text
stringlengths 12
1.05M
| repo_name
stringlengths 5
86
| path
stringlengths 4
191
| language
stringclasses 1
value | license
stringclasses 15
values | size
int32 12
1.05M
| keyword
listlengths 1
23
| text_hash
stringlengths 64
64
|
|---|---|---|---|---|---|---|---|
#!/usr/bin/python
# Copyright (C) 2012,2013,2014,2015,2016 The ESPResSo project
# Copyright (C) 2011 Olaf Lenz
# Copyright 2008 Marcus D. Hanwell <marcus@cryos.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 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 __future__ import print_function
import string, re, os
# Execute git log with the desired command line options.
fin = os.popen('git log --summary --stat --no-merges --date=short 3.0.1..', 'r')
# Set up the loop variables in order to locate the blocks we want
authorFound = False
dateFound = False
messageFound = False
filesFound = False
message = ""
messageNL = False
files = ""
prevAuthorLine = ""
commitId = ""
# The main part of the loop
for line in fin:
# The commit line marks the start of a new commit object.
m = re.match('^commit (.*)$', line)
if m is not None:
commitId = m.group(1)
# Start all over again...
authorFound = False
dateFound = False
messageFound = False
messageNL = False
message = ""
filesFound = False
files = ""
continue
# Match the author line and extract the part we want
m = re.match('^Author:\s*(.*)\s*$', line)
if m is not None:
author = m.group(1)
authorFound = True
continue
# Match the date line
m = re.match('^Date:\s*(.*)\s*$', line)
if m is not None:
date = m.group(1)
dateFound = True
continue
# The svn-id lines are ignored
# The sign off line is ignored too
if re.search('git-svn-id:|^Signed-off-by', line) >= 0:
continue
# Extract the actual commit message for this commit
if not (authorFound & dateFound & messageFound):
# Find the commit message if we can
if len(line) == 1:
if messageNL:
messageFound = True
else:
messageNL = True
elif len(line) == 4:
messageFound = True
else:
if len(message) == 0:
message = message + line.strip()
else:
message = message + " " + line.strip()
# If this line is hit all of the files have been stored for this commit
if re.search('files changed', line) >= 0:
filesFound = True
continue
# Collect the files for this commit. FIXME: Still need to add +/- to files
elif authorFound & dateFound & messageFound:
fileList = re.split(' \| ', line, 2)
if len(fileList) > 1:
if len(files) > 0:
files = files + ", " + fileList[0].strip()
else:
files = fileList[0].strip()
# All of the parts of the commit have been found - write out the entry
if authorFound & dateFound & messageFound & filesFound:
# First the author line, only outputted if it is the first for that
# author on this day
authorLine = date + " " + author
if len(prevAuthorLine) == 0:
print(authorLine)
elif authorLine == prevAuthorLine:
pass
else:
print(("\n" + authorLine))
# Assemble the actual commit message line(s) and limit the line length
# to 80 characters.
commitLine = "* " + files + ": " + message
i = 0
commit = ""
while i < len(commitLine):
if len(commitLine) < i + 78:
commit = commit + "\n " + commitLine[i:len(commitLine)]
break
index = commitLine.rfind(' ', i, i+78)
if index > i:
commit = commit + "\n " + commitLine[i:index]
i = index+1
else:
commit = commit + "\n " + commitLine[i:78]
i = i+79
# Write out the commit line
print(commit)
#Now reset all the variables ready for a new commit block.
authorFound = False
dateFound = False
messageFound = False
messageNL = False
message = ""
filesFound = False
files = ""
commitId = ""
prevAuthorLine = authorLine
# Close the input and output lines now that we are finished.
fin.close()
|
Marcello-Sega/espresso
|
maintainer/git2changelog.py
|
Python
|
gpl-3.0
| 4,736
|
[
"ESPResSo"
] |
4773e48bd229e348b7121bb9893920a653ce7dc5caf326c5669159e6055bc096
|
#!/usr/bin/env python
"""
This file provides a more advanced example of vtkTable access and
manipulation methods.
"""
from vtk import *
#------------------------------------------------------------------------------
# Script Entry Point (i.e., main() )
#------------------------------------------------------------------------------
if __name__ == "__main__":
""" Main entry point of this python script """
print "vtkTable Example 4: Accessing vtkTable data elements"
# Load our table from a CSV file (covered in table2.py)
csv_source = vtkDelimitedTextReader()
csv_source.SetFieldDelimiterCharacters(",")
csv_source.SetHaveHeaders(True)
csv_source.SetFileName("table_data.csv")
csv_source.Update()
csv_source.GetOutput().Dump(6)
T = csv_source.GetOutput()
# Print some information about the table
print "Number of Columns =", T.GetNumberOfColumns()
print "Number of Rows =", T.GetNumberOfRows()
print "Get column 1, row 4 data: ", T.GetColumn(1).GetValue(4)
# Add a new row to the table
new_row = [8, "Luis", 68]
for i in range( T.GetNumberOfColumns()):
T.GetColumn(i).InsertNextValue( str(new_row[i]) )
print "Table after new row appenended:"
T.Dump(6)
print "vtkTable Example 4: Finished."
|
timkrentz/SunTracker
|
IMU/VTK-6.2.0/Examples/Infovis/Python/tables4.py
|
Python
|
mit
| 1,331
|
[
"VTK"
] |
08fd600c1cd0138972ca71c78609c0b0f1b2f6fd4972deb64b3332772977b135
|
from __future__ import absolute_import
from typing import Any, DefaultDict, Dict, List, Set, Tuple, TypeVar, Text, \
Union, Optional, Sequence, AbstractSet, Pattern, AnyStr
from typing.re import Match
from zerver.lib.str_utils import NonBinaryStr
from django.db import models
from django.db.models.query import QuerySet
from django.db.models import Manager
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, UserManager, \
PermissionsMixin
import django.contrib.auth
from django.core.exceptions import ValidationError
from django.core.validators import URLValidator
from django.dispatch import receiver
from zerver.lib.cache import cache_with_key, flush_user_profile, flush_realm, \
user_profile_by_id_cache_key, user_profile_by_email_cache_key, \
generic_bulk_cached_fetch, cache_set, flush_stream, \
display_recipient_cache_key, cache_delete, \
get_stream_cache_key, active_user_dicts_in_realm_cache_key, \
bot_dicts_in_realm_cache_key, active_user_dict_fields, \
bot_dict_fields, flush_message
from zerver.lib.utils import make_safe_digest, generate_random_token
from zerver.lib.str_utils import ModelReprMixin
from django.db import transaction
from zerver.lib.camo import get_camo_url
from django.utils import timezone
from django.contrib.sessions.models import Session
from zerver.lib.timestamp import datetime_to_timestamp
from django.db.models.signals import pre_save, post_save, post_delete
from django.core.validators import MinLengthValidator, RegexValidator
from django.utils.translation import ugettext_lazy as _
from zerver.lib import cache
from bitfield import BitField
from bitfield.types import BitHandler
from collections import defaultdict
from datetime import timedelta
import pylibmc
import re
import logging
import sre_constants
import time
import datetime
MAX_SUBJECT_LENGTH = 60
MAX_MESSAGE_LENGTH = 10000
MAX_LANGUAGE_ID_LENGTH = 50 # type: int
STREAM_NAMES = TypeVar('STREAM_NAMES', Sequence[Text], AbstractSet[Text])
# Doing 1000 remote cache requests to get_display_recipient is quite slow,
# so add a local cache as well as the remote cache cache.
per_request_display_recipient_cache = {} # type: Dict[int, List[Dict[str, Any]]]
def get_display_recipient_by_id(recipient_id, recipient_type, recipient_type_id):
# type: (int, int, int) -> Union[Text, List[Dict[str, Any]]]
if recipient_id not in per_request_display_recipient_cache:
result = get_display_recipient_remote_cache(recipient_id, recipient_type, recipient_type_id)
per_request_display_recipient_cache[recipient_id] = result
return per_request_display_recipient_cache[recipient_id]
def get_display_recipient(recipient):
# type: (Recipient) -> Union[Text, List[Dict[str, Any]]]
return get_display_recipient_by_id(
recipient.id,
recipient.type,
recipient.type_id
)
def flush_per_request_caches():
# type: () -> None
global per_request_display_recipient_cache
per_request_display_recipient_cache = {}
global per_request_realm_filters_cache
per_request_realm_filters_cache = {}
@cache_with_key(lambda *args: display_recipient_cache_key(args[0]),
timeout=3600*24*7)
def get_display_recipient_remote_cache(recipient_id, recipient_type, recipient_type_id):
# type: (int, int, int) -> Union[Text, List[Dict[str, Any]]]
"""
returns: an appropriate object describing the recipient. For a
stream this will be the stream name as a string. For a huddle or
personal, it will be an array of dicts about each recipient.
"""
if recipient_type == Recipient.STREAM:
stream = Stream.objects.get(id=recipient_type_id)
return stream.name
# We don't really care what the ordering is, just that it's deterministic.
user_profile_list = (UserProfile.objects.filter(subscription__recipient_id=recipient_id)
.select_related()
.order_by('email'))
return [{'email': user_profile.email,
'domain': user_profile.realm.domain,
'full_name': user_profile.full_name,
'short_name': user_profile.short_name,
'id': user_profile.id,
'is_mirror_dummy': user_profile.is_mirror_dummy} for user_profile in user_profile_list]
def get_realm_emoji_cache_key(realm):
# type: (Realm) -> Text
return u'realm_emoji:%s' % (realm.id,)
class Realm(ModelReprMixin, models.Model):
# domain is a domain in the Internet sense. It must be structured like a
# valid email domain. We use is to restrict access, identify bots, etc.
domain = models.CharField(max_length=40, db_index=True, unique=True) # type: Text
# name is the user-visible identifier for the realm. It has no required
# structure.
AUTHENTICATION_FLAGS = [u'Google', u'Email', u'GitHub', u'LDAP', u'Dev', u'RemoteUser']
name = models.CharField(max_length=40, null=True) # type: Optional[Text]
string_id = models.CharField(max_length=40, unique=True) # type: Text
restricted_to_domain = models.BooleanField(default=False) # type: bool
invite_required = models.BooleanField(default=True) # type: bool
invite_by_admins_only = models.BooleanField(default=False) # type: bool
inline_image_preview = models.BooleanField(default=True) # type: bool
inline_url_embed_preview = models.BooleanField(default=True) # type: bool
create_stream_by_admins_only = models.BooleanField(default=False) # type: bool
add_emoji_by_admins_only = models.BooleanField(default=False) # type: bool
mandatory_topics = models.BooleanField(default=False) # type: bool
show_digest_email = models.BooleanField(default=True) # type: bool
name_changes_disabled = models.BooleanField(default=False) # type: bool
email_changes_disabled = models.BooleanField(default=False) # type: bool
description = models.TextField(max_length=100, null=True) # type: Optional[Text]
allow_message_editing = models.BooleanField(default=True) # type: bool
DEFAULT_MESSAGE_CONTENT_EDIT_LIMIT_SECONDS = 600 # if changed, also change in admin.js
message_content_edit_limit_seconds = models.IntegerField(default=DEFAULT_MESSAGE_CONTENT_EDIT_LIMIT_SECONDS) # type: int
message_retention_days = models.IntegerField(null=True) # type: Optional[int]
# Valid org_types are {CORPORATE, COMMUNITY}
CORPORATE = 1
COMMUNITY = 2
org_type = models.PositiveSmallIntegerField(default=COMMUNITY) # type: int
date_created = models.DateTimeField(default=timezone.now) # type: datetime.datetime
notifications_stream = models.ForeignKey('Stream', related_name='+', null=True, blank=True) # type: Optional[Stream]
deactivated = models.BooleanField(default=False) # type: bool
default_language = models.CharField(default=u'en', max_length=MAX_LANGUAGE_ID_LENGTH) # type: Text
authentication_methods = BitField(flags=AUTHENTICATION_FLAGS,
default=2**31 - 1) # type: BitHandler
waiting_period_threshold = models.PositiveIntegerField(default=0) # type: int
# Define the types of the various automatically managed properties
property_types = dict(
add_emoji_by_admins_only=bool,
create_stream_by_admins_only=bool,
default_language=Text,
description=Text,
email_changes_disabled=bool,
invite_required=bool,
invite_by_admins_only=bool,
inline_image_preview=bool,
inline_url_embed_preview=bool,
name=Text,
name_changes_disabled=bool,
restricted_to_domain=bool,
waiting_period_threshold=int,
)
ICON_FROM_GRAVATAR = u'G'
ICON_UPLOADED = u'U'
ICON_SOURCES = (
(ICON_FROM_GRAVATAR, 'Hosted by Gravatar'),
(ICON_UPLOADED, 'Uploaded by administrator'),
)
icon_source = models.CharField(default=ICON_FROM_GRAVATAR, choices=ICON_SOURCES,
max_length=1) # type: Text
icon_version = models.PositiveSmallIntegerField(default=1) # type: int
DEFAULT_NOTIFICATION_STREAM_NAME = u'announce'
def authentication_methods_dict(self):
# type: () -> Dict[Text, bool]
"""Returns the a mapping from authentication flags to their status,
showing only those authentication flags that are supported on
the current server (i.e. if EmailAuthBackend is not configured
on the server, this will not return an entry for "Email")."""
# This mapping needs to be imported from here due to the cyclic
# dependency.
from zproject.backends import AUTH_BACKEND_NAME_MAP
ret = {} # type: Dict[Text, bool]
supported_backends = {backend.__class__ for backend in django.contrib.auth.get_backends()}
for k, v in self.authentication_methods.iteritems():
backend = AUTH_BACKEND_NAME_MAP[k]
if backend in supported_backends:
ret[k] = v
return ret
def __unicode__(self):
# type: () -> Text
return u"<Realm: %s %s>" % (self.string_id, self.id)
@cache_with_key(get_realm_emoji_cache_key, timeout=3600*24*7)
def get_emoji(self):
# type: () -> Dict[Text, Optional[Dict[str, Text]]]
return get_realm_emoji_uncached(self)
def get_admin_users(self):
# type: () -> Sequence[UserProfile]
# TODO: Change return type to QuerySet[UserProfile]
return UserProfile.objects.filter(realm=self, is_realm_admin=True,
is_active=True).select_related()
def get_active_users(self):
# type: () -> Sequence[UserProfile]
# TODO: Change return type to QuerySet[UserProfile]
return UserProfile.objects.filter(realm=self, is_active=True).select_related()
def get_bot_domain(self):
# type: () -> str
# Remove the port. Mainly needed for development environment.
external_host = settings.EXTERNAL_HOST.split(':')[0]
if settings.REALMS_HAVE_SUBDOMAINS or \
Realm.objects.filter(deactivated=False) \
.exclude(string_id__in=settings.SYSTEM_ONLY_REALMS).count() > 1:
return "%s.%s" % (self.string_id, external_host)
return external_host
@property
def subdomain(self):
# type: () -> Optional[Text]
if settings.REALMS_HAVE_SUBDOMAINS:
return self.string_id
return None
@property
def uri(self):
# type: () -> str
if settings.REALMS_HAVE_SUBDOMAINS and self.subdomain is not None:
return '%s%s.%s' % (settings.EXTERNAL_URI_SCHEME,
self.subdomain, settings.EXTERNAL_HOST)
return settings.SERVER_URI
@property
def host(self):
# type: () -> str
if settings.REALMS_HAVE_SUBDOMAINS and self.subdomain is not None:
return "%s.%s" % (self.subdomain, settings.EXTERNAL_HOST)
return settings.EXTERNAL_HOST
@property
def is_zephyr_mirror_realm(self):
# type: () -> bool
return self.string_id == "zephyr"
@property
def webathena_enabled(self):
# type: () -> bool
return self.is_zephyr_mirror_realm
@property
def presence_disabled(self):
# type: () -> bool
return self.is_zephyr_mirror_realm
class Meta(object):
permissions = (
('administer', "Administer a realm"),
('api_super_user', "Can send messages as other users for mirroring"),
)
post_save.connect(flush_realm, sender=Realm)
def get_realm(string_id):
# type: (Text) -> Realm
return Realm.objects.filter(string_id=string_id).first()
def completely_open(realm):
# type: (Realm) -> bool
# This realm is completely open to everyone on the internet to
# join. E-mail addresses do not need to match a realmalias and
# an invite from an existing user is not required.
if not realm:
return False
return not realm.invite_required and not realm.restricted_to_domain
def get_unique_open_realm():
# type: () -> Optional[Realm]
"""We only return a realm if there is a unique non-system-only realm,
it is completely open, and there are no subdomains."""
if settings.REALMS_HAVE_SUBDOMAINS:
return None
realms = Realm.objects.filter(deactivated=False)
# On production installations, the (usually "zulip.com") system
# realm is an empty realm just used for system bots, so don't
# include it in this accounting.
realms = realms.exclude(string_id__in=settings.SYSTEM_ONLY_REALMS)
if len(realms) != 1:
return None
realm = realms[0]
if realm.invite_required or realm.restricted_to_domain:
return None
return realm
def name_changes_disabled(realm):
# type: (Optional[Realm]) -> bool
if realm is None:
return settings.NAME_CHANGES_DISABLED
return settings.NAME_CHANGES_DISABLED or realm.name_changes_disabled
class RealmAlias(models.Model):
realm = models.ForeignKey(Realm) # type: Realm
# should always be stored lowercase
domain = models.CharField(max_length=80, db_index=True) # type: Text
allow_subdomains = models.BooleanField(default=False)
class Meta(object):
unique_together = ("realm", "domain")
def can_add_alias(domain):
# type: (Text) -> bool
if settings.REALMS_HAVE_SUBDOMAINS:
return True
if RealmAlias.objects.filter(domain=domain).exists():
return False
return True
# These functions should only be used on email addresses that have
# been validated via django.core.validators.validate_email
#
# Note that we need to use some care, since can you have multiple @-signs; e.g.
# "tabbott@test"@zulip.com
# is valid email address
def email_to_username(email):
# type: (Text) -> Text
return "@".join(email.split("@")[:-1]).lower()
# Returns the raw domain portion of the desired email address
def email_to_domain(email):
# type: (Text) -> Text
return email.split("@")[-1].lower()
class GetRealmByDomainException(Exception):
pass
def get_realm_by_email_domain(email):
# type: (Text) -> Optional[Realm]
if settings.REALMS_HAVE_SUBDOMAINS:
raise GetRealmByDomainException(
"Cannot get realm from email domain when settings.REALMS_HAVE_SUBDOMAINS = True")
domain = email_to_domain(email)
query = RealmAlias.objects.select_related('realm')
# Search for the longest match. If found return immediately. Since in case of
# settings.REALMS_HAVE_SUBDOMAINS=True, we have a unique mapping between the
# realm and domain so don't worry about `allow_subdomains` being True or False.
alias = query.filter(domain=domain).first()
if alias is not None:
return alias.realm
else:
# Since we have not found any match. We will now try matching the parent domain.
# Filter out the realm domains with `allow_subdomains=False` so that we don't end
# up matching 'test.zulip.com' wrongly to (realm, 'zulip.com', False).
query = query.filter(allow_subdomains=True)
while len(domain) > 0:
subdomain, sep, domain = domain.partition('.')
alias = query.filter(domain=domain).first()
if alias is not None:
return alias.realm
return None
# Is a user with the given email address allowed to be in the given realm?
# (This function does not check whether the user has been invited to the realm.
# So for invite-only realms, this is the test for whether a user can be invited,
# not whether the user can sign up currently.)
def email_allowed_for_realm(email, realm):
# type: (Text, Realm) -> bool
if not realm.restricted_to_domain:
return True
domain = email_to_domain(email)
query = RealmAlias.objects.filter(realm=realm)
if query.filter(domain=domain).exists():
return True
else:
query = query.filter(allow_subdomains=True)
while len(domain) > 0:
subdomain, sep, domain = domain.partition('.')
if query.filter(domain=domain).exists():
return True
return False
def list_of_domains_for_realm(realm):
# type: (Realm) -> List[Dict[str, Union[str, bool]]]
return list(RealmAlias.objects.filter(realm=realm).values('domain', 'allow_subdomains'))
class RealmEmoji(ModelReprMixin, models.Model):
author = models.ForeignKey('UserProfile', blank=True, null=True)
realm = models.ForeignKey(Realm) # type: Realm
# Second part of the regex (negative lookbehind) disallows names ending with one of the punctuation characters
name = models.TextField(validators=[MinLengthValidator(1),
RegexValidator(regex=r'^[0-9a-zA-Z.\-_]+(?<![.\-_])$',
message=_("Invalid characters in emoji name"))]) # type: Text
# URLs start having browser compatibility problem below 2000
# characters, so 1000 seems like a safe limit.
img_url = models.URLField(max_length=1000) # type: Text
class Meta(object):
unique_together = ("realm", "name")
def __unicode__(self):
# type: () -> Text
return u"<RealmEmoji(%s): %s %s>" % (self.realm.string_id, self.name, self.img_url)
def get_realm_emoji_uncached(realm):
# type: (Realm) -> Dict[Text, Optional[Dict[str, Text]]]
d = {}
for row in RealmEmoji.objects.filter(realm=realm).select_related('author'):
if row.author:
author = {
'id': row.author.id,
'email': row.author.email,
'full_name': row.author.full_name}
else:
author = None
d[row.name] = dict(source_url=row.img_url,
display_url=get_camo_url(row.img_url),
author=author)
return d
def flush_realm_emoji(sender, **kwargs):
# type: (Any, **Any) -> None
realm = kwargs['instance'].realm
cache_set(get_realm_emoji_cache_key(realm),
get_realm_emoji_uncached(realm),
timeout=3600*24*7)
post_save.connect(flush_realm_emoji, sender=RealmEmoji)
post_delete.connect(flush_realm_emoji, sender=RealmEmoji)
def filter_pattern_validator(value):
# type: (Text) -> None
regex = re.compile(r'(?:[\w\-#]*)(\(\?P<\w+>.+\))')
error_msg = 'Invalid filter pattern, you must use the following format OPTIONAL_PREFIX(?P<id>.+)'
if not regex.match(str(value)):
raise ValidationError(error_msg)
try:
re.compile(value)
except sre_constants.error:
# Regex is invalid
raise ValidationError(error_msg)
def filter_format_validator(value):
# type: (str) -> None
regex = re.compile(r'^[\.\/:a-zA-Z0-9_-]+%\(([a-zA-Z0-9_-]+)\)s[a-zA-Z0-9_-]*$')
if not regex.match(value):
raise ValidationError('URL format string must be in the following format: `https://example.com/%(\w+)s`')
class RealmFilter(models.Model):
realm = models.ForeignKey(Realm) # type: Realm
pattern = models.TextField(validators=[filter_pattern_validator]) # type: Text
url_format_string = models.TextField(validators=[URLValidator, filter_format_validator]) # type: Text
class Meta(object):
unique_together = ("realm", "pattern")
def __unicode__(self):
# type: () -> Text
return u"<RealmFilter(%s): %s %s>" % (self.realm.string_id, self.pattern, self.url_format_string)
def get_realm_filters_cache_key(realm_id):
# type: (int) -> Text
return u'all_realm_filters:%s' % (realm_id,)
# We have a per-process cache to avoid doing 1000 remote cache queries during page load
per_request_realm_filters_cache = {} # type: Dict[int, List[Tuple[Text, Text, int]]]
def realm_in_local_realm_filters_cache(realm_id):
# type: (int) -> bool
return realm_id in per_request_realm_filters_cache
def realm_filters_for_realm(realm_id):
# type: (int) -> List[Tuple[Text, Text, int]]
if not realm_in_local_realm_filters_cache(realm_id):
per_request_realm_filters_cache[realm_id] = realm_filters_for_realm_remote_cache(realm_id)
return per_request_realm_filters_cache[realm_id]
@cache_with_key(get_realm_filters_cache_key, timeout=3600*24*7)
def realm_filters_for_realm_remote_cache(realm_id):
# type: (int) -> List[Tuple[Text, Text, int]]
filters = []
for realm_filter in RealmFilter.objects.filter(realm_id=realm_id):
filters.append((realm_filter.pattern, realm_filter.url_format_string, realm_filter.id))
return filters
def all_realm_filters():
# type: () -> Dict[int, List[Tuple[Text, Text, int]]]
filters = defaultdict(list) # type: DefaultDict[int, List[Tuple[Text, Text, int]]]
for realm_filter in RealmFilter.objects.all():
filters[realm_filter.realm_id].append((realm_filter.pattern, realm_filter.url_format_string, realm_filter.id))
return filters
def flush_realm_filter(sender, **kwargs):
# type: (Any, **Any) -> None
realm_id = kwargs['instance'].realm_id
cache_delete(get_realm_filters_cache_key(realm_id))
try:
per_request_realm_filters_cache.pop(realm_id)
except KeyError:
pass
post_save.connect(flush_realm_filter, sender=RealmFilter)
post_delete.connect(flush_realm_filter, sender=RealmFilter)
class UserProfile(ModelReprMixin, AbstractBaseUser, PermissionsMixin):
DEFAULT_BOT = 1
"""
Incoming webhook bots are limited to only sending messages via webhooks.
Thus, it is less of a security risk to expose their API keys to third-party services,
since they can't be used to read messages.
"""
INCOMING_WEBHOOK_BOT = 2
# Fields from models.AbstractUser minus last_name and first_name,
# which we don't use; email is modified to make it indexed and unique.
email = models.EmailField(blank=False, db_index=True, unique=True) # type: Text
is_staff = models.BooleanField(default=False) # type: bool
is_active = models.BooleanField(default=True, db_index=True) # type: bool
is_realm_admin = models.BooleanField(default=False, db_index=True) # type: bool
is_bot = models.BooleanField(default=False, db_index=True) # type: bool
bot_type = models.PositiveSmallIntegerField(null=True, db_index=True) # type: Optional[int]
is_api_super_user = models.BooleanField(default=False, db_index=True) # type: bool
date_joined = models.DateTimeField(default=timezone.now) # type: datetime.datetime
is_mirror_dummy = models.BooleanField(default=False) # type: bool
bot_owner = models.ForeignKey('self', null=True, on_delete=models.SET_NULL) # type: Optional[UserProfile]
USERNAME_FIELD = 'email'
MAX_NAME_LENGTH = 100
NAME_INVALID_CHARS = ['*', '`', '>', '"', '@']
# Our custom site-specific fields
full_name = models.CharField(max_length=MAX_NAME_LENGTH) # type: Text
short_name = models.CharField(max_length=MAX_NAME_LENGTH) # type: Text
# pointer points to Message.id, NOT UserMessage.id.
pointer = models.IntegerField() # type: int
last_pointer_updater = models.CharField(max_length=64) # type: Text
realm = models.ForeignKey(Realm) # type: Realm
api_key = models.CharField(max_length=32) # type: Text
tos_version = models.CharField(null=True, max_length=10) # type: Text
### Notifications settings. ###
# Stream notifications.
enable_stream_desktop_notifications = models.BooleanField(default=False) # type: bool
enable_stream_sounds = models.BooleanField(default=False) # type: bool
# PM + @-mention notifications.
enable_desktop_notifications = models.BooleanField(default=True) # type: bool
pm_content_in_desktop_notifications = models.BooleanField(default=True) # type: bool
enable_sounds = models.BooleanField(default=True) # type: bool
enable_offline_email_notifications = models.BooleanField(default=True) # type: bool
enable_offline_push_notifications = models.BooleanField(default=True) # type: bool
enable_online_push_notifications = models.BooleanField(default=False) # type: bool
enable_digest_emails = models.BooleanField(default=True) # type: bool
# Old notification field superseded by existence of stream notification
# settings.
default_desktop_notifications = models.BooleanField(default=True) # type: bool
###
last_reminder = models.DateTimeField(default=timezone.now, null=True) # type: Optional[datetime.datetime]
rate_limits = models.CharField(default=u"", max_length=100) # type: Text # comma-separated list of range:max pairs
# Default streams
default_sending_stream = models.ForeignKey('zerver.Stream', null=True, related_name='+') # type: Optional[Stream]
default_events_register_stream = models.ForeignKey('zerver.Stream', null=True, related_name='+') # type: Optional[Stream]
default_all_public_streams = models.BooleanField(default=False) # type: bool
# UI vars
enter_sends = models.NullBooleanField(default=False) # type: Optional[bool]
autoscroll_forever = models.BooleanField(default=False) # type: bool
left_side_userlist = models.BooleanField(default=False) # type: bool
emoji_alt_code = models.BooleanField(default=False) # type: bool
# display settings
twenty_four_hour_time = models.BooleanField(default=False) # type: bool
default_language = models.CharField(default=u'en', max_length=MAX_LANGUAGE_ID_LENGTH) # type: Text
# Hours to wait before sending another email to a user
EMAIL_REMINDER_WAITPERIOD = 24
# Minutes to wait before warning a bot owner that her bot sent a message
# to a nonexistent stream
BOT_OWNER_STREAM_ALERT_WAITPERIOD = 1
AVATAR_FROM_GRAVATAR = u'G'
AVATAR_FROM_USER = u'U'
AVATAR_SOURCES = (
(AVATAR_FROM_GRAVATAR, 'Hosted by Gravatar'),
(AVATAR_FROM_USER, 'Uploaded by user'),
)
avatar_source = models.CharField(default=AVATAR_FROM_GRAVATAR, choices=AVATAR_SOURCES, max_length=1) # type: Text
avatar_version = models.PositiveSmallIntegerField(default=1) # type: int
TUTORIAL_WAITING = u'W'
TUTORIAL_STARTED = u'S'
TUTORIAL_FINISHED = u'F'
TUTORIAL_STATES = ((TUTORIAL_WAITING, "Waiting"),
(TUTORIAL_STARTED, "Started"),
(TUTORIAL_FINISHED, "Finished"))
tutorial_status = models.CharField(default=TUTORIAL_WAITING, choices=TUTORIAL_STATES, max_length=1) # type: Text
# Contains serialized JSON of the form:
# [("step 1", true), ("step 2", false)]
# where the second element of each tuple is if the step has been
# completed.
onboarding_steps = models.TextField(default=u'[]') # type: Text
invites_granted = models.IntegerField(default=0) # type: int
invites_used = models.IntegerField(default=0) # type: int
alert_words = models.TextField(default=u'[]') # type: Text # json-serialized list of strings
# Contains serialized JSON of the form:
# [["social", "mit"], ["devel", "ios"]]
muted_topics = models.TextField(default=u'[]') # type: Text
objects = UserManager() # type: UserManager
DEFAULT_UPLOADS_QUOTA = 1024*1024*1024
quota = models.IntegerField(default=DEFAULT_UPLOADS_QUOTA) # type: int
# The maximum length of a timezone in pytz.all_timezones is 32.
# Setting max_length=40 is a safe choice.
# In Django, the convention is to use empty string instead of Null
# for text based fields. For more information, see
# https://docs.djangoproject.com/en/1.10/ref/models/fields/#django.db.models.Field.null.
timezone = models.CharField(max_length=40, default=u'') # type: Text
def can_admin_user(self, target_user):
# type: (UserProfile) -> bool
"""Returns whether this user has permission to modify target_user"""
if target_user.bot_owner == self:
return True
elif self.is_realm_admin and self.realm == target_user.realm:
return True
else:
return False
def __unicode__(self):
# type: () -> Text
return u"<UserProfile: %s %s>" % (self.email, self.realm)
@property
def is_incoming_webhook(self):
# type: () -> bool
return self.bot_type == UserProfile.INCOMING_WEBHOOK_BOT
@staticmethod
def emails_from_ids(user_ids):
# type: (Sequence[int]) -> Dict[int, Text]
rows = UserProfile.objects.filter(id__in=user_ids).values('id', 'email')
return {row['id']: row['email'] for row in rows}
def can_create_streams(self):
# type: () -> bool
diff = (timezone.now() - self.date_joined).days
if self.is_realm_admin:
return True
elif self.realm.create_stream_by_admins_only:
return False
if diff >= self.realm.waiting_period_threshold:
return True
return False
def major_tos_version(self):
# type: () -> int
if self.tos_version is not None:
return int(self.tos_version.split('.')[0])
else:
return -1
def receives_offline_notifications(user_profile):
# type: (UserProfile) -> bool
return ((user_profile.enable_offline_email_notifications or
user_profile.enable_offline_push_notifications) and
not user_profile.is_bot)
def receives_online_notifications(user_profile):
# type: (UserProfile) -> bool
return (user_profile.enable_online_push_notifications and
not user_profile.is_bot)
def remote_user_to_email(remote_user):
# type: (Text) -> Text
if settings.SSO_APPEND_DOMAIN is not None:
remote_user += "@" + settings.SSO_APPEND_DOMAIN
return remote_user
# Make sure we flush the UserProfile object from our remote cache
# whenever we save it.
post_save.connect(flush_user_profile, sender=UserProfile)
class PreregistrationUser(models.Model):
email = models.EmailField() # type: Text
referred_by = models.ForeignKey(UserProfile, null=True) # Optional[UserProfile]
streams = models.ManyToManyField('Stream') # type: Manager
invited_at = models.DateTimeField(auto_now=True) # type: datetime.datetime
realm_creation = models.BooleanField(default=False)
# status: whether an object has been confirmed.
# if confirmed, set to confirmation.settings.STATUS_ACTIVE
status = models.IntegerField(default=0) # type: int
realm = models.ForeignKey(Realm, null=True) # type: Optional[Realm]
class EmailChangeStatus(models.Model):
new_email = models.EmailField() # type: Text
old_email = models.EmailField() # type: Text
updated_at = models.DateTimeField(auto_now=True) # type: datetime.datetime
user_profile = models.ForeignKey(UserProfile) # type: UserProfile
# status: whether an object has been confirmed.
# if confirmed, set to confirmation.settings.STATUS_ACTIVE
status = models.IntegerField(default=0) # type: int
realm = models.ForeignKey(Realm) # type: Realm
class PushDeviceToken(models.Model):
APNS = 1
GCM = 2
KINDS = (
(APNS, 'apns'),
(GCM, 'gcm'),
)
kind = models.PositiveSmallIntegerField(choices=KINDS) # type: int
# The token is a unique device-specific token that is
# sent to us from each device:
# - APNS token if kind == APNS
# - GCM registration id if kind == GCM
token = models.CharField(max_length=4096, unique=True) # type: bytes
last_updated = models.DateTimeField(auto_now=True) # type: datetime.datetime
# The user who's device this is
user = models.ForeignKey(UserProfile, db_index=True) # type: UserProfile
# [optional] Contains the app id of the device if it is an iOS device
ios_app_id = models.TextField(null=True) # type: Optional[Text]
def generate_email_token_for_stream():
# type: () -> Text
return generate_random_token(32)
class Stream(ModelReprMixin, models.Model):
MAX_NAME_LENGTH = 60
name = models.CharField(max_length=MAX_NAME_LENGTH, db_index=True) # type: Text
realm = models.ForeignKey(Realm, db_index=True) # type: Realm
invite_only = models.NullBooleanField(default=False) # type: Optional[bool]
# Used by the e-mail forwarder. The e-mail RFC specifies a maximum
# e-mail length of 254, and our max stream length is 30, so we
# have plenty of room for the token.
email_token = models.CharField(
max_length=32, default=generate_email_token_for_stream) # type: Text
description = models.CharField(max_length=1024, default=u'') # type: Text
date_created = models.DateTimeField(default=timezone.now) # type: datetime.datetime
deactivated = models.BooleanField(default=False) # type: bool
def __unicode__(self):
# type: () -> Text
return u"<Stream: %s>" % (self.name,)
def is_public(self):
# type: () -> bool
# All streams are private in Zephyr mirroring realms.
return not self.invite_only and not self.realm.is_zephyr_mirror_realm
class Meta(object):
unique_together = ("name", "realm")
def num_subscribers(self):
# type: () -> int
return Subscription.objects.filter(
recipient__type=Recipient.STREAM,
recipient__type_id=self.id,
user_profile__is_active=True,
active=True
).count()
# This is stream information that is sent to clients
def to_dict(self):
# type: () -> Dict[str, Any]
return dict(name=self.name,
stream_id=self.id,
description=self.description,
invite_only=self.invite_only)
post_save.connect(flush_stream, sender=Stream)
post_delete.connect(flush_stream, sender=Stream)
# The Recipient table is used to map Messages to the set of users who
# received the message. It is implemented as a set of triples (id,
# type_id, type). We have 3 types of recipients: Huddles (for group
# private messages), UserProfiles (for 1:1 private messages), and
# Streams. The recipient table maps a globally unique recipient id
# (used by the Message table) to the type-specific unique id (the
# stream id, user_profile id, or huddle id).
class Recipient(ModelReprMixin, models.Model):
type_id = models.IntegerField(db_index=True) # type: int
type = models.PositiveSmallIntegerField(db_index=True) # type: int
# Valid types are {personal, stream, huddle}
PERSONAL = 1
STREAM = 2
HUDDLE = 3
class Meta(object):
unique_together = ("type", "type_id")
# N.B. If we used Django's choice=... we would get this for free (kinda)
_type_names = {
PERSONAL: 'personal',
STREAM: 'stream',
HUDDLE: 'huddle'}
def type_name(self):
# type: () -> str
# Raises KeyError if invalid
return self._type_names[self.type]
def __unicode__(self):
# type: () -> Text
display_recipient = get_display_recipient(self)
return u"<Recipient: %s (%d, %s)>" % (display_recipient, self.type_id, self.type)
class Client(ModelReprMixin, models.Model):
name = models.CharField(max_length=30, db_index=True, unique=True) # type: Text
def __unicode__(self):
# type: () -> Text
return u"<Client: %s>" % (self.name,)
get_client_cache = {} # type: Dict[Text, Client]
def get_client(name):
# type: (Text) -> Client
# Accessing KEY_PREFIX through the module is necessary
# because we need the updated value of the variable.
cache_name = cache.KEY_PREFIX + name
if cache_name not in get_client_cache:
result = get_client_remote_cache(name)
get_client_cache[cache_name] = result
return get_client_cache[cache_name]
def get_client_cache_key(name):
# type: (Text) -> Text
return u'get_client:%s' % (make_safe_digest(name),)
@cache_with_key(get_client_cache_key, timeout=3600*24*7)
def get_client_remote_cache(name):
# type: (Text) -> Client
(client, _) = Client.objects.get_or_create(name=name)
return client
# get_stream_backend takes either a realm id or a realm
@cache_with_key(get_stream_cache_key, timeout=3600*24*7)
def get_stream_backend(stream_name, realm):
# type: (Text, Realm) -> Stream
return Stream.objects.select_related("realm").get(
name__iexact=stream_name.strip(), realm_id=realm.id)
def get_active_streams(realm):
# type: (Realm) -> QuerySet
"""
Return all streams (including invite-only streams) that have not been deactivated.
"""
return Stream.objects.filter(realm=realm, deactivated=False)
def get_stream(stream_name, realm):
# type: (Text, Realm) -> Stream
return get_stream_backend(stream_name, realm)
def bulk_get_streams(realm, stream_names):
# type: (Realm, STREAM_NAMES) -> Dict[Text, Any]
def fetch_streams_by_name(stream_names):
# type: (List[Text]) -> Sequence[Stream]
#
# This should be just
#
# Stream.objects.select_related("realm").filter(name__iexact__in=stream_names,
# realm_id=realm_id)
#
# But chaining __in and __iexact doesn't work with Django's
# ORM, so we have the following hack to construct the relevant where clause
if len(stream_names) == 0:
return []
upper_list = ", ".join(["UPPER(%s)"] * len(stream_names))
where_clause = "UPPER(zerver_stream.name::text) IN (%s)" % (upper_list,)
return get_active_streams(realm.id).select_related("realm").extra(
where=[where_clause],
params=stream_names)
return generic_bulk_cached_fetch(lambda stream_name: get_stream_cache_key(stream_name, realm),
fetch_streams_by_name,
[stream_name.lower() for stream_name in stream_names],
id_fetcher=lambda stream: stream.name.lower())
def get_recipient_cache_key(type, type_id):
# type: (int, int) -> Text
return u"get_recipient:%s:%s" % (type, type_id,)
@cache_with_key(get_recipient_cache_key, timeout=3600*24*7)
def get_recipient(type, type_id):
# type: (int, int) -> Recipient
return Recipient.objects.get(type_id=type_id, type=type)
def bulk_get_recipients(type, type_ids):
# type: (int, List[int]) -> Dict[int, Any]
def cache_key_function(type_id):
# type: (int) -> Text
return get_recipient_cache_key(type, type_id)
def query_function(type_ids):
# type: (List[int]) -> Sequence[Recipient]
# TODO: Change return type to QuerySet[Recipient]
return Recipient.objects.filter(type=type, type_id__in=type_ids)
return generic_bulk_cached_fetch(cache_key_function, query_function, type_ids,
id_fetcher=lambda recipient: recipient.type_id)
def sew_messages_and_reactions(messages, reactions):
# type: (List[Dict[str, Any]], List[Dict[str, Any]]) -> List[Dict[str, Any]]
"""Given a iterable of messages and reactions stitch reactions
into messages.
"""
# Add all messages with empty reaction item
for message in messages:
message['reactions'] = []
# Convert list of messages into dictionary to make reaction stitching easy
converted_messages = {message['id']: message for message in messages}
for reaction in reactions:
converted_messages[reaction['message_id']]['reactions'].append(
reaction)
return list(converted_messages.values())
class Message(ModelReprMixin, models.Model):
sender = models.ForeignKey(UserProfile) # type: UserProfile
recipient = models.ForeignKey(Recipient) # type: Recipient
subject = models.CharField(max_length=MAX_SUBJECT_LENGTH, db_index=True) # type: Text
content = models.TextField() # type: Text
rendered_content = models.TextField(null=True) # type: Optional[Text]
rendered_content_version = models.IntegerField(null=True) # type: Optional[int]
pub_date = models.DateTimeField('date published', db_index=True) # type: datetime.datetime
sending_client = models.ForeignKey(Client) # type: Client
last_edit_time = models.DateTimeField(null=True) # type: Optional[datetime.datetime]
edit_history = models.TextField(null=True) # type: Optional[Text]
has_attachment = models.BooleanField(default=False, db_index=True) # type: bool
has_image = models.BooleanField(default=False, db_index=True) # type: bool
has_link = models.BooleanField(default=False, db_index=True) # type: bool
def topic_name(self):
# type: () -> Text
"""
Please start using this helper to facilitate an
eventual switch over to a separate topic table.
"""
return self.subject
def __unicode__(self):
# type: () -> Text
display_recipient = get_display_recipient(self.recipient)
return u"<Message: %s / %s / %r>" % (display_recipient, self.subject, self.sender)
def get_realm(self):
# type: () -> Realm
return self.sender.realm
def save_rendered_content(self):
# type: () -> None
self.save(update_fields=["rendered_content", "rendered_content_version"])
@staticmethod
def need_to_render_content(rendered_content, rendered_content_version, bugdown_version):
# type: (Optional[Text], Optional[int], int) -> bool
return (rendered_content is None or
rendered_content_version is None or
rendered_content_version < bugdown_version)
def to_log_dict(self):
# type: () -> Dict[str, Any]
return dict(
id = self.id,
sender_id = self.sender.id,
sender_email = self.sender.email,
sender_domain = self.sender.realm.domain,
sender_full_name = self.sender.full_name,
sender_short_name = self.sender.short_name,
sending_client = self.sending_client.name,
type = self.recipient.type_name(),
recipient = get_display_recipient(self.recipient),
subject = self.topic_name(),
content = self.content,
timestamp = datetime_to_timestamp(self.pub_date))
@staticmethod
def get_raw_db_rows(needed_ids):
# type: (List[int]) -> List[Dict[str, Any]]
# This is a special purpose function optimized for
# callers like get_messages_backend().
fields = [
'id',
'subject',
'pub_date',
'last_edit_time',
'edit_history',
'content',
'rendered_content',
'rendered_content_version',
'recipient_id',
'recipient__type',
'recipient__type_id',
'sender_id',
'sending_client__name',
'sender__email',
'sender__full_name',
'sender__short_name',
'sender__realm__id',
'sender__realm__domain',
'sender__avatar_source',
'sender__avatar_version',
'sender__is_mirror_dummy',
]
messages = Message.objects.filter(id__in=needed_ids).values(*fields)
"""Adding one-many or Many-Many relationship in values results in N X
results.
Link: https://docs.djangoproject.com/en/1.8/ref/models/querysets/#values
"""
reactions = Reaction.get_raw_db_rows(needed_ids)
return sew_messages_and_reactions(messages, reactions)
def sent_by_human(self):
# type: () -> bool
sending_client = self.sending_client.name.lower()
return (sending_client in ('zulipandroid', 'zulipios', 'zulipdesktop',
'zulipmobile', 'zulipelectron', 'snipe',
'website', 'ios', 'android')) or (
'desktop app' in sending_client)
@staticmethod
def content_has_attachment(content):
# type: (Text) -> Match
return re.search(r'[/\-]user[\-_]uploads[/\.-]', content)
@staticmethod
def content_has_image(content):
# type: (Text) -> bool
return bool(re.search(r'[/\-]user[\-_]uploads[/\.-]\S+\.(bmp|gif|jpg|jpeg|png|webp)', content, re.IGNORECASE))
@staticmethod
def content_has_link(content):
# type: (Text) -> bool
return ('http://' in content or
'https://' in content or
'/user_uploads' in content or
(settings.ENABLE_FILE_LINKS and 'file:///' in content))
@staticmethod
def is_status_message(content, rendered_content):
# type: (Text, Text) -> bool
"""
Returns True if content and rendered_content are from 'me_message'
"""
if content.startswith('/me ') and '\n' not in content:
if rendered_content.startswith('<p>') and rendered_content.endswith('</p>'):
return True
return False
def update_calculated_fields(self):
# type: () -> None
# TODO: rendered_content could also be considered a calculated field
content = self.content
self.has_attachment = bool(Message.content_has_attachment(content))
self.has_image = bool(Message.content_has_image(content))
self.has_link = bool(Message.content_has_link(content))
@receiver(pre_save, sender=Message)
def pre_save_message(sender, **kwargs):
# type: (Any, **Any) -> None
if kwargs['update_fields'] is None or "content" in kwargs['update_fields']:
message = kwargs['instance']
message.update_calculated_fields()
def get_context_for_message(message):
# type: (Message) -> QuerySet[Message]
# TODO: Change return type to QuerySet[Message]
return Message.objects.filter(
recipient_id=message.recipient_id,
subject=message.subject,
id__lt=message.id,
pub_date__gt=message.pub_date - timedelta(minutes=15),
).order_by('-id')[:10]
post_save.connect(flush_message, sender=Message)
class Reaction(ModelReprMixin, models.Model):
user_profile = models.ForeignKey(UserProfile) # type: UserProfile
message = models.ForeignKey(Message) # type: Message
emoji_name = models.TextField() # type: Text
class Meta(object):
unique_together = ("user_profile", "message", "emoji_name")
@staticmethod
def get_raw_db_rows(needed_ids):
# type: (List[int]) -> List[Dict[str, Any]]
fields = ['message_id', 'emoji_name', 'user_profile__email',
'user_profile__id', 'user_profile__full_name']
return Reaction.objects.filter(message_id__in=needed_ids).values(*fields)
# Whenever a message is sent, for each user current subscribed to the
# corresponding Recipient object, we add a row to the UserMessage
# table, which has has columns (id, user profile id, message id,
# flags) indicating which messages each user has received. This table
# allows us to quickly query any user's last 1000 messages to generate
# the home view.
#
# Additionally, the flags field stores metadata like whether the user
# has read the message, starred the message, collapsed or was
# mentioned the message, etc.
#
# UserMessage is the largest table in a Zulip installation, even
# though each row is only 4 integers.
class UserMessage(ModelReprMixin, models.Model):
user_profile = models.ForeignKey(UserProfile) # type: UserProfile
message = models.ForeignKey(Message) # type: Message
# We're not using the archived field for now, but create it anyway
# since this table will be an unpleasant one to do schema changes
# on later
ALL_FLAGS = ['read', 'starred', 'collapsed', 'mentioned', 'wildcard_mentioned',
'summarize_in_home', 'summarize_in_stream', 'force_expand', 'force_collapse',
'has_alert_word', "historical", 'is_me_message']
flags = BitField(flags=ALL_FLAGS, default=0) # type: BitHandler
class Meta(object):
unique_together = ("user_profile", "message")
def __unicode__(self):
# type: () -> Text
display_recipient = get_display_recipient(self.message.recipient)
return u"<UserMessage: %s / %s (%s)>" % (display_recipient, self.user_profile.email, self.flags_list())
def flags_list(self):
# type: () -> List[str]
return [flag for flag in self.flags.keys() if getattr(self.flags, flag).is_set]
def parse_usermessage_flags(val):
# type: (int) -> List[str]
flags = []
mask = 1
for flag in UserMessage.ALL_FLAGS:
if val & mask:
flags.append(flag)
mask <<= 1
return flags
class Attachment(ModelReprMixin, models.Model):
file_name = models.TextField(db_index=True) # type: Text
# path_id is a storage location agnostic representation of the path of the file.
# If the path of a file is http://localhost:9991/user_uploads/a/b/abc/temp_file.py
# then its path_id will be a/b/abc/temp_file.py.
path_id = models.TextField(db_index=True) # type: Text
owner = models.ForeignKey(UserProfile) # type: UserProfile
realm = models.ForeignKey(Realm, blank=True, null=True) # type: Realm
is_realm_public = models.BooleanField(default=False) # type: bool
messages = models.ManyToManyField(Message) # type: Manager
create_time = models.DateTimeField(default=timezone.now, db_index=True) # type: datetime.datetime
size = models.IntegerField(null=True) # type: int
def __unicode__(self):
# type: () -> Text
return u"<Attachment: %s>" % (self.file_name,)
def is_claimed(self):
# type: () -> bool
return self.messages.count() > 0
def to_dict(self):
# type: () -> Dict[str, Any]
return {
'id': self.id,
'name': self.file_name,
'path_id': self.path_id,
'messages': [{
'id': m.id,
# convert to JavaScript-style UNIX timestamp so we can take
# advantage of client timezones.
'name': time.mktime(m.pub_date.timetuple()) * 1000
} for m in self.messages.all()]
}
def get_old_unclaimed_attachments(weeks_ago):
# type: (int) -> Sequence[Attachment]
# TODO: Change return type to QuerySet[Attachment]
delta_weeks_ago = timezone.now() - datetime.timedelta(weeks=weeks_ago)
old_attachments = Attachment.objects.filter(messages=None, create_time__lt=delta_weeks_ago)
return old_attachments
class Subscription(ModelReprMixin, models.Model):
user_profile = models.ForeignKey(UserProfile) # type: UserProfile
recipient = models.ForeignKey(Recipient) # type: Recipient
active = models.BooleanField(default=True) # type: bool
in_home_view = models.NullBooleanField(default=True) # type: Optional[bool]
DEFAULT_STREAM_COLOR = u"#c2c2c2"
color = models.CharField(max_length=10, default=DEFAULT_STREAM_COLOR) # type: Text
pin_to_top = models.BooleanField(default=False) # type: bool
desktop_notifications = models.BooleanField(default=True) # type: bool
audible_notifications = models.BooleanField(default=True) # type: bool
# Combination desktop + audible notifications superseded by the
# above.
notifications = models.BooleanField(default=False) # type: bool
class Meta(object):
unique_together = ("user_profile", "recipient")
def __unicode__(self):
# type: () -> Text
return u"<Subscription: %r -> %s>" % (self.user_profile, self.recipient)
@cache_with_key(user_profile_by_id_cache_key, timeout=3600*24*7)
def get_user_profile_by_id(uid):
# type: (int) -> UserProfile
return UserProfile.objects.select_related().get(id=uid)
@cache_with_key(user_profile_by_email_cache_key, timeout=3600*24*7)
def get_user_profile_by_email(email):
# type: (Text) -> UserProfile
return UserProfile.objects.select_related().get(email__iexact=email.strip())
@cache_with_key(active_user_dicts_in_realm_cache_key, timeout=3600*24*7)
def get_active_user_dicts_in_realm(realm):
# type: (Realm) -> List[Dict[str, Any]]
return UserProfile.objects.filter(realm=realm, is_active=True) \
.values(*active_user_dict_fields)
@cache_with_key(bot_dicts_in_realm_cache_key, timeout=3600*24*7)
def get_bot_dicts_in_realm(realm):
# type: (Realm) -> List[Dict[str, Any]]
return UserProfile.objects.filter(realm=realm, is_bot=True).values(*bot_dict_fields)
def get_owned_bot_dicts(user_profile, include_all_realm_bots_if_admin=True):
# type: (UserProfile, bool) -> List[Dict[str, Any]]
if user_profile.is_realm_admin and include_all_realm_bots_if_admin:
result = get_bot_dicts_in_realm(user_profile.realm)
else:
result = UserProfile.objects.filter(realm=user_profile.realm, is_bot=True,
bot_owner=user_profile).values(*bot_dict_fields)
# TODO: Remove this import cycle
from zerver.lib.avatar import get_avatar_url
return [{'email': botdict['email'],
'user_id': botdict['id'],
'full_name': botdict['full_name'],
'is_active': botdict['is_active'],
'api_key': botdict['api_key'],
'default_sending_stream': botdict['default_sending_stream__name'],
'default_events_register_stream': botdict['default_events_register_stream__name'],
'default_all_public_streams': botdict['default_all_public_streams'],
'owner': botdict['bot_owner__email'],
'avatar_url': get_avatar_url(botdict['avatar_source'], botdict['email'],
botdict['avatar_version']),
}
for botdict in result]
def get_prereg_user_by_email(email):
# type: (Text) -> PreregistrationUser
# A user can be invited many times, so only return the result of the latest
# invite.
return PreregistrationUser.objects.filter(email__iexact=email.strip()).latest("invited_at")
def get_cross_realm_emails():
# type: () -> Set[Text]
return set(settings.CROSS_REALM_BOT_EMAILS)
# The Huddle class represents a group of individuals who have had a
# Group Private Message conversation together. The actual membership
# of the Huddle is stored in the Subscription table just like with
# Streams, and a hash of that list is stored in the huddle_hash field
# below, to support efficiently mapping from a set of users to the
# corresponding Huddle object.
class Huddle(models.Model):
# TODO: We should consider whether using
# CommaSeparatedIntegerField would be better.
huddle_hash = models.CharField(max_length=40, db_index=True, unique=True) # type: Text
def get_huddle_hash(id_list):
# type: (List[int]) -> Text
id_list = sorted(set(id_list))
hash_key = ",".join(str(x) for x in id_list)
return make_safe_digest(hash_key)
def huddle_hash_cache_key(huddle_hash):
# type: (Text) -> Text
return u"huddle_by_hash:%s" % (huddle_hash,)
def get_huddle(id_list):
# type: (List[int]) -> Huddle
huddle_hash = get_huddle_hash(id_list)
return get_huddle_backend(huddle_hash, id_list)
@cache_with_key(lambda huddle_hash, id_list: huddle_hash_cache_key(huddle_hash), timeout=3600*24*7)
def get_huddle_backend(huddle_hash, id_list):
# type: (Text, List[int]) -> Huddle
with transaction.atomic():
(huddle, created) = Huddle.objects.get_or_create(huddle_hash=huddle_hash)
if created:
recipient = Recipient.objects.create(type_id=huddle.id,
type=Recipient.HUDDLE)
subs_to_create = [Subscription(recipient=recipient,
user_profile=get_user_profile_by_id(user_profile_id))
for user_profile_id in id_list]
Subscription.objects.bulk_create(subs_to_create)
return huddle
def clear_database():
# type: () -> None
pylibmc.Client(['127.0.0.1']).flush_all()
model = None # type: Any
for model in [Message, Stream, UserProfile, Recipient,
Realm, Subscription, Huddle, UserMessage, Client,
DefaultStream]:
model.objects.all().delete()
Session.objects.all().delete()
class UserActivity(models.Model):
user_profile = models.ForeignKey(UserProfile) # type: UserProfile
client = models.ForeignKey(Client) # type: Client
query = models.CharField(max_length=50, db_index=True) # type: Text
count = models.IntegerField() # type: int
last_visit = models.DateTimeField('last visit') # type: datetime.datetime
class Meta(object):
unique_together = ("user_profile", "client", "query")
class UserActivityInterval(models.Model):
user_profile = models.ForeignKey(UserProfile) # type: UserProfile
start = models.DateTimeField('start time', db_index=True) # type: datetime.datetime
end = models.DateTimeField('end time', db_index=True) # type: datetime.datetime
class UserPresence(models.Model):
user_profile = models.ForeignKey(UserProfile) # type: UserProfile
client = models.ForeignKey(Client) # type: Client
# Valid statuses
ACTIVE = 1
IDLE = 2
timestamp = models.DateTimeField('presence changed') # type: datetime.datetime
status = models.PositiveSmallIntegerField(default=ACTIVE) # type: int
@staticmethod
def status_to_string(status):
# type: (int) -> str
if status == UserPresence.ACTIVE:
return 'active'
elif status == UserPresence.IDLE:
return 'idle'
else:
raise ValueError('Unknown status: %s' % (status,))
@staticmethod
def get_status_dict_by_user(user_profile):
# type: (UserProfile) -> DefaultDict[Any, Dict[Any, Any]]
query = UserPresence.objects.filter(user_profile=user_profile).values(
'client__name',
'status',
'timestamp',
'user_profile__email',
'user_profile__id',
'user_profile__enable_offline_push_notifications',
'user_profile__is_mirror_dummy',
)
if PushDeviceToken.objects.filter(user=user_profile).exists():
mobile_user_ids = [user_profile.id] # type: List[int]
else:
mobile_user_ids = []
return UserPresence.get_status_dicts_for_query(query, mobile_user_ids)
@staticmethod
def get_status_dict_by_realm(realm_id):
# type: (int) -> DefaultDict[Any, Dict[Any, Any]]
query = UserPresence.objects.filter(
user_profile__realm_id=realm_id,
user_profile__is_active=True,
user_profile__is_bot=False
).values(
'client__name',
'status',
'timestamp',
'user_profile__email',
'user_profile__id',
'user_profile__enable_offline_push_notifications',
'user_profile__is_mirror_dummy',
)
mobile_user_ids = [row['user'] for row in PushDeviceToken.objects.filter(
user__realm_id=1,
user__is_active=True,
user__is_bot=False,
).distinct("user").values("user")]
return UserPresence.get_status_dicts_for_query(query, mobile_user_ids)
@staticmethod
def get_status_dicts_for_query(query, mobile_user_ids):
# type: (QuerySet, List[int]) -> DefaultDict[Any, Dict[Any, Any]]
user_statuses = defaultdict(dict) # type: DefaultDict[Any, Dict[Any, Any]]
# Order of query is important to get a latest status as aggregated status.
for row in query.order_by("user_profile__id", "-timestamp"):
info = UserPresence.to_presence_dict(
row['client__name'],
row['status'],
row['timestamp'],
push_enabled=row['user_profile__enable_offline_push_notifications'],
has_push_devices=row['user_profile__id'] in mobile_user_ids,
is_mirror_dummy=row['user_profile__is_mirror_dummy'],
)
if not user_statuses.get(row['user_profile__email']):
# Applying the latest status as aggregated status for user.
user_statuses[row['user_profile__email']]['aggregated'] = {
'status': info['status'],
'timestamp': info['timestamp'],
'client': info['client']
}
user_statuses[row['user_profile__email']][row['client__name']] = info
return user_statuses
@staticmethod
def to_presence_dict(client_name, status, dt, push_enabled=None,
has_push_devices=None, is_mirror_dummy=None):
# type: (Text, int, datetime.datetime, Optional[bool], Optional[bool], Optional[bool]) -> Dict[str, Any]
presence_val = UserPresence.status_to_string(status)
timestamp = datetime_to_timestamp(dt)
return dict(
client=client_name,
status=presence_val,
timestamp=timestamp,
pushable=(push_enabled and has_push_devices),
)
def to_dict(self):
# type: () -> Dict[str, Any]
return UserPresence.to_presence_dict(
self.client.name,
self.status,
self.timestamp
)
@staticmethod
def status_from_string(status):
# type: (NonBinaryStr) -> Optional[int]
if status == 'active':
status_val = UserPresence.ACTIVE
elif status == 'idle':
status_val = UserPresence.IDLE
else:
status_val = None
return status_val
class Meta(object):
unique_together = ("user_profile", "client")
class DefaultStream(models.Model):
realm = models.ForeignKey(Realm) # type: Realm
stream = models.ForeignKey(Stream) # type: Stream
class Meta(object):
unique_together = ("realm", "stream")
class Referral(models.Model):
user_profile = models.ForeignKey(UserProfile) # type: UserProfile
email = models.EmailField(blank=False, null=False) # type: Text
timestamp = models.DateTimeField(auto_now_add=True, null=False) # type: datetime.datetime
# This table only gets used on Zulip Voyager instances
# For reasons of deliverability (and sending from multiple email addresses),
# we will still send from mandrill when we send things from the (staging.)zulip.com install
class ScheduledJob(models.Model):
scheduled_timestamp = models.DateTimeField(auto_now_add=False, null=False) # type: datetime.datetime
type = models.PositiveSmallIntegerField() # type: int
# Valid types are {email}
# for EMAIL, filter_string is recipient_email
EMAIL = 1
# JSON representation of the job's data. Be careful, as we are not relying on Django to do validation
data = models.TextField() # type: Text
# Kind if like a ForeignKey, but table is determined by type.
filter_id = models.IntegerField(null=True) # type: Optional[int]
filter_string = models.CharField(max_length=100) # type: Text
class RealmAuditLog(models.Model):
realm = models.ForeignKey(Realm) # type: Realm
acting_user = models.ForeignKey(UserProfile, null=True, related_name='+') # type: Optional[UserProfile]
modified_user = models.ForeignKey(UserProfile, null=True, related_name='+') # type: Optional[UserProfile]
modified_stream = models.ForeignKey(Stream, null=True) # type: Optional[Stream]
event_type = models.CharField(max_length=40) # type: Text
event_time = models.DateTimeField() # type: datetime.datetime
backfilled = models.BooleanField(default=False) # type: bool
|
jainayush975/zulip
|
zerver/models.py
|
Python
|
apache-2.0
| 63,723
|
[
"VisIt"
] |
4e856323a4d6e41f60b13bc86ec5d2307ceb5e7fc11871c2ebf50ccd91279829
|
# coding: utf-8
# In[1]:
from __future__ import division
from sys import stdout
import numpy as np
import networkx as nx
from sklearn.metrics import normalized_mutual_info_score
from sklearn.metrics.pairwise import euclidean_distances
from sklearn.metrics import pairwise_distances_argmin_min
import matplotlib.pyplot as plt
from itertools import repeat
from Queue import Queue
from threading import Thread
from threading import current_thread
MIN_EXPANSION_SIZE = 50
MAX_DELETED_NEURONS = 3
#########################################################################################################################
##function to visualise graph
def visualise_graph(G, colours, layer):
## create new figure for graph plot
fig, ax = plt.subplots()
# graph layout
pos = nx.spring_layout(G)
#attributes in this graph
attributes = np.unique([v for k, v in nx.get_node_attributes(G, "assigned_community_layer_{}".format(layer)).items()])
# draw nodes -- colouring by cluster
for i in range(min(len(colours), len(attributes))):
node_list = [n for n in G.nodes() if G.node[n]["assigned_community_layer_{}".format(layer)] == attributes[i]]
colour = [colours[i] for n in range(len(node_list))]
nx.draw_networkx_nodes(G, pos, nodelist=node_list, node_color=colour)
#draw edges
nx.draw_networkx_edges(G, pos)
# draw labels
nx.draw_networkx_labels(G, pos)
#title of plot
plt.title('Nodes coloured by cluster, layer: {}'.format(layer))
#show plot
plt.show()
## visualise graph based on network clusters
def visualise_network(network, colours, layer):
#num neurons in lattice
num_neurons = len(network)
##create new figure for lattice plot
fig, ax = plt.subplots()
# graph layout
pos = nx.spring_layout(network)
# draw nodes -- colouring by cluster
for i in range(len(colours)):
nx.draw_networkx_nodes(network, pos, nodelist = [network.nodes()[i]], node_color = colours[i])
#draw edges
nx.draw_networkx_edges(network, pos)
# draw labels
nx.draw_networkx_labels(network, pos)
#label axes
plt.title('Neurons in lattice, layer: '+str(layer))
#show lattice plot
plt.show()
##########################################################################################################################
#function to generate real valued som for graph input
#three initial nodes
def initialise_network(ID, X, starting_nodes=4):
#network will be a one dimensional list
network = nx.Graph(ID = ID)
#initialise a network with just one neuron
network.add_nodes_from(range(1, starting_nodes + 1))
#id of nodes
for n in network.nodes():
network.node[n]["ID"] = "{}-{}".format(ID, str(n).zfill(2))
#connect nodes
for i in range(1, starting_nodes + 1):
for j in range(i + 1, starting_nodes + 1):
network.add_edge(i, j)
#assign a random vector in X to be the weight
V = X[np.random.randint(len(X), size=starting_nodes)]
return network, V
#########################################################################################################################
def precompute_sigmas(sigma, num_epochs):
return np.array([sigma * np.exp(-2 * sigma * e / num_epochs)
for e in range(num_epochs)])
##########################################################################################################################
##TODO
# function to train SOM on given graph
def train_network(X, network, V, num_epochs, eta_0, precomputed_sigmas):
#initial learning rate
eta = eta_0
#list if all patterns to visit
training_patterns = range(len(X))
#shortest path matrix
shortest_path = np.array(nx.floyd_warshall_numpy(network))
# net_change = np.zeros((V.shape))
for e in range(num_epochs):
#shuffle nodes
np.random.shuffle(training_patterns)
sigma = precomputed_sigmas[e]
# iterate through N nodes of graph
for i in training_patterns:
#data point to consider
x = X[i]
#determine winning neuron
closest_neuron = winning_neuron(x, V)
# update weights
deltaV = update_weights(x, V, closest_neuron, shortest_path[closest_neuron], eta, sigma)
#weight update (vectorised)
V += deltaV
# net_change += deltaV
# print "TRAINING COMPLETED"
# print net_change
# print np.linalg.norm(net_change, axis=1)
return V
##########################################################################################################################
# winning neuron
def winning_neuron(x, V):
distances = np.linalg.norm(x - V, axis=1)
return distances.argmin()
##########################################################################################################################
# function to update weights
def update_weights(x, V, winning_neuron, shortest_path_length, eta, sigma):
#weight update (vectorised)
return np.dot(np.diag(eta * np.exp(- shortest_path_length ** 2 / (2 * sigma ** 2))),
(x - V))
########################################################################################################################
# assign nodes into clusters
def assign_nodes(names, X, network, V):
#distance from each datapoint (row) to each weight vector (column)
# distances = euclidean_distances(X, V)
#
arg_min_distances, min_distances = pairwise_distances_argmin_min(X, V)
#nodes corresponding to minimum index (of length len(X))
minimum_nodes = np.array([network.nodes()[n] for n in arg_min_distances])
#list of neurons with no assignments
empty_neurons = np.array([n for n in network.nodes() if n not in minimum_nodes])
if empty_neurons.size > 0:
################################################DELETION####################################################
#neighbours of deleted neurons
neighbour_lists = np.array([network.neighbors(n) for n in empty_neurons])
print "DELETING NODES: {}".format(empty_neurons)
#remove the nodes
network.remove_nodes_from(empty_neurons)
##remove from V
V = np.array([V[i] for i in range(len(V)) if i in arg_min_distances])
#compute distances between all neurons in input space
computed_neuron_distances = compute_euclidean_distances(network, V)
##connect separated components
for neighbour_list in neighbour_lists:
connect_components(network, neighbour_list, computed_neuron_distances)
############################################################################################################
#array of errors
errors = np.array([np.mean(min_distances[minimum_nodes == n]) for n in network.nodes()])
#compute MQE
MQE = np.mean(errors)
print "MQE={}, size of map={}".format(MQE, len(network))
##array of assignments
assignments_array = np.array([np.array([names[i] for i in np.where(minimum_nodes == n)[0]]) for n in network.nodes()])
#zip zith nodes
errors = {n: e for n, e in zip(network.nodes(), errors)}
assignments = {n: a for n, a in zip(network.nodes(), assignments_array)}
# print "ERRORS"
# print errors
# print "number of nodes assigned to neurons"
# print {n: len(a) for n, a in zip(network.nodes(), assignments_array)}
nx.set_node_attributes(network, "e", errors)
nx.set_node_attributes(network, "ls", assignments)
return MQE, empty_neurons.size, V
##########################################################################################################################
def compute_euclidean_distances(network, V):
distances = euclidean_distances(V)
return {network.nodes()[i] : {network.nodes()[j] : distances[i, j] for j in range(len(distances[i]))}
for i in range(len(distances))}
#########################################################################################################################
def connect_components(network, neighbour_list, computed_neuron_distances):
sub_network = network.subgraph(neighbour_list)
connected_components = [sub_network.subgraph(c) for c in nx.connected_components(sub_network)]
number_of_connected_components = len(connected_components)
for i in range(number_of_connected_components):
connected_component_1 = connected_components[i].nodes()
for j in range(i + 1, number_of_connected_components):
connected_component_2 = connected_components[j].nodes()
distances = np.array([[computed_neuron_distances[n1][n2] for n2 in connected_component_2]
for n1 in connected_component_1])
min_n1, min_n2 = np.unravel_index(distances.argmin(), distances.shape)
network.add_edge(connected_component_1[min_n1],
connected_component_2[min_n2])
##########################################################################################################################
##function to identify neuron with greatest error
def identify_error_unit(network):
errors = nx.get_node_attributes(network, "e")
# print "ERROR UNIT"
# print max(errors, key=errors.get)
return max(errors, key=errors.get)
##########################################################################################################################
def expand_network(ID, named_X, network, V, error_unit):
#v goes to random vector in range of error unit
ls = network.node[error_unit]["ls"]
r = np.random.randint(len(ls))
v = named_X[ls[r]]
#zip nodes and distances
distances = zip(network.nodes(), np.linalg.norm(V - v, axis=1))
#identify neighbour pointing closet
error_unit_neighbours = network.neighbors(error_unit)
#id of new node
new_node = max(network) + 1
#add new node to map
network.add_node(new_node)
##id
network.node[new_node]["ID"] = "{}-{}".format(ID, str(new_node).zfill(2))
#add edges to map
#connect error unit and new node
network.add_edge(error_unit, new_node)
if len(error_unit_neighbours) > 0:
##find closest neighbour
distances = {n: v for n, v in distances if n in error_unit_neighbours}
closest_neighbour = min(distances, key=distances.get)
#connect to error unit and closest neighbour
network.add_edge(closest_neighbour, new_node)
#add v to V
V = np.vstack([V, v])
return V
##########################################################################################################################
##########################################################################################################################
##GHSOM algorithm
def ghsom(ID, named_X, num_iter, eta, sigma, e_0, e_sg, e_en, q):
print "MQE_0={}, growth target={}".format(e_0, e_0 * e_sg)
#separate names and matrix of node embedding
names, X = zip(*named_X.items())
names = np.array(names)
X = np.array(X)
#create som for this neuron
network, V = initialise_network(ID, X)
#precompute sigmas
precomputed_sigmas = precompute_sigmas(sigma, num_iter)
#train for lamda epochs
V = train_network(X, network, V, num_iter, eta, precomputed_sigmas)
#classify nodes and compute error
MQE, num_deleted_neurons, V = assign_nodes(names, X, network, V)
##som growth phase
#repeat until error is low enough
while MQE > e_sg * e_0 and num_deleted_neurons < MAX_DELETED_NEURONS:
#find neuron with greatest error
error_unit = identify_error_unit(network)
#expand network
V = expand_network(ID, named_X, network, V, error_unit)
#train for lam epochs
V = train_network(X, network, V, num_iter, eta, precomputed_sigmas)
#calculate mean network error
MQE, deleted_neurons, V = assign_nodes(names, X, network, V)
num_deleted_neurons += deleted_neurons
print "growth terminated, MQE: {}, target: {}, number of deleted neurons: {}".format(MQE,
e_0 * e_sg, num_deleted_neurons)
##neuron expansion phase
#iterate thorugh all neruons and find neurons with error great enough to expand
for _, d in network.nodes(data=True):
#unpack
node_id = d["ID"]
ls = d["ls"]
e = d["e"]
#check error
if (e > e_en * e_0 and len(ls) > MIN_EXPANSION_SIZE and num_deleted_neurons < MAX_DELETED_NEURONS):
# if (len(ls) > MIN_EXPANSION_SIZE and num_deleted_neurons < MAX_DELETED_NEURONS):
sub_X = {k: named_X[k] for k in ls}
print "submitted job: ID={}, e={}, number of nodes={}".format(node_id, e, len(ls))
#add these parameters to the queue
q.put((node_id, sub_X, num_iter, eta, sigma, e, e_sg, e_en))
#return network
return network, MQE
##########################################################################################################################
##########################################################################################################################
def label_nodes(G, networks):
for _, network, _ in networks:
for _, d in network.nodes(data=True):
community = d["ID"]
layer = community.count("-")
assignment_string = "assigned_community_layer_{}".format(layer)
for node in d["ls"]:
G.node[node][assignment_string] = community
##########################################################################################################################
def NMI_one_layer(G, label, layer):
#actual community for this layer
actual_community_labels = np.array([v for k, v in nx.get_node_attributes(G, label).items()])
#predicted communitiy for this layer
predicted_community_labels = np.array([v for k, v in nx.get_node_attributes(G,
"assigned_community_layer_{}".format(layer)).items()])
print actual_community_labels
print predicted_community_labels
return normalized_mutual_info_score(actual_community_labels, predicted_community_labels)
def NMI_all_layers(G, labels):
return np.array([NMI_one_layer(G, labels[len(labels) - 1 - i], i + 1) for i in range(len(labels))])
##########################################################################################################################
## get embedding
def get_embedding(G):
return np.array([v for k, v in nx.get_node_attributes(G, "embedding").items()])
# return np.array([v for k, v in nx.get_node_attributes(G, "embedding").items()])[:,:3]
##########################################################################################################################
def process_job(q, networks):
#unpack first element of queue
#contains all the para,eters for GHSOM
ID, X, num_iter, eta, sigma, e_0, e_sg, e_en = q.get()
#run GHSOM and return a network and MQE
n, e = ghsom(ID, X, num_iter, eta, sigma, e_0, e_sg, e_en, q)
#append result to networks list
networks.append((ID, n, e))
#mark task as done
q.task_done()
def worker(q, networks):
#continually poll queue for jobs
while True:
process_job(q, networks)
def main(params, filename, num_iter=10000, num_threads=1):
#network
G = nx.read_gpickle(filename)
#embedding matrix
X = get_embedding(G)
#zip with names
named_X = {k: v for k, v in zip(G.nodes(), X)}
##list of returned networks
networks = []
#initilise worker queue
q = Queue()
##initial MQE is variance of dataset
m = np.mean(X, axis=0)
MQE_0 = np.mean(np.linalg.norm(X - m, axis=1))
#add initial layer of ghsom to queue
q.put(("01", named_X, num_iter, params["eta"], params["sigma"], MQE_0, params["e_sg"], params["e_en"]))
if num_threads > 1:
#initialise threads
for i in range(num_threads):
t = Thread(target=worker, args=(q, networks))
t.setDaemon(True)
t.start()
#finally wait until queue is empty and all tasks are done
q.join()
else :
#single thread
while not q.empty():
process_job(q, networks)
print "DONE"
return G, networks
# In[ ]:
params = {'eta': 0.001,
'sigma': 0.01,
'e_sg': 0.85,
'e_en': 0.1}
# In[3]:
G, networks = main(params=params, filename="benchmarks/hierarchical_benchmark.gpickle", num_threads=5, num_iter=1000)
# In[4]:
label_nodes(G, networks)
# In[5]:
NMI_all_layers(G, labels=["firstlevelcommunity", "secondlevelcommunity"])
# In[12]:
_, network, _ = networks[0]
colours = np.random.rand(len(network), 3)
# In[13]:
visualise_graph(G=G, colours=colours, layer=1)
# In[ ]:
|
DavidMcDonald1993/ghsom
|
ghsom_parallel.py
|
Python
|
gpl-2.0
| 17,719
|
[
"NEURON",
"VisIt"
] |
33f4fff3456c67c3098bbb444e20d7edef0b65dff9883d42b02eecaa584f5688
|
import stl
import traces
from pytest import raises, approx
from lenses import bind
from magnum.solvers.cegis import (solve, MaxRoundsError, encode_refuted_rec,
find_refuted_radius, smt_radius_oracle)
def test_feasible_example2_cegis():
from magnum.examples.feasible_example2 import feasible_example as g
res = solve(g)
assert not res.feasible
assert len(res.counter_examples) in (1, 2)
def test_smt_radius_oracle():
from magnum.examples.rock_paper_scissors import rps as g
play = {'u': traces.TimeSeries([(0, 1)])}
counter = {'w': traces.TimeSeries([(0, 20 / 60)])}
oracle = smt_radius_oracle(g=g, play=play, counter=counter)
assert not oracle(r=9 / 60)
assert oracle(r=20 / 60)
assert oracle(r=1)
play = {'u': traces.TimeSeries([(0, 0)])}
counter = {'w': traces.TimeSeries([(0, 20 / 60)])}
oracle = smt_radius_oracle(g=g, play=play, counter=counter)
assert not oracle(r=5 / 60)
assert not oracle(r=9 / 60)
assert oracle(r=11 / 60)
assert oracle(r=1)
def test_find_refuted_radius():
from magnum.examples.rock_paper_scissors import rps as g
play = {'u': traces.TimeSeries([(0, 1)])}
counter = {'w': traces.TimeSeries([(0, 20 / 60)])}
r = find_refuted_radius(g, play, counter, tol=1e-6)
assert approx(10 / 60, abs=1e-5) == r
play = {'u': traces.TimeSeries([(0, 0)])}
counter = {'w': traces.TimeSeries([(0, 20 / 60)])}
r = find_refuted_radius(g, play, counter, tol=1e-6)
assert approx(10 / 60, abs=1e-5) == r
play = {'u': traces.TimeSeries([(0, 20 / 60)])}
counter = {'w': traces.TimeSeries([(0, 40 / 60)])}
r = find_refuted_radius(g, play, counter, tol=1e-6)
assert approx(10 / 60, abs=1e-5) == r
play = {'u': traces.TimeSeries([(0, 40 / 60)])}
counter = {'w': traces.TimeSeries([(0, 0)])}
r = find_refuted_radius(g, play, counter, tol=1e-6)
assert approx(10 / 60, abs=1e-5) == r
# TODO
def test_rps():
from magnum.examples.rock_paper_scissors import rps as g
res = solve(g, use_smt=True)
assert not res.feasible
assert len(res.counter_examples) == 3
with raises(MaxRoundsError):
solve(g, max_ce=1, refuted_recs=False)
# TODO
res = solve(g)
assert not res.feasible
assert len(res.counter_examples) == 3
res = solve(g, max_ce=1, max_rounds=10)
assert not res.feasible
def test_rpss():
from magnum.examples.rock_paper_scissors_spock import rps as g
res = solve(g, use_smt=True)
assert res.feasible
res = solve(g)
assert res.feasible
assert len(res.counter_examples) <= 3
assert approx(res.cost) == 0.5
res = solve(g, max_ce=2, max_rounds=7)
assert res.feasible
def test_encode_refuted_rec():
refuted = {
'u1': traces.TimeSeries([(0, 0), (1, 1)]),
'u2': traces.TimeSeries([(0, 0.5)])
}
phi = encode_refuted_rec(refuted, 0.2, [0])
psi1 = stl.parse('(u1 < -0.2) | (u1 > 0.2)')
psi2 = stl.parse('(u2 < 0.3) | (u2 > 0.7)')
assert phi == psi1 | psi2
psi3 = stl.parse('X(u1 < 0.8)')
psi4 = stl.parse('(X(u2 < 0.3)) | (X(u2 > 0.7))')
phi = encode_refuted_rec(refuted, 0.2, [1])
assert phi == psi3 | psi4
phi = encode_refuted_rec(refuted, 0.2, [0, 1])
assert set(phi.args) == set((psi1 | psi2 | psi3 | psi4).args)
def test_encode_refuted_rec_sync():
from magnum.examples.feasible_example2 import feasible_example as g
from magnum.solvers import smt
from magnum.solvers import milp
from stl.boolean_eval import pointwise_sat
dt = g.model.dt
refuted = {'u': traces.TimeSeries([(0, 0.5)])}
phi = encode_refuted_rec(refuted, 0.1, g.times, dt=dt)
g = bind(g).specs.learned.set(phi)
res = smt.encode_and_run(g)
assert pointwise_sat(phi, dt=dt)(res.solution)
res = milp.encode_and_run(g)
assert pointwise_sat(phi, dt=dt)(res.solution)
refuted = {'u': traces.TimeSeries([(0, 1), (0.4, 1), (1, 0)])}
phi = encode_refuted_rec(refuted, 0.1, g.times, dt=dt)
g = bind(g).specs.learned.set(phi)
res = smt.encode_and_run(g)
assert pointwise_sat(phi, dt=dt)(res.solution)
res = milp.encode_and_run(g)
assert pointwise_sat(phi, dt=dt)(res.solution)
|
mvcisback/py-blustl
|
magnum/solvers/test_cegis.py
|
Python
|
bsd-3-clause
| 4,263
|
[
"Psi4"
] |
61fa5a8abe801e0497663f4b666fca28ed431c227f8c0a8628060ab0ebb35c7b
|
tutorial_tests = """
Let's try a simple generator:
>>> def f():
... yield 1
... yield 2
>>> for i in f():
... print i
1
2
>>> g = f()
>>> g.next()
1
>>> g.next()
2
"Falling off the end" stops the generator:
>>> g.next()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<stdin>", line 2, in g
StopIteration
"return" also stops the generator:
>>> def f():
... yield 1
... return
... yield 2 # never reached
...
>>> g = f()
>>> g.next()
1
>>> g.next()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<stdin>", line 3, in f
StopIteration
>>> g.next() # once stopped, can't be resumed
Traceback (most recent call last):
File "<stdin>", line 1, in ?
StopIteration
"raise StopIteration" stops the generator too:
>>> def f():
... yield 1
... raise StopIteration
... yield 2 # never reached
...
>>> g = f()
>>> g.next()
1
>>> g.next()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
StopIteration
>>> g.next()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
StopIteration
However, they are not exactly equivalent:
>>> def g1():
... try:
... return
... except:
... yield 1
...
>>> list(g1())
[]
>>> def g2():
... try:
... raise StopIteration
... except:
... yield 42
>>> print list(g2())
[42]
This may be surprising at first:
>>> def g3():
... try:
... return
... finally:
... yield 1
...
>>> list(g3())
[1]
Let's create an alternate range() function implemented as a generator:
>>> def yrange(n):
... for i in range(n):
... yield i
...
>>> list(yrange(5))
[0, 1, 2, 3, 4]
Generators always return to the most recent caller:
>>> def creator():
... r = yrange(5)
... print "creator", r.next()
... return r
...
>>> def caller():
... r = creator()
... for i in r:
... print "caller", i
...
>>> caller()
creator 0
caller 1
caller 2
caller 3
caller 4
Generators can call other generators:
>>> def zrange(n):
... for i in yrange(n):
... yield i
...
>>> list(zrange(5))
[0, 1, 2, 3, 4]
"""
# The examples from PEP 255.
pep_tests = """
Specification: Yield
Restriction: A generator cannot be resumed while it is actively
running:
>>> def g():
... i = me.next()
... yield i
>>> me = g()
>>> me.next()
Traceback (most recent call last):
...
File "<string>", line 2, in g
ValueError: generator already executing
Specification: Return
Note that return isn't always equivalent to raising StopIteration: the
difference lies in how enclosing try/except constructs are treated.
For example,
>>> def f1():
... try:
... return
... except:
... yield 1
>>> print list(f1())
[]
because, as in any function, return simply exits, but
>>> def f2():
... try:
... raise StopIteration
... except:
... yield 42
>>> print list(f2())
[42]
because StopIteration is captured by a bare "except", as is any
exception.
Specification: Generators and Exception Propagation
>>> def f():
... return 1//0
>>> def g():
... yield f() # the zero division exception propagates
... yield 42 # and we'll never get here
>>> k = g()
>>> k.next()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<stdin>", line 2, in g
File "<stdin>", line 2, in f
ZeroDivisionError: integer division or modulo by zero
>>> k.next() # and the generator cannot be resumed
Traceback (most recent call last):
File "<stdin>", line 1, in ?
StopIteration
>>>
Specification: Try/Except/Finally
>>> def f():
... try:
... yield 1
... try:
... yield 2
... 1//0
... yield 3 # never get here
... except ZeroDivisionError:
... yield 4
... yield 5
... raise
... except:
... yield 6
... yield 7 # the "raise" above stops this
... except:
... yield 8
... yield 9
... try:
... x = 12
... finally:
... yield 10
... yield 11
>>> print list(f())
[1, 2, 4, 5, 8, 9, 10, 11]
>>>
Guido's binary tree example.
>>> # A binary tree class.
>>> class Tree:
...
... def __init__(self, label, left=None, right=None):
... self.label = label
... self.left = left
... self.right = right
...
... def __repr__(self, level=0, indent=" "):
... s = level*indent + repr(self.label)
... if self.left:
... s = s + "\\n" + self.left.__repr__(level+1, indent)
... if self.right:
... s = s + "\\n" + self.right.__repr__(level+1, indent)
... return s
...
... def __iter__(self):
... return inorder(self)
>>> # Create a Tree from a list.
>>> def tree(list):
... n = len(list)
... if n == 0:
... return []
... i = n // 2
... return Tree(list[i], tree(list[:i]), tree(list[i+1:]))
>>> # Show it off: create a tree.
>>> t = tree("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
>>> # A recursive generator that generates Tree labels in in-order.
>>> def inorder(t):
... if t:
... for x in inorder(t.left):
... yield x
... yield t.label
... for x in inorder(t.right):
... yield x
>>> # Show it off: create a tree.
>>> t = tree("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
>>> # Print the nodes of the tree in in-order.
>>> for x in t:
... print x,
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
>>> # A non-recursive generator.
>>> def inorder(node):
... stack = []
... while node:
... while node.left:
... stack.append(node)
... node = node.left
... yield node.label
... while not node.right:
... try:
... node = stack.pop()
... except IndexError:
... return
... yield node.label
... node = node.right
>>> # Exercise the non-recursive generator.
>>> for x in t:
... print x,
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
"""
# Examples from Iterator-List and Python-Dev and c.l.py.
email_tests = """
The difference between yielding None and returning it.
>>> def g():
... for i in range(3):
... yield None
... yield None
... return
>>> list(g())
[None, None, None, None]
Ensure that explicitly raising StopIteration acts like any other exception
in try/except, not like a return.
>>> def g():
... yield 1
... try:
... raise StopIteration
... except:
... yield 2
... yield 3
>>> list(g())
[1, 2, 3]
Next one was posted to c.l.py.
>>> def gcomb(x, k):
... "Generate all combinations of k elements from list x."
...
... if k > len(x):
... return
... if k == 0:
... yield []
... else:
... first, rest = x[0], x[1:]
... # A combination does or doesn't contain first.
... # If it does, the remainder is a k-1 comb of rest.
... for c in gcomb(rest, k-1):
... c.insert(0, first)
... yield c
... # If it doesn't contain first, it's a k comb of rest.
... for c in gcomb(rest, k):
... yield c
>>> seq = range(1, 5)
>>> for k in range(len(seq) + 2):
... print "%d-combs of %s:" % (k, seq)
... for c in gcomb(seq, k):
... print " ", c
0-combs of [1, 2, 3, 4]:
[]
1-combs of [1, 2, 3, 4]:
[1]
[2]
[3]
[4]
2-combs of [1, 2, 3, 4]:
[1, 2]
[1, 3]
[1, 4]
[2, 3]
[2, 4]
[3, 4]
3-combs of [1, 2, 3, 4]:
[1, 2, 3]
[1, 2, 4]
[1, 3, 4]
[2, 3, 4]
4-combs of [1, 2, 3, 4]:
[1, 2, 3, 4]
5-combs of [1, 2, 3, 4]:
From the Iterators list, about the types of these things.
>>> def g():
... yield 1
...
>>> type(g)
<type 'function'>
>>> i = g()
>>> type(i)
<type 'generator'>
>>> [s for s in dir(i) if not s.startswith('_')]
['close', 'gi_code', 'gi_frame', 'gi_running', 'next', 'send', 'throw']
>>> from test.test_support import HAVE_DOCSTRINGS
>>> print(i.next.__doc__ if HAVE_DOCSTRINGS else 'x.next() -> the next value, or raise StopIteration')
x.next() -> the next value, or raise StopIteration
>>> iter(i) is i
True
>>> import types
>>> isinstance(i, types.GeneratorType)
True
And more, added later.
>>> i.gi_running
0
>>> type(i.gi_frame)
<type 'frame'>
>>> i.gi_running = 42
Traceback (most recent call last):
...
TypeError: readonly attribute
>>> def g():
... yield me.gi_running
>>> me = g()
>>> me.gi_running
0
>>> me.next()
1
>>> me.gi_running
0
A clever union-find implementation from c.l.py, due to David Eppstein.
Sent: Friday, June 29, 2001 12:16 PM
To: python-list@python.org
Subject: Re: PEP 255: Simple Generators
>>> class disjointSet:
... def __init__(self, name):
... self.name = name
... self.parent = None
... self.generator = self.generate()
...
... def generate(self):
... while not self.parent:
... yield self
... for x in self.parent.generator:
... yield x
...
... def find(self):
... return self.generator.next()
...
... def union(self, parent):
... if self.parent:
... raise ValueError("Sorry, I'm not a root!")
... self.parent = parent
...
... def __str__(self):
... return self.name
>>> names = "ABCDEFGHIJKLM"
>>> sets = [disjointSet(name) for name in names]
>>> roots = sets[:]
>>> import random
>>> gen = random.WichmannHill(42)
>>> while 1:
... for s in sets:
... print "%s->%s" % (s, s.find()),
... print
... if len(roots) > 1:
... s1 = gen.choice(roots)
... roots.remove(s1)
... s2 = gen.choice(roots)
... s1.union(s2)
... print "merged", s1, "into", s2
... else:
... break
A->A B->B C->C D->D E->E F->F G->G H->H I->I J->J K->K L->L M->M
merged D into G
A->A B->B C->C D->G E->E F->F G->G H->H I->I J->J K->K L->L M->M
merged C into F
A->A B->B C->F D->G E->E F->F G->G H->H I->I J->J K->K L->L M->M
merged L into A
A->A B->B C->F D->G E->E F->F G->G H->H I->I J->J K->K L->A M->M
merged H into E
A->A B->B C->F D->G E->E F->F G->G H->E I->I J->J K->K L->A M->M
merged B into E
A->A B->E C->F D->G E->E F->F G->G H->E I->I J->J K->K L->A M->M
merged J into G
A->A B->E C->F D->G E->E F->F G->G H->E I->I J->G K->K L->A M->M
merged E into G
A->A B->G C->F D->G E->G F->F G->G H->G I->I J->G K->K L->A M->M
merged M into G
A->A B->G C->F D->G E->G F->F G->G H->G I->I J->G K->K L->A M->G
merged I into K
A->A B->G C->F D->G E->G F->F G->G H->G I->K J->G K->K L->A M->G
merged K into A
A->A B->G C->F D->G E->G F->F G->G H->G I->A J->G K->A L->A M->G
merged F into A
A->A B->G C->A D->G E->G F->A G->G H->G I->A J->G K->A L->A M->G
merged A into G
A->G B->G C->G D->G E->G F->G G->G H->G I->G J->G K->G L->G M->G
"""
# Emacs turd '
# Fun tests (for sufficiently warped notions of "fun").
fun_tests = """
Build up to a recursive Sieve of Eratosthenes generator.
>>> def firstn(g, n):
... return [g.next() for i in range(n)]
>>> def intsfrom(i):
... while 1:
... yield i
... i += 1
>>> firstn(intsfrom(5), 7)
[5, 6, 7, 8, 9, 10, 11]
>>> def exclude_multiples(n, ints):
... for i in ints:
... if i % n:
... yield i
>>> firstn(exclude_multiples(3, intsfrom(1)), 6)
[1, 2, 4, 5, 7, 8]
>>> def sieve(ints):
... prime = ints.next()
... yield prime
... not_divisible_by_prime = exclude_multiples(prime, ints)
... for p in sieve(not_divisible_by_prime):
... yield p
>>> primes = sieve(intsfrom(2))
>>> firstn(primes, 20)
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]
Another famous problem: generate all integers of the form
2**i * 3**j * 5**k
in increasing order, where i,j,k >= 0. Trickier than it may look at first!
Try writing it without generators, and correctly, and without generating
3 internal results for each result output.
>>> def times(n, g):
... for i in g:
... yield n * i
>>> firstn(times(10, intsfrom(1)), 10)
[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
>>> def merge(g, h):
... ng = g.next()
... nh = h.next()
... while 1:
... if ng < nh:
... yield ng
... ng = g.next()
... elif ng > nh:
... yield nh
... nh = h.next()
... else:
... yield ng
... ng = g.next()
... nh = h.next()
The following works, but is doing a whale of a lot of redundant work --
it's not clear how to get the internal uses of m235 to share a single
generator. Note that me_times2 (etc) each need to see every element in the
result sequence. So this is an example where lazy lists are more natural
(you can look at the head of a lazy list any number of times).
>>> def m235():
... yield 1
... me_times2 = times(2, m235())
... me_times3 = times(3, m235())
... me_times5 = times(5, m235())
... for i in merge(merge(me_times2,
... me_times3),
... me_times5):
... yield i
Don't print "too many" of these -- the implementation above is extremely
inefficient: each call of m235() leads to 3 recursive calls, and in
turn each of those 3 more, and so on, and so on, until we've descended
enough levels to satisfy the print stmts. Very odd: when I printed 5
lines of results below, this managed to screw up Win98's malloc in "the
usual" way, i.e. the heap grew over 4Mb so Win98 started fragmenting
address space, and it *looked* like a very slow leak.
>>> result = m235()
>>> for i in range(3):
... print firstn(result, 15)
[1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24]
[25, 27, 30, 32, 36, 40, 45, 48, 50, 54, 60, 64, 72, 75, 80]
[81, 90, 96, 100, 108, 120, 125, 128, 135, 144, 150, 160, 162, 180, 192]
Heh. Here's one way to get a shared list, complete with an excruciating
namespace renaming trick. The *pretty* part is that the times() and merge()
functions can be reused as-is, because they only assume their stream
arguments are iterable -- a LazyList is the same as a generator to times().
>>> class LazyList:
... def __init__(self, g):
... self.sofar = []
... self.fetch = g.next
...
... def __getitem__(self, i):
... sofar, fetch = self.sofar, self.fetch
... while i >= len(sofar):
... sofar.append(fetch())
... return sofar[i]
>>> def m235():
... yield 1
... # Gack: m235 below actually refers to a LazyList.
... me_times2 = times(2, m235)
... me_times3 = times(3, m235)
... me_times5 = times(5, m235)
... for i in merge(merge(me_times2,
... me_times3),
... me_times5):
... yield i
Print as many of these as you like -- *this* implementation is memory-
efficient.
>>> m235 = LazyList(m235())
>>> for i in range(5):
... print [m235[j] for j in range(15*i, 15*(i+1))]
[1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24]
[25, 27, 30, 32, 36, 40, 45, 48, 50, 54, 60, 64, 72, 75, 80]
[81, 90, 96, 100, 108, 120, 125, 128, 135, 144, 150, 160, 162, 180, 192]
[200, 216, 225, 240, 243, 250, 256, 270, 288, 300, 320, 324, 360, 375, 384]
[400, 405, 432, 450, 480, 486, 500, 512, 540, 576, 600, 625, 640, 648, 675]
Ye olde Fibonacci generator, LazyList style.
>>> def fibgen(a, b):
...
... def sum(g, h):
... while 1:
... yield g.next() + h.next()
...
... def tail(g):
... g.next() # throw first away
... for x in g:
... yield x
...
... yield a
... yield b
... for s in sum(iter(fib),
... tail(iter(fib))):
... yield s
>>> fib = LazyList(fibgen(1, 2))
>>> firstn(iter(fib), 17)
[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584]
Running after your tail with itertools.tee (new in version 2.4)
The algorithms "m235" (Hamming) and Fibonacci presented above are both
examples of a whole family of FP (functional programming) algorithms
where a function produces and returns a list while the production algorithm
suppose the list as already produced by recursively calling itself.
For these algorithms to work, they must:
- produce at least a first element without presupposing the existence of
the rest of the list
- produce their elements in a lazy manner
To work efficiently, the beginning of the list must not be recomputed over
and over again. This is ensured in most FP languages as a built-in feature.
In python, we have to explicitly maintain a list of already computed results
and abandon genuine recursivity.
This is what had been attempted above with the LazyList class. One problem
with that class is that it keeps a list of all of the generated results and
therefore continually grows. This partially defeats the goal of the generator
concept, viz. produce the results only as needed instead of producing them
all and thereby wasting memory.
Thanks to itertools.tee, it is now clear "how to get the internal uses of
m235 to share a single generator".
>>> from itertools import tee
>>> def m235():
... def _m235():
... yield 1
... for n in merge(times(2, m2),
... merge(times(3, m3),
... times(5, m5))):
... yield n
... m1 = _m235()
... m2, m3, m5, mRes = tee(m1, 4)
... return mRes
>>> it = m235()
>>> for i in range(5):
... print firstn(it, 15)
[1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24]
[25, 27, 30, 32, 36, 40, 45, 48, 50, 54, 60, 64, 72, 75, 80]
[81, 90, 96, 100, 108, 120, 125, 128, 135, 144, 150, 160, 162, 180, 192]
[200, 216, 225, 240, 243, 250, 256, 270, 288, 300, 320, 324, 360, 375, 384]
[400, 405, 432, 450, 480, 486, 500, 512, 540, 576, 600, 625, 640, 648, 675]
The "tee" function does just what we want. It internally keeps a generated
result for as long as it has not been "consumed" from all of the duplicated
iterators, whereupon it is deleted. You can therefore print the hamming
sequence during hours without increasing memory usage, or very little.
The beauty of it is that recursive running-after-their-tail FP algorithms
are quite straightforwardly expressed with this Python idiom.
Ye olde Fibonacci generator, tee style.
>>> def fib():
...
... def _isum(g, h):
... while 1:
... yield g.next() + h.next()
...
... def _fib():
... yield 1
... yield 2
... fibTail.next() # throw first away
... for res in _isum(fibHead, fibTail):
... yield res
...
... realfib = _fib()
... fibHead, fibTail, fibRes = tee(realfib, 3)
... return fibRes
>>> firstn(fib(), 17)
[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584]
"""
# syntax_tests mostly provokes SyntaxErrors. Also fiddling with #if 0
# hackery.
syntax_tests = """
>>> def f():
... return 22
... yield 1
Traceback (most recent call last):
..
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.syntax[0]>, line 3)
>>> def f():
... yield 1
... return 22
Traceback (most recent call last):
..
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.syntax[1]>, line 3)
"return None" is not the same as "return" in a generator:
>>> def f():
... yield 1
... return None
Traceback (most recent call last):
..
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.syntax[2]>, line 3)
These are fine:
>>> def f():
... yield 1
... return
>>> def f():
... try:
... yield 1
... finally:
... pass
>>> def f():
... try:
... try:
... 1//0
... except ZeroDivisionError:
... yield 666
... except:
... pass
... finally:
... pass
>>> def f():
... try:
... try:
... yield 12
... 1//0
... except ZeroDivisionError:
... yield 666
... except:
... try:
... x = 12
... finally:
... yield 12
... except:
... return
>>> list(f())
[12, 666]
>>> def f():
... yield
>>> type(f())
<type 'generator'>
>>> def f():
... if 0:
... yield
>>> type(f())
<type 'generator'>
>>> def f():
... if 0:
... yield 1
>>> type(f())
<type 'generator'>
>>> def f():
... if "":
... yield None
>>> type(f())
<type 'generator'>
>>> def f():
... return
... try:
... if x==4:
... pass
... elif 0:
... try:
... 1//0
... except SyntaxError:
... pass
... else:
... if 0:
... while 12:
... x += 1
... yield 2 # don't blink
... f(a, b, c, d, e)
... else:
... pass
... except:
... x = 1
... return
>>> type(f())
<type 'generator'>
>>> def f():
... if 0:
... def g():
... yield 1
...
>>> type(f())
<type 'NoneType'>
>>> def f():
... if 0:
... class C:
... def __init__(self):
... yield 1
... def f(self):
... yield 2
>>> type(f())
<type 'NoneType'>
>>> def f():
... if 0:
... return
... if 0:
... yield 2
>>> type(f())
<type 'generator'>
>>> def f():
... if 0:
... lambda x: x # shouldn't trigger here
... return # or here
... def f(i):
... return 2*i # or here
... if 0:
... return 3 # but *this* sucks (line 8)
... if 0:
... yield 2 # because it's a generator (line 10)
Traceback (most recent call last):
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.syntax[24]>, line 10)
This one caused a crash (see SF bug 567538):
>>> def f():
... for i in range(3):
... try:
... continue
... finally:
... yield i
...
>>> g = f()
>>> print g.next()
0
>>> print g.next()
1
>>> print g.next()
2
>>> print g.next()
Traceback (most recent call last):
StopIteration
Test the gi_code attribute
>>> def f():
... yield 5
...
>>> g = f()
>>> g.gi_code is f.func_code
True
>>> g.next()
5
>>> g.next()
Traceback (most recent call last):
StopIteration
>>> g.gi_code is f.func_code
True
Test the __name__ attribute and the repr()
>>> def f():
... yield 5
...
>>> g = f()
>>> g.__name__
'f'
>>> repr(g) # doctest: +ELLIPSIS
'<generator object f at ...>'
Lambdas shouldn't have their usual return behavior.
>>> x = lambda: (yield 1)
>>> list(x())
[1]
>>> x = lambda: ((yield 1), (yield 2))
>>> list(x())
[1, 2]
"""
# conjoin is a simple backtracking generator, named in honor of Icon's
# "conjunction" control structure. Pass a list of no-argument functions
# that return iterable objects. Easiest to explain by example: assume the
# function list [x, y, z] is passed. Then conjoin acts like:
#
# def g():
# values = [None] * 3
# for values[0] in x():
# for values[1] in y():
# for values[2] in z():
# yield values
#
# So some 3-lists of values *may* be generated, each time we successfully
# get into the innermost loop. If an iterator fails (is exhausted) before
# then, it "backtracks" to get the next value from the nearest enclosing
# iterator (the one "to the left"), and starts all over again at the next
# slot (pumps a fresh iterator). Of course this is most useful when the
# iterators have side-effects, so that which values *can* be generated at
# each slot depend on the values iterated at previous slots.
def simple_conjoin(gs):
values = [None] * len(gs)
def gen(i):
if i >= len(gs):
yield values
else:
for values[i] in gs[i]():
for x in gen(i+1):
yield x
for x in gen(0):
yield x
# That works fine, but recursing a level and checking i against len(gs) for
# each item produced is inefficient. By doing manual loop unrolling across
# generator boundaries, it's possible to eliminate most of that overhead.
# This isn't worth the bother *in general* for generators, but conjoin() is
# a core building block for some CPU-intensive generator applications.
def conjoin(gs):
n = len(gs)
values = [None] * n
# Do one loop nest at time recursively, until the # of loop nests
# remaining is divisible by 3.
def gen(i):
if i >= n:
yield values
elif (n-i) % 3:
ip1 = i+1
for values[i] in gs[i]():
for x in gen(ip1):
yield x
else:
for x in _gen3(i):
yield x
# Do three loop nests at a time, recursing only if at least three more
# remain. Don't call directly: this is an internal optimization for
# gen's use.
def _gen3(i):
assert i < n and (n-i) % 3 == 0
ip1, ip2, ip3 = i+1, i+2, i+3
g, g1, g2 = gs[i : ip3]
if ip3 >= n:
# These are the last three, so we can yield values directly.
for values[i] in g():
for values[ip1] in g1():
for values[ip2] in g2():
yield values
else:
# At least 6 loop nests remain; peel off 3 and recurse for the
# rest.
for values[i] in g():
for values[ip1] in g1():
for values[ip2] in g2():
for x in _gen3(ip3):
yield x
for x in gen(0):
yield x
# And one more approach: For backtracking apps like the Knight's Tour
# solver below, the number of backtracking levels can be enormous (one
# level per square, for the Knight's Tour, so that e.g. a 100x100 board
# needs 10,000 levels). In such cases Python is likely to run out of
# stack space due to recursion. So here's a recursion-free version of
# conjoin too.
# NOTE WELL: This allows large problems to be solved with only trivial
# demands on stack space. Without explicitly resumable generators, this is
# much harder to achieve. OTOH, this is much slower (up to a factor of 2)
# than the fancy unrolled recursive conjoin.
def flat_conjoin(gs): # rename to conjoin to run tests with this instead
n = len(gs)
values = [None] * n
iters = [None] * n
_StopIteration = StopIteration # make local because caught a *lot*
i = 0
while 1:
# Descend.
try:
while i < n:
it = iters[i] = gs[i]().next
values[i] = it()
i += 1
except _StopIteration:
pass
else:
assert i == n
yield values
# Backtrack until an older iterator can be resumed.
i -= 1
while i >= 0:
try:
values[i] = iters[i]()
# Success! Start fresh at next level.
i += 1
break
except _StopIteration:
# Continue backtracking.
i -= 1
else:
assert i < 0
break
# A conjoin-based N-Queens solver.
class Queens:
def __init__(self, n):
self.n = n
rangen = range(n)
# Assign a unique int to each column and diagonal.
# columns: n of those, range(n).
# NW-SE diagonals: 2n-1 of these, i-j unique and invariant along
# each, smallest i-j is 0-(n-1) = 1-n, so add n-1 to shift to 0-
# based.
# NE-SW diagonals: 2n-1 of these, i+j unique and invariant along
# each, smallest i+j is 0, largest is 2n-2.
# For each square, compute a bit vector of the columns and
# diagonals it covers, and for each row compute a function that
# generates the possibilities for the columns in that row.
self.rowgenerators = []
for i in rangen:
rowuses = [(1L << j) | # column ordinal
(1L << (n + i-j + n-1)) | # NW-SE ordinal
(1L << (n + 2*n-1 + i+j)) # NE-SW ordinal
for j in rangen]
def rowgen(rowuses=rowuses):
for j in rangen:
uses = rowuses[j]
if uses & self.used == 0:
self.used |= uses
yield j
self.used &= ~uses
self.rowgenerators.append(rowgen)
# Generate solutions.
def solve(self):
self.used = 0
for row2col in conjoin(self.rowgenerators):
yield row2col
def printsolution(self, row2col):
n = self.n
assert n == len(row2col)
sep = "+" + "-+" * n
print sep
for i in range(n):
squares = [" " for j in range(n)]
squares[row2col[i]] = "Q"
print "|" + "|".join(squares) + "|"
print sep
# A conjoin-based Knight's Tour solver. This is pretty sophisticated
# (e.g., when used with flat_conjoin above, and passing hard=1 to the
# constructor, a 200x200 Knight's Tour was found quickly -- note that we're
# creating 10s of thousands of generators then!), and is lengthy.
class Knights:
def __init__(self, m, n, hard=0):
self.m, self.n = m, n
# solve() will set up succs[i] to be a list of square #i's
# successors.
succs = self.succs = []
# Remove i0 from each of its successor's successor lists, i.e.
# successors can't go back to i0 again. Return 0 if we can
# detect this makes a solution impossible, else return 1.
def remove_from_successors(i0, len=len):
# If we remove all exits from a free square, we're dead:
# even if we move to it next, we can't leave it again.
# If we create a square with one exit, we must visit it next;
# else somebody else will have to visit it, and since there's
# only one adjacent, there won't be a way to leave it again.
# Finelly, if we create more than one free square with a
# single exit, we can only move to one of them next, leaving
# the other one a dead end.
ne0 = ne1 = 0
for i in succs[i0]:
s = succs[i]
s.remove(i0)
e = len(s)
if e == 0:
ne0 += 1
elif e == 1:
ne1 += 1
return ne0 == 0 and ne1 < 2
# Put i0 back in each of its successor's successor lists.
def add_to_successors(i0):
for i in succs[i0]:
succs[i].append(i0)
# Generate the first move.
def first():
if m < 1 or n < 1:
return
# Since we're looking for a cycle, it doesn't matter where we
# start. Starting in a corner makes the 2nd move easy.
corner = self.coords2index(0, 0)
remove_from_successors(corner)
self.lastij = corner
yield corner
add_to_successors(corner)
# Generate the second moves.
def second():
corner = self.coords2index(0, 0)
assert self.lastij == corner # i.e., we started in the corner
if m < 3 or n < 3:
return
assert len(succs[corner]) == 2
assert self.coords2index(1, 2) in succs[corner]
assert self.coords2index(2, 1) in succs[corner]
# Only two choices. Whichever we pick, the other must be the
# square picked on move m*n, as it's the only way to get back
# to (0, 0). Save its index in self.final so that moves before
# the last know it must be kept free.
for i, j in (1, 2), (2, 1):
this = self.coords2index(i, j)
final = self.coords2index(3-i, 3-j)
self.final = final
remove_from_successors(this)
succs[final].append(corner)
self.lastij = this
yield this
succs[final].remove(corner)
add_to_successors(this)
# Generate moves 3 thru m*n-1.
def advance(len=len):
# If some successor has only one exit, must take it.
# Else favor successors with fewer exits.
candidates = []
for i in succs[self.lastij]:
e = len(succs[i])
assert e > 0, "else remove_from_successors() pruning flawed"
if e == 1:
candidates = [(e, i)]
break
candidates.append((e, i))
else:
candidates.sort()
for e, i in candidates:
if i != self.final:
if remove_from_successors(i):
self.lastij = i
yield i
add_to_successors(i)
# Generate moves 3 thru m*n-1. Alternative version using a
# stronger (but more expensive) heuristic to order successors.
# Since the # of backtracking levels is m*n, a poor move early on
# can take eons to undo. Smallest square board for which this
# matters a lot is 52x52.
def advance_hard(vmid=(m-1)/2.0, hmid=(n-1)/2.0, len=len):
# If some successor has only one exit, must take it.
# Else favor successors with fewer exits.
# Break ties via max distance from board centerpoint (favor
# corners and edges whenever possible).
candidates = []
for i in succs[self.lastij]:
e = len(succs[i])
assert e > 0, "else remove_from_successors() pruning flawed"
if e == 1:
candidates = [(e, 0, i)]
break
i1, j1 = self.index2coords(i)
d = (i1 - vmid)**2 + (j1 - hmid)**2
candidates.append((e, -d, i))
else:
candidates.sort()
for e, d, i in candidates:
if i != self.final:
if remove_from_successors(i):
self.lastij = i
yield i
add_to_successors(i)
# Generate the last move.
def last():
assert self.final in succs[self.lastij]
yield self.final
if m*n < 4:
self.squaregenerators = [first]
else:
self.squaregenerators = [first, second] + \
[hard and advance_hard or advance] * (m*n - 3) + \
[last]
def coords2index(self, i, j):
assert 0 <= i < self.m
assert 0 <= j < self.n
return i * self.n + j
def index2coords(self, index):
assert 0 <= index < self.m * self.n
return divmod(index, self.n)
def _init_board(self):
succs = self.succs
del succs[:]
m, n = self.m, self.n
c2i = self.coords2index
offsets = [( 1, 2), ( 2, 1), ( 2, -1), ( 1, -2),
(-1, -2), (-2, -1), (-2, 1), (-1, 2)]
rangen = range(n)
for i in range(m):
for j in rangen:
s = [c2i(i+io, j+jo) for io, jo in offsets
if 0 <= i+io < m and
0 <= j+jo < n]
succs.append(s)
# Generate solutions.
def solve(self):
self._init_board()
for x in conjoin(self.squaregenerators):
yield x
def printsolution(self, x):
m, n = self.m, self.n
assert len(x) == m*n
w = len(str(m*n))
format = "%" + str(w) + "d"
squares = [[None] * n for i in range(m)]
k = 1
for i in x:
i1, j1 = self.index2coords(i)
squares[i1][j1] = format % k
k += 1
sep = "+" + ("-" * w + "+") * n
print sep
for i in range(m):
row = squares[i]
print "|" + "|".join(row) + "|"
print sep
conjoin_tests = """
Generate the 3-bit binary numbers in order. This illustrates dumbest-
possible use of conjoin, just to generate the full cross-product.
>>> for c in conjoin([lambda: iter((0, 1))] * 3):
... print c
[0, 0, 0]
[0, 0, 1]
[0, 1, 0]
[0, 1, 1]
[1, 0, 0]
[1, 0, 1]
[1, 1, 0]
[1, 1, 1]
For efficiency in typical backtracking apps, conjoin() yields the same list
object each time. So if you want to save away a full account of its
generated sequence, you need to copy its results.
>>> def gencopy(iterator):
... for x in iterator:
... yield x[:]
>>> for n in range(10):
... all = list(gencopy(conjoin([lambda: iter((0, 1))] * n)))
... print n, len(all), all[0] == [0] * n, all[-1] == [1] * n
0 1 True True
1 2 True True
2 4 True True
3 8 True True
4 16 True True
5 32 True True
6 64 True True
7 128 True True
8 256 True True
9 512 True True
And run an 8-queens solver.
>>> q = Queens(8)
>>> LIMIT = 2
>>> count = 0
>>> for row2col in q.solve():
... count += 1
... if count <= LIMIT:
... print "Solution", count
... q.printsolution(row2col)
Solution 1
+-+-+-+-+-+-+-+-+
|Q| | | | | | | |
+-+-+-+-+-+-+-+-+
| | | | |Q| | | |
+-+-+-+-+-+-+-+-+
| | | | | | | |Q|
+-+-+-+-+-+-+-+-+
| | | | | |Q| | |
+-+-+-+-+-+-+-+-+
| | |Q| | | | | |
+-+-+-+-+-+-+-+-+
| | | | | | |Q| |
+-+-+-+-+-+-+-+-+
| |Q| | | | | | |
+-+-+-+-+-+-+-+-+
| | | |Q| | | | |
+-+-+-+-+-+-+-+-+
Solution 2
+-+-+-+-+-+-+-+-+
|Q| | | | | | | |
+-+-+-+-+-+-+-+-+
| | | | | |Q| | |
+-+-+-+-+-+-+-+-+
| | | | | | | |Q|
+-+-+-+-+-+-+-+-+
| | |Q| | | | | |
+-+-+-+-+-+-+-+-+
| | | | | | |Q| |
+-+-+-+-+-+-+-+-+
| | | |Q| | | | |
+-+-+-+-+-+-+-+-+
| |Q| | | | | | |
+-+-+-+-+-+-+-+-+
| | | | |Q| | | |
+-+-+-+-+-+-+-+-+
>>> print count, "solutions in all."
92 solutions in all.
And run a Knight's Tour on a 10x10 board. Note that there are about
20,000 solutions even on a 6x6 board, so don't dare run this to exhaustion.
>>> k = Knights(10, 10)
>>> LIMIT = 2
>>> count = 0
>>> for x in k.solve():
... count += 1
... if count <= LIMIT:
... print "Solution", count
... k.printsolution(x)
... else:
... break
Solution 1
+---+---+---+---+---+---+---+---+---+---+
| 1| 58| 27| 34| 3| 40| 29| 10| 5| 8|
+---+---+---+---+---+---+---+---+---+---+
| 26| 35| 2| 57| 28| 33| 4| 7| 30| 11|
+---+---+---+---+---+---+---+---+---+---+
| 59|100| 73| 36| 41| 56| 39| 32| 9| 6|
+---+---+---+---+---+---+---+---+---+---+
| 74| 25| 60| 55| 72| 37| 42| 49| 12| 31|
+---+---+---+---+---+---+---+---+---+---+
| 61| 86| 99| 76| 63| 52| 47| 38| 43| 50|
+---+---+---+---+---+---+---+---+---+---+
| 24| 75| 62| 85| 54| 71| 64| 51| 48| 13|
+---+---+---+---+---+---+---+---+---+---+
| 87| 98| 91| 80| 77| 84| 53| 46| 65| 44|
+---+---+---+---+---+---+---+---+---+---+
| 90| 23| 88| 95| 70| 79| 68| 83| 14| 17|
+---+---+---+---+---+---+---+---+---+---+
| 97| 92| 21| 78| 81| 94| 19| 16| 45| 66|
+---+---+---+---+---+---+---+---+---+---+
| 22| 89| 96| 93| 20| 69| 82| 67| 18| 15|
+---+---+---+---+---+---+---+---+---+---+
Solution 2
+---+---+---+---+---+---+---+---+---+---+
| 1| 58| 27| 34| 3| 40| 29| 10| 5| 8|
+---+---+---+---+---+---+---+---+---+---+
| 26| 35| 2| 57| 28| 33| 4| 7| 30| 11|
+---+---+---+---+---+---+---+---+---+---+
| 59|100| 73| 36| 41| 56| 39| 32| 9| 6|
+---+---+---+---+---+---+---+---+---+---+
| 74| 25| 60| 55| 72| 37| 42| 49| 12| 31|
+---+---+---+---+---+---+---+---+---+---+
| 61| 86| 99| 76| 63| 52| 47| 38| 43| 50|
+---+---+---+---+---+---+---+---+---+---+
| 24| 75| 62| 85| 54| 71| 64| 51| 48| 13|
+---+---+---+---+---+---+---+---+---+---+
| 87| 98| 89| 80| 77| 84| 53| 46| 65| 44|
+---+---+---+---+---+---+---+---+---+---+
| 90| 23| 92| 95| 70| 79| 68| 83| 14| 17|
+---+---+---+---+---+---+---+---+---+---+
| 97| 88| 21| 78| 81| 94| 19| 16| 45| 66|
+---+---+---+---+---+---+---+---+---+---+
| 22| 91| 96| 93| 20| 69| 82| 67| 18| 15|
+---+---+---+---+---+---+---+---+---+---+
"""
weakref_tests = """\
Generators are weakly referencable:
>>> import weakref
>>> def gen():
... yield 'foo!'
...
>>> wr = weakref.ref(gen)
>>> wr() is gen
True
>>> p = weakref.proxy(gen)
Generator-iterators are weakly referencable as well:
>>> gi = gen()
>>> wr = weakref.ref(gi)
>>> wr() is gi
True
>>> p = weakref.proxy(gi)
>>> list(p)
['foo!']
"""
coroutine_tests = """\
Sending a value into a started generator:
>>> def f():
... print (yield 1)
... yield 2
>>> g = f()
>>> g.next()
1
>>> g.send(42)
42
2
Sending a value into a new generator produces a TypeError:
>>> f().send("foo")
Traceback (most recent call last):
...
TypeError: can't send non-None value to a just-started generator
Yield by itself yields None:
>>> def f(): yield
>>> list(f())
[None]
An obscene abuse of a yield expression within a generator expression:
>>> list((yield 21) for i in range(4))
[21, None, 21, None, 21, None, 21, None]
And a more sane, but still weird usage:
>>> def f(): list(i for i in [(yield 26)])
>>> type(f())
<type 'generator'>
A yield expression with augmented assignment.
>>> def coroutine(seq):
... count = 0
... while count < 200:
... count += yield
... seq.append(count)
>>> seq = []
>>> c = coroutine(seq)
>>> c.next()
>>> print seq
[]
>>> c.send(10)
>>> print seq
[10]
>>> c.send(10)
>>> print seq
[10, 20]
>>> c.send(10)
>>> print seq
[10, 20, 30]
Check some syntax errors for yield expressions:
>>> f=lambda: (yield 1),(yield 2)
Traceback (most recent call last):
...
File "<doctest test.test_generators.__test__.coroutine[21]>", line 1
SyntaxError: 'yield' outside function
>>> def f(): return lambda x=(yield): 1
Traceback (most recent call last):
...
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.coroutine[22]>, line 1)
>>> def f(): x = yield = y
Traceback (most recent call last):
...
File "<doctest test.test_generators.__test__.coroutine[23]>", line 1
SyntaxError: assignment to yield expression not possible
>>> def f(): (yield bar) = y
Traceback (most recent call last):
...
File "<doctest test.test_generators.__test__.coroutine[24]>", line 1
SyntaxError: can't assign to yield expression
>>> def f(): (yield bar) += y
Traceback (most recent call last):
...
File "<doctest test.test_generators.__test__.coroutine[25]>", line 1
SyntaxError: can't assign to yield expression
Now check some throw() conditions:
>>> def f():
... while True:
... try:
... print (yield)
... except ValueError,v:
... print "caught ValueError (%s)" % (v),
>>> import sys
>>> g = f()
>>> g.next()
>>> g.throw(ValueError) # type only
caught ValueError ()
>>> g.throw(ValueError("xyz")) # value only
caught ValueError (xyz)
>>> g.throw(ValueError, ValueError(1)) # value+matching type
caught ValueError (1)
>>> g.throw(ValueError, TypeError(1)) # mismatched type, rewrapped
caught ValueError (1)
>>> g.throw(ValueError, ValueError(1), None) # explicit None traceback
caught ValueError (1)
>>> g.throw(ValueError(1), "foo") # bad args
Traceback (most recent call last):
...
TypeError: instance exception may not have a separate value
>>> g.throw(ValueError, "foo", 23) # bad args
Traceback (most recent call last):
...
TypeError: throw() third argument must be a traceback object
>>> def throw(g,exc):
... try:
... raise exc
... except:
... g.throw(*sys.exc_info())
>>> throw(g,ValueError) # do it with traceback included
caught ValueError ()
>>> g.send(1)
1
>>> throw(g,TypeError) # terminate the generator
Traceback (most recent call last):
...
TypeError
>>> print g.gi_frame
None
>>> g.send(2)
Traceback (most recent call last):
...
StopIteration
>>> g.throw(ValueError,6) # throw on closed generator
Traceback (most recent call last):
...
ValueError: 6
>>> f().throw(ValueError,7) # throw on just-opened generator
Traceback (most recent call last):
...
ValueError: 7
>>> f().throw("abc") # throw on just-opened generator
Traceback (most recent call last):
...
TypeError: exceptions must be classes, or instances, not str
Now let's try closing a generator:
>>> def f():
... try: yield
... except GeneratorExit:
... print "exiting"
>>> g = f()
>>> g.next()
>>> g.close()
exiting
>>> g.close() # should be no-op now
>>> f().close() # close on just-opened generator should be fine
>>> def f(): yield # an even simpler generator
>>> f().close() # close before opening
>>> g = f()
>>> g.next()
>>> g.close() # close normally
And finalization:
>>> def f():
... try: yield
... finally:
... print "exiting"
>>> g = f()
>>> g.next()
>>> del g
exiting
>>> class context(object):
... def __enter__(self): pass
... def __exit__(self, *args): print 'exiting'
>>> def f():
... with context():
... yield
>>> g = f()
>>> g.next()
>>> del g
exiting
GeneratorExit is not caught by except Exception:
>>> def f():
... try: yield
... except Exception: print 'except'
... finally: print 'finally'
>>> g = f()
>>> g.next()
>>> del g
finally
Now let's try some ill-behaved generators:
>>> def f():
... try: yield
... except GeneratorExit:
... yield "foo!"
>>> g = f()
>>> g.next()
>>> g.close()
Traceback (most recent call last):
...
RuntimeError: generator ignored GeneratorExit
>>> g.close()
Our ill-behaved code should be invoked during GC:
>>> import sys, StringIO
>>> old, sys.stderr = sys.stderr, StringIO.StringIO()
>>> g = f()
>>> g.next()
>>> del g
>>> sys.stderr.getvalue().startswith(
... "Exception RuntimeError: 'generator ignored GeneratorExit' in "
... )
True
>>> sys.stderr = old
And errors thrown during closing should propagate:
>>> def f():
... try: yield
... except GeneratorExit:
... raise TypeError("fie!")
>>> g = f()
>>> g.next()
>>> g.close()
Traceback (most recent call last):
...
TypeError: fie!
Ensure that various yield expression constructs make their
enclosing function a generator:
>>> def f(): x += yield
>>> type(f())
<type 'generator'>
>>> def f(): x = yield
>>> type(f())
<type 'generator'>
>>> def f(): lambda x=(yield): 1
>>> type(f())
<type 'generator'>
>>> def f(): x=(i for i in (yield) if (yield))
>>> type(f())
<type 'generator'>
>>> def f(d): d[(yield "a")] = d[(yield "b")] = 27
>>> data = [1,2]
>>> g = f(data)
>>> type(g)
<type 'generator'>
>>> g.send(None)
'a'
>>> data
[1, 2]
>>> g.send(0)
'b'
>>> data
[27, 2]
>>> try: g.send(1)
... except StopIteration: pass
>>> data
[27, 27]
"""
refleaks_tests = """
Prior to adding cycle-GC support to itertools.tee, this code would leak
references. We add it to the standard suite so the routine refleak-tests
would trigger if it starts being uncleanable again.
>>> import itertools
>>> def leak():
... class gen:
... def __iter__(self):
... return self
... def next(self):
... return self.item
... g = gen()
... head, tail = itertools.tee(g)
... g.item = head
... return head
>>> it = leak()
Make sure to also test the involvement of the tee-internal teedataobject,
which stores returned items.
>>> item = it.next()
This test leaked at one point due to generator finalization/destruction.
It was copied from Lib/test/leakers/test_generator_cycle.py before the file
was removed.
>>> def leak():
... def gen():
... while True:
... yield g
... g = gen()
>>> leak()
This test isn't really generator related, but rather exception-in-cleanup
related. The coroutine tests (above) just happen to cause an exception in
the generator's __del__ (tp_del) method. We can also test for this
explicitly, without generators. We do have to redirect stderr to avoid
printing warnings and to doublecheck that we actually tested what we wanted
to test.
>>> import sys, StringIO
>>> old = sys.stderr
>>> try:
... sys.stderr = StringIO.StringIO()
... class Leaker:
... def __del__(self):
... raise RuntimeError
...
... l = Leaker()
... del l
... err = sys.stderr.getvalue().strip()
... err.startswith(
... "Exception RuntimeError: RuntimeError() in <"
... )
... err.endswith("> ignored")
... len(err.splitlines())
... finally:
... sys.stderr = old
True
True
1
These refleak tests should perhaps be in a testfile of their own,
test_generators just happened to be the test that drew these out.
"""
__test__ = {"tut": tutorial_tests,
"pep": pep_tests,
"email": email_tests,
"fun": fun_tests,
"syntax": syntax_tests,
"conjoin": conjoin_tests,
"weakref": weakref_tests,
"coroutine": coroutine_tests,
"refleaks": refleaks_tests,
}
# Magic test name that regrtest.py invokes *after* importing this module.
# This worms around a bootstrap problem.
# Note that doctest and regrtest both look in sys.argv for a "-v" argument,
# so this works as expected in both ways of running regrtest.
def test_main(verbose=None):
from test import test_support, test_generators
test_support.run_doctest(test_generators, verbose)
# This part isn't needed for regrtest, but for running the test directly.
if __name__ == "__main__":
test_main(1)
|
wang1352083/pythontool
|
python-2.7.12-lib/test/test_generators.py
|
Python
|
mit
| 50,769
|
[
"VisIt"
] |
808427b654a2cbdce5932942c6e671e0029fee997851f62cbcb7fae4b577ba4b
|
# -*- coding: utf-8 -*-
import sys
import os
import re
import time
"""
Python Nagios extensions
"""
__author__ = "Drew Stinnett"
__copyright__ = "Copyright 2008, Drew Stinnett"
__credits__ = ["Drew Stinnett", "Pall Sigurdsson"]
__license__ = "GPL"
__version__ = "0.4"
__maintainer__ = "Pall Sigurdsson"
__email__ = "palli@opensource.is"
__status__ = "Development"
def debug(text):
debug = True
if debug: print text
class config:
"""
Parse and write nagios config files
"""
def __init__(self, cfg_file = "/etc/nagios/nagios.cfg"):
self.cfg_file = cfg_file # Main configuration file
# If nagios.cfg is not set, lets do some minor autodiscover.
if self.cfg_file is None:
possible_files = ('/etc/nagios/nagios.cfg','/etc/nagios3/nagios.cfg','/usr/local/nagios/nagios.cfg','/nagios/etc/nagios/nagios.cfg')
for file in possible_files:
if os.path.isfile(file):
self.cfg_file = file
if not os.path.isfile(self.cfg_file):
raise ParserError("Main Nagios config not found. %s does not exist\n" % self.cfg_file)
def reset(self):
self.cfg_files = [] # List of other configuration files
self.data = {} # dict of every known object definition
self.errors = [] # List of ParserErrors
self.item_list = None
self.item_cache = None
self.maincfg_values = [] # The contents of main nagios.cfg
self.resource_values = [] # The contents of any resource_files
## This is a pure listof all the key/values in the config files. It
## shouldn't be useful until the items in it are parsed through with the proper
## 'use' relationships
self.pre_object_list = []
self.post_object_list = []
self.object_type_keys = {
'hostgroup':'hostgroup_name',
'hostextinfo':'host_name',
'host':'host_name',
'service':'name',
'servicegroup':'servicegroup_name',
'contact':'contact_name',
'contactgroup':'contactgroup_name',
'timeperiod':'timeperiod_name',
'command':'command_name',
#'service':['host_name','description'],
}
def _has_template(self, target):
"""
Determine if an item has a template associated with it
"""
if target.has_key('use'):
return True
else:
return None
def _get_hostgroup(self, hostgroup_name):
for hostgroup in self.data['all_hostgroup']:
if hostgroup.has_key('hostgroup_name') and hostgroup['hostgroup_name'] == hostgroup_name:
return hostgroup
return None
def _get_key(self, object_type, user_key = None):
"""
Return the correct 'key' for an item. This is mainly a helper method
for other methods in this class. It is used to shorten code repitition
"""
if not user_key and not self.object_type_keys.has_key(object_type):
raise ParserError("Unknown key for object type: %s\n" % object_type)
## Use a default key
if not user_key:
user_key = self.object_type_keys[object_type]
return user_key
def _get_item(self, item_name, item_type):
"""
Return an item from a list
"""
# create local cache for performance optimizations. TODO: Rewrite functions that call this function
if not self.item_list:
self.item_list = self.pre_object_list
self.item_cache = {}
for item in self.item_list:
if not item.has_key('name'):
continue
name = item['name']
tmp_item_type = (item['meta']['object_type'])
if not self.item_cache.has_key( tmp_item_type ):
self.item_cache[tmp_item_type] = {}
self.item_cache[tmp_item_type][name] = item
try:
return self.item_cache[item_type][item_name]
except:
return None
if self.item_cache[item_type].has_key(item_name):
return self.item_cache[item_type][item_name]
return None
for test_item in self.item_list:
## Skip items without a name
if not test_item.has_key('name'):
continue
## Make sure there isn't an infinite loop going on
try:
if (test_item['name'] == item_name) and (test_item['meta']['object_type'] == item_type):
return test_item
except:
raise ParserError("Loop detected, exiting", item=test_item)
## If we make it this far, it means there is no matching item
return None
def _apply_template(self, original_item):
"""
Apply all attributes of item named parent_name to "original_item".
"""
# TODO: Performance optimization. Don't recursively call _apply_template on hosts we have already
# applied templates to. This needs more work.
if not original_item.has_key('use'):
return original_item
object_type = original_item['meta']['object_type']
# Performance tweak, if item has been parsed. Lets not do it again
if original_item.has_key('name') and self.item_apply_cache[object_type].has_key( original_item['name'] ):
return self.item_apply_cache[object_type][ original_item['name'] ]
# End of performance tweak
parent_names = original_item['use'].split(',')
parent_items = []
for parent_name in parent_names:
parent_item = self._get_item( parent_name, object_type )
if parent_item == None:
error_string = "error in %s\n" % (original_item['meta']['filename'])
error_string = error_string + "Can not find any %s named %s\n" % (object_type,parent_name)
error_string = error_string + self.print_conf(original_item)
self.errors.append( ParserError(error_string,item=original_item) )
continue
# Parent item probably has use flags on its own. So lets apply to parent first
parent_item = self._apply_template( parent_item )
parent_items.append( parent_item )
for parent_item in parent_items:
for k,v in parent_item.iteritems():
if k == 'use':
continue
if k == 'register':
continue
if k == 'meta':
continue
if k == 'name':
continue
if not original_item['meta']['inherited_attributes'].has_key(k):
original_item['meta']['inherited_attributes'][k] = v
if not original_item.has_key(k):
original_item[k] = v
original_item['meta']['template_fields'].append(k)
if original_item.has_key('name'):
self.item_apply_cache[object_type][ original_item['name'] ] = original_item
return original_item
def _get_items_in_file(self, filename):
"""
Return all items in the given file
"""
return_list = []
for k in self.data.keys():
for item in self[k]:
if item['meta']['filename'] == filename:
return_list.append(item)
return return_list
def get_new_item(self, object_type, filename):
''' Returns an empty item with all necessary metadata '''
current = {}
current['meta'] = {}
current['meta']['object_type'] = object_type
current['meta']['filename'] = filename
current['meta']['template_fields'] = []
current['meta']['needs_commit'] = None
current['meta']['delete_me'] = None
current['meta']['defined_attributes'] = {}
current['meta']['inherited_attributes'] = {}
current['meta']['raw_definition'] = ""
return current
def _load_file(self, filename):
## Set globals (This is stolen from the perl module)
append = ""
type = None
current = None
in_definition = {}
tmp_buffer = []
for line in open(filename, 'rb').readlines():
## Cleanup and line skips
line = line.strip()
if line == "":
continue
if line[0] == "#" or line[0] == ';':
continue
# append saved text to the current line
if append:
append += ' '
line = append + line;
append = None
# end of object definition
if line.find("}") != -1:
in_definition = None
append = line.split("}", 1)[1]
tmp_buffer.append( line )
try:
current['meta']['raw_definition'] = '\n'.join( tmp_buffer )
except:
print "hmm?"
self.pre_object_list.append(current)
## Destroy the Nagios Object
current = None
continue
# beginning of object definition
boo_re = re.compile("define\s+(\w+)\s*{?(.*)$")
m = boo_re.search(line)
if m:
tmp_buffer = [line]
object_type = m.groups()[0]
current = self.get_new_item(object_type, filename)
if in_definition:
raise ParserError("Error: Unexpected start of object definition in file '%s' on line $line_no. Make sure you close preceding objects before starting a new one.\n" % filename)
## Start off an object
in_definition = True
append = m.groups()[1]
continue
else:
tmp_buffer.append( ' ' + line )
## save whatever's left in the buffer for the next iteration
if not in_definition:
append = line
continue
## this is an attribute inside an object definition
if in_definition:
#(key, value) = line.split(None, 1)
tmp = line.split(None, 1)
if len(tmp) > 1:
(key, value) = tmp
else:
key = tmp[0]
value = ""
## Strip out in-line comments
if value.find(";") != -1:
value = value.split(";", 1)[0]
## Clean info
key = key.strip()
value = value.strip()
## Rename some old values that may be in the configuration
## This can probably be removed in the future to increase performance
if (current['meta']['object_type'] == 'service') and key == 'description':
key = 'service_description'
current[key] = value
current['meta']['defined_attributes'][key] = value
## Something is wrong in the config
else:
raise ParserError("Error: Unexpected token in file '%s'" % filename)
## Something is wrong in the config
if in_definition:
raise ParserError("Error: Unexpected EOF in file '%s'" % filename)
def _locate_item(self, item):
"""
This is a helper function for anyone who wishes to modify objects. It takes "item", locates the
file which is configured in, and locates exactly the lines which contain that definition.
Returns tuple:
(everything_before, object_definition, everything_after, filename)
everything_before(string) - Every line in filename before object was defined
everything_after(string) - Every line in "filename" after object was defined
object_definition - exact configuration of the object as it appears in "filename"
filename - file in which the object was written to
Raises:
ValueError if object was not found in "filename"
"""
if item['meta'].has_key("filename"):
filename = item['meta']['filename']
else:
raise ValueError("item does not have a filename")
file = open(filename)
object_has_been_found = False
everything_before = [] # Every line before our object definition
everything_after = [] # Every line after our object definition
object_definition = [] # List of every line of our object definition
i_am_within_definition = False
for line in file.readlines():
if object_has_been_found:
'If we have found an object, lets just spool to the end'
everything_after.append( line )
continue
tmp = line.split(None, 1)
if len(tmp) == 0:
'empty line'
keyword = ''
rest = ''
if len(tmp) == 1:
'single word on the line'
keyword = tmp[0]
rest = ''
if len(tmp) > 1:
keyword,rest = tmp[0],tmp[1]
keyword = keyword.strip()
# If we reach a define statement, we log every line to a special buffer
# When define closes, we parse the object and see if it is the object we
# want to modify
if keyword == 'define':
current_object_type = rest.split(None,1)[0]
current_object_type = current_object_type.strip(';')
current_object_type = current_object_type.strip('{')
current_object_type = current_object_type.strip()
tmp_buffer = []
i_am_within_definition = True
if i_am_within_definition == True:
tmp_buffer.append( line )
else:
everything_before.append( line )
if len(keyword) > 0 and keyword[0] == '}':
i_am_within_definition = False
current_definition = self.get_new_item(object_type=current_object_type, filename=filename)
for i in tmp_buffer:
i = i.strip()
tmp = i.split(None, 1)
if len(tmp) == 1:
k = tmp[0]
v = ''
elif len(tmp) > 1:
k,v = tmp[0],tmp[1]
v = v.split(';',1)[0]
v = v.strip()
else: continue # skip empty lines
if k.startswith('#'): continue
if k.startswith(';'): continue
if k.startswith('define'): continue
if k.startswith('}'): continue
current_definition[k] = v
current_definition = self._apply_template(current_definition)
# Compare objects
if self.compareObjects( item, current_definition ) == True:
'This is the object i am looking for'
object_has_been_found = True
object_definition = tmp_buffer
else:
'This is not the item you are looking for'
everything_before += tmp_buffer
if object_has_been_found:
return (everything_before, object_definition, everything_after, filename)
else:
raise ValueError("We could not find object in %s\n%s" % (filename,item))
def _modify_object(self, item, field_name=None, new_value=None, new_field_name=None, new_item=None, make_comments=True):
'''
Helper function for object_* functions. Locates "item" and changes the line which contains field_name.
If new_value and new_field_name are both None, the attribute is removed.
Arguments:
item(dict) -- The item to be modified
field_name(str) -- The field_name to modify (if any)
new_field_name(str) -- If set, field_name will be renamed
new_value(str) -- If set the value of field_name will be changed
new_item(str) -- If set, whole object will be replaced with this string
make_comments -- If set, put pynag-branded comments where changes have been made
Returns:
True on success
Raises:
ValueError if object or field_name is not found
IOError is save is unsuccessful.
'''
if field_name is None and new_item is None:
raise ValueError("either field_name or new_item must be set")
everything_before,object_definition, everything_after, filename = self._locate_item(item)
if new_item is not None:
'We have instruction on how to write new object, so we dont need to parse it'
change = True
object_definition = [new_item]
else:
change = None
for i in range( len(object_definition)):
tmp = object_definition[i].split(None, 1)
if len(tmp) == 0: continue
if len(tmp) == 1: value = ''
if len(tmp) == 2: value = tmp[1]
k = tmp[0].strip()
if k == field_name:
'Attribute was found, lets change this line'
if not new_field_name and not new_value:
'We take it that we are supposed to remove this attribute'
change = object_definition.pop(i)
break
elif new_field_name:
'Field name has changed'
k = new_field_name
if new_value:
'value has changed '
value = new_value
# Here we do the actual change
change = "\t%-30s%s\n" % (k, value)
object_definition[i] = change
break
if not change:
'Attribute was not found. Lets add it'
change = "\t%-30s%s\n" % (field_name, new_value)
object_definition.insert(i,change)
# Lets put a banner in front of our item
if make_comments:
comment = '# Edited by PyNag on %s\n' % time.ctime()
if len(everything_before) > 0:
last_line_before = everything_before[-1]
if last_line_before.startswith('# Edited by PyNag on'):
everything_before.pop() # remove this line
object_definition.insert(0, comment )
# Here we overwrite the config-file, hoping not to ruin anything
buffer = "%s%s%s" % (''.join(everything_before), ''.join(object_definition), ''.join(everything_after))
file = open(filename,'w')
file.write( buffer )
file.close()
return True
def item_rewrite(self, item, str_new_item):
"""
Completely rewrites item with string provided.
Arguments:
item -- Item that is to be rewritten
str_new_item -- str representation of the new item
Examples:
item_rewrite( item, "define service {\n name example-service \n register 0 \n }\n" )
Returns:
True on success
Raises:
ValueError if object is not found
IOError if save fails
"""
return self._modify_object(item=item, new_item=str_new_item)
def item_remove(self, item):
"""
Completely rewrites item with string provided.
Arguments:
item -- Item that is to be rewritten
str_new_item -- str representation of the new item
Examples:
item_rewrite( item, "define service {\n name example-service \n register 0 \n }\n" )
Returns:
True on success
Raises:
ValueError if object is not found
IOError if save fails
"""
return self._modify_object(item=item, new_item="")
def item_edit_field(self, item, field_name, new_value):
"""
Modifies one field of a (currently existing) object. Changes are immediate (i.e. there is no commit)
Example usage:
edit_object( item, field_name="host_name", new_value="examplehost.example.com")
Returns:
True on success
Raises:
ValueError if object is not found
IOError if save fails
"""
return self._modify_object(item, field_name=field_name, new_value=new_value)
def item_remove_field(self, item, field_name):
"""
Removes one field of a (currently existing) object. Changes are immediate (i.e. there is no commit)
Example usage:
item_remove_field( item, field_name="contactgroups" )
Returns:
True on success
Raises:
ValueError if object is not found
IOError if save fails
"""
return self._modify_object(item=item, field_name=field_name, new_value=None, new_field_name=None)
def item_rename_field(self, item, old_field_name, new_field_name):
"""
Renames a field of a (currently existing) item. Changes are immediate (i.e. there is no commit).
Example usage:
item_rename_field(item, old_field_name="normal_check_interval", new_field_name="check_interval")
Returns:
True on success
Raises:
ValueError if object is not found
IOError if save fails
"""
return self._modify_object(item=item, field_name=old_field_name, new_field_name=new_field_name)
def item_add(self, item, filename):
"""
Adds a new object to a specified config file
Arguments:
item -- Item to be created
filename -- Filename that we are supposed to write to
Returns:
True on success
Raises:
IOError on failed save
"""
if not 'meta' in item:
item['meta'] = {}
item['meta']['filename'] = filename
# Create directory if it does not already exist
dirname = os.path.dirname(filename)
if not os.path.isdir(dirname):
os.makedirs(dirname)
buffer = self.print_conf( item )
file = open(filename,'a')
file.write( buffer )
file.close()
return True
def edit_object(self,item, field_name, new_value):
"""
Modifies a (currently existing) item. Changes are immediate (i.e. there is no commit)
Example Usage: edit_object( item, field_name="host_name", new_value="examplehost.example.com")
THIS FUNCTION IS DEPRECATED. USE item_edit_field() instead
"""
return self.item_edit_field(item=item, field_name=field_name, new_value=new_value)
def compareObjects(self, item1, item2):
"""
Compares two items. Returns true if they are equal"
"""
keys1 = item1.keys()
keys2 = item2.keys()
keys1.sort()
keys2.sort()
result=True
if keys1 != keys2:
return False
for key in keys1:
if key == 'meta': continue
key1 = item1[key]
key2 = item2[key]
# For our purpose, 30 is equal to 30.000
if key == 'check_interval':
key1 = int(float(key1))
key2 = int(float(key2))
if key1 != key2:
result = False
if result == False: return False
return True
def edit_service(self, target_host, service_description, field_name, new_value):
"""
Edit a service's attributes
"""
original_object = self.get_service(target_host, service_description)
if original_object == None:
raise ParserError("Service not found")
return config.edit_object( original_object, field_name, new_value)
def _get_list(self, object, key):
"""
Return a comma list from an item
Example:
_get_list(Foo_object, host_name)
define service {
service_description Foo
host_name larry,curly,moe
}
return
['larry','curly','moe']
"""
if type(object) != type({}):
raise ParserError("%s is not a dictionary\n" % object)
# return []
if not object.has_key(key):
return []
return_list = []
if object[key].find(",") != -1:
for name in object[key].split(","):
return_list.append(name)
else:
return_list.append(object[key])
## Alphabetize
return_list.sort()
return return_list
def delete_object(self, object_type, object_name, user_key = None):
"""
Delete object from configuration files.
"""
object_key = self._get_key(object_type,user_key)
target_object = None
k = 'all_%s' % object_type
for item in self.data[k]:
if not item.has_key(object_key):
continue
## If the object matches, mark it for deletion
if item[object_key] == object_name:
self.data[k].remove(item)
item['meta']['delete_me'] = True
item['meta']['needs_commit'] = True
self.data[k].append(item)
## Commit the delete
self.commit()
return True
## Only make it here if the object isn't found
return None
def delete_service(self, service_description, host_name):
"""
Delete service from configuration
"""
for item in self.data['all_service']:
if (item['service_description'] == service_description) and (host_name in self._get_active_hosts(item)):
self.data['all_service'].remove(item)
item['meta']['delete_me'] = True
item['meta']['needs_commit'] = True
self.data['all_service'].append(item)
return True
def delete_host(self, object_name, user_key = None):
"""
Delete a host
"""
return self.delete_object('host',object_name, user_key = user_key)
def delete_hostgroup(self, object_name, user_key = None):
"""
Delete a hostgroup
"""
return self.delete_object('hostgroup',object_name, user_key = user_key)
def get_object(self, object_type, object_name, user_key = None):
"""
Return a complete object dictionary
"""
object_key = self._get_key(object_type,user_key)
target_object = None
#print object_type
for item in self.data['all_%s' % object_type]:
## Skip items without the specified key
if not item.has_key(object_key):
continue
if item[object_key] == object_name:
target_object = item
## This is for multi-key items
return target_object
def get_host(self, object_name, user_key = None):
"""
Return a host object
"""
return self.get_object('host',object_name, user_key = user_key)
def get_servicegroup(self, object_name, user_key = None):
"""
Return a Servicegroup object
"""
return self.get_object('servicegroup',object_name, user_key = user_key)
def get_contact(self, object_name, user_key = None):
"""
Return a Contact object
"""
return self.get_object('contact',object_name, user_key = user_key)
def get_contactgroup(self, object_name, user_key = None):
"""
Return a Contactgroup object
"""
return self.get_object('contactgroup',object_name, user_key = user_key)
def get_timeperiod(self, object_name, user_key = None):
"""
Return a Timeperiod object
"""
return self.get_object('timeperiod',object_name, user_key = user_key)
def get_command(self, object_name, user_key = None):
"""
Return a Command object
"""
return self.get_object('command',object_name, user_key = user_key)
def get_hostgroup(self, object_name, user_key = None):
"""
Return a hostgroup object
"""
return self.get_object('hostgroup',object_name, user_key = user_key)
def get_service(self, target_host, service_description):
"""
Return a service object. This has to be seperate from the 'get_object'
method, because it requires more than one key
"""
for item in self.data['all_service']:
## Skip service with no service_description
if not item.has_key('service_description'):
continue
## Skip non-matching services
if item['service_description'] != service_description:
continue
if target_host in self._get_active_hosts(item):
return item
return None
def _append_use(self, source_item, name):
"""
Append any unused values from 'name' to the dict 'item'
"""
## Remove the 'use' key
if source_item.has_key('use'):
del source_item['use']
for possible_item in self.pre_object_list:
if possible_item.has_key('name'):
## Start appending to the item
for k,v in possible_item.iteritems():
try:
if k == 'use':
source_item = self._append_use(source_item, v)
except:
raise ParserError("Recursion error on %s %s" % (source_item, v) )
## Only add the item if it doesn't already exist
if not source_item.has_key(k):
source_item[k] = v
return source_item
def _post_parse(self):
self.item_list = None
self.item_apply_cache = {} # This is performance tweak used by _apply_template
for raw_item in self.pre_object_list:
# Performance tweak, make sure hashmap exists for this object_type
object_type = raw_item['meta']['object_type']
if not self.item_apply_cache.has_key( object_type ):
self.item_apply_cache[ object_type ] = {}
# Tweak ends
if raw_item.has_key('use'):
raw_item = self._apply_template( raw_item )
self.post_object_list.append(raw_item)
## Add the items to the class lists.
for list_item in self.post_object_list:
type_list_name = "all_%s" % list_item['meta']['object_type']
if not self.data.has_key(type_list_name):
self.data[type_list_name] = []
self.data[type_list_name].append(list_item)
def commit(self):
"""
Write any changes that have been made to it's appropriate file
"""
## Loops through ALL items
for k in self.data.keys():
for item in self[k]:
## If the object needs committing, commit it!
if item['meta']['needs_commit']:
## Create file contents as an empty string
file_contents = ""
## find any other items that may share this config file
extra_items = self._get_items_in_file(item['meta']['filename'])
if len(extra_items) > 0:
for commit_item in extra_items:
## Ignore files that are already set to be deleted:w
if commit_item['meta']['delete_me']:
continue
## Make sure we aren't adding this thing twice
if item != commit_item:
file_contents += self.print_conf(commit_item)
## This is the actual item that needs commiting
if not item['meta']['delete_me']:
file_contents += self.print_conf(item)
## Write the file
f = open(item['meta']['filename'], 'w')
f.write(file_contents)
f.close()
## Recreate the item entry without the commit flag
self.data[k].remove(item)
item['meta']['needs_commit'] = None
self.data[k].append(item)
def flag_all_commit(self):
"""
Flag every item in the configuration to be committed
This should probably only be used for debugging purposes
"""
for k in self.data.keys():
index = 0
for item in self[k]:
self.data[k][index]['meta']['needs_commit'] = True
index += 1
def print_conf(self, item):
"""
Return a string that can be used in a configuration file
"""
output = ""
## Header, to go on all files
output += "# Configuration file %s\n" % item['meta']['filename']
output += "# Edited by PyNag on %s\n" % time.ctime()
## Some hostgroup information
if item['meta'].has_key('hostgroup_list'):
output += "# Hostgroups: %s\n" % ",".join(item['meta']['hostgroup_list'])
## Some hostgroup information
if item['meta'].has_key('service_list'):
output += "# Services: %s\n" % ",".join(item['meta']['service_list'])
## Some hostgroup information
if item['meta'].has_key('service_members'):
output += "# Service Members: %s\n" % ",".join(item['meta']['service_members'])
if len(item['meta']['template_fields']) != 0:
output += "# Values from templates:\n"
for k in item['meta']['template_fields']:
output += "#\t %-30s %-30s\n" % (k, item[k])
output += "\n"
output += "define %s {\n" % item['meta']['object_type']
for k, v in item.iteritems():
if k != 'meta':
if k not in item['meta']['template_fields']:
output += "\t %-30s %-30s\n" % (k,v)
output += "}\n\n"
return output
def _load_static_file(self, filename):
"""Load a general config file (like nagios.cfg) that has key=value config file format. Ignore comments
Returns: a [ (key,value), (key,value) ] list
"""
result = []
for line in open(filename).readlines():
## Strip out new line characters
line = line.strip()
## Skip blank lines
if line == "":
continue
## Skip comments
if line[0] == "#" or line[0] == ';':
continue
key, value = line.split("=", 1)
result.append( (key, value) )
return result
def needs_reload(self):
"Returns True if Nagios service needs reload of cfg files"
new_timestamps = self.get_timestamps()
for k,v in self.maincfg_values:
if k == 'lock_file': lockfile = v
if not os.path.isfile(lockfile): return False
lockfile = new_timestamps.pop(lockfile)
for k,v in new_timestamps.items():
if int(v) > lockfile: return True
return False
def needs_reparse(self):
"Returns True if any Nagios configuration file has changed since last parse()"
new_timestamps = self.get_timestamps()
if len(new_timestamps) != len( self.timestamps ):
return True
for k,v in new_timestamps.items():
if self.timestamps[k] != v:
return True
return False
def parse(self):
"""
Load the nagios.cfg file and parse it up
"""
# reset
self.reset()
self.maincfg_values = self._load_static_file(self.cfg_file)
self.cfg_files = self.get_cfg_files()
self.resource_values = self.get_resources()
self.timestamps = self.get_timestamps()
## This loads everything into
for cfg_file in self.cfg_files:
self._load_file(cfg_file)
self._post_parse()
def get_timestamps(self):
"Returns a hash map of all nagios related files and their timestamps"
files = {}
files[self.cfg_file] = None
for k,v in self.maincfg_values:
if k == 'resource_file' or k == 'lock_file':
files[v] = None
for i in self.get_cfg_files():
files[i] = None
# Now lets lets get timestamp of every file
for k,v in files.items():
if not os.path.isfile(k): continue
files[k] = os.stat(k).st_mtime
return files
def get_resources(self):
"Returns a list of every private resources from nagios.cfg"
resources = []
for config_object,config_value in self.maincfg_values:
if config_object == 'resource_file' and os.path.isfile(config_value):
resources += self._load_static_file(config_value)
return resources
def extended_parse(self):
"""
This parse is used after the initial parse() command is run. It is
only needed if you want extended meta information about hosts or other objects
"""
## Do the initial parsing
self.parse()
## First, cycle through the hosts, and append hostgroup information
index = 0
for host in self.data['all_host']:
if host.has_key('register') and host['register'] == '0': continue
if not host.has_key('host_name'): continue
if not self.data['all_host'][index]['meta'].has_key('hostgroup_list'):
self.data['all_host'][index]['meta']['hostgroup_list'] = []
## Append any hostgroups that are directly listed in the host definition
if host.has_key('hostgroups'):
for hostgroup_name in self._get_list(host, 'hostgroups'):
if not self.data['all_host'][index]['meta'].has_key('hostgroup_list'):
self.data['all_host'][index]['meta']['hostgroup_list'] = []
if hostgroup_name not in self.data['all_host'][index]['meta']['hostgroup_list']:
self.data['all_host'][index]['meta']['hostgroup_list'].append(hostgroup_name)
## Append any services which reference this host
service_list = []
for service in self.data['all_service']:
if service.has_key('register') and service['register'] == '0': continue
if not service.has_key('service_description'): continue
if host['host_name'] in self._get_active_hosts(service):
service_list.append(service['service_description'])
self.data['all_host'][index]['meta']['service_list'] = service_list
## Increment count
index += 1
## Loop through all hostgroups, appending them to their respective hosts
for hostgroup in self.data['all_hostgroup']:
for member in self._get_list(hostgroup,'members'):
index = 0
for host in self.data['all_host']:
if not host.has_key('host_name'): continue
## Skip members that do not match
if host['host_name'] == member:
## Create the meta var if it doesn' exist
if not self.data['all_host'][index]['meta'].has_key('hostgroup_list'):
self.data['all_host'][index]['meta']['hostgroup_list'] = []
if hostgroup['hostgroup_name'] not in self.data['all_host'][index]['meta']['hostgroup_list']:
self.data['all_host'][index]['meta']['hostgroup_list'].append(hostgroup['hostgroup_name'])
## Increment count
index += 1
## Expand service membership
index = 0
for service in self.data['all_service']:
service_members = []
## Find a list of hosts to negate from the final list
self.data['all_service'][index]['meta']['service_members'] = self._get_active_hosts(service)
## Increment count
index += 1
def _get_active_hosts(self, object):
"""
Given an object, return a list of active hosts. This will exclude hosts that ar negated with a "!"
"""
## First, generate the negation list
negate_hosts = []
## Hostgroups
if object.has_key("hostgroup_name"):
for hostgroup_name in self._get_list(object, 'hostgroup_name'):
if hostgroup_name[0] == "!":
hostgroup_obj = self.get_hostgroup(hostgroup_name[1:])
negate_hosts.extend(self._get_list(hostgroup_obj,'members'))
## Host Names
if object.has_key("host_name"):
for host_name in self._get_list(object, 'host_name'):
if host_name[0] == "!":
negate_hosts.append(host_name[1:])
## Now get hosts that are actually listed
active_hosts = []
## Hostgroups
if object.has_key("hostgroup_name"):
for hostgroup_name in self._get_list(object, 'hostgroup_name'):
if hostgroup_name[0] != "!":
active_hosts.extend(self._get_list(self.get_hostgroup(hostgroup_name),'members'))
## Host Names
if object.has_key("host_name"):
for host_name in self._get_list(object, 'host_name'):
if host_name[0] != "!":
active_hosts.append(host_name)
## Combine the lists
return_hosts = []
for active_host in active_hosts:
if active_host not in negate_hosts:
return_hosts.append(active_host)
return return_hosts
def get_cfg_files(self):
"""
Return a list of all cfg files used in this configuration
Example:
print get_cfg_files()
['/etc/nagios/hosts/host1.cfg','/etc/nagios/hosts/host2.cfg',...]
"""
cfg_files = []
for config_object, config_value in self.maincfg_values:
## Add cfg_file objects to cfg file list
if config_object == "cfg_file" and os.path.isfile(config_value):
cfg_files.append(config_value)
## Parse all files in a cfg directory
if config_object == "cfg_dir":
directories = []
raw_file_list = []
directories.append( config_value )
# Walk through every subdirectory and add to our list
while len(directories) > 0:
current_directory = directories.pop(0)
# Nagios doesnt care if cfg_dir exists or not, so why should we ?
if not os.path.isdir( current_directory ): continue
list = os.listdir(current_directory)
for item in list:
# Append full path to file
item = "%s" % (os.path.join(current_directory, item.strip() ) )
if os.path.islink( item ):
item = os.readlink( item )
if os.path.isdir(item):
directories.append( item )
if raw_file_list.count( item ) < 1:
raw_file_list.append( item )
for raw_file in raw_file_list:
if raw_file.endswith('.cfg'):
if os.path.exists(raw_file):
'Nagios doesnt care if cfg_file exists or not, so we will not throws errors'
cfg_files.append(raw_file)
return cfg_files
def get_object_types(self):
''' Returns a list of all discovered object types '''
return map(lambda x: re.sub("all_","", x), self.data.keys())
def cleanup(self):
"""
This cleans up dead configuration files
"""
for filename in self.cfg_files:
if os.path.isfile(filename):
size = os.stat(filename)[6]
if size == 0:
os.remove(filename)
return True
def __setitem__(self, key, item):
self.data[key] = item
def __getitem__(self, key):
return self.data[key]
class status:
def __init__(self, filename = "/var/log/nagios/status.dat"):
if not os.path.isfile(filename):
raise ParserError("status.dat file %s not found." % filename)
self.filename = filename
self.data = {}
def parse(self):
## Set globals (This is stolen from the perl module)
type = None
for line in open(self.filename, 'rb').readlines():
## Cleanup and line skips
line = line.strip()
if line == "":
continue
if line[0] == "#" or line[0] == ';':
continue
if line.find("{") != -1:
status = {}
status['meta'] = {}
status['meta']['type'] = line.split("{")[0].strip()
continue
if line.find("}") != -1:
if not self.data.has_key(status['meta']['type']):
self.data[status['meta']['type']] = []
self.data[status['meta']['type']].append(status)
continue
(key, value) = line.split("=", 1)
status[key] = value
def __setitem__(self, key, item):
self.data[key] = item
def __getitem__(self, key):
return self.data[key]
class ParserError(Exception):
def __init__(self, message, item=None):
self.message = message
self.item = item
def __str__(self):
return repr(self.message)
if __name__ == '__main__':
c=config('/etc/nagios/nagios.cfg')
c.parse()
print c.get_object_types()
print c.needs_reload()
#for i in c.data['all_host']:
# print i['meta']
|
evilchili/nagiosnmapper
|
pynag/Parsers/__init__.py
|
Python
|
bsd-2-clause
| 37,674
|
[
"MOE"
] |
330419632e43cf0e951fd145b85b88b2331e4108da0af92595ff149da28edd58
|
# Copyright (c) 2012, GlaxoSmithKline Research & Development Ltd.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of GlaxoSmithKline Research & Development Ltd.
# nor the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Created by Jameed Hussain, September 2012
from __future__ import print_function
import sys
import re
from rdkit import Chem
from optparse import OptionParser
def heavy_atom_count(smi):
m = Chem.MolFromSmiles(smi)
return m.GetNumAtoms()
def add_to_index(smi,attachments,cmpd_heavy):
result = False
core_size = heavy_atom_count(smi) - attachments
if(use_ratio):
core_ratio = float(core_size) / float(cmpd_heavy)
if(core_ratio <= ratio ):
result = True
else:
if(core_size <= max_size):
result = True
return result
def get_symmetry_class(smi):
symmetry = []
m = Chem.MolFromSmiles(smi)
#determine the symmetry class
#see: http://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg01894.html
#A thanks to Greg (and Alan)
Chem.AssignStereochemistry(m,cleanIt=True,force=True,flagPossibleStereoCenters=True)
#get the symmetry class of the attachements points
#Note: 1st star is the zero index,
#2nd star is first index, etc
for atom in m.GetAtoms():
if(atom.GetMass() == 0):
symmetry.append(atom.GetProp('_CIPRank'))
return symmetry
def cansmirk(lhs,rhs,context):
#cansmirk algorithm
#1) cansmi the LHS.
#2) For the LHS the 1st star will have label 1, 2nd star will have label 2 and so on
#3) Do a symmetry check of lhs and rhs and use that to decide if the labels on
# RHS or/and context need to change.
#4) For the rhs, if you have a choice (ie. two attachement points are symmetrically
# equivalent), always put the label with lower numerical value on the earlier
# attachement point on the cansmi-ed smiles
#print "in: %s,%s" % (lhs,rhs)
isotope_track={}
#if the star count of lhs/context/rhs is 1, single cut
stars = lhs.count("*")
if(stars > 1):
#get the symmetry class of stars of lhs and rhs
lhs_sym = get_symmetry_class(lhs)
rhs_sym = get_symmetry_class(rhs)
#deal with double cuts
if(stars == 2):
#simple cases
#unsymmetric lhs and unsymmetric rhs
if( (lhs_sym[0] != lhs_sym[1]) and (rhs_sym[0] != rhs_sym[1]) ):
#get 1st and 2nd labels and store the new label for it in isotope_track
#structure: isotope_track[old_label]=new_label (as strings)
isotope_track = build_track_dictionary(lhs,stars)
#switch labels using isotope track
lhs = switch_labels_on_position(lhs)
rhs = switch_labels(isotope_track,stars,rhs)
context = switch_labels(isotope_track,stars,context)
#symmetric lhs and symmetric rhs
elif( (lhs_sym[0] == lhs_sym[1]) and (rhs_sym[0] == rhs_sym[1]) ):
#the points are all equivalent so change labels on lhs and rhs based on position
#labels on context don't need to change
lhs = switch_labels_on_position(lhs)
rhs = switch_labels_on_position(rhs)
#more difficult cases..
#symmetric lhs and unsymmetric rhs
elif( (lhs_sym[0] == lhs_sym[1]) and (rhs_sym[0] != rhs_sym[1]) ):
#switch labels lhs based on position
lhs = switch_labels_on_position(lhs)
#change labels on rhs based on position but need to record
#the changes as need to appy them to the context
isotope_track = build_track_dictionary(rhs,stars)
rhs = switch_labels_on_position(rhs)
context = switch_labels(isotope_track,stars,context)
#unsymmetric lhs and symmetric rhs
elif( (lhs_sym[0] != lhs_sym[1]) and (rhs_sym[0] == rhs_sym[1]) ):
#change labels on lhs based on position but need to record
#the changes as need to appy them to the context
isotope_track = build_track_dictionary(lhs,stars)
lhs = switch_labels_on_position(lhs)
context = switch_labels(isotope_track,stars,context)
#as rhs is symmetric, positions are equivalent so change labels on position
rhs = switch_labels_on_position(rhs)
#deal with triple cut
#unwieldy code but most readable I can make it
elif(stars == 3):
#simple cases
#completely symmetric lhs and completely symmetric rhs
if( ( (lhs_sym[0] == lhs_sym[1]) and (lhs_sym[1] == lhs_sym[2]) and (lhs_sym[0] == lhs_sym[2]) ) and
( (rhs_sym[0] == rhs_sym[1]) and (rhs_sym[1] == rhs_sym[2]) and (rhs_sym[0] == rhs_sym[2]) ) ):
#the points are all equivalent so change labels on lhs and rhs based on position
#labels on context don't need to change
lhs = switch_labels_on_position(lhs)
rhs = switch_labels_on_position(rhs)
#completely symmetric lhs and completely unsymmetric rhs
elif( ( (lhs_sym[0] == lhs_sym[1]) and (lhs_sym[1] == lhs_sym[2]) and (lhs_sym[0] == lhs_sym[2]) ) and
( (rhs_sym[0] != rhs_sym[1]) and (rhs_sym[1] != rhs_sym[2]) and (rhs_sym[0] != rhs_sym[2]) ) ):
#alter lhs in usual way
lhs = switch_labels_on_position(lhs)
#change labels on rhs based on position but need to record
#the changes as need to appy them to the context
isotope_track = build_track_dictionary(rhs,stars)
rhs = switch_labels_on_position(rhs)
context = switch_labels(isotope_track,stars,context)
#completely unsymmetric lhs and completely unsymmetric rhs
elif( ( (lhs_sym[0] != lhs_sym[1]) and (lhs_sym[1] != lhs_sym[2]) and (lhs_sym[0] != lhs_sym[2]) ) and
( (rhs_sym[0] != rhs_sym[1]) and (rhs_sym[1] != rhs_sym[2]) and (rhs_sym[0] != rhs_sym[2]) ) ):
#build the isotope track
isotope_track = build_track_dictionary(lhs,stars)
#alter lhs in usual way
lhs = switch_labels_on_position(lhs)
#change rhs and context based on isotope_track
rhs = switch_labels(isotope_track,stars,rhs)
context = switch_labels(isotope_track,stars,context)
#completely unsymmetric lhs and completely symmetric rhs
elif( ( (lhs_sym[0] != lhs_sym[1]) and (lhs_sym[1] != lhs_sym[2]) and (lhs_sym[0] != lhs_sym[2]) ) and
( (rhs_sym[0] == rhs_sym[1]) and (rhs_sym[1] == rhs_sym[2]) and (rhs_sym[0] == rhs_sym[2]) ) ):
#build isotope trach on lhs
isotope_track = build_track_dictionary(lhs,stars)
#alter lhs in usual way
lhs = switch_labels_on_position(lhs)
#change labels on context
context = switch_labels(isotope_track,stars,context)
#all positions on rhs equivalent so add labels on position
rhs = switch_labels_on_position(rhs)
#more difficult cases, partial symmetry
#completely unsymmetric on lhs and partial symmetry on rhs
elif( (lhs_sym[0] != lhs_sym[1]) and (lhs_sym[1] != lhs_sym[2]) and (lhs_sym[0] != lhs_sym[2]) ):
#build the isotope track
isotope_track = build_track_dictionary(lhs,stars)
#alter lhs in usual way
lhs = switch_labels_on_position(lhs)
#change rhs and context based on isotope_track
rhs = switch_labels(isotope_track,stars,rhs)
context = switch_labels(isotope_track,stars,context)
#tweak positions on rhs based on symmetry
#rhs 1,2 equivalent
if(rhs_sym[0] == rhs_sym[1]):
#tweak rhs position 1 and 2 as they are symmetric
rhs = switch_specific_labels_on_symmetry(rhs,rhs_sym,1,2)
#rhs 2,3 equivalent
elif(rhs_sym[1] == rhs_sym[2]):
#tweak rhs position 1 and 2 as they are symmetric
rhs = switch_specific_labels_on_symmetry(rhs,rhs_sym,2,3)
#rhs 1,3 equivalent - try for larger set in future
elif(rhs_sym[0] == rhs_sym[2]):
#tweak rhs position 1 and 2 as they are symmetric
rhs = switch_specific_labels_on_symmetry(rhs,rhs_sym,1,3)
#now we are left with things with partial symmetry on lhs and not completely symmetric or unsymmetric on rhs
else:
#lhs 1,2,3 equivalent and any sort of partial symmetry on rhs
if( (lhs_sym[0] == lhs_sym[1]) and (lhs_sym[1] == lhs_sym[2]) and (lhs_sym[0] == lhs_sym[2]) ):
#alter lhs in usual way
lhs = switch_labels_on_position(lhs)
#change labels on rhs based on position but need to record
#the changes as need to appy them to the context
isotope_track = build_track_dictionary(rhs,stars)
rhs = switch_labels_on_position(rhs)
context = switch_labels(isotope_track,stars,context)
#now deal partial symmetry on lhs or rhs.
#Cases where:
#lhs 1,2 equivalent
#lhs 2,3 equivalent
#lhs 1,3 equivalent
else:
#build isotope track on lhs
isotope_track = build_track_dictionary(lhs,stars)
#alter lhs in usual way
lhs = switch_labels_on_position(lhs)
#change rhs and context based on isotope_track
rhs = switch_labels(isotope_track,stars,rhs)
context = switch_labels(isotope_track,stars,context)
#tweak positions on rhs based on symmetry
#lhs 1,2 equivalent
if(lhs_sym[0] == lhs_sym[1]):
#tweak rhs position 1 and 2 as they are symmetric on lhs
rhs = switch_specific_labels_on_symmetry(rhs,rhs_sym,1,2)
#lhs 2,3 equivalent
elif(lhs_sym[1] == lhs_sym[2]):
#tweak rhs position 1 and 2 as they are symmetric on lhs
rhs = switch_specific_labels_on_symmetry(rhs,rhs_sym,2,3)
#lhs 1,3 equivalent - try for larger set in future
elif(lhs_sym[0] == lhs_sym[2]):
#tweak rhs position 1 and 2 as they are symmetric on lhs
rhs = switch_specific_labels_on_symmetry(rhs,rhs_sym,1,3)
smirk = "%s>>%s" % (lhs,rhs)
return smirk,context
def switch_specific_labels_on_symmetry(smi,symmetry_class,a,b):
#check if a and b positions are symmetrically equivalent
#if equivalent, swap labels if the lower numerical label is not on the
#1st symmetrically equivalent attachment points in the smi
if(symmetry_class[a-1] == symmetry_class[b-1]):
#what are the labels on a and b
matchObj = re.search( r'\[\*\:([123])\].*\[\*\:([123])\].*\[\*\:([123])\]', smi )
if matchObj:
#if the higher label comes first, fix
if(int(matchObj.group(a)) > int(matchObj.group(b))):
#if(int(matchObj.group(1)) > int(matchObj.group(2))):
smi = re.sub(r'\[\*\:'+matchObj.group(a)+'\]', '[*:XX' + matchObj.group(b) + 'XX]' , smi)
smi = re.sub(r'\[\*\:'+matchObj.group(b)+'\]', '[*:XX' + matchObj.group(a) + 'XX]' , smi)
smi = re.sub('XX', '' , smi)
return smi
def switch_labels_on_position(smi):
#move the labels in order of position
smi = re.sub(r'\[\*\:[123]\]', '[*:XX1XX]' , smi, 1)
smi = re.sub(r'\[\*\:[123]\]', '[*:XX2XX]' , smi, 1)
smi = re.sub(r'\[\*\:[123]\]', '[*:XX3XX]' , smi, 1)
smi = re.sub('XX', '' , smi)
return smi
def switch_labels(track,stars,smi):
#switch labels based on the input dictionary track
if(stars > 1):
#for k in track:
# print "old: %s, new: %s" % (k,track[k])
if(track['1'] != '1'):
smi = re.sub(r'\[\*\:1\]', '[*:XX' + track['1'] + 'XX]' , smi)
if(track['2'] != '2'):
smi = re.sub(r'\[\*\:2\]', '[*:XX' + track['2'] + 'XX]' , smi)
if(stars == 3):
if(track['3'] != '3'):
smi = re.sub(r'\[\*\:3\]', '[*:XX' + track['3'] + 'XX]' , smi)
#now remove the XX
smi = re.sub('XX', '' , smi)
return smi
def build_track_dictionary(smi,stars):
isotope_track = {}
#find 1st label, record it in isotope_track as key, with value being the
#new label based on its position (1st star is 1, 2nd star 2 etc.)
if(stars ==2):
matchObj = re.search( r'\[\*\:([123])\].*\[\*\:([123])\]', smi )
if matchObj:
isotope_track[matchObj.group(1)] = '1'
isotope_track[matchObj.group(2)] = '2'
elif(stars ==3):
matchObj = re.search( r'\[\*\:([123])\].*\[\*\:([123])\].*\[\*\:([123])\]', smi )
if matchObj:
isotope_track[matchObj.group(1)] = '1'
isotope_track[matchObj.group(2)] = '2'
isotope_track[matchObj.group(3)] = '3'
return isotope_track
def index_hydrogen_change():
#Algorithm details
#have an index of common fragment(key) => fragments conected to it (values)
#Need to add *-H to the values where appropriate - and its
#appropriate when the key is what you would get if you chopped a H off a cmpd.
#Therefore simply need to check if key with the * replaced with a H is
#the same as any full smiles in the set
#
#Specific details:
#1) Loop through keys of index
#2) If key is the result of a single cut (so contains only 1 *) replace the * with H, and cansmi
#3) If full smiles matches key in hash above, add *-H to that fragment index.
for key in index:
attachments = key.count('*')
#print attachments
if(attachments==1):
smi = key
#simple method
smi = re.sub(r'\[\*\:1\]', '[H]' , smi)
#now cansmi it
temp = Chem.MolFromSmiles(smi)
if(temp == None):
sys.stderr.write('Error with key: %s, Added H: %s\n' %(key,smi) )
else:
c_smi = Chem.MolToSmiles( temp, isomericSmiles=True )
if(c_smi in smi_to_id):
core = "[*:1][H]"
id = smi_to_id[c_smi]
value = "%s;t%s" % (id,core)
#add to index
index[key].append(value)
if __name__=='__main__':
#note max heavy atom count does not
#include the attachement points (*)
max_size = 10
ratio = 0.3
use_ratio = False
index={}
smi_to_id={}
id_to_smi={}
id_to_heavy={}
#set up the command line options
#parser = OptionParser()
parser = OptionParser(description="Program to generate MMPs")
parser.add_option('-s', '--symmetric', default=False, action='store_true', dest='sym',
help='Output symmetrically equivalent MMPs, i.e output both cmpd1,cmpd2, SMIRKS:A>>B and cmpd2,cmpd1, SMIRKS:B>>A')
parser.add_option('-m','--maxsize',action='store', dest='maxsize', type='int',
help='Maximum size of change (in heavy atoms) allowed in matched molecular pairs identified. DEFAULT=10. \
Note: This option overrides the ratio option if both are specified.')
parser.add_option('-r','--ratio',action='store', dest='ratio', type='float',
help='Maximum ratio of change allowed in matched molecular pairs identified. The ratio is: size of change / \
size of cmpd (in terms of heavy atoms). DEFAULT=0.3. Note: If this option is used with the maxsize option, the maxsize option will be used.')
#parse the command line options
(options, args) = parser.parse_args()
#print options
if(options.maxsize != None):
max_size = options.maxsize
elif(options.ratio != None):
ratio = options.ratio
if(ratio >= 1):
print("Ratio specified: %s. Ratio needs to be less than 1.")
sys.exit(1)
use_ratio = True
#read the STDIN
for line in sys.stdin:
line = line.rstrip()
smi,id,core,context = line.split(',')
#fill in dictionaries
smi_to_id[smi]=id
id_to_smi[id]=smi
#if using the ratio option, check if heavy atom
#of mol already calculated. If not, calculate and store
cmpd_heavy = None
if(use_ratio):
if( (id in id_to_heavy) == False):
id_to_heavy[id] = heavy_atom_count(smi)
cmpd_heavy = id_to_heavy[id]
#deal with cmpds that have not been fragmented
if(len(core) == 0) and (len(context) == 0):
continue
#deal with single cuts
if(len(core) == 0):
side_chains = context.split('.')
#minus 1 for the attachement pt
if( add_to_index(side_chains[1],1,cmpd_heavy)==True ):
context = side_chains[0]
core = side_chains[1]
value = "%s;t%s" % (id,core)
#add the array if no key exists
#add the context with id to index
index.setdefault(context, []).append(value)
#minus 1 for the attachement pt
if( add_to_index(side_chains[0],1,cmpd_heavy)==True ):
context = side_chains[1]
core = side_chains[0]
value = "%s;t%s" % (id,core)
#add the array if no key exists
#add the context with id to index
index.setdefault(context, []).append(value)
#double or triple cut
else:
attachments = core.count('*')
if( add_to_index(core,attachments,cmpd_heavy)==True ):
value = "%s;t%s" % (id,core)
#add the array if no key exists
#add the context with id to index
index.setdefault(context, []).append(value)
#index the H change
index_hydrogen_change()
#Now index is ready
#loop through the index
for key in index:
total = len(index[key])
#check if have more than one value
if(total == 1):
continue
for xa in xrange(total):
for xb in xrange(xa, total):
if(xa != xb):
#now generate the pairs
id_a,core_a = index[key][xa].split(";t")
id_b,core_b = index[key][xb].split(";t")
#make sure pairs are not same molecule
if(id_a != id_b):
#make sure LHS and RHS of SMIRKS are not the same
if(core_a != core_b):
smirks,context = cansmirk(core_a,core_b,key)
print("%s,%s,%s,%s,%s,%s" % ( id_to_smi[id_a], id_to_smi[id_b], id_a, id_b, smirks, context ))
#deal with symmetry switch
if(options.sym == True):
smirks,context = cansmirk(core_b,core_a,key)
print("%s,%s,%s,%s,%s,%s" % ( id_to_smi[id_b], id_to_smi[id_a], id_b, id_a, smirks, context ))
|
AlexanderSavelyev/rdkit
|
Contrib/mmpa/indexing.py
|
Python
|
bsd-3-clause
| 21,045
|
[
"RDKit"
] |
42b341dde820d9abc180e03be6ea14769fc8e548c851425adfe54f499ab34010
|
#!/usr/bin/env python
##!/home/users/sblair/anaconda2/bin/python
##!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 14 08:54:21 2017
@author: sblair
"""
import sys
sys.path.insert(1,'.')
import FluidChannel as fc
import argparse
parser = argparse.ArgumentParser(prog='wmb_geom.py',
description='create geometry files for cavity channel problem')
parser.add_argument('nDivs',type=int)
# parse input arguments
args = parser.parse_args()
#overall channel dimensions
aLx_p = 6.4
aLy_p = 3.0
aLz_p = 14.0
aNdivs = args.nDivs
# wall mounted brick parameters
x_c = 3.5;
z_c = 3.2;
W = 1.;
H = W;
L = W;
myObst = fc.WallMountedBrick(x_c,z_c,L,W,H);
myChan = fc.FluidChannel(Lx_p=aLx_p,Ly_p=aLy_p,Lz_p=aLz_p,obst=myObst,
N_divs=aNdivs)
# add two subspaces
ss1 = fc.YZ_Slice(aLx_p/2.,0.5, 2.5, 5.5, 10.0)
ss2 = fc.YZ_Slice(aLx_p/4.,1.0, 2.0, 4.5, 5.0)
ss3 = fc.YZ_Slice(aLx_p/5.,1.0, 2.0, 4.5, 5.0)
myChan.add_subset(ss1) # for the time being, limit yourself to 1 subset
#myChan.add_subset(ss2)
#myChan.add_subset(ss3)
# write the mat file
myChan.write_mat_file('ssTest');
# write vtk of boundary conditions so you can visualize them
#myChan.write_bc_vtk();
myChan.set_pRef_indx(aLx_p/2.,aLy_p/2.,0.95*aLz_p);
#print "selected pressure reference is node number %d \n"%myChan.pRef_indx
#print "X = %g \n"%myChan.x[myChan.pRef_indx];
#print "Y = %g \n"%myChan.y[myChan.pRef_indx];
#print "Z = %g \n"%myChan.z[myChan.pRef_indx];
|
stu314159/pyNFC
|
ssTest_geom.py
|
Python
|
mit
| 1,568
|
[
"VTK"
] |
3109a1a84b72170a06b191184449e63f40809a22f1b4b34d4e199993d0cb3574
|
#!/usr/bin/env python
"Merges Bisulphite reads by finding reciprocal pairs for PE watson / crick sequencing reads"
import pysam
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from pyfaidx import Fasta
import argparse
#seq_in = SeqIO.parse(open('/Volumes/data/epiGBS/test_scabi/join_all.fq', 'r'), 'fastq')
def parse_options():
"""Parses command line options"""
parser = argparse.ArgumentParser(description='Process input files')
# parser.add_argument('-r', '--reference', type=str, nargs='?', default=None,
# help='reference genome input.')
parser.add_argument("-s","--seqin",
help = "Combined watson and crick file")
parser.add_argument("-c","--crickin",dest = "crick",
help = "Crick fasta for CRICK_MAX")
parser.add_argument("--clusters",dest = "clusters",
help = "uc input file to make sam output")
parser.add_argument("--samout",dest = "samout",
help = "Sam output file")
args = parser.parse_args()
return args
def count_crickMAX(args):
"""Count the number of sequences in the Crick fasta file"""
with open(args.crick, 'r') as crick_in:
count = 0
for line in crick_in:
if line.startswith('>'):
count +=1
return count
if __name__ == '__main__':
args = parse_options()
CRICK_MAX = count_crickMAX(args)
print "now starting Fasta import"
seq_in = Fasta(args.seqin)
print "done with Fasta import"
clusters = open(args.clusters)
outsam = args.samout
# path = '/Volumes/data/epiGBS/Baseclear/Athal/'
# path = '/Volumes/data/epiGBS/DNAVISION/Project_DNA11032___140919_SN170_0407_AC52R6ACXX/Sample_DNA11032-001-L1/output/seqykJJfz/scabiosa/'
# path = '/tmp/'
# path = '/Volumes/data/epiGBS/FINAL/Scabiosa/BASECLEAR/'
# seq_in = Fasta(path+'Scabiosa_combined.fa')
#fasta_in = SeqIO.parse(open('/tmp/test.fa', 'r'), 'fasta')
seq_in_keymap = {}
for key in seq_in.keys():
seq_in_keymap[key.split(';')[0]] = key
faidx_rec = seq_in[key]
# clusters = open(path +'derep.uc', 'r')
# outsam = path+'derep_out.sam'
#clusters = open('/Volumes/data/epiGBS/test_scabi/cluster_sorted_a.uc', 'r')
#out_fa = open('/Volumes/data/epiGBS/test_scabi/output3.fa', 'w')
#outsam = '/Volumes/data/epiGBS/test_scabi/output3.sam'
#seq_in = SeqIO.parse(open('/Volumes/data/galaxy/database/files/009/dataset_9152.dat', 'r'), 'fastq')
#clusters = open('/Volumes/data/epiGBS/test_scabi/cluster_923.uc', 'r')
#cluster_records = pickle.load(open( "/tmp/save.p", "rb" ))
#
#print 'boe'
def make_bio_object(id, seq_in):
"""Recreates seq-record from pyfaidx record"""
key = seq_in_keymap[id.split(';')[0]]
faidx_rec = seq_in[key]
seq = faidx_rec[0:faidx_rec.__len__()].seq
record = SeqRecord(Seq(seq), id=key, name= faidx_rec.name, description=faidx_rec.name)
return record
def create_SAM_header(clusters):
"""Create SAM header for bisulphite read mapping"""
header = { 'HD': {'VN': '1.0'},
'SQ': [], 'RG':[]}
header_SQ = {}
count = 0
for i in ['crick', 'watson']:
header['RG'].append({'ID':i, 'SM':i})
for line in clusters:
if line.startswith('S'):
name, length = line.split('\t')[1:3]
cluster_dict = {'LN':int(length), 'SN':name}
header_SQ[int(cluster_dict['SN'])] = cluster_dict['LN']
for k, v in sorted(header_SQ.items()):
header['SQ'].append({'LN':v, 'SN':str(k)})
clusters.seek(0)
return header
#seq_in, clusters, out_fa, outsam = sys.argv[1:]
#clusters = open(clusters, 'r')
#seq_in = SeqIO.parse(open(seq_in, 'r'), 'fastq')
#out_fa = open(out_fa, 'w')
#cluster_records = pickle.load(open( "/tmp/save.p", "rb" ))
#name = outsam.getrname(int(name))
#print 'boe'
count = 0
cluster_records = {}
def add_to_cluster(cluster_instance, cluster_records):
"""Add a read to cluster_records"""
cluster = cluster_instance.cluster
seq = cluster_instance.spaced_READ()
if cluster in cluster_records:
for pos, nt in enumerate(seq):
#spaces represent non-covered bases.
if nt == ' ':
continue
try:
try:
cluster_records[cluster][cluster_instance.read_type][pos][nt]+=1
except KeyError:
cluster_records[cluster][cluster_instance.read_type][pos][nt]=1
except KeyError:
try:
cluster_records[cluster][cluster_instance.read_type][pos]={nt:1}
except KeyError:
cluster_records[cluster][cluster_instance.read_type] = {}
cluster_records[cluster][cluster_instance.read_type][pos]={nt:1}
else:
#Add a dictionary in which the nucleotide composition of the cluster is saved
cluster_records[cluster] = {}
for pos, nt in enumerate(seq):
if nt != ' ':
try:
cluster_records[cluster][cluster_instance.read_type][pos] = {nt:1}
except KeyError:
cluster_records[cluster][cluster_instance.read_type] = {}
cluster_records[cluster][cluster_instance.read_type][pos] = {nt:1}
else:
try:
cluster_records[cluster][cluster_instance.read_type][pos] = {}
except KeyError:
cluster_records[cluster][cluster_instance.read_type] = {}
cluster_records[cluster][cluster_instance.read_type][pos] = {}
return cluster_records
def parse_USEARCH_cigar(cigar, seq_len):
"""Parses usearch specific cigar and return appropriate
tuple output
USEARCH uses an alternative output format option in which I and D
are interchanged
0123456
MDINSHP
"""
DECODE = 'MDINSHP'
_ENCODE = dict( (c,i) for (i, c) in enumerate(DECODE) )
result = []
n = ''
total_M = 0 #to keep track of total matching characters to not exceed limit.
pos = 0
for c in cigar:
if c.isdigit():
n += c
elif c in _ENCODE:
pos += 1
if n == '':
n='1'
if pos > 1:
if total_M +int(n) > seq_len:
n = seq_len - total_M
total_M += int(n)
else:
if c != 'I':
total_M += int(n)
elif c in 'DM':
if total_M +int(n) > seq_len:
n = seq_len - total_M
total_M += int(n)
else:
total_M += int(n)
result.append( (_ENCODE[c], int(n)) )
if int(n) == seq_len and c == 'M':
return result
n = ''
return result
# cigar = '91M2I63M'
# seq_len = 154
# parse_USEARCH_cigar(cigar, seq_len)
def create_SAM_line(cluster_obj):
"""Create SAM record for read mapping."""
read = cluster_obj.read
cigar = cluster_obj.cigar_usearch
record = pysam.AlignedRead()
record.qname = read.id
record.tid = int(cluster_obj.cluster)
if cluster_obj.read_type == 'watson' and cluster_obj.direction == '-':
record.seq = str(read.seq.reverse_complement())
record.flag = long(16)
elif cluster_obj.read_type == 'crick' and cluster_obj.direction == '+':
record.seq = str(read.seq)
elif cluster_obj.read_type == 'crick' and cluster_obj.direction == '-':
record.seq = str(read.seq.reverse_complement())
record.flag = long(16)
elif cluster_obj.read_type == 'watson' and cluster_obj.direction == '+':
record.seq = str(read.seq)
elif cluster_obj.direction == '*':
record.seq = str(read.seq)
# record.qual = read.format('fastq')[:-1].split('\n')[-1]
record.qual = 'H'*len(record.seq)
#TODO: properly call mapq using new algorithm.
record.mapq = len(cluster_obj.read.seq)
if cigar in '*=':
record.cigar = ((0, len(read.seq), ), )
else:
cigar_tuple = parse_USEARCH_cigar(cluster_obj.cigar_usearch, len(read.seq))
if cigar_tuple[0][0] == 2:
record.pos = cigar_tuple[0][1]
cigar_tuple = cigar_tuple[1:]
if cigar_tuple[0][0] == 0:
if int(cigar_tuple[0][1]) > len(read.seq):
record.cigar = ((0, len(read.seq), ), )
record.tags = ( ("NM", 1),("RG", "BS1") )
return record
record.cigar = cigar_tuple
# if int(record.qname) < CRICK_MAX:
# rg_type = "crick"
# else:
# rg_type = "watson"
tags = []
for tag in read.description.split('\t')[1:]:
name, type, content = tag.split(':')
tags.append(tuple((name, content)))
# record.tags = tuple(tags)
if cluster_obj.read_type == 'watson':
record.tags = (('RG', 'watson', ), )
else:
record.tags = (('RG', 'crick', ), )
return record
count = 0
class Cluster_obj:
"""Contains usearch cluster objects"""
def __init__(self, line):
"""Initializes a class instance"""
split_line = line.split()
self.type = split_line[0] #type of cluster object
cluster_tid_nr = str(outsam.gettid(split_line[1]))
self.cluster = cluster_tid_nr #split_line[1] #target cluster
self.direction = split_line[4]#forward or reverse match to centroid.
if self.direction == '*':
self.direction = '+'
self.cigar_usearch = split_line[7] #usearch type cigar
self.readname = split_line[8]
self.read = None #seq read object
#Determines if the read is watson or crick.
self.read_type = None #watson or crick read?
def SAM_record(self):
"""Returns a SAM record of cluster_object"""
sam_record = create_SAM_line(self)
return sam_record
def spaced_READ(self):
""""Returns a string with contig aligned read values
the string contains spaces if there is no coverage for a certain
contig position"""
if self.direction == '-':
rv_read = read.reverse_complement()
rv_read.description = self.read.description
rv_read.id = self.read.id
rv_read.name = self.read.name
self.read = rv_read
# self.read.seq = self.read.seq.reverse_complement()
if self.cigar_usearch in ['*', '=']:
return str(self.read.seq)
else:
pos = 0
out = ''
cigar = self.SAM_record().cigar
#Add the appropriate number of leading spaces.
out += self.SAM_record().pos * ' '
for item in cigar:
operation, length = item
#Match
if operation == 0:
out+=str(self.read.seq)[pos:pos+length]
pos+=length
#Insertion
if operation == 2:
out+=' '*length
#deletion
if operation == 1:
pos += length
return out
#parse fasta input of valid clusters with min_size = 2!
cluster_ids = set()
total_lines = 0
for cluster in clusters:
if cluster.startswith('C'):
split_line = cluster.split('\t')
if int(split_line[2])>1:
cluster_ids.add(split_line[1])
else:
total_lines+=1
clusters.seek(0)
print len(cluster_ids)
header = create_SAM_header(clusters)
outsam = pysam.Samfile(outsam,'wh', header=header)
n = 0
cluster_list = seq_in.keys()
for line in clusters:
#clusters contains an ordered list of sequences which should be processed
#Forward reads /1 or merged fastq reads always represent crick reads.
#These have number below CRICK_MAX
if not n%1000 and n:
print "processed %s out of %s lines"%(n, total_lines)
# make_ref(cluster_records)
if line.startswith('S') or line.startswith('H'):
n+=1
if line.split('\t')[1] not in cluster_ids:
continue
cluster_instance = Cluster_obj(line)
#get read with name count.
read = make_bio_object(cluster_instance.readname, seq_in)
cluster_pos = cluster_list.index(read.name)
cluster_instance.read = read
#Centroids of clusters are always in direction +, so the type depends only on
if cluster_instance.type == 'C':
cluster_instance.direction = '+'
#Now we will only encounter crick reads, as they are >crick first
if cluster_pos > CRICK_MAX:
if cluster_instance.direction == '-':
cluster_instance.read_type = "crick"
elif cluster_instance.direction == '+':
cluster_instance.read_type = "watson"
#Now we will only encounter Watson reads, as they are >crick first
elif cluster_pos <= CRICK_MAX:
if cluster_instance.direction == '-':
cluster_instance.read_type = "watson"
elif cluster_instance.direction == '+':
cluster_instance.read_type = "crick"
# if cluster_instance.type not in ['C', 'N']: #see http://www.drive5.com/usearch/manual/ucout.html
sam_record = create_SAM_line(cluster_instance)
outsam.write(sam_record)
outsam.close()
|
thomasvangurp/epiGBS
|
de_novo_reference_creation/mergeBSv3.py
|
Python
|
mit
| 13,261
|
[
"Galaxy",
"pysam"
] |
91c9636684c0759588ef713d0f459892ec8c9de09538451b65c3359ef88511d5
|
# The MIT License (MIT)
# Copyright (c) 2013-2015 Brian Madden and Gabe Knuth
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
from mpf.system.scriptlet import Scriptlet
class Attract(Scriptlet):
def on_load(self):
self.machine.events.add_handler('machineflow_Attract_start', self.start)
self.machine.events.add_handler('machineflow_Attract_stop', self.stop)
def start(self):
for gi in self.machine.gi:
gi.on()
def stop(self):
for light in self.machine.lights:
light.off()
|
town-hall-pinball/project-alpha
|
scriptlets/attract.py
|
Python
|
mit
| 1,555
|
[
"Brian"
] |
6642808fd6023cd1b42e331c958dc995731059afa3ad0d86391f1921fc19c24f
|
'''
SASSIE: Copyright (C) 2011 Joseph E. Curtis, Ph.D.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
import os
import sassie.calculate.em_to_sas.gui_mimic_em_to_sas as gui_mimic_em_to_sas
#import gui_mimic_em_to_sas as gui_mimic_em_to_sas
import filecmp
from unittest import main
from nose.tools import assert_equals
from mocker import Mocker, MockerTestCase
pdb_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data', 'pdb_common') + os.path.sep
dcd_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data', 'dcd_common') + os.path.sep
other_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data', 'other_common') + os.path.sep
module_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data', 'interface', 'em_to_sas') + os.path.sep
paths = {'pdb_data_path' : pdb_data_path, 'dcd_data_path' : dcd_data_path, 'other_data_path' : other_data_path, 'module_data_path' : module_data_path}
class Test_Em_to_Sas_Filter(MockerTestCase):
'''
System integration test for em_to_sas.py / sassie 1.0
em_to_sasS is the module that reads a three-dimensional file
(either Gaussian Cube or a binary MRC electron density file) and
then represent each voxel with an occupation > threshold
as a scattering center represented as beads (C-atoms),
that is then written as PDB/xyz files
and the SAS profile is calculated using the "scat" program
Inputs tested:
runname: string project name
emfiletype: integer EM map file type : 2 values (0: cube; 1: mrc)
inputpath: string input file path
emdensityfile string path and name of input EM density file
threshold: float EM map threshold value
pdbfile: string output PDB file name
sasfile: string output SAS intensity file name
npoints: integer number of SAS data points
qmax: float maximum q value for SAS data
plotflag: integer flag for plotting interpolated data : 2 values (0: no plot; 1: plot)
Use cases tested:
1. check if runname has incorrect character
2. check input file path permissions
a. no permission error
b. permission error
i. path doesn't not exist
ii. read permission not allowed
iii. write permission not allowed
3. check if emfiletype is 0 or 1
4. check if npoints > 1
5. check if qmax > 0
6. check if threshold > 0
7. check if plotflag is 0 or 1
7. check if emdensity file exists
'''
def setUp(self):
gui_mimic_em_to_sas.test_variables(self, paths)
def test_1(self):
'''
test if runname has incorrect character
'''
self.runname = 'run_&'
return_error = gui_mimic_em_to_sas.run_module(
self, test_filter=True)
''' check for value error '''
expected_error = ['file or path : run_& has incorrect character : &']
assert_equals(return_error, expected_error)
def test_2(self):
'''
test if path exists
'''
self.inputpath = os.path.join(module_data_path,'non_existent_path')
return_error = gui_mimic_em_to_sas.run_module(self, file_check=True)
''' check for path error '''
expected_error = ['permission error in input file path ' + self.inputpath + ' [code = FalseFalseFalse]',
'path does not exist']
assert_equals(return_error, expected_error)
def test_3(self):
'''
test if directory has read permission
'''
''' make a directory '''
os.system('mkdir empty_folder')
''' see if you can read the directory '''
print os.access('empty_folder', os.R_OK)
''' make the directory un-readable'''
os.system('chmod a-r empty_folder')
''' see if you can read the directory '''
print os.access('empty_folder', os.R_OK)
self.inputpath= os.path.join('./','empty_folder')
return_error = gui_mimic_em_to_sas.run_module(self, file_check=True)
''' check for path error '''
expected_error = ['permission error in input file path ' + self.inputpath + ' [code = TrueFalseTrue]', 'read permission not allowed']
assert_equals(return_error, expected_error)
''' make the directory readable'''
os.system('chmod a+r empty_folder')
''' remove the directory '''
os.system('rm -Rf empty_folder')
def test_4(self):
'''
test if directory has write permission
'''
''' make a directory '''
os.system('mkdir empty_folder1')
''' see if you can write to the directory '''
# print os.access('empty_folder1', os.W_OK)
''' make the directory un-writeable'''
os.system('chmod a-w empty_folder1')
''' see if you can write to the directory '''
# print os.access('empty_folder', os.W_OK)
self.inputpath = os.path.join('./', 'empty_folder1')
return_error = gui_mimic_em_to_sas.run_module(
self, file_check=True)
# print 'return_error: ', return_error
''' check for path error '''
expected_error = ['permission error in input file path ' +
self.inputpath + ' [code = TrueTrueFalse]', 'write permission not allowed']
# print 'expected_error: ', expected_error
assert_equals(return_error, expected_error)
''' make the directory writeable'''
os.system('chmod a+w empty_folder1')
''' remove the directory '''
os.system('rm -Rf empty_folder1')
def test_5(self):
'''
test if emfiletype is 0 or 1
'''
self.emfiletype = '2'
return_error = gui_mimic_em_to_sas.run_module(
self, test_filter=True)
''' check for value error '''
expected_error = ['emfiletype == 0 for "cube file" and 1 for "mrc file", emfiletype = 2']
assert_equals(return_error, expected_error)
def test_5(self):
'''
test if plotflag is 0 or 1
'''
self.plotflag = '2'
return_error = gui_mimic_em_to_sas.run_module(
self, test_filter=True)
''' check for value error '''
expected_error = ['plotflag == 0 for no plotting and 1 for plotting, plotflag = 2']
assert_equals(return_error, expected_error)
def test_6(self):
'''
test if npoints > 1
'''
self.npoints = '1'
return_error = gui_mimic_em_to_sas.run_module(
self, test_filter=True)
''' check for value error '''
expected_error = ['npoints needs to be > 1, npoints = 1']
assert_equals(return_error, expected_error)
def test_7(self):
'''
test for qmax > 0
'''
self.qmax = '0'
return_error = gui_mimic_em_to_sas.run_module(
self, test_filter=True)
''' check for value error '''
expected_error = ['qmax needs to be > 0, qmax = 0.0']
assert_equals(return_error, expected_error)
def test_8(self):
'''
test for threshold > 0
'''
self.threshold = '0'
return_error = gui_mimic_em_to_sas.run_module(
self, test_filter=True)
''' check for value error '''
expected_error = ['threshold need to be > 0, threshold = 0.0']
assert_equals(return_error, expected_error)
def test_9(self):
'''
test if emdensityfile exists
'''
self.emdensityfile = os.path.join(other_data_path,'does_not_exist.mrc')
return_error = gui_mimic_em_to_sas.run_module(
self, test_filter=True)
''' check for value error '''
expected_error = ['file : '+self.emdensityfile+' does not exist', 'check input emdensity file path + filename']
assert_equals(return_error, expected_error)
def tearDown(self):
if os.path.exists(self.runname):
shutil.rmtree(self.runname)
if __name__ == '__main__':
main()
|
madscatt/zazzie
|
src_2.7/sassie/test_sassie/interface/em_to_sas/test_em_to_sas_filter.py
|
Python
|
gpl-3.0
| 8,871
|
[
"Gaussian"
] |
bd3190fab8998c447e94786d317c25ebd6a60ca18cb7560cb220e4fd3e0e8fec
|
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 15 18:04:09 2017
@author: AutuanLiu
"""
# pyts的使用
import numpy as np
from scipy.stats import norm
n_samples = 10
n_features = 48
n_classes = 2
delta = 0.5
dt = 1
x = 0.
X = np.zeros((n_samples, n_features))
X[:, 0] = x
for i in range(n_samples):
start = x
for k in range(1, n_features):
start += norm.rvs(scale=delta**2 * dt)
X[i][k] = start
y = np.random.randint(n_classes, size=n_samples)
from pyts.visualization import plot_ts
plot_ts(X[0])
from pyts.transformation import StandardScaler
standardscaler = StandardScaler(epsilon=1e-2)
X_standardized = standardscaler.transform(X)
from pyts.visualization import plot_standardscaler
plot_standardscaler(X[0])
from pyts.transformation import PAA
paa = PAA(window_size=None, output_size=8, overlapping=True)
X_paa = paa.transform(X_standardized)
from pyts.visualization import plot_paa
plot_paa(X_standardized[0], window_size=None, output_size=8, overlapping=True, marker='o')
from pyts.transformation import SAX
sax = SAX(n_bins=5, quantiles='gaussian')
X_sax = sax.transform(X_paa)
from pyts.visualization import plot_sax
plot_sax(X_paa[0], n_bins=5, quantiles='gaussian')
from pyts.visualization import plot_paa_sax
plot_paa_sax(X_standardized[0], window_size=None, output_size=8, overlapping=True, n_bins=5, quantiles='gaussian')
|
AutuanLiu/RLang
|
datapro/python/ppaSax.py
|
Python
|
mit
| 1,386
|
[
"Gaussian"
] |
40734fa1c91c595065b5775c064b77c44de84fbbda69278495548e9d315db3af
|
#!/usr/bin/env python
import json
import ntpath
import operator
import os
from functools import reduce
from CTDopts.CTDopts import (
_InFile,
_OutFile,
CTDModel,
ModelTypeError,
Parameter,
ParameterGroup,
Parameters
)
from lxml import etree
from ..common import logger
from ..common.exceptions import ApplicationException
MESSAGE_INDENTATION_INCREMENT = 2
# simple struct-class containing a tuple with input/output location and the in-memory CTDModel
class ParsedCTD:
def __init__(self, ctd_model=None, input_file=None, suggested_output_file=None):
self.ctd_model = ctd_model
self.input_file = input_file
self.suggested_output_file = suggested_output_file
class ParameterHardcoder:
def __init__(self):
# map whose keys are the composite names of tools and parameters in the following pattern:
# [ToolName][separator][ParameterName] -> HardcodedValue
# if the parameter applies to all tools, then the following pattern is used:
# [ParameterName] -> HardcodedValue
# examples (assuming separator is '#'):
# threads -> 24
# XtandemAdapter#adapter -> xtandem.exe
# adapter -> adapter.exe
self.separator = "!"
# hard coded values
self.parameter_map = {}
# ctd/xml attributes to overwrite
self.attribute_map = {'CTD': {}, 'XML': {}}
# blacklisted parameters
self.blacklist = set()
def register_blacklist(self, parameter_name, tool_name):
k = self.build_key(parameter_name, tool_name)
self.blacklist.add(k)
# the most specific value will be returned in case of overlap
def get_blacklist(self, parameter_name, tool_name):
# look for the value that would apply for all tools
if self.build_key(parameter_name, tool_name) in self.blacklist:
return True
elif parameter_name in self.blacklist:
return True
else:
return False
def register_attribute(self, parameter_name, attribute, value, tool_name):
tpe, attribute = attribute.split(':')
if tpe not in ['CTD', 'XML']:
raise Exception('Attribute hardcoder not in CTD/XML')
k = self.build_key(parameter_name, tool_name)
if k not in self.attribute_map[tpe]:
self.attribute_map[tpe][k] = {}
self.attribute_map[tpe][k][attribute] = value
# the most specific value will be returned in case of overlap
def get_hardcoded_attributes(self, parameter_name, tool_name, tpe):
# look for the value that would apply for all tools
try:
return self.attribute_map[tpe][self.build_key(parameter_name, tool_name)]
except KeyError:
return self.attribute_map[tpe].get(parameter_name, None)
# the most specific value will be returned in case of overlap
def get_hardcoded_value(self, parameter_name, tool_name):
# look for the value that would apply for all tools
try:
return self.parameter_map[self.build_key(parameter_name, tool_name)]
except KeyError:
return self.parameter_map.get(parameter_name, None)
def register_parameter(self, parameter_name, parameter_value, tool_name=None):
self.parameter_map[self.build_key(parameter_name, tool_name)] = parameter_value
def build_key(self, parameter_name, tool_name):
if tool_name is None:
return parameter_name
return f"{parameter_name}{self.separator}{tool_name}"
def validate_path_exists(path):
if not os.path.exists(path) or not os.path.isfile(os.path.realpath(path)):
raise ApplicationException("The provided path (%s) does not exist or is not a valid file path." % path)
def validate_argument_is_directory(args, argument_name):
file_name = getattr(args, argument_name)
logger.info("REALPATH %s" % os.path.realpath(file_name))
if file_name is not None and os.path.isdir(os.path.realpath(file_name)):
raise ApplicationException("The provided output file name (%s) points to a directory." % file_name)
def validate_argument_is_valid_path(args, argument_name):
paths_to_check = []
# check if we are handling a single file or a list of files
member_value = getattr(args, argument_name)
if member_value is not None:
if isinstance(member_value, list):
for file_name in member_value:
paths_to_check.append(str(file_name).strip())
else:
paths_to_check.append(str(member_value).strip())
for path_to_check in paths_to_check:
try:
validate_path_exists(path_to_check)
except ApplicationException:
raise ApplicationException(f"Argument {argument_name}: The provided output file name ({path_to_check}) points to a directory.")
# taken from
# http://stackoverflow.com/questions/8384737/python-extract-file-name-from-path-no-matter-what-the-os-path-format
def get_filename(path):
head, tail = ntpath.split(path)
return tail or ntpath.basename(head)
def get_filename_without_suffix(path):
root, ext = os.path.splitext(os.path.basename(path))
return root
def parse_input_ctds(xsd_location, input_ctds, output_destination, output_file_extension):
is_converting_multiple_ctds = len(input_ctds) > 1
parsed_ctds = []
schema = None
if xsd_location is not None:
try:
logger.info("Loading validation schema from %s" % xsd_location, 0)
schema = etree.XMLSchema(etree.parse(xsd_location))
except Exception as e:
logger.error("Could not load validation schema {}. Reason: {}".format(xsd_location, str(e)), 0)
else:
logger.warning("Validation against a schema has not been enabled.", 0)
for input_ctd in input_ctds:
if schema is not None:
validate_against_schema(input_ctd, schema)
output_file = output_destination
# if multiple inputs are being converted, we need to generate a different output_file for each input
if is_converting_multiple_ctds:
output_file = os.path.join(output_file, get_filename_without_suffix(input_ctd) + "." + output_file_extension)
logger.info("Parsing %s" % input_ctd)
model = None
try:
model = CTDModel(from_file=input_ctd)
except ModelTypeError:
pass
try:
model = Parameters(from_file=input_ctd)
except ModelTypeError:
pass
assert model is not None, "Could not parse %s, seems to be no CTD/PARAMS" % (input_ctd)
parsed_ctds.append(ParsedCTD(model, input_ctd, output_file))
return parsed_ctds
def flatten_list_of_lists(args, list_name):
setattr(args, list_name, [item for sub_list in getattr(args, list_name) for item in sub_list])
def validate_against_schema(ctd_file, schema):
try:
parser = etree.XMLParser(schema=schema)
etree.parse(ctd_file, parser=parser)
except etree.XMLSyntaxError as e:
raise ApplicationException("Invalid CTD file {}. Reason: {}".format(ctd_file, str(e)))
def add_common_parameters(parser, version, last_updated):
parser.add_argument("FORMAT", default=None, help="Output format (mandatory). Can be one of: cwl, galaxy.")
parser.add_argument("-i", "--input", dest="input_files", default=[], required=True, nargs="+", action="append",
help="List of CTD files to convert.")
parser.add_argument("-o", "--output-destination", dest="output_destination", required=True,
help="If multiple input files are given, then a folder in which all converted "
"files will be generated is expected; "
"if a single input file is given, then a destination file is expected.")
parser.add_argument("-x", "--default-executable-path", dest="default_executable_path",
help="Use this executable path when <executablePath> is not present in the CTD",
default=None, required=False)
parser.add_argument("-p", "--hardcoded-parameters", dest="hardcoded_parameters", default=None, required=False,
help="File containing hardcoded values for the given parameters. Run with '-h' or '--help' "
"to see a brief example on the format of this file.")
parser.add_argument("-V", "--validation-schema", dest="xsd_location", default=None, required=False,
help="Location of the schema to use to validate CTDs. If not provided, no schema validation "
"will take place.")
# TODO: add verbosity, maybe?
program_version = "v%s" % version
program_build_date = str(last_updated)
program_version_message = f"%(prog)s {program_version} ({program_build_date})"
parser.add_argument("-v", "--version", action="version", version=program_version_message)
def parse_hardcoded_parameters(hardcoded_parameters_file):
parameter_hardcoder = ParameterHardcoder()
if hardcoded_parameters_file is None:
return parameter_hardcoder
with open(hardcoded_parameters_file) as fp:
data = json.load(fp)
for parameter_name in data:
if parameter_name == "#":
continue
for el in data[parameter_name]:
hardcoded_value = el.get("value", None)
tool_names = el.get("tools", [None])
for tool_name in tool_names:
if tool_name is not None:
tool_name = tool_name.strip()
# hardcoded / blacklisted:
# - blacklisted: if value is @
# - hardcoded: otherwise
if hardcoded_value is not None:
if hardcoded_value == '@':
parameter_hardcoder.register_blacklist(parameter_name, tool_name)
else:
parameter_hardcoder.register_parameter(parameter_name, hardcoded_value, tool_name)
else:
for a in el:
if a in ["tools", "value"]:
continue
if el[a] == "output-file":
el[a] = _OutFile
if el[a] == "input-file":
el[a] = _InFile
parameter_hardcoder.register_attribute(parameter_name, a, el[a], tool_name)
return parameter_hardcoder
def extract_tool_help_text(ctd_model):
manual = ""
doc_url = None
if "manual" in ctd_model.opt_attribs.keys():
manual += "%s\n\n" % ctd_model.opt_attribs["manual"]
if "docurl" in ctd_model.opt_attribs.keys():
doc_url = ctd_model.opt_attribs["docurl"]
help_text = "No help available"
if manual is not None:
help_text = manual
if doc_url is not None:
help_text = ("" if manual is None else manual)
if doc_url != "":
help_text += "\nFor more information, visit %s" % doc_url
return help_text
def extract_tool_executable_path(model, default_executable_path):
# rules to build the executable path:
# if executablePath is null, then use default_executable_path
# if executablePath is null and executableName is null, then the name of the tool will be used
# if executablePath is null and executableName is not null, then executableName will be used
# if executablePath is not null and executableName is null,
# then executablePath and the name of the tool will be used
# if executablePath is not null and executableName is not null, then both will be used
# first, check if the model has executablePath / executableName defined
executable_path = model.opt_attribs.get("executablePath", None)
executable_name = model.opt_attribs.get("executableName", None)
# check if we need to use the default_executable_path
if executable_path is None:
executable_path = default_executable_path
# fix the executablePath to make sure that there is a '/' in the end
if executable_path is not None:
executable_path = executable_path.strip()
if not executable_path.endswith("/"):
executable_path += "/"
# assume that we have all information present
command = str(executable_path) + str(executable_name)
if executable_path is None:
if executable_name is None:
command = model.name
else:
command = executable_name
else:
if executable_name is None:
command = executable_path + model.name
return command
def _extract_and_flatten_parameters(parameter_group, nodes=False):
"""
get the parameters of a OptionGroup as generator
"""
for parameter in parameter_group.values():
if type(parameter) is Parameter:
yield parameter
else:
if nodes:
yield parameter
yield from _extract_and_flatten_parameters(parameter.parameters, nodes)
def extract_and_flatten_parameters(ctd_model, nodes=False):
"""
get the parameters of a CTD as generator
"""
if type(ctd_model) is CTDModel:
return _extract_and_flatten_parameters(ctd_model.parameters.parameters, nodes)
else:
return _extract_and_flatten_parameters(ctd_model.parameters, nodes)
# names = [_.name for _ in ctd_model.parameters.values()]
# if names == ["version", "1"]:
# return _extract_and_flatten_parameters(ctd_model.parameters.parameters["1"], nodes)
# else:
# return _extract_and_flatten_parameters(ctd_model, nodes)
# for parameter in ctd_model.parameters.parameters:
# if type(parameter) is not ParameterGroup:
# yield parameter
# else:
# for p in extract_and_flatten_parameters(parameter):
# yield p
# parameters = []
# if len(ctd_model.parameters.parameters) > 0:
# # use this to put parameters that are to be processed
# # we know that CTDModel has one parent ParameterGroup
# pending = [ctd_model.parameters]
# while len(pending) > 0:
# # take one element from 'pending'
# parameter = pending.pop()
# if type(parameter) is not ParameterGroup:
# parameters.append(parameter)
# else:
# # append the first-level children of this ParameterGroup
# pending.extend(parameter.parameters.values())
# # returned the reversed list of parameters (as it is now,
# # we have the last parameter in the CTD as first in the list)
# return reversed(parameters)
# some parameters are mapped to command line options, this method helps resolve those mappings, if any
def resolve_param_mapping(param, ctd_model, fix_underscore=False):
# go through all mappings and find if the given param appears as a reference name in a mapping element
param_mapping = None
ctd_model_cli = []
if hasattr(ctd_model, "cli"):
ctd_model_cli = ctd_model.cli
for cli_element in ctd_model_cli:
for mapping_element in cli_element.mappings:
if mapping_element.reference_name == param.name:
if param_mapping is not None:
logger.warning("The parameter %s has more than one mapping in the <cli> section. "
"The first found mapping, %s, will be used." % (param.name, param_mapping), 1)
else:
param_mapping = cli_element.option_identifier
if param_mapping is not None:
ret = param_mapping
else:
ret = param.name
if fix_underscore and ret.startswith("_"):
return ret[1:]
else:
return ret
def _extract_param_cli_name(param, ctd_model, fix_underscore=False):
# we generate parameters with colons for subgroups, but not for the two topmost parents (OpenMS legacy)
if type(param.parent) == ParameterGroup:
if hasattr(ctd_model, "cli") and ctd_model.cli:
logger.warning("Using nested parameter sections (NODE elements) is not compatible with <cli>", 1)
return ":".join(extract_param_path(param, fix_underscore)[:-1]) + ":" + resolve_param_mapping(param, ctd_model, fix_underscore)
else:
return resolve_param_mapping(param, ctd_model, fix_underscore)
def extract_param_path(param, fix_underscore=False):
pl = param.get_lineage(name_only=True)
if fix_underscore:
for i, p in enumerate(pl):
if p.startswith("_"):
pl[i] = pl[i][1:]
return pl
# if type(param.parent) == ParameterGroup or type(param.parent) == Parameters:
# if not hasattr(param.parent.parent, "parent"):
# return [param.name]
# elif not hasattr(param.parent.parent.parent, "parent"):
# return [param.name]
# else:
# return extract_param_path(param.parent) + [param.name]
# else:
# return [param.name]
def extract_param_name(param, fix_underscore=False):
# we generate parameters with colons for subgroups, but not for the two topmost parents (OpenMS legacy)
return ":".join(extract_param_path(param, fix_underscore))
def extract_command_line_prefix(param, ctd_model):
param_name = extract_param_name(param, True)
param_cli_name = _extract_param_cli_name(param, ctd_model, True)
if param_name == param_cli_name:
# there was no mapping, so for the cli name we will use a '-' in the prefix
param_cli_name = "-" + param_name
return param_cli_name
def indent(s, indentation=" "):
"""
helper function to indent text
@param s the text (a string)
@param indentation the desired indentation
@return indented text
"""
return [indentation + _ for _ in s]
def getFromDict(dataDict, mapList):
return reduce(operator.getitem, mapList, dataDict)
def setInDict(dataDict, mapList, value):
getFromDict(dataDict, mapList[:-1])[mapList[-1]] = value
|
WorkflowConversion/CTDConverter
|
ctdconverter/common/utils.py
|
Python
|
gpl-3.0
| 18,108
|
[
"Galaxy",
"OpenMS",
"VisIt"
] |
7343f3a4e7968af2077bc45343b102e3ce26addf779bb683da6fa840bbdf58d3
|
# -----------------------------------------------------------------------------
# User configuration
# -----------------------------------------------------------------------------
outputDir = '/Users/seb/Desktop/Geometry-diskout/'
inputFile = '/Users/seb/Downloads/ParaViewData-3.10.1/Data/disk_out_ref.ex2'
# -----------------------------------------------------------------------------
from paraview import simple
from paraview.web.dataset_builder import *
# -----------------------------------------------------------------------------
# Pipeline creation
# -----------------------------------------------------------------------------
reader = simple.OpenDataFile(inputFile)
reader.PointVariables = ['Temp', 'V', 'Pres', 'AsH3', 'GaMe3', 'CH4', 'H2']
clip = simple.Clip(Input=reader)
clip.ClipType.Normal = [0.0, 1.0, 0.0]
streamLines = simple.StreamTracer(
Input = reader,
SeedType="High Resolution Line Source",
Vectors = ['POINTS', 'V'],
MaximumStreamlineLength = 20.16)
streamLines.SeedType.Point2 = [5.75, 5.75, 10.15999984741211]
streamLines.SeedType.Point1 = [-5.75, -5.75, -10.0]
streamTubes = simple.Tube(Input=streamLines, Radius = 0.2)
sections = {
"LookupTables": {
"AsH3": {
"range": [
0.0804768,
0.184839
],
"preset": "wildflower"
},
"Pres": {
"range": [
0.00678552,
0.0288185
],
"preset": "cool"
},
"Temp": {
"range": [
293.15,
913.15
],
"preset": "spectralflip"
}
}
}
sceneDescription = {
'scene': [
{
'name': 'Stream lines',
'source': streamTubes,
'colors': {
'Pres': {'location': 'POINT_DATA' },
'Temp': {'location': 'POINT_DATA' }
}
},{
'name': 'Clip',
'source': clip,
'colors': {
'Pres': {'location': 'POINT_DATA' },
'Temp': {'location': 'POINT_DATA' }
}
},{
'parent': 'Contours',
'name': 'AsH3 0.1',
'source': simple.Contour(
Input = reader,
PointMergeMethod = "Uniform Binning",
ContourBy = 'AsH3',
Isosurfaces = [0.1],
ComputeScalars = 1),
'colors': {
'AsH3': {'constant': 0.1 },
'Pres': {'location': 'POINT_DATA' },
'Temp': {'location': 'POINT_DATA' }
}
},{
'parent': 'Contours',
'name': 'AsH3 0.14',
'source': simple.Contour(
Input = reader,
PointMergeMethod = "Uniform Binning",
ContourBy = 'AsH3',
Isosurfaces = [0.14],
ComputeScalars = 1),
'colors': {
'AsH3': {'constant': 0.14 },
'Pres': {'location': 'POINT_DATA' },
'Temp': {'location': 'POINT_DATA' }
}
},{
'parent': 'Contours',
'name': 'AsH3 0.18',
'source': simple.Contour(
Input = reader,
PointMergeMethod = "Uniform Binning",
ContourBy = 'AsH3',
Isosurfaces = [0.18],
ComputeScalars = 1),
'colors': {
'AsH3': {'constant': 0.18 },
'Pres': {'location': 'POINT_DATA' },
'Temp': {'location': 'POINT_DATA' }
}
}
]
}
# -----------------------------------------------------------------------------
# Data Generation
# -----------------------------------------------------------------------------
# Create Image Builder
dsb = GeometryDataSetBuilder(outputDir, sceneDescription, sections=sections)
dsb.start()
dsb.writeData()
dsb.stop()
|
Kitware/arctic-viewer
|
scripts/examples/paraview/samples/Geometry-diskout.py
|
Python
|
bsd-3-clause
| 4,125
|
[
"ParaView"
] |
75782691f1543748759d5cd643f73fcfe7691ee60d07db510e095aea488e350f
|
#!/usr/bin/env python
"""
PyVTK provides tools for manipulating VTK files in Python.
VtkData - create VTK files from Python / read VTK files to Python
"""
"""
Copyright 2001 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the LGPL. See http://www.fsf.org
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Revision: 1.11 $
$Date: 2003-04-07 14:56:08 $
Pearu Peterson
"""
__author__ = "Pearu Peterson <pearu@cens.ioc.ee>"
__license__ = "LGPL (see http://www.fsf.org)"
from __version__ import __version__
__all__ = ['StructuredPoints','StructuredGrid','UnstructuredGrid',
'RectilinearGrid','PolyData',
'Scalars','ColorScalars','LookupTable','Vectors','Normals',
'TextureCoordinates','Tensors','Field',
'PointData','CellData',
'VtkData']
import types
import os
import common
from StructuredPoints import StructuredPoints, structured_points_fromfile
from StructuredGrid import StructuredGrid, structured_grid_fromfile
from UnstructuredGrid import UnstructuredGrid, unstructured_grid_fromfile
from RectilinearGrid import RectilinearGrid, rectilinear_grid_fromfile
from PolyData import PolyData, polydata_fromfile
from Scalars import Scalars,scalars_fromfile
from ColorScalars import ColorScalars, color_scalars_fromfile
from LookupTable import LookupTable, lookup_table_fromfile
from Vectors import Vectors, vectors_fromfile
from Normals import Normals, normals_fromfile
from TextureCoordinates import TextureCoordinates, texture_coordinates_fromfile
from Tensors import Tensors, tensors_fromfile
from Field import Field, field_fromfile
from Data import PointData,CellData
class VtkData(common.Common):
"""
VtkData
=======
Represents VTK file that has four relevant parts:
header - string up to length 255
format - string: ascii | binary
DataSet - StructuredPoints | StructuredGrid | UnstructuredGrid
| RectilinearGrid | PolyData
Data - PointData | CellData
Usage:
------
v = VtkData(<DataSet instance> [,<header string>,<Data instances>,..])
v = VtkData(<filename>, only_structure = 0) - read VTK data from file.
v.tofile(filename, format = 'ascii') - save VTK data to file.
Attributes:
header
structure
point_data
cell_data
Public methods:
to_string(format = 'ascii')
tofile(filename, format = 'ascii')
DataSet
=======
StructuredPoints(<3-sequence of dimensions>
[,<3-sequence of origin> [, <3-sequence of spacing>]])
StructuredGrid(<3-sequence of dimensions>,
<sequence of 3-sequences of points>)
UnstructuredGrid(<sequence of 3-sequences of points>
[,<cell> = <sequence of (sequences of) integers>])
cell - vertex | poly_vertex | line | poly_line | triangle
| triangle_strip | polygon | pixel | quad | tetra
| voxel | hexahedron | wedge | pyramid
RectilinearGrid([x = <sequence of x-coordinates>],
[y = <sequence of y-coordinates>],
[z = <sequence of z-coordinates>])
PolyData(<sequence of 3-sequences of points>,
[vertices = <sequence of (sequences of) integers>],
[lines = <sequence of (sequences of) integers>],
[polygons = <sequence of (sequences of) integers>],
[triangle_strips = <sequence of (sequences of) integers>])
Data
====
PointData | CellData ([<DataSetAttr instances>]) - construct Data instance
DataSetAttr
===========
DataSetAttr - Scalars | ColorScalars | LookupTable | Vectors
| Normals | TextureCoordinates | Tensors | Field
Scalars(<sequence of scalars> [,name[, lookup_table]])
ColorScalars(<sequence of scalar sequences> [,name])
LookupTable(<sequence of 4-sequences> [,name])
Vectors(<sequence of 3-sequences> [,name])
Normals(<sequence of 3-sequences> [,name])
TextureCoordinates(<sequence of (1,2, or 3)-sequences> [,name])
Tensors(<sequence of (3x3)-sequences> [,name])
Field([name,] [arrayname_1 = sequence of n_1-sequences, ...
arrayname_m = sequence of n_m-sequences,])
where len(array_1) == .. == len(array_m) must hold.
"""
header = None
point_data = None
cell_data = None
def __init__(self,*args,**kws):
assert args,'expected at least one argument'
if type(args[0]) is types.StringType:
if kws.has_key('only_structure') and kws['only_structure']:
self.fromfile(args[0],1)
else:
self.fromfile(args[0])
return
else:
structure = args[0]
args = list(args)[1:]
if not common.is_dataset(structure):
raise TypeError,'argument structure must be StructuredPoints|StructuredGrid|UnstructuredGrid|RectilinearGrid|PolyData but got %s'%(type(structure))
self.structure = structure
for a in args:
if common.is_string(a):
if len(a)>255:
self.skipping('striping header string to a length =255')
self.header = a[:255]
elif common.is_pointdata(a):
self.point_data = a
elif common.is_celldata(a):
self.cell_data = a
else:
self.skipping('unexpexted argument %s'%(type(a)))
if self.header is None:
self.header = 'Really cool data'
self.warning('Using header=%s'%(`self.header`))
if self.point_data is None and self.cell_data is None:
self.warning('No data defined')
if self.point_data is not None:
s = self.structure.get_size()
s1 = self.point_data.get_size()
if s1 != s:
raise ValueError,'DataSet (size=%s) and PointData (size=%s) have different sizes'%(s,s1)
else:
self.point_data = PointData()
if self.cell_data is not None:
s = self.structure.get_cell_size()
s1 = self.cell_data.get_size()
if s1 != s:
raise ValueError,'DataSet (cell_size=%s) and CellData (size=%s) have different sizes'%(s,s1)
else:
self.cell_data = CellData()
def to_string(self, format = 'ascii'):
ret = ['# vtk DataFile Version 2.0',
self.header,
format.upper(),
self.structure.to_string(format)
]
if self.cell_data.data:
ret.append(self.cell_data.to_string(format))
if self.point_data.data:
ret.append(self.point_data.to_string(format))
#print `ret`
return '\n'.join(ret)
def tofile(self, filename, format = 'ascii'):
"""Save VTK data to file.
"""
if not common.is_string(filename):
raise TypeError,'argument filename must be string but got %s'%(type(filename))
if format not in ['ascii','binary']:
raise TypeError,'argument format must be ascii | binary'
filename = filename.strip()
if not filename:
raise ValueError,'filename must be non-empty string'
if filename[-4:]!='.vtk':
filename += '.vtk'
#print 'Creating file',`filename`
f = open(filename,'wb')
f.write(self.to_string(format))
f.close()
def fromfile(self,filename, only_structure = 0):
filename = filename.strip()
if filename[-4:]!='.vtk':
filename += '.vtk'
#print 'Reading file',`filename`
f = open(filename,'rb')
l = f.readline()
if not l.strip().replace(' ','').lower() == '#vtkdatafileversion2.0':
raise TypeError, 'File '+`filename`+' is not VTK 2.0 format'
self.header = f.readline().rstrip()
format = f.readline().strip().lower()
if format not in ['ascii','binary']:
raise ValueError,'Expected ascii|binary but got %s'%(`format`)
if format == 'binary':
raise NotImplementedError,'reading vtk binary format'
l = common._getline(f).lower().split(' ')
if l[0].strip() != 'dataset':
raise ValueError,'expected dataset but got %s'%(l[0])
try:
ff = eval(l[1]+'_fromfile')
except NameError:
raise NotImplementedError,'%s_fromfile'%(l[1])
self.structure,l = ff(f,self)
for i in range(2):
if only_structure: break
if not l: break
l = [s.strip() for s in l.lower().split(' ')]
assert len(l)==2 and l[0] in ['cell_data','point_data'], l[0]
data = l[0]
n = eval(l[1])
lst = []
while 1:
l = common._getline(f)
if not l: break
sl = [s.strip() for s in l.split()]
k = sl[0].lower()
if k not in ['scalars','color_scalars','lookup_table','vectors',
'normals','texture_coordinates','tensors','field']:
break
try:
ff = eval(k+'_fromfile')
except NameError:
raise NotImplementedError,'%s_fromfile'%(k)
lst.append(ff(f,n,sl[1:]))
if data == 'point_data':
self.point_data = PointData(*lst)
if data == 'cell_data':
self.cell_data = CellData(*lst)
if self.point_data is None:
self.point_data = PointData()
if self.cell_data is None:
self.cell_data = CellData()
f.close()
if __name__ == "__main__":
vtk = VtkData(StructuredPoints((3,1,1)),
'This is title',
PointData(Scalars([3,4,5]))
)
vtk.tofile('test')
|
chunshen1987/iSS
|
utilities/for_paraview/lib/__init__.py
|
Python
|
mit
| 10,057
|
[
"VTK"
] |
6c73bd620905b2e1913fcdbafe4f9b395a9908b949874f40fbad1c994d2592e2
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: Brian Cherinka, José Sánchez-Gallego, and Brett Andrews
# @Date: 2017-03-20
# @Filename: conftest.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
#
# @Last modified by: Brian Cherinka
# @Last modified time: 2018-07-21 21:51:06
import copy
import itertools
import os
import warnings
from collections import OrderedDict
import pytest
import yaml
from brain import bconfig
from flask_jwt_extended import tokens
from sdss_access.path import Path
from marvin import config, marvindb
from marvin.api.api import Interaction
from marvin.tools.cube import Cube
from marvin.tools.maps import Maps
from marvin.tools.modelcube import ModelCube
from marvin.tools.query import Query
from marvin.utils.datamodel.dap import datamodel
warnings.simplefilter('always')
# PYTEST MODIFIERS
# -----------------
def pytest_addoption(parser):
"""Add new options"""
# run slow tests
parser.addoption('--runslow', action='store_true', default=False, help='Run slow tests.')
# control releases run
parser.addoption('--travis-only', action='store_true', default=False, help='Run a Travis only subset')
def pytest_runtest_setup(item):
"""Skip slow tests."""
if 'slow' in item.keywords and not item.config.getoption('--runslow'):
pytest.skip('Requires --runslow option to run.')
def pytest_configure(config):
''' Runs during configuration of conftest. Checks and sets a global instance for a
TravisSubset based on the pytest command line input of --travis-only
'''
option = config.getoption('--travis-only')
global travis
if option:
travis = TravisSubset()
# specific release instance
travis = None
class TravisSubset(object):
def __init__(self):
self.new_gals = ['8485-1901']
self.new_releases = ['MPL-6']
self.new_bintypes = ['SPX', 'HYB10']
self.new_templates = ['GAU-MILESHC']
self.new_dbs = ['nodb']
self.new_origins = ['file', 'api']
self.new_modes = ['local', 'remote', 'auto']
# Global Parameters for FIXTURES
# ------------------------------
releases = ['MPL-6', 'MPL-5', 'MPL-4'] # to loop over releases (see release fixture)
bintypes_accepted = {'MPL-4': ['NONE', 'VOR10'],
'MPL-5': ['SPX', 'VOR10'],
'MPL-6': ['SPX', 'HYB10']}
templates_accepted = {'MPL-4': ['MIUSCAT_THIN', 'MILES_THIN']}
def populate_bintypes_templates(releases):
''' Generates bintype and template dictionaries for each release '''
bintypes = OrderedDict((release, []) for release in releases)
templates = OrderedDict((release, []) for release in releases)
for release in releases:
bintemps = datamodel[release].get_bintemps()
for bintemp in bintemps:
bintype = bintemp.split('-')[0]
template = '-'.join(bintemp.split('-')[1:])
if release in bintypes_accepted and bintype not in bintypes_accepted[release]:
continue
if release in templates_accepted and template not in templates_accepted[release]:
continue
if bintype not in bintypes[release]:
bintypes[release].append(bintype)
if template not in templates[release]:
templates[release].append(template)
return bintypes, templates
bintypes, templates = populate_bintypes_templates(releases)
# TODO reduce modes to only local and remote
modes = ['local', 'remote', 'auto'] # to loop over modes (see mode fixture)
dbs = ['db', 'nodb'] # to loop over dbs (see db fixture)
origins = ['file', 'db', 'api'] # to loop over data origins (see data_origin fixture)
# Galaxy and Query data is stored in a YAML file
galaxy_data = yaml.load(open(os.path.join(os.path.dirname(__file__), 'data/galaxy_test_data.dat')))
query_data = yaml.load(open(os.path.join(os.path.dirname(__file__), 'data/query_test_data.dat')))
@pytest.fixture(scope='session', params=releases)
def release(request):
"""Yield a release."""
if travis and request.param not in travis.new_releases:
pytest.skip('Skipping non-requested release')
return request.param
def _get_release_generator_chain():
"""Return all valid combinations of (release, bintype, template)."""
return itertools.chain(*[itertools.product([release], bintypes[release],
templates[release]) for release in releases])
def _params_ids(fixture_value):
"""Return a test id for the release chain."""
return '-'.join(fixture_value)
@pytest.fixture(scope='session', params=sorted(_get_release_generator_chain()), ids=_params_ids)
def get_params(request):
"""Yield a tuple of (release, bintype, template)."""
# placeholder until the marvin_test_if decorator works in 2.7
release, bintype, template = request.param
if travis and release not in travis.new_releases:
pytest.skip('Skipping non-requested release')
if travis and bintype not in travis.new_bintypes:
pytest.skip('Skipping non-requested bintype')
if travis and template not in travis.new_templates:
pytest.skip('Skipping non-requested template')
return request.param
@pytest.fixture(scope='session', params=sorted(galaxy_data.keys()))
def plateifu(request):
"""Yield a plate-ifu."""
if travis and request.param not in travis.new_gals:
pytest.skip('Skipping non-requested galaxies')
return request.param
@pytest.fixture(scope='session', params=origins)
def data_origin(request):
"""Yield a data access mode."""
if travis and request.param not in travis.new_origins:
pytest.skip('Skipping non-requested origins')
return request.param
@pytest.fixture(scope='session', params=modes)
def mode(request):
"""Yield a data mode."""
if travis and request.param not in travis.new_modes:
pytest.skip('Skipping non-requested modes')
return request.param
# Config-based FIXTURES
# ----------------------
@pytest.fixture(scope='session', autouse=True)
def set_config():
"""Set config."""
config.use_sentry = False
config.add_github_message = False
config._traceback = None
@pytest.fixture()
def check_config():
"""Check the config to see if a db is on."""
return config.db is None
URLMAP = None
@pytest.fixture(scope='session')
def set_sasurl(loc='local', port=None):
"""Set the sasurl to local or test-utah, and regenerate the urlmap."""
if not port:
port = int(os.environ.get('LOCAL_MARVIN_PORT', 5000))
istest = True if loc == 'utah' else False
config.switchSasUrl(loc, test=istest, port=port)
global URLMAP
if not URLMAP:
response = Interaction('api/general/getroutemap', request_type='get', auth='netrc')
config.urlmap = response.getRouteMap()
URLMAP = config.urlmap
@pytest.fixture(scope='session', autouse=True)
def saslocal():
"""Set sasurl to local."""
set_sasurl(loc='local')
@pytest.fixture(scope='session')
def urlmap(set_sasurl):
"""Yield the config urlmap."""
return config.urlmap
@pytest.fixture(scope='session')
def set_release(release):
"""Set the release in the config."""
config.setMPL(release)
@pytest.fixture(scope='session')
def versions(release):
"""Yield the DRP and DAP versions for a release."""
drpver, dapver = config.lookUpVersions(release)
return drpver, dapver
@pytest.fixture(scope='session')
def drpver(versions):
"""Return DRP version."""
drpver, __ = versions
return drpver
@pytest.fixture(scope='session')
def dapver(versions):
"""Return DAP version."""
__, dapver = versions
return dapver
def set_the_config(release):
"""Set config release without parametrizing.
Using ``set_release`` combined with ``galaxy`` double parametrizes!"""
config.access = 'collab'
config.setRelease(release)
set_sasurl(loc='local')
config.login()
config._traceback = None
def custom_login():
config.token = tokens.encode_access_token('test', os.environ.get('MARVIN_SECRET'), 'HS256', False, True, 'user_claims', True, 'identity', 'user_claims')
def custom_auth(self, authtype=None):
authtype = 'token'
super(Interaction, self).setAuth(authtype=authtype)
# DB-based FIXTURES
# -----------------
class DB(object):
"""Object representing aspects of the marvin db.
Useful for tests needing direct DB access.
"""
def __init__(self):
"""Initialize with DBs."""
self._marvindb = marvindb
self.session = marvindb.session
self.datadb = marvindb.datadb
self.sampledb = marvindb.sampledb
self.dapdb = marvindb.dapdb
@pytest.fixture(scope='session')
def maindb():
"""Yield an instance of the DB object."""
yield DB()
@pytest.fixture(scope='function')
def db_off():
"""Turn the DB off for a test, and reset it after."""
config.forceDbOff()
yield
config.forceDbOn()
@pytest.fixture(autouse=True)
def db_on():
"""Automatically turn on the DB at collection time."""
config.forceDbOn()
@pytest.fixture()
def usedb(request):
''' fixture for optional turning off the db '''
if request.param:
config.forceDbOn()
else:
config.forceDbOff()
return config.db is not None
@pytest.fixture(params=dbs)
def db(request):
"""Turn local db on or off.
Use this to parametrize over all db options.
"""
if travis and request.param not in travis.new_dbs:
pytest.skip('Skipping non-requested dbs')
if request.param == 'db':
config.forceDbOn()
else:
config.forceDbOff()
yield config.db is not None
config.forceDbOn()
@pytest.fixture()
def exporigin(mode, db):
"""Return the expected origins for a given db/mode combo."""
if mode == 'local' and not db:
return 'file'
elif mode == 'local' and db:
return 'db'
elif mode == 'remote' and not db:
return 'api'
elif mode == 'remote' and db:
return 'api'
elif mode == 'auto' and db:
return 'db'
elif mode == 'auto' and not db:
return 'file'
@pytest.fixture()
def expmode(mode, db):
''' expected modes for a given db/mode combo '''
if mode == 'local' and not db:
return None
elif mode == 'local' and db:
return 'local'
elif mode == 'remote' and not db:
return 'remote'
elif mode == 'remote' and db:
return 'remote'
elif mode == 'auto' and db:
return 'local'
elif mode == 'auto' and not db:
return 'remote'
@pytest.fixture()
def user(maindb):
username = 'test'
password = 'test'
model = maindb.datadb.User
user = maindb.session.query(model).filter(model.username == username).one_or_none()
if not user:
user = model(username=username, login_count=1)
user.set_password(password)
maindb.session.add(user)
yield user
maindb.session.delete(user)
# Monkeypatch-based FIXTURES
# --------------------------
@pytest.fixture()
def monkeyconfig(request, monkeypatch):
"""Monkeypatch a variable on the Marvin config.
Example at line 160 in utils/test_general.
"""
name, value = request.param
monkeypatch.setattr(config, name, value=value)
@pytest.fixture()
def monkeymanga(monkeypatch, temp_scratch):
"""Monkeypatch the environ to create a temp SAS dir for reading/writing/downloading.
Example at line 141 in utils/test_images.
"""
monkeypatch.setitem(os.environ, 'SAS_BASE_DIR', str(temp_scratch))
monkeypatch.setitem(os.environ, 'MANGA_SPECTRO_REDUX',
str(temp_scratch.join('mangawork/manga/spectro/redux')))
monkeypatch.setitem(os.environ, 'MANGA_SPECTRO_ANALYSIS',
str(temp_scratch.join('mangawork/manga/spectro/analysis')))
@pytest.fixture()
def monkeyauth(monkeypatch):
monkeypatch.setattr(config, 'login', custom_login)
monkeypatch.setattr(Interaction, 'setAuth', custom_auth)
monkeypatch.setattr(bconfig, '_public_api_url', config.sasurl)
monkeypatch.setattr(bconfig, '_collab_api_url', config.sasurl)
# Temp Dir/File-based FIXTURES
# ----------------------------
@pytest.fixture(scope='function')
def temp_scratch(tmpdir_factory):
"""Create a temporary scratch space for reading/writing.
Use for creating temp dirs and files.
Example at line 208 in tools/test_query, line 254 in tools/test_results, and
misc/test_marvin_pickle.
"""
fn = tmpdir_factory.mktemp('scratch')
return fn
def tempafile(path, temp_scratch):
"""Return a pytest temporary file given the original file path.
Example at line 141 in utils/test_images.
"""
redux = os.getenv('MANGA_SPECTRO_REDUX')
anal = os.getenv('MANGA_SPECTRO_ANALYSIS')
endredux = path.partition(redux)[-1]
endanal = path.partition(anal)[-1]
end = (endredux or endanal)
return temp_scratch.join(end)
# Object-based FIXTURES
# ---------------------
class Galaxy(object):
"""An example galaxy for Marvin-tools testing."""
sasbasedir = os.getenv('SAS_BASE_DIR')
mangaredux = os.getenv('MANGA_SPECTRO_REDUX')
mangaanalysis = os.getenv('MANGA_SPECTRO_ANALYSIS')
dir3d = 'stack'
def __init__(self, plateifu):
"""Initialize plate and ifu."""
self.plateifu = plateifu
self.plate, self.ifu = self.plateifu.split('-')
self.plate = int(self.plate)
def set_galaxy_data(self, data_origin=None):
"""Set galaxy properties from the configuration file."""
if self.plateifu not in galaxy_data:
return
data = copy.deepcopy(galaxy_data[self.plateifu])
for key in data.keys():
setattr(self, key, data[key])
# sets specfic data per release
releasedata = self.releasedata[self.release]
for key in releasedata.keys():
setattr(self, key, releasedata[key])
# remap NSA drpall names for MPL-4 vs 5+
drpcopy = self.nsa_data['drpall'].copy()
for key, val in self.nsa_data['drpall'].items():
if isinstance(val, list):
newval, newkey = drpcopy.pop(key)
if self.release == 'MPL-4':
drpcopy[newkey] = newval
else:
drpcopy[key] = newval
self.nsa_data['drpall'] = drpcopy
def set_params(self, bintype=None, template=None, release=None):
"""Set bintype, template, etc."""
self.release = release
self.drpver, self.dapver = config.lookUpVersions(self.release)
self.drpall = 'drpall-{0}.fits'.format(self.drpver)
self.bintype = datamodel[self.dapver].get_bintype(bintype)
self.template = datamodel[self.dapver].get_template(template)
self.bintemp = '{0}-{1}'.format(self.bintype.name, self.template.name)
if release == 'MPL-4':
self.niter = int('{0}{1}'.format(self.template.n, self.bintype.n))
else:
self.niter = '*'
self.access_kwargs = {'plate': self.plate, 'ifu': self.ifu, 'drpver': self.drpver,
'dapver': self.dapver, 'dir3d': self.dir3d, 'mpl': self.release,
'bintype': self.bintype.name, 'n': self.niter, 'mode': '*',
'daptype': self.bintemp}
def set_filepaths(self, pathtype='full'):
"""Set the paths for cube, maps, etc."""
self.path = Path()
self.imgpath = self.path.__getattribute__(pathtype)('mangaimage', **self.access_kwargs)
self.cubepath = self.path.__getattribute__(pathtype)('mangacube', **self.access_kwargs)
self.rsspath = self.path.__getattribute__(pathtype)('mangarss', **self.access_kwargs)
if self.release == 'MPL-4':
self.mapspath = self.path.__getattribute__(pathtype)('mangamap', **self.access_kwargs)
self.modelpath = None
else:
self.access_kwargs.pop('mode')
self.mapspath = self.path.__getattribute__(pathtype)('mangadap5', mode='MAPS',
**self.access_kwargs)
self.modelpath = self.path.__getattribute__(pathtype)('mangadap5', mode='LOGCUBE',
**self.access_kwargs)
def get_location(self, path):
"""Extract the location from the input path."""
return self.path.location("", full=path)
def partition_path(self, path):
"""Partition the path into non-redux/analysis parts."""
endredux = path.partition(self.mangaredux)[-1]
endanalysis = path.partition(self.mangaanalysis)[-1]
end = (endredux or endanalysis)
return end
def new_path(self, name, newvar):
''' Sets a new path with the subsituted name '''
access_copy = self.access_kwargs.copy()
access_copy['mode'] = '*'
access_copy.update(**newvar)
if name == 'maps':
access_copy['mode'] = 'MAPS'
name = 'mangamap' if self.release == 'MPL-4' else 'mangadap5'
elif name == 'modelcube':
access_copy['mode'] = 'LOGCUBE'
name = None if self.release == 'MPL-4' else 'mangadap5'
path = self.path.full(name, **access_copy) if name else None
return path
@pytest.fixture(scope='function')
def galaxy(monkeyauth, get_params, plateifu):
"""Yield an instance of a Galaxy object for use in tests."""
release, bintype, template = get_params
set_the_config(release)
gal = Galaxy(plateifu=plateifu)
gal.set_params(bintype=bintype, template=template, release=release)
gal.set_filepaths()
gal.set_galaxy_data()
yield gal
gal = None
@pytest.fixture(scope='function')
def cube(galaxy, exporigin, mode):
''' Yield a Marvin Cube based on the expected origin combo of (mode+db).
Fixture tests 6 cube origins from (mode+db) combos [file, db and api]
'''
if str(galaxy.bintype) != 'SPX':
pytest.skip()
if exporigin == 'file':
c = Cube(filename=galaxy.cubepath, release=galaxy.release, mode=mode)
else:
c = Cube(plateifu=galaxy.plateifu, release=galaxy.release, mode=mode)
c.exporigin = exporigin
c.initial_mode = mode
yield c
c = None
@pytest.fixture(scope='function')
def modelcube(galaxy, exporigin, mode):
''' Yield a Marvin ModelCube based on the expected origin combo of (mode+db).
Fixture tests 6 modelcube origins from (mode+db) combos [file, db and api]
'''
if exporigin == 'file':
mc = ModelCube(filename=galaxy.modelpath, release=galaxy.release, mode=mode, bintype=galaxy.bintype)
else:
mc = ModelCube(plateifu=galaxy.plateifu, release=galaxy.release, mode=mode, bintype=galaxy.bintype)
mc.exporigin = exporigin
mc.initial_mode = mode
yield mc
mc = None
@pytest.fixture(scope='function')
def maps(galaxy, exporigin, mode):
''' Yield a Marvin Maps based on the expected origin combo of (mode+db).
Fixture tests 6 cube origins from (mode+db) combos [file, db and api]
'''
if exporigin == 'file':
m = Maps(filename=galaxy.mapspath, release=galaxy.release, mode=mode, bintype=galaxy.bintype)
else:
m = Maps(plateifu=galaxy.plateifu, release=galaxy.release, mode=mode, bintype=galaxy.bintype)
m.exporigin = exporigin
yield m
m = None
modes = ['local', 'remote', 'auto'] # to loop over modes (see mode fixture)
dbs = ['db', 'nodb'] # to loop over dbs (see db fixture)
origins = ['file', 'db', 'api'] # to loop over data origins (see data_origin fixture)
@pytest.fixture(scope='class')
def maps_release_only(release):
return Maps(plateifu='8485-1901', release=release)
@pytest.fixture(scope='function')
def query(request, monkeyauth, release, mode, db):
''' Yields a Query that loops over all modes and db options '''
data = query_data[release]
set_the_config(release)
if mode == 'local' and not db:
pytest.skip('cannot use queries in local mode without a db')
searchfilter = request.param if hasattr(request, 'param') else None
q = Query(searchfilter=searchfilter, mode=mode, release=release)
q.expdata = data
yield q
config.forceDbOn()
q = None
# @pytest.fixture(autouse=True)
# def skipall():
# pytest.skip('skipping everything')
|
albireox/marvin
|
python/marvin/tests/conftest.py
|
Python
|
bsd-3-clause
| 20,539
|
[
"Brian",
"Galaxy"
] |
48bea8e966717c25ae1417d2699090d87b8b1cfcaa6ee4b9847f4ba81fb5bb97
|
import numpy
from time import strftime
from ase.build import bulk
from ase.neighborlist import NeighborList
from ase import units
from expectra.feff import feff_edge_number, run_feff
from mpi4py import MPI
COMM_WORLD = MPI.COMM_WORLD
def getxk(e):
return numpy.sign(e)*numpy.sqrt(numpy.abs(e))
def xk2xkp(xk, vrcorr):
xk0 = xk*units.Bohr
vr = vrcorr / units.Rydberg
xksign = numpy.sign(xk0)
e = xksign*xk0**2 + vr
return getxk(e) / units.Bohr
def xkp2xk(xk, vrcorr):
xk0 = xk*units.Bohr
vr = vrcorr / units.Rydberg
xksign = numpy.sign(xk0)
e = xksign*xk0**2 - vr
return getxk(e) / units.Bohr
def chi_path(path, r, sig2, energy_shift, s02, N):
#this gives errors at small k (<0.1), but it doesn't matter
#as the k-window should always be zero in this region
#also uses real momentum for dw factor
delta_k = 0.05
vrcorr = energy_shift
xkpmin = xk2xkp(path['xk'][0], vrcorr)
n = int(xkpmin / delta_k)
if xkpmin > 0.0: n += 1
xkmin = n*delta_k
xkout = numpy.arange(xkmin, 20.0+delta_k, delta_k)
xk0 = xkp2xk(xkout, vrcorr)
f0 = numpy.interp(xk0, path['xk'], path['afeff'])
lambda0 = numpy.interp(xk0, path['xk'], path['xlam'])
delta0 = numpy.interp(xk0, path['xk'], path['cdelta'] + path['phfeff'])
redfac0 = numpy.interp(xk0, path['xk'], path['redfac'])
rep0 = numpy.interp(xk0, path['xk'], path['rep'])
p0 = rep0 + 1j/lambda0
dr = r - path['reff']
chi = numpy.zeros(len(xk0), dtype=complex)
chi[1:] = redfac0[1:]*s02*N*f0[1:]/(xk0[1:]*(path['reff']+dr)**2.0)
chi[1:] *= numpy.exp(-2*path['reff']/lambda0[1:])
chi[1:] *= numpy.exp(-2*(p0[1:]**2.0)*sig2)
chi[1:] *= numpy.exp(1j*(2*p0[1:]*dr - 4*p0[1:]*sig2/path['reff']))
chi[1:] *= numpy.exp(1j*(2*xk0[1:]*path['reff'] + delta0[1:]))
return xkout, numpy.imag(chi)
def exafs_reference_path(z, feff_options):
atoms = bulk(z, orthorhombic=True, cubic=True)
atoms = atoms.repeat((4,4,4))
center = numpy.argmin(numpy.sum((atoms.get_scaled_positions() -
numpy.array( (.5,.5,.5) ))**2.0, axis=1))
#do the bulk reference scattering calculation and get the path
#data from feff
path = run_feff(atoms, center, feff_options, get_path=True)[2]
return path
def exafs_first_shell(S02, energy_shift, absorber,
ignore_elements, edge, neighbor_cutoff, trajectory):
feff_options = {
'RMAX':str(neighbor_cutoff),
'HOLE':'%i %.4f' % (feff_edge_number(edge), S02),
'CORRECTIONS':'%.4f %.4f' % (energy_shift, 0.0),
}
#get the bulk reference state
path = exafs_reference_path(absorber, feff_options)
k = None
chi_total = None
counter = -1
interactions = 0
nl = None
for step, atoms in enumerate(trajectory):
if COMM_WORLD.rank == 0:
time_stamp = strftime("%F %T")
print '[%s] step %i/%i' % (time_stamp, step+1, len(trajectory))
atoms = atoms.copy()
if ignore_elements:
ignore_indicies = [atom.index for atom in atoms
if atom.symbol in ignore_elements]
del atoms[ignore_indicies]
if nl is None:
nl = NeighborList(len(atoms)*[neighbor_cutoff], skin=0.3,
self_interaction=False)
nl.update(atoms)
for i in xrange(len(atoms)):
if atoms[i].symbol != absorber:
continue
indicies, offsets = nl.get_neighbors(i)
for j, offset in zip(indicies, offsets):
counter += 1
if counter % COMM_WORLD.size != COMM_WORLD.rank:
continue
r = atoms.get_distance(i,j,True)
if r >= neighbor_cutoff: continue
interactions += 1
k, chi = chi_path(path, r, 0.0, energy_shift, S02, 1)
if chi_total is not None:
chi_total += chi
else:
chi_total = chi
chi_total = COMM_WORLD.allreduce(chi_total)
chi_total /= atoms.get_chemical_symbols().count(absorber)
chi_total /= len(trajectory)
chi_total *= 2
return k, chi_total
def exafs_multiple_scattering(S02, energy_shift, absorber,
ignore_elements, edge, rmax, trajectory):
feff_options = {
'RMAX':str(rmax),
'HOLE':'%i %.4f' % (feff_edge_number(edge), S02),
'CORRECTIONS':'%.4f %.4f' % (energy_shift, 0.0),
'NLEG':'4',
}
k = None
chi_total = None
counter = -1
for step, atoms in enumerate(trajectory):
if COMM_WORLD.rank == 0:
time_stamp = strftime("%F %T")
print '[%s] step %i/%i' % (time_stamp, step+1, len(trajectory))
atoms = atoms.copy()
if ignore_elements:
ignore_indicies = [atom.index for atom in atoms
if atom.symbol in ignore_elements]
del atoms[ignore_indicies]
for i in xrange(len(atoms)):
counter += 1
if counter % COMM_WORLD.size != COMM_WORLD.rank:
continue
if atoms[i].symbol != absorber:
continue
k, chi = run_feff(atoms, i, feff_options)
if k is None and chi is None:
continue
if chi_total is not None:
chi_total += chi
else:
chi_total = chi
#in case too many ranks
k = COMM_WORLD.bcast(k)
if chi_total is None:
chi_total = numpy.zeros(len(k))
chi_total = COMM_WORLD.allreduce(chi_total)
chi_total /= atoms.get_chemical_symbols().count(absorber)
chi_total /= len(trajectory)
return k, chi_total
|
SamChill/expectra
|
expectra/exafs.py
|
Python
|
mit
| 5,769
|
[
"ASE",
"FEFF"
] |
ac0a8690c26bc3325831ae8912c5fc0d29db718c715bee15729e60bcb13b7f28
|
from setuptools import setup, find_packages
from listen.constants import LIBRARY_URL
from listen import (
__license__ as license,
__author__ as author,
__title__ as title,
__version__ as version
)
setup(
name=title,
version=version,
packages=find_packages("listen"),
url=LIBRARY_URL,
license=license,
author=author,
author_email="",
description="Python 3 bindings for the Listen.moe API.",
long_description="An asynchronous wrapper for the Listen.moe api.",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries"
],
keywords="aiohttp asyncio listen.moe",
install_requires=["aiohttp"],
)
|
GetRektByMe/Listen
|
setup.py
|
Python
|
mit
| 908
|
[
"MOE"
] |
d8be5fd423199473a35574c65ee9394a94be072795690bbe631de67d967a8b94
|
import sys
import ply.yacc as yacc
from Cparser import Cparser
from TreePrinter import TreePrinter
from TypeChecker import TypeChecker
semantic_control = True
print_tree = False
if __name__ == '__main__':
TreePrinter() # Loads printTree definitions
try:
filename = sys.argv[1] if len(sys.argv) > 1 else "example.txt"
file = open(filename, "r")
except IOError:
print("Cannot open {0} file".format(filename))
sys.exit(0)
c_parser = Cparser()
parser = yacc.yacc(module=c_parser)
text = file.read()
ast = parser.parse(text, lexer=c_parser.scanner)
if c_parser.errors:
print "There were errors in your code. Please correct them."
exit(1)
if print_tree:
print "Parsing tree:\n"
str = ast.printTree()
print str
if semantic_control:
print "Starting semantic control..."
typeChecker = TypeChecker()
typeChecker.visit(ast)
print "Done"
if typeChecker.errors:
print "There were errors in your code. Please correct them."
exit(1)
|
salceson/kompilatory
|
lab3/main.py
|
Python
|
mit
| 1,105
|
[
"VisIt"
] |
814ba26cd2d0956e57aa22090fc78549425e08ce3219003d2d0391ac27668804
|
#!/usr/bin/env python
#coding=utf-8
from setuptools import setup, find_packages
setup(name='ezfile',
version='0.0.3.4',
description='A one-line file-IO package',
author='moe001',
author_email='i@001.moe',
url='https://github.com/moe001/ezfile',
packages=find_packages(),
license='MIT',
long_description=open('README.rst').read(),
)
|
moe001/ezfile
|
ezfile_main/setup.py
|
Python
|
mit
| 386
|
[
"MOE"
] |
dc63aaed1ef338559a949f47bf9d9c751469e4388fa1f754c35fce4e08247d32
|
#
# Copyright (C) 2001-2004 greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
""" The "parser" for compound descriptors.
I almost hesitate to document this, because it's not the prettiest
thing the world has ever seen... but it does work (for at least some
definitions of the word).
Rather than getting into the whole mess of writing a parser for the
compound descriptor expressions, I'm just using string substitutions
and python's wonderful ability to *eval* code.
It would probably be a good idea at some point to replace this with a
real parser, if only for the flexibility and intelligent error
messages that would become possible.
The general idea is that we're going to deal with expressions where
atomic descriptors have some kind of method applied to them which
reduces them to a single number for the entire composition. Compound
descriptors (those applicable to the compound as a whole) are not
operated on by anything in particular (except for standard math stuff).
Here's the general flow of things:
1) Composition descriptor references ($a, $b, etc.) are replaced with the
corresponding descriptor names using string subsitution.
(*_SubForCompoundDescriptors*)
2) Atomic descriptor references ($1, $2, etc) are replaced with lookups
into the atomic dict with "DEADBEEF" in place of the atom name.
(*_SubForAtomicVars*)
3) Calls to Calculator Functions are augmented with a reference to
the composition and atomic dictionary
(*_SubMethodArgs*)
**NOTE:**
anytime we don't know the answer for a descriptor, rather than
throwing a (completely incomprehensible) exception, we just return
-666. So bad descriptor values should stand out like sore thumbs.
"""
from __future__ import print_function
__DEBUG=0
from rdkit import RDConfig
# we do this to allow the use of stuff in the math module
from math import *
#----------------------
# atomic descriptor section
#----------------------
# these are the methods which can be applied to ATOMIC descriptors.
knownMethods = ['SUM','MIN','MAX','MEAN','AVG','DEV','HAS']
def HAS(strArg,composList,atomDict):
""" *Calculator Method*
does a string search
**Arguments**
- strArg: the arguments in string form
- composList: the composition vector
- atomDict: the atomic dictionary
**Returns**
1 or 0
"""
splitArgs = string.split(strArg,',')
if len(splitArgs)>1:
for atom,num in composList:
tStr = splitArgs[0].replace('DEADBEEF',atom)
where = eval(tStr)
what = eval(splitArgs[1])
if where.find(what)!= -1:
return 1
return 0
else:
return -666
def SUM(strArg,composList,atomDict):
""" *Calculator Method*
calculates the sum of a descriptor across a composition
**Arguments**
- strArg: the arguments in string form
- compos: the composition vector
- atomDict: the atomic dictionary
**Returns**
a float
"""
accum = 0.0
for atom,num in composList:
tStr = strArg.replace('DEADBEEF',atom)
accum = accum + eval(tStr)*num
return accum
def MEAN(strArg,composList,atomDict):
""" *Calculator Method*
calculates the average of a descriptor across a composition
**Arguments**
- strArg: the arguments in string form
- compos: the composition vector
- atomDict: the atomic dictionary
**Returns**
a float
"""
accum = 0.0
nSoFar = 0
for atom,num in composList:
tStr = strArg.replace('DEADBEEF',atom)
accum = accum + eval(tStr)*num
nSoFar = nSoFar + num
return accum/nSoFar
AVG = MEAN
def DEV(strArg,composList,atomDict):
""" *Calculator Method*
calculates the average deviation of a descriptor across a composition
**Arguments**
- strArg: the arguments in string form
- compos: the composition vector
- atomDict: the atomic dictionary
**Returns**
a float
"""
avg = MEAN(strArg,composList,atomDict)
accum = 0.0
nSoFar = 0.0
for atom,num in composList:
tStr = strArg.replace('DEADBEEF',atom)
accum = accum + abs(eval(tStr)-avg)*num
nSoFar = nSoFar + num
return accum/nSoFar
def MIN(strArg,composList,atomDict):
""" *Calculator Method*
calculates the minimum value of a descriptor across a composition
**Arguments**
- strArg: the arguments in string form
- compos: the composition vector
- atomDict: the atomic dictionary
**Returns**
a float
"""
accum = []
for atom,num in composList:
tStr = strArg.replace('DEADBEEF',atom)
accum.append(eval(tStr))
return min(accum)
def MAX(strArg,composList,atomDict):
""" *Calculator Method*
calculates the maximum value of a descriptor across a composition
**Arguments**
- strArg: the arguments in string form
- compos: the composition vector
- atomDict: the atomic dictionary
**Returns**
a float
"""
accum = []
for atom,num in composList:
tStr = strArg.replace('DEADBEEF',atom)
accum.append(eval(tStr))
return max(accum)
#------------------
# string replacement routines
# these are not intended to be called by clients
#------------------
def _SubForAtomicVars(cExpr,varList,dictName):
""" replace atomic variables with the appropriate dictionary lookup
*Not intended for client use*
"""
for i in range(len(varList)):
cExpr = cExpr.replace('$%d'%(i+1),
'%s["DEADBEEF"]["%s"]'%(dictName,varList[i]))
return cExpr
def _SubForCompoundDescriptors(cExpr,varList,dictName):
""" replace compound variables with the appropriate list index
*Not intended for client use*
"""
for i in range(len(varList)):
cExpr = cExpr.replace('$%s'%chr(ord('a')+i),
'%s["%s"]'%(dictName,varList[i]))
return cExpr
def _SubMethodArgs(cExpr,knownMethods):
""" alters the arguments of calls to calculator methods
*Not intended for client use*
This is kind of putrid (and the code ain't so pretty either)
The general idea is that the various special methods for atomic
descriptors need two extra arguments (the composition and the atomic
dict). Rather than make the user type those in, we just find
invocations of these methods and fill out the function calls using
string replacements.
"""
res = cExpr
for method in knownMethods:
p = 0
while p != -1 and p < len(res):
p = res.find(method,p)
if p != -1:
p = p + len(method) + 1
start = p
parenCount = 1
while parenCount and p < len(res):
if res[p] == ')':
parenCount = parenCount - 1
elif res[p] == '(':
parenCount = parenCount + 1
p = p + 1
if p <= len(res):
res = res[0:start]+"'%s',compos,atomDict"%(res[start:p-1])+res[p-1:]
return res
def CalcSingleCompoundDescriptor(compos,argVect,atomDict,propDict):
""" calculates the value of the descriptor for a single compound
**ARGUMENTS:**
- compos: a vector/tuple containing the composition
information... in the form:
'[("Fe",1.),("Pt",2.),("Rh",0.02)]'
- argVect: a vector/tuple with three elements:
1) AtomicDescriptorNames: a list/tuple of the names of the
atomic descriptors being used. These determine the
meaning of $1, $2, etc. in the expression
2) CompoundDescriptorNames: a list/tuple of the names of the
compound descriptors being used. These determine the
meaning of $a, $b, etc. in the expression
3) Expr: a string containing the expression to be used to
evaluate the final result.
- atomDict:
a dictionary of atomic descriptors. Each atomic entry is
another dictionary containing the individual descriptors
and their values
- propVect:
a list of descriptors for the composition.
**RETURNS:**
the value of the descriptor, -666 if a problem was encountered
**NOTE:**
- because it takes rather a lot of work to get everything set
up to calculate a descriptor, if you are calculating the
same descriptor for multiple compounds, you probably want to
be calling _CalcMultipleCompoundsDescriptor()_.
"""
try:
atomVarNames = argVect[0]
compositionVarNames = argVect[1]
formula = argVect[2]
formula = _SubForCompoundDescriptors(formula,compositionVarNames,'propDict')
formula = _SubForAtomicVars(formula,atomVarNames,'atomDict')
evalTarget = _SubMethodArgs(formula,knownMethods)
except:
if __DEBUG:
import sys,traceback
print('Sub Failure!')
traceback.print_exc()
print(evalTarget)
print(propDict)
raise RuntimeError('Failure 1')
else:
return -666
try:
v = eval(evalTarget)
except:
if __DEBUG:
import sys,traceback
outF = open(RDConfig.RDCodeDir+'/ml/descriptors/log.txt','a+')
outF.write('#------------------------------\n')
outF.write('formula: %s\n'%repr(formula))
outF.write('target: %s\n'%repr(evalTarget))
outF.write('propDict: %s\n'%(repr(propDict)))
try:
outF.write('keys: %s\n'%(repr(atomDict.keys())))
except:
outF.write('no atomDict\n')
outF.close()
print('ick!')
print('formula:',formula)
print('target:',evalTarget)
print('propDict:',propDict)
print('keys:',atomDict.keys())
traceback.print_exc()
raise RuntimeError('Failure 2')
else:
v = -666
return v
def CalcMultipleCompoundsDescriptor(composVect,argVect,atomDict,propDictList):
""" calculates the value of the descriptor for a list of compounds
**ARGUMENTS:**
- composVect: a vector of vector/tuple containing the composition
information.
See _CalcSingleCompoundDescriptor()_ for an explanation of the elements.
- argVect: a vector/tuple with three elements:
1) AtomicDescriptorNames: a list/tuple of the names of the
atomic descriptors being used. These determine the
meaning of $1, $2, etc. in the expression
2) CompoundDsscriptorNames: a list/tuple of the names of the
compound descriptors being used. These determine the
meaning of $a, $b, etc. in the expression
3) Expr: a string containing the expression to be used to
evaluate the final result.
- atomDict:
a dictionary of atomic descriptors. Each atomic entry is
another dictionary containing the individual descriptors
and their values
- propVectList:
a vector of vectors of descriptors for the composition.
**RETURNS:**
a vector containing the values of the descriptor for each
compound. Any given entry will be -666 if problems were
encountered
"""
res = [-666]*len(composVect)
try:
atomVarNames = argVect[0]
compositionVarNames = argVect[1]
formula = argVect[2]
formula = _SubForCompoundDescriptors(formula,compositionVarNames,'propDict')
formula = _SubForAtomicVars(formula,atomVarNames,'atomDict')
evalTarget = _SubMethodArgs(formula,knownMethods)
except:
return res
for i in range(len(composVect)):
propDict = propDictList[i]
compos = composVect[i]
try:
v = eval(evalTarget)
except:
v = -666
res[i] = v
return res
#------------
# Demo/testing code
#------------
if __name__ == '__main__':
piece1 = [['d1','d2'],['d1','d2']]
aDict = {'Fe':{'d1':1.,'d2':2.},'Pt':{'d1':10.,'d2':20.}}
pDict = {'d1':100.,'d2':200.}
compos = [('Fe',1),('Pt',1)]
cExprs = ["SUM($1)","SUM($1)+SUM($2)","SUM($1)+SUM($1)","MEAN($1)","DEV($2)","MAX($1)","MIN($1)/MAX($1)",
"MIN($2)","SUM($1)/$a","sqrt($a+$b)","SUM((3.*$1)/($2))","foo"]
for cExpr in cExprs:
argVect = piece1 + [cExpr]
print(cExpr)
print(CalcSingleCompoundDescriptor(compos,argVect,aDict,pDict))
print(CalcMultipleCompoundsDescriptor([compos,compos],argVect,aDict,[pDict,pDict]))
|
strets123/rdkit
|
rdkit/ML/Descriptors/Parser.py
|
Python
|
bsd-3-clause
| 12,201
|
[
"RDKit"
] |
cfadd71d0c57650b9f582e3c4187003fe63a4d90e628b56cd16bd4b3c6d2b3ef
|
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Handles function calls, by generating compiled function names and calls.
Note: this transformer does not rename the top level object being converted;
that is the caller's responsibility.
Requires function_scopes.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gast
from tensorflow.python.autograph.core import converter
from tensorflow.python.autograph.pyct import anno
from tensorflow.python.autograph.pyct import ast_util
from tensorflow.python.autograph.pyct import parser
from tensorflow.python.autograph.pyct import templates
from tensorflow.python.autograph.utils import ag_logging
# TODO(mdan): Rename to FunctionCallsTransformer.
class _Function(object):
no_root = True
def __init__(self):
self.context_name = None
set_trace_warned = False
class CallTreeTransformer(converter.Base):
"""Transforms the call tree by renaming transformed symbols."""
def visit_Lambda(self, node):
if anno.hasanno(node, 'function_context_name'):
# Lambda functions created during the conversion process have no
# context manager.
self.state[_Function].enter()
self.state[_Function].context_name = anno.getanno(
node, 'function_context_name')
node = self.generic_visit(node)
self.state[_Function].exit()
else:
node = self.generic_visit(node)
return node
def visit_FunctionDef(self, node):
self.state[_Function].enter()
# Note: if the conversion process ever creates helper functions, this
# assumption will no longer hold.
assert anno.hasanno(node, 'function_context_name'), (
'The function_scopes converter always creates a scope for functions.')
self.state[_Function].context_name = anno.getanno(
node, 'function_context_name')
node.args = self.visit(node.args)
node.body = self.visit_block(node.body)
if self.state[_Function].level < 2:
# Top-level functions lose their decorator because the conversion is
# always just-in-time and by the time it happens the decorators are
# already set to be applied.
node.decorator_list = []
else:
# Inner functions are converted already, so we insert a decorator to
# prevent double conversion. Double conversion would work too, but this
# saves the overhead.
node.decorator_list.append(
parser.parse_expression('ag__.do_not_convert_internal'))
if node.returns:
node.returns = self.visit(node.returns)
self.state[_Function].exit()
return node
def visit_With(self, node):
# Context manager calls (in node.items) are not converted.
node.body = self.visit_block(node.body)
return node
def visit_Call(self, node):
full_name = str(anno.getanno(node.func, anno.Basic.QN, default=''))
function_context_name = self.state[_Function].context_name
node = self.generic_visit(node)
# TODO(mdan): Refactor converted_call as a 'Call' operator.
# Calls to the internal 'ag__' module are never converted (though their
# arguments might be).
if full_name.startswith('ag__.'):
return node
# Calls to the function context manager (inserted by function_scopes) are
# also safe.
if full_name.startswith(function_context_name + '.'):
return node
# Calls to pdb.set_trace or ipdb.set_trace are never converted. We don't use
# the normal mechanisms to bypass these literals because they are sensitive
# to the frame they are being called from.
# TODO(mdan): Generalize this to a "static whitelist" config.
if full_name in ('pdb.set_trace', 'ipdb.set_trace', 'breakpoint'):
global set_trace_warned
if not set_trace_warned:
# TODO(mdan): Update and shorten once available on tensorflow.org.
ag_logging.warn(
'Detected `pdb.set_trace()` in converted code. The code'
' generated by AutoGraph is not optimized for step-by-step'
' debugging. See https://github.com/tensorflow/tensorflow/'
'blob/master/tensorflow/python/autograph/g3doc/reference/'
'debugging.md.')
set_trace_warned = True
return node
if (full_name == 'print' and
not self.ctx.program.options.uses(converter.Feature.BUILTIN_FUNCTIONS)):
return node
func = node.func
starred_arg = None
normal_args = []
for a in node.args:
if isinstance(a, gast.Starred):
assert starred_arg is None, 'Multiple *args should be impossible.'
starred_arg = a
else:
normal_args.append(a)
if starred_arg is None:
args = templates.replace_as_expression('(args,)', args=normal_args)
else:
args = templates.replace_as_expression(
'(args,) + tuple(stararg)',
stararg=starred_arg.value,
args=normal_args)
kwargs_arg = None
normal_keywords = []
for k in node.keywords:
if k.arg is None:
assert kwargs_arg is None, 'Multiple **kwargs should be impossible.'
kwargs_arg = k
else:
normal_keywords.append(k)
if kwargs_arg is None:
if not normal_keywords:
kwargs = parser.parse_expression('None')
else:
kwargs = ast_util.keywords_to_dict(normal_keywords)
else:
kwargs = templates.replace_as_expression(
'dict(kwargs, **keywords)',
kwargs=kwargs_arg.value,
keywords=ast_util.keywords_to_dict(normal_keywords))
template = """
ag__.converted_call(func, options, args, kwargs, function_ctx)
"""
new_call = templates.replace_as_expression(
template,
func=func,
options=parser.parse_expression(function_context_name + '.callopts'),
args=args,
kwargs=kwargs,
function_ctx=function_context_name)
return new_call
def transform(node, ctx):
"""Transform function call to the compiled counterparts.
Args:
node: AST
ctx: EntityContext
Returns:
A tuple (node, new_names):
node: The transformed AST
new_names: set(string), containing any newly-generated names
"""
return CallTreeTransformer(ctx).visit(node)
|
chemelnucfin/tensorflow
|
tensorflow/python/autograph/converters/call_trees.py
|
Python
|
apache-2.0
| 6,862
|
[
"VisIt"
] |
67224519ee9d39cab31921ea399e9cc1fcd10fc1a1ccc6cce1b5e2ff55f1d15f
|
from pygmin.amber import amberSystem as amb
# create a new amber system and load database to be pruned
sys = amb.AMBERSystem('coords.prmtop', 'coords.inpcrd')
dbcurr = sys.create_database(db="aladipep.db")
print 'Collecting minima to delete .. '
listTODel = []
for minimum in dbcurr.minima():
testOutCome1 = sys.check_cistrans(minimum.coords)
testOutCome2 = sys.check_CAchirality(minimum.coords)
if testOutCome1 and testOutCome2:
print 'PASS', minimum._id, minimum.energy
else:
listTODel.append(minimum)
print 'FAIL', minimum._id, minimum.energy
print '------------'
print 'Number of minima to be deleted = ', len(listTODel)
# now delete
for minn in listTODel:
dbcurr.removeMinimum(minn)
#print 'Checking transition states .. '
#ct = 0
#print len(dbcurr.transition_states())
#for ts in dbcurr.transition_states() :
# if sys.check_cistrans(ts.coords ):
# print 'PASS', ts._id, ts.energy
# ct = ct + 1
# # dbcurr.removeTS(ts) # not implemented yet
# else:
# print 'FAIL', ts._id, ts.energy
#
# print '------------'
#
#print 'Number of TS deleted = ', ct
|
js850/PyGMIN
|
examples/amber/driver_sanitycheck.py
|
Python
|
gpl-3.0
| 1,210
|
[
"Amber"
] |
f7ddbdfa4d60bb1b32b3a85b6672c982ad5bd153fdaa20f791130c269a6a031d
|
from __future__ import print_function
import httplib2
import os
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email import encoders
import base64
try:
import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
except ImportError:
flags = None
# If modifying these scopes, delete your previously saved credentials
# at ~/.credentials/gmail-python-quickstart.json
SCOPES = 'https://mail.google.com/'
CLIENT_SECRET_FILE = 'client_secret.json'
APPLICATION_NAME = 'WinServer'
def create_message(sender, to, subject, html_text, image_file):
"""Create a message for an email.
Args:
sender: Email address of the sender.
to: Email address of the receiver.
subject: The subject of the email message.
message_text: The text of the email message.
Returns:
An object containing a base64url encoded email object.
"""
msgRoot = MIMEMultipart('alternative')
msgRoot['Subject'] = subject
msgRoot['From'] = sender
msgRoot['To'] = to
msgRoot.preamble = 'This is a multi-part message in MIME format.'
# Encapsulate the plain and HTML versions of the message body in an
# 'alternative' part, so message agents can decide which they want to display.
msgAlternative = MIMEMultipart('related')
msgText = MIMEText('Here\'s your selfie, and thanks for coming! To learn more, visit www.cis.rit.edu or https://github.com/natedileas/ImageRIT. \n\n - Nate and Ryan')
msgRoot.attach(msgText)
html = MIMEText(html_text, 'html')
msgAlternative.attach(html)
with open(image_file, 'rb') as f:
img = MIMEImage(f.read(), _subtype='png')
encoders.encode_base64(img)
img.add_header('Content-ID', '<IMAGE>')
msgAlternative.attach(img)
msgRoot.add_header('Content-Disposition', 'attachment', filename=image_file)
msgRoot.attach(msgAlternative)
return {'raw': base64.urlsafe_b64encode(msgRoot.as_bytes()).decode()}
def send_message(service, user_id, message):
"""Send an email message.
Args:
service: Authorized Gmail API service instance.
user_id: User's email address. The special value "me"
can be used to indicate the authenticated user.
message: Message to be sent.
Returns:
Sent Message.
"""
#try:
message = (service.users().messages().send(userId=user_id, body=message)
.execute())
print('Message Id: %s' % message['id'])
return message
#except Exception as error:
# print('An error occurred: %s' % error)
def get_credentials():
"""Gets valid user credentials from storage.
If nothing has been stored, or if the stored credentials are invalid,
the OAuth2 flow is completed to obtain the new credentials.
Returns:
Credentials, the obtained credential.
"""
home_dir = os.path.expanduser('~')
credential_dir = os.path.join(home_dir, '.credentials')
if not os.path.exists(credential_dir):
os.makedirs(credential_dir)
credential_path = os.path.join(credential_dir,
'gmail-python-quickstart.json')
store = Storage(credential_path)
credentials = store.get()
if not credentials or credentials.invalid:
flow = client.flow_from_clientsecrets(CLIENT_SECRET_FILE, SCOPES)
flow.user_agent = APPLICATION_NAME
if flags:
credentials = tools.run_flow(flow, store, flags)
else: # Needed only for compatibility with Python 2.6
credentials = tools.run(flow, store)
print('Storing credentials to ' + credential_path)
return credentials
def send_async(email, imagefile):
credentials = get_credentials()
http = credentials.authorize(httplib2.Http())
service = discovery.build('gmail', 'v1', http=http)
with open('email2.html', 'r') as f:
html = f.read()
#html = html.replace('IMAGE', imagefile)
message = create_message('ImageRIT2017@gmail.com', email, 'ImageRIT Selfie', html, imagefile)
send_message(service, "me", message)
if __name__ == '__main__':
# in order to use this properly, you have to go to the google api developers console,
# download the client secret, and put it in this directory.
# on the first run it will require ui interaction in-browser
send_async('ndileas@gmail.com', '..\\logo_720x720.png')
|
natedileas/ImageRIT
|
Server/g_api_email.py
|
Python
|
gpl-3.0
| 4,571
|
[
"VisIt"
] |
1ea6c7ebf009cf6bf13e4b9c8cc2fb3f5070d2eb8b083a7cb00d1a71be116598
|
"""
Provide some basic helper functions.
"""
import cv2
import numpy as np
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.optimize import leastsq
from queue import PriorityQueue
NUM_EVALS = 0
LAST_AVG_ERROR = 0.0
def f2K(f):
""" Convert focal length to camera intrinsic matrix. """
K = np.matrix([[f, 0, 0],
[0, f, 0],
[0, 0, 1]], dtype=np.float)
return K
def E2Rt(E, K, baseRt, frameIdx, kp1, kp2, matches):
""" Convert essential matrix to pose. From H&Z p.258. """
W = np.matrix([[0, -1, 0],
[1, 0, 0],
[0, 0, 1]], dtype=np.float)
# Z = np.matrix([[0, 1, 0],
# [-1, 0, 0],
# [0, 0, 0]], dtype=np.float)
U, D, V = np.linalg.svd(E)
# skew-symmetric translation matrix
# S = U * Z * U.T
# two possibilities for R, t
R1 = U * W * V.T
R2 = U * W.T * V.T
t1 = U[:, 2]
t2 = -U[:, 2]
# ensure positive determinants
if np.linalg.det(R1) < 0:
R1 = -R1
if np.linalg.det(R2) < 0:
R2 = -R2
# extract match points
matches1 = []
matches2 = []
for m in matches:
pt1 = np.matrix([kp1[m.queryIdx].pt[0], kp1[m.queryIdx].pt[1]]).T
matches1.append((pt1, m.queryIdx, frameIdx))
pt2 = np.matrix([kp2[m.trainIdx].pt[0], kp2[m.trainIdx].pt[1]]).T
matches2.append((pt2, m.trainIdx, frameIdx + 1))
# create four possible new camera matrices
Rt1 = np.hstack([R1, t1])
Rt2 = np.hstack([R1, t2])
Rt3 = np.hstack([R2, t1])
Rt4 = np.hstack([R2, t2])
# transform each Rt to be relative to baseRt
baseRt4x4 = np.vstack([baseRt, np.matrix([0, 0, 0, 1], dtype=np.float)])
Rt1 = Rt1 * baseRt4x4
Rt2 = Rt2 * baseRt4x4
Rt3 = Rt3 * baseRt4x4
Rt4 = Rt4 * baseRt4x4
# test how many points are in front of both cameras
bestRt = None
bestCount = -1
bestPts3D = None
for Rt in [Rt1, Rt2, Rt3, Rt4]:
cnt = 0
pts3D = {}
for m1, m2 in zip(matches1, matches2):
# use least squares triangulation
x = triangulateLM(baseRt, Rt, m1[0], m2[0], K)
# test if in front of both cameras
if inFront(baseRt, x) and inFront(Rt, x):
cnt += 1
pts3D[x.tostring()] = (m1, m2)
# update best camera/cnt
#print( "[DEBUG] Found %d points in front of both cameras." % cnt
if cnt > bestCount:
bestCount = cnt
bestRt = Rt
bestPts3D = pts3D
print( "Found %d of %d possible 3D points in front of both cameras.\n" % (bestCount, len(matches1)))
# Wrap bestRt, bestPts3D into a 'pair'
pair = {}
pair["motion"] = [baseRt, bestRt]
pair["3Dmatches"] = {}
pair["frameOffset"] = frameIdx
for X, matches in bestPts3D.items():
m1, m2 = matches
key = (m1[1], m1[2]) # use m1 instead of m2 for matching later
entry = {"frames" : [m1[2], m2[2]], # frames that can see this point
"2Dlocs" : [m1[0], m2[0]], # corresponding 2D points
"3Dlocs" : np.fromstring(X,dtype=np.float64).reshape(3,1), # 3D triangulation
"newKey" : (m2[1], m2[2])} # next key (for merging with graph)
pair["3Dmatches"][key] = entry
return pair
def updateGraph(graph, pair):
""" Update graph dictionary with new pose and 3D points. """
# append new pose
graph["motion"].append(pair["motion"][1])
# insert 3D points, checking for matches with existing points
for key, pair_entry in pair["3Dmatches"].items():
newKey = pair_entry["newKey"]
# if there's a match, update that entry
if key in graph["3Dmatches"]:
graph_entry = graph["3Dmatches"][key]
graph_entry["frames"].append(pair_entry["frames"][1])
graph_entry["2Dlocs"].append(pair_entry["2Dlocs"][1])
graph_entry["3Dlocs"].append(pair_entry["3Dlocs"])
del graph["3Dmatches"][key]
graph["3Dmatches"][newKey] = graph_entry
# otherwise, create new entry
else:
graph_entry = {"frames" : pair_entry["frames"], # frames that can see this point
"2Dlocs" : pair_entry["2Dlocs"], # corresponding 2D points
"3Dlocs" : [pair_entry["3Dlocs"]], # 3D triangulations
"color" : None} # point color
graph["3Dmatches"][newKey] = graph_entry
def finalizeGraph(graph, frames):
""" Replace the 3Dlocs list with the its average for each entry. Add color. """
for key, entry in graph["3Dmatches"].items():
# compute average
total = np.matrix(np.zeros((3, 1)), dtype=np.float)
for X in entry["3Dlocs"]:
total += X
mean = total / len(entry["3Dlocs"])
# update graph entry
entry["3Dlocs"] = mean
# determine color
color = np.zeros((1, 3), dtype=np.float)
for frame, pt2D in zip(entry["frames"], entry["2Dlocs"]):
color += frames["images"][frame][int(pt2D[1, 0]),
int(pt2D[0, 0])].astype(np.float)
color /= len(frames["images"])
entry["color"] = color.astype(np.uint8)
def repeatedBundleAdjustment(graph, K, niter, freq, sd,
percent_outliers, outlier_max_dist, max_err, cutoff):
""" Perform repeated bundle adjustment. """
cnt = 0
while True:
cnt += 1
print( "\nBundle adjustment, ROUND %d." % cnt)
# every few rounds, remove outliers and jitter the initialization
if cnt % freq == 0:
# outlierRejection(graph, K, percent_outliers, outlier_max_dist)
error = bundleAdjustment(graph, K, niter, sd, cutoff)
else:
error = bundleAdjustment(graph, K, niter, 0.0, cutoff)
if error < max_err:
break
#outlierRejection(graph, K, percent_outliers, outlier_max_dist)
def bundleAdjustment(graph, K, niter=0, sd=0, cutoff=15.0):
""" Run bundle adjustment to joinly optimize camera poses and 3D points. """
# unpack graph parameters into 1D array for initial guess
x0, baseRt, keys, views, pts2D, pts3D = unpackGraph(graph)
num_frames = len(graph["motion"])
num_pts3D = len(pts3D)
frameOffset = graph["frameOffset"]
view_matrices, pts2D_matrices = createViewPointMatrices(views, pts2D, num_frames,
num_pts3D, frameOffset)
# insert Gaussian white noise
noise = np.random.randn(len(x0)) * sd
x0 += noise
# run Levenberg-Marquardt algorithm
global NUM_EVALS
NUM_EVALS = 0
args = (K, baseRt, view_matrices, pts2D_matrices, num_frames, cutoff)
result, success = leastsq(reprojectionError, x0, args=args, maxfev=niter)
# get optimized motion and structure as lists
optimized_motion = extractMotion(result, np.matrix(np.eye(3)),
baseRt, num_frames)
optimized_structure = np.hsplit(extractStructure(result, num_frames), num_pts3D)
# update/repack graph
graph["motion"] = optimized_motion
for key, pt3D in zip(keys, optimized_structure):
graph["3Dmatches"][key]["3Dlocs"] = pt3D
global LAST_AVG_ERROR
return LAST_AVG_ERROR
def outlierRejection(graph, K, percent=5.0, max_dist=5.0):
"""
Examine graph and remove some top percentage of outliers
and those outside a certain radius.
"""
# iterate through all points
pq = PriorityQueue()
marked_keys = []
for key, entry in graph["3Dmatches"].items():
X = entry["3Dlocs"]
# mark and continue if too far away from the origin
if np.linalg.norm(X) > max_dist:
marked_keys.append(key)
continue
# project into each frame
errors = []
for frame, x in zip(entry["frames"], entry["2Dlocs"]):
frame -= graph["frameOffset"]
Rt = graph["motion"][frame]
proj = fromHomogenous(K * Rt * toHomogenous(X))
diff = proj - x
err = np.sqrt(np.multiply(diff, diff).sum())
#print( (frame, err))
errors.append(err)
# get mean error and add to priority queue
# (priority is reciprocal of error since this is a MinPQ)
mean_error = np.array(errors).mean()
pq.put_nowait((1.0 / mean_error, key))
# remove worst keys
N = max(0, int((percent/100.0) * len(graph["3Dmatches"].keys())) - len(marked_keys))
for i in range(N):
score, key = pq.get_nowait()
del graph["3Dmatches"][key]
pq.task_done()
# remove keys out of range
for key in marked_keys:
del graph["3Dmatches"][key]
print( "Removed %d outliers." % (N + len(marked_keys)))
def unpackGraph(graph):
""" Extract parameters for optimization. """
# extract motion parameters
baseRt = graph["motion"][0]
poses = graph["motion"][1:]
motion = []
for p in poses:
R = p[:, :-1]
t = p[:, -1:]
# convert to axis-angle format and concatenate
r = toAxisAngle(R)
motion.append(r)
motion.append(np.array(t.T)[0, :])
motion = np.hstack(motion)
# extract frame parameters as array for all frames at each point
keys = []
views = []
pts3D = []
pts2D = []
for key, entry in graph["3Dmatches"].items():
keys.append(key)
views.append(entry["frames"])
pts3D.append(entry["3Dlocs"])
pts2D.append(entry["2Dlocs"])
structure = np.array(pts3D).ravel()
# concatenate motion/structure arrays
x0 = np.hstack([motion, structure])
return x0, baseRt, keys, views, pts2D, pts3D
def createViewPointMatrices(views, pts2D, num_frames, num_pts3D, frameOffset):
""" Create frame-ordered lists of view and 2D point matrices. """
# create lists of unpopulated matrices
view_matrices = []
pts2D_matrices = []
for i in range(num_frames):
view_matrices.append(np.zeros(num_pts3D, dtype=np.bool))
pts2D_matrices.append(np.matrix(np.zeros((2, num_pts3D)), dtype=np.float))
# iterate through all 3D points and fill in matrices
for i, (frames, pts) in enumerate(zip(views, pts2D)):
for frame, pt in zip(frames, pts):
frame -= frameOffset
view_matrix = view_matrices[frame]
pts2D_matrix = pts2D_matrices[frame]
view_matrix[i] = True
pts2D_matrix[:, i] = pt
return view_matrices, pts2D_matrices
def reprojectionError(x, K, baseRt, view_matrices, pts2D_matrices, num_frames, cutoff):
""" Compute reprojection error for the graph with these parameters. """
# unpack parameter vector
motion_matrices = extractMotion(x, K, baseRt, num_frames)
structure_matrix = toHomogenous(extractStructure(x, num_frames))
# project all 3D points and store residuals according to view matrices
residuals = []
for P, views, pts2D in zip(motion_matrices, view_matrices, pts2D_matrices):
proj = fromHomogenous(P * structure_matrix)
# compute error
diff = proj - pts2D
# concatenate only the appropriate columns to residuals
residuals.append(diff[:, views])
# hstack residuals and compute distances
error = np.asarray(np.hstack(residuals))
sq_error = np.square(error)
dists = np.sqrt(sq_error[0, :] + sq_error[1, :])
# reweight with Tukey M-estimator
weights = np.square(1.0 - np.square(dists / cutoff))
weights[dists > cutoff] = 0.0
weighted_dists = np.multiply(weights, dists).ravel()
weighted_error = np.multiply(np.vstack([weights, weights]), error).ravel()
avg = dists.ravel().sum() / len(weighted_dists)
weighted = weighted_dists.sum() / len(weighted_dists)
global NUM_EVALS
global LAST_AVG_ERROR
if NUM_EVALS % 1000 == 0:
print( "Iteration %d, Error: %f, Weighted: %f" % (NUM_EVALS, avg, weighted))
NUM_EVALS += 1
LAST_AVG_ERROR = weighted
return weighted_error
def sigmoid(x):
""" Sigmoid function to map angles to positive real numbers < 1."""
return 1.0 / (1.0 + np.exp(x))
def inverseSigmoid(x):
""" Invert sigmoid function. """
return np.log((1.0 / x) - 1.0)
def toAxisAngle(R):
"""
Decompose rotation R to axis-angle representation, where sigmoid(angle),
is given as the magnitude of the axis vector.
"""
# from https://en.wikipedia.org/wiki/Axis-angle-representation
angle = np.arccos(0.5 * (np.trace(R) - 1.0))
axis = 0.5/np.sin(angle) * np.array([R[2, 1] - R[1, 2],
R[0, 2] - R[2, 0],
R[1, 0] - R[0, 1]])
return axis * sigmoid(angle)
def fromAxisAngle(r):
""" Convert axis-angle representation to full rotation matrix. """
# from https://en.wikipedia.org/wiki/Rotation_matrix
angle = inverseSigmoid(np.linalg.norm(r))
axis = r / np.linalg.norm(r)
cross = np.matrix([[0, -axis[2], axis[1]],
[axis[2], 0, -axis[0]],
[-axis[1], axis[0], 0]], dtype=np.float)
tensor = np.matrix([[axis[0]**2, axis[0]*axis[1], axis[0]*axis[2]],
[axis[0]*axis[1], axis[1]**2, axis[1]*axis[2]],
[axis[0]*axis[2], axis[1]*axis[2], axis[2]**2]], dtype=np.float)
R = np.cos(angle)*np.eye(3) + np.sin(angle)*cross + (1-np.cos(angle))*tensor
return R
def extractStructure(x, num_frames):
""" Extract 3D points (as a single large matrix) from parameter vector. """
# only consider the entries of x representing 3D structure
offset = (num_frames - 1) * 6
structure = x[offset:]
# repack structure into 3D points
num_pts = len(structure) / 3
pts3D_matrix = np.matrix(structure.reshape(-1, 3)).T
return pts3D_matrix
def extractMotion(x, K, baseRt, num_frames):
"""
Extract camera poses (as a list of matrices) from parameter vector,
including implicit base pose.
"""
# only consider the entries of x representing poses
offset = (num_frames - 1) * 6
motion = x[:offset]
# repack motion into 3x4 pose matrices
pose_arrays = np.split(motion, num_frames - 1)
pose_matrices = [K * baseRt]
for p in pose_arrays:
# convert from axis-angle to full pose matrix
r = p[:3]
t = p[3:]
R = fromAxisAngle(r)
pose_matrices.append(K * np.hstack([R, np.matrix(t).T]))
return pose_matrices
def printGraphStats(graph):
""" Compute and display summary statistics for graph dictionary. """
print( "\nNumber of frames: " + str(len(graph["motion"])))
print( "Number of 3D points: " + str(len(graph["3Dmatches"].keys())))
# count multiple correspondence
cnt = 0
for key, entry in graph["3Dmatches"].items():
if len(entry["frames"]) > 2:
cnt += 1
print( "Number of 3D points with >1 correspondence(s): " + str(cnt))
print( "")
def inFront(Rt, X):
""" Return true if X is in front of the camera. """
R = Rt[:, :-1]
t = Rt[:, -1:]
if R[2, :] * (X + R.T * t) > 0:
return True
return False
def triangulateLM(Rt1, Rt2, x1, x2, K):
"""
Use nonlinear optimization to triangulate a 3D point, initialized with
the estimate from triangulateCross().
"""
# initialize with triangulateCross() linear solution
x0 = np.asarray(triangulateCross(Rt1, Rt2, x1, x2, K).T)[0, :]
# run Levenberg-Marquardt algorithm
args = (Rt1, Rt2, x1, x2, K)
result, success = leastsq(triangulationError, x0, args=args, maxfev=10000)
# convert back to column vector and return
X = np.matrix(result).T
# test reprojection
#px1 = fromHomogenous(K * Rt1 * toHomogenous(X))
#px2 = fromHomogenous(K * Rt2 * toHomogenous(X))
#diff1 = px1 - x1
#diff2 = px2 - x2
#print( "Errors (x1, x2): (%f, %f)" % (np.sqrt(np.multiply(diff1, diff1).sum()),
# np.sqrt(np.multiply(diff2, diff2).sum()))
return X
def triangulationError(x, Rt1, Rt2, x1, x2, K):
""" Calculate triangulation error for single point x as a row-vector. """
X = np.matrix(x).T
# project into each frame
px1 = fromHomogenous(K * Rt1 * toHomogenous(X))
px2 = fromHomogenous(K * Rt2 * toHomogenous(X))
# compute the diffs
diff1 = px1 - x1
diff2 = px2 - x2
return np.asarray(np.vstack([diff1, diff2]).T)[0, :]
def triangulateLS(Rt1, Rt2, x1, x2, K):
"""
Triangulate a least squares 3D point given two camera matrices
and the point correspondence in non-homogenous coordinates.
NOTE: This does not work very well due to ambiguity in homogenous coordinates.
"""
A = np.vstack([K * Rt1, K * Rt2])
b = np.vstack([toHomogenous(x1), toHomogenous(x2)])
X = np.linalg.lstsq(A, b)[0]
# testing
px1 = fromHomogenous(K * Rt1 * toHomogenous(fromHomogenous(X)))
px2 = fromHomogenous(K * Rt2 * toHomogenous(fromHomogenous(X)))
diff1 = px1 - x1
diff2 = px2 - x2
print( "Errors (x1, x2): (%f, %f)" % (np.sqrt(np.multiply(diff1, diff1).sum()),
np.sqrt(np.multiply(diff2, diff2).sum())))
return X
def triangulateCross(Rt1, Rt2, x1, x2, K):
"""
Triangulate a 3D point given its location in two frames of reference
by using a cross product relation. Use least squares to solve.
"""
# set up cross product matrix
p1x = vector2cross(toHomogenous(x1))
p2x = vector2cross(toHomogenous(x2))
M = np.vstack([p1x * K * Rt1, p2x * K * Rt2])
# solve with least squares
A = M[:, :-1]
b = -M[:, -1:]
X = np.linalg.lstsq(A, b)[0]
# testing
#px1 = fromHomogenous(K * Rt1 * toHomogenous(X))
#px2 = fromHomogenous(K * Rt2 * toHomogenous(X))
#diff1 = px1 - x1
#diff2 = px2 - x2
#print( "Errors (x1, x2): (%f, %f)" % (np.sqrt(np.multiply(diff1, diff1).sum()),
# np.sqrt(np.multiply(diff2, diff2).sum()))
return X
def vector2cross(v):
""" Return the cross-product matrix version of a column vector. """
cross = np.matrix([[0, -v[2, 0], v[1, 0]],
[v[2, 0], 0, -v[0, 0]],
[-v[1, 0], v[0, 0], 0]], dtype=np.float)
return cross
def fromHomogenous(X):
""" Transform a point from homogenous to normal coordinates. """
x = X[:-1, :]
x /= X[-1, :]
return x
def toHomogenous(x):
""" Transform a point from normal to homogenous coordinates. """
X = np.vstack([x, np.ones((1, x.shape[1]))])
return X
def basePose():
""" Return the base camera pose. """
return np.matrix(np.hstack([np.eye(3), np.zeros((3, 1))]))
def ij2xy(i, j, shape):
""" Convert array indices to xy coordinates. """
x = j - 0.5*shape[1]
y = 0.5*shape[0] - i
return (x, y)
def drawMatches(img1, kp1, img2, kp2, matches):
""" Visualize keypoint matches. """
# get dimensions
h1, w1 = img1.shape[:2]
h2, w2 = img2.shape[:2]
# create display
view = np.zeros((max(h1, h2), w1 + w2, 3), np.uint8)
view[:h1, :w1, :] = img1
view[:h2, w2:, :] = img2
color = (0, 255, 0)
for idx, m in enumerate(matches):
cv2.line(view,
(int(kp1[m.queryIdx].pt[0]), int(kp1[m.queryIdx].pt[1])),
(int(kp2[m.trainIdx].pt[0] + w1), int(kp2[m.trainIdx].pt[1])),
color)
cv2.imshow("Keypoint correspondences", view)
cv2.waitKey()
cv2.destroyAllWindows()
def imread(imfile):
""" Read image from file and normalize. """
img = mpimg.imread(imfile).astype(np.float)
img = rescale(img)
return img
def imshow(img, title="", cmap="gray", cbar=False):
""" Show image to screen. """
plt.imshow(img, cmap=cmap)
plt.title(title)
if cbar:
plt.colorbar()
plt.show()
def imsave(img, imfile):
""" Save image to file."""
mpimg.imsave(imfile, img)
def plotTrajectory(graph, max_dist=1e10):
""" Show estimated camera trajectory. """
tx = []
ty = []
tz = []
for Rt in graph["motion"]:
t = Rt[:, -1:]
if np.linalg.norm(t) < max_dist:
tx.append(t[0, 0])
ty.append(t[1, 0])
tz.append(t[2, 0])
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(tx, ty, tz, marker="o")
plt.show()
def showPointCloud(graph, max_dist=1e10):
""" Show point cloud. """
num_pts = len(graph["3Dmatches"].keys())
px = np.zeros(num_pts, dtype=np.float)
py = np.zeros(num_pts, dtype=np.float)
pz = np.zeros(num_pts, dtype=np.float)
colors = np.zeros((num_pts, 3), dtype=np.uint8)
for i, (key, entry) in enumerate(graph["3Dmatches"].items()):
pt = entry["3Dlocs"]
if np.linalg.norm(pt) < max_dist:
px[i] = pt[0, 0]
py[i] = pt[1, 0]
pz[i] = pt[2, 0]
colors[i, :] = entry["color"].astype(np.float)/255.0
colors[i, :] = colors[i, [2, 1, 0]]
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(px, py, pz, marker="o", c=colors)
plt.show()
def toPLY(graph, plyfile):
""" Output graph structure to *.ply format. """
num_pts = len(graph["3Dmatches"].keys())
# create pts3D and color arrays
pts3D_matrix = np.matrix(np.zeros((3, num_pts), dtype=np.float32))
color_matrix = np.matrix(np.zeros((3, num_pts), dtype=np.uint8))
for i, (key, entry) in enumerate(graph["3Dmatches"].items()):
pts3D_matrix[:, i] = entry["3Dlocs"]
color_matrix[:, i] = entry["color"].T
pts3D_matrix = pts3D_matrix.astype(np.float32)
color_matrix = color_matrix.astype(np.uint8)
# output to file
f = open(plyfile, "wb")
f.write("ply\n")
f.write("format ascii 1.0\n")
f.write("element vertex %d\n" % num_pts)
f.write("property float x\n")
f.write("property float y\n")
f.write("property float z\n")
f.write("property uchar blue\n")
f.write("property uchar green\n")
f.write("property uchar red\n")
f.write("end_header\n")
for i in range(num_pts):
pt = (pts3D_matrix[0, i], pts3D_matrix[1, i], pts3D_matrix[2, i],
color_matrix[0, i], color_matrix[1, i], color_matrix[2, i])
f.write("%f %f %f %d %d %d\n" % pt)
f.close()
def rescale(img):
""" Rescale image values linearly to the range [0.0, 1.0]. """
return (img - img.min()) / (img.max() - img.min())
def truncate(img):
""" Truncate values in image to range [0.0, 1.0]. """
img[img > 1.0] = 1.0
img[img < 0.0] = 0.0
return img
def rgb2gray(img):
""" Convert an RGB image to grayscale. """
r = img[:, :, 0]
g = img[:, :, 1]
b = img[:, :, 2]
return 0.299*r + 0.587*g + 0.114*b
|
eugeniopacceli/ComputerVision
|
quiz7/BasicFunctions.py
|
Python
|
mit
| 23,175
|
[
"Gaussian"
] |
aee19d4852c4f063a8c5ed7db6c6e9ab08d724fd52209a8143ce0e0db2a6fab0
|
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py
#
##############################################################################
from odoo import models, fields, tools, _
testing = tools.config.get('test_enable')
if not testing:
# prevent these forms to be registered when running tests
class MedicalDischargeForm(models.AbstractModel):
_name = 'cms.form.group.visit.medical.discharge'
_inherit = 'cms.form.group.visit.step2'
_form_model_fields = ['medical_discharge']
_form_required_fields = ['medical_discharge']
medical_discharge = fields.Binary()
@property
def _form_fieldsets(self):
return [
{
'id': 'medical_discharge',
'fields': ['medical_discharge']
},
]
@property
def form_title(self):
return _("Upload your medical discharge")
@property
def form_msg_success_updated(self):
return _('Medical discharge successfully uploaded.')
@property
def form_widgets(self):
res = super(MedicalDischargeForm, self).form_widgets
res['medical_discharge'] = 'cms_form_compassion.form.widget' \
'.document'
return res
def _form_validate_medical_discharge(self, value, **req_values):
if value == '':
return 'medical_discharge', _('Missing')
return 0, 0
def form_before_create_or_update(self, values, extra_values):
if values.get('medical_discharge'):
# Mark the task medical discharge task as completed
criminal_task = self.env.ref(
'website_event_compassion.task_medical_discharge')
values['completed_task_ids'] = [(4, criminal_task.id)]
else:
del values['completed_task_ids']
|
ecino/compassion-switzerland
|
website_event_compassion/forms/medical_discharge_form.py
|
Python
|
agpl-3.0
| 2,148
|
[
"VisIt"
] |
b58c3d5cc53cdc09d6bb1531968d72ab3d3c08fedb4c47507c0f0c028d6742a7
|
from typing import Union, Iterable
import numpy
from numpy import ndarray
from numpy.random.mtrand import RandomState
from . import DistributionNonNegative, DistributionBounded, DistributionUnbounded
class Beta(DistributionBounded):
"""
The Beta distribution is bounded and continuous.
The implementation is from `numpy.random.mtrand.RandomState.beta <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.beta.html>`_.
Distribution function:
.. math:: f(x; a,b) = \\frac{1}{B(\\alpha, \\beta)} x^{\\alpha - 1} (1 - x)^{\\beta - 1}
where the normalisation, B, is the beta function,
.. math:: B(\\alpha, \\beta) = \\int_0^1 t^{\\alpha - 1} (1 - t)^{\\beta - 1} dt.
"""
continuous = True
lb = 0
ub = 1
def __init__(self,
a: Union[float, ndarray, Iterable[float]],
b: Union[float, ndarray, Iterable[float]],
seed=None):
self.a = a
self.b = b
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.beta(a=self.a,
b=self.b,
size=size)
class Binomial(DistributionNonNegative):
"""
The Binomial distribution is non-negative and discrete.
The implementation is from `numpy.random.mtrand.RandomState.binomial <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.binomial.html>`_.
Distribution function:
.. math:: P(N) = \\binom{n}{N}p^N(1-p)^{n-N}
"""
continuous = False
def __init__(self,
n: Union[int, ndarray, Iterable[int]],
p: Union[float, ndarray, Iterable[float]],
seed=None):
self.n = n
self.p = p
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.binomial(n=self.n,
p=self.p,
size=size)
class BinomialNegative(DistributionNonNegative):
"""
The negative Binomial distribution is non-negative and discrete.
The implementation is from `numpy.random.mtrand.RandomState.negative_binomial <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.negative_binomial.html>`_.
Distribution function:
.. math:: P(N;n,p) = \\binom{N+n-1}{n-1}p^{n}(1-p)^{N}
"""
continuous = False
def __init__(self,
n: Union[int, ndarray, Iterable[int]],
p: Union[float, ndarray, Iterable[float]],
seed=None):
self.n = n
self.p = p
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.negative_binomial(n=self.n,
p=self.p,
size=size)
class CauchyStandard(DistributionUnbounded):
"""
The standard Cauchy distribution is unbounded and continuous.
The implementation is from `numpy.random.mtrand.RandomState.standard_cauchy <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.standard_cauchy.html>`_.
Distribution function:
.. math:: P(x; x_0, \\gamma) = \\frac{1}{\\pi \\gamma \\bigl[ 1+ (\\frac{x-x_0}{\\gamma})^2 \\bigr] }
"""
continuous = True
def __init__(self, seed=None):
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.standard_cauchy(size=size)
class Chisquare(DistributionNonNegative):
"""
The Chisquare distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.chisquare <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.chisquare.html>`_.
Distribution function:
.. math:: p(x) = \\frac{(1/2)^{k/2}}{\\Gamma(k/2)} x^{k/2 - 1} e^{-x/2}
"""
continuous = True
def __init__(self,
k: Union[int, ndarray, Iterable[int]],
seed=None):
self.k = k
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.chisquare(df=self.k,
size=size)
class ChisquareNonCentral(DistributionNonNegative):
"""
The non-central Chisquare distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.noncentral_chisquare <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.noncentral_chisquare.html>`_.
Distribution function:
.. math:: P(x;df,nonc) = \\sum^{\\infty}_{i=0} \\frac{e^{-nonc/2}(nonc/2)^{i}}{i!} P_{Y_{df+2i}}(x)
"""
continuous = True
def __init__(self,
k: Union[int, ndarray, Iterable[int]],
nonc: Union[float, ndarray, Iterable[float]],
seed=None):
self.k = k
self.nonc = nonc
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.noncentral_chisquare(df=self.k,
nonc=self.nonc,
size=size)
class Dirichlet(DistributionNonNegative):
"""
The Dirichlet distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.dirichlet <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.dirichlet.html>`_.
Distribution function:
.. math:: X \\approx \\prod_{i=1}^{k}{x^{\\alpha_i-1}_i}
"""
continuous = True
def __init__(self,
alpha: list,
seed=None):
self.alpha = alpha
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.dirichlet(alpha=self.alpha,
size=size)
class Exponential(DistributionNonNegative):
"""
The Exponential distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.exponential <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.exponential.html>`_.
Distribution function:
.. math:: f(x; \\frac{1}{\\beta}) = \\frac{1}{\\beta} \\exp(-\\frac{x}{\\beta})
"""
continuous = True
def __init__(self,
beta: Union[int, ndarray, Iterable[int]] = 1.0,
seed=None):
self.beta = beta
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.exponential(scale=self.beta,
size=size)
class F(DistributionNonNegative):
"""
The Fisher distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.f <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.f.html>`_.
"""
continuous = True
def __init__(self,
dfnum: Union[int, ndarray, Iterable[int]],
dfden: Union[int, ndarray, Iterable[int]],
seed=None):
self.dfnum = dfnum
self.dfden = dfden
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.f(dfnum=self.dfnum,
dfden=self.dfden,
size=size)
class FNonCentral(DistributionNonNegative):
"""
The non-central Fisher distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.noncentral_f <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.noncentral_f.html>`_.
"""
continuous = True
def __init__(self,
dfnum: Union[int, ndarray, Iterable[int]],
dfden: Union[int, ndarray, Iterable[int]],
nonc: Union[float, ndarray, Iterable[float]],
seed=None):
self.dfnum = dfnum
self.dfden = dfden
self.nonc = nonc
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.noncentral_f(dfnum=self.dfnum,
dfden=self.dfden,
nonc=self.nonc,
size=size)
class Gamma(DistributionNonNegative):
"""
The Gamma distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.gamma <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.gamma.html>`_.
Distribution function:
.. math:: p(x) = x^{k-1}\\frac{e^{-x/\\theta}}{\\theta^k\\Gamma(k)}
"""
continuous = True
def __init__(self,
k: Union[float, ndarray, Iterable[float]],
theta: Union[float, ndarray, Iterable[float]] = 1.0,
seed=None):
self.k = k
self.theta = theta
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.gamma(shape=self.k,
scale=self.theta,
size=size)
class Geometric(DistributionNonNegative):
"""
The Geometric distribution is non-negative and discrete.
The implementation is from `numpy.random.mtrand.RandomState.geometric <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.geometric.html>`_.
Distribution function:
.. math:: f(k) = (1 - p)^{k - 1} p
"""
continuous = False
lb = 1
def __init__(self,
p: Union[float, ndarray, Iterable[float]],
seed=None):
self.p = p
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.geometric(p=self.p,
size=size)
class Gumbel(DistributionUnbounded):
"""
The Gumbel distribution is unbounded and continuous.
The implementation is from `numpy.random.mtrand.RandomState.gumbel <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.gumbel.html>`_.
Distribution function:
.. math:: p(x) = \\frac{e^{-(x - \\mu)/ \\beta}}{\\beta} e^{ -e^{-(x - \\mu)/ \\beta}}
"""
continuous = True
def __init__(self,
mu: Union[float, ndarray, Iterable[float]] = 0.0,
beta: Union[float, ndarray, Iterable[float]] = 1.0,
seed=None):
self.mu = mu
self.beta = beta
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.gumbel(loc=self.mu,
scale=self.beta,
size=size)
class Hypergeometric(DistributionNonNegative):
"""
The Hypergeometric distribution is non-negative and discrete.
The implementation is from `numpy.random.mtrand.RandomState.hypergeometric <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.hypergeometric.html>`_.
Distribution function:
.. math:: P(x) = \\frac{\\binom{m}{n}\\binom{N-m}{n-x}}{\\binom{N}{n}}
"""
continuous = False
def __init__(self,
n: int,
m: Union[int, ndarray, Iterable[int]],
N: Union[int, ndarray, Iterable[int]],
seed=None):
self.n = n
self.m = m
self.N = N
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.hypergeometric(ngood=self.n,
nbad=self.m,
nsample=self.N,
size=size)
class Laplace(DistributionUnbounded):
"""
The Laplace distribution is unbounded and continuous.
The implementation is from `numpy.random.mtrand.RandomState.laplace <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.laplace.html>`_.
Distribution function:
.. math:: f(x; \\mu, \\lambda) = \\frac{1}{2\\lambda} \\exp\\left(-\\frac{|x - \\mu|}{\\lambda}\\right)
"""
continuous = True
def __init__(self,
mu: Union[float, ndarray, Iterable[float]],
beta: Union[float, ndarray, Iterable[float]],
seed=None):
self.mu = mu
self.beta = beta
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.laplace(loc=self.mu,
scale=self.beta,
size=size)
class Logistic(DistributionUnbounded):
"""
The Logistic distribution is unbounded and continuous.
The implementation is from `numpy.random.mtrand.RandomState.logistic <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.logistic.html>`_.
Distribution function:
.. math:: P(x) = P(x) = \\frac{e^{-(x-\\mu)/s}}{s(1+e^{-(x-\\mu)/s})^2}
"""
continuous = True
def __init__(self,
mu: Union[float, ndarray, Iterable[float]],
beta: Union[float, ndarray, Iterable[float]],
seed=None):
self.mu = mu
self.beta = beta
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.logistic(loc=self.mu,
scale=self.beta,
size=size)
class Lognormal(DistributionNonNegative):
"""
The Lognormal distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.lognormal <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.lognormal.html>`_.
Distribution function:
.. math:: p(x) = \\frac{1}{\\sigma x \\sqrt{2\\pi}} e^{(-\\frac{(ln(x)-\\mu)^2}{2\\sigma^2})}
"""
continuous = True
def __init__(self,
mu: Union[float, ndarray, Iterable[float]],
sigma: Union[float, ndarray, Iterable[float]],
seed=None):
self.mu = mu
self.sigma = sigma
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.lognormal(mean=self.mu,
sigma=self.sigma,
size=size)
class Lomax(DistributionNonNegative):
"""
The Pareto II or Lomax distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.pareto <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.pareto.html>`_.
Distribution function:
.. math:: p(x) = \\frac{am^a}{x^{a+1}}
"""
continuous = True
lb = 0
def __init__(self,
a: Union[float, ndarray, Iterable[float]],
seed=None):
self.a = a
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.pareto(a=self.a,
size=size)
class Multinomial(DistributionNonNegative):
"""
The Multinomial distribution is non-negative and discrete.
The implementation is from `numpy.random.mtrand.RandomState.multinomial <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.multinomial.html>`_.
"""
continuous = False
def __init__(self,
n: int,
pvals: Union[float, ndarray, Iterable[float]],
seed=None):
self.n = n
self.pvals = pvals
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.multinomial(n=self.n,
pvals=self.pvals,
size=size)
class Normal(DistributionUnbounded):
"""
The Normal/Gaussian distribution if unbounded and continuous.
The implementation is from `numpy.random.mtrand.RandomState.normal <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.normal.html>`_.
Distribution function:
.. math:: p(x) = \\frac{1}{\\sqrt{ 2 \\pi \\sigma^2 }} e^{ - \\frac{ (x - \\mu)^2 } {2 \\sigma^2} }
"""
continuous = True
def __init__(self,
mean: Union[float, ndarray, Iterable[float]] = 0.0,
std: Union[float, ndarray, Iterable[float]] = 1.0,
seed=None):
self.mean = mean
self.std = std
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.normal(loc=self.mean, scale=self.std, size=size)
class NormalMultivariate(DistributionUnbounded):
"""
The multivariate Normal distribution is unbounded and continuous.
The implementation is from `numpy.random.mtrand.RandomState.multivariate_normal <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.multivariate_normal.html>`_.
"""
continuous = False
def __init__(self,
mu: Union[float, ndarray, Iterable[float]],
cov: Union[list, ndarray],
seed=None):
self.mu = mu
self.cov = cov
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.multivariate_normal(mean=self.mu,
cov=self.cov,
size=size)
class Poisson(DistributionNonNegative):
"""
The Poisson distribution is non-negative and discrete.
The implementation is from `numpy.random.mtrand.RandomState.poisson <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.poisson.html>`_.
Distribution function:
.. math:: f(k; \\lambda)=\\frac{\\lambda^k e^{-\\lambda}}{k!}
"""
continuous = False
def __init__(self,
lam: Union[float, ndarray, Iterable[float]] = 1.0,
seed=None):
self.lam = lam
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.poisson(lam=self.lam,
size=size)
class Power(DistributionBounded):
"""
The Power distribution is bounded and continuous.
The implementation is from `numpy.random.mtrand.RandomState.power <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.power.html>`_.
Distribution function:
.. math:: P(x; a) = ax^{a-1}, 0 \\le x \\le 1, a>0.
"""
continuous = True
lb = 0
ub = 1
def __init__(self,
a: Union[float, ndarray, Iterable[float]],
seed=None):
self.a = a
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.power(a=self.a,
size=size)
class Randint(DistributionBounded):
"""
The Randint distribution is bounded and discrete.
The implementation is from `numpy.random.mtrand.RandomState.randint <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.randint.html>`_.
"""
continuous = False
def __init__(self,
lb: int,
ub: int,
seed=None):
self.lb = lb
self.ub = ub
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.randint(low=self.lb,
high=self.ub,
size=size)
class RandomSample(DistributionBounded):
"""
The RandomSample distribution is bounded and continuous.
The implementation is from `numpy.random.mtrand.RandomState.random_sample <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.random_sample.html>`_.
"""
continuous = True
lb = 0
ub = 1
def __init__(self, seed=None):
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.random_sample(size=size)
class Rayleigh(DistributionNonNegative):
"""
The Rayleigh distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.rayleigh <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.rayleigh.html>`_.
Distribution function:
.. math:: P(x;scale) = \\frac{x}{scale^2}e^{\\frac{-x^2}{2 \\cdotp scale^2}}
"""
continuous = True
def __init__(self,
sigma: Union[float, ndarray, Iterable[float]],
seed=None):
self.sigma = sigma
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.rayleigh(scale=self.sigma,
size=size)
class Triangular(DistributionBounded):
"""
The Triangular distribution is bounded and continuous.
The implementation is from `numpy.random.mtrand.RandomState.triangular <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.triangular.html>`_.
Distribution function:
.. math:: P(x;l, m, r) = \\begin{cases} \\frac{2(x-l)}{(r-l)(m-l)}& \\text{for $l \\leq x \\leq m$}, \\frac{2(r-x)}{(r-l)(r-m)}& \\text{for $m \\leq x \\leq r$}, 0& \\text{otherwise}. \\end{cases}
"""
continuous = True
def __init__(self,
left: Union[float, ndarray, Iterable[float]],
mode: Union[float, ndarray, Iterable[float]],
right: Union[float, ndarray, Iterable[float]],
seed=None):
self.left = left
self.mode = mode
self.right = right
self.lb = left
self.ub = right
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.triangular(left=self.left,
mode=self.mode,
right=self.right,
size=size)
class Uniform(DistributionBounded):
"""
The Uniform distribution is bounded and discrete.
The implementation is from `numpy.random.mtrand.RandomState.uniform <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.uniform.html>`_.
Distribution function:
.. math:: p(x) = \\frac{1}{b - a}
"""
continuous = False
def __init__(self,
lb: Union[float, ndarray, Iterable[float]],
ub: Union[float, ndarray, Iterable[float]],
seed=None):
self.lb = lb
self.ub = ub
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.uniform(low=self.lb,
high=self.ub,
size=size)
class Vonmises(DistributionBounded):
"""
The Vonmises distribution is bounded and continuous.
The implementation is from `numpy.random.mtrand.RandomState.vonmises <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.vonmises.html>`_.
Distribution function:
.. math:: p(x) = \\frac{e^{\\kappa cos(x-\\mu)}}{2\\pi I_0(\\kappa)}
"""
continuous = True
lb = -numpy.math.pi
ub = +numpy.math.pi
def __init__(self,
mu: Union[float, ndarray, Iterable[float]],
kappa: Union[float, ndarray, Iterable[float]],
seed=None):
self.mu = mu
self.kappa = kappa
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.vonmises(mu=self.mu,
kappa=self.kappa,
size=size)
class Wald(DistributionNonNegative):
"""
The Wald distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.wald <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.wald.html>`_.
Distribution function:
continuous = True
.. math:: P(x;mean,scale) = \\sqrt{\\frac{scale}{2\\pi x^3}}e^ \\frac{-scale(x-mean)^2}{2\\cdotp mean^2x}
"""
def __init__(self,
mu: Union[float, ndarray, Iterable[float]],
lam: Union[float, ndarray, Iterable[float]],
seed=None):
self.mu = mu
self.lam = lam
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.wald(mean=self.mu,
scale=self.lam,
size=size)
class Weibull(DistributionNonNegative):
"""
The Weibull distribution is non-negative and continuous.
The implementation is from `numpy.random.mtrand.RandomState.weibull <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.weibull.html>`_.
Distribution function:
.. math:: X = (-ln(U))^{1/a}
"""
continuous = True
def __init__(self,
a: Union[float, ndarray, Iterable[float]],
seed=None):
self.a = a
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.weibull(a=self.a,
size=size)
class Zipf(DistributionNonNegative):
"""
The Zipf distribution is non-negative and discrete.
The implementation is from `numpy.random.mtrand.RandomState.zipf <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.zipf.html>`_.
Distribution function:
.. math:: p(x) = \\frac{x^{-a}}{\\zeta(a)}
"""
continuous = False
lb = 1
def __init__(self,
a: Union[float, ndarray, Iterable[float]],
seed=None):
self.a = a
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.zipf(a=self.a,
size=size)
class Choice(DistributionBounded):
"""
The Choice distribution is bounded and discrete.
The implementation is from `numpy.random.mtrand.RandomState.choice <https://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.random.mtrand.RandomState.choice.html>`_.
"""
continuous = False
def __init__(self,
probabilities: numpy.array,
seed=None):
self.probabilities = probabilities
self.a = numpy.arange(len(probabilities))
self.lb = 0
self.ub = len(probabilities) - 1
self.rs = RandomState(seed=seed)
def _get(self, size=None):
return self.rs.choice(a=self.a, p=self.probabilities, size=size)
|
Dubrzr/dsfaker
|
dsfaker/generators/distributions.py
|
Python
|
mit
| 26,657
|
[
"Gaussian"
] |
101615780e2e490688ed9bf8001d8785fe243bc9049d97f34a4f3bc8b4ae2f15
|
"""
Data-driven tests for references.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import glob
import hashlib
# TODO it may be a bit circular to use pysam as our interface for
# accessing reference information, since this is the method we use
# in the main code. We should examine the possibility of using
# a different library here --- perhaps BioPython?
import pysam
import ga4gh.datamodel.references as references
import ga4gh.protocol as protocol
import tests.datadriven as datadriven
def testReferenceSets():
testDataDir = "tests/data/references"
for test in datadriven.makeTests(testDataDir, ReferenceSetTest):
yield test
class ReferenceSetTest(datadriven.DataDrivenTest):
"""
Data drive test class for reference sets. Builds an alternative model of
a reference set, and verifies that it is consistent with the model
built by the references.ReferenceSet object.
"""
class ReferenceInfo(object):
"""
Container class for information about a reference
"""
def __init__(self, referenceSetId, fastaFileName):
self.fastaFile = pysam.FastaFile(fastaFileName)
self.bases = self.fastaFile.fetch(self.fastaFile.references[0])
def __init__(self, referenceSetId, baseDir):
super(ReferenceSetTest, self).__init__(None, referenceSetId, baseDir)
self._referenceInfos = {}
for fastaFileName in glob.glob(
os.path.join(self._dataDir, "*.fa.gz")):
self._readFasta(referenceSetId, fastaFileName)
def _readFasta(self, referenceSetId, fastaFileName):
referenceInfo = self.ReferenceInfo(referenceSetId, fastaFileName)
self._referenceInfos[fastaFileName] = referenceInfo
def getDataModelClass(self):
class HtslibReferenceSetWrapper(references.HtslibReferenceSet):
def __init__(self, parentContainer, localId, dataDir):
super(HtslibReferenceSetWrapper, self).__init__(
localId, dataDir)
return HtslibReferenceSetWrapper
def getProtocolClass(self):
return protocol.ReferenceSet
def testValidateObjects(self):
# test that validation works on reference sets and references
referenceSet = self._gaObject
referenceSetPe = referenceSet.toProtocolElement()
self.assertValid(
protocol.ReferenceSet, referenceSetPe.toJsonDict())
self.assertGreater(len(referenceSetPe.referenceIds), 0)
for gaReference in referenceSet.getReferences():
reference = gaReference.toProtocolElement().toJsonDict()
self.assertValid(protocol.Reference, reference)
def testGetBases(self):
# test searching with no arguments succeeds
referenceSet = self._gaObject
for gaReference in referenceSet.getReferences():
pysamReference = self._referenceInfos[
gaReference.getFastaFilePath()]
self.assertReferencesEqual(gaReference, pysamReference)
def testGetBasesStart(self):
# test searching with start only succeeds
self.doRangeTest(5, None)
def testGetBasesEnd(self):
# test searching with end only succeeds
self.doRangeTest(None, 5)
def testGetBasesRanges(self):
# test searching with start and end succeeds
self.doRangeTest(5, 10)
def testMd5checksums(self):
referenceSet = self._gaObject
referenceMd5s = []
for gaReference in referenceSet.getReferences():
pysamReference = self._referenceInfos[
gaReference.getFastaFilePath()]
basesChecksum = hashlib.md5(pysamReference.bases).hexdigest()
self.assertEqual("TODO", gaReference.getMd5Checksum())
referenceMd5s.append(basesChecksum)
# checksumsString = ''.join(referenceMd5s)
# md5checksum = hashlib.md5(checksumsString).hexdigest()
referenceSetMd5 = referenceSet._generateMd5Checksum()
self.assertEqual("TODO", referenceSetMd5)
def doRangeTest(self, start=None, end=None):
referenceSet = self._gaObject
for gaReference in referenceSet.getReferences():
pysamReference = self._referenceInfos[
gaReference.getFastaFilePath()]
self.assertReferencesEqual(
gaReference, pysamReference, start, end)
def assertReferencesEqual(
self, gaReference, pysamReference, start=None, end=None):
gaBases = gaReference.getBases(start, end)
pysamBases = pysamReference.bases[start:end]
self.assertEqual(gaBases, pysamBases)
|
UMMS-Biocore/ga4gh-server
|
tests/datadriven/test_references.py
|
Python
|
apache-2.0
| 4,702
|
[
"Biopython",
"pysam"
] |
8b30d03778d8c8fa4d3c1ababc694e2d37518d7eb1ab48ecd05ed3a22a09d2df
|
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Package Setup script for TFX."""
import logging
import os
import shutil
import subprocess
import sys
import setuptools
from setuptools import find_namespace_packages
from setuptools import setup
from setuptools.command import develop
# pylint: disable=g-bad-import-order
# It is recommended to import setuptools prior to importing distutils to avoid
# using legacy behavior from distutils.
# https://setuptools.readthedocs.io/en/latest/history.html#v48-0-0
from distutils.command import build
# pylint: enable=g-bad-import-order
from tfx import dependencies
from tfx import version
from wheel import bdist_wheel
# Prefer to import `package_config` from the setup.py script's directory. The
# `package_config.py` file is used to configure which package to build (see
# the logic below switching on `package_config.PACKAGE_NAME`) and the overall
# package build README at `package_build/README.md`.
sys.path.insert(0, os.path.dirname(__file__))
# pylint: disable=g-bad-import-order,g-import-not-at-top
import package_config
# pylint: enable=g-bad-import-order,g-import-not-at-top
class _BdistWheelCommand(bdist_wheel.bdist_wheel):
"""Overrided bdist_wheel command.
Inject some custom command line arguments and flags that can be used in the
subcommands. This command class covers:
- pip wheel --build-option="--local-mlmd-repo=${MLMD_OUTPUT_DIR}"
- python setup.py bdist_wheel --local-mlmd-repo="${MLMD_OUTPUT_DIR}"
"""
user_options = bdist_wheel.bdist_wheel.user_options + [
('local-mlmd-repo=', None, 'Path to the local MLMD repository to use '
'instead of the Bazel com_github_google_ml_metadata remote repository.')
]
def initialize_options(self):
# Run super().initialize_options. Command is an old-style class (i.e.
# doesn't inherit object) and super() fails in python 2.
bdist_wheel.bdist_wheel.initialize_options(self)
self.local_mlmd_repo = None
def finalize_options(self):
bdist_wheel.bdist_wheel.finalize_options(self)
gen_proto = self.distribution.get_command_obj('gen_proto')
gen_proto.local_mlmd_repo = self.local_mlmd_repo
class _UnsupportedDevBuildWheelCommand(_BdistWheelCommand):
"""Disables build of 'tfx-dev' wheel files."""
def finalize_options(self):
if not os.environ.get('UNSUPPORTED_BUILD_TFX_DEV_WHEEL'):
raise Exception(
'Starting in version 0.26.0, pip package build for TFX has changed,'
'and `python setup.py bdist_wheel` can no longer be invoked '
'directly.\n\nFor instructions on how to build wheels for TFX, see '
'https://github.com/tensorflow/tfx/blob/master/package_build/'
'README.md.\n\nEditable pip installation for development is still '
'supported through `pip install -e`.')
super().finalize_options()
class _BuildCommand(build.build):
"""Build everything that is needed to install.
This overrides the original distutils "build" command to to run gen_proto
command before any sub_commands.
build command is also invoked from bdist_wheel and install command, therefore
this implementation covers the following commands:
- pip install . (which invokes bdist_wheel)
- python setup.py install (which invokes install command)
- python setup.py bdist_wheel (which invokes bdist_wheel command)
"""
def _should_generate_proto(self):
"""Predicate method for running GenProto command or not."""
return True
# Add "gen_proto" command as the first sub_command of "build". Each
# sub_command of "build" (e.g. "build_py", "build_ext", etc.) is executed
# sequentially when running a "build" command, if the second item in the tuple
# (predicate method) is evaluated to true.
sub_commands = [
('gen_proto', _should_generate_proto),
] + build.build.sub_commands
class _DevelopCommand(develop.develop):
"""Developmental install.
https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode
Unlike normal package installation where distribution is copied to the
site-packages folder, developmental install creates a symbolic link to the
source code directory, so that your local code change is immediately visible
in runtime without re-installation.
This is a setuptools-only (i.e. not included in distutils) command that is
also used in pip's editable install (pip install -e). Originally it only
invokes build_py and install_lib command, but we override it to run gen_proto
command in advance.
This implementation covers the following commands:
- pip install -e . (developmental install)
- python setup.py develop (which is invoked from developmental install)
"""
def run(self):
self.run_command('gen_proto')
# Run super().initialize_options. Command is an old-style class (i.e.
# doesn't inherit object) and super() fails in python 2.
develop.develop.run(self)
class _GenProtoCommand(setuptools.Command):
"""Generate proto stub files in python.
Running this command will populate foo_pb2.py file next to your foo.proto
file.
"""
user_options = [
('local-mlmd-repo=', None, 'Path to the local MLMD repository to use '
'instead of the Bazel com_github_google_ml_metadata remote repository.')
]
def initialize_options(self):
self.local_mlmd_repo = None
def finalize_options(self):
self._bazel_cmd = shutil.which('bazel')
if not self._bazel_cmd:
raise RuntimeError(
'Could not find "bazel" binary. Please visit '
'https://docs.bazel.build/versions/master/install.html for '
'installation instruction.')
def run(self):
bazel_args = ['--compilation_mode', 'opt']
if self.local_mlmd_repo:
# If local MLMD repo is given, override com_github_google_ml_metadata
# remote repository with the local path. This is required to use the
# local developmental version of MLMD during tests.
# https://docs.bazel.build/versions/master/command-line-reference.html
bazel_args.append('--override_repository={}={}'.format(
'com_github_google_ml_metadata', self.local_mlmd_repo))
cmd = [self._bazel_cmd, 'run', *bazel_args, '//build:gen_proto']
print('Running Bazel command', cmd, file=sys.stderr)
subprocess.check_call(
cmd,
# Bazel should be invoked in a directory containing bazel WORKSPACE
# file, which is the root directory.
cwd=os.path.dirname(os.path.realpath(__file__)),
env=os.environ)
_TFX_DESCRIPTION = (
'TensorFlow Extended (TFX) is a TensorFlow-based general-purpose machine '
'learning platform implemented at Google.')
_PIPELINES_SDK_DESCRIPTION = (
'A dependency-light distribution of the core pipeline authoring '
'functionality of TensorFlow Extended (TFX).')
# Get the long descriptions from README files.
with open('README.md') as fp:
_TFX_LONG_DESCRIPTION = fp.read()
with open('README.ml-pipelines-sdk.md') as fp:
_PIPELINES_SDK_LONG_DESCRIPTION = fp.read()
package_name = package_config.PACKAGE_NAME
tfx_extras_requires = {
# In order to use 'docker-image' or 'all', system libraries specified
# under 'tfx/tools/docker/Dockerfile' are required
'docker-image': dependencies.make_extra_packages_docker_image(),
'airflow': dependencies.make_extra_packages_airflow(),
'kfp': dependencies.make_extra_packages_kfp(),
'tfjs': dependencies.make_extra_packages_tfjs(),
'tf-ranking': dependencies.make_extra_packages_tf_ranking(),
'tfdf': dependencies.make_extra_packages_tfdf(),
'examples': dependencies.make_extra_packages_examples(),
'test': dependencies.make_extra_packages_test(),
'all': dependencies.make_extra_packages_all(),
}
# Packages included the TFX namespace.
TFX_NAMESPACE_PACKAGES = [
'tfx', 'tfx.*', 'tfx.orchestration', 'tfx.orchestration.*'
]
# Packages within the TFX namespace that are to be included in the base
# "ml-pipelines-sdk" pip package (and excluded from the "tfx" pip package,
# which takes "ml-pipelines-sdk" as a dependency).
ML_PIPELINES_SDK_PACKAGES = [
# This adds `tfx.version` which is needed in several places.
'tfx',
# Core DSL subpackage.
'tfx.dsl',
'tfx.dsl.*',
# The "ml-pipelines-sdk" package currently only supports local execution.
# These are the subpackages of `tfx.orchestration` necessary.
'tfx.orchestration',
'tfx.orchestration.config',
'tfx.orchestration.launcher',
'tfx.orchestration.local',
'tfx.orchestration.local.legacy',
'tfx.orchestration.portable',
'tfx.orchestration.portable.*',
# Note that `tfx.proto` contains TFX first-party component-specific
# protobuf definitions, but `tfx.proto.orchestration` contains portable
# execution protobuf definitions which are needed in the base package.
'tfx.proto.orchestration',
# TODO(b/176814928): Consider moving relevant modules under
# `tfx.orchestration.*` to `tfx.dsl.*` as appropriate.
'tfx.proto.orchestration.*',
# TODO(b/176795329): Move `tfx.utils` to a location that emphasizes that
# these are internal utilities.
'tfx.utils',
'tfx.utils.*',
# TODO(b/176795331): Move `Artifact` and `ComponentSpec` classes into
# `tfx.dsl.*`.
'tfx.types',
'tfx.types.*',
]
EXCLUDED_PACKAGES = [
'tfx.benchmarks',
'tfx.benchmarks.*',
]
# Below console_scripts, each line identifies one console script. The first
# part before the equals sign (=) which is 'tfx', is the name of the script
# that should be generated, the second part is the import path followed by a
# colon (:) with the Click command group. After installation, the user can
# invoke the CLI using "tfx <command_group> <sub_command> <flags>"
TFX_ENTRY_POINTS = """
[console_scripts]
tfx=tfx.tools.cli.cli_main:cli_group
"""
ML_PIPELINES_SDK_ENTRY_POINTS = None
# This `setup.py` file can be used to build packages in 3 configurations. See
# the discussion in `package_build/README.md` for an overview. The `tfx` and
# `ml-pipelines-sdk` pip packages can be built for distribution using the
# selectable `package_config.PACKAGE_NAME` specifier. Additionally, for
# development convenience, the `tfx-dev` package containing the union of the
# the `tfx` and `ml-pipelines-sdk` package can be installed as an editable
# package using `pip install -e .`, but should not be built for distribution.
if package_config.PACKAGE_NAME == 'tfx-dev':
# Monolithic development package with the entirety of `tfx.*` and the full
# set of dependencies. Functionally equivalent to the union of the "tfx" and
# "tfx-pipeline-sdk" packages.
install_requires = dependencies.make_required_install_packages()
extras_require = tfx_extras_requires
description = _TFX_DESCRIPTION
long_description = _TFX_LONG_DESCRIPTION
packages = find_namespace_packages(
include=TFX_NAMESPACE_PACKAGES, exclude=EXCLUDED_PACKAGES)
# Do not support wheel builds for "tfx-dev".
build_wheel_command = _UnsupportedDevBuildWheelCommand # pylint: disable=invalid-name
# Include TFX entrypoints.
entry_points = TFX_ENTRY_POINTS
elif package_config.PACKAGE_NAME == 'ml-pipelines-sdk':
# Core TFX pipeline authoring SDK, without dependency on component-specific
# packages like "tensorflow" and "apache-beam".
install_requires = dependencies.make_pipeline_sdk_required_install_packages()
extras_require = {}
description = _PIPELINES_SDK_DESCRIPTION
long_description = _PIPELINES_SDK_LONG_DESCRIPTION
packages = find_namespace_packages(
include=ML_PIPELINES_SDK_PACKAGES, exclude=EXCLUDED_PACKAGES)
# Use the default pip wheel building command.
build_wheel_command = bdist_wheel.bdist_wheel # pylint: disable=invalid-name
# Include ML Pipelines SDK entrypoints.
entry_points = ML_PIPELINES_SDK_ENTRY_POINTS
elif package_config.PACKAGE_NAME == 'tfx':
# Recommended installation package for TFX. This package builds on top of
# the "ml-pipelines-sdk" pipeline authoring SDK package and adds first-party
# TFX components and additional functionality.
install_requires = (['ml-pipelines-sdk==%s' % version.__version__] +
dependencies.make_required_install_packages())
extras_require = tfx_extras_requires
description = _TFX_DESCRIPTION
long_description = _TFX_LONG_DESCRIPTION
packages = find_namespace_packages(
include=TFX_NAMESPACE_PACKAGES,
exclude=ML_PIPELINES_SDK_PACKAGES + EXCLUDED_PACKAGES)
# Use the pip wheel building command that includes proto generation.
build_wheel_command = _BdistWheelCommand # pylint: disable=invalid-name
# Include TFX entrypoints.
entry_points = TFX_ENTRY_POINTS
else:
raise ValueError('Invalid package config: %r.' % package_config.PACKAGE_NAME)
logging.info('Executing build for package %r.', package_name)
setup(
name=package_name,
version=version.__version__,
author='Google LLC',
author_email='tensorflow-extended-dev@googlegroups.com',
license='Apache 2.0',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
],
namespace_packages=[],
install_requires=install_requires,
extras_require=extras_require,
# TODO(b/158761800): Move to [build-system] requires in pyproject.toml.
setup_requires=[
'pytest-runner',
],
cmdclass={
'bdist_wheel': build_wheel_command,
'build': _BuildCommand,
'develop': _DevelopCommand,
'gen_proto': _GenProtoCommand,
},
python_requires='>=3.7,<3.9',
packages=packages,
include_package_data=True,
description=description,
long_description=long_description,
long_description_content_type='text/markdown',
keywords='tensorflow tfx',
url='https://www.tensorflow.org/tfx',
download_url='https://github.com/tensorflow/tfx/tags',
requires=[],
entry_points=entry_points)
|
tensorflow/tfx
|
setup.py
|
Python
|
apache-2.0
| 15,240
|
[
"VisIt"
] |
63a821aa3c4603da98e30eeec6e37675446a263c8a0be63b5f6c65b0c7c83645
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Mamba.jl documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 31 10:03:01 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os, sys
import juliadoc
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.pngmath',
'sphinxcontrib.bibtex',
'juliadoc.julia',
'juliadoc.jlhelp'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = []
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'Mamba.jl'
copyright = '2014, Brian J Smith'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.9'
# The full version, including alpha/beta/rc tags.
release = '0.9.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = False
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
primary_domain = 'jl'
highlight_language = 'julia'
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
html_domain_indices = False
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'Mambajldoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
'preamble': '\usepackage{bm}',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'Mambajl.tex', 'Mamba.jl Documentation',
'Brian J Smith', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
latex_domain_indices = False
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'mambajl', 'Mamba.jl Documentation',
['Brian J Smith'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Mambajl', 'Mamba.jl Documentation',
'Brian J Smith', 'Mambajl', 'Markov chain Monte Carlo for Bayesian analysis in julia.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
|
axsk/Mamba.jl
|
doc/conf.py
|
Python
|
mit
| 8,644
|
[
"Brian"
] |
07464e3069f9c8370221039a523a0a626598ac12e0d9f313afbec0918efac8ee
|
#!/usr/bin/env python
from lims_orca_utils import *
from neuron import h
import numpy as np
import argparse
import matplotlib.pyplot as plt
# Load the morphology
def load_morphology(filename):
swc = h.Import3d_SWC_read()
swc.input(filename)
imprt = h.Import3d_GUI(swc, 0)
h("objref this")
imprt.instantiate(h.this)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='analyze cap check sweep')
parser.add_argument('specimen')
parser.add_argument('down_lim', type=float)
parser.add_argument('up_lim', type=float)
parser.add_argument('-p', dest='plot', action='store_true')
args = parser.parse_args()
up_data = np.loadtxt("/home/nathang/analysis/passive_props/data/" + args.specimen + '_upbase.dat')
down_data = np.loadtxt("/home/nathang/analysis/passive_props/data/" + args.specimen + '_downbase.dat')
specimen_name, ephys_roi_result_id, specimen_id = get_specimen_info_from_lims(args.specimen)
swc_filename, swc_path = get_swc_from_lims(specimen_id)
h.load_file("stdgui.hoc")
h.load_file("import3d.hoc")
load_morphology(swc_path)
for sec in h.allsec():
sec.insert('pas')
for seg in sec:
seg.pas.e = 0
h.load_file("passive_props/fixnseg.hoc")
h.load_file("passive_props/iclamp.ses")
h.load_file("passive_props/params.hoc")
h.load_file("passive_props/mrf2.ses")
h.v_init = 0
h.tstop = 100
fit_start = 4.0025
v_rec = h.Vector()
t_rec = h.Vector()
v_rec.record(h.soma[0](0.5)._ref_v)
t_rec.record(h._ref_t)
mrf = h.MulRunFitter[0]
gen0 = mrf.p.pf.generatorlist.object(0)
gen0.toggle()
fit0 = gen0.gen.fitnesslist.object(0)
up_t = h.Vector(up_data[:, 0])
up_v = h.Vector(up_data[:, 1])
fit0.set_data(up_t, up_v)
fit0.boundary.x[0] = fit_start
fit0.boundary.x[1] = args.up_lim
fit0.set_w()
gen1 = mrf.p.pf.generatorlist.object(1)
gen1.toggle()
fit1 = gen1.gen.fitnesslist.object(0)
down_t = h.Vector(down_data[:, 0])
down_v = h.Vector(down_data[:, 1])
fit1.set_data(down_t, down_v)
fit1.boundary.x[0] = fit_start
fit1.boundary.x[1] = args.down_lim
fit1.set_w()
minerr = 1e12
for i in range(3):
h.Ri = 100
h.Cm = 1
h.Rm = 10000
mrf.randomize()
mrf.prun()
if mrf.opt.minerr < minerr:
fit_Ri = h.Ri
fit_Cm = h.Cm
fit_Rm = h.Rm
minerr = mrf.opt.minerr
h.region_areas()
print "Ri ", fit_Ri
print "Cm ", fit_Cm
print "Rm ", fit_Rm
print "Final error ", minerr
if args.plot:
plt.style.use('ggplot')
plt.figure()
plt.plot(up_data[:, 0], up_data[:, 1])
plt.plot(down_data[:, 0], -1 * down_data[:, 1])
plt.plot(t_rec, -1 * np.array(v_rec), color='black')
plt.axvline(fit_start, color='gray')
plt.axvline(args.up_lim, color='gray')
plt.axvline(args.down_lim, color='gray')
plt.title("{:s} - Ri: {:.2f}, Rm: {:.2f}, Cm: {:.2f}".format(args.specimen, h.Ri, h.Rm, h.Cm))
plt.xlim(0, 75)
plt.savefig(args.specimen + "_pasfit2.png", bbox_inches='tight')
plt.show()
|
XiaoxiaoLiu/morphology_analysis
|
model_fitting/neuron_passive_fit2.py
|
Python
|
gpl-3.0
| 3,292
|
[
"NEURON"
] |
35f1a18ca5ec30b4a87c1e3ed78870dc52bec7756646fff057a6564e1254d3c8
|
#!/usr/bin/env python
"""
Run this test like so:
$ vtkpython TestGL2PSExporter.py -D $VTK_DATA_ROOT \
-B $VTK_DATA_ROOT/Baseline/Rendering/
$ vtkpython TestGL2PSExporter.py --help
provides more details on other options.
Please note that this test requires that you have PIL (the Python
Imaging Library) module installed and also GL2PS support built into
VTK.
"""
import sys
import os
import os.path
import tempfile
import vtk
from vtk.test import Testing
# This requires that you have PIL installed.
try:
import Image
except ImportError:
print "Please install PIL (Python Imaging Library) to run this test."
sys.exit(0)
class TestGL2PSExporter(Testing.vtkTest):
# Create these as class attributes so that they are only created
# once and not for every test.
cs = vtk.vtkConeSource()
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(cs.GetOutputPort())
act = vtk.vtkActor()
act.SetMapper(mapper)
act.GetProperty().SetColor(0.5, 0.5, 1.0)
axes = vtk.vtkCubeAxesActor2D()
axes.SetInputConnection(cs.GetOutputPort())
axes.SetFontFactor(2.0)
axes.SetCornerOffset(0.0)
axes.GetProperty().SetColor(0,0,0)
txt = vtk.vtkTextActor()
txt.SetDisplayPosition(45, 150)
txt.SetInput("This is test\nmultiline\ninput\ndata.")
tprop = txt.GetTextProperty()
tprop.SetFontSize(18)
tprop.SetFontFamilyToArial()
tprop.SetJustificationToCentered()
tprop.BoldOn()
tprop.ItalicOn()
tprop.ShadowOn()
tprop.SetColor(0, 0, 1)
ren = vtk.vtkRenderer()
ren.AddActor(act)
ren.AddActor(txt)
axes.SetCamera(ren.GetActiveCamera())
ren.AddActor(axes)
ren.SetBackground(0.8, 0.8, 0.8)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
cam = ren.GetActiveCamera()
ren.ResetCamera()
cam.Azimuth(30)
iren.Initialize()
iren.Render()
def _cleanup(self, files):
"""Remove the list of given files."""
for f in files:
if os.path.isfile(f):
os.remove(f)
def testVectorEPS(self):
"""Test vector EPS output."""
# Get a temporary file name. Set the extension to empty since
# the exporter appends a suitable extension.
tmp_eps = tempfile.mktemp('')
# Write an EPS file.
exp = vtk.vtkGL2PSExporter()
exp.SetRenderWindow(self.renWin)
exp.SetFilePrefix(tmp_eps)
# Turn off compression so PIL can read file.
exp.CompressOff()
exp.SetSortToBSP()
exp.DrawBackgroundOn()
exp.Write()
# Now read the EPS file using PIL.
tmp_eps += '.eps'
im = Image.open(tmp_eps)
# Get a temporary name for the PNG file.
tmp_png = tempfile.mktemp('.png')
im.save(tmp_png)
# Now read the saved image and compare it for the test.
png_r = vtk.vtkPNGReader()
png_r.SetFileName(tmp_png)
png_r.Update()
img = png_r.GetOutput()
# Cleanup. Do this first because if the test fails, an
# exception is raised and the temporary files won't be
# removed.
self._cleanup([tmp_eps, tmp_png])
img_file = "TestGL2PSExporter.png"
Testing.compareImageWithSavedImage(img,
Testing.getAbsImagePath(img_file))
# Interact if necessary.
Testing.interact()
def testRasterEPS(self):
"""Test EPS output when Write3DPropsAsRasterImage is on."""
# Get a temporary file name. Set the extension to empty since
# the exporter appends a suitable extension.
tmp_eps = tempfile.mktemp('')
# Write an EPS file.
exp = vtk.vtkGL2PSExporter()
exp.SetRenderWindow(self.renWin)
exp.SetFilePrefix(tmp_eps)
# Turn off compression so PIL can read file.
exp.CompressOff()
exp.SetSortToOff()
exp.DrawBackgroundOn()
exp.Write3DPropsAsRasterImageOn()
exp.Write()
# Now read the EPS file using PIL.
tmp_eps += '.eps'
im = Image.open(tmp_eps)
# Get a temporary name for the PNG file.
tmp_png = tempfile.mktemp('.png')
im.save(tmp_png)
# Now read the saved image and compare it for the test.
png_r = vtk.vtkPNGReader()
png_r.SetFileName(tmp_png)
png_r.Update()
img = png_r.GetOutput()
# Cleanup. Do this first because if the test fails, an
# exception is raised and the temporary files won't be
# removed.
self._cleanup([tmp_eps, tmp_png])
img_file = "TestGL2PSExporter.png"
Testing.compareImageWithSavedImage(img,
Testing.getAbsImagePath(img_file))
# Interact if necessary.
Testing.interact()
if __name__ == "__main__":
cases = [(TestGL2PSExporter, 'test')]
# This should prevent debug leaks messages.
del TestGL2PSExporter
Testing.main(cases)
|
cjh1/VTK
|
IO/Export/Testing/Python/TestGL2PSExporter.py
|
Python
|
bsd-3-clause
| 5,080
|
[
"VTK"
] |
75226f6095f80c9025f77f5244deba52820577cd0b6325dbe77c29e1c3e19c59
|
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Classes representing statistical distributions and ops for working with them.
## Classes for statistical distributions.
Classes that represent batches of statistical distributions. Each class is
initialized with parameters that define the distributions.
### Base classes
@@BaseDistribution
@@ContinuousDistribution
@@DiscreteDistribution
### Univariate (scalar) distributions
@@Gaussian
@@Uniform
### Multivariate distributions
@@MultivariateNormal
@@DirichletMultinomial
## Posterior inference with conjugate priors.
Functions that transform conjugate prior/likelihood pairs to distributions
representing the posterior or posterior predictive.
### Gaussian likelihood with conjugate prior.
@@gaussian_conjugates_known_sigma_posterior
@@gaussian_congugates_known_sigma_predictive
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=unused-import,wildcard-import,line-too-long
from tensorflow.contrib.distributions.python.ops.dirichlet_multinomial import *
from tensorflow.contrib.distributions.python.ops.distribution import *
from tensorflow.contrib.distributions.python.ops.gaussian import *
from tensorflow.contrib.distributions.python.ops.gaussian_conjugate_posteriors import *
from tensorflow.contrib.distributions.python.ops.mvn import *
from tensorflow.contrib.distributions.python.ops.uniform import *
|
plowman/python-mcparseface
|
models/syntaxnet/tensorflow/tensorflow/contrib/distributions/__init__.py
|
Python
|
apache-2.0
| 2,083
|
[
"Gaussian"
] |
d5cd605fb84553271171f221eba4d9d8f8c6755bb9dcc46ee284cdf419020cb2
|
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'status': ['stableinterface'],
'supported_by': 'committer',
'version': '1.0'}
DOCUMENTATION = """
---
module: ec2_elb_lb
description:
- Returns information about the load balancer.
- Will be marked changed when called only if state is changed.
short_description: Creates or destroys Amazon ELB.
version_added: "1.5"
author:
- "Jim Dalton (@jsdalton)"
options:
state:
description:
- Create or destroy the ELB
choices: ["present", "absent"]
required: true
name:
description:
- The name of the ELB
required: true
listeners:
description:
- List of ports/protocols for this ELB to listen on (see example)
required: false
purge_listeners:
description:
- Purge existing listeners on ELB that are not found in listeners
required: false
default: true
instance_ids:
description:
- List of instance ids to attach to this ELB
required: false
default: false
version_added: "2.1"
purge_instance_ids:
description:
- Purge existing instance ids on ELB that are not found in instance_ids
required: false
default: false
version_added: "2.1"
zones:
description:
- List of availability zones to enable on this ELB
required: false
purge_zones:
description:
- Purge existing availability zones on ELB that are not found in zones
required: false
default: false
security_group_ids:
description:
- A list of security groups to apply to the elb
required: false
default: None
version_added: "1.6"
security_group_names:
description:
- A list of security group names to apply to the elb
required: false
default: None
version_added: "2.0"
health_check:
description:
- An associative array of health check configuration settings (see example)
required: false
default: None
access_logs:
description:
- An associative array of access logs configuration settings (see example)
required: false
default: None
version_added: "2.0"
subnets:
description:
- A list of VPC subnets to use when creating ELB. Zones should be empty if using this.
required: false
default: None
aliases: []
version_added: "1.7"
purge_subnets:
description:
- Purge existing subnet on ELB that are not found in subnets
required: false
default: false
version_added: "1.7"
scheme:
description:
- The scheme to use when creating the ELB. For a private VPC-visible ELB use 'internal'.
required: false
default: 'internet-facing'
version_added: "1.7"
validate_certs:
description:
- When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0.
required: false
default: "yes"
choices: ["yes", "no"]
aliases: []
version_added: "1.5"
connection_draining_timeout:
description:
- Wait a specified timeout allowing connections to drain before terminating an instance
required: false
aliases: []
version_added: "1.8"
idle_timeout:
description:
- ELB connections from clients and to servers are timed out after this amount of time
required: false
version_added: "2.0"
cross_az_load_balancing:
description:
- Distribute load across all configured Availability Zones
required: false
default: "no"
choices: ["yes", "no"]
aliases: []
version_added: "1.8"
stickiness:
description:
- An associative array of stickiness policy settings. Policy will be applied to all listeners ( see example )
required: false
version_added: "2.0"
wait:
description:
- When specified, Ansible will check the status of the load balancer to ensure it has been successfully
removed from AWS.
required: false
default: no
choices: ["yes", "no"]
version_added: "2.1"
wait_timeout:
description:
- Used in conjunction with wait. Number of seconds to wait for the elb to be terminated.
A maximum of 600 seconds (10 minutes) is allowed.
required: false
default: 60
version_added: "2.1"
tags:
description:
- An associative array of tags. To delete all tags, supply an empty dict.
required: false
version_added: "2.1"
extends_documentation_fragment:
- aws
- ec2
"""
EXAMPLES = """
# Note: None of these examples set aws_access_key, aws_secret_key, or region.
# It is assumed that their matching environment variables are set.
# Basic provisioning example (non-VPC)
- local_action:
module: ec2_elb_lb
name: "test-please-delete"
state: present
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http # options are http, https, ssl, tcp
load_balancer_port: 80
instance_port: 80
proxy_protocol: True
- protocol: https
load_balancer_port: 443
instance_protocol: http # optional, defaults to value of protocol setting
instance_port: 80
# ssl certificate required for https or ssl
ssl_certificate_id: "arn:aws:iam::123456789012:server-certificate/company/servercerts/ProdServerCert"
# Internal ELB example
- local_action:
module: ec2_elb_lb
name: "test-vpc"
scheme: internal
state: present
instance_ids:
- i-abcd1234
purge_instance_ids: true
subnets:
- subnet-abcd1234
- subnet-1a2b3c4d
listeners:
- protocol: http # options are http, https, ssl, tcp
load_balancer_port: 80
instance_port: 80
# Configure a health check and the access logs
- local_action:
module: ec2_elb_lb
name: "test-please-delete"
state: present
zones:
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
health_check:
ping_protocol: http # options are http, https, ssl, tcp
ping_port: 80
ping_path: "/index.html" # not required for tcp or ssl
response_timeout: 5 # seconds
interval: 30 # seconds
unhealthy_threshold: 2
healthy_threshold: 10
access_logs:
interval: 5 # minutes (defaults to 60)
s3_location: "my-bucket" # This value is required if access_logs is set
s3_prefix: "logs"
# Ensure ELB is gone
- local_action:
module: ec2_elb_lb
name: "test-please-delete"
state: absent
# Ensure ELB is gone and wait for check (for default timeout)
- local_action:
module: ec2_elb_lb
name: "test-please-delete"
state: absent
wait: yes
# Ensure ELB is gone and wait for check with timeout value
- local_action:
module: ec2_elb_lb
name: "test-please-delete"
state: absent
wait: yes
wait_timeout: 600
# Normally, this module will purge any listeners that exist on the ELB
# but aren't specified in the listeners parameter. If purge_listeners is
# false it leaves them alone
- local_action:
module: ec2_elb_lb
name: "test-please-delete"
state: present
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
purge_listeners: no
# Normally, this module will leave availability zones that are enabled
# on the ELB alone. If purge_zones is true, then any extraneous zones
# will be removed
- local_action:
module: ec2_elb_lb
name: "test-please-delete"
state: present
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
purge_zones: yes
# Creates a ELB and assigns a list of subnets to it.
- local_action:
module: ec2_elb_lb
state: present
name: 'New ELB'
security_group_ids: 'sg-123456, sg-67890'
region: us-west-2
subnets: 'subnet-123456,subnet-67890'
purge_subnets: yes
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
# Create an ELB with connection draining, increased idle timeout and cross availability
# zone load balancing
- local_action:
module: ec2_elb_lb
name: "New ELB"
state: present
connection_draining_timeout: 60
idle_timeout: 300
cross_az_load_balancing: "yes"
region: us-east-1
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
# Create an ELB with load balancer stickiness enabled
- local_action:
module: ec2_elb_lb
name: "New ELB"
state: present
region: us-east-1
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
stickiness:
type: loadbalancer
enabled: yes
expiration: 300
# Create an ELB with application stickiness enabled
- local_action:
module: ec2_elb_lb
name: "New ELB"
state: present
region: us-east-1
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
stickiness:
type: application
enabled: yes
cookie: SESSIONID
# Create an ELB and add tags
- local_action:
module: ec2_elb_lb
name: "New ELB"
state: present
region: us-east-1
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
tags:
Name: "New ELB"
stack: "production"
client: "Bob"
# Delete all tags from an ELB
- local_action:
module: ec2_elb_lb
name: "New ELB"
state: present
region: us-east-1
zones:
- us-east-1a
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 80
tags: {}
"""
try:
import boto
import boto.ec2.elb
import boto.ec2.elb.attributes
import boto.vpc
from boto.ec2.elb.healthcheck import HealthCheck
from boto.ec2.tag import Tag
HAS_BOTO = True
except ImportError:
HAS_BOTO = False
import time
import random
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ec2 import ec2_argument_spec, connect_to_aws, AnsibleAWSError
from ansible.module_utils.ec2 import get_aws_connection_info
def _throttleable_operation(max_retries):
def _operation_wrapper(op):
def _do_op(*args, **kwargs):
retry = 0
while True:
try:
return op(*args, **kwargs)
except boto.exception.BotoServerError as e:
if retry < max_retries and e.code in \
("Throttling", "RequestLimitExceeded"):
retry = retry + 1
time.sleep(min(random.random() * (2 ** retry), 300))
continue
else:
raise
return _do_op
return _operation_wrapper
def _get_vpc_connection(module, region, aws_connect_params):
try:
return connect_to_aws(boto.vpc, region, **aws_connect_params)
except (boto.exception.NoAuthHandlerFound, AnsibleAWSError) as e:
module.fail_json(msg=str(e))
_THROTTLING_RETRIES = 5
class ElbManager(object):
"""Handles ELB creation and destruction"""
def __init__(self, module, name, listeners=None, purge_listeners=None,
zones=None, purge_zones=None, security_group_ids=None,
health_check=None, subnets=None, purge_subnets=None,
scheme="internet-facing", connection_draining_timeout=None,
idle_timeout=None,
cross_az_load_balancing=None, access_logs=None,
stickiness=None, wait=None, wait_timeout=None, tags=None,
region=None,
instance_ids=None, purge_instance_ids=None, **aws_connect_params):
self.module = module
self.name = name
self.listeners = listeners
self.purge_listeners = purge_listeners
self.instance_ids = instance_ids
self.purge_instance_ids = purge_instance_ids
self.zones = zones
self.purge_zones = purge_zones
self.security_group_ids = security_group_ids
self.health_check = health_check
self.subnets = subnets
self.purge_subnets = purge_subnets
self.scheme = scheme
self.connection_draining_timeout = connection_draining_timeout
self.idle_timeout = idle_timeout
self.cross_az_load_balancing = cross_az_load_balancing
self.access_logs = access_logs
self.stickiness = stickiness
self.wait = wait
self.wait_timeout = wait_timeout
self.tags = tags
self.aws_connect_params = aws_connect_params
self.region = region
self.changed = False
self.status = 'gone'
self.elb_conn = self._get_elb_connection()
self.elb = self._get_elb()
self.ec2_conn = self._get_ec2_connection()
@_throttleable_operation(_THROTTLING_RETRIES)
def ensure_ok(self):
"""Create the ELB"""
if not self.elb:
# Zones and listeners will be added at creation
self._create_elb()
else:
self._set_zones()
self._set_security_groups()
self._set_elb_listeners()
self._set_subnets()
self._set_health_check()
# boto has introduced support for some ELB attributes in
# different versions, so we check first before trying to
# set them to avoid errors
if self._check_attribute_support('connection_draining'):
self._set_connection_draining_timeout()
if self._check_attribute_support('connecting_settings'):
self._set_idle_timeout()
if self._check_attribute_support('cross_zone_load_balancing'):
self._set_cross_az_load_balancing()
if self._check_attribute_support('access_log'):
self._set_access_log()
# add sitcky options
self.select_stickiness_policy()
# ensure backend server policies are correct
self._set_backend_policies()
# set/remove instance ids
self._set_instance_ids()
self._set_tags()
def ensure_gone(self):
"""Destroy the ELB"""
if self.elb:
self._delete_elb()
if self.wait:
elb_removed = self._wait_for_elb_removed()
# Unfortunately even though the ELB itself is removed quickly
# the interfaces take longer so reliant security groups cannot
# be deleted until the interface has registered as removed.
elb_interface_removed = self._wait_for_elb_interface_removed()
if not (elb_removed and elb_interface_removed):
self.module.fail_json(msg='Timed out waiting for removal of load balancer.')
def get_info(self):
try:
check_elb = self.elb_conn.get_all_load_balancers(self.name)[0]
except:
check_elb = None
if not check_elb:
info = {
'name': self.name,
'status': self.status,
'region': self.region
}
else:
try:
lb_cookie_policy = check_elb.policies.lb_cookie_stickiness_policies[0].__dict__['policy_name']
except:
lb_cookie_policy = None
try:
app_cookie_policy = check_elb.policies.app_cookie_stickiness_policies[0].__dict__['policy_name']
except:
app_cookie_policy = None
info = {
'name': check_elb.name,
'dns_name': check_elb.dns_name,
'zones': check_elb.availability_zones,
'security_group_ids': check_elb.security_groups,
'status': self.status,
'subnets': self.subnets,
'scheme': check_elb.scheme,
'hosted_zone_name': check_elb.canonical_hosted_zone_name,
'hosted_zone_id': check_elb.canonical_hosted_zone_name_id,
'lb_cookie_policy': lb_cookie_policy,
'app_cookie_policy': app_cookie_policy,
'proxy_policy': self._get_proxy_protocol_policy(),
'backends': self._get_backend_policies(),
'instances': [instance.id for instance in check_elb.instances],
'out_of_service_count': 0,
'in_service_count': 0,
'unknown_instance_state_count': 0,
'region': self.region
}
# status of instances behind the ELB
if info['instances']:
info['instance_health'] = [ dict(
instance_id = instance_state.instance_id,
reason_code = instance_state.reason_code,
state = instance_state.state
) for instance_state in self.elb_conn.describe_instance_health(self.name)]
else:
info['instance_health'] = []
# instance state counts: InService or OutOfService
if info['instance_health']:
for instance_state in info['instance_health']:
if instance_state['state'] == "InService":
info['in_service_count'] += 1
elif instance_state['state'] == "OutOfService":
info['out_of_service_count'] += 1
else:
info['unknown_instance_state_count'] += 1
if check_elb.health_check:
info['health_check'] = {
'target': check_elb.health_check.target,
'interval': check_elb.health_check.interval,
'timeout': check_elb.health_check.timeout,
'healthy_threshold': check_elb.health_check.healthy_threshold,
'unhealthy_threshold': check_elb.health_check.unhealthy_threshold,
}
if check_elb.listeners:
info['listeners'] = [self._api_listener_as_tuple(l)
for l in check_elb.listeners]
elif self.status == 'created':
# When creating a new ELB, listeners don't show in the
# immediately returned result, so just include the
# ones that were added
info['listeners'] = [self._listener_as_tuple(l)
for l in self.listeners]
else:
info['listeners'] = []
if self._check_attribute_support('connection_draining'):
info['connection_draining_timeout'] = int(self.elb_conn.get_lb_attribute(self.name, 'ConnectionDraining').timeout)
if self._check_attribute_support('connecting_settings'):
info['idle_timeout'] = self.elb_conn.get_lb_attribute(self.name, 'ConnectingSettings').idle_timeout
if self._check_attribute_support('cross_zone_load_balancing'):
is_cross_az_lb_enabled = self.elb_conn.get_lb_attribute(self.name, 'CrossZoneLoadBalancing')
if is_cross_az_lb_enabled:
info['cross_az_load_balancing'] = 'yes'
else:
info['cross_az_load_balancing'] = 'no'
# return stickiness info?
info['tags'] = self.tags
return info
@_throttleable_operation(_THROTTLING_RETRIES)
def _wait_for_elb_removed(self):
polling_increment_secs = 15
max_retries = (self.wait_timeout / polling_increment_secs)
status_achieved = False
for x in range(0, max_retries):
try:
self.elb_conn.get_all_lb_attributes(self.name)
except (boto.exception.BotoServerError, StandardError) as e:
if "LoadBalancerNotFound" in e.code:
status_achieved = True
break
else:
time.sleep(polling_increment_secs)
return status_achieved
@_throttleable_operation(_THROTTLING_RETRIES)
def _wait_for_elb_interface_removed(self):
polling_increment_secs = 15
max_retries = (self.wait_timeout / polling_increment_secs)
status_achieved = False
elb_interfaces = self.ec2_conn.get_all_network_interfaces(
filters={'attachment.instance-owner-id': 'amazon-elb',
'description': 'ELB {0}'.format(self.name) })
for x in range(0, max_retries):
for interface in elb_interfaces:
try:
result = self.ec2_conn.get_all_network_interfaces(interface.id)
if result == []:
status_achieved = True
break
else:
time.sleep(polling_increment_secs)
except (boto.exception.BotoServerError, StandardError) as e:
if 'InvalidNetworkInterfaceID' in e.code:
status_achieved = True
break
else:
self.module.fail_json(msg=str(e))
return status_achieved
@_throttleable_operation(_THROTTLING_RETRIES)
def _get_elb(self):
elbs = self.elb_conn.get_all_load_balancers()
for elb in elbs:
if self.name == elb.name:
self.status = 'ok'
return elb
def _get_elb_connection(self):
try:
return connect_to_aws(boto.ec2.elb, self.region,
**self.aws_connect_params)
except (boto.exception.NoAuthHandlerFound, AnsibleAWSError) as e:
self.module.fail_json(msg=str(e))
def _get_ec2_connection(self):
try:
return connect_to_aws(boto.ec2, self.region,
**self.aws_connect_params)
except (boto.exception.NoAuthHandlerFound, StandardError) as e:
self.module.fail_json(msg=str(e))
@_throttleable_operation(_THROTTLING_RETRIES)
def _delete_elb(self):
# True if succeeds, exception raised if not
result = self.elb_conn.delete_load_balancer(name=self.name)
if result:
self.changed = True
self.status = 'deleted'
def _create_elb(self):
listeners = [self._listener_as_tuple(l) for l in self.listeners]
self.elb = self.elb_conn.create_load_balancer(name=self.name,
zones=self.zones,
security_groups=self.security_group_ids,
complex_listeners=listeners,
subnets=self.subnets,
scheme=self.scheme)
if self.elb:
# HACK: Work around a boto bug in which the listeners attribute is
# always set to the listeners argument to create_load_balancer, and
# not the complex_listeners
# We're not doing a self.elb = self._get_elb here because there
# might be eventual consistency issues and it doesn't necessarily
# make sense to wait until the ELB gets returned from the EC2 API.
# This is necessary in the event we hit the throttling errors and
# need to retry ensure_ok
# See https://github.com/boto/boto/issues/3526
self.elb.listeners = self.listeners
self.changed = True
self.status = 'created'
def _create_elb_listeners(self, listeners):
"""Takes a list of listener tuples and creates them"""
# True if succeeds, exception raised if not
self.changed = self.elb_conn.create_load_balancer_listeners(self.name,
complex_listeners=listeners)
def _delete_elb_listeners(self, listeners):
"""Takes a list of listener tuples and deletes them from the elb"""
ports = [l[0] for l in listeners]
# True if succeeds, exception raised if not
self.changed = self.elb_conn.delete_load_balancer_listeners(self.name,
ports)
def _set_elb_listeners(self):
"""
Creates listeners specified by self.listeners; overwrites existing
listeners on these ports; removes extraneous listeners
"""
listeners_to_add = []
listeners_to_remove = []
listeners_to_keep = []
# Check for any listeners we need to create or overwrite
for listener in self.listeners:
listener_as_tuple = self._listener_as_tuple(listener)
# First we loop through existing listeners to see if one is
# already specified for this port
existing_listener_found = None
for existing_listener in self.elb.listeners:
# Since ELB allows only one listener on each incoming port, a
# single match on the incoming port is all we're looking for
if existing_listener[0] == int(listener['load_balancer_port']):
existing_listener_found = self._api_listener_as_tuple(existing_listener)
break
if existing_listener_found:
# Does it match exactly?
if listener_as_tuple != existing_listener_found:
# The ports are the same but something else is different,
# so we'll remove the existing one and add the new one
listeners_to_remove.append(existing_listener_found)
listeners_to_add.append(listener_as_tuple)
else:
# We already have this listener, so we're going to keep it
listeners_to_keep.append(existing_listener_found)
else:
# We didn't find an existing listener, so just add the new one
listeners_to_add.append(listener_as_tuple)
# Check for any extraneous listeners we need to remove, if desired
if self.purge_listeners:
for existing_listener in self.elb.listeners:
existing_listener_tuple = self._api_listener_as_tuple(existing_listener)
if existing_listener_tuple in listeners_to_remove:
# Already queued for removal
continue
if existing_listener_tuple in listeners_to_keep:
# Keep this one around
continue
# Since we're not already removing it and we don't need to keep
# it, let's get rid of it
listeners_to_remove.append(existing_listener_tuple)
if listeners_to_remove:
self._delete_elb_listeners(listeners_to_remove)
if listeners_to_add:
self._create_elb_listeners(listeners_to_add)
def _api_listener_as_tuple(self, listener):
"""Adds ssl_certificate_id to ELB API tuple if present"""
base_tuple = listener.get_complex_tuple()
if listener.ssl_certificate_id and len(base_tuple) < 5:
return base_tuple + (listener.ssl_certificate_id,)
return base_tuple
def _listener_as_tuple(self, listener):
"""Formats listener as a 4- or 5-tuples, in the order specified by the
ELB API"""
# N.B. string manipulations on protocols below (str(), upper()) is to
# ensure format matches output from ELB API
listener_list = [
int(listener['load_balancer_port']),
int(listener['instance_port']),
str(listener['protocol'].upper()),
]
# Instance protocol is not required by ELB API; it defaults to match
# load balancer protocol. We'll mimic that behavior here
if 'instance_protocol' in listener:
listener_list.append(str(listener['instance_protocol'].upper()))
else:
listener_list.append(str(listener['protocol'].upper()))
if 'ssl_certificate_id' in listener:
listener_list.append(str(listener['ssl_certificate_id']))
return tuple(listener_list)
def _enable_zones(self, zones):
try:
self.elb.enable_zones(zones)
except boto.exception.BotoServerError as e:
if "Invalid Availability Zone" in e.error_message:
self.module.fail_json(msg=e.error_message)
else:
self.module.fail_json(msg="an unknown server error occurred, please try again later")
self.changed = True
def _disable_zones(self, zones):
try:
self.elb.disable_zones(zones)
except boto.exception.BotoServerError as e:
if "Invalid Availability Zone" in e.error_message:
self.module.fail_json(msg=e.error_message)
else:
self.module.fail_json(msg="an unknown server error occurred, please try again later")
self.changed = True
def _attach_subnets(self, subnets):
self.elb_conn.attach_lb_to_subnets(self.name, subnets)
self.changed = True
def _detach_subnets(self, subnets):
self.elb_conn.detach_lb_from_subnets(self.name, subnets)
self.changed = True
def _set_subnets(self):
"""Determine which subnets need to be attached or detached on the ELB"""
if self.subnets:
if self.purge_subnets:
subnets_to_detach = list(set(self.elb.subnets) - set(self.subnets))
subnets_to_attach = list(set(self.subnets) - set(self.elb.subnets))
else:
subnets_to_detach = None
subnets_to_attach = list(set(self.subnets) - set(self.elb.subnets))
if subnets_to_attach:
self._attach_subnets(subnets_to_attach)
if subnets_to_detach:
self._detach_subnets(subnets_to_detach)
def _set_zones(self):
"""Determine which zones need to be enabled or disabled on the ELB"""
if self.zones:
if self.purge_zones:
zones_to_disable = list(set(self.elb.availability_zones) -
set(self.zones))
zones_to_enable = list(set(self.zones) -
set(self.elb.availability_zones))
else:
zones_to_disable = None
zones_to_enable = list(set(self.zones) -
set(self.elb.availability_zones))
if zones_to_enable:
self._enable_zones(zones_to_enable)
# N.B. This must come second, in case it would have removed all zones
if zones_to_disable:
self._disable_zones(zones_to_disable)
def _set_security_groups(self):
if self.security_group_ids is not None and set(self.elb.security_groups) != set(self.security_group_ids):
self.elb_conn.apply_security_groups_to_lb(self.name, self.security_group_ids)
self.changed = True
def _set_health_check(self):
"""Set health check values on ELB as needed"""
if self.health_check:
# This just makes it easier to compare each of the attributes
# and look for changes. Keys are attributes of the current
# health_check; values are desired values of new health_check
health_check_config = {
"target": self._get_health_check_target(),
"timeout": self.health_check['response_timeout'],
"interval": self.health_check['interval'],
"unhealthy_threshold": self.health_check['unhealthy_threshold'],
"healthy_threshold": self.health_check['healthy_threshold'],
}
update_health_check = False
# The health_check attribute is *not* set on newly created
# ELBs! So we have to create our own.
if not self.elb.health_check:
self.elb.health_check = HealthCheck()
for attr, desired_value in health_check_config.items():
if getattr(self.elb.health_check, attr) != desired_value:
setattr(self.elb.health_check, attr, desired_value)
update_health_check = True
if update_health_check:
self.elb.configure_health_check(self.elb.health_check)
self.changed = True
def _check_attribute_support(self, attr):
return hasattr(boto.ec2.elb.attributes.LbAttributes(), attr)
def _set_cross_az_load_balancing(self):
attributes = self.elb.get_attributes()
if self.cross_az_load_balancing:
if not attributes.cross_zone_load_balancing.enabled:
self.changed = True
attributes.cross_zone_load_balancing.enabled = True
else:
if attributes.cross_zone_load_balancing.enabled:
self.changed = True
attributes.cross_zone_load_balancing.enabled = False
self.elb_conn.modify_lb_attribute(self.name, 'CrossZoneLoadBalancing',
attributes.cross_zone_load_balancing.enabled)
def _set_access_log(self):
attributes = self.elb.get_attributes()
if self.access_logs:
if 's3_location' not in self.access_logs:
self.module.fail_json(msg='s3_location information required')
access_logs_config = {
"enabled": True,
"s3_bucket_name": self.access_logs['s3_location'],
"s3_bucket_prefix": self.access_logs.get('s3_prefix', ''),
"emit_interval": self.access_logs.get('interval', 60),
}
update_access_logs_config = False
for attr, desired_value in access_logs_config.items():
if getattr(attributes.access_log, attr) != desired_value:
setattr(attributes.access_log, attr, desired_value)
update_access_logs_config = True
if update_access_logs_config:
self.elb_conn.modify_lb_attribute(self.name, 'AccessLog', attributes.access_log)
self.changed = True
elif attributes.access_log.enabled:
attributes.access_log.enabled = False
self.changed = True
self.elb_conn.modify_lb_attribute(self.name, 'AccessLog', attributes.access_log)
def _set_connection_draining_timeout(self):
attributes = self.elb.get_attributes()
if self.connection_draining_timeout is not None:
if not attributes.connection_draining.enabled or \
attributes.connection_draining.timeout != self.connection_draining_timeout:
self.changed = True
attributes.connection_draining.enabled = True
attributes.connection_draining.timeout = self.connection_draining_timeout
self.elb_conn.modify_lb_attribute(self.name, 'ConnectionDraining', attributes.connection_draining)
else:
if attributes.connection_draining.enabled:
self.changed = True
attributes.connection_draining.enabled = False
self.elb_conn.modify_lb_attribute(self.name, 'ConnectionDraining', attributes.connection_draining)
def _set_idle_timeout(self):
attributes = self.elb.get_attributes()
if self.idle_timeout is not None:
if attributes.connecting_settings.idle_timeout != self.idle_timeout:
self.changed = True
attributes.connecting_settings.idle_timeout = self.idle_timeout
self.elb_conn.modify_lb_attribute(self.name, 'ConnectingSettings', attributes.connecting_settings)
def _policy_name(self, policy_type):
return __file__.split('/')[-1].split('.')[0].replace('_', '-') + '-' + policy_type
def _create_policy(self, policy_param, policy_meth, policy):
getattr(self.elb_conn, policy_meth )(policy_param, self.elb.name, policy)
def _delete_policy(self, elb_name, policy):
self.elb_conn.delete_lb_policy(elb_name, policy)
def _update_policy(self, policy_param, policy_meth, policy_attr, policy):
self._delete_policy(self.elb.name, policy)
self._create_policy(policy_param, policy_meth, policy)
def _set_listener_policy(self, listeners_dict, policy=[]):
for listener_port in listeners_dict:
if listeners_dict[listener_port].startswith('HTTP'):
self.elb_conn.set_lb_policies_of_listener(self.elb.name, listener_port, policy)
def _set_stickiness_policy(self, elb_info, listeners_dict, policy, **policy_attrs):
for p in getattr(elb_info.policies, policy_attrs['attr']):
if str(p.__dict__['policy_name']) == str(policy[0]):
if str(p.__dict__[policy_attrs['dict_key']]) != str(policy_attrs['param_value'] or 0):
self._set_listener_policy(listeners_dict)
self._update_policy(policy_attrs['param_value'], policy_attrs['method'], policy_attrs['attr'], policy[0])
self.changed = True
break
else:
self._create_policy(policy_attrs['param_value'], policy_attrs['method'], policy[0])
self.changed = True
self._set_listener_policy(listeners_dict, policy)
def select_stickiness_policy(self):
if self.stickiness:
if 'cookie' in self.stickiness and 'expiration' in self.stickiness:
self.module.fail_json(msg='\'cookie\' and \'expiration\' can not be set at the same time')
elb_info = self.elb_conn.get_all_load_balancers(self.elb.name)[0]
d = {}
for listener in elb_info.listeners:
d[listener[0]] = listener[2]
listeners_dict = d
if self.stickiness['type'] == 'loadbalancer':
policy = []
policy_type = 'LBCookieStickinessPolicyType'
if self.module.boolean(self.stickiness['enabled']):
if 'expiration' not in self.stickiness:
self.module.fail_json(msg='expiration must be set when type is loadbalancer')
expiration = self.stickiness['expiration'] if self.stickiness['expiration'] is not 0 else None
policy_attrs = {
'type': policy_type,
'attr': 'lb_cookie_stickiness_policies',
'method': 'create_lb_cookie_stickiness_policy',
'dict_key': 'cookie_expiration_period',
'param_value': expiration
}
policy.append(self._policy_name(policy_attrs['type']))
self._set_stickiness_policy(elb_info, listeners_dict, policy, **policy_attrs)
elif not self.module.boolean(self.stickiness['enabled']):
if len(elb_info.policies.lb_cookie_stickiness_policies):
if elb_info.policies.lb_cookie_stickiness_policies[0].policy_name == self._policy_name(policy_type):
self.changed = True
else:
self.changed = False
self._set_listener_policy(listeners_dict)
self._delete_policy(self.elb.name, self._policy_name(policy_type))
elif self.stickiness['type'] == 'application':
policy = []
policy_type = 'AppCookieStickinessPolicyType'
if self.module.boolean(self.stickiness['enabled']):
if 'cookie' not in self.stickiness:
self.module.fail_json(msg='cookie must be set when type is application')
policy_attrs = {
'type': policy_type,
'attr': 'app_cookie_stickiness_policies',
'method': 'create_app_cookie_stickiness_policy',
'dict_key': 'cookie_name',
'param_value': self.stickiness['cookie']
}
policy.append(self._policy_name(policy_attrs['type']))
self._set_stickiness_policy(elb_info, listeners_dict, policy, **policy_attrs)
elif not self.module.boolean(self.stickiness['enabled']):
if len(elb_info.policies.app_cookie_stickiness_policies):
if elb_info.policies.app_cookie_stickiness_policies[0].policy_name == self._policy_name(policy_type):
self.changed = True
self._set_listener_policy(listeners_dict)
self._delete_policy(self.elb.name, self._policy_name(policy_type))
else:
self._set_listener_policy(listeners_dict)
def _get_backend_policies(self):
"""Get a list of backend policies"""
policies = []
if self.elb.backends is not None:
for backend in self.elb.backends:
if backend.policies is not None:
for policy in backend.policies:
policies.append(str(backend.instance_port) + ':' + policy.policy_name)
return policies
def _set_backend_policies(self):
"""Sets policies for all backends"""
ensure_proxy_protocol = False
replace = []
backend_policies = self._get_backend_policies()
# Find out what needs to be changed
for listener in self.listeners:
want = False
if 'proxy_protocol' in listener and listener['proxy_protocol']:
ensure_proxy_protocol = True
want = True
if str(listener['instance_port']) + ':ProxyProtocol-policy' in backend_policies:
if not want:
replace.append({'port': listener['instance_port'], 'policies': []})
elif want:
replace.append({'port': listener['instance_port'], 'policies': ['ProxyProtocol-policy']})
# enable or disable proxy protocol
if ensure_proxy_protocol:
self._set_proxy_protocol_policy()
# Make the backend policies so
for item in replace:
self.elb_conn.set_lb_policies_of_backend_server(self.elb.name, item['port'], item['policies'])
self.changed = True
def _get_proxy_protocol_policy(self):
"""Find out if the elb has a proxy protocol enabled"""
if self.elb.policies is not None and self.elb.policies.other_policies is not None:
for policy in self.elb.policies.other_policies:
if policy.policy_name == 'ProxyProtocol-policy':
return policy.policy_name
return None
def _set_proxy_protocol_policy(self):
"""Install a proxy protocol policy if needed"""
proxy_policy = self._get_proxy_protocol_policy()
if proxy_policy is None:
self.elb_conn.create_lb_policy(
self.elb.name, 'ProxyProtocol-policy', 'ProxyProtocolPolicyType', {'ProxyProtocol': True}
)
self.changed = True
# TODO: remove proxy protocol policy if not needed anymore? There is no side effect to leaving it there
def _diff_list(self, a, b):
"""Find the entries in list a that are not in list b"""
b = set(b)
return [aa for aa in a if aa not in b]
def _get_instance_ids(self):
"""Get the current list of instance ids installed in the elb"""
instances = []
if self.elb.instances is not None:
for instance in self.elb.instances:
instances.append(instance.id)
return instances
def _set_instance_ids(self):
"""Register or deregister instances from an lb instance"""
assert_instances = self.instance_ids or []
has_instances = self._get_instance_ids()
add_instances = self._diff_list(assert_instances, has_instances)
if add_instances:
self.elb_conn.register_instances(self.elb.name, add_instances)
self.changed = True
if self.purge_instance_ids:
remove_instances = self._diff_list(has_instances, assert_instances)
if remove_instances:
self.elb_conn.deregister_instances(self.elb.name, remove_instances)
self.changed = True
def _set_tags(self):
"""Add/Delete tags"""
if self.tags is None:
return
params = {'LoadBalancerNames.member.1': self.name}
tagdict = dict()
# get the current list of tags from the ELB, if ELB exists
if self.elb:
current_tags = self.elb_conn.get_list('DescribeTags', params,
[('member', Tag)])
tagdict = dict((tag.Key, tag.Value) for tag in current_tags
if hasattr(tag, 'Key'))
# Add missing tags
dictact = dict(set(self.tags.items()) - set(tagdict.items()))
if dictact:
for i, key in enumerate(dictact):
params['Tags.member.%d.Key' % (i + 1)] = key
params['Tags.member.%d.Value' % (i + 1)] = dictact[key]
self.elb_conn.make_request('AddTags', params)
self.changed=True
# Remove extra tags
dictact = dict(set(tagdict.items()) - set(self.tags.items()))
if dictact:
for i, key in enumerate(dictact):
params['Tags.member.%d.Key' % (i + 1)] = key
self.elb_conn.make_request('RemoveTags', params)
self.changed=True
def _get_health_check_target(self):
"""Compose target string from healthcheck parameters"""
protocol = self.health_check['ping_protocol'].upper()
path = ""
if protocol in ['HTTP', 'HTTPS'] and 'ping_path' in self.health_check:
path = self.health_check['ping_path']
return "%s:%s%s" % (protocol, self.health_check['ping_port'], path)
def main():
argument_spec = ec2_argument_spec()
argument_spec.update(dict(
state={'required': True, 'choices': ['present', 'absent']},
name={'required': True},
listeners={'default': None, 'required': False, 'type': 'list'},
purge_listeners={'default': True, 'required': False, 'type': 'bool'},
instance_ids={'default': None, 'required': False, 'type': 'list'},
purge_instance_ids={'default': False, 'required': False, 'type': 'bool'},
zones={'default': None, 'required': False, 'type': 'list'},
purge_zones={'default': False, 'required': False, 'type': 'bool'},
security_group_ids={'default': None, 'required': False, 'type': 'list'},
security_group_names={'default': None, 'required': False, 'type': 'list'},
health_check={'default': None, 'required': False, 'type': 'dict'},
subnets={'default': None, 'required': False, 'type': 'list'},
purge_subnets={'default': False, 'required': False, 'type': 'bool'},
scheme={'default': 'internet-facing', 'required': False},
connection_draining_timeout={'default': None, 'required': False, 'type': 'int'},
idle_timeout={'default': None, 'type': 'int', 'required': False},
cross_az_load_balancing={'default': None, 'type': 'bool', 'required': False},
stickiness={'default': None, 'required': False, 'type': 'dict'},
access_logs={'default': None, 'required': False, 'type': 'dict'},
wait={'default': False, 'type': 'bool', 'required': False},
wait_timeout={'default': 60, 'type': 'int', 'required': False},
tags={'default': None, 'required': False, 'type': 'dict'}
)
)
module = AnsibleModule(
argument_spec=argument_spec,
mutually_exclusive = [['security_group_ids', 'security_group_names']]
)
if not HAS_BOTO:
module.fail_json(msg='boto required for this module')
region, ec2_url, aws_connect_params = get_aws_connection_info(module)
if not region:
module.fail_json(msg="Region must be specified as a parameter, in EC2_REGION or AWS_REGION environment variables or in boto configuration file")
name = module.params['name']
state = module.params['state']
listeners = module.params['listeners']
purge_listeners = module.params['purge_listeners']
instance_ids = module.params['instance_ids']
purge_instance_ids = module.params['purge_instance_ids']
zones = module.params['zones']
purge_zones = module.params['purge_zones']
security_group_ids = module.params['security_group_ids']
security_group_names = module.params['security_group_names']
health_check = module.params['health_check']
access_logs = module.params['access_logs']
subnets = module.params['subnets']
purge_subnets = module.params['purge_subnets']
scheme = module.params['scheme']
connection_draining_timeout = module.params['connection_draining_timeout']
idle_timeout = module.params['idle_timeout']
cross_az_load_balancing = module.params['cross_az_load_balancing']
stickiness = module.params['stickiness']
wait = module.params['wait']
wait_timeout = module.params['wait_timeout']
tags = module.params['tags']
if state == 'present' and not listeners:
module.fail_json(msg="At least one listener is required for ELB creation")
if state == 'present' and not (zones or subnets):
module.fail_json(msg="At least one availability zone or subnet is required for ELB creation")
if wait_timeout > 600:
module.fail_json(msg='wait_timeout maximum is 600 seconds')
if security_group_names:
security_group_ids = []
try:
ec2 = connect_to_aws(boto.ec2, region, **aws_connect_params)
if subnets: # We have at least one subnet, ergo this is a VPC
vpc_conn = _get_vpc_connection(module=module, region=region, aws_connect_params=aws_connect_params)
vpc_id = vpc_conn.get_all_subnets([subnets[0]])[0].vpc_id
filters = {'vpc_id': vpc_id}
else:
filters = None
grp_details = ec2.get_all_security_groups(filters=filters)
for group_name in security_group_names:
if isinstance(group_name, basestring):
group_name = [group_name]
group_id = [ str(grp.id) for grp in grp_details if str(grp.name) in group_name ]
security_group_ids.extend(group_id)
except boto.exception.NoAuthHandlerFound as e:
module.fail_json(msg = str(e))
elb_man = ElbManager(module, name, listeners, purge_listeners, zones,
purge_zones, security_group_ids, health_check,
subnets, purge_subnets, scheme,
connection_draining_timeout, idle_timeout,
cross_az_load_balancing,
access_logs, stickiness, wait, wait_timeout, tags,
region=region, instance_ids=instance_ids, purge_instance_ids=purge_instance_ids,
**aws_connect_params)
# check for unsupported attributes for this version of boto
if cross_az_load_balancing and not elb_man._check_attribute_support('cross_zone_load_balancing'):
module.fail_json(msg="You must install boto >= 2.18.0 to use the cross_az_load_balancing attribute")
if connection_draining_timeout and not elb_man._check_attribute_support('connection_draining'):
module.fail_json(msg="You must install boto >= 2.28.0 to use the connection_draining_timeout attribute")
if idle_timeout and not elb_man._check_attribute_support('connecting_settings'):
module.fail_json(msg="You must install boto >= 2.33.0 to use the idle_timeout attribute")
if state == 'present':
elb_man.ensure_ok()
elif state == 'absent':
elb_man.ensure_gone()
ansible_facts = {'ec2_elb': 'info'}
ec2_facts_result = dict(changed=elb_man.changed,
elb=elb_man.get_info(),
ansible_facts=ansible_facts)
module.exit_json(**ec2_facts_result)
if __name__ == '__main__':
main()
|
t0mk/ansible
|
lib/ansible/modules/cloud/amazon/ec2_elb_lb.py
|
Python
|
gpl-3.0
| 53,300
|
[
"Dalton"
] |
6ca92a85268403fc586cb53c2eba36a32abb1d10be8fd94a1376af88a9cf0cdb
|
import os
from __main__ import slicer
import qt, ctk
from SampleData import *
#
# BenderSampleData
#
# To add new data, edit the ui file to add case to the tree.
# and fill the corresponding information in the BenderSampleDataLogic
# download data dictionnary.
class BenderSampleData:
def __init__(self, parent):
import string
parent.title = "Bender Sample Data"
parent.categories = ["Informatics"]
#parent.dependencies = ["SampleData"]
parent.contributors = ["Johan Andruejol (Kitware), Julien Finet (Kitware)"]
parent.helpText = string.Template("""
This module can be used to download data for working with in Bender. The data is downloaded into the application
cache so it will be available directly next time.
Use of this module requires an active network connection.
See <a href=\"$a/Documentation/$b.$c/Modules/SampleData\">$a/Documentation/$b.$c/Modules/SampleData</a> for more information.
""").substitute({ 'a':'http://public.kitware.com/Wiki/Bender', 'b':1, 'c':1 })
parent.acknowledgementText = """
This work is supported by Air Force Research Laboratory (AFRL)
"""
self.parent = parent
# Look for sample's data action to replace it
self.triggerReplaceMenu()
def addMenu(self):
actionIcon = self.parent.icon
a = qt.QAction(actionIcon, 'Download Sample Data', slicer.util.mainWindow())
a.setToolTip('Go to the BenderSampleData module to download data from the network')
a.connect('triggered()', self.select)
menuFile = slicer.util.lookupTopLevelWidget('menuFile')
if menuFile:
for action in menuFile.actions():
if action.text == 'Save':
menuFile.insertAction(action,a)
def select(self):
m = slicer.util.mainWindow()
m.moduleSelector().selectModule('BenderSampleData')
def triggerReplaceMenu(self):
if not slicer.app.commandOptions().noMainWindow:
qt.QTimer.singleShot(0, self.addMenu);
#
# SampleData widget
#
class BenderSampleDataWidget:
def __init__(self, parent=None):
self.observerTags = []
if not parent:
self.parent = slicer.qMRMLWidget()
self.parent.setLayout(qt.QVBoxLayout())
self.parent.setMRMLScene(slicer.mrmlScene)
self.layout = self.parent.layout()
self.setup()
self.parent.show()
else:
self.parent = parent
self.layout = parent.layout()
def setup(self):
# UI setup
loader = qt.QUiLoader()
moduleName = 'BenderSampleData'
scriptedModulesPath = eval('slicer.modules.%s.path' % moduleName.lower())
scriptedModulesPath = os.path.dirname(scriptedModulesPath)
path = os.path.join(scriptedModulesPath, 'Resources', 'UI', '%s.ui' %moduleName)
qfile = qt.QFile(path)
qfile.open(qt.QFile.ReadOnly)
widget = loader.load(qfile, self.parent)
self.layout = self.parent.layout()
self.widget = widget;
self.layout.addWidget(widget)
# widget setup
self.log = self.get('BenderSampleDataLog')
self.logic = BenderSampleDataLogic(self.logMessage)
self.dataTree = self.get('BenderSampleDataTree')
self.dataTree.expandAll()
self.downloadDirectoryPathLineEdit = self.get('DownloadDirectoryPathLineEdit')
self.downloadDirectoryPathLineEdit.currentPath = qt.QDir.homePath()
self.get('BenderSampleDataDownloadPushButton').connect('clicked()', self.downloadCheckedItems)
def downloadCheckedItems(self):
items = self.modelMatch(
self.dataTree, self.dataTree.invisibleRootItem(), qt.Qt.CheckStateRole, qt.Qt.Checked, -1)
if len(items) < 1:
return
qt.QDir().mkpath( self.downloadDirectoryPathLineEdit.currentPath )
for item in items:
parent = self.getTopLevelItem(item)
if parent and item:
self.logic.download(parent.text(0),
item.text(0),
self.downloadDirectoryPathLineEdit.currentPath)
def getTopLevelItem(self, item):
if not item or not item.parent():
return item
return self.getTopLevelItem(item.parent())
def logMessage(self,message):
self.log.insertHtml(message)
self.log.insertPlainText('\n')
self.log.ensureCursorVisible()
self.log.repaint()
slicer.app.processEvents(qt.QEventLoop.ExcludeUserInputEvents)
### === Convenience python widget methods === ###
def get(self, objectName):
return self.findWidget(self.widget, objectName)
def getChildren(self, object):
'''Return the list of the children and grand children of a Qt object'''
children = object.children()
allChildren = list(children)
for child in children:
allChildren.extend( self.getChildren(child) )
return allChildren
def findWidget(self, widget, objectName):
if widget.objectName == objectName:
return widget
else:
children = []
for w in widget.children():
resulting_widget = self.findWidget(w, objectName)
if resulting_widget:
return resulting_widget
return None
def modelMatch(self, view, startItem, role, value, hits):
res = []
column = 0
if startItem.data(column, role) == value:
res.append(startItem)
hits = hits - 1
if hits == 0:
return res
for childRow in range(0, startItem.childCount()):
childItem = startItem.child(childRow)
childRes = self.modelMatch(view, childItem, role, value, hits)
res.extend(childRes)
return res
#
# Bender Sample Data Logic
#
class BenderSampleDataLogic( SampleDataLogic ):
"""Download the selected items. Use the logic of the sample data module."""
def __init__(self, logMessage=None):
SampleDataLogic.__init__(self, logMessage)
self.downloadData = (
{ 'Man 2mm Arm' :
{
'Volume' : ['man-arm-2mm', 'LabelmapFile', 'http://packages.kitware.com/download/item/3614/man-arm-2mm.mha', 'man-arm-2mm.mha'],
'Color table' : ['Tissues-v1.1.0', 'ColorTableFile', 'http://packages.kitware.com/download/item/3615/Tissues-v1.1.0.txt', 'Tissues-v1.1.0.txt'],
'Armature' : ['man-arm-2mm-armature', 'ArmatureFile', 'http://packages.kitware.com/download/item/3616/man-arm-2mm-armature.vtk', 'man-arm-2mm-armature.vtk'],
'Bones' : ['man-arm-2mm-Bones', 'ModelFile', 'http://packages.kitware.com/download/item/3959/man-arm-2mm-Bones.vtk', 'man-arm-2mm-Bones.vtk'],
'Skin' : ['man-arm-2mm-Skin', 'ModelFile', 'http://packages.kitware.com/download/item/3960/man-arm-2mm-Skin.vtk', 'man-arm-2mm-Skin.vtk'],
'Merged volume' : ['man-arm-2mm-merged', 'LabelmapFile', 'http://packages.kitware.com/download/item/3961/man-arm-2mm-merged.nrrd', 'man-arm-2mm-merged.nrrd'],
'Skinned volume' : ['man-arm-2mm-merged-skinned', 'LabelmapFile', 'http://packages.kitware.com/download/item/3618/man-arm-2mm-merged-skinned.mha', 'man-arm-2mm-merged-skinned.mha'],
'Posed volume' : ['man-arm-2mm-posed', 'LabelmapFile', 'http://packages.kitware.com/download/item/3619/man-arm-2mm-posed.mha', 'man-arm-2mm-posed.mha'],
},
# Add the tree item's download data here
})
def download(self, case, data, path):
filePath = self.downloadFile(self.downloadData[case][data][2],
path, self.downloadData[case][data][3])
#properties = {'name' : self.downloadData[case][data][0]}
#filetype = self.downloadData[case][data][1]
#if filetype == 'LabelmapFile':
#filetype = 'VolumeFile'
#properties['labelmap'] = True
#success, node = slicer.util.loadNodeFromFile(filePath, filetype, properties, returnNode=True)
#if success:
# self.logMessage('<b>Load finished</b>\n')
#else:
# self.logMessage('<b><font color="red">\tLoad failed!</font></b>\n')
#return node
def downloadData(self):
return self.downloadData
|
ricortiz/Bender
|
Modules/Scripted/Scripts/BenderSampleData.py
|
Python
|
apache-2.0
| 7,801
|
[
"VTK"
] |
acf4fd50809495a69bc13f4aae10247d811095612ebb31533f0cfa533382bd9d
|
# Functions for instrumental resolution corrections and area of illumination
# these are to be included in the Models class and Refl class
# Note that these function assumes a Gaussian spread in both the angular as well
# as in real space
# THis one really needs scipy
from scipy import *
from numpy import *
from scipy.special import erf
# Area correction
def GaussArea(alpha,s1,s2,sigma_x):
alpha=alpha*(abs(alpha)>1e-7)+1e-7*(abs(alpha)<=1e-7)
sinalpha=sin(alpha*pi/180)
A=sqrt(pi/2.0)*sigma_x*(erf(s2*sinalpha/sqrt(2.0)/sigma_x)+erf(s1*sinalpha/sqrt(2.0)/sigma_x))/sinalpha
return A
# Intensity correction Gaussian beamprofile
def GaussIntensity(alpha,s1,s2,sigma_x):
sinalpha=sin(alpha*pi/180)
return (erf(s2*sinalpha/sqrt(2.0)/sigma_x)+erf(s1*sinalpha/sqrt(2.0)/sigma_x))/2.0
# Diffuse correction: Area corr
def GaussDiffCorrection(alpha,s1,s2,sigma_x):
return GaussArea(alpha,s1,s2,sigma_x)*GaussIntensity(alpha,s1,s2,sigma_x)
# Specular foorprintcorrections square beamprofile
def SquareIntensity(alpha,slen,beamwidth):
F=slen/beamwidth*sin(alpha*pi/180)
return where(F<=1.0,F,ones(F.shape))
# Function to calculate the instrumental resolution in incomming, alpha, and
# outgoing, beta, directions
def ResVariance(alpha,beta,sigma_x,sigma_xp,samplewidth,slitwidth,DetGCdist):
alpha=alpha*pi/180.0
beta=beta*pi/180.0
sigma_sample2=samplewidth**2/12
sigma_slit2=slitwidth**2/12
sigma_t2=sigma_x**2*sigma_sample2*sin(beta)**2/(sigma_sample2*sin(alpha)**2+sigma_x**2)
sigma_beta=sqrt(sigma_slit2+sigma_t2)/DetGCdist
sigma_alpha=ones(beta.shape)*sigma_xp
return (sigma_alpha,sigma_beta)
# Function to convolve the tth scan with a gaussian for simulating
# the instrumental resolution
def SpecularRes(tth,I,sigma_alpha,sigma_beta,points):
# cutoff is between 0 and 1 and describes how much of the gaussian should
# be incorporated in the resolution
sigmainv2=(1/sigma_alpha**2+1/sigma_beta**2)/4
#print sigmainv2
#tthcutoff=max(sqrt(-2.0/sigmainv2*log(cutoff)))
dtth=arange(-points,points+1)*(tth[1]-tth[0])
Iconv=ones(I.shape)
resfunc=exp(-(dtth*pi/180.0)**2/2*min(sigmainv2))
resfunc=resfunc/sum(resfunc)
#print sum(resfunc)
Iconv=convolve(I,resfunc,mode=1)
return Iconv
####################################################################
## Resolution Functions (Normal Distributed=Gaussian)
#####################################################################
#Full Convlutions - vayring resolution
# Function to create a 1D vector for the resolution with the
# positions to calculate the reflectivity Qret and the weight
# of each point weight
# Inputs: Q - the Q values
# dQ - the resolution
# points - the number of points for the convolution
# range how far the gaussian should be convoluted
def ResolutionVector(Q,dQ,points,range=3):
#if type(dQ)!=type(array([])):
# dQ=dQ*ones(Q.shape)
Qstep=2*range*dQ/points
Qres=Q+(arange(points)-(points-1)/2)[:,newaxis]*Qstep
weight=1/sqrt(2*pi)/dQ*exp(-(transpose(Q[:,newaxis])-Qres)**2/(dQ)**2/2)
Qret = Qres.flatten()#reshape(Qres,(1,Qres.shape[0]*Qres.shape[1]))[0]
#print Qres
#print Qres.shape
#print Qret.shape
return (Qret,weight)
# Include the resolution with Qret and weight calculated from ResolutionVector
# and I the calculated intensity at each point. returns the intensity
def ConvoluteResolutionVector(Qret,I,weight):
Qret2 = Qret.reshape(weight.shape[0], weight.shape[1])
#print Qret.shape,weight.shape
I2 = I.reshape(weight.shape[0], weight.shape[1])
#print (I*weight).shape,Qret.shape
norm_fact = trapz(weight, x = Qret2, axis = 0)
Int = trapz(I2*weight, x = Qret2, axis = 0)/norm_fact
#print Int.shape
return Int
# Fast convlution - constant resolution
# constant spacing between data!
def ConvoluteFast(Q,I,dQ,range=3):
Qstep=Q[1]-Q[0]
resvector=arange(-range*dQ,range*dQ+Qstep,Qstep)
weight=1/sqrt(2*pi)/dQ*exp(-(resvector)**2/(dQ)**2/2)
Iconv=convolve(r_[ones(resvector.shape)*I[0],I,ones(resvector.shape)*I[-1]], weight/weight.sum(), mode=1)[resvector.shape[0]:-resvector.shape[0]]
return Iconv
# Fast convolution - varying resolution
# constant spacing between the dat.
def ConvoluteFastVar(Q,I,dQ,range=3):
Qstep = Q[1]-Q[0]
steps = max(dQ*ones(Q.shape))*range/Qstep
weight = 1/sqrt(2*pi)/dQ*exp(-(Q[:,newaxis]-Q)**2/(dQ)**2/2)
Itemp = I[:,newaxis]*ones(I.shape)
norm_fact = trapz(weight, axis = 0)
Int = trapz(Itemp*weight,axis = 0)/norm_fact
return Int
# Add functions for determining s1,s2,sigma_x,sigma_xp
|
haozhangphd/genx-py3
|
genx/models/lib/instrument.py
|
Python
|
gpl-3.0
| 4,675
|
[
"Gaussian"
] |
a6cce2ed05d61e85a097a5ea1be97f28c691343a5aacc83f3e220781535e1e7a
|
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2011 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., or visit: http://www.gnu.org/.
##
## Author(s): Stoq Team <stoq-devel@async.com.br>
##
"""Test pyflakes on stoq, stoqlib and plugins directories
Useful to early find syntax errors and other common problems.
"""
import unittest
import pep8
from .testutils import SourceTest
ERRORS = [
'E111', # indentation is not a multiple of four
'E112', # expected an indented block
'E113', # unexpected indentation
'E201', # whitespace after '{'
'E202', # whitespace before ')'
'E203', # whitespace before ':'
'E211', # whitespace before '('
'E221', # multiple spaces before operator
'E225', # missing whitespace around operator
'E231', # E231 missing whitespace after ','/':'
'E241', # multiple spaces after operator
'E251', # no spaces around keyword / parameter equals
'E262', # inline comment should start with '# '
'W291', # trailing whitespace
'W292', # no newline at end of file
'W293', # blank line contains whitespace
'E301', # expected 1 blank line, found 0
'E302', # expected 2 blank lines, found 1
'E303', # too many blank lines
'W391', # blank line at end of file
'E401', # multiple imports on one line
'W601', # in instead of dict.has_key
'W602', # deprecated form of raising exception
'W603', # '<>' is deprecated, use '!='"
'W604', # backticks are deprecated, use 'repr()'
'E701', # multiple statements on one line (colon)
'E702', # multiple statements on one line (semicolon)
]
class TestPEP8(SourceTest, unittest.TestCase):
def check_filename(self, root, filename):
pep8.process_options([
'--repeat',
'--select=%s' % (','.join(ERRORS), ),
filename
])
pep8.input_file(filename)
result = pep8.get_count()
if result:
raise AssertionError(
"ERROR: %d PEP8 errors in %s" % (result, filename, ))
suite = unittest.TestLoader().loadTestsFromTestCase(TestPEP8)
if __name__ == '__main__':
unittest.main()
|
laborautonomo/pyboleto
|
tests/test_pep8.py
|
Python
|
bsd-3-clause
| 2,862
|
[
"VisIt"
] |
0397b9c76af2d3404bf47496aa15d310c9f70f0b3ad925897067c7750c539bc1
|
#!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
#
# This example was built using Python2.7 and VTK6.3 on OSX
import vtk
# Input file and variable
filename = '../tests/input/block_vars_out.e'
varname = 'right_elemental'
# Read Exodus Data
reader = vtk.vtkExodusIIReader()
reader.SetFileName(filename)
reader.UpdateInformation()
reader.SetTimeStep(0)
reader.SetAllArrayStatus(vtk.vtkExodusIIReader.ELEM_BLOCK, 1)
reader.Update()
#print reader # uncomment this to show the file information
blk0 = reader.GetOutput().GetBlock(0).GetBlock(0)
data = vtk.vtkDoubleArray()
data.SetName(varname)
data.SetNumberOfTuples(blk0.GetCellData().GetArray(0).GetNumberOfTuples())
data.FillComponent(0, vtk.vtkMath.Nan())
blk0.GetCellData().AddArray(data)
lookup = vtk.vtkLookupTable()
lookup.SetNanColor(0.5, 0.5, 0.5, 1)
lookup.SetTableRange(0, 2)
# Create Geometry
geometry = vtk.vtkCompositeDataGeometryFilter()
geometry.SetInputConnection(0, reader.GetOutputPort(0))
geometry.Update()
# Mapper
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(geometry.GetOutputPort())
mapper.SelectColorArray(varname)
mapper.SetLookupTable(lookup)
mapper.UseLookupTableScalarRangeOn()
mapper.SetScalarModeToUseCellFieldData()
mapper.InterpolateScalarsBeforeMappingOn()
# Actor
actor = vtk.vtkActor()
actor.SetMapper(mapper)
# Renderer
renderer = vtk.vtkRenderer()
renderer.AddViewProp(actor)
# Window and Interactor
window = vtk.vtkRenderWindow()
window.AddRenderer(renderer)
window.SetSize(600, 600)
interactor = vtk.vtkRenderWindowInteractor()
interactor.SetRenderWindow(window)
interactor.Initialize()
# Show the result
window.Render()
interactor.Start()
|
nuclear-wizard/moose
|
python/chigger/vtk_scripts/elem_block.py
|
Python
|
lgpl-2.1
| 1,934
|
[
"MOOSE",
"VTK"
] |
a82ef042cc23a7c25d83c8e7c55bb67ff9fbd292a7bc113a0391d30298ea2453
|
import numpy as np
# functions and classes go here
def fb_alg(A_mat, O_mat, observ):
# set up
k = observ.size
(n,m) = O_mat.shape
prob_mat = np.zeros( (n,k) )
fw = np.zeros( (n,k+1) )
bw = np.zeros( (n,k+1) )
# forward part
fw[:, 0] = 1.0/n
for obs_ind in xrange(k):
f_row_vec = np.matrix(fw[:,obs_ind])
fw[:, obs_ind+1] = f_row_vec * \
np.matrix(A_mat) * \
np.matrix(np.diag(O_mat[:,observ[obs_ind]]))
fw[:,obs_ind+1] = fw[:,obs_ind+1]/np.sum(fw[:,obs_ind+1])
# backward part
bw[:,-1] = 1.0
for obs_ind in xrange(k, 0, -1):
b_col_vec = np.matrix(bw[:,obs_ind]).transpose()
bw[:, obs_ind-1] = (np.matrix(A_mat) * \
np.matrix(np.diag(O_mat[:,observ[obs_ind-1]])) * \
b_col_vec).transpose()
bw[:,obs_ind-1] = bw[:,obs_ind-1]/np.sum(bw[:,obs_ind-1])
# combine it
prob_mat = np.array(fw)*np.array(bw)
prob_mat = prob_mat/np.sum(prob_mat, 0)
# get out
return prob_mat, fw, bw
def baum_welch( num_states, num_obs, observ ):
# allocate
# A_mat = np.ones( (num_states, num_states) )
A_mat = np.random.random( (num_states, num_states) )
A_mat = A_mat / np.sum(A_mat,1)[:,None]
# O_mat = np.ones( (num_states, num_obs) )
O_mat = np.random.random( (num_states, num_obs) )
O_mat = O_mat / np.sum(O_mat,1)[:,None]
theta = np.zeros( (num_states, num_states, observ.size) )
while True:
old_A = A_mat
old_O = O_mat
A_mat = np.ones( (num_states, num_states) )
O_mat = np.ones( (num_states, num_obs) )
# A_mat = np.random.random( (num_states, num_states) )
# A_mat = A_mat / np.sum(A_mat,1)[:,None]
# O_mat = np.random.random( (num_states, num_obs) )
# O_mat = O_mat / np.sum(O_mat,1)[:,None]
# expectation step, forward and backward probs
P,F,B = fb_alg( old_A, old_O, observ)
# need to get transitional probabilities at each time step too
for a_ind in xrange(num_states):
for b_ind in xrange(num_states):
for t_ind in xrange(observ.size):
theta[a_ind,b_ind,t_ind] = \
F[a_ind,t_ind] * \
B[b_ind,t_ind+1] * \
old_A[a_ind,b_ind] * \
old_O[b_ind, observ[t_ind]]
# form A_mat and O_mat
for a_ind in xrange(num_states):
for b_ind in xrange(num_states):
A_mat[a_ind, b_ind] = np.sum( theta[a_ind, b_ind, :] )/ \
np.sum(P[a_ind,:])
A_mat = A_mat / np.sum(A_mat,1)
for a_ind in xrange(num_states):
for o_ind in xrange(num_obs):
right_obs_ind = np.array(np.where(observ == o_ind))+1
O_mat[a_ind, o_ind] = np.sum(P[a_ind,right_obs_ind])/ \
np.sum( P[a_ind,1:])
O_mat = O_mat / np.sum(O_mat,1)
# compare
if np.linalg.norm(old_A-A_mat) < .00001 and np.linalg.norm(old_O-O_mat) < .00001:
break
# get out
return A_mat, O_mat
import casino
num_obs = 100
g = casino.casino()
observations1 = [ 1 if g.next()[0].name == 'H' else 0 for x in xrange(num_obs) ]
observations1 = np.array(observations1)
# observations1 = np.random.randn( num_obs )
# observations1[observations1>0] = 1
# observations1[observations1<=0] = 0
# import pdb; pdb.set_trace()
A_mat, O_mat = baum_welch(2,2,observations1)
print "observation 1"
print observations1[:30]
print "trans"
print A_mat
print "emiss"
print O_mat
# observations2 = np.random.random(num_obs)
# observations2[observations2>.15] = 1
# observations2[observations2<=.85] = 0
# A_mat, O_mat = baum_welch(2,2,observations2)
# print "observations2"
# print observations2[:30]
# print A_mat
# print O_mat
# A_mat, O_mat = baum_welch(2,2,np.hstack( (observations1, observations2) ) )
# print A_mat
# print O_mat
|
karolciba/playground
|
markov/baumwelch.py
|
Python
|
unlicense
| 4,027
|
[
"CASINO"
] |
11dfceb50c4007cf27bc0e267b3fc4b836467f3db454d21252f1f9262a77a740
|
# (C) 2013, James Cammarata <jcammarata@ansible.com>
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import collections
import datetime
import functools
import hashlib
import json
import os
import stat
import tarfile
import time
import threading
from ansible import constants as C
from ansible.errors import AnsibleError
from ansible.galaxy.user_agent import user_agent
from ansible.module_utils.six import string_types
from ansible.module_utils.six.moves.urllib.error import HTTPError
from ansible.module_utils.six.moves.urllib.parse import quote as urlquote, urlencode, urlparse
from ansible.module_utils._text import to_bytes, to_native, to_text
from ansible.module_utils.urls import open_url, prepare_multipart
from ansible.utils.display import Display
from ansible.utils.hashing import secure_hash_s
from ansible.utils.path import makedirs_safe
try:
from urllib.parse import urlparse
except ImportError:
# Python 2
from urlparse import urlparse
display = Display()
_CACHE_LOCK = threading.Lock()
def cache_lock(func):
def wrapped(*args, **kwargs):
with _CACHE_LOCK:
return func(*args, **kwargs)
return wrapped
def g_connect(versions):
"""
Wrapper to lazily initialize connection info to Galaxy and verify the API versions required are available on the
endpoint.
:param versions: A list of API versions that the function supports.
"""
def decorator(method):
def wrapped(self, *args, **kwargs):
if not self._available_api_versions:
display.vvvv("Initial connection to galaxy_server: %s" % self.api_server)
# Determine the type of Galaxy server we are talking to. First try it unauthenticated then with Bearer
# auth for Automation Hub.
n_url = self.api_server
error_context_msg = 'Error when finding available api versions from %s (%s)' % (self.name, n_url)
if self.api_server == 'https://galaxy.ansible.com' or self.api_server == 'https://galaxy.ansible.com/':
n_url = 'https://galaxy.ansible.com/api/'
try:
data = self._call_galaxy(n_url, method='GET', error_context_msg=error_context_msg, cache=True)
except (AnsibleError, GalaxyError, ValueError, KeyError) as err:
# Either the URL doesnt exist, or other error. Or the URL exists, but isn't a galaxy API
# root (not JSON, no 'available_versions') so try appending '/api/'
if n_url.endswith('/api') or n_url.endswith('/api/'):
raise
# Let exceptions here bubble up but raise the original if this returns a 404 (/api/ wasn't found).
n_url = _urljoin(n_url, '/api/')
try:
data = self._call_galaxy(n_url, method='GET', error_context_msg=error_context_msg, cache=True)
except GalaxyError as new_err:
if new_err.http_code == 404:
raise err
raise
if 'available_versions' not in data:
raise AnsibleError("Tried to find galaxy API root at %s but no 'available_versions' are available "
"on %s" % (n_url, self.api_server))
# Update api_server to point to the "real" API root, which in this case could have been the configured
# url + '/api/' appended.
self.api_server = n_url
# Default to only supporting v1, if only v1 is returned we also assume that v2 is available even though
# it isn't returned in the available_versions dict.
available_versions = data.get('available_versions', {u'v1': u'v1/'})
if list(available_versions.keys()) == [u'v1']:
available_versions[u'v2'] = u'v2/'
self._available_api_versions = available_versions
display.vvvv("Found API version '%s' with Galaxy server %s (%s)"
% (', '.join(available_versions.keys()), self.name, self.api_server))
# Verify that the API versions the function works with are available on the server specified.
available_versions = set(self._available_api_versions.keys())
common_versions = set(versions).intersection(available_versions)
if not common_versions:
raise AnsibleError("Galaxy action %s requires API versions '%s' but only '%s' are available on %s %s"
% (method.__name__, ", ".join(versions), ", ".join(available_versions),
self.name, self.api_server))
return method(self, *args, **kwargs)
return wrapped
return decorator
def get_cache_id(url):
""" Gets the cache ID for the URL specified. """
url_info = urlparse(url)
port = None
try:
port = url_info.port
except ValueError:
pass # While the URL is probably invalid, let the caller figure that out when using it
# Cannot use netloc because it could contain credentials if the server specified had them in there.
return '%s:%s' % (url_info.hostname, port or '')
@cache_lock
def _load_cache(b_cache_path):
""" Loads the cache file requested if possible. The file must not be world writable. """
cache_version = 1
if not os.path.isfile(b_cache_path):
display.vvvv("Creating Galaxy API response cache file at '%s'" % to_text(b_cache_path))
with open(b_cache_path, 'w'):
os.chmod(b_cache_path, 0o600)
cache_mode = os.stat(b_cache_path).st_mode
if cache_mode & stat.S_IWOTH:
display.warning("Galaxy cache has world writable access (%s), ignoring it as a cache source."
% to_text(b_cache_path))
return
with open(b_cache_path, mode='rb') as fd:
json_val = to_text(fd.read(), errors='surrogate_or_strict')
try:
cache = json.loads(json_val)
except ValueError:
cache = None
if not isinstance(cache, dict) or cache.get('version', None) != cache_version:
display.vvvv("Galaxy cache file at '%s' has an invalid version, clearing" % to_text(b_cache_path))
cache = {'version': cache_version}
# Set the cache after we've cleared the existing entries
with open(b_cache_path, mode='wb') as fd:
fd.write(to_bytes(json.dumps(cache), errors='surrogate_or_strict'))
return cache
def _urljoin(*args):
return '/'.join(to_native(a, errors='surrogate_or_strict').strip('/') for a in args + ('',) if a)
class GalaxyError(AnsibleError):
""" Error for bad Galaxy server responses. """
def __init__(self, http_error, message):
super(GalaxyError, self).__init__(message)
self.http_code = http_error.code
self.url = http_error.geturl()
try:
http_msg = to_text(http_error.read())
err_info = json.loads(http_msg)
except (AttributeError, ValueError):
err_info = {}
url_split = self.url.split('/')
if 'v2' in url_split:
galaxy_msg = err_info.get('message', http_error.reason)
code = err_info.get('code', 'Unknown')
full_error_msg = u"%s (HTTP Code: %d, Message: %s Code: %s)" % (message, self.http_code, galaxy_msg, code)
elif 'v3' in url_split:
errors = err_info.get('errors', [])
if not errors:
errors = [{}] # Defaults are set below, we just need to make sure 1 error is present.
message_lines = []
for error in errors:
error_msg = error.get('detail') or error.get('title') or http_error.reason
error_code = error.get('code') or 'Unknown'
message_line = u"(HTTP Code: %d, Message: %s Code: %s)" % (self.http_code, error_msg, error_code)
message_lines.append(message_line)
full_error_msg = "%s %s" % (message, ', '.join(message_lines))
else:
# v1 and unknown API endpoints
galaxy_msg = err_info.get('default', http_error.reason)
full_error_msg = u"%s (HTTP Code: %d, Message: %s)" % (message, self.http_code, galaxy_msg)
self.message = to_native(full_error_msg)
# Keep the raw string results for the date. It's too complex to parse as a datetime object and the various APIs return
# them in different formats.
CollectionMetadata = collections.namedtuple('CollectionMetadata', ['namespace', 'name', 'created_str', 'modified_str'])
class CollectionVersionMetadata:
def __init__(self, namespace, name, version, download_url, artifact_sha256, dependencies):
"""
Contains common information about a collection on a Galaxy server to smooth through API differences for
Collection and define a standard meta info for a collection.
:param namespace: The namespace name.
:param name: The collection name.
:param version: The version that the metadata refers to.
:param download_url: The URL to download the collection.
:param artifact_sha256: The SHA256 of the collection artifact for later verification.
:param dependencies: A dict of dependencies of the collection.
"""
self.namespace = namespace
self.name = name
self.version = version
self.download_url = download_url
self.artifact_sha256 = artifact_sha256
self.dependencies = dependencies
@functools.total_ordering
class GalaxyAPI:
""" This class is meant to be used as a API client for an Ansible Galaxy server """
def __init__(
self, galaxy, name, url,
username=None, password=None, token=None, validate_certs=True,
available_api_versions=None,
clear_response_cache=False, no_cache=True,
priority=float('inf'),
):
self.galaxy = galaxy
self.name = name
self.username = username
self.password = password
self.token = token
self.api_server = url
self.validate_certs = validate_certs
self._available_api_versions = available_api_versions or {}
self._priority = priority
b_cache_dir = to_bytes(C.config.get_config_value('GALAXY_CACHE_DIR'), errors='surrogate_or_strict')
makedirs_safe(b_cache_dir, mode=0o700)
self._b_cache_path = os.path.join(b_cache_dir, b'api.json')
if clear_response_cache:
with _CACHE_LOCK:
if os.path.exists(self._b_cache_path):
display.vvvv("Clearing cache file (%s)" % to_text(self._b_cache_path))
os.remove(self._b_cache_path)
self._cache = None
if not no_cache:
self._cache = _load_cache(self._b_cache_path)
display.debug('Validate TLS certificates for %s: %s' % (self.api_server, self.validate_certs))
def __str__(self):
# type: (GalaxyAPI) -> str
"""Render GalaxyAPI as a native string representation."""
return to_native(self.name)
def __unicode__(self):
# type: (GalaxyAPI) -> unicode
"""Render GalaxyAPI as a unicode/text string representation."""
return to_text(self.name)
def __repr__(self):
# type: (GalaxyAPI) -> str
"""Render GalaxyAPI as an inspectable string representation."""
return (
'<{instance!s} "{name!s}" @ {url!s} with priority {priority!s}>'.
format(
instance=self, name=self.name,
priority=self._priority, url=self.api_server,
)
)
def __lt__(self, other_galaxy_api):
# type: (GalaxyAPI, GalaxyAPI) -> Union[bool, 'NotImplemented']
"""Return whether the instance priority is higher than other."""
if not isinstance(other_galaxy_api, self.__class__):
return NotImplemented
return (
self._priority > other_galaxy_api._priority or
self.name < self.name
)
@property
@g_connect(['v1', 'v2', 'v3'])
def available_api_versions(self):
# Calling g_connect will populate self._available_api_versions
return self._available_api_versions
def _call_galaxy(self, url, args=None, headers=None, method=None, auth_required=False, error_context_msg=None,
cache=False):
url_info = urlparse(url)
cache_id = get_cache_id(url)
if cache and self._cache:
server_cache = self._cache.setdefault(cache_id, {})
iso_datetime_format = '%Y-%m-%dT%H:%M:%SZ'
valid = False
if url_info.path in server_cache:
expires = datetime.datetime.strptime(server_cache[url_info.path]['expires'], iso_datetime_format)
valid = datetime.datetime.utcnow() < expires
if valid and not url_info.query:
# Got a hit on the cache and we aren't getting a paginated response
path_cache = server_cache[url_info.path]
if path_cache.get('paginated'):
if '/v3/' in url_info.path:
res = {'links': {'next': None}}
else:
res = {'next': None}
# Technically some v3 paginated APIs return in 'data' but the caller checks the keys for this so
# always returning the cache under results is fine.
res['results'] = []
for result in path_cache['results']:
res['results'].append(result)
else:
res = path_cache['results']
return res
elif not url_info.query:
# The cache entry had expired or does not exist, start a new blank entry to be filled later.
expires = datetime.datetime.utcnow()
expires += datetime.timedelta(days=1)
server_cache[url_info.path] = {
'expires': expires.strftime(iso_datetime_format),
'paginated': False,
}
headers = headers or {}
self._add_auth_token(headers, url, required=auth_required)
try:
display.vvvv("Calling Galaxy at %s" % url)
resp = open_url(to_native(url), data=args, validate_certs=self.validate_certs, headers=headers,
method=method, timeout=20, http_agent=user_agent(), follow_redirects='safe')
except HTTPError as e:
raise GalaxyError(e, error_context_msg)
except Exception as e:
raise AnsibleError("Unknown error when attempting to call Galaxy at '%s': %s" % (url, to_native(e)))
resp_data = to_text(resp.read(), errors='surrogate_or_strict')
try:
data = json.loads(resp_data)
except ValueError:
raise AnsibleError("Failed to parse Galaxy response from '%s' as JSON:\n%s"
% (resp.url, to_native(resp_data)))
if cache and self._cache:
path_cache = self._cache[cache_id][url_info.path]
# v3 can return data or results for paginated results. Scan the result so we can determine what to cache.
paginated_key = None
for key in ['data', 'results']:
if key in data:
paginated_key = key
break
if paginated_key:
path_cache['paginated'] = True
results = path_cache.setdefault('results', [])
for result in data[paginated_key]:
results.append(result)
else:
path_cache['results'] = data
return data
def _add_auth_token(self, headers, url, token_type=None, required=False):
# Don't add the auth token if one is already present
if 'Authorization' in headers:
return
if not self.token and required:
raise AnsibleError("No access token or username set. A token can be set with --api-key "
"or at {0}.".format(to_native(C.GALAXY_TOKEN_PATH)))
if self.token:
headers.update(self.token.headers())
@cache_lock
def _set_cache(self):
with open(self._b_cache_path, mode='wb') as fd:
fd.write(to_bytes(json.dumps(self._cache), errors='surrogate_or_strict'))
@g_connect(['v1'])
def authenticate(self, github_token):
"""
Retrieve an authentication token
"""
url = _urljoin(self.api_server, self.available_api_versions['v1'], "tokens") + '/'
args = urlencode({"github_token": github_token})
resp = open_url(url, data=args, validate_certs=self.validate_certs, method="POST", http_agent=user_agent())
data = json.loads(to_text(resp.read(), errors='surrogate_or_strict'))
return data
@g_connect(['v1'])
def create_import_task(self, github_user, github_repo, reference=None, role_name=None):
"""
Post an import request
"""
url = _urljoin(self.api_server, self.available_api_versions['v1'], "imports") + '/'
args = {
"github_user": github_user,
"github_repo": github_repo,
"github_reference": reference if reference else ""
}
if role_name:
args['alternate_role_name'] = role_name
elif github_repo.startswith('ansible-role'):
args['alternate_role_name'] = github_repo[len('ansible-role') + 1:]
data = self._call_galaxy(url, args=urlencode(args), method="POST")
if data.get('results', None):
return data['results']
return data
@g_connect(['v1'])
def get_import_task(self, task_id=None, github_user=None, github_repo=None):
"""
Check the status of an import task.
"""
url = _urljoin(self.api_server, self.available_api_versions['v1'], "imports")
if task_id is not None:
url = "%s?id=%d" % (url, task_id)
elif github_user is not None and github_repo is not None:
url = "%s?github_user=%s&github_repo=%s" % (url, github_user, github_repo)
else:
raise AnsibleError("Expected task_id or github_user and github_repo")
data = self._call_galaxy(url)
return data['results']
@g_connect(['v1'])
def lookup_role_by_name(self, role_name, notify=True):
"""
Find a role by name.
"""
role_name = to_text(urlquote(to_bytes(role_name)))
try:
parts = role_name.split(".")
user_name = ".".join(parts[0:-1])
role_name = parts[-1]
if notify:
display.display("- downloading role '%s', owned by %s" % (role_name, user_name))
except Exception:
raise AnsibleError("Invalid role name (%s). Specify role as format: username.rolename" % role_name)
url = _urljoin(self.api_server, self.available_api_versions['v1'], "roles",
"?owner__username=%s&name=%s" % (user_name, role_name))
data = self._call_galaxy(url)
if len(data["results"]) != 0:
return data["results"][0]
return None
@g_connect(['v1'])
def fetch_role_related(self, related, role_id):
"""
Fetch the list of related items for the given role.
The url comes from the 'related' field of the role.
"""
results = []
try:
url = _urljoin(self.api_server, self.available_api_versions['v1'], "roles", role_id, related,
"?page_size=50")
data = self._call_galaxy(url)
results = data['results']
done = (data.get('next_link', None) is None)
# https://github.com/ansible/ansible/issues/64355
# api_server contains part of the API path but next_link includes the /api part so strip it out.
url_info = urlparse(self.api_server)
base_url = "%s://%s/" % (url_info.scheme, url_info.netloc)
while not done:
url = _urljoin(base_url, data['next_link'])
data = self._call_galaxy(url)
results += data['results']
done = (data.get('next_link', None) is None)
except Exception as e:
display.warning("Unable to retrieve role (id=%s) data (%s), but this is not fatal so we continue: %s"
% (role_id, related, to_text(e)))
return results
@g_connect(['v1'])
def get_list(self, what):
"""
Fetch the list of items specified.
"""
try:
url = _urljoin(self.api_server, self.available_api_versions['v1'], what, "?page_size")
data = self._call_galaxy(url)
if "results" in data:
results = data['results']
else:
results = data
done = True
if "next" in data:
done = (data.get('next_link', None) is None)
while not done:
url = _urljoin(self.api_server, data['next_link'])
data = self._call_galaxy(url)
results += data['results']
done = (data.get('next_link', None) is None)
return results
except Exception as error:
raise AnsibleError("Failed to download the %s list: %s" % (what, to_native(error)))
@g_connect(['v1'])
def search_roles(self, search, **kwargs):
search_url = _urljoin(self.api_server, self.available_api_versions['v1'], "search", "roles", "?")
if search:
search_url += '&autocomplete=' + to_text(urlquote(to_bytes(search)))
tags = kwargs.get('tags', None)
platforms = kwargs.get('platforms', None)
page_size = kwargs.get('page_size', None)
author = kwargs.get('author', None)
if tags and isinstance(tags, string_types):
tags = tags.split(',')
search_url += '&tags_autocomplete=' + '+'.join(tags)
if platforms and isinstance(platforms, string_types):
platforms = platforms.split(',')
search_url += '&platforms_autocomplete=' + '+'.join(platforms)
if page_size:
search_url += '&page_size=%s' % page_size
if author:
search_url += '&username_autocomplete=%s' % author
data = self._call_galaxy(search_url)
return data
@g_connect(['v1'])
def add_secret(self, source, github_user, github_repo, secret):
url = _urljoin(self.api_server, self.available_api_versions['v1'], "notification_secrets") + '/'
args = urlencode({
"source": source,
"github_user": github_user,
"github_repo": github_repo,
"secret": secret
})
data = self._call_galaxy(url, args=args, method="POST")
return data
@g_connect(['v1'])
def list_secrets(self):
url = _urljoin(self.api_server, self.available_api_versions['v1'], "notification_secrets")
data = self._call_galaxy(url, auth_required=True)
return data
@g_connect(['v1'])
def remove_secret(self, secret_id):
url = _urljoin(self.api_server, self.available_api_versions['v1'], "notification_secrets", secret_id) + '/'
data = self._call_galaxy(url, auth_required=True, method='DELETE')
return data
@g_connect(['v1'])
def delete_role(self, github_user, github_repo):
url = _urljoin(self.api_server, self.available_api_versions['v1'], "removerole",
"?github_user=%s&github_repo=%s" % (github_user, github_repo))
data = self._call_galaxy(url, auth_required=True, method='DELETE')
return data
# Collection APIs #
@g_connect(['v2', 'v3'])
def publish_collection(self, collection_path):
"""
Publishes a collection to a Galaxy server and returns the import task URI.
:param collection_path: The path to the collection tarball to publish.
:return: The import task URI that contains the import results.
"""
display.display("Publishing collection artifact '%s' to %s %s" % (collection_path, self.name, self.api_server))
b_collection_path = to_bytes(collection_path, errors='surrogate_or_strict')
if not os.path.exists(b_collection_path):
raise AnsibleError("The collection path specified '%s' does not exist." % to_native(collection_path))
elif not tarfile.is_tarfile(b_collection_path):
raise AnsibleError("The collection path specified '%s' is not a tarball, use 'ansible-galaxy collection "
"build' to create a proper release artifact." % to_native(collection_path))
with open(b_collection_path, 'rb') as collection_tar:
sha256 = secure_hash_s(collection_tar.read(), hash_func=hashlib.sha256)
content_type, b_form_data = prepare_multipart(
{
'sha256': sha256,
'file': {
'filename': b_collection_path,
'mime_type': 'application/octet-stream',
},
}
)
headers = {
'Content-type': content_type,
'Content-length': len(b_form_data),
}
if 'v3' in self.available_api_versions:
n_url = _urljoin(self.api_server, self.available_api_versions['v3'], 'artifacts', 'collections') + '/'
else:
n_url = _urljoin(self.api_server, self.available_api_versions['v2'], 'collections') + '/'
resp = self._call_galaxy(n_url, args=b_form_data, headers=headers, method='POST', auth_required=True,
error_context_msg='Error when publishing collection to %s (%s)'
% (self.name, self.api_server))
return resp['task']
@g_connect(['v2', 'v3'])
def wait_import_task(self, task_id, timeout=0):
"""
Waits until the import process on the Galaxy server has completed or the timeout is reached.
:param task_id: The id of the import task to wait for. This can be parsed out of the return
value for GalaxyAPI.publish_collection.
:param timeout: The timeout in seconds, 0 is no timeout.
"""
state = 'waiting'
data = None
# Construct the appropriate URL per version
if 'v3' in self.available_api_versions:
full_url = _urljoin(self.api_server, self.available_api_versions['v3'],
'imports/collections', task_id, '/')
else:
full_url = _urljoin(self.api_server, self.available_api_versions['v2'],
'collection-imports', task_id, '/')
display.display("Waiting until Galaxy import task %s has completed" % full_url)
start = time.time()
wait = 2
while timeout == 0 or (time.time() - start) < timeout:
try:
data = self._call_galaxy(full_url, method='GET', auth_required=True,
error_context_msg='Error when getting import task results at %s' % full_url)
except GalaxyError as e:
if e.http_code != 404:
raise
# The import job may not have started, and as such, the task url may not yet exist
display.vvv('Galaxy import process has not started, wait %s seconds before trying again' % wait)
time.sleep(wait)
continue
state = data.get('state', 'waiting')
if data.get('finished_at', None):
break
display.vvv('Galaxy import process has a status of %s, wait %d seconds before trying again'
% (state, wait))
time.sleep(wait)
# poor man's exponential backoff algo so we don't flood the Galaxy API, cap at 30 seconds.
wait = min(30, wait * 1.5)
if state == 'waiting':
raise AnsibleError("Timeout while waiting for the Galaxy import process to finish, check progress at '%s'"
% to_native(full_url))
for message in data.get('messages', []):
level = message['level']
if level == 'error':
display.error("Galaxy import error message: %s" % message['message'])
elif level == 'warning':
display.warning("Galaxy import warning message: %s" % message['message'])
else:
display.vvv("Galaxy import message: %s - %s" % (level, message['message']))
if state == 'failed':
code = to_native(data['error'].get('code', 'UNKNOWN'))
description = to_native(
data['error'].get('description', "Unknown error, see %s for more details" % full_url))
raise AnsibleError("Galaxy import process failed: %s (Code: %s)" % (description, code))
@g_connect(['v2', 'v3'])
def get_collection_metadata(self, namespace, name):
"""
Gets the collection information from the Galaxy server about a specific Collection.
:param namespace: The collection namespace.
:param name: The collection name.
return: CollectionMetadata about the collection.
"""
if 'v3' in self.available_api_versions:
api_path = self.available_api_versions['v3']
field_map = [
('created_str', 'created_at'),
('modified_str', 'updated_at'),
]
else:
api_path = self.available_api_versions['v2']
field_map = [
('created_str', 'created'),
('modified_str', 'modified'),
]
info_url = _urljoin(self.api_server, api_path, 'collections', namespace, name, '/')
error_context_msg = 'Error when getting the collection info for %s.%s from %s (%s)' \
% (namespace, name, self.name, self.api_server)
data = self._call_galaxy(info_url, error_context_msg=error_context_msg)
metadata = {}
for name, api_field in field_map:
metadata[name] = data.get(api_field, None)
return CollectionMetadata(namespace, name, **metadata)
@g_connect(['v2', 'v3'])
def get_collection_version_metadata(self, namespace, name, version):
"""
Gets the collection information from the Galaxy server about a specific Collection version.
:param namespace: The collection namespace.
:param name: The collection name.
:param version: Version of the collection to get the information for.
:return: CollectionVersionMetadata about the collection at the version requested.
"""
api_path = self.available_api_versions.get('v3', self.available_api_versions.get('v2'))
url_paths = [self.api_server, api_path, 'collections', namespace, name, 'versions', version, '/']
n_collection_url = _urljoin(*url_paths)
error_context_msg = 'Error when getting collection version metadata for %s.%s:%s from %s (%s)' \
% (namespace, name, version, self.name, self.api_server)
data = self._call_galaxy(n_collection_url, error_context_msg=error_context_msg, cache=True)
self._set_cache()
return CollectionVersionMetadata(data['namespace']['name'], data['collection']['name'], data['version'],
data['download_url'], data['artifact']['sha256'],
data['metadata']['dependencies'])
@g_connect(['v2', 'v3'])
def get_collection_versions(self, namespace, name):
"""
Gets a list of available versions for a collection on a Galaxy server.
:param namespace: The collection namespace.
:param name: The collection name.
:return: A list of versions that are available.
"""
relative_link = False
if 'v3' in self.available_api_versions:
api_path = self.available_api_versions['v3']
pagination_path = ['links', 'next']
relative_link = True # AH pagination results are relative an not an absolute URI.
else:
api_path = self.available_api_versions['v2']
pagination_path = ['next']
versions_url = _urljoin(self.api_server, api_path, 'collections', namespace, name, 'versions', '/')
versions_url_info = urlparse(versions_url)
# We should only rely on the cache if the collection has not changed. This may slow things down but it ensures
# we are not waiting a day before finding any new collections that have been published.
if self._cache:
server_cache = self._cache.setdefault(get_cache_id(versions_url), {})
modified_cache = server_cache.setdefault('modified', {})
try:
modified_date = self.get_collection_metadata(namespace, name).modified_str
except GalaxyError as err:
if err.http_code != 404:
raise
# No collection found, return an empty list to keep things consistent with the various APIs
return []
cached_modified_date = modified_cache.get('%s.%s' % (namespace, name), None)
if cached_modified_date != modified_date:
modified_cache['%s.%s' % (namespace, name)] = modified_date
if versions_url_info.path in server_cache:
del server_cache[versions_url_info.path]
self._set_cache()
error_context_msg = 'Error when getting available collection versions for %s.%s from %s (%s)' \
% (namespace, name, self.name, self.api_server)
try:
data = self._call_galaxy(versions_url, error_context_msg=error_context_msg, cache=True)
except GalaxyError as err:
if err.http_code != 404:
raise
# v3 doesn't raise a 404 so we need to mimick the empty response from APIs that do.
return []
if 'data' in data:
# v3 automation-hub is the only known API that uses `data`
# since v3 pulp_ansible does not, we cannot rely on version
# to indicate which key to use
results_key = 'data'
else:
results_key = 'results'
versions = []
while True:
versions += [v['version'] for v in data[results_key]]
next_link = data
for path in pagination_path:
next_link = next_link.get(path, {})
if not next_link:
break
elif relative_link:
# TODO: This assumes the pagination result is relative to the root server. Will need to be verified
# with someone who knows the AH API.
next_link = versions_url.replace(versions_url_info.path, next_link)
data = self._call_galaxy(to_native(next_link, errors='surrogate_or_strict'),
error_context_msg=error_context_msg, cache=True)
self._set_cache()
return versions
|
s-hertel/ansible
|
lib/ansible/galaxy/api.py
|
Python
|
gpl-3.0
| 35,709
|
[
"Galaxy"
] |
2f1d5d4fb7f01f35279f64a996db43c8e6a0d5e58a70e4217cc41e17e3a89520
|
# class generated by DeVIDE::createDeVIDEModuleFromVTKObject
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
class vtkIdFilter(SimpleVTKClassModuleBase):
def __init__(self, module_manager):
SimpleVTKClassModuleBase.__init__(
self, module_manager,
vtk.vtkIdFilter(), 'Processing.',
('vtkDataSet',), ('vtkDataSet',),
replaceDoc=True,
inputFunctions=None, outputFunctions=None)
|
nagyistoce/devide
|
modules/vtk_basic/vtkIdFilter.py
|
Python
|
bsd-3-clause
| 475
|
[
"VTK"
] |
cfbb14b36a3f1a99a0960004b2f036351c138a88883dda0e362a002d52bca597
|
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
import re,os,json,urllib,urlparse
from resources.lib.modules import control
from resources.lib.modules import cleantitle
from resources.lib.modules import client
from resources.lib.modules import workers
class source:
def __init__(self):
self.domains = ['torba.se']
self.base_link = 'http://torba.se'
self.search_mv_link = '/movies/autocomplete?order=relevance&title=%s'
self.search_tv_link = '/series/autocomplete?order=relevance&title=%s'
self.tv_link = '/series/%s/%s/%s'
self.mv_link = '/v/%s'
def movie(self, imdb, title, year):
try:
query = self.search_mv_link % (urllib.quote_plus(title))
query = urlparse.urljoin(self.base_link, query)
r = client.request(query, headers={'X-Requested-With': 'XMLHttpRequest'})
r = json.loads(r)
t = cleantitle.get(title)
r = [(i['slug'], i['title'], i['year']) for i in r]
r = [i[0] for i in r if t == cleantitle.get(i[1]) and year == str(i[2])][0]
url = r.encode('utf-8')
return url
except:
return
def tvshow(self, imdb, tvdb, tvshowtitle, year):
try:
query = self.search_tv_link % (urllib.quote_plus(tvshowtitle))
query = urlparse.urljoin(self.base_link, query)
r = client.request(query, headers={'X-Requested-With': 'XMLHttpRequest'})
r = json.loads(r)
t = cleantitle.get(tvshowtitle)
r = [(i['slug'], i['title'], i['year']) for i in r]
r = [i[0] for i in r if t == cleantitle.get(i[1]) and year == str(i[2])][0]
url = r.encode('utf-8')
return url
except:
return
def episode(self, url, imdb, tvdb, title, premiered, season, episode):
if url == None: return
url = '%s/%01d/%01d' % (url, int(season), int(episode))
url = url.encode('utf-8')
return url
def sources(self, url, hostDict, hostprDict):
try:
sources = []
if url == None: return sources
try: url = self.tv_link % re.findall('(.+?)/(\d*)/(\d*)$', url)[0]
except: url = self.mv_link % url
url = urlparse.urljoin(self.base_link, url)
r = client.request(url)
url = client.parseDOM(r, 'a', ret='href', attrs = {'class': 'video-play.+?'})[0]
url = re.findall('(?://|\.)streamtorrent\.tv/.+?/([0-9a-zA-Z/]+)', url)[0]
u = 'https://streamtorrent.tv/api/torrent/%s.json' % url
r = client.request(u)
r = json.loads(r)
r = [i for i in r['files'] if 'streams' in i and len(i['streams']) > 0][0]
r = [{'height': i['height'], 'stream_id': r['_id'], 'vid_id': url} for i in r['streams']]
links = []
links += [{'quality': '1080p', 'url': urllib.urlencode(i)} for i in r if int(i['height']) >= 1080]
links += [{'quality': 'HD', 'url': urllib.urlencode(i)} for i in r if 720 <= int(i['height']) < 1080]
links += [{'quality': 'SD', 'url': urllib.urlencode(i)} for i in r if int(i['height']) <= 720]
links = links[:3]
for i in links: sources.append({'source': 'cdn', 'quality': i['quality'], 'provider': 'Torba', 'url': i['url'], 'direct': True, 'debridonly': False, 'autoplay': False})
return sources
except:
return sources
def resolve(self, url):
try:
m3u8 = [
'#EXTM3U',
'#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",DEFAULT=YES,AUTOSELECT=YES,NAME="Stream 1",URI="{audio_stream}"',
'',
'#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=0,NAME="{stream_name}",AUDIO="audio"',
'{video_stream}'
]
query = urlparse.parse_qs(url)
query = dict([(key, query[key][0]) if query[key] else (key, '') for key in query])
auth = 'http://streamtorrent.tv/api/torrent/%s/%s.m3u8?json=true' % (query['vid_id'], query['stream_id'])
r = client.request(auth)
r = json.loads(r)
try: url = r['url']
except: url = None
if not url == None:
def dialog(url):
try: self.disableScraper = control.yesnoDialog('To watch this video visit from any device', '[COLOR skyblue]%s[/COLOR]' % url, '', 'Torba', 'Cancel', 'Settings')
except: pass
workers.Thread(dialog, url).start()
control.sleep(3000)
for i in range(100):
try:
if not control.condVisibility('Window.IsActive(yesnoDialog)'): break
r = client.request(auth)
r = json.loads(r)
try: url = r['url']
except: url = None
if url == None: break
workers.Thread(dialog, url).start()
control.sleep(3000)
except:
pass
if self.disableScraper:
control.openSettings(query='2.0')
return ''
control.execute('Dialog.Close(yesnoDialog)')
if not url == None: return
stream_name = '%sp' % (query['height'])
video_stream = r[stream_name]
if not 'audio' in r: return video_stream
audio_stream = r['audio']
content = ('\n'.join(m3u8)).format(**{'audio_stream': audio_stream, 'stream_name': stream_name, 'video_stream': video_stream})
path = os.path.join(control.dataPath, 'torbase.m3u8')
control.makeFile(control.dataPath) ; control.deleteFile(path)
file = control.openFile(path, 'w') ; file.write(content) ; file.close()
return path
except:
return
|
EdLogan18/logan-repository
|
plugin.video.exodus/resources/lib/sources/torba_mv_tv.py
|
Python
|
gpl-2.0
| 6,750
|
[
"VisIt"
] |
22901364f41db17ef07ac4e4499d806ffe3cdc9610628053154779f7217c47b9
|
#-*. coding: utf-8 -*-
## Copyright (c) 2008-2011, Noel O'Boyle; 2012, Adrià Cereto-Massagué; 2014, Maciej Wójcikowski;
## All rights reserved.
##
## This file is part of Cinfony.
## The contents are covered by the terms of the BSD license
## which is included in the file LICENSE_BSD.txt.
"""
rdkit - A Cinfony module for accessing the RDKit from CPython
Global variables:
Chem and AllChem - the underlying RDKit Python bindings
informats - a dictionary of supported input formats
outformats - a dictionary of supported output formats
descs - a list of supported descriptors
fps - a list of supported fingerprint types
forcefields - a list of supported forcefields
"""
import os
from copy import copy
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem, Draw
from rdkit.Chem import Descriptors
_descDict = dict(Descriptors.descList)
import rdkit.DataStructs
import rdkit.Chem.MACCSkeys
import rdkit.Chem.AtomPairs.Pairs
import rdkit.Chem.AtomPairs.Torsions
### ODDT ###
from rdkit.Chem.Lipinski import NumRotatableBonds
from rdkit.Chem.AllChem import ComputeGasteigerCharges
from rdkit.Chem.Pharm2D import Gobbi_Pharm2D,Generate
# PIL and Tkinter
try:
import Tkinter as tk
import Image as PIL
import ImageTk as PILtk
except:
PILtk = None
# Aggdraw
try:
import aggdraw
from rdkit.Chem.Draw import aggCanvas
except ImportError:
aggdraw = None
fps = ['rdkit', 'layered', 'maccs', 'atompairs', 'torsions', 'morgan']
"""A list of supported fingerprint types"""
descs = _descDict.keys()
"""A list of supported descriptors"""
_formats = {'smi': "SMILES",
'can': "Canonical SMILES",
'mol': "MDL MOL file",
'mol2': "Tripos MOL2 file",
'sdf': "MDL SDF file",
'inchi':"InChI",
'inchikey':"InChIKey"}
_notinformats = ['can', 'inchikey']
_notoutformats = ['mol2']
if not Chem.INCHI_AVAILABLE:
_notinformats += ['inchi']
_notoutformats += ['inchi', 'inchikey']
informats = dict([(_x, _formats[_x]) for _x in _formats if _x not in _notinformats])
"""A dictionary of supported input formats"""
outformats = dict([(_x, _formats[_x]) for _x in _formats if _x not in _notoutformats])
"""A dictionary of supported output formats"""
_forcefields = {'uff': AllChem.UFFOptimizeMolecule}
forcefields = _forcefields.keys()
"""A list of supported forcefields"""
def readfile(format, filename, *args, **kwargs):
"""Iterate over the molecules in a file.
Required parameters:
format - see the informats variable for a list of available
input formats
filename
You can access the first molecule in a file using the next() method
of the iterator:
mol = readfile("smi", "myfile.smi").next()
You can make a list of the molecules in a file using:
mols = list(readfile("smi", "myfile.smi"))
You can iterate over the molecules in a file as shown in the
following code snippet:
>>> atomtotal = 0
>>> for mol in readfile("sdf", "head.sdf"):
... atomtotal += len(mol.atoms)
...
>>> print atomtotal
43
"""
if not os.path.isfile(filename):
raise IOError, "No such file: '%s'" % filename
format = format.lower()
# Eagerly evaluate the supplier functions in order to report
# errors in the format and errors in opening the file.
# Then switch to an iterator...
if format=="sdf":
iterator = Chem.SDMolSupplier(filename, *args, **kwargs)
def sdf_reader():
for mol in iterator:
yield Molecule(mol)
return sdf_reader()
elif format=="mol":
def mol_reader():
yield Molecule(Chem.MolFromMolFile(filename, *args, **kwargs))
return mol_reader()
elif format=="pdb":
def mol_reader():
yield Molecule(Chem.MolFromPDBFile(filename, *args, **kwargs))
return mol_reader()
elif format=="mol2":
def mol_reader():
block = ''
for line in open(filename, 'r'):
if line.strip() == "@<TRIPOS>MOLECULE" and len(block) > 0:
yield Molecule(Chem.MolFromMol2Block(block, *args, **kwargs))
block += line
# process last molecule
if len(block) > 0:
yield Molecule(Chem.MolFromMol2Block(block, *args, **kwargs))
return mol_reader()
elif format=="smi":
iterator = Chem.SmilesMolSupplier(filename, delimiter=" \t",
titleLine=False, *args, **kwargs)
def smi_reader():
for mol in iterator:
yield Molecule(mol)
return smi_reader()
elif format=='inchi' and Chem.INCHI_AVAILABLE:
def inchi_reader():
for line in open(filename, 'r'):
mol = Chem.inchi.MolFromInchi(line.strip(), *args, **kwargs)
yield Molecule(mol)
return inchi_reader()
else:
raise ValueError, "%s is not a recognised RDKit format" % format
def readstring(format, string):
"""Read in a molecule from a string.
Required parameters:
format - see the informats variable for a list of available
input formats
string
Example:
>>> input = "C1=CC=CS1"
>>> mymol = readstring("smi", input)
>>> len(mymol.atoms)
5
"""
format = format.lower()
if format=="mol":
mol = Chem.MolFromMolBlock(string)
elif format=="mol2":
mol = Chem.MolFromMol2Block(string)
elif format=="pdb":
mol = Chem.MolFromPDBBlock(string)
elif format=="smi":
mol = Chem.MolFromSmiles(string)
elif format=='inchi' and Chem.INCHI_AVAILABLE:
mol = Chem.inchi.MolFromInchi(string)
else:
raise ValueError,"%s is not a recognised RDKit format" % format
if mol:
return Molecule(mol)
else:
raise IOError, "Failed to convert '%s' to format '%s'" % (
string, format)
class Outputfile(object):
"""Represent a file to which *output* is to be sent.
Required parameters:
format - see the outformats variable for a list of available
output formats
filename
Optional parameters:
overwite -- if the output file already exists, should it
be overwritten? (default is False)
Methods:
write(molecule)
close()
"""
def __init__(self, format, filename, overwrite=False):
self.format = format
self.filename = filename
if not overwrite and os.path.isfile(self.filename):
raise IOError, "%s already exists. Use 'overwrite=True' to overwrite it." % self.filename
if format=="sdf":
self._writer = Chem.SDWriter(self.filename)
elif format=="smi":
self._writer = Chem.SmilesWriter(self.filename, isomericSmiles=True)
elif format in ('inchi', 'inchikey') and Chem.INCHI_AVAILABLE:
self._writer= open(filename, 'w')
else:
raise ValueError,"%s is not a recognised RDKit format" % format
self.total = 0 # The total number of molecules written to the file
def write(self, molecule):
"""Write a molecule to the output file.
Required parameters:
molecule
"""
if not self.filename:
raise IOError, "Outputfile instance is closed."
if self.format in ('inchi', 'inchikey'):
self._writer.write(molecule.write(self.format) +'\n')
else:
self._writer.write(molecule.Mol)
self.total += 1
def close(self):
"""Close the Outputfile to further writing."""
self.filename = None
self._writer.flush()
del self._writer
class Molecule(object):
"""Represent an rdkit Molecule.
Required parameter:
Mol -- an RDKit Mol or any type of cinfony Molecule
Attributes:
atoms, data, formula, molwt, title
Methods:
addh(), calcfp(), calcdesc(), draw(), localopt(), make3D(), removeh(),
write()
The underlying RDKit Mol can be accessed using the attribute:
Mol
"""
_cinfony = True
def __init__(self, Mol, protein = False):
if hasattr(Mol, "_cinfony"):
a, b = Mol._exchange
if a == 0:
molecule = readstring("smi", b)
else:
molecule = readstring("mol", b)
Mol = molecule.Mol
self.Mol = Mol
### ODDT ###
self.protein = protein
self._atom_dict = None
self._res_dict = None
self._ring_dict = None
self._coords = None
self._charges = None
@property
def atoms(self): return [Atom(rdkatom) for rdkatom in self.Mol.GetAtoms()]
@property
def data(self): return MoleculeData(self.Mol)
@property
def molwt(self): return Descriptors.MolWt(self.Mol)
@property
def formula(self): return Descriptors.MolecularFormula(self.Mol)
def _gettitle(self):
# Note to self: maybe should implement the get() method for self.data
if "_Name" in self.data:
return self.data["_Name"]
else:
return ""
def _settitle(self, val): self.Mol.SetProp("_Name", val)
title = property(_gettitle, _settitle)
@property
def _exchange(self):
if self.Mol.GetNumConformers() == 0:
return (0, self.write("smi"))
else:
return (1, self.write("mol"))
# cache frequently used properties and cache them in prefixed [_] variables
@property
def coords(self):
if self._coords is None:
self._coords = np.array([atom.coords for atom in self.atoms])
return self._coords
@property
def charges(self):
if self._charges is None:
self._charges = np.array([atom.partialcharge for atom in self.atoms])
return self._charges
#### Custom ODDT properties ####
@property
def sssr(self):
return [list(path) for path in list(Chem.GetSymmSSSR(self.Mol))]
@property
def num_rotors(self):
return NumRotatableBonds(self.Mol)
@property
def atom_dict(self):
# check cache and generate dicts
if self._atom_dict is None:
self._dicts()
return self._atom_dict
@property
def res_dict(self):
# check cache and generate dicts
if self._res_dict is None:
self._dicts()
return self._res_dict
@property
def ring_dict(self):
# check cache and generate dicts
if self._ring_dict is None:
self._dicts()
return self._ring_dict
@property
def clone(self):
return Molecule(copy(self.Mol))
def clone_coords(self, source):
self.Mol.RemoveAllConformers()
for conf in source.Mol.GetConformers():
self.Mol.AddConformer(conf)
return self
def _dicts(self):
# Atoms
atom_dtype = [('id', 'int16'),
# atom info
('coords', 'float16', 3),
('charge', 'float16'),
('atomicnum', 'int8'),
('atomtype','a4'),
('hybridization', 'int8'),
('neighbors', 'float16', (4,3)), # non-H neighbors coordinates for angles (max of 6 neighbors should be enough)
# residue info
('resid', 'int16'),
('resname', 'a3'),
('isbackbone', 'bool'),
# atom properties
('isacceptor', 'bool'),
('isdonor', 'bool'),
('isdonorh', 'bool'),
('ismetal', 'bool'),
('ishydrophobe', 'bool'),
('isaromatic', 'bool'),
('isminus', 'bool'),
('isplus', 'bool'),
('ishalogen', 'bool'),
# secondary structure
('isalpha', 'bool'),
('isbeta', 'bool')
]
a = []
atom_dict = np.empty(self.Mol.GetNumAtoms(), dtype=atom_dtype)
metals = [3,4,11,12,13,19,20,21,22,23,24,25,26,27,28,29,30,31,37,38,39,40,41,42,43,44,45,46,47,48,49,50,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,87,88,89,90,91,
92,93,94,95,96,97,98,99,100,101,102,103]
for i, atom in enumerate(self.atoms):
atomicnum = atom.atomicnum
partialcharge = atom.partialcharge
coords = atom.coords
atomtype = atom.Atom.GetProp("_TriposAtomType") if atom.Atom.HasProp("_TriposAtomType") else atom.Atom.GetSymbol()
# if self.protein:
# residue = pybel.Residue(atom.OBAtom.GetResidue())
# else:
# residue = False
residue = None
# get neighbors, but only for those atoms which realy need them
neighbors = np.empty(4, dtype=[('coords', 'float16', 3),('atomicnum', 'int8')])
neighbors.fill(np.nan)
for n, nbr_atom in enumerate(atom.neighbors):
neighbors[n] = (nbr_atom.coords, nbr_atom.atomicnum)
atom_dict[i] = (atom.idx,
coords,
partialcharge,
atomicnum,
atomtype,
atom.Atom.GetHybridization(),
neighbors['coords'],
# residue info
residue.idx if residue else 0,
residue.name if residue else '',
False, #residue.OBResidue.GetAtomProperty(atom.OBAtom, 2) if residue else False, # is backbone
# atom properties
False, #atom.OBAtom.IsHbondAcceptor(),
False, #atom.OBAtom.IsHbondDonor(),
False, #atom.OBAtom.IsHbondDonorH(),
atomicnum in metals,
atomicnum == 6 and not (np.in1d(neighbors['atomicnum'], [6,1])).any(), #hydrophobe #doble negation, since nan gives False
atom.Atom.GetIsAromatic(),
atomtype in ['O3-', '02-' 'O-'], # is charged (minus)
atomtype in ['N3+', 'N2+', 'Ng+'], # is charged (plus)
atomicnum in [9,17,35,53], # is halogen?
False, # alpha
False # beta
)
# if self.protein:
# # Protein Residues (alpha helix and beta sheet)
# res_dtype = [('id', 'int16'),
# ('resname', 'a3'),
# ('N', 'float16', 3),
# ('CA', 'float16', 3),
# ('C', 'float16', 3),
# ('isalpha', 'bool'),
# ('isbeta', 'bool')
# ] # N, CA, C
# b = []
# for residue in self.residues:
# backbone = {}
# for atom in residue:
# if residue.OBResidue.GetAtomProperty(atom.OBAtom,1):
# if atom.atomicnum == 7:
# backbone['N'] = atom.coords
# elif atom.atomicnum == 6:
# if atom.type == 'C3':
# backbone['CA'] = atom.coords
# else:
# backbone['C'] = atom.coords
# if len(backbone.keys()) == 3:
# b.append((residue.idx, residue.name, backbone['N'], backbone['CA'], backbone['C'], False, False))
# res_dict = np.array(b, dtype=res_dtype)
#
# # detect secondary structure by phi and psi angles
# first = res_dict[:-1]
# second = res_dict[1:]
# psi = dihedral(first['N'], first['CA'], first['C'], second['N'])
# phi = dihedral(first['C'], second['N'], second['CA'], second['C'])
# # mark atoms belonging to alpha and beta
# res_mask_alpha = np.where(((phi > -145) & (phi < -35) & (psi > -70) & (psi < 50))) # alpha
# res_dict['isalpha'][res_mask_alpha] = True
# for i in res_dict[res_mask_alpha]['id']:
# atom_dict['isalpha'][atom_dict['resid'] == i] = True
# res_mask_beta = np.where(((phi >= -180) & (phi < -40) & (psi <= 180) & (psi > 90)) | ((phi >= -180) & (phi < -70) & (psi <= -165))) # beta
# res_dict['isbeta'][res_mask_beta] = True
# atom_dict['isbeta'][np.in1d(atom_dict['resid'], res_dict[res_mask_beta]['id'])] = True
# Aromatic Rings
r = []
for path in self.sssr:
if self.Mol.GetAtomWithIdx(path[0]).GetIsAromatic():
atom = atom_dict[atom_dict['id'] == path[0]]
coords = atom_dict[np.in1d(atom_dict['id'], path)]['coords']
centroid = coords.mean(axis=0)
# get vector perpendicular to ring
vector = np.cross(coords - np.vstack((coords[1:],coords[:1])), np.vstack((coords[1:],coords[:1])) - np.vstack((coords[2:],coords[:2]))).mean(axis=0) - centroid
r.append((centroid, vector, atom['isalpha'], atom['isbeta']))
ring_dict = np.array(r, dtype=[('centroid', 'float16', 3),('vector', 'float16', 3),('isalpha', 'bool'),('isbeta', 'bool'),])
self._atom_dict = atom_dict
self._ring_dict = ring_dict
if self.protein:
self._res_dict = res_dict
def addh(self):
"""Add hydrogens."""
self.Mol = Chem.AddHs(self.Mol)
def removeh(self):
"""Remove hydrogens."""
self.Mol = Chem.RemoveHs(self.Mol)
def write(self, format="smi", filename=None, overwrite=False):
"""Write the molecule to a file or return a string.
Optional parameters:
format -- see the informats variable for a list of available
output formats (default is "smi")
filename -- default is None
overwite -- if the output file already exists, should it
be overwritten? (default is False)
If a filename is specified, the result is written to a file.
Otherwise, a string is returned containing the result.
To write multiple molecules to the same file you should use
the Outputfile class.
"""
format = format.lower()
if filename:
if not overwrite and os.path.isfile(filename):
raise IOError, "%s already exists. Use 'overwrite=True' to overwrite it." % filename
if format=="smi":
result = Chem.MolToSmiles(self.Mol, isomericSmiles=True, canonical=False)
elif format=="can":
result = Chem.MolToSmiles(self.Mol, isomericSmiles=True, canonical=True)
elif format=="mol":
result = Chem.MolToMolBlock(self.Mol)
elif format=="pdb":
result = Chem.MolToPDBBlock(self.Mol)
elif format in ('inchi', 'inchikey') and Chem.INCHI_AVAILABLE:
result = Chem.inchi.MolToInchi(self.Mol)
if format == 'inchikey':
result = Chem.inchi.InchiToInchiKey(result)
else:
raise ValueError,"%s is not a recognised RDKit format" % format
if filename:
print >> open(filename, "w"), result
else:
return result
def __iter__(self):
"""Iterate over the Atoms of the Molecule.
This allows constructions such as the following:
for atom in mymol:
print atom
"""
return iter(self.atoms)
def __str__(self):
return self.write()
def calcdesc(self, descnames=[]):
"""Calculate descriptor values.
Optional parameter:
descnames -- a list of names of descriptors
If descnames is not specified, all available descriptors are
calculated. See the descs variable for a list of available
descriptors.
"""
if not descnames:
descnames = descs
ans = {}
for descname in descnames:
try:
desc = _descDict[descname]
except KeyError:
raise ValueError, "%s is not a recognised RDKit descriptor type" % descname
ans[descname] = desc(self.Mol)
return ans
def calcfp(self, fptype="rdkit", opt=None):
"""Calculate a molecular fingerprint.
Optional parameters:
fptype -- the fingerprint type (default is "rdkit"). See the
fps variable for a list of of available fingerprint
types.
opt -- a dictionary of options for fingerprints. Currently only used
for radius and bitInfo in Morgan fingerprints.
"""
if opt == None:
opt = {}
fptype = fptype.lower()
if fptype=="rdkit":
fp = Fingerprint(Chem.RDKFingerprint(self.Mol))
elif fptype=="layered":
fp = Fingerprint(Chem.LayeredFingerprint(self.Mol))
elif fptype=="maccs":
fp = Fingerprint(Chem.MACCSkeys.GenMACCSKeys(self.Mol))
elif fptype=="atompairs":
# Going to leave as-is. See Atom Pairs documentation.
fp = Chem.AtomPairs.Pairs.GetAtomPairFingerprintAsIntVect(self.Mol)
elif fptype=="torsions":
# Going to leave as-is.
fp = Chem.AtomPairs.Torsions.GetTopologicalTorsionFingerprintAsIntVect(self.Mol)
elif fptype == "morgan":
info = opt.get('bitInfo', None)
radius = opt.get('radius', 4)
fp = Fingerprint(Chem.rdMolDescriptors.GetMorganFingerprintAsBitVect(self.Mol,radius,bitInfo=info))
elif fptype == "pharm2d":
fp = Fingerprint(Generate.Gen2DFingerprint(self.Mol,Gobbi_Pharm2D.factory))
else:
raise ValueError, "%s is not a recognised RDKit Fingerprint type" % fptype
return fp
def draw(self, show=True, filename=None, update=False, usecoords=False):
"""Create a 2D depiction of the molecule.
Optional parameters:
show -- display on screen (default is True)
filename -- write to file (default is None)
update -- update the coordinates of the atoms to those
determined by the structure diagram generator
(default is False)
usecoords -- don't calculate 2D coordinates, just use
the current coordinates (default is False)
Aggdraw or Cairo is used for 2D depiction. Tkinter and
Python Imaging Library are required for image display.
"""
if not usecoords and update:
AllChem.Compute2DCoords(self.Mol)
usecoords = True
mol = Chem.Mol(self.Mol.ToBinary()) # Clone
if not usecoords:
AllChem.Compute2DCoords(mol)
if filename: # Note: overwrite is allowed
Draw.MolToFile(mol, filename)
if show:
if not tk:
errormessage = ("Tkinter or Python Imaging "
"Library not found, but is required for image "
"display. See installation instructions for "
"more information.")
raise ImportError(errormessage)
img = Draw.MolToImage(mol)
root = tk.Tk()
root.title((hasattr(self, "title") and self.title)
or self.__str__().rstrip())
frame = tk.Frame(root, colormap="new", visual='truecolor').pack()
imagedata = PILtk.PhotoImage(img)
label = tk.Label(frame, image=imagedata).pack()
quitbutton = tk.Button(root, text="Close", command=root.destroy).pack(fill=tk.X)
root.mainloop()
def localopt(self, forcefield = "uff", steps = 500):
"""Locally optimize the coordinates.
Optional parameters:
forcefield -- default is "uff". See the forcefields variable
for a list of available forcefields.
steps -- default is 500
If the molecule does not have any coordinates, make3D() is
called before the optimization.
"""
forcefield = forcefield.lower()
if self.Mol.GetNumConformers() == 0:
self.make3D(forcefield)
_forcefields[forcefield](self.Mol, maxIters = steps)
def make3D(self, forcefield = "uff", steps = 50):
"""Generate 3D coordinates.
Optional parameters:
forcefield -- default is "uff". See the forcefields variable
for a list of available forcefields.
steps -- default is 50
Once coordinates are generated, a quick
local optimization is carried out with 50 steps and the
UFF forcefield. Call localopt() if you want
to improve the coordinates further.
"""
forcefield = forcefield.lower()
success = AllChem.EmbedMolecule(self.Mol)
if success == -1: # Failed
success = AllChem.EmbedMolecule(self.Mol,
useRandomCoords = True)
if success == -1:
raise Error, "Embedding failed!"
self.localopt(forcefield, steps)
class Atom(object):
"""Represent an rdkit Atom.
Required parameters:
Atom -- an RDKit Atom
Attributes:
atomicnum, coords, formalcharge
The original RDKit Atom can be accessed using the attribute:
Atom
"""
def __init__(self, Atom):
self.Atom = Atom
@property
def atomicnum(self): return self.Atom.GetAtomicNum()
@property
def coords(self):
owningmol = self.Atom.GetOwningMol()
if owningmol.GetNumConformers() == 0:
raise AttributeError, "Atom has no coordinates (0D structure)"
idx = self.Atom.GetIdx()
atomcoords = owningmol.GetConformer().GetAtomPosition(idx)
return (atomcoords[0], atomcoords[1], atomcoords[2])
@property
def formalcharge(self): return self.Atom.GetFormalCharge()
### ODDT ###
@property
def idx(self):
return self.Atom.GetIdx()
@property
def neighbors(self):
return [Atom(a) for a in self.Atom.GetNeighbors()]
@property
def partialcharge(self):
if self.Atom.HasProp('_TriposPartialCharge'):
return float(self.Atom.GetProp('_TriposPartialCharge'))
if not self.Atom.HasProp('_GasteigerCharge'):
ComputeGasteigerCharges(self.Atom.GetOwningMol())
return float(self.Atom.GetProp('_GasteigerCharge').replace(',','.'))
def __str__(self):
if hasattr(self, "coords"):
return "Atom: %d (%.2f %.2f %.2f)" % (self.atomicnum, self.coords[0],
self.coords[1], self.coords[2])
else:
return "Atom: %d (no coords)" % (self.atomicnum)
class Smarts(object):
"""A Smarts Pattern Matcher
Required parameters:
smartspattern
Methods:
findall(molecule)
Example:
>>> mol = readstring("smi","CCN(CC)CC") # triethylamine
>>> smarts = Smarts("[#6][#6]") # Matches an ethyl group
>>> print smarts.findall(mol)
[(0, 1), (3, 4), (5, 6)]
The numbers returned are the indices (starting from 0) of the atoms
that match the SMARTS pattern. In this case, there are three matches
for each of the three ethyl groups in the molecule.
"""
def __init__(self,smartspattern):
"""Initialise with a SMARTS pattern."""
self.rdksmarts = Chem.MolFromSmarts(smartspattern)
if not self.rdksmarts:
raise IOError, "Invalid SMARTS pattern."
def findall(self,molecule):
"""Find all matches of the SMARTS pattern to a particular molecule.
Required parameters:
molecule
"""
return molecule.Mol.GetSubstructMatches(self.rdksmarts)
class MoleculeData(object):
"""Store molecule data in a dictionary-type object
Required parameters:
Mol -- an RDKit Mol
Methods and accessor methods are like those of a dictionary except
that the data is retrieved on-the-fly from the underlying Mol.
Example:
>>> mol = readfile("sdf", 'head.sdf').next()
>>> data = mol.data
>>> print data
{'Comment': 'CORINA 2.61 0041 25.10.2001', 'NSC': '1'}
>>> print len(data), data.keys(), data.has_key("NSC")
2 ['Comment', 'NSC'] True
>>> print data['Comment']
CORINA 2.61 0041 25.10.2001
>>> data['Comment'] = 'This is a new comment'
>>> for k,v in data.iteritems():
... print k, "-->", v
Comment --> This is a new comment
NSC --> 1
>>> del data['NSC']
>>> print len(data), data.keys(), data.has_key("NSC")
1 ['Comment'] False
"""
def __init__(self, Mol):
self._mol = Mol
def _testforkey(self, key):
if not key in self:
raise KeyError, "'%s'" % key
def keys(self):
return self._mol.GetPropNames()
def values(self):
return [self._mol.GetProp(x) for x in self.keys()]
def items(self):
return zip(self.keys(), self.values())
def __iter__(self):
return iter(self.keys())
def iteritems(self):
return iter(self.items())
def __len__(self):
return len(self.keys())
def __contains__(self, key):
return self._mol.HasProp(key)
def __delitem__(self, key):
self._testforkey(key)
self._mol.ClearProp(key)
def clear(self):
for key in self:
del self[key]
def has_key(self, key):
return key in self
def update(self, dictionary):
for k, v in dictionary.iteritems():
self[k] = v
def __getitem__(self, key):
self._testforkey(key)
return self._mol.GetProp(key)
def __setitem__(self, key, value):
self._mol.SetProp(key, str(value))
def __repr__(self):
return dict(self.iteritems()).__repr__()
class Fingerprint(object):
"""A Molecular Fingerprint.
Required parameters:
fingerprint -- a vector calculated by one of the fingerprint methods
Attributes:
fp -- the underlying fingerprint object
bits -- a list of bits set in the Fingerprint
Methods:
The "|" operator can be used to calculate the Tanimoto coeff. For example,
given two Fingerprints 'a', and 'b', the Tanimoto coefficient is given by:
tanimoto = a | b
"""
def __init__(self, fingerprint):
self.fp = fingerprint
def __or__(self, other):
return rdkit.DataStructs.FingerprintSimilarity(self.fp, other.fp)
def __getattr__(self, attr):
if attr == "bits":
# Create a bits attribute on-the-fly
return list(self.fp.GetOnBits())
else:
raise AttributeError, "Fingerprint has no attribute %s" % attr
def __str__(self):
return ", ".join([str(x) for x in _compressbits(self.fp)])
@property
def raw(self):
return np.array(self.fp)
def _compressbits(bitvector, wordsize=32):
"""Compress binary vector into vector of long ints.
This function is used by the Fingerprint class.
>>> _compressbits([0, 1, 0, 0, 0, 1], 2)
[2, 0, 2]
"""
ans = []
for start in range(0, len(bitvector), wordsize):
compressed = 0
for i in range(wordsize):
if i + start < len(bitvector) and bitvector[i + start]:
compressed += 2**i
ans.append(compressed)
return ans
if __name__=="__main__": #pragma: no cover
import doctest
doctest.testmod()
|
mwojcikowski/opendrugdiscovery
|
oddt/toolkits/rdk.py
|
Python
|
bsd-3-clause
| 31,908
|
[
"Pybel",
"RDKit"
] |
0ea256f1c9cd9c7fdd309e62970510183bc0a6f9e39254bfa804ce97bd1aaadc
|
# Copyright (c) 2005 Gavin E. Crooks <gec@threeplusone.com>
# Copyright (c) 2006, The Regents of the University of California, through
# Lawrence Berkeley National Laboratory (subject to receipt of any required
# approvals from the U.S. Dept. of Energy). All rights reserved.
# This software is distributed under the new BSD Open Source License.
# <http://www.opensource.org/licenses/bsd-license.html>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# (1) Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# (2) Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and or other materials provided with the distribution.
#
# (3) Neither the name of the University of California, Lawrence Berkeley
# National Laboratory, U.S. Dept. of Energy nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
""" Sequence file reading and writing.
Biological sequence data is stored and transmitted using a wide variety of
different file formats. This package provides convenient methods to read and
write several of these file fomats.
CoreBio is often capable of guessing the correct file type, either from the
file extension or the structure of the file:
>>> import corebio.seq_io
>>> afile = open("test_corebio/data/cap.fa")
>>> seqs = corebio.seq_io.read(afile)
Alternatively, each sequence file type has a separate module named FILETYPE_io
(e.g. fasta_io, clustal_io).
>>> import corebio.seq_io.fasta_io
>>> afile = open("test_corebio/data/cap.fa")
>>> seqs = corebio.seq_io.fasta_io.read( afile )
Sequence data can also be written back to files:
>>> fout = open("out.fa", "w")
>>> corebio.seq_io.fasta_io.write( fout, seqs )
Supported File Formats
----------------------
Module Name Extension read write features
---------------------------------------------------------------------------
array_io array, flatfile yes yes none
clustal_io clustalw aln yes yes
fasta_io fasta, Pearson fa yes yes none
genbank_io genbank gb yes
intelligenetics_io intelligenetics ig yes yes
msf_io msf msf yes
nbrf_io nbrf, pir pir yes
nexus_io nexus nexus yes
phylip_io phylip phy yes
plain_io plain, raw yes yes none
table_io table tbl yes yes none
Each IO module defines one or more of the following functions and variables:
read(afile, alphabet=None)
Read a file of sequence data and return a SeqList, a collection
of Seq's (Alphabetic strings) and features.
read_seq(afile, alphabet=None)
Read a single sequence from a file.
iter_seq(afile, alphabet =None)
Iterate over the sequences in a file.
index(afile, alphabet = None)
Instead of loading all of the sequences into memory, scan the file and
return an index map that will load sequences on demand. Typically not
implemented for formats with interleaved sequences.
write(afile, seqlist)
Write a collection of sequences to the specifed file.
write_seq(afile, seq)
Write one sequence to the file. Only implemented for non-interleaved,
headerless formats, such as fasta and plain.
example
A string containing a short example of the file format
names
A list of synonyms for the file format. E.g. for fasta_io, ( 'fasta',
'pearson', 'fa'). The first entry is the preferred format name.
extensions
A list of file name extensions used for this file format. e.g.
fasta_io.extensions is ('fa', 'fasta', 'fast', 'seq', 'fsa', 'fst', 'nt',
'aa','fna','mpfa'). The preferred or standard extension is first in the
list.
Attributes :
- formats -- Available seq_io format parsers
- format_names -- A map between format names and format parsers.
- format_extensions -- A map between filename extensions and parsers.
"""
# Dev. References :
#
# - http://iubio.bio.indiana.edu/soft/molbio/readseq/java/Readseq2-help.html
# - http://www.ebi.ac.uk/help/formats_frame.html
# - http://www.cmbi.kun.nl/bioinf/tools/crab_pir.html
# - http://bioperl.org/HOWTOs/html/SeqIO.html
# - http://emboss.sourceforge.net/docs/themes/SequenceFormats.html
# - http://www.cse.ucsc.edu/research/compbio/a2m-desc.html (a2m)
# - http://www.genomatix.de/online_help/help/sequence_formats.html
from __future__ import absolute_import
from ..seq import *
from . import (
clustal_io,
fasta_io,
msf_io,
nbrf_io,
nexus_io,
plain_io,
phylip_io,
# null_io,
stockholm_io,
intelligenetics_io,
table_io,
array_io,
genbank_io,
)
__all__ = [
'clustal_io',
'fasta_io',
'msf_io',
'nbrf_io',
'nexus_io',
'plain_io',
'phylip_io',
'null_io',
'stockholm_io',
'intelligenetics_io',
'table_io',
'array_io',
'genbank_io',
'read',
'formats',
'format_names',
'format_extensions',
]
formats = ( clustal_io, fasta_io, plain_io, msf_io, genbank_io,nbrf_io, nexus_io, phylip_io, stockholm_io, intelligenetics_io, table_io, array_io)
"""Available seq_io formats"""
def format_names() :
"""Return a map between format names and format modules"""
global formats
fnames = {}
for f in formats :
for name in f.names :
assert name not in fnames # Insanity check
fnames[name] = f
return fnames
def format_extensions() :
"""Return a map between filename extensions and sequence file types"""
global formats
fext = {}
for f in formats :
for ext in f.extensions :
assert ext not in fext # Insanity check
fext[ext] = f
return fext
# seq_io._parsers is an ordered list of sequence parsers that are tried, in
# turn, on files of unknown format. Each parser must raise an exception when
# fed a format further down the list.
#
# The general trend is most common to least common file format. However,
# 'nbrf_io' is before 'fasta_io' because nbrf looks like fasta with extras, and
# 'array_io' is last, since it is very general.
_parsers = (nbrf_io, fasta_io, clustal_io, phylip_io, genbank_io, stockholm_io, msf_io, nexus_io, table_io, array_io)
def _get_parsers(fin) :
global _parsers
fnames = format_names()
fext = format_extensions()
parsers = list(_parsers)
best_guess = parsers[0]
# If a filename is supplied use the extension to guess the format.
if hasattr(fin, "name") and '.' in fin.name :
extension = fin.name.split('.')[-1]
if extension in fnames:
best_guess = fnames[extension]
elif extension in fext :
best_guess = fext[extension]
if best_guess in parsers :
parsers.remove(best_guess)
parsers.insert(0,best_guess)
return parsers
def read(fin, alphabet=None) :
""" Read a sequence file and attempt to guess its format.
First the filename extension (if available) is used to infer the format.
If that fails, then we attempt to parse the file using several common
formats.
Note, fin cannot be unseekable stream such as sys.stdin
returns :
SeqList
raises :
ValueError - If the file cannot be parsed.
ValueError - Sequence do not conform to the alphabet.
"""
alphabet = Alphabet(alphabet)
parsers = _get_parsers(fin)
for p in parsers :
fin.seek(0)
try:
return p.read(fin, alphabet)
except ValueError:
pass
names = ", ".join([ p.names[0] for p in parsers])
raise ValueError("Cannot parse sequence file: Tried %s " % names)
|
go-bears/Final-Project
|
weblogo-3.4_rd/corebio/seq_io/__init__.py
|
Python
|
mit
| 8,995
|
[
"BioPerl"
] |
e40ed228f1bba4ad7612e02a1896d994d48e1460953923e5aed03c2c78866977
|
'''Tests for the examples in examples/gaussian_bayesian_networks'''
from bayesian.gaussian_bayesian_network import build_graph
from bayesian.examples.gaussian_bayesian_networks.river import (
f_a, f_b, f_c, f_d)
from bayesian.linear_algebra import zeros, Matrix
from bayesian.gaussian import MeansVector, CovarianceMatrix
def pytest_funcarg__river_graph(request):
g = build_graph(f_a, f_b, f_c, f_d)
return g
class TestRiverExample():
def test_get_joint_parameters(self, river_graph):
mu, sigma = river_graph.get_joint_parameters()
assert mu == MeansVector([
[3],
[4],
[9],
[14]], names=['a', 'b', 'c', 'd'])
assert sigma == CovarianceMatrix([
[4, 4, 8, 12],
[4, 5, 8, 13],
[8, 8, 20, 28],
[12, 13, 28, 42]], names=['a', 'b', 'c', 'd'])
def test_query(self, river_graph):
r = river_graph.query(a=7)
print r
|
kamijawa/ogc_server
|
bayesian/test/test_gbn_examples.py
|
Python
|
mit
| 969
|
[
"Gaussian"
] |
27a1b24e4b1bdf4da29dd75826883a6211f976ac68f50c10caad1172fba2e5b4
|
##########################################################################
#
# Copyright (c) 2015, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided with
# the distribution.
#
# * Neither the name of John Haddon nor the names of
# any other contributors to this software may be used to endorse or
# promote products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
##########################################################################
import ast
import IECore
import Gaffer
import GafferDispatch
class PythonCommand( GafferDispatch.TaskNode ) :
def __init__( self, name = "PythonCommand" ) :
GafferDispatch.TaskNode.__init__( self, name )
# Turn off automatic substitutions for the command, since it's a pain
# to have to manually escape things, and the context is available
# directly anyway.
self["command"] = Gaffer.StringPlug( substitutions = Gaffer.Context.Substitutions.NoSubstitutions )
self["variables"] = Gaffer.CompoundDataPlug()
self["sequence"] = Gaffer.BoolPlug()
def hash( self, context ) :
h = GafferDispatch.TaskNode.hash( self, context )
command = self["command"].getValue()
h.append( command )
parser = _Parser( command )
for name in parser.contextReads :
value = context.get( name )
if isinstance( value, IECore.Object ) :
value.hash( h )
else :
h.append( value )
self["variables"].hash( h )
if self.requiresSequenceExecution() :
h.append( context.getFrame() )
return h
def execute( self ) :
executionDict = self.__executionDict()
exec( self["command"].getValue(), executionDict, executionDict )
def executeSequence( self, frames ) :
if not self.requiresSequenceExecution() :
## \todo It'd be nice if the dispatcher didn't call
# executeSequence() if requiresSequenceExecution() was False.
# At the same time we could look into properly supporting
# varying results for requiresSequenceExecution(), with sequences
# going into their own batch independent of non-sequence batches.
Gaffer.TaskNode.executeSequence( self, frames )
return
executionDict = self.__executionDict( frames )
exec( self["command"].getValue(), executionDict, executionDict )
def requiresSequenceExecution( self ) :
return self["sequence"].getValue()
def __executionDict( self, frames = None ) :
result = {
"IECore" : IECore,
"Gaffer" : Gaffer,
"self" : self,
"context" : Gaffer.Context.current(),
"variables" : _VariablesDict(
self["variables"],
Gaffer.Context.current(),
validFrames = set( frames ) if frames is not None else { Gaffer.Context.current().getFrame() }
)
}
if frames is not None :
result["frames"] = frames
return result
class _VariablesDict( dict ) :
def __init__( self, variables, context, validFrames ) :
dict.__init__( self )
self.__variables = variables
self.__context = context
self.__validFrames = validFrames
self.__frame = None
def keys( self ) :
self.__update()
return dict.keys( self )
def __getitem__( self, key ) :
self.__update()
return dict.__getitem__( self, key )
def __update( self ) :
if self.__frame == self.__context.getFrame() :
return
if self.__context.getFrame() not in self.__validFrames :
raise ValueError( "Invalid frame" )
self.clear()
for plug in self.__variables.children() :
value, name = self.__variables.memberDataAndName( plug )
if value is None :
continue
with IECore.IgnoredExceptions( Exception ) :
value = value.value
self[name] = value
self.__frame = self.__context.getFrame()
class _Parser( ast.NodeVisitor ) :
def __init__( self, expression ) :
ast.NodeVisitor.__init__( self )
self.contextReads = set()
self.visit( ast.parse( expression ) )
def visit_Subscript( self, node ) :
if not isinstance( node.ctx, ast.Load ) or not isinstance( node.value, ast.Name ) :
return
if node.value.id != "context" :
return
if not isinstance( node.slice, ast.Index ) or not isinstance( node.slice.value, ast.Str ) :
return
self.contextReads.add( node.slice.value.s )
def visit_Call( self, node ) :
if isinstance( node.func, ast.Attribute ) :
if isinstance( node.func.value, ast.Name ) :
if node.func.value.id == "context" :
# it's a method call on the context
if node.func.attr == "getFrame" :
self.contextReads.add( "frame" )
elif node.func.attr == "getTime" :
self.contextReads.add( "frame" )
self.contextReads.add( "framesPerSecond" )
elif node.func.attr == "getFramesPerSecond" :
self.contextReads.add( "framesPerSecond" )
elif node.func.attr == "get" :
if not isinstance( node.args[0], ast.Str ) :
raise SyntaxError( "Context name must be a string" )
self.contextReads.add( node.args[0].s )
ast.NodeVisitor.generic_visit( self, node )
IECore.registerRunTimeTyped( PythonCommand, typeName = "GafferDispatch::PythonCommand" )
|
chippey/gaffer
|
python/GafferDispatch/PythonCommand.py
|
Python
|
bsd-3-clause
| 6,260
|
[
"VisIt"
] |
2d4f235ed76e7979155671fcbd8a7dc64629160cf6372cb8e6852f598676a526
|
import tkinter
from tkinter import filedialog
from tkinter import messagebox
from PIL import ImageTk
import PIL.Image
import os
import re
import cv2
import numpy as np
from isd_lib import utils
BACKGROUND_COLOR = '#ededed'
WINDOW_WIDTH = 990
WINDOW_HEIGHT = 720
PREVIEW_SIZE = 256 # height & width of preview in pixels
PAD_SMALL = 2
PAD_MEDIUM = 4
PAD_LARGE = 8
PAD_EXTRA_LARGE = 14
DEFAULT_ERODE_ITER = 0
DEFAULT_DILATE_ITER = 2
COLOR_NAMES = [
'red',
'yellow',
'green',
'cyan',
'blue',
'violet',
'white',
'gray',
'black'
]
class Application(tkinter.Frame):
def __init__(self, master):
tkinter.Frame.__init__(self, master=master)
self.image_name = None
self.image_dir = None
self.bg_colors = None
# Detected regions will be saved as a dictionary with the bounding
# rectangles canvas ID as the key. The value will be another dictionary
# containing the contour itself and the rectangle coordinates
self.regions = None
self.region_count = tkinter.IntVar()
self.region_min = tkinter.DoubleVar()
self.region_max = tkinter.DoubleVar()
self.region_avg = tkinter.DoubleVar()
self.master.minsize(width=WINDOW_WIDTH, height=WINDOW_HEIGHT)
self.master.title("Image Sub-region Detector")
self.main_frame = tkinter.Frame(self.master, bg=BACKGROUND_COLOR)
self.main_frame.pack(
fill=tkinter.BOTH,
expand=True,
padx=0,
pady=0
)
self.left_frame = tkinter.Frame(self.main_frame, bg=BACKGROUND_COLOR)
self.left_frame.pack(
fill=tkinter.BOTH,
expand=True,
side=tkinter.LEFT,
padx=0,
pady=0
)
self.right_frame = tkinter.Frame(self.main_frame, bg=BACKGROUND_COLOR)
self.right_frame.pack(
fill=tkinter.Y,
expand=False,
side=tkinter.LEFT,
padx=PAD_MEDIUM,
pady=PAD_MEDIUM
)
file_chooser_frame = tkinter.Frame(self.left_frame, bg=BACKGROUND_COLOR)
file_chooser_frame.pack(
fill=tkinter.X,
expand=False,
anchor=tkinter.N,
padx=PAD_MEDIUM,
pady=PAD_MEDIUM
)
file_chooser_button = tkinter.Button(
file_chooser_frame,
text='Choose Image File...',
command=self.choose_files
)
file_chooser_button.pack(side=tkinter.LEFT)
self.export_format = tkinter.StringVar()
self.export_format.set('numpy')
format_label = tkinter.Label(
file_chooser_frame,
text=" Export Format: ",
bg=BACKGROUND_COLOR
)
export_fmt_combo = tkinter.OptionMenu(
file_chooser_frame,
self.export_format,
"numpy",
"tiff",
"both"
)
export_fmt_combo.config(width=6)
export_fmt_combo.pack(side=tkinter.RIGHT)
format_label.pack(side=tkinter.RIGHT)
self.export_string = tkinter.StringVar()
snip_label = tkinter.Label(
file_chooser_frame,
text="Export Label: ",
bg=BACKGROUND_COLOR
)
snip_label_entry = tkinter.Entry(
file_chooser_frame,
textvariable=self.export_string
)
snip_label_entry.pack(side=tkinter.RIGHT)
snip_label.pack(side=tkinter.RIGHT)
# the canvas frame's contents will use grid b/c of the double
# scrollbar (they don't look right using pack), but the canvas itself
# will be packed in its frame
canvas_frame = tkinter.Frame(self.left_frame, bg=BACKGROUND_COLOR)
canvas_frame.grid_rowconfigure(0, weight=1)
canvas_frame.grid_columnconfigure(0, weight=1)
canvas_frame.pack(
fill=tkinter.BOTH,
expand=True,
anchor=tkinter.N,
padx=PAD_MEDIUM,
pady=PAD_MEDIUM
)
self.canvas = tkinter.Canvas(canvas_frame, cursor="cross")
self.scrollbar_v = tkinter.Scrollbar(
canvas_frame,
orient=tkinter.VERTICAL
)
self.scrollbar_h = tkinter.Scrollbar(
canvas_frame,
orient=tkinter.HORIZONTAL
)
self.scrollbar_v.config(command=self.canvas.yview)
self.scrollbar_h.config(command=self.canvas.xview)
self.canvas.config(yscrollcommand=self.scrollbar_v.set)
self.canvas.config(xscrollcommand=self.scrollbar_h.set)
self.canvas.grid(
row=0,
column=0,
sticky=tkinter.N + tkinter.S + tkinter.E + tkinter.W
)
self.scrollbar_v.grid(row=0, column=1, sticky=tkinter.N + tkinter.S)
self.scrollbar_h.grid(row=1, column=0, sticky=tkinter.E + tkinter.W)
# start packing in right_frame
export_button = tkinter.Button(
self.right_frame,
text='Export Sub-regions',
command=self.export_sub_regions
)
export_button.pack(fill=tkinter.BOTH, anchor=tkinter.N)
bg_colors_frame = tkinter.Frame(self.right_frame, bg=BACKGROUND_COLOR)
bg_colors_frame.pack(
fill=tkinter.BOTH,
expand=False,
anchor=tkinter.N,
pady=(PAD_EXTRA_LARGE, PAD_MEDIUM)
)
bg_colors_label = tkinter.Label(
bg_colors_frame,
text="Background colors: ",
bg=BACKGROUND_COLOR
)
bg_colors_label.pack(side=tkinter.TOP, anchor=tkinter.W)
color_profile_frame = tkinter.Frame(
bg_colors_frame,
bg=BACKGROUND_COLOR
)
color_profile_frame.pack(
fill=tkinter.X,
expand=True,
anchor=tkinter.W,
side=tkinter.LEFT
)
self.color_profile_vars = {}
for color in COLOR_NAMES:
self.color_profile_vars[color] = tkinter.StringVar()
self.color_profile_vars[color].set("0.0%")
l = tkinter.Label(
color_profile_frame,
textvariable=self.color_profile_vars[color],
bg=BACKGROUND_COLOR
)
l.config(
borderwidth=0,
highlightthickness=0
)
l.pack(anchor=tkinter.E, pady=PAD_SMALL, padx=PAD_MEDIUM)
bg_cb_frame = tkinter.Frame(bg_colors_frame, bg=BACKGROUND_COLOR)
bg_cb_frame.pack(
fill=tkinter.NONE,
expand=False,
anchor=tkinter.E
)
self.bg_color_vars = {}
for color in COLOR_NAMES:
self.bg_color_vars[color] = tkinter.IntVar()
self.bg_color_vars[color].set(0)
cb = tkinter.Checkbutton(
bg_cb_frame,
text=color,
variable=self.bg_color_vars[color],
bg=BACKGROUND_COLOR
)
cb.config(
borderwidth=0,
highlightthickness=0
)
cb.pack(anchor=tkinter.W, pady=PAD_SMALL, padx=PAD_MEDIUM)
erode_frame = tkinter.Frame(self.right_frame, bg=BACKGROUND_COLOR)
erode_frame.pack(
fill=tkinter.BOTH,
expand=False,
anchor=tkinter.N,
pady=PAD_MEDIUM
)
self.erode_iter = tkinter.IntVar()
self.erode_iter.set(DEFAULT_ERODE_ITER)
erode_label = tkinter.Label(
erode_frame,
text="Erosion iterations: ",
bg=BACKGROUND_COLOR
)
erode_label_entry = tkinter.Entry(
erode_frame,
textvariable=self.erode_iter
)
erode_label_entry.config(width=4)
erode_label_entry.pack(side=tkinter.RIGHT, anchor=tkinter.N)
erode_label.pack(side=tkinter.RIGHT, anchor=tkinter.N)
dilate_frame = tkinter.Frame(self.right_frame, bg=BACKGROUND_COLOR)
dilate_frame.pack(
fill=tkinter.BOTH,
expand=False,
anchor=tkinter.N,
pady=PAD_MEDIUM
)
self.dilate_iter = tkinter.IntVar()
self.dilate_iter.set(DEFAULT_DILATE_ITER)
dilate_label = tkinter.Label(
dilate_frame,
text="Dilation iterations: ",
bg=BACKGROUND_COLOR
)
dilate_label_entry = tkinter.Entry(
dilate_frame,
textvariable=self.dilate_iter
)
dilate_label_entry.config(width=4)
dilate_label_entry.pack(side=tkinter.RIGHT, anchor=tkinter.N)
dilate_label.pack(side=tkinter.RIGHT, anchor=tkinter.N)
min_area_frame = tkinter.Frame(self.right_frame, bg=BACKGROUND_COLOR)
min_area_frame.pack(
fill=tkinter.BOTH,
expand=False,
anchor=tkinter.N,
pady=PAD_MEDIUM
)
self.min_area = tkinter.DoubleVar()
self.min_area.set(0.5)
min_area_label = tkinter.Label(
min_area_frame,
text="Minimum area: ",
bg=BACKGROUND_COLOR
)
min_area_label_entry = tkinter.Entry(
min_area_frame,
textvariable=self.min_area
)
min_area_label_entry.config(width=4)
min_area_label_entry.pack(side=tkinter.RIGHT, anchor=tkinter.N)
min_area_label.pack(side=tkinter.RIGHT, anchor=tkinter.N)
max_area_frame = tkinter.Frame(self.right_frame, bg=BACKGROUND_COLOR)
max_area_frame.pack(
fill=tkinter.BOTH,
expand=False,
anchor=tkinter.N,
pady=PAD_MEDIUM
)
self.max_area = tkinter.DoubleVar()
self.max_area.set(2.0)
max_area_label = tkinter.Label(
max_area_frame,
text="Maximum area: ",
bg=BACKGROUND_COLOR
)
max_area_label_entry = tkinter.Entry(
max_area_frame,
textvariable=self.max_area
)
max_area_label_entry.config(width=4)
max_area_label_entry.pack(side=tkinter.RIGHT, anchor=tkinter.N)
max_area_label.pack(side=tkinter.RIGHT, anchor=tkinter.N)
region_buttons_frame = tkinter.Frame(
self.right_frame,
bg=BACKGROUND_COLOR
)
region_buttons_frame.pack(
fill=tkinter.BOTH,
expand=False,
anchor=tkinter.N,
pady=PAD_MEDIUM
)
find_regions_button = tkinter.Button(
region_buttons_frame,
text='Find Regions',
command=self.find_regions
)
find_regions_button.pack(side=tkinter.LEFT, anchor=tkinter.N)
clear_regions_button = tkinter.Button(
region_buttons_frame,
text='Clear Regions',
command=self.clear_rectangles
)
clear_regions_button.pack(side=tkinter.LEFT, anchor=tkinter.N)
# frame showing various stats about found regions
stats_frame = tkinter.Frame(
self.right_frame,
bg=BACKGROUND_COLOR,
highlightthickness=1,
highlightbackground='gray'
)
stats_frame.pack(
fill=tkinter.BOTH,
expand=False,
anchor=tkinter.N,
pady=PAD_LARGE,
padx=PAD_MEDIUM
)
region_count_frame = tkinter.Frame(
stats_frame,
bg=BACKGROUND_COLOR
)
region_count_frame.pack(
fill=tkinter.BOTH,
expand=True,
anchor=tkinter.N,
pady=PAD_SMALL,
padx=PAD_SMALL
)
region_count_desc_label = tkinter.Label(
region_count_frame,
text="# of regions: ",
bg=BACKGROUND_COLOR
)
region_count_desc_label.pack(side=tkinter.LEFT, anchor=tkinter.N)
region_count_label = tkinter.Label(
region_count_frame,
textvariable=self.region_count,
bg=BACKGROUND_COLOR
)
region_count_label.pack(side=tkinter.RIGHT, anchor=tkinter.N)
region_min_frame = tkinter.Frame(
stats_frame,
bg=BACKGROUND_COLOR
)
region_min_frame.pack(
fill=tkinter.BOTH,
expand=True,
anchor=tkinter.N,
pady=PAD_SMALL,
padx=PAD_SMALL
)
region_min_desc_label = tkinter.Label(
region_min_frame,
text="Minimum size: ",
bg=BACKGROUND_COLOR
)
region_min_desc_label.pack(side=tkinter.LEFT, anchor=tkinter.N)
region_min_label = tkinter.Label(
region_min_frame,
textvariable=self.region_min,
bg=BACKGROUND_COLOR
)
region_min_label.pack(side=tkinter.RIGHT, anchor=tkinter.N)
region_max_frame = tkinter.Frame(
stats_frame,
bg=BACKGROUND_COLOR
)
region_max_frame.pack(
fill=tkinter.BOTH,
expand=True,
anchor=tkinter.N,
pady=PAD_SMALL,
padx=PAD_SMALL
)
region_max_desc_label = tkinter.Label(
region_max_frame,
text="Maximum size: ",
bg=BACKGROUND_COLOR
)
region_max_desc_label.pack(side=tkinter.LEFT, anchor=tkinter.N)
region_max_label = tkinter.Label(
region_max_frame,
textvariable=self.region_max,
bg=BACKGROUND_COLOR
)
region_max_label.pack(side=tkinter.RIGHT, anchor=tkinter.N)
region_avg_frame = tkinter.Frame(
stats_frame,
bg=BACKGROUND_COLOR
)
region_avg_frame.pack(
fill=tkinter.BOTH,
expand=True,
anchor=tkinter.N,
pady=PAD_SMALL,
padx=PAD_SMALL
)
region_avg_desc_label = tkinter.Label(
region_avg_frame,
text="Average size: ",
bg=BACKGROUND_COLOR
)
region_avg_desc_label.pack(side=tkinter.LEFT, anchor=tkinter.N)
region_avg_label = tkinter.Label(
region_avg_frame,
textvariable=self.region_avg,
bg=BACKGROUND_COLOR
)
region_avg_label.pack(side=tkinter.RIGHT, anchor=tkinter.N)
# preview frame holding small full-size depiction of chosen image
preview_frame = tkinter.Frame(
self.right_frame,
bg=BACKGROUND_COLOR,
highlightthickness=1,
highlightbackground='black'
)
preview_frame.pack(
fill=tkinter.NONE,
expand=False,
anchor=tkinter.S,
side=tkinter.BOTTOM
)
self.preview_canvas = tkinter.Canvas(
preview_frame,
highlightthickness=0
)
self.preview_canvas.config(width=PREVIEW_SIZE, height=PREVIEW_SIZE)
self.preview_canvas.pack(anchor=tkinter.S, side=tkinter.BOTTOM)
# setup some button and key bindings
self.canvas.bind("<ButtonPress-1>", self.on_draw_button_press)
self.canvas.bind("<B1-Motion>", self.on_draw_move)
self.canvas.bind("<ButtonRelease-1>", self.on_draw_release)
self.canvas.bind("<ButtonPress-2>", self.on_pan_button_press)
self.canvas.bind("<B2-Motion>", self.pan_image)
self.canvas.bind("<ButtonRelease-2>", self.on_pan_button_release)
self.canvas.bind("<ButtonPress-3>", self.on_right_button_press)
self.canvas.bind("<Configure>", self.canvas_size_changed)
self.scrollbar_h.bind("<B1-Motion>", self.update_preview)
self.scrollbar_h.bind("<ButtonRelease-1>", self.update_preview)
self.scrollbar_v.bind("<B1-Motion>", self.update_preview)
self.scrollbar_v.bind("<ButtonRelease-1>", self.update_preview)
self.preview_canvas.bind("<ButtonPress-1>", self.move_preview_rectangle)
self.preview_canvas.bind("<B1-Motion>", self.move_preview_rectangle)
self.rect = None
self.start_x = None
self.start_y = None
self.pan_start_x = None
self.pan_start_y = None
self.image = None
self.tk_image = None
self.preview_image = None
self.preview_rectangle = None
self.pack()
def on_draw_button_press(self, event):
# starting coordinates
self.start_x = self.canvas.canvasx(event.x)
self.start_y = self.canvas.canvasy(event.y)
# create a new rectangle if we don't already have one
if self.rect is None:
self.rect = self.canvas.create_rectangle(
self.start_x,
self.start_y,
self.start_x,
self.start_y,
outline='#00ff00',
width=2
)
def on_draw_move(self, event):
cur_x = self.canvas.canvasx(event.x)
cur_y = self.canvas.canvasy(event.y)
# update rectangle size with mouse position
self.canvas.coords(self.rect, self.start_x, self.start_y, cur_x, cur_y)
# noinspection PyUnusedLocal
def on_draw_release(self, event):
if self.rect is None or self.image is None:
return
corners = self.canvas.coords(self.rect)
corners = tuple([int(c) for c in corners])
region = self.image.crop(corners)
if 0 in region.size:
# either height or width is zero, do nothing
return
target = cv2.cvtColor(np.array(region), cv2.COLOR_RGB2HSV)
color_profile = utils.get_color_profile(target)
total_pixels = (corners[2] - corners[0]) * (corners[3] - corners[1])
for color in COLOR_NAMES:
color_percent = (float(color_profile[color]) / total_pixels) * 100
self.color_profile_vars[color].set(
"%.1f%%" % np.round(color_percent, decimals=1)
)
def on_pan_button_press(self, event):
self.canvas.config(cursor='fleur')
# starting position for panning
self.pan_start_x = int(self.canvas.canvasx(event.x))
self.pan_start_y = int(self.canvas.canvasy(event.y))
def pan_image(self, event):
self.canvas.scan_dragto(
event.x - self.pan_start_x,
event.y - self.pan_start_y,
gain=1
)
self.update_preview(None)
# noinspection PyUnusedLocal
def on_pan_button_release(self, event):
self.canvas.config(cursor='cross')
def on_right_button_press(self, event):
# have to translate our event position to our current panned location
selection = self.canvas.find_closest(
self.canvas.canvasx(event.x),
self.canvas.canvasy(event.y),
start='rect'
)
for item in selection:
tags = self.canvas.gettags(item)
if 'rect' not in tags:
# this isn't a rectangle object, do nothing
continue
self.canvas.delete(item)
self.regions.pop(item)
def find_regions(self):
if self.rect is None or self.image is None:
return
corners = self.canvas.coords(self.rect)
corners = tuple([int(c) for c in corners])
region = self.image.crop(corners)
hsv_img = cv2.cvtColor(np.array(self.image), cv2.COLOR_RGB2HSV)
target = cv2.cvtColor(np.array(region), cv2.COLOR_RGB2HSV)
bg_colors = []
for color, cb_var in self.bg_color_vars.items():
if cb_var.get() == 1:
bg_colors.append(color)
if len(bg_colors) <= 0:
messagebox.showwarning(
'Choose Background Color',
'Please choose at least one background color to find regions.'
)
return
contours = utils.find_regions(
hsv_img,
target,
bg_colors=bg_colors,
pre_erode=self.erode_iter.get(),
dilate=self.dilate_iter.get(),
min_area=self.min_area.get(),
max_area=self.max_area.get()
)
# make sure we have at least one detected region
if len(contours) > 0:
self.create_regions(contours)
else:
self.region_count.set(0)
self.region_min.set(0.0)
self.region_max.set(0.0)
self.region_avg.set(0.0)
def create_regions(self, contours):
"""
Creates regions (self.regions) & draws bounding rectangles on canvas
Args:
contours: list of OpenCV contours
"""
self.clear_rectangles()
self.regions = {} # reset regions dictionary
region_areas = []
for c in contours:
region_areas.append(cv2.contourArea(c))
rect = cv2.boundingRect(c)
# using a custom fully transparent bitmap for the stipple, b/c
# if the rectangle has no fill we cannot catch mouse clicks
# within its boundaries (only on the border itself)
# a bit of a hack but it works
rect_id = self.canvas.create_rectangle(
rect[0],
rect[1],
rect[0] + rect[2],
rect[1] + rect[3],
outline='#00ff00',
fill='gray',
stipple='@trans.xbm',
width=2,
tag='rect'
)
self.regions[rect_id] = {
'contour': c,
'rectangle': rect
}
self.region_count.set(len(contours))
self.region_min.set(min(region_areas))
self.region_max.set(max(region_areas))
self.region_avg.set(np.round(np.mean(region_areas), decimals=1))
def reset_color_profile(self):
for color in COLOR_NAMES:
self.color_profile_vars[color].set("0.0%")
def clear_rectangles(self):
self.canvas.delete("rect")
self.canvas.delete(self.rect)
self.rect = None
self.region_count.set(0)
self.region_min.set(0.0)
self.region_max.set(0.0)
self.region_avg.set(0.0)
self.reset_color_profile()
def set_preview_rectangle(self):
x1, x2 = self.scrollbar_h.get()
y1, y2 = self.scrollbar_v.get()
self.preview_rectangle = self.preview_canvas.create_rectangle(
int(x1 * PREVIEW_SIZE) + 1,
int(y1 * PREVIEW_SIZE) + 1,
int(x2 * PREVIEW_SIZE),
int(y2 * PREVIEW_SIZE),
outline='#00ff00',
width=2,
tag='preview_rect'
)
# noinspection PyUnusedLocal
def update_preview(self, event):
if self.preview_rectangle is None:
# do nothing
return
x1, x2 = self.scrollbar_h.get()
y1, y2 = self.scrollbar_v.get()
# current rectangle position
rx1, ry1, rx2, ry2 = self.preview_canvas.coords(
self.preview_rectangle
)
delta_x = int(x1 * PREVIEW_SIZE) + 1 - rx1
delta_y = int(y1 * PREVIEW_SIZE) + 1 - ry1
self.preview_canvas.move(
self.preview_rectangle,
delta_x,
delta_y
)
def move_preview_rectangle(self, event):
if self.preview_rectangle is None:
# do nothing
return
x1, y1, x2, y2 = self.preview_canvas.coords(self.preview_rectangle)
half_width = float(x2 - x1) / 2
half_height = float(y2 - y1) / 2
if event.x + half_width >= PREVIEW_SIZE - 1:
new_x = PREVIEW_SIZE - (half_width * 2) - 1
else:
new_x = event.x - half_width
if event.y + half_height >= PREVIEW_SIZE - 1:
new_y = PREVIEW_SIZE - (half_height * 2) - 1
else:
new_y = event.y - half_height
self.canvas.xview(
tkinter.MOVETO,
float(new_x) / PREVIEW_SIZE
)
self.canvas.yview(
tkinter.MOVETO,
float(new_y) / PREVIEW_SIZE
)
self.update()
self.update_preview(None)
# noinspection PyUnusedLocal
def canvas_size_changed(self, event):
self.preview_canvas.delete('preview_rect')
self.set_preview_rectangle()
def choose_files(self):
selected_file = filedialog.askopenfile('r')
if selected_file is None:
# do nothing, user cancelled file dialog
return
self.canvas.delete('all')
self.rect = None
self.region_count.set(0)
self.region_min.set(0.0)
self.region_max.set(0.0)
self.region_avg.set(0.0)
# some of the files may be 3-channel 16-bit/chan TIFFs, which
# PIL doesn't support. OpenCV can read these, but converts them
# to 8-bit/chan. So, we'll open all images in OpenCV first,
# then create a PIL Image to finally create an ImageTk PhotoImage
cv_img = cv2.imread(selected_file.name)
self.image = PIL.Image.fromarray(
cv2.cvtColor(cv_img, cv2.COLOR_BGR2RGB),
'RGB'
)
height, width = self.image.size
self.canvas.config(scrollregion=(0, 0, height, width))
self.tk_image = ImageTk.PhotoImage(self.image)
self.canvas.create_image(0, 0, anchor=tkinter.NW, image=self.tk_image)
# have to force an update of the UI else the canvas scroll bars
# will not have updated fast enough to get their positions for
# drawing the preview rectangle
self.update()
tmp_preview_image = self.image.resize(
(PREVIEW_SIZE, PREVIEW_SIZE),
PIL.Image.ANTIALIAS
)
self.preview_canvas.delete('all')
self.preview_image = ImageTk.PhotoImage(tmp_preview_image)
self.preview_canvas.create_image(
0,
0,
anchor=tkinter.NW,
image=self.preview_image
)
self.set_preview_rectangle()
self.image_name = os.path.basename(selected_file.name)
self.image_dir = os.path.dirname(selected_file.name)
def export_sub_regions(self):
if not self.regions:
return
if len(self.regions) == 0:
return
if self.export_string.get() == '':
messagebox.showwarning(
'Export Label',
'Please create an export label.'
)
return
export_format = self.export_format.get()
output_dir = "/".join(
[
self.image_dir,
self.export_string.get().strip()
]
)
if not os.path.exists(output_dir):
os.makedirs(output_dir)
hsv_img = cv2.cvtColor(np.array(self.image), cv2.COLOR_RGB2HSV)
for k, v in self.regions.items():
x1 = v['rectangle'][0]
y1 = v['rectangle'][1]
x2 = v['rectangle'][0] + v['rectangle'][2]
y2 = v['rectangle'][1] + v['rectangle'][3]
# build base file name for output files
match = re.search('(.+)\.(.+)$', self.image_name)
output_filename = "".join(
[
match.groups()[0],
'_',
str(x1),
',',
str(y1)
]
)
if export_format == 'tiff' or export_format == 'both':
region = self.image.crop((x1, y1, x2, y2))
tif_filename = ".".join([output_filename, 'tif'])
tif_file_path = "/".join([output_dir, tif_filename])
region.save(tif_file_path)
if export_format == 'numpy' or export_format == 'both':
# extract sub-region from original image using rectangle
hsv_region = hsv_img[y1:y2, x1:x2]
# subtract the rect coordinates from the contour
local_contour = v['contour'] - [x1, y1]
# create a mask from the new contour
new_mask = np.zeros(
(v['rectangle'][3], v['rectangle'][2]),
dtype=np.uint8
)
cv2.drawContours(new_mask, [local_contour], 0, 255, -1)
# mask the extracted sub-region & convert to int16
# to use -1 for non-contour pixels
masked_region = cv2.bitwise_and(
hsv_region,
hsv_region,
mask=new_mask
).astype(np.int16)
# set non-contour areas to -1
masked_region[new_mask == 0] = -1
# save sub-region to file as NumPy array
npy_filename = ".".join([output_filename, 'npy'])
npy_file_path = "/".join([output_dir, npy_filename])
np.save(npy_file_path, masked_region)
root = tkinter.Tk()
app = Application(root)
root.mainloop()
|
whitews/image-subregion-detector
|
image_subregion_detector.py
|
Python
|
bsd-3-clause
| 29,126
|
[
"FLEUR"
] |
b03f965007ecac91a0127cde2bfe4ec60ccc3f8f6fa37100f0cadba85a7128e1
|
from gpaw.test import equal
from gpaw.grid_descriptor import GridDescriptor
from gpaw.spline import Spline
import gpaw.mpi as mpi
from gpaw.lfc import LocalizedFunctionsCollection as LFC
s = Spline(0, 1.0, [1.0, 0.5, 0.0])
n = 40
a = 8.0
gd = GridDescriptor((n, n, n), (a, a, a), comm=mpi.serial_comm)
c = LFC(gd, [[s], [s], [s]])
c.set_positions([(0.5, 0.5, 0.25 + 0.25 * i) for i in [0, 1, 2]])
b = gd.zeros()
c.add(b)
x = gd.integrate(b)
gd = GridDescriptor((n, n, n), (a, a, a), comm=mpi.serial_comm)
c = LFC(gd, [[s], [s], [s]])
c.set_positions([(0.5, 0.5, 0.25 + 0.25 * i) for i in [0, 1, 2]])
b = gd.zeros()
c.add(b)
y = gd.integrate(b)
equal(x, y, 1e-13)
|
robwarm/gpaw-symm
|
gpaw/test/lf.py
|
Python
|
gpl-3.0
| 665
|
[
"GPAW"
] |
e1299f7fd9ebf1b59b9581a854ae0b7e224dc52124ebbffbbc6ceb60ffee9f59
|
# Orca
#
# Copyright 2004-2008 Sun Microsystems Inc.
#
# 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., Franklin Street, Fifth Floor,
# Boston MA 02110-1301 USA.
""" Custom script for Thunderbird 3."""
__id__ = "$Id$"
__version__ = "$Revision$"
__date__ = "$Date$"
__copyright__ = "Copyright (c) 2004-2008 Sun Microsystems Inc."
__license__ = "LGPL"
import pyatspi
import orca.orca as orca
import orca.debug as debug
import orca.scripts.default as default
import orca.orca_state as orca_state
import orca.speech as speech
import orca.scripts.toolkits.Gecko as Gecko
from orca.orca_i18n import _
from formatting import Formatting
from speech_generator import SpeechGenerator
from script_utilities import Utilities
import script_settings
_settingsManager = getattr(orca, '_settingsManager')
########################################################################
# #
# The Thunderbird script class. #
# #
########################################################################
class Script(Gecko.Script):
"""The script for Thunderbird."""
_containingPanelName = ""
def __init__(self, app):
""" Creates a new script for the given application.
Arguments:
- app: the application to create a script for.
"""
# Set the debug level for all the methods in this script.
self.debugLevel = debug.LEVEL_FINEST
# http://bugzilla.mozilla.org/show_bug.cgi?id=659018
if app.toolkitVersion < "7.0":
app.setCacheMask(pyatspi.cache.ALL ^ pyatspi.cache.NAME)
# Store the last autocompleted string for the address fields
# so that we're not too 'chatty'. See bug #533042.
#
self._lastAutoComplete = ""
# When a mail message gets focus, we'll get a window:activate event
# followed by two focus events for the document frame. We want to
# present the message if it was just opened; we don't if it was
# already opened and the user has just returned focus to it. Store
# the fact that a message was loaded which we should present once
# the document frame claims focus. See bug #541018.
#
self._messageLoaded = False
Gecko.Script.__init__(self, app)
# This will be used to cache a handle to the Thunderbird text area for
# spell checking purposes.
self.textArea = None
def getFormatting(self):
"""Returns the formatting strings for this script."""
return Formatting(self)
def getSpeechGenerator(self):
"""Returns the speech generator for this script."""
return SpeechGenerator(self)
def getUtilities(self):
"""Returns the utilites for this script."""
return Utilities(self)
def getAppPreferencesGUI(self):
"""Return a GtkGrid containing the application unique configuration
GUI items for the current application."""
grid = Gecko.Script.getAppPreferencesGUI(self)
# Reapply "say all on load" using the Thunderbird specific setting.
#
self.sayAllOnLoadCheckButton.set_active(script_settings.sayAllOnLoad)
# We need to maintain a separate setting for grabFocusOnAncestor
# because the version of Gecko used by the Thunderbird might be
# different from that used by Firefox. See bug 608149.
#
self.grabFocusOnAncestorCheckButton.set_active(
script_settings.grabFocusOnAncestor)
return grid
def setAppPreferences(self, prefs):
"""Write out the application specific preferences lines and set the
new values.
Arguments:
- prefs: file handle for application preferences.
"""
Gecko.Script.setAppPreferences(self, prefs)
# Write the Thunderbird specific settings.
#
prefix = "orca.scripts.apps.Thunderbird.script_settings"
prefs.writelines("import %s\n\n" % prefix)
value = self.sayAllOnLoadCheckButton.get_active()
prefs.writelines("%s.sayAllOnLoad = %s\n" % (prefix, value))
script_settings.sayAllOnLoad = value
value = self.grabFocusOnAncestorCheckButton.get_active()
prefs.writelines("%s.grabFocusOnAncestor = %s\n" % (prefix, value))
script_settings.grabFocusOnAncestor = value
def _debug(self, msg):
""" Convenience method for printing debug messages"""
debug.println(self.debugLevel, "Thunderbird.py: "+msg)
def _isSpellCheckListItemFocus(self, event):
"""Check if this event is for a list item in the spell checking
dialog and whether it has a FOCUSED state.
Arguments:
- event: the Event
Return True is this event is for a list item in the spell checking
dialog and it doesn't have a FOCUSED state, Otherwise return False.
"""
rolesList = [pyatspi.ROLE_LIST_ITEM, \
pyatspi.ROLE_LIST, \
pyatspi.ROLE_DIALOG, \
pyatspi.ROLE_APPLICATION]
if self.utilities.hasMatchingHierarchy(event.source, rolesList):
dialog = event.source.parent.parent
# Translators: this is what the name of the spell checking
# dialog in Thunderbird begins with. The translated form
# has to match what Thunderbird is using. We hate keying
# off stuff like this, but we're forced to do so in this case.
#
if dialog.name.startswith(_("Check Spelling")):
state = event.source.getState()
if not state.contains(pyatspi.STATE_FOCUSED):
return True
return False
def onCaretMoved(self, event):
"""Called whenever the caret moves.
Arguments:
- event: the Event
"""
# Much of the Gecko code is designed to handle Gecko's broken
# caret navigation. This is not needed in -- and can sometimes
# interfere with our presentation of -- a simple message being
# composed by the user. Surely we can count on Thunderbird to
# handle navigation in that case.
#
if self.isEditableMessage(event.source) \
or self.isNonHTMLEntry(event.source):
self.setCaretContext(event.source, event.detail1)
return default.Script.onCaretMoved(self, event)
# Page_Up/Page_Down are not used by Orca. However, users report
# using these keys in Thunderbird without success. The default
# script is sometimes rejecting the resulting caret-moved events
# based on the locusOfFocus other times Gecko is because of the
# caret context.
#
lastKey, mods = self.utilities.lastKeyAndModifiers()
updatePosition = lastKey in ["Page_Up", "Page_Down"]
# Unlike the unpredictable wild, wild web, odds are good that a
# caret-moved event in a message composition window is valid. But
# depending upon the locusOfFocus at the time this event is issued
# the default Gecko toolkit script might not do the right thing.
#
if not updatePosition and event.detail1 >= 0:
updatePosition = \
event.source.getState().contains(pyatspi.STATE_EDITABLE)
if updatePosition:
orca.setLocusOfFocus(event, event.source, notifyScript=False)
self.setCaretContext(event.source, event.detail1)
# The Gecko script, should it be about to pass along this
# event to the default script, will set the locusOfFocus to
# the object returned by findFirstCaretContext(). If that
# object is not the same as the event source or the event
# source's parent, the default script will reject the event.
# As a result, if the user presses Page_Up or Page_Down and
# just so happens to land on an object whose sole contents
# is an image, we'll say nothing. Ultimately this should
# probably be handled elsewhere, but this close to the next
# major (2.24) release, I (JD) am not risking it. :-)
#
[obj, offset] = \
self.findFirstCaretContext(event.source, event.detail1)
if obj.getRole() == pyatspi.ROLE_IMAGE:
return default.Script.onCaretMoved(self, event)
return Gecko.Script.onCaretMoved(self, event)
def onFocus(self, event):
""" Called whenever an object gets focus.
Arguments:
- event: the Event
"""
obj = event.source
parent = obj.parent
top = self.utilities.topLevelObject(obj)
consume = False
# Clear the stored autocomplete string.
#
self._lastAutoComplete = ""
# Don't speak chrome URLs.
#
if obj.name.startswith("chrome://"):
return
# This is a better fix for bug #405541. Thunderbird gives
# focus to the cell in the column that is being sorted
# (e.g., Date). Braille should show the row beginning with
# the first populated cell. Set the locusOfFocus to that
# cell and consume the event so that the Gecko script
# doesn't reset it.
#
if obj.getRole() == pyatspi.ROLE_TABLE_CELL:
table = parent.queryTable()
row = table.getRowAtIndex(self.utilities.cellIndex(obj))
for i in range(0, table.nColumns):
acc = table.getAccessibleAt(row, i)
if acc.name:
# For some reason orca.py's check to see if the
# object we're setting the locusOfFocus to is the
# same as the current locusOfFocus is returning
# True when it's not actually True. Therefore,
# we'll force the propagation as a precaution.
#
force = event.type.startswith("focus:")
orca.setLocusOfFocus(event, acc, force=force)
consume = True
break
# Text area (for caching handle for spell checking purposes).
#
# This works in conjunction with code in the onNameChanged()
# method. Check to see if focus is currently in the Thunderbird
# message area. If it is, then, if this is the first time, save
# a pointer to the document frame which contains the text being
# edited.
#
# Note that this drops through to then use the default event
# processing in the parent class for this "focus:" event.
rolesList = [pyatspi.ROLE_DOCUMENT_FRAME,
pyatspi.ROLE_INTERNAL_FRAME,
pyatspi.ROLE_FRAME,
pyatspi.ROLE_APPLICATION]
if self.utilities.hasMatchingHierarchy(event.source, rolesList):
self._debug("onFocus - message text area.")
self.textArea = event.source
# Fall-thru to process the event with the default handler.
if event.type.startswith("focus:"):
# If we get a "focus:" event for the "Replace with:" entry in the
# spell checking dialog, then clear the current locus of focus so
# that this item will be spoken and brailled. See bug #535192 for
# more details.
#
rolesList = [pyatspi.ROLE_ENTRY, \
pyatspi.ROLE_DIALOG, \
pyatspi.ROLE_APPLICATION]
if self.utilities.hasMatchingHierarchy(obj, rolesList):
dialog = obj.parent
# Translators: this is what the name of the spell checking
# dialog in Thunderbird begins with. The translated form
# has to match what Thunderbird is using. We hate keying
# off stuff like this, but we're forced to do so in this case.
#
if dialog.name.startswith(_("Check Spelling")):
orca_state.locusOfFocus = None
orca.setLocusOfFocus(event, obj)
# If we get a "focus:" event for a list item in the spell
# checking dialog, and it doesn't have a FOCUSED state (i.e.
# we didn't navigate to it), then ignore it. See bug #535192
# for more details.
#
if self._isSpellCheckListItemFocus(event):
return
# Handle dialogs.
#
if top and top.getRole() == pyatspi.ROLE_DIALOG:
self._speakEnclosingPanel(obj)
# Handle a newly-opened message.
#
if event.source.getRole() == pyatspi.ROLE_DOCUMENT_FRAME \
and orca_state.locusOfFocus \
and orca_state.locusOfFocus.getRole() == pyatspi.ROLE_FRAME:
if self._messageLoaded:
consume = True
self._presentMessage(event.source)
# If the user just gave focus to the message window (e.g. by
# Alt+Tabbing back into it), we might have an existing caret
# context. But we'll need the document frame in order to verify
# this. Therefore try to find the document frame.
#
elif self.getCaretContext() == [None, -1]:
documentFrame = None
for child in orca_state.locusOfFocus:
if child.getRole() == pyatspi.ROLE_INTERNAL_FRAME \
and child.childCount \
and child[0].getRole() == pyatspi.ROLE_DOCUMENT_FRAME:
documentFrame = child[0]
break
try:
contextObj, contextOffset = \
self._documentFrameCaretContext[hash(documentFrame)]
if contextObj:
orca.setLocusOfFocus(event, contextObj)
except:
pass
if not consume:
# Much of the Gecko code is designed to handle Gecko's broken
# caret navigation. This is not needed in -- and can sometimes
# interfere with our presentation of -- a simple message being
# composed by the user. Surely we can count on Thunderbird to
# handle navigation in that case.
#
if self.isEditableMessage(event.source):
default.Script.onFocus(self, event)
else:
Gecko.Script.onFocus(self, event)
def locusOfFocusChanged(self, event, oldLocusOfFocus, newLocusOfFocus):
"""Called when the visual object with focus changes.
Arguments:
- event: if not None, the Event that caused the change
- oldLocusOfFocus: Accessible that is the old locus of focus
- newLocusOfFocus: Accessible that is the new locus of focus
"""
# If the user has just deleted a message from the middle of the
# message header list, then we want to speak the newly focused
# message in the header list (even though it has the same row
# number as the previously deleted message).
# See bug #536451 for more details.
#
rolesList = [pyatspi.ROLE_TABLE_CELL,
pyatspi.ROLE_TREE_TABLE,
pyatspi.ROLE_SCROLL_PANE,
pyatspi.ROLE_SCROLL_PANE]
if self.utilities.hasMatchingHierarchy(event.source, rolesList):
lastKey, mods = self.utilities.lastKeyAndModifiers()
if lastKey == "Delete":
oldLocusOfFocus = None
# If the user has just deleted an open mail message, then we want to
# try to speak the new name of the open mail message frame.
# See bug #540039 for more details.
#
rolesList = [pyatspi.ROLE_DOCUMENT_FRAME, \
pyatspi.ROLE_INTERNAL_FRAME, \
pyatspi.ROLE_FRAME, \
pyatspi.ROLE_APPLICATION]
if self.utilities.hasMatchingHierarchy(event.source, rolesList):
lastKey, mods = self.utilities.lastKeyAndModifiers()
if lastKey == "Delete":
oldLocusOfFocus = None
state = newLocusOfFocus.getState()
if state.contains(pyatspi.STATE_DEFUNCT):
newLocusOfFocus = event.source
# Pass the event onto the parent class to be handled in the default way.
Gecko.Script.locusOfFocusChanged(self, event,
oldLocusOfFocus, newLocusOfFocus)
def onStateChanged(self, event):
"""Called whenever an object's state changes.
Arguments:
- event: the Event
"""
if event.type.startswith("object:state-changed:busy"):
if event.source.getRole() == pyatspi.ROLE_DOCUMENT_FRAME \
and not event.detail1:
self._messageLoaded = True
if self.inDocumentContent():
self._presentMessage(event.source)
return
default.Script.onStateChanged(self, event)
def onStateFocused(self, event):
"""Called whenever an object's state changes focus.
Arguments:
- event: the Event
"""
# If we get an "object:state-changed:focused" event for a list
# item in the spell checking dialog, and it doesn't have a
# FOCUSED state (i.e. we didn't navigate to it), then ignore it.
# See bug #535192 for more details.
#
if self._isSpellCheckListItemFocus(event):
return
Gecko.Script.onStateChanged(self, event)
def onTextInserted(self, event):
"""Called whenever text is inserted into an object.
Arguments:
- event: the Event
"""
obj = event.source
parent = obj.parent
# Try to stop unwanted chatter when a new message is being
# replied to. See bgo#618484.
#
if event.source.getRole() == pyatspi.ROLE_DOCUMENT_FRAME \
and event.source.getState().contains(pyatspi.STATE_EDITABLE) \
and event.type.endswith("system"):
return
# Speak the autocompleted text, but only if it is different
# address so that we're not too "chatty." See bug #533042.
#
if parent.getRole() == pyatspi.ROLE_AUTOCOMPLETE:
if event.type.endswith("system") and event.any_data:
# The autocompleted address may start with the name,
# or it might start with the text typed by the user
# followed by ">>" followed by the address. Therefore
# we'll look at whatever follows the ">>" should it
# exist.
#
address = event.any_data.split(">>")[-1]
if self._lastAutoComplete != address:
speech.speak(address)
self._lastAutoComplete = address
return
Gecko.Script.onTextInserted(self, event)
def onVisibleDataChanged(self, event):
"""Called when the visible data of an object changes."""
# [[[TODO: JD - In Gecko.py, we need onVisibleDataChanged() to
# to detect when the user switches between the tabs holding
# different URLs in Firefox. Thunderbird issues very similar-
# looking events as the user types a subject in the message
# composition window. For now, rather than trying to distinguish
# them in Gecko.py, we'll simply prevent Gecko.py from seeing when
# Thunderbird issues such an event.]]]
#
return
def onNameChanged(self, event):
"""Called whenever a property on an object changes.
Arguments:
- event: the Event
"""
obj = event.source
# If the user has just deleted an open mail message, then we want to
# try to speak the new name of the open mail message frame and also
# present the first line of that message to be consistent with what
# we do when a new message window is opened. See bug #540039 for more
# details.
#
rolesList = [pyatspi.ROLE_DOCUMENT_FRAME,
pyatspi.ROLE_INTERNAL_FRAME,
pyatspi.ROLE_FRAME,
pyatspi.ROLE_APPLICATION]
if self.utilities.hasMatchingHierarchy(event.source, rolesList):
lastKey, mods = self.utilities.lastKeyAndModifiers()
if lastKey == "Delete":
speech.speak(obj.name)
[obj, offset] = self.findFirstCaretContext(obj, 0)
self.setCaretPosition(obj, offset)
return
# If we get a "object:property-change:accessible-name" event for
# the first item in the Suggestions lists for the spell checking
# dialog, then speak the first two labels in that dialog. These
# will by the "Misspelled word:" label and the currently misspelled
# word. See bug #535192 for more details.
#
rolesList = [pyatspi.ROLE_LIST_ITEM,
pyatspi.ROLE_LIST,
pyatspi.ROLE_DIALOG,
pyatspi.ROLE_APPLICATION]
if self.utilities.hasMatchingHierarchy(obj, rolesList):
dialog = obj.parent.parent
# Translators: this is what the name of the spell checking
# dialog in Thunderbird begins with. The translated form
# has to match what Thunderbird is using. We hate keying
# off stuff like this, but we're forced to do so in this case.
#
if dialog.name.startswith(_("Check Spelling")):
if obj.getIndexInParent() == 0:
badWord = self.utilities.displayedText(dialog[1])
if self.textArea != None:
# If we have a handle to the Thunderbird message text
# area, then extract out all the text objects, and
# create a list of all the words found in them.
#
allTokens = []
text = self.utilities.substring(self.textArea, 0, -1)
tokens = text.split()
allTokens += tokens
self.speakMisspeltWord(allTokens, badWord)
def _speakEnclosingPanel(self, obj):
"""Speak the enclosing panel for the object, if it is
named. Going two containers up the hierarchy appears to be far
enough to find a named panel, if there is one. Don't speak
panels whose name begins with 'chrome://'"""
self._debug("_speakEnclosingPanel")
parent = obj.parent
if not parent:
return
if parent.name != "" \
and (not parent.name.startswith("chrome://")) \
and (parent.getRole() == pyatspi.ROLE_PANEL):
# Speak the parent panel name, but only once.
#
if parent.name != self._containingPanelName:
self._containingPanelName = parent.name
utterances = []
# Translators: this is the name of a panel in Thunderbird.
#
text = _("%s panel") % parent.name
utterances.append(text)
speech.speak(utterances)
else:
grandparent = parent.parent
if grandparent \
and (grandparent.name != "") \
and (not grandparent.name.startswith("chrome://")) \
and (grandparent.getRole() == pyatspi.ROLE_PANEL):
# Speak the grandparent panel name, but only once.
#
if grandparent.name != self._containingPanelName:
self._containingPanelName = grandparent.name
utterances = []
# Translators: this is the name of a panel in Thunderbird.
#
text = _("%s panel") % grandparent.name
utterances.append(text)
speech.speak(utterances)
def _presentMessage(self, documentFrame):
"""Presents the first line of the message, or the entire message,
depending on the user's sayAllOnLoad setting."""
[obj, offset] = self.findFirstCaretContext(documentFrame, 0)
self.setCaretPosition(obj, offset)
if not script_settings.sayAllOnLoad:
self.presentLine(obj, offset)
elif _settingsManager.getSetting('enableSpeech'):
self.sayAll(None)
self._messageLoaded = False
def sayCharacter(self, obj):
"""Speaks the character at the current caret position."""
if self.isEditableMessage(obj):
text = self.utilities.queryNonEmptyText(obj)
if text and text.caretOffset + 1 >= text.characterCount:
default.Script.sayCharacter(self, obj)
return
Gecko.Script.sayCharacter(self, obj)
def getBottomOfFile(self):
"""Returns the object and last caret offset at the bottom of the
document frame. Overridden here to handle editable messages.
"""
# Pylint thinks that obj is an instance of a list. It most
# certainly is not. Silly pylint.
#
# pylint: disable-msg=E1103
#
[obj, offset] = Gecko.Script.getBottomOfFile(self)
if obj and obj.getState().contains(pyatspi.STATE_EDITABLE):
offset += 1
return [obj, offset]
def toggleFlatReviewMode(self, inputEvent=None):
"""Toggles between flat review mode and focus tracking mode."""
# If we're leaving flat review dump the cache. See bug 568658.
#
if self.flatReviewContext:
pyatspi.clearCache()
return default.Script.toggleFlatReviewMode(self, inputEvent)
def isNonHTMLEntry(self, obj):
"""Checks for ROLE_ENTRY areas that are not part of an HTML
document. See bug #607414.
Returns True is this is something like the Subject: entry
"""
result = obj and obj.getRole() == pyatspi.ROLE_ENTRY \
and not self.utilities.ancestorWithRole(
obj, [pyatspi.ROLE_DOCUMENT_FRAME], [pyatspi.ROLE_FRAME])
return result
def isEditableMessage(self, obj):
"""Returns True if this is a editable message."""
# For now, look specifically to see if this object is the
# document frame. If it's not, we cannot be sure how complex
# this message is and should let the Gecko code kick in.
#
if obj \
and obj.getRole() == pyatspi.ROLE_DOCUMENT_FRAME \
and obj.getState().contains(pyatspi.STATE_EDITABLE):
return True
return False
def useCaretNavigationModel(self, keyboardEvent):
"""Returns True if we should do our own caret navigation."""
if self.isEditableMessage(orca_state.locusOfFocus) \
or self.isNonHTMLEntry(orca_state.locusOfFocus):
return False
return Gecko.Script.useCaretNavigationModel(self, keyboardEvent)
|
Alberto-Beralix/Beralix
|
i386-squashfs-root/usr/share/pyshared/orca/scripts/apps/Thunderbird/script.py
|
Python
|
gpl-3.0
| 28,065
|
[
"ORCA"
] |
71ca3f3f14b5a03d6c5a59d134473aa2edce0bc06b309232fa5fdf3fd1819557
|
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Using BLAST, create a CSV file that lists the % identity of the specified sequence to all sequences from the specified germline
__author__ = 'William Lees'
__docformat__ = "restructuredtext en"
import os.path
import sys
import argparse
import csv
import re
import subprocess
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio import pairwise2
from Bio.Alphabet import generic_nucleotide
from Bio import SeqIO
from Bio import Phylo
from itertools import izip
def main(argv):
parser = argparse.ArgumentParser(description='Create an Identity/Divergence plot.')
parser.add_argument('repertoire', help='file containing repertoire sequence identities (CSV)')
parser.add_argument('-a', '--adjust', help='Adjust labels to prevent overlap (requires package adjustText)', action='store_true')
parser.add_argument('-b', '--bar', help='Plot a colour bar', action='store_true')
parser.add_argument('-c', '--colourmap', help='colourmap')
parser.add_argument('-g', '--background', help='Set the contour colourwhere the density is zero')
parser.add_argument('-mx', '--maxx', help='max divergence value to show')
parser.add_argument('-my', '--miny', help='min identity value to show')
parser.add_argument('-p', '--points', help='comma-seperated list of identity files and formats')
parser.add_argument('-s', '--save', help='Save output to file (as opposed to interactive display)')
args = parser.parse_args()
if args.adjust:
from adjustText import adjust_text
colourmap = args.colourmap if args.colourmap else 'hot_r'
plist = args.points.split(',')
points = []
repertoire = read_file(args.repertoire)
def pairwise(iterable):
a = iter(iterable)
return izip(a, a)
if len(plist) > 0:
try:
for file, format in pairwise(plist):
points.append((read_file(file), format))
except IOError:
print 'file "%s" cannot be opened.' % file
except:
print '"points" must consist of pairs of files and formats.'
quit()
max_divergence = int(args.maxx) if args.maxx else None
min_identity = int(args.miny) if args.miny else None
savefile = args.save if args.save else None
if not max_divergence:
max_divergence = max(repertoire['GermlineDist'])
for point in points:
max_divergence = max(max_divergence, max(point[0]['GermlineDist']))
max_divergence = int(max_divergence) + 1
if not min_identity:
min_identity = min(repertoire['TargetDist'])
for point in points:
min_identity = min(min_identity, min(point[0]['TargetDist']))
min_identity = int(min_identity)
H, yedges, xedges = np.histogram2d(repertoire['TargetDist'], repertoire['GermlineDist'], bins=[101-min_identity, max_divergence+1], range=[[min_identity, 101], [-1, max_divergence]], normed=False)
# For alternative interpolations and plots, see http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram2d.html
# For colour maps, see http://matplotlib.org/examples/color/colormaps_reference.html
fig = plt.figure()
cm = plt.cm.get_cmap(colourmap)
if args.background:
cm.set_under(color=args.background)
ax = fig.add_subplot(1,1,1)
im = plt.imshow(H, interpolation='bilinear', origin='low', extent=[xedges[0], xedges[-1], yedges[0], yedges[-1]], vmin=0.0000001, cmap=cm)
ax.set_xlim(xedges[0], xedges[-1])
ax.set_ylim(yedges[0], yedges[-1])
if args.bar:
cb = plt.colorbar(im, shrink=0.8, extend='neither')
cb.ax.set_ylabel('sequences', rotation=90)
texts = []
for point in points:
df, format = point
markersize = 5
label = False
labelcolour = 'black'
fmt = format.split('/')
format = fmt[0]
for f in fmt[1:]:
if f[0] == 'm':
markersize = int(f[1:])
elif f[0] == 'l':
label = True
if len(f) > 1:
labelcolour = f[1:]
else:
print 'Unrecognised format string: %s' % format
for index, row in df.iterrows():
if label:
if args.adjust:
texts.append(plt.text(row['GermlineDist'], row['TargetDist'], row['SequenceId'], bbox={'pad':0, 'alpha':0}, fontdict={ 'color': labelcolour}))
else:
texts.append(plt.text(row['GermlineDist'] + 0.2, row['TargetDist'] - 0.2, row['SequenceId'], bbox={'pad':0, 'alpha':0}, fontdict={ 'color': labelcolour}))
ax.plot(row['GermlineDist'], row['TargetDist'], format, markersize=markersize)
if args.adjust:
adjust_text(texts)
plt.xlabel('Germline Divergence (%)')
plt.ylabel('Target Ab Identity (%)')
if savefile:
plt.savefig(savefile)
else:
plt.show()
def read_file(file):
df = pd.read_csv(file, converters={'SequenceId': lambda x: x})
for key in ("SequenceId", "TargetDist", "GermlineDist"):
if key not in df.keys():
print 'File %s does not contain a column "%s"' % (file, key)
quit()
for index, row in df.iterrows():
try:
x = row[1] * row[2] # check they behave like numbers
except:
print 'Error in file %s: malformed row at %s.' % (file, row[0])
if len(df) < 1:
print '%s: empty file.' % file
quit()
return df
if __name__=="__main__":
main(sys.argv)
|
williamdlees/BioTools
|
PlotIdentity.py
|
Python
|
mit
| 6,306
|
[
"BLAST"
] |
7e0db6e5327bcc3313827f6354f1303bf816bf38d934ca60b57f24500c753124
|
"""
Module for writing data to NetCDF files
"""
from netCDF4 import Dataset
import logging
types = {'int8': 'i1',
'int16': "i2",
'int32': "i4",
'int64': "i8",
'uint8': 'u1',
'uint16': "u2",
'uint32': "u4",
'uint64': "u8",
'float32': "f4",
'float64': "f8"}
index_name = 'obs'
def __add_metadata(var, data):
if data.standard_name:
var.standard_name = data.standard_name
if data.units:
var.units = str(data.units)
if data.long_name:
var.long_name = data.long_name
if data.metadata.missing_value:
var.missing_value = data.metadata.missing_value
if data.metadata.calendar:
var.calendar = data.metadata.calendar
if data.metadata.history:
var.history = data.metadata.history
for name, value in data.attributes.items():
setattr(var, name, value)
for name, value in data.metadata.misc.items():
if name not in var.ncattrs():
setattr(var, name, value)
return var
def __get_missing_value(coord):
f = coord.metadata.missing_value
if not f and f != 0:
f = None
return f
def sizeof_fmt(num, suffix='B'):
"""
Return a human readable size from an integer number of bytes
From http://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size
:param int num: Number of bytes
:param str suffix: Little or big B
:return str: Formatted human readable size
"""
for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']:
if abs(num) < 1024.0:
return "%3.1f%s%s" % (num, unit, suffix)
num /= 1024.0
return "%.1f%s%s" % (num, 'Yi', suffix)
def __check_disk_space(filepath, data):
"""
Warn if there is insufficient disk space to write the data to the filapath - if the OS supports it
:param str filepath: Path of file to write
:param ndarray data: Numpy array of data to write
:return: None
"""
try:
from os import statvfs
stats = statvfs(filepath)
except (ImportError, OSError):
logging.debug("Unable to determine free disk space on this OS.")
else:
# available space is the number of available blocks times the fundamental block size
available = stats.f_bavail * stats.f_frsize
if available < data.nbytes:
logging.warning("Free disk space at {path} is {free}, but the array being saved is {size}."
.format(path=filepath, free=sizeof_fmt(available), size=sizeof_fmt(data.data.nbytes)))
def __create_variable(nc_file, data, prefer_standard_name=False):
"""Creates and writes a variable to a netCDF file.
:param nc_file: netCDF file to which to write
:param data: LazyData for variable to write
:param prefer_standard_name: if True, use the standard name of the variable if defined,
otherwise use the variable name
:return: created netCDF variable
"""
from cis.exceptions import InconsistentDimensionsError
name = None
if (data.metadata._name is not None) and (len(data.metadata._name) > 0):
name = data.metadata._name
if (name is None) or prefer_standard_name:
if (data.metadata.standard_name is not None) and (len(data.metadata.standard_name) > 0):
name = data.metadata.standard_name
out_type = types[str(data.data.dtype)]
logging.info("Creating variable: {name}({index}) {type}".format(name=name, index=index_name, type=out_type))
if name not in nc_file.variables:
# Generate a warning if we have insufficient disk space
__check_disk_space(nc_file.filepath(), data.data)
var = nc_file.createVariable(name, datatype=out_type, dimensions=index_name,
fill_value=__get_missing_value(data))
var = __add_metadata(var, data)
try:
var[:] = data.data.flatten()
except IndexError as e:
raise InconsistentDimensionsError(str(e) + "\nInconsistent dimensions in output file, unable to write "
"{} to file (it's shape is {}).".format(data.name(), data.shape))
except:
logging.error("Error writing data to disk.")
raise
return var
else:
return nc_file.variables[name]
def write(data_object, filename):
"""
:param data_object:
:param filename:
:return:
"""
write_coordinate_list(data_object.coords(), filename)
add_data_to_file(data_object, filename)
def write_coordinates(coords, filename):
"""Writes coordinates to a netCDF file.
:param coords: UngriddedData or UngriddedCoordinates object for which the coordinates are to be written
:param filename: file to which to write
"""
coord_list = coords.coords()
write_coordinate_list(coord_list, filename)
def write_coordinate_list(coord_list, filename):
"""Writes coordinates to a netCDF file.
:param coord_list: list of Coord objects
:param filename: file to which to write
"""
netcdf_file = Dataset(filename, 'w', format="NETCDF4")
try:
length = len(coord_list[0].data.flatten())
except AttributeError:
length = len(coord_list[0].points.flatten())
_ = netcdf_file.createDimension(index_name, length)
for coord in coord_list:
__create_variable(netcdf_file, coord, prefer_standard_name=True)
netcdf_file.close()
def add_data_to_file(data_object, filename):
"""
:param data_object:
:param filename:
:return:
"""
from cis import __version__
netcdf_file = Dataset(filename, 'a', format="NETCDF4")
var = __create_variable(netcdf_file, data_object, prefer_standard_name=False)
netcdf_file.source = "CIS" + __version__
netcdf_file.close()
|
zak-k/cis
|
cis/data_io/write_netcdf.py
|
Python
|
gpl-3.0
| 5,862
|
[
"NetCDF"
] |
b7e750948fc5d50581eaf67bb017aad8ecaca5812d0f13150f8541e48df9f70d
|
"""
Compute Bra-ket averaged Taylor expansion integrals over trajectories
traveling on adiabataic potentials
"""
import numpy as np
import nomad.core.glbl as glbl
import nomad.compiled.nuclear_gaussian as nuclear
# Let propagator know if we need data at centroids to propagate
require_centroids = False
# Determines the Hamiltonian symmetry
hermitian = True
# Returns functional form of bra function ('dirac_delta', 'gaussian')
basis = 'gaussian'
def v_integral(t1, t2, kecoef, nuc_ovrlp, elec_ovrlp):
"""Returns potential coupling matrix element between two trajectories
using the bra-ket averaged approach.
If we are passed a single trajectory, this is a diagonal matrix
element -- simply return potential energy of trajectory.
"""
if nuc_ovrlp is None:
nuc_ovrlp = nuc_overlap(t1, t2)
Sij = nuc_ovrlp
Sji = Sij.conjugate()
if glbl.properties['integral_order'] > 2:
raise ValueError('Integral_order > 2 not implemented for bra_ket_averaged')
if t1.state == t2.state:
state = t1.state
# Adiabatic energy
vij = t1.energy(state) * Sij
vji = t2.energy(state) * Sji
if glbl.properties['integral_order'] > 0:
o1_ij = nuclear.qn_vector(1, Sij, t1.widths(), t1.x(), t1.p(),
t2.widths(), t2.x(), t2.p())
o1_ji = nuclear.qn_vector(1, Sji, t2.widths(), t2.x(), t2.p(),
t1.widths(), t1.x(), t1.p())
vij += np.dot(o1_ij - t1.x()*Sij, t1.derivative(state,state))
vji += np.dot(o1_ji - t2.x()*Sji, t2.derivative(state,state))
if glbl.properties['integral_order'] > 1:
xcen = (t1.widths()*t1.x() + t2.widths()*t2.x()) / (t1.widths()+t2.widths())
o2_ij = nuclear.qn_vector(2, Sij, t1.widths(), t1.x(), t1.p(),
t2.widths(), t2.x(), t2.p())
o2_ji = nuclear.qn_vector(2, Sji, t2.widths(), t2.x(), t2.p(),
t1.widths(), t1.x(), t1.p())
for k in range(t1.dim):
vij += 0.5*o2_ij[k]*t1.hessian(state)[k,k]
vji += 0.5*o2_ji[k]*t2.hessian(state)[k,k]
for l in range(k):
vij += 0.5 * ((2.*o1_ij[k]*o1_ij[l] -
xcen[k]*o1_ij[l] - xcen[l]*o1_ij[k] -
o1_ij[k]*t1.x()[l] - o1_ij[l]*t1.x()[k] +
(t1.x()[k]*xcen[l] + t1.x()[l]*xcen[k])*Sij) *
t1.hessian(state)[k,l])
vji += 0.5 * ((2.*o1_ji[k]*o1_ji[l] -
xcen[k]*o1_ji[l] - xcen[l]*o1_ji[k] -
o1_ji[k]*t2.x()[l] - o1_ji[l]*t2.x()[k] +
(t2.x()[k]*xcen[l] + t2.x()[l]*xcen[k])*Sji) *
t2.hessian(state)[k,l])
return 0.5*(vij + vji.conjugate())
# [necessarily] off-diagonal matrix element between trajectories
# on different electronic states
else:
# Derivative coupling
fij = t1.derivative(t1.state, t2.state)
fji = t2.derivative(t2.state, t1.state)
vij = 2.*np.vdot(fij, kecoef *
nuclear.deldx(Sij,t1.widths(),t1.x(),t1.p(),
t2.widths(),t2.x(),t2.p()))
vji = 2.*np.vdot(fji, kecoef *
nuclear.deldx(Sji,t2.widths(),t2.x(),t2.p(),
t1.widths(),t1.x(),t1.p()))
# vij = np.vdot(t1.velocity(), fij)
# vji = np.vdot(t2.velocity(), fji)
# print("t1.v="+str(t1.velocity()))
# print("t2.v="+str(t2.velocity()))
# print("del/dx t1="+str(nuclear.deldx(Sij,t1.widths(),t1.x(),t1.p(),
# t2.widths(),t2.x(),t2.p())))
# print("del/dx t2="+str(nuclear.deldx(Sji,t2.widths(),t2.x(),t2.p(),
# t1.widths(),t1.x(),t1.p())))
# print("fij="+str(fij))
# print("fji="+str(fji))
# print("vij="+str(vij))
# print("vji="+str(vji))
# print("Sij="+str(Sij))
# return complex(0,1.)*0.5*Sij*(vij + vji)
return 0.5*(vij + vji.conjugate())
|
mschuurman/FMSpy
|
nomad/integrals/fms_bat.py
|
Python
|
lgpl-3.0
| 4,365
|
[
"Gaussian"
] |
de242cf9b9730283b2a4951686af64c445d58f9fda12e2dd3b375d695e49bbb1
|
from ase import *
from ase.constraints import StrainFilter
a = 3.6
b = a / 2
cu = Atoms('Cu', cell=[(0,b,b),(b,0,b),(b,b,0)], pbc=1) * (6, 6, 6)
try:
import Asap
except ImportError:
pass
else:
cu.set_calculator(ASAP())
f = UnitCellFilter(cu, [1, 1, 1, 0, 0, 0])
opt = QuasiNewton(f)
t = PickleTrajectory('Cu-fcc.traj', 'w', cu)
opt.attach(t)
opt.run(0.01)
# HCP:
from ase.lattice.surface import hcp0001
cu = hcp0001('Cu', (1, 1, 2), a=a / sqrt(2))
cu.cell[1,0] += 0.05
cu *= (6, 6, 3)
try:
import Asap
except ImportError:
pass
else:
cu.set_calculator(ASAP())
print cu.get_forces()
print cu.get_stress()
f = UnitCellFilter(cu)
opt = MDMin(f,dt=0.01)
t = PickleTrajectory('Cu-hcp.traj', 'w', cu)
opt.attach(t)
opt.run(0.02)
|
freephys/python_ase
|
ase/test/unitcellfilter.py
|
Python
|
gpl-3.0
| 796
|
[
"ASE"
] |
d5af32acef98aa746cf051b5f0ba0067e1606270b7f7f6107796c98048cb16d4
|
# searchAgents.py
# ---------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
#
# Attribution Information: The Pacman AI projects were developed at UC Berkeley.
# The core projects and autograders were primarily created by John DeNero
# (denero@cs.berkeley.edu) and Dan Klein (klein@cs.berkeley.edu).
# Student side autograding was added by Brad Miller, Nick Hay, and
# Pieter Abbeel (pabbeel@cs.berkeley.edu).
"""
This file contains all of the agents that can be selected to control Pacman. To
select an agent, use the '-p' option when running pacman.py. Arguments can be
passed to your agent using '-a'. For example, to load a SearchAgent that uses
depth first search (dfs), run the following command:
> python pacman.py -p SearchAgent -a fn=depthFirstSearch
Commands to invoke other search strategies can be found in the project
description.
Please only change the parts of the file you are asked to. Look for the lines
that say
"*** YOUR CODE HERE ***"
The parts you fill in start about 3/4 of the way down. Follow the project
description for details.
Good luck and happy searching!
"""
from game import Directions
from game import Agent
from game import Actions
import util
import time
import search
class GoWestAgent(Agent):
"An agent that goes West until it can't."
def getAction(self, state):
"The agent receives a GameState (defined in pacman.py)."
if Directions.WEST in state.getLegalPacmanActions():
return Directions.WEST
else:
return Directions.STOP
#######################################################
# This portion is written for you, but will only work #
# after you fill in parts of search.py #
#######################################################
class SearchAgent(Agent):
"""
This very general search agent finds a path using a supplied search
algorithm for a supplied search problem, then returns actions to follow that
path.
As a default, this agent runs DFS on a PositionSearchProblem to find
location (1,1)
Options for fn include:
depthFirstSearch or dfs
breadthFirstSearch or bfs
Note: You should NOT change any code in SearchAgent
"""
def __init__(self, fn='depthFirstSearch', prob='PositionSearchProblem', heuristic='nullHeuristic'):
# Warning: some advanced Python magic is employed below to find the right functions and problems
# Get the search function from the name and heuristic
if fn not in dir(search):
raise AttributeError, fn + ' is not a search function in search.py.'
func = getattr(search, fn)
if 'heuristic' not in func.func_code.co_varnames:
print('[SearchAgent] using function ' + fn)
self.searchFunction = func
else:
if heuristic in globals().keys():
heur = globals()[heuristic]
elif heuristic in dir(search):
heur = getattr(search, heuristic)
else:
raise AttributeError, heuristic + ' is not a function in searchAgents.py or search.py.'
print('[SearchAgent] using function %s and heuristic %s' % (fn, heuristic))
# Note: this bit of Python trickery combines the search algorithm and the heuristic
self.searchFunction = lambda x: func(x, heuristic=heur)
# Get the search problem type from the name
if prob not in globals().keys() or not prob.endswith('Problem'):
raise AttributeError, prob + ' is not a search problem type in SearchAgents.py.'
self.searchType = globals()[prob]
print('[SearchAgent] using problem type ' + prob)
def registerInitialState(self, state):
"""
This is the first time that the agent sees the layout of the game
board. Here, we choose a path to the goal. In this phase, the agent
should compute the path to the goal and store it in a local variable.
All of the work is done in this method!
state: a GameState object (pacman.py)
"""
if self.searchFunction == None: raise Exception, "No search function provided for SearchAgent"
starttime = time.time()
problem = self.searchType(state) # Makes a new search problem
self.actions = self.searchFunction(problem) # Find a path
totalCost = problem.getCostOfActions(self.actions)
print('Path found with total cost of %d in %.1f seconds' % (totalCost, time.time() - starttime))
if '_expanded' in dir(problem): print('Search nodes expanded: %d' % problem._expanded)
def getAction(self, state):
"""
Returns the next action in the path chosen earlier (in
registerInitialState). Return Directions.STOP if there is no further
action to take.
state: a GameState object (pacman.py)
"""
if 'actionIndex' not in dir(self): self.actionIndex = 0
i = self.actionIndex
self.actionIndex += 1
if i < len(self.actions):
return self.actions[i]
else:
return Directions.STOP
class PositionSearchProblem(search.SearchProblem):
"""
A search problem defines the state space, start state, goal test, successor
function and cost function. This search problem can be used to find paths
to a particular point on the pacman board.
The state space consists of (x,y) positions in a pacman game.
Note: this search problem is fully specified; you should NOT change it.
"""
def __init__(self, gameState, costFn = lambda x: 1, goal=(1,1), start=None, warn=True, visualize=True):
"""
Stores the start and goal.
gameState: A GameState object (pacman.py)
costFn: A function from a search state (tuple) to a non-negative number
goal: A position in the gameState
"""
self.walls = gameState.getWalls()
self.startState = gameState.getPacmanPosition()
if start != None: self.startState = start
self.goal = goal
self.costFn = costFn
self.visualize = visualize
if warn and (gameState.getNumFood() != 1 or not gameState.hasFood(*goal)):
print 'Warning: this does not look like a regular search maze'
# For display purposes
self._visited, self._visitedlist, self._expanded = {}, [], 0 # DO NOT CHANGE
def getStartState(self):
return self.startState
def isGoalState(self, state):
isGoal = state == self.goal
# For display purposes only
if isGoal and self.visualize:
self._visitedlist.append(state)
import __main__
if '_display' in dir(__main__):
if 'drawExpandedCells' in dir(__main__._display): #@UndefinedVariable
__main__._display.drawExpandedCells(self._visitedlist) #@UndefinedVariable
return isGoal
def getSuccessors(self, state):
"""
Returns successor states, the actions they require, and a cost of 1.
As noted in search.py:
For a given state, this should return a list of triples,
(successor, action, stepCost), where 'successor' is a
successor to the current state, 'action' is the action
required to get there, and 'stepCost' is the incremental
cost of expanding to that successor
"""
successors = []
for action in [Directions.NORTH, Directions.SOUTH, Directions.EAST, Directions.WEST]:
x,y = state
dx, dy = Actions.directionToVector(action)
nextx, nexty = int(x + dx), int(y + dy)
if not self.walls[nextx][nexty]:
nextState = (nextx, nexty)
cost = self.costFn(nextState)
successors.append( ( nextState, action, cost) )
# Bookkeeping for display purposes
self._expanded += 1 # DO NOT CHANGE
if state not in self._visited:
self._visited[state] = True
self._visitedlist.append(state)
return successors
def getCostOfActions(self, actions):
"""
Returns the cost of a particular sequence of actions. If those actions
include an illegal move, return 999999.
"""
if actions == None: return 999999
x,y= self.getStartState()
cost = 0
for action in actions:
# Check figure out the next state and see whether its' legal
dx, dy = Actions.directionToVector(action)
x, y = int(x + dx), int(y + dy)
if self.walls[x][y]: return 999999
cost += self.costFn((x,y))
return cost
class StayEastSearchAgent(SearchAgent):
"""
An agent for position search with a cost function that penalizes being in
positions on the West side of the board.
The cost function for stepping into a position (x,y) is 1/2^x.
"""
def __init__(self):
self.searchFunction = search.uniformCostSearch
costFn = lambda pos: .5 ** pos[0]
self.searchType = lambda state: PositionSearchProblem(state, costFn, (1, 1), None, False)
class StayWestSearchAgent(SearchAgent):
"""
An agent for position search with a cost function that penalizes being in
positions on the East side of the board.
The cost function for stepping into a position (x,y) is 2^x.
"""
def __init__(self):
self.searchFunction = search.uniformCostSearch
costFn = lambda pos: 2 ** pos[0]
self.searchType = lambda state: PositionSearchProblem(state, costFn)
def manhattanHeuristic(position, problem, info={}):
"The Manhattan distance heuristic for a PositionSearchProblem"
xy1 = position
xy2 = problem.goal
return abs(xy1[0] - xy2[0]) + abs(xy1[1] - xy2[1])
def euclideanHeuristic(position, problem, info={}):
"The Euclidean distance heuristic for a PositionSearchProblem"
xy1 = position
xy2 = problem.goal
return ( (xy1[0] - xy2[0]) ** 2 + (xy1[1] - xy2[1]) ** 2 ) ** 0.5
#####################################################
# This portion is incomplete. Time to write code! #
#####################################################
class CornersProblem(search.SearchProblem):
"""
This search problem finds paths through all four corners of a layout.
You must select a suitable state space and successor function
"""
def __init__(self, startingGameState):
"""
Stores the walls, pacman's starting position and corners.
"""
self.walls = startingGameState.getWalls()
self.startingPosition = startingGameState.getPacmanPosition()
top, right = self.walls.height-2, self.walls.width-2
self.corners = ((1,1), (1,top), (right, 1), (right, top))
for corner in self.corners:
if not startingGameState.hasFood(*corner):
print 'Warning: no food in corner ' + str(corner)
self._expanded = 0 # DO NOT CHANGE; Number of search nodes expanded
# Please add any code here which you would like to use
# in initializing the problem
"""
State is a tuple (pacmanposition, cornersMap)
pacmanposition: (x,y)
cornersMap: a tupple mapping for each corner in corners to boolen for visited
"""
self.cornersMap = tuple([False for x in self.corners]) # A tuple intially (False, False, False, False)
self.start = (self.startingPosition, self.cornersMap)
def getStartState(self):
"""
Returns the start state (in your state space, not the full Pacman state
space)
"""
return self.start
util.raiseNotDefined()
def isGoalState(self, state):
"""
Returns whether this search state is a goal state of the problem.
"""
return sum(state[1]) == len(state[1]) # Return whether all corners are visited
util.raiseNotDefined()
def getSuccessors(self, state):
"""
Returns successor states, the actions they require, and a cost of 1.
As noted in search.py:
For a given state, this should return a list of triples, (successor,
action, stepCost), where 'successor' is a successor to the current
state, 'action' is the action required to get there, and 'stepCost'
is the incremental cost of expanding to that successor
"""
successors = []
for action in [Directions.NORTH, Directions.SOUTH, Directions.EAST, Directions.WEST]:
# Add a successor state to the successor list if the action is legal
# Here's a code snippet for figuring out whether a new position hits a wall:
# x,y = currentPosition
# dx, dy = Actions.directionToVector(action)
# nextx, nexty = int(x + dx), int(y + dy)
# hitsWall = self.walls[nextx][nexty]
x,y = state[0]
dx, dy = Actions.directionToVector(action) # Get increment in x, y position of pacman
nextx, nexty = int(x+dx), int(y+dy)
if not self.walls[nextx][nexty]:
nextcornerMap = list(state[1]) # Intialise the next corner Map from current state of corners
nextpos = (nextx, nexty)
for i in range(0,len(self.corners)):
if nextpos == self.corners[i]:
nextcornerMap[i] = True # Update corner map if pacman visit that corners
successors.append( ( (nextpos, tuple(nextcornerMap)), action, 1) ) # Add to successor list a tuple (successor state, action, action cost)
self._expanded += 1 # DO NOT CHANGE
return successors
def getCostOfActions(self, actions):
"""
Returns the cost of a particular sequence of actions. If those actions
include an illegal move, return 999999. This is implemented for you.
"""
if actions == None: return 999999
x,y= self.startingPosition
for action in actions:
dx, dy = Actions.directionToVector(action)
x, y = int(x + dx), int(y + dy)
if self.walls[x][y]: return 999999
return len(actions)
def cornersHeuristic(state, problem):
"""
A heuristic for the CornersProblem that you defined.
state: The current search state
(a data structure you chose in your search problem)
problem: The CornersProblem instance for this layout.
This function should always return a number that is a lower bound on the
shortest path from the state to a goal of the problem; i.e. it should be
admissible (as well as consistent).
"""
corners = problem.corners # These are the corner coordinates
walls = problem.walls # These are the walls of the maze, as a Grid (game.py)
if problem.isGoalState(state): # If goal heurisitic returns 0
return 0
value = 0 # Intialise the heuristic value = 0
startPos = state[0] # Take pacman position as startPosition
cornersDict = dict(zip(corners, state[1])) # Dictionary mapping corners to True / False i.e. whether visited of not
remainingCorners = [x for x in corners if cornersDict[x] == False] # List of remaining unvisited corners
closestCorner = min(remainingCorners, key= lambda x: util.manhattanDistance(x, startPos))
closestCornerDist = util.manhattanDistance(closestCorner, startPos)
value += closestCornerDist # Add the distance from closed corner to pacman
"""Get Minimum Spanning Tree of unvisited nodes using Prim's"""
mstDict = {x: False for x in remainingCorners} # MST
Queue = util.PriorityQueue()
keyDict = {x:float("inf") for x in remainingCorners} # Intialize infinity weights
keyDict[closestCorner] = 0 # Make closed corner distance 0
for x in keyDict:
Queue.push(x, keyDict[x]) # Add all corners to queue
while sum(mstDict.values()) < len(mstDict):
u = Queue.pop()
mstDict[u] = True
value += keyDict[u] # Add edge weight to path cost
for v in remainingCorners:
if mstDict[v] == False and util.manhattanDistance(u, v) < keyDict[v]: # Update edge weight for adjacent corners to currently selected corner
keyDict[v] = util.manhattanDistance(u, v)
Queue.update(v, keyDict[v])
return value
return 0 # Default to trivial solution
class AStarCornersAgent(SearchAgent):
"A SearchAgent for FoodSearchProblem using A* and your foodHeuristic"
def __init__(self):
self.searchFunction = lambda prob: search.aStarSearch(prob, cornersHeuristic)
self.searchType = CornersProblem
class FoodSearchProblem:
"""
A search problem associated with finding the a path that collects all of the
food (dots) in a Pacman game.
A search state in this problem is a tuple ( pacmanPosition, foodGrid ) where
pacmanPosition: a tuple (x,y) of integers specifying Pacman's position
foodGrid: a Grid (see game.py) of either True or False, specifying remaining food
"""
def __init__(self, startingGameState):
self.start = (startingGameState.getPacmanPosition(), startingGameState.getFood())
self.walls = startingGameState.getWalls()
self.startingGameState = startingGameState
self._expanded = 0 # DO NOT CHANGE
self.heuristicInfo = {} # A dictionary for the heuristic to store information
def getStartState(self):
return self.start
def isGoalState(self, state):
return state[1].count() == 0
def getSuccessors(self, state):
"Returns successor states, the actions they require, and a cost of 1."
successors = []
self._expanded += 1 # DO NOT CHANGE
for direction in [Directions.NORTH, Directions.SOUTH, Directions.EAST, Directions.WEST]:
x,y = state[0]
dx, dy = Actions.directionToVector(direction)
nextx, nexty = int(x + dx), int(y + dy)
if not self.walls[nextx][nexty]:
nextFood = state[1].copy()
nextFood[nextx][nexty] = False
successors.append( ( ((nextx, nexty), nextFood), direction, 1) )
return successors
def getCostOfActions(self, actions):
"""Returns the cost of a particular sequence of actions. If those actions
include an illegal move, return 999999"""
x,y= self.getStartState()[0]
cost = 0
for action in actions:
# figure out the next state and see whether it's legal
dx, dy = Actions.directionToVector(action)
x, y = int(x + dx), int(y + dy)
if self.walls[x][y]:
return 999999
cost += 1
return cost
class AStarFoodSearchAgent(SearchAgent):
"A SearchAgent for FoodSearchProblem using A* and your foodHeuristic"
def __init__(self):
self.searchFunction = lambda prob: search.aStarSearch(prob, foodHeuristic)
self.searchType = FoodSearchProblem
def foodHeuristic(state, problem):
"""
Your heuristic for the FoodSearchProblem goes here.
This heuristic must be consistent to ensure correctness. First, try to come
up with an admissible heuristic; almost all admissible heuristics will be
consistent as well.
If using A* ever finds a solution that is worse uniform cost search finds,
your heuristic is *not* consistent, and probably not admissible! On the
other hand, inadmissible or inconsistent heuristics may find optimal
solutions, so be careful.
The state is a tuple ( pacmanPosition, foodGrid ) where foodGrid is a Grid
(see game.py) of either True or False. You can call foodGrid.asList() to get
a list of food coordinates instead.
If you want access to info like walls, capsules, etc., you can query the
problem. For example, problem.walls gives you a Grid of where the walls
are.
If you want to *store* information to be reused in other calls to the
heuristic, there is a dictionary called problem.heuristicInfo that you can
use. For example, if you only want to count the walls once and store that
value, try: problem.heuristicInfo['wallCount'] = problem.walls.count()
Subsequent calls to this heuristic can access
problem.heuristicInfo['wallCount']
"""
position, foodGrid = state
foodList = foodGrid.asList()
if problem.isGoalState(state): # If goal heurisitic returns 0
return 0
value = 0 # Intialise the heuristic value = 0
closestFood = min(foodList, key= lambda x: mazeDistance(x, position, problem.startingGameState))
closestFoodDist = mazeDistance(closestFood, position, problem.startingGameState)
value += closestFoodDist # Add the distance from closed food to pacman
"""Get Minimum Spanning Tree of unvisited food dots using Prim's"""
mstDict = {x: False for x in foodList}
Queue = util.PriorityQueue()
keyDict = {x:float("inf") for x in foodList} # Intialize infinity weights
keyDict[closestFood] = 0 # Make closed food dot distance 0
for x in keyDict: # Add all food dots to Queue
Queue.push(x, keyDict[x])
while sum(mstDict.values()) < len(mstDict) :
u = Queue.pop()
mstDict[u] = True
value += keyDict[u] # Add edge weight to path cost
for v in foodList:
if mstDict[v] == False and mazeDistance(u, v, problem.startingGameState) < keyDict[v]:
keyDict[v] = mazeDistance(u, v, problem.startingGameState) # Update edge weight for adjacent food dots to currently selected food dot
Queue.update(v, keyDict[v])
return value
return 0
class ClosestDotSearchAgent(SearchAgent):
"Search for all food using a sequence of searches"
def registerInitialState(self, state):
self.actions = []
currentState = state
while(currentState.getFood().count() > 0):
nextPathSegment = self.findPathToClosestDot(currentState) # The missing piece
self.actions += nextPathSegment
for action in nextPathSegment:
legal = currentState.getLegalActions()
if action not in legal:
t = (str(action), str(currentState))
raise Exception, 'findPathToClosestDot returned an illegal move: %s!\n%s' % t
currentState = currentState.generateSuccessor(0, action)
self.actionIndex = 0
print 'Path found with cost %d.' % len(self.actions)
def findPathToClosestDot(self, gameState):
"""
Returns a path (a list of actions) to the closest dot, starting from
gameState.
"""
# Here are some useful elements of the startState
startPosition = gameState.getPacmanPosition()
food = gameState.getFood()
walls = gameState.getWalls()
problem = AnyFoodSearchProblem(gameState)
return search.uniformCostSearch(problem) # Returns solution to closedDot based on uniformCostSearch
util.raiseNotDefined()
class AnyFoodSearchProblem(PositionSearchProblem):
"""
A search problem for finding a path to any food.
This search problem is just like the PositionSearchProblem, but has a
different goal test, which you need to fill in below. The state space and
successor function do not need to be changed.
The class definition above, AnyFoodSearchProblem(PositionSearchProblem),
inherits the methods of the PositionSearchProblem.
You can use this search problem to help you fill in the findPathToClosestDot
method.
"""
def __init__(self, gameState):
"Stores information from the gameState. You don't need to change this."
# Store the food for later reference
self.food = gameState.getFood()
# Store info for the PositionSearchProblem (no need to change this)
self.walls = gameState.getWalls()
self.startState = gameState.getPacmanPosition()
self.costFn = lambda x: 1
self._visited, self._visitedlist, self._expanded = {}, [], 0 # DO NOT CHANGE
def isGoalState(self, state):
"""
The state is Pacman's position. Fill this in with a goal test that will
complete the problem definition.
"""
x,y = state
return self.food[x][y] # Return if pacman position is a food dot
util.raiseNotDefined()
def mazeDistance(point1, point2, gameState):
"""
Returns the maze distance between any two points, using the search functions
you have already built. The gameState can be any game state -- Pacman's
position in that state is ignored.
Example usage: mazeDistance( (2,4), (5,6), gameState)
This might be a useful helper function for your ApproximateSearchAgent.
"""
x1, y1 = point1
x2, y2 = point2
walls = gameState.getWalls()
assert not walls[x1][y1], 'point1 is a wall: ' + str(point1)
assert not walls[x2][y2], 'point2 is a wall: ' + str(point2)
prob = PositionSearchProblem(gameState, start=point1, goal=point2, warn=False, visualize=False)
return len(search.bfs(prob))
|
namangoyal6/artificial-intelligence
|
Search/code/searchAgents.py
|
Python
|
mit
| 25,423
|
[
"VisIt"
] |
7bc30b15096a53213b4f1806258dcf93725db8b970dd8b03229e45dd2790e109
|
#!/usr/bin/env python
import os
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Now create the RenderWindow, Renderer and Interactor
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
sphereModel = vtk.vtkSphereSource()
sphereModel.SetThetaResolution(10)
sphereModel.SetPhiResolution(10)
voxelModel = vtk.vtkVoxelModeller()
voxelModel.SetInputConnection(sphereModel.GetOutputPort())
voxelModel.SetSampleDimensions(21, 21, 21)
voxelModel.SetModelBounds(-1.5, 1.5, -1.5, 1.5, -1.5, 1.5)
voxelModel.SetScalarTypeToBit()
voxelModel.SetForegroundValue(1)
voxelModel.SetBackgroundValue(0)
#
# If the current directory is writable, then test the writers
#
try:
channel = open("voxelModel.vtk", "wb")
channel.close()
aWriter = vtk.vtkDataSetWriter()
aWriter.SetFileName("voxelModel.vtk")
aWriter.SetInputConnection(voxelModel.GetOutputPort())
aWriter.Update()
aReader = vtk.vtkDataSetReader()
aReader.SetFileName("voxelModel.vtk")
voxelSurface = vtk.vtkContourFilter()
voxelSurface.SetInputConnection(aReader.GetOutputPort())
voxelSurface.SetValue(0, .999)
voxelMapper = vtk.vtkPolyDataMapper()
voxelMapper.SetInputConnection(voxelSurface.GetOutputPort())
voxelActor = vtk.vtkActor()
voxelActor.SetMapper(voxelMapper)
sphereMapper = vtk.vtkPolyDataMapper()
sphereMapper.SetInputConnection(sphereModel.GetOutputPort())
sphereActor = vtk.vtkActor()
sphereActor.SetMapper(sphereMapper)
ren1.AddActor(sphereActor)
ren1.AddActor(voxelActor)
ren1.SetBackground(.1, .2, .4)
renWin.SetSize(256, 256)
ren1.ResetCamera()
ren1.GetActiveCamera().SetViewUp(0, -1, 0)
ren1.GetActiveCamera().Azimuth(180)
ren1.GetActiveCamera().Dolly(1.75)
ren1.ResetCameraClippingRange()
# cleanup
#
try:
os.remove("voxelModel.vtk")
except OSError:
pass
iren.Initialize()
# render the image
# iren.Start()
except IOError:
print("Unable to test the writer/reader.")
|
hlzz/dotfiles
|
graphics/VTK-7.0.0/Imaging/Core/Testing/Python/voxelModel.py
|
Python
|
bsd-3-clause
| 2,253
|
[
"VTK"
] |
653132703325591b9b9e41cd95da2b85bc8f3cdfc1e95e6e60d665cc0d9b11fd
|
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Red Hat | Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Options for authenticating with the API.
class ModuleDocFragment(object):
DOCUMENTATION = r'''
options:
host:
description:
- Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
type: str
api_key:
description:
- Token used to authenticate with the API. Can also be specified via K8S_AUTH_API_KEY environment variable.
type: str
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json). Can also be specified via K8S_AUTH_KUBECONFIG environment
variable.
type: path
context:
description:
- The name of a context found in the config file. Can also be specified via K8S_AUTH_CONTEXT environment variable.
type: str
username:
description:
- Provide a username for authenticating with the API. Can also be specified via K8S_AUTH_USERNAME environment
variable.
- Please note that this only works with clusters configured to use HTTP Basic Auth. If your cluster has a
different form of authentication (e.g. OAuth2 in OpenShift), this option will not work as expected and you
should look into the C(k8s_auth) module, as that might do what you need.
type: str
password:
description:
- Provide a password for authenticating with the API. Can also be specified via K8S_AUTH_PASSWORD environment
variable.
- Please read the description of the C(username) option for a discussion of when this option is applicable.
type: str
cert_file:
description:
- Path to a certificate used to authenticate with the API. Can also be specified via K8S_AUTH_CERT_FILE environment
variable.
type: path
key_file:
description:
- Path to a key file used to authenticate with the API. Can also be specified via K8S_AUTH_KEY_FILE environment
variable.
type: path
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API. The full certificate chain must be provided to
avoid certificate validation errors. Can also be specified via K8S_AUTH_SSL_CA_CERT environment variable.
type: path
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates. Can also be specified via K8S_AUTH_VERIFY_SSL
environment variable.
type: bool
notes:
- "The OpenShift Python client wraps the K8s Python client, providing full access to
all of the APIS and models available on both platforms. For API version details and
additional information visit https://github.com/openshift/openshift-restclient-python"
- "To avoid SSL certificate validation errors when C(verify_ssl) is I(True), the full
certificate chain for the API server must be provided via C(ssl_ca_cert) or in the
kubeconfig file."
'''
|
andmos/ansible
|
lib/ansible/plugins/doc_fragments/k8s_auth_options.py
|
Python
|
gpl-3.0
| 3,129
|
[
"VisIt"
] |
f770f2f99fcebe6d2928be292cb455275ec28903ac0d994131299267dfd0eda7
|
from brian import *
import random
# ###########################################
# Configuration
# ###########################################
set_global_preferences(useweave=True)
set_global_preferences(usecodegen=True)
#set_global_preferences(openmp=True)
record = True
plot_all = True
# ###########################################
# Network parameters
# ###########################################
NE = 8000 # Number of excitatory neurons
NI = 2000 # Number of excitatory neurons
Nrec = 50 # Number of neurons to record
J_ex = 0.1 # excitatory weight
J_in = -0.5 # inhibitory weight
p_rate = 20. * Hz # external Poisson rate
delay = 1.5 * ms # synaptic delay
tau_m = 20.0 * ms
taupre = 20.*ms
taupost = 20.*ms
wmax = 0.3
lbda = 0.01
alpha = 2.02
simtime = 0.3*second # Simulation time
# ###########################################
# Neuron model
# ###########################################
eqs_neurons='''
dv/dt = -v/tau_m : 1
'''
# ###########################################
# Synapse model
# ###########################################
model='''w:1
dApre/dt=-Apre/taupre : 1 (event-driven)
dApost/dt=-Apost/taupost : 1 (event-driven)'''
pre_spike = '''v+=w
Apre += 1
w-= lbda * alpha * w * Apost
'''
post_spike = '''
Apost += 1
w += lbda * (wmax - w) * Apre
'''
# ###########################################
# Population
# ###########################################
P = NeuronGroup(NE+NI, model=eqs_neurons, threshold=20., reset=0., refractory=2.*ms)
Pe = P.subgroup(NE)
Pi = P.subgroup(NI)
P.v = (-20. + 1.95*20.*rand(NE+NI))
poisson = PoissonGroup(NE+NI, rates=p_rate)
# ###########################################
# Projections
# ###########################################
# EE
ee = Synapses(Pe, Pe, model=model,pre=pre_spike, post=post_spike)
for post in xrange(NE):
ee[random.sample(xrange(NE), NE/10), post] = True
ee.w[:,:]='(0.5+rand())*J_ex'
ee.delay = delay
# EI
ei = Synapses(Pe, Pi, model='w:1',pre='v+=w')
for post in xrange(NI):
ei[random.sample(xrange(NE), NE/10), post] = True
ei.w[:,:]='(0.5+rand())*J_ex'
ei.delay = delay
# II
ii = Synapses(Pi, P, model='w:1',pre='v+=w')
for post in xrange(NE+NI):
ii[random.sample(xrange(NI), NI/10), post] = True
ii.w = J_in
ii.delay = delay
noise = Synapses(poisson, P, model='w:1',pre='v+=w')
for post in xrange(NE+NI):
noise[random.sample(xrange(NE+NI), (NE+NI)/10), post] = True
noise.w = J_ex
noise.delay = delay
# ###########################################
# Setting up monitors
# ###########################################
if record:
sm = SpikeMonitor(P[:Nrec])
# ###########################################
# Simulation
# ###########################################
print 'Start simulation'
from time import time
ts = time()
run(simtime)
print 'Simulation took', time() - ts, 's'
if record:
print 'Mean firing rate:', sm.nspikes/float(Nrec)/float(simtime), 'Hz'
# ###########################################
# Make plots
# ###########################################
if plot_all:
if record:
raster_plot(sm, ms=2.)
show()
# Weights
weights = ee.w[:, :Nrec].flatten()
hist(weights, bins=100)
xlabel('Synaptic weight [pA]')
show()
|
vitay/ANNarchy
|
benchmarks/brunel/Brian-Brunel-plastic.py
|
Python
|
gpl-2.0
| 3,239
|
[
"Brian",
"NEURON"
] |
2256c367e4fc537097549ee56dca4f11a8af8959d2c6d2f2190959ea2bee9eb3
|
#! /usr/bin/env python
#
# The purpose of this script is to create a moltemplate lt file for the opls.
# and oplsaa forcefields.
__author__ = 'Jason Lambert and Andrew Jewett'
# (some additional corrections by Miguel Gonzalez, Yue Chun Chiu and others)
__version__ = '0.1'
__date__ = '2016-11-20'
import sys
import os
from sets import Set
from operator import itemgetter
g_program_name = __file__.split('/')[-1]
doc_msg = \
"Typical Usage:\n\n" + \
" "+g_program_name+" -name OPLS < oplsaa.prm > oplsaa.lt\n\n" + \
" where \"oplsaa.prm\" is a force-field file downloaded from the TINKER website,\n" + \
" \"oplsaa.lt\" is the corresponding file converted into moltemplate (.lt) format.\n" + \
" and \"OPLS\" is the name that future moltemplate users will use to refer to\n" + \
" this force-field (optional).\n" + \
"Optional Arguments\n" + \
" -name FORCEFIELDNAME # Give the force-field a name\n" + \
" -file FILE_NAME # Read force field parameters from a file\n" + \
" -url URL # Read force field parameters from a file on the web\n" + \
" -atoms \"QUOTED LIST\" # Restrict output to a subset of atom types\n"
def SplitQuotedString(string,
quotes='\'\"',
delimiters=' \t\r\f\n',
escape='\\',
comment_char='#'):
tokens = []
token = ''
reading_token = True
escaped_state = False
quote_state = None
for c in string:
if (c in comment_char) and (not escaped_state) and (quote_state==None):
tokens.append(token)
return tokens
elif (c in delimiters) and (not escaped_state) and (quote_state==None):
if reading_token:
tokens.append(token)
token = ''
reading_token = False
elif c in escape:
if escaped_state:
token += c
reading_token = True
escaped_state = False
else:
escaped_state = True
# and leave c (the '\' character) out of token
elif (c in quotes) and (not escaped_state):
if (quote_state != None):
if (c == quote_state):
quote_state = None
else:
quote_state = c
token += c
reading_token = True
else:
if (c == 'n') and (escaped_state == True):
c = '\n'
elif (c == 't') and (escaped_state == True):
c = '\t'
elif (c == 'r') and (escaped_state == True):
c = '\r'
elif (c == 'f') and (escaped_state == True):
c = '\f'
token += c
reading_token = True
escaped_state = False
if len(string) > 0:
tokens.append(token)
return tokens
def RemoveOuterQuotes(text, quotes='\"\''):
if ((len(text)>=2) and (text[0] in quotes) and (text[-1]==text[0])):
return text[1:-1]
else:
return text
try:
sys.stderr.write(g_program_name+", version "+__version__+", "+__date__+"\n")
if sys.version < '2.6':
raise Exception('Error: Using python '+sys.version+'\n'+
' Alas, your version of python is too old.\n'
' You must upgrade to a newer version of python (2.6 or later).')
if sys.version < '2.7':
from ordereddict import OrderedDict
else:
from collections import OrderedDict
if sys.version > '3':
import io
else:
import cStringIO
# defaults:
ffname = "TINKER_FORCE_FIELD"
type_subset = Set([])
filename_in = ""
file_in = sys.stdin
pair_style_name = "lj/cut/coul/long"
pair_style_link = "http://lammps.sandia.gov/doc/pair_lj.html"
bond_style_name = "harmonic"
bond_style_link = "http://lammps.sandia.gov/doc/bond_harmonic.html"
angle_style_name = "harmonic"
angle_style_link = "http://lammps.sandia.gov/doc/angle_harmonic.html"
dihedral_style_name = "fourier"
dihedral_style_link = "http://lammps.sandia.gov/doc/dihedral_fourier.html"
improper_style_name = "harmonic"
improper_style_link = "http://lammps.sandia.gov/doc/improper_harmonic.html"
special_bonds_command = "special_bonds lj/coul 0.0 0.0 0.5"
mixing_style = "geometric"
contains_united_atoms = False
argv = [arg for arg in sys.argv]
i = 1
while i < len(argv):
#sys.stderr.write('argv['+str(i)+'] = \"'+argv[i]+'\"\n')
if argv[i] == '-atoms':
if i+1 >= len(argv):
raise Exception('Error: the \"'+argv[i]+'\" argument should be followed by a quoted string\n'
' which contains a space-delimited list of of a subset of atom types\n'
' you want to use from the original force-field.\n'
' Make sure you enclose the entire list in quotes.\n');
type_subset = Set(argv[i+1].strip('\"\'').strip().split())
del argv[i:i+2]
elif argv[i] == '-name':
if i+1 >= len(argv):
raise Exception('Error: '+argv[i]+' flag should be followed by the name of the force-field\n')
ffname = argv[i+1]
del argv[i:i+2]
elif argv[i] in ('-file','-in-file'):
if i+1 >= len(argv):
raise Exception('Error: '+argv[i]+' flag should be followed by the name of a force-field file\n')
filename_in = argv[i+1]
try:
file_in = open(filename_in, 'r')
except IOError:
sys.stderr.write('Error: Unable to open file\n'
' \"'+filename_in+'\"\n'
' for reading.\n')
sys.exit(1)
del argv[i:i+2]
elif argv[i] == '-dihedral-style':
if i+1 >= len(argv):
raise Exception('Error: '+argv[i]+' flag should be followed by either \"opls\" or \"fourier\"\n')
dihedral_style_name = argv[i+1]
if dihedral_style_name == "fourier":
dihedral_style_link = "http://lammps.sandia.gov/doc/dihedral_fourier.html"
if dihedral_style_name == "opls":
dihedral_style_link = "http://lammps.sandia.gov/doc/dihedral_opls.html"
else:
raise Exception('Error: '+argv[i]+' '+dihedral_style_name+' not supported.\n')
del argv[i:i+2]
elif argv[i] in ('-url','-in-url'):
import urllib2
if i+1 >= len(argv):
raise Exception('Error: '+argv[i]+' flag should be followed by the name of a force-field file.\n')
url = argv[i+1]
try:
request = urllib2.Request(url)
file_in = urllib2.urlopen(request)
except urllib2.URLError:
sys.stdout.write("Error: Unable to open link:\n"+url+"\n")
sys.exit(1)
del argv[i:i+2]
elif argv[i] in ('-help','--help','-?','--?'):
sys.stderr.write(doc_msg)
sys.exit(0)
del argv[i:i+1]
else:
i += 1
if len(argv) != 1:
raise Exception('Error: Unrecongized arguments: ' +' '.join(argv[1:]) +
'\n\n'+ doc_msg)
#sys.stderr.write("Reading parameter file...\n")
lines = file_in.readlines()
atom2charge = OrderedDict() # lookup charge from atom type
atom2mass = OrderedDict() # lookup mass from atom type
atom2vdw_e = OrderedDict() # lookup Lennard-Jones "epsilon" parameter
atom2vdw_s = OrderedDict() # lookup Lennard-Jones "sigma" parameter
atom2descr = OrderedDict()
atom2ffid = OrderedDict() # lookup force-field-ID from atom type
# force-field-ID is an id number/string used to assign
# bonds, angles, dihedrals, and impropers.
bonds_by_type = OrderedDict() # lookup bond parameters by force-field-ID
angles_by_type = OrderedDict() # lookup angle parameters by force-field-ID
dihedrals_by_type = OrderedDict() # lookup dihedral parameters by force-field-ID
impropers_by_type = OrderedDict() # lookup improper parameters by force-field-ID
lines_ureybrad = []
lines_biotype = []
for iline in range(0, len(lines)):
line = lines[iline]
tokens = SplitQuotedString(line.strip(),
comment_char='#')
if (len(tokens)>1) and (tokens[0] == 'atom'):
tokens = map(RemoveOuterQuotes,
SplitQuotedString(line.strip(),
comment_char=''))
if (len(tokens) > 6):
if ((len(type_subset) == 0) or (tokens[1] in type_subset)):
atom2ffid[tokens[1]] = tokens[2]
#atom2mass[tokens[1]] = float(tokens[6])
#Some atoms in oplsaa.prm have zero mass. Unfortunately this
#causes LAMMPS to crash, even if these atoms are never used,
#so I give the mass a non-zero value instead.
atom2mass[tokens[1]] = max(float(tokens[6]), 1e-30)
atom2descr[tokens[1]] = tokens[4]
if tokens[4].find('(UA)') != -1:
contains_united_atoms = True
else:
raise Exception('Error: Invalid atom line:\n'+line)
elif (len(tokens) > 2) and (tokens[0] == 'charge'):
if ((len(type_subset) == 0) or (tokens[1] in type_subset)):
atom2charge[tokens[1]] = float(tokens[2])
elif (len(tokens) > 3) and (tokens[0] == 'vdw'):
if ((len(type_subset) == 0) or (tokens[1] in type_subset)):
atom2vdw_e[tokens[1]] = float(tokens[3]) # "epsilon"
atom2vdw_s[tokens[1]] = float(tokens[2]) # "sigma"
elif (len(tokens) > 4) and (tokens[0] == 'bond'):
k = float(tokens[3])
r0 = float(tokens[4])
bonds_by_type[tokens[1],tokens[2]] = (k, r0)
elif (len(tokens) > 5) and (tokens[0] == 'angle'):
k = float(tokens[4])
angle0 = float(tokens[5])
angles_by_type[tokens[1],tokens[2],tokens[3]] = (k, angle0)
elif (len(tokens) > 11) and (tokens[0] == 'torsion'):
if dihedral_style_name == 'fourier':
# http://lammps.sandia.gov/doc/dihedral_fourier.html
m = (len(tokens) - 5) / 3
K = [0.0 for i in range(0,m)]
n = [0.0 for i in range(0,m)]
d = [0.0 for i in range(0,m)]
for i in range(0,m):
K[i] = float(tokens[5+3*i])
d[i] = float(tokens[5+3*i+1])
n[i] = float(tokens[5+3*i+2])
dihedrals_by_type[tokens[1],tokens[2],tokens[3],tokens[4]]=(K,n,d)
elif dihedral_style_name == 'opls':
# http://lammps.sandia.gov/doc/dihedral_opls.html
K1 = float(tokens[5])
K2 = float(tokens[8])
K3 = float(tokens[11])
K4 = 0.0
if len(tokens) > 14:
K4 = float(tokens[14])
if ((float(tokens[6]) != 0.0) or (float(tokens[7]) != 1.0) or
(float(tokens[9]) not in (180.0,-180.0)) or (float(tokens[10]) != 2.0) or
(float(tokens[12]) != 0.0) or (float(tokens[13]) != 3.0) or
((K4 != 0.0) and
((len(tokens) <= 16) or
(float(tokens[15]) not in (180.0,-180.0)) or
(float(tokens[16]) != 4.0)))):
raise Exception("Error: This parameter file is incompatible with -dihedral-style \""+dihedral_style_name+"\"\n"+
" (See line number "+str(iline+1)+" of parameter file.)\n")
dihedrals_by_type[tokens[1],tokens[2],tokens[3],tokens[4]]=(K1,K2,K3,K4)
else:
assert(False)
elif (len(tokens) > 7) and (tokens[0] == 'imptors'):
k = float(tokens[5])
angle0 = float(tokens[6])
multiplicity = float(tokens[7])
impropers_by_type[tokens[1],tokens[2],tokens[3],tokens[4]] = (k/multiplicity, angle0)
elif ((len(tokens) > 0) and (tokens[0] == 'biotype')):
# I'm not sure what to do with these, so I'll store them for now and
# append them as comments to the .lt file generated by the program.
lines_biotype.append(line.rstrip())
elif ((len(tokens) > 0) and (tokens[0] == 'ureybrad')):
# I'm not sure what to do with these, so I'll store them for now and
# append them as comments to the .lt file generated by the program.
lines_ureybrad.append(line.rstrip())
elif ((len(tokens) > 1) and (tokens[0] == 'radiusrule')):
if tokens[1] == 'GEOMETRIC':
mixing_style = 'geometric'
elif tokens[1] == 'ARITHMETIC':
mixing_style = 'arithmetic'
else:
raise Exception("Error: Unrecognized mixing style: "+tokens[1]+", found here:\n" +
line)
elif ((len(tokens) > 1) and (tokens[0] == 'epsilonrule')):
if tokens[1] != 'GEOMETRIC':
raise Exception("Error: As of 2016-9-21, LAMMPS only supports GEOMETRIC mixing of energies\n" +
" This force field simply cannot be used with LAMMPS in a general way.\n" +
" One way around this is to manually change the \"epsilonrule\" back to\n" +
" GEOMETRIC, and limit the number of atom types considered by this\n" +
" program by using the -atoms \"LIST OF ATOMS\" argument,\n" +
" to only include the atoms you care about, and then explicitly\n" +
" define pair_coeffs for all possible pairs of these atom types.\n" +
" If this is a popular force-field, then lobby the LAMMPS developers\n" +
" to consider alternate mixing rules.\n\n" +
"The offending line from the file is line number "+str(iline)+":\n" +
line+"\n")
except Exception as err:
sys.stderr.write('\n\n'+str(err)+'\n')
sys.exit(1)
#sys.stderr.write(" done.\n")
#sys.stderr.write("Converting to moltemplate format...\n")
system_is_charged = False
for atom_type in atom2charge:
if atom2charge[atom_type] != 0.0:
system_is_charged = True
if system_is_charged:
pair_style_name = "lj/cut/coul/long"
pair_style_params = "10.0 10.0"
kspace_style = " kspace_style pppm 0.0001\n"
pair_style_link = "http://lammps.sandia.gov/doc/pair_lj.html"
else:
pair_style_name = "lj/cut"
pair_style_params = "10.0"
kspace_style = ""
pair_style_link = "http://lammps.sandia.gov/doc/pair_lj.html"
pair_style_command = " pair_style hybrid "+pair_style_name+" "+pair_style_params+"\n"
sys.stdout.write("# This file was generated automatically using:\n")
sys.stdout.write("# "+g_program_name+" "+" ".join(sys.argv[1:])+"\n")
if contains_united_atoms:
sys.stdout.write("#\n"
"# WARNING: Many of these atoms are probably UNITED-ATOM (UA) atoms.\n"
"# The hydrogen atoms have been absorbed into the heavy atoms, and the\n"
"# force-field modified accordingly. Do not mix with ordinary atoms.\n")
sys.stdout.write("#\n"
"# WARNING: The following 1-2, 1-3, and 1-4 weighting parameters were ASSUMED:\n")
sys.stdout.write("# "+special_bonds_command+"\n")
sys.stdout.write("# (See http://lammps.sandia.gov/doc/special_bonds.html for details)\n")
if len(lines_ureybrad) > 0:
sys.stdout.write("#\n"
"# WARNING: All Urey-Bradley interactions have been IGNORED including:\n")
sys.stdout.write("# ffid1 ffid2 ffid3 K r0\n# ")
sys.stdout.write("\n# ".join(lines_ureybrad))
sys.stdout.write("\n\n")
sys.stdout.write("\n\n")
sys.stdout.write(ffname+" {\n\n")
sys.stdout.write(" # Below we will use lammps \"set\" command to assign atom charges\n"
" # by atom type. http://lammps.sandia.gov/doc/set.html\n\n")
sys.stdout.write(" write_once(\"In Charges\") {\n")
for atype in atom2mass:
assert(atype in atom2descr)
sys.stdout.write(" set type @atom:" + atype + " charge " + str(atom2charge[atype]) +
" # \"" + atom2descr[atype] + "\"\n")
sys.stdout.write(" } #(end of atom partial charges)\n\n\n")
sys.stdout.write(" write_once(\"Data Masses\") {\n")
for atype in atom2mass:
sys.stdout.write(" @atom:" + atype + " " + str(atom2mass[atype]) + "\n")
sys.stdout.write(" } #(end of atom masses)\n\n\n")
sys.stdout.write(" # ---------- EQUIVALENCE CATEGORIES for bonded interaction lookup ----------\n"
" # Each type of atom has a separate ID used for looking up bond parameters\n"
" # and a separate ID for looking up 3-body angle interaction parameters\n"
" # and a separate ID for looking up 4-body dihedral interaction parameters\n"
" # and a separate ID for looking up 4-body improper interaction parameters\n"
#" # (This is because there are several different types of sp3 carbon atoms\n"
#" # which have the same torsional properties when within an alkane molecule,\n"
#" # for example. If they share the same dihedral-ID, then this frees us\n"
#" # from being forced define separate dihedral interaction parameters\n"
#" # for all of them.)\n"
" # The complete @atom type name includes ALL of these ID numbers. There's\n"
" # no need to force the end-user to type the complete name of each atom.\n"
" # The \"replace\" command used below informs moltemplate that the short\n"
" # @atom names we have been using abovee are equivalent to the complete\n"
" # @atom names used below:\n\n")
for atype in atom2ffid:
ffid = atype + "_ffid" + atom2ffid[atype]
sys.stdout.write(" replace{ @atom:" + atype +
" @atom:"+atype+"_b"+atom2ffid[atype]+"_a"+atom2ffid[atype]+"_d"+atom2ffid[atype]+"_i"+atom2ffid[atype]+" }\n")
sys.stdout.write("\n\n\n\n")
sys.stdout.write(" # --------------- Non-Bonded interactions: ---------------------\n"
" # "+pair_style_link+"\n"
" # Syntax:\n"
" # pair_coeff AtomType1 AtomType2 pair_style_name parameters...\n\n")
sys.stdout.write(" write_once(\"In Settings\") {\n")
for atype in atom2vdw_e:
assert(atype in atom2vdw_s)
assert(atype in atom2ffid)
sys.stdout.write(" pair_coeff " +
"@atom:"+atype+"_b"+atom2ffid[atype]+"_a"+atom2ffid[atype]+"_d"+atom2ffid[atype]+"_i"+atom2ffid[atype]+" "
"@atom:"+atype+"_b"+atom2ffid[atype]+"_a"+atom2ffid[atype]+"_d"+atom2ffid[atype]+"_i"+atom2ffid[atype]+" "+
pair_style_name +
" " + str(atom2vdw_e[atype]) +
" " + str(atom2vdw_s[atype]) + "\n")
sys.stdout.write(" } #(end of pair_coeffs)\n\n\n\n")
sys.stdout.write(" # ------- Bonded Interactions: -------\n"
" # "+bond_style_link+"\n"
" # Syntax: \n"
" # bond_coeff BondTypeName BondStyle parameters...\n\n")
sys.stdout.write(" write_once(\"In Settings\") {\n")
for btype in bonds_by_type:
ffid1 = btype[0] if btype[0] != "0" else "X"
ffid2 = btype[1] if btype[1] != "0" else "X"
(k,r0) = bonds_by_type[btype]
sys.stdout.write(" bond_coeff @bond:" + ffid1 + "-" + ffid2 + " " +
bond_style_name +" "+ str(k) + " " +str(r0) + "\n")
sys.stdout.write(" } #(end of bond_coeffs)\n\n")
sys.stdout.write(" # Rules for assigning bond types by atom type:\n"
" # BondTypeName AtomType1 AtomType2\n"
" # (* = wildcard)\n\n")
sys.stdout.write(" write_once(\"Data Bonds By Type\") {\n")
for btype in bonds_by_type:
ffid1 = btype[0] if btype[0] != "0" else "X"
ffid2 = btype[1] if btype[1] != "0" else "X"
sys.stdout.write(" @bond:" + ffid1 + "-" + ffid2)
ffid1 = "@atom:*_b"+btype[0]+"_a*_d*_i*" if btype[0] != "0" else "@atom:*"
ffid2 = "@atom:*_b"+btype[1]+"_a*_d*_i*" if btype[1] != "0" else "@atom:*"
sys.stdout.write(" " + ffid1 + " " + ffid2 + "\n")
sys.stdout.write(" } #(end of bonds by type)\n\n\n\n\n")
sys.stdout.write(" # ------- Angle Interactions: -------\n"
" # "+angle_style_link+"\n"
" # Syntax: \n"
" # angle_coeff AngleTypeName AngleStyle parameters...\n\n")
sys.stdout.write(" write_once(\"In Settings\") {\n")
for atype in angles_by_type:
ffid1 = atype[0] if atype[0] != "0" else "X"
ffid2 = atype[1] if atype[1] != "0" else "X"
ffid3 = atype[2] if atype[2] != "0" else "X"
(k,angle0) = angles_by_type[atype]
sys.stdout.write(" angle_coeff @angle:"+ffid1+"-"+ffid2+"-"+ffid3+" "+
angle_style_name +" "+ str(k) + " " +str(angle0) + "\n")
sys.stdout.write(" } #(end of angle_coeffs)\n\n")
sys.stdout.write(" # Rules for creating angle interactions according to atom type:\n"
" # AngleTypeName AtomType1 AtomType2 AtomType3\n"
" # (* = wildcard)\n\n")
sys.stdout.write(" write_once(\"Data Angles By Type\") {\n")
for atype in angles_by_type:
ffid1 = atype[0] if atype[0] != "0" else "X"
ffid2 = atype[1] if atype[1] != "0" else "X"
ffid3 = atype[2] if atype[2] != "0" else "X"
sys.stdout.write(" @angle:" + ffid1 + "-" + ffid2 + "-" + ffid3)
ffid1 = "@atom:*_b*_a"+atype[0]+"_d*_i*" if atype[0] != "0" else "@atom:*"
ffid2 = "@atom:*_b*_a"+atype[1]+"_d*_i*" if atype[1] != "0" else "@atom:*"
ffid3 = "@atom:*_b*_a"+atype[2]+"_d*_i*" if atype[2] != "0" else "@atom:*"
sys.stdout.write(" " + ffid1 + " " + ffid2 + " " + ffid3 + "\n")
sys.stdout.write(" } #(end of angles by type)\n\n\n\n\n")
sys.stdout.write(" # ----------- Dihedral Interactions: ------------\n"
" # "+dihedral_style_link+"\n"
" # Syntax:\n"
" # dihedral_coeff DihedralTypeName DihedralStyle parameters...\n\n")
sys.stdout.write(" write_once(\"In Settings\") {\n")
for dtype in dihedrals_by_type:
ffid1 = dtype[0] if dtype[0] != "0" else "X"
ffid2 = dtype[1] if dtype[1] != "0" else "X"
ffid3 = dtype[2] if dtype[2] != "0" else "X"
ffid4 = dtype[3] if dtype[3] != "0" else "X"
sys.stdout.write(" dihedral_coeff @dihedral:"+
ffid1 + "-" + ffid2 + "-" + ffid3 + "-" + ffid4 + " " +
dihedral_style_name +" ")
if dihedral_style_name == 'fourier':
# http://lammps.sandia.gov/doc/dihedral_fourier.html
(K,n,d) = dihedrals_by_type[dtype]
m = len(K)
assert((m == len(n)) and (m == len(d)))
sys.stdout.write(str(m))
for i in range(0,m):
sys.stdout.write(" " + str(K[i]) + " " + str(n[i]) + " " + str(d[i]))
sys.stdout.write("\n")
elif dihedral_style_name == 'opls':
# http://lammps.sandia.gov/doc/dihedral_opls.html
(K1,K2,K3,K4) = dihedrals_by_type[dtype]
sys.stdout.write(str(K1) +" "+ str(K2) +" "+ str(K3) +" "+ str(K4)+"\n")
else:
assert(False)
sys.stdout.write(" } #(end of dihedral_coeffs)\n\n")
sys.stdout.write(" # Rules for creating dihedral interactions according to atom type:\n"
" # DihedralTypeName AtomType1 AtomType2 AtomType3 AtomType4\n"
" # (* = wildcard)\n\n")
sys.stdout.write(" write_once(\"Data Dihedrals By Type\") {\n")
for dtype in dihedrals_by_type:
ffid1 = dtype[0] if dtype[0] != "0" else "X"
ffid2 = dtype[1] if dtype[1] != "0" else "X"
ffid3 = dtype[2] if dtype[2] != "0" else "X"
ffid4 = dtype[3] if dtype[3] != "0" else "X"
sys.stdout.write(" @dihedral:"+ffid1+"-"+ffid2+"-"+ffid3+"-"+ffid4)
ffid1 = "@atom:*_b*_a*_d"+dtype[0]+"_i*" if dtype[0] != "0" else "@atom:*"
ffid2 = "@atom:*_b*_a*_d"+dtype[1]+"_i*" if dtype[1] != "0" else "@atom:*"
ffid3 = "@atom:*_b*_a*_d"+dtype[2]+"_i*" if dtype[2] != "0" else "@atom:*"
ffid4 = "@atom:*_b*_a*_d"+dtype[3]+"_i*" if dtype[3] != "0" else "@atom:*"
sys.stdout.write(" "+ffid1+" "+ffid2+" "+ffid3+" "+ffid4+"\n")
sys.stdout.write(" } #(end of dihedrals by type)\n\n\n\n\n")
sys.stdout.write(" # ---------- Improper Interactions: ----------\n"
" # "+improper_style_link+"\n"
" # Syntax:\n"
" # improper_coeff ImproperTypeName ImproperStyle parameters\n\n")
sys.stdout.write(" write_once(\"In Settings\") {\n")
for itype in impropers_by_type:
ffid1 = itype[0] if itype[0] != "0" else "X"
ffid2 = itype[1] if itype[1] != "0" else "X"
ffid3 = itype[2] if itype[2] != "0" else "X"
ffid4 = itype[3] if itype[3] != "0" else "X"
(k,angle0) = impropers_by_type[itype]
sys.stdout.write(" improper_coeff @improper:"+
ffid1 + "-" + ffid2 + "-" + ffid3 + "-" + ffid4 + " " +
improper_style_name +" "+ str(k) +" "+ str(angle0) +"\n")
sys.stdout.write(" } #(end of improper_coeffs)\n\n")
sys.stdout.write(" # Rules for creating dihedral interactions according to atom type:\n"
" # ImproperTypeName AtomType1 AtomType2 AtomType3 AtomType4\n"
" # (* = wildcard)\n")
sys.stdout.write(" write_once(\"Data Impropers By Type (opls_imp.py)\") {\n")
for itype in impropers_by_type:
ffid1 = itype[0] if itype[0] != "0" else "X"
ffid2 = itype[1] if itype[1] != "0" else "X"
ffid3 = itype[2] if itype[2] != "0" else "X"
ffid4 = itype[3] if itype[3] != "0" else "X"
sys.stdout.write(" @improper:"+ffid1+"-"+ffid2+"-"+ffid3+"-"+ffid4)
ffid1 = "@atom:*_b*_a*_d*_i"+itype[0] if itype[0] != "0" else "@atom:*"
ffid2 = "@atom:*_b*_a*_d*_i"+itype[1] if itype[1] != "0" else "@atom:*"
ffid3 = "@atom:*_b*_a*_d*_i"+itype[2] if itype[2] != "0" else "@atom:*"
ffid4 = "@atom:*_b*_a*_d*_i"+itype[3] if itype[3] != "0" else "@atom:*"
sys.stdout.write(" "+ffid1+" "+ffid2+" "+ffid3+" "+ffid4+"\n")
sys.stdout.write(" } #(end of impropers by type)\n\n\n\n\n")
sys.stdout.write(" # -------- (descriptive comment) --------\n")
sys.stdout.write(" # ---- biologically relevant atom types: ----\n # ")
sys.stdout.write("\n # ".join(lines_biotype))
sys.stdout.write("\n # ---------- (end of comment) ----------\n")
sys.stdout.write("\n\n\n\n")
sys.stdout.write(" # LAMMPS supports many different kinds of bonded and non-bonded\n"
" # interactions which can be selected at run time. Eventually\n"
" # we must inform LAMMPS which of them we will need. We specify\n"
" # this in the \"In Init\" section: \n\n")
sys.stdout.write(" write_once(\"In Init\") {\n")
sys.stdout.write(" units real\n")
sys.stdout.write(" atom_style full\n")
sys.stdout.write(" bond_style hybrid "+bond_style_name+"\n")
sys.stdout.write(" angle_style hybrid "+angle_style_name+"\n")
sys.stdout.write(" dihedral_style hybrid "+dihedral_style_name+"\n")
sys.stdout.write(" improper_style hybrid "+improper_style_name+"\n")
sys.stdout.write(pair_style_command)
sys.stdout.write(" pair_modify mix "+mixing_style+"\n")
sys.stdout.write(" "+special_bonds_command+"\n")
sys.stdout.write(kspace_style)
sys.stdout.write(" } #end of init parameters\n\n")
sys.stdout.write(" # Note: We use \"hybrid\" styles in case the user later wishes to\n"
" # combine the molecules built using this force-field with other\n"
" # molecules that use other styles. (This is not necessarily\n"
" # a good idea, but LAMMPS and moltemplate both allow it.)\n"
" # For more information:\n"
" # http://lammps.sandia.gov/doc/pair_hybrid.html\n"
" # http://lammps.sandia.gov/doc/bond_hybrid.html\n"
" # http://lammps.sandia.gov/doc/angle_hybrid.html\n"
" # http://lammps.sandia.gov/doc/dihedral_hybrid.html\n"
" # http://lammps.sandia.gov/doc/improper_hybrid.html\n\n\n")
sys.stdout.write("} # "+ffname+"\n\n")
#sys.stderr.write(" done.\n")
if filename_in != "":
file_in.close()
|
lkostler/AME60649_project_final
|
moltemplate/moltemplate/src/tinkerparm2lt.py
|
Python
|
bsd-3-clause
| 29,431
|
[
"LAMMPS",
"TINKER"
] |
3044bd3ab28f494abaa19ceceab07ef45682c24e413be49af16f74b83c4d309c
|
# Portions copyright (c) 2014 ZMAN(ZhangNing)
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Name: WebZ轻量级自动化框架
# Description: keyword-driven automated testing framework
# Author: ZMAN(ZhangNing)
#
# This project also used some third-party modules:
#
# selenium: Licensed under the Apache License, Version 2.0 (the "License");
# Copyright 2008-2013 Software Freedom Conservancy.
#
# splinter: Licensed under the BSD License;
# Copyright 2012 splinter authors. All rights reserved.
#
# reportlab: Licensed under the BSD License;
# Copyright ReportLab Europe Ltd. 2000-2014.
#
# xlrd: Licensed under the BSD License;
# Portions copyright 2005-2009, Stephen John Machin, Lingfo Pty Ltd. All rights reserved.
#
import time
import process
class keywords :
def __init__(self) :
return
# Open your browser
def case_main(self, case) :
case2 = case[0].split('|')
if case2[0] == "打开网页" :
browser = process.process().openpage("http://%s" %case2[1])
case.remove(case[0])
return(browser, case)
# main key words
def filter(self, browser,case) :
case = case.split('|')
# click
if case[0] == "点击" :
case[1] = case[1].split('@@')
flag2 = process.process().sendcase_click(browser,case[1][0],'click',case[1][1])
# fill
elif case[0] == "填写" :
case[1] = case[1].split('@@')
flag2 = process.process().sendcase_fill(browser,case[1][0],'fill',case[1][1],case[1][2])
# back forward
elif case[0] == "后退" :
flag2 = process.process().sendcase_action(browser,'back')
# click on the text link
elif case[0] == "点击文字" :
flag2 = process.process().sendcase_click_text(browser,'click_text', case[1])
# go forward
elif case[0] == "前往" :
flag2 = process.process().sendcase_click_text(browser,'visit',case[1])
# refresh
elif case[0] == "刷新" :
flag2 = process.process().sendcase_action(browser,'refresh')
# verify
elif case[0] == "验证" :
case[1] = case[1].split('@@')
flag2 = process.process().sendcase_verify(browser,case[1][0], case[1][1])
# screenshot
elif case[0] == "截图" :
flag2 = process.process().sendcase_action(browser, 'screenshot')
# wait
elif case[0] == "等待" :
flag2 = process.process().sendcase_action(browser, 'wait')
# move mouse to
elif case[0] == "鼠标移至" :
case[1] = case[1].split('@@')
flag2 = process.process().mouse_move(browser, case[1][0],case[1][1])
# alert
elif case[0] == "处理警告" :
flag2 = process.process().sendcase_action2(browser, 'alert', case[1])
# switch window
elif case[0] == "切换窗口" :
flag2 = process.process().sendcase_action2(browser, 'switch', case[1])
return(flag2)
if __name__ == '__main__':
input("You can not run me")
|
lsp84ch83/PyText
|
WebZ轻量级自动化框架/keywords.py
|
Python
|
gpl-3.0
| 3,311
|
[
"VisIt"
] |
1850ab43ce134a2642f09992cba12d9fe378112c3163476c355f06a1f2dcf8a0
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""rna_pdb_toolsx - a swiss army knife to manipulation of RNA pdb structures
Usage::
$ rna_pdb_toolsx.py --delete A:46-56 --inplace *.pdb
$ rna_pdb_toolsx.py --get-seq *
# BujnickiLab_RNApuzzle14_n01bound
> A:1-61
# BujnickiLab_RNApuzzle14_n02bound
> A:1-61
CGUUAGCCCAGGAAACUGGGCGGAAGUAAGGCCCAUUGCACUCCGGGCCUGAAGCAACGCG
[...]
"""
import argparse
import textwrap
import os
import shutil
import sys
import tempfile
import glob
import os
from rna_tools.rna_tools_lib import edit_pdb, add_header, get_version, \
collapsed_view, fetch, fetch_ba, replace_chain, RNAStructure, \
select_pdb_fragment, sort_strings, set_chain_for_struc
from rna_tools.tools.rna_x3dna.rna_x3dna import x3DNA
def get_parser():
version = os.path.basename(os.path.dirname(os.path.abspath(__file__))), get_version(__file__)
version = version[1].strip()
parser = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('--version', help='', action='version', version=version)
parser.add_argument('-r', '--report', help='get report',
action='store_true')
parser.add_argument('--no-progress-bar', help='for --no-progress-bar for --rpr', action='store_true')
parser.add_argument('--renum-atoms', help='renumber atoms, tested with --get-seq',
action='store_true')
parser.add_argument('--renum-nmr', help='',
action='store_true')
parser.add_argument('--renum-residues-dirty', help='', action='store_true')
parser.add_argument('--undo', help='undo operation of action done --inplace, , rename "backup files" .pdb~ to pdb, ALL files in the folder, not only ~ related to the last action (that you might want to revert, so be careful)', action='store_true')
parser.add_argument('--delete-anisou', help='remove files with ANISOU records, works with --inplace',
action='store_true')
parser.add_argument('--fix', help='fix a PDB file, ! external program, pdbfixer used to fix missing atoms',
action='store_true')
parser.add_argument('--to-mol2', help='fix a PDB file, ! external program, pdbfixer used to fix missing atoms',
action='store_true')
parser.add_argument('--split-alt-locations', help='@todo',
action='store_true')
parser.add_argument('-c', '--clean', help='get clean structure',
action='store_true')
parser.add_argument('--is-pdb', help='check if a file is in the pdb format',
action='store_true')
parser.add_argument('--is-nmr', help='check if a file is NMR-style multiple model pdb',
action='store_true')
parser.add_argument('--nmr-dir', help='make NMR-style multiple model pdb file from a set of files \n\n' +
" rna_pdb_toolsx.py --nmr-dir . 'cwc15_u5_fragments*.pdb' > ~/Desktop/cwc15-u5.pdb\n\n" +
"please use '' for pattern file recognition, this is a hack to deal with folders with\n"
"thousands of models, if you used only *.pdb then the terminal will complain that you\n"
"selected to many files.")
parser.add_argument('--un-nmr', help='split NMR-style multiple model pdb files into individual models [biopython]',
action='store_true')
parser.add_argument('--orgmode', help='get a structure in org-mode format <sick!>',
action='store_true')
parser.add_argument('--get-chain', help='get chain, one or many, e.g, A, but now also ABC works')
parser.add_argument('--fetch', action='store_true', help='fetch file from the PDB db, e.g., 1xjr,\nuse \'rp\' to fetch' +
'the RNA-Puzzles standardized_dataset [around 100 MB]')
parser.add_argument('--fetch-ba', action='store_true',
help='fetch biological assembly from the PDB db')
parser.add_argument('--fetch-chain', action='store_true', help='fetch a structure in extract chain, e.g. 6bk8 H')
parser.add_argument('--get-seq', help='get seq', action='store_true')
parser.add_argument('--color-seq', help='color seq, works with --get-seq', action='store_true')
parser.add_argument('--ignore-files', help='files to be ingored, .e.g, \'solution\'')
parser.add_argument('--compact',
help=textwrap.dedent("""with --get-seq, get it in compact view'
$ rna_pdb_toolsx.py --get-seq --compact *.pdb
# 20_Bujnicki_1
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_2
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_3
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_4
"""), action='store_true')
parser.add_argument('--hide-warnings', help='hide warnings, works with --get-chain, it hides warnings that given changes are not detected in a PDB file', action='store_true')
parser.add_argument('--get-ss', help='get secondary structure', action='store_true')
parser.add_argument('--rosetta2generic', help='convert ROSETTA-like format to a generic pdb',
action='store_true')
parser.add_argument('--no-hr', help='do not insert the header into files',
action='store_true')
parser.add_argument('--renumber-residues', help='by defult is false',
action='store_true')
parser.add_argument('--dont-rename-chains',
help=textwrap.dedent("""used only with --get-rnapuzzle-ready.
By default:
--get-rnapuzzle-ready rename chains from ABC.. to stop behavior switch on this option
"""),
action='store_true')
parser.add_argument('--dont-fix-missing-atoms',
help="""used only with --get-rnapuzzle-ready""",
action='store_true')
parser.add_argument('--inspect',
help="inspect missing atoms (technically decorator to --get-rnapuzzle-ready without actually doing anything but giving a report on problems)",
action='store_true')
parser.add_argument('--collapsed-view', help='',
action='store_true')
parser.add_argument('--cv', help='alias to collapsed_view',
action='store_true')
parser.add_argument('-v', '--verbose', help='tell me more what you\'re doing, please!',
action='store_true')
parser.add_argument('--mutate', help=textwrap.dedent("""mutate residues,
e.g.,
--mutate "A:1A+2A+3A+4A,B:1A"
to mutate to adenines the first four nucleotides of the chain A
and the first nucleotide of the chain B"""))
parser.add_argument('--edit',
dest="edit",
default='',
help="edit 'A:6>B:200', 'A:2-7>B:2-7'")
parser.add_argument('--rename-chain',
help="edit 'A>B' to rename chain A to chain B")
parser.add_argument('--swap-chains', help='B>A, rename A to _, then B to A, then _ to B')
parser.add_argument('--set-chain', help='set chain for all ATOM lines and TER (quite brutal function)')
parser.add_argument('--replace-chain',
default='',
help=textwrap.dedent("""a file PDB name with one chain that will be used to
replace the chain in the original PDB file,
the chain id in this file has to be the same with the chain id of the original chain"""))
parser.add_argument('--delete', # type="string",
dest="delete",
default='',
help="delete the selected fragment, e.g. A:10-16, or for more than one fragment --delete 'A:1-25+30-57'")
parser.add_argument('--extract', # type="string",
dest="extract",
default='',
help="extract the selected fragment, e.g. A:10-16, or for more than one fragment --extract 'A:1-25+30-57'")
parser.add_argument('--extract-chain',
help="extract chain, e.g. A")
parser.add_argument('--uniq', help=textwrap.dedent("""
rna_pdb_toolsx.py --get-seq --uniq '[:5]' --compact --chain-first * | sort
A:1-121 ACCUUGCGCAACUGGCGAAUCCUGGGGCUGCCGCCGGCAGUACCC...CA # rp13nc3295_min.out.1
A:1-123 ACCUUGCGCGACUGGCGAAUCCUGAAGCUGCUUUGAGCGGCUUCG...AG # rp13cp0016_min.out.1
A:1-123 ACCUUGCGCGACUGGCGAAUCCUGAAGCUGCUUUGAGCGGCUUCG...AG # zcp_6537608a_ALL-000001_AA
A:1-45 57-71 GGGUCGUGACUGGCGAACAGGUGGGAAACCACCGGGGAGCGACCCGCCGCCCGCCUGGGC # solution
"""))
parser.add_argument('--chain-first', help="", action='store_true')
parser.add_argument('--oneline', help="", action='store_true')
parser.add_argument('--fasta',
help= textwrap.dedent("""with --get-seq, show sequences in fasta format,
can be combined with --compact (mind, chains will be separated with ' ' in one line)
$ rna_pdb_toolsx.py --get-seq --fasta --compact input/20_Bujnicki_1.pdb
> 20_Bujnicki_1
ACCCGCAAGGCCGACGGC GCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU
"""), action='store_true')
parser.add_argument('--cif2pdb', help="[PyMOL Python package required]", action='store_true')
parser.add_argument('--pdb2cif', help="[PyMOL Python package required]", action='store_true')
parser.add_argument('--mdr', help='get structures ready for MD (like rpr but without first)',
action='store_true')
x = parser.add_argument_group('RNAPUZZLE-READY')
x.add_argument('--get-rnapuzzle-ready',
help=textwrap.dedent("""get RNApuzzle ready (keep only standard atoms).'
Be default it does not renumber residues, use --renumber-residues
[requires BioPython]"""), action='store_true')
x.add_argument('--rpr', help='alias to get_rnapuzzle ready)',
action='store_true')
rpr = parser.add_argument_group('CAN BE COMBINED WITH')# --get-rnapuzzle-ready (or --rpr) can be combined with')
rpr.add_argument('--keep-hetatm', help='keep hetatoms', action='store_true')
rpr.add_argument('--inplace', help=textwrap.dedent("""in place edit the file! [experimental,
only for get_rnapuzzle_ready, --delete, --get-ss, --get-seq, --edit-pdb]"""),
action='store_true')
rpr.add_argument('--suffix', help=textwrap.dedent("""when used with --inplace allows you to change a name of a new file, --suffix del will give <file>_del.pdb (mind added _)"""))
rpr.add_argument('--replace-hetatm', help="replace 'HETATM' with 'ATOM' [tested only with --get-rnapuzzle-ready]",
action="store_true")
rpr.add_argument('--dont-report-missing-atoms',
help="""used only with --get-rnapuzzle-ready""",
action='store_true')
rpr.add_argument('--backbone-only',
help="""used only with --get-rnapuzzle-ready, keep only backbone (= remove bases)""",
action='store_true')
rpr.add_argument('--no-backbone',
help="""used only with --get-rnapuzzle-ready, remove atoms of backbone (define as P OP1 OP2 O5')""",
action='store_true')
rpr.add_argument('--bases-only',
help="""used only with --get-rnapuzzle-ready, keep only atoms of bases""",
action='store_true')
parser.add_argument('file', help='file', nargs='+')
#parser.add_argument('outfile', help='outfile')
return parser
# main
if __name__ == '__main__':
# get version
version = os.path.basename(os.path.dirname(os.path.abspath(__file__))), get_version(__file__)
version = version[1].strip()
# get parser and arguments
parser = get_parser()
args = parser.parse_args()
# quick fix for one files vs file-s
if list == type(args.file) and len(args.file) == 1:
args.file = args.file[0]
if args.report:
s = RNAStructure(args.file)
print(s.get_report)
print(s.get_preview())
print(s.get_info_chains())
if args.clean:
s = RNAStructure(args.file)
s.decap_gtp()
s.std_resn()
s.remove_hydrogen()
s.remove_ion()
s.remove_water()
s.renum_atoms()
s.fix_O_in_UC()
s.fix_op_atoms()
# print s.get_preview()
# s.write(args.outfile)
if not args.no_hr:
print(add_header(version))
print(s.get_text())
if args.get_seq:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
analyzed = []
for f in args.file:
#####################################
if args.uniq:
subname = eval('f' + args.uniq)
if subname in analyzed:
continue
else:
analyzed.append(subname)
########
s = RNAStructure(f)
if not s.is_pdb():
print('Error: Not a PDB file %s' % f)
sys.exit(1)
s.decap_gtp()
s.std_resn()
s.remove_hydrogen()
s.remove_ion()
s.remove_water()
if args.renum_atoms:
s.renum_atoms()
s.fix_O_in_UC()
s.fix_op_atoms()
output = ''
# with # is easier to grep this out
if args.fasta:
output += s.get_seq(compact=args.compact, chainfirst=args.chain_first, fasta=args.fasta, addfn=s.fn, color=args.color_seq) + '\n'
elif args.oneline:
output += s.get_seq(compact=args.compact, chainfirst=args.chain_first, color=args.color_seq).strip() + ' # '+ os.path.basename(f.replace('.pdb', '')) + '\n'
else:
output += '# ' + os.path.basename(f.replace('.pdb', '')) + '\n'
output += s.get_seq(compact=args.compact, chainfirst=args.chain_first, color=args.color_seq) + '\n'
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
if args.get_ss:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
output = f + '\n'
p = x3DNA(f)
output += p.get_secstruc() + '\n'
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
# getchain
if args.get_chain:
s = RNAStructure(args.file)
## s.std_resn()
## s.remove_hydrogen()
## s.remove_ion()
## s.remove_water()
## s.renum_atoms()
## s.fix_O_in_UC()
## s.fix_op_atoms()
# print s.get_preview()
warningmsg = ''
for chain in list(args.get_chain):
chain_txt = s.get_chain(chain)
if not chain_txt.strip():
warningmsg += 'Warning: Chain %s not detected!' % chain
else:
print(chain_txt)
if not args.hide_warnings:
if warningmsg:
print(warningmsg)
if args.rosetta2generic:
s = RNAStructure(args.file)
s.std_resn()
s.remove_hydrogen()
s.remove_ion()
s.remove_water()
s.fix_op_atoms()
s.renum_atoms()
# print s.get_preview()
# s.write(args.outfile)
if not args.no_hr:
print(add_header(version))
print(s.get_text())
remarks_only = False
if args.inspect:
args.get_rnapuzzle_ready = True
fix_missing_atom = False
remarks_only = True
args.dont_rename_chains = True
args.renumber_residues = False
if args.get_rnapuzzle_ready or args.rpr or args.mdr: # rnapuzzle
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
# progress bar only in --inplace mode!
if args.inplace:
if not args.no_progress_bar:
import progressbar
bar = progressbar.ProgressBar(max_value=len(args.file))
bar.update(0)
for c, f in enumerate(args.file):
if args.verbose:
print(f)
if args.inplace:
shutil.copy(f, f + '~')
# keep previous edits
previous_edits = []
with open(f) as fx:
for l in fx:
if l.startswith('HEADER --'):
previous_edits.append(l.strip())
######################
s = RNAStructure(f)
if args.replace_hetatm:
s.replace_hetatm()
s.remove_hydrogen()
s.decap_gtp()
s.std_resn()
s.fix_op_atoms()
# s.remove_ion()
# s.remove_water()
# s.renum_atoms()
s.shift_atom_names()
s.prune_elements()
# s.write('tmp.pdb')
rename_chains = False if args.dont_rename_chains else True
report_missing_atoms = not args.dont_report_missing_atoms
fix_missing_atom = not args.dont_fix_missing_atoms
ignore_op3 = False
if args.mdr:
ignore_op3 = True
remarks = s.get_rnapuzzle_ready(args.renumber_residues, fix_missing_atoms=fix_missing_atom,
rename_chains=rename_chains,
report_missing_atoms=report_missing_atoms,
backbone_only=args.backbone_only,
no_backbone=args.no_backbone,
bases_only=args.bases_only,
keep_hetatm=args.keep_hetatm,
ignore_op3=ignore_op3,
verbose=args.verbose)
if args.inplace:
if args.suffix:
f = f.replace('.pdb', '_' + args.suffix + '.pdb')
with open(f, 'w') as f:
if not args.no_hr:
f.write(add_header(version) + '\n')
if previous_edits:
f.write('\n'.join(previous_edits) + '\n')
if remarks:
f.write('\n'.join(remarks) + '\n')
f.write(s.get_text())
# progress bar only in --inplace mode!
if not args.no_progress_bar:
bar.update(c)
else:
output = ''
if not args.no_hr:
output += add_header(version) + '\n'
if remarks:
output += '\n'.join(remarks) + '\n'
output += s.get_text() + '\n'
if remarks_only:
sys.stdout.write('\n'.join(remarks))
sys.stdout.flush()
else:
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
# hmm... fix for problem with renumbering, i do renumbering
# and i stop here
# i'm not sure that this is perfect
sys.exit(0)
if args.renumber_residues:
s = RNAStructure(args.file)
s.remove_hydrogen()
s.remove_ion()
s.remove_water()
s.get_rnapuzzle_ready(args.renumber_residues)
s.renum_atoms()
if not args.no_hr:
print(add_header(version))
print(s.get_text())
# args.renumber_resides_dirty
if args.renum_residues_dirty:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
if args.inplace:
shutil.copy(f, f + '~')
s = RNAStructure(f)
output = ''
#if not args.no_hr:
# output += add_header(version) + '\n'
# output += 'HEADER --delete ' + args.delete + '\n' # ' '.join(str(selection))
c = 1
old_resi = -1
for l in s.lines:
if l.startswith('ATOM') or l.startswith("HETATOM"):
resi = int(l[23:26].strip())
if resi != old_resi:
old_resi = resi
c += 1
# print(resi, c)
#resi = c
#if chain in selection:
# if resi in selection[chain]:
# continue # print chain, resi
output += l[:23] + str(c).rjust(3) + l[26:] + '\n'
# write: inplace
if args.inplace:
with open(f, 'w') as f:
f.write(output)
else: # write: to stdout
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
if args.undo:
# quick fix - make a list on the spot
dir = args.file #os.path.abso(os.path.dirname(args.file))
for f in glob.glob(dir + '/*.pdb~'):
if args.verbose:
print(f, '->',f.replace('.pdb~', '.pdb'))
os.rename(f, f.replace('.pdb~', '.pdb'))
if args.delete:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
if args.inplace:
shutil.copy(f, f + '~')
selection = select_pdb_fragment(args.delete)
s = RNAStructure(f)
output = ''
if not args.no_hr:
output += add_header(version) + '\n'
output += 'HEADER --delete ' + args.delete + '\n' # ' '.join(str(selection))
for l in s.lines:
if l.startswith('ATOM'):
chain = l[21]
resi = int(l[23:26].strip())
if chain in selection:
if resi in selection[chain]:
continue # print chain, resi
output += l + '\n'
# write: inplace
if args.inplace:
os.rename(f, f.replace('.pdb', '.pdb~'))
if args.suffix:
f = f.replace('.pdb', '_' + args.suffix + '.pdb')
with open(f, 'w') as f:
f.write(output)
else: # write: to stdout
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
if args.replace_chain:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
if args.inplace:
shutil.copy(f, f + '~')
# --replace_chain <file> without A:<file> it will be easier than --x "A:<file>"
s = RNAStructure(args.replace_chain)
chain_ids = (s.get_all_chain_ids())
if len(chain_ids) > 1:
raise Exception('There is more than one chain in the inserted PDB file. There should be only one chain, the one you want to insert to the PDB.')
out = replace_chain(f, args.replace_chain, list(chain_ids)[0])
print(out)
if args.mutate:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
from rna_tools.tools.mini_moderna3.moderna import *
for f in args.file:
if args.ignore_files:
if args.ignore_files in f:
continue
if args.inplace:
shutil.copy(f, f + '~') # create a backup copy if inplace
# create a working copy of the main file
ftf = tempfile.NamedTemporaryFile(delete=False).name # f temp file
shutil.copy(f, ftf) # create a backup copy if inplace
# go over each chain
# rna_pdb_toolsx.py --mutate 'A:1CB:1G,A:1U+B:1A' CG_AB.pdb > ~/Desktop/a.pdb
for m in args.mutate.split(','): # A:1A, B:1A
chain, resi_mutate_to = m.strip().split(':') # A:1A+2C
resi_mutate_to_list = resi_mutate_to.split('+') # A:1A+2C
model = load_model(f, chain)
# go over each mutation in this chain
for resi_mutate_to in resi_mutate_to_list:
resi = resi_mutate_to[:-1]
mutate_to = resi_mutate_to[-1]
if args.verbose:
print('Mutate', model[resi], 'to', mutate_to)
exchange_single_base(model[resi], mutate_to)
# multi mutation in one chain
tf = tempfile.NamedTemporaryFile(delete=False)
model.write_pdb_file(tf.name)
# work on the copy of f, ftf
output = replace_chain(ftf, tf.name, chain)
with open(ftf, 'w') as tmp:
tmp.write(output)
# write: inplace
if args.inplace:
# ftf now is f, get ready for the final output
if args.suffix:
f = f.replace('.pdb', '_' + args.suffix + '.pdb')
# rpr on the file
shutil.copy(ftf, f)
os.system('rna_pdb_toolsx.py --rpr --no-progress-bar --inplace ' + f)
else: # write: to stdout
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
if args.extract:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
if args.inplace:
shutil.copy(f, f + '~')
selection = select_pdb_fragment(args.extract)
s = RNAStructure(f)
output = ''
if not args.no_hr:
output += add_header(version) + '\n'
output += 'HEADER extract ' + args.extract + '\n' # ' '.join(str(selection))
for l in s.lines:
if l.startswith('ATOM'):
chain = l[21]
resi = int(l[23:26].strip())
if chain in selection:
if resi in selection[chain]:
# continue # print chain, resi
output += l + '\n'
# write: inplace
if args.inplace:
with open(f, 'w') as f:
f.write(output)
else: # write: to stdout
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
if args.extract_chain:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
if args.inplace:
shutil.copy(f, f + '~')
selection = select_pdb_fragment(args.extract)
s = RNAStructure(f)
output = ''
if not args.no_hr:
output += add_header(version) + '\n'
output += 'HEADER extract ' + args.extract + '\n' # ' '.join(str(selection))
for l in s.lines:
if l.startswith('ATOM') or l.startswith('TER') or l.startswith('HETATM'):
chain = l[21]
if chain in args.extract_chain:
output += l + '\n'
# write: inplace
if args.inplace:
with open(f, 'w') as f:
f.write(output)
else: # write: to stdout
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
if args.is_pdb:
s = RNAStructure(args.file)
output = str(s.is_pdb())
sys.stdout.write(output + '\n')
if args.un_nmr:
s = RNAStructure(args.file)
str(s.un_nmr())
if args.is_nmr:
struc = RNAStructure(args.file)
output = str(struc.is_nmr(args.verbose))
sys.stdout.write(output + '\n')
#edit
if args.edit:
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
if args.verbose:
print(f)
if args.inplace:
shutil.copy(f, f + '~')
output = edit_pdb(f, args)
if args.inplace:
with open(f, 'w') as f:
f.write(output)
else: # write: to stdout
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
if args.fetch:
fn = fetch(args.file)
if args.fetch_chain:
fn = fetch(args.file[0])
chain = args.file[1]
nfn = fn.replace('.pdb','') + '_' + chain + '.pdb' # 6bk8_H.pdb
#cmd = 'rna_pdb_tools.py --get-chain %s %s' > %s' % (chain, fn, nfn)
cmd = 'rna_pdb_toolsx.py --get-chain %s %s' % (chain, fn)
os.system(cmd)
# print(nfn)
if args.fetch_ba:
fetch_ba(args.file)
if args.collapsed_view or args.cv:
collapsed_view(args)
if args.delete_anisou:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
if args.inplace:
shutil.copy(f, f + '~')
s = RNAStructure(f)
output = ''
if not args.no_hr:
output += add_header(version) + '\n'
for l in s.lines:
if l.startswith('ANISOU'):
continue
else:
output += l + '\n'
if args.inplace:
with open(f, 'w') as f:
f.write(output)
else: # write: to stdout
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
if args.swap_chains:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
if args.inplace:
shutil.copy(f, f + '~')
# rename_chain 'A>B'
s = RNAStructure(f)
output = ''
if not args.no_hr:
output += add_header(version) + '\n'
chain_id_old, chain_id_new = args.swap_chains.split('>')
if chain_id_old == chain_id_new:
output = open(f).read() # return the file ;-) itself unchanged
else:
s.rename_chain(chain_id_new, '_')
s.rename_chain(chain_id_old, chain_id_new)
output += s.rename_chain('_', chain_id_old)
if args.inplace:
with open(f, 'w') as f:
f.write(output)
else: # write: to stdout
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
if args.rename_chain:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
if args.inplace:
shutil.copy(f, f + '~')
# rename_chain 'A>B'
s = RNAStructure(f)
chain_id_old, chain_id_new = args.rename_chain.split('>')
output = ''
if not args.no_hr:
output += add_header(version) + '\n'
output += s.rename_chain(chain_id_old, chain_id_new)
if args.inplace:
with open(f, 'w') as f:
f.write(output)
else: # write: to stdout
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
if args.split_alt_locations:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
if args.inplace:
shutil.copy(f, f + '~')
#s = RNAStructure(f)
s = open(f)
output = ''
if not args.no_hr:
output += add_header(version) + '\n'
# First, collect all alternative locations.
alts = set()
for l in s:
if l.startswith('ATOM'):
if l[16].strip():
alts.add(l[16])
s.close()
if args.verbose:
print('alts:', alts)
for index, alt in enumerate(alts):
output += 'MODEL %i' % (index + 1)
s = open(f)
for l in s:
if l.startswith('ATOM') or l.startswith('HETATM'):
# if empty, then print this line
if l[16] == ' ':
output += l
if l[16] == alt:
output += l
else:
output += l
output += 'ENDMDL\n'
s.close()
if args.inplace:
with open(f, 'w') as f:
f.write(output)
else: # write: to stdout
try:
sys.stdout.write(output)
sys.stdout.flush()
except IOError:
pass
if args.orgmode:
if args.inplace:
shutil.copy(args.file, args.file + '~')
s = RNAStructure(args.file)
s.decap_gtp()
s.std_resn()
s.remove_hydrogen()
s.remove_ion()
s.remove_water()
s.fix_op_atoms()
s.renum_atoms()
s.shift_atom_names()
s.prune_elements()
# print s.get_preview()
# s.write(args.outfile)
# for l in s.lines:
# print l
remarks = s.get_rnapuzzle_ready(
args.renumber_residues, fix_missing_atoms=True, rename_chains=True, verbose=args.verbose)
with open(args.file + '~', 'w') as f:
if not args.no_hr:
f.write(add_header(version) + '\n')
f.write('\n'.join(remarks) + '\n')
f.write(s.get_text())
try:
from Bio import PDB
from Bio.PDB import PDBIO
import warnings
warnings.filterwarnings('ignore', '.*Invalid or missing.*',)
warnings.filterwarnings('ignore', '.*with given element *',)
except:
sys.exit('Error: Install biopython to use this function (pip biopython)')
parser = PDB.PDBParser()
struct = parser.get_structure('', args.file + '~')
model = struct[0]
# chains [['A', 'seq', [residues]]]
chains = []
for c in model.get_list():
seq = ''
chain = []
for r in c:
chain.append(str(r.get_resname().strip()) + str(r.id[1]))
seq += r.get_resname().strip()
chains.append([c.id, seq, chain])
t = []
#[['A', 'CCGCCGCGCCAUGCCUGUGGCGG', ['C1', 'C2', 'G3', 'C4', 'C5', 'G6', 'C7', 'G8', 'C9', 'C10', 'A11', 'U12', 'G13', 'C14', 'C15', 'U16', 'G17', 'U18', 'G19', 'G20', 'C21', 'G22', 'G23']], ['B', 'CCGCCGCGCCAUGCCUGUGGCGG', ['C1', 'C2', 'G3', 'C4', 'C5', 'G6', 'C7', 'G8', 'C9', 'C10', 'A11', 'U12', 'G13', 'C14', 'C15', 'U16', 'G17', 'U18', 'G19', 'G20', 'C21', 'G22', 'G23']]]
for c in chains:
t.append('* ' + c[0] + ':' + c[2][0][1:] + '-' + c[2][-1][1:] + ' ' + c[1])
for r in c[2]:
t.append('** ' + c[0] + ':' + r)
print('\n'.join(t))
if args.fix:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
cmd = 'pdbfixer ' + f + ' --add-atoms all --add-residues'
print(cmd)
os.system(cmd)
if args.inplace:
shutil.move("output.pdb", f)
else:
shutil.move("output.pdb", f.replace('.pdb', '_fx.pdb'))
if args.to_mol2:
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
cmd = 'obabel -i pdb ' + f + ' -o mol2 -O ' + f.replace('.pdb', '.mol2')
print(cmd)
os.system(cmd)
if args.nmr_dir:
files = sort_strings(glob.glob(args.nmr_dir + '/' + args.file))
c = 1
for f in files:
#s = RNAStructure(f)
print("MODEL " + str(c))
# at some point I could use RNAStructure for this
print(open(f).read())
#print(s.get_text(add_end=False))
print('ENDMDL')
c += 1
print('END')
if args.set_chain:
if list != type(args.file):
args.file = [args.file]
for f in args.file:
txt = set_chain_for_struc(f, args.set_chain)
if args.inplace:
shutil.move(f, f.replace('.pdb', '.pdb~'))
with open(f, 'w') as fi:
fi.write(txt)
else:
print(txt)
if args.renum_nmr:
if list != type(args.file):
args.file = [args.file]
txt = ''
for f in args.file:
c = 1
for l in open(f):
if l.startswith('MODEL'):
txt += "MODEL " + str(c) + '\n'
c += 1
elif l.strip() == 'END':
pass
else:
txt += l
if args.inplace:
shutil.move(f, f.replace('.pdb', '.pdb~'))
with open(f) as fi:
fi.write(txt)
else:
print(txt)
if args.cif2pdb:
try:
from pymol import cmd
except ImportError:
print('This functionality needs PyMOL. Install it or if installed, check your setup')
sys.exit(1)
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
cmd.load(f)
cmd.save(f.replace('.cif', '.pdb'), '(all)')
cmd.delete('all')
if args.pdb2cif:
try:
from pymol import cmd
except ImportError:
print('This functionality needs PyMOL. Install it or if installed, check your setup')
sys.exit(1)
# quick fix - make a list on the spot
if list != type(args.file):
args.file = [args.file]
##################################
for f in args.file:
cmd.load(f)
cmd.save(f.replace('.pdb', '.cif'), '(all)')
cmd.delete('all')
|
mmagnus/rna-pdb-tools
|
rna_tools/rna_pdb_toolsx.py
|
Python
|
gpl-3.0
| 40,901
|
[
"Biopython",
"PyMOL"
] |
5dca839cb152551141d38f9adad5b4e8873a9d0db2ccf390ec3d715b29580cd5
|
import argparse
import os
from coalib.misc import Constants
from coalib.collecting.Collectors import get_all_bears_names
from coalib.parsing.filters import available_filters
class CustomFormatter(argparse.RawDescriptionHelpFormatter):
"""
A Custom Formatter that will keep the metavars in the usage but remove them
in the more detailed arguments section.
"""
def _format_action_invocation(self, action):
if not action.option_strings:
# For arguments that don't have options strings
metavar, = self._metavar_formatter(action, action.dest)(1)
return metavar
else:
# Option string arguments (like "-f, --files")
parts = action.option_strings
return ', '.join(parts)
class PathArg(str):
"""
Uni(xi)fying OS-native directory separators in path arguments.
Removing the pain from interactively using coala in a Windows cmdline,
because backslashes are interpreted as escaping syntax and therefore
removed when arguments are turned into coala settings
>>> import os
>>> PathArg(os.path.join('path', 'with', 'separators'))
'path/with/separators'
"""
def __new__(cls, path):
return str.__new__(cls, path.replace(os.path.sep, '/'))
def default_arg_parser(formatter_class=None):
"""
This function creates an ArgParser to parse command line arguments.
:param formatter_class: Formatting the arg_parser output into a specific
form. For example: In the manpage format.
"""
formatter_class = (CustomFormatter if formatter_class is None
else formatter_class)
description = """
coala provides a common command-line interface for linting and fixing all your
code, regardless of the programming languages you use.
To find out what kind of analysis coala offers for the languages you use, visit
http://coala.io/languages, or run::
$ coala --show-bears --filter-by language C Python
To perform code analysis, simply specify the analysis routines (bears) and the
files you want it to run on, for example:
spaceBear::
$ coala --bears SpaceConsistencyBear --files **.py
coala can also automatically fix your code:
spacePatchBear::
$ coala --bears SpaceConsistencyBear --files **.py --apply-patches
To run coala without user interaction, run the `coala --non-interactive`,
`coala --json` and `coala --format` commands.
"""
arg_parser = argparse.ArgumentParser(
formatter_class=formatter_class,
prog='coala',
description=description,
# Use our own help so that we can put it in the group we want
add_help=False)
arg_parser.add_argument('TARGETS',
nargs='*',
help='sections to be executed exclusively')
info_group = arg_parser.add_argument_group('Info')
info_group.add_argument('-h',
'--help',
action='help',
help='show this help message and exit')
info_group.add_argument('-v',
'--version',
action='version',
version=Constants.VERSION)
mode_group = arg_parser.add_argument_group('Mode')
mode_group.add_argument(
'-C', '--non-interactive', const=True, action='store_const',
help='run coala in non interactive mode')
mode_group.add_argument(
'--ci', action='store_const', dest='non_interactive', const=True,
help='continuous integration run, alias for `--non-interactive`')
mode_group.add_argument(
'--json', const=True, action='store_const',
help='mode in which coala will display output as json')
mode_group.add_argument(
'--statan', const=True, action='store_const',
help='mode in which coala used in <statan> mode')
mode_group.add_argument(
'--format', const=True, nargs='?', metavar='STR',
help='output results with a custom format string, e.g. '
'"Message: {message}"; possible placeholders: '
'id, origin, file, line, end_line, column, end_column, '
'severity, severity_str, message, message_base, '
'message_arguments, affected_code, source_lines')
config_group = arg_parser.add_argument_group('Configuration')
config_group.add_argument(
'-c', '--config', type=PathArg, nargs=1, metavar='FILE',
help='configuration file to be used, defaults to {}'.format(
Constants.default_coafile))
config_group.add_argument(
'-F', '--find-config', action='store_const', const=True,
help='find {} in ancestors of the working directory'.format(
Constants.default_coafile))
config_group.add_argument(
'-I', '--no-config', const=True, action='store_const',
help='run without using any config file')
config_group.add_argument(
'-s', '--save', type=PathArg, nargs='?', const=True, metavar='FILE',
help='save used arguments to a config file to a {}, the given path, '
'or at the value of -c'.format(Constants.default_coafile))
config_group.add_argument(
'--disable-caching', const=True, action='store_const',
help='run on all files even if unchanged')
config_group.add_argument(
'--flush-cache', const=True, action='store_const',
help='rebuild the file cache')
config_group.add_argument(
'--no-autoapply-warn', const=True, action='store_const',
help='turn off warning about patches not being auto applicable')
inputs_group = arg_parser.add_argument_group('Inputs')
inputs_group.add_argument(
'-b', '--bears', nargs='+', metavar='NAME',
help='names of bears to use').completer = (
lambda *args, **kwargs: get_all_bears_names()) # pragma: no cover
inputs_group.add_argument(
'-f', '--files', type=PathArg, nargs='+', metavar='FILE',
help='files that should be checked')
inputs_group.add_argument(
'-i', '--ignore', type=PathArg, nargs='+', metavar='FILE',
help='files that should be ignored')
inputs_group.add_argument(
'--limit-files', type=PathArg, nargs='+', metavar='FILE',
help="filter the `--files` argument's matches further")
inputs_group.add_argument(
'-d', '--bear-dirs', type=PathArg, nargs='+', metavar='DIR',
help='additional directories which may contain bears')
outputs_group = arg_parser.add_argument_group('Outputs')
outputs_group.add_argument(
'-V', '--verbose', action='store_const',
dest='log_level', const='DEBUG',
help='alias for `-L DEBUG`')
outputs_group.add_argument(
'-L', '--log-level', nargs=1,
choices=['ERROR', 'INFO', 'WARNING', 'DEBUG'], metavar='ENUM',
help='set log output level to DEBUG/INFO/WARNING/ERROR, '
'defaults to INFO')
outputs_group.add_argument(
'-m', '--min-severity', nargs=1,
choices=('INFO', 'NORMAL', 'MAJOR'), metavar='ENUM',
help='set minimal result severity to INFO/NORMAL/MAJOR')
outputs_group.add_argument(
'-N', '--no-color', const=True, action='store_const',
help='display output without coloring (excluding logs)')
outputs_group.add_argument(
'-B', '--show-bears', const=True, action='store_const',
help='list all bears')
outputs_group.add_argument(
'-l', '--filter-by-language', nargs='+', metavar='LANG',
help='filters `--show-bears` by the given languages')
outputs_group.add_argument(
'--filter-by', action='append', nargs='+',
metavar=('FILTER_NAME FILTER_ARG', 'FILTER_ARG'),
help='filters `--show-bears` by the filter given as argument. '
'Available filters: {}'.format(', '.join(sorted(
available_filters))))
outputs_group.add_argument(
'-p', '--show-capabilities', nargs='+', metavar='LANG',
help='show what coala can fix and detect for the given languages')
outputs_group.add_argument(
'-D', '--show-description', const=True, action='store_const',
help='show bear descriptions for `--show-bears`')
outputs_group.add_argument(
'--show-settings', const=True, action='store_const',
help='show bear settings for `--show-bears`')
outputs_group.add_argument(
'--show-details', const=True, action='store_const',
help='show bear details for `--show-bears`')
outputs_group.add_argument(
'--log-json', const=True, action='store_const',
help='output logs as json along with results'
' (must be called with --json)')
outputs_group.add_argument(
'-o', '--output', type=PathArg, nargs=1, metavar='FILE',
help='write results to the given file (must be called with --json)')
outputs_group.add_argument(
'-r', '--relpath', nargs='?', const=True,
help='return relative paths for files (must be called with --json)')
misc_group = arg_parser.add_argument_group('Miscellaneous')
misc_group.add_argument(
'-S', '--settings', nargs='+', metavar='SETTING',
help='arbitrary settings in the form of section.key=value')
misc_group.add_argument(
'-a', '--apply-patches', action='store_const',
dest='default_actions', const='**: ApplyPatchAction',
help='apply all patches automatically if possible')
misc_group.add_argument(
'-j', '--jobs', type=int,
help='number of jobs to use in parallel')
misc_group.add_argument(
'-n', '--no-orig', const=True, action='store_const',
help="don't create .orig backup files before patching")
misc_group.add_argument(
'-A', '--single-action', const=True, action='store_const',
help='apply a single action for all results')
misc_group.add_argument(
'--debug', const=True, action='store_const',
help='run coala in debug mode, starting ipdb, '
'which must be separately installed, '
'on unexpected internal exceptions '
'(implies --verbose)')
try:
# Auto completion should be optional, because of somewhat complicated
# setup.
import argcomplete
argcomplete.autocomplete(arg_parser)
except ImportError: # pragma: no cover
pass
return arg_parser
|
IPMITMO/statan
|
coala/coalib/parsing/DefaultArgParser.py
|
Python
|
mit
| 10,541
|
[
"VisIt"
] |
7840546ede318cb3c09d9ca5232fb9cfb327c5e1b6dbfefb045086f46934ab35
|
"""
Classes to handle the .bed files
"""
import os
import os.path as op
import sys
import math
import logging
import numpy as np
from collections import defaultdict
from itertools import groupby
from jcvi.formats.base import LineFile, must_open, is_number, get_number
from jcvi.formats.sizes import Sizes
from jcvi.utils.iter import pairwise
from jcvi.utils.cbook import SummaryStats, thousands, percentage
from jcvi.utils.natsort import natsort_key, natsorted
from jcvi.utils.range import Range, range_union, range_chain, \
range_distance, range_intersect
from jcvi.apps.base import OptionParser, ActionDispatcher, sh, \
need_update, popen
class BedLine(object):
# the Bed format supports more columns. we only need
# the first 4, but keep the information in 'extra'.
__slots__ = ("seqid", "start", "end", "accn",
"extra", "score", "strand", "args", "nargs")
def __init__(self, sline):
args = sline.strip().split("\t")
self.nargs = nargs = len(args)
self.seqid = args[0]
self.start = int(args[1]) + 1
self.end = int(args[2])
assert self.start <= self.end, \
"start={0} end={1}".format(self.start, self.end)
self.extra = self.accn = self.score = self.strand = None
if nargs > 3:
self.accn = args[3]
if nargs > 4:
self.score = args[4]
if nargs > 5:
self.strand = args[5]
if nargs > 6:
self.extra = args[6:]
self.args = args
def __str__(self):
args = [self.seqid, self.start - 1, self.end]
if self.accn is not None:
args += [self.accn]
if self.score is not None:
args += [self.score]
if self.strand is not None:
args += [self.strand]
if self.extra is not None:
args += self.extra
s = "\t".join(str(x) for x in args)
return s
def __getitem__(self, key):
return getattr(self, key)
@property
def span(self):
return self.end - self.start + 1
@property
def range(self):
strand = self.strand or '+'
return (self.seqid, self.start, self.end, strand)
@property
def tag(self):
return "{0}:{1}-{2}".format(self.seqid, self.start, self.end)
def gffline(self, type='match', source='default'):
score = "." if not self.score or \
(self.score and not is_number(self.score)) \
else self.score
strand = "." if not self.strand else self.strand
row = "\t".join((self.seqid, source, type,
str(self.start), str(self.end), score,
strand, '.', 'ID=' + self.accn))
return row
class Bed(LineFile):
def __init__(self, filename=None, key=None, sorted=True, juncs=False):
super(Bed, self).__init__(filename)
# the sorting key provides some flexibility in ordering the features
# for example, user might not like the lexico-order of seqid
self.nullkey = lambda x: (natsort_key(x.seqid), x.start, x.accn)
self.key = key or self.nullkey
if not filename:
return
for line in must_open(filename):
if line[0] == "#" or (juncs and line.startswith('track name')):
continue
self.append(BedLine(line))
if sorted:
self.sort(key=self.key)
def print_to_file(self, filename="stdout", sorted=False):
if sorted:
self.sort(key=self.key)
fw = must_open(filename, "w")
for b in self:
if b.start < 1:
logging.error("Start < 1. Reset start for `{0}`.".format(b.accn))
b.start = 1
print >> fw, b
fw.close()
def sum(self, seqid=None, unique=True):
return bed_sum(self, seqid=seqid, unique=unique)
@property
def seqids(self):
return natsorted(set(b.seqid for b in self))
@property
def accns(self):
return natsorted(set(b.accn for b in self))
@property
def order(self):
# get the gene order given a Bed object
return dict((f.accn, (i, f)) for (i, f) in enumerate(self))
@property
def order_in_chr(self):
# get the gene order on a particular seqid
res = {}
self.sort(key=self.nullkey)
for seqid, beds in groupby(self, key=lambda x: x.seqid):
for i, f in enumerate(beds):
res[f.accn] = (seqid, i, f)
return res
@property
def bp_in_chr(self):
# get the bp position on a particular seqid
res = {}
self.sort(key=self.nullkey)
for seqid, beds in groupby(self, key=lambda x: x.seqid):
for i, f in enumerate(beds):
res[f.accn] = (seqid, (f.start + f.end) / 2, f)
return res
@property
def simple_bed(self):
return [(b.seqid, i) for (i, b) in enumerate(self)]
@property
def links(self):
r = []
for s, sb in self.sub_beds():
for a, b in pairwise(sb):
r.append(((a.accn, a.strand), (b.accn, b.strand)))
return r
def extract(self, seqid, start, end):
# get all features within certain range
for b in self:
if b.seqid != seqid:
continue
if b.start < start or b.end > end:
continue
yield b
def sub_bed(self, seqid):
# get all the beds on one chromosome
for b in self:
if b.seqid == seqid:
yield b
def sub_beds(self):
self.sort(key=self.nullkey)
# get all the beds on all chromosomes, emitting one at a time
for bs, sb in groupby(self, key=lambda x: x.seqid):
yield bs, list(sb)
def get_breaks(self):
# get chromosome break positions
simple_bed = self.simple_bed
for seqid, ranks in groupby(simple_bed, key=lambda x: x[0]):
ranks = list(ranks)
# chromosome, extent of the chromosome
yield seqid, ranks[0][1], ranks[-1][1]
class BedpeLine(object):
def __init__(self, sline):
args = sline.strip().split("\t")
self.seqid1 = args[0]
self.start1 = int(args[1]) + 1
self.end1 = int(args[2])
self.seqid2 = args[3]
self.start2 = int(args[4]) + 1
self.end2 = int(args[5])
self.accn = args[6]
self.score = args[7]
self.strand1 = args[8]
self.strand2 = args[9]
self.isdup = False
@property
def innerdist(self):
if self.seqid1 != self.seqid2:
return -1
return abs(self.start2 - self.end1)
@property
def outerdist(self):
if self.seqid1 != self.seqid2:
return -1
return abs(self.end2 - self.start1)
@property
def is_innie(self):
return (self.strand1, self.strand2) == ('+', '-')
def rc(self):
self.strand1 = '+' if self.strand1 == '-' else '-'
self.strand2 = '+' if self.strand2 == '-' else '-'
def _extend(self, rlen, size, start, end, strand):
if strand == '+':
end = start + rlen - 1
if end > size:
end = size
start = end - rlen + 1
else:
start = end - rlen + 1
if start < 1:
start = 1
end = start + rlen - 1
return start, end, strand
def extend(self, rlen, size):
self.start1, self.end1, self.strand1 = self._extend(\
rlen, size, self.start1, self.end1, self.strand1)
self.start2, self.end2, self.strand2 = self._extend(\
rlen, size, self.start2, self.end2, self.strand2)
def __str__(self):
args = (self.seqid1, self.start1 - 1, self.end1,
self.seqid2, self.start2 - 1, self.end2,
self.accn, self.score, self.strand1, self.strand2)
return "\t".join(str(x) for x in args)
@property
def bedline(self):
assert self.seqid1 == self.seqid2
assert self.start1 <= self.end2
args = (self.seqid1, self.start1 - 1, self.end2, self.accn)
return "\t".join(str(x) for x in args)
class BedEvaluate (object):
def __init__(self, TPbed, FPbed, FNbed, TNbed):
self.TP = Bed(TPbed).sum(unique=True)
self.FP = Bed(FPbed).sum(unique=True)
self.FN = Bed(FNbed).sum(unique=True)
self.TN = Bed(TNbed).sum(unique=True)
def __str__(self):
from jcvi.utils.table import tabulate
table = {}
table[("Prediction-True", "Reality-True")] = self.TP
table[("Prediction-True", "Reality-False")] = self.FP
table[("Prediction-False", "Reality-True")] = self.FN
table[("Prediction-False", "Reality-False")] = self.TN
msg = str(tabulate(table))
msg += "\nSensitivity [TP / (TP + FN)]: {0:.1f} %\n".\
format(self.sensitivity * 100)
msg += "Specificity [TP / (TP + FP)]: {0:.1f} %\n".\
format(self.specificity * 100)
msg += "Accuracy [(TP + TN) / (TP + FP + FN + TN)]: {0:.1f} %".\
format(self.accuracy * 100)
return msg
@property
def sensitivity(self):
if self.TP + self.FN == 0:
return 0
return self.TP * 1. / (self.TP + self.FN)
@property
def specificity(self):
if self.TP + self.FP == 0:
return 0
return self.TP * 1. / (self.TP + self.FP)
@property
def accuracy(self):
if self.TP + self.FP + self.FN + self.TN == 0:
return 0
return (self.TP + self.TN) * 1. / \
(self.TP + self.FP + self.FN + self.TN)
@property
def score(self):
return "|".join(("{0:.3f}".format(x) for x in \
(self.sensitivity, self.specificity, self.accuracy)))
class BedSummary(object):
def __init__(self, bed):
mspans = [(x.span, x.accn) for x in bed]
spans, accns = zip(*mspans)
self.mspans = mspans
self.stats = SummaryStats(spans)
self.nseqids = len(set(x.seqid for x in bed))
self.nfeats = len(bed)
self.total_bases = bed_sum(bed, unique=False)
self.unique_bases = bed_sum(bed)
self.coverage = self.total_bases * 1. / self.unique_bases
def report(self):
print >> sys.stderr, "Total seqids: {0}".format(self.nseqids)
print >> sys.stderr, "Total ranges: {0}".format(self.nfeats)
print >> sys.stderr, "Total unique bases: {0} bp".format(thousands(self.unique_bases))
print >> sys.stderr, "Total bases: {0} bp".format(thousands(self.total_bases))
print >> sys.stderr, "Estimated coverage: {0:.1f}x".format(self.coverage)
print >> sys.stderr, self.stats
maxspan, maxaccn = max(self.mspans)
minspan, minaccn = min(self.mspans)
print >> sys.stderr, "Longest: {0} ({1})".format(maxaccn, maxspan)
print >> sys.stderr, "Shortest: {0} ({1})".format(minaccn, minspan)
def __str__(self):
return "\t".join(str(x) for x in (self.nfeats, self.unique_bases))
def bed_sum(beds, seqid=None, unique=True):
if seqid:
ranges = [(x.seqid, x.start, x.end) for x in beds \
if x.seqid == seqid]
else:
ranges = [(x.seqid, x.start, x.end) for x in beds]
unique_sum = range_union(ranges)
raw_sum = sum(x.span for x in beds)
return unique_sum if unique else raw_sum
def main():
actions = (
('depth', 'calculate average depth per feature using coverageBed'),
('sort', 'sort bed file'),
('merge', 'merge bed files'),
('index', 'index bed file using tabix'),
('bins', 'bin bed lengths into each window'),
('summary', 'summarize the lengths of the intervals'),
('evaluate', 'make truth table and calculate sensitivity and specificity'),
('pile', 'find the ids that intersect'),
('pairs', 'estimate insert size between paired reads from bedfile'),
('mates', 'print paired reads from bedfile'),
('sizes', 'infer the sizes for each seqid'),
('uniq', 'remove overlapping features with higher scores'),
('longest', 'select longest feature within overlapping piles'),
('bedpe', 'convert to bedpe format'),
('distance', 'calculate distance between bed features'),
('sample', 'sample bed file and remove high-coverage regions'),
('refine', 'refine bed file using a second bed file'),
('flanking', 'get n flanking features for a given position'),
('some', 'get a subset of bed features given a list'),
('fix', 'fix non-standard bed files'),
('filter', 'filter the bedfile to retain records between size range'),
('random', 'extract a random subset of features'),
('juncs', 'trim junctions.bed overhang to get intron, merge multiple beds'),
('seqids', 'print out all seqids on one line'),
('alignextend', 'alignextend based on BEDPE and FASTA ref'),
('clr', 'extract clear range based on BEDPE'),
('density', 'calculates density of features per seqid'),
)
p = ActionDispatcher(actions)
p.dispatch(globals())
def density(args):
"""
%prog density bedfile ref.fasta
Calculates density of features per seqid.
"""
p = OptionParser(density.__doc__)
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
bedfile, fastafile = args
bed = Bed(bedfile)
sizes = Sizes(fastafile).mapping
header = "seqid features size density_per_Mb".split()
print "\t".join(header)
for seqid, bb in bed.sub_beds():
nfeats = len(bb)
size = sizes[seqid]
ds = nfeats * 1e6 / size
print "\t".join(str(x) for x in \
(seqid, nfeats, size, "{0:.1f}".format(ds)))
def clr(args):
"""
%prog clr bedpefile ref.fasta
Use mates from BEDPE to extract ranges where the ref is covered by mates.
This is useful in detection of chimeric contigs.
"""
p = OptionParser(clr.__doc__)
p.set_bedpe()
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
bedpe, ref = args
filtered = bedpe + ".filtered"
if need_update(bedpe, filtered):
filter_bedpe(bedpe, filtered, ref, rc=opts.rc,
minlen=opts.minlen, maxlen=opts.maxlen)
converted = bedpe + ".converted"
if need_update(filtered, converted):
fp = open(filtered)
fw = open(converted, "w")
for row in fp:
r = BedpeLine(row)
print >> fw, r.bedline
fw.close()
merged = bedpe + ".merge.bed"
if need_update(converted, merged):
mergeBed(converted)
return fastaFromBed(merged, ref)
def sfa_to_fq(sfa, qvchar):
fq = sfa.rsplit(".", 1)[0] + ".fq"
fp = must_open(sfa)
fw = must_open(fq, "w")
total = 0
for row in fp:
total += 1
name, seq = row.split()
qual = len(seq) * qvchar
print >> fw, "\n".join(("@" + name, seq, "+", qual))
logging.debug("A total of {0} sequences written to `{1}`.".format(total, fq))
return fq
def filter_bedpe(bedpe, filtered, ref, rc=False, rlen=None,
minlen=2000, maxlen=8000):
tag = " after RC" if rc else ""
logging.debug("Filter criteria: innie{0}, {1} <= insertsize <= {2}".\
format(tag, minlen, maxlen))
sizes = Sizes(ref).mapping
fp = must_open(bedpe)
fw = must_open(filtered, "w")
retained = total = 0
for row in fp:
b = BedpeLine(row)
total += 1
if rc:
b.rc()
if not b.is_innie:
continue
b.score = b.outerdist
if not minlen <= b.score <= maxlen:
continue
retained += 1
if rlen:
b.extend(rlen, sizes[b.seqid1])
print >> fw, b
logging.debug("A total of {0} mates written to `{1}`.".\
format(percentage(retained, total), filtered))
fw.close()
def alignextend(args):
"""
%prog alignextend bedpefile ref.fasta
Similar idea to alignextend, using mates from BEDPE and FASTA ref. See AMOS
script here:
https://github.com/nathanhaigh/amos/blob/master/src/Experimental/alignextend.pl
"""
p = OptionParser(alignextend.__doc__)
p.add_option("--len", default=100, type="int",
help="Extend to this length")
p.add_option("--dup", default=10, type="int",
help="Filter duplicates with coordinates within this distance")
p.add_option("--qv", default=31, type="int",
help="Dummy qv score for extended bases")
p.set_bedpe()
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
bedpe, ref = args
dupwiggle = opts.dup
qvchar = chr(opts.qv + 33)
pf = bedpe.split(".")[0]
filtered = bedpe + ".filtered"
if need_update(bedpe, filtered):
filter_bedpe(bedpe, filtered, ref, rc=opts.rc,
minlen=opts.minlen, maxlen=opts.maxlen, rlen=opts.rlen)
sortedfiltered = filtered + ".sorted"
if need_update(filtered, sortedfiltered):
sh("sort -k1,1 -k2,2n -i {0} -o {1}".format(filtered, sortedfiltered))
clr = pf + ".clr.bed"
rmdup = sortedfiltered + ".rmdup"
if need_update(sortedfiltered, (clr, rmdup)):
logging.debug("Rmdup criteria: wiggle <= {0}".format(dupwiggle))
fp = must_open(sortedfiltered)
fw = must_open(rmdup, "w")
fw_clr = must_open(clr, "w")
data = [BedpeLine(x) for x in fp]
retained = total = 0
for seqid, ss in groupby(data, key=lambda x: x.seqid1):
ss = list(ss)
smin = min(x.start1 for x in ss)
smax = max(x.end2 for x in ss)
print >> fw_clr, "\t".join(str(x) for x in (seqid, smin - 1, smax))
for i, a in enumerate(ss):
if a.isdup:
continue
for b in ss[i + 1:]:
if b.start1 > a.start1 + dupwiggle:
break
if b.isdup:
continue
if a.seqid2 == b.seqid2 and \
a.start2 - dupwiggle <= b.start2 <= a.start2 + dupwiggle:
b.isdup = True
for a in ss:
total += 1
if a.isdup:
continue
retained += 1
print >> fw, a
logging.debug("A total of {0} mates written to `{1}`.".\
format(percentage(retained, total), rmdup))
fw.close()
fw_clr.close()
bed1, bed2 = pf + ".1e.bed", pf + ".2e.bed"
if need_update(rmdup, (bed1, bed2)):
sh("cut -f1-3,7-9 {0}".format(rmdup), outfile=bed1)
sh("cut -f4-6,7-8,10 {0}".format(rmdup), outfile=bed2)
sfa1, sfa2 = pf + ".1e.sfa", pf + ".2e.sfa"
if need_update((bed1, bed2, ref), (sfa1, sfa2)):
for bed in (bed1, bed2):
fastaFromBed(bed, ref, name=True, tab=True, stranded=True)
fq1, fq2 = pf + ".1e.fq", pf + ".2e.fq"
if need_update((sfa1, sfa2), (fq1, fq2)):
for sfa in (sfa1, sfa2):
sfa_to_fq(sfa, qvchar)
def seqids(args):
"""
%prog seqids bedfile
Print out all seqids on one line. Useful for graphics.karyotype.
"""
p = OptionParser(seqids.__doc__)
p.add_option("--maxn", default=100, type="int",
help="Maximum number of seqids")
p.add_option("--prefix", help="Seqids must start with")
opts, args = p.parse_args(args)
if len(args) < 1:
sys.exit(not p.print_help())
bedfile, = args
pf = opts.prefix
bed = Bed(bedfile)
s = bed.seqids
if pf:
s = [x for x in s if x.startswith(pf)]
s = s[:opts.maxn]
print ",".join(s)
def juncs(args):
"""
%prog junctions junctions1.bed [junctions2.bed ...]
Given a TopHat junctions.bed file, trim the read overhang to get intron span
If more than one junction bed file is provided, uniq the junctions and
calculate cumulative (sum) junction support
"""
from tempfile import mkstemp
from pybedtools import BedTool
p = OptionParser(juncs.__doc__)
p.set_outfile()
opts, args = p.parse_args(args)
if len(args) < 1:
sys.exit(not p.print_help())
fh, trimbed = mkstemp(suffix = ".bed")
fw = must_open(trimbed, "w")
for i, juncbed in enumerate(args):
bed = Bed(juncbed, juncs=True)
for b in bed:
ovh = [int(x) for x in b.extra[-2].split(",")]
b.start += ovh[0]
b.end -= ovh[1]
b.accn = "{0}-{1}".format(b.accn, i)
b.extra = None
print >> fw, b
fw.close()
if len(args) > 1:
sh("sort -k1,1 -k2,2n {0} -o {0}".format(trimbed))
tbed = BedTool(trimbed)
grouptbed = tbed.groupby(g=[1,2,3,6], c=5, ops=['sum'])
cmd = """awk -F $'\t' 'BEGIN { OFS = FS } { ID = sprintf("mJUNC%07d", NR); print $1,$2,$3,ID,$5,$4; }'"""
infile = grouptbed.fn
sh(cmd, infile=infile, outfile=opts.outfile)
else:
sort([trimbed, "-o", opts.outfile])
os.unlink(trimbed)
def random(args):
"""
%prog random bedfile number_of_features
Extract a random subset of features. Number of features can be an integer
number, or a fractional number in which case a random fraction (for example
0.1 = 10% of all features) will be extracted.
"""
from random import sample
from jcvi.formats.base import flexible_cast
p = OptionParser(random.__doc__)
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
bedfile, N = args
assert is_number(N)
b = Bed(bedfile)
NN = flexible_cast(N)
if NN < 1:
NN = int(round(NN * len(b)))
beds = sample(b, NN)
new_bed = Bed()
new_bed.extend(beds)
outfile = bedfile.rsplit(".", 1)[0] + ".{0}.bed".format(N)
new_bed.print_to_file(outfile)
logging.debug("Write {0} features to `{1}`".format(NN, outfile))
def filter(args):
"""
%prog filter bedfile
Filter the bedfile to retain records between certain size range.
"""
p = OptionParser(filter.__doc__)
p.add_option("--minsize", default=0, type="int",
help="Minimum feature length")
p.add_option("--maxsize", default=1000000000, type="int",
help="Minimum feature length")
p.add_option("--minaccn", type="int",
help="Minimum value of accn, useful to filter based on coverage")
p.set_outfile()
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
bedfile, = args
fp = must_open(bedfile)
fw = must_open(opts.outfile, "w")
minsize, maxsize = opts.minsize, opts.maxsize
minaccn = opts.minaccn
total = []
keep = []
for row in fp:
b = BedLine(row)
span = b.span
total.append(span)
if not minsize <= span <= maxsize:
continue
if minaccn and int(b.accn) < minaccn:
continue
print >> fw, b
keep.append(span)
logging.debug("Stats: {0} features kept.".\
format(percentage(len(keep), len(total))))
logging.debug("Stats: {0} bases kept.".\
format(percentage(sum(keep), sum(total))))
def depth(args):
"""
%prog depth reads.bed features.bed
Calculate depth depth per feature using coverageBed.
"""
p = OptionParser(depth.__doc__)
p.set_outfile()
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
readsbed, featsbed = args
fp = open(featsbed)
nargs = len(fp.readline().split("\t"))
keepcols = ",".join(str(x) for x in range(1, nargs + 1))
cmd = "coverageBed -a {0} -b {1} -d".format(readsbed, featsbed)
cmd += " | groupBy -g {0} -c {1} -o mean".format(keepcols, nargs + 2)
sh(cmd, outfile=opts.outfile)
def remove_isoforms(ids):
"""
This is more or less a hack to remove the GMAP multiple mappings. Multiple
GMAP mappings can be seen given the names .mrna1, .mrna2, etc.
"""
key = lambda x: x.rsplit(".", 1)[0]
iso_number = lambda x: get_number(x.split(".")[-1])
ids = sorted(ids, key=key)
newids = []
for k, ii in groupby(ids, key=key):
min_i = min(list(ii), key=iso_number)
newids.append(min_i)
return newids
def longest(args):
"""
%prog longest bedfile fastafile
Select longest feature within overlapping piles.
"""
from jcvi.formats.sizes import Sizes
p = OptionParser(longest.__doc__)
p.add_option("--maxsize", default=20000, type="int",
help="Limit max size")
p.add_option("--minsize", default=60, type="int",
help="Limit min size")
p.add_option("--precedence", default="Medtr",
help="Accessions with prefix take precedence")
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
bedfile, fastafile = args
maxsize = opts.maxsize
minsize = opts.minsize
prec = opts.precedence
mergedbed = mergeBed(bedfile, nms=True)
sizes = Sizes(fastafile).mapping
bed = Bed(mergedbed)
pf = bedfile.rsplit(".", 1)[0]
ids = set()
for b in bed:
accns = b.accn.split(";")
prec_accns = [x for x in accns if x.startswith(prec)]
if prec_accns:
accns = prec_accns
accn_sizes = [(sizes.get(x, 0), x) for x in accns]
accn_sizes = [(size, x) for size, x in accn_sizes if size < maxsize]
if not accn_sizes:
continue
max_size, max_accn = max(accn_sizes)
if max_size < minsize:
continue
ids.add(max_accn)
newids = remove_isoforms(ids)
logging.debug("Remove isoforms: before={0} after={1}".\
format(len(ids), len(newids)))
longestidsfile = pf + ".longest.ids"
fw = open(longestidsfile, "w")
print >> fw, "\n".join(newids)
fw.close()
logging.debug("A total of {0} records written to `{1}`.".\
format(len(newids), longestidsfile))
longestbedfile = pf + ".longest.bed"
some([bedfile, longestidsfile, "--outfile={0}".format(longestbedfile),
"--no_strip_names"])
def merge(args):
"""
%prog merge bedfiles > newbedfile
Concatenate bed files together. Performing seqid and name changes to avoid
conflicts in the new bed file.
"""
p = OptionParser(merge.__doc__)
p.set_outfile()
opts, args = p.parse_args(args)
if len(args) < 1:
sys.exit(not p.print_help())
bedfiles = args
fw = must_open(opts.outfile, "w")
for bedfile in bedfiles:
bed = Bed(bedfile)
pf = op.basename(bedfile).split(".")[0]
for b in bed:
b.seqid = "_".join((pf, b.seqid))
print >> fw, b
def fix(args):
"""
%prog fix bedfile > newbedfile
Fix non-standard bed files. One typical problem is start > end.
"""
p = OptionParser(fix.__doc__)
p.add_option("--minspan", default=0, type="int",
help="Enforce minimum span [default: %default]")
p.set_outfile()
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
bedfile, = args
minspan = opts.minspan
fp = open(bedfile)
fw = must_open(opts.outfile, "w")
nfixed = nfiltered = ntotal = 0
for row in fp:
atoms = row.strip().split("\t")
assert len(atoms) >= 3, "Must be at least 3 columns"
seqid, start, end = atoms[:3]
start, end = int(start), int(end)
orientation = '+'
if start > end:
start, end = end, start
orientation = '-'
nfixed += 1
atoms[1:3] = [str(start), str(end)]
if len(atoms) > 6:
atoms[6] = orientation
line = "\t".join(atoms)
b = BedLine(line)
if b.span >= minspan:
print >> fw, b
nfiltered += 1
ntotal += 1
if nfixed:
logging.debug("Total fixed: {0}".format(percentage(nfixed, ntotal)))
if nfiltered:
logging.debug("Total filtered: {0}".format(percentage(nfiltered, ntotal)))
def some(args):
"""
%prog some bedfile idsfile > newbedfile
Retrieve a subset of bed features given a list of ids.
"""
from jcvi.formats.base import SetFile
from jcvi.utils.cbook import gene_name
p = OptionParser(some.__doc__)
p.add_option("-v", dest="inverse", default=False, action="store_true",
help="Get the inverse, like grep -v [default: %default]")
p.set_outfile()
p.set_stripnames()
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
bedfile, idsfile = args
inverse = opts.inverse
ostrip = opts.strip_names
fw = must_open(opts.outfile, "w")
ids = SetFile(idsfile)
if ostrip:
ids = set(gene_name(x) for x in ids)
bed = Bed(bedfile)
ntotal = nkeep = 0
for b in bed:
ntotal += 1
keep = b.accn in ids
if inverse:
keep = not keep
if keep:
nkeep += 1
print >> fw, b
fw.close()
logging.debug("Stats: {0} features kept.".\
format(percentage(nkeep, ntotal)))
def uniq(args):
"""
%prog uniq bedfile
Remove overlapping features with higher scores.
"""
from jcvi.formats.sizes import Sizes
p = OptionParser(uniq.__doc__)
p.add_option("--sizes", help="Use sequence length as score")
p.add_option("--mode", default="span", choices=("span", "score"),
help="Pile mode")
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
bedfile, = args
uniqbedfile = bedfile.split(".")[0] + ".uniq.bed"
bed = Bed(bedfile)
if opts.sizes:
sizes = Sizes(opts.sizes).mapping
ranges = [Range(x.seqid, x.start, x.end, sizes[x.accn], i) \
for i, x in enumerate(bed)]
else:
if opts.mode == "span":
ranges = [Range(x.seqid, x.start, x.end, x.end - x.start + 1, i) \
for i, x in enumerate(bed)]
else:
ranges = [Range(x.seqid, x.start, x.end, float(x.score), i) \
for i, x in enumerate(bed)]
selected, score = range_chain(ranges)
selected = [x.id for x in selected]
selected_ids = set(selected)
selected = [bed[x] for x in selected]
notselected = [x for i, x in enumerate(bed) if i not in selected_ids]
newbed = Bed()
newbed.extend(selected)
newbed.print_to_file(uniqbedfile, sorted=True)
if notselected:
leftoverfile = bedfile.split(".")[0] + ".leftover.bed"
leftoverbed = Bed()
leftoverbed.extend(notselected)
leftoverbed.print_to_file(leftoverfile, sorted=True)
logging.debug("Imported: {0}, Exported: {1}".format(len(bed), len(newbed)))
return uniqbedfile
def subtractbins(binfile1, binfile2):
from jcvi.graphics.landscape import BinFile
abin = BinFile(binfile1)
bbin = BinFile(binfile2)
assert len(abin) == len(bbin)
fw = open(binfile1, "w")
for a, b in zip(abin, bbin):
assert a.chr == b.chr
assert a.binlen == b.binlen
a.subtract(b)
print >> fw, a
fw.close()
return binfile1
def bins(args):
"""
%prog bins bedfile fastafile
Bin bed lengths into each consecutive window. Use --subtract to remove bases
from window, e.g. --subtract gaps.bed ignores the gap sequences.
"""
from jcvi.formats.sizes import Sizes
p = OptionParser(bins.__doc__)
p.add_option("--binsize", default=100000, type="int",
help="Size of the bins [default: %default]")
p.add_option("--subtract",
help="Subtract bases from window [default: %default]")
p.add_option("--mode", default="span", choices=("span", "count", "score"),
help="Accumulate feature based on [default: %default]")
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
bedfile, fastafile = args
subtract = opts.subtract
mode = opts.mode
assert op.exists(bedfile), "File `{0}` not found".format(bedfile)
binsize = opts.binsize
binfile = bedfile + ".{0}".format(binsize)
binfile += ".{0}.bins".format(mode)
if not need_update(bedfile, binfile):
return binfile
sz = Sizes(fastafile)
sizesfile = sz.filename
sizes = sz.mapping
fw = open(binfile, "w")
scores = "median" if mode == "score" else None
bedfile = mergeBed(bedfile, nms=True, scores=scores)
if subtract:
subtractmerge = mergeBed(subtract)
subtract_complement = complementBed(subtractmerge, sizesfile)
bedfile = intersectBed(bedfile, subtract_complement)
bedfile = sort([bedfile, "-i"])
bed = Bed(bedfile)
sbdict = dict(bed.sub_beds())
for chr, chr_len in sorted(sizes.items()):
chr_len = sizes[chr]
subbeds = sbdict.get(chr, [])
nbins = chr_len / binsize
last_bin = chr_len % binsize
if last_bin:
nbins += 1
a = np.zeros(nbins) # values
b = np.zeros(nbins, dtype="int") # bases
c = np.zeros(nbins, dtype="int") # count
b[:-1] = binsize
b[-1] = last_bin
for bb in subbeds:
start, end = bb.start, bb.end
startbin = start / binsize
endbin = end / binsize
assert startbin <= endbin
c[startbin:endbin + 1] += 1
if mode == "score":
a[startbin:endbin + 1] += float(bb.score)
elif mode == "span":
if startbin == endbin:
a[startbin] += end - start + 1
if startbin < endbin:
firstsize = (startbin + 1) * binsize - start + 1
lastsize = end - endbin * binsize
a[startbin] += firstsize
if startbin + 1 < endbin:
a[startbin + 1:endbin] += binsize
a[endbin] += lastsize
if mode == "count":
a = c
for xa, xb in zip(a, b):
print >> fw, "\t".join(str(x) for x in (chr, xa, xb))
fw.close()
if subtract:
subtractbinfile = bins([subtract, fastafile, "--binsize={0}".format(binsize)])
binfile = subtractbins(binfile, subtractbinfile)
return binfile
def pile(args):
"""
%prog pile abedfile bbedfile > piles
Call intersectBed on two bedfiles.
"""
from jcvi.utils.grouper import Grouper
p = OptionParser(pile.__doc__)
p.add_option("--minOverlap", default=0, type="int",
help="Minimum overlap required [default: %default]")
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
abedfile, bbedfile = args
iw = intersectBed_wao(abedfile, bbedfile, minOverlap=opts.minOverlap)
groups = Grouper()
for a, b in iw:
groups.join(a.accn, b.accn)
ngroups = 0
for group in groups:
if len(group) > 1:
ngroups += 1
print "|".join(group)
logging.debug("A total of {0} piles (>= 2 members)".format(ngroups))
def index(args):
"""
%prog index bedfile
Compress frgscffile.sorted and index it using `tabix`.
"""
p = OptionParser(index.__doc__)
p.add_option("--query",
help="Chromosome location [default: %default]")
p.set_outfile()
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
bedfile, = args
gzfile = bedfile + ".gz"
if need_update(bedfile, gzfile):
bedfile = sort([bedfile])
cmd = "bgzip -c {0}".format(bedfile)
sh(cmd, outfile=gzfile)
tbifile = gzfile + ".tbi"
if need_update(gzfile, tbifile):
cmd = "tabix -p bed {0}".format(gzfile)
sh(cmd)
query = opts.query
if not query:
return
cmd = "tabix {0} {1}".format(gzfile, query)
sh(cmd, outfile=opts.outfile)
def fastaFromBed(bedfile, fastafile, name=False, tab=False, stranded=False):
suffix = ".sfa" if tab else ".fasta"
outfile = op.basename(bedfile).rsplit(".", 1)[0] + suffix
cmd = "fastaFromBed -fi {0} -bed {1} -fo {2}".\
format(fastafile, bedfile, outfile)
if name:
cmd += " -name"
if tab:
cmd += " -tab"
if stranded:
cmd += " -s"
if need_update([bedfile, fastafile], outfile):
sh(cmd, outfile=outfile)
return outfile
def mergeBed(bedfile, d=0, sorted=False, nms=False, s=False, scores=None, delim=";"):
if not sorted:
bedfile = sort([bedfile, "-i"])
cmd = "mergeBed -i {0}".format(bedfile)
if d:
cmd += " -d {0}".format(d)
if nms:
nargs = len(open(bedfile).readline().split())
if nargs <= 3:
logging.debug("Only {0} columns detected... set nms=True"\
.format(nargs))
else:
cmd += " -c 4 -o collapse"
if s:
cmd += " -s"
if scores:
valid_opts = ("sum", "min", "max", "mean", "median",
"mode", "antimode", "collapse")
if not scores in valid_opts:
scores = "mean"
cmd += " -scores {0}".format(scores)
cmd += ' -delim "{0}"'.format(delim)
mergebedfile = op.basename(bedfile).rsplit(".", 1)[0] + ".merge.bed"
if need_update(bedfile, mergebedfile):
sh(cmd, outfile=mergebedfile)
return mergebedfile
def complementBed(bedfile, sizesfile):
cmd = "complementBed"
cmd += " -i {0} -g {1}".format(bedfile, sizesfile)
complementbedfile = "complement_" + op.basename(bedfile)
if need_update([bedfile, sizesfile], complementbedfile):
sh(cmd, outfile=complementbedfile)
return complementbedfile
def intersectBed(bedfile1, bedfile2):
cmd = "intersectBed"
cmd += " -a {0} -b {1}".format(bedfile1, bedfile2)
suffix = ".intersect.bed"
intersectbedfile = ".".join((op.basename(bedfile1).split(".")[0],
op.basename(bedfile2).split(".")[0])) + suffix
if need_update([bedfile1, bedfile2], intersectbedfile):
sh(cmd, outfile=intersectbedfile)
return intersectbedfile
def query_to_range(query, sizes):
# chr1:1-10000 => (chr1, 0, 10000)
if ":" in query:
a, bc = query.split(":", 1)
b, c = [int(x) for x in bc.split("-", 1)]
b -= 1
else:
a = query
b, c = 0, sizes.mapping[a]
return a, b, c
def evaluate(args):
"""
%prog evaluate prediction.bed reality.bed fastafile
Make a truth table like:
True False --- Reality
True TP FP
False FN TN
|----Prediction
Sn = TP / (all true in reality) = TP / (TP + FN)
Sp = TP / (all true in prediction) = TP / (TP + FP)
Ac = (TP + TN) / (TP + FP + FN + TN)
"""
from jcvi.formats.sizes import Sizes
p = OptionParser(evaluate.__doc__)
p.add_option("--query",
help="Chromosome location [default: %default]")
opts, args = p.parse_args(args)
if len(args) != 3:
sys.exit(not p.print_help())
prediction, reality, fastafile = args
query = opts.query
prediction = mergeBed(prediction)
reality = mergeBed(reality)
sizes = Sizes(fastafile)
sizesfile = sizes.filename
prediction_complement = complementBed(prediction, sizesfile)
reality_complement = complementBed(reality, sizesfile)
TPbed = intersectBed(prediction, reality)
FPbed = intersectBed(prediction, reality_complement)
FNbed = intersectBed(prediction_complement, reality)
TNbed = intersectBed(prediction_complement, reality_complement)
beds = (TPbed, FPbed, FNbed, TNbed)
if query:
subbeds = []
rr = query_to_range(query, sizes)
ce = 'echo "{0}"'.format("\t".join(str(x) for x in rr))
for b in beds:
subbed = ".".join((b, query))
cmd = ce + " | intersectBed -a stdin -b {0}".format(b)
sh(cmd, outfile=subbed)
subbeds.append(subbed)
beds = subbeds
be = BedEvaluate(*beds)
print >> sys.stderr, be
if query:
for b in subbeds:
os.remove(b)
return be
def intersectBed_wao(abedfile, bbedfile, minOverlap=0):
abed = Bed(abedfile)
bbed = Bed(bbedfile)
print >> sys.stderr, "`{0}` has {1} features.".format(abedfile, len(abed))
print >> sys.stderr, "`{0}` has {1} features.".format(bbedfile, len(bbed))
cmd = "intersectBed -wao -a {0} -b {1}".format(abedfile, bbedfile)
acols = abed[0].nargs
bcols = bbed[0].nargs
fp = popen(cmd)
for row in fp:
atoms = row.split()
aline = "\t".join(atoms[:acols])
bline = "\t".join(atoms[acols:acols + bcols])
c = int(atoms[-1])
if c < minOverlap:
continue
a = BedLine(aline)
try:
b = BedLine(bline)
except AssertionError:
b = None
yield a, b
def refine(args):
"""
%prog refine bedfile1 bedfile2 refinedbed
Refine bed file using a second bed file. The final bed is keeping all the
intervals in bedfile1, but refined by bedfile2 whenever they have
intersection.
"""
p = OptionParser(refine.__doc__)
opts, args = p.parse_args(args)
if len(args) != 3:
sys.exit(not p.print_help())
abedfile, bbedfile, refinedbed = args
fw = open(refinedbed, "w")
intersected = refined = 0
for a, b in intersectBed_wao(abedfile, bbedfile):
if b is None:
print >> fw, a
continue
intersected += 1
aspan_before = a.span
arange = (a.start, a.end)
brange = (b.start, b.end)
irange = range_intersect(arange, brange)
a.start, a.end = irange
aspan_after = a.span
if aspan_before > aspan_after:
refined += 1
print >> fw, a
fw.close()
print >> sys.stderr, "Total intersected: {0}".format(intersected)
print >> sys.stderr, "Total refined: {0}".format(refined)
summary([abedfile])
summary([refinedbed])
def distance(args):
"""
%prog distance bedfile
Calculate distance between bed features. The output file is a list of
distances, which can be used to plot histogram, etc.
"""
from jcvi.utils.iter import pairwise
p = OptionParser(distance.__doc__)
p.add_option("--distmode", default="ss", choices=("ss", "ee"),
help="Distance mode between paired reads. ss is outer distance, " \
"ee is inner distance [default: %default]")
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
bedfile, = args
sortedbedfile = sort([bedfile])
valid = total = 0
fp = open(sortedbedfile)
for a, b in pairwise(fp):
a = BedLine(a)
b = BedLine(b)
ar = (a.seqid, a.start, a.end, "+")
br = (b.seqid, b.start, b.end, "+")
dist, oo = range_distance(ar, br, distmode=opts.distmode)
total += 1
if dist > 0:
print dist
valid += 1
logging.debug("Total valid (> 0) distances: {0}.".\
format(percentage(valid, total)))
def sample(args):
"""
%prog sample bedfile sizesfile
Sample bed file and remove high-coverage regions.
When option --targetsize is used, this program uses a differnent mode. It
first calculates the current total bases from all ranges and then compare to
targetsize, if more, then sample down as close to targetsize as possible.
"""
import random
from jcvi.assembly.coverage import Coverage
p = OptionParser(sample.__doc__)
p.add_option("--max", default=10, type="int",
help="Max depth allowed [default: %default]")
p.add_option("--targetsize", type="int",
help="Sample bed file to get target base number [default: %default]")
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
bedfile, sizesfile = args
pf = bedfile.rsplit(".", 1)[0]
targetsize = opts.targetsize
if targetsize:
bed = Bed(bedfile)
samplebed = pf + ".sample.bed"
fw = open(samplebed, "w")
nfeats = len(bed)
nbases = bed.sum(unique=False)
targetfeats = int(round(nfeats * targetsize / nbases))
sub_bed = random.sample(bed, targetfeats)
for b in sub_bed:
print >> fw, b
logging.debug("File written to `{0}`.".format(samplebed))
return
c = Coverage(bedfile, sizesfile)
coveragefile = c.filename
samplecoveragefile = pf + ".sample.coverage"
fw = open(samplecoveragefile, "w")
fp = open(coveragefile)
for row in fp:
seqid, start, end, cov = row.split()
cov = int(cov)
if cov <= opts.max:
fw.write(row)
fw.close()
samplebedfile = pf + ".sample.bed"
cmd = "intersectBed -a {0} -b {1} -wa -u".format(bedfile, samplecoveragefile)
sh(cmd, outfile=samplebedfile)
logging.debug("Sampled bedfile written to `{0}`.".format(samplebedfile))
def bedpe(args):
"""
%prog bedpe bedfile
Convert to bedpe format. Use --span to write another bed file that contain
the span of the read pairs.
"""
from jcvi.assembly.coverage import bed_to_bedpe
p = OptionParser(bedpe.__doc__)
p.add_option("--span", default=False, action="store_true",
help="Write span bed file [default: %default]")
p.add_option("--mates", help="Check the library stats from .mates file")
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
bedfile, = args
pf = bedfile.rsplit(".", 1)[0]
bedpefile = pf + ".bedpe"
bedspanfile = pf + ".spans.bed" if opts.span else None
bed_to_bedpe(bedfile, bedpefile, \
pairsbedfile=bedspanfile, matesfile=opts.mates)
return bedpefile, bedspanfile
def sizes(args):
"""
%prog sizes bedfile
Infer the sizes for each seqid. Useful before dot plots.
"""
p = OptionParser(sizes.__doc__)
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
bedfile, = args
assert op.exists(bedfile)
sizesfile = bedfile.rsplit(".", 1)[0] + ".sizes"
fw = must_open(sizesfile, "w", checkexists=True, skipcheck=True)
if fw:
b = Bed(bedfile)
for s, sbeds in b.sub_beds():
print >> fw, "{0}\t{1}".format(\
s, max(x.end for x in sbeds))
logging.debug("Sizes file written to `{0}`.".format(sizesfile))
return sizesfile
def analyze_dists(dists, cutoff=1000, alpha=.1):
"""
The dists can show bimodal distribution if they come from a mate-pair
library. Assume bimodal distribution and then separate the two peaks. Based
on the percentage in each peak, we can decide if it is indeed one peak or
two peaks, and report the median respectively.
"""
peak0 = [d for d in dists if d < cutoff]
peak1 = [d for d in dists if d >= cutoff]
c0, c1 = len(peak0), len(peak1)
logging.debug("Component counts: {0} {1}".format(c0, c1))
if c0 == 0 or c1 == 0 or float(c1) / len(dists) < alpha:
logging.debug("Single peak identified ({0} / {1} < {2})".\
format(c1, len(dists), alpha))
return np.median(dists)
peak0_median = np.median(peak0)
peak1_median = np.median(peak1)
logging.debug("Dual peaks identified: {0}bp ({1}), {2}bp ({3}) (selected)".\
format(int(peak0_median), c0, int(peak1_median), c1))
return peak1_median
def report_pairs(data, cutoff=0, mateorientation=None,
pairsfile=None, insertsfile=None, rclip=1, ascii=False, bins=20,
distmode="ss", mpcutoff=1000):
"""
This subroutine is used by the pairs function in blast.py and cas.py.
Reports number of fragments and pairs as well as linked pairs
"""
allowed_mateorientations = ("++", "--", "+-", "-+")
if mateorientation:
assert mateorientation in allowed_mateorientations
num_fragments, num_pairs = 0, 0
all_dist = []
linked_dist = []
# +- (forward-backward) is `innie`, -+ (backward-forward) is `outie`
orientations = defaultdict(int)
# clip how many chars from end of the read name to get pair name
key = (lambda x: x.accn[:-rclip]) if rclip else (lambda x: x.accn)
data.sort(key=key)
if pairsfile:
pairsfw = open(pairsfile, "w")
if insertsfile:
insertsfw = open(insertsfile, "w")
for pe, lines in groupby(data, key=key):
lines = list(lines)
if len(lines) != 2:
num_fragments += len(lines)
continue
num_pairs += 1
a, b = lines
asubject, astart, astop = a.seqid, a.start, a.end
bsubject, bstart, bstop = b.seqid, b.start, b.end
aquery, bquery = a.accn, b.accn
astrand, bstrand = a.strand, b.strand
dist, orientation = range_distance(\
(asubject, astart, astop, astrand),
(bsubject, bstart, bstop, bstrand),
distmode=distmode)
if dist >= 0:
all_dist.append((dist, orientation, aquery, bquery))
# select only pairs with certain orientations - e.g. innies, outies, etc.
if mateorientation:
all_dist = [x for x in all_dist if x[1] == mateorientation]
# try to infer cutoff as twice the median until convergence
if cutoff <= 0:
dists = np.array([x[0] for x in all_dist], dtype="int")
p0 = analyze_dists(dists, cutoff=mpcutoff)
cutoff = int(2 * p0) # initial estimate
cutoff = int(math.ceil(cutoff / bins)) * bins
logging.debug("Insert size cutoff set to {0}, ".format(cutoff) +
"use '--cutoff' to override")
for dist, orientation, aquery, bquery in all_dist:
if dist > cutoff:
continue
if cutoff > 2 * mpcutoff and dist < mpcutoff:
continue
linked_dist.append(dist)
if pairsfile:
print >> pairsfw, "{0}\t{1}\t{2}".format(aquery, bquery, dist)
orientations[orientation] += 1
print >>sys.stderr, "{0} fragments, {1} pairs ({2} total)".\
format(num_fragments, num_pairs, num_fragments + num_pairs * 2)
s = SummaryStats(linked_dist, dtype="int")
num_links = s.size
meandist, stdev = s.mean, s.sd
p0, p1, p2 = s.median, s.p1, s.p2
print >>sys.stderr, "%d pairs (%.1f%%) are linked (cutoff=%d)" % \
(num_links, num_links * 100. / num_pairs, cutoff)
print >>sys.stderr, "mean distance between mates: {0} +/- {1}".\
format(meandist, stdev)
print >>sys.stderr, "median distance between mates: {0}".format(p0)
print >>sys.stderr, "95% distance range: {0} - {1}".format(p1, p2)
print >>sys.stderr, "\nOrientations:"
orientation_summary = []
for orientation, count in sorted(orientations.items()):
o = "{0}:{1}".format(orientation, \
percentage(count, num_links, mode=1))
orientation_summary.append(o.split()[0])
print >>sys.stderr, o
if insertsfile:
from jcvi.graphics.histogram import histogram
print >>insertsfw, "\n".join(str(x) for x in linked_dist)
insertsfw.close()
prefix = insertsfile.rsplit(".", 1)[0]
if prefix > 10:
prefix = prefix.split("-")[0]
osummary = " ".join(orientation_summary)
title="{0} ({1}; median:{2} bp)".format(prefix, osummary, p0)
histogram(insertsfile, vmin=0, vmax=cutoff, bins=bins,
xlabel="Insertsize", title=title, ascii=ascii)
if op.exists(insertsfile):
os.remove(insertsfile)
return s
def pairs(args):
"""
See __doc__ for OptionParser.set_pairs().
"""
p = OptionParser(pairs.__doc__)
p.set_pairs()
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
bedfile, = args
basename = bedfile.split(".")[0]
insertsfile = ".".join((basename, "inserts"))
sortedbedfile = op.basename(bedfile).rsplit(".", 1)[0] + ".sorted.bed"
if need_update(bedfile, sortedbedfile):
bedfile = sort([bedfile, "--accn"])
else:
bedfile = sortedbedfile
fp = open(bedfile)
data = [BedLine(row) for i, row in enumerate(fp) if i < opts.nrows]
ascii = not opts.pdf
return bedfile, report_pairs(data, opts.cutoff, opts.mateorientation,
pairsfile=opts.pairsfile, insertsfile=insertsfile,
rclip=opts.rclip, ascii=ascii, bins=opts.bins,
distmode=opts.distmode)
def summary(args):
"""
%prog summary bedfile
Sum the total lengths of the intervals.
"""
p = OptionParser(summary.__doc__)
p.add_option("--sizes", default=False, action="store_true",
help="Write .sizes file")
p.add_option("--all", default=False, action="store_true",
help="Write summary stats per seqid")
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
bedfile, = args
bed = Bed(bedfile)
bs = BedSummary(bed)
if opts.sizes:
sizesfile = bedfile + ".sizes"
fw = open(sizesfile, "w")
for span, accn in bs.mspans:
print >> fw, span
fw.close()
logging.debug("Spans written to `{0}`.".format(sizesfile))
return bs
if not opts.all:
bs.report()
return bs
for seqid, subbeds in bed.sub_beds():
bs = BedSummary(subbeds)
print "\t".join((seqid, str(bs)))
def sort(args):
"""
%prog sort bedfile
Sort bed file to have ascending order of seqid, then start. It uses the
`sort` command.
"""
p = OptionParser(sort.__doc__)
p.add_option("-i", "--inplace", dest="inplace",
default=False, action="store_true",
help="Sort bed file in place [default: %default]")
p.add_option("-u", dest="unique",
default=False, action="store_true",
help="Uniqify the bed file")
p.add_option("--accn", default=False, action="store_true",
help="Sort based on the accessions [default: %default]")
p.set_outfile(outfile=None)
p.set_tmpdir()
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
bedfile, = args
inplace = opts.inplace
sortedbed = opts.outfile
if inplace:
sortedbed = bedfile
elif opts.outfile is None:
sortedbed = op.basename(bedfile).rsplit(".", 1)[0] + ".sorted.bed"
sortopt = "-k1,1 -k2,2n -k4,4" if not opts.accn else \
"-k4,4 -k1,1 -k2,2n"
cmd = "sort"
if opts.tmpdir:
cmd += " -T {0}".format(opts.tmpdir)
if opts.unique:
cmd += " -u"
cmd += " {0} {1} -o {2}".format(sortopt, bedfile, sortedbed)
sh(cmd)
return sortedbed
def mates(args):
"""
%prog mates bedfile
Generate the mates file by inferring from the names.
"""
p = OptionParser(mates.__doc__)
p.add_option("--lib", default=False, action="store_true",
help="Output library information along with pairs [default: %default]")
p.add_option("--nointra", default=False, action="store_true",
help="Remove mates that are intra-scaffold [default: %default]")
p.add_option("--prefix", default=False, action="store_true",
help="Only keep links between IDs with same prefix [default: %default]")
p.set_mates()
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
bedfile, = args
rclip = opts.rclip
key = (lambda x: x.accn[:-rclip]) if rclip else (lambda x: x.accn)
bed = Bed(bedfile, key=key)
pf = bedfile.rsplit(".", 1)[0]
matesfile = pf + ".mates"
lib = pf if opts.lib else None
fw = open(matesfile, "w")
if lib:
bedfile, stats = pairs([bedfile, \
"--rclip={0}".format(rclip),
"--cutoff={0}".format(opts.cutoff)])
sv = int(2 * stats.sd)
mindist = max(stats.mean - sv, 1)
maxdist = stats.mean + sv
print >> fw, "\t".join(str(x) for x in \
("library", pf, mindist, maxdist))
num_fragments = num_pairs = 0
matesbedfile = matesfile + ".bed"
fwm = open(matesbedfile, "w")
for pe, lines in groupby(bed, key=key):
lines = list(lines)
if len(lines) != 2:
num_fragments += len(lines)
continue
a, b = lines
if opts.nointra and a.seqid == b.seqid:
continue
# Use --prefix to limit the links between seqids with the same prefix
# For example, contigs of the same BAC, mth2-23j10_001, mth-23j10_002
if opts.prefix:
aprefix = a.seqid.split("_")[0]
bprefix = b.seqid.split("_")[0]
if aprefix != bprefix:
continue
num_pairs += 1
pair = [a.accn, b.accn]
if lib:
pair.append(lib)
print >> fw, "\t".join(pair)
print >> fwm, a
print >> fwm, b
logging.debug("Discard {0} frags and write {1} pairs to `{2}` and `{3}`.".\
format(num_fragments, num_pairs, matesfile, matesbedfile))
fw.close()
fwm.close()
return matesfile, matesbedfile
def flanking(args):
"""
%prog flanking bedfile [options]
Get up to n features (upstream or downstream or both) flanking a given position.
"""
from numpy import array, argsort
p = OptionParser(flanking.__doc__)
p.add_option("--chrom", default=None, type="string",
help="chrom name of the position in query. Make sure it matches bedfile.")
p.add_option("--coord", default=None, type="int",
help="coordinate of the position in query.")
p.add_option("-n", default=10, type="int",
help="number of flanking features to get [default: %default]")
p.add_option("--side", default="both", choices=("upstream", "downstream", "both"),
help="which side to get flanking features [default: %default]")
p.add_option("--max_d", default=None, type="int",
help="features <= max_d away from position [default: %default]")
p.set_outfile()
opts, args = p.parse_args(args)
if any([len(args) != 1, opts.chrom is None, opts.coord is None]):
sys.exit(not p.print_help())
bedfile, = args
position = (opts.chrom, opts.coord)
n, side, maxd = opts.n, opts.side, opts.max_d
chrombed = Bed(bedfile).sub_bed(position[0])
if side == "upstream":
data = [(abs(f.start-position[1]), f) for f in chrombed \
if f.start <= position[1]]
elif side == "downstream":
data = [(abs(f.start-position[1]), f) for f in chrombed \
if f.start >= position[1]]
else:
data = [(abs(f.start-position[1]), f) for f in chrombed]
if maxd:
data = [f for f in data if f[0]<=maxd]
n += 1 # not counting self
n = min(n, len(data))
distances, subbed = zip(*data)
distances = array(distances)
idx = argsort(distances)[:n]
flankingbed = [f for (i, f) in enumerate(subbed) if i in idx]
fw = must_open(opts.outfile, "w")
for atom in flankingbed:
print >>fw, str(atom)
return (position, flankingbed)
if __name__ == '__main__':
main()
|
sgordon007/jcvi_062915
|
formats/bed.py
|
Python
|
bsd-2-clause
| 60,122
|
[
"BLAST"
] |
8f70c9b7676b945e40adb889cac930834ed84ee8214c202b2460eda19a26fefc
|
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2007 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## 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; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU 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., or visit: http://www.gnu.org/.
##
## Author(s): Stoq Team <stoq-devel@async.com.br>
##
##
import glib
import gtk
from kiwi.ui.delegates import GladeDelegate
from kiwi.utils import gsignal
class ProgressDialog(GladeDelegate):
"""This is a dialog you use to show the progress of a certain task.
It's just a label, progress bar and button.
it'll always be displayed in the center of a screen.
The progress is pulsating and updated every 100 ms.
Signals:
* *cancel* (): Emitted when a the cancel button is clicked
"""
domain = 'stoq'
gladefile = "ProgressDialog"
toplevel_name = "ProgressDialog"
gsignal('cancel')
def __init__(self, label='', pulse=True):
"""
Create a new ProgressDialog object.
:param label: initial content of the label
"""
GladeDelegate.__init__(self, gladefile=self.gladefile)
self.set_title(label)
self._pulse = pulse
self._timeout_id = -1
self._start_id = -1
self.label.set_label(label)
self.toplevel.set_position(gtk.WIN_POS_CENTER)
def start(self, wait=50):
"""Start the task, it'll pulsate the progress bar until stop() is called
:param wait: how many ms to wait before showing the dialog, defaults
to 50
"""
if self._pulse:
self._timeout_id = glib.timeout_add(100, self._pulse_timeout)
self._start_id = glib.timeout_add(wait, self._real_start)
def stop(self):
"""Stops pulsating and hides the dialog
"""
self.hide()
if self._timeout_id != -1:
glib.source_remove(self._timeout_id)
self._timeout_id = -1
if self._start_id != -1:
glib.source_remove(self._start_id)
self._start_id = -1
def set_label(self, label):
"""Update the label of the dialog
:param label: the new content of the label
"""
self.label.set_label(label)
#
# Private and callbacks
#
def _real_start(self):
self.show()
# self.toplevel.present()
self._start_id = -1
return False
def _pulse_timeout(self):
self.progressbar.pulse()
return True
def on_cancel__clicked(self, button):
self.emit('cancel')
self.stop()
|
andrebellafronte/stoq
|
stoqlib/gui/dialogs/progressdialog.py
|
Python
|
gpl-2.0
| 3,155
|
[
"VisIt"
] |
8d1f80c08d04d8d7802df52bff153c3ed65774f4c3801c3c51f4a80722514a7a
|
########################################################################
# $HeadURL$
# File : JobCleaningAgent.py
# Author : A.T.
########################################################################
"""
The Job Cleaning Agent controls removing jobs from the WMS in the end of their life cycle.
"""
from DIRAC import S_OK, gLogger
from DIRAC.Core.Base.AgentModule import AgentModule
from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB
from DIRAC.WorkloadManagementSystem.DB.TaskQueueDB import TaskQueueDB
from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB import JobLoggingDB
from DIRAC.WorkloadManagementSystem.Client.SandboxStoreClient import SandboxStoreClient
from DIRAC.RequestManagementSystem.Client.Request import Request
from DIRAC.RequestManagementSystem.Client.Operation import Operation
from DIRAC.RequestManagementSystem.Client.File import File
from DIRAC.RequestManagementSystem.Client.ReqClient import ReqClient
import DIRAC.Core.Utilities.Time as Time
import time
import os
REMOVE_STATUS_DELAY = { 'Done':7,
'Killed':1,
'Failed':7 }
class JobCleaningAgent( AgentModule ):
"""
The specific agents must provide the following methods:
- initialize() for initial settings
- beginExecution()
- execute() - the main method called in the agent cycle
- endExecution()
- finalize() - the graceful exit of the method, this one is usually used
for the agent restart
"""
#############################################################################
def initialize( self ):
"""Sets defaults
"""
self.am_setOption( "PollingTime", 60 )
self.jobDB = JobDB()
self.taskQueueDB = TaskQueueDB()
self.jobLoggingDB = JobLoggingDB()
# self.sandboxDB = SandboxDB( 'SandboxDB' )
agentTSTypes = self.am_getOption('ProductionTypes', [])
if agentTSTypes:
self.prod_types = agentTSTypes
else:
self.prod_types = Operations().getValue( 'Transformations/DataProcessing', ['MCSimulation', 'Merge'] )
gLogger.info('Will exclude the following Production types from cleaning %s' % ( ', '.join(self.prod_types) ) )
self.maxJobsAtOnce = self.am_getOption('MaxJobsAtOnce', 100)
self.jobByJob = self.am_getOption('JobByJob', True)
self.throttlingPeriod = self.am_getOption('ThrottlingPeriod', 0.)
return S_OK()
def __getAllowedJobTypes( self ):
#Get valid jobTypes
result = self.jobDB.getDistinctJobAttributes( 'JobType' )
if not result[ 'OK' ]:
return result
cleanJobTypes = []
for jobType in result[ 'Value' ]:
if jobType not in self.prod_types:
cleanJobTypes.append( jobType )
self.log.notice( "JobTypes to clean %s" % cleanJobTypes )
return S_OK( cleanJobTypes )
#############################################################################
def execute( self ):
"""The PilotAgent execution method.
"""
#Delete jobs in "Deleted" state
result = self.removeJobsByStatus( { 'Status' : 'Deleted' } )
if not result[ 'OK' ]:
return result
#Get all the Job types that can be cleaned
result = self.__getAllowedJobTypes()
if not result[ 'OK' ]:
return result
baseCond = { 'JobType' : result[ 'Value' ] }
# Remove jobs with final status
for status in REMOVE_STATUS_DELAY:
delay = REMOVE_STATUS_DELAY[ status ]
condDict = dict( baseCond )
condDict[ 'Status' ] = status
delTime = str( Time.dateTime() - delay * Time.day )
result = self.removeJobsByStatus( condDict, delTime )
if not result['OK']:
gLogger.warn( 'Failed to remove jobs in status %s' % status )
return S_OK()
def removeJobsByStatus( self, condDict, delay = False ):
""" Remove deleted jobs
"""
if delay:
gLogger.verbose( "Removing jobs with %s and older than %s" % ( condDict, delay ) )
result = self.jobDB.selectJobs( condDict, older = delay, limit = self.maxJobsAtOnce )
else:
gLogger.verbose( "Removing jobs with %s " % condDict )
result = self.jobDB.selectJobs( condDict, limit = self.maxJobsAtOnce )
if not result['OK']:
return result
jobList = result['Value']
if len(jobList) > self.maxJobsAtOnce:
jobList = jobList[:self.maxJobsAtOnce]
if not jobList:
return S_OK()
self.log.notice( "Deleting %s jobs for %s" % ( len( jobList ), condDict ) )
count = 0
error_count = 0
result = SandboxStoreClient( useCertificates = True ).unassignJobs( jobList )
if not result[ 'OK' ]:
gLogger.warn( "Cannot unassign jobs to sandboxes", result[ 'Message' ] )
result = self.deleteJobOversizedSandbox( jobList )
if not result[ 'OK' ]:
gLogger.warn( "Cannot schedle removal of oversized sandboxes", result[ 'Message' ] )
return result
failedJobs = result['Value']['Failed']
for job in failedJobs:
jobList.pop( jobList.index( job ) )
if self.jobByJob:
for jobID in jobList:
resultJobDB = self.jobDB.removeJobFromDB( jobID )
resultTQ = self.taskQueueDB.deleteJob( jobID )
resultLogDB = self.jobLoggingDB.deleteJob( jobID )
errorFlag = False
if not resultJobDB['OK']:
gLogger.warn( 'Failed to remove job %d from JobDB' % jobID, result['Message'] )
errorFlag = True
if not resultTQ['OK']:
gLogger.warn( 'Failed to remove job %d from TaskQueueDB' % jobID, result['Message'] )
errorFlag = True
if not resultLogDB['OK']:
gLogger.warn( 'Failed to remove job %d from JobLoggingDB' % jobID, result['Message'] )
errorFlag = True
if errorFlag:
error_count += 1
else:
count += 1
if self.throttlingPeriod:
time.sleep(self.throttlingPeriod)
else:
result = self.jobDB.removeJobFromDB( jobList )
if not result['OK']:
gLogger.error('Failed to delete %d jobs from JobDB' % len(jobList) )
else:
gLogger.info('Deleted %d jobs from JobDB' % len(jobList) )
for jobID in jobList:
resultTQ = self.taskQueueDB.deleteJob( jobID )
if not resultTQ['OK']:
gLogger.warn( 'Failed to remove job %d from TaskQueueDB' % jobID, resultTQ['Message'] )
error_count += 1
else:
count += 1
result = self.jobLoggingDB.deleteJob( jobList )
if not result['OK']:
gLogger.error('Failed to delete %d jobs from JobLoggingDB' % len(jobList) )
else:
gLogger.info('Deleted %d jobs from JobLoggingDB' % len(jobList) )
if count > 0 or error_count > 0 :
gLogger.info( 'Deleted %d jobs from JobDB, %d errors' % ( count, error_count ) )
return S_OK()
def deleteJobOversizedSandbox( self, jobIDList ):
""" Delete the job oversized sandbox files from storage elements
"""
failed = {}
successful = {}
lfnDict = {}
for jobID in jobIDList:
result = self.jobDB.getJobParameter( jobID, 'OutputSandboxLFN' )
if result['OK']:
lfn = result['Value']
if lfn:
lfnDict[lfn] = jobID
else:
successful[jobID] = 'No oversized sandbox found'
else:
gLogger.warn( 'Error interrogting JobDB: %s' % result['Message'] )
if not lfnDict:
return S_OK( {'Successful':successful, 'Failed':failed} )
# Schedule removal of the LFNs now
for lfn, jobID in lfnDict.items():
result = self.jobDB.getJobAttributes( jobID, ['OwnerDN', 'OwnerGroup'] )
if not result['OK']:
failed[jobID] = lfn
continue
if not result['Value']:
failed[jobID] = lfn
continue
ownerDN = result['Value']['OwnerDN']
ownerGroup = result['Value']['OwnerGroup']
result = self.__setRemovalRequest( lfn, ownerDN, ownerGroup )
if not result['OK']:
failed[jobID] = lfn
else:
successful[jobID] = lfn
result = {'Successful':successful, 'Failed':failed}
return S_OK( result )
def __setRemovalRequest( self, lfn, ownerDN, ownerGroup ):
""" Set removal request with the given credentials
"""
oRequest = Request()
oRequest.OwnerDN = ownerDN
oRequest.OwnerGroup = ownerGroup
oRequest.RequestName = os.path.basename( lfn ).strip() + '_removal_request.xml'
oRequest.SourceComponent = 'JobCleaningAgent'
removeFile = Operation()
removeFile.Type = 'RemoveFile'
removedFile = File()
removedFile.LFN = lfn
removeFile.addFile( removedFile )
oRequest.addOperation( removeFile )
return ReqClient().putRequest( oRequest )
|
avedaee/DIRAC
|
WorkloadManagementSystem/Agent/JobCleaningAgent.py
|
Python
|
gpl-3.0
| 8,926
|
[
"DIRAC"
] |
80367924a8fdd52e4aa3703241d634a1cbb0961644a6ef1f3abaa210addfa2bd
|
########################################################################
# File : AgentModule.py
# Author : Adria Casajus
########################################################################
"""
Base class for all agent modules
"""
import os
import threading
import time
import signal
import importlib
import inspect
import DIRAC
from DIRAC import S_OK, S_ERROR, gConfig, gLogger, rootPath
from DIRAC.Core.Utilities.File import mkDir
from DIRAC.Core.Utilities import Time, MemStat, Network
from DIRAC.Core.Utilities.Shifter import setupShifterProxyInEnv
from DIRAC.Core.Utilities.ReturnValues import isReturnStructure
from DIRAC.FrameworkSystem.Client.MonitoringClient import gMonitor
from DIRAC.ConfigurationSystem.Client import PathFinder
from DIRAC.FrameworkSystem.Client.MonitoringClient import MonitoringClient
from DIRAC.Core.Utilities.ThreadScheduler import gThreadScheduler
from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
class AgentModule:
"""Base class for all agent modules
This class is used by the AgentReactor Class to steer the execution of
DIRAC Agents.
For this purpose the following methods are used:
- am_initialize() just after instantiated
- am_getPollingTime() to set the execution frequency
- am_getMaxCycles() to determine the number of cycles
- am_go() for the actual execution of one cycle
Before each iteration, the following methods are used to determine
if the new cycle is to be started.
- am_getModuleParam( 'alive' )
- am_checkStopAgentFile()
- am_removeStopAgentFile()
To start new execution cycle the following methods are used
- am_getCyclesDone()
- am_setOption( 'MaxCycles', maxCycles )
At the same time it provides all Agents with common interface.
All Agent class must inherit from this base class and must implement
at least the following method:
- execute() main method called in the agent cycle
Additionally they may provide:
- initialize() for initial settings
- finalize() the graceful exit
- beginExecution() before each execution cycle
- endExecution() at the end of each execution cycle
The agent can be stopped either by a signal or by creating a 'stop_agent' file
in the controlDirectory defined in the agent configuration
"""
def __init__(self, agentName, loadName, baseAgentName=False, properties={}):
"""
Common __init__ method for all Agents.
All Agent modules must define: __doc__
They are used to populate __codeProperties
The following Options are used from the Configuration:
- /LocalSite/InstancePath
- /DIRAC/Setup
- Status
- Enabled
- PollingTime default = 120
- MaxCycles default = 500
- WatchdogTime default = 0 (disabled)
- ControlDirectory control/SystemName/AgentName
- WorkDirectory work/SystemName/AgentName
- shifterProxy ''
- shifterProxyLocation WorkDirectory/SystemName/AgentName/.shifterCred
It defines the following default Options that can be set via Configuration (above):
- MonitoringEnabled True
- Enabled True if Status == Active
- PollingTime 120
- MaxCycles 500
- ControlDirectory control/SystemName/AgentName
- WorkDirectory work/SystemName/AgentName
- shifterProxy False
- shifterProxyLocation work/SystemName/AgentName/.shifterCred
different defaults can be set in the initialize() method of the Agent using am_setOption()
In order to get a shifter proxy in the environment during the execute()
the configuration Option 'shifterProxy' must be set, a default may be given
in the initialize() method.
"""
if baseAgentName and agentName == baseAgentName:
self.log = gLogger
standaloneModule = True
else:
self.log = gLogger.getSubLogger(agentName, child=False)
standaloneModule = False
self.__basePath = gConfig.getValue("/LocalSite/InstancePath", rootPath)
self.__agentModule = None
self.__codeProperties = {}
self.__getCodeInfo()
self.__moduleProperties = {
"fullName": agentName,
"loadName": loadName,
"section": PathFinder.getAgentSection(agentName),
"loadSection": PathFinder.getAgentSection(loadName),
"standalone": standaloneModule,
"cyclesDone": 0,
"totalElapsedTime": 0,
"setup": gConfig.getValue("/DIRAC/Setup", "Unknown"),
"alive": True,
}
self.__moduleProperties["system"], self.__moduleProperties["agentName"] = agentName.split("/")
self.__configDefaults = {}
self.__configDefaults["MonitoringEnabled"] = True
self.__configDefaults["Enabled"] = self.am_getOption("Status", "Active").lower() in ("active")
self.__configDefaults["PollingTime"] = self.am_getOption("PollingTime", 120)
self.__configDefaults["MaxCycles"] = self.am_getOption("MaxCycles", 500)
self.__configDefaults["WatchdogTime"] = self.am_getOption("WatchdogTime", 0)
self.__configDefaults["ControlDirectory"] = os.path.join(self.__basePath, "control", *agentName.split("/"))
self.__configDefaults["WorkDirectory"] = os.path.join(self.__basePath, "work", *agentName.split("/"))
self.__configDefaults["shifterProxy"] = ""
self.__configDefaults["shifterProxyLocation"] = os.path.join(
self.__configDefaults["WorkDirectory"], ".shifterCred"
)
if isinstance(properties, dict):
for key in properties:
self.__moduleProperties[key] = properties[key]
self.__moduleProperties["executors"] = [(self.execute, ())]
self.__moduleProperties["shifterProxy"] = False
self.__monitorLastStatsUpdate = -1
self.monitor = None
self.__initializeMonitor()
self.__initialized = False
def __getCodeInfo(self):
try:
self.__codeProperties["version"] = importlib.metadata.version(
inspect.getmodule(self).__package__.split(".")[0]
)
except Exception:
self.log.exception(f"Failed to find version for {self!r}")
self.__codeProperties["version"] = "unset"
try:
self.__agentModule = __import__(self.__class__.__module__, globals(), locals(), "__doc__")
except Exception as excp:
self.log.exception("Cannot load agent module", lException=excp)
try:
self.__codeProperties["description"] = getattr(self.__agentModule, "__doc__")
except Exception:
self.log.error("Missing property __doc__")
self.__codeProperties["description"] = "unset"
self.__codeProperties["DIRACVersion"] = DIRAC.version
self.__codeProperties["platform"] = DIRAC.getPlatform()
def am_initialize(self, *initArgs):
"""Common initialization for all the agents.
This is executed every time an agent (re)starts.
This is called by the AgentReactor, should not be overridden.
"""
agentName = self.am_getModuleParam("fullName")
result = self.initialize(*initArgs)
if not isReturnStructure(result):
return S_ERROR("initialize must return S_OK/S_ERROR")
if not result["OK"]:
return S_ERROR("Error while initializing %s: %s" % (agentName, result["Message"]))
mkDir(self.am_getControlDirectory())
workDirectory = self.am_getWorkDirectory()
mkDir(workDirectory)
# Set the work directory in an environment variable available to subprocesses if needed
os.environ["AGENT_WORKDIRECTORY"] = workDirectory
self.__moduleProperties["shifterProxy"] = self.am_getOption("shifterProxy")
if self.am_monitoringEnabled() and not self.activityMonitoring:
self.monitor.enable()
if len(self.__moduleProperties["executors"]) < 1:
return S_ERROR("At least one executor method has to be defined")
if not self.am_Enabled():
return S_ERROR("Agent is disabled via the configuration")
self.log.notice("=" * 40)
self.log.notice("Loaded agent module %s" % self.__moduleProperties["fullName"])
self.log.notice(" Site: %s" % DIRAC.siteName())
self.log.notice(" Setup: %s" % gConfig.getValue("/DIRAC/Setup"))
self.log.notice(" Agent version: %s" % self.__codeProperties["version"])
self.log.notice(" DIRAC version: %s" % DIRAC.version)
self.log.notice(" DIRAC platform: %s" % DIRAC.getPlatform())
pollingTime = int(self.am_getOption("PollingTime"))
if pollingTime > 3600:
self.log.notice(" Polling time: %s hours" % (pollingTime / 3600.0))
else:
self.log.notice(" Polling time: %s seconds" % self.am_getOption("PollingTime"))
self.log.notice(" Control dir: %s" % self.am_getControlDirectory())
self.log.notice(" Work dir: %s" % self.am_getWorkDirectory())
if self.am_getOption("MaxCycles") > 0:
self.log.notice(" Cycles: %s" % self.am_getMaxCycles())
else:
self.log.notice(" Cycles: unlimited")
if self.am_getWatchdogTime() > 0:
self.log.notice(" Watchdog interval: %s" % self.am_getWatchdogTime())
else:
self.log.notice(" Watchdog interval: disabled ")
self.log.notice("=" * 40)
self.__initialized = True
return S_OK()
def am_getControlDirectory(self):
return os.path.join(self.__basePath, str(self.am_getOption("ControlDirectory")))
def am_getStopAgentFile(self):
return os.path.join(self.am_getControlDirectory(), "stop_agent")
def am_checkStopAgentFile(self):
return os.path.isfile(self.am_getStopAgentFile())
def am_createStopAgentFile(self):
try:
with open(self.am_getStopAgentFile(), "w") as fd:
fd.write("Dirac site agent Stopped at %s" % Time.toString())
except Exception:
pass
def am_removeStopAgentFile(self):
try:
os.unlink(self.am_getStopAgentFile())
except Exception:
pass
def am_getBasePath(self):
return self.__basePath
def am_getWorkDirectory(self):
return os.path.join(self.__basePath, str(self.am_getOption("WorkDirectory")))
def am_getShifterProxyLocation(self):
return os.path.join(self.__basePath, str(self.am_getOption("shifterProxyLocation")))
def am_getOption(self, optionName, defaultValue=None):
"""Gets an option from the agent's configuration section.
The section will be a subsection of the /Systems section in the CS.
"""
if defaultValue is None:
if optionName in self.__configDefaults:
defaultValue = self.__configDefaults[optionName]
if optionName and optionName[0] == "/":
return gConfig.getValue(optionName, defaultValue)
for section in (self.__moduleProperties["section"], self.__moduleProperties["loadSection"]):
result = gConfig.getOption("%s/%s" % (section, optionName), defaultValue)
if result["OK"]:
return result["Value"]
return defaultValue
def am_setOption(self, optionName, value):
self.__configDefaults[optionName] = value
def am_getModuleParam(self, optionName):
return self.__moduleProperties[optionName]
def am_setModuleParam(self, optionName, value):
self.__moduleProperties[optionName] = value
def am_getPollingTime(self):
return self.am_getOption("PollingTime")
def am_getMaxCycles(self):
return self.am_getOption("MaxCycles")
def am_getWatchdogTime(self):
return int(self.am_getOption("WatchdogTime"))
def am_getCyclesDone(self):
return self.am_getModuleParam("cyclesDone")
def am_Enabled(self):
return self.am_getOption("Enabled")
def am_disableMonitoring(self):
self.am_setOption("MonitoringEnabled", False)
def am_monitoringEnabled(self):
return self.am_getOption("MonitoringEnabled")
def am_stopExecution(self):
self.am_setModuleParam("alive", False)
def __initializeMonitor(self):
"""
Initialize the system monitoring.
"""
# This flag is used to activate ES based monitoring
# if the "EnableActivityMonitoring" flag in "yes" or "true" in the cfg file.
self.activityMonitoring = (
Operations().getValue("EnableActivityMonitoring", False) and self.am_monitoringEnabled()
)
if self.activityMonitoring:
# The import needs to be here because of the CS must be initialized before importing
# this class (see https://github.com/DIRACGrid/DIRAC/issues/4793)
from DIRAC.MonitoringSystem.Client.MonitoringReporter import MonitoringReporter
self.activityMonitoringReporter = MonitoringReporter(monitoringType="ComponentMonitoring")
# With the help of this periodic task we commit the data to ES at an interval of 100 seconds.
gThreadScheduler.addPeriodicTask(100, self.__activityMonitoringReporting)
else:
if self.__moduleProperties["standalone"]:
self.monitor = gMonitor
else:
self.monitor = MonitoringClient()
self.monitor.setComponentType(self.monitor.COMPONENT_AGENT)
self.monitor.setComponentName(self.__moduleProperties["fullName"])
self.monitor.initialize()
self.monitor.registerActivity("CPU", "CPU Usage", "Framework", "CPU,%", self.monitor.OP_MEAN, 600)
self.monitor.registerActivity("MEM", "Memory Usage", "Framework", "Memory,MB", self.monitor.OP_MEAN, 600)
# Component monitor
for field in ("version", "DIRACVersion", "description", "platform"):
self.monitor.setComponentExtraParam(field, self.__codeProperties[field])
self.monitor.setComponentExtraParam("startTime", Time.dateTime())
self.monitor.setComponentExtraParam("cycles", 0)
self.monitor.disable()
self.__monitorLastStatsUpdate = time.time()
def am_secureCall(self, functor, args=(), name=False):
if not name:
name = str(functor)
try:
result = functor(*args)
if not isReturnStructure(result):
raise Exception(
"%s method for %s module has to return S_OK/S_ERROR" % (name, self.__moduleProperties["fullName"])
)
return result
except Exception as e:
self.log.exception("Agent exception while calling method %s" % name, lException=e)
return S_ERROR("Exception while calling %s method: %s" % (name, str(e)))
def _setShifterProxy(self):
if self.__moduleProperties["shifterProxy"]:
result = setupShifterProxyInEnv(self.__moduleProperties["shifterProxy"], self.am_getShifterProxyLocation())
if not result["OK"]:
self.log.error("Failed to set shifter proxy", result["Message"])
return result
return S_OK()
def am_go(self):
# Set the shifter proxy if required
result = self._setShifterProxy()
if not result["OK"]:
return result
self.log.notice("-" * 40)
self.log.notice("Starting cycle for module %s" % self.__moduleProperties["fullName"])
mD = self.am_getMaxCycles()
if mD > 0:
cD = self.__moduleProperties["cyclesDone"]
self.log.notice("Remaining %s of %s cycles" % (mD - cD, mD))
self.log.notice("-" * 40)
# use SIGALARM as a watchdog interrupt if enabled
watchdogInt = self.am_getWatchdogTime()
if watchdogInt > 0:
signal.signal(signal.SIGALRM, signal.SIG_DFL)
signal.alarm(watchdogInt)
elapsedTime = time.time()
cpuStats = self._startReportToMonitoring()
cycleResult = self.__executeModuleCycle()
if cpuStats:
self._endReportToMonitoring(*cpuStats)
# Increment counters
self.__moduleProperties["cyclesDone"] += 1
# Show status
elapsedTime = time.time() - elapsedTime
self.__moduleProperties["totalElapsedTime"] += elapsedTime
self.log.notice("-" * 40)
self.log.notice("Agent module %s run summary" % self.__moduleProperties["fullName"])
self.log.notice(" Executed %s times previously" % self.__moduleProperties["cyclesDone"])
self.log.notice(" Cycle took %.2f seconds" % elapsedTime)
averageElapsedTime = self.__moduleProperties["totalElapsedTime"] / self.__moduleProperties["cyclesDone"]
self.log.notice(" Average execution time: %.2f seconds" % (averageElapsedTime))
elapsedPollingRate = averageElapsedTime * 100 / self.am_getOption("PollingTime")
self.log.notice(" Polling time: %s seconds" % self.am_getOption("PollingTime"))
self.log.notice(" Average execution/polling time: %.2f%%" % elapsedPollingRate)
if cycleResult["OK"]:
self.log.notice(" Cycle was successful")
if self.activityMonitoring:
# Here we record the data about the cycle duration along with some basic details about the
# component and right now it isn't committed to the ES backend.
self.activityMonitoringReporter.addRecord(
{
"timestamp": int(Time.toEpoch()),
"host": Network.getFQDN(),
"componentType": "agent",
"component": "_".join(self.__moduleProperties["fullName"].split("/")),
"cycleDuration": elapsedTime,
"cycles": 1,
}
)
else:
self.log.warn(" Cycle had an error:", cycleResult["Message"])
self.log.notice("-" * 40)
# Update number of cycles
if not self.activityMonitoring:
self.monitor.setComponentExtraParam("cycles", self.__moduleProperties["cyclesDone"])
# cycle finished successfully, cancel watchdog
if watchdogInt > 0:
signal.alarm(0)
return cycleResult
def _startReportToMonitoring(self):
try:
if not self.activityMonitoring:
now = time.time()
stats = os.times()
cpuTime = stats[0] + stats[2]
if now - self.__monitorLastStatsUpdate < 10:
return (now, cpuTime)
# Send CPU consumption mark
self.__monitorLastStatsUpdate = now
# Send Memory consumption mark
membytes = MemStat.VmB("VmRSS:")
if membytes:
mem = membytes / (1024.0 * 1024.0)
gMonitor.addMark("MEM", mem)
return (now, cpuTime)
else:
return False
except Exception:
return False
def _endReportToMonitoring(self, initialWallTime, initialCPUTime):
wallTime = time.time() - initialWallTime
stats = os.times()
cpuTime = stats[0] + stats[2] - initialCPUTime
percentage = 0
if wallTime:
percentage = cpuTime / wallTime * 100.0
if percentage > 0:
gMonitor.addMark("CPU", percentage)
def __executeModuleCycle(self):
# Execute the beginExecution function
result = self.am_secureCall(self.beginExecution, name="beginExecution")
if not result["OK"]:
return result
# Launch executor functions
executors = self.__moduleProperties["executors"]
if len(executors) == 1:
result = self.am_secureCall(executors[0][0], executors[0][1])
if not result["OK"]:
return result
else:
exeThreads = [threading.Thread(target=executor[0], args=executor[1]) for executor in executors]
for thread in exeThreads:
thread.setDaemon(1)
thread.start()
for thread in exeThreads:
thread.join()
# Execute the endExecution function
return self.am_secureCall(self.endExecution, name="endExecution")
def initialize(self, *args, **kwargs):
"""Agents should override this method for specific initialization.
Executed at every agent (re)start.
"""
return S_OK()
def beginExecution(self):
return S_OK()
def endExecution(self):
return S_OK()
def finalize(self):
return S_OK()
def execute(self):
return S_ERROR("Execute method has to be overwritten by agent module")
def __activityMonitoringReporting(self):
"""This method is called by the ThreadScheduler as a periodic task in order to commit the collected data which
is done by the MonitoringReporter and is send to the 'ComponentMonitoring' type.
:return: True / False
"""
result = self.activityMonitoringReporter.commit()
return result["OK"]
|
DIRACGrid/DIRAC
|
src/DIRAC/Core/Base/AgentModule.py
|
Python
|
gpl-3.0
| 21,572
|
[
"DIRAC"
] |
85a580a2ea1c08fbd4616e19f925b2a196a5aa1120cfef09f88d2a7430d2e0c5
|
#!/usr/bin/env python
"""
This script automates the steps needed to debug a MPI executable with the GNU debugger
Note that GNU gdb is not a parallel debugger hence this crude approach may not work properly.
"""
from __future__ import print_function, division
import sys
import os
import argparse
import tempfile
from subprocess import Popen, PIPE
def str_examples():
examples = (
"\n"
"Usage example:\n\n"
"pmdbg.py -n 2 abinit files_file ==> (Try) to run Abinit in parallel under the control of gdb\n"
" Use 2 MPI processes, read input from files_file "
)
return examples
def show_examples_and_exit(err_msg=None, error_code=1):
"""Display the usage of the script."""
sys.stderr.write(str_examples())
if err_msg:
sys.stderr.write("Fatal Error\n" + err_msg + "\n")
sys.exit(error_code)
def main():
"""mpirun -n# xterm gdb binary -command=file"""
parser = argparse.ArgumentParser(epilog=str_examples(),formatter_class=argparse.RawDescriptionHelpFormatter)
#parser.add_argument('-v', '--verbose', default=0, action='count', # -vv --> verbose=2
# help='verbose, can be supplied multiple times to increase verbosity')
parser.add_argument('-n', default=1, type=int, help='Number of MPI processes')
parser.add_argument("args", nargs="+", help='executable stdin_file')
# Parse the command line.
try:
options = parser.parse_args()
except Exception:
show_examples_and_exit(error_code=1)
binary, stdin_fname= options.args[0], options.args[1]
_, dbg_fname = tempfile.mkstemp()
with open(dbg_fname, "w") as fh:
fh.write("run < %s" % stdin_fname)
# mpirun -n# xterm gdb binary -command=file.
cmd = "mpirun -n %i xterm -e gdb %s -command=%s" % (options.n, binary, dbg_fname)
print(cmd)
p = Popen(cmd, shell=True) #, cwd=cwd, env=env)
retcode = p.wait()
try:
os.remove(dbg_fname)
except IOError:
pass
return retcode
if __name__ == "__main__":
sys.exit(main())
|
jmbeuken/abinit
|
developers/various/paragdb.py
|
Python
|
gpl-3.0
| 2,114
|
[
"ABINIT"
] |
c1ee962a0754e436569cc3e37a59b4bc84a6d8c272488a4077739a531be6b25a
|
# -*- coding: utf-8 -*-
from fenics import *
from matplotlib import pyplot
import numpy as np
parameters["plotting_backend"] = "matplotlib"
prm = parameters['krylov_solver']
prm['absolute_tolerance'] = 1e-7
prm['relative_tolerance'] = 1e-4
prm['maximum_iterations'] = 1000
#list_linear_solver_methods()
# Units
cm = 1e-2
um = 1e-4 * cm
dyn = 1
pa = 10 * dyn/cm**2
# Scaled variables
r0 = 20*um
R = r0/r0
Le = 10*r0
W = 0.2*r0
Disp = 4*um/r0
mu0 = 1.13e5*pa
Mu = mu0/mu0
Lam = 5.54e6*pa/mu0
# Create mesh and define function space
nr = 10
nz = 1000
mesh = RectangleMesh(Point(0, 0), Point(W, Le), nr, nz)
V = VectorFunctionSpace(mesh, 'P', 1)
# Define boundaries
def astr_boundary(x, on_boundary):
return near(x[0], W) and near(x[1], Le/2)
def fixed_boundary(x, on_boundary):
return near(x[1], 0) or near(x[1], Le)
#astr_boundary = 'near(x[0], W) && near(x[1], Le/2)'
#fixed_boundary = 'near(x[1], 0) || near(x[1], Le)'
bc1 = DirichletBC(V, Constant((Disp, 0)), astr_boundary, method='pointwise')
bc2 = DirichletBC(V, Constant((0, 0)), fixed_boundary)
bcs = [bc1, bc2]
# Stress and strain
def epsilon(u):
return 0.5*(nabla_grad(u) + nabla_grad(u).T)
def sigma(u):
return 0.5*Lam*nabla_div(u)*Identity(d) + 2*Mu*epsilon(u)
# Define variational problem
u = TrialFunction(V)
d = u.geometric_dimension()
v = TestFunction(V)
f = Constant((0, 0))
T = Constant((0, 0))
a = inner(sigma(u), epsilon(v))*dx
L = dot(f, v)*dx + dot(T, v)*ds
# Compute solution
u = Function(V)
solve(a == L, u, bcs)
# Plot solution
#p1 = plot(u, title='Displacement', mode='displacement')
#pyplot.colorbar(p1)
#pyplot.show()
# Plot stress
W = TensorFunctionSpace(mesh, "Lagrange", 2)
sig = project(sigma(u), W)
[s11, s12, s21, s22] = sig.split(True)
#s_gd = s11.dx(1)
#p_bm = -s_gd*mu0*um/pa
#p2 = plot(s11, title='Stress (Pa/um)')
#pyplot.colorbar(p2)
#pyplot.show()
print(np.max(s11.vector().array())*mu0/pa)
print(np.max(u.vector().array())*r0/um)
#
# Save solution to file in VTK format
#File('data/sigr_7.pvd') << s11
#File('data/sigz.pvd') << s22
# Hold plot
interactive()
|
akdiem/nvu
|
fenics_artery.py
|
Python
|
bsd-3-clause
| 2,083
|
[
"VTK"
] |
d1387d70ef5650bd1ee30d786d79ffd7806a4ba573550a4c587dc91d862189ca
|
"""Joint variant calling with multiple samples: aka squaring off, or backfilling.
Handles the N+1 problem of variant calling by combining and recalling samples
previously calling individually (or in smaller batches). Recalls at all positions found
variable in any of the input samples within each batch. Takes a general approach supporting
GATK's incremental joint discovery (http://www.broadinstitute.org/gatk/guide/article?id=3893)
and FreeBayes's N+1 approach (https://groups.google.com/d/msg/freebayes/-GK4zI6NsYY/Wpcp8nt_PVMJ)
as implemented in bcbio.variation.recall (https://github.com/chapmanb/bcbio.variation.recall).
"""
import collections
import math
import os
import pysam
import toolz as tz
from bcbio import broad, utils
from bcbio.bam import ref
from bcbio.distributed.split import grouped_parallel_split_combine
from bcbio.pipeline import config_utils, region
from bcbio.pipeline import datadict as dd
from bcbio.provenance import do
from bcbio.variation import bamprep, gatkjoint, genotype, multi
SUPPORTED = {"general": ["freebayes", "platypus", "samtools"],
"gatk": ["gatk-haplotype"],
"gvcf": ["strelka2"],
"sentieon": ["haplotyper"]}
# ## CWL joint calling targets
def batch_for_jointvc(items):
batch_groups = collections.defaultdict(list)
for data in [utils.to_single_data(x) for x in items]:
vc = dd.get_variantcaller(data)
if genotype.is_joint(data):
batches = dd.get_batches(data) or dd.get_sample_name(data)
if not isinstance(batches, (list, tuple)):
batches = [batches]
else:
batches = [dd.get_sample_name(data)]
for b in batches:
data = utils.deepish_copy(data)
data["vrn_file_gvcf"] = data["vrn_file"]
batch_groups[(b, vc)].append(data)
return list(batch_groups.values())
def run_jointvc(items):
items = [utils.to_single_data(x) for x in items]
data = items[0]
if not dd.get_jointcaller(data):
data["config"]["algorithm"]["jointcaller"] = "%s-joint" % dd.get_variantcaller(data)
# GenomicsDBImport uses 1-based coordinates. That's unexpected, convert over to these.
chrom, coords = data["region"].split(":")
start, end = coords.split("-")
ready_region = "%s:%s-%s" % (chrom, int(start) + 1, end)
str_region = ready_region.replace(":", "_")
batches = dd.get_batches(data) or dd.get_sample_name(data)
if not isinstance(batches, (list, tuple)):
batches = [batches]
out_file = os.path.join(utils.safe_makedir(os.path.join(dd.get_work_dir(data), "joint",
dd.get_variantcaller(data), str_region)),
"%s-%s-%s.vcf.gz" % (batches[0], dd.get_variantcaller(data), str_region))
joint_out = square_batch_region(data, ready_region, [], [d["vrn_file"] for d in items], out_file)[0]
data["vrn_file_region"] = joint_out["vrn_file"]
return data
def concat_batch_variantcalls_jointvc(items):
concat_out = genotype.concat_batch_variantcalls(items, region_block=False, skip_jointcheck=True)
return {"vrn_file_joint": concat_out["vrn_file"]}
def finalize_jointvc(items):
return [utils.to_single_data(x) for x in items]
def _get_callable_regions(data):
"""Retrieve regions to parallelize by from callable regions or chromosomes.
"""
import pybedtools
callable_files = data.get("callable_regions")
if callable_files:
assert len(callable_files) == 1
regions = [(r.chrom, int(r.start), int(r.stop)) for r in pybedtools.BedTool(callable_files[0])]
else:
work_bam = list(tz.take(1, filter(lambda x: x and x.endswith(".bam"), data["work_bams"])))
if work_bam:
with pysam.Samfile(work_bam[0], "rb") as pysam_bam:
regions = [(chrom, 0, length) for (chrom, length) in zip(pysam_bam.references,
pysam_bam.lengths)]
else:
regions = [(r.name, 0, r.size) for r in
ref.file_contigs(dd.get_ref_file(data), data["config"])]
return regions
def _split_by_callable_region(data):
"""Split by callable or variant regions.
We expect joint calling to be deep in numbers of samples per region, so prefer
splitting aggressively by regions.
"""
batch = tz.get_in(("metadata", "batch"), data)
jointcaller = tz.get_in(("config", "algorithm", "jointcaller"), data)
name = batch if batch else tz.get_in(("rgnames", "sample"), data)
out_dir = utils.safe_makedir(os.path.join(data["dirs"]["work"], "joint", jointcaller, name))
utils.safe_makedir(os.path.join(out_dir, "inprep"))
parts = []
for feat in _get_callable_regions(data):
region_dir = utils.safe_makedir(os.path.join(out_dir, feat[0]))
region_prep_dir = os.path.join(region_dir, "inprep")
if not os.path.exists(region_prep_dir):
os.symlink(os.path.join(os.pardir, "inprep"), region_prep_dir)
region_outfile = os.path.join(region_dir, "%s-%s.vcf.gz" % (batch, region.to_safestr(feat)))
parts.append((feat, data["work_bams"], data["vrn_files"], region_outfile))
out_file = os.path.join(out_dir, "%s-joint.vcf.gz" % name)
return out_file, parts
def _is_jointcaller_compatible(data):
"""Match variant caller inputs to compatible joint callers.
"""
jointcaller = tz.get_in(("config", "algorithm", "jointcaller"), data)
variantcaller = tz.get_in(("config", "algorithm", "variantcaller"), data)
if isinstance(variantcaller, (list, tuple)) and len(variantcaller) == 1:
variantcaller = variantcaller[0]
return jointcaller == "%s-joint" % variantcaller or not variantcaller
def square_off(samples, run_parallel):
"""Perform joint calling at all variants within a batch.
"""
to_process = []
extras = []
for data in [utils.to_single_data(x) for x in samples]:
added = False
if tz.get_in(("metadata", "batch"), data):
for add in genotype.handle_multiple_callers(data, "jointcaller", require_bam=False):
if _is_jointcaller_compatible(add):
added = True
to_process.append([add])
if not added:
extras.append([data])
processed = grouped_parallel_split_combine(to_process, _split_by_callable_region,
multi.group_batches_joint, run_parallel,
"square_batch_region", "concat_variant_files",
"vrn_file", ["region", "sam_ref", "config"])
return _combine_to_jointcaller(processed) + extras
def _combine_to_jointcaller(processed):
"""Add joint calling information to variants, while collapsing independent regions.
"""
by_vrn_file = collections.OrderedDict()
for data in (x[0] for x in processed):
key = (tz.get_in(("config", "algorithm", "jointcaller"), data), data["vrn_file"])
if key not in by_vrn_file:
by_vrn_file[key] = []
by_vrn_file[key].append(data)
out = []
for grouped_data in by_vrn_file.values():
cur = grouped_data[0]
out.append([cur])
return out
def want_gvcf(items):
jointcaller = tz.get_in(("config", "algorithm", "jointcaller"), items[0])
want_gvcf = any("gvcf" in dd.get_tools_on(d) for d in items)
return jointcaller or want_gvcf
def get_callers():
return ["%s-joint" % x for x in SUPPORTED["general"]] + \
["%s-merge" % x for x in SUPPORTED["general"]] + \
["%s-joint" % x for x in SUPPORTED["gatk"]] + \
["%s-joint" % x for x in SUPPORTED["gvcf"]] + \
["%s-joint" % x for x in SUPPORTED["sentieon"]]
def square_batch_region(data, region, bam_files, vrn_files, out_file):
"""Perform squaring of a batch in a supplied region, with input BAMs
"""
from bcbio.variation import sentieon, strelka2
if not utils.file_exists(out_file):
jointcaller = tz.get_in(("config", "algorithm", "jointcaller"), data)
if jointcaller in ["%s-joint" % x for x in SUPPORTED["general"]]:
_square_batch_bcbio_variation(data, region, bam_files, vrn_files, out_file, "square")
elif jointcaller in ["%s-merge" % x for x in SUPPORTED["general"]]:
_square_batch_bcbio_variation(data, region, bam_files, vrn_files, out_file, "merge")
elif jointcaller in ["%s-joint" % x for x in SUPPORTED["gatk"]]:
gatkjoint.run_region(data, region, vrn_files, out_file)
elif jointcaller in ["%s-joint" % x for x in SUPPORTED["gvcf"]]:
strelka2.run_gvcfgenotyper(data, region, vrn_files, out_file)
elif jointcaller in ["%s-joint" % x for x in SUPPORTED["sentieon"]]:
sentieon.run_gvcftyper(vrn_files, out_file, region, data)
else:
raise ValueError("Unexpected joint calling approach: %s." % jointcaller)
if region:
data["region"] = region
data = _fix_orig_vcf_refs(data)
data["vrn_file"] = out_file
return [data]
def _fix_orig_vcf_refs(data):
"""Supply references to initial variantcalls if run in addition to batching.
"""
variantcaller = tz.get_in(("config", "algorithm", "variantcaller"), data)
if variantcaller:
data["vrn_file_orig"] = data["vrn_file"]
for i, sub in enumerate(data.get("group_orig", [])):
sub_vrn = sub.pop("vrn_file", None)
if sub_vrn:
sub["vrn_file_orig"] = sub_vrn
data["group_orig"][i] = sub
return data
def _square_batch_bcbio_variation(data, region, bam_files, vrn_files, out_file,
todo="square"):
"""Run squaring or merging analysis using bcbio.variation.recall.
"""
ref_file = tz.get_in(("reference", "fasta", "base"), data)
cores = tz.get_in(("config", "algorithm", "num_cores"), data, 1)
resources = config_utils.get_resources("bcbio-variation-recall", data["config"])
# adjust memory by cores but leave room for run program memory
memcores = int(math.ceil(float(cores) / 5.0))
jvm_opts = config_utils.adjust_opts(resources.get("jvm_opts", ["-Xms250m", "-Xmx2g"]),
{"algorithm": {"memory_adjust": {"direction": "increase",
"magnitude": memcores}}})
# Write unique VCFs and BAMs to input file
input_file = "%s-inputs.txt" % os.path.splitext(out_file)[0]
with open(input_file, "w") as out_handle:
out_handle.write("\n".join(sorted(list(set(vrn_files)))) + "\n")
if todo == "square":
out_handle.write("\n".join(sorted(list(set(bam_files)))) + "\n")
variantcaller = tz.get_in(("config", "algorithm", "jointcaller"), data).replace("-joint", "")
cmd = ["bcbio-variation-recall", todo] + jvm_opts + broad.get_default_jvm_opts() + \
["-c", cores, "-r", bamprep.region_to_gatk(region)]
if todo == "square":
cmd += ["--caller", variantcaller]
cmd += [out_file, ref_file, input_file]
bcbio_env = utils.get_bcbio_env()
cmd = " ".join(str(x) for x in cmd)
do.run(cmd, "%s in region: %s" % (cmd, bamprep.region_to_gatk(region)), env=bcbio_env)
return out_file
|
a113n/bcbio-nextgen
|
bcbio/variation/joint.py
|
Python
|
mit
| 11,384
|
[
"pysam"
] |
d597fbf099020599756d1bce970a85751e420b7ccfdf473bd2eec1a93caea1eb
|
# -*- coding: utf-8 -*-
"""
Unit tests for instructor.api methods.
"""
# pylint: disable=E1111
import unittest
import json
import requests
import datetime
import ddt
import random
import io
from urllib import quote
from django.test import TestCase
from nose.tools import raises
from mock import Mock, patch
from django.conf import settings
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.http import HttpRequest, HttpResponse
from django_comment_common.models import FORUM_ROLE_COMMUNITY_TA
from django_comment_common.utils import seed_permissions_roles
from django.core import mail
from django.utils.timezone import utc
from django.test import RequestFactory
from django.contrib.auth.models import User
from courseware.tests.modulestore_config import TEST_DATA_MONGO_MODULESTORE
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from courseware.tests.helpers import LoginEnrollmentTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from student.tests.factories import UserFactory
from courseware.tests.factories import StaffFactory, InstructorFactory, BetaTesterFactory
from student.roles import CourseBetaTesterRole
from microsite_configuration import microsite
from instructor.tests.utils import FakeContentTask, FakeEmail, FakeEmailInfo
from student.models import CourseEnrollment, CourseEnrollmentAllowed
from courseware.models import StudentModule
# modules which are mocked in test cases.
import instructor_task.api
import instructor.views.api
from instructor.views.api import generate_unique_password
from instructor.views.api import _split_input_list, common_exceptions_400
from instructor_task.api_helper import AlreadyRunningError
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from shoppingcart.models import (
RegistrationCodeRedemption, Order,
PaidCourseRegistration, Coupon, Invoice, CourseRegistrationCode
)
from course_modes.models import CourseMode
from django.core.files.uploadedfile import SimpleUploadedFile
from student.models import NonExistentCourseError
from .test_tools import msk_from_problem_urlname
from ..views.tools import get_extended_due
EXPECTED_CSV_HEADER = '"code","course_id","company_name","created_by","redeemed_by","invoice_id","purchaser","customer_reference_number","internal_reference"'
EXPECTED_COUPON_CSV_HEADER = '"course_id","percentage_discount","code_redeemed_count","description"'
# ddt data for test cases involving reports
REPORTS_DATA = (
{
'report_type': 'grade',
'instructor_api_endpoint': 'calculate_grades_csv',
'task_api_endpoint': 'instructor_task.api.submit_calculate_grades_csv',
'extra_instructor_api_kwargs': {}
},
{
'report_type': 'enrolled student profile',
'instructor_api_endpoint': 'get_students_features',
'task_api_endpoint': 'instructor_task.api.submit_calculate_students_features_csv',
'extra_instructor_api_kwargs': {'csv': '/csv'}
}
)
@common_exceptions_400
def view_success(request): # pylint: disable=W0613
"A dummy view for testing that returns a simple HTTP response"
return HttpResponse('success')
@common_exceptions_400
def view_user_doesnotexist(request): # pylint: disable=W0613
"A dummy view that raises a User.DoesNotExist exception"
raise User.DoesNotExist()
@common_exceptions_400
def view_alreadyrunningerror(request): # pylint: disable=W0613
"A dummy view that raises an AlreadyRunningError exception"
raise AlreadyRunningError()
class TestCommonExceptions400(unittest.TestCase):
"""
Testing the common_exceptions_400 decorator.
"""
def setUp(self):
self.request = Mock(spec=HttpRequest)
self.request.META = {}
def test_happy_path(self):
resp = view_success(self.request)
self.assertEqual(resp.status_code, 200)
def test_user_doesnotexist(self):
self.request.is_ajax.return_value = False
resp = view_user_doesnotexist(self.request)
self.assertEqual(resp.status_code, 400)
self.assertIn("User does not exist", resp.content)
def test_user_doesnotexist_ajax(self):
self.request.is_ajax.return_value = True
resp = view_user_doesnotexist(self.request)
self.assertEqual(resp.status_code, 400)
result = json.loads(resp.content)
self.assertIn("User does not exist", result["error"])
def test_alreadyrunningerror(self):
self.request.is_ajax.return_value = False
resp = view_alreadyrunningerror(self.request)
self.assertEqual(resp.status_code, 400)
self.assertIn("Task is already running", resp.content)
def test_alreadyrunningerror_ajax(self):
self.request.is_ajax.return_value = True
resp = view_alreadyrunningerror(self.request)
self.assertEqual(resp.status_code, 400)
result = json.loads(resp.content)
self.assertIn("Task is already running", result["error"])
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
@patch.dict(settings.FEATURES, {'ENABLE_INSTRUCTOR_EMAIL': True, 'REQUIRE_COURSE_EMAIL_AUTH': False})
class TestInstructorAPIDenyLevels(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Ensure that users cannot access endpoints they shouldn't be able to.
"""
def setUp(self):
self.course = CourseFactory.create()
self.user = UserFactory.create()
CourseEnrollment.enroll(self.user, self.course.id)
self.problem_location = msk_from_problem_urlname(
self.course.id,
'robot-some-problem-urlname'
)
self.problem_urlname = self.problem_location.to_deprecated_string()
_module = StudentModule.objects.create(
student=self.user,
course_id=self.course.id,
module_state_key=self.problem_location,
state=json.dumps({'attempts': 10}),
)
# Endpoints that only Staff or Instructors can access
self.staff_level_endpoints = [
('students_update_enrollment', {'identifiers': 'foo@example.org', 'action': 'enroll'}),
('get_grading_config', {}),
('get_students_features', {}),
('get_distribution', {}),
('get_student_progress_url', {'unique_student_identifier': self.user.username}),
('reset_student_attempts',
{'problem_to_reset': self.problem_urlname, 'unique_student_identifier': self.user.email}),
('update_forum_role_membership',
{'unique_student_identifier': self.user.email, 'rolename': 'Moderator', 'action': 'allow'}),
('list_forum_members', {'rolename': FORUM_ROLE_COMMUNITY_TA}),
('proxy_legacy_analytics', {'aname': 'ProblemGradeDistribution'}),
('send_email', {'send_to': 'staff', 'subject': 'test', 'message': 'asdf'}),
('list_instructor_tasks', {}),
('list_background_email_tasks', {}),
('list_report_downloads', {}),
('calculate_grades_csv', {}),
('get_students_features', {}),
]
# Endpoints that only Instructors can access
self.instructor_level_endpoints = [
('bulk_beta_modify_access', {'identifiers': 'foo@example.org', 'action': 'add'}),
('modify_access', {'unique_student_identifier': self.user.email, 'rolename': 'beta', 'action': 'allow'}),
('list_course_role_members', {'rolename': 'beta'}),
('rescore_problem',
{'problem_to_reset': self.problem_urlname, 'unique_student_identifier': self.user.email}),
]
def _access_endpoint(self, endpoint, args, status_code, msg):
"""
Asserts that accessing the given `endpoint` gets a response of `status_code`.
endpoint: string, endpoint for instructor dash API
args: dict, kwargs for `reverse` call
status_code: expected HTTP status code response
msg: message to display if assertion fails.
"""
url = reverse(endpoint, kwargs={'course_id': self.course.id.to_deprecated_string()})
if endpoint in ['send_email', 'students_update_enrollment', 'bulk_beta_modify_access']:
response = self.client.post(url, args)
else:
response = self.client.get(url, args)
self.assertEqual(
response.status_code,
status_code,
msg=msg
)
def test_student_level(self):
"""
Ensure that an enrolled student can't access staff or instructor endpoints.
"""
self.client.login(username=self.user.username, password='test')
for endpoint, args in self.staff_level_endpoints:
self._access_endpoint(
endpoint,
args,
403,
"Student should not be allowed to access endpoint " + endpoint
)
for endpoint, args in self.instructor_level_endpoints:
self._access_endpoint(
endpoint,
args,
403,
"Student should not be allowed to access endpoint " + endpoint
)
def test_staff_level(self):
"""
Ensure that a staff member can't access instructor endpoints.
"""
staff_member = StaffFactory(course_key=self.course.id)
CourseEnrollment.enroll(staff_member, self.course.id)
self.client.login(username=staff_member.username, password='test')
# Try to promote to forums admin - not working
# update_forum_role(self.course.id, staff_member, FORUM_ROLE_ADMINISTRATOR, 'allow')
for endpoint, args in self.staff_level_endpoints:
# TODO: make these work
if endpoint in ['update_forum_role_membership', 'proxy_legacy_analytics', 'list_forum_members']:
continue
self._access_endpoint(
endpoint,
args,
200,
"Staff member should be allowed to access endpoint " + endpoint
)
for endpoint, args in self.instructor_level_endpoints:
self._access_endpoint(
endpoint,
args,
403,
"Staff member should not be allowed to access endpoint " + endpoint
)
def test_instructor_level(self):
"""
Ensure that an instructor member can access all endpoints.
"""
inst = InstructorFactory(course_key=self.course.id)
CourseEnrollment.enroll(inst, self.course.id)
self.client.login(username=inst.username, password='test')
for endpoint, args in self.staff_level_endpoints:
# TODO: make these work
if endpoint in ['update_forum_role_membership', 'proxy_legacy_analytics']:
continue
self._access_endpoint(
endpoint,
args,
200,
"Instructor should be allowed to access endpoint " + endpoint
)
for endpoint, args in self.instructor_level_endpoints:
# TODO: make this work
if endpoint in ['rescore_problem']:
continue
self._access_endpoint(
endpoint,
args,
200,
"Instructor should be allowed to access endpoint " + endpoint
)
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
@patch.dict(settings.FEATURES, {'ALLOW_AUTOMATED_SIGNUPS': True})
class TestInstructorAPIBulkAccountCreationAndEnrollment(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Test Bulk account creation and enrollment from csv file
"""
def setUp(self):
self.request = RequestFactory().request()
self.course = CourseFactory.create()
self.instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=self.instructor.username, password='test')
self.url = reverse('register_and_enroll_students', kwargs={'course_id': self.course.id.to_deprecated_string()})
self.not_enrolled_student = UserFactory(
username='NotEnrolledStudent',
email='nonenrolled@test.com',
first_name='NotEnrolled',
last_name='Student'
)
@patch('instructor.views.api.log.info')
def test_account_creation_and_enrollment_with_csv(self, info_log):
"""
Happy path test to create a single new user
"""
csv_content = "test_student@example.com,test_student_1,tester1,USA"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
response = self.client.post(self.url, {'students_list': uploaded_file})
self.assertEqual(response.status_code, 200)
data = json.loads(response.content)
self.assertEquals(len(data['row_errors']), 0)
self.assertEquals(len(data['warnings']), 0)
self.assertEquals(len(data['general_errors']), 0)
# test the log for email that's send to new created user.
info_log.assert_called_with('email sent to new created user at test_student@example.com')
@patch('instructor.views.api.log.info')
def test_account_creation_and_enrollment_with_csv_with_blank_lines(self, info_log):
"""
Happy path test to create a single new user
"""
csv_content = "\ntest_student@example.com,test_student_1,tester1,USA\n\n"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
response = self.client.post(self.url, {'students_list': uploaded_file})
self.assertEqual(response.status_code, 200)
data = json.loads(response.content)
self.assertEquals(len(data['row_errors']), 0)
self.assertEquals(len(data['warnings']), 0)
self.assertEquals(len(data['general_errors']), 0)
# test the log for email that's send to new created user.
info_log.assert_called_with('email sent to new created user at test_student@example.com')
@patch('instructor.views.api.log.info')
def test_email_and_username_already_exist(self, info_log):
"""
If the email address and username already exists
and the user is enrolled in the course, do nothing (including no email gets sent out)
"""
csv_content = "test_student@example.com,test_student_1,tester1,USA\n" \
"test_student@example.com,test_student_1,tester2,US"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
response = self.client.post(self.url, {'students_list': uploaded_file})
self.assertEqual(response.status_code, 200)
data = json.loads(response.content)
self.assertEquals(len(data['row_errors']), 0)
self.assertEquals(len(data['warnings']), 0)
self.assertEquals(len(data['general_errors']), 0)
# test the log for email that's send to new created user.
info_log.assert_called_with("user already exists with username '{username}' and email '{email}'".format(username='test_student_1', email='test_student@example.com'))
def test_bad_file_upload_type(self):
"""
Try uploading some non-CSV file and verify that it is rejected
"""
uploaded_file = SimpleUploadedFile("temp.jpg", io.BytesIO(b"some initial binary data: \x00\x01").read())
response = self.client.post(self.url, {'students_list': uploaded_file})
self.assertEqual(response.status_code, 200)
data = json.loads(response.content)
self.assertNotEquals(len(data['general_errors']), 0)
self.assertEquals(data['general_errors'][0]['response'], 'Could not read uploaded file.')
def test_insufficient_data(self):
"""
Try uploading a CSV file which does not have the exact four columns of data
"""
csv_content = "test_student@example.com,test_student_1\n"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
response = self.client.post(self.url, {'students_list': uploaded_file})
self.assertEqual(response.status_code, 200)
data = json.loads(response.content)
self.assertEquals(len(data['row_errors']), 0)
self.assertEquals(len(data['warnings']), 0)
self.assertEquals(len(data['general_errors']), 1)
self.assertEquals(data['general_errors'][0]['response'], 'Data in row #1 must have exactly four columns: email, username, full name, and country')
def test_invalid_email_in_csv(self):
"""
Test failure case of a poorly formatted email field
"""
csv_content = "test_student.example.com,test_student_1,tester1,USA"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
response = self.client.post(self.url, {'students_list': uploaded_file})
data = json.loads(response.content)
self.assertEqual(response.status_code, 200)
self.assertNotEquals(len(data['row_errors']), 0)
self.assertEquals(len(data['warnings']), 0)
self.assertEquals(len(data['general_errors']), 0)
self.assertEquals(data['row_errors'][0]['response'], 'Invalid email {0}.'.format('test_student.example.com'))
@patch('instructor.views.api.log.info')
def test_csv_user_exist_and_not_enrolled(self, info_log):
"""
If the email address and username already exists
and the user is not enrolled in the course, enrolled him/her and iterate to next one.
"""
csv_content = "nonenrolled@test.com,NotEnrolledStudent,tester1,USA"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
response = self.client.post(self.url, {'students_list': uploaded_file})
self.assertEqual(response.status_code, 200)
info_log.assert_called_with('user {username} enrolled in the course {course}'.format(username='NotEnrolledStudent', course=self.course.id))
def test_user_with_already_existing_email_in_csv(self):
"""
If the email address already exists, but the username is different,
assume it is the correct user and just register the user in the course.
"""
csv_content = "test_student@example.com,test_student_1,tester1,USA\n" \
"test_student@example.com,test_student_2,tester2,US"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
response = self.client.post(self.url, {'students_list': uploaded_file})
self.assertEqual(response.status_code, 200)
data = json.loads(response.content)
warning_message = 'An account with email {email} exists but the provided username {username} ' \
'is different. Enrolling anyway with {email}.'.format(email='test_student@example.com', username='test_student_2')
self.assertNotEquals(len(data['warnings']), 0)
self.assertEquals(data['warnings'][0]['response'], warning_message)
user = User.objects.get(email='test_student@example.com')
self.assertTrue(CourseEnrollment.is_enrolled(user, self.course.id))
def test_user_with_already_existing_username_in_csv(self):
"""
If the username already exists (but not the email),
assume it is a different user and fail to create the new account.
"""
csv_content = "test_student1@example.com,test_student_1,tester1,USA\n" \
"test_student2@example.com,test_student_1,tester2,US"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
response = self.client.post(self.url, {'students_list': uploaded_file})
self.assertEqual(response.status_code, 200)
data = json.loads(response.content)
self.assertNotEquals(len(data['row_errors']), 0)
self.assertEquals(data['row_errors'][0]['response'], 'Username {user} already exists.'.format(user='test_student_1'))
def test_csv_file_not_attached(self):
"""
Test when the user does not attach a file
"""
csv_content = "test_student1@example.com,test_student_1,tester1,USA\n" \
"test_student2@example.com,test_student_1,tester2,US"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
response = self.client.post(self.url, {'file_not_found': uploaded_file})
self.assertEqual(response.status_code, 200)
data = json.loads(response.content)
self.assertNotEquals(len(data['general_errors']), 0)
self.assertEquals(data['general_errors'][0]['response'], 'File is not attached.')
def test_raising_exception_in_auto_registration_and_enrollment_case(self):
"""
Test that exceptions are handled well
"""
csv_content = "test_student1@example.com,test_student_1,tester1,USA\n" \
"test_student2@example.com,test_student_1,tester2,US"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
with patch('instructor.views.api.create_and_enroll_user') as mock:
mock.side_effect = NonExistentCourseError()
response = self.client.post(self.url, {'students_list': uploaded_file})
self.assertEqual(response.status_code, 200)
data = json.loads(response.content)
self.assertNotEquals(len(data['row_errors']), 0)
self.assertEquals(data['row_errors'][0]['response'], 'NonExistentCourseError')
def test_generate_unique_password(self):
"""
generate_unique_password should generate a unique password string that excludes certain characters.
"""
password = generate_unique_password([], 12)
self.assertEquals(len(password), 12)
for letter in password:
self.assertNotIn(letter, 'aAeEiIoOuU1l')
def test_users_created_and_enrolled_successfully_if_others_fail(self):
csv_content = "test_student1@example.com,test_student_1,tester1,USA\n" \
"test_student3@example.com,test_student_1,tester3,CA\n" \
"test_student2@example.com,test_student_2,tester2,USA"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
response = self.client.post(self.url, {'students_list': uploaded_file})
self.assertEqual(response.status_code, 200)
data = json.loads(response.content)
self.assertNotEquals(len(data['row_errors']), 0)
self.assertEquals(data['row_errors'][0]['response'], 'Username {user} already exists.'.format(user='test_student_1'))
self.assertTrue(User.objects.filter(username='test_student_1', email='test_student1@example.com').exists())
self.assertTrue(User.objects.filter(username='test_student_2', email='test_student2@example.com').exists())
self.assertFalse(User.objects.filter(email='test_student3@example.com').exists())
@patch.object(instructor.views.api, 'generate_random_string',
Mock(side_effect=['first', 'first', 'second']))
def test_generate_unique_password_no_reuse(self):
"""
generate_unique_password should generate a unique password string that hasn't been generated before.
"""
generated_password = ['first']
password = generate_unique_password(generated_password, 12)
self.assertNotEquals(password, 'first')
@patch.dict(settings.FEATURES, {'ALLOW_AUTOMATED_SIGNUPS': False})
def test_allow_automated_signups_flag_not_set(self):
csv_content = "test_student1@example.com,test_student_1,tester1,USA"
uploaded_file = SimpleUploadedFile("temp.csv", csv_content)
response = self.client.post(self.url, {'students_list': uploaded_file})
self.assertEquals(response.status_code, 403)
@ddt.ddt
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
class TestInstructorAPIEnrollment(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Test enrollment modification endpoint.
This test does NOT exhaustively test state changes, that is the
job of test_enrollment. This tests the response and action switch.
"""
def setUp(self):
self.request = RequestFactory().request()
self.course = CourseFactory.create()
self.instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=self.instructor.username, password='test')
self.enrolled_student = UserFactory(username='EnrolledStudent', first_name='Enrolled', last_name='Student')
CourseEnrollment.enroll(
self.enrolled_student,
self.course.id
)
self.notenrolled_student = UserFactory(username='NotEnrolledStudent', first_name='NotEnrolled',
last_name='Student')
# Create invited, but not registered, user
cea = CourseEnrollmentAllowed(email='robot-allowed@robot.org', course_id=self.course.id)
cea.save()
self.allowed_email = 'robot-allowed@robot.org'
self.notregistered_email = 'robot-not-an-email-yet@robot.org'
self.assertEqual(User.objects.filter(email=self.notregistered_email).count(), 0)
# Email URL values
self.site_name = microsite.get_value(
'SITE_NAME',
settings.SITE_NAME
)
self.about_path = '/courses/{}/about'.format(self.course.id)
self.course_path = '/courses/{}/'.format(self.course.id)
# uncomment to enable enable printing of large diffs
# from failed assertions in the event of a test failure.
# (comment because pylint C0103)
# self.maxDiff = None
def tearDown(self):
"""
Undo all patches.
"""
patch.stopall()
def test_missing_params(self):
""" Test missing all query parameters. """
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url)
self.assertEqual(response.status_code, 400)
def test_bad_action(self):
""" Test with an invalid action. """
action = 'robot-not-an-action'
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.enrolled_student.email, 'action': action})
self.assertEqual(response.status_code, 400)
def test_invalid_email(self):
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': 'percivaloctavius@', 'action': 'enroll', 'email_students': False})
self.assertEqual(response.status_code, 200)
# test the response data
expected = {
"action": "enroll",
'auto_enroll': False,
"results": [
{
"identifier": 'percivaloctavius@',
"invalidIdentifier": True,
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
def test_invalid_username(self):
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': 'percivaloctavius', 'action': 'enroll', 'email_students': False})
self.assertEqual(response.status_code, 200)
# test the response data
expected = {
"action": "enroll",
'auto_enroll': False,
"results": [
{
"identifier": 'percivaloctavius',
"invalidIdentifier": True,
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
def test_enroll_with_username(self):
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.notenrolled_student.username, 'action': 'enroll', 'email_students': False})
self.assertEqual(response.status_code, 200)
# test the response data
expected = {
"action": "enroll",
'auto_enroll': False,
"results": [
{
"identifier": self.notenrolled_student.username,
"before": {
"enrollment": False,
"auto_enroll": False,
"user": True,
"allowed": False,
},
"after": {
"enrollment": True,
"auto_enroll": False,
"user": True,
"allowed": False,
}
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
def test_enroll_without_email(self):
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.notenrolled_student.email, 'action': 'enroll', 'email_students': False})
print "type(self.notenrolled_student.email): {}".format(type(self.notenrolled_student.email))
self.assertEqual(response.status_code, 200)
# test that the user is now enrolled
user = User.objects.get(email=self.notenrolled_student.email)
self.assertTrue(CourseEnrollment.is_enrolled(user, self.course.id))
# test the response data
expected = {
"action": "enroll",
"auto_enroll": False,
"results": [
{
"identifier": self.notenrolled_student.email,
"before": {
"enrollment": False,
"auto_enroll": False,
"user": True,
"allowed": False,
},
"after": {
"enrollment": True,
"auto_enroll": False,
"user": True,
"allowed": False,
}
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
# Check the outbox
self.assertEqual(len(mail.outbox), 0)
@ddt.data('http', 'https')
def test_enroll_with_email(self, protocol):
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
params = {'identifiers': self.notenrolled_student.email, 'action': 'enroll', 'email_students': True}
environ = {'wsgi.url_scheme': protocol}
response = self.client.post(url, params, **environ)
print "type(self.notenrolled_student.email): {}".format(type(self.notenrolled_student.email))
self.assertEqual(response.status_code, 200)
# test that the user is now enrolled
user = User.objects.get(email=self.notenrolled_student.email)
self.assertTrue(CourseEnrollment.is_enrolled(user, self.course.id))
# test the response data
expected = {
"action": "enroll",
"auto_enroll": False,
"results": [
{
"identifier": self.notenrolled_student.email,
"before": {
"enrollment": False,
"auto_enroll": False,
"user": True,
"allowed": False,
},
"after": {
"enrollment": True,
"auto_enroll": False,
"user": True,
"allowed": False,
}
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
# Check the outbox
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(
mail.outbox[0].subject,
u'You have been enrolled in {}'.format(self.course.display_name)
)
self.assertEqual(
mail.outbox[0].body,
"Dear NotEnrolled Student\n\nYou have been enrolled in {} "
"at edx.org by a member of the course staff. "
"The course should now appear on your edx.org dashboard.\n\n"
"To start accessing course materials, please visit "
"{proto}://{site}{course_path}\n\n----\n"
"This email was automatically sent from edx.org to NotEnrolled Student".format(
self.course.display_name,
proto=protocol, site=self.site_name, course_path=self.course_path
)
)
@ddt.data('http', 'https')
def test_enroll_with_email_not_registered(self, protocol):
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
params = {'identifiers': self.notregistered_email, 'action': 'enroll', 'email_students': True}
environ = {'wsgi.url_scheme': protocol}
response = self.client.post(url, params, **environ)
self.assertEqual(response.status_code, 200)
# Check the outbox
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(
mail.outbox[0].subject,
u'You have been invited to register for {}'.format(self.course.display_name)
)
self.assertEqual(
mail.outbox[0].body,
"Dear student,\n\nYou have been invited to join {} at edx.org by a member of the course staff.\n\n"
"To finish your registration, please visit {proto}://{site}/register and fill out the "
"registration form making sure to use robot-not-an-email-yet@robot.org in the E-mail field.\n"
"Once you have registered and activated your account, "
"visit {proto}://{site}{about_path} to join the course.\n\n----\n"
"This email was automatically sent from edx.org to robot-not-an-email-yet@robot.org".format(
self.course.display_name, proto=protocol, site=self.site_name, about_path=self.about_path
)
)
@ddt.data('http', 'https')
@patch.dict(settings.FEATURES, {'ENABLE_MKTG_SITE': True})
def test_enroll_email_not_registered_mktgsite(self, protocol):
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
params = {'identifiers': self.notregistered_email, 'action': 'enroll', 'email_students': True}
environ = {'wsgi.url_scheme': protocol}
response = self.client.post(url, params, **environ)
self.assertEqual(response.status_code, 200)
self.assertEqual(
mail.outbox[0].body,
"Dear student,\n\nYou have been invited to join {display_name} at edx.org by a member of the course staff.\n\n"
"To finish your registration, please visit {proto}://{site}/register and fill out the registration form "
"making sure to use robot-not-an-email-yet@robot.org in the E-mail field.\n"
"You can then enroll in {display_name}.\n\n----\n"
"This email was automatically sent from edx.org to robot-not-an-email-yet@robot.org".format(
display_name=self.course.display_name, proto=protocol, site=self.site_name
)
)
@ddt.data('http', 'https')
def test_enroll_with_email_not_registered_autoenroll(self, protocol):
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
params = {'identifiers': self.notregistered_email, 'action': 'enroll', 'email_students': True,
'auto_enroll': True}
environ = {'wsgi.url_scheme': protocol}
response = self.client.post(url, params, **environ)
print "type(self.notregistered_email): {}".format(type(self.notregistered_email))
self.assertEqual(response.status_code, 200)
# Check the outbox
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(
mail.outbox[0].subject,
u'You have been invited to register for {}'.format(self.course.display_name)
)
self.assertEqual(
mail.outbox[0].body,
"Dear student,\n\nYou have been invited to join {display_name} at edx.org by a member of the course staff.\n\n"
"To finish your registration, please visit {proto}://{site}/register and fill out the registration form "
"making sure to use robot-not-an-email-yet@robot.org in the E-mail field.\n"
"Once you have registered and activated your account, you will see {display_name} listed on your dashboard.\n\n----\n"
"This email was automatically sent from edx.org to robot-not-an-email-yet@robot.org".format(
proto=protocol, site=self.site_name, display_name=self.course.display_name
)
)
def test_unenroll_without_email(self):
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.enrolled_student.email, 'action': 'unenroll', 'email_students': False})
print "type(self.enrolled_student.email): {}".format(type(self.enrolled_student.email))
self.assertEqual(response.status_code, 200)
# test that the user is now unenrolled
user = User.objects.get(email=self.enrolled_student.email)
self.assertFalse(CourseEnrollment.is_enrolled(user, self.course.id))
# test the response data
expected = {
"action": "unenroll",
"auto_enroll": False,
"results": [
{
"identifier": self.enrolled_student.email,
"before": {
"enrollment": True,
"auto_enroll": False,
"user": True,
"allowed": False,
},
"after": {
"enrollment": False,
"auto_enroll": False,
"user": True,
"allowed": False,
}
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
# Check the outbox
self.assertEqual(len(mail.outbox), 0)
def test_unenroll_with_email(self):
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.enrolled_student.email, 'action': 'unenroll', 'email_students': True})
print "type(self.enrolled_student.email): {}".format(type(self.enrolled_student.email))
self.assertEqual(response.status_code, 200)
# test that the user is now unenrolled
user = User.objects.get(email=self.enrolled_student.email)
self.assertFalse(CourseEnrollment.is_enrolled(user, self.course.id))
# test the response data
expected = {
"action": "unenroll",
"auto_enroll": False,
"results": [
{
"identifier": self.enrolled_student.email,
"before": {
"enrollment": True,
"auto_enroll": False,
"user": True,
"allowed": False,
},
"after": {
"enrollment": False,
"auto_enroll": False,
"user": True,
"allowed": False,
}
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
# Check the outbox
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(
mail.outbox[0].subject,
'You have been un-enrolled from {display_name}'.format(display_name=self.course.display_name,)
)
self.assertEqual(
mail.outbox[0].body,
"Dear Enrolled Student\n\nYou have been un-enrolled in {display_name} "
"at edx.org by a member of the course staff. "
"The course will no longer appear on your edx.org dashboard.\n\n"
"Your other courses have not been affected.\n\n----\n"
"This email was automatically sent from edx.org to Enrolled Student".format(
display_name=self.course.display_name,
)
)
def test_unenroll_with_email_allowed_student(self):
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.allowed_email, 'action': 'unenroll', 'email_students': True})
print "type(self.allowed_email): {}".format(type(self.allowed_email))
self.assertEqual(response.status_code, 200)
# test the response data
expected = {
"action": "unenroll",
"auto_enroll": False,
"results": [
{
"identifier": self.allowed_email,
"before": {
"enrollment": False,
"auto_enroll": False,
"user": False,
"allowed": True,
},
"after": {
"enrollment": False,
"auto_enroll": False,
"user": False,
"allowed": False,
}
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
# Check the outbox
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(
mail.outbox[0].subject,
'You have been un-enrolled from {display_name}'.format(display_name=self.course.display_name,)
)
self.assertEqual(
mail.outbox[0].body,
"Dear Student,\n\nYou have been un-enrolled from course {display_name} by a member of the course staff. "
"Please disregard the invitation previously sent.\n\n----\n"
"This email was automatically sent from edx.org to robot-allowed@robot.org".format(
display_name=self.course.display_name,
)
)
@ddt.data('http', 'https')
@patch('instructor.enrollment.uses_shib')
def test_enroll_with_email_not_registered_with_shib(self, protocol, mock_uses_shib):
mock_uses_shib.return_value = True
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
params = {'identifiers': self.notregistered_email, 'action': 'enroll', 'email_students': True}
environ = {'wsgi.url_scheme': protocol}
response = self.client.post(url, params, **environ)
self.assertEqual(response.status_code, 200)
# Check the outbox
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(
mail.outbox[0].subject,
'You have been invited to register for {display_name}'.format(display_name=self.course.display_name,)
)
self.assertEqual(
mail.outbox[0].body,
"Dear student,\n\nYou have been invited to join {display_name} at edx.org by a member of the course staff.\n\n"
"To access the course visit {proto}://{site}{about_path} and register for the course.\n\n----\n"
"This email was automatically sent from edx.org to robot-not-an-email-yet@robot.org".format(
proto=protocol, site=self.site_name, about_path=self.about_path,
display_name=self.course.display_name,
)
)
@patch('instructor.enrollment.uses_shib')
@patch.dict(settings.FEATURES, {'ENABLE_MKTG_SITE': True})
def test_enroll_email_not_registered_shib_mktgsite(self, mock_uses_shib):
# Try with marketing site enabled and shib on
mock_uses_shib.return_value = True
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
# Try with marketing site enabled
with patch.dict('django.conf.settings.FEATURES', {'ENABLE_MKTG_SITE': True}):
response = self.client.post(url, {'identifiers': self.notregistered_email, 'action': 'enroll', 'email_students': True})
self.assertEqual(response.status_code, 200)
self.assertEqual(
mail.outbox[0].body,
"Dear student,\n\nYou have been invited to join {} at edx.org by a member of the course staff.\n\n----\n"
"This email was automatically sent from edx.org to robot-not-an-email-yet@robot.org".format(
self.course.display_name,
)
)
@ddt.data('http', 'https')
@patch('instructor.enrollment.uses_shib')
def test_enroll_with_email_not_registered_with_shib_autoenroll(self, protocol, mock_uses_shib):
mock_uses_shib.return_value = True
url = reverse('students_update_enrollment', kwargs={'course_id': self.course.id.to_deprecated_string()})
params = {'identifiers': self.notregistered_email, 'action': 'enroll', 'email_students': True,
'auto_enroll': True}
environ = {'wsgi.url_scheme': protocol}
response = self.client.post(url, params, **environ)
print "type(self.notregistered_email): {}".format(type(self.notregistered_email))
self.assertEqual(response.status_code, 200)
# Check the outbox
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(
mail.outbox[0].subject,
'You have been invited to register for {display_name}'.format(display_name=self.course.display_name,)
)
self.assertEqual(
mail.outbox[0].body,
"Dear student,\n\nYou have been invited to join {display_name} at edx.org by a member of the course staff.\n\n"
"To access the course visit {proto}://{site}{course_path} and login.\n\n----\n"
"This email was automatically sent from edx.org to robot-not-an-email-yet@robot.org".format(
display_name=self.course.display_name,
proto=protocol, site=self.site_name, course_path=self.course_path
)
)
@ddt.ddt
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
class TestInstructorAPIBulkBetaEnrollment(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Test bulk beta modify access endpoint.
"""
def setUp(self):
self.course = CourseFactory.create()
self.instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=self.instructor.username, password='test')
self.beta_tester = BetaTesterFactory(course_key=self.course.id)
CourseEnrollment.enroll(
self.beta_tester,
self.course.id
)
self.assertTrue(CourseBetaTesterRole(self.course.id).has_user(self.beta_tester))
self.notenrolled_student = UserFactory(username='NotEnrolledStudent')
self.notregistered_email = 'robot-not-an-email-yet@robot.org'
self.assertEqual(User.objects.filter(email=self.notregistered_email).count(), 0)
self.request = RequestFactory().request()
# Email URL values
self.site_name = microsite.get_value(
'SITE_NAME',
settings.SITE_NAME
)
self.about_path = '/courses/{}/about'.format(self.course.id)
self.course_path = '/courses/{}/'.format(self.course.id)
# uncomment to enable enable printing of large diffs
# from failed assertions in the event of a test failure.
# (comment because pylint C0103)
# self.maxDiff = None
def test_missing_params(self):
""" Test missing all query parameters. """
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url)
self.assertEqual(response.status_code, 400)
def test_bad_action(self):
""" Test with an invalid action. """
action = 'robot-not-an-action'
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.beta_tester.email, 'action': action})
self.assertEqual(response.status_code, 400)
def add_notenrolled(self, response, identifier):
"""
Test Helper Method (not a test, called by other tests)
Takes a client response from a call to bulk_beta_modify_access with 'email_students': False,
and the student identifier (email or username) given as 'identifiers' in the request.
Asserts the reponse returns cleanly, that the student was added as a beta tester, and the
response properly contains their identifier, 'error': False, and 'userDoesNotExist': False.
Additionally asserts no email was sent.
"""
self.assertEqual(response.status_code, 200)
self.assertTrue(CourseBetaTesterRole(self.course.id).has_user(self.notenrolled_student))
# test the response data
expected = {
"action": "add",
"results": [
{
"identifier": identifier,
"error": False,
"userDoesNotExist": False
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
# Check the outbox
self.assertEqual(len(mail.outbox), 0)
def test_add_notenrolled_email(self):
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.notenrolled_student.email, 'action': 'add', 'email_students': False})
self.add_notenrolled(response, self.notenrolled_student.email)
self.assertFalse(CourseEnrollment.is_enrolled(self.notenrolled_student, self.course.id))
def test_add_notenrolled_email_autoenroll(self):
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.notenrolled_student.email, 'action': 'add', 'email_students': False, 'auto_enroll': True})
self.add_notenrolled(response, self.notenrolled_student.email)
self.assertTrue(CourseEnrollment.is_enrolled(self.notenrolled_student, self.course.id))
def test_add_notenrolled_username(self):
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.notenrolled_student.username, 'action': 'add', 'email_students': False})
self.add_notenrolled(response, self.notenrolled_student.username)
self.assertFalse(CourseEnrollment.is_enrolled(self.notenrolled_student, self.course.id))
def test_add_notenrolled_username_autoenroll(self):
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.notenrolled_student.username, 'action': 'add', 'email_students': False, 'auto_enroll': True})
self.add_notenrolled(response, self.notenrolled_student.username)
self.assertTrue(CourseEnrollment.is_enrolled(self.notenrolled_student, self.course.id))
@ddt.data('http', 'https')
def test_add_notenrolled_with_email(self, protocol):
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
params = {'identifiers': self.notenrolled_student.email, 'action': 'add', 'email_students': True}
environ = {'wsgi.url_scheme': protocol}
response = self.client.post(url, params, **environ)
self.assertEqual(response.status_code, 200)
self.assertTrue(CourseBetaTesterRole(self.course.id).has_user(self.notenrolled_student))
# test the response data
expected = {
"action": "add",
"results": [
{
"identifier": self.notenrolled_student.email,
"error": False,
"userDoesNotExist": False
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
# Check the outbox
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(
mail.outbox[0].subject,
'You have been invited to a beta test for {display_name}'.format(display_name=self.course.display_name,)
)
self.assertEqual(
mail.outbox[0].body,
u"Dear {student_name}\n\nYou have been invited to be a beta tester "
"for {display_name} at edx.org by a member of the course staff.\n\n"
"Visit {proto}://{site}{about_path} to join "
"the course and begin the beta test.\n\n----\n"
"This email was automatically sent from edx.org to {student_email}".format(
display_name=self.course.display_name,
student_name=self.notenrolled_student.profile.name,
student_email=self.notenrolled_student.email,
proto=protocol,
site=self.site_name,
about_path=self.about_path
)
)
@ddt.data('http', 'https')
def test_add_notenrolled_with_email_autoenroll(self, protocol):
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
params = {'identifiers': self.notenrolled_student.email, 'action': 'add', 'email_students': True,
'auto_enroll': True}
environ = {'wsgi.url_scheme': protocol}
response = self.client.post(url, params, **environ)
self.assertEqual(response.status_code, 200)
self.assertTrue(CourseBetaTesterRole(self.course.id).has_user(self.notenrolled_student))
# test the response data
expected = {
"action": "add",
"results": [
{
"identifier": self.notenrolled_student.email,
"error": False,
"userDoesNotExist": False
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
# Check the outbox
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(
mail.outbox[0].subject,
'You have been invited to a beta test for {display_name}'.format(display_name=self.course.display_name)
)
self.assertEqual(
mail.outbox[0].body,
u"Dear {student_name}\n\nYou have been invited to be a beta tester "
"for {display_name} at edx.org by a member of the course staff.\n\n"
"To start accessing course materials, please visit "
"{proto}://{site}{course_path}\n\n----\n"
"This email was automatically sent from edx.org to {student_email}".format(
display_name=self.course.display_name,
student_name=self.notenrolled_student.profile.name,
student_email=self.notenrolled_student.email,
proto=protocol,
site=self.site_name,
course_path=self.course_path
)
)
@patch.dict(settings.FEATURES, {'ENABLE_MKTG_SITE': True})
def test_add_notenrolled_email_mktgsite(self):
# Try with marketing site enabled
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.notenrolled_student.email, 'action': 'add', 'email_students': True})
self.assertEqual(response.status_code, 200)
self.assertEqual(
mail.outbox[0].body,
u"Dear {}\n\nYou have been invited to be a beta tester "
"for {} at edx.org by a member of the course staff.\n\n"
"Visit edx.org to enroll in the course and begin the beta test.\n\n----\n"
"This email was automatically sent from edx.org to {}".format(
self.notenrolled_student.profile.name,
self.course.display_name,
self.notenrolled_student.email,
)
)
def test_enroll_with_email_not_registered(self):
# User doesn't exist
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.notregistered_email, 'action': 'add', 'email_students': True})
self.assertEqual(response.status_code, 200)
# test the response data
expected = {
"action": "add",
"results": [
{
"identifier": self.notregistered_email,
"error": True,
"userDoesNotExist": True
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
# Check the outbox
self.assertEqual(len(mail.outbox), 0)
def test_remove_without_email(self):
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.beta_tester.email, 'action': 'remove', 'email_students': False})
self.assertEqual(response.status_code, 200)
# Works around a caching bug which supposedly can't happen in prod. The instance here is not ==
# the instance fetched from the email above which had its cache cleared
if hasattr(self.beta_tester, '_roles'):
del self.beta_tester._roles
self.assertFalse(CourseBetaTesterRole(self.course.id).has_user(self.beta_tester))
# test the response data
expected = {
"action": "remove",
"results": [
{
"identifier": self.beta_tester.email,
"error": False,
"userDoesNotExist": False
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
# Check the outbox
self.assertEqual(len(mail.outbox), 0)
def test_remove_with_email(self):
url = reverse('bulk_beta_modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {'identifiers': self.beta_tester.email, 'action': 'remove', 'email_students': True})
self.assertEqual(response.status_code, 200)
# Works around a caching bug which supposedly can't happen in prod. The instance here is not ==
# the instance fetched from the email above which had its cache cleared
if hasattr(self.beta_tester, '_roles'):
del self.beta_tester._roles
self.assertFalse(CourseBetaTesterRole(self.course.id).has_user(self.beta_tester))
# test the response data
expected = {
"action": "remove",
"results": [
{
"identifier": self.beta_tester.email,
"error": False,
"userDoesNotExist": False
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
# Check the outbox
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(
mail.outbox[0].subject,
u'You have been removed from a beta test for {display_name}'.format(display_name=self.course.display_name,)
)
self.assertEqual(
mail.outbox[0].body,
"Dear {full_name}\n\nYou have been removed as a beta tester for "
"{display_name} at edx.org by a member of the course staff. "
"The course will remain on your dashboard, but you will no longer "
"be part of the beta testing group.\n\n"
"Your other courses have not been affected.\n\n----\n"
"This email was automatically sent from edx.org to {email_address}".format(
display_name=self.course.display_name,
full_name=self.beta_tester.profile.name,
email_address=self.beta_tester.email
)
)
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
class TestInstructorAPILevelsAccess(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Test endpoints whereby instructors can change permissions
of other users.
This test does NOT test whether the actions had an effect on the
database, that is the job of test_access.
This tests the response and action switch.
Actually, modify_access does not have a very meaningful
response yet, so only the status code is tested.
"""
def setUp(self):
self.course = CourseFactory.create()
self.instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=self.instructor.username, password='test')
self.other_instructor = InstructorFactory(course_key=self.course.id)
self.other_staff = StaffFactory(course_key=self.course.id)
self.other_user = UserFactory()
def test_modify_access_noparams(self):
""" Test missing all query parameters. """
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url)
self.assertEqual(response.status_code, 400)
def test_modify_access_bad_action(self):
""" Test with an invalid action parameter. """
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.other_staff.email,
'rolename': 'staff',
'action': 'robot-not-an-action',
})
self.assertEqual(response.status_code, 400)
def test_modify_access_bad_role(self):
""" Test with an invalid action parameter. """
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.other_staff.email,
'rolename': 'robot-not-a-roll',
'action': 'revoke',
})
self.assertEqual(response.status_code, 400)
def test_modify_access_allow(self):
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.other_user.email,
'rolename': 'staff',
'action': 'allow',
})
self.assertEqual(response.status_code, 200)
def test_modify_access_allow_with_uname(self):
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.other_instructor.username,
'rolename': 'staff',
'action': 'allow',
})
self.assertEqual(response.status_code, 200)
def test_modify_access_revoke(self):
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.other_staff.email,
'rolename': 'staff',
'action': 'revoke',
})
self.assertEqual(response.status_code, 200)
def test_modify_access_revoke_with_username(self):
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.other_staff.username,
'rolename': 'staff',
'action': 'revoke',
})
self.assertEqual(response.status_code, 200)
def test_modify_access_with_fake_user(self):
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': 'GandalfTheGrey',
'rolename': 'staff',
'action': 'revoke',
})
self.assertEqual(response.status_code, 200)
expected = {
'unique_student_identifier': 'GandalfTheGrey',
'userDoesNotExist': True,
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
def test_modify_access_with_inactive_user(self):
self.other_user.is_active = False
self.other_user.save() # pylint: disable=no-member
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.other_user.username,
'rolename': 'beta',
'action': 'allow',
})
self.assertEqual(response.status_code, 200)
expected = {
'unique_student_identifier': self.other_user.username,
'inactiveUser': True,
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
def test_modify_access_revoke_not_allowed(self):
""" Test revoking access that a user does not have. """
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.other_staff.email,
'rolename': 'instructor',
'action': 'revoke',
})
self.assertEqual(response.status_code, 200)
def test_modify_access_revoke_self(self):
"""
Test that an instructor cannot remove instructor privelages from themself.
"""
url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'unique_student_identifier': self.instructor.email,
'rolename': 'instructor',
'action': 'revoke',
})
self.assertEqual(response.status_code, 200)
# check response content
expected = {
'unique_student_identifier': self.instructor.username,
'rolename': 'instructor',
'action': 'revoke',
'removingSelfAsInstructor': True,
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
def test_list_course_role_members_noparams(self):
""" Test missing all query parameters. """
url = reverse('list_course_role_members', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url)
self.assertEqual(response.status_code, 400)
def test_list_course_role_members_bad_rolename(self):
""" Test with an invalid rolename parameter. """
url = reverse('list_course_role_members', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'rolename': 'robot-not-a-rolename',
})
self.assertEqual(response.status_code, 400)
def test_list_course_role_members_staff(self):
url = reverse('list_course_role_members', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'rolename': 'staff',
})
self.assertEqual(response.status_code, 200)
# check response content
expected = {
'course_id': self.course.id.to_deprecated_string(),
'staff': [
{
'username': self.other_staff.username,
'email': self.other_staff.email,
'first_name': self.other_staff.first_name,
'last_name': self.other_staff.last_name,
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
def test_list_course_role_members_beta(self):
url = reverse('list_course_role_members', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'rolename': 'beta',
})
self.assertEqual(response.status_code, 200)
# check response content
expected = {
'course_id': self.course.id.to_deprecated_string(),
'beta': []
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected)
def test_update_forum_role_membership(self):
"""
Test update forum role membership with user's email and username.
"""
# Seed forum roles for course.
seed_permissions_roles(self.course.id)
for user in [self.instructor, self.other_user]:
for identifier_attr in [user.email, user.username]:
for rolename in ["Administrator", "Moderator", "Community TA"]:
for action in ["allow", "revoke"]:
self.assert_update_forum_role_membership(user, identifier_attr, rolename, action)
def assert_update_forum_role_membership(self, current_user, identifier, rolename, action):
"""
Test update forum role membership.
Get unique_student_identifier, rolename and action and update forum role.
"""
url = reverse('update_forum_role_membership', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(
url,
{
'unique_student_identifier': identifier,
'rolename': rolename,
'action': action,
}
)
# Status code should be 200.
self.assertEqual(response.status_code, 200)
user_roles = current_user.roles.filter(course_id=self.course.id).values_list("name", flat=True)
if action == 'allow':
self.assertIn(rolename, user_roles)
elif action == 'revoke':
self.assertNotIn(rolename, user_roles)
@ddt.ddt
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Test endpoints that show data without side effects.
"""
def setUp(self):
super(TestInstructorAPILevelsDataDump, self).setUp()
self.course = CourseFactory.create()
self.course_mode = CourseMode(course_id=self.course.id,
mode_slug="honor",
mode_display_name="honor cert",
min_price=40)
self.course_mode.save()
self.instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=self.instructor.username, password='test')
self.cart = Order.get_cart_for_user(self.instructor)
self.coupon_code = 'abcde'
self.coupon = Coupon(code=self.coupon_code, description='testing code', course_id=self.course.id,
percentage_discount=10, created_by=self.instructor, is_active=True)
self.coupon.save()
#create testing invoice 1
self.sale_invoice_1 = Invoice.objects.create(
total_amount=1234.32, company_name='Test1', company_contact_name='TestName', company_contact_email='Test@company.com',
recipient_name='Testw', recipient_email='test1@test.com', customer_reference_number='2Fwe23S',
internal_reference="A", course_id=self.course.id, is_valid=True
)
self.students = [UserFactory() for _ in xrange(6)]
for student in self.students:
CourseEnrollment.enroll(student, self.course.id)
def test_invalidate_sale_record(self):
"""
Testing the sale invalidating scenario.
"""
for i in range(2):
course_registration_code = CourseRegistrationCode(
code='sale_invoice{}'.format(i), course_id=self.course.id.to_deprecated_string(),
created_by=self.instructor, invoice=self.sale_invoice_1
)
course_registration_code.save()
data = {'invoice_number': self.sale_invoice_1.id, 'event_type': "invalidate"}
url = reverse('sale_validation', kwargs={'course_id': self.course.id.to_deprecated_string()})
self.assert_request_status_code(200, url, method="POST", data=data)
#Now try to fetch data against not existing invoice number
test_data_1 = {'invoice_number': 100, 'event_type': "invalidate"}
self.assert_request_status_code(404, url, method="POST", data=test_data_1)
# Now invalidate the same invoice number and expect an Bad request
response = self.assert_request_status_code(400, url, method="POST", data=data)
self.assertIn("The sale associated with this invoice has already been invalidated.", response.content)
# now re_validate the invoice number
data['event_type'] = "re_validate"
self.assert_request_status_code(200, url, method="POST", data=data)
# Now re_validate the same actove invoice number and expect an Bad request
response = self.assert_request_status_code(400, url, method="POST", data=data)
self.assertIn("This invoice is already active.", response.content)
test_data_2 = {'invoice_number': self.sale_invoice_1.id}
response = self.assert_request_status_code(400, url, method="POST", data=test_data_2)
self.assertIn("Missing required event_type parameter", response.content)
test_data_3 = {'event_type': "re_validate"}
response = self.assert_request_status_code(400, url, method="POST", data=test_data_3)
self.assertIn("Missing required invoice_number parameter", response.content)
# submitting invalid invoice number
data['invoice_number'] = 'testing'
response = self.assert_request_status_code(400, url, method="POST", data=data)
self.assertIn("invoice_number must be an integer, {value} provided".format(value=data['invoice_number']), response.content)
def test_get_ecommerce_purchase_features_csv(self):
"""
Test that the response from get_purchase_transaction is in csv format.
"""
PaidCourseRegistration.add_to_order(self.cart, self.course.id)
self.cart.purchase(first='FirstNameTesting123', street1='StreetTesting123')
url = reverse('get_purchase_transaction', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url + '/csv', {})
self.assertEqual(response['Content-Type'], 'text/csv')
def test_get_sale_order_records_features_csv(self):
"""
Test that the response from get_sale_order_records is in csv format.
"""
self.cart.order_type = 'business'
self.cart.save()
self.cart.add_billing_details(company_name='Test Company', company_contact_name='Test',
company_contact_email='test@123', recipient_name='R1',
recipient_email='', customer_reference_number='PO#23')
PaidCourseRegistration.add_to_order(self.cart, self.course.id)
self.cart.purchase()
sale_order_url = reverse('get_sale_order_records', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(sale_order_url)
self.assertEqual(response['Content-Type'], 'text/csv')
def test_get_sale_records_features_csv(self):
"""
Test that the response from get_sale_records is in csv format.
"""
for i in range(2):
course_registration_code = CourseRegistrationCode(
code='sale_invoice{}'.format(i), course_id=self.course.id.to_deprecated_string(),
created_by=self.instructor, invoice=self.sale_invoice_1
)
course_registration_code.save()
url = reverse('get_sale_records', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url + '/csv', {})
self.assertEqual(response['Content-Type'], 'text/csv')
def test_get_sale_records_features_json(self):
"""
Test that the response from get_sale_records is in json format.
"""
for i in range(5):
course_registration_code = CourseRegistrationCode(
code='sale_invoice{}'.format(i), course_id=self.course.id.to_deprecated_string(),
created_by=self.instructor, invoice=self.sale_invoice_1
)
course_registration_code.save()
url = reverse('get_sale_records', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {})
res_json = json.loads(response.content)
self.assertIn('sale', res_json)
for res in res_json['sale']:
self.validate_sale_records_response(res, course_registration_code, self.sale_invoice_1, 0)
def test_get_sale_records_features_with_used_code(self):
"""
Test that the response from get_sale_records is in json format and using one of the registration codes.
"""
for i in range(5):
course_registration_code = CourseRegistrationCode(
code='qwerty{}'.format(i), course_id=self.course.id.to_deprecated_string(),
created_by=self.instructor, invoice=self.sale_invoice_1
)
course_registration_code.save()
PaidCourseRegistration.add_to_order(self.cart, self.course.id)
# now using registration code
self.client.post(reverse('shoppingcart.views.use_code'), {'code': 'qwerty0'})
url = reverse('get_sale_records', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {})
res_json = json.loads(response.content)
self.assertIn('sale', res_json)
for res in res_json['sale']:
self.validate_sale_records_response(res, course_registration_code, self.sale_invoice_1, 1)
def test_get_sale_records_features_with_multiple_invoices(self):
"""
Test that the response from get_sale_records is in json format for multiple invoices
"""
for i in range(5):
course_registration_code = CourseRegistrationCode(
code='qwerty{}'.format(i), course_id=self.course.id.to_deprecated_string(),
created_by=self.instructor, invoice=self.sale_invoice_1
)
course_registration_code.save()
#create test invoice 2
sale_invoice_2 = Invoice.objects.create(
total_amount=1234.32, company_name='Test1', company_contact_name='TestName', company_contact_email='Test@company.com',
recipient_name='Testw_2', recipient_email='test2@test.com', customer_reference_number='2Fwe23S',
internal_reference="B", course_id=self.course.id
)
for i in range(5):
course_registration_code = CourseRegistrationCode(
code='xyzmn{}'.format(i), course_id=self.course.id.to_deprecated_string(),
created_by=self.instructor, invoice=sale_invoice_2
)
course_registration_code.save()
url = reverse('get_sale_records', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {})
res_json = json.loads(response.content)
self.assertIn('sale', res_json)
self.validate_sale_records_response(res_json['sale'][0], course_registration_code, self.sale_invoice_1, 0)
self.validate_sale_records_response(res_json['sale'][1], course_registration_code, sale_invoice_2, 0)
def validate_sale_records_response(self, res, course_registration_code, invoice, used_codes):
"""
validate sale records attribute values with the response object
"""
self.assertEqual(res['total_amount'], invoice.total_amount)
self.assertEqual(res['recipient_email'], invoice.recipient_email)
self.assertEqual(res['recipient_name'], invoice.recipient_name)
self.assertEqual(res['company_name'], invoice.company_name)
self.assertEqual(res['company_contact_name'], invoice.company_contact_name)
self.assertEqual(res['company_contact_email'], invoice.company_contact_email)
self.assertEqual(res['internal_reference'], invoice.internal_reference)
self.assertEqual(res['customer_reference_number'], invoice.customer_reference_number)
self.assertEqual(res['invoice_number'], invoice.id)
self.assertEqual(res['created_by'], course_registration_code.created_by.username)
self.assertEqual(res['course_id'], invoice.course_id.to_deprecated_string())
self.assertEqual(res['total_used_codes'], used_codes)
self.assertEqual(res['total_codes'], 5)
def test_get_ecommerce_purchase_features_with_coupon_info(self):
"""
Test that some minimum of information is formatted
correctly in the response to get_purchase_transaction.
"""
PaidCourseRegistration.add_to_order(self.cart, self.course.id)
url = reverse('get_purchase_transaction', kwargs={'course_id': self.course.id.to_deprecated_string()})
# using coupon code
resp = self.client.post(reverse('shoppingcart.views.use_code'), {'code': self.coupon_code})
self.assertEqual(resp.status_code, 200)
self.cart.purchase(first='FirstNameTesting123', street1='StreetTesting123')
response = self.client.get(url, {})
res_json = json.loads(response.content)
self.assertIn('students', res_json)
for res in res_json['students']:
self.validate_purchased_transaction_response(res, self.cart, self.instructor, self.coupon_code)
def test_get_ecommerce_purchases_features_without_coupon_info(self):
"""
Test that some minimum of information is formatted
correctly in the response to get_purchase_transaction.
"""
url = reverse('get_purchase_transaction', kwargs={'course_id': self.course.id.to_deprecated_string()})
carts, instructors = ([] for i in range(2))
# purchasing the course by different users
for _ in xrange(3):
test_instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=test_instructor.username, password='test')
cart = Order.get_cart_for_user(test_instructor)
carts.append(cart)
instructors.append(test_instructor)
PaidCourseRegistration.add_to_order(cart, self.course.id)
cart.purchase(first='FirstNameTesting123', street1='StreetTesting123')
response = self.client.get(url, {})
res_json = json.loads(response.content)
self.assertIn('students', res_json)
for res, i in zip(res_json['students'], xrange(3)):
self.validate_purchased_transaction_response(res, carts[i], instructors[i], 'None')
def validate_purchased_transaction_response(self, res, cart, user, code):
"""
validate purchased transactions attribute values with the response object
"""
item = cart.orderitem_set.all().select_subclasses()[0]
self.assertEqual(res['coupon_code'], code)
self.assertEqual(res['username'], user.username)
self.assertEqual(res['email'], user.email)
self.assertEqual(res['list_price'], item.list_price)
self.assertEqual(res['unit_cost'], item.unit_cost)
self.assertEqual(res['order_id'], cart.id)
self.assertEqual(res['orderitem_id'], item.id)
def test_get_students_features(self):
"""
Test that some minimum of information is formatted
correctly in the response to get_students_features.
"""
url = reverse('get_students_features', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {})
res_json = json.loads(response.content)
self.assertIn('students', res_json)
for student in self.students:
student_json = [
x for x in res_json['students']
if x['username'] == student.username
][0]
self.assertEqual(student_json['username'], student.username)
self.assertEqual(student_json['email'], student.email)
@ddt.data(True, False)
def test_get_students_features_cohorted(self, is_cohorted):
"""
Test that get_students_features includes cohort info when the course is
cohorted, and does not when the course is not cohorted.
"""
url = reverse('get_students_features', kwargs={'course_id': unicode(self.course.id)})
self.course.cohort_config = {'cohorted': is_cohorted}
self.store.update_item(self.course, self.instructor.id)
response = self.client.get(url, {})
res_json = json.loads(response.content)
self.assertEqual('cohort' in res_json['feature_names'], is_cohorted)
@patch.object(instructor.views.api, 'anonymous_id_for_user', Mock(return_value='42'))
@patch.object(instructor.views.api, 'unique_id_for_user', Mock(return_value='41'))
def test_get_anon_ids(self):
"""
Test the CSV output for the anonymized user ids.
"""
url = reverse('get_anon_ids', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {})
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(
'"User ID","Anonymized User ID","Course Specific Anonymized User ID"'
'\n"3","41","42"\n'
))
self.assertTrue(body.endswith('"8","41","42"\n'))
def test_list_report_downloads(self):
url = reverse('list_report_downloads', kwargs={'course_id': self.course.id.to_deprecated_string()})
with patch('instructor_task.models.LocalFSReportStore.links_for') as mock_links_for:
mock_links_for.return_value = [
('mock_file_name_1', 'https://1.mock.url'),
('mock_file_name_2', 'https://2.mock.url'),
]
response = self.client.get(url, {})
expected_response = {
"downloads": [
{
"url": "https://1.mock.url",
"link": "<a href=\"https://1.mock.url\">mock_file_name_1</a>",
"name": "mock_file_name_1"
},
{
"url": "https://2.mock.url",
"link": "<a href=\"https://2.mock.url\">mock_file_name_2</a>",
"name": "mock_file_name_2"
}
]
}
res_json = json.loads(response.content)
self.assertEqual(res_json, expected_response)
@ddt.data(*REPORTS_DATA)
@ddt.unpack
def test_calculate_report_csv_success(self, report_type, instructor_api_endpoint, task_api_endpoint, extra_instructor_api_kwargs):
kwargs = {'course_id': unicode(self.course.id)}
kwargs.update(extra_instructor_api_kwargs)
url = reverse(instructor_api_endpoint, kwargs=kwargs)
with patch(task_api_endpoint):
response = self.client.get(url, {})
success_status = "Your {report_type} report is being generated! You can view the status of the generation task in the 'Pending Instructor Tasks' section.".format(report_type=report_type)
self.assertIn(success_status, response.content)
@ddt.data(*REPORTS_DATA)
@ddt.unpack
def test_calculate_report_csv_already_running(self, report_type, instructor_api_endpoint, task_api_endpoint, extra_instructor_api_kwargs):
kwargs = {'course_id': unicode(self.course.id)}
kwargs.update(extra_instructor_api_kwargs)
url = reverse(instructor_api_endpoint, kwargs=kwargs)
with patch(task_api_endpoint) as mock:
mock.side_effect = AlreadyRunningError()
response = self.client.get(url, {})
already_running_status = "{report_type} report generation task is already in progress. Check the 'Pending Instructor Tasks' table for the status of the task. When completed, the report will be available for download in the table below.".format(report_type=report_type)
self.assertIn(already_running_status, response.content)
def test_get_distribution_no_feature(self):
"""
Test that get_distribution lists available features
when supplied no feature parameter.
"""
url = reverse('get_distribution', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
res_json = json.loads(response.content)
self.assertEqual(type(res_json['available_features']), list)
url = reverse('get_distribution', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url + u'?feature=')
self.assertEqual(response.status_code, 200)
res_json = json.loads(response.content)
self.assertEqual(type(res_json['available_features']), list)
def test_get_distribution_unavailable_feature(self):
"""
Test that get_distribution fails gracefully with
an unavailable feature.
"""
url = reverse('get_distribution', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {'feature': 'robot-not-a-real-feature'})
self.assertEqual(response.status_code, 400)
def test_get_distribution_gender(self):
"""
Test that get_distribution fails gracefully with
an unavailable feature.
"""
url = reverse('get_distribution', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {'feature': 'gender'})
self.assertEqual(response.status_code, 200)
res_json = json.loads(response.content)
self.assertEqual(res_json['feature_results']['data']['m'], 6)
self.assertEqual(res_json['feature_results']['choices_display_names']['m'], 'Male')
self.assertEqual(res_json['feature_results']['data']['no_data'], 0)
self.assertEqual(res_json['feature_results']['choices_display_names']['no_data'], 'No Data')
def test_get_student_progress_url(self):
""" Test that progress_url is in the successful response. """
url = reverse('get_student_progress_url', kwargs={'course_id': self.course.id.to_deprecated_string()})
url += "?unique_student_identifier={}".format(
quote(self.students[0].email.encode("utf-8"))
)
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
res_json = json.loads(response.content)
self.assertIn('progress_url', res_json)
def test_get_student_progress_url_from_uname(self):
""" Test that progress_url is in the successful response. """
url = reverse('get_student_progress_url', kwargs={'course_id': self.course.id.to_deprecated_string()})
url += "?unique_student_identifier={}".format(
quote(self.students[0].username.encode("utf-8"))
)
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
res_json = json.loads(response.content)
self.assertIn('progress_url', res_json)
def test_get_student_progress_url_noparams(self):
""" Test that the endpoint 404's without the required query params. """
url = reverse('get_student_progress_url', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url)
self.assertEqual(response.status_code, 400)
def test_get_student_progress_url_nostudent(self):
""" Test that the endpoint 400's when requesting an unknown email. """
url = reverse('get_student_progress_url', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url)
self.assertEqual(response.status_code, 400)
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
class TestInstructorAPIRegradeTask(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Test endpoints whereby instructors can change student grades.
This includes resetting attempts and starting rescore tasks.
This test does NOT test whether the actions had an effect on the
database, that is the job of task tests and test_enrollment.
"""
def setUp(self):
self.course = CourseFactory.create()
self.instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=self.instructor.username, password='test')
self.student = UserFactory()
CourseEnrollment.enroll(self.student, self.course.id)
self.problem_location = msk_from_problem_urlname(
self.course.id,
'robot-some-problem-urlname'
)
self.problem_urlname = self.problem_location.to_deprecated_string()
self.module_to_reset = StudentModule.objects.create(
student=self.student,
course_id=self.course.id,
module_state_key=self.problem_location,
state=json.dumps({'attempts': 10}),
)
def test_reset_student_attempts_deletall(self):
""" Make sure no one can delete all students state on a problem. """
url = reverse('reset_student_attempts', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'problem_to_reset': self.problem_urlname,
'all_students': True,
'delete_module': True,
})
self.assertEqual(response.status_code, 400)
def test_reset_student_attempts_single(self):
""" Test reset single student attempts. """
url = reverse('reset_student_attempts', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'problem_to_reset': self.problem_urlname,
'unique_student_identifier': self.student.email,
})
self.assertEqual(response.status_code, 200)
# make sure problem attempts have been reset.
changed_module = StudentModule.objects.get(pk=self.module_to_reset.pk)
self.assertEqual(
json.loads(changed_module.state)['attempts'],
0
)
# mock out the function which should be called to execute the action.
@patch.object(instructor_task.api, 'submit_reset_problem_attempts_for_all_students')
def test_reset_student_attempts_all(self, act):
""" Test reset all student attempts. """
url = reverse('reset_student_attempts', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'problem_to_reset': self.problem_urlname,
'all_students': True,
})
self.assertEqual(response.status_code, 200)
self.assertTrue(act.called)
def test_reset_student_attempts_missingmodule(self):
""" Test reset for non-existant problem. """
url = reverse('reset_student_attempts', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'problem_to_reset': 'robot-not-a-real-module',
'unique_student_identifier': self.student.email,
})
self.assertEqual(response.status_code, 400)
def test_reset_student_attempts_delete(self):
""" Test delete single student state. """
url = reverse('reset_student_attempts', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'problem_to_reset': self.problem_urlname,
'unique_student_identifier': self.student.email,
'delete_module': True,
})
self.assertEqual(response.status_code, 200)
# make sure the module has been deleted
self.assertEqual(
StudentModule.objects.filter(
student=self.module_to_reset.student,
course_id=self.module_to_reset.course_id,
# module_id=self.module_to_reset.module_id,
).count(),
0
)
def test_reset_student_attempts_nonsense(self):
""" Test failure with both unique_student_identifier and all_students. """
url = reverse('reset_student_attempts', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'problem_to_reset': self.problem_urlname,
'unique_student_identifier': self.student.email,
'all_students': True,
})
self.assertEqual(response.status_code, 400)
@patch.object(instructor_task.api, 'submit_rescore_problem_for_student')
def test_rescore_problem_single(self, act):
""" Test rescoring of a single student. """
url = reverse('rescore_problem', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'problem_to_reset': self.problem_urlname,
'unique_student_identifier': self.student.email,
})
self.assertEqual(response.status_code, 200)
self.assertTrue(act.called)
@patch.object(instructor_task.api, 'submit_rescore_problem_for_student')
def test_rescore_problem_single_from_uname(self, act):
""" Test rescoring of a single student. """
url = reverse('rescore_problem', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'problem_to_reset': self.problem_urlname,
'unique_student_identifier': self.student.username,
})
self.assertEqual(response.status_code, 200)
self.assertTrue(act.called)
@patch.object(instructor_task.api, 'submit_rescore_problem_for_all_students')
def test_rescore_problem_all(self, act):
""" Test rescoring for all students. """
url = reverse('rescore_problem', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'problem_to_reset': self.problem_urlname,
'all_students': True,
})
self.assertEqual(response.status_code, 200)
self.assertTrue(act.called)
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
@patch.dict(settings.FEATURES, {'ENABLE_INSTRUCTOR_EMAIL': True, 'REQUIRE_COURSE_EMAIL_AUTH': False})
class TestInstructorSendEmail(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Checks that only instructors have access to email endpoints, and that
these endpoints are only accessible with courses that actually exist,
only with valid email messages.
"""
def setUp(self):
self.course = CourseFactory.create()
self.instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=self.instructor.username, password='test')
test_subject = u'\u1234 test subject'
test_message = u'\u6824 test message'
self.full_test_message = {
'send_to': 'staff',
'subject': test_subject,
'message': test_message,
}
def test_send_email_as_logged_in_instructor(self):
url = reverse('send_email', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, self.full_test_message)
self.assertEqual(response.status_code, 200)
def test_send_email_but_not_logged_in(self):
self.client.logout()
url = reverse('send_email', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, self.full_test_message)
self.assertEqual(response.status_code, 403)
def test_send_email_but_not_staff(self):
self.client.logout()
student = UserFactory()
self.client.login(username=student.username, password='test')
url = reverse('send_email', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, self.full_test_message)
self.assertEqual(response.status_code, 403)
def test_send_email_but_course_not_exist(self):
url = reverse('send_email', kwargs={'course_id': 'GarbageCourse/DNE/NoTerm'})
response = self.client.post(url, self.full_test_message)
self.assertNotEqual(response.status_code, 200)
def test_send_email_no_sendto(self):
url = reverse('send_email', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {
'subject': 'test subject',
'message': 'test message',
})
self.assertEqual(response.status_code, 400)
def test_send_email_no_subject(self):
url = reverse('send_email', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {
'send_to': 'staff',
'message': 'test message',
})
self.assertEqual(response.status_code, 400)
def test_send_email_no_message(self):
url = reverse('send_email', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url, {
'send_to': 'staff',
'subject': 'test subject',
})
self.assertEqual(response.status_code, 400)
class MockCompletionInfo(object):
"""Mock for get_task_completion_info"""
times_called = 0
def mock_get_task_completion_info(self, *args): # pylint: disable=unused-argument
"""Mock for get_task_completion_info"""
self.times_called += 1
if self.times_called % 2 == 0:
return True, 'Task Completed'
return False, 'Task Errored In Some Way'
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
class TestInstructorAPITaskLists(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Test instructor task list endpoint.
"""
class FakeTask(object):
""" Fake task object """
FEATURES = [
'task_type',
'task_input',
'task_id',
'requester',
'task_state',
'created',
'status',
'task_message',
'duration_sec'
]
def __init__(self, completion):
for feature in self.FEATURES:
setattr(self, feature, 'expected')
# created needs to be a datetime
self.created = datetime.datetime(2013, 10, 25, 11, 42, 35)
# set 'status' and 'task_message' attrs
success, task_message = completion()
if success:
self.status = "Complete"
else:
self.status = "Incomplete"
self.task_message = task_message
# Set 'task_output' attr, which will be parsed to the 'duration_sec' attr.
self.task_output = '{"duration_ms": 1035000}'
self.duration_sec = 1035000 / 1000.0
def make_invalid_output(self):
"""Munge task_output to be invalid json"""
self.task_output = 'HI MY NAME IS INVALID JSON'
# This should be given the value of 'unknown' if the task output
# can't be properly parsed
self.duration_sec = 'unknown'
def to_dict(self):
""" Convert fake task to dictionary representation. """
attr_dict = {key: getattr(self, key) for key in self.FEATURES}
attr_dict['created'] = attr_dict['created'].isoformat()
return attr_dict
def setUp(self):
self.course = CourseFactory.create()
self.instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=self.instructor.username, password='test')
self.student = UserFactory()
CourseEnrollment.enroll(self.student, self.course.id)
self.problem_location = msk_from_problem_urlname(
self.course.id,
'robot-some-problem-urlname'
)
self.problem_urlname = self.problem_location.to_deprecated_string()
self.module = StudentModule.objects.create(
student=self.student,
course_id=self.course.id,
module_state_key=self.problem_location,
state=json.dumps({'attempts': 10}),
)
mock_factory = MockCompletionInfo()
self.tasks = [self.FakeTask(mock_factory.mock_get_task_completion_info) for _ in xrange(7)]
self.tasks[-1].make_invalid_output()
def tearDown(self):
"""
Undo all patches.
"""
patch.stopall()
@patch.object(instructor_task.api, 'get_running_instructor_tasks')
def test_list_instructor_tasks_running(self, act):
""" Test list of all running tasks. """
act.return_value = self.tasks
url = reverse('list_instructor_tasks', kwargs={'course_id': self.course.id.to_deprecated_string()})
mock_factory = MockCompletionInfo()
with patch('instructor.views.instructor_task_helpers.get_task_completion_info') as mock_completion_info:
mock_completion_info.side_effect = mock_factory.mock_get_task_completion_info
response = self.client.get(url, {})
self.assertEqual(response.status_code, 200)
# check response
self.assertTrue(act.called)
expected_tasks = [ftask.to_dict() for ftask in self.tasks]
actual_tasks = json.loads(response.content)['tasks']
for exp_task, act_task in zip(expected_tasks, actual_tasks):
self.assertDictEqual(exp_task, act_task)
self.assertEqual(actual_tasks, expected_tasks)
@patch.object(instructor_task.api, 'get_instructor_task_history')
def test_list_background_email_tasks(self, act):
"""Test list of background email tasks."""
act.return_value = self.tasks
url = reverse('list_background_email_tasks', kwargs={'course_id': self.course.id.to_deprecated_string()})
mock_factory = MockCompletionInfo()
with patch('instructor.views.instructor_task_helpers.get_task_completion_info') as mock_completion_info:
mock_completion_info.side_effect = mock_factory.mock_get_task_completion_info
response = self.client.get(url, {})
self.assertEqual(response.status_code, 200)
# check response
self.assertTrue(act.called)
expected_tasks = [ftask.to_dict() for ftask in self.tasks]
actual_tasks = json.loads(response.content)['tasks']
for exp_task, act_task in zip(expected_tasks, actual_tasks):
self.assertDictEqual(exp_task, act_task)
self.assertEqual(actual_tasks, expected_tasks)
@patch.object(instructor_task.api, 'get_instructor_task_history')
def test_list_instructor_tasks_problem(self, act):
""" Test list task history for problem. """
act.return_value = self.tasks
url = reverse('list_instructor_tasks', kwargs={'course_id': self.course.id.to_deprecated_string()})
mock_factory = MockCompletionInfo()
with patch('instructor.views.instructor_task_helpers.get_task_completion_info') as mock_completion_info:
mock_completion_info.side_effect = mock_factory.mock_get_task_completion_info
response = self.client.get(url, {
'problem_location_str': self.problem_urlname,
})
self.assertEqual(response.status_code, 200)
# check response
self.assertTrue(act.called)
expected_tasks = [ftask.to_dict() for ftask in self.tasks]
actual_tasks = json.loads(response.content)['tasks']
for exp_task, act_task in zip(expected_tasks, actual_tasks):
self.assertDictEqual(exp_task, act_task)
self.assertEqual(actual_tasks, expected_tasks)
@patch.object(instructor_task.api, 'get_instructor_task_history')
def test_list_instructor_tasks_problem_student(self, act):
""" Test list task history for problem AND student. """
act.return_value = self.tasks
url = reverse('list_instructor_tasks', kwargs={'course_id': self.course.id.to_deprecated_string()})
mock_factory = MockCompletionInfo()
with patch('instructor.views.instructor_task_helpers.get_task_completion_info') as mock_completion_info:
mock_completion_info.side_effect = mock_factory.mock_get_task_completion_info
response = self.client.get(url, {
'problem_location_str': self.problem_urlname,
'unique_student_identifier': self.student.email,
})
self.assertEqual(response.status_code, 200)
# check response
self.assertTrue(act.called)
expected_tasks = [ftask.to_dict() for ftask in self.tasks]
actual_tasks = json.loads(response.content)['tasks']
for exp_task, act_task in zip(expected_tasks, actual_tasks):
self.assertDictEqual(exp_task, act_task)
self.assertEqual(actual_tasks, expected_tasks)
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
@patch.object(instructor_task.api, 'get_instructor_task_history')
class TestInstructorEmailContentList(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Test the instructor email content history endpoint.
"""
def setUp(self):
self.course = CourseFactory.create()
self.instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=self.instructor.username, password='test')
self.tasks = {}
self.emails = {}
self.emails_info = {}
def tearDown(self):
"""
Undo all patches.
"""
patch.stopall()
def setup_fake_email_info(self, num_emails, with_failures=False):
""" Initialize the specified number of fake emails """
for email_id in range(num_emails):
num_sent = random.randint(1, 15401)
if with_failures:
failed = random.randint(1, 15401)
else:
failed = 0
self.tasks[email_id] = FakeContentTask(email_id, num_sent, failed, 'expected')
self.emails[email_id] = FakeEmail(email_id)
self.emails_info[email_id] = FakeEmailInfo(self.emails[email_id], num_sent, failed)
def get_matching_mock_email(self, **kwargs):
""" Returns the matching mock emails for the given id """
email_id = kwargs.get('id', 0)
return self.emails[email_id]
def get_email_content_response(self, num_emails, task_history_request, with_failures=False):
""" Calls the list_email_content endpoint and returns the repsonse """
self.setup_fake_email_info(num_emails, with_failures)
task_history_request.return_value = self.tasks.values()
url = reverse('list_email_content', kwargs={'course_id': self.course.id.to_deprecated_string()})
with patch('instructor.views.api.CourseEmail.objects.get') as mock_email_info:
mock_email_info.side_effect = self.get_matching_mock_email
response = self.client.get(url, {})
self.assertEqual(response.status_code, 200)
return response
def check_emails_sent(self, num_emails, task_history_request, with_failures=False):
""" Tests sending emails with or without failures """
response = self.get_email_content_response(num_emails, task_history_request, with_failures)
self.assertTrue(task_history_request.called)
expected_email_info = [email_info.to_dict() for email_info in self.emails_info.values()]
actual_email_info = json.loads(response.content)['emails']
self.assertEqual(len(actual_email_info), num_emails)
for exp_email, act_email in zip(expected_email_info, actual_email_info):
self.assertDictEqual(exp_email, act_email)
self.assertEqual(expected_email_info, actual_email_info)
def test_content_list_one_email(self, task_history_request):
""" Test listing of bulk emails when email list has one email """
response = self.get_email_content_response(1, task_history_request)
self.assertTrue(task_history_request.called)
email_info = json.loads(response.content)['emails']
# Emails list should have one email
self.assertEqual(len(email_info), 1)
# Email content should be what's expected
expected_message = self.emails[0].html_message
returned_email_info = email_info[0]
received_message = returned_email_info[u'email'][u'html_message']
self.assertEqual(expected_message, received_message)
def test_content_list_no_emails(self, task_history_request):
""" Test listing of bulk emails when email list empty """
response = self.get_email_content_response(0, task_history_request)
self.assertTrue(task_history_request.called)
email_info = json.loads(response.content)['emails']
# Emails list should be empty
self.assertEqual(len(email_info), 0)
def test_content_list_email_content_many(self, task_history_request):
""" Test listing of bulk emails sent large amount of emails """
self.check_emails_sent(50, task_history_request)
def test_list_email_content_error(self, task_history_request):
""" Test handling of error retrieving email """
invalid_task = FakeContentTask(0, 0, 0, 'test')
invalid_task.make_invalid_input()
task_history_request.return_value = [invalid_task]
url = reverse('list_email_content', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {})
self.assertEqual(response.status_code, 200)
self.assertTrue(task_history_request.called)
returned_email_info = json.loads(response.content)['emails']
self.assertEqual(len(returned_email_info), 1)
returned_info = returned_email_info[0]
for info in ['created', 'sent_to', 'email', 'number_sent', 'requester']:
self.assertEqual(returned_info[info], None)
def test_list_email_with_failure(self, task_history_request):
""" Test the handling of email task that had failures """
self.check_emails_sent(1, task_history_request, True)
def test_list_many_emails_with_failures(self, task_history_request):
""" Test the handling of many emails with failures """
self.check_emails_sent(50, task_history_request, True)
def test_list_email_with_no_successes(self, task_history_request):
task_info = FakeContentTask(0, 0, 10, 'expected')
email = FakeEmail(0)
email_info = FakeEmailInfo(email, 0, 10)
task_history_request.return_value = [task_info]
url = reverse('list_email_content', kwargs={'course_id': self.course.id.to_deprecated_string()})
with patch('instructor.views.api.CourseEmail.objects.get') as mock_email_info:
mock_email_info.return_value = email
response = self.client.get(url, {})
self.assertEqual(response.status_code, 200)
self.assertTrue(task_history_request.called)
returned_info_list = json.loads(response.content)['emails']
self.assertEqual(len(returned_info_list), 1)
returned_info = returned_info_list[0]
expected_info = email_info.to_dict()
self.assertDictEqual(expected_info, returned_info)
@ddt.ddt
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
@override_settings(ANALYTICS_SERVER_URL="http://robotanalyticsserver.netbot:900/")
@override_settings(ANALYTICS_API_KEY="robot_api_key")
class TestInstructorAPIAnalyticsProxy(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Test instructor analytics proxy endpoint.
"""
class FakeProxyResponse(object):
""" Fake successful requests response object. """
def __init__(self):
self.status_code = requests.status_codes.codes.OK
self.content = '{"test_content": "robot test content"}'
class FakeBadProxyResponse(object):
""" Fake strange-failed requests response object. """
def __init__(self):
self.status_code = 'notok.'
self.content = '{"test_content": "robot test content"}'
def setUp(self):
self.course = CourseFactory.create()
self.instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=self.instructor.username, password='test')
@ddt.data((ModuleStoreEnum.Type.mongo, False), (ModuleStoreEnum.Type.split, True))
@ddt.unpack
@patch.object(instructor.views.api.requests, 'get')
def test_analytics_proxy_url(self, store_type, assert_wo_encoding, act):
""" Test legacy analytics proxy url generation. """
with modulestore().default_store(store_type):
course = CourseFactory.create()
instructor_local = InstructorFactory(course_key=course.id)
self.client.login(username=instructor_local.username, password='test')
act.return_value = self.FakeProxyResponse()
url = reverse('proxy_legacy_analytics', kwargs={'course_id': course.id.to_deprecated_string()})
response = self.client.get(url, {
'aname': 'ProblemGradeDistribution'
})
self.assertEqual(response.status_code, 200)
# Make request URL pattern - everything but course id.
url_pattern = "{url}get?aname={aname}&course_id={course_id}&apikey={api_key}".format(
url="http://robotanalyticsserver.netbot:900/",
aname="ProblemGradeDistribution",
course_id="{course_id!s}",
api_key="robot_api_key",
)
if assert_wo_encoding:
# Format url with no URL-encoding of parameters.
assert_url = url_pattern.format(course_id=course.id.to_deprecated_string())
with self.assertRaises(AssertionError):
act.assert_called_once_with(assert_url)
# Format url *with* URL-encoding of parameters.
expected_url = url_pattern.format(course_id=quote(course.id.to_deprecated_string()))
act.assert_called_once_with(expected_url)
@override_settings(ANALYTICS_SERVER_URL="")
@patch.object(instructor.views.api.requests, 'get')
def test_analytics_proxy_server_url(self, act):
"""
Test legacy analytics when empty server url.
"""
act.return_value = self.FakeProxyResponse()
url = reverse('proxy_legacy_analytics', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'aname': 'ProblemGradeDistribution'
})
self.assertEqual(response.status_code, 501)
@override_settings(ANALYTICS_API_KEY="")
@patch.object(instructor.views.api.requests, 'get')
def test_analytics_proxy_api_key(self, act):
"""
Test legacy analytics when empty server API key.
"""
act.return_value = self.FakeProxyResponse()
url = reverse('proxy_legacy_analytics', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'aname': 'ProblemGradeDistribution'
})
self.assertEqual(response.status_code, 501)
@override_settings(ANALYTICS_SERVER_URL="")
@override_settings(ANALYTICS_API_KEY="")
@patch.object(instructor.views.api.requests, 'get')
def test_analytics_proxy_empty_url_and_api_key(self, act):
"""
Test legacy analytics when empty server url & API key.
"""
act.return_value = self.FakeProxyResponse()
url = reverse('proxy_legacy_analytics', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'aname': 'ProblemGradeDistribution'
})
self.assertEqual(response.status_code, 501)
@patch.object(instructor.views.api.requests, 'get')
def test_analytics_proxy(self, act):
"""
Test legacy analytics content proxyin, actg.
"""
act.return_value = self.FakeProxyResponse()
url = reverse('proxy_legacy_analytics', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'aname': 'ProblemGradeDistribution'
})
self.assertEqual(response.status_code, 200)
# check response
self.assertTrue(act.called)
expected_res = {'test_content': "robot test content"}
self.assertEqual(json.loads(response.content), expected_res)
@patch.object(instructor.views.api.requests, 'get')
def test_analytics_proxy_reqfailed(self, act):
""" Test proxy when server reponds with failure. """
act.return_value = self.FakeBadProxyResponse()
url = reverse('proxy_legacy_analytics', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'aname': 'ProblemGradeDistribution'
})
self.assertEqual(response.status_code, 500)
@patch.object(instructor.views.api.requests, 'get')
def test_analytics_proxy_missing_param(self, act):
""" Test proxy when missing the aname query parameter. """
act.return_value = self.FakeProxyResponse()
url = reverse('proxy_legacy_analytics', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {})
self.assertEqual(response.status_code, 400)
self.assertFalse(act.called)
class TestInstructorAPIHelpers(TestCase):
""" Test helpers for instructor.api """
def test_split_input_list(self):
strings = []
lists = []
strings.append(
"Lorem@ipsum.dolor, sit@amet.consectetur\nadipiscing@elit.Aenean\r convallis@at.lacus\r, ut@lacinia.Sed")
lists.append(['Lorem@ipsum.dolor', 'sit@amet.consectetur', 'adipiscing@elit.Aenean', 'convallis@at.lacus',
'ut@lacinia.Sed'])
for (stng, lst) in zip(strings, lists):
self.assertEqual(_split_input_list(stng), lst)
def test_split_input_list_unicode(self):
self.assertEqual(_split_input_list('robot@robot.edu, robot2@robot.edu'),
['robot@robot.edu', 'robot2@robot.edu'])
self.assertEqual(_split_input_list(u'robot@robot.edu, robot2@robot.edu'),
['robot@robot.edu', 'robot2@robot.edu'])
self.assertEqual(_split_input_list(u'robot@robot.edu, robot2@robot.edu'),
[u'robot@robot.edu', 'robot2@robot.edu'])
scary_unistuff = unichr(40960) + u'abcd' + unichr(1972)
self.assertEqual(_split_input_list(scary_unistuff), [scary_unistuff])
def test_msk_from_problem_urlname(self):
course_id = SlashSeparatedCourseKey('MITx', '6.002x', '2013_Spring')
name = 'L2Node1'
output = 'i4x://MITx/6.002x/problem/L2Node1'
self.assertEqual(msk_from_problem_urlname(course_id, name).to_deprecated_string(), output)
@raises(ValueError)
def test_msk_from_problem_urlname_error(self):
args = ('notagoodcourse', 'L2Node1')
msk_from_problem_urlname(*args)
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
class TestDueDateExtensions(ModuleStoreTestCase, LoginEnrollmentTestCase):
"""
Test data dumps for reporting.
"""
def setUp(self):
"""
Fixtures.
"""
super(TestDueDateExtensions, self).setUp()
due = datetime.datetime(2010, 5, 12, 2, 42, tzinfo=utc)
course = CourseFactory.create()
week1 = ItemFactory.create(due=due)
week2 = ItemFactory.create(due=due)
week3 = ItemFactory.create() # No due date
course.children = [week1.location.to_deprecated_string(), week2.location.to_deprecated_string(),
week3.location.to_deprecated_string()]
homework = ItemFactory.create(
parent_location=week1.location,
due=due
)
week1.children = [homework.location.to_deprecated_string()]
user1 = UserFactory.create()
StudentModule(
state='{}',
student_id=user1.id,
course_id=course.id,
module_state_key=week1.location).save()
StudentModule(
state='{}',
student_id=user1.id,
course_id=course.id,
module_state_key=week2.location).save()
StudentModule(
state='{}',
student_id=user1.id,
course_id=course.id,
module_state_key=week3.location).save()
StudentModule(
state='{}',
student_id=user1.id,
course_id=course.id,
module_state_key=homework.location).save()
user2 = UserFactory.create()
StudentModule(
state='{}',
student_id=user2.id,
course_id=course.id,
module_state_key=week1.location).save()
StudentModule(
state='{}',
student_id=user2.id,
course_id=course.id,
module_state_key=homework.location).save()
user3 = UserFactory.create()
StudentModule(
state='{}',
student_id=user3.id,
course_id=course.id,
module_state_key=week1.location).save()
StudentModule(
state='{}',
student_id=user3.id,
course_id=course.id,
module_state_key=homework.location).save()
self.course = course
self.week1 = week1
self.homework = homework
self.week2 = week2
self.week3 = week3
self.user1 = user1
self.user2 = user2
self.instructor = InstructorFactory(course_key=course.id)
self.client.login(username=self.instructor.username, password='test')
def test_change_due_date(self):
url = reverse('change_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'student': self.user1.username,
'url': self.week1.location.to_deprecated_string(),
'due_datetime': '12/30/2013 00:00'
})
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(datetime.datetime(2013, 12, 30, 0, 0, tzinfo=utc),
get_extended_due(self.course, self.week1, self.user1))
def test_change_to_invalid_due_date(self):
url = reverse('change_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'student': self.user1.username,
'url': self.week1.location.to_deprecated_string(),
'due_datetime': '01/01/2009 00:00'
})
self.assertEqual(response.status_code, 400, response.content)
self.assertEqual(
None,
get_extended_due(self.course, self.week1, self.user1)
)
def test_change_nonexistent_due_date(self):
url = reverse('change_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'student': self.user1.username,
'url': self.week3.location.to_deprecated_string(),
'due_datetime': '12/30/2013 00:00'
})
self.assertEqual(response.status_code, 400, response.content)
self.assertEqual(
None,
get_extended_due(self.course, self.week3, self.user1)
)
def test_reset_date(self):
self.test_change_due_date()
url = reverse('reset_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'student': self.user1.username,
'url': self.week1.location.to_deprecated_string(),
})
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(
None,
get_extended_due(self.course, self.week1, self.user1)
)
def test_reset_nonexistent_extension(self):
url = reverse('reset_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'student': self.user1.username,
'url': self.week1.location.to_deprecated_string(),
})
self.assertEqual(response.status_code, 400, response.content)
def test_reset_extension_to_deleted_date(self):
"""
Test that we can delete a due date extension after deleting the normal
due date, without causing an error.
"""
self.test_change_due_date()
self.week1.due = None
self.week1 = self.store.update_item(self.week1, self.user1.id)
# Now, week1's normal due date is deleted but the extension still exists.
url = reverse('reset_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {
'student': self.user1.username,
'url': self.week1.location.to_deprecated_string(),
})
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(
None,
get_extended_due(self.course, self.week1, self.user1)
)
def test_show_unit_extensions(self):
self.test_change_due_date()
url = reverse('show_unit_extensions',
kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {'url': self.week1.location.to_deprecated_string()})
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(json.loads(response.content), {
u'data': [{u'Extended Due Date': u'2013-12-30 00:00',
u'Full Name': self.user1.profile.name,
u'Username': self.user1.username}],
u'header': [u'Username', u'Full Name', u'Extended Due Date'],
u'title': u'Users with due date extensions for %s' %
self.week1.display_name})
def test_show_student_extensions(self):
self.test_change_due_date()
url = reverse('show_student_extensions',
kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url, {'student': self.user1.username})
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(json.loads(response.content), {
u'data': [{u'Extended Due Date': u'2013-12-30 00:00',
u'Unit': self.week1.display_name}],
u'header': [u'Unit', u'Extended Due Date'],
u'title': u'Due date extensions for %s (%s)' % (
self.user1.profile.name, self.user1.username)})
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
@override_settings(REGISTRATION_CODE_LENGTH=8)
class TestCourseRegistrationCodes(ModuleStoreTestCase):
"""
Test data dumps for E-commerce Course Registration Codes.
"""
def setUp(self):
"""
Fixtures.
"""
self.course = CourseFactory.create()
self.instructor = InstructorFactory(course_key=self.course.id)
self.client.login(username=self.instructor.username, password='test')
url = reverse('generate_registration_codes',
kwargs={'course_id': self.course.id.to_deprecated_string()})
data = {
'total_registration_codes': 12, 'company_name': 'Test Group', 'company_contact_name': 'Test@company.com',
'company_contact_email': 'Test@company.com', 'sale_price': 122.45, 'recipient_name': 'Test123',
'recipient_email': 'test@123.com', 'address_line_1': 'Portland Street',
'address_line_2': '', 'address_line_3': '', 'city': '', 'state': '', 'zip': '', 'country': '',
'customer_reference_number': '123A23F', 'internal_reference': '', 'invoice': ''
}
response = self.client.post(url, data, **{'HTTP_HOST': 'localhost'})
self.assertEqual(response.status_code, 200, response.content)
for i in range(5):
order = Order(user=self.instructor, status='purchased')
order.save()
# Spent(used) Registration Codes
for i in range(5):
i += 1
registration_code_redemption = RegistrationCodeRedemption(
order_id=i, registration_code_id=i, redeemed_by=self.instructor
)
registration_code_redemption.save()
def test_user_invoice_copy_preference(self):
"""
Test to remember user invoice copy preference
"""
url_reg_code = reverse('generate_registration_codes',
kwargs={'course_id': self.course.id.to_deprecated_string()})
data = {
'total_registration_codes': 5, 'company_name': 'Group Alpha', 'company_contact_name': 'Test@company.com',
'company_contact_email': 'Test@company.com', 'sale_price': 121.45, 'recipient_name': 'Test123',
'recipient_email': 'test@123.com', 'address_line_1': 'Portland Street', 'address_line_2': '',
'address_line_3': '', 'city': '', 'state': '', 'zip': '', 'country': '',
'customer_reference_number': '123A23F', 'internal_reference': '', 'invoice': 'True'
}
# user invoice copy preference will be saved in api user preference; model
response = self.client.post(url_reg_code, data, **{'HTTP_HOST': 'localhost'})
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
# get user invoice copy preference.
url_user_invoice_preference = reverse('get_user_invoice_preference',
kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url_user_invoice_preference, data)
result = json.loads(response.content)
self.assertEqual(result['invoice_copy'], True)
# updating the user invoice copy preference during code generation flow
data['invoice'] = ''
response = self.client.post(url_reg_code, data, **{'HTTP_HOST': 'localhost'})
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
# get user invoice copy preference.
url_user_invoice_preference = reverse('get_user_invoice_preference',
kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.post(url_user_invoice_preference, data)
result = json.loads(response.content)
self.assertEqual(result['invoice_copy'], False)
def test_generate_course_registration_codes_csv(self):
"""
Test to generate a response of all the generated course registration codes
"""
url = reverse('generate_registration_codes',
kwargs={'course_id': self.course.id.to_deprecated_string()})
data = {
'total_registration_codes': 15, 'company_name': 'Group Alpha', 'company_contact_name': 'Test@company.com',
'company_contact_email': 'Test@company.com', 'sale_price': 122.45, 'recipient_name': 'Test123',
'recipient_email': 'test@123.com', 'address_line_1': 'Portland Street', 'address_line_2': '',
'address_line_3': '', 'city': '', 'state': '', 'zip': '', 'country': '',
'customer_reference_number': '123A23F', 'internal_reference': '', 'invoice': ''
}
response = self.client.post(url, data, **{'HTTP_HOST': 'localhost'})
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(EXPECTED_CSV_HEADER))
self.assertEqual(len(body.split('\n')), 17)
@patch.object(instructor.views.api, 'random_code_generator',
Mock(side_effect=['first', 'second', 'third', 'fourth']))
def test_generate_course_registration_codes_matching_existing_coupon_code(self):
"""
Test the generated course registration code is already in the Coupon Table
"""
url = reverse('generate_registration_codes',
kwargs={'course_id': self.course.id.to_deprecated_string()})
coupon = Coupon(code='first', course_id=self.course.id.to_deprecated_string(), created_by=self.instructor)
coupon.save()
data = {
'total_registration_codes': 3, 'company_name': 'Group Alpha', 'company_contact_name': 'Test@company.com',
'company_contact_email': 'Test@company.com', 'sale_price': 122.45, 'recipient_name': 'Test123',
'recipient_email': 'test@123.com', 'address_line_1': 'Portland Street', 'address_line_2': '',
'address_line_3': '', 'city': '', 'state': '', 'zip': '', 'country': '',
'customer_reference_number': '123A23F', 'internal_reference': '', 'invoice': ''
}
response = self.client.post(url, data, **{'HTTP_HOST': 'localhost'})
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(EXPECTED_CSV_HEADER))
self.assertEqual(len(body.split('\n')), 5) # 1 for headers, 1 for new line at the end and 3 for the actual data
@patch.object(instructor.views.api, 'random_code_generator',
Mock(side_effect=['first', 'first', 'second', 'third']))
def test_generate_course_registration_codes_integrity_error(self):
"""
Test for the Integrity error against the generated code
"""
url = reverse('generate_registration_codes',
kwargs={'course_id': self.course.id.to_deprecated_string()})
data = {
'total_registration_codes': 2, 'company_name': 'Test Group', 'company_contact_name': 'Test@company.com',
'company_contact_email': 'Test@company.com', 'sale_price': 122.45, 'recipient_name': 'Test123',
'recipient_email': 'test@123.com', 'address_line_1': 'Portland Street', 'address_line_2': '',
'address_line_3': '', 'city': '', 'state': '', 'zip': '', 'country': '',
'customer_reference_number': '123A23F', 'internal_reference': '', 'invoice': ''
}
response = self.client.post(url, data, **{'HTTP_HOST': 'localhost'})
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(EXPECTED_CSV_HEADER))
self.assertEqual(len(body.split('\n')), 4)
def test_spent_course_registration_codes_csv(self):
"""
Test to generate a response of all the spent course registration codes
"""
url = reverse('spent_registration_codes',
kwargs={'course_id': self.course.id.to_deprecated_string()})
data = {'spent_company_name': ''}
response = self.client.post(url, data)
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(EXPECTED_CSV_HEADER))
self.assertEqual(len(body.split('\n')), 7)
generate_code_url = reverse(
'generate_registration_codes', kwargs={'course_id': self.course.id.to_deprecated_string()}
)
data = {
'total_registration_codes': 9, 'company_name': 'Group Alpha', 'company_contact_name': 'Test@company.com',
'sale_price': 122.45, 'company_contact_email': 'Test@company.com', 'recipient_name': 'Test123',
'recipient_email': 'test@123.com', 'address_line_1': 'Portland Street', 'address_line_2': '',
'address_line_3': '', 'city': '', 'state': '', 'zip': '', 'country': '',
'customer_reference_number': '123A23F', 'internal_reference': '', 'invoice': ''
}
response = self.client.post(generate_code_url, data, **{'HTTP_HOST': 'localhost'})
self.assertEqual(response.status_code, 200, response.content)
for i in range(9):
order = Order(user=self.instructor, status='purchased')
order.save()
# Spent(used) Registration Codes
for i in range(9):
i += 13
registration_code_redemption = RegistrationCodeRedemption(
order_id=i, registration_code_id=i, redeemed_by=self.instructor
)
registration_code_redemption.save()
data = {'spent_company_name': 'Group Alpha'}
response = self.client.post(url, data)
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(EXPECTED_CSV_HEADER))
self.assertEqual(len(body.split('\n')), 11)
def test_active_course_registration_codes_csv(self):
"""
Test to generate a response of all the active course registration codes
"""
url = reverse('active_registration_codes',
kwargs={'course_id': self.course.id.to_deprecated_string()})
data = {'active_company_name': ''}
response = self.client.post(url, data)
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(EXPECTED_CSV_HEADER))
self.assertEqual(len(body.split('\n')), 9)
generate_code_url = reverse(
'generate_registration_codes', kwargs={'course_id': self.course.id.to_deprecated_string()}
)
data = {
'total_registration_codes': 9, 'company_name': 'Group Alpha', 'company_contact_name': 'Test@company.com',
'company_contact_email': 'Test@company.com', 'sale_price': 122.45, 'recipient_name': 'Test123',
'recipient_email': 'test@123.com', 'address_line_1': 'Portland Street', 'address_line_2': '',
'address_line_3': '', 'city': '', 'state': '', 'zip': '', 'country': '',
'customer_reference_number': '123A23F', 'internal_reference': '', 'invoice': ''
}
response = self.client.post(generate_code_url, data, **{'HTTP_HOST': 'localhost'})
self.assertEqual(response.status_code, 200, response.content)
data = {'active_company_name': 'Group Alpha'}
response = self.client.post(url, data)
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(EXPECTED_CSV_HEADER))
self.assertEqual(len(body.split('\n')), 11)
def test_get_all_course_registration_codes_csv(self):
"""
Test to generate a response of all the course registration codes
"""
url = reverse(
'get_registration_codes', kwargs={'course_id': self.course.id.to_deprecated_string()}
)
data = {'download_company_name': ''}
response = self.client.post(url, data)
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(EXPECTED_CSV_HEADER))
self.assertEqual(len(body.split('\n')), 14)
generate_code_url = reverse(
'generate_registration_codes', kwargs={'course_id': self.course.id.to_deprecated_string()}
)
data = {
'total_registration_codes': 9, 'company_name': 'Group Alpha', 'company_contact_name': 'Test@company.com',
'company_contact_email': 'Test@company.com', 'sale_price': 122.45, 'recipient_name': 'Test123',
'recipient_email': 'test@123.com', 'address_line_1': 'Portland Street', 'address_line_2': '',
'address_line_3': '', 'city': '', 'state': '', 'zip': '', 'country': '',
'customer_reference_number': '123A23F', 'internal_reference': '', 'invoice': ''
}
response = self.client.post(generate_code_url, data, **{'HTTP_HOST': 'localhost'})
self.assertEqual(response.status_code, 200, response.content)
data = {'download_company_name': 'Group Alpha'}
response = self.client.post(url, data)
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(EXPECTED_CSV_HEADER))
self.assertEqual(len(body.split('\n')), 11)
def test_get_codes_with_sale_invoice(self):
"""
Test to generate a response of all the course registration codes
"""
generate_code_url = reverse(
'generate_registration_codes', kwargs={'course_id': self.course.id.to_deprecated_string()}
)
data = {
'total_registration_codes': 5.5, 'company_name': 'Group Invoice', 'company_contact_name': 'Test@company.com',
'company_contact_email': 'Test@company.com', 'sale_price': 122.45, 'recipient_name': 'Test123',
'recipient_email': 'test@123.com', 'address_line_1': 'Portland Street', 'address_line_2': '',
'address_line_3': '', 'city': '', 'state': '', 'zip': '', 'country': '',
'customer_reference_number': '123A23F', 'internal_reference': '', 'invoice': True
}
response = self.client.post(generate_code_url, data, **{'HTTP_HOST': 'localhost'})
self.assertEqual(response.status_code, 200, response.content)
url = reverse('get_registration_codes',
kwargs={'course_id': self.course.id.to_deprecated_string()})
data = {'download_company_name': 'Group Invoice'}
response = self.client.post(url, data)
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(EXPECTED_CSV_HEADER))
def test_get_historical_coupon_codes(self):
"""
Test to download a response of all the active coupon codes
"""
get_coupon_code_url = reverse(
'get_coupon_codes', kwargs={'course_id': self.course.id.to_deprecated_string()}
)
for i in range(10):
coupon = Coupon(
code='test_code{0}'.format(i), description='test_description', course_id=self.course.id,
percentage_discount='{0}'.format(i), created_by=self.instructor, is_active=True
)
coupon.save()
response = self.client.get(get_coupon_code_url)
self.assertEqual(response.status_code, 200, response.content)
self.assertEqual(response['Content-Type'], 'text/csv')
body = response.content.replace('\r', '')
self.assertTrue(body.startswith(EXPECTED_COUPON_CSV_HEADER))
|
dsajkl/reqiop
|
lms/djangoapps/instructor/tests/test_api.py
|
Python
|
agpl-3.0
| 148,904
|
[
"VisIt"
] |
5bc16524826fae070566ec08a73622e8f7472df08829faf1e76f5631fd992378
|
"""
refcounting
~~~~~~~~~~~
Reference count annotations for C API functions. Has the same
result as the sphinx.ext.refcounting extension but works for all
functions regardless of the signature, and the reference counting
information is written inline with the documentation instead of a
separate file.
Adds a new directive "refcounting". The directive has no content
and one required positional parameter:: "new" or "borrow".
Example:
.. cfunction:: json_t *json_object(void)
.. refcounting:: new
<description of the json_object function>
:copyright: Copyright 2009 Petri Lehtinen <petri@digip.org>
:license: MIT, see LICENSE for details.
"""
from docutils import nodes
class refcounting(nodes.emphasis): pass
def visit(self, node):
self.visit_emphasis(node)
def depart(self, node):
self.depart_emphasis(node)
def html_visit(self, node):
self.body.append(self.starttag(node, 'em', '', CLASS='refcount'))
def html_depart(self, node):
self.body.append('</em>')
def refcounting_directive(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
if arguments[0] == 'borrow':
text = 'Return value: Borrowed reference.'
elif arguments[0] == 'new':
text = 'Return value: New reference.'
else:
raise Error('Valid arguments: new, borrow')
return [refcounting(text, text)]
def setup(app):
app.add_node(refcounting,
html=(html_visit, html_depart),
latex=(visit, depart),
text=(visit, depart))
app.add_directive('refcounting', refcounting_directive, 0, (1, 0, 0))
|
glenn-edgar/lua_frame_work
|
user_libraries/avro-c/avro-c-1.4.1/jansson/doc/ext/refcounting.py
|
Python
|
mit
| 1,706
|
[
"VisIt"
] |
cab7013f55f173cddfffa0874ef06dea913dad33c849c41a2f5ba9e656c6007d
|
import logging
from future.utils import iteritems
import numpy as np
from scipy.ndimage import map_coordinates
import scipy.ndimage as ndimage
from scipy.interpolate import interp1d, LinearNDInterpolator
logger = logging.getLogger('opendrift') # using common logger
def expand_numpy_array(data):
if isinstance(data, np.ma.MaskedArray):
self.logger.warning('Converting masked array to numpy array before interpolating')
data = np.ma.filled(data, fill_value=np.nan)
if not np.isfinite(data).any():
self.logger.warning('Only NaNs, returning')
return
mask = ~np.isfinite(data)
data[mask] = np.finfo(np.float64).min
data[mask] = ndimage.morphology.grey_dilation(data, size=3)[mask]
data[data==np.finfo(np.float64).min] = np.nan
###########################
# 2D interpolator classes
###########################
class Nearest2DInterpolator():
def __init__(self, xgrid, ygrid, x, y):
self.x = x
self.y = y
self.xi = (x - xgrid.min())/(xgrid.max()-xgrid.min())*len(xgrid)
self.yi = (y - ygrid.min())/(ygrid.max()-ygrid.min())*len(ygrid)
self.xi = np.round(self.xi).astype(np.int)
self.yi = np.round(self.yi).astype(np.int)
self.xi[self.xi >= len(xgrid)] = len(xgrid)-1
self.yi[self.yi >= len(ygrid)] = len(ygrid)-1
def __call__(self, array2d):
return array2d[self.yi, self.xi]
class NDImage2DInterpolator():
def __init__(self, xgrid, ygrid, x, y):
self.x = x
self.y = y
self.xi = (x - xgrid.min())/(xgrid.max()-xgrid.min())*len(xgrid)
self.yi = (y - ygrid.min())/(ygrid.max()-ygrid.min())*len(ygrid)
def __call__(self, array2d):
try:
array2d = np.ma.array(array2d, mask=array2d.mask)
array2d[array2d.mask] = np.nan # Gives holes
except:
pass
return np.ma.masked_invalid(
map_coordinates(array2d, [self.yi, self.xi],
cval=np.nan, order=0))
class LinearND2DInterpolator():
logger = logging.getLogger('opendrift')
def __init__(self, xgrid, ygrid, x, y):
self.block_x, self.block_y = np.meshgrid(xgrid, ygrid)
self.block_x = self.block_x.ravel()
self.block_y = self.block_y.ravel()
self.x = x
self.y = y
def __call__(self, array2d):
array_ravel = array2d.ravel()
valid = np.isfinite(array_ravel)
#if isinstance(array2d.mask, np.ndarray):
# valid = ~array2d.ravel().mask
#elif array2d.mask == False:
# valid = np.ones(array_ravel.shape, dtype=bool)
#elif array2d.mask == True:
# valid = np.zeros(array_ravel.shape, dtype=bool)
if hasattr(self, 'interpolator'):
if not np.array_equal(valid, self.interpolator.valid):
self.logger.debug('Cannot reuse interpolator - validity of '
'array is different from original.')
if hasattr(self, 'interpolator') and (np.array_equal(
valid, self.interpolator.valid)):
# Reuse stored interpolator with new data
self.interpolator.values[:, 0] = \
(array_ravel[valid])
else:
# Make new interpolator for given x,y
self.interpolator = LinearNDInterpolator(
(self.block_y[valid],
self.block_x[valid]),
array_ravel[valid])
# Store valid array, to determine if can be used again
self.interpolator.valid = valid
# Call interpolator to avoid threading-problem:
# https://github.com/scipy/scipy/issues/8856
self.interpolator((0,0))
return self.interpolator(self.y, self.x)
class Linear2DInterpolator():
logger = logging.getLogger('opendrift')
def __init__(self, xgrid, ygrid, x, y):
self.x = x
self.y = y
self.xi = (x - xgrid.min())/(xgrid.max()-xgrid.min())*len(xgrid)
self.yi = (y - ygrid.min())/(ygrid.max()-ygrid.min())*len(ygrid)
def __call__(self, array2d):
if isinstance(array2d,np.ma.MaskedArray):
self.logger.debug('Converting masked array to numpy array for interpolation')
array2d = np.ma.filled(array2d, fill_value=np.nan)
if not np.isfinite(array2d).any():
self.logger.warning('Only NaNs input to linearNDFast - returning')
return np.nan*np.ones(len(self.xi))
# Fill NaN-values with nearby real values
interp = map_coordinates(array2d, [self.yi, self.xi],
cval=np.nan, order=1)
missing = np.where(~np.isfinite(interp))[0]
i=0
while len(missing) > 0:
i += 1
if i > 10:
self.logger.warning('Still NaN-values after 10 iterations, exiting!')
return interp
self.logger.debug('NaN values for %i elements, expanding data %i' %
(len(missing), i))
expand_numpy_array(array2d)
interp[missing] = map_coordinates(
array2d, [self.yi[missing], self.xi[missing]],
cval=np.nan, order=1, mode='nearest')
missing = np.where(~np.isfinite(interp))[0]
return interp
horizontal_interpolation_methods = {
'nearest': Nearest2DInterpolator,
'ndimage': NDImage2DInterpolator,
'linearND': LinearND2DInterpolator,
'linearNDFast': Linear2DInterpolator}
###########################
# 1D interpolator classes
###########################
class Nearest1DInterpolator():
def __init__(self, zgrid, z):
# Truncating above and below
z[z < zgrid.min()] = zgrid.min()
z[z > zgrid.max()] = zgrid.max()
# Interpolator zgrid -> index
if zgrid[1] > zgrid[0]: # increasing
z_interpolator = interp1d(zgrid, range(len(zgrid)))
else: # decreasing values, must flip for interpolator
z_interpolator = interp1d(zgrid[::-1], range(len(zgrid))[::-1])
# Indices corresponding to nearest value in zgrid
self.zi = np.round(z_interpolator(z)).astype(np.int)
self.zi[self.zi < 0] = 0
self.zi[self.zi >= len(zgrid)] = len(zgrid) - 1
def __call__(self, array2d):
return array2d[self.zi, range(len(self.zi))]
class Linear1DInterpolator():
def __init__(self, zgrid, z):
# Truncating above and below
z[z < zgrid.min()] = zgrid.min()
z[z > zgrid.max()] = zgrid.max()
# Interpolator zgrid -> index
if zgrid[1] > zgrid[0]: # increasing
z_interpolator = interp1d(zgrid, range(len(zgrid)))
else: # decreasing values, must flip for interpolator
z_interpolator = interp1d(zgrid[::-1], range(len(zgrid))[::-1])
z_interpolator(z[0]) # to prevent threading issues
# Indices corresponding to layers above and below
interp_zi = z_interpolator(z)
self.index_above = np.floor(interp_zi).astype(np.int)
self.index_above[self.index_above < 0] = 0
self.index_below = np.minimum(self.index_above + 1, len(zgrid) - 1)
self.weight_above = 1 - (interp_zi - self.index_above)
self.xi = range(len(z))
def __call__(self, array2d):
return array2d[self.index_above, self.xi]*self.weight_above + \
array2d[self.index_below, self.xi]*(1 - self.weight_above)
vertical_interpolation_methods = {
'nearest': Nearest1DInterpolator,
'linear': Linear1DInterpolator}
def fill_NaN_towards_seafloor(array):
"""Extrapolate NaN-values (missing) towards seafloor"""
filled = False
for i in range(1, array.shape[0]):
mask = np.isnan(array[i,:,:])
if np.sum(mask) > 0:
array[i, mask] = array[i-1, mask]
filled = True
return filled
###########################
# ReaderBlock
###########################
class ReaderBlock():
"""Class to store and interpolate the output from a reader."""
logger = logging.getLogger('opendrift') # using common logger
def __init__(self, data_dict,
interpolation_horizontal='linearNDFast',
interpolation_vertical='linear'):
# Make pointers to data values, for convenience
self.x = data_dict['x']
self.y = data_dict['y']
self.time = data_dict['time']
self.data_dict = data_dict
del self.data_dict['x']
del self.data_dict['y']
del self.data_dict['time']
try:
self.z = data_dict['z']
del self.data_dict['z']
except:
self.z = None
# Mask any extremely large values, e.g. if missing netCDF _Fill_value
filled_variables = set()
for var in self.data_dict:
if isinstance(self.data_dict[var], np.ma.core.MaskedArray):
self.data_dict[var] = np.ma.masked_outside(
np.ma.masked_invalid(self.data_dict[var]), -1E+9, 1E+9)
# Convert masked arrays to numpy arrays
self.data_dict[var] = np.ma.filled(self.data_dict[var],
fill_value=np.nan)
# Fill missing data towards seafloor if 3D
if isinstance(self.data_dict[var], (list,)):
self.logger.warning('Ensemble data currently not extrapolated towards seafloor')
elif self.data_dict[var].ndim == 3:
filled = fill_NaN_towards_seafloor(self.data_dict[var])
if filled is True:
filled_variables.add(var)
if len(filled_variables) > 0:
self.logger.debug('Filled NaN-values toward seafloor for :'
+ str(list(filled_variables)))
# Set 1D (vertical) and 2D (horizontal) interpolators
try:
self.Interpolator2DClass = \
horizontal_interpolation_methods[interpolation_horizontal]
except Exception:
raise NotImplementedError(
'Valid interpolation methods are: ' +
str(horizontal_interpolation_methods.keys()))
try:
self.Interpolator1DClass = \
vertical_interpolation_methods[interpolation_vertical]
except Exception:
raise NotImplementedError(
'Valid interpolation methods are: ' +
str(vertical_interpolation_methods.keys()))
if 'land_binary_mask' in self.data_dict.keys() and \
interpolation_horizontal != 'nearest':
self.logger.debug('Nearest interpolation will be used '
'for landmask, and %s for other variables'
% interpolation_horizontal)
def _initialize_interpolator(self, x, y, z=None):
self.logger.debug('Initialising interpolator.')
self.interpolator2d = self.Interpolator2DClass(self.x, self.y, x, y)
if self.z is not None and len(np.atleast_1d(self.z)) > 1:
self.interpolator1d = self.Interpolator1DClass(self.z, z)
def interpolate(self, x, y, z=None, variables=None,
profiles=[], profiles_depth=None):
self._initialize_interpolator(x, y, z)
env_dict = {}
if profiles is not []:
profiles_dict = {'z': self.z}
for varname, data in iteritems(self.data_dict):
nearest = False
if varname == 'land_binary_mask':
nearest = True
self.interpolator2d_nearest = Nearest2DInterpolator(self.x, self.y, x, y)
if type(data) is list:
num_ensembles = len(data)
self.logger.debug('Interpolating %i ensembles for %s' % (num_ensembles, varname))
if data[0].ndim == 2:
horizontal = np.zeros(x.shape)*np.nan
else:
horizontal = np.zeros((len(self.z), len(x)))*np.nan
ensemble_number = np.remainder(range(len(x)), num_ensembles)
for en in range(num_ensembles):
elnum = ensemble_number == en
int_full = self._interpolate_horizontal_layers(data[en], nearest=nearest)
if int_full.ndim == 1:
horizontal[elnum] = int_full[elnum]
else:
horizontal[:, elnum] = int_full[:, elnum]
else:
horizontal = self._interpolate_horizontal_layers(data, nearest=nearest)
if profiles is not None and varname in profiles:
profiles_dict[varname] = horizontal
if horizontal.ndim > 1:
env_dict[varname] = self.interpolator1d(horizontal)
else:
env_dict[varname] = horizontal
if 'z' in profiles_dict:
profiles_dict['z'] = np.atleast_1d(profiles_dict['z'])
return env_dict, profiles_dict
def _interpolate_horizontal_layers(self, data, nearest=False):
'''Interpolate all layers of 3d (or 2d) array.'''
if nearest is True:
interpolator2d = self.interpolator2d_nearest
else:
interpolator2d = self.interpolator2d
if data.ndim == 2:
return interpolator2d(data)
if data.ndim == 3:
num_layers = data.shape[0]
# Allocate output array
result = np.ma.empty((num_layers, len(interpolator2d.x)))
for layer in range(num_layers):
result[layer, :] = self.interpolator2d(data[layer, :, :])
return result
def covers_positions(self, x, y, z=None):
'''Check if given positions are covered by this reader block.'''
indices = np.where((x >= self.x.min()) & (x <= self.x.max()) &
(y >= self.y.min()) & (y <= self.y.max()))[0]
if len(indices) == len(x):
return True
else:
return False
|
knutfrode/opendrift
|
opendrift/readers/interpolation.py
|
Python
|
gpl-2.0
| 14,062
|
[
"NetCDF"
] |
d7a0c27351e9323dedc244cde6520cd37f2343984f5b04a49dfbe048f6bbea5d
|
""" Find features in image """
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
from numpy.testing import assert_allclose
import skimage
try:
from skimage.filters import threshold_otsu
except ImportError:
from skimage.filter import threshold_otsu # skimage <= 0.10
try:
from skimage.feature import canny
except ImportError:
from skimage.filter import canny # skimage <= 0.10
from skimage.measure import find_contours
from skimage.transform import hough_circle
from skimage.feature import peak_local_max
import pandas as pd
from scipy.spatial import cKDTree
from .algebraic import fit_ellipse
def find_disks(image, size_range, number_of_disks=100):
""" Locate blobs in the image by using a Laplacian of Gaussian method """
number_of_disks = int(np.round(number_of_disks))
# Take a maximum of 30 intermediate steps
step = max(int(round(abs(size_range[1] - size_range[0]) / 30)), 1)
radii = np.arange(size_range[0], size_range[1], step=step, dtype=np.intp)
# Find edges
edges = canny(image)
circles = hough_circle(edges, radii)
fit = []
for radius, circle in zip(radii, circles):
peaks = peak_local_max(circle, threshold_rel=0.5,
num_peaks=number_of_disks)
accumulator = circle[peaks[:, 0], peaks[:, 1]]
fit.append(pd.DataFrame(dict(r=[radius] * peaks.shape[0],
y=peaks[:, 0],
x=peaks[:, 1],
accum=accumulator)))
fit = pd.concat(fit, ignore_index=True)
fit = merge_hough_same_values(fit, number_of_disks)
return fit
def find_ellipse(image, mode='ellipse_aligned', min_length=24):
""" Thresholds the image, finds the longest contour and fits an ellipse
to this contour.
Parameters
----------
image : 2D numpy array of numbers
mode : {'ellipse', 'ellipse_aligned', 'circle'}
min_length : number
minimum length of contour
Returns
-------
yr, xr, yc, xc when dimension order was y, x (common)
xr, yr, xc, yc when dimension order was x, y
"""
assert image.ndim == 2
thresh = threshold_otsu(image)
binary = image > thresh
contours = find_contours(binary, 0.5, fully_connected='high')
if len(contours) == 0:
raise ValueError('No contours found')
# eliminate short contours
contours = [c for c in contours if len(c) >= min_length]
# fit circles to the rest, keep the one with lowest residual deviation
result = [np.nan] * 4
residual = None
for c in contours:
try:
(xr, yr), (xc, yc), _ = fit_ellipse(c.T, mode=mode)
if np.any(np.isnan([xr, yr, xc, yc])):
continue
x, y = c.T
r = np.sum((((xc - x)/xr)**2 + ((yc - y)/yr)**2 - 1)**2)/len(c)
if residual is None or r < residual:
result = xr, yr, xc, yc
residual = r
except np.linalg.LinAlgError:
pass
return result
def find_ellipsoid(image3d, center_atol=None):
""" Finds ellipses in all three projections of the 3D image and returns
center coordinates and priciple radii.
The function uses the YX projection for the yr, xr, yc, xc and the ZX
projection for zr, xc. The ZY projection can be used for sanity checking
the found center.
Parameters
----------
image3d : 3D numpy array of numbers
center_atol : float, optional
the maximum absolute tolerance for the difference between the found
centers, Default None
Returns
-------
zr, yr, xr, zc, yc, xc
"""
assert image3d.ndim == 3
# Y, X projection, use y radius because resonant scanning in x direction.
image = np.mean(image3d, axis=0)
yr, xr, yc, xc = find_ellipse(image, mode='ellipse_aligned')
# Z, X projection
image = np.mean(image3d, axis=1)
zr, xr2, zc, xc2 = find_ellipse(image, mode='ellipse_aligned')
if center_atol is not None:
# Z, Y projection (noisy with resonant scanning)
image = np.mean(image3d, axis=2)
zr2, yr2, zc2, yc2 = find_ellipse(image, mode='ellipse_aligned')
assert_allclose([xc, yc, zc],
[xc2, yc2, zc2], rtol=0, atol=center_atol,
err_msg='Found centers have inconsistent values.')
return zr, yr, xr, zc, yc, xc
def merge_hough_same_values(data, number_to_keep=100):
while True:
# Rescale positions, so that pairs are identified below a distance
# of 1. Do so every iteration (room for improvement?)
positions = data[['x', 'y']].values
mass = data['accum'].values
duplicates = cKDTree(positions, 30).query_pairs(
np.mean(data['r']), p=2.0, eps=0.1)
if len(duplicates) == 0:
break
to_drop = []
for pair in duplicates:
# Drop the dimmer one.
if np.equal(*mass.take(pair, 0)):
# Rare corner case: a tie!
# Break ties by sorting by sum of coordinates, to avoid
# any randomness resulting from cKDTree returning a set.
dimmer = np.argsort(np.sum(positions.take(pair, 0), 1))[0]
else:
dimmer = np.argmin(mass.take(pair, 0))
to_drop.append(pair[dimmer])
data.drop(to_drop, inplace=True)
# Keep only brightest n circles
try:
data = data.sort_values(by=['accum'], ascending=False)
except AttributeError:
data = data.sort(columns=['accum'], ascending=False)
data = data.head(number_to_keep)
return data
|
rbnvrw/circletracking
|
circletracking/find.py
|
Python
|
bsd-3-clause
| 5,757
|
[
"Gaussian"
] |
21da9763d1a654a06e363e613a769f08f5942cb0da82e0bb8a3a9481c45b71e5
|
"""
primer finder for epride -
easy primer design for multiple sequence alignments
@author: manutamminen
"""
import os
import sys
import subprocess
import itertools
import igraph as ig
import leidenalg as la
from collections import defaultdict
from itertools import zip_longest
import pandas as pd
from . import io, utilities
def process_nsearch(file_name, primer_length):
"""
Blasts a query against a database using usearch blast.
:param file_name: str; name of the nsearch output file
:param primer_length: int; how long should the accepted hits be
:return: a defaultdict of length-filtered hits and their target ids
"""
with open(file_name) as file_handle:
next(file_handle)
targets = defaultdict(set)
for line in file_handle:
splitted = line.split(",")
match_len = int(splitted[3]) - int(splitted[2])
if match_len == (primer_length - 1):
target_id = splitted[1]
target_match_start = splitted[4]
target_match_seq = splitted[7]
target = '---'.join([target_id, target_match_start])
targets[target_match_seq].add(target)
return targets
def nsearch_seqs(query, db, id_val, primer_length, keep_aln=False):
"""
Blasts a query against a database using usearch blast.
:param query: fasta iterable
:param db: fasta iterable
:param id_val: int; how similar hits are accepted
:param primer_length: int; how long should the accepted hits be
:param keep_aln: boolean; keep the alignment file?
:return: a list of hit dictionaries
"""
with io.SavedFasta(query) as q, io.SavedFasta(db) as d:
random_id = io.generate_id()
query_len = str(len(db))
ns_path = sys.prefix
subprocess.call([
ns_path + "/nsearch", "search", "--query", q, "--db", d, "--min-identity",
str(id_val), "--max-hits", query_len, "--out", random_id + ".csv"
])
print("Parsing the alignment file...")
blastout = process_nsearch(random_id + ".csv", primer_length)
if not keep_aln:
os.remove(random_id + ".csv")
return blastout
def find_primers(seqs, id_val, primer_length=20, keep_aln=False):
"""
Utility function that wraps database construction, primer list construction, blast analysis
and hit dictionary into one function
:param seqs: fasta iterable
:param id_val: int; how similar hits are accepted
:param primer_length: int; length filtering criterion for primer candidates
:param keep_aln: boolean; keep the alignment file?
:return: a list of hit dictionaries
"""
seqs = list(io.read_fasta(seqs, remove_commas=True))
chopped_seqs = list(utilities.chop_sequences(seqs, primer_length))
print("Performing the kmer blast analysis...")
nsearch_results = nsearch_seqs(chopped_seqs, seqs, id_val, primer_length, keep_aln)
return nsearch_results
def pretty_print_clusters(coverage_obj):
"""
A helper function for visual representation of the coverage objects.
:param coverage_obj: object created by Cluster class
:return: str; A visual summary of the coverage object
"""
txt = [
"| Cluster | Cluster | Primers | Cluster ids{}|".format(10 * " "),
"|{}| size |{}|{}|".format((9 * " "), (9 * " "), (22 * " ")),
"|{}|{}|{}|{}|".format((9 * " "), (9 * " "), (9 * " "), (22 * " "))
]
for ix, row in coverage_obj.iterrows():
three_first = ", ".join(
[str(i)[:6] + ".." for i in list(row['Ids'])[:2]])
txt.append("| {:^7} | {:^7} | {:^7} | {:20} |".format(
row['Clust'], row['Id_count'], row['Primer_count'], three_first))
return txt
def process_clusters(primers):
"""
Finalize the primer and sequence cluster information embedded in the coverage object
:param primers: dict; keys: str; primers sequences; values: set; matching sequence ids and binding positions
:return: dict; keys: frozen set; matching sequence ids; values: frozen set; matching primer sequences
"""
hit_dictionary = defaultdict(set)
for seq, hit_set in primers.items():
hit_set = {i.split("---")[0] for i in hit_set}
hit_set = frozenset(hit_set)
hit_dictionary[hit_set].add(seq)
return hit_dictionary
def get_membership(primer_obj):
"""
Apply Leiden algorithm to cluster the graph and extract the sequence names within each cluster
:param primer object
:return: dict; keys: frozen set; matching sequence ids; values: integer; matching network cluster
"""
clus_keys = primer_obj.clusters.keys()
vertex_acc = set()
edge_acc = set()
for key in clus_keys:
if len(key) > 1:
for pair in itertools.combinations(key, 2):
edge_acc.add(pair)
for ind_id in key:
vertex_acc.add(ind_id)
g = ig.Graph()
g.add_vertices(list(vertex_acc))
g.add_edges(list(edge_acc))
part = la.find_partition(g, la.ModularityVertexPartition)
memb_dict = defaultdict(set)
for memb, seq_id in zip(part.membership, vertex_acc):
memb_dict[memb].add(seq_id)
other_dict = {}
for key, val in memb_dict.items():
other_dict[frozenset(val)] = key
return(other_dict)
def get_primer_clusters(primer_obj):
"""
Prepare a Pandas dataframe from the network cluster dictionary prepared by get_membership function
:param dict; keys: frozen set; matching sequence ids; values: integer; matching network clusters
:return: pandas DataFrame with columns
'Clust'; network cluster number;
'Id_count'; the number of sequence ids within each network cluster;
'Primer_count'; the number of primer candidates within each network cluster;
'Ids'; the sequence ids within each network cluster;
'Primers'; the primer candidates within each network cluster
"""
membs = get_membership(primer_obj)
acc = []
for ids, clust in membs.items():
primers = primer_obj.clusters[ids]
id_count = len(ids)
primer_count = len(primers)
acc.append([clust, id_count, primer_count, ids, primers])
primer_df = pd.DataFrame(
acc,
columns = [
'Clust',
'Id_count',
'Primer_count',
'Ids',
'Primers'])
return(primer_df.sort_values('Id_count', ascending=False))
class Primers(object):
def __init__(self,
file_name,
id_val,
primer_length=20,
keep_aln=False):
"""
Blasts a query against a database using usearch blast.
:param file_name: str; target file name
:param id_val: int; how similar hits are accepted
:param primer_length: int; how long should the accepted hits be
:param keep_aln: boolean; keep the alignment file?
"""
self.primers = find_primers(
seqs=file_name,
id_val=id_val,
primer_length=primer_length,
keep_aln=keep_aln)
self.clusters = process_clusters(self.primers)
self.coverage = get_primer_clusters(self)
print("Done finding primer candidates!")
def __getitem__(self, ix):
prims = self.coverage[self.coverage['Clust'] == ix]['Primers'].iloc[0]
fst_accession = self.coverage[self.coverage['Clust'] == ix]['Ids'].iloc[0]
fst_accession = sorted(fst_accession)[0]
acc = []
for prim in prims:
prim_loc_dict = dict(
[i.split("---") for i in self.primers[prim]])
prim_loc = prim_loc_dict[fst_accession]
acc.append([prim_loc, prim])
return acc
def __len__(self):
return len(self.coverage)
def __repr__(self):
clusters = pretty_print_clusters(self.coverage)
return "\n".join(clusters)
|
manutamminen/epride
|
epride/primer_finder.py
|
Python
|
mit
| 7,971
|
[
"BLAST"
] |
41dc689a2b05c821ca5935f050f62379d8c8f4cbfede5e142a8d28c2f16c66aa
|
"""
@author David W.H. Swenson
"""
from .test_helpers import data_filename, assert_close_unit, make_1d_traj, md
import pytest
from nose.plugins.skip import SkipTest
import openpathsampling.engines.openmm as peng
from openpathsampling.netcdfplus import FunctionPseudoAttribute
import openpathsampling as paths
import os
class TestFunctionPseudoAttribute(object):
def setup(self):
if not md:
raise SkipTest("mdtraj not installed")
self.mdtraj = md.load(data_filename("ala_small_traj.pdb"))
pytest.importorskip("simtk.unit")
self.traj_topology = peng.trajectory_from_mdtraj(self.mdtraj)
self.traj_simple = peng.trajectory_from_mdtraj(
self.mdtraj,
simple_topology=True)
self.topology = self.traj_topology[0].engine.topology
if os.path.isfile("myfile.nc"):
os.remove("myfile.nc")
def teardown(self):
if os.path.isfile("myfile.nc"):
os.remove("myfile.nc")
def test_pickle_external_attr(self):
template = make_1d_traj([0.0])[0]
attr = FunctionPseudoAttribute("x", paths.Trajectory, lambda x: x)
storage = paths.Storage("myfile.nc", "w", template)
storage.save(attr)
storage.close()
def test_storage_attribute_function(self):
import os
# test all combinations of (1) with and without UUIDs,
# (2) using partial yes, no all of these must work
for allow_incomplete in (True, False):
# print('ALLOW INCOMPLETE', allow_incomplete)
fname = data_filename("attr_storage_test.nc")
if os.path.isfile(fname):
os.remove(fname)
traj = paths.Trajectory(list(self.traj_simple))
template = traj[0]
storage_w = paths.Storage(fname, "w")
storage_w.snapshots.save(template)
storage_w.trajectories.save(traj)
# compute distance in x[0]
attr1 = FunctionPseudoAttribute(
'f1',
paths.Trajectory,
lambda x: x[0].coordinates[0] - x[-1].coordinates[0]
).with_diskcache(
allow_incomplete=allow_incomplete
)
storage_w.save(attr1)
# let's mess up the order in which we save and
# include reversed ones as well
storage_w.trajectories.save(traj[3:])
storage_w.snapshots.save(traj[1].reversed)
storage_w.trajectories.save(traj.reversed)
# this should be ignored for all is saved already
storage_w.trajectories.save(traj)
storage_w.close()
storage_r = paths.Storage(fname, 'r')
rattr1 = storage_r.attributes['f1']
assert(rattr1._store_dict)
attr_cache = rattr1._store_dict.value_store
assert (attr_cache.allow_incomplete == allow_incomplete)
for idx, traj in enumerate(storage_r.trajectories):
if not allow_incomplete or attr_cache[traj] is not None:
assert_close_unit(attr_cache[traj], attr1(traj))
storage_r.close()
if os.path.isfile(fname):
os.remove(fname)
def test_storage_sync_and_complete(self):
import os
# test all combinations of (1) with and without UUIDs,
# (2) using partial yes, no all of these must work
allow_incomplete = True
fname = data_filename("attr_storage_test.nc")
if os.path.isfile(fname):
os.remove(fname)
traj = paths.Trajectory(list(self.traj_simple))
template = traj[0]
storage_w = paths.Storage(fname, "w")
storage_w.snapshots.save(template)
storage_w.trajectories.save(traj)
# compute distance in x[0]
attr1 = FunctionPseudoAttribute(
'f1',
paths.Trajectory,
lambda x: x[0].coordinates[0] - x[-1].coordinates[0]
).with_diskcache(
allow_incomplete=allow_incomplete
)
storage_w.save(attr1)
store = storage_w.attributes.cache_store(attr1)
storage_w.trajectories.complete_attribute(attr1)
# check if stored values match computed ones
for idx, value in zip(
store.variables['index'][:],
store.vars['value']):
traj = storage_w.trajectories[
storage_w.trajectories.vars['uuid'][idx]]
assert_close_unit(attr1(traj), value)
storage_w.close()
if os.path.isfile(fname):
os.remove(fname)
def test_storage_sync(self):
import os
# test all combinations of (1) with and without UUIDs,
# (2) using partial yes; all of these must work
allow_incomplete = True
fname = data_filename("attr_storage_test.nc")
if os.path.isfile(fname):
os.remove(fname)
traj = paths.Trajectory(list(self.traj_simple))
template = traj[0]
storage_w = paths.Storage(fname, "w")
storage_w.snapshots.save(template)
storage_w.trajectories.save(traj)
# compute distance in x[0]
attr1 = FunctionPseudoAttribute(
'f1',
paths.Trajectory,
lambda x: x[0].coordinates[0] - x[-1].coordinates[0]
).with_diskcache(
allow_incomplete=allow_incomplete
)
storage_w.save(attr1)
store = storage_w.attributes.cache_store(attr1)
storage_w.trajectories.sync_attribute(attr1)
# fill the cache
_ = attr1(traj)
storage_w.trajectories.sync_attribute(attr1)
# should match the number of stored snapshots
# assert (len(store.vars['value']) == 6)
# save the rest
storage_w.trajectories.save(traj.reversed)
# assert (len(storage_w.snapshots) == 20)
# should still be unchanged
# assert (len(store.vars['value']) == 6)
# this should store the remaining attr values
storage_w.trajectories.sync_attribute(attr1)
# assert (len(store.vars['value']) == 10)
# check if the values match
for idx, value in zip(
store.variables['index'][:],
store.vars['value']):
snap = storage_w.trajectories[
storage_w.trajectories.vars['uuid'][idx]]
assert_close_unit(attr1(snap), value)
storage_w.close()
if os.path.isfile(fname):
os.remove(fname)
|
openpathsampling/openpathsampling
|
openpathsampling/tests/test_attribute.py
|
Python
|
mit
| 6,549
|
[
"MDTraj",
"OpenMM"
] |
9065ad90543a1f80b40402540405d62cbdce30c89309f0cf03ba62dca37415f5
|
# coding=utf-8
import os
import platform
import sys
from typing import Optional, Dict, Any, List
from dbt.events.functions import fire_event
from dbt.events.types import OpenCommand
from dbt import flags
import dbt.clients.system
import dbt.exceptions
from dbt.adapters.factory import get_adapter, register_adapter
from dbt.config import Project, Profile
from dbt.config.renderer import DbtProjectYamlRenderer, ProfileRenderer
from dbt.config.utils import parse_cli_vars
from dbt.clients.yaml_helper import load_yaml_text
from dbt.links import ProfileConfigDocs
from dbt.ui import green, red
from dbt.events.format import pluralize
from dbt.version import get_installed_version
from dbt.task.base import BaseTask, get_nearest_project_dir
PROFILE_DIR_MESSAGE = """To view your profiles.yml file, run:
{open_cmd} {profiles_dir}"""
ONLY_PROFILE_MESSAGE = '''
A `dbt_project.yml` file was not found in this directory.
Using the only profile `{}`.
'''.lstrip()
MULTIPLE_PROFILE_MESSAGE = '''
A `dbt_project.yml` file was not found in this directory.
dbt found the following profiles:
{}
To debug one of these profiles, run:
dbt debug --profile [profile-name]
'''.lstrip()
COULD_NOT_CONNECT_MESSAGE = '''
dbt was unable to connect to the specified database.
The database returned the following error:
>{err}
Check your database credentials and try again. For more information, visit:
{url}
'''.lstrip()
MISSING_PROFILE_MESSAGE = '''
dbt looked for a profiles.yml file in {path}, but did
not find one. For more information on configuring your profile, consult the
documentation:
{url}
'''.lstrip()
FILE_NOT_FOUND = 'file not found'
class QueryCommentedProfile(Profile):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.query_comment = None
class DebugTask(BaseTask):
def __init__(self, args, config):
super().__init__(args, config)
self.profiles_dir = flags.PROFILES_DIR
self.profile_path = os.path.join(self.profiles_dir, 'profiles.yml')
try:
self.project_dir = get_nearest_project_dir(self.args)
except dbt.exceptions.Exception:
# we probably couldn't find a project directory. Set project dir
# to whatever was given, or default to the current directory.
if args.project_dir:
self.project_dir = args.project_dir
else:
self.project_dir = os.getcwd()
self.project_path = os.path.join(self.project_dir, 'dbt_project.yml')
self.cli_vars = parse_cli_vars(getattr(self.args, 'vars', '{}'))
# set by _load_*
self.profile: Optional[Profile] = None
self.profile_fail_details = ''
self.raw_profile_data: Optional[Dict[str, Any]] = None
self.profile_name: Optional[str] = None
self.project: Optional[Project] = None
self.project_fail_details = ''
self.any_failure = False
self.messages: List[str] = []
@property
def project_profile(self):
if self.project is None:
return None
return self.project.profile_name
def path_info(self):
open_cmd = dbt.clients.system.open_dir_cmd()
fire_event(OpenCommand(open_cmd=open_cmd, profiles_dir=self.profiles_dir))
def run(self):
if self.args.config_dir:
self.path_info()
return not self.any_failure
version = get_installed_version().to_version_string(skip_matcher=True)
print('dbt version: {}'.format(version))
print('python version: {}'.format(sys.version.split()[0]))
print('python path: {}'.format(sys.executable))
print('os info: {}'.format(platform.platform()))
print('Using profiles.yml file at {}'.format(self.profile_path))
print('Using dbt_project.yml file at {}'.format(self.project_path))
print('')
self.test_configuration()
self.test_dependencies()
self.test_connection()
if self.any_failure:
print(red(f"{(pluralize(len(self.messages), 'check'))} failed:"))
else:
print(green('All checks passed!'))
for message in self.messages:
print(message)
print('')
return not self.any_failure
def interpret_results(self, results):
return results
def _load_project(self):
if not os.path.exists(self.project_path):
self.project_fail_details = FILE_NOT_FOUND
return red('ERROR not found')
renderer = DbtProjectYamlRenderer(self.profile, self.cli_vars)
try:
self.project = Project.from_project_root(
self.project_dir,
renderer,
verify_version=flags.VERSION_CHECK,
)
except dbt.exceptions.DbtConfigError as exc:
self.project_fail_details = str(exc)
return red('ERROR invalid')
return green('OK found and valid')
def _profile_found(self):
if not self.raw_profile_data:
return red('ERROR not found')
assert self.raw_profile_data is not None
if self.profile_name in self.raw_profile_data:
return green('OK found')
else:
return red('ERROR not found')
def _target_found(self):
requirements = (self.raw_profile_data and self.profile_name and
self.target_name)
if not requirements:
return red('ERROR not found')
# mypy appeasement, we checked just above
assert self.raw_profile_data is not None
assert self.profile_name is not None
assert self.target_name is not None
if self.profile_name not in self.raw_profile_data:
return red('ERROR not found')
profiles = self.raw_profile_data[self.profile_name]['outputs']
if self.target_name not in profiles:
return red('ERROR not found')
return green('OK found')
def _choose_profile_names(self) -> Optional[List[str]]:
project_profile: Optional[str] = None
if os.path.exists(self.project_path):
try:
partial = Project.partial_load(
os.path.dirname(self.project_path),
verify_version=bool(flags.VERSION_CHECK),
)
renderer = DbtProjectYamlRenderer(None, self.cli_vars)
project_profile = partial.render_profile_name(renderer)
except dbt.exceptions.DbtProjectError:
pass
args_profile: Optional[str] = getattr(self.args, 'profile', None)
try:
return [Profile.pick_profile_name(args_profile, project_profile)]
except dbt.exceptions.DbtConfigError:
pass
# try to guess
profiles = []
if self.raw_profile_data:
profiles = [k for k in self.raw_profile_data if k != 'config']
if project_profile is None:
self.messages.append('Could not load dbt_project.yml')
elif len(profiles) == 0:
self.messages.append('The profiles.yml has no profiles')
elif len(profiles) == 1:
self.messages.append(ONLY_PROFILE_MESSAGE.format(profiles[0]))
else:
self.messages.append(MULTIPLE_PROFILE_MESSAGE.format(
'\n'.join(' - {}'.format(o) for o in profiles)
))
return profiles
def _choose_target_name(self, profile_name: str):
has_raw_profile = (
self.raw_profile_data is not None and
profile_name in self.raw_profile_data
)
if not has_raw_profile:
return None
# mypy appeasement, we checked just above
assert self.raw_profile_data is not None
raw_profile = self.raw_profile_data[profile_name]
renderer = ProfileRenderer(self.cli_vars)
target_name, _ = Profile.render_profile(
raw_profile=raw_profile,
profile_name=profile_name,
target_override=getattr(self.args, 'target', None),
renderer=renderer
)
return target_name
def _load_profile(self):
if not os.path.exists(self.profile_path):
self.profile_fail_details = FILE_NOT_FOUND
self.messages.append(MISSING_PROFILE_MESSAGE.format(
path=self.profile_path, url=ProfileConfigDocs
))
self.any_failure = True
return red('ERROR not found')
try:
raw_profile_data = load_yaml_text(
dbt.clients.system.load_file_contents(self.profile_path)
)
except Exception:
pass # we'll report this when we try to load the profile for real
else:
if isinstance(raw_profile_data, dict):
self.raw_profile_data = raw_profile_data
profile_errors = []
profile_names = self._choose_profile_names()
renderer = ProfileRenderer(self.cli_vars)
for profile_name in profile_names:
try:
profile: Profile = QueryCommentedProfile.render_from_args(
self.args, renderer, profile_name
)
except dbt.exceptions.DbtConfigError as exc:
profile_errors.append(str(exc))
else:
if len(profile_names) == 1:
# if a profile was specified, set it on the task
self.target_name = self._choose_target_name(profile_name)
self.profile = profile
if profile_errors:
self.profile_fail_details = '\n\n'.join(profile_errors)
return red('ERROR invalid')
return green('OK found and valid')
def test_git(self):
try:
dbt.clients.system.run_cmd(os.getcwd(), ['git', '--help'])
except dbt.exceptions.ExecutableError as exc:
self.messages.append('Error from git --help: {!s}'.format(exc))
self.any_failure = True
return red('ERROR')
return green('OK found')
def test_dependencies(self):
print('Required dependencies:')
print(' - git [{}]'.format(self.test_git()))
print('')
def test_configuration(self):
profile_status = self._load_profile()
project_status = self._load_project()
print('Configuration:')
print(' profiles.yml file [{}]'.format(profile_status))
print(' dbt_project.yml file [{}]'.format(project_status))
# skip profile stuff if we can't find a profile name
if self.profile_name is not None:
print(' profile: {} [{}]'.format(self.profile_name,
self._profile_found()))
print(' target: {} [{}]'.format(self.target_name,
self._target_found()))
print('')
self._log_project_fail()
self._log_profile_fail()
def _log_project_fail(self):
if not self.project_fail_details:
return
self.any_failure = True
if self.project_fail_details == FILE_NOT_FOUND:
return
msg = (
f'Project loading failed for the following reason:'
f'\n{self.project_fail_details}'
f'\n'
)
self.messages.append(msg)
def _log_profile_fail(self):
if not self.profile_fail_details:
return
self.any_failure = True
if self.profile_fail_details == FILE_NOT_FOUND:
return
msg = (
f'Profile loading failed for the following reason:'
f'\n{self.profile_fail_details}'
f'\n'
)
self.messages.append(msg)
@staticmethod
def attempt_connection(profile):
"""Return a string containing the error message, or None if there was
no error.
"""
register_adapter(profile)
adapter = get_adapter(profile)
try:
with adapter.connection_named('debug'):
adapter.debug_query()
except Exception as exc:
return COULD_NOT_CONNECT_MESSAGE.format(
err=str(exc),
url=ProfileConfigDocs,
)
return None
def _connection_result(self):
result = self.attempt_connection(self.profile)
if result is not None:
self.messages.append(result)
self.any_failure = True
return red('ERROR')
return green('OK connection ok')
def test_connection(self):
if not self.profile:
return
print('Connection:')
for k, v in self.profile.credentials.connection_info():
print(' {}: {}'.format(k, v))
print(' Connection test: [{}]'.format(self._connection_result()))
print('')
@classmethod
def validate_connection(cls, target_dict):
"""Validate a connection dictionary. On error, raises a DbtConfigError.
"""
target_name = 'test'
# make a fake profile that we can parse
profile_data = {
'outputs': {
target_name: target_dict,
},
}
# this will raise a DbtConfigError on failure
profile = Profile.from_raw_profile_info(
raw_profile=profile_data,
profile_name='',
target_override=target_name,
renderer=ProfileRenderer({}),
)
result = cls.attempt_connection(profile)
if result is not None:
raise dbt.exceptions.DbtProfileError(
result,
result_type='connection_failure'
)
|
analyst-collective/dbt
|
core/dbt/task/debug.py
|
Python
|
apache-2.0
| 13,733
|
[
"VisIt"
] |
c9d4faf80e5781b88bfbafb67e820bdfaba31ffb44baedd8065a4b5ae8f5712e
|
#!/usr/bin/env python
########################################
# to modify the NetCDF files
########################################
#First import the netcdf4 library
from netCDF4 import Dataset # http://code.google.com/p/netcdf4-python/
import numpy as np
import sys,getopt
#=================================================== get opts input file
def main(argv):
inputfile = ''
outputfile = ''
try:
opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="])
except getopt.GetoptError:
print 'test.py -i <inputfile> -o <outputfile>'
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
print 'test.py -i <inputfile> -o <outputfile>'
sys.exit()
elif opt in ("-i", "--ifile"):
inputfile = arg
elif opt in ("-o," "--ofile"):
outputfile = arg
print 'INputfile:', inputfile
print 'Outputfile:', outputfile
if __name__ == "__main__":
main(sys.argv[1:])
#===================================================
# Read en existing NetCDF file and create a new one
# f is going to be the existing NetCDF file from where we want to import data
# and g is going to be the new file.
f=Dataset('tas_Amon_CanESM2_rcp85_r1i1p1_200601-210012.nc','r+') # r is for read only
print "dkfjksfkd----------------s"
f.variables['tas'][:,:,:]= np.full(f.variables['tas'].shape,8)
#print f.variables['tas'][:]
print f.variables['tas'].shape
#a=np.full((22,222,11),5)
#print a
print f.variables['tas'][:]
f.close()
quit()
# Read en existing NetCDF file and create a new one
# f is going to be the existing NetCDF file from where we want to import data
# and g is going to be the new file.
f=Dataset('tas_Amon_CanESM2_rcp85_r1i1p1_200601-210012.nc','r+') # r is for read only
f.variables['tas'][:,:,:]= np.full(f.variables['tas'].shape,5)
#print f.variables['tas'][:]
print f.variables['tas'].shape
#a=np.full((22,222,11),5)
#print a
f.close()
quit()
g=Dataset('output.nc','w') # w if for creating a file
# if the file exists it the
# file will be deleted to write on it
# To copy the global attributes of the netCDF file
for attname in f.ncattrs():
setattr(g,attname,getattr(f,attname))
# To copy the dimension of the netCDF file
for dimname,dim in f.dimensions.iteritems():
# if you want to make changes in the dimensions of the new file
# you should add your own conditions here before the creation of the dimension.
g.createDimension(dimname,len(dim))
# To copy the variables of the netCDF file
for varname,ncvar in f.variables.iteritems():
# if you want to make changes in the variables of the new file
# you should add your own conditions here before the creation of the variable.
var = g.createVariable(varname,ncvar.dtype,ncvar.dimensions,fill_value=None)
#Proceed to copy the variable attributes
#for attname in ncvar.ncattrs():
#setattr(var,'fill_value','i4')
#setattr(var,attname,getattr(ncvar,attname))
#Finally copy the variable data to the new created variable
var[:] = ncvar[:]
f.close()
g.close()
num
|
CopyChat/Plotting
|
Python/modify_netcdf.py
|
Python
|
gpl-3.0
| 3,214
|
[
"NetCDF"
] |
8a6499ae72c53c7b0a1ea0a4b051aabfdaa9bcfb6f086e00734e148782172b51
|
# -*- coding: utf-8 -*-
#
# test_stdp_triplet_synapse.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# NEST 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 NEST. If not, see <http://www.gnu.org/licenses/>.
# This script tests the stdp_triplet_synapse in NEST.
import nest
import unittest
from math import exp
import numpy as np
@nest.ll_api.check_stack
class STDPTripletConnectionTestCase(unittest.TestCase):
"""Check stdp_triplet_connection model properties."""
def setUp(self):
nest.set_verbosity('M_WARNING')
nest.ResetKernel()
# settings
self.dendritic_delay = 1.0
self.decay_duration = 5.0
self.synapse_model = "stdp_triplet_synapse"
self.syn_spec = {
"synapse_model": self.synapse_model,
"delay": self.dendritic_delay,
# set receptor 1 post-synaptically, to not generate extra spikes
"receptor_type": 1,
"weight": 5.0,
"tau_plus": 16.8,
"tau_plus_triplet": 101.0,
"Aplus": 0.1,
"Aminus": 0.1,
"Aplus_triplet": 0.1,
"Aminus_triplet": 0.1,
"Kplus": 0.0,
"Kplus_triplet": 0.0,
"Wmax": 100.0,
}
self.post_neuron_params = {
"tau_minus": 33.7,
"tau_minus_triplet": 125.0,
}
# setup basic circuit
self.pre_neuron = nest.Create("parrot_neuron")
self.post_neuron = nest.Create(
"parrot_neuron", 1, params=self.post_neuron_params)
nest.Connect(self.pre_neuron, self.post_neuron, syn_spec=self.syn_spec)
def generateSpikes(self, neuron, times):
"""Trigger spike to given neuron at specified times."""
delay = 1.
gen = nest.Create("spike_generator", 1, {
"spike_times": [t - delay for t in times]})
nest.Connect(gen, neuron, syn_spec={"delay": delay})
def status(self, which):
"""Get synapse parameter status."""
stats = nest.GetConnections(
self.pre_neuron, synapse_model=self.synapse_model)
return stats.get(which) if len(stats) == 1 else stats.get(which)[0]
def decay(self, time, Kplus, Kplus_triplet, Kminus, Kminus_triplet):
"""Decay variables."""
Kplus *= exp(-time / self.syn_spec["tau_plus"])
Kplus_triplet *= exp(-time / self.syn_spec["tau_plus_triplet"])
Kminus *= exp(-time / self.post_neuron_params["tau_minus"])
Kminus_triplet *= exp(-time /
self.post_neuron_params["tau_minus_triplet"])
return (Kplus, Kplus_triplet, Kminus, Kminus_triplet)
def facilitate(self, w, Kplus, Kminus_triplet):
"""Facilitate weight."""
Wmax = self.status("Wmax")
return np.sign(Wmax) * (abs(w) + Kplus * (
self.syn_spec["Aplus"] +
self.syn_spec["Aplus_triplet"] * Kminus_triplet)
)
def depress(self, w, Kminus, Kplus_triplet):
"""Depress weight."""
Wmax = self.status("Wmax")
return np.sign(Wmax) * (abs(w) - Kminus * (
self.syn_spec["Aminus"] +
self.syn_spec["Aminus_triplet"] * Kplus_triplet)
)
def assertAlmostEqualDetailed(self, expected, given, message):
"""Improve assetAlmostEqual with detailed message."""
messageWithValues = "%s (expected: `%s` was: `%s`" % (
message, str(expected), str(given))
self.assertAlmostEqual(given, expected, msg=messageWithValues)
def test_badPropertiesSetupsThrowExceptions(self):
"""Check that exceptions are thrown when setting bad parameters."""
def setupProperty(property):
bad_syn_spec = self.syn_spec.copy()
bad_syn_spec.update(property)
nest.Connect(self.pre_neuron, self.post_neuron,
syn_spec=bad_syn_spec)
def badPropertyWith(content, parameters):
self.assertRaisesRegexp(
nest.kernel.NESTError, "BadProperty(.+)" + content,
setupProperty, parameters
)
badPropertyWith("Kplus", {"Kplus": -1.0})
badPropertyWith("Kplus_triplet", {"Kplus_triplet": -1.0})
def test_varsZeroAtStart(self):
"""Check that pre and post-synaptic variables are zero at start."""
self.assertAlmostEqualDetailed(
0.0, self.status("Kplus"), "Kplus should be zero")
self.assertAlmostEqualDetailed(0.0, self.status(
"Kplus_triplet"), "Kplus_triplet should be zero")
def test_preVarsIncreaseWithPreSpike(self):
"""Check that pre-synaptic variables (Kplus, Kplus_triplet) increase
after each pre-synaptic spike."""
self.generateSpikes(self.pre_neuron, [2.0])
Kplus = self.status("Kplus")
Kplus_triplet = self.status("Kplus_triplet")
nest.Simulate(20.0)
self.assertAlmostEqualDetailed(
Kplus + 1.0,
self.status("Kplus"),
"Kplus should have increased by 1")
self.assertAlmostEqualDetailed(
Kplus_triplet + 1.0,
self.status("Kplus_triplet"),
"Kplus_triplet should have increased by 1")
def test_preVarsDecayAfterPreSpike(self):
"""Check that pre-synaptic variables (Kplus, Kplus_triplet) decay
after each pre-synaptic spike."""
self.generateSpikes(self.pre_neuron, [2.0])
# trigger computation
self.generateSpikes(self.pre_neuron, [2.0 + self.decay_duration])
(Kplus, Kplus_triplet, _, _) = self.decay(
self.decay_duration, 1.0, 1.0, 0.0, 0.0)
Kplus += 1.0
Kplus_triplet += 1.0
nest.Simulate(20.0)
self.assertAlmostEqualDetailed(
Kplus, self.status("Kplus"), "Kplus should have decay")
self.assertAlmostEqualDetailed(Kplus_triplet, self.status(
"Kplus_triplet"), "Kplus_triplet should have decay")
def test_preVarsDecayAfterPostSpike(self):
"""Check that pre-synaptic variables (Kplus, Kplus_triplet) decay
after each post-synaptic spike."""
self.generateSpikes(self.pre_neuron, [2.0])
self.generateSpikes(self.post_neuron, [3.0, 4.0])
# trigger computation
self.generateSpikes(self.pre_neuron, [2.0 + self.decay_duration])
(Kplus, Kplus_triplet, _, _) = self.decay(
self.decay_duration, 1.0, 1.0, 0.0, 0.0)
Kplus += 1.0
Kplus_triplet += 1.0
nest.Simulate(20.0)
self.assertAlmostEqualDetailed(
Kplus, self.status("Kplus"), "Kplus should have decay")
self.assertAlmostEqualDetailed(Kplus_triplet, self.status(
"Kplus_triplet"), "Kplus_triplet should have decay")
def test_weightChangeWhenPrePostSpikes(self):
"""Check that weight changes whenever a pre-post spike pair happen."""
self.generateSpikes(self.pre_neuron, [2.0])
self.generateSpikes(self.post_neuron, [4.0])
self.generateSpikes(self.pre_neuron, [6.0]) # trigger computation
Kplus = self.status("Kplus")
Kplus_triplet = self.status("Kplus_triplet")
Kminus = 0.0
Kminus_triplet = 0.0
weight = self.status("weight")
Wmax = self.status("Wmax")
(Kplus, Kplus_triplet, Kminus, Kminus_triplet) = self.decay(
2.0, Kplus, Kplus_triplet, Kminus, Kminus_triplet)
weight = self.depress(weight, Kminus, Kplus_triplet)
Kplus += 1.0
Kplus_triplet += 1.0
(Kplus, Kplus_triplet, Kminus, Kminus_triplet) = self.decay(
2.0 + self.dendritic_delay, Kplus, Kplus_triplet,
Kminus, Kminus_triplet
)
weight = self.facilitate(weight, Kplus, Kminus_triplet)
Kminus += 1.0
Kminus_triplet += 1.0
(Kplus, Kplus_triplet, Kminus, Kminus_triplet) = self.decay(
2.0 - self.dendritic_delay, Kplus, Kplus_triplet,
Kminus, Kminus_triplet
)
weight = self.depress(weight, Kminus, Kplus_triplet)
nest.Simulate(20.0)
self.assertAlmostEqualDetailed(weight, self.status(
"weight"), "weight should have decreased")
def test_weightChangeWhenPrePostPreSpikes(self):
"""Check that weight changes whenever a pre-post-pre spike triplet
happen."""
self.generateSpikes(self.pre_neuron, [2.0, 6.0])
self.generateSpikes(self.post_neuron, [4.0])
self.generateSpikes(self.pre_neuron, [8.0]) # trigger computation
Kplus = self.status("Kplus")
Kplus_triplet = self.status("Kplus_triplet")
Kminus = 0.0
Kminus_triplet = 0.0
weight = self.status("weight")
Wmax = self.status("Wmax")
(Kplus, Kplus_triplet, Kminus, Kminus_triplet) = self.decay(
2.0, Kplus, Kplus_triplet, Kminus, Kminus_triplet)
weight = self.depress(weight, Kminus, Kplus_triplet)
Kplus += 1.0
Kplus_triplet += 1.0
(Kplus, Kplus_triplet, Kminus, Kminus_triplet) = self.decay(
2.0 + self.dendritic_delay, Kplus, Kplus_triplet,
Kminus, Kminus_triplet
)
weight = self.facilitate(weight, Kplus, Kminus_triplet)
Kminus += 1.0
Kminus_triplet += 1.0
(Kplus, Kplus_triplet, Kminus, Kminus_triplet) = self.decay(
2.0 - self.dendritic_delay, Kplus, Kplus_triplet,
Kminus, Kminus_triplet
)
weight = self.depress(weight, Kminus, Kplus_triplet)
Kplus += 1.0
Kplus_triplet += 1.0
(Kplus, Kplus_triplet, Kminus, Kminus_triplet) = self.decay(
2.0, Kplus, Kplus_triplet, Kminus, Kminus_triplet)
weight = self.depress(weight, Kminus, Kplus_triplet)
nest.Simulate(20.0)
self.assertAlmostEqualDetailed(weight, self.status(
"weight"), "weight should have decreased")
def test_maxWeightStaturatesWeight(self):
"""Check that setting maximum weight property keep weight limited."""
limited_weight = self.status("weight") + 1e-10
limited_syn_spec = self.syn_spec.copy()
limited_syn_spec.update({"Wmax": limited_weight})
nest.Connect(self.pre_neuron, self.post_neuron,
syn_spec=limited_syn_spec)
self.generateSpikes(self.pre_neuron, [2.0])
self.generateSpikes(self.pre_neuron, [3.0]) # trigger computation
nest.Simulate(20.0)
print(limited_weight)
print(self.status('weight'))
self.assertAlmostEqualDetailed(limited_weight, self.status(
"weight"), "weight should have been limited")
@nest.ll_api.check_stack
class STDPTripletInhTestCase(STDPTripletConnectionTestCase):
def setUp(self):
nest.set_verbosity('M_WARNING')
nest.ResetKernel()
# settings
self.dendritic_delay = 1.0
self.decay_duration = 5.0
self.synapse_model = "stdp_triplet_synapse"
self.syn_spec = {
"synapse_model": self.synapse_model,
"delay": self.dendritic_delay,
# set receptor 1 post-synaptically, to not generate extra spikes
"receptor_type": 1,
"weight": -5.0,
"tau_plus": 16.8,
"tau_plus_triplet": 101.0,
"Aplus": 0.1,
"Aminus": 0.1,
"Aplus_triplet": 0.1,
"Aminus_triplet": 0.1,
"Kplus": 0.0,
"Kplus_triplet": 0.0,
"Wmax": -100.0,
}
self.post_neuron_params = {
"tau_minus": 33.7,
"tau_minus_triplet": 125.0,
}
# setup basic circuit
self.pre_neuron = nest.Create("parrot_neuron")
self.post_neuron = nest.Create("parrot_neuron", 1,
params=self.post_neuron_params)
nest.Connect(self.pre_neuron, self.post_neuron, syn_spec=self.syn_spec)
def suite_inh():
return unittest.makeSuite(STDPTripletInhTestCase, "test")
def suite():
return unittest.makeSuite(STDPTripletConnectionTestCase, "test")
def run():
runner = unittest.TextTestRunner(verbosity=2)
runner.run(suite())
runner.run(suite_inh())
if __name__ == "__main__":
run()
|
alberto-antonietti/nest-simulator
|
pynest/nest/tests/test_stdp_triplet_synapse.py
|
Python
|
gpl-2.0
| 12,804
|
[
"NEURON"
] |
85ae8667daa492be1f2a2f60f82b3759109bea86d9c511aea98cfb047216677b
|
"""Nodes that make up parse trees
Parsing spits out a tree of these, which you can then tell to walk itself and
spit out a useful value. Or you can walk it yourself; the structural attributes
are public.
"""
# TODO: If this is slow, think about using cElementTree or something.
from inspect import isfunction
from sys import version_info, exc_info
from parsimonious.exceptions import VisitationError, UndefinedLabel
from parsimonious.utils import StrAndRepr
class Node(StrAndRepr):
"""A parse tree node
Consider these immutable once constructed. As a side effect of a
memory-saving strategy in the cache, multiple references to a single
``Node`` might be returned in a single parse tree. So, if you start
messing with one, you'll see surprising parallel changes pop up elsewhere.
My philosophy is that parse trees (and their nodes) should be
representation-agnostic. That is, they shouldn't get all mixed up with what
the final rendered form of a wiki page (or the intermediate representation
of a programming language, or whatever) is going to be: you should be able
to parse once and render several representations from the tree, one after
another.
"""
# I tried making this subclass list, but it got ugly. I had to construct
# invalid ones and patch them up later, and there were other problems.
__slots__ = ['expr_name', # The name of the expression that generated me
'full_text', # The full text fed to the parser
'start', # The position in the text where that expr started matching
'end', # The position after starft where the expr first didn't
# match. [start:end] follow Python slice conventions.
'children'] # List of child parse tree nodes
def __init__(self, expr_name, full_text, start, end, children=None):
self.expr_name = expr_name
self.full_text = full_text
self.start = start
self.end = end
self.children = children or []
def __iter__(self):
"""Support looping over my children and doing tuple unpacks on me.
It can be very handy to unpack nodes in arg lists; see
:class:`PegVisitor` for an example.
"""
return iter(self.children)
@property
def text(self):
"""Return the text this node matched."""
return self.full_text[self.start:self.end]
# From here down is just stuff for testing and debugging.
def prettily(self, error=None):
"""Return a unicode, pretty-printed representation of me.
:arg error: The node to highlight because an error occurred there
"""
# TODO: If a Node appears multiple times in the tree, we'll point to
# them all. Whoops.
def indent(text):
return '\n'.join((' ' + line) for line in text.splitlines())
ret = [u'<%s%s matching "%s">%s' % (
self.__class__.__name__,
(' called "%s"' % self.expr_name) if self.expr_name else '',
self.text,
' <-- *** We were here. ***' if error is self else '')]
for n in self:
ret.append(indent(n.prettily(error=error)))
return '\n'.join(ret)
def __unicode__(self):
"""Return a compact, human-readable representation of me."""
return self.prettily()
def __eq__(self, other):
"""Support by-value deep comparison with other nodes for testing."""
return (other is not None and
self.expr_name == other.expr_name and
self.full_text == other.full_text and
self.start == other.start and
self.end == other.end and
self.children == other.children)
def __ne__(self, other):
return not self == other
def __repr__(self, top_level=True):
"""Return a bit of code (though not an expression) that will recreate
me."""
# repr() of unicode flattens everything out to ASCII, so we don't need
# to explicitly encode things afterward.
ret = ["s = %r" % self.full_text] if top_level else []
ret.append("%s(%r, s, %s, %s%s)" % (
self.__class__.__name__,
self.expr_name,
self.start,
self.end,
(', children=[%s]' %
', '.join([c.__repr__(top_level=False) for c in self.children]))
if self.children else ''))
return '\n'.join(ret)
class RegexNode(Node):
"""Node returned from a ``Regex`` expression
Grants access to the ``re.Match`` object, in case you want to access
capturing groups, etc.
"""
__slots__ = ['match']
class RuleDecoratorMeta(type):
def __new__(metaclass, name, bases, namespace):
def unvisit(name):
"""Remove any leading "visit_" from a method name."""
return name[6:] if name.startswith('visit_') else name
methods = [v for k, v in namespace.iteritems() if
hasattr(v, '_rule') and isfunction(v)]
if methods:
from parsimonious.grammar import Grammar # circular import dodge
methods.sort(key=(lambda x: x.func_code.co_firstlineno)
if version_info[0] < 3 else
(lambda x: x.__code__.co_firstlineno))
# Possible enhancement: once we get the Grammar extensibility story
# solidified, we can have @rules *add* to the default grammar
# rather than pave over it.
namespace['grammar'] = Grammar(
'\n'.join('{name} = {expr}'.format(name=unvisit(m.__name__),
expr=m._rule)
for m in methods))
return super(RuleDecoratorMeta,
metaclass).__new__(metaclass, name, bases, namespace)
class NodeVisitor(object):
"""A shell for writing things that turn parse trees into something useful
Performs a depth-first traversal of an AST. Subclass this, add methods for
each expr you care about, instantiate, and call
``visit(top_node_of_parse_tree)``. It'll return the useful stuff. This API
is very similar to that of ``ast.NodeVisitor``.
These could easily all be static methods, but that would add at least as
much weirdness at the call site as the ``()`` for instantiation. And this
way, we support subclasses that require state state: options, for example,
or a symbol table constructed from a programming language's AST.
We never transform the parse tree in place, because...
* There are likely multiple references to the same ``Node`` object in a
parse tree, and changes to one reference would surprise you elsewhere.
* It makes it impossible to report errors: you'd end up with the "error"
arrow pointing someplace in a half-transformed mishmash of nodes--and
that's assuming you're even transforming the tree into another tree.
Heaven forbid you're making it into a string or something else.
"""
__metaclass__ = RuleDecoratorMeta
#: The :term:`default grammar`: the one recommended for use with this
#: visitor. If you populate this, you will be able to call
#: :meth:`NodeVisitor.parse()` as a shortcut.
grammar = None
#: Classes of exceptions you actually intend to raise during visitation
#: and which should propogate out of the visitor. These will not be
#: wrapped in a VisitationError when they arise.
unwrapped_exceptions = ()
# TODO: If we need to optimize this, we can go back to putting subclasses
# in charge of visiting children; they know when not to bother. Or we can
# mark nodes as not descent-worthy in the grammar.
def visit(self, node):
"""Walk a parse tree, transforming it into another representation.
Recursively descend a parse tree, dispatching to the method named after
the rule in the :class:`~parsimonious.grammar.Grammar` that produced
each node. If, for example, a rule was... ::
bold = '<b>'
...the ``visit_bold()`` method would be called. It is your
responsibility to subclass :class:`NodeVisitor` and implement those
methods.
"""
method = getattr(self, 'visit_' + node.expr_name, self.generic_visit)
# Call that method, and show where in the tree it failed if it blows
# up.
try:
return method(node, [self.visit(n) for n in node])
except (VisitationError, UndefinedLabel):
# Don't catch and re-wrap already-wrapped exceptions.
raise
except self.unwrapped_exceptions:
raise
except Exception:
# Catch any exception, and tack on a parse tree so it's easier to
# see where it went wrong.
exc_class, exc, tb = exc_info()
raise VisitationError, (exc, exc_class, node), tb
def generic_visit(self, node, visited_children):
"""Default visitor method
:arg node: The node we're visiting
:arg visited_children: The results of visiting the children of that
node, in a list
I'm not sure there's an implementation of this that makes sense across
all (or even most) use cases, so we leave it to subclasses to implement
for now.
"""
raise NotImplementedError("No visitor method was defined for %s." %
node.expr_name)
# Convenience methods:
def parse(self, text, pos=0):
"""Parse some text with this Visitor's default grammar.
``SomeVisitor().parse('some_string')`` is a shortcut for
``SomeVisitor().visit(some_grammar.parse('some_string'))``.
"""
return self._parse_or_match(text, pos, 'parse')
def match(self, text, pos=0):
"""Parse some text with this Visitor's default grammar, but don't
insist on parsing all the way to the end.
``SomeVisitor().match('some_string')`` is a shortcut for
``SomeVisitor().visit(some_grammar.match('some_string'))``.
"""
return self._parse_or_match(text, pos, 'match')
# Internal convenience methods to help you write your own visitors:
def lift_child(self, node, (first_child,)):
"""Lift the sole child of ``node`` up to replace the node."""
return first_child
# Private methods:
def _parse_or_match(self, text, pos, method_name):
"""Execute a parse or match on the default grammar, followed by a
visitation.
Raise RuntimeError if there is no default grammar specified.
"""
if not self.grammar:
raise RuntimeError(
"The {cls}.{method}() shortcut won't work because {cls} was "
"never associated with a specific " "grammar. Fill out its "
"`grammar` attribute, and try again.".format(
cls=self.__class__.__name__,
method=method_name))
return self.visit(getattr(self.grammar, method_name)(text, pos=pos))
def rule(rule_string):
"""Decorate a NodeVisitor ``visit_*`` method to tie a grammar rule to it.
The following will arrange for the ``visit_digit`` method to receive the
results of the ``~"[0-9]"`` parse rule::
@rule('~"[0-9]"')
def visit_digit(self, node, visited_children):
...
Notice that there is no "digit = " as part of the rule; that gets inferred
from the method name.
In cases where there is only one kind of visitor interested in a grammar,
using ``@rule`` saves you having to look back and forth between the visitor
and the grammar definition.
On an implementation level, all ``@rule`` rules get stitched together into
a :class:`~parsimonoius.Grammar` that becomes the NodeVisitor's
:term:`default grammar`.
Typically, the choice of a default rule for this grammar is simple: whatever
``@rule`` comes first in the class is the default. But the choice may become
surprising if you divide the ``@rule`` calls among subclasses. At the
moment, which method "comes first" is decided simply by comparing line
numbers, so whatever method is on the smallest-numbered line will be the
default. In a future release, this will change to pick the
first ``@rule`` call on the basemost class that has one. That way, a
subclass which does not override the default rule's ``visit_*`` method
won't unintentionally change which rule is the default.
"""
def decorator(method):
method._rule = rule_string # XXX: Maybe register them on a class var instead so we can just override a @rule'd visitor method on a subclass without blowing away the rule string that comes with it.
return method
return decorator
|
fjalex/parsimonious
|
parsimonious/nodes.py
|
Python
|
mit
| 12,898
|
[
"VisIt"
] |
187d16ac6d949f7eb6558469c3c3267c5d7c9f988bf8393213df5901b26d182d
|
import tensorflow as tf # neural network for function approximation
import gym # environment
import numpy as np # matrix operation and math functions
from gym import wrappers
import gym_morph # customized environment for cart-pole
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import time
start_time = time.time()
MAX_TEST = 10
for test_num in range(1, MAX_TEST+1):
# Hyperparameters
RANDOM_NUMBER_SEED = test_num
ENVIRONMENT1 = "morph-v0"
MAX_EPISODES = 20000 # number of episodes
EPISODE_LENGTH = 4000 # single episode length
HIDDEN_SIZE = 16
DISPLAY_WEIGHTS = False # Help debug weight update
gamma = 0.99 # Discount per step
RENDER = False # Render the cart-pole system
VIDEO_INTERVAL = 100 # Generate a video at this interval
CONSECUTIVE_TARGET = 100 # Including previous 100 rewards
CONST_LR = True # Constant or decaying learing rate
# Constant learning rate
const_learning_rate_in = 0.0008
# Decay learning rate
start_learning_rate_in = 0.003
decay_steps_in = 100
decay_rate_in = 0.96
DIR_PATH_SAVEFIG = "/root/cartpole_plot/"
if CONST_LR:
learning_rate = const_learning_rate_in
file_name_savefig = "el" + str(EPISODE_LENGTH) \
+ "_hn" + str(HIDDEN_SIZE) \
+ "_clr" + str(learning_rate).replace(".", "p") \
+ "_test" + str(test_num) \
+ ".png"
else:
start_learning_rate = start_learning_rate_in
decay_steps = decay_steps_in
decay_rate = decay_rate_in
file_name_savefig = "el" + str(EPISODE_LENGTH) \
+ "_hn" + str(HIDDEN_SIZE) \
+ "_dlr_slr" + str(start_learning_rate).replace(".", "p") \
+ "_ds" + str(decay_steps) \
+ "_dr" + str(decay_rate).replace(".", "p") \
+ "_test" + str(test_num) \
+ ".png"
env = gym.make(ENVIRONMENT1)
env.seed(RANDOM_NUMBER_SEED)
np.random.seed(RANDOM_NUMBER_SEED)
tf.set_random_seed(RANDOM_NUMBER_SEED)
# Input and output sizes
input_size = 4
output_size = 2
# input_size = env.observation_space.shape[0]
# try:
# output_size = env.action_space.shape[0]
# except AttributeError:
# output_size = env.action_space.n
# Tensorflow network setup
x = tf.placeholder(tf.float32, shape=(None, input_size))
y = tf.placeholder(tf.float32, shape=(None, 1))
if not CONST_LR:
# decay learning rate
global_step = tf.Variable(0, trainable=False)
learning_rate = tf.train.exponential_decay(start_learning_rate, global_step, decay_steps, decay_rate, staircase=False)
expected_returns = tf.placeholder(tf.float32, shape=(None, 1))
# Xavier (2010) weights initializer for uniform distribution:
# x = sqrt(6. / (in + out)); [-x, x]
w_init = tf.contrib.layers.xavier_initializer()
hidden_W = tf.get_variable("W1", shape=[input_size, HIDDEN_SIZE],
initializer=w_init)
hidden_B = tf.Variable(tf.zeros(HIDDEN_SIZE))
dist_W = tf.get_variable("W2", shape=[HIDDEN_SIZE, output_size],
initializer=w_init)
dist_B = tf.Variable(tf.zeros(output_size))
hidden = tf.nn.elu(tf.matmul(x, hidden_W) + hidden_B)
dist = tf.tanh(tf.matmul(hidden, dist_W) + dist_B)
dist_soft = tf.nn.log_softmax(dist)
dist_in = tf.matmul(dist_soft, tf.Variable([[1.], [0.]]))
pi = tf.contrib.distributions.Bernoulli(dist_in)
pi_sample = pi.sample()
log_pi = pi.log_prob(y)
if CONST_LR:
optimizer = tf.train.RMSPropOptimizer(learning_rate)
train = optimizer.minimize(-1.0 * expected_returns * log_pi)
else:
optimizer = tf.train.RMSPropOptimizer(learning_rate)
train = optimizer.minimize(-1.0 * expected_returns * log_pi, global_step=global_step)
# saver = tf.train.Saver()
# Create and initialize a session
sess = tf.Session()
sess.run(tf.global_variables_initializer())
def run_episode(environment, ep, render=False):
raw_reward = 0
discounted_reward = 0
cumulative_reward = []
discount = 1.0
states = []
actions = []
obs = environment.reset()
done = False
while not done:
states.append(obs)
cumulative_reward.append(discounted_reward)
if render and ((ep % VIDEO_INTERVAL) == 0):
environment.render()
action = sess.run(pi_sample, feed_dict={x: [obs]})[0]
actions.append(action)
obs, reward, done, info = env.step(action[0])
raw_reward += reward
if reward > 0:
discounted_reward += reward * discount
else:
discounted_reward += reward
discount *= gamma
return raw_reward, discounted_reward, cumulative_reward, states, actions
def display_weights(session):
w1 = session.run(hidden_W)
b1 = session.run(hidden_B)
w2 = session.run(dist_W)
b2 = session.run(dist_B)
print(w1, b1, w2, b2)
returns = []
mean_returns = []
for ep in range(MAX_EPISODES):
raw_G, discounted_G, cumulative_G, ep_states, ep_actions = \
run_episode(env, ep, RENDER)
expected_R = np.transpose([discounted_G - np.array(cumulative_G)])
sess.run(train, feed_dict={x: ep_states, y: ep_actions,
expected_returns: expected_R})
if DISPLAY_WEIGHTS:
display_weights(sess)
returns.append(raw_G)
running_returns = returns[max(0, ep-CONSECUTIVE_TARGET):(ep+1)]
mean_return = np.mean(running_returns)
mean_returns.append(mean_return)
if CONST_LR:
msg = "Test: {}/{}, Episode: {}/{}, Time: {}, Learning rate: {}, Return: {}, Last {} returns mean: {}"
msg = msg.format(test_num, MAX_TEST, ep+1, MAX_EPISODES, time.strftime('%H:%M:%S', time.gmtime(time.time()-start_time)), learning_rate, raw_G, CONSECUTIVE_TARGET, mean_return)
print(msg)
else:
msg = "Test: {}/{}, Episode: {}/{}, Time: {}, Learning rate: {}, Return: {}, Last {} returns mean: {}"
msg = msg.format(test_num, MAX_TEST, ep+1, MAX_EPISODES, time.strftime('%H:%M:%S', time.gmtime(time.time()-start_time)), sess.run(learning_rate), raw_G, CONSECUTIVE_TARGET, mean_return)
print(msg)
env.close() # close openai gym environment
tf.reset_default_graph() # clear tensorflow graph
# Plot
# plt.style.use('ggplot')
plt.style.use('dark_background')
episodes_plot = np.arange(MAX_EPISODES)
fig = plt.figure()
ax = fig.add_subplot(111)
fig.subplots_adjust(top=0.85)
if CONST_LR:
ax.set_title("The Cart-Pole Problem Test %i \n \
Episode Length: %i \
Discount Factor: %.2f \n \
Number of Hidden Neuron: %i \
Constant Learning Rate: %.5f" % (test_num, EPISODE_LENGTH, gamma, HIDDEN_SIZE, learning_rate))
else:
ax.set_title("The Cart-Pole Problem Test %i \n \
EpisodeLength: %i DiscountFactor: %.2f NumHiddenNeuron: %i \n \
Decay Learning Rate: (start: %.5f, steps: %i, rate: %.2f)" % (test_num, EPISODE_LENGTH, gamma, HIDDEN_SIZE, start_learning_rate, decay_steps, decay_rate))
ax.set_xlabel("Episode")
ax.set_ylabel("Return")
ax.set_ylim((0, EPISODE_LENGTH))
ax.grid(linestyle='--')
ax.plot(episodes_plot, returns, label='Instant return')
ax.plot(episodes_plot, mean_returns, label='Averaged return')
legend = ax.legend(loc='best', shadow=True)
fig.savefig(DIR_PATH_SAVEFIG + file_name_savefig, dpi=500)
# plt.show()
|
GitYiheng/reinforcement_learning_test
|
test03_monte_carlo/t40_rlvps02.py
|
Python
|
mit
| 7,664
|
[
"NEURON"
] |
85dcd9b708d6b361a51dc57c0350e31b0a0add2714f4a43446dcbdeb27b77bf5
|
# -*- coding: utf-8 -*-
#
# (c) Copyright 2003-2007 Hewlett-Packard Development Company, L.P.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Author: Don Welch, Narla Naga Samrat Chowdary, Yashwant Kumar Sahu
#
from __future__ import division
# Std Lib
import struct
import cStringIO
import xml.parsers.expat as expat
import re
import urllib
try:
from xml.etree import ElementTree
etree_loaded = True
except ImportError:
try:
from elementtree.ElementTree import XML
elementtree_loaded = True
except ImportError:
elementtree_loaded = False
etree_loaded = False
# Local
from g import *
from codes import *
import pml, utils
import hpmudext
"""
status dict structure:
{ 'revision' : STATUS_REV_00 .. STATUS_REV_04,
'agents' : [ list of pens/agents/supplies (dicts) ],
'top-door' : TOP_DOOR_NOT_PRESENT | TOP_DOOR_CLOSED | TOP_DOOR_OPEN,
'status-code' : STATUS_...,
'supply-door' : SUPPLY_DOOR_NOT_PRESENT | SUPPLY_DOOR_CLOSED | SUPPLY_DOOR_OPEN.
'duplexer' : DUPLEXER_NOT_PRESENT | DUPLEXER_DOOR_CLOSED | DUPLEXER_DOOR_OPEN,
'photo_tray' : PHOTO_TRAY_NOT_PRESENT | PHOTO_TRAY_ENGAGED | PHOTO_TRAY_NOT_ENGAGED,
'in-tray1' : IN_TRAY_NOT_PRESENT | IN_TRAY_CLOSED | IN_TRAY_OPEN (| IN_TRAY_DEFAULT | IN_TRAY_LOCKED)*,
'in-tray2' : IN_TRAY_NOT_PRESENT | IN_TRAY_CLOSED | IN_TRAY_OPEN (| IN_TRAY_DEFAULT | IN_TRAY_LOCKED)*,
'media-path' : MEDIA_PATH_NOT_PRESENT | MEDIA_PATH_CUT_SHEET | MEDIA_PATH_BANNER | MEDIA_PATH_PHOTO,
}
* S:02 only
agent dict structure: (pens/supplies/agents/etc)
{ 'kind' : AGENT_KIND_NONE ... AGENT_KIND_ADF_KIT,
'type' : TYPE_BLACK ... AGENT_TYPE_UNSPECIFIED, # aka color
'health' : AGENT_HEALTH_OK ... AGENT_HEALTH_UNKNOWN,
'level' : 0 ... 100,
'level-trigger' : AGENT_LEVEL_TRIGGER_SUFFICIENT_0 ... AGENT_LEVEL_TRIGGER_ALMOST_DEFINITELY_OUT,
}
"""
# 'revision'
STATUS_REV_00 = 0x00
STATUS_REV_01 = 0x01
STATUS_REV_02 = 0x02
STATUS_REV_03 = 0x03
STATUS_REV_04 = 0x04
STATUS_REV_V = 0xff
STATUS_REV_UNKNOWN = 0xfe
vstatus_xlate = {'busy' : STATUS_PRINTER_BUSY,
'idle' : STATUS_PRINTER_IDLE,
'prnt' : STATUS_PRINTER_PRINTING,
'offf' : STATUS_PRINTER_TURNING_OFF,
'rprt' : STATUS_PRINTER_REPORT_PRINTING,
'cncl' : STATUS_PRINTER_CANCELING,
'iost' : STATUS_PRINTER_IO_STALL,
'dryw' : STATUS_PRINTER_DRY_WAIT_TIME,
'penc' : STATUS_PRINTER_PEN_CHANGE,
'oopa' : STATUS_PRINTER_OUT_OF_PAPER,
'bnej' : STATUS_PRINTER_BANNER_EJECT,
'bnmz' : STATUS_PRINTER_BANNER_MISMATCH,
'phmz' : STATUS_PRINTER_PHOTO_MISMATCH,
'dpmz' : STATUS_PRINTER_DUPLEX_MISMATCH,
'pajm' : STATUS_PRINTER_MEDIA_JAM,
'cars' : STATUS_PRINTER_CARRIAGE_STALL,
'paps' : STATUS_PRINTER_PAPER_STALL,
'penf' : STATUS_PRINTER_PEN_FAILURE,
'erro' : STATUS_PRINTER_HARD_ERROR,
'pwdn' : STATUS_PRINTER_POWER_DOWN,
'fpts' : STATUS_PRINTER_FRONT_PANEL_TEST,
'clno' : STATUS_PRINTER_CLEAN_OUT_TRAY_MISSING}
REVISION_2_TYPE_MAP = {0 : AGENT_TYPE_NONE,
1 : AGENT_TYPE_BLACK,
2 : AGENT_TYPE_CYAN,
3 : AGENT_TYPE_MAGENTA,
4 : AGENT_TYPE_YELLOW,
5 : AGENT_TYPE_BLACK,
6 : AGENT_TYPE_CYAN,
7 : AGENT_TYPE_MAGENTA,
8 : AGENT_TYPE_YELLOW,
}
STATUS_BLOCK_UNKNOWN = {'revision' : STATUS_REV_UNKNOWN,
'agents' : [],
'status-code' : STATUS_UNKNOWN,
}
NUM_PEN_POS = {STATUS_REV_00 : 16,
STATUS_REV_01 : 16,
STATUS_REV_02 : 16,
STATUS_REV_03 : 18,
STATUS_REV_04 : 22}
PEN_DATA_SIZE = {STATUS_REV_00 : 8,
STATUS_REV_01 : 8,
STATUS_REV_02 : 4,
STATUS_REV_03 : 8,
STATUS_REV_04 : 8}
STATUS_POS = {STATUS_REV_00 : 14,
STATUS_REV_01 : 14,
STATUS_REV_02 : 14,
STATUS_REV_03 : 16,
STATUS_REV_04 : 20}
def parseSStatus(s, z=''):
revision = ''
pens = []
top_door = TOP_DOOR_NOT_PRESENT
stat = STATUS_UNKNOWN
supply_door = SUPPLY_DOOR_NOT_PRESENT
duplexer = DUPLEXER_NOT_PRESENT
photo_tray = PHOTO_TRAY_NOT_PRESENT
in_tray1 = IN_TRAY_NOT_PRESENT
in_tray2 = IN_TRAY_NOT_PRESENT
media_path = MEDIA_PATH_NOT_PRESENT
Z_SIZE = 6
try:
z1 = []
if len(z) > 0:
z_fields = z.split(',')
for z_field in z_fields:
if len(z_field) > 2 and z_field[:2] == '05':
z1s = z_field[2:]
z1 = [int(x, 16) for x in z1s]
s1 = [int(x, 16) for x in s]
revision = s1[1]
assert STATUS_REV_00 <= revision <= STATUS_REV_04
top_door = bool(s1[2] & 0x8L) + s1[2] & 0x1L
supply_door = bool(s1[3] & 0x8L) + s1[3] & 0x1L
duplexer = bool(s1[4] & 0xcL) + s1[4] & 0x1L
photo_tray = bool(s1[5] & 0x8L) + s1[5] & 0x1L
if revision == STATUS_REV_02:
in_tray1 = bool(s1[6] & 0x8L) + s1[6] & 0x1L
in_tray2 = bool(s1[7] & 0x8L) + s1[7] & 0x1L
else:
in_tray1 = bool(s1[6] & 0x8L)
in_tray2 = bool(s1[7] & 0x8L)
media_path = bool(s1[8] & 0x8L) + (s1[8] & 0x1L) + ((bool(s1[18] & 0x2L))<<1)
status_pos = STATUS_POS[revision]
status_byte = s1[status_pos]<<4
if status_byte != 48:
status_byte = (s1[status_pos]<<4) + s1[status_pos + 1]
stat = status_byte + STATUS_PRINTER_BASE
pen, c, d = {}, NUM_PEN_POS[revision]+1, 0
num_pens = s1[NUM_PEN_POS[revision]]
index = 0
pen_data_size = PEN_DATA_SIZE[revision]
log.debug("num_pens = %d" % num_pens)
for p in range(num_pens):
info = long(s[c : c + pen_data_size], 16)
pen['index'] = index
if pen_data_size == 4:
pen['type'] = REVISION_2_TYPE_MAP.get(int((info & 0xf000L) >> 12L), 0)
if index < (num_pens / 2):
pen['kind'] = AGENT_KIND_HEAD
else:
pen['kind'] = AGENT_KIND_SUPPLY
pen['level-trigger'] = int ((info & 0x0e00L) >> 9L)
pen['health'] = int((info & 0x0180L) >> 7L)
pen['level'] = int(info & 0x007fL)
pen['id'] = 0x1f
elif pen_data_size == 8:
pen['kind'] = bool(info & 0x80000000L) + ((bool(info & 0x40000000L))<<1L)
pen['type'] = int((info & 0x3f000000L) >> 24L)
pen['id'] = int((info & 0xf80000) >> 19L)
pen['level-trigger'] = int((info & 0x70000L) >> 16L)
pen['health'] = int((info & 0xc000L) >> 14L)
pen['level'] = int(info & 0xffL)
else:
log.error("Pen data size error")
if len(z1) > 0:
# TODO: Determine cause of IndexError for C6100 (defect #1111)
try:
pen['dvc'] = long(z1s[d+1:d+5], 16)
pen['virgin'] = bool(z1[d+5] & 0x8L)
pen['hp-ink'] = bool(z1[d+5] & 0x4L)
pen['known'] = bool(z1[d+5] & 0x2L)
pen['ack'] = bool(z1[d+5] & 0x1L)
except IndexError:
pen['dvc'] = 0
pen['virgin'] = 0
pen['hp-ink'] = 0
pen['known'] = 0
pen['ack'] = 0
log.debug("pen %d %s" % (index, pen))
index += 1
pens.append(pen)
pen = {}
c += pen_data_size
d += Z_SIZE
except (IndexError, ValueError, TypeError), e:
log.warn("Status parsing error: %s" % str(e))
return {'revision' : revision,
'agents' : pens,
'top-door' : top_door,
'status-code' : stat,
'supply-door' : supply_door,
'duplexer' : duplexer,
'photo-tray' : photo_tray,
'in-tray1' : in_tray1,
'in-tray2' : in_tray2,
'media-path' : media_path,
}
# $HB0$NC0,ff,DN,IDLE,CUT,K0,C0,DP,NR,KP092,CP041
# 0 1 2 3 4 5 6 7 8 9 10
def parseVStatus(s):
pens, pen, c = [], {}, 0
fields = s.split(',')
log.debug(fields)
f0 = fields[0]
if len(f0) == 20:
# TODO: $H00000000$M00000000 style (OJ Pro 1150/70)
# Need spec
pass
elif len(f0) == 8:
for p in f0:
if c == 0:
#assert p == '$'
c += 1
elif c == 1:
if p in ('a', 'A'):
pen['type'], pen['kind'] = AGENT_TYPE_NONE, AGENT_KIND_NONE
c += 1
elif c == 2:
pen['health'] = AGENT_HEALTH_OK
pen['kind'] = AGENT_KIND_HEAD_AND_SUPPLY
if p in ('b', 'B'): pen['type'] = AGENT_TYPE_BLACK
elif p in ('c', 'C'): pen['type'] = AGENT_TYPE_CMY
elif p in ('d', 'D'): pen['type'] = AGENT_TYPE_KCM
elif p in ('u', 'U'): pen['type'], pen['health'] = AGENT_TYPE_NONE, AGENT_HEALTH_MISINSTALLED
c += 1
elif c == 3:
if p == '0': pen['state'] = 1
else: pen['state'] = 0
pen['level'] = 0
i = 8
while True:
try:
f = fields[i]
except IndexError:
break
else:
if f[:2] == 'KP' and pen['type'] == AGENT_TYPE_BLACK:
pen['level'] = int(f[2:])
elif f[:2] == 'CP' and pen['type'] == AGENT_TYPE_CMY:
pen['level'] = int(f[2:])
i += 1
pens.append(pen)
pen = {}
c = 0
else:
pass
try:
fields[2]
except IndexError:
top_lid = 1 # something went wrong!
else:
if fields[2] == 'DN':
top_lid = 1
else:
top_lid = 2
try:
stat = vstatus_xlate.get(fields[3].lower(), STATUS_PRINTER_IDLE)
except IndexError:
stat = STATUS_PRINTER_IDLE # something went wrong!
return {'revision' : STATUS_REV_V,
'agents' : pens,
'top-door' : top_lid,
'status-code': stat,
'supply-door': SUPPLY_DOOR_NOT_PRESENT,
'duplexer' : DUPLEXER_NOT_PRESENT,
'photo-tray' : PHOTO_TRAY_NOT_PRESENT,
'in-tray1' : IN_TRAY_NOT_PRESENT,
'in-tray2' : IN_TRAY_NOT_PRESENT,
'media-path' : MEDIA_PATH_CUT_SHEET, # ?
}
def parseStatus(DeviceID):
if 'VSTATUS' in DeviceID:
return parseVStatus(DeviceID['VSTATUS'])
elif 'S' in DeviceID:
return parseSStatus(DeviceID['S'], DeviceID.get('Z', ''))
else:
return STATUS_BLOCK_UNKNOWN
def LaserJetDeviceStatusToPrinterStatus(device_status, printer_status, detected_error_state):
stat = STATUS_PRINTER_IDLE
if device_status in (pml.DEVICE_STATUS_WARNING, pml.DEVICE_STATUS_DOWN):
if detected_error_state & pml.DETECTED_ERROR_STATE_LOW_PAPER_MASK and \
not (detected_error_state & pml.DETECTED_ERROR_STATE_NO_PAPER_MASK):
stat = STATUS_PRINTER_LOW_PAPER
elif detected_error_state & pml.DETECTED_ERROR_STATE_NO_PAPER_MASK:
stat = STATUS_PRINTER_OUT_OF_PAPER
elif detected_error_state & pml.DETECTED_ERROR_STATE_DOOR_OPEN_MASK:
stat = STATUS_PRINTER_DOOR_OPEN
elif detected_error_state & pml.DETECTED_ERROR_STATE_JAMMED_MASK:
stat = STATUS_PRINTER_MEDIA_JAM
elif detected_error_state & pml.DETECTED_ERROR_STATE_OUT_CART_MASK:
stat = STATUS_PRINTER_NO_TONER
elif detected_error_state & pml.DETECTED_ERROR_STATE_LOW_CART_MASK:
stat = STATUS_PRINTER_LOW_TONER
elif detected_error_state == pml.DETECTED_ERROR_STATE_SERVICE_REQUEST_MASK:
stat = STATUS_PRINTER_SERVICE_REQUEST
elif detected_error_state & pml.DETECTED_ERROR_STATE_OFFLINE_MASK:
stat = STATUS_PRINTER_OFFLINE
else:
if printer_status == pml.PRINTER_STATUS_IDLE:
stat = STATUS_PRINTER_IDLE
elif printer_status == pml.PRINTER_STATUS_PRINTING:
stat = STATUS_PRINTER_PRINTING
elif printer_status == pml.PRINTER_STATUS_WARMUP:
stat = STATUS_PRINTER_WARMING_UP
return stat
# Map from ISO 10175/10180 to HPLIP types
COLORANT_INDEX_TO_AGENT_TYPE_MAP = {
'other' : AGENT_TYPE_UNSPECIFIED,
'unknown' : AGENT_TYPE_UNSPECIFIED,
'blue' : AGENT_TYPE_BLUE,
'cyan' : AGENT_TYPE_CYAN,
'magenta': AGENT_TYPE_MAGENTA,
'yellow' : AGENT_TYPE_YELLOW,
'black' : AGENT_TYPE_BLACK,
}
MARKER_SUPPLES_TYPE_TO_AGENT_KIND_MAP = {
pml.OID_MARKER_SUPPLIES_TYPE_OTHER : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_UNKNOWN : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_TONER : AGENT_KIND_TONER_CARTRIDGE,
pml.OID_MARKER_SUPPLIES_TYPE_WASTE_TONER : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_INK : AGENT_KIND_SUPPLY,
pml.OID_MARKER_SUPPLIES_TYPE_INK_CART : AGENT_KIND_HEAD_AND_SUPPLY,
pml.OID_MARKER_SUPPLIES_TYPE_INK_RIBBON : AGENT_KIND_HEAD_AND_SUPPLY,
pml.OID_MARKER_SUPPLIES_TYPE_WASTE_INK : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_OPC : AGENT_KIND_DRUM_KIT,
pml.OID_MARKER_SUPPLIES_TYPE_DEVELOPER : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_FUSER_OIL : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_SOLID_WAX : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_RIBBON_WAX : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_WASTE_WAX : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_FUSER : AGENT_KIND_MAINT_KIT,
pml.OID_MARKER_SUPPLIES_TYPE_CORONA_WIRE : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_FUSER_OIL_WICK : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_CLEANER_UNIT : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_FUSER_CLEANING_PAD : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_TRANSFER_UNIT : AGENT_KIND_TRANSFER_KIT,
pml.OID_MARKER_SUPPLIES_TYPE_TONER_CART : AGENT_KIND_TONER_CARTRIDGE,
pml.OID_MARKER_SUPPLIES_TYPE_FUSER_OILER : AGENT_KIND_UNKNOWN,
pml.OID_MARKER_SUPPLIES_TYPE_ADF_MAINT_KIT : AGENT_KIND_ADF_KIT,
}
def StatusType3( dev, parsedID ): # LaserJet Status (PML/SNMP)
try:
dev.openPML()
#result_code, on_off_line = dev.getPML( pml.OID_ON_OFF_LINE, pml.INT_SIZE_BYTE )
#result_code, sleep_mode = dev.getPML( pml.OID_SLEEP_MODE, pml.INT_SIZE_BYTE )
result_code, printer_status = dev.getPML( pml.OID_PRINTER_STATUS, pml.INT_SIZE_BYTE )
result_code, device_status = dev.getPML( pml.OID_DEVICE_STATUS, pml.INT_SIZE_BYTE )
result_code, cover_status = dev.getPML( pml.OID_COVER_STATUS, pml.INT_SIZE_BYTE )
result_code, value = dev.getPML( pml.OID_DETECTED_ERROR_STATE )
except Error:
dev.closePML()
return {'revision' : STATUS_REV_UNKNOWN,
'agents' : [],
'top-door' : 0,
'status-code' : STATUS_UNKNOWN,
'supply-door' : 0,
'duplexer' : 1,
'photo-tray' : 0,
'in-tray1' : 0,
'in-tray2' : 0,
'media-path' : 0,
}
try:
detected_error_state = struct.unpack( 'B', value[0])[0]
except (IndexError, TypeError):
detected_error_state = pml.DETECTED_ERROR_STATE_OFFLINE_MASK
agents, x = [], 1
while True:
log.debug( "%s Agent: %d %s" % ("*"*10, x, "*"*10))
log.debug("OID_MARKER_SUPPLIES_TYPE_%d:" % x)
oid = ( pml.OID_MARKER_SUPPLIES_TYPE_x % x, pml.OID_MARKER_SUPPLIES_TYPE_x_TYPE )
result_code, value = dev.getPML( oid, pml.INT_SIZE_BYTE )
if result_code != ERROR_SUCCESS or value is None:
log.debug("End of supply information.")
break
for a in MARKER_SUPPLES_TYPE_TO_AGENT_KIND_MAP:
if value == a:
agent_kind = MARKER_SUPPLES_TYPE_TO_AGENT_KIND_MAP[a]
break
else:
agent_kind = AGENT_KIND_UNKNOWN
# TODO: Deal with printers that return -1 and -2 for level and max (LJ3380)
log.debug("OID_MARKER_SUPPLIES_LEVEL_%d:" % x)
oid = ( pml.OID_MARKER_SUPPLIES_LEVEL_x % x, pml.OID_MARKER_SUPPLIES_LEVEL_x_TYPE )
result_code, agent_level = dev.getPML( oid )
if result_code != ERROR_SUCCESS:
log.debug("Failed")
break
log.debug( 'agent%d-level: %d' % ( x, agent_level ) )
log.debug("OID_MARKER_SUPPLIES_MAX_%d:" % x)
oid = ( pml.OID_MARKER_SUPPLIES_MAX_x % x, pml.OID_MARKER_SUPPLIES_MAX_x_TYPE )
result_code, agent_max = dev.getPML( oid )
if agent_max == 0: agent_max = 1
if result_code != ERROR_SUCCESS:
log.debug("Failed")
break
log.debug( 'agent%d-max: %d' % ( x, agent_max ) )
log.debug("OID_MARKER_SUPPLIES_COLORANT_INDEX_%d:" % x)
oid = ( pml.OID_MARKER_SUPPLIES_COLORANT_INDEX_x % x, pml.OID_MARKER_SUPPLIES_COLORANT_INDEX_x_TYPE )
result_code, colorant_index = dev.getPML( oid )
if result_code != ERROR_SUCCESS: # 3080, 3055 will fail here
log.debug("Failed")
agent_type = AGENT_TYPE_BLACK
#break
else:
log.debug("Colorant index: %d" % colorant_index)
log.debug("OID_MARKER_COLORANT_VALUE_%d" % x)
oid = ( pml.OID_MARKER_COLORANT_VALUE_x % colorant_index, pml.OID_MARKER_COLORANT_VALUE_x_TYPE )
result_code, colorant_value = dev.getPML( oid )
if result_code != ERROR_SUCCESS:
log.debug("Failed. Defaulting to black.")
agent_type = AGENT_TYPE_BLACK
#else:
if 1:
if agent_kind in (AGENT_KIND_MAINT_KIT, AGENT_KIND_ADF_KIT,
AGENT_KIND_DRUM_KIT, AGENT_KIND_TRANSFER_KIT):
agent_type = AGENT_TYPE_UNSPECIFIED
else:
agent_type = AGENT_TYPE_BLACK
if result_code != ERROR_SUCCESS:
log.debug("OID_MARKER_SUPPLIES_DESCRIPTION_%d:" % x)
oid = (pml.OID_MARKER_SUPPLIES_DESCRIPTION_x % x, pml.OID_MARKER_SUPPLIES_DESCRIPTION_x_TYPE)
result_code, colorant_value = dev.getPML( oid )
if result_code != ERROR_SUCCESS:
log.debug("Failed")
break
if colorant_value is not None:
log.debug("colorant value: %s" % colorant_value)
colorant_value = colorant_value.lower().strip()
for c in COLORANT_INDEX_TO_AGENT_TYPE_MAP:
if colorant_value.find(c) >= 0:
agent_type = COLORANT_INDEX_TO_AGENT_TYPE_MAP[c]
break
else:
agent_type = AGENT_TYPE_BLACK
else: # SUCCESS
if colorant_value is not None:
log.debug("colorant value: %s" % colorant_value)
agent_type = COLORANT_INDEX_TO_AGENT_TYPE_MAP.get( colorant_value, AGENT_TYPE_BLACK )
if agent_type == AGENT_TYPE_NONE:
if agent_kind == AGENT_KIND_TONER_CARTRIDGE:
agent_type = AGENT_TYPE_BLACK
else:
agent_type = AGENT_TYPE_UNSPECIFIED
log.debug("OID_MARKER_STATUS_%d:" % x)
oid = ( pml.OID_MARKER_STATUS_x % x, pml.OID_MARKER_STATUS_x_TYPE )
result_code, agent_status = dev.getPML( oid )
if result_code != ERROR_SUCCESS:
log.debug("Failed")
agent_trigger = AGENT_LEVEL_TRIGGER_SUFFICIENT_0
agent_health = AGENT_HEALTH_OK
else:
agent_trigger = AGENT_LEVEL_TRIGGER_SUFFICIENT_0
if agent_status is None:
agent_health = AGENT_HEALTH_OK
elif agent_status == pml.OID_MARKER_STATUS_OK:
agent_health = AGENT_HEALTH_OK
elif agent_status == pml.OID_MARKER_STATUS_MISINSTALLED:
agent_health = AGENT_HEALTH_MISINSTALLED
elif agent_status in ( pml.OID_MARKER_STATUS_LOW_TONER_CONT,
pml.OID_MARKER_STATUS_LOW_TONER_STOP ):
agent_health = AGENT_HEALTH_OK
agent_trigger = AGENT_LEVEL_TRIGGER_MAY_BE_LOW
else:
agent_health = AGENT_HEALTH_OK
agent_level = int(agent_level/agent_max * 100)
log.debug("agent%d: kind=%d, type=%d, health=%d, level=%d, level-trigger=%d" % \
(x, agent_kind, agent_type, agent_health, agent_level, agent_trigger))
agents.append({'kind' : agent_kind,
'type' : agent_type,
'health' : agent_health,
'level' : agent_level,
'level-trigger' : agent_trigger,})
x += 1
if x > 20:
break
printer_status = printer_status or STATUS_PRINTER_IDLE
log.debug("printer_status=%d" % printer_status)
device_status = device_status or pml.DEVICE_STATUS_RUNNING
log.debug("device_status=%d" % device_status)
cover_status = cover_status or pml.COVER_STATUS_CLOSED
log.debug("cover_status=%d" % cover_status)
detected_error_state = detected_error_state or pml.DETECTED_ERROR_STATE_NO_ERROR
log.debug("detected_error_state=%d (0x%x)" % (detected_error_state, detected_error_state))
stat = LaserJetDeviceStatusToPrinterStatus(device_status, printer_status, detected_error_state)
log.debug("Printer status=%d" % stat)
if stat == STATUS_PRINTER_DOOR_OPEN:
supply_door = 0
else:
supply_door = 1
return {'revision' : STATUS_REV_UNKNOWN,
'agents' : agents,
'top-door' : cover_status,
'status-code' : stat,
'supply-door' : supply_door,
'duplexer' : 1,
'photo-tray' : 0,
'in-tray1' : 1,
'in-tray2' : 1,
'media-path' : 1,
}
def setup_panel_translator():
printables = list(
"""0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~""")
map = {}
for x in [chr(x) for x in range(0,256)]:
if x in printables:
map[x] = x
else:
map[x] = '\x20'
map.update({'\x10' : '\xab',
'\x11' : '\xbb',
'\x12' : '\xa3',
'\x13' : '\xbb',
'\x80' : '\xab',
'\x81' : '\xbb',
'\x82' : '\x2a',
'\x83' : '\x2a',
'\x85' : '\x2a',
'\xa0' : '\xab',
'\x1f' : '\x3f',
'=' : '\x20',
})
frm, to = '', ''
map_keys = map.keys()
map_keys.sort()
for x in map_keys:
frm = ''.join([frm, x])
to = ''.join([to, map[x]])
global PANEL_TRANSLATOR_FUNC
PANEL_TRANSLATOR_FUNC = utils.Translator(frm, to)
PANEL_TRANSLATOR_FUNC = None
setup_panel_translator()
def PanelCheck(dev):
line1, line2 = '', ''
if dev.io_mode not in (IO_MODE_RAW, IO_MODE_UNI):
try:
dev.openPML()
except Error:
pass
else:
oids = [(pml.OID_HP_LINE1, pml.OID_HP_LINE2),
(pml.OID_SPM_LINE1, pml.OID_SPM_LINE2)]
for oid1, oid2 in oids:
result, line1 = dev.getPML(oid1)
if result < pml.ERROR_MAX_OK:
line1 = PANEL_TRANSLATOR_FUNC(line1).rstrip()
if '\x0a' in line1:
line1, line2 = line1.split('\x0a', 1)
break
result, line2 = dev.getPML(oid2)
if result < pml.ERROR_MAX_OK:
line2 = PANEL_TRANSLATOR_FUNC(line2).rstrip()
break
return bool(line1 or line2), line1 or '', line2 or ''
BATTERY_HEALTH_MAP = {0 : AGENT_HEALTH_OK,
1 : AGENT_HEALTH_OVERTEMP,
2 : AGENT_HEALTH_CHARGING,
3 : AGENT_HEALTH_MISINSTALLED,
4 : AGENT_HEALTH_FAILED,
}
BATTERY_TRIGGER_MAP = {0 : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
1 : AGENT_LEVEL_TRIGGER_ALMOST_DEFINITELY_OUT,
2 : AGENT_LEVEL_TRIGGER_PROBABLY_OUT,
3 : AGENT_LEVEL_TRIGGER_SUFFICIENT_4,
4 : AGENT_LEVEL_TRIGGER_SUFFICIENT_2,
5 : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
}
BATTERY_PML_TRIGGER_MAP = {
(100, 80) : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
(79, 60) : AGENT_LEVEL_TRIGGER_SUFFICIENT_1,
(59, 40) : AGENT_LEVEL_TRIGGER_SUFFICIENT_2,
(39, 30) : AGENT_LEVEL_TRIGGER_SUFFICIENT_3,
(29, 20) : AGENT_LEVEL_TRIGGER_SUFFICIENT_4,
(19, 10) : AGENT_LEVEL_TRIGGER_MAY_BE_LOW,
(9, 5) : AGENT_LEVEL_TRIGGER_PROBABLY_OUT,
(4, -1) : AGENT_LEVEL_TRIGGER_ALMOST_DEFINITELY_OUT,
}
def BatteryCheck(dev, status_block, battery_check):
try_dynamic_counters = False
try:
try:
dev.openPML()
except Error:
if battery_check == STATUS_BATTERY_CHECK_STD:
log.debug("PML channel open failed. Trying dynamic counters...")
try_dynamic_counters = True
else:
if battery_check == STATUS_BATTERY_CHECK_PML:
result, battery_level = dev.getPML(pml.OID_BATTERY_LEVEL_2)
if result > pml.ERROR_MAX_OK:
status_block['agents'].append({
'kind' : AGENT_KIND_INT_BATTERY,
'type' : AGENT_TYPE_UNSPECIFIED,
'health' : AGENT_HEALTH_UNKNOWN,
'level' : 0,
'level-trigger' : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
})
return
else:
status_block['agents'].append({
'kind' : AGENT_KIND_INT_BATTERY,
'type' : AGENT_TYPE_UNSPECIFIED,
'health' : AGENT_HEALTH_OK,
'level' : battery_level,
'level-trigger' : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
})
return
else: # STATUS_BATTERY_CHECK_STD
result, battery_level = dev.getPML(pml.OID_BATTERY_LEVEL)
result, power_mode = dev.getPML(pml.OID_POWER_MODE)
if battery_level is not None and \
power_mode is not None:
if power_mode & pml.POWER_MODE_BATTERY_LEVEL_KNOWN and \
battery_level >= 0:
for x in BATTERY_PML_TRIGGER_MAP:
if x[0] >= battery_level > x[1]:
battery_trigger_level = BATTERY_PML_TRIGGER_MAP[x]
break
if power_mode & pml.POWER_MODE_CHARGING:
agent_health = AGENT_HEALTH_CHARGING
elif power_mode & pml.POWER_MODE_DISCHARGING:
agent_health = AGENT_HEALTH_DISCHARGING
else:
agent_health = AGENT_HEALTH_OK
status_block['agents'].append({
'kind' : AGENT_KIND_INT_BATTERY,
'type' : AGENT_TYPE_UNSPECIFIED,
'health' : agent_health,
'level' : battery_level,
'level-trigger' : battery_trigger_level,
})
return
else:
status_block['agents'].append({
'kind' : AGENT_KIND_INT_BATTERY,
'type' : AGENT_TYPE_UNSPECIFIED,
'health' : AGENT_HEALTH_UNKNOWN,
'level' : 0,
'level-trigger' : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
})
return
else:
try_dynamic_counters = True
finally:
dev.closePML()
if battery_check == STATUS_BATTERY_CHECK_STD and \
try_dynamic_counters:
try:
try:
battery_health = dev.getDynamicCounter(200)
battery_trigger_level = dev.getDynamicCounter(201)
battery_level = dev.getDynamicCounter(202)
status_block['agents'].append({
'kind' : AGENT_KIND_INT_BATTERY,
'type' : AGENT_TYPE_UNSPECIFIED,
'health' : BATTERY_HEALTH_MAP[battery_health],
'level' : battery_level,
'level-trigger' : BATTERY_TRIGGER_MAP[battery_trigger_level],
})
except Error:
status_block['agents'].append({
'kind' : AGENT_KIND_INT_BATTERY,
'type' : AGENT_TYPE_UNSPECIFIED,
'health' : AGENT_HEALTH_UNKNOWN,
'level' : 0,
'level-trigger' : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
})
finally:
dev.closePrint()
else:
status_block['agents'].append({
'kind' : AGENT_KIND_INT_BATTERY,
'type' : AGENT_TYPE_UNSPECIFIED,
'health' : AGENT_HEALTH_UNKNOWN,
'level' : 0,
'level-trigger' : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
})
# this works for 2 pen products that allow 1 or 2 pens inserted
# from: k, kcm, cmy, ggk
def getPenConfiguration(s): # s=status dict from parsed device ID
pens = [p['type'] for p in s['agents']]
if utils.all(pens, lambda x : x==AGENT_TYPE_NONE):
return AGENT_CONFIG_NONE
if AGENT_TYPE_NONE in pens:
if AGENT_TYPE_BLACK in pens:
return AGENT_CONFIG_BLACK_ONLY
elif AGENT_TYPE_CMY in pens:
return AGENT_CONFIG_COLOR_ONLY
elif AGENT_TYPE_KCM in pens:
return AGENT_CONFIG_PHOTO_ONLY
elif AGENT_TYPE_GGK in pens:
return AGENT_CONFIG_GREY_ONLY
else:
return AGENT_CONFIG_INVALID
else:
if AGENT_TYPE_BLACK in pens and AGENT_TYPE_CMY in pens:
return AGENT_CONFIG_COLOR_AND_BLACK
elif AGENT_TYPE_CMY in pens and AGENT_TYPE_KCM in pens:
return AGENT_CONFIG_COLOR_AND_PHOTO
elif AGENT_TYPE_CMY in pens and AGENT_TYPE_GGK in pens:
return AGENT_CONFIG_COLOR_AND_GREY
else:
return AGENT_CONFIG_INVALID
def getFaxStatus(dev):
tx_active, rx_active = False, False
if dev.io_mode not in (IO_MODE_UNI, IO_MODE_RAW):
try:
dev.openPML()
result_code, tx_state = dev.getPML(pml.OID_FAXJOB_TX_STATUS)
if result_code == ERROR_SUCCESS and tx_state:
if tx_state not in (pml.FAXJOB_TX_STATUS_IDLE, pml.FAXJOB_TX_STATUS_DONE):
tx_active = True
result_code, rx_state = dev.getPML(pml.OID_FAXJOB_RX_STATUS)
if result_code == ERROR_SUCCESS and rx_state:
if rx_state not in (pml.FAXJOB_RX_STATUS_IDLE, pml.FAXJOB_RX_STATUS_DONE):
rx_active = True
finally:
dev.closePML()
return tx_active, rx_active
TYPE6_STATUS_CODE_MAP = {
0 : STATUS_PRINTER_IDLE, #</DevStatusUnknown>
-19928: STATUS_PRINTER_IDLE,
-18995: STATUS_PRINTER_CANCELING,
-17974: STATUS_PRINTER_WARMING_UP,
-17973: STATUS_PRINTER_PEN_CLEANING, # sic
-18993: STATUS_PRINTER_BUSY,
-17949: STATUS_PRINTER_BUSY,
-19720: STATUS_PRINTER_MANUAL_DUPLEX_BLOCK,
-19678: STATUS_PRINTER_BUSY,
-19695: STATUS_PRINTER_OUT_OF_PAPER,
-17985: STATUS_PRINTER_MEDIA_JAM,
-19731: STATUS_PRINTER_OUT_OF_PAPER,
-18974: STATUS_PRINTER_BUSY, #?
-19730: STATUS_PRINTER_OUT_OF_PAPER,
-19729: STATUS_PRINTER_OUT_OF_PAPER,
-19933: STATUS_PRINTER_HARD_ERROR, # out of memory
-17984: STATUS_PRINTER_DOOR_OPEN,
-19694: STATUS_PRINTER_DOOR_OPEN,
-18992: STATUS_PRINTER_MANUAL_FEED_BLOCKED, # ?
-19690: STATUS_PRINTER_MEDIA_JAM, # tray 1
-19689: STATUS_PRINTER_MEDIA_JAM, # tray 2
-19611: STATUS_PRINTER_MEDIA_JAM, # tray 3
-19686: STATUS_PRINTER_MEDIA_JAM,
-19688: STATUS_PRINTER_MEDIA_JAM, # paper path
-19685: STATUS_PRINTER_MEDIA_JAM, # cart area
-19684: STATUS_PRINTER_MEDIA_JAM, # output bin
-18848: STATUS_PRINTER_MEDIA_JAM, # duplexer
-18847: STATUS_PRINTER_MEDIA_JAM, # door open
-18846: STATUS_PRINTER_MEDIA_JAM, # tray 2
-19687: STATUS_PRINTER_MEDIA_JAM, # open door
-17992: STATUS_PRINTER_MEDIA_JAM, # mispick
-19700: STATUS_PRINTER_HARD_ERROR, # invalid driver
-17996: STATUS_PRINTER_FUSER_ERROR, # fuser error
-17983: STATUS_PRINTER_FUSER_ERROR,
-17982: STATUS_PRINTER_FUSER_ERROR,
-17981: STATUS_PRINTER_FUSER_ERROR,
-17971: STATUS_PRINTER_FUSER_ERROR,
-17995: STATUS_PRINTER_HARD_ERROR, # beam error
-17994: STATUS_PRINTER_HARD_ERROR, # scanner error
-17993: STATUS_PRINTER_HARD_ERROR, # fan error
-18994: STATUS_PRINTER_HARD_ERROR,
-17986: STATUS_PRINTER_HARD_ERROR,
-19904: STATUS_PRINTER_HARD_ERROR,
-19701: STATUS_PRINTER_NON_HP_INK, # [sic]
-19613: STATUS_PRINTER_IDLE, # HP
-19654: STATUS_PRINTER_NON_HP_INK, # [sic]
-19682: STATUS_PRINTER_HARD_ERROR, # resinstall
-19693: STATUS_PRINTER_IDLE, # ?? To Accept
-19752: STATUS_PRINTER_LOW_TONER,
-19723: STATUS_PRINTER_BUSY,
-19703: STATUS_PRINTER_BUSY,
-19739: STATUS_PRINTER_NO_TONER,
-19927: STATUS_PRINTER_BUSY,
-19932: STATUS_PRINTER_BUSY,
-19931: STATUS_PRINTER_BUSY,
-11989: STATUS_PRINTER_BUSY,
-11995: STATUS_PRINTER_BUSY, # ADF loaded
-19954: STATUS_PRINTER_CANCELING,
-19955: STATUS_PRINTER_REPORT_PRINTING,
-19956: STATUS_PRINTER_REPORT_PRINTING,
-19934: STATUS_PRINTER_HARD_ERROR,
-19930: STATUS_PRINTER_BUSY,
-11990: STATUS_PRINTER_DOOR_OPEN,
-11999: STATUS_PRINTER_MEDIA_JAM, # ADF
-12000: STATUS_PRINTER_MEDIA_JAM, # ADF
-11998: STATUS_PRINTER_MEDIA_JAM, # ADF
-11986: STATUS_PRINTER_HARD_ERROR, # scanner
-11994: STATUS_PRINTER_BUSY,
-14967: STATUS_PRINTER_BUSY,
-19912: STATUS_PRINTER_HARD_ERROR,
-14962: STATUS_PRINTER_BUSY, # copy pending
-14971: STATUS_PRINTER_BUSY, # copying
-14973: STATUS_PRINTER_BUSY, # copying being canceled
-14972: STATUS_PRINTER_BUSY, # copying canceled
-14966: STATUS_PRINTER_DOOR_OPEN,
-14974: STATUS_PRINTER_MEDIA_JAM,
-14969: STATUS_PRINTER_HARD_ERROR,
-14968: STATUS_PRINTER_HARD_ERROR,
-12996: STATUS_PRINTER_BUSY, # scan
-12994: STATUS_PRINTER_BUSY, # scan
-12993: STATUS_PRINTER_BUSY, # scan
-12991: STATUS_PRINTER_BUSY, # scan
-12995: STATUS_PRINTER_BUSY, # scan
-12997: STATUS_PRINTER_HARD_ERROR, # scan
-12990: STATUS_PRINTER_BUSY,
-12998: STATUS_PRINTER_BUSY,
-13000: STATUS_PRINTER_DOOR_OPEN,
-12999: STATUS_PRINTER_MEDIA_JAM,
-13859: STATUS_PRINTER_BUSY,
-13858: STATUS_PRINTER_BUSY, #</DevStatusDialingOut>
-13868: STATUS_PRINTER_BUSY, #</DevStatusRedialPending>
-13867: STATUS_PRINTER_BUSY, #</DevStatusFaxSendCanceled>
-13857: STATUS_PRINTER_BUSY, #</DevStatusConnecting>
-13856: STATUS_PRINTER_BUSY, #</DevStatusSendingPage>
-13855: STATUS_PRINTER_BUSY, #</DevStatusOnePageSend>
-13854: STATUS_PRINTER_BUSY, #</DevStatusMultiplePagesSent>
-13853: STATUS_PRINTER_BUSY, #</DevStatusSenderCancelingFax>
-13839: STATUS_PRINTER_BUSY, #</DevStatusIncomingCall>
-13842: STATUS_PRINTER_BUSY, #</DevStatusBlockingFax>
-13838: STATUS_PRINTER_BUSY, #</DevStatusReceivingFax>
-13847: STATUS_PRINTER_BUSY, #</DevStatusSinglePageReceived>
-13846: STATUS_PRINTER_BUSY, #</DevStatusDoublePagesReceived>
-13845: STATUS_PRINTER_BUSY, #</DevStatusTriplePagesReceived>
-13844: STATUS_PRINTER_BUSY, #</DevStatusPrintingFax>
-13840: STATUS_PRINTER_BUSY, #</DevStatusCancelingFaxPrint>
-13843: STATUS_PRINTER_BUSY, #</DevStatusFaxCancelingReceive>
-13850: STATUS_PRINTER_BUSY, #</DevStatusFaxCanceledReceive>
-13851: STATUS_PRINTER_BUSY, #</DevStatusFaxDelayedSendMemoryFull>
-13836: STATUS_PRINTER_BUSY, #</DevStatusNoDialTone>
-13864: STATUS_PRINTER_BUSY, #</DevStatusNoFaxAnswer>
-13863: STATUS_PRINTER_BUSY, #</DevStatusFaxBusy>
-13865: STATUS_PRINTER_BUSY, #</DevStatusNoDocumentSent>
-13862: STATUS_PRINTER_BUSY, #</DevStatusFaxSendError>
-13837: STATUS_PRINTER_BUSY, #</DevStatusT30Error>
-13861: STATUS_PRINTER_BUSY, #</DevStatusFaxMemoryFullSend>
-13866: STATUS_PRINTER_BUSY, #</DevStatusADFNotCleared>
-13841: STATUS_PRINTER_BUSY, #</DevStatusNoFaxDetected>
-13848: STATUS_PRINTER_BUSY, #</DevStatusFaxMemoryFullReceive>
-13849: STATUS_PRINTER_BUSY, #</DevStatusFaxReceiveError>
}
def StatusType6(dev): # LaserJet Status (XML)
info_device_status = cStringIO.StringIO()
info_ssp = cStringIO.StringIO()
try:
dev.getEWSUrl("/hp/device/info_device_status.xml", info_device_status)
dev.getEWSUrl("/hp/device/info_ssp.xml", info_ssp)
except:
pass
info_device_status = info_device_status.getvalue()
info_ssp = info_ssp.getvalue()
device_status = {}
ssp = {}
if info_device_status:
try:
log.debug_block("info_device_status", info_device_status)
device_status = utils.XMLToDictParser().parseXML(info_device_status)
log.debug(device_status)
except expat.ExpatError:
log.error("Device Status XML parse error")
device_status = {}
if info_ssp:
try:
log.debug_block("info_spp", info_ssp)
ssp = utils.XMLToDictParser().parseXML(info_ssp)
log.debug(ssp)
except expat.ExpatError:
log.error("SSP XML parse error")
ssp = {}
status_code = device_status.get('devicestatuspage-devicestatus-statuslist-status-code-0', 0)
if not status_code:
status_code = ssp.get('devicestatuspage-devicestatus-statuslist-status-code-0', 0)
black_supply_level = device_status.get('devicestatuspage-suppliesstatus-blacksupply-percentremaining', 0)
black_supply_low = ssp.get('suppliesstatuspage-blacksupply-lowreached', 0)
agents = []
agents.append({ 'kind' : AGENT_KIND_TONER_CARTRIDGE,
'type' : AGENT_TYPE_BLACK,
'health' : 0,
'level' : black_supply_level,
'level-trigger' : 0,
})
if dev.tech_type == TECH_TYPE_COLOR_LASER:
cyan_supply_level = device_status.get('devicestatuspage-suppliesstatus-cyansupply-percentremaining', 0)
agents.append({ 'kind' : AGENT_KIND_TONER_CARTRIDGE,
'type' : AGENT_TYPE_CYAN,
'health' : 0,
'level' : cyan_supply_level,
'level-trigger' : 0,
})
magenta_supply_level = device_status.get('devicestatuspage-suppliesstatus-magentasupply-percentremaining', 0)
agents.append({ 'kind' : AGENT_KIND_TONER_CARTRIDGE,
'type' : AGENT_TYPE_MAGENTA,
'health' : 0,
'level' : magenta_supply_level,
'level-trigger' : 0,
})
yellow_supply_level = device_status.get('devicestatuspage-suppliesstatus-yellowsupply-percentremaining', 0)
agents.append({ 'kind' : AGENT_KIND_TONER_CARTRIDGE,
'type' : AGENT_TYPE_YELLOW,
'health' : 0,
'level' : yellow_supply_level,
'level-trigger' : 0,
})
return {'revision' : STATUS_REV_UNKNOWN,
'agents' : agents,
'top-door' : 0,
'supply-door' : 0,
'duplexer' : 1,
'photo-tray' : 0,
'in-tray1' : 1,
'in-tray2' : 1,
'media-path' : 1,
'status-code' : TYPE6_STATUS_CODE_MAP.get(status_code, STATUS_PRINTER_IDLE),
}
# PJL status codes
PJL_STATUS_MAP = {
10001: STATUS_PRINTER_IDLE, # online
10002: STATUS_PRINTER_OFFLINE, # offline
10003: STATUS_PRINTER_WARMING_UP,
10004: STATUS_PRINTER_BUSY, # self test
10005: STATUS_PRINTER_BUSY, # reset
10006: STATUS_PRINTER_LOW_TONER,
10007: STATUS_PRINTER_CANCELING,
10010: STATUS_PRINTER_SERVICE_REQUEST,
10011: STATUS_PRINTER_OFFLINE,
10013: STATUS_PRINTER_BUSY,
10014: STATUS_PRINTER_REPORT_PRINTING,
10015: STATUS_PRINTER_BUSY,
10016: STATUS_PRINTER_BUSY,
10017: STATUS_PRINTER_REPORT_PRINTING,
10018: STATUS_PRINTER_BUSY,
10019: STATUS_PRINTER_BUSY,
10020: STATUS_PRINTER_BUSY,
10021: STATUS_PRINTER_BUSY,
10022: STATUS_PRINTER_REPORT_PRINTING,
10023: STATUS_PRINTER_PRINTING,
10024: STATUS_PRINTER_SERVICE_REQUEST,
10025: STATUS_PRINTER_SERVICE_REQUEST,
10026: STATUS_PRINTER_BUSY,
10027: STATUS_PRINTER_MEDIA_JAM,
10028: STATUS_PRINTER_REPORT_PRINTING,
10029: STATUS_PRINTER_PRINTING,
10030: STATUS_PRINTER_BUSY,
10031: STATUS_PRINTER_BUSY,
10032: STATUS_PRINTER_BUSY,
10033: STATUS_PRINTER_SERVICE_REQUEST,
10034: STATUS_PRINTER_CANCELING,
10035: STATUS_PRINTER_PRINTING,
10036: STATUS_PRINTER_WARMING_UP,
10200: STATUS_PRINTER_LOW_BLACK_TONER,
10201: STATUS_PRINTER_LOW_CYAN_TONER,
10202: STATUS_PRINTER_LOW_MAGENTA_TONER,
10203: STATUS_PRINTER_LOW_YELLOW_TONER,
10204: STATUS_PRINTER_LOW_TONER, # order image drum
10205: STATUS_PRINTER_LOW_BLACK_TONER, # order black drum
10206: STATUS_PRINTER_LOW_CYAN_TONER, # order cyan drum
10207: STATUS_PRINTER_LOW_MAGENTA_TONER, # order magenta drum
10208: STATUS_PRINTER_LOW_YELLOW_TONER, # order yellow drum
10209: STATUS_PRINTER_LOW_BLACK_TONER,
10210: STATUS_PRINTER_LOW_CYAN_TONER,
10211: STATUS_PRINTER_LOW_MAGENTA_TONER,
10212: STATUS_PRINTER_LOW_YELLOW_TONER,
10213: STATUS_PRINTER_SERVICE_REQUEST, # order transport kit
10214: STATUS_PRINTER_SERVICE_REQUEST, # order cleaning kit
10215: STATUS_PRINTER_SERVICE_REQUEST, # order transfer kit
10216: STATUS_PRINTER_SERVICE_REQUEST, # order fuser kit
10217: STATUS_PRINTER_SERVICE_REQUEST, # maintenance
10218: STATUS_PRINTER_LOW_TONER,
10300: STATUS_PRINTER_LOW_BLACK_TONER, # replace black toner
10301: STATUS_PRINTER_LOW_CYAN_TONER, # replace cyan toner
10302: STATUS_PRINTER_LOW_MAGENTA_TONER, # replace magenta toner
10303: STATUS_PRINTER_LOW_YELLOW_TONER, # replace yellow toner
10304: STATUS_PRINTER_SERVICE_REQUEST, # replace image drum
10305: STATUS_PRINTER_SERVICE_REQUEST, # replace black drum
10306: STATUS_PRINTER_SERVICE_REQUEST, # replace cyan drum
10307: STATUS_PRINTER_SERVICE_REQUEST, # replace magenta drum
10308: STATUS_PRINTER_SERVICE_REQUEST, # replace yellow drum
10309: STATUS_PRINTER_SERVICE_REQUEST, # replace black cart
10310: STATUS_PRINTER_SERVICE_REQUEST, # replace cyan cart
10311: STATUS_PRINTER_SERVICE_REQUEST, # replace magenta cart
10312: STATUS_PRINTER_SERVICE_REQUEST, # replace yellow cart
10313: STATUS_PRINTER_SERVICE_REQUEST, # replace transport kit
10314: STATUS_PRINTER_SERVICE_REQUEST, # replace cleaning kit
10315: STATUS_PRINTER_SERVICE_REQUEST, # replace transfer kit
10316: STATUS_PRINTER_SERVICE_REQUEST, # replace fuser kit
10317: STATUS_PRINTER_SERVICE_REQUEST,
10318: STATUS_PRINTER_SERVICE_REQUEST, # replace supplies
10400: STATUS_PRINTER_NON_HP_INK, # [sic]
10401: STATUS_PRINTER_IDLE,
10402: STATUS_PRINTER_SERVICE_REQUEST,
10403: STATUS_PRINTER_IDLE,
# 11xyy - Background paper-loading
# 12xyy - Background paper-tray status
# 15xxy - Output-bin status
# 20xxx - PJL parser errors
# 25xxx - PJL parser warnings
# 27xxx - PJL semantic errors
# 30xxx - Auto continuable conditions
30119: STATUS_PRINTER_MEDIA_JAM,
# 32xxx - PJL file system errors
# 35xxx - Potential operator intervention conditions
# 40xxx - Operator intervention conditions
40021: STATUS_PRINTER_DOOR_OPEN,
40022: STATUS_PRINTER_MEDIA_JAM,
40038: STATUS_PRINTER_LOW_TONER,
40600: STATUS_PRINTER_NO_TONER,
# 41xyy - Foreground paper-loading messages
# 43xyy - Optional paper handling device messages
# 44xyy - LJ 4xxx/5xxx paper jam messages
# 50xxx - Hardware errors
# 55xxx - Personality errors
}
MIN_PJL_ERROR_CODE = 10001
DEFAULT_PJL_ERROR_CODE = 10001
def MapPJLErrorCode(error_code, str_code=None):
if error_code < MIN_PJL_ERROR_CODE:
return STATUS_PRINTER_BUSY
if str_code is None:
str_code = str(error_code)
if len(str_code) < 5:
return STATUS_PRINTER_BUSY
status_code = PJL_STATUS_MAP.get(error_code, None)
if status_code is None:
status_code = STATUS_PRINTER_BUSY
if 10999 < error_code < 12000: # 11xyy - Background paper-loading
# x = tray #
# yy = media code
tray = int(str_code[2])
media = int(str_code[3:])
log.debug("Background paper loading for tray #%d" % tray)
log.debug("Media code = %d" % media)
elif 11999 < error_code < 13000: # 12xyy - Background paper-tray status
# x = tray #
# yy = status code
tray = int(str_code[2])
status = int(str_code[3:])
log.debug("Background paper tray status for tray #%d" % tray)
log.debug("Status code = %d" % status)
elif 14999 < error_code < 16000: # 15xxy - Output-bin status
# xx = output bin
# y = status code
bin = int(str_code[2:4])
status = int(str_code[4])
log.debug("Output bin full for bin #%d" % bin)
status_code = STATUS_PRINTER_OUTPUT_BIN_FULL
elif 19999 < error_code < 28000: # 20xxx, 25xxx, 27xxx PJL errors
status_code = STATUS_PRINTER_SERVICE_REQUEST
elif 29999 < error_code < 31000: # 30xxx - Auto continuable conditions
log.debug("Auto continuation condition #%d" % error_code)
status_code = STATUS_PRINTER_BUSY
elif 34999 < error_code < 36000: # 35xxx - Potential operator intervention conditions
status_code = STATUS_PRINTER_SERVICE_REQUEST
elif 39999 < error_code < 41000: # 40xxx - Operator intervention conditions
status_code = STATUS_PRINTER_SERVICE_REQUEST
elif 40999 < error_code < 42000: # 41xyy - Foreground paper-loading messages
# x = tray
# yy = media code
tray = int(str_code[2])
media = int(str_code[3:])
log.debug("Foreground paper loading for tray #%d" % tray)
log.debug("Media code = %d" % media)
status_code = STATUS_PRINTER_OUT_OF_PAPER
elif 41999 < error_code < 43000:
status_code = STATUS_PRINTER_MEDIA_JAM
elif 42999 < error_code < 44000: # 43xyy - Optional paper handling device messages
status_code = STATUS_PRINTER_SERVICE_REQUEST
elif 43999 < error_code < 45000: # 44xyy - LJ 4xxx/5xxx paper jam messages
status_code = STATUS_PRINTER_MEDIA_JAM
elif 49999 < error_code < 51000: # 50xxx - Hardware errors
status_code = STATUS_PRINTER_HARD_ERROR
elif 54999 < error_code < 56000 : # 55xxx - Personality errors
status_code = STATUS_PRINTER_HARD_ERROR
log.debug("Mapped PJL error code %d to status code %d" % (error_code, status_code))
return status_code
pjl_code_pat = re.compile("""^CODE\s*=\s*(\d.*)$""", re.IGNORECASE)
def StatusType8(dev): # LaserJet PJL (B&W only)
try:
# Will error if printer is busy printing...
dev.openPrint()
except Error, e:
log.warn(e.msg)
status_code = STATUS_PRINTER_BUSY
else:
try:
try:
dev.writePrint("\x1b%-12345X@PJL INFO STATUS \r\n\x1b%-12345X")
pjl_return = dev.readPrint(1024, timeout=5, allow_short_read=True)
dev.close()
log.debug_block("PJL return:", pjl_return)
str_code = '10001'
for line in pjl_return.splitlines():
line = line.strip()
match = pjl_code_pat.match(line)
if match is not None:
str_code = match.group(1)
break
log.debug("Code = %s" % str_code)
try:
error_code = int(str_code)
except ValueError:
error_code = DEFAULT_PJL_ERROR_CODE
log.debug("Error code = %d" % error_code)
status_code = MapPJLErrorCode(error_code, str_code)
except Error:
status_code = STATUS_PRINTER_HARD_ERROR
finally:
try:
dev.closePrint()
except Error:
pass
agents = []
# TODO: Only handles mono lasers...
if status_code in (STATUS_PRINTER_LOW_TONER, STATUS_PRINTER_LOW_BLACK_TONER):
health = AGENT_HEALTH_OK
level_trigger = AGENT_LEVEL_TRIGGER_MAY_BE_LOW
level = 0
elif status_code == STATUS_PRINTER_NO_TONER:
health = AGENT_HEALTH_MISINSTALLED
level_trigger = AGENT_LEVEL_TRIGGER_MAY_BE_LOW
level = 0
else:
health = AGENT_HEALTH_OK
level_trigger = AGENT_LEVEL_TRIGGER_SUFFICIENT_0
level = 100
log.debug("Agent: health=%d, level=%d, trigger=%d" % (health, level, level_trigger))
agents.append({ 'kind' : AGENT_KIND_TONER_CARTRIDGE,
'type' : AGENT_TYPE_BLACK,
'health' : health,
'level' : level,
'level-trigger' : level_trigger,
})
if dev.tech_type == TECH_TYPE_COLOR_LASER:
level = 100
level_trigger = AGENT_LEVEL_TRIGGER_SUFFICIENT_0
if status_code == STATUS_PRINTER_LOW_CYAN_TONER:
level = 0
level_trigger = AGENT_LEVEL_TRIGGER_MAY_BE_LOW
log.debug("Agent: health=%d, level=%d, trigger=%d" % (health, level, level_trigger))
agents.append({ 'kind' : AGENT_KIND_TONER_CARTRIDGE,
'type' : AGENT_TYPE_CYAN,
'health' : AGENT_HEALTH_OK,
'level' : level,
'level-trigger' : level_trigger,
})
level = 100
level_trigger = AGENT_LEVEL_TRIGGER_SUFFICIENT_0
if status_code == STATUS_PRINTER_LOW_MAGENTA_TONER:
level = 0
level_trigger = AGENT_LEVEL_TRIGGER_MAY_BE_LOW
log.debug("Agent: health=%d, level=%d, trigger=%d" % (health, level, level_trigger))
agents.append({ 'kind' : AGENT_KIND_TONER_CARTRIDGE,
'type' : AGENT_TYPE_MAGENTA,
'health' : AGENT_HEALTH_OK,
'level' : level,
'level-trigger' : level_trigger,
})
level = 100
level_trigger = AGENT_LEVEL_TRIGGER_SUFFICIENT_0
if status_code == STATUS_PRINTER_LOW_YELLOW_TONER:
level = 0
level_trigger = AGENT_LEVEL_TRIGGER_MAY_BE_LOW
log.debug("Agent: health=%d, level=%d, trigger=%d" % (health, level, level_trigger))
agents.append({ 'kind' : AGENT_KIND_TONER_CARTRIDGE,
'type' : AGENT_TYPE_YELLOW,
'health' : AGENT_HEALTH_OK,
'level' : level,
'level-trigger' : level_trigger,
})
if status_code == 40021:
top_door = 0
else:
top_door = 1
log.debug("Status code = %d" % status_code)
return { 'revision' : STATUS_REV_UNKNOWN,
'agents' : agents,
'top-door' : top_door,
'supply-door' : top_door,
'duplexer' : 0,
'photo-tray' : 0,
'in-tray1' : 1,
'in-tray2' : 1,
'media-path' : 1,
'status-code' : status_code,
}
element_type10_xlate = { 'ink' : AGENT_KIND_SUPPLY,
'inkCartridge' : AGENT_KIND_HEAD_AND_SUPPLY,
'printhead' : AGENT_KIND_HEAD,
'toner' : AGENT_KIND_TONER_CARTRIDGE,
'tonerCartridge' : AGENT_KIND_TONER_CARTRIDGE,
}
pen_type10_xlate = { 'pK' : AGENT_TYPE_PG,
'CMY' : AGENT_TYPE_CMY,
'M' : AGENT_TYPE_MAGENTA,
'C' : AGENT_TYPE_CYAN,
'Y' : AGENT_TYPE_YELLOW,
'K' : AGENT_TYPE_BLACK,
}
pen_level10_xlate = { 'ok' : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
'low' : AGENT_LEVEL_TRIGGER_MAY_BE_LOW,
'out' : AGENT_LEVEL_TRIGGER_ALMOST_DEFINITELY_OUT,
'empty' : AGENT_LEVEL_TRIGGER_ALMOST_DEFINITELY_OUT,
'missing' : AGENT_LEVEL_TRIGGER_ALMOST_DEFINITELY_OUT,
}
pen_health10_xlate = { 'ok' : AGENT_HEALTH_OK,
'misinstalled' : AGENT_HEALTH_MISINSTALLED,
'missing' : AGENT_HEALTH_MISINSTALLED,
}
def clean(data):
if data[0] is not '<':
size = -1
temp = ""
while size:
index = data.find('\r\n')
size = int(data[0:index+1], 16)
temp = temp + data[index+2:index+2+size]
data = data[index+2+size+2:len(data)]
data = temp
return data
def StatusType10FetchUrl(dev, url, footer=""):
data_fp = cStringIO.StringIO()
if footer:
data = dev.getEWSUrl_LEDM(url, data_fp, footer)
else:
data = dev.getEWSUrl_LEDM(url, data_fp)
if data:
data = data.split('\r\n\r\n', 1)[1]
if data:
data = clean(data)
return data
def StatusType10(dev): # Low End Data Model
status_block = { 'revision' : STATUS_REV_UNKNOWN,
'agents' : [],
'top-door' : TOP_DOOR_NOT_PRESENT,
'supply-door' : TOP_DOOR_NOT_PRESENT,
'duplexer' : DUPLEXER_NOT_PRESENT,
'photo-tray' : PHOTO_TRAY_NOT_PRESENT,
'in-tray1' : IN_TRAY_NOT_PRESENT,
'in-tray2' : IN_TRAY_NOT_PRESENT,
'media-path' : MEDIA_PATH_NOT_PRESENT,
'status-code' : STATUS_PRINTER_IDLE,
}
if not etree_loaded and not elementtree_loaded:
log.error("cannot get status for printer. please load ElementTree module")
return status_block
# Get the dynamic consumables configuration
data = StatusType10FetchUrl(dev, "/DevMgmt/ConsumableConfigDyn.xml")
if not data:
return status_block
data = data.replace("ccdyn:", "").replace("dd:", "")
# Parse the agent status XML
agents = []
try:
if etree_loaded:
tree = ElementTree.XML(data)
if not etree_loaded and elementtree_loaded:
tree = XML(data)
elements = tree.findall("ConsumableInfo")
for e in elements:
health = AGENT_HEALTH_OK
ink_level = 0
try:
type = e.find("ConsumableTypeEnum").text
state = e.find("ConsumableLifeState/ConsumableState").text
# level
if type == "ink" or type == "inkCartridge" or type == "toner" or type == "tonerCartridge":
ink_type = e.find("ConsumableLabelCode").text
if state != "missing":
try:
ink_level = int(e.find("ConsumablePercentageLevelRemaining").text)
except:
ink_level = 0
else:
ink_type = ''
if state == "ok":
ink_level = 100
log.debug("type '%s' state '%s' ink_type '%s' ink_level %d" % (type, state, ink_type, ink_level))
entry = { 'kind' : element_type10_xlate.get(type, AGENT_KIND_NONE),
'type' : pen_type10_xlate.get(ink_type, AGENT_TYPE_NONE),
'health' : pen_health10_xlate.get(state, AGENT_HEALTH_OK),
'level' : int(ink_level),
'level-trigger' : pen_level10_xlate.get(state, AGENT_LEVEL_TRIGGER_SUFFICIENT_0)
}
log.debug("%s" % entry)
agents.append(entry)
except AttributeError:
log.debug("no value found for attribute")
except (expat.ExpatError, UnboundLocalError):
agents = []
status_block['agents'] = agents
# Get the media handling configuration
data = StatusType10FetchUrl(dev, "/DevMgmt/MediaHandlingDyn.xml")
if not data:
return status_block
data = data.replace("mhdyn:", "").replace("dd:", "")
# Parse the media handling XML
try:
if etree_loaded:
tree = ElementTree.XML(data)
if not etree_loaded and elementtree_loaded:
tree = XML(data)
elements = tree.findall("InputTray")
except (expat.ExpatError, UnboundLocalError):
elements = []
for e in elements:
bin_name = e.find("InputBin").text
if bin_name == "Tray1":
status_block['in-tray1'] = IN_TRAY_PRESENT
elif bin_name == "Tray2":
status_block['in-tray2'] = IN_TRAY_PRESENT
elif bin_name == "PhotoTray":
status_block['photo-tray'] = PHOTO_TRAY_ENGAGED
else:
log.error("found invalid bin name '%s'" % bin_name)
try:
elements = tree.findall("Accessories/MediaHandlingDeviceFunctionType")
except UnboundLocalError:
elements = []
for e in elements:
if e.text == "autoDuplexor":
status_block['duplexer'] = DUPLEXER_DOOR_CLOSED
# Get the product status
data = StatusType10FetchUrl(dev, "/DevMgmt/ProductStatusDyn.xml")
if not data:
return status_block
data = data.replace("psdyn:", "").replace("locid:", "")
data = data.replace("pscat:", "").replace("dd:", "").replace("ad:", "")
# Parse the product status XML
try:
if etree_loaded:
tree = ElementTree.XML(data)
if not etree_loaded and elementtree_loaded:
tree = XML(data)
elements = tree.findall("Status/StatusCategory")
except (expat.ExpatError, UnboundLocalError):
elements = []
for e in elements:
if e.text == "processing":
status_block['status-code'] = STATUS_PRINTER_PRINTING
if e.text == "closeDoorOrCover":
status_block['status-code'] = STATUS_PRINTER_DOOR_OPEN
elif e.text == "shuttingDown":
status_block['status-code'] = STATUS_PRINTER_TURNING_OFF
elif e.text == "cancelJob":
status_block['status-code'] = STATUS_PRINTER_CANCELING
elif e.text == "trayEmptyOrOpen":
status_block['status-code'] = STATUS_PRINTER_OUT_OF_PAPER
elif e.text == "jamInPrinter":
status_block['status-code'] = STATUS_PRINTER_MEDIA_JAM
elif e.text == "hardError":
status_block['status-code'] = STATUS_PRINTER_HARD_ERROR
elif e.text == "outputBinFull":
status_block['status-code'] = STATUS_PRINTER_OUTPUT_BIN_FULL
elif e.text == "unexpectedSizeInTray" or e.text == "sizeMismatchInTray":
status_block['status-code'] = STATUS_PRINTER_MEDIA_SIZE_MISMATCH
elif e.text == "insertOrCloseTray2":
status_block['status-code'] = STATUS_PRINTER_TRAY_2_MISSING
elif e.text == "scannerError":
status_block['status-code'] = EVENT_SCANNER_FAIL
elif e.text == "scanProcessing":
status_block['status-code'] = EVENT_START_SCAN_JOB
elif e.text == "scannerAdfLoaded":
status_block['status-code'] = EVENT_SCAN_ADF_LOADED
elif e.text == "scanToDestinationNotSet":
status_block['status-code'] = EVENT_SCAN_TO_DESTINATION_NOTSET
elif e.text == "scanWaitingForPC":
status_block['status-code'] = EVENT_SCAN_WAITING_FOR_PC
elif e.text == "scannerAdfJam":
status_block['status-code'] = EVENT_SCAN_ADF_JAM
elif e.text == "scannerAdfDoorOpen":
status_block['status-code'] = EVENT_SCAN_ADF_DOOR_OPEN
elif e.text == "faxProcessing":
status_block['status-code'] = EVENT_START_FAX_JOB
elif e.text == "faxSending":
status_block['status-code'] = STATUS_FAX_TX_ACTIVE
elif e.text == "faxReceiving":
status_block['status-code'] = STATUS_FAX_RX_ACTIVE
elif e.text == "faxDialing":
status_block['status-code'] = EVENT_FAX_DIALING
elif e.text == "faxConnecting":
status_block['status-code'] = EVENT_FAX_CONNECTING
elif e.text == "faxSendError":
status_block['status-code'] = EVENT_FAX_SEND_ERROR
elif e.text == "faxErrorStorageFull":
status_block['status-code'] = EVENT_FAX_ERROR_STORAGE_FULL
elif e.text == "faxReceiveError":
status_block['status-code'] = EVENT_FAX_RECV_ERROR
elif e.text == "faxBlocking":
status_block['status-code'] = EVENT_FAX_BLOCKING
elif e.text == "inPowerSave":
status_block['status-code'] = STATUS_PRINTER_POWER_SAVE
elif e.text == "incorrectCartridge":
status_block['status-code'] = STATUS_PRINTER_CARTRIDGE_WRONG
elif e.text == "cartridgeMissing":
status_block['status-code'] = STATUS_PRINTER_CARTRIDGE_MISSING
elif e.text == "missingPrintHead":
status_block['status-code'] = STATUS_PRINTER_PRINTHEAD_MISSING
return status_block
|
Alberto-Beralix/Beralix
|
i386-squashfs-root/usr/share/hplip/base/status.py
|
Python
|
gpl-3.0
| 65,504
|
[
"ADF"
] |
a288c44a3ac18b15ea3d5d993ec775fdd6610e990f604444d894144cefa69563
|
from math import log
import numpy as np
from nose.tools import assert_equal, assert_almost_equal
from iminuit import describe
from probfit import pdf
from probfit._libstat import xlogyx, wlogyx, csum, integrate1d, _vector_apply
from probfit.functor import construct_arg, fast_tuple_equal
from probfit.funcutil import merge_func_code
def f(x, y, z):
return x + y + z
def f2(x, z, a):
return x + z + a
def g(x, a, b):
return x + a + b
def h(x, c, d):
return x + c + d
def k_1(y, z):
return y + z
def k_2(i, j):
return i + j
def iterable_equal(x, y):
assert_equal(list(x), list(y))
# cpdef double doublegaussian(double x, double mean,
# double sigma_L, double sigma_R)
def test_doublegaussian():
assert_equal(
tuple(describe(pdf.doublegaussian)), ('x', 'mean', 'sigma_L', 'sigma_R'))
assert_almost_equal(pdf.doublegaussian(0., 0., 1., 2.), 1.)
assert_almost_equal(pdf.doublegaussian(-1., 0., 1., 2.), 0.6065306597126334)
assert_almost_equal(pdf.doublegaussian(1., 0., 1., 2.), 0.8824969025845955)
# cpdef double ugaussian(double x, double mean, double sigma)
def test_ugaussian():
assert_equal(tuple(describe(pdf.ugaussian)), ('x', 'mean', 'sigma'))
assert_almost_equal(pdf.ugaussian(0, 0, 1), 1.)
assert_almost_equal(pdf.ugaussian(-1, 0, 1), 0.6065306597126334)
assert_almost_equal(pdf.ugaussian(1, 0, 1), 0.6065306597126334)
# cpdef double gaussian(double x, double mean, double sigma)
def test_gaussian():
assert_equal(tuple(describe(pdf.gaussian)), ('x', 'mean', 'sigma'))
assert_almost_equal(pdf.gaussian(0, 0, 1), 0.3989422804014327)
assert_almost_equal(pdf.gaussian(-1, 0, 1), 0.24197072451914337)
assert_almost_equal(pdf.gaussian(1, 0, 1), 0.24197072451914337)
# cpdef double crystalball(double x,double alpha,double n,double mean,double sigma)
def test_crystalball():
assert_equal(tuple(describe(pdf.crystalball)),
('x', 'alpha', 'n', 'mean', 'sigma'))
assert_almost_equal(pdf.crystalball(10, 1, 2, 10, 2), 1.)
assert_almost_equal(pdf.crystalball(11, 1, 2, 10, 2), 0.8824969025845955)
assert_almost_equal(pdf.crystalball(12, 1, 2, 10, 2), 0.6065306597126334)
assert_almost_equal(pdf.crystalball(14, 1, 2, 10, 2), 0.1353352832366127)
assert_almost_equal(pdf.crystalball(6, 1, 2, 10, 2), 0.26956918209450376)
# cpdef double argus(double x, double c, double chi, double p)
def test_argus():
assert_equal(tuple(describe(pdf.argus)), ('x', 'c', 'chi', 'p'))
assert_almost_equal(pdf.argus(6., 10, 2, 3), 0.004373148605400128)
assert_almost_equal(pdf.argus(10., 10, 2, 3), 0.)
assert_almost_equal(pdf.argus(8., 10, 2, 3), 0.0018167930603254737)
# cpdef double cruijff(double x, double m_0, double sigma_L, double sigma_R, double alpha_L, double alpha_R)
def test_cruijff():
iterable_equal(tuple(describe(pdf.cruijff)),
('x', 'm_0', 'sigma_L', 'sigma_R', 'alpha_L', 'alpha_R'))
val = pdf.cruijff(0, 0, 1., 2., 1., 2.)
assert_almost_equal(val, 1.)
vl = pdf.cruijff(0, 1, 1., 1., 2., 2.)
vr = pdf.cruijff(2, 1, 1., 1., 2., 2.)
assert_almost_equal(vl, vr, msg='symmetric test')
assert_almost_equal(vl, 0.7788007830714)
assert_almost_equal(vr, 0.7788007830714)
# cpdef double linear(double x, double m, double c)
def test_linear():
assert_equal(describe(pdf.linear), ['x', 'm', 'c'])
assert_almost_equal(pdf.linear(1, 2, 3), 5)
assert(hasattr(pdf.linear, 'integrate'))
integral = pdf.linear.integrate((0., 1.), 1, 1, 1)
assert_equal(integral, 1.5)
# cpdef double poly2(double x, double a, double b, double c)
def test_poly2():
assert_equal(describe(pdf.poly2), ['x', 'a', 'b', 'c'])
assert_almost_equal(pdf.poly2(2, 3, 4, 5), 25)
# cpdef double poly3(double x, double a, double b, double c, double d)
def test_poly3():
assert_equal(describe(pdf.poly3), ['x', 'a', 'b', 'c', 'd'])
assert_almost_equal(pdf.poly3(2, 3, 4, 5, 6), 56.)
def test_polynomial():
p = pdf.Polynomial(1)
assert_equal(describe(p), ['x', 'c_0', 'c_1'])
assert_equal(p(2, 2, 1), 4)
integral = p.integrate((0, 1), 1, 2, 1)
assert_equal(integral, 2.5)
p = pdf.Polynomial(2)
assert_equal(describe(p), ['x', 'c_0', 'c_1', 'c_2'])
assert_equal(p(2, 3, 4, 5), 31)
integral = p.integrate((2, 10), 10, 1, 2, 3)
analytical = 8 + 2 / 2.*(10 ** 2 - 2 ** 2) + 3 / 3.*(10 ** 3 - 2 ** 3)
assert_equal(integral, analytical)
# cpdef double novosibirsk(double x, double width, double peak, double tail)
def test_novosibirsk():
assert_equal(describe(pdf.novosibirsk), ['x', 'width', 'peak', 'tail'])
assert_almost_equal(pdf.novosibirsk(3, 2, 3, 4), 1.1253517471925912e-07)
def test_rtv_breitwigner():
assert_equal(describe(pdf.rtv_breitwigner), ['x', 'm', 'gamma'])
assert_almost_equal(pdf.rtv_breitwigner(1, 1, 1.), 0.8194496535636714)
assert_almost_equal(pdf.rtv_breitwigner(1, 1, 2.), 0.5595531041435416)
assert_almost_equal(pdf.rtv_breitwigner(1, 2, 3.), 0.2585302502852219)
def test_cauchy():
assert_equal(describe(pdf.cauchy), ['x', 'm', 'gamma'])
assert_almost_equal(pdf.cauchy(1, 1, 1.), 0.3183098861837907)
assert_almost_equal(pdf.cauchy(1, 1, 2.), 0.15915494309189535)
assert_almost_equal(pdf.cauchy(1, 2, 4.), 0.07489644380795074)
def test_HistogramPdf():
be = np.array([0, 1, 3, 4], dtype=float)
hy = np.array([10, 30, 50], dtype=float)
norm = float((hy * np.diff(be)).sum())
f = pdf.HistogramPdf(hy, be)
assert_almost_equal(f(0.5), 10.0 / norm)
assert_almost_equal(f(1.2), 30.0 / norm)
assert_almost_equal(f(2.9), 30.0 / norm)
assert_almost_equal(f(3.6), 50.0 / norm)
assert(hasattr(f, 'integrate'))
integral = f.integrate((0, 4))
assert_almost_equal(integral, 1.0)
integral = f.integrate((0.5, 3.4))
assert_almost_equal(integral, (10 * 0.5 + 30 * 2 + 50 * 0.4) / norm)
integral = f.integrate((1.2, 4.5))
assert_almost_equal(integral, (30 * 1.8 + 50 * 1) / norm)
def test__vector_apply():
def f(x, y):
return x * x + y
y = 10
a = np.array([1., 2., 3.])
expected = [f(x, y) for x in a]
va = _vector_apply(f, a, tuple([y]))
for i in range(len(a)):
assert_almost_equal(va[i], expected[i])
def test_integrate1d():
def f(x, y):
return x * x + y
def intf(x, y):
return x * x * x / 3. + y * x
bound = (-2., 1.)
y = 3.
integral = integrate1d(f, bound, 1000, tuple([y]))
analytic = intf(bound[1], y) - intf(bound[0], y)
assert_almost_equal(integral, analytic)
def test_integrate1d_analytic():
class temp:
def __call__(self, x, m , c):
return m * x ** 2 + c
def integrate(self, bound, nint, m, c):
a, b = bound
return b - a # (wrong on purpose)
bound = (0., 10.)
f = temp()
integral = integrate1d(f, bound, 10, (2., 3.))
assert_equal(integral, bound[1] - bound[0])
def test_csum():
x = np.array([1, 2, 3], dtype=np.double)
s = csum(x)
assert_almost_equal(s, 6.)
def test_xlogyx():
def bad(x, y):
return x * log(y / x)
assert_almost_equal(xlogyx(1., 1.), bad(1., 1.))
assert_almost_equal(xlogyx(1., 2.), bad(1., 2.))
assert_almost_equal(xlogyx(1., 3.), bad(1., 3.))
assert_almost_equal(xlogyx(0., 1.), 0.)
def test_wlogyx():
def bad(w, y, x):
return w * log(y / x)
assert_almost_equal(wlogyx(1., 1., 1.), bad(1., 1., 1.))
assert_almost_equal(wlogyx(1., 2., 3.), bad(1., 2., 3.))
assert_almost_equal(wlogyx(1e-50, 1e-20, 1.), bad(1e-50, 1e-20, 1.))
def test_construct_arg():
arg = (1, 2, 3, 4, 5, 6)
pos = np.array([0, 2, 4], dtype=np.int)
carg = construct_arg(arg, pos)
expected = (1, 3, 5)
# print carg
for i in range(len(carg)):
assert_almost_equal(carg[i], expected[i])
def test_merge_func_code():
funccode, [pf, pg, ph] = merge_func_code(f, g, h)
assert_equal(funccode.co_varnames, ('x', 'y', 'z', 'a', 'b', 'c', 'd'))
exp_pf = [0, 1, 2]
for i in range(len(pf)): assert_almost_equal(pf[i], exp_pf[i])
exp_pg = [0, 3, 4]
for i in range(len(pg)): assert_almost_equal(pg[i], exp_pg[i])
exp_ph = [0, 5, 6]
for i in range(len(ph)): assert_almost_equal(ph[i], exp_ph[i])
def test_merge_func_code_prefix():
funccode, [pf, pg, ph] = merge_func_code(
f, g, h,
prefix=['f_', 'g_', 'h_'],
skip_first=True)
assert_equal(funccode.co_varnames, ('x', 'f_y', 'f_z',
'g_a', 'g_b', 'h_c', 'h_d'))
exp_pf = [0, 1, 2]
for i in range(len(pf)): assert_almost_equal(pf[i], exp_pf[i])
exp_pg = [0, 3, 4]
for i in range(len(pg)): assert_almost_equal(pg[i], exp_pg[i])
exp_ph = [0, 5, 6]
for i in range(len(ph)): assert_almost_equal(ph[i], exp_ph[i])
def test_merge_func_code_factor_list():
funccode, [pf, pg, pk_1, pk_2] = merge_func_code(
f, g,
prefix=['f_', 'g_'],
skip_first=True,
factor_list=[k_1, k_2])
assert_equal(funccode.co_varnames, ('x', 'f_y', 'f_z',
'g_a', 'g_b', 'g_i', 'g_j'))
exp_pf = [0, 1, 2]
for i in range(len(pf)): assert_almost_equal(pf[i], exp_pf[i])
exp_pg = [0, 3, 4]
for i in range(len(pg)): assert_almost_equal(pg[i], exp_pg[i])
exp_pk_1 = [1, 2]
for i in range(len(pk_1)): assert_almost_equal(pk_1[i], exp_pk_1[i])
exp_pk_2 = [5, 6]
for i in range(len(pk_1)): assert_almost_equal(pk_2[i], exp_pk_2[i])
def test_merge_func_code_skip_prefix():
funccode, pos = merge_func_code(
f, f2,
prefix=['f_', 'g_'],
skip_first=True,
skip_prefix=['z'])
assert_equal(funccode.co_varnames, ('x', 'f_y', 'z', 'g_a'))
def test_fast_tuple_equal():
a = (1., 2., 3.)
b = (1., 2., 3.)
ret = fast_tuple_equal(a, b, 0)
assert(ret)
a = (1., 4., 3.)
b = (1., 2., 3.)
ret = fast_tuple_equal(a, b, 0)
assert(not ret)
a = (4., 3.)
b = (1., 4., 3.)
ret = fast_tuple_equal(a, b, 1)
assert(ret)
a = (4., 5.)
b = (1., 4., 3.)
ret = fast_tuple_equal(a, b, 1)
assert(not ret)
a = tuple([])
b = tuple([])
ret = fast_tuple_equal(a, b, 0)
assert(ret)
|
mtresch/probfit
|
test/testfunc.py
|
Python
|
mit
| 10,590
|
[
"Gaussian"
] |
f7d5d1a8a8a0a8857ed4a961b1f3902220aed93434b39dee55f94aee725f7b6f
|
#!/usr/bin/env python
########################################################################
# File : dirac-proxy-init.py
# Author : Adrian Casajus
########################################################################
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
__RCSID__ = "$Id$"
import sys
import DIRAC
from DIRAC.Core.Base import Script
from DIRAC.Core.Utilities.DIRACScript import DIRACScript
class Params:
proxyLoc = False
dnAsUsername = False
def setProxyLocation(self, arg):
self.proxyLoc = arg
return DIRAC.S_OK()
def setDNAsUsername(self, arg):
self.dnAsUsername = True
return DIRAC.S_OK()
def showVersion(self, arg):
print("Version:")
print(" ", __RCSID__)
sys.exit(0)
return DIRAC.S_OK()
@DIRACScript()
def main():
params = Params()
Script.registerSwitch("f:", "file=", "File to use as proxy", params.setProxyLocation)
Script.registerSwitch("D", "DN", "Use DN as myproxy username", params.setDNAsUsername)
Script.registerSwitch("i", "version", "Print version", params.showVersion)
Script.addDefaultOptionValue("LogLevel", "always")
Script.parseCommandLine()
from DIRAC.Core.Security.MyProxy import MyProxy
from DIRAC.Core.Security import Locations
if not params.proxyLoc:
params.proxyLoc = Locations.getProxyLocation()
if not params.proxyLoc:
print("Can't find any valid proxy")
sys.exit(1)
print("Uploading proxy file %s" % params.proxyLoc)
mp = MyProxy()
retVal = mp.uploadProxy(params.proxyLoc, params.dnAsUsername)
if not retVal['OK']:
print("Can't upload proxy:")
print(" ", retVal['Message'])
sys.exit(1)
print("Proxy uploaded")
sys.exit(0)
if __name__ == "__main__":
main()
|
yujikato/DIRAC
|
src/DIRAC/FrameworkSystem/scripts/dirac_myproxy_upload.py
|
Python
|
gpl-3.0
| 1,783
|
[
"DIRAC"
] |
ecd07c3943960b6df104ed9f50db35ae7c7ff8eca11db881e962075f83df7934
|
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under the GNU Public Licence, v2 or any higher version
#
# Please cite your use of MDAnalysis in published work:
#
# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler,
# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein.
# MDAnalysis: A Python package for the rapid analysis of molecular dynamics
# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th
# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy.
# doi: 10.25080/majora-629e541a-00e
#
# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein.
# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations.
# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787
#
# TPR parser and tpr support module
# Copyright (c) 2011 Zhuyi Xue
# Released under the GNU Public Licence, v2
"""
TPRParser settings
==================
Definition of constants.
The currently read file format versions are defined in
:data:`SUPPORTED_VERSIONS`.
"""
#: Gromacs TPR file format versions that can be read by the TPRParser.
SUPPORTED_VERSIONS = (58, 73, 83, 100, 103, 110, 112, 116, 119, 122, 127)
# Some constants
STRLEN = 4096
BIG_STRLEN = 1048576
DIM = 3
NR_RBDIHS = 6 # <gromacs-5.1-dir>/src/gromacs/topology/idef.h
NR_CBTDIHS = 6 # <gromacs-5.1-dir>/src/gromacs/topology/idef.h
NR_FOURDIHS = 4 # <gromacs-5.1-dir>/src/gromacs/topology/idef.h
egcNR = 10 # include/types/topolog.h
TPX_TAG_RELEASE = "release" # <gromacs-5.1-dir>/src/gromacs/fileio/tpxio.c
tpx_version = 103 # <gromacs-5.1-dir>/src/gromacs/fileio/tpxio.c
tpx_generation = 27 # <gromacs-5.1-dir>/src/gromacs/fileio/tpxio.c
tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials = 98
tpxv_GenericInternalParameters = 117
tpxv_VSite2FD = 118
tpxv_AddSizeField = 119
tpxv_VSite1 = 121
tpxv_RemoveTholeRfac = 127
#: Function types from ``<gromacs_dir>/include/types/idef.h``
(
F_BONDS, F_G96BONDS, F_MORSE, F_CUBICBONDS,
F_CONNBONDS, F_HARMONIC, F_FENEBONDS, F_TABBONDS,
F_TABBONDSNC, F_RESTRBONDS, F_ANGLES, F_G96ANGLES, F_RESTRANGLES,
F_LINEAR_ANGLES, F_CROSS_BOND_BONDS, F_CROSS_BOND_ANGLES, F_UREY_BRADLEY,
F_QUARTIC_ANGLES, F_TABANGLES, F_PDIHS, F_RBDIHS, F_RESTRDIHS, F_CBTDIHS,
F_FOURDIHS, F_IDIHS, F_PIDIHS, F_TABDIHS,
F_CMAP, F_GB12, F_GB13, F_GB14,
F_GBPOL, F_NPSOLVATION, F_LJ14, F_COUL14,
F_LJC14_Q, F_LJC_PAIRS_NB, F_LJ, F_BHAM,
F_LJ_LR, F_BHAM_LR, F_DISPCORR, F_COUL_SR,
F_COUL_LR, F_RF_EXCL, F_COUL_RECIP, F_LJ_RECIP, F_DPD,
F_POLARIZATION, F_WATER_POL, F_THOLE_POL, F_ANHARM_POL,
F_POSRES, F_FBPOSRES, F_DISRES, F_DISRESVIOL, F_ORIRES,
F_ORIRESDEV, F_ANGRES, F_ANGRESZ, F_DIHRES,
F_DIHRESVIOL, F_CONSTR, F_CONSTRNC, F_SETTLE, F_VSITE1,
F_VSITE2, F_VSITE2FD, F_VSITE3, F_VSITE3FD, F_VSITE3FAD,
F_VSITE3OUT, F_VSITE4FD, F_VSITE4FDN, F_VSITEN,
F_COM_PULL, F_DENSITYFITTING, F_EQM, F_EPOT, F_EKIN,
F_ETOT, F_ECONSERVED, F_TEMP, F_VTEMP_NOLONGERUSED,
F_PDISPCORR, F_PRES, F_DHDL_CON, F_DVDL,
F_DKDL, F_DVDL_COUL, F_DVDL_VDW, F_DVDL_BONDED,
F_DVDL_RESTRAINT, F_DVDL_TEMPERATURE, F_NRE) = list(range(95))
#: Function types from ``<gromacs_dir>/src/gmxlib/tpxio.c``
ftupd = [
(20, F_CUBICBONDS), (20, F_CONNBONDS), (20, F_HARMONIC), (34, F_FENEBONDS),
(43, F_TABBONDS), (43, F_TABBONDSNC), (70, F_RESTRBONDS),
(tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, F_RESTRANGLES),
(76, F_LINEAR_ANGLES), (30, F_CROSS_BOND_BONDS), (30, F_CROSS_BOND_ANGLES),
(30, F_UREY_BRADLEY), (34, F_QUARTIC_ANGLES), (43, F_TABANGLES),
(tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, F_RESTRDIHS),
(tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, F_CBTDIHS),
(26, F_FOURDIHS), (26, F_PIDIHS), (43, F_TABDIHS), (65, F_CMAP),
(60, F_GB12), (61, F_GB13), (61, F_GB14), (72, F_GBPOL),
(72, F_NPSOLVATION), (41, F_LJC14_Q), (41, F_LJC_PAIRS_NB),
(32, F_BHAM_LR), (32, F_RF_EXCL), (32, F_COUL_RECIP), (93, F_LJ_RECIP),
(46, F_DPD), (30, F_POLARIZATION), (36, F_THOLE_POL), (90, F_FBPOSRES),
(22, F_DISRESVIOL), (22, F_ORIRES), (22, F_ORIRESDEV),
(26, F_DIHRES), (26, F_DIHRESVIOL), (49, F_VSITE4FDN),
(50, F_VSITEN), (46, F_COM_PULL), (20, F_EQM),
(46, F_ECONSERVED), (69, F_VTEMP_NOLONGERUSED), (66, F_PDISPCORR),
(54, F_DHDL_CON), (76, F_ANHARM_POL), (79, F_DVDL_COUL),
(79, F_DVDL_VDW,), (79, F_DVDL_BONDED,), (79, F_DVDL_RESTRAINT),
(79, F_DVDL_TEMPERATURE),
(tpxv_GenericInternalParameters, F_DENSITYFITTING),
(tpxv_VSite1, F_VSITE1),
(tpxv_VSite2FD, F_VSITE2FD),
]
#: Interaction types from ``<gromacs_dir>/gmxlib/ifunc.c``
interaction_types = [
("BONDS", "Bond", 2),
("G96BONDS", "G96Bond", 2),
("MORSE", "Morse", 2),
("CUBICBONDS", "Cubic Bonds", 2),
("CONNBONDS", "Connect Bonds", 2),
("HARMONIC", "Harmonic Pot.", 2),
("FENEBONDS", "FENE Bonds", 2),
("TABBONDS", "Tab. Bonds", 2),
("TABBONDSNC", "Tab. Bonds NC", 2),
("RESTRAINTPOT", "Restraint Pot.", 2),
("ANGLES", "Angle", 3),
("G96ANGLES", "G96Angle", 3),
("RESTRANGLES", "Restricted Angles", 3),
("LINEAR_ANGLES", "Lin. Angle", 3),
("CROSS_BOND_BOND", "Bond-Cross", 3),
("CROSS_BOND_ANGLE", "BA-Cross", 3),
("UREY_BRADLEY", "U-B", 3),
("QANGLES", "Quartic Angles", 3),
("TABANGLES", "Tab. Angles", 3),
("PDIHS", "Proper Dih.", 4),
("RBDIHS", "Ryckaert-Bell.", 4),
("RESTRDIHS", "Restricted Dih.", 4),
("CBTDIHS", "CBT Dih.", 4),
("FOURDIHS", "Fourier Dih.", 4),
("IDIHS", "Improper Dih.", 4),
("PIDIHS", "Improper Dih.", 4),
("TABDIHS", "Tab. Dih.", 4),
("CMAP", "CMAP Dih.", 5),
("GB12", "GB 1-2 Pol.", 2),
("GB13", "GB 1-3 Pol.", 2),
("GB14", "GB 1-4 Pol.", 2),
("GBPOL", "GB Polarization", None),
("NPSOLVATION", "Nonpolar Sol.", None),
("LJ14", "LJ-14", 2),
("COUL14", "Coulomb-14", None),
("LJC14_Q", "LJC-14 q", 2),
("LJC_NB", "LJC Pairs NB", 2),
("LJ_SR", "LJ (SR)", 2),
("BHAM", "Buck.ham (SR)", 2),
("LJ_LR", "LJ (LR)", None),
("BHAM_LR", "Buck.ham (LR)", None),
("DISPCORR", "Disper. corr.", None),
("COUL_SR", "Coulomb (SR)", None),
("COUL_LR", "Coulomb (LR)", None),
("RF_EXCL", "RF excl.", None),
("COUL_RECIP", "Coul. recip.", None),
("LJ_RECIP", "LJ recip.", None),
("DPD", "DPD", None),
("POLARIZATION", "Polarization", 2),
("WATERPOL", "Water Pol.", 5),
("THOLE", "Thole Pol.", 4),
("ANHARM_POL", "Anharm. Pol.", 2),
("POSRES", "Position Rest.", 1),
("FBPOSRES", "Flat-bottom posres", 1),
("DISRES", "Dis. Rest.", 2),
("DISRESVIOL", "D.R.Viol. (nm)", None),
("ORIRES", "Orient. Rest.", 2),
("ORDEV", "Ori. R. RMSD", None),
("ANGRES", "Angle Rest.", 4),
("ANGRESZ", "Angle Rest. Z", 2),
("DIHRES", "Dih. Rest.", 4),
("DIHRESVIOL", "Dih. Rest. Viol.", None),
("CONSTR", "Constraint", 2),
("CONSTRNC", "Constr. No Conn.", 2),
("SETTLE", "Settle", 3),
("VSITE1", "Virtual site 1", 2),
("VSITE2", "Virtual site 2", 3),
("VSITE2FD", "Virtual site 2fd", 3),
("VSITE3", "Virtual site 3", 4),
("VSITE3FD", "Virtual site 3fd", 4),
("VSITE3FAD", "Virtual site 3fad", 4),
("VSITE3OUT", "Virtual site 3out", 4),
("VSITE4FD", "Virtual site 4fd", 5),
("VSITE4FDN", "Virtual site 4fdn", 5),
("VSITEN", "Virtual site N", 2),
("COM_PULL", "COM Pull En.", None),
("DENSITYFIT", "Density fitting", None),
("EQM", "Quantum En.", None),
("EPOT", "Potential", None),
("EKIN", "Kinetic En.", None),
("ETOT", "Total Energy", None),
("ECONS", "Conserved En.", None),
("TEMP", "Temperature", None),
("VTEMP", "Vir. Temp. (not used)", None),
("PDISPCORR", "Pres. DC", None),
("PRES", "Pressure", None),
("DH/DL_CON", "dH/dl constr.", None),
("DV/DL", "dVremain/dl", None),
("DK/DL", "dEkin/dl", None),
("DVC/DL", "dVcoul/dl", None),
("DVV/DL", "dVvdw/dl", None),
("DVB/DL", "dVbonded/dl", None),
("DVR/DL", "dVrestraint/dl", None),
("DVT/DL", "dVtemperature/dl", None)
]
|
MDAnalysis/mdanalysis
|
package/MDAnalysis/topology/tpr/setting.py
|
Python
|
gpl-2.0
| 8,442
|
[
"Gromacs",
"MDAnalysis"
] |
e3c8e6b95faecd369958c44b24f8cbb13026426a73251edb1d7e8e8b37cb0de4
|
# The Hazard Library
# Copyright (C) 2012-2014, GEM Foundation
#
# 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/>.
"""
Module exports :class:`ChiouYoungs2014`.
"""
from __future__ import division
import numpy as np
import math
from openquake.hazardlib.gsim.base import GMPE, CoeffsTable
from openquake.hazardlib import const
from openquake.hazardlib.imt import PGA, PGV, SA
class ChiouYoungs2014(GMPE):
"""
Implements GMPE developed by Brian S.-J. Chiou and Robert R. Youngs
and published as "Updated of the Chiou and Youngs NGA Model for the
Average Horizontal Component of Peak Ground Motion and Response Spectra"
(2014, Earthquake Spectra).
"""
#: Supported tectonic region type is active shallow crust
DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST
#: Supported intensity measure types are spectral acceleration,
#: peak ground velocity and peak ground acceleration
DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([
PGA,
PGV,
SA
])
#: Supported intensity measure component is orientation-independent
#: measure :attr:`~openquake.hazardlib.const.IMC.RotD50`,
DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.RotD50
#: Supported standard deviation types are inter-event, intra-event
#: and total, see chapter "Variance model".
DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
const.StdDev.TOTAL,
const.StdDev.INTER_EVENT,
const.StdDev.INTRA_EVENT
])
#: Required site parameters are Vs30, Vs30 measured flag
#: and Z1.0.
REQUIRES_SITES_PARAMETERS = set(('vs30', 'vs30measured', 'z1pt0'))
#: Required rupture parameters are magnitude, rake,
#: dip and ztor.
REQUIRES_RUPTURE_PARAMETERS = set(('dip', 'rake', 'mag', 'ztor'))
#: Required distance measures are RRup, Rjb and Rx.
REQUIRES_DISTANCES = set(('rrup', 'rjb', 'rx'))
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
"""
See :meth:`superclass method
<.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
for spec of input and result values.
"""
# extracting dictionary of coefficients specific to required
# intensity measure type.
C = self.COEFFS[imt]
# intensity on a reference soil is used for both mean
# and stddev calculations.
ln_y_ref = self._get_ln_y_ref(rup, dists, C)
# exp1 and exp2 are parts of eq. 12 and eq. 13,
# calculate it once for both.
exp1 = np.exp(C['phi3'] * (sites.vs30.clip(-np.inf, 1130) - 360))
exp2 = np.exp(C['phi3'] * (1130 - 360))
mean = self._get_mean(sites, C, ln_y_ref, exp1, exp2)
stddevs = self._get_stddevs(sites, rup, C, stddev_types,
ln_y_ref, exp1, exp2)
return mean, stddevs
def _get_mean(self, sites, C, ln_y_ref, exp1, exp2):
"""
Add site effects to an intensity.
Implements eq. 13b.
"""
# we do not support estimating of basin depth and instead
# rely on it being available (since we require it).
# centered_z1pt0
centered_z1pt0 = self._get_centered_z1pt0(sites)
# we consider random variables being zero since we want
# to find the exact mean value.
eta = epsilon = 0.
ln_y = (
# first line of eq. 12
ln_y_ref + eta
# second line
+ C['phi1'] * np.log(sites.vs30 / 1130).clip(-np.inf, 0)
# third line
+ C['phi2'] * (exp1 - exp2)
* np.log((np.exp(ln_y_ref) * np.exp(eta) + C['phi4']) / C['phi4'])
# fourth line
+ C['phi5']
* (1.0 - np.exp(-1. * centered_z1pt0 / C['phi6']))
# fifth line
+ epsilon
)
return ln_y
def _get_stddevs(self, sites, rup, C, stddev_types, ln_y_ref, exp1, exp2):
"""
Get standard deviation for a given intensity on reference soil.
Implements equations 13 for inter-event, intra-event
and total standard deviations.
"""
Fmeasured = sites.vs30measured
Finferred = 1 - sites.vs30measured
# eq. 13 to calculate inter-event standard error
mag_test = min(max(rup.mag, 5.0), 6.5) - 5.0
tau = C['tau1'] + (C['tau2'] - C['tau1']) / 1.5 * mag_test
# b and c coeffs from eq. 10
b = C['phi2'] * (exp1 - exp2)
c = C['phi4']
y_ref = np.exp(ln_y_ref)
# eq. 13
NL = b * y_ref / (y_ref + c)
sigma = ((C['sig1'] + (C['sig2'] - C['sig1']) * mag_test / 1.5)
* np.sqrt((C['sig3'] * Finferred + 0.7 * Fmeasured) +
(1. + NL) ** 2.))
ret = []
for stddev_type in stddev_types:
assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
if stddev_type == const.StdDev.TOTAL:
# eq. 13
ret += [np.sqrt(((1 + NL) ** 2) * (tau ** 2) + (sigma ** 2))]
elif stddev_type == const.StdDev.INTRA_EVENT:
ret.append(sigma)
elif stddev_type == const.StdDev.INTER_EVENT:
# this is implied in eq. 21
ret.append(np.abs((1 + NL) * tau))
return ret
def _get_ln_y_ref(self, rup, dists, C):
"""
Get an intensity on a reference soil.
Implements eq. 13a.
"""
# reverse faulting flag
Frv = 1. if 30 <= rup.rake <= 150 else 0.
# normal faulting flag
Fnm = 1. if -120 <= rup.rake <= -60 else 0.
# hanging wall flag
Fhw = np.zeros_like(dists.rx)
idx = np.nonzero(dists.rx >= 0.)
Fhw[idx] = 1.
# a part in eq. 11
mag_test1 = np.cosh(2. * max(rup.mag - 4.5, 0))
# centered DPP
centered_dpp = 0.
# centered_ztor
centered_ztor = self._get_centered_ztor(rup, Frv)
#
ln_y_ref = (
# first part of eq. 11
C['c1']
+ (C['c1a'] + C['c1c'] / mag_test1) * Frv
+ (C['c1b'] + C['c1d'] / mag_test1) * Fnm
+ (C['c7'] + C['c7b'] / mag_test1) * centered_ztor
+ (C['c11'] + C['c11b'] / mag_test1) *
np.cos(math.radians(rup.dip)) ** 2
# second part
+ C['c2'] * (rup.mag - 6)
+ ((C['c2'] - C['c3']) / C['cn'])
* np.log(1 + np.exp(C['cn'] * (C['cm'] - rup.mag)))
# third part
+ C['c4']
* np.log(dists.rrup + C['c5']
* np.cosh(C['c6'] * max(rup.mag - C['chm'], 0)))
+ (C['c4a'] - C['c4'])
* np.log(np.sqrt(dists.rrup ** 2 + C['crb'] ** 2))
# forth part
+ (C['cg1'] + C['cg2'] / (np.cosh(max(rup.mag - C['cg3'], 0))))
* dists.rrup
# fifth part
+ C['c8'] * np.amax(1 - (np.amax(dists.rrup - 40,
np.zeros_like(dists)) / 30.),
np.zeros_like(dists))
* min(max(rup.mag - 5.5, 0) / 0.8, 1.0)
* np.exp(-1 * C['c8a'] * (rup.mag - C['c8b'] ** 2)) * centered_dpp
# sixth part
+ C['c9'] * Fhw * np.cos(math.radians(rup.dip)) *
(C['c9a'] + (1 - C['c9a']) * np.tanh(dists.rx / C['c9b']))
* (1 - np.sqrt(dists.rjb ** 2 + rup.ztor ** 2)
/ (dists.rrup + 1.0))
)
return ln_y_ref
def _get_centered_z1pt0(self, sites):
"""
Get z1pt0 centered on the Vs30- dependent avarage z1pt0(m)
California and non-Japan regions
"""
#: California and non-Japan regions
mean_z1pt0 = (-7.15 / 4.) * np.log(((sites.vs30) ** 4. + 570.94 ** 4.)
/ (1360 ** 4. + 570.94 ** 4.))
centered_z1pt0 = sites.z1pt0 - np.exp(mean_z1pt0)
return centered_z1pt0
def _get_centered_ztor(self, rup, Frv):
"""
Get ztor centered on the M- dependent avarage ztor(km)
by different fault types.
"""
if Frv == 1:
mean_ztor = max(2.704 - 1.226 * max(rup.mag - 5.849, 0.0), 0.) ** 2
centered_ztor = rup.ztor - mean_ztor
else:
mean_ztor = max(2.673 - 1.136 * max(rup.mag - 4.970, 0.0), 0.) ** 2
centered_ztor = rup.ztor - mean_ztor
return centered_ztor
#: Coefficient tables are constructed from values in tables 1 - 5
COEFFS = CoeffsTable(sa_damping=5, table="""\
IMT c1 c1a c1b c1c c1d cn cm c2 c3 c4 c4a crb c5 chm c6 c7 c7b c8 c8a c8b c9 c9a c9b c11 c11b cg1 cg2 cg3 phi1 phi2 phi3 phi4 phi5 phi6 gjpit gwn phi1jp phi5jp phi6jp tau1 tau2 sig1 sig2 sig3 sig2jp
pga -1.5065 0.165 -0.255 -0.165 0.255 16.0875 4.9993 1.06 1.9636 -2.1 -0.5 50 6.4551 3.0956 0.4908 0.0352 0.0462 0. 0.2695 0.4833 0.9228 0.1202 6.8607 0. -0.4536 -0.007146 -0.006758 4.2542 -0.521 -0.1417 -0.00701 0.102151 0. 300 1.5817 0.7594 -0.6846 0.459 800. 0.4 0.26 0.4912 0.3762 0.8 0.4528
pgv 2.3549 0.165 -0.0626 -0.165 0.0626 3.3024 5.423 1.06 2.3152 -2.1 -0.5 50 5.8096 3.0514 0.4407 0.0324 0.0097 0.2154 0.2695 5. 0.3079 0.1 6.5 0 -0.3834 -0.001852 -0.007403 4.3439 -0.7936 -0.0699 -0.008444 5.41 0.0202 300. 2.2306 0.335 -0.7966 0.9488 800. 0.3894 0.2578 0.4785 0.3629 0.7504 0.3918
0.01 -1.5065 0.165 -0.255 -0.165 0.255 16.0875 4.9993 1.06 1.9636 -2.1 -0.5 50 6.4551 3.0956 0.4908 0.0352 0.0462 0. 0.2695 0.4833 0.9228 0.1202 6.8607 0. -0.4536 -0.007146 -0.006758 4.2542 -0.521 -0.1417 -0.00701 0.102151 0. 300 1.5817 0.7594 -0.6846 0.459 800. 0.4 0.26 0.4912 0.3762 0.8 0.4528
0.02 -1.4798 0.165 -0.255 -0.165 0.255 15.7118 4.9993 1.06 1.9636 -2.1 -0.5 50 6.4551 3.0963 0.4925 0.0352 0.0472 0. 0.2695 1.2144 0.9296 0.1217 6.8697 0. -0.4536 -0.007249 -0.006758 4.2386 -0.5055 -0.1364 -0.007279 0.10836 0. 300 1.574 0.7606 -0.6681 0.458 800. 0.4026 0.2637 0.4904 0.3762 0.8 0.4551
0.03 -1.2972 0.165 -0.255 -0.165 0.255 15.8819 4.9993 1.06 1.9636 -2.1 -0.5 50 6.4551 3.0974 0.4992 0.0352 0.0533 0. 0.2695 1.6421 0.9396 0.1194 6.9113 0. -0.4536 -0.007869 -0.006758 4.2519 -0.4368 -0.1403 -0.007354 0.119888 0. 300 1.5544 0.7642 -0.6314 0.462 800. 0.4063 0.2689 0.4988 0.3849 0.8 0.4571
0.04 -1.1007 0.165 -0.255 -0.165 0.255 16.4556 4.9993 1.06 1.9636 -2.1 -0.5 50 6.4551 3.0988 0.5037 0.0352 0.0596 0. 0.2695 1.9456 0.9661 0.1166 7.0271 0. -0.4536 -0.008316 -0.006758 4.296 -0.3752 -0.1591 -0.006977 0.133641 0. 300 1.5502 0.7676 -0.5855 0.453 800. 0.4095 0.2736 0.5049 0.391 0.8 0.4642
0.05 -0.9292 0.165 -0.255 -0.165 0.255 17.6453 4.9993 1.06 1.9636 -2.1 -0.5 50 6.4551 3.1011 0.5048 0.0352 0.0639 0. 0.2695 2.181 0.9794 0.1176 7.0959 0. -0.4536 -0.008743 -0.006758 4.3578 -0.3469 -0.1862 -0.006467 0.148927 0. 300 1.5391 0.7739 -0.5457 0.436 800. 0.4124 0.2777 0.5096 0.3957 0.8 0.4716
0.075 -0.658 0.165 -0.254 -0.165 0.254 20.1772 5.0031 1.06 1.9636 -2.1 -0.5 50 6.4551 3.1094 0.5048 0.0352 0.063 0. 0.2695 2.6087 1.026 0.1171 7.3298 0. -0.4536 -0.009537 -0.00619 4.5455 -0.3747 -0.2538 -0.005734 0.190596 0. 300 1.4804 0.7956 -0.4685 0.383 800. 0.4179 0.2855 0.5179 0.4043 0.8 0.5022
0.1 -0.5613 0.165 -0.253 -0.165 0.253 19.9992 5.0172 1.06 1.9636 -2.1 -0.5 50 6.8305 3.2381 0.5048 0.0352 0.0532 0. 0.2695 2.9122 1.0177 0.1146 7.2588 0. -0.4536 -0.00983 -0.005332 4.7603 -0.444 -0.2943 -0.005604 0.230662 0. 300 1.4094 0.7932 -0.4985 0.375 800. 0.4219 0.2913 0.5236 0.4104 0.8 0.523
0.12 -0.5342 0.165 -0.252 -0.165 0.252 18.7106 5.0315 1.06 1.9795 -2.1 -0.5 50 7.1333 3.3407 0.5048 0.0352 0.0452 0. 0.2695 3.1045 1.0008 0.1128 7.2372 0. -0.4536 -0.009913 -0.004732 4.8963 -0.4895 -0.3077 -0.005696 0.253169 0. 300 1.3682 0.7768 -0.5603 0.377 800. 0.4244 0.2949 0.527 0.4143 0.8 0.5278
0.15 -0.5462 0.165 -0.25 -0.165 0.25 16.6246 5.0547 1.06 2.0362 -2.1 -0.5 50 7.3621 3.43 0.5045 0.0352 0.0345 0. 0.2695 3.3399 0.9801 0.1106 7.2109 0. -0.4536 -0.009896 -0.003806 5.0644 -0.5477 -0.3113 -0.005845 0.266468 0. 300 1.3241 0.7437 -0.6451 0.379 800. 0.4275 0.2993 0.5308 0.4191 0.8 0.5304
0.17 -0.5858 0.165 -0.248 -0.165 0.248 15.3709 5.0704 1.06 2.0823 -2.1 -0.5 50 7.4365 3.4688 0.5036 0.0352 0.0283 0. 0.2695 3.4719 0.9652 0.115 7.2491 0. -0.4536 -0.009787 -0.00328 5.1371 -0.5922 -0.3062 -0.005959 0.26506 0. 300 1.3071 0.7219 -0.6981 0.38 800. 0.4292 0.3017 0.5328 0.4217 0.8 0.531
0.2 -0.6798 0.165 -0.2449 -0.165 0.2449 13.7012 5.0939 1.06 2.1521 -2.1 -0.5 50 7.4972 3.5146 0.5016 0.0352 0.0202 0. 0.2695 3.6434 0.9459 0.1208 7.2988 0. -0.444 -0.009505 -0.00269 5.188 -0.6693 -0.2927 -0.006141 0.255253 0. 300 1.2931 0.6922 -0.7653 0.384 800. 0.4313 0.3047 0.5351 0.4252 0.8 0.5312
0.25 -0.8663 0.165 -0.2382 -0.165 0.2382 11.2667 5.1315 1.06 2.2574 -2.1 -0.5 50 7.5416 3.5746 0.4971 0.0352 0.009 0. 0.2695 3.8787 0.9196 0.1208 7.3691 0. -0.3539 -0.008918 -0.002128 5.2164 -0.7766 -0.2662 -0.006439 0.231541 0. 300 1.315 0.6579 -0.8469 0.393 800. 0.4341 0.3087 0.5377 0.4299 0.7999 0.5309
0.3 -1.0514 0.165 -0.2313 -0.165 0.2313 9.1908 5.167 1.06 2.344 -2.1 -0.5 50 7.56 3.6232 0.4919 0.0352 -0.0004 0. 0.2695 4.0711 0.8829 0.1175 6.8789 0. -0.2688 -0.008251 -0.001812 5.1954 -0.8501 -0.2405 -0.006704 0.207277 0.001 300 1.3514 0.6362 -0.8999 0.408 800. 0.4363 0.3119 0.5395 0.4338 0.7997 0.5307
0.4 -1.3794 0.165 -0.2146 -0.165 0.2146 6.5459 5.2317 1.06 2.4709 -2.1 -0.5 50 7.5735 3.6945 0.4807 0.0352 -0.0155 0. 0.2695 4.3745 0.8302 0.106 6.5334 0. -0.1793 -0.007267 -0.001274 5.0899 -0.9431 -0.1975 -0.007125 0.165464 0.004 300 1.4051 0.6049 -0.9618 0.462 800. 0.4396 0.3165 0.5422 0.4399 0.7988 0.531
0.5 -1.6508 0.165 -0.1972 -0.165 0.1972 5.2305 5.2893 1.06 2.5567 -2.1 -0.5 50 7.5778 3.7401 0.4707 0.0352 -0.0278 0.0991 0.2695 4.6099 0.7884 0.1061 6.526 0. -0.1428 -0.006492 -0.001074 4.7854 -1.0044 -0.1633 -0.007435 0.133828 0.01 300 1.4402 0.5507 -0.9945 0.524 800. 0.4419 0.3199 0.5433 0.4446 0.7966 0.5313
0.75 -2.1511 0.165 -0.162 -0.165 0.162 3.7896 5.4109 1.06 2.6812 -2.1 -0.5 50 7.5808 3.7941 0.4575 0.0352 -0.0477 0.1982 0.2695 5.0376 0.6754 0.1 6.5 0. -0.1138 -0.005147 -0.001115 4.3304 -1.0602 -0.1028 -0.00812 0.085153 0.034 300 1.528 0.3582 -1.0225 0.658 800. 0.4459 0.3255 0.5294 0.4533 0.7792 0.5309
1 -2.5365 0.165 -0.14 -0.165 0.14 3.3024 5.5106 1.06 2.7474 -2.1 -0.5 50 7.5814 3.8144 0.4522 0.0352 -0.0559 0.2154 0.2695 5.3411 0.6196 0.1 6.5 0. -0.1062 -0.004277 -0.001197 4.1667 -1.0941 -0.0699 -0.008444 0.058595 0.067 300 1.6523 0.2003 -1.0002 0.78 800. 0.4484 0.3291 0.5105 0.4594 0.7504 0.5302
1.5 -3.0686 0.165 -0.1184 -0.165 0.1184 2.8498 5.6705 1.06 2.8161 -2.1 -0.5 50 7.5817 3.8284 0.4501 0.0352 -0.063 0.2154 0.2695 5.7688 0.5101 0.1 6.5 0. -0.102 -0.002979 -0.001675 4.0029 -1.1142 -0.0425 -0.007707 0.031787 0.143 300 1.8872 0.0356 -0.9245 0.96 800. 0.4515 0.3335 0.4783 0.468 0.7136 0.5276
2 -3.4148 0.1645 -0.11 -0.1645 0.11 2.5417 5.7981 1.06 2.8514 -2.1 -0.5 50 7.5818 3.833 0.45 0.0352 -0.0665 0.2154 0.2695 6.0723 0.3917 0.1 6.5 0. -0.1009 -0.002301 -0.002349 3.8949 -1.1154 -0.0302 -0.004792 0.019716 0.203 300 2.1348 0. -0.8626 1.11 800. 0.4534 0.3363 0.4681 0.4681 0.7035 0.5167
3 -3.9013 0.1168 -0.104 -0.1168 0.104 2.1488 5.9983 1.06 2.8875 -2.1 -0.5 50 7.5818 3.8361 0.45 0.016 -0.0516 0.2154 0.2695 6.5 0.1244 0.1 6.5 0. -0.1003 -0.001344 -0.003306 3.7928 -1.1081 -0.0129 -0.001828 0.009643 0.277 300 3.5752 0. -0.7882 1.291 800. 0.4558 0.3398 0.4617 0.4617 0.7006 0.4917
4 -4.2466 0.0732 -0.102 -0.0732 0.102 1.8957 6.1552 1.06 2.9058 -2.1 -0.5 50 7.5818 3.8369 0.45 0.0062 -0.0448 0.2154 0.2695 6.8035 0.0086 0.1 6.5 0. -0.1001 -0.001084 -0.003566 3.7443 -1.0603 -0.0016 -0.001523 0.005379 0.309 300 3.8646 0. -0.7195 1.387 800. 0.4574 0.3419 0.4571 0.4571 0.7001 0.4682
5 -4.5143 0.0484 -0.101 -0.0484 0.101 1.7228 6.2856 1.06 2.9169 -2.1 -0.5 50 7.5818 3.8376 0.45 0.0029 -0.0424 0.2154 0.2695 7.0389 0. 0.1 6.5 0. -0.1001 -0.00101 -0.00364 3.709 -0.9872 0. -0.00144 0.003223 0.321 300 3.7292 0. -0.656 1.433 800. 0.4584 0.3435 0.4535 0.4535 0.7 0.4517
7.5 -5.0009 0.022 -0.101 -0.022 0.101 1.5737 6.5428 1.06 2.932 -2.1 -0.5 50 7.5818 3.838 0.45 0.0007 -0.0348 0.2154 0.2695 7.4666 0. 0.1 6.5 0. -0.1 -0.000964 -0.003686 3.6632 -0.8274 0. -0.001369 0.001134 0.329 300 2.3763 0. -0.5202 1.46 800. 0.4601 0.3459 0.4471 0.4471 0.7 0.4167
10 -5.3461 0.0124 -0.1 -0.0124 0.1 1.5265 6.7415 1.06 2.9396 -2.1 -0.5 50 7.5818 3.838 0.45 0.0003 -0.0253 0.2154 0.2695 7.77 0. 0.1 6.5 0. -0.1 -0.00095 -0.0037 3.623 -0.7053 0. -0.001361 0.000515 0.33 300 1.7679 0. -0.4068 1.464 800. 0.4612 0.3474 0.4426 0.4426 0.7 0.3755
""")
class ChiouYoungs2014PEER(ChiouYoungs2014):
"""
This implements the Chiou & Youngs (2014) GMPE for use with the PEER
tests. In this version the total standard deviation is fixed at 0.65
"""
#: Only the total standars deviation is defined
DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
const.StdDev.TOTAL,
])
#: The PEER tests requires only PGA
DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([
PGA,
])
def _get_stddevs(self, sites, rup, C, stddev_types, ln_y_ref, exp1, exp2):
"""
Returns the standard deviation, which is fixed at 0.65 for every site
"""
ret = []
for stddev_type in stddev_types:
assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
if stddev_type == const.StdDev.TOTAL:
# eq. 13
ret.append(0.65 * np.ones_like(sites.vs30))
return ret
|
mmpagani/oq-hazardlib
|
openquake/hazardlib/gsim/chiou_youngs_2014.py
|
Python
|
agpl-3.0
| 20,221
|
[
"Brian"
] |
24580ca092d1f706e4450bfaba97470dbc7466adff5395ef0fd12edc28333d98
|
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ----------------------------------------------------------------------------
import abc
import copy
import pandas as pd
from skbio.util._decorator import stable, experimental
from skbio.metadata import IntervalMetadata
class MetadataMixin(metaclass=abc.ABCMeta):
@property
@stable(as_of="0.4.0")
def metadata(self):
"""``dict`` containing metadata which applies to the entire object.
Notes
-----
This property can be set and deleted. When setting new metadata a
shallow copy of the dictionary is made.
Examples
--------
.. note:: scikit-bio objects with metadata share a common interface for
accessing and manipulating their metadata. The following examples
use scikit-bio's ``Sequence`` class to demonstrate metadata
behavior. These examples apply to all other scikit-bio objects
storing metadata.
Create a sequence with metadata:
>>> from pprint import pprint
>>> from skbio import Sequence
>>> seq = Sequence('ACGT', metadata={'description': 'seq description',
... 'id': 'seq-id'})
Retrieve metadata:
>>> pprint(seq.metadata) # using pprint to display dict in sorted order
{'description': 'seq description', 'id': 'seq-id'}
Update metadata:
>>> seq.metadata['id'] = 'new-id'
>>> seq.metadata['pubmed'] = 12345
>>> pprint(seq.metadata)
{'description': 'seq description', 'id': 'new-id', 'pubmed': 12345}
Set metadata:
>>> seq.metadata = {'abc': 123}
>>> seq.metadata
{'abc': 123}
Delete metadata:
>>> seq.has_metadata()
True
>>> del seq.metadata
>>> seq.metadata
{}
>>> seq.has_metadata()
False
"""
if self._metadata is None:
# Not using setter to avoid copy.
self._metadata = {}
return self._metadata
@metadata.setter
def metadata(self, metadata):
if not isinstance(metadata, dict):
raise TypeError("metadata must be a dict, not type %r" %
type(metadata).__name__)
# Shallow copy.
self._metadata = metadata.copy()
@metadata.deleter
def metadata(self):
self._metadata = None
@abc.abstractmethod
def __init__(self, metadata=None):
raise NotImplementedError
def _init_(self, metadata=None):
if metadata is None:
# Could use deleter but this is less overhead and needs to be fast.
self._metadata = None
else:
# Use setter for validation and copy.
self.metadata = metadata
@abc.abstractmethod
def __eq__(self, other):
raise NotImplementedError
def _eq_(self, other):
# We're not simply comparing self.metadata to other.metadata in order
# to avoid creating "empty" metadata representations on the objects if
# they don't have metadata.
if self.has_metadata() and other.has_metadata():
return self.metadata == other.metadata
elif not (self.has_metadata() or other.has_metadata()):
# Both don't have metadata.
return True
else:
# One has metadata while the other does not.
return False
@abc.abstractmethod
def __ne__(self, other):
raise NotImplementedError
def _ne_(self, other):
return not (self == other)
@abc.abstractmethod
def __copy__(self):
raise NotImplementedError
def _copy_(self):
if self.has_metadata():
return self.metadata.copy()
else:
return None
@abc.abstractmethod
def __deepcopy__(self, memo):
raise NotImplementedError
def _deepcopy_(self, memo):
if self.has_metadata():
return copy.deepcopy(self.metadata, memo)
else:
return None
@stable(as_of="0.4.0")
def has_metadata(self):
"""Determine if the object has metadata.
An object has metadata if its ``metadata`` dictionary is not empty
(i.e., has at least one key-value pair).
Returns
-------
bool
Indicates whether the object has metadata.
Examples
--------
.. note:: scikit-bio objects with metadata share a common interface for
accessing and manipulating their metadata. The following examples
use scikit-bio's ``Sequence`` class to demonstrate metadata
behavior. These examples apply to all other scikit-bio objects
storing metadata.
>>> from skbio import Sequence
>>> seq = Sequence('ACGT')
>>> seq.has_metadata()
False
>>> seq = Sequence('ACGT', metadata={})
>>> seq.has_metadata()
False
>>> seq = Sequence('ACGT', metadata={'id': 'seq-id'})
>>> seq.has_metadata()
True
"""
return self._metadata is not None and bool(self.metadata)
class PositionalMetadataMixin(metaclass=abc.ABCMeta):
@abc.abstractmethod
def _positional_metadata_axis_len_(self):
"""Return length of axis that positional metadata applies to.
Returns
-------
int
Positional metadata axis length.
"""
raise NotImplementedError
@property
@stable(as_of="0.4.0")
def positional_metadata(self):
"""``pd.DataFrame`` containing metadata along an axis.
Notes
-----
This property can be set and deleted. When setting new positional
metadata, a shallow copy is made and the ``pd.DataFrame`` index is set
to ``pd.RangeIndex(start=0, stop=axis_len, step=1)``.
Examples
--------
.. note:: scikit-bio objects with positional metadata share a common
interface for accessing and manipulating their positional metadata.
The following examples use scikit-bio's ``DNA`` class to demonstrate
positional metadata behavior. These examples apply to all other
scikit-bio objects storing positional metadata.
Create a DNA sequence with positional metadata:
>>> from skbio import DNA
>>> seq = DNA(
... 'ACGT',
... positional_metadata={'exons': [True, True, False, True],
... 'quality': [3, 3, 20, 11]})
>>> seq
DNA
-----------------------------
Positional metadata:
'exons': <dtype: bool>
'quality': <dtype: int64>
Stats:
length: 4
has gaps: False
has degenerates: False
has definites: True
GC-content: 50.00%
-----------------------------
0 ACGT
Retrieve positional metadata:
>>> seq.positional_metadata
exons quality
0 True 3
1 True 3
2 False 20
3 True 11
Update positional metadata:
>>> seq.positional_metadata['gaps'] = seq.gaps()
>>> seq.positional_metadata
exons quality gaps
0 True 3 False
1 True 3 False
2 False 20 False
3 True 11 False
Set positional metadata:
>>> seq.positional_metadata = {'degenerates': seq.degenerates()}
>>> seq.positional_metadata # doctest: +NORMALIZE_WHITESPACE
degenerates
0 False
1 False
2 False
3 False
Delete positional metadata:
>>> seq.has_positional_metadata()
True
>>> del seq.positional_metadata
>>> seq.positional_metadata
Empty DataFrame
Columns: []
Index: [0, 1, 2, 3]
>>> seq.has_positional_metadata()
False
"""
if self._positional_metadata is None:
# Not using setter to avoid copy.
self._positional_metadata = pd.DataFrame(
index=self._get_positional_metadata_index())
return self._positional_metadata
@positional_metadata.setter
def positional_metadata(self, positional_metadata):
try:
# Pass copy=True to copy underlying data buffer.
positional_metadata = pd.DataFrame(positional_metadata, copy=True)
# Different versions of pandas will raise different error types. We
# don't really care what the type of the error is, just its message, so
# a blanket Exception will do.
except Exception as e:
raise TypeError(
"Invalid positional metadata. Must be consumable by "
"`pd.DataFrame` constructor. Original pandas error message: "
"\"%s\"" % e)
num_rows = len(positional_metadata.index)
axis_len = self._positional_metadata_axis_len_()
if num_rows != axis_len:
raise ValueError(
"Number of positional metadata values (%d) must match the "
"positional metadata axis length (%d)."
% (num_rows, axis_len))
positional_metadata.index = self._get_positional_metadata_index()
self._positional_metadata = positional_metadata
@positional_metadata.deleter
def positional_metadata(self):
self._positional_metadata = None
def _get_positional_metadata_index(self):
"""Create a memory-efficient integer index for positional metadata."""
return pd.RangeIndex(start=0,
stop=self._positional_metadata_axis_len_(),
step=1)
@abc.abstractmethod
def __init__(self, positional_metadata=None):
raise NotImplementedError
def _init_(self, positional_metadata=None):
if positional_metadata is None:
# Could use deleter but this is less overhead and needs to be fast.
self._positional_metadata = None
else:
# Use setter for validation and copy.
self.positional_metadata = positional_metadata
@abc.abstractmethod
def __eq__(self, other):
raise NotImplementedError
def _eq_(self, other):
# We're not simply comparing self.positional_metadata to
# other.positional_metadata in order to avoid creating "empty"
# positional metadata representations on the objects if they don't have
# positional metadata.
if self.has_positional_metadata() and other.has_positional_metadata():
return self.positional_metadata.equals(other.positional_metadata)
elif not (self.has_positional_metadata() or
other.has_positional_metadata()):
# Both don't have positional metadata.
return (self._positional_metadata_axis_len_() ==
other._positional_metadata_axis_len_())
else:
# One has positional metadata while the other does not.
return False
@abc.abstractmethod
def __ne__(self, other):
raise NotImplementedError
def _ne_(self, other):
return not (self == other)
@abc.abstractmethod
def __copy__(self):
raise NotImplementedError
def _copy_(self):
if self.has_positional_metadata():
# deep=True makes a shallow copy of the underlying data buffer.
return self.positional_metadata.copy(deep=True)
else:
return None
@abc.abstractmethod
def __deepcopy__(self, memo):
raise NotImplementedError
def _deepcopy_(self, memo):
if self.has_positional_metadata():
# `copy.deepcopy` no longer recursively copies contents of the
# DataFrame, so we must handle the deep copy ourselves.
# Reference: https://github.com/pandas-dev/pandas/issues/17406
df = self.positional_metadata
data_cp = copy.deepcopy(df.values.tolist(), memo)
return pd.DataFrame(data_cp,
index=df.index.copy(deep=True),
columns=df.columns.copy(deep=True),
copy=False)
else:
return None
@stable(as_of="0.4.0")
def has_positional_metadata(self):
"""Determine if the object has positional metadata.
An object has positional metadata if its ``positional_metadata``
``pd.DataFrame`` has at least one column.
Returns
-------
bool
Indicates whether the object has positional metadata.
Examples
--------
.. note:: scikit-bio objects with positional metadata share a common
interface for accessing and manipulating their positional metadata.
The following examples use scikit-bio's ``DNA`` class to demonstrate
positional metadata behavior. These examples apply to all other
scikit-bio objects storing positional metadata.
>>> import pandas as pd
>>> from skbio import DNA
>>> seq = DNA('ACGT')
>>> seq.has_positional_metadata()
False
>>> seq = DNA('ACGT', positional_metadata=pd.DataFrame(index=range(4)))
>>> seq.has_positional_metadata()
False
>>> seq = DNA('ACGT', positional_metadata={'quality': range(4)})
>>> seq.has_positional_metadata()
True
"""
return (self._positional_metadata is not None and
len(self.positional_metadata.columns) > 0)
class IntervalMetadataMixin(metaclass=abc.ABCMeta):
@abc.abstractmethod
def _interval_metadata_axis_len_(self):
'''Return length of axis that interval metadata applies to.
Returns
-------
int
Interval metadata axis length.
'''
raise NotImplementedError
@abc.abstractmethod
def __init__(self, interval_metadata=None):
raise NotImplementedError
def _init_(self, interval_metadata=None):
if interval_metadata is None:
# Could use deleter but this is less overhead and needs to be fast.
self._interval_metadata = None
else:
# Use setter for validation and copy.
self.interval_metadata = interval_metadata
@property
@experimental(as_of="0.5.1")
def interval_metadata(self):
'''``IntervalMetadata`` object containing info about interval features.
Notes
-----
This property can be set and deleted. When setting new
interval metadata, a shallow copy of the ``IntervalMetadata``
object is made.
'''
if self._interval_metadata is None:
# Not using setter to avoid copy.
self._interval_metadata = IntervalMetadata(
self._interval_metadata_axis_len_())
return self._interval_metadata
@interval_metadata.setter
def interval_metadata(self, interval_metadata):
if isinstance(interval_metadata, IntervalMetadata):
upper_bound = interval_metadata.upper_bound
lower_bound = interval_metadata.lower_bound
axis_len = self._interval_metadata_axis_len_()
if lower_bound != 0:
raise ValueError(
'The lower bound for the interval features (%d) '
'must be zero.' % lower_bound)
if upper_bound is not None and upper_bound != axis_len:
raise ValueError(
'The upper bound for the interval features (%d) '
'must match the interval metadata axis length (%d)'
% (upper_bound, axis_len))
# copy all the data to the mixin
self._interval_metadata = IntervalMetadata(
axis_len, copy_from=interval_metadata)
else:
raise TypeError('You must provide `IntervalMetadata` object, '
'not type %s.' % type(interval_metadata).__name__)
@interval_metadata.deleter
def interval_metadata(self):
self._interval_metadata = None
@experimental(as_of="0.5.1")
def has_interval_metadata(self):
"""Determine if the object has interval metadata.
An object has interval metadata if its ``interval_metadata``
has at least one ```Interval`` objects.
Returns
-------
bool
Indicates whether the object has interval metadata.
"""
return (self._interval_metadata is not None and
self.interval_metadata.num_interval_features > 0)
@abc.abstractmethod
def __eq__(self, other):
raise NotImplementedError
def _eq_(self, other):
# We're not simply comparing self.interval_metadata to
# other.interval_metadata in order to avoid creating "empty"
# interval metadata representations on the objects if they don't have
# interval metadata.
if self.has_interval_metadata() and other.has_interval_metadata():
return self.interval_metadata == other.interval_metadata
elif not (self.has_interval_metadata() or
other.has_interval_metadata()):
# Both don't have interval metadata.
return (self._interval_metadata_axis_len_() ==
other._interval_metadata_axis_len_())
else:
# One has interval metadata while the other does not.
return False
@abc.abstractmethod
def __ne__(self, other):
raise NotImplementedError
def _ne_(self, other):
return not (self == other)
@abc.abstractmethod
def __copy__(self):
raise NotImplementedError
def _copy_(self):
if self.has_interval_metadata():
return copy.copy(self.interval_metadata)
else:
return None
@abc.abstractmethod
def __deepcopy__(self, memo):
raise NotImplementedError
def _deepcopy_(self, memo):
if self.has_interval_metadata():
return copy.deepcopy(self.interval_metadata, memo)
else:
return None
|
gregcaporaso/scikit-bio
|
skbio/metadata/_mixin.py
|
Python
|
bsd-3-clause
| 18,539
|
[
"scikit-bio"
] |
f91b63f76bca56f13437f56fafe306b3bac702316d2b3f62865450ed660e99a9
|
# -*- coding: utf-8 -*-
"""
This module contains functions for turning a Python script into a .hex file
and flashing it onto a BBC micro:bit.
Copyright (c) 2015-2018 Nicholas H.Tollervey and others.
See the LICENSE file for more information, or visit:
https://opensource.org/licenses/MIT
"""
from __future__ import print_function
import argparse
import binascii
import ctypes
import os
import struct
import sys
from subprocess import check_output
import time
# nudatus is an optional dependancy
can_minify = True
try:
import nudatus
except ImportError: # pragma: no cover
can_minify = False
#: The magic start address in flash memory for a Python script.
_SCRIPT_ADDR = 0x3e000
#: The help text to be shown when requested.
_HELP_TEXT = """
Flash Python onto the BBC micro:bit or extract Python from a .hex file.
If no path to the micro:bit is provided uflash will attempt to autodetect the
correct path to the device. If no path to the Python script is provided uflash
will flash the unmodified MicroPython firmware onto the device. Use the -e flag
to recover a Python script from a hex file. Use the -r flag to specify a custom
version of the MicroPython runtime.
Documentation is here: https://uflash.readthedocs.io/en/latest/
"""
#: MAJOR, MINOR, RELEASE, STATUS [alpha, beta, final], VERSION of uflash
_VERSION = (1, 2, 4, )
_MAX_SIZE = 8188
#: The version number reported by the bundled MicroPython in os.uname().
MICROPYTHON_VERSION = '1.0.1'
def get_version():
"""
Returns a string representation of the version information of this project.
"""
return '.'.join([str(i) for i in _VERSION])
def get_minifier():
"""
Report the minifier will be used when minify=True
"""
if can_minify:
return 'nudatus'
return None
def strfunc(raw):
"""
Compatibility for 2 & 3 str()
"""
return str(raw) if sys.version_info[0] == 2 else str(raw, 'utf-8')
def hexlify(script, minify=False):
"""
Takes the byte content of a Python script and returns a hex encoded
version of it.
Based on the hexlify script in the microbit-micropython repository.
"""
if not script:
return ''
# Convert line endings in case the file was created on Windows.
script = script.replace(b'\r\n', b'\n')
script = script.replace(b'\r', b'\n')
if minify:
if not can_minify:
raise ValueError("No minifier is available")
script = nudatus.mangle(script.decode('utf-8')).encode('utf-8')
# Add header, pad to multiple of 16 bytes.
data = b'MP' + struct.pack('<H', len(script)) + script
# Padding with null bytes in a 2/3 compatible way
data = data + (b'\x00' * (16 - len(data) % 16))
if len(data) > _MAX_SIZE:
# 'MP' = 2 bytes, script length is another 2 bytes.
raise ValueError("Python script must be less than 8188 bytes.")
# Convert to .hex format.
output = [':020000040003F7'] # extended linear address, 0x0003.
addr = _SCRIPT_ADDR
for i in range(0, len(data), 16):
chunk = data[i:min(i + 16, len(data))]
chunk = struct.pack('>BHB', len(chunk), addr & 0xffff, 0) + chunk
checksum = (-(sum(bytearray(chunk)))) & 0xff
hexline = ':%s%02X' % (strfunc(binascii.hexlify(chunk)).upper(),
checksum)
output.append(hexline)
addr += 16
return '\n'.join(output)
def unhexlify(blob):
"""
Takes a hexlified script and turns it back into a string of Python code.
"""
lines = blob.split('\n')[1:]
output = []
for line in lines:
# Discard the address, length etc. and reverse the hexlification
output.append(binascii.unhexlify(line[9:-2]))
# Check the header is correct ("MP<size>")
if (output[0][0:2].decode('utf-8') != u'MP'):
return ''
# Strip off header
output[0] = output[0][4:]
# and strip any null bytes from the end
output[-1] = output[-1].strip(b'\x00')
script = b''.join(output)
try:
result = script.decode('utf-8')
return result
except UnicodeDecodeError:
# Return an empty string because in certain rare circumstances (where
# the source hex doesn't include any embedded Python code) this
# function may be passed in "raw" bytes from MicroPython.
return ''
def embed_hex(runtime_hex, python_hex=None):
"""
Given a string representing the MicroPython runtime hex, will embed a
string representing a hex encoded Python script into it.
Returns a string representation of the resulting combination.
Will raise a ValueError if the runtime_hex is missing.
If the python_hex is missing, it will return the unmodified runtime_hex.
"""
if not runtime_hex:
raise ValueError('MicroPython runtime hex required.')
if not python_hex:
return runtime_hex
py_list = python_hex.split()
runtime_list = runtime_hex.split()
embedded_list = []
# The embedded list should be the original runtime with the Python based
# hex embedded two lines from the end.
embedded_list.extend(runtime_list[:-5])
embedded_list.extend(py_list)
embedded_list.extend(runtime_list[-5:])
return '\n'.join(embedded_list) + '\n'
def extract_script(embedded_hex):
"""
Given a hex file containing the MicroPython runtime and an embedded Python
script, will extract the original Python script.
Returns a string containing the original embedded script.
"""
hex_lines = embedded_hex.split('\n')
script_addr_high = hex((_SCRIPT_ADDR >> 16) & 0xffff)[2:].upper().zfill(4)
script_addr_low = hex(_SCRIPT_ADDR & 0xffff)[2:].upper().zfill(4)
start_script = None
within_range = False
# Look for the script start address
for loc, val in enumerate(hex_lines):
if val[0:9] == ':02000004':
# Reached an extended address record, check if within script range
within_range = val[9:13].upper() == script_addr_high
elif within_range and val[0:3] == ':10' and \
val[3:7].upper() == script_addr_low:
start_script = loc
break
if start_script:
# Find the end of the script
end_script = None
for loc, val in enumerate(hex_lines[start_script:]):
if val[9:41] == 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF':
end_script = loc + start_script
break
# Pass the extracted hex through unhexlify
return unhexlify('\n'.join(
hex_lines[start_script - 1:end_script if end_script else -6]))
return ''
def find_microbit():
"""
Returns a path on the filesystem that represents the plugged in BBC
micro:bit that is to be flashed. If no micro:bit is found, it returns
None.
Works on Linux, OSX and Windows. Will raise a NotImplementedError
exception if run on any other operating system.
"""
# Check what sort of operating system we're on.
if os.name == 'posix':
# 'posix' means we're on Linux or OSX (Mac).
# Call the unix "mount" command to list the mounted volumes.
mount_output = check_output('mount').splitlines()
mounted_volumes = [x.split()[2] for x in mount_output]
for volume in mounted_volumes:
if volume.endswith(b'MICROBIT'):
return volume.decode('utf-8') # Return a string not bytes.
elif os.name == 'nt':
# 'nt' means we're on Windows.
def get_volume_name(disk_name):
"""
Each disk or external device connected to windows has an attribute
called "volume name". This function returns the volume name for
the given disk/device.
Code from http://stackoverflow.com/a/12056414
"""
vol_name_buf = ctypes.create_unicode_buffer(1024)
ctypes.windll.kernel32.GetVolumeInformationW(
ctypes.c_wchar_p(disk_name), vol_name_buf,
ctypes.sizeof(vol_name_buf), None, None, None, None, 0)
return vol_name_buf.value
#
# In certain circumstances, volumes are allocated to USB
# storage devices which cause a Windows popup to raise if their
# volume contains no media. Wrapping the check in SetErrorMode
# with SEM_FAILCRITICALERRORS (1) prevents this popup.
#
old_mode = ctypes.windll.kernel32.SetErrorMode(1)
try:
for disk in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
path = '{}:\\'.format(disk)
#
# Don't bother looking if the drive isn't removable
#
if ctypes.windll.kernel32.GetDriveTypeW(path) != 2:
continue
if os.path.exists(path) and \
get_volume_name(path) == 'MICROBIT':
return path
finally:
ctypes.windll.kernel32.SetErrorMode(old_mode)
else:
# No support for unknown operating systems.
raise NotImplementedError('OS "{}" not supported.'.format(os.name))
def save_hex(hex_file, path):
"""
Given a string representation of a hex file, this function copies it to
the specified path thus causing the device mounted at that point to be
flashed.
If the hex_file is empty it will raise a ValueError.
If the filename at the end of the path does not end in '.hex' it will raise
a ValueError.
"""
if not hex_file:
raise ValueError('Cannot flash an empty .hex file.')
if not path.endswith('.hex'):
raise ValueError('The path to flash must be for a .hex file.')
with open(path, 'wb') as output:
output.write(hex_file.encode('ascii'))
def flash(path_to_python=None, paths_to_microbits=None,
path_to_runtime=None, python_script=None, minify=False):
"""
Given a path to or source of a Python file will attempt to create a hex
file and then flash it onto the referenced BBC micro:bit.
If the path_to_python & python_script are unspecified it will simply flash
the unmodified MicroPython runtime onto the device.
If used, the python_script argument should be a bytes object representing
a UTF-8 encoded string. For example::
script = "from microbit import *\\ndisplay.scroll('Hello, World!')"
uflash.flash(python_script=script.encode('utf-8'))
If paths_to_microbits is unspecified it will attempt to find the device's
path on the filesystem automatically.
If the path_to_runtime is unspecified it will use the built in version of
the MicroPython runtime. This feature is useful if a custom build of
MicroPython is available.
If the automatic discovery fails, then it will raise an IOError.
"""
# Check for the correct version of Python.
if not ((sys.version_info[0] == 3 and sys.version_info[1] >= 3) or
(sys.version_info[0] == 2 and sys.version_info[1] >= 7)):
raise RuntimeError('Will only run on Python 2.7, or 3.3 and later.')
# Grab the Python script (if needed).
python_hex = ''
if path_to_python:
if not path_to_python.endswith('.py'):
raise ValueError('Python files must end in ".py".')
with open(path_to_python, 'rb') as python_script:
python_hex = hexlify(python_script.read(), minify)
elif python_script:
python_hex = hexlify(python_script, minify)
runtime = _RUNTIME
# Load the hex for the runtime.
if path_to_runtime:
with open(path_to_runtime) as runtime_file:
runtime = runtime_file.read()
# Generate the resulting hex file.
micropython_hex = embed_hex(runtime, python_hex)
# Find the micro:bit.
if not paths_to_microbits:
found_microbit = find_microbit()
if found_microbit:
paths_to_microbits = [found_microbit]
# Attempt to write the hex file to the micro:bit.
if paths_to_microbits:
for path in paths_to_microbits:
hex_path = os.path.join(path, 'micropython.hex')
print('Flashing Python to: {}'.format(hex_path))
save_hex(micropython_hex, hex_path)
else:
raise IOError('Unable to find micro:bit. Is it plugged in?')
def extract(path_to_hex, output_path=None):
"""
Given a path_to_hex file this function will attempt to extract the
embedded script from it and save it either to output_path or stdout
"""
with open(path_to_hex, 'r') as hex_file:
python_script = extract_script(hex_file.read())
if output_path:
with open(output_path, 'w') as output_file:
output_file.write(python_script)
else:
print(python_script)
def watch_file(path, func, *args, **kwargs):
"""
Watch a file for changes by polling its last modification time. Call the
provided function with *args and **kwargs upon modification.
"""
if not path:
raise ValueError('Please specify a file to watch')
print('Watching "{}" for changes'.format(path))
last_modification_time = os.path.getmtime(path)
try:
while True:
time.sleep(1)
new_modification_time = os.path.getmtime(path)
if new_modification_time == last_modification_time:
continue
func(*args, **kwargs)
last_modification_time = new_modification_time
except KeyboardInterrupt:
pass
def main(argv=None):
"""
Entry point for the command line tool 'uflash'.
Will print help text if the optional first argument is "help". Otherwise
it will ensure the optional first argument ends in ".py" (the source
Python script).
An optional second argument is used to reference the path to the micro:bit
device. Any more arguments are ignored.
Exceptions are caught and printed for the user.
"""
if not argv:
argv = sys.argv[1:]
parser = argparse.ArgumentParser(description=_HELP_TEXT)
parser.add_argument('source', nargs='?', default=None)
parser.add_argument('target', nargs='*', default=None)
parser.add_argument('-r', '--runtime', default=None,
help="Use the referenced MicroPython runtime.")
parser.add_argument('-e', '--extract',
action='store_true',
help=("Extract python source from a hex file"
" instead of creating the hex file."), )
parser.add_argument('-w', '--watch',
action='store_true',
help='Watch the source file for changes.')
parser.add_argument('-m', '--minify',
action='store_true',
help='Minify the source')
parser.add_argument('--version', action='version',
version='%(prog)s ' + get_version())
args = parser.parse_args(argv)
if args.extract:
try:
extract(args.source, args.target)
except Exception as ex:
error_message = "Error extracting {source}: {error!s}"
print(error_message.format(source=args.source, error=ex),
file=sys.stderr)
sys.exit(1)
elif args.watch:
try:
watch_file(args.source, flash,
path_to_python=args.source,
paths_to_microbits=args.target,
path_to_runtime=args.runtime)
except Exception as ex:
error_message = "Error watching {source}: {error!s}"
print(error_message.format(source=args.source, error=ex),
file=sys.stderr)
sys.exit(1)
else:
try:
flash(path_to_python=args.source, paths_to_microbits=args.target,
path_to_runtime=args.runtime, minify=args.minify)
except Exception as ex:
error_message = (
"Error flashing {source} to {target}{runtime}: {error!s}"
)
source = args.source
target = args.target if args.target else "microbit"
if args.runtime:
runtime = "with runtime {runtime}".format(runtime=args.runtime)
else:
runtime = ""
print(error_message.format(source=source, target=target,
runtime=runtime, error=ex),
file=sys.stderr)
sys.exit(1)
#: A string representation of the MicroPython runtime hex.
_RUNTIME = """:020000040000FA
:1000000000400020218E01005D8E01005F8E010006
:1000100000000000000000000000000000000000E0
:10002000000000000000000000000000618E0100E0
:100030000000000000000000638E0100658E0100DA
:10004000678E01005D3D000065950100678E01002F
:10005000678E010000000000218F0100678E010003
:1000600069E80000D59A0100D9930100678E01006C
:10007000678E0100678E0100678E0100678E0100A8
:10008000678E0100678E0100678E0100678E010098
:10009000678E01000D8A0100D98A0100A5E90000E0
:1000A000B5E90000678E01000000000000000000BC
:1000B0000000000000000000000000000000000040
:1000C00010B5064C2378002B07D1054B002B02D02E
:1000D000044800E000BF0123237010BD2001002070
:1000E0000000000098870300044B10B5002B03D0DC
:1000F0000349044800E000BF10BDC04600000000F6
:100100002401002098870300164B002B00D1144BCC
:100110009D46402292029A1A924600218B460F4633
:100120001348144A121A28F050FE0F4B002B00D02F
:1001300098470E4B002B00D0984700200021040068
:100140000D000D48002802D00C4800E000BF20F050
:10015000E3FB2000290028F08EFB20F029FBC0469D
:100160000000080000400020000000000000000027
:1001700018010020E02F0020000000000000000017
:1001800010B54A68014926F045FE10BDC43B030086
:1001900010B50400080021F08CF90300002C03D0F6
:1001A000012C06D0002003E00348002B00DC0348AC
:1001B00010BD40002043FBE7CCE70200C4E702008B
:1001C00043684B6083688B60C3680800CB60014B59
:1001D0000B607047A890020030B5040087B00D0096
:1001E0000020042A25D1200021F063F9AB0722D199
:1001F000184B2A689A421ED103AA290011F034FB39
:10020000102026F056F8144BE2680360039B6168E7
:1002100053435B184360049B6168019353435B182D
:10022000059983604A43C260002902DAE2689B1A9A
:10023000836007B030BD002301002A00206802F06F
:10024000F5FCE36858436368C01801234000184375
:10025000EFE7C046E8A402006C900200F0B50E0083
:10026000002785B0110003901D00012203233000F8
:10027000009712F021F8102026F01BF8039B0400D1
:10028000036001234760C36028689E4205D102F0E5
:10029000F5FBA060200005B0F0BD02F0EFFB606050
:1002A000686802F0EBFBA060032EF3D1A86802F0AF
:1002B000E5FBE0600028EDD101480DF087F8C0466D
:1002C000D6FB020070B50D004A688B68084904002F
:1002D00026F0A0FDEA68012A04D10649200026F094
:1002E000D8FC70BD0449200026F094FDF9E7C04613
:1002F000E0FB0200A0020300EDFB0200136810B552
:100300001400002B05D1A42904D1406825F0D8F9A8
:10031000206010BDB9235B00994201D18068F5E7E8
:10032000024B9942F5D1C068F0E7C046BF02000019
:100330000023820708D10068044A0133904203D0A9
:10034000034BC01A434243411800704720910200FA
:10035000E4900200044B88600B60044B08004B6083
:100360000023CB607047C0466C98020097150200CE
:1003700030B585B00500080069460CF0F7FB0400B5
:1003800020000CF055FC011E02D1064805B030BD1E
:100390002B1D0022180023F085F80028F0D0024819
:1003A000F4E7C046CCE70200C4E7020070B50500E0
:1003B000102025F07EFF0400074B696808C023F079
:1003C00067F8AB68E968A3606B68E0689A0028F09A
:1003D000E0FC200070BDC04620910200F7B504008B
:1003E0000D0000268B0704D10B68214E9E1B734223
:1003F0005E41AB68002B0AD1002E03D01D492000BE
:1004000026F047FC1C49200026F043FCF7BD002ED7
:1004100003D01A49200026F03CFC1949200026F0A0
:1004200038FC002701236A68BA4207D81549200022
:1004300026F02FFC002EE9D01349E4E7BA00019220
:10044000EA68B9005258002A0FD0042A0DD0002BB8
:1004500003D10E49200026F01CFCEB68B900595866
:100460000122200002F03AFA00230137DBE7C04600
:10047000E49002002BFC020032FC020038FC020077
:1004800043FC02005E070300A002030045FC0200DB
:1004900010B5830707D1044B02689A4203D1034980
:1004A000034824F0C7FA10BDE4900200F3FB0200F9
:1004B000E0A7020070B50D000400FFF7E9FF290076
:1004C000201D012222F0EEFF004870BDE4B30200BF
:1004D00070B50D000400FFF7DBFF2900201D02228C
:1004E00022F0E0FF004870BDE4B3020070B50600E2
:1004F00008680D000124FFF7CBFFB44201D3044884
:1005000070BDA300E958286820F0E3FF0134F4E748
:10051000E4B3020070B50D000400FFF7B9FF280036
:1005200000210CF023FB050028000CF081FB011ECC
:1005300001D1044870BD231D0322180022F0B2FF30
:10054000F2E7C046E4B3020010B50400FFF7A0FFD5
:10055000201D23F035F8014810BDC046E4B3020069
:1005600010B5012220F0E6FF004810BDE4B3020000
:1005700070B504000D00FFF78BFF201D022229003B
:1005800022F090FF002804D1034822F03EFE0CF038
:10059000A5F8024870BDC046C0A90200E4B302003D
:1005A00010B50400FFF774FF201D22F0EAFF0028B9
:1005B00003D10249024824F03DFA10BD15FC0200A7
:1005C000C0A90200F8B50D0001280BD0002803D007
:1005D00002280BD0002004E08B681448002B00D1C7
:1005E0001348F8BD8B685B001843FAE7032400202A
:1005F0000C408442F5D10F4B0E6820009E42F0D192
:100600004F68A74203D1012076003043E9E7EA684A
:10061000A3009958002906D0042904D002200CF028
:100620003DF9401036180134EBE7C046CCE7020034
:10063000C4E70200E4900200F8B5040010200D00A9
:1006400025F037FE0600094B210008C607003000E0
:1006500022F01EFFA4002C19A54201D13800F8BDDC
:10066000012202CD300022F01DFFF5E720910200AB
:10067000F7B504000E00171E2CD0FFF709FF194D27
:10068000B4422DD000210800FFF7D6FF002105005D
:1006900030000CF06BFA019001980CF0C9FA061EBC
:1006A0000CD1002F1CD0E06825F032FE6B6863602F
:1006B000AB68A360EB680B4DE36011E0201D0022E6
:1006C000310022F0EFFE0028E6D031002800FFF7CD
:1006D000F1FEE1E78842D5D1200020F00DFF0500B2
:1006E0002800FEBDE4B30200F0B589B00400039019
:1006F000029101920027FFF71BFEB84207D13A0092
:1007000003AB0121224820F06BFF04000137029D5A
:1007100000262800FFF70CFEB04207D1320002ABE2
:1007200001211B4820F05CFF05000136019B002BD6
:1007300005D00023AA680193A36893420DD0154BFE
:1007400006940493144B05930023079304A820F008
:1007500022FF011E12D101230193002F02D020009D
:10076000FFF7F2FE002E02D02800FFF7EDFE019BFE
:100770000A48002B00D10A4809B0F0BD2B1D002209
:10078000180022F08FFE0028E0D10190E5E7C04676
:10079000209102006C98020097150200CCE702003D
:1007A000C4E7020073B50C00150000910192002609
:1007B0008B0704D10B68394E9E1B73425E41320099
:1007C0001F2868D819F0A0FA2810176767671C67F8
:1007D0006767676767212D346767673B6767676788
:1007E0006740464A5358675D2900200020F095FE77
:1007F0000400200076BD2900200020F0E6FEF7E787
:100800006946022020F0C2FEF2E7002E04D06946BD
:100810000220FFF76BFEECE72900200020F073FEBA
:10082000E6E729002000002EE0D0FFF773FEE0E7A6
:1008300029002000FFF71CFF002EDAD1D8E7694617
:10084000022020F077FED3E7012229002000FFF7E5
:100850004BFFCDE7012221002800F8E72800FFF731
:1008600067FD002815D0A368AA68934211D129001A
:10087000200020F0E6FEBBE72900200020F0D9FE92
:10088000B6E7201D0022290022F00CFE044C0028AF
:10089000AFD1044CADE70024ABE7C0462091020085
:1008A000CCE70200C4E70200F0B50F00496885B04C
:1008B00005001600002901D0002A05D139002800C2
:1008C00020F0D0FF05B0F0BD0F321309C918009316
:1008D00020F039FF0F22A868B9687C68324000D147
:1008E0001032009B1E19234BF3185B00C018214BDC
:1008F0000290E3185B00CB18019010209C46210069
:100900000023801A002921D1C3401A48029A844644
:100910006400141B2380009B5B00E41A009B0234DC
:1009200063445A00200028F050FA002E04D07300CF
:10093000023BE35A002B1BD001216E603B78DB07A2
:10094000DA0F2B788B4313432B70BBE76246128878
:10095000013913431A00C2400393019B1A80019A84
:10096000039B023A0192022252421B049444C9E7BB
:10097000013EDAE7FFFFFF7FF0B54B6815005268D4
:1009800089B006000C00934201D22C000D00012119
:10099000227863680A4201D12A781140C9183000D0
:1009A00020F0D1FEB36822780193A3681700029368
:1009B000636829789C46AB684F4003930123180075
:1009C0001F408B4306936346904302006046591EC6
:1009D000019B04936B681B1A07934B1C18D1634649
:1009E0005900019B5918002F02D001230B800231BE
:1009F000019820F02BFE0121706022782B78534063
:100A00003278DB078A43DB0F1343337009B0F0BD44
:100A1000029B13481B881B189B180593079B5B18A8
:100A20008B421AD8039B039A1B8802321B1803922D
:100A3000069A01399B18059A5A4092B21B0CD71995
:100A40000693049A059B17801A0C049B3F0C0233F3
:100A50000493029B02330293BFE7014BE8E7C046D1
:100A6000FFFF0000F0B5060095B0069353680D0037
:100A7000591C0492009320F066FE049B00215B68E1
:100A8000B0685A1C5200009328F09FF9002373604D
:100A9000049B28005B68591C009320F054FE0499C5
:100AA000280020F0DFFEAB686F680193069B9B680F
:100AB0000393069B5B680293B3680793029BBB4258
:100AC0002DD82ED3039A3900019820F07FFE0028FC
:100AD00023D10123079A686013807360049B1A78FE
:100AE000069B1B785A4001231A4214D032781343D4
:100AF00033706B68002B0ED0012111A8494220F001
:100B0000D0FE11AA3100300021F0D2F8069A290057
:100B1000280021F0CDF815B0F0BD002801DA00233F
:100B2000DBE7824A029B9B185B009C460022039BEA
:100B3000634405931B8800921AB2002A63DA0022EC
:100B4000019B7C001A537B1C102709936B60019B4F
:100B5000A01C00991B180893791A019B0A91089907
:100B60008B4256D3059B009A1B8893400893029BA7
:100B7000012B0AD91022039B00996344023B1B8876
:100B8000521AD340089A1A430892019B029A1C19E0
:100B9000099B9B1A654A73609B18079A5B00D318E0
:100BA0000A93634602330E936B680B930B9A029B76
:100BB000934239D313005D4A102194460024019AD0
:100BC00063445B00D318009A891A019A9A4200D8AC
:100BD0009EE07368002B07D0544A07999A18520078
:100BE000525A002A00D19DE06B68002B00D175E7B6
:100BF0004E4A01999A185200525A002A00D06DE7C5
:100C0000013B6B60F0E7009A5B0001329BB292B24D
:100C100091E71988009F0800B84002431A800A9A99
:100C20000233D1408AB29AE7A31E20880D931B8815
:100C300000041843089919F07BF80E9B0022E31A70
:100C40000C931900039B05909C4609928C4212D884
:100C500023889A4234D3D31A5A42190C9BB2228069
:100C60005A1E9341CA18002A2CD003990C9B8C461B
:100C700000210F0041E0099B009F180C63461B8870
:100C8000BB4018436B4609909F8C059B5F430B88C4
:100C90009F4203D2D81B0F9090420CD8D31AFF1852
:100CA0007B420B80BBB23A0C5F1EBB41D2180223C1
:100CB00002319C44CAE70F9B9A1A0A800022F6E789
:100CC0009A1A22800A9B059A023B5A800A930B9B30
:100CD0000D9C013B6B6067E7380C09906046009FF4
:100CE0000088B840099F074318884118B8B24118D6
:100CF000022019808444090C02339C42ECD82388DA
:100D00005918059B2180013B090C521A0593AAE74B
:100D10001A88009F100038418A402043188094B2FE
:100D2000023B52E7013B736053E7C046FFFFFF7F82
:100D3000436870B55A00002384680A4DA218944293
:100D400006D30278D20700D55B4201200B6070BD4C
:100D5000023AAB4203D816881B043343EFE7002066
:100D6000F5E7C046FF7F0000032230B502400121B5
:100D7000002A04D1084C05680B00A54209D00B00DD
:100D8000034006D1002A04D1036804481B1A5842C4
:100D90004341180030BDC046D4E702002CB9020020
:100DA00010B50400FFF7E0FF012200280AD1032359
:100DB00002002340022B05D103480440063C2200D8
:100DC000541EA241100010BD070080FF044B886034
:100DD0000B60044B08004B600023CB607047C0469B
:100DE0006C980200F125020010B501F05FFD084B80
:100DF00042680848D31859424B41AC215B428B43AF
:100E0000B02189005B18044907F04CFB0BF066FC2D
:100E100040FDFFFF90AC020048FC0200F7B5040063
:100E20000E00019301208B180A0000210093009B03
:100E3000934212D82725002900D0053D224F2A00D1
:100E40003900200025F0E6FF009B9E4214D32A00C3
:100E50003900200025F0DEFFF7BD1378272B08D0DE
:100E6000223B5D426B41DBB20132002BDFD02725F4
:100E7000E4E700230100F7E73278AA4205D12A000F
:100E80001249200025F0C6FF1AE011495C2A14D04F
:100E90001F2A09D97F2A15D0019B002B02D053B2FB
:100EA000002B07DB3900ECE70A490A2A05D00A497A
:100EB0000D2A02D0092A05D10849200025F0E9FEB3
:100EC0000136C1E70649DCE7820003008100030028
:100ED00085000300880003008B0003008E000300E0
:100EE00091000300194B70B506000C0098420FD119
:100EF0004968A0680FF0AEFD051E09D0200026F05D
:100F000024F90023ED00236006331D43280070BD43
:100F1000102025F0CEF96168050081600660A068A8
:100F20000FF07AFD63686860591C2368994208D104
:100F3000A368EB600023EA68A9685354A3602360A8
:100F4000E4E7A06825F0D3F9E860F3E70C9A020023
:100F500070B504000D00002A05D00FF0ADFDC300F0
:100F60000620184370BD0FF075FD0028F7D12A0048
:100F70002100024821F014FAF4E7C0460C9A02005E
:100F800010B50A000100024821F00AFA10BDC0465F
:100F9000A0920200094B10B50340062B01D1C008F6
:100FA00010BD830708D1064B02689A4204D18168BC
:100FB000C0680FF081FDF3E7FFF716FF070080FF21
:100FC0000C9A0200064B10B50340062B03D1C00853
:100FD00024F0D5FC10BD8368C0680B60FAE7C046FA
:100FE000070080FFF0B50F00002589B01100060052
:100FF0001C003800009503232A0011F05DF90E2033
:10100000AF420FD0012F0FD102AA102104A814F073
:10101000F7FE216802A82A0001F060FC04A9300054
:10102000FFF760FF09B0F0BD2068830722D1164B9F
:1010300002689A421ED104A9FFF7C4FF134B0500B2
:1010400020680340062B13D1C00824F089FC04005B
:10105000002C04D1049928000FF0DEFC04001020BD
:10106000049F25F026F906608760C5604460D9E7D3
:101070004468EDE704A9012201F0BAFE00220599B7
:101080000498FFF765FFCDE7A0920200070080FFFC
:10109000F0B58DB00400039101F008FC04A906002E
:1010A0002000FFF78FFF039B01902F489A0705D17F
:1010B0001B6883420AD02D4A934207D0C36800229E
:1010C0000293012103AB029CA0470390002406AACF
:1010D00005A9039801F074FD2500059BA3420ED8D5
:1010E0002900002508A826F01FF80A9C059BAB42A2
:1010F00021D808A93000FFF7F5FE0DB0F0BD069B22
:10110000A700D85901F0D2FBB04202D018480CF029
:1011100021FB002C01D0049BED18069BD859154BE0
:101120000340062B05D1C00824F01FFC2D18013404
:10113000D3E78068FAE7002D06D02000049A0199D1
:1011400027F027FE049BE418069AAB00985807A9DD
:10115000FFF738FF079A0100200027F01AFE079BCF
:101160000135E418C2E7C04688E702004CA002003F
:10117000BE000300070080FFF0B58BB00490086844
:101180000D000692079301F091FB0400686801F0DE
:101190008DFB0600A04202D06868FFF725FE08A973
:1011A0002868FFF70FFF040009A96868FFF70AFF26
:1011B000089A0590A3180393049B2700022B19D9C2
:1011C000AB681D498B4206D00121300000912100FF
:1011D00004F04AF80700049B032B0BD0EB68164A77
:1011E000934207D00122210000923000089A04F0B7
:1011F0003BF80390039B059AD91B069B380000938C
:10120000099B21F0AEF8002806D1079B0138002B7E
:101210000CD00A480CF0DAF8094B9E4208D10100C4
:10122000200022F054F84400012020430BB0F0BD10
:10123000041B6400F8E7C046E4B30200AA00030000
:101240000C9A0200F0B5070087B008680D0001F0A5
:101250002DFB04A906002868FFF7B4FE05A90400C9
:101260006868FFF7AFFE03902000022F07D9012323
:101270000093AB68049A2100300003F0F5FF059A53
:10128000041B049BA418064D9C4205D8039927F023
:1012900071FD002800D1034D280007B0F0BDC04605
:1012A000C4E70200CCE7020073B50D0006006946F2
:1012B0002868FFF787FE01A904006868FFF782FE2F
:1012C0000100022E02D908480CF072FA019A009827
:1012D000064D824206D8801A201827F04BFD0028C0
:1012E00000D1034D280076BD98000300C4E702003A
:1012F000CCE70200F0B58FB0079010680C00160024
:1013000001F0D4FA0690012C31D0706801F0CEFAC9
:10131000069B984202D07068FFF766FD0DA97068C1
:10132000FFF750FE0D9B089009930DA93068FFF759
:1013300049FE0D9B0B900493079B012B1CD1049B32
:101340005D1E01235B420A9300242700049B039443
:101350000593059B002B13D1039B002B23D1214B1D
:10136000069A0E209A4200D01F480FB0F0BD072306
:1013700009931E4B0893D8E7012300250A93E3E75E
:101380000B9B09995A1901230898009320F0E9FF53
:10139000002816D1039B002B19D1079B002B09D1E4
:1013A0002F00049B5C1E049B0134E21B934212D16C
:1013B0003068DAE7079B2C00012B0AD001232F00AD
:1013C00003930A9BED18059B013B0593C1E72C0095
:1013D000F7E7039FE7E70B9B0698D91920F0E0FF9A
:1013E000C3E7C0460C9A0200909202001701030066
:1013F000F0B589B0049008680D0001F057FA0400B8
:10140000686801F053FA0700A04202D06868FFF74D
:10141000EBFC06A92868FFF7D5FD060007A9686858
:10142000FFF7D0FD069A0590B3180393049B340090
:10143000022B19D9AB681E498B4206D00121380016
:101440000091310003F010FF0400049B032B0BD02C
:10145000EB68174A934207D001223100009238000E
:10146000069A03F001FF03900025079BAB4212D1BF
:10147000039B2000191B21F039FF0130450001209A
:10148000284309B0F0BD0599200027F073FC00281F
:1014900008D101353400079A039BA6189E42F2D961
:1014A0006D00ECE7200021F009FF0600F2E7C046DE
:1014B000E4B3020010B50100014821F063F810BD4B
:1014C0000D33020010B50100014821F05BF810BD9A
:1014D0001F330200F7B50600080001A9FFF772FDEF
:1014E000019B0500002B01D11348FEBD134B0400E6
:1014F0009E4207D10027019A631B9A4211D8002F00
:1015000007D1F1E70E4B9E42F4D0019A631B9A4239
:1015100001D80C48E9E72078B04701340028F4D11D
:10152000E2E7207807F098F8002803D02078B04749
:10153000071ED9D00134DEE7C4E70200C1860000EF
:10154000D9860000CCE7020010B501000148FFF782
:10155000C1FF10BD4186000010B501000148FFF732
:10156000B9FF10BD5986000010B501000148FFF712
:10157000B1FF10BD7186000010B501000148FFF7F2
:10158000A9FF10BDC186000010B501000148FFF79A
:10159000A1FF10BDD9860000F0B585B006000C0093
:1015A000170001F083F9694605003000FFF70AFDD6
:1015B0000600042F23D10098A30715D1114B2268F0
:1015C0009A4211D101AA210010F04EF9002802D14F
:1015D0000D480CF0EDF80199029A2800521A711882
:1015E00020F0DEFE05B0F0BD00230100220028003F
:1015F00001F01CFB335C01205B001843F2E7002084
:10160000F0E7C046E8A40200A6FC020070B51D0089
:101610008EB0002900D174E018683B4C03002340D1
:10162000062B05D0830726D1384B02689A4222D177
:101630000239012962D80AA9FFF7C4FC060028680C
:101640000440062C15D1C00824F08AF90400002CAF
:1016500004D10A9930000FF0DFF9040010200A9D30
:1016600024F027FE2A4B85600360C66044600EB0FC
:1016700070BD4468EBE7012940D80122104210D028
:10168000441021000AA825F04FFD0C9B00212200E8
:101690001800019327F099FB0AA91D48FFF722FCC7
:1016A000E5E703A920F0DAFF002805D0049A0399A2
:1016B000174820F075FEDAE7286801F0F9FA1021E2
:1016C000002800D0411006A825F01DFD0AA92868B1
:1016D0000BF04CFA040020000BF0AAFA002801D10C
:1016E00006A9DAE701F0CAF9FF2802D909480BF088
:1016F0006DFEC1B206A825F066FDECE706480CF0C9
:1017000029F80648B3E7C046070080FF0C9A02009C
:10171000A092020073FC02008CFC02009092020076
:1017200073B50400080001A91600FFF74BFC050083
:10173000042E06D10300019A0749200025F06AFB18
:1017400073BD0649200025F0A4FA0123019A29005F
:101750002000FFF763FBF3E703010300CF59030009
:101760000A001B4B73B51A4005000C000340062B02
:101770000CD1062A04D1441A60426041C0B212E082
:10178000C00824F0EDF80600606805E04668062A07
:10179000FAD1C80824F0E4F8002E05D0002803D0C0
:1017A000B04201D0002076BD69462800FFF70AFC50
:1017B00001A905002000FFF705FC009A019B01002C
:1017C0009A42EFD1280027F0D5FA44426041D5E78C
:1017D000070080FF084B07B50340062B08D083079E
:1017E00004D10268054B92699A4201D0FFF7FCFAD6
:1017F00001A9FFF7E7FB0EBD070080FF9D1D00005C
:101800000A4B13B503400C00062B08D0830704D104
:101810000268074B92699A4201D0FFF7E5FA01A9E5
:10182000FFF7D0FB019B236016BDC046070080FF79
:101830009D1D0000F0B59BB00B9005910892102102
:101840000EAA12A8099314F0DBFA059B089A93429A
:1018500008D30B9A12AB13CB13C21B6813600B98FF
:101860001BB0F0BD059B19785D1C7D290ED1089B2E
:10187000AB4208D9059B59787D2904D112A825F0DF
:10188000A2FC059507E0BC480BF0A0FD7B2906D023
:1018900012A825F098FC059B01330593D5E7089B1A
:1018A000AB4216D9059B59787B29E7D02B007D29BF
:1018B00003D0212901D03A290DD100252E001A7814
:1018C000212A11D0002206921AE0089A01339A4286
:1018D00001D1AA48D8E71A787D2A03D0212A01D05D
:1018E0003A2AF2D11E00EAE708995A1C91421CD903
:1018F0005A780692723A012A17D802339942E8D9E7
:1019000000211A7805913A2A1FD15A1C5B7805925A
:101910007D2B1DD1089B059A9342DAD90027059BA0
:101920001B787D2B17D09648AEE79648ACE7197820
:101930007B2905D10132013308998B42F7D3C8E7DF
:101940007D29F8D1013A002AF5D1059F0593E6E7F4
:10195000059B0122F0E7002D48D00023287816933C
:1019600006F086FE00283DD0099B1B680793002BDC
:1019700001DD854888E716AA3100280020F0D9FC4F
:10198000209A169B013A04009A4203D87F49804866
:1019900023F050F8219A01339B009D580122099BA6
:1019A00052421A60B44231D27A480BF001FF01343E
:1019B000B44204D223782E2B01D05B2BF7D1611BCC
:1019C00001222800FFF7C4FA002205000100229836
:1019D00007F0D2F8002807D129006F4821F01BFC3E
:1019E0000AF07CFE2C00E3E74568DBE7099B1B68F7
:1019F000002B01DA694847E7209A013A9342C5D2A1
:101A0000013321999A005558099A1360002F00D08C
:101A1000A6E1069B3C00002B04D0069C733C631E91
:101A20009C41E4B210AA102116A814F0E9F929008B
:101A3000220010A800F052FF16A95948FFF752FAE9
:101A400001235B4205000D931093002F00D18FE01E
:101A50000EF096FF229B059A0293219B3900019379
:101A6000209B16A80093099BFFF7E4FE16A825F01B
:101A700098FB0026179B0400C3180A93037806936B
:101A8000B34208D0474F1900380027F0DAF9B042C6
:101A900000D16EE1013423782B2B4ED000272D2B63
:101AA00002D0202B01D1043701342378232B02D11B
:101AB000133B1F4301342378302B07D1069B002BA7
:101AC00001D13D330693002E00D130360DAA0A997C
:101AD000200020F02EFC037807902C2B04D10C3B27
:101AE0001F43030001330793079B1B782E2B06D15E
:101AF000079810AA01300A9920F01BFC0790079B59
:101B00001C78002C1BD02100274827F09AF90028C8
:101B100003D0079B5B78002B11D02448B4E631003A
:101B2000380027F08EF9002804D033000234069ED6
:101B30000693B0E706900600ADE70227B4E716A8C3
:101B400025F003FB069B002B08D12800FFF728F99E
:101B50003C230693002801D002330693002E00D1C7
:101B6000203606231F4229D0732C23D110488BE640
:101B70003C003E00E9E7C046D1FD020012FE020033
:101B80002AFE0200F9FD02004EFE020098FE02004D
:101B900084A90200B1FE0200C0A90200CEFE02002C
:101BA0000C9A020018FF02001DFF02002DFF020028
:101BB00046FF0200632C01D1714865E6069B3D2B70
:101BC0001FD05E2B1FD03C2B01D13B3B1F43280075
:101BD000FFF7CAF800282DD0632C50D026D8472C08
:101BE00013D8452C26D2002C40D0252C22D02800FA
:101BF00020F01DFD220003006249634806F052FCFC
:101C0000EEE64023E2E78023E0E7582C53D0622C35
:101C1000EDD1002303930D9B0222029361230196D1
:101C2000009729000EA813F0FFF834E6672C17D8A8
:101C3000652C1BD32800FFF7B3F800286CD0002CCC
:101C400056D06E2C54D0472C3FD8452C41D2252C51
:101C500050D0280020F0EBFC220003004B49CCE7D9
:101C60006F2C1AD0782C26D06E2CC0D10023039371
:101C70000D9B01960293009761230A22D1E7280069
:101C800000F0FCFE0D9B16A90870012201933B0099
:101C900000960EA813F06CF8FDE5FB0602D5802334
:101CA0009B001F43002303930D9B01960293009713
:101CB00061230822B5E70022230003920D9A173B07
:101CC0000292019600971022ABE72300653B022B9E
:101CD000BFD8280000F036FF109B220002930D9B16
:101CE000011C01933B0000960EA825F04EF8D2E5AA
:101CF0006724EEE72800802400F024FF244918F030
:101D000071FE109B640002930D9B3C430193011CE8
:101D1000009623006622E7E7069B3D2B01D11D4874
:101D2000B2E5002C01D0732C13D116A92800FFF7BF
:101D300067FD109B0100169A002B00DA1092109B91
:101D40009A4200D916930D9B00960193169A3B0078
:101D50009FE7280020F06BFC220003000E494CE7AF
:101D6000069B002B00D058E601235B420D93109395
:101D70006EE66678002E00D0D1E606968BE6C04669
:101D800072FF0200A5FF020008AD0200D6FF0200AC
:101D90000000C8420A0003003F000300F0B5A1B0F4
:101DA00005000C000D920A2800D0E4E10DAB0F9362
:101DB0000123073D1093059215403CD11368BF4A9B
:101DC000934206D10FAA10A9059821F02CF8059589
:101DD00002E0BB4A9342FAD1109B11A907930F9BD3
:101DE00020000893FFF7EEF8002309900A93A30759
:101DF00005D1B44A23689B1A5A425A410A9214AA3E
:101E0000102118A813F0FCFF119A00279446099B93
:101E1000099C63440493049BA3420FD8079BAA48E0
:101E2000BB4229D10A9BA948002B00D0A54818A97C
:101E3000FFF758F8BAE100230593CDE7217825296B
:101E400004D018A825F0BFF90134E4E7049B661C10
:101E5000B34202D89E480BF0B9FA6178252904D123
:101E600018A825F0B0F93400EEE70025282915D18F
:101E7000059BAB4202D197480BF06CFCA01C0600FE
:101E80003378292B23D1311A0122FFF761F80100A1
:101E900005980EF083F80127050001360023340071
:101EA00040220026302104200B9320330693049B0C
:101EB000A34213D800231293049BA34231D9237861
:101EC0002A2B70D1079BBB4221D88348D4E7049BBF
:101ED000B34201D88148BEE70136D1E723782D2BE4
:101EE00003D12C3B1E430134E1E72B2B01D1293BCD
:101EF000F8E7202B01D10643F5E7232B04D0302B44
:101F0000D8D116430691EEE710230B93EBE77B1C29
:101F10000C93089BBF00F85800F0B0FD0C9F129086
:101F2000013401235B421393049BA34292D923788B
:101F30002E2B17D1049B601C83428BD963782A2BEC
:101F400038D1079BBB42C0D97B1C0C93089BBF00B8
:101F5000F85800F093FD0C9F13900234049BA342A9
:101F600000D877E7002D06D1079BBB42ADD9089A70
:101F7000BB009D5801372278672A45D8652A00D3CF
:101F8000B8E0582A5DD01DD81300453B022B00D87D
:101F9000B0E0099B5249E41A00941300514806F03E
:101FA00081FA0AF09BFB200012AA049920F0C1F9E3
:101FB0000400B6E7002313AA0499139320F0B9F99B
:101FC0000400CBE7632A49D0642AE2D103222B0024
:101FD0001340022B0AD1444B2B40062B06D0FF2383
:101FE000DB05E81890430AF0CBF90500139B0A22A1
:101FF0000393129B00960293069B01936123290091
:1020000014A812F011FF1FE7732A16D8722A00D302
:1020100080E0692ADAD06F2ABBD10B9B002B02D05B
:1020200084239B001E43139B00960393129B08225C
:102030000293069B01936123E1E7752AC6D0782AB3
:10204000A7D11300139A173B0392129A0292069A91
:1020500001920B9A164300961022D0E7224B2B4098
:10206000062B05D0AB0716D1184B2A689A4212D11D
:102070001CA92800FFF7C4FB1C9A0100012A01D00B
:102080001A48F9E6129B019320230093330014A809
:1020900012F06EFED8E62800FEF766FE00280BD090
:1020A000280000F0EBFC129B1CA908700193202370
:1020B000012200933300EAE70D48DDE64CA0020060
:1020C00074C20200A09202009CFD02000C9A020061
:1020D000D7FC0200E9FC020016FD020000FD020030
:1020E00067FD020008AD0200070080FF3DFD020011
:1020F00056FD0200280000F025FD139B2278029374
:10210000129B011C0193069B14A80093330024F03A
:102110003CFE99E616AA10211CA813F071FE237844
:102120001A00723A51424A41D2B2722B09D00A9B2C
:10213000002B06D0AB0704D1594B2968994200D136
:102140000422290016A800F0C9FB139A1D9B002A3F
:1021500000DA1393139A9A4200D91A00129B1E991F
:102160000193202314A80093330012F001FE1CA851
:1021700024F0EBFF68E6080000F098FB16A90700C2
:102180002000FEF71FFF0590072D22D118A90D98FA
:1021900000F0B2FC03000020834207D0189981426E
:1021A00006DC404B40489F4200D10E2021B0F0BDDC
:1021B000169B1CA8594324F0B7FF1E9B01210493D2
:1021C00000930598189B169A23F013FD1CA938005C
:1021D0002EE60D9800F06AFBB8420FD11CA90D98AD
:1021E000FEF7F0FE1C9E04901D2D17D8192D4ED21F
:1021F000052D21D0122D1FD00020D7E7284B0D9898
:102200009F4209D101221CA920F028FA0028CDD034
:102210001C9B1D9E0493E7E7FEF7E6FD1F2DEBD107
:102220000123049A009316993300059820F099F839
:1022300000282AD01D48B9E7169B002B07D10D981E
:1022400000F034FBB84202D10D9C2000AEE7002E16
:10225000FBD0169B1CA8F11824F066FF1E9B169A53
:1022600005991800069326F094FD169A1E9B944635
:102270000593634418003200049926F08AFD1CA9D6
:102280003800FEF72FFE0400DFE709488EE70096CE
:10229000049B169A0599280023F0E1FCC8E7C04684
:1022A000A09202000C9A020090920200CCE7020079
:1022B000C4E70200F0B5050087B008680C0000F024
:1022C000F5FA0090012D28D96668022D26D0A06865
:1022D00000F0D4FB05000021080024F0C1FB04A994
:1022E00001902068FEF76EFE049B0400C7183E4B69
:1022F0009E4241D1BC422AD2207806F0A1F90028A2
:102300000FD1002D0FD121003A1B009820F048F882
:102310000100019811F060FF19E0334E01256D4274
:10232000D9E70134E6E72600307806F089F900287D
:1023300002D10136B742F7D82100321B009820F0B5
:102340002FF80100019811F047FFB74209D8019812
:1023500007B0F0BD0136B74203D1002DF7DD013DD6
:1023600006E0307806F06CF90028F3D1002DF6DC99
:10237000BE42ECD23400C4E7300000F097FA009B74
:10238000984202D03000FEF72FFD05A93000FFF77C
:1023900037FA059B0390002B13D114480BF016F865
:1023A0003E002100321B00981FF0FAFF0100019847
:1023B00011F012FFBE42CAD2059BF418002D00DDB9
:1023C000013D2600059B0293002DE9D0029BF318E6
:1023D0009F42E5D3029A0399300026F0CBFC0028F7
:1023E000DFD00136F0E7C046E4B30200710003001D
:1023F000F0B507008BB00D00022807D8290038007F
:10240000FFF758FF050028000BB0F0BD086800F08A
:102410004DFA08A9049028686E68FEF7D3FD019074
:10242000A86800F02BFB041EE8DB431C1800002109
:10243000059324F015FB2F4B05009E4202D12E4838
:102440000BF0B6F909A93000FFF7DAF9099B0690FD
:10245000002B02D129480AF0B9FF089A019B944643
:1024600063440293A3000393099F029BDE1B002C8D
:102470000BD0019BB34208D83A000699300026F0F1
:1024800079FC002821D0013EF1E7EB68A6009F19F6
:10249000019A029B01999A1A04981FF081FF3860F3
:1024A000002CB0D0059B1C1BEB68A70099193A00C3
:1024B000180026F077FC6B6800211A1BEB6892006D
:1024C000D81926F082FCAC609DE7039AEB6894462D
:1024D00063440793029BF1199A1BD21B04981FF0C7
:1024E0005FFF079B013C1860039B0296043B03932C
:1024F000BAE7C046E4B3020008010300710003001C
:1025000070B50C008AB0050004A920681600FEF71B
:1025100059FD00230593049B0100C218029605ABE8
:1025200006A801940095FFF785F906A90248FEF771
:10253000D9FC0AB070BDC0460C9A020010B5040068
:10254000002906D0044B8A6B03600968002306F05B
:1025500015F820000AF0C2F818AC0200F0B504002B
:1025600087B0039202936618002A06D0023A222A04
:1025700003D935480AF02AFF0134B44229D2207821
:1025800006F05EF8071EF7D123782B2B1CD10134FF
:10259000311B200003AA20F014FA23181C00002588
:1025A0000193B44217D3002F00D06D4201236D0078
:1025B0001D43019B9C422FD12449039A244805F0D6
:1025C00071FF0299FFF7BAFF2D2BE1D101340127EA
:1025D000DEE70027DCE723781A00303A0092092A68
:1025E00007D9202213431A00613A192ADBD8573B36
:1025F00000930399009B9942D5D9280005F004FC6B
:10260000002816D1039B5D43009BED186B006B40C7
:102610000FD40134C5E70134B44205D2207806F066
:102620000FF80028F7D1C7E7B442C5D1280007B09A
:10263000F0BD019B3A000593F11A05A8039B23F016
:1026400065F8059C0500B4E7550103007801030017
:1026500008AD0200F0B504008BB008934318049253
:102660000193019B9C4200D3F6E0207805F0E8FF3F
:10267000071E38D123782B2B37D101340590019BCD
:102680009C4200D3EAE0202322781A43692A33D1FE
:102690000199A21C914200D8E6E062781A436E2AA2
:1026A00000D0E1E0A2781A43662A00D0DCE0E21D07
:1026B000E51C914214D9E2781A43692A10D1227993
:1026C0001A436E2A0CD162791A43692A08D1A27979
:1026D0001A43742A04D1E2791343792B00D10535CA
:1026E000FF26F6051BE00134BBE705902D2BCAD170
:1026F0002C3B01340593C2E76E2A2ED10199A21C0E
:10270000914200D8B0E062781A43612A00D0ABE071
:10271000A27813436E2B00D0A6E05D4EE51C059B0E
:10272000002B02D080231B06F618A5427BD1594905
:102730008CE03D002B786F1C18003038092834D805
:10274000022E15D10A23029A53431B180293019BB0
:10275000BB42EED8002304934DE000220792029280
:102760004D4A250006920022002603920993E1E7D4
:1027700018F0AEFC051C012E0DD1069918F032F9A7
:10278000011C039817F0BCFD43490390069818F00C
:1027900029F90690DBE74149039818F023F9291C31
:1027A00017F0AEFD00260390D1E7002E03D12E2BAB
:1027B00003D10126CBE7022E16D0099A1A43652AC7
:1027C00012D1019BBB4256D96B782B2B05D1AF1C84
:1027D000019B9F42ABD00226B9E702262D2BA8D140
:1027E0002C3BAF190793F3E7049A002A04D0202268
:1027F00013436A2B13D13D00079B002B02D0029B91
:102800005B420293029818F019FC011C23481BF04C
:10281000D5F8039918F0E6F8049F061C7FE700231B
:102820000493E9E70135019B9D4205D2287805F024
:1028300007FF0028F6D17AE7019B9D4200D076E79A
:10284000089B002B01D1002F1AD01549154820F004
:10285000E9FC1099FFF772FE002305930023039310
:10286000002325000493CCE7059B002B00D15EE7F5
:102870002500002656E7019BBB4200D157E769E7D8
:10288000032302209E43084B3043C0180BB0F0BD19
:102890000000C07F3B010300CDCCCC3D00002041B7
:1028A0001E01030008AD020000008080074BC20734
:1028B0000AD4074A074B0240062A05D00322064BDA
:1028C0000240022A00D00368180070472CB90200A9
:1028D000070080FF0C9A020088B0020070B50D005E
:1028E000040016000EF04CF82800FFF7DFFF8368A5
:1028F000002B04D0320029002000984770BD4268A8
:102900000249200024F086FAF8E7C046E4020300FA
:1029100010B50A0001000248FFF7E0FF10BDC046F5
:1029200084E80200F7B5050008000E0020F07EFCE8
:10293000002810D001AA6946300005F053FE009B24
:10294000002B08D01749280024F0A3F9009CE71EAB
:10295000A400002F09DA310028000222FFF7BEFF91
:102960002800114924F095F9F7BD019B28001A1998
:1029700011000C3A08390B6812680C4924F04AFA25
:10298000019B1B19043B1A68002A06D1064928003E
:1029900024F07FF9033F0C3CDBE70549280024F0D5
:1029A00039FAF7E7A2020300654F0300C6020300ED
:1029B000DB02030010B50400FFF778FF054B006948
:1029C000984203D0431E9841C0B210BD200021F0B0
:1029D00067FFFAE7F5BA000070B505000C000120AA
:1029E0008D4203D0214B9D4201D1002070BD994200
:1029F000FBD001231D4204D01942F6D12B000D005B
:102A00001C002A001A4B1A40062A05D0AA0711D129
:102A1000184A296891420DD12340062B05D0A307FF
:102A2000E3D1144B22689A42DFD121002800FEF73F
:102A300097FEDBE72340062BD7D0A30703D10D4B2E
:102A400022689A42D1D02800FFF730FF8369002B1B
:102A5000CBD0220029001B2098470028C5D0064B68
:102A6000C01A43425841C0B2C0E7C046E4B30200B6
:102A7000070080FF0C9A0200CCE70200104B10B553
:102A8000984219D00F4A0123904217D0184201D022
:102A9000184110BD830706D10B4B02689A4202D140
:102AA0000CF036FFF5E71FF0C2FD084902000848A8
:102AB00005F0F8FC09F012FE0020EAE71800E8E74C
:102AC000C4E70200CCE702002CB90200690203004F
:102AD00090AC020010B5C30705D4830706D1054B9F
:102AE00002689A4202D122F028FE10BDFFF7C6FF0D
:102AF000FBE7C0462CB902000F4B70B50D00012456
:102B0000984204D100230B602300180070BD0B4BCA
:102B1000984201D10C60F7E70300234002D0401037
:102B20002860F1E78207F0D1054A01689142ECD1B3
:102B30000CF0EEFEF4E7C046C4E70200CCE702006A
:102B40002CB90200184B10B5984228D0174B984268
:102B500027D0C30703D5401018F070FA10BD032327
:102B6000184206D1124A0168914202D122F0EEFDCC
:102B7000F4E702001A40022A08D10E4A0240062A4F
:102B800004D0FF22D20580189843E7E71FF04FFDDD
:102B900009490200094805F085FC09F09FFD002065
:102BA000DCE7FE208005D9E7C4E70200CCE702009D
:102BB0002CB90200070080FF4F02030090AC020016
:102BC00010B583070CD103680A4CA34202D120F050
:102BD0002AF910BD084CA34202D123F058FFF8E7B0
:102BE0001FF025FD05490200054805F05BFC09F0D2
:102BF00075FDC0464CA0020088E70200FF010300FB
:102C000090AC020013B50C0001A9FFF7D9FF019B9E
:102C1000A34206D022000349034805F043FC09F013
:102C20005DFD13BD2202030008AD0200F7B50500EB
:102C30000C0017001E00D3070ED557100197019BFB
:102C4000002B1FDA1B190193002E1DD0002B15DA63
:102C5000002301930198FEBD01A91000FFF74CFF6E
:102C60000028ECD138006C681FF0E1FC2200030062
:102C70000B490C4805F016FC09F030FDA342E9D9D8
:102C80000194E7E7002EF9D1019B002B01DBA34261
:102C9000E0D36A680449054805F004FCECE7C04647
:102CA000C501030090AC0200E901030084A9020001
:102CB00010B50400830710D10D4B02689A420CD165
:102CC0000C4B0340062B06D1C00822F04EFE4300F9
:102CD0000120184310BD8068F9E72000FFF7E6FDEA
:102CE0004369181EF6D0210001209847F2E7C0463C
:102CF000A0920200070080FF164B70B50400002070
:102D00009C4203D0144DAC4201D1012070BD134B45
:102D100000209C42FAD001262640864203D0601053
:102D2000431E98410DE02000FFF7C0FD4369002BD2
:102D300009D0210030009847002804D0401B4342AE
:102D40005841C0B2E2E72000FFF7B2FF0028DCD014
:102D50000138E5E7C4E70200CCE70200E4B3020073
:102D600010B50400FFF7A4FF002809D120001FF0D0
:102D70005EFC04490200044805F094FB09F0AEFC37
:102D800010BDC0468102030090AC020070B5040083
:102D90000D001600FFF78AFD036A002B05D03200F4
:102DA000290020009847002818D10D4D2000002E42
:102DB00008D11FF03CFC02000A49280005F072FB14
:102DC00009F08CFC042E04D11FF031FC06490200EE
:102DD000F3E71FF02CFC05490200EEE770BDC0468A
:102DE00090AC0200E9020300140303003503030062
:102DF00010B51FF033FC002802D102480AF0AAFCEB
:102E000010BDC046A001030070B5050000291CDB01
:102E1000032905D80800002416F076FF18180606C6
:102E20000123023999430C00FE26B52109023143E2
:102E300028001FF02DFC002C04D005492800214358
:102E40001FF026FCAE61EC6170BD0024F226ECE7B9
:102E500080B0000010B50D4C206824F053FC002811
:102E600007D00B4B1B78002B03D1206803685B68ED
:102E700098470023074A1370074A13700BF030FC81
:102E80000CF05CFA0EF038F810BDC0465C2900204A
:102E9000CB2D0020CA2D0020392E002070B5050052
:102EA00094B0002804D13F481DF0D4FD14B070BD8B
:102EB00008A809F0EDFB041E19D12E68290004A80A
:102EC00001220EF0C7FE23002200310004A808F002
:102ED00099F90400032001F0A1F8200021F05FFD22
:102EE0000120404201F09AF809F0F0FBDEE70120F2
:102EF000404201F093F809992B48FFF713FD099818
:102F0000FFF7D4FC2949040008F0E6FE0028CDD1E3
:102F10002749200008F0E0FE0028C7D1099C01AA3B
:102F20006946200005F05EFB02AA322104A812F0D7
:102F300067FF009B022B05D9019B1E495A6802A816
:102F400023F068FF2000FFF7B1FC1B4BC2689A42D8
:102F500010D1236819495A6802A823F05BFFE3687F
:102F6000002B07D05A68002A04D00022996802A8D2
:102F7000FFF7B4FC032001F051F804A824F011F984
:102F800006F034FC04A824F0E0F80120404201F0EF
:102F900045F80B4B9A6C002A00D187E700229A640F
:102FA00084E7C0469803030084E8020054AC0200A2
:102FB000FCA90200C503030065830000CE030300E3
:102FC0007C2E0020F8B54E4C1321200025F0BEFCCD
:102FD0002000032125F050FD4A4C01234A4A1321C9
:102FE000200016F017F801220221200016F042F806
:102FF000464C200013F0F2F9454F3860200013F0E2
:1030000009FC444D2860102025F059FE0400296871
:103010000025414E3A68330013F042FF3F4B1C60DD
:103020003F480DF08DFCE120C0000DF099FC3D49BA
:103030003D480AF07FFE09F071FB06F053FB01F0FA
:10304000A5FE13F031F8300024F0A3FF22F04AFA75
:1030500000F064F904F0E0F901F07EFC0AF0D4FC21
:10306000324C3348230088331D600BF0ADFB0BF06E
:1030700089FB0AF0DBFC2F4F3B78012B0ED100239C
:1030800007211A002C4800F051FA031E1DD0010040
:10309000F720400000F0D2FBFFF700FF3B78002B49
:1030A0002AD112F0ABF90028F8D0244820F004FB14
:1030B0000BF078FB08220021214825F086FE230032
:1030C00098348C331D602560AAE7F82292021178AB
:1030D0004D2909D15178502906D1F7205288194934
:1030E000400022F05FFDD7E70122174917200AF0C0
:1030F000A5F821F07EFCD1E712F0D0F9D3E7C04665
:103100003C2900205429002017280200DC29002037
:10311000582900205C290020642900206029002013
:10312000004000203C2900203C0100207C2E002093
:10313000552E0000EA000020D2030300DA0303004A
:10314000FC2E002004E0030044A0020010B5084C4F
:10315000084A0621200013F075FF074A074920009E
:1031600025F0A6FD00221E21054824F01CFF10BDFD
:10317000642900208C94020000000020FD6F0100F3
:10318000DC29002070B505000C200C0023F091F81C
:10319000024B45600360846070BDC046A494020089
:1031A00010B524F09CF8014810BDC046E4B30200FD
:1031B00010B5C30708D483070ED10368094A9342A8
:1031C00002D0094A934207D1FFF758FC002801DDDD
:1031D00020F07FFA054810BDFFF7B4FC17F00EFF92
:1031E000F4E7C0462CB90200D4E70200E4B30200C1
:1031F00001220B4B10B51A600A4A51680029FCD015
:1032000000215160A1220131D2009A585960032354
:10321000D01718408018801022F052FA10BDC04616
:1032200000C00040FCC0004010B5002804D1044894
:1032300012F05CFE034810BD0868FFF71FFCF7E7BB
:10324000E7030000E4B3020080235B051869034B29
:103250001B7843438020C002C01A7047C72D00204E
:1032600080235B051869034B1B7843438020C00211
:10327000C01A7047C82D002070B5084DC4012B68D6
:103280000021181921F0E3FB2868054B00197F3055
:1032900000781B788342F0D270BDC046F42900202C
:1032A000C62D002010B5C3790400002B08D0064AB3
:1032B000037981791068DB01C018013021F0C7FB68
:1032C0000023237210BDC046F429002010B5124B14
:1032D00001001A684379DB01D31818007F300478A5
:1032E000FF2C08D10879C00112185278FF2A0FD09C
:1032F000887990420CD08A799B180132D2B25878E2
:103300007E2A01D08A7110BD00234C718B71FAE7BF
:1033100001204042F7E7C046F429002070B5F824A8
:103320008025A40223786D054D2B4CD12B6980207C
:10333000E41A2B69C002E41A2969001B16F0F8FC94
:103340002B4B2C4918702B69E21852185D4215401E
:10335000294B2A4A9B1A2A4A9B1880225205116936
:103360009D4234D38020C002401B16F0E1FC254B67
:10337000641B1870E411244BE4B21C70A1200123DB
:103380000025224A22491360C0004D604B68002B83
:10339000FCD01358DBB2A342F7D21E4901330B70A5
:1033A00001235360FFF750FF037805001A4CFD2BF3
:1033B0000FD180235B051869184BC009C018C001E4
:1033C0002818206070BD80242B69E402AFE76D18D7
:1033D000C5E7FFF745FF0378803DFD2B01D1256050
:1033E000F0E7FFF73DFFFD2121F031FBF7E7C04695
:1033F000C82D0020FF87FFFF1401002000000020DF
:10340000A4870300C72D0020C62D002000D0004057
:10341000FCD00040C92D0020F4290020FFFFFF014F
:10342000F7B5254B254F1A78254B14001B783968C2
:103430000133E001405CFF2829D00134E4B29C4212
:1034400000D101249442F4D1802300265B051B693E
:10345000DB090193E30100933B68E2019D182B789F
:1034600028005A425341F61821F007FB002810D0DB
:10347000002304E0DA01AA5C002A0AD10133019A90
:103480009342F7D13868009BC01821F0ECFA200075
:10349000FEBD0B4B01341B78E4B201339C4200D1DA
:1034A0000124054B1B78A342D4D1072E02D91FF06B
:1034B0000CFAB6E7FF24EAE7C92D0020F429002022
:1034C000C62D0020F7B507000D0001240E4B1B7818
:1034D00001930E4B1E68019BA34202D2FF242000E1
:1034E000FEBDE10171180B78FE2B09D18B78AB4240
:1034F00006D103312A00380025F03CFC0028EED02C
:103500000134E4B2E7E7C046C62D0020F4290020CC
:1035100010B5054A03791068DB01C01881780022D4
:103520000330FDF715FD10BDF4290020F0B585B07E
:1035300002900D0016000393782948D8FFF7C2FFC8
:103540000400002E3BD0FF2801D0FFF795FEFFF7C7
:1035500067FF0400FF2803D11E491F4821F06AFAC3
:103560001E4FC0013B680190FE21181821F06FFA30
:103570003B68019AE9B29818023021F068FA38687D
:10358000019B2A00C018033002990BF037FA0C2077
:1035900022F08FFE039A0300002A16D0104A1A6008
:1035A0000E4A1C7112685C71E4011419A278DE7174
:1035B00002329A7101221A72039A5A7202E033009F
:1035C000FF28E4D1180005B0F0BD064AE7E7002364
:1035D000F8E7C046E803030028AB0200F429002006
:1035E000ECBA020098BB020007B501A9FEF708F982
:1035F0000199FFF767FFFF2803D10449044821F030
:1036000019FAFFF739FE03480EBDC0461B0403003C
:1036100028AB0200E4B30200F7B50192027A04007D
:103620000091002A02D1244809F0D0FEC579002D6E
:1036300006D1224A17680279D201D25D002A05D14B
:10364000092201251A606D422800FEBD61797E22A3
:10365000C901791808007F30A3790078D21AFF28B1
:1036600009D12079C00138184078FF2819D0C01A34
:10367000824200D902000198461B964200D91600EA
:10368000002EE1D0009A01335019C918320025F0FC
:1036900080FBA3799B19DBB27E2B04D0A371AD19FB
:1036A000D4E70022E7E70023A3716379DB01FB186D
:1036B0007F331B786371F2E7FE030300F4290020D7
:1036C000F0B585B00393037A040002910192002BB8
:1036D00002D1304809F07AFEC379002B08D02E4A77
:1036E00003791268DB019B5C019A0092002B25D1C3
:1036F0000923039A13600A3B0193019805B0F0BDBA
:103700007E22A379D71A009A974200D917006079D0
:10371000214E0133C001C01833683A0018180299CD
:103720000BF06CF9A379DB19DBB27E2B0AD0A37105
:10373000029BDB190293009BDB1B0093009B002B79
:10374000DED1DAE70023A371FFF76AFE0500FF2848
:1037500009D12079FFF790FD002323721C23039ADF
:1037600013601D3BC8E760793368C0011818290051
:103770007F3021F06CF93368ED015819617921F03F
:1037800066F962793368D2019B187F331B786371C5
:10379000CEE7C046FE030300F4290020002170B5E7
:1037A000080023F05DF9012405000C4B1B78A342AF
:1037B00001D2280070BD0A4AE3011068C0180378DE
:1037C000FE2B08D1817800220330FDF7C1FB0100F8
:1037D000280010F001FD0134E4B2E6E7C62D002018
:1037E000F429002073B501A9FEF70AF80199FFF743
:1037F00069FEFF2803D10E490E4821F01BF9002570
:103800007E260D4B1C68C301E31859789B78023360
:10381000DBB2C201A2187F321078FF2804D1C81A87
:10382000401921F04DFF76BDF31AED180023F0E7A3
:103830001B04030028AB0200F42900201FB5034A33
:10384000034B22F072F905B000BDC046CD32000036
:10385000A5320000044B054A05481A60054A5A6023
:1038600000221A817047C046FC290020200307006F
:10387000E4B3020074696275F7B51600314A0B00B3
:1038800088321768002F02D12F4809F09FFD0221CE
:103890002E4C2F4DE167A324E4002C592D4AE4B2AD
:1038A00006343C192C4F3D68A54204D12B4B1160C6
:1038B00001930198FEBD2578002832D1601C002BB1
:1038C00004D12900FDF75CFB01900BE05A68AA4285
:1038D00000D92A000100186825F064FA01226B0063
:1038E0001A430192002E0ED0621953785B42336066
:1038F000D37811791B0209040B43917852790B4359
:103900001206134373603E68A91D6118721A2000E5
:1039100025F048FA0223751B0E4A063D3D601360F0
:10392000C7E7022D04D8002303600E330193D9E7C3
:103930002100042225F02DFAE91E201D0022FDF7AA
:1039400007FBC1E77C2E0020AC04030004E100E08B
:103950000010004000E100E0082A0020E4B302006B
:103960007FB5002101AA0800FFF786FF0A4B9842A5
:103970000FD00121019B03905A00029B0A438B4008
:103980000492064A032013400B4303A9059302F057
:1039900071FE07B000BDC046E4B30200FEFFFF7F2A
:1039A000002213B501AC11002000FFF765FF094BA1
:1039B00098420ED02378022B08D96378012B05D1C9
:1039C000A378002B02D1E378012B02D0024809F042
:1039D000FDFC16BDE4B302008C04030002220B4B75
:1039E00010B5DA6700220121094B5A61094A1161B9
:1039F0005A69002AFCD0084C88342068002803D07B
:103A000022F086FC0023236010BDC04604E100E0E4
:103A1000FC100040001000407C2E002010B5FFF785
:103A2000DDFF014810BDC046E4B30200F8B5FFF762
:103A3000D5FF364C26786578063601357543280063
:103A400022F037FC324A861916600022314B4519A4
:103A500088331860304B01211D60304B5A60802242
:103A6000D20511605A68002AFCD003212C4B615604
:103A70002C4A00259950A178043A9950617A08326D
:103A800099506168284A08269950217A274A284F78
:103A900099500121274A9D5004329950264A9E5040
:103AA0008122247892042243A324E4001A510224A0
:103AB000224A9C50224A9F50224F043A9F50182776
:103AC000214A9F50214AC0279850C12292009E50FF
:103AD0001F4ABF00D0591F4E0640C020000230438D
:103AE000D051C020400014501460102280301C5867
:103AF00022431A50184A5560596051680029FCD079
:103B00000021116101229A60F8BDC046FC29002005
:103B1000082A00207C2E0020F8290020FC0000400C
:103B2000001000400C0500001C05000024050000EA
:103B3000FFFF00002C050000140500003405000004
:103B40003C050000211001005405000004050000A0
:103B500000E100E0FF00FFFFFC10004010B5FFF7A0
:103B600065FF014810BDC046E4B30200F0B5050092
:103B70008DB01600002802D0694809F0EBFD694BB2
:103B800009AA190091C991C21A781F7A06925A7827
:103B900005929A78039203229A5604925A685B7AA5
:103BA000019202937368AB424CD9EB000793B36860
:103BB000EA009B181A68002A1BD0042A19D05868FA
:103BC000FEF788FFB368EA0004009858FDF7E2F9B1
:103BD0000200B338FF3806282ED816F095F8040CEA
:103BE000131920262800631EFA2B00D995E0E3B2B2
:103BF00006930135D6E7631EFD2B00D98DE0E3B2B5
:103C00000593F6E7532C00D987E0E3B20393F0E77E
:103C1000072C00D981E0444B1B570493E9E7022CA1
:103C200000D97AE0E3B20293E3E70194E1E7FF2CE5
:103C300000D972E0E7B2DCE73C493D4804F032FCD1
:103C400008F04CFD3B4B09AC88331B68002B12D1AC
:103C5000069B27722370059B6370039BA370049BD4
:103C6000E370019B0A93029B63722E4B07CC07C340
:103C700031480DB0F0BD069B2A4D2370059B637043
:103C800022882B889A420FD0FFF7A8FE039B277249
:103C9000A370049BE370019B0A93029B63720ECC9A
:103CA0000EC5FFF7C3FEE3E70222244B2449DA677F
:103CB0000022244B4A6101321A614A69002AFCD071
:103CC000039809AA907004981772D07001980A900E
:103CD00002985072134870CA70C01B4A04989850DA
:103CE0000398043A98500298083298500198174A5D
:103CF0009850174A9F5000224A6001325A604A6821
:103D0000002AFCD000220A61C02101329A60114BC6
:103D1000013249005A501A60AAE70F498DE7C046A0
:103D200036040300FC2900202E0403005104030084
:103D300008AD02007C2E0020E4B3020004E100E0A4
:103D4000FC100040001000400C0500001C050000A5
:103D50002405000000E100E067040300214BF7B5F3
:103D60005A68214D002A03D000225A600132AA600D
:103D70001A69002A34D000221A61A323DB00E85814
:103D80001A4BC2B2883319680C78A24201D21400CF
:103D900008708023DB00EB58012B1FD1144E154A0D
:103DA0003768A31D12680193FB189A4216D3621C50
:103DB000380024F0EEFFA923DB00EB58621CBB5453
:103DC00015F0F6FE3368020A1C19E270020C22712B
:103DD000019AA0709B18000E607133600123AB60E4
:103DE000F7BDC046FC100040001000407C2E0020B3
:103DF000082A0020F8290020F7B5314F00933B0036
:103E0000883301921A680E00002A02D12D4809F069
:103E1000DDFA02212C4B2D4CD96700232C4D636118
:103E200001332B616369002BFCD0A323DB00EB582B
:103E30000099DBB27118994203D9B3423DD39B1B61
:103E40000093009B8837F31813703B68010001331F
:103E50001800320024F09DFF009B002B06D038682C
:103E6000013680191A00019924F093FF0023636042
:103E700001332B606368002BFCD00123AB6000236F
:103E800023612369002BFCD00023636101332B6184
:103E90006369002BFCD00023636001336B606368AF
:103EA000002BFCD00023C021022223610133AB6030
:103EB000084B49005A501A60F7BD1E000023BFE7A7
:103EC0007C2E0020AC04030004E100E0FC10004064
:103ED0000010004000E100E007B501A9FDF790FCEB
:103EE000019B020003210248FFF786FF01480EBD37
:103EF0002A040300E4B302001FB5012201A9FEF762
:103F000077FF002301981A000299FFF775FF014817
:103F100005B000BDE4B30200030010B50548002B56
:103F200003D11FF072F908F0D9FB09681FF073F98B
:103F3000F9E7C04654AC020010B503480968FEF723
:103F4000F1FC024810BDC04684E80200E4B3020060
:103F5000F0B5802787B02B4D02907F422C78002C43
:103F60001CD063B2002B12DA6E787C40E4B2002ED3
:103F700014D0013CE4B2FF2C02D101350135EDE74C
:103F800004AB981D0121067005F0F2FBF1E704ABCC
:103F9000D81D0121047005F0EBFBEFE7052702981F
:103FA0001FF097FB0124BC4227DA0025164E2200A1
:103FB000290030000BF0A2FB6B4601901B79002B0F
:103FC00015D0631E1A002900300003930BF096FBF6
:103FD000031E0CD12200290030000BF05BFBFF22F6
:103FE000019B290013403000621E0BF053FB01358A
:103FF000052DDBD10134E4B2D5E7013F002FCED14E
:1040000007B0F0BDC70403001C00002010B5C82095
:10401000FFF79EFF004810BDE4B3020010B5040096
:10402000431C02D0024804F09BFA024B1C6010BDF6
:10403000A42E0020782E0020014B024A9A6470477B
:104040007C2E0020A42E002030B507240278084DD5
:10405000A24314000222224302707F22039C41608B
:104060002240D400028883602A402243028030BD6F
:1040700007FCFFFF10B50B00072401782340A14384
:1040800019437F23017004990A4C0B40D90003881F
:10409000426023400B430380039B04685905064B91
:1040A000C90A23400B430360029B8360059BC360E6
:1040B00010BDC04607FCFFFFFF03E0FF70B513789B
:1040C00004000A3BD8B20F2809D90A001048114948
:1040D00004F0E8F90025636A1860280070BD002527
:1040E00052781B021A43E36AAB420AD1238C0025A3
:1040F000042BF2D10849064804F0D4F9636A186029
:10410000EBE7206BA90009589142E6D00135EBE7B7
:1041100018AC0200E8060300FD060300F0B5040039
:1041200085B00D00100003A9A26A1E0021F03EFF19
:10413000002809D12A000B490B4804F0B3F9636A3F
:104140001860002005B0F0BD0398FEF7C3FC030023
:10415000B343F7D0030000962A000449024804F054
:10416000A1F9ECE7A406030018AC0200BC060300AA
:10417000F7B51F0013780E000A3BD9B2050021489D
:104180000F2904D850781B02184321F0F3FB1524A3
:104190000378009315231C491B1B0193A300CB1A22
:1041A000190055310978009A91421FD119005631F2
:1041B000427809788A4219D1573381781B788B422B
:1041C00014D1002B0FD1019B9A000F4BD05CB84249
:1041D00008D93B0032000D490D4804F063F96B6AC1
:1041E00018600020FEBDC378002BECD0013C002CF1
:1041F000D0D132000749064804F054F96B6A1860C0
:104200002000EFE73B83030060070300140703006F
:1042100018AC02002D070300F0B5137885B0050037
:104220000E00462B47D101A9100021F0EFFE019BA3
:10423000834240D003781A000A3A0F2A0AD80200B3
:104240000F2331002800FFF793FF01248440200052
:1042500005B0F0BDB32B2ED121F0D3FE040021F028
:10426000CBFE02900378B62B25D10127A73B220075
:1042700031002800FFF77CFF3C0003A9844002982E
:1042800021F0C4FE039B02909842E0D09D2102A839
:1042900021F0CBFE029A039B9A42D8D00F23310023
:1042A0002800FFF765FF3B00834002981C4321F084
:1042B000A3FE0290EEE732000349044804F0F2F84E
:1042C0006B6A00241860C2E74507030018AC0200BF
:1042D000F0B50E0087B0040004A930001F00019261
:1042E00021F04DFB019B0500002B0FD1A4239B0067
:1042F0009E4205D1BF21090220001EF0C9F919E034
:10430000BE4B9E4200D088E0BD49F5E7019B012BE2
:1043100000D09AE00A23FF339E420DD101003A6893
:104320002000FFF7CBFE010020001EF0FBF9002863
:1043300000D116E207B0F0BDB24B9E4209D1010098
:104340003A682000FFF7BAFE010020001EF042FA92
:10435000EDE7AD4B9E420AD101000F233A682000E1
:10436000FFF706FF8E21C000C9010143C4E70378AF
:10437000622B3BD1049B032B07D0052B36D1C3788E
:104380005F2B33D103796E2B30D101230E265B4294
:1043900069789E480293B300F31AC3181A002B32AF
:1043A00012788A4209D1AA7894461A002C321278DF
:1043B000944502D12A331B780293013E002EEAD1A4
:1043C000029B013329D03A6829002000FFF776FECE
:1043D000049B0200052B03D12E79773E73425E4188
:1043E0003300029920001EF0B9F9A0E7884B9E42E5
:1043F00001D1884980E7884B9E4201D187497BE7FC
:10440000874B9E4212D129003A682000FFF704FF33
:10441000FF231B02B421184215D0019B2A008149B9
:10442000814804F03FF8636A186083E77F4B9E423F
:10443000F3D13A6829002000FFF7EEFEFF231B02AC
:104440001842EAD1BC2109028FE7019B022B00D060
:1044500021E17B68764A1B780A3B0F2B48D89642AD
:1044600012D13A6801000F232000FFF781FE7A681D
:10447000060029000F232000FFF77AFE310002001A
:1044800020001EF038F955E700226A4B02929E4246
:104490001AD18026F6013A68290007232000FFF789
:1044A00067FE7A680190290007232000FFF760FE6D
:1044B000019A0300310020001EF016F93AE7029B32
:1044C000013302930F2BA8D0029B03229E005A4B6C
:1044D0002800991924F0D4FC0028F0D1EB78002BA7
:1044E000EDD1564BF65C80233601DB011E43D2E74B
:1044F00096421AD1802607233A6829002000FFF748
:1045000037FEFF23019029007A682000FFF706FE9E
:104510000100019BB6011B0231431943ECE6A026C2
:10452000E9E7C026E7E7E026E5E787239B009E4210
:10453000F5D01E3B9E42F4D0414B9E42F3D0414BFE
:104540009E4251D0404B9E4250D0404B9E424FD055
:104550004F339E424ED03E4B9E424DD03D4B9E42ED
:1045600000D05AE705233C4A9B009B5A290002933E
:104570003A6807232000FFF7FBFD7E68039033783D
:10458000452B6BD1300021F07CFD002866D1300036
:1045900021F037FD0378A62B60D105A921F036FD67
:1045A0000599060021F01CFD022857D1300021F0AA
:1045B00023FD07233200070029002000FFF7D8FD64
:1045C000029B0600DB0451D51F233A00290020007E
:1045D000FFF7A4FDF100039B029E80011E433143BF
:1045E000F826F6003040C0E60023BCE70123BAE716
:1045F000019BB8E70323B6E70423B4E7E602000013
:1046000030BF00000B0200000F0200006505030030
:104610002202000072B600002302000062B6000011
:104620009F0200001F06030018AC02009A0200005F
:104630008902000001020000690603006806030009
:10464000C50200006E0200006F020000710200004F
:10465000C1020000C302000098F602002A0044498B
:10466000444803F01FFF636A1860D6E66B460822D1
:104670009B5E002B07DA3E233A0029002000FFF75B
:104680004DFD4008A6E77C233A0029002000FFF7F3
:1046900045FD80089EE7019B032B00D0BDE69E23CD
:1046A0009B009E4222D100263A6807232900200061
:1046B000FFF75EFD7A680190072329002000FFF7CD
:1046C00057FD1F230290BA6829002000FFF726FD3E
:1046D000019F029B374381013943DE0031430BE6E2
:1046E00080263601E0E780267601DDE7224B9E42F8
:1046F000F6D0224B9E42F6D0093B9E422BD1C026DB
:1047000007233A6829002000FFF732FD07230190B4
:104710007A6829002000FFF72BFDBA68760113782C
:1047200002900A3B0F2B0DD8072329002000FFF72A
:104730001FFD029BD900019B194331430F008101EA
:104740003943D9E58023DB001E43290007232000DD
:10475000FFF7E4FCEDE70A4B9E4200D05DE6D02671
:10476000CEE708490348646A1EF05CFD2060E1E57D
:10477000F405030018AC02007902000007020000F3
:10478000C502000054060300F7B50E000700110033
:10479000300021F025FC0025040004281ED97C6A85
:1047A000134914481EF03EFD206000242000FEBD89
:1047B00073780002184321F0DDF80236019024F0EE
:1047C00058FB022811D1019B1B78722B0DD1019B44
:1047D0005A782B0030339A4207D10135A542E5D0F3
:1047E00030780A38C3B20F2BE2D97C6A0249D8E785
:1047F0008F05030018AC0200C2050300054B10B57D
:10480000186822F07BFF044B002800D1034B1800EE
:1048100010BDC0465C290020CCE70200C4E70200BE
:1048200010B5034B186822F071FF024810BDC04656
:104830005C290020E4B3020010B5034B186822F095
:10484000D3FF20F03DFF10BD5C29002010B5034BC5
:10485000186822F0D0FF20F033FF10BD5C29002043
:1048600010B5034B186822F0CDFF20F029FF10BDD2
:104870005C29002010B5034B186822F078FF20F067
:104880001FFF10BD5C29002030B593B009F08AFFEE
:10489000184C200023F078FB174D286812F068F8B8
:1048A000200023F076FB09F06DFF20F01BFE1EF0C8
:1048B0008EF90400296803A822F016FF0F4B200090
:1048C0000A93039B0B93049B0C93059B0D93069BF0
:1048D0000E93079B0F93089B1093099B01931193D1
:1048E00020F0C1F8200020220AA90AF087F8044825
:1048F00013B030BD642900205C29002055BA11C0D6
:10490000E4B30200F8B5114D0400286822F0F6FE69
:10491000002802D12000FFF7B7FF0D4B1B78002BBA
:104920000DD10C4E3478E4B2002C08D10127286850
:10493000377003685B689847054B34701F702868B0
:1049400012F0F2F820F0BCFEF8BDC0465C29002051
:10495000CA2D0020CB2D0020F0B58DB01EF037F908
:104960000E4B02689A4217D1046941680894446961
:104970008268C36809948469C0690A9484466C4655
:1049800005910692079308A8E0C8E0C4604620603D
:104990000348006822F092FE0DB0F0BD55BA11C078
:1049A0005C290020F0B58FB00692426809939446C6
:1049B0000368040002939B6804300093634403601F
:1049C0000E001EF011F9059060681EF023F9431CDB
:1049D00063600378A24A0193831C636043780021DB
:1049E0000093C31C63608378B5000393031D636069
:1049F000C3782000049323001033A360059B143078
:104A00009A1893000793C318E360079B0C331A00AE
:104A1000089324F0DAF9099B009A5B190B93059B24
:104A20009B1A039A0A939D1A2F1D009ABF00E7193B
:104A30000123B24264D2019A1A4207D13300009A8C
:104A40008849894803F02EFD07F048FE009B033596
:104A50009900099BAD005918009B6519F01A01F0E7
:104A600009FE009E043F68600022964200D070E07C
:104A7000069B002B03D1019B1B0700D4D6E0022329
:104A80000026019A1A400992B24204D0069820F0FA
:104A9000BAFE060038600027029B0B9DDB68089376
:104AA000069B9F425ED10A9B029805339B00E1184A
:104AB0000A00049D0C30002D00D080E0049A920082
:104AC0008918079A2032A2188A4200D980E0143B44
:104AD0000693009B089A9B00D3180793039B9D4263
:104AE00000D27FE065680DA80D951EF07DF82818AE
:104AF0000578461CFF2D00D0A7E066600FB0F0BD22
:104B0000019A1A4205D00335AD00584B6519043F90
:104B10006B60069B002BA7D1019B1B07A4D4009BB5
:104B2000049A9A1AB24212D8009A049B991A320037
:104B30008900009B9A4297D29300029D581828182A
:104B4000089D0069EB1AE31818610132F1E73300A0
:104B500076E7099908989300C958C31AE3181961B0
:104B6000013282E7009B039800221B189C462968AB
:104B7000944505D8099B002B1CD1CA083C490EE07E
:104B8000089B90001858884212D1059B013B9B1A44
:104B90009B00E3185A69002A05D0CA0835493248F3
:104BA00003F080FC50E76A685A610137083577E7FF
:104BB0000132DDE76A68300020F05EFEF5E7166836
:104BC000002E02D1AE0086591660013D043272E714
:104BD000081D0968002903D1121A92102649DEE740
:104BE000010071E7069AAB00D71AE7193A69002A63
:104BF00016D1082000996E180899B6008E190799E9
:104C0000C958019B03420DD0049B029804339B00BA
:104C10001858043003F0B0FF002803D043683B610C
:104C200001355BE732681549D208B8E7039B002BD2
:104C300002D0134808F08EFD019B9B0700D451E77A
:104C4000039820F0E0FD38604CE7ED43059BED183C
:104C5000AD00651968690AF0EBFD6861300047E74F
:104C6000FDFFFF3FB407030090AC020044A0020028
:104C70001C080300ED0703003D0803006F08030054
:104C80009F0803000048704716FCFFFF004870476C
:104C900016FCFFFF82B007B591B204920593052977
:104CA00009D01B2902D104A810F0C2FD002003B0D6
:104CB00008BC02B0184704AB5B88032BF6D106A9E9
:104CC0000822684624F065F80349049A059B0868A1
:104CD00011F042FFEAE7C046602900200022044BA1
:104CE0005A60044A08321A60034A13607047C0468B
:104CF0000C2A0020A0990200A02B0020F8B5214E1C
:104D00003568696801292DD9AA684B1ED05C0A282C
:104D100028D1002B01DC1C0009E0581E145C0A2C71
:104D2000F9D00300F5E7105D202802D10134A1423B
:104D3000F9D8002B0BDD601C814208D1581E0028D9
:104D400005D00138175C0A2F0CD0202FF7D052184D
:104D5000023AE31A14789B083A3C624254411C1907
:104D6000002C00D1F8BD084F04223900280022F0A1
:104D7000AEF90421380004F0EDFC3369013C043342
:104D80003361EDE7142A0020DB6F030010B5202209
:104D90000021024824F019F810BDC046DC2E002086
:104DA000084B10B5426818600020986018750138EB
:104DB000D86008005A601A6199611EF07DFCFFF707
:104DC0009DFF10BD142A0020F8B503780400002BC5
:104DD0001ED0104D286E002804D0210024F03FF88A
:104DE000002815D0200024F044F8471C380021F09A
:104DF0006DFA061E0CD03A00210023F0CAFF2A00EB
:104E0000054B5C321968043B99609342FAD12E66D7
:104E1000F8BDC0467C2E0020F42E0020F0B5B84C22
:104E200002002068A568436885B00193002D00D07A
:104E3000FDE0531E042B11D8636801998B4200D109
:104E400095E0012A00D12AE1022A07D1236962688C
:104E5000934200D94FE10122524288E0032A00D157
:104E600085E0042A00D12FE1052A00D107E1062AB6
:104E70000ED12369019A9342AD416D42002DEADDC6
:104E80002368290098682369C01804F063FC1FE0B8
:104E90000B2A21D1019B2269991A22F0D8F92368A3
:104EA000019A5B68934204D213002269981A04F0B5
:104EB00087FC2268236951689068C91AC01804F0F9
:104EC00049FC236858682369C01A401B04F066FC3B
:104ED00023695D192561BEE70E2A13D1E368002B13
:104EE000B9DB013BE3606268019B991A22F0AFF9DC
:104EF000E368002B18DB1633824A9B00D3189968AD
:104F000020680FE0102A16D1E368062BA3DC5D1C95
:104F10007C4A17339B00D318996800299BD063689B
:104F2000E560436022F058F963682269D61A226866
:104F30005568ED1A0AE0152A0CD123696268616888
:104F40009A1A22F08CF9236962689E1A0127002EB2
:104F50002FDCA4E70D2A0DD16B481EF0ADFB2068B5
:104F600022F01FF96368C018FFF72EFF002210001F
:104F700005B0F0BD01231B2A62D0082A01D07F2A88
:104F800020D121696268914200D864E700238668D5
:104F9000B618F75C202F13D101339F18B942F8D807
:104FA0000426032B00DC033E891B320022F057F954
:104FB0000127300004F0F2FB23699E1B266178E094
:104FC0000126F1E7092A28D1636822698068D11A8D
:104FD000C0184E4A03AB02F025FB061E00D13AE78B
:104FE0000027431C0BD1A0691EF066FB6368226991
:104FF000D11A22689068C01804F0ACFB4FE723690F
:105000002068F918039B01375A1C03921A7822F082
:105010000CF9BE42F3D1350041E71300203B5E2B73
:1050200000D918E7216922F009F9012537E7012D98
:1050300008D104234F2A03D002235B2A00D0002387
:10504000A36008E7022D20D11300303B092B03D8C1
:1050500003232275A360FEE60023A360412A00D14A
:1050600052E7422A00D139E7432A00D101E7442A16
:1050700000D1EBE6482A12D0462A00D0EBE6002702
:10508000019B22693E009D1A0EE00021032D29D1CB
:105090007E2A24D1237D312B01D0372B0DD1002541
:1050A0002F00236962689E1A0023A3609E4200DDE0
:1050B0007FE7002F00D1E1E6F1E61A00FB25343A44
:1050C0002A42DCD0332B0AD12169019B994206D2B6
:1050D000012222F0C4F8002501272E00E4E7002574
:1050E0002F00FAE7042D04D1462AC8D0482AD6D08A
:1050F000A5E7A160AFE6002501262F0059E7C046CD
:10510000142A00207C2E0020DC3F030084E80200EB
:10511000044B88600B60044B08004B600023CB609D
:105120007047C0466C980200352C020013B504008D
:10513000080001A9FBF746FF002C03D0012C07D083
:10514000002004E0019B0548002B00D1044816BD57
:1051500001991EF0CBF840002043F8E7CCE70200AD
:10516000C4E70200F0B585B00400080003A91500EB
:10517000FBF728FF0600002D07D10300039A2F49F3
:10518000200021F047FE05B0F0BD039B0200C318CC
:10519000002101200193019B934206D82727002973
:1051A00000D0053F3A0026491AE01378272B08D093
:1051B000223B5D426B41DBB20132002BEBD0272753
:1051C000F0E700230100F7E730001EF05CF805006F
:1051D00030001EF073F80600AF4205D13A001949BD
:1051E000200021F017FE14E017495C2D0ED02B0093
:1051F000203B5E2B01D82A00D5E714490A2D05D0A3
:1052000013490D2D02D0092D0CD11249200021F097
:1052100040FD019BB342D7D83A000949200021F054
:10522000F9FDB0E7FF2D02D82A000B49D8E70B4B58
:105230002A000B499D42D3D90A49D1E70301030053
:105240008200030081000300850003008800030042
:105250008B0003008E00030091000300FFFF00009D
:10526000080903000F090300F7B51E0008AB1D78FD
:10527000294B0C001700984206D12B003200390050
:10528000FDF7D4FC2018FEBDF30715D57610019666
:10529000019BE219002B2ADA00213F260127501E2C
:1052A000A04219D2002900D001932000002DEAD19C
:1052B0001A491B481FF0BEFB01A93000FDF71CFC7A
:1052C0000028E5D130001DF0B2F916490200164859
:1052D00003F0E8F807F002FA0278B243802A01D01E
:1052E00039000133421E002BCDD01000D8E720003A
:1052F000012600243F27904204D3002C00D00193C4
:105300001000D3E7013BBED3340001300178B9432C
:105310008029F0D10130F9E7A0920200EE080300E5
:1053200084A90200C608030090AC0200F0B587B063
:1053300004000E001700FDF7B9FA02A905002000CD
:10534000FBF740FE0400042F4ED1B30734D1274BA6
:1053500032689A4230D105AB04AA03A930001DF08F
:105360009EFE059B224FBB4204D0032B02D0214856
:1053700008F01EFA039B2600BB4207D00122210041
:1053800000922800029AFFF76FFF0600029A049B22
:10539000A118BB4206D00121280000912100FFF78F
:1053A00063FF01000E208E4204D88A1B28003100C2
:1053B0001CF0F6FF07B0F0BD0023029A0093210015
:1053C00033002800FFF750FF0278012153B2002B71
:1053D00006DA4023012101E001315B081342FBD1D1
:1053E0000122FBF7B5FDE5E70020E3E7E8A40200B2
:1053F000E4B30200A6FC020010B504000C2020F06B
:1054000058FF034B4460036001235B42836010BD7F
:10541000089B020001220020074B08495A600860DF
:10542000A821DA60064AC9005A5006495A50043188
:105430005A5005495A50704700A000400CAC00403B
:10544000FCFF0000440500004C050000034B04482D
:105450001B78002B00D103487047C046CD2D00209B
:10546000CCE70200C4E70200F8B5A826324A334B65
:10547000F600196813680420CB18C9181160304A67
:105480008C4612781B11170009112E4A2E4C2F4DF5
:10549000002F48D0002B3ADA9051C31AA920C0003F
:1054A000135081239B00002937DA591A13515151A7
:1054B0000123274CD3602378002B22D03F2225489C
:1054C000254B01688C331B6801310A409D5C1C4BE5
:1054D0001B78002B01D0803D6D001C2302606246CA
:1054E0006B4308339B1A154A9B1013601F23194006
:1054F00007D11A4B1A78002A03D01948197009F0FD
:1055000069FA01232278042053402370F8BDA927AB
:105510000433FF00D0519351C3E7535181239B00C3
:10552000C9181151C4E7043390515351A920812364
:10553000C0009B001350F3E7302A0020402A0020CF
:10554000D800002000A000404C05000044050000E9
:10555000CC2D0020342A00207C2E0020D9000020F1
:10556000F32C020030B585B001220400080001A927
:10557000FDF73EFC029A202A00D920220023019D3B
:10558000934204D0E85CE11808710133F8E7014860
:1055900005B030BDE4B3020070B50400080015008A
:1055A000FDF76CFA1F2802D90C4807F00FFF002DF9
:1055B00002D10B4808F0CEF82418042D04D10120A4
:1055C00023795B00184370BD2800FDF757FAFF28C8
:1055D00001D90448E9E720710348F4E748090300CA
:1055E0005C09030079FC0200E4B302000123A0225D
:1055F000834010B5134CD20513510300C133124C34
:10560000FF339B009C50114B8900C918A223DB007B
:10561000CA580F4C00022240CA50F82252011040D2
:10562000C022CC589202224310430322C850CC58C7
:10563000084822432043C850C046C046C046CA500E
:1056400010BDC0460C0500000303000000600040D0
:10565000FFE0ECFF031F0000A0221E21114BD2002F
:1056600070B59C58104D8C439C50A324E4001D51F0
:105670000E4C0F4D0F4E5C5104355E510E4D8000A7
:105680005C51A5240D4DE4001D51084C0C4D001932
:105690000C4C185104341D510B4C185198580143AF
:1056A000995070BD00F0014040A1004000600040F2
:1056B0001C05000044A100402405000048A1004052
:1056C0004CA100402C0500003405000010B504007A
:1056D0000A4903F0F5FB0A4BA0211C600123607905
:1056E000084A8340C9058B500021FFF77FFF002047
:1056F000FFF7B2FF0022044B1A7010BD18B202006F
:10570000382A00200C050000D800002070B50D00DC
:105710000400134E2800310003F0D2FB31002000BA
:1057200003F0CEFB0F4BA0221C600F4BD2051D6077
:10573000607901242100814026000C4BD150697909
:105740008E400021D650FFF751FF68792100FFF706
:105750004DFF2000FFF780FF054B1C7070BDC04659
:1057600018B20200382A00203C2A00200C05000054
:10577000D8000020F8B50025FFF74CFE214B28008B
:1057800090331D6009F0F4F8A0221E201E4B1F4923
:105790001D701F4BD2001D601E4B1F4C1D608B588F
:1057A0001E4F83438B50A223DB00E2581C4E3A402D
:1057B000E250E2581B493243E2500122E5501A4BB5
:1057C000186843799A401300A022D205535003F081
:1057D00061FB164B1B78AB4213D0154B1149E258B5
:1057E0001740E750E25816430122E650E550114BAE
:1057F000186843799A401300A022D205535003F051
:1058000049FBF8BD7C2E0020CD2D002000F001408A
:10581000302A0020402A002000600040FFE0ECFF1A
:10582000001F03000C050000382A0020D8000020CB
:10583000140500003C2A0020F0B53E4E8DB0330028
:1058400090331B680500002B03D1FFF793FF0DB0C9
:10585000F0BD002801D008F097FA684606F018FF5E
:10586000002822D133009033186807F0B9F90400FA
:1058700006F02CFF002D01D008F090FA2E4B2022CC
:105880001D6833006D118C3301356D011B681540A7
:105890005D19002C2DD1903621002800346023F0B2
:1058A00094FA0122254B1A70D1E7002D01D008F09F
:1058B00075FA019B2249186806F00EFA00240500CB
:1058C000A042DBD1019F3800FCF7F0FF1D4B98424E
:1058D0000BD12900012000F0CDFE2A000400F86061
:1058E0001F211948FBF734FBA060019B0024B3641F
:1058F000C4E72000FCF7DAFF144B984209D03300CC
:1059000000229033124913481A601DF08BFCB064DA
:105910009DE763682B60A3686B60E368AB602369F5
:10592000EB6063692B61A3696B61E369AB61236A17
:10593000EB61B6E77C2E0020342A0020D90000203D
:10594000DCAB020074AA020016090300EC9B020003
:105950003609030090AC020010B5FFF70BFF0148B9
:1059600010BDC046E4B30200F0B589B00493734B98
:1059700003901B780E001500002B01D0FFF7FAFEF4
:105980006F4C8C342368002B06D16D4A4020903236
:10599000136020F08EFC206080226A4BD200DA6710
:1059A0000122694C694BE250FFF734FD0023684A3D
:1059B000F021A3500432A3500832A350C22209039D
:1059C0009200A150634F093AFF3AA3500594BE429A
:1059D00000D0A3E0B54200D09DE05F4D07AC2800A9
:1059E00003F062FA002805D001235C4928002370E7
:1059F00003F066FA5A4D280003F056FA002805D045
:105A0000012356492800637003F05AFA554D2800C7
:105A100003F04AFA002805D0012350492800A3705A
:105A200003F04EFA002307AA5F1C9B5C002B39D0C1
:105A30004D4ABB00043BD458A02203213D006379AA
:105A4000D205C133FF339B00995007ABEB5C002BB1
:105A500026D00426444BAA00D3580193012263792F
:105A6000A0219A40A123C905DB00CA50019B053340
:105A7000180002931DF01DF9012811D16379A021AE
:105A800098403A4BC905C85002981DF012F90028F9
:105A900006D1013E002EE1D1019949E00225D4E76B
:105AA000022DFBD10123022FBDD12B4801F0BEFCFA
:105AB000FFF70CFE0021039807F058F80025012499
:105AC0003F221F4B802190331860294B1D70294BBA
:105AD0001C70294B1A601A4B12198C33186823F06A
:105AE00074F92800FFF7A8FE244B144E1C60059B98
:105AF00050221C6022492800347008F005FF049BE6
:105B0000AB4219D00E4B3278002A15D09A6C002A7D
:105B100012D120BFF7E71B4807F01CFE300001F050
:105B200085FC0400BD42C3D0280001F07FFC0100C9
:105B30002000FFF7EBFDBDE709B0F0BDCD2D002043
:105B40007C2E002004E100E000A00040FC0F0000DB
:105B500004050000E4B30200ACA20200E8B10200B8
:105B6000F4A2020004A30200B89B02000C0500008E
:105B7000CC2D0020D9000020342A00200CAC00409D
:105B8000695400008109030010B5084B86B002ACCF
:105B90000093019404230CF0BFFB02982379E26880
:105BA000A168FFF7E1FE024806B010BDC49B0200E9
:105BB000E4B30200014B1878C0B27047CD2D00202D
:105BC00010B5242020F075FB0400044B202208C0EF
:105BD000802123F0FAF8200010BDC046EC9B0200A3
:105BE000F8B5070008000D001600FCF75FFE304B0B
:105BF00098425BD1781F0F2858D814F085F8080810
:105C00003257575757575757575757303055FFF751
:105C1000D7FF04230400EA5CE2540133242BFAD1B9
:105C20003000FCF743FE224B98423FD10121052F63
:105C300002D0122F00D002390422FF20B35CA55CF1
:105C4000803B4B435B19FF2B03D90500DB179D43BA
:105C50002B00A3540132242AF0D12000F8BD2C00DF
:105C6000DEE7FFF7ADFF04230400EA5CE2540133F2
:105C7000242BFAD13000FCF765FF0F211DF03EF810
:105C80002100FF25221D24311378803B4343DB1381
:105C90008033FF2B03D92E00DB179E433300137094
:105CA00001329142F0D1D8E72C00E3E70024D4E799
:105CB000EC9B0200F0B585B00C00FBF76BF903AA72
:105CC000070002A92000FCF77BFF029E039B350022
:105CD0001035AD002800019320F0EBFA04002C22CF
:105CE0001030002123F071F867602700104BE66345
:105CF0002360104B019EA3600F4B403DE3600F4BB0
:105D0000403763610E4B7519A3610E4BE3610E4B77
:105D100023620E4B63620E4B6363AE4202D12000DE
:105D200005B0F0BD01CEFBF735F901C7F5E7C04678
:105D300058B80200555D0000B55D0000196600000E
:105D4000B1660000795D0000B1670000A565000044
:105D50004CA0020070B50C0005000B6805495A689C
:105D600021F058F821682800403122000CF08CF90D
:105D700070BDC046C43B0300136870B5002B10D142
:105D80000568EE6BB34200D170BD9C002C19246CE9
:105D9000A14201D00133F5E702339B001B58136089
:105DA000F2E7024902481EF045FEC046A30903007F
:105DB000E0A70200F0B51700C26B85B0CE19050050
:105DC00001910393964206D033002549254802F0FD
:105DD00069FB06F083FC0021300000F04BFC04005E
:105DE000019B05609B001A0003990830029322F082
:105DF000D0FF0298BA0008302018002122F0E5FFF9
:105E0000029A039B94466344F7191E00019BBB4210
:105E100002D3200005B0F0BD3068FBF7BBF80021CD
:105E20000200EB6B0293029B994204D10E490D488C
:105E300002F038FBCDE78B00E818006C824201D0FD
:105E40000131F0E7E3189968002901D00749EEE72E
:105E5000726808369A60019B02330193D6E7C04608
:105E6000B407030090AC02001C080300ED07030018
:105E7000014B58687047C0467C2E0020014B1868C3
:105E80007047C0467C2E0020F0B5194E87B03368AD
:105E9000050000200C0001931FF0B5FC306000905D
:105EA00020681EF07CFD019B07003360114E022D1F
:105EB00003D0A068FCF7FAFC0600210063680831F3
:105EC000A81E039300F0D6FB009B049005930022CC
:105ED00003AB0321300006F053FD074B04009F4243
:105EE00003D0010038001FF07DFB200007B0F0BD9B
:105EF0007C2E002058B80200E4B302001FB56946AA
:105F000006F034FE0400200006F092FE002802D1C4
:105F1000044804B010BDFCF7EFFE0028F3D102489E
:105F2000F7E7C046CCE70200C4E702001FB56946A8
:105F300006F01CFE0400200006F07AFE002802D1C4
:105F4000044804B010BDFCF7D7FE0028F3D0024887
:105F5000F7E7C046C4E70200CCE7020010B5FCF743
:105F600029FD034B002800D1024B180010BDC0468C
:105F7000CCE70200C4E7020037B5FCF77FFD01ABB8
:105F80007F2806D80121187001221800FAF7E0FFD7
:105F90003EBD1E49820988420BD8402149420A432E
:105FA0001A703F2202408020404210435870423114
:105FB000EAE7174C010BA0420ED82024644221438B
:105FC000197080215F344942224020400A43014336
:105FD00099705A700321D7E70E4CA04212D81024B2
:105FE000850C64422C431C703F2580242940644268
:105FF0002A40284021432243204359709A70D87088
:106000000421C1E7044807F0E1F9C046FF0700009A
:10601000FFFF0000FFFF1000B7090300F0B589B0D3
:10602000019204000D0000222F490198029302F012
:10603000A3FD0090002801D043680093012C16D0E6
:10604000A4002B19002427000193019B9D4224D01A
:10605000009B2E68002B04D0310018001EF0A6FC17
:106060000600002C37D137002C680435EDE70024FA
:1060700004A9286806F07AFD27000390039806F02B
:10608000D7FD051E0CD1002C07D12200174901981D
:1060900002F072FD00281BD04468200009B0F0BD5A
:1060A000009B2E00002B04D0290018001EF07EFC5F
:1060B0000600002C09D03A003100029807F08EF952
:1060C0000B4B984201D025003E002C003700D5E74D
:1060D000084807F07BF93A003100029807F07EF992
:1060E000034B9842C1D1BEE7561300002E110000A9
:1060F000CCE70200D809030037B501A90500FBF77A
:106100007FFB1E4B04002B40062B05D0AB072AD18A
:106110001B4B2A689A4226D1019920001DF0E6F80F
:106120000190012822D1207843B2002B04DB01200A
:1061300023785B0018433EBD7F23013418403F3B6A
:10614000034208D13F22237819009143802905D0CA
:106150001FF0B6FAEFE798435B10F1E780011340B8
:1061600001341843EFE7019B012BE0D0019A054968
:10617000054802F097F906F0B1FAC046070080FF23
:106180000C9A0200F109030090AC0200F0B5140073
:1061900087B00290039100222349200002F0ECFC1A
:1061A000002205002149200002F0E6FC0123040042
:1061B000049305931E4F002D07D068681D4B98422D
:1061C00003D004A9FBF71CFB07001B4E002C07D0D3
:1061D0006068184B984203D005A9FBF711FB060035
:1061E0000024029B154D9C420AD10023059A01937D
:1061F0000093310028000EF0BBFD0E4807B0F0BD43
:10620000002C07D00023049A019300933900280042
:106210000EF0AEFD0399A3000022C9582800FCF738
:106220005DFB0134DDE7C0468E15000096110000CD
:10623000DE6F0300E4B30200654F030084E8020050
:1062400010B5040086B06A4602A810210FF0D8FDF0
:10625000012221006846FCF741FB02A90248FAF737
:1062600041FE06B010BDC0460C9A020070B50C6825
:10627000E30726D4A30703D1174B22689A4220D004
:10628000012820D94868FCF7F9FB06002000FCF73C
:1062900059FC051C300014F0D1FE011C0F4817F00A
:1062A0008DFB011C041C281C14F09CFB16F0F6FF4F
:1062B000211C14F0BFF9032302249843084B044324
:1062C000E418200070BD2000FCF73CFC16F0E6FF4F
:1062D00006F056F80400F4E72CB902000000204153
:1062E0000000808030B50B0085B01400012802D971
:1062F000094807F02FFA09480121C2680192019D5F
:106300000022A8472200039003A901200DF0C4FF3A
:10631000039805B030BDC046450A030088E7020077
:1063200013B504000800FAF735FE6A4601002000A4
:1063300006F09EFB009B0248002B00D1014816BDD1
:10634000CCE70200C4E7020037B50024022800D9D8
:106350008C6848680D68FAF71DFE0A4B0100002C96
:1063600000D0094B6A4628009847009B002B07D0B5
:1063700001991C00002903D01800FCF703FF04005A
:1063800020003EBDD5CA000071CA000070B50400EF
:1063900008001500FAF7FEFD2A000100200006F0B3
:1063A000C1FB014870BDC046E4B30200F8B5032646
:1063B000050007003540022D16D10E4B0340062B79
:1063C00012D0FF23DB05C418B443201C002113F0B6
:1063D00075FE002806D080231B06E418B443064B44
:1063E0002C43E7183800F8BD380009F069FA0700B7
:1063F000F8E7C046070080FF000080807FB50B00F3
:10640000012803D100211868FCF782FA102102A8A4
:1064100020F079FE0C4902A81CF002FC032804D1EC
:106420000A481CF0F2FE06F059F9039B0193002B79
:1064300003D1042801D10648F3E702A90548FAF779
:1064400051FD07B000BDC0463B830300FCA902001C
:1064500058A802000C9A020010B506F0C1FB0028F3
:1064600004D103481CF0D1FE06F038F910BDC04637
:10647000DCAB020010B5022803D0054905481EF028
:10648000D9FA4A680B20096806F0A8FF10BDC0467B
:106490002B0A0300ECAA02007FB50D4D0400A842B0
:1064A00013D00C4E012201003000FCF717FA0A4904
:1064B000300020F0EEFB04230293084B0394DB69C9
:1064C00002AA0321064801939847280004B070BD32
:1064D000E4B3020084E80200654F030098B10200B3
:1064E0005C9D0200F8B50E0000280FD10400284B77
:1064F0001D680021080020F0B3FA00270600BD4205
:1065000032D10025AC423ED13000F8BD0868830787
:1065100014D103681F4A93420DD11CF087FF050078
:106520003068FCF7C3F91C4BC26800249A42E0D1E2
:1065300034680434DDE7194A934201D0FCF7B6F918
:10654000856B002DECD0164B2A689A42E8D00025C6
:10655000E6E7EA68FB009958002904D0042902D034
:1065600030000DF039FE0137AB68BB42F1D8C8E707
:10657000A268EB009958002904D0042902D0300009
:106580000DF02AFE01356368AB42F1D8BCE7C04686
:106590007C2E002098B102007DB6000058B80200A1
:1065A00074C20200044B88600B60044B08004B600F
:1065B0000023CB607047C0466C980200E72D0200B4
:1065C00070B50E0010490400002520F062FB7368CE
:1065D000AB420AD8012B03D10C49200020F059FB13
:1065E0000B49200020F055FB70BD002D03D0094958
:1065F000200020F04EFBAB00F31801229968200028
:10660000FCF76CF90135E2E7E20D0300700A0300C4
:10661000A002030045FC020070B50D0001281ED049
:10662000002803D0022807D0002004E04B680E4861
:10663000002B00D10D4870BD00260D4C6B689E42AA
:1066400003D3012064002043F5E7B300EB189968F9
:10665000022006F023F9401024180136EEE74B68BB
:106660005B001843E7E7C046CCE70200C4E702003E
:1066700044A0020070B506000D000B48002E0DD09E
:10668000B41CA40020001FF014FE084B46600360F9
:10669000002D03D00023083CA34200D170BDE9586F
:1066A000C21891600433F7E744A002004CA0020036
:1066B000F0B5070085B00E0014001D2803D9002591
:1066C000280005B0F0BD01238340324D1D4044D168
:1066D000314A13421FD1F82292051342EFD0200015
:1066E000FCF7E4F82D4B426A9A4205D020002C4971
:1066F0001EF0F8F8041E0CD0230031006268083345
:1067000000920831726838000BF02AF9254D0028F4
:10671000D6D1254DD4E72000FCF7C8F8204905F074
:10672000DBFA0028CBD07368626829009818FFF75D
:10673000A1FF07003100736808379A00050008318F
:10674000380022F026FB210070686368800038184A
:106750009A00083122F01DFBB2E703A91000FCF7F4
:10676000CBF90025A842ABD00398104D0028A7DD37
:10677000736800215843FFF77DFF05002B003000B0
:10678000083300930830039B726804211FF031FA2C
:1067900096E7C0468000100020000400A5650000B8
:1067A0004CA00200CCE70200C4E7020044A00200B3
:1067B00030B5040085B0042A2DD1032540680D4072
:1067C0001FD1164B0A689A421BD101AA0BF04CF854
:1067D000002802D1124806F0EBFF019B0298290025
:1067E000C01AFFF747FF050021006B6808319A00C7
:1067F000019B08309C00091922F0CBFA280005B053
:1068000030BD0A00002301002068FCF70FFA0230B7
:1068100080000559F2E70025F0E7C046E8A4020031
:10682000A6FC0200F0B50C001100002285B01E008D
:106830000092012320000BF03FFD184D002C1ED0CC
:106840003568AB0703D1164B2A689A4217D010203F
:106850001FF02FFD00210400306806F087F90025A5
:1068600004260390039806F0E3F9071E0AD12800D6
:106870002100FFF7FFFE050020001FF049FD280062
:1068800005B0F0BDAE4205D8F10020001FF02FFD8D
:1068900004007600AB001F510135E3E744A002007D
:1068A0004CA002000022104B10491A600300123362
:1068B000FF3341185A701A7004338B42FAD1010029
:1068C0000300002209310833FF311A709A705A70A0
:1068D000DA7004338B42F8D1C3237F229B00C25469
:1068E000034B044A1A607047442A00201103000039
:1068F00004000020720A0300F0B500267E24320056
:1069000031009300C318FF335F7C7F2F4CD09B7CFA
:10691000F618F6B2531CDBB2EF2E2AD9C1267D251C
:10692000B60086193700AC469C4516DA9B00C318A2
:10693000FF3359749974D97419757D230232D2B218
:10694000934211DA9300C318FF335C749974D974BD
:10695000197500260132D2B2D3E73D68043FBD600D
:1069600001256D42AC44DFE73568013B7560043EAC
:10697000E6E77D2FEED80D4DEF5D01252F42E9D0E2
:10698000C1227D26920082189E4208DA9A0082185F
:10699000FF3254749174D17411751A00D9E71568D7
:1069A000013E5560043AEFE7F0BDC046550B0300C9
:1069B00070B5002140250D4C8B00C318FF335A7C65
:1069C0007F2A11D0A25C0131C9B22A42F4D05A7D8B
:1069D0007F2AF1D0A25C7F2AEED9DA7D56B2002E52
:1069E000EADD0132DA74E7E770BDC046040B03004C
:1069F0000300F7B500214B4A1333FF338218197097
:106A000004339A42FBD1FC2300249C462200844498
:106A100053B2002B04DA444B444A1A60002008E0C9
:106A200063461F69BC4205D37F234432920013544E
:106A30000120FEBDDE68355D602D01D9203DEDB23F
:106A4000611CC9B28F4251D0735C602B01D9203BCD
:106A5000DBB2232D4DD1303B092B02D9324B344AC6
:106A6000DBE70234E1B28F4204D8FF2BF6D8437043
:106A70000C00CDE7745C2500303D092DF5D80A25C2
:106A80006B430131303BE318C9B2ECE70136512EBC
:106A900030D10023274C1F5DDEB22A2F0CD1264FA8
:106AA000FF5CAF4208D19300C318FF335E74447893
:106AB00001321C75D2B2DBE70133512BEBD11F4CF5
:106AC000493B08342678AE4208D0013C002B02D165
:106AD000154B1B4AA1E7013BDBB2F3E7002BF7D0D4
:106AE00014004334A4000419A370C1E7232DB5D0CA
:106AF00000230026F7B201970F4FF75DAF42C5D1D3
:106B00000C4FF75D2A2FC1D09F42BFD1930001994E
:106B1000C318FF3359744178013202341975D2B267
:106B2000E1B2A5E71203000004000020750A03008B
:106B3000870A0300940C0300430C0300E50C0300D8
:106B4000950A030010B51130084A0949FF3003784F
:106B50007F2B00D110BD02240457002C03DCCB5C3A
:106B600043700430F3E7D35CFAE7C046F30B03004D
:106B7000A30B0300F0B50023070085B09E00BE19EB
:106B80003100FF314A7C9C467F2A01D105B0F0BD1F
:106B90004F4B02209C5C63460133DBB20442EDD0D4
:106BA000012560462C4242D15419E0B20090494878
:106BB0007C35801840780190C87C097D0290039153
:106BC000C1218900791808009D4226DA9B000098AF
:106BD000FB18FF3358740198941C98740298E4B21F
:106BE000D874039818753B48634682183000FF300C
:106BF0009578027D023300927D22C67CDBB29A42F8
:106C000010DA9B00FB18FF335C749D74DE74009AED
:106C10001A7563460333DBB2B0E70468013D446094
:106C20000438D1E70868013A48600439E7E70130E1
:106C3000C0B2010044318900C95D0029F7D07F2925
:106C400008D008242248405C204297D124390129E9
:106C500000D893E73000511CC9B200911D49FF30A4
:106C6000891849787D250191C17C0291017D0391AC
:106C7000C121890079180C009D421FDA9B00009CFD
:106C8000FB18FF335C74019C124D9C74029CDC74F5
:106C9000039C1C75941CAA1863469678027D0233E7
:106CA00000927D22C57CDBB2E4B29A420BDA9B00F3
:106CB000FB18FF335C749E74DD74A8E72668013D01
:106CC0006660043CD8E70868013A48600439ECE79C
:106CD000040B0300A30B0300F7B500229300C318B5
:106CE000FF335C7C002C03D10132D1B20A00F5E7FE
:106CF0007F2C00D126E1102693490D5D511CC9B2AD
:106D0000354227D0DC7CAD06ED0FA4462C00C12512
:106D10001434AD001F7D019445196D368E4214DA8E
:106D20008D00019C4519FF356C740024AC746446D9
:106D30002F75EC745C7C352C00D0C5E05A7B834CFD
:106D4000A25C5207D2D5102285E02C68013E6C600F
:106D5000043DE3E74E2C1CD118220D24DD7C5C742D
:106D60001E7DC1239B00C31870348C420CDA8B004B
:106D7000C318FF335A740022DD749A741E75B5E788
:106D80001B22EAE71C22E8E71F68013C5F60043B26
:106D9000EBE74F2CF4D0502CF4D06DB2002D2BDA51
:106DA000DD7C002D28D00D004435AD002D5C002D7C
:106DB00022D1961CF5B20195AD004519FF356F7CC7
:106DC0007F2F19D0604EF75D7F2F15D9EF7C002FF4
:106DD00012D0C1237D229B00C318019C944206DD82
:106DE0001F236B740023AB74EB742B757EE71C6858
:106DF000013A5C60043BF0E7172C2ED15C7B013A32
:106E0000D2B2452C1DD11B3C5C7315004335AD003F
:106E10004D4C2D5C655D7F2D00D867E70132D2B205
:106E200092008218FF32557C002D00D180E0645D15
:106E30007F2C00D85AE7D27C002A00D056E71E32B9
:106E400009E0392C01D10D3CDEE73F4A125D7F2A73
:106E500000D84BE712225A7448E7182C07D15A7B06
:106E6000394CA25C7F2A00D840E71322F3E7202C9C
:106E700005D15A7B3C2A00D038E7163AEBE7482C7C
:106E800015D15C7D7F2C02D14B245C7403E02E4D28
:106E90002C5DA406F8D55C7C2B4D2D5DED0700D450
:106EA00048E75D7B202D3CD10C3C5C741EE73C2CFC
:106EB000F1D15A7D7F2A00D118E7234CA25C9206BB
:106EC00000D513E73F22C6E72A2C16D1DA7C1C7DB9
:106ED000C1237D259B00C3188D4209DA2B258B0029
:106EE000C318FF335D740025DA749D741C75FDE6CC
:106EF0001E68013D5E60043BEEE72C2C11D1DA7C6C
:106F00001C7DC1237D259B00C3188D4204DA8B00B4
:106F1000C318FF332D25E5E71E68013D5E60043B85
:106F2000F3E7452C00D170E7392C00D0DEE66CE7A2
:106F3000527D7F2A00D1D9E6A25C7F2A00D8D5E60F
:106F40001E2288E7F7BDC046040B0300550B030063
:106F5000F0B50022060085B0130044339B009B5D12
:106F60007F2B31D05B4CE35CDB072AD51300511E2D
:106F7000C9B244318900584F7118013BDBB2002B74
:106F800023D008787F2803D0385C04397F28F4D9CF
:106F900099007118FF31487C7F280ED02027255C8E
:106FA0003D4204D04C4D285C0425284205D0887C05
:106FB0004508AC460130604488740133DBB293422B
:106FC000E6D10132D2B2C7E70023022712E06B07F5
:106FD00008D4EB070DD56246FF32937CD9085B1AC3
:106FE000937406E0039B039A9B7B99080133CB18AB
:106FF0009373029B9A00B2181100FF3194464A7CA9
:107000007F2A64D034485D1C845CEDB2029565B281
:10701000002D21DA029A9200B218FF320392527CBC
:107020000192855C019C2A0041257F2C00D015002F
:1070300040242242CBD1019C123C012CD9D84022C1
:107040000233DBB244339B009B5DC35C1342D0D060
:107050008B7C013B8B74CCE71E4DAA5C08252A4231
:107060000ED0029B9B00F318FF335A7C7F2AC0D0BE
:10707000825C3A42BDD006229A7405229A73B8E720
:107080003C421AD00133DBB21A0044329200925DC6
:10709000002AF7D07F2AACD00F498A5C3A42A8D0A8
:1070A0009B00F318FF339A7C520801329A746246AF
:1070B000FF32937C5B08013392E710231A4298D089
:1070C0004B7BC35C3B4294D08B7C023BC2E705B058
:1070D000F0BDC046550B0300040B030070B504005F
:1070E000FFF7E0FB2000FFF783FC23000022FC33C6
:1070F000DA601A61904226D02500224E113533689D
:10710000FF35934203D029001F4806F079FB200089
:10711000FFF7E2FD2000FFF74BFC2000FFF712FD18
:107120002000FFF715FF2000FFF724FDC4222B00ED
:107130009200A1181A78502A06D97F2A07D0002079
:10714000124B134A1A6070BD04338B42F2D133687C
:10715000002B02D00F4819F07DFC2000FFF7CCFB7C
:107160003368002B03D029000B4806F049FB2000B0
:107170001BF066FE054B0949186821F070FE43427A
:107180005841E0E7582A0020AC0A03000400002020
:10719000BB0A0300E10A0300F10A0300720A0300BC
:1071A00070B504000800FBF769FC0500431002D02D
:1071B0000F4806F00BF90F49200001F081FE00286E
:1071C00007D0A02203216379D205C133FF339B008E
:1071D0009950012362799340A022D205002D04D05A
:1071E000A121C9000448535070BD0449FAE7C046C4
:1071F0003B0D0300F8B10200E4B302000C050000EF
:1072000070B505000800FBF739FC0B2303410400AF
:10721000DB0702D4094806F0D9F82800084901F034
:107220004FFEFF22A40092001440A0226B79D205E9
:10723000C133FF339B0003489C5070BD0D0D03000C
:10724000F0B10200E4B3020010B50C49040001F0F3
:1072500037FEA022D205002805D004216379C1336E
:10726000FF339B00D150A223DB00D0586379D84074
:10727000012318401EF024FA10BDC046F0B10200F0
:1072800010B5040001F0E8FD0A4B984205D00A4B06
:10729000984202D0200001F0EDFDA0226379D205D2
:1072A000C133FF339B0098580007800F1EF008FA87
:1072B00010BDC046F0B1020008B20200032370B551
:1072C0000B4004000800022B14D1194B0B40062B75
:1072D00010D0FBF737FC15F08BFC0022154B13F098
:1072E00037FF15F015FC144B0500984205D91348DB
:1072F00006F06CF8FBF7C2FBF5E71149200001F03E
:10730000DFFD002807D0A02203216379D205C13315
:10731000FF339B0099506079290006F0B5FB002DE2
:1073200003D10849200001F0CBFD074870BDC046DD
:10733000070080FF0000E03FFF0300001A0D03007C
:1073400038B20200E8B10200E4B3020013B50A4902
:10735000040001F0B5FD05216846615611F084FD79
:10736000684611F0A7FDA0230021044ADB00D1509C
:107370001EF0A6F916BDC046E8B10200007000403C
:1073800010B50800FBF77AFBFA239B00584306F080
:1073900057FB002802D0024806F018F8014810BD3B
:1073A000FE0C0300E4B3020010B50800FBF766FB17
:1073B00006F046FB002802D0024806F007F8024813
:1073C00010BDC046FE0C0300E4B3020010B504007B
:1073D00001F042FD0C4988420DD00C4B98420AD076
:1073E000200001F06DFDA02200216379D205C13398
:1073F000FF339B009950200007F0BCF9044B002894
:1074000000D0044B180010BD20B2020008B20200E8
:10741000CCE70200C4E70200A0230C220249DB05EE
:107420005A5024315A5070474407000010B50400E8
:10743000FBF73CFA064B984208D0064B984205D021
:10744000054B984202D0054806F084F9200010BD93
:107450007CA3020034A2020070A20200EE0C030022
:10746000F0B50D00002785B0110003901E00280024
:10747000104B022200970AF01FFFAB1C9B00180064
:1074800002931EF016FF0400039B013D036045605C
:107490003368029D8360083D0437BD4202D120005D
:1074A00005B0F0BD0021F05905F060FBE3199860CC
:1074B000F2E7C046FFFF0000F7B503780400002B99
:1074C0001FD0402B20D101230193002304221E0052
:1074D0001D00190094462278002A3ED1013200296D
:1074E00010DC002D0EDC002E0CDC033B934209D98E
:1074F000013C23785C2B05D00199002901D00A2B8F
:1075000000D100221000FEBD3F491BF0FAFC00280C
:10751000D9D13E4920001BF0F4FC0028D3D13C49CE
:1075200020001BF0EEFC0028CDD13A4920001BF0D2
:10753000E8FC0028C7D1384920001BF0E2FC0028F5
:10754000C1D1364920001BF0DCFC0028BBD13449F6
:1075500020001BF0D6FC0190B7E76778272A11D1ED
:10756000002B4DD0032B09D1272F05D1A278272A34
:1075700004D10234243AD31A0134ACE7012BFBD8EE
:107580000122F8E7222A11D11A006046824309D16C
:10759000222F05D1A278222A02D102346246EAE7DC
:1075A000002B01D0022BE7D10222E4E75C2A0AD1AA
:1075B000272F03D0222F01D05C2F04D11A00571E91
:1075C000BA41A418D8E7002BD6D15B2A12D006D82E
:1075D000282A0DD0293A57425741C91BCCE77B2AAC
:1075E0000AD07D2A0AD05D3A57425741ED1BC3E7C6
:1075F0000131C1E70135BFE70136BDE7013EBBE719
:10760000272FBDD1B2E7C046876B03005C0D030096
:10761000620D0300660D030072640300948703008B
:1076200081390300F0B58BB007934318039004929F
:1076300001930093009B5C1E039BA34201D900931E
:1076400010E0207801F008F8002801D00094F1E75C
:10765000207801F00DF80028F8D123785F2BF5D0C1
:107660002E2BF3D07D4B1D68009C019B9C4202D2C7
:1076700023782E2B21D1009BE71A019B9C4241D3FA
:107680000024260002940194AB68A34256D8019BC3
:10769000002B00D084E0009B039A93422FD1704CC2
:1076A0003A002100180021F065FB002827D1079B34
:1076B000E41907301C60C01B22E00134D5E7013615
:1076C000AB68B3421BD9F3000293EB68F200985801
:1076D0000028F4D00428F2D009A9FAF791F8099B00
:1076E0000100BB42EBD13A00009821F0C9FB002811
:1076F000E5D1EB68029A9B185868002804D1002055
:107700000BB0F0BD0026DBE7032318420CD1036861
:10771000544A934205D11BF089FE0500631C009377
:10772000A2E7514A934201D0FBF7C0F8856B002DC8
:10773000E5D04E4B2A689A42F0D0E0E7EA68E300D1
:10774000985800281CD004281AD009A9FAF758F82C
:10775000099B06900593BB4212D301003A000098A2
:1077600021F08EFB00280BD1029B002B12D03B0096
:107770009E4202D3059A9A4204D2019B013301939F
:10778000013481E7029AD15C069AD25C914205D11C
:107790000133EDE7069B059E0293EEE71E00ECE742
:1077A000019B012B01D0BE4254D9029B079ADB19E1
:1077B0001360F01BA4E7029BEA68DB0098580028DE
:1077C0003AD0042838D009A9FAF71AF8099B03908F
:1077D0000593BB4230D301003A00009821F050FBE2
:1077E0000190002828D133000F220F33DC171440FA
:1077F000E41824112401A41B012C00DC1034059A88
:1078000033199B18402B0DD9039A194904981FF07E
:1078100001FB099E10E0174904981FF03AFA019BFA
:1078200001330193019B9C42F5DC039904981FF0FE
:1078300030FA099BF6183619029B01330293AB68A4
:10784000029A9342B7D80C4904981FF022FA0120FB
:10785000404255E7002340260293F0E77C2E0020AB
:10786000500D030098B1020058B8020074C2020023
:10787000580D0300DE6F0300654F030010B50400D0
:107880001FF08FFC1AF0CDFF01280BD00649200015
:107890001FF0A2FC20001FF084FC1AF0C2FF022897
:1078A00000D0002010BDC046A60D0300F0B59DB06D
:1078B00000AF0C68032835D9CB68FB60042835D0AD
:1078C0000D6900206D102BD41C232000F918F9F746
:1078D00097FF7861002D5AD0954C9649606808F062
:1078E0005DFB0600606800229349043001F044F912
:1078F0001823FA18D11804003000F9F781FF3B6B08
:10790000013D0100C318002C05D1994203D2013B6F
:107910001A782E2AF9D1013D0ED299420FD187480B
:1079200005F054FD864B0025FB60CDE70025CBE735
:10793000013B1A782E2AEED09942F9D3EBE7FE6983
:107940005C1A2500002E01D0751C2D192B006A46EB
:107950000E33DB08DB00D31A9D46220018003B6182
:1079600021F017FA002E08D02E233A69601C135517
:1079700010187969320021F00CFA2900386909F0F1
:107980009BF806243B69C0000443FD617B61200035
:10799000F9F700FB01F0C4F8061E15D02E21786916
:1079A00021F04FFA00280BD0654BFA689A4207D1B4
:1079B0007B69C11A180009F07FF801F0B1F80600E0
:1079C0003000BD461DB0F0BD182318000125FA187F
:1079D000D2183818103B4021C0181FF0ADFBBE6014
:1079E0003E61FB69AB4205D2554BFA689A42E7D03B
:1079F000BE68E5E7AB4204D07B695B5D2E2B00D00F
:107A000094E02900786909F057F87B6A3860002B08
:107A100017D12A00082479691833F81800191FF0C3
:107A200056FB1823FB181819FFF728FF78607B68AE
:107A3000002B14D13A684349434800F033FD04F069
:107A40004DFE18230824FA182F2110190EF0E4F91E
:107A50003B693969EA1A7B6959181823DDE73868E8
:107A600001F05EF8041E4BD1386801F027F8FB697D
:107A70000400AB4213D1354BFA689A420FD17B68B0
:107A8000012B0FD0324A2B4940681DF0F5FE182219
:107A90000823BA18D11820001BF04EFA30E07B689A
:107AA000012BF4D10022796AB86AF9F751FAF4216E
:107AB0000200FF31200005F035F87B6A18227B6058
:107AC0000823B818C0182F210EF0A6F91822082391
:107AD000B818C0181F491FF07FFB18220823BA18D6
:107AE000D0181FF05EFB1AF09CFE022806D1182267
:107AF0000823BA18D11820001BF01EFA7B687B629D
:107B0000BB68002B0CD07A693B699446E91A634440
:107B1000180008F0D1FF22000100B86805F002F853
:107B2000002E00D126006B1C3B61BC60013558E77C
:107B30007C2E0020860F00009E0F00006A0D0300BF
:107B4000E4B30200890D03000CA90200C4E702009F
:107B5000760F00009E0D0300184BF7B530CB0F00D9
:107B6000160001281AD94B68154A934207D0990785
:107B700011D114491C688C420DD11C001D00022833
:107B80000CD0BB68934209D09A0704D10D4A1968FA
:107B90001C00914202D0002005F0DCFD01A93868EC
:107BA000F9F72EFE019A0100002310201DF0FAFFC4
:107BB0002A003100230005F0C1FBFEBD7C2E002011
:107BC000E4B3020074C20200F0B58BB006000800F6
:107BD00011001A0010AB1F78314B05AD01950093D1
:107BE00005230AF099FB912000011EF062FB2D4B4A
:107BF00004A91860059B476043706B682A4F0370A7
:107C0000AB6804008370EB68C3702B7C30003B6072
:107C1000F9F7F6FD0025254B03900C201D601EF0A2
:107C200048FB234B06000360FDF7CAFFB060FDF779
:107C3000C7FF204B204A1860204B11001D70204BBD
:107C400070601D701F4B30001D602B00FDF78CFE17
:107C50002000049A03991BF0EFF82000FFF73EFA8A
:107C60000400A84207D1FDF785FD0E4B1C60164BA2
:107C7000186805F0ABFB0122144B1A70FDF79AFF50
:107C80000028FBD1124B943318603B68002B04D0C2
:107C90000C4B1048196818F063FE07480BB0F0BD94
:107CA00050A40200102F0020582A00204C2A002047
:107CB0009CA40200482A0020E4B30200D02D00203A
:107CC000CE2D0020502A002004000020CF2D0020BF
:107CD0007C2E0020AA0D030000220D4910B50B7860
:107CE000DBB2934210D10B4A1478002C02D001244D
:107CF0000C701370084B1B78002B07D0074A1368D1
:107D000020331360064B1A68100010BD8268FBE731
:107D1000CE2D0020CF2D0020D02D00204C2A002079
:107D2000482A002073B501A9F9F76AFD019B0600F6
:107D30001748502B17D8802040001EF0BAFA154C77
:107D400005002300943318600023019A9A420CD155
:107D50005B232800AB540AF0C5FF2B00002808D194
:107D6000943420600C4805F031FBF15CE954013398
:107D7000ECE75A1B0133591E09789B29F9D12900D8
:107D800006481AF00DFB00239434236076BDC046EC
:107D9000B90D03007C2E0020C70D03000C9A0200D1
:107DA000D2235B005843134AF0B51368000C83429A
:107DB00006D9114C2368013323601368203B1360FC
:107DC0001F23050001270D4E9D431468A5420BD8C3
:107DD00003401A1D202A00D92022094C246893420E
:107DE00004D3084B1860F0BD3770EEE7E518297131
:107DF0000133F4E74C2A0020502A0020D02D002027
:107E0000482A0020542A002070B506000D000028E2
:107E100014DD002907DD154812F014F80124B042E2
:107E200009DB002407E00100C020000612F00AF878
:107E30000124A842F5DDE4B2200070BD002907DD71
:107E4000C020000611F0FEFF0124B042F3DCE8E799
:107E50000024A042F0D00100044811F0F3FF0123F8
:107E6000A84200DC231CDCB2E6E7C046FFFFFF3F70
:107E700070B504000D0010491EF00BFF6968012267
:107E80002000FAF72BFD0D4E200031001EF001FFFF
:107E9000A96801222000FAF721FD310020001EF020
:107EA000F8FEE96801222000FAF718FD04492000D5
:107EB0001EF0EFFE70BDC046DD0D030045FC020064
:107EC000A002030070B5060010200D0014001EF083
:107ED000F0F9034B466085600360C46070BDC04626
:107EE000E8A4020010B5FAF72DFE054912F07AFD5C
:107EF0000323020002209A43024B1043C01810BD16
:107F0000E02E65420000808010B5FAF71BFE05499F
:107F100012F068FD0323020002209A43024B104333
:107F2000C01810BD35FA8E3C0000808010B5FAF7FD
:107F300009FE011C13F04CF8024B002800D1024B43
:107F4000180010BDCCE70200C4E7020010B5FAF734
:107F5000F9FD440064080849201C13F039F8002892
:107F600005D10549201C12F0BDF8002801D00348B6
:107F700010BD0348FCE7C046FFFF7F7FC4E7020057
:107F8000CCE7020010B5FAF7DDFD034B03400220F9
:107F90001843024BC01810BDFCFFFF7F000080801B
:107FA00010B5FAF7CFFD440064080849201C13F00F
:107FB0000FF8002807D10549201C12F089F8002885
:107FC00001D1034810BD0348FCE7C046FFFF7F7F97
:107FD000CCE70200C4E702001FB500230193FAF7C3
:107FE000B1FD01A915F03CF90322030002209343DF
:107FF000064903435B180293019B934303435B18B9
:1080000002A90393FEF736FB05B000BD0000808097
:1080100070B50D00FAF796FD041C2800FAF792FDE2
:1080200012F0ECFF0100201C15F0F6F8032302000B
:1080300002209A43014B1043C01870BD000080809D
:108040001FB500230193FAF77DFD01A915F0BAF8D9
:10805000032302249843074B2043C0180290019841
:108060001DF02EFB02A903902000FEF703FB04B0D5
:1080700010BDC0460000808070B50D00FAF762FDAB
:10808000041C2800FAF75EFD011C201C15F0B2FB51
:108090000323020002209A43014B1043C01870BD15
:1080A0000000808070B50D00FAF74CFD041C28001C
:1080B000FAF748FDC00FC3076000400818430323C8
:1080C00002249843014B2043C01870BD00008080FB
:1080D00070B50D00FAF736FD041C2800FAF732FDE2
:1080E000011C201C15F00EFB0323020002209A4302
:1080F000014B1043C01870BD0000808010B5FAF726
:1081000021FD14F075FE0323020002209A43024B66
:108110001043C01810BDC0460000808010B5FAF7AB
:1081200011FD15F09DFA0323020002209A43024B31
:108130001043C01810BDC0460000808010B5FAF78B
:1081400001FD15F03BFA0323020002209A43024B83
:108150001043C01810BDC0460000808010B5FAF76B
:10816000F1FC15F091F90323020002209A43024B1F
:108170001043C01810BDC0460000808010B5FAF74B
:10818000E1FC15F043F90323020002209A43024B5D
:108190001043C01810BDC0460000808010B5FAF72B
:1081A000D1FC14F083FF0323020002209A43024B08
:1081B0001043C01810BDC0460000808010B5FAF70B
:1081C000C1FC15F0A3FA0323020002209A43024BDC
:1081D0001043C01810BDC0460000808070B50D006F
:1081E000FAF7B0FC041C2800FAF7ACFC011C201CB8
:1081F00015F0E4FB0323020002209A43014B1043D5
:10820000C01870BD0000808010B5FAF79BFC0021FB
:10821000041C11F053FF002802D0074805F0D6F8DF
:10822000201C15F08BFD0323020002209A43034B10
:108230001043C01810BDC046F50D0300000080803B
:1082400070B5060008680D00FAF77CFC0021041CDC
:1082500011F03EFF002802D0184805F0B7F8201CA6
:1082600015F030FB041C012E06D1032302209C4391
:108270002043134BC01870BD6868FAF763FC0021F7
:10828000051C11F025FF0028E6D1FE21281C8905D8
:1082900011F00EFF002803D00A490B481CF0CAFB5E
:1082A000281C15F00FFB011C201C12F0C3F903233E
:1082B000020002209A431043DBE7C046F50D03009D
:1082C00000008080E40D030044AD0200F0B50E0014
:1082D0001100002285B0B71C03901C0030000D4B2C
:1082E0000092BF0009F0E8FF38001DF0E2FF466091
:1082F00006000500039B083F03600836E719BC42EF
:1083000002D1280005B0F0BD002101CC04F02EFC04
:1083100001C6F4E7FFFF0000F7B505002C200E00B2
:10832000170001931DF0D7FF040005708660878158
:10833000072D01D0012D0FD1337872780A3B1B0233
:108340001343E381019B20206375042363841DF0A4
:10835000B0FFA0622000FEBD014B5B5DF1E7C046AF
:10836000070E0300F7B50D00110000220600009271
:1083700028001F000B4B09F09FFF10201DF0A6FFE7
:10838000041E08D1084B094A094C5A620023266092
:108390002000A360FEBD39002800FEF76BF9E06005
:1083A000F4E7C046FFFF00007C2E002044A002003E
:1083B000942E002010B5013810C9FEF75BF9E0607B
:1083C000004810BDE4B30200F8B57F2553B20400A5
:1083D0000E0017001540002B0ADB6B1E012B07D87F
:1083E0000B6858681DF0C6FA010020001EF051FC11
:1083F000022D16D10F4920001EF04BFCF368002B14
:1084000002D05A68002A04D10B4920001EF041FC1A
:10841000F8BD012A07D1002299682000FAF75EFA18
:10842000F6E7002DEAD03A00F1682000FEF7C8F820
:10843000EEE7C046613A03003B830300C36803488C
:108440005A68002A00D098687047C046E4B302001A
:10845000136810B51400002B0BD0FC23FF33994296
:1084600006D10C4B52689A4202D10023C38023608C
:1084700010BD094B994201D1C368F8E7074B026868
:108480009A42F5D1064B9942F2D1FFF7D7FF20600F
:10849000EEE7C046E4B3020003020000DCAB0200DA
:1084A000E30200000EB470B5050087B010201DF087
:1084B0000DFF041E0BD11A4B1A4A1B4C9D6118620A
:1084C0005A62200007B070BC08BC03B018470021F6
:1084D000056081600120FEF7CDF82521E0600500F0
:1084E0000B9820F0AEFC061E09D10B9820F0C1FCC1
:1084F000320001000B98F8F72BFDA860E1E702A815
:1085000010211EF000FE0CAA0B9902A801920DF09A
:10851000D7FC02A90548E568F8F7E4FCEDE7C0469A
:108520007C2E002044A00200942E00200C9A020011
:1085300010B50300820708D1064A0168914204D1B0
:10854000054AD9680120914203D00449180003F07C
:10855000C3FB10BD58B80200658300001CA80200D0
:1085600010B50400FAF7A2F9034BC2689A4200D092
:1085700024690023A36010BD65830000F8B51600D0
:108580001D0004000F00FAF791F9154BC2689A42DA
:1085900000D02469A068002811D10C301DF096FE8F
:1085A000A06000280AD003236360E288A1689300DA
:1085B000CB180332E2801F605E609D60F8BDE388E7
:1085C000A18802338B42F0DB0331890001221DF0C8
:1085D0009BFE0028F2D0A388A0600333A380E4E7C9
:1085E0006583000070B5150004000E00FAF75EF90F
:1085F000064BC2689A4200D02469A368002B02D1BE
:1086000033602B6070BDE2883260FAE7658300005A
:10861000F8B5050010200C001F0016001DF049FEE3
:10862000054B44608460A4190760C4606B60034B11
:108630002860AB60F8BDC046593202006F320200BC
:1086400000237F2803D8034B1B5C9B07DB0F18001C
:108650007047C0460E0E030000237F2803D8034B4B
:108660001B5C1B07DB0F18007047C0460E0E030093
:1086700000237F2803D8034B1B5C5B07DB0F18002C
:108680007047C0460E0E030000237F2803D8034B1B
:108690001B5C5B06DB0F18007047C0460E0E030024
:1086A00000227F2808D8054B0132195C0C2319429F
:1086B00002D15F3842424241100070470E0E030063
:1086C00000237F2803D8034B1B5CDB06DB0F18005D
:1086D0007047C0460E0E030000237F2803D8034BCB
:1086E0001B5C9B06DB0F18007047C0460E0E030094
:1086F00070B50400FAF7DAF800230C49DA005218D2
:108700001568A54205D1516809481EF0C2FA01203A
:1087100070BD0133612BF1D1064B9C4203D09842CE
:1087200001D00020F4E70449EEE7C04680AD020026
:1087300084E8020088E902008E0E0300FF23032272
:10874000DB05CB1810B59343042804D811F0DCFAEC
:1087500006030F0416000021080010BD0021181C9C
:1087600011F0A6FC0A490028F6D00A49F4E7181CC3
:1087700012F044FC012140000143EDE7802109068D
:108780005B18022193431943034BC918E4E7C04621
:10879000CCE70200C4E7020000008080FF23DB0575
:1087A00010B50400C81803239843002386B0019332
:1087B000063300931022613302A903F00BFB02A9D8
:1087C00020001EF066FA2E2102A820F03AFB0028B5
:1087D0000FD1652102A820F034FB002809D16E21B9
:1087E00002A820F02EFB002803D1034920001EF030
:1087F00050FA06B010BDC046C404030030B50C00EA
:108800001100002285B01D0000920123200009F014
:1088100053FD002C23D02868124B0340062B06D0B2
:10882000032420420ED1104B02689A420AD103A9B8
:10883000F8F7E6FF0022039900921300F9F70AFF08
:1088400005B030BD03002340022BF9D0FAF77AF9C6
:1088500003000220A3431843044BC018F0E7044868
:10886000EEE7C046070080FF0C9A020000008080FF
:1088700002008080F0B5050087B010000191FAF782
:1088800061F9041C0390681F182800D9BDE011F09D
:108890003BFA0D121F24333E6F81BCBCBCBCBC0D27
:1088A000121F24333E6F9FA8ADB2B7000198211C60
:1088B00011F026FD03E0211C019812F0C5F901908A
:1088C00003230198524A9843013B03439B187CE0E1
:1088D000211C019812F086F8F1E70021201C11F00C
:1088E000E7FB002803D04B494B481CF0A3F803A931
:1088F00001A81AF024FDE3E70021201C11F0D8FBA9
:108900000028F0D1211C019811F094FED7E7002136
:10891000201C11F0CDFB0028E5D1211C019814F09A
:1089200069FF0021041C019011F0C2FB002807D050
:10893000039A0023002A01DA80231B060193BFE774
:108940000021201C039E012711F0B8FB002800D154
:10895000071C0021301C012511F0B0FB002800D1BC
:10896000051CFFB2EDB2AF42AAD0311C201C9FE71C
:10897000019D0021281C11F09BFB002805D000213F
:10898000201C11F09BFB0028ADD1211C281C15F0E8
:1089900015F894E70021201C11F08AFB0028A2D1D1
:1089A00003A901A81AF0CBFC03220220019B18495D
:1089B000934303435B180493039B934303435B1864
:1089C00004A90593FDF756FE0300180007B0F0BD9B
:1089D0000199201C11F086FB104B0028F5D1104B9B
:1089E000F3E70199201C11F069FBF5E70199201CC0
:1089F00011F05EFBF0E70199201C11F07DFBEBE725
:108A00000199201C11F064FBE6E70023DDE7C04676
:108A100000008080E40D030044AD0200CCE70200BA
:108A2000C4E7020010B5040048680022043007497A
:108A300000F0A2F8064A002803D04068F8F7CAFE02
:108A40000200044920001EF0E5F910BD860F000069
:108A50003B8303009534030070B5150012680C00C9
:108A60004068002A0AD1CC0006210430214300F0DE
:108A700083F8002801D043682B6070BD03799B0701
:108A80000BD50C4B9842F8D10B4EF36D002B03D154
:108A900001201CF0B8FEF065F06D06216A68E40064
:108AA0002143002A03D11CF0F1FE0023E4E71CF06F
:108AB000E3FEFAE7649D02007C2E002070B50625D7
:108AC000C0000543012229000B4800F055F8446816
:108AD0000600002C0ED108201DF0EBFB074B040014
:108AE000036001201CF08FFE2A00606004491CF026
:108AF000C3FE7460200070BDB82E002098B1020043
:108B0000860F000010B50C000621C00001430122B1
:108B1000024800F031F8446010BDC046B82E002075
:108B200073B50625C3001D43060000222900104826
:108B300000F022F8041E18D1020029000D4800F0B0
:108B40001BF8041E12D0EA216A46FF31406803F088
:108B50008FFF009B002B08D000216A4608001BF005
:108B60002DFF61683000FFF7CDFF606876BDC0461D
:108B7000B82E0020C4B00200F0B587B00092027891
:108B800004000F00930703D5009B002B00D0F5E0F5
:108B9000D307DB0F0ED07A4B3B40062B43D0032389
:108BA0003B4003D177493868884203D0009B012BB2
:108BB00000D0E3E0019353075FD52368A568DE0882
:108BC000F600AE19B54230D3009B012B00D0D5E0A2
:108BD0002368D9086368994210D104316160A068A4
:108BE000C9001DF084FB23686268DB08D21ADB0031
:108BF000A060D200C018002120F0E7F80721236808
:108C0000DD086A1CD2000B4013432360A368ED000B
:108C10005D195B4B2F601F40062F21D00122237866
:108C2000934323701CE00123C4E72868B8421AD19B
:108C3000009B022B14D129002368721BD210083B21
:108C4000013A6F6828002360D200083120F0AAF8AA
:108C50002368DD08A368ED005D1900236F602B60B9
:108C6000280007B0F0BD019B002B04D13900F9F7B3
:108C7000B3FE0028DCD10835A4E76368002B05D1DA
:108C8000009B012B7AD1200000F07EF83C4B3B404A
:108C90000593062B27D1F8081CF062FE039061684B
:108CA000039811F0CBF800260491049B0293029BD9
:108CB000DD00A3685D19286800281BD1009B012BEB
:108CC0005CD107212368DA080132D2000B4013433C
:108CD0002360002E00D0350000236B60059B2F60C1
:108CE000062B9BD1BCE73900022003F0D7FD4310CF
:108CF0000393D4E7042803D1002E1DD12E001BE0DE
:108D0000B84211D1009B022BAAD123680298083BDC
:108D100023600130616811F091F8A368C900CB5855
:108D2000002B25D12B609BE7019B002B04D1390040
:108D3000F9F752FE0028E5D102986168013011F080
:108D40007DF8049B02918B42B1D1009B012B15D180
:108D5000002E0FD023683500083323600023736092
:108D6000059B3760062B00D17AE72378009A57E7F6
:108D70000423D7E7200000F007F890E700256FE70D
:108D8000070080FF0C9A0200F7B5436804000193C6
:108D90005A1C002317495800455AAA4206D90133E4
:108DA000222BF8D15508AD18213B1D43E800A768D8
:108DB0001DF091FA07232268656013400122002507
:108DC000236013432370A060019B9D4203D13800B0
:108DD0001DF09EFAF7BDEE00B959002908D004290C
:108DE00006D001222000FFF7C7FEBE19736843605A
:108DF0000135E9E7B0F60200F8B505000023046884
:108E000086681449621C5800405A824206D90133D0
:108E1000222BF8D15008821801201043002328602B
:108E20006B6080001DF057FA3700A400A860A419F9
:108E3000A74203D130001DF06BFAF8BD3968002954
:108E400005D0042903D0012228001AF02BFB043797
:108E5000EEE7C046B0F602000379044AD35C002B6B
:108E600000D183790248DB00C0187047D12D002063
:108E7000E0B1020010B50400FFF7EEFF22790368AD
:108E800002490348FFF70EFB03F028FCA33403005C
:108E900008AD0200002803D001210379014AD15412
:108EA0007047C046D12D002010B5FFF7D5FF034B0A
:108EB0004068C01A431E9841C0B210BD758E0000B4
:108EC00070B506000C00FFF7C7FF0C4D2B002833D0
:108ED000984204D12A001032002394420BD0002380
:108EE000A04208D0436830009847641B3379044A95
:108EF000E410D4540123180070BDC046E0B1020054
:108F0000D12D0020F0B589B0002807D1664B674805
:108F100019681DF0BEFE664809B0F0BD0D68654BCE
:108F20009D425BD1002108001DF09AFD0024050040
:108F30000590614B5A680192944217D300255F4A0D
:108F400005A901200BF0A8F907AA06A905981DF0AC
:108F50009EFD069B03339B0801939B000393019B9B
:108F6000524EAB4210D156493000D2E79B68019374
:108F7000019AE3009958002904D0042902D028005E
:108F80000BF02AF90134D4E72F00AB000293079BC2
:108F9000029A9858F8F71EFC010030001DF079FE87
:108FA000019BFF18069B9F4212D212231C1A002C11
:108FB00007DD013C07D2039A029B94466344029367
:108FC000E5E71234F3E73F4930001DF062FEF0E7B9
:108FD0003D4930001DF05DFE0135C0E72800F9F77E
:108FE00065FC3A4B42689A4200D16D682800FFF751
:108FF0007FFB061E00D08EE72C4C354920001DF06B
:1090000048FE31002800F9F783FC280019F00FFB17
:109010003049020020001DF0FDFEAB0732D12B6865
:109020002D4A93422BD128001AF000FA1CF039FC8B
:1090300000250600A84200D16DE773689D4200D369
:1090400069E7B268EB00D3181F68002F15D05B6882
:109050002249200001931DF01CFE00213800F9F781
:1090600057FC1F4920001DF014FE00210198F9F75C
:109070004FFC154920001DF00CFE0135DDE7194AB3
:10908000934203D02800F9F711FC0500A86B0028D3
:1090900000D140E7830700D03DE7134B02689A42B6
:1090A00000D038E7C2E7C0460800002084E802008C
:1090B000E4B3020046140000C4B00200D4B10200C0
:1090C000B5340300DE6F0300654F03000D0200009E
:1090D000D9340300E134030098B10200DD6F0300CE
:1090E000F134030058B8020074C20200002803D013
:1090F000012807D0002004E08B680448002B00D131
:10910000034870478B685B001843FAE7CCE702001E
:10911000C4E70200034B48600B60002308008B602B
:10912000CB60704798B202007FB5040001220800AE
:1091300001A9F9F75DFE0022217940200BF0E6FA43
:1091400001000500029810F0F3FD636806001A0A9A
:10915000824218D2A368C1186943E0681DF0C7F8BD
:109160006368E060DBB22A00A06863606843E3687C
:109170007243181801991FF00CFEA36804489E1949
:10918000A66004B070BD121A1202DBB21343EAE704
:10919000E4B30200F7B5FF27456804000191BD4321
:1091A0001DD101792A0040200BF0B0FA6368060057
:1091B0003B408027A1683F011F430831414367605E
:1091C000E0681DF094F86368E0601A0AA368013A49
:1091D000013372435E43290080191FF0F6FD2079A8
:1091E000019BA268E1680BF031FCA36803480133DE
:1091F000A3606368013BFF3B6360FEBDE4B3020014
:10920000F8B5002207000D00010040200BF07EFAA7
:10921000060010201DF04DF8084B0400012F00D06F
:10922000074B2800277123606368A560DBB2704399
:1092300063601DF03EF8E0602000F8BD30B302002E
:10924000F4B2020070B506008AB00C0015001228B6
:109250005CD003D8052826D0002454E01B2800D178
:109260006CE01F28F8D1012207A9280019F0F6F9AF
:10927000032300284FD01C4213D13B4B22689A4253
:109280000FD1012204A920001AF0B8F90123079A8E
:1092900000930599089B049819F063F8334C002853
:1092A00031D1334C2FE0012204A920001AF0A6F995
:1092B0002800012207A9F9F79BFD069B00220393D2
:1092C0006B464020197B0BF021FA0100060008983C
:1092D00010F02EFD069BA16803936B464118050014
:1092E000187BFFF78DFF059B04001A000499C068E6
:1092F00003931FF04EFD2A000598E3687243181887
:1093000007991FF046FD20000AB070BD1100200033
:10931000FFF70AFFF7E7EA070DD41D4203D1154B0B
:109320002A689A4207D003232B40022BB9D1124B53
:109330001D40062DB5D0114804F03AFA012204A9C7
:1093400020001AF05BF9012207A9280019F086F91C
:109350000028A6D0089B059A00930499079B30002B
:109360001CF07DFC9AE7C04630B30200CCE7020057
:10937000C4E702002CB90200070080FF3B83030012
:10938000F0B5050087B00E00012808D08B0726D164
:109390000B68264A934202D0254A93421FD10122EC
:1093A00003A9300019F05AF9002818D0002229002A
:1093B00040200BF0ABF901000700049810F0B8FC56
:1093C000060001002800FFF71BFF320004007A436B
:1093D0000399C0681FF0DDFC200007B0F0BD30002D
:1093E000F9F766FC071E00D0471039002800FFF788
:1093F00007FF00210400300003F0B8FB00260090B6
:10940000009803F015FC031EE6D0002F04D11900CC
:109410002000FFF7BFFEF3E7721C0192E168320003
:1094200028000BF013FB019EEAE7C046A092020061
:1094300030B3020070B50E7904000D00012E0DD17D
:1094400019491DF026FC3300AA68E9682000F7F7E7
:10945000E5FC164920001DF01CFC70BD32001449CB
:109460001DF0D8FCAB68002BF3D0124920001DF092
:1094700010FC0026AB68B34204D80F4920001DF051
:1094800008FCE6E7002E03D00C4920001DF001FC8B
:109490003200E96828790BF0A1F9012201002000CF
:1094A000F9F71CFA0136E5E7F6340300A0020300E1
:1094B000023503000D3503001D06030045FC0200C4
:1094C00070B5050086B0161E44D0032480680C4099
:1094D0002BD1214B0A689A4227D103AA08F0C4F97C
:1094E000002802D11D4804F063F9042E1AD122008D
:1094F000297940200BF00AF9049B06000093039B96
:1095000028790193019A009B991AFFF779FE039934
:10951000049A0400521A71437243EE68C0687118CD
:109520001FF037FC200006B070BD0A0000230100C8
:109530002868F9F77BFB02002879042E04D1E9683A
:109540000BF04CF90400EDE73300E9680BF07EFA0C
:10955000034CE7E71400E5E7E8A40200A6FC0200DC
:10956000E4B3020037B50C00110000221D00009288
:109570000123200008F0A0FE002C05D121000120CD
:10958000FFF73EFE040016E02968CB0705D48B07E1
:1095900013D10C4B0A689A420FD10800F9F76EFA02
:1095A000010005000120FFF72BFE2A000400002126
:1095B000C0681FF00AFC20003EBD0120FFF7E0FE5E
:1095C000E0E7C0462CB9020037B50400A06803F0FC
:1095D0002FFB019000280ED06568074B9D4205D0F7
:1095E00001AB00220121280003F0CAF9F9F784FB3E
:1095F0000028EBD001983EBDE4B3020030B58DB039
:109600000500684603F044F8011E10D12A1D012010
:109610001BF0D4F90122EB6804005B1001335B00FE
:109620001343EB6003F052F820000DB030BD0198F9
:10963000054A0368934205D0044A00249342F3D0BC
:1096400003F04CF80024EFE7DCAB020084A9020031
:10965000044B0B6003684B60436808008B60012378
:10966000CB607047A8B3020010B502491DF011FB92
:1096700010BDC0461135030010B50400034B036054
:1096800040301DF02FFE200010BDC04624B6020061
:1096900010B50F4C20001FF027F8002808D020003C
:1096A0001EF0F4FF0B4B1B68984202D1FAF7C4FC82
:1096B00010BD3F21084A138801330B400749098830
:1096C0008B42F5D01188064C13806054F0E7C046F9
:1096D0005C2A0020782E0020BC2D0020BE2D00200A
:1096E000F12D0020002210B5044B05491A80054BCE
:1096F00005481A801EF0FDFF10BDC046BC2D00209D
:1097000091960000BE2D00205C2A0020034B188893
:10971000034B1B88C01A431E98417047BE2D002082
:10972000BC2D0020084A094B10881988884201D1B5
:1097300030BFF9E713880649C85C3F21138801331D
:109740000B4013807047C046BE2D0020BC2D00206A
:10975000F12D002070B504004518AC4205D02178E9
:1097600002481EF097FF0134F7E770BD5C2A002025
:1097700070B504004518AC420DD02378064E0A2B74
:1097800003D10D2130001EF085FF217830001EF03E
:1097900081FF0134EFE770BD5C2A002070B5040042
:1097A0000825002C08D02100082C00D929000348E6
:1097B000641AFFF7CFFFF4E770BDC0461F35030002
:1097C00070B5050004000826002C08D02100082CE4
:1097D00000D931000448641AFFF7BCFFF4E7280001
:1097E000FFF7DCFF70BDC0461635030010B5010061
:1097F00001481BF04DFE10BD1C000020142313B5C2
:10980000064C00931922182120000DF069FF044A2C
:10981000044920001FF04CFA13BDC0465C2A00200A
:10982000000000207996000010B5024B672219F065
:10983000F2FF10BD3541020010B5024B972219F01E
:10984000EAFF10BD59AA0000F7B50F0011001A0079
:10985000C38A8579868A019300230400837143615A
:109860000F4B19F0D8FFA368002B17D1E18A00290C
:1098700008D0A38A002B05D1206B1BF09FFC206B26
:109880001BF01CFBA38AE28A3900200019F074FF48
:109890006B1E9D41019BA571A682E382F7BDC04668
:1098A00075A6000010B54379C26A012B03D11000E0
:1098B00019F08EFB10BD0B00006B024919F0B2FBD2
:1098C000F8E7C0462CBD02007FB50B7804000D0000
:1098D0004E1C002B0AD0032B0BD103A928001CF02F
:1098E00050FB03990600206B1BF07FFA300004B098
:1098F00070BD012B07D18E1C49780429F6D0006B6E
:1099000005F0F0F9F2E7042B0BD14B788978006B66
:10991000090219431BF0B1FA28001CF06DFB060088
:10992000E4E7052B15D14379042B04D02649006BBD
:109930001BF0AFFAF0E788784B780002184303A9D0
:109940001CF01DF80399246BF7F71AFB01002000A7
:10995000EEE71A000A3A0F2A09D803A9280019F0DD
:10996000DFFE039906002000FFF79CFFBEE7082BEF
:109970000CD103A928001CF0FAFA039B226A9B0071
:1099800006009958206B1BF084FAAFE703AB02AADC
:1099900001A928001CF061FB05000299206B05F06D
:1099A00055F9019B094A9B009B582900039A200006
:1099B0009847A368002B04D0E368002B01D1029BD9
:1099C000E360039E92E7C046E4B302002CB60200B7
:1099D000F7B506000192FFF777FF04270500019B0A
:1099E0009D4200D1F7BDA91C30006C78FFF76CFFD9
:1099F0002F3CE4B205003900082C01D8024B195D58
:109A0000306B1BF0B9FBEAE72835030010B543794A
:109A1000C26A012B03D1100019F0EBFA10BD0B0044
:109A2000006B024919F0FEFAF8E7C0463CBD02009F
:109A300010B54379C26A012B03D1100019F0D9FA8D
:109A400010BD0B00006B024919F0ECFAF8E7C046B4
:109A50001CBD0200836870B504000D00002B09D105
:109A60001100054819F0DEFBA060200029000C3031
:109A70001AF0F3F870BDC04618AC020010B5024AE7
:109A8000FFF7E8FF10BDC04670380300F0B50400D2
:109A90000D00E162002162712B7891B005920161A5
:109AA0009F4A072B3BD1059B012B06D00200836BFD
:109AB00008321B680599406B9847AB6818000893FB
:109AC0001CF09AFA63790890032B0FD10D90402176
:109AD0000DA81CF0AAFAA36B02009B680D99606B9D
:109AE0009847A368E882002B00D0D4E008981CF0C7
:109AF00083FA08900378002B4FD00A3B0F2B47D8EE
:109B00000DA919F00DFE95220D9B9200934244D0B1
:109B10000AD80125483A93420DD0824A089920007C
:109B2000FFF798FF11B0F0BD7F4A934202D07F4A01
:109B30000325F0E7002508981CF05EFA182108902C
:109B400008A81CF072FA089B07900693069B079AD8
:109B5000934224D16379012B15D9A36B29005B684B
:109B6000606B98476379042B0DD10023E06A03955D
:109B70000293C18A626B0191009393680521D268B8
:109B80000069FAF777FAA368002B00D083E0C9E7F1
:109B90000100674A2000FFF75DFF0225CBE7069B27
:109BA00008931B78222B04D106981CF025FA069006
:109BB000CCE71F2B01D05F4AB0E709A906981CF03B
:109BC00025FA03780600432BF5D11CF015FA099B02
:109BD0009842F0D109A930001CF018FA0378070068
:109BE0000A3B0F2BE7D81CF007FA099B06008342BB
:109BF000E1D00378472BDED11CF0FEF9099B984297
:109C0000D9D10AA9380019F08BFD30001CF0F9F900
:109C10009F210B900BA81CF008FA01000B981CF078
:109C2000DFF99B220A9B0600920093421BD1012878
:109C300004D10B9803780A3B0F2B01D93E4A6DE7FC
:109C40002669731C2361059B012B21D00DA919F0F6
:109C500067FDA36B0D9ADB683100606B98470028A5
:109C600016D1364A5AE7364A93421AD1012803D10F
:109C70000B980378032B01D0324A4FE7059B012B49
:109C800006D0666B1CF08CF9010030001CF0B8FAAD
:109C9000A368002B88D0200008990C3019F0DDFF54
:109CA00040E789229200934222D1012803D90B98E0
:109CB0000378032B01D0244A30E7059B012BE7D022
:109CC0000CA91CF05EF901270B900B980378032B6D
:109CD00001D01E4A22E70DA91CF053F901370B9061
:109CE0000D9A0C99606B1CF092FABE42EDD1CFE751
:109CF000059B012BCCD0032800D95CE70B9B1800F7
:109D00000D931CF079F90E901CF076F9A36B0F906F
:109D10001F6932000DAB0A99606BB847B8E7C046BF
:109D2000653703008937030091020000DA02000062
:109D300096370300BE370300E1370300FD37030009
:109D4000FF0100000D380300293803004E380300DE
:109D5000F0B587B001920A000593531E9A410D0099
:109D600006000599019804921CF03AF92C1E039004
:109D700009D02B7800243A2B05D102002100306B4A
:109D80001BF08DFA2C00049B019F0293059B9F42C0
:109D90001ED1002C3BD1039A049B944663441900C6
:109DA000306B1BF070FA002D3ED1019B9F422CD0EE
:109DB000019B9C423BD120001CF023F900220100B2
:109DC000300000F039F801981CF016F90190ECE72A
:109DD0003B783A2B0CD1002C12D1049B306B5A1ECD
:109DE000039B3C00D218029BD21A19001BF057FAB1
:109DF00038001CF001F9029B070001330293C5E70C
:109E00000C4A39003000FFF725FE07B0F0BD002DE9
:109E1000CBD0AC4208D120001CF0F3F800220100A6
:109E2000300000F009F8C0E700222900F8E700221E
:109E30000199C5E79B350300F0B50B7817001A00B0
:109E40000A3A85B004000D000F2A10D803A9280093
:109E500019F066FC03992000002F01D0022F03D1D6
:109E6000FFF7D4FD05B0F0BDFFF71CFDFAE76A4A25
:109E7000192B00D8CBE01A3B2A2B00D182E005DC5D
:109E8000062B08D0292B11D0644AC0E02B2B00D11F
:109E900094E0972BF8D1002F00D0B7E003A9280059
:109EA0001CF0B4F80200039B00219BE002A92800EB
:109EB0001CF0ACF80600022F03D001002000FFF7D1
:109EC00003FD30001CF098F80299060019F01DFC03
:109ED0000028D9D13378A22B13D1300003A91CF06C
:109EE00095F8060030001CF087F8039A0190904224
:109EF00007D2022F03D031002000FFF7E5FC019EBE
:109F0000F0E73378482B21D1022F06D1206B1BF0CC
:109F100060F8206B1BF01CF80EE030001CF071F8AC
:109F200001002000FFF7D0FC206B012FF2D11BF0C5
:109F300024F8206B1AF0F4FF30001CF05DF8029951
:109F400019F0E3FB002800D08CE79DE7492B9BD15B
:109F500030001CF056F803A919F0E2FB012F07D1DD
:109F6000206B1BF000F80399206B1AF0B1FFE3E7B8
:109F7000022F02D1206B1BF015F80399206B1AF009
:109F8000DAFFD9E703A928001CF040F8039906007E
:109F900019F0BBFB002800D076E7002F36D1350042
:109FA00003A928001CF032F806001CF025F80378FD
:109FB000A92B1BD100231A00310013E0002F25D15B
:109FC00003A928001CF022F80399050019F09DFB55
:109FD000021E02D03B003A0066E72B78A62BDFD0AA
:109FE000030029002000FFF7B3FE3BE7AA2B05D1B1
:109FF00003A91CF00BF8039B0200DDE7C12B00D185
:10A0000042E71BF0F9FF320003004DE7044A290044
:10A010002000FFF71FFD25E73C3503005435030002
:10A020006F350300F0B5170085B0040008000D007F
:10A030001BF0E2FF3900060019F067FB01900028D1
:10A040001FD02379002B17D0E36A1E78002E13D17E
:10A05000F6212000FF31FFF725FC29002000FFF743
:10A0600033FC330032000121206B1BF056F9206BCA
:10A070001AF08DFF05B0F0BD29002000FFF724FC89
:10A08000F5E733786D2B1DD1290001222000FFF761
:10A09000D3FE30001BF0B5FF4378811C4E3BDBB292
:10A0A00018260A2B01D8234AD65C2000FFF70CFCA7
:10A0B0003100206B1BF060F8022229002000FFF71E
:10A0C000BBFED7E76E2B2ED1300003A91BF09EFFFD
:10A0D00006000700039BBB421FD101992000FFF738
:10A0E000F3FB206B1AF03FFF002229002000FFF74E
:10A0F000A3FE019BB342BDD030001BF07DFF019B4E
:10A100000500834202D0206B1AF02DFF310000229F
:10A110002000FFF791FE2E00EBE738001BF06CFFEC
:10A1200001970700D6E731002000FFF7CDFB019A29
:10A13000C3E7C04631350300F0B50B788FB00A3B5A
:10A140000400019103920F2B00D906E108001BF0D7
:10A1500053FF0378432B00D0FFE001981BF04CFF26
:10A160000BA91BF053FF037842780A3B1B021343F1
:10A17000A14A934200D0F0E01BF03EFF03780500B7
:10A18000472B00D0E9E01BF07CFF002800D0E4E082
:10A1900028001BF031FF0B9B984200D0DDE0280027
:10A1A0001BF02FFF9F210C900CA81BF03EFF0C9B77
:10A1B00007000293012302980D931BF01DFF050079
:10A1C0000C90B84200D1BDE01BF016FF0C90B842D5
:10A1D0000ED00378032B00D0BFE00DA91BF0D1FEF9
:10A1E0000D9B0C90002B00D1B7E0B84200D0B4E03A
:10A1F000029B1B784533DBB2022B00D8ADE02B78F5
:10A200004533DBB2022B00D8A7E00B9B1800059367
:10A210001BF0F2FE039B0700984200D100270D9B24
:10A2200026690493238B26830693638B0793E38B22
:10A230000893731C6383A38BE383331D23612B7803
:10A24000D91E03930B00591E8B410993039B032BCB
:10A2500003D029002000FFF737FB02992000FFF709
:10A2600033FBF11C206B1AF0C9FEB11C206B1AF0F5
:10A2700088FD206B1AF077FE002201992000FFF77D
:10A28000DBFD05992000FFF71FFB711C206B1AF006
:10A2900078FD0499206B1AF0A8FD1221206B1AF0AA
:10A2A0006BFF206BF11C1AF06CFD039B206B032BE2
:10A2B0004CD01AF062FE206B1AF074FE049B206BE7
:10A2C0001921002B00DA1A2100251AF055FFB21CC3
:10A2D0000121206B1AF09EFE069B2383079B63835C
:10A2E000089BE383AF4218D0206B1AF050FE039B0B
:10A2F000032B02D0206B1AF04AFE39002000FFF732
:10A30000E3FA2569206B6B1C290023611AF076FEA5
:10A310000999206B01311AF07AFC3100206B1AF098
:10A3200030FD206B1AF033FE039B032B02D0206B11
:10A330001AF02DFE002F03D02900206B1AF021FD0A
:10A340000FB0F0BD2D4B029D029351E71AF00BFEAA
:10A3500029002000FFF7B8FAB0E7238B25690293A4
:10A36000638B6E1C0493E38B66830593AB1C06938F
:10A37000A38B0198E383224B2B432383EB1C2361A4
:10A380001BF03AFE01002000FFF79EFA07000121B2
:10A39000206B1AF090FE3100206B1AF0F2FCA91C21
:10A3A000206B1AF09BFE002201992000FFF744FD6C
:10A3B00039002000FFF788FA0700206B1AF022FC12
:10A3C000002803D13100206B1AF018FEA91C206B65
:10A3D0001AF0D7FC206B1AF08DFE029B2383049B9E
:10A3E0006383059BE383039BBB42A5D03900200018
:10A3F000FFF76AFAA0E7C046A20200001A6D030048
:10A400000080FFFFF0B589B005000591049200932C
:10A410000191002904D09F2105A81BF006FE0190A0
:10A4200000231E001F00059C03930293019BA3427F
:10A430001AD1002E0DD0029B002B00D079E0286BA2
:10A440001AF03CFD039B002B00D077E0286B1AF03C
:10A4500035FD049B286B002B00D174E033003A00DB
:10A4600000991AF063FF0AE02378BB2B14D1BA3BA2
:10A470001E4206D0374A21002800FFF7EBFA09B048
:10A48000F0BD012320001E431BF0BBFD0290200005
:10A490001BF0B2FD0400C9E7BC2B0BD1BA3B1E4236
:10A4A00001D02D4AE7E7022320001E431BF0A9FD3F
:10A4B0000390ECE7BD2B2AD120001BF0A2FD040085
:10A4C0001BF09AFD0378C12B0BD128000622210036
:10A4D00019F031FA009B2000013300931BF08CFD32
:10A4E000D6E723780A3B0F2B01D91C4AC3E707A9FB
:10A4F000200019F015F904000799286B1AF0BDFC2B
:10A5000021002800FFF7E0F9013704008EE7002E54
:10A5100001D0134AAFE7002F01D0124AABE7210068
:10A520002800FFF7D1F9009B0400013300933E009F
:10A530007CE702992800FFF7C7F983E70399280011
:10A54000FFF7C2F985E733003A0000991AF0E5FEFB
:10A5500095E7C0468D380300A4380300BC380300DB
:10A56000DD380300F8380300F0B589B0040003912A
:10A5700003A83D211BF059FD0027E36A02905E7D90
:10A580000398029B984215D118001BF03AFD029BDC
:10A5900003901B780100320020001D2B59D119F0C7
:10A5A00075F90500013F57D229002000FFF72EFA68
:10A5B00009B0F0BD05A91BF029FD6821039003A88F
:10A5C0001BF033FD06A90500039819F0A9F896239E
:10A5D000069AFF3301909A4213D003992000FFF7A7
:10A5E00073F9013703900398A84229D105992800EF
:10A5F00019F08BF800280CD129002000FFF764F92E
:10A6000007E0019B9D4207D8174A00212000FFF771
:10A6100021FA059B0393B3E701981BF0EDFC8542FB
:10A62000F2D107A9019819F07BF8079B0F4A9342D2
:10A6300004D00F4A9342E7D10426EAE70126E8E76F
:10A6400007A919F06DF807990390206B1AF040FCE8
:10A65000C9E719F065FBA4E7002301211A00206B6C
:10A660001AF05BFE9EE7C04654360300110200005C
:10A6700006020000F7B50A780E00130008215D3BC2
:10A680008B43DBB20400002B02D101338371F7BD91
:10A6900013005E3B8B43DBB2002BF8D013000A3B68
:10A6A0000F2B2FD95C2A11D101A930001BF0AEFC71
:10A6B00007001BF0A1FC019B834205D01BF09CFC12
:10A6C000019B0500834208D1002506E030001BF005
:10A6D00098FC07001BF090FC050001A9380019F058
:10A6E0001FF8A379002D02D02A78002A0CD1002B64
:10A6F000CDD1E38A002BCAD0184A31002000FFF7E1
:10A70000A9F9C4E73700DFE7002B1ED0A38A013385
:10A710009BB2A382012B09D1E18A206B002911D0C1
:10A720001AF04CFD0021206B1AF062FD2900200078
:10A73000FFF7CAF8206B01991AF09FFB206B1AF003
:10A7400063FDA4E71AF0BAFBECE7E38A29000133C2
:10A75000E3822000FFF7B8F899E7C046723603009D
:10A76000F0B504000E00056987B002936B1C0393DB
:10A77000AB1C03612900006B17001AF079FC200064
:10A7800018F0D6FF31002000FFF79EF8206B1AF07A
:10A79000B7FC691C206B1AF031FC2900206B1AF001
:10A7A000F0FA206B1AF006FE2669731C2361029BE7
:10A7B0009F4218D1A38B206B013BA3831AF070FC3E
:10A7C000206B1AF0FCFD0399206B1AF0DAFA0C9B4F
:10A7D000002B03D019002000FFF776F83100206B22
:10A7E0001AF0CFFA1BE038001BF00BFC0023059396
:10A7F000236905000193013323610378002B10D1F5
:10A800001BF0FAFB1BF0F8FB029B984224D03C4A59
:10A8100029002000FFF71EF9A38B013BA38307B09B
:10A82000F0BD07008B2B07D11BF0EBFB07001BF0E3
:10A83000E3FB05A918F074FF206B1AF094FB3900B4
:10A840002000FFF741F82121206B1AF095FC019AB6
:10A850000021206B1AF0DEFB28001BF0CDFB0599D0
:10A860000700002948D1206B1AF091FB0025059BB9
:10A87000AB4209D02569206B6B1C236129001AF0BB
:10A8800003FC200018F054FF39002000FFF71CF8EB
:10A89000059B0700002B02D0206B1AF031FC206BC7
:10A8A0001AF053FC059B002B19D00E21206B04F0ED
:10A8B00019FA2900206B1AF064FA0E21206B04F0BB
:10A8C00011FA05992000FFF7A1F820000599FFF77C
:10A8D000AFF8A38B206B013BA3831AF0E1FB31009F
:10A8E000206B1AF08BFB0199206B1AF04AFA0121B8
:10A8F000206B1AF08CF95AE72000FFF787F8B5E7CC
:10A900001A390300F0B587B0039143790400012B95
:10A9100007D1C36A0D001B78002B04D1194AFFF739
:10A9200099F807B0F0BD692103A81BF07EFB0290E7
:10A930000398029B9842F4D005A90B2718F0F0FE6B
:10A94000059B0390019302ABFF183A000199E06A5E
:10A9500018F0FEFB3B780600002B0DD0019A010099
:10A96000E06A18F020FC3378074A002BE0D1290078
:10A970002000FFF76FF8DBE70378042BD8D0034AF9
:10A98000F5E7C046BF360300E43603000237030094
:10A99000F0B587B0039144790500012C09D10191EC
:10A9A00003A869211BF041FB02900398029B984287
:10A9B00001D107B0F0BD05A90B2718F0B1FE02AB1D
:10A9C000059EFF1803903A003100E86A18F0C0FBBA
:10A9D0003B78002B08D10378012B05D0074A019959
:10A9E0002800FFF737F8E0E704703100E86A18F054
:10A9F000D1FB0028D9D00470D7E7C046A0360300A9
:10AA000010B5084B428B04009A4202D1064AFFF768
:10AA100021F8A28BE38B618BD21A206B04F088F9AA
:10AA200010BDC046FFFF00003C36030010B5084BC8
:10AA3000028B04009A4202D1064AFFF70BF8A28B60
:10AA4000E38B218BD21A206B04F072F910BDC04643
:10AA5000FFFF000027360300F7B50B7804001A004B
:10AA60000A3A0E000F2A08D801A9300018F058FE43
:10AA700001992000FEF7DCFFF7BD432B44D1694666
:10AA800030001BF0C3FA01002000FEF71DFF037821
:10AA90000500A22B10D101A91BF0B8FA050028006F
:10AAA0001BF0AAFA019B0700834205D02900200071
:10AAB000FEF70AFF3D00F2E72B78482B16D128005D
:10AAC0001BF09FFA01002000FEF7FEFE0500206B40
:10AAD0001AF089FA0099280018F017FE0028CBD147
:10AAE000214A31002000FEF7B5FFC5E7492BF7D119
:10AAF00028001BF086FA01A918F012FE0199050042
:10AB0000206B1AF059FAE5E7442BE9D108001BF055
:10AB1000B8FA0028E4D130001BF073FA06001BF0ED
:10AB200070FA050001002000FFF796FF28001BF0D7
:10AB300063FA0378A92B9FD0AA2B0ED101A91BF091
:10AB400065FA019B0500834296D020002900FFF79B
:10AB500083FF28001BF050FAF3E7C12BC0D001009F
:10AB60002000FFF779FF87E7B5350300F7B5022628
:10AB70000D00C16A0400097D314005D0344A290026
:10AB80002000FEF767FFF7BD0191297808000A3819
:10AB90000F281DD8280001A918F0C2FDA279E36A88
:10ABA000002A03D01A8B01321A8302E0DA8A0132BA
:10ABB000DA82012601990029E5D06B46DF1C3A00B4
:10ABC000E06A18F0C5FA3B78002B3CD1214AD6E761
:10ABD0001A32914204D128001BF013FA01A9DBE7D5
:10ABE0001A33994223D1A379002BC7D1012728001A
:10ABF000A7711BF046FA03260028DBD128001BF0C2
:10AC000000FA0278E36A0A3A0F2A09D828001A7D66
:10AC100017431F751BF0F5F901A918F081FDC9E76D
:10AC20001A7D280017431F751BF0EBF9F2E7280087
:10AC30001BF0E7F901A918F073FDE36A1A7D1643CA
:10AC40001E750526B6E70223467003709BE7C046D3
:10AC50003D3703004C370300C36A70B51B7804000E
:10AC60000D00072B04D00C4A0021FEF7F3FE70BD47
:10AC70001100280018F049FD002807D00E21206B94
:10AC800004F030F8206B1AF05BFBF0E7290020009D
:10AC9000FEF71AFEF6E7C04623370300C36A70B515
:10ACA0001B7804000D00072B06D0022B04D0174A96
:10ACB0000021FEF7CFFE70BD1100280018F025FD21
:10ACC000061E07D00E21206B04F00CF8206B1AF042
:10ACD00052FBF0E72B78C42B12D128001BF091F91E
:10ACE00001002000FEF7F0FD3100206B1AF0E3F9BF
:10ACF000206B0E2103F0F6FF206B1AF04BFBDAE716
:10AD000029002000FEF7E0FDE0E7C04639390300E6
:10AD1000F0B50D0085B004001100280018F0F5FC16
:10AD2000071E05D00021206B1AF062FA05B0F0BDB5
:10AD30002B784E2B0BD1206B01211AF059FA2900E8
:10AD40002000FEF7C1FD206B1AF05EFAEEE7B32B90
:10AD500061D128001BF055F905001BF04DF9029058
:10AD60000378B62B4DD103A91BF050F9039B029039
:10AD7000984203D09D2102A81BF057F92B784E2B47
:10AD800020D103990298266B1BF02AF9411C300050
:10AD90001AF02EFA29002000FEF796FD206B1AF01B
:10ADA00033FA0127029E039B9E4210D1002FBDD192
:10ADB00031000298246B1BF013F9411C20001AF09B
:10ADC0002EFAB3E729002000FEF77EFDEAE733788C
:10ADD000310020000193FEF777FD019B0600002F54
:10ADE0000BD04E2B05D00F4A29002000FEF732FE73
:10ADF0009CE7206B1AF008FAD5E74E2BD3D10A4A0C
:10AE0000F2E72B7804224E2B00D0052229002000E7
:10AE100018F091FD8AE729002000FEF755FD012179
:10AE2000206BCCE7CD350300F0350300F0B504000E
:10AE30000D00002662711100C56206612A0087B00C
:10AE4000006B03F071FE6279012A01D1EE832E843A
:10AE5000AE683378542B0AD130001BF0D2F80100D1
:10AE60002000FEF731FD206B1AF06AFA2AE02B78F9
:10AE7000002B08D131002000FEF726FD0E21206BAB
:10AE800003F030FFEFE7072B21D130001BF0B4F8BF
:10AE900063790500012B07D100230100A371402233
:10AEA0005F4B200018F0B7FC28001BF0A5F81BF042
:10AEB000A3F801002000FEF707FD206B19F0A2FEA9
:10AEC0000028DBD0206B19F070FE07B0F0BD022B1C
:10AED00017D1012A07D100234732A3713100514B0A
:10AEE000200018F098FC30001BF086F801002000CC
:10AEF000FEF7EAFC2B7D5B07B5D5206B1AF047F80F
:10AF0000BCE7033B032B50D830001BF075F805A9B4
:10AF10001BF07CF81BF070F867790390012F09D1C2
:10AF20000B2202ABD2183900E06A18F011F90223A3
:10AF30000370EF822B78032B20D10021206B1AF0B5
:10AF40004AF92B78062B27D1206B19F0B7FF012186
:10AF50002000FEF7A7FC206B19F0B0FF206B19F062
:10AF6000ADFF0023059A009303993300200019F0E8
:10AF700096F92B78062B00D075E77FE7042B04D1D8
:10AF80000021206B1AF034F9DBE7052BD9D1002121
:10AF9000206B1AF044F9D4E720000121FEF782FC6F
:10AFA0000121206B1AF087F8DBE7012A07D1DE21A7
:10AFB00005AAFF31280018F0CBF80223037005A979
:10AFC000A86818F0ADFBF82120004900FEF76AFCE4
:10AFD000F0212000FF31FEF719FDE989206B19F0FF
:10AFE0004CFFFA2120004900FEF710FDA8681BF075
:10AFF00003F81BF001F801002000FEF765FCDE21DC
:10B000002800FF3118F094F80378022B00D135E7BF
:10B01000DE214288FF31206B19F007FE23E7C0468E
:10B02000BF3E0200B33E0200F8B5164B0400A83341
:10B030001B681600002B24D1056901226B1C0361DB
:10B040002B0019F0B2F8BE210700FF31206B19F078
:10B0500019FE3100380018F058FB061E09D13900DE
:10B060002000FEF731FC330032000121206B1AF082
:10B0700054F90121206B1AF070F92900206B19F0A6
:10B0800080FEF8BD7C2E0020F0B585B005000E00D6
:10B090000192FEF719FC03780400A22B03D101A949
:10B0A0001AF0B4FF0400EB6A1B78072B00D070E0A5
:10B0B000337872780A3B1B021343504A934268D19B
:10B0C0002378472B65D120001AF0DBFF002860D0E1
:10B0D000DE212800FF31FEF7E5FB0121EA6A936AD1
:10B0E000928C002A06D1464A21002800FEF7B2FCC5
:10B0F00005B0F0BD5878084211D059682800FEF715
:10B10000D1FB019920001AF06BFF02280ADC002312
:10B11000286B1A0002211AF000F9200036E0013AEB
:10B120000833DEE720001AF067FF0378492BEED1E1
:10B1300020001AF061FF1AF05FFF0378472BE6D179
:10B1400020001AF059FF07001AF056FF06003800D9
:10B150001AF057FF03A918F0E3FA03990122286BAC
:10B1600019F0C2FE30001AF08CFF0021884203D192
:10B1700030001AF046FF0100002301222800FFF7EB
:10B1800041F920001AF038FF1AF036FF1AF034FFA8
:10B190000400019BA342ABD020001AF02DFF019BBD
:10B1A0000600834224D02378492B21D10378472BF2
:10B1B0001ED120001AF025FF070030001AF061FFB1
:10B1C0000024A04203D130001AF01BFF040003A9A1
:10B1D000380018F0A5FA00220399286B19F084FEB4
:10B1E0002800002301222100FFF70CF93000CDE7F1
:10B1F00021002800FEF768FBCAE7C046C70200002E
:10B200000F360300F0B59BB01500069038220F00F2
:10B210000CA800211E001DF0D8FD069B0BAC5B683E
:10B220000B97236201235B421193069B26711868DA
:10B230001AF0E2FE1AF0B4FE606280001BF04BF8D8
:10B240000022A06200950025069B11001B682000CB
:10B2500018F078FA19F093FC2B0003902063049502
:10B26000626A0792954202D2A268002A41D0002B5E
:10B270005DD10593059A079B934202D00D9A002A4F
:10B2800058D00499039819F07FFC0025149A0D9B5F
:10B290000592954200D213E1002B0CD0169B0EA80C
:10B2A000996818F0DAFC169B0E9A0493DB890B99C7
:10B2B0000D98FDF763F9039819F06EFC18980028B3
:10B2C00001D017F073FC002406981AF0E4FE159BD9
:10B2D0001B681D69149B159803939C4200D219E1C9
:10B2E0001BF016F80D99002900D11BE1080001F0B0
:10B2F000F5F9A16AAA005658002E13D03269002A27
:10B3000010D117F0C6FB737D30610122310020009F
:10B31000042B09D1FEF7BAFB2369049A9A4200D2A2
:10B320000493012301359BE7FFF780FDF4E7002339
:10B330001D0095E70599159B8900CB58002B37D048
:10B340000120998C8C46197D01421BD06446601EF9
:10B35000C000002C16D00226996A09184D78354293
:10B3600029D0002A0ED00F00508816780890506817
:10B370005578099011CF11C2089A0E704A80099A27
:10B380004D704A600021DE249983FF348C451ADC1D
:10B3900000218C4535DC5E68002E09D00021B28C7E
:10B3A00009920A00099881423BDB0020824263D166
:10B3B000059B01335DE7002A02D1012D00D10A006F
:10B3C000013C0838C5E7986ACA0082181878012835
:10B3D00004D15068A04208D10131D7E7157801287F
:10B3E00003D9002D01D1012010701078022803D05C
:10B3F000012550782842EFD0988B451C9D835080C2
:10B40000EAE7986ACA0082181078032807D1012455
:10B410005078204203D1988B5080001998830131D5
:10B42000B7E7B06ACD0040190890007803380128CA
:10B4300012D800240EE09F6AE00038180778042F25
:10B4400007D1089D6F683D004768BD4201D1428029
:10B4500001320134A445EEDC0131A3E79C6AC1004E
:10B4600061180C78042C03D101254C782C4202D0B1
:10B470004C88A4184C8001308445EFDCD98A92B204
:10B480005118D982998B52189A8391E7039B022213
:10B4900021000BA81793FFF7C9FC0D9B0593002B08
:10B4A00004D1032221000BA8FFF7C0FC0D9B0593DC
:10B4B000002B2DD1042221000BA8FFF7B7FC27E0B9
:10B4C000002B00D0EAE6159B0593059AAB009C582B
:10B4D000002C1DD0637D042BD8D1189B0593002B25
:10B4E00004D10499139817F04AFB1890002317937E
:10B4F0000F4B032221000BA81993FEF7C7FA0D9BEF
:10B500000593002B04D1042221000BA8FEF7BEFAFC
:10B510000135BBE6A3001858002801D017F0FFFD45
:10B520000134D7E60A00280017F0BFFA1BB0F0BDBF
:10B5300058980200F8B5124A0E00124B1249904278
:10B540001AD0C4688C4203D0012430602000F8BDBA
:10B55000406B002812D004689C42F0D10500002402
:10B5600047680835BF00EF19BD42EFD2310001CD69
:10B57000FFF7E0FF2418F7E70024E7E70400E5E71A
:10B580004CB202004CA002007DB60000F7B50500E9
:10B590000C00AB68002B0AD0344AE168914206D017
:10B5A000E358002B03D00422EB681A60F7BDA06BB0
:10B5B000002820D06B680430D900062300221943EC
:10B5C000FDF7DAFA002816D0297C4268EB68286873
:10B5D000002904D00100002001F0F0F9E6E700287E
:10B5E00007D02249E5688D4203D021498C4200D022
:10B5F00000692100F0E72B68002B16D1646B002C4A
:10B60000D4D01C4B22681A4F9A420BD12600636893
:10B61000194A08369B189B00F3180193019B346864
:10B620009E4216D3BC42B4D1C0E72A7C002AE5D1A1
:10B630000E4AE1689142E1D00D4A9442DED0186989
:10B64000EA68696801F014FAEB681B68002BD5D032
:10B65000ACE7BC4201D10436E0E721002800FFF747
:10B6600095FFEB681B68002BF5D09FE77DB60000C7
:10B670004CB202004CA00200FFFFFF3FF0B58FB0BC
:10B680000E0005A9019202930700FFF753FF041D66
:10B69000A40020001AF00DFE0500002180C017F064
:10B6A000C7FE22002800103A103000211DF08DFB4B
:10B6B000012E05D1029B1B680393042B00D189E066
:10B6C00007AC0822002120001DF07FFBF22200239E
:10B6D00009A8FF324260E63AFF3A39008260C4604E
:10B6E00003740993FFF752FF079804282FD1059898
:10B6F000029BC468019A3100A04728612800F7F72F
:10B70000D5F8B84266D1EA220023FF32390009A8F1
:10B71000089307930B9309950A92FFF737FF079B4E
:10B72000002B57D00198304336D107AA010019F0F9
:10B7300045F90400294B9C424CD0200016F077FFBD
:10B74000274902002748FCF7ADFE00F0C7FF00289C
:10B75000D4D0019A324306D106AB0121069701F0FD
:10B760000FF90500CAE7019B5D00AD190135AD0079
:10B7700028001AF09EFD2A1F0390029980C01DF038
:10B7800008FB711C039B019A206801F0F9F8050081
:10B7900003981AF0BDFDB1E7019B5C00A4190234C7
:10B7A000A40020001AF085FD22000700079B0299E3
:10B7B00003600393089B083A436008301DF0E9FAE0
:10B7C0003A000199300019F0F9F8040038001AF035
:10B7D0009FFDAFE728000FB0F0BDC046E4B3020004
:10B7E000A339030090AC0200F0B5146889B01700CB
:10B7F000002C0ED1436803AD82686960596B0392D7
:10B80000AC60EF602C74002905D111492800FFF7C6
:10B81000BDFE09B0F0BD0F4B0A689A4210D14B68CB
:10B8200008310E000193019B9C42EED0A300F15819
:10B830002800FFF7ABFE3B68002BEAD10134F2E7AA
:10B840002800FFF7A3FE3B68002BE2D1DDE7C046EE
:10B850004CB202004CA0020010B54A6801491BF02E
:10B86000D9FA10BD9D3A0300F0B58BB005000E006B
:10B8700014000021082268461DF0A7FA00211022BA
:10B8800006A81DF0A2FA202307936B46059508939E
:10B890002968E023002C02D0042C10D1E623FF33CA
:10B8A00005A80693FFF772FE0221009F042F0ED118
:10B8B000220031002869F7F769FA0BB0F0BDFC23CC
:10B8C00005A85B000693FFF761FE0321EDE7381E34
:10B8D000F3D002AB002202950396049401F050F8D5
:10B8E000042CEAD00048E8E7E4B30200F0B5204BAE
:10B8F0008BB08200D35803AF0C0008220021060051
:10B90000380001931DF061FA019B05AD6B601423B3
:10B91000AB600023280021680594EF602B74FFF7CB
:10B9200035FE0398042805D12169300000F0B6FFE8
:10B930000BB0F0BD00280AD0210019F037F8022E14
:10B94000F6D1F7F7C7F8440001202043F0E7022EB4
:10B9500001D00020ECE7E2232168FF3328006B6070
:10B96000FFF714FE3B68002BF3D16400ECE7C04600
:10B9700094B80200F0B55642564103238BB00C0038
:10B980000190002117007642082203A81E401DF0F6
:10B990001CFA0823079303AB0893002305ADF73681
:10B9A000FF36216828002B7405940696FFF7EEFDFC
:10B9B000039B002B09D1002F07D1F733FF332168F8
:10B9C00028006B60AF60FFF7E1FD039804281AD1EF
:10B9D0002069F6F76BFF154BC2689A4211D1002F10
:10B9E00007D02368586819F0C5FF010001981BF0C3
:10B9F00050F980223A4321690198F6F76FFF0BB0A6
:10BA0000F0BD3A00F7E7002805D0210018F0CEFF7E
:10BA100000220100F0E7200016F009FE23000200DA
:10BA2000034901981BF0F6F9E9E7C0466583000079
:10BA30005239030070B504000D000B491BF029F9C1
:10BA4000696800222000F6F749FF084920001BF032
:10BA500020F9A96800222000F6F740FF04492000E1
:10BA60001BF017F970BDC0465B3A030045FC0200AD
:10BA7000A83A030010B5C468002C06D142680449F6
:10BA80000448FCF70FFD00F029FEA04710BDC0469A
:10BA9000643A030090AC0200F0B5154B89B0160073
:10BAA0008200D5580C000C220021070068461DF0CA
:10BAB0008CF9182303A84560836000256B46216834
:10BAC000C36003940574FFF761FD009B042B06D14E
:10BAD00032002169380001F081FC09B0F0BD181E68
:10BAE000FBD06A4629000120029618F067FFF4E7B0
:10BAF0000CB70200F0B51700EE228DB004000393DE
:10BB0000002307A852004260CD3A05ADFF3A0E006F
:10BB100021688260C560037405936B600794FFF72A
:10BB200035FD0598002809D1200016F080FD0C494C
:10BB300002000C48FCF7B6FC00F0D0FD039B042883
:10BB400006D13A003100206900F01AFF0DB0F0BDB7
:10BB5000009332003B00696816F072FEF6E7C046BB
:10BB60008739030090AC0200F0B50D0085B001A943
:10BB700007001600280002AA17F055F900230199C2
:10BB8000029899422CD13C201AF0A5FB2A4B019A2D
:10BB900003602A4B04008360294B4760C360294B34
:10BBA0000361294B4361294B8361294BC361294BB5
:10BBB0000362294B4362294BC362002A06D0029BD1
:10BBC0001968096B0163012A18D94563A66303A9A3
:10BBD0002000FFF7AFFC012813D9214801F0BAFD7E
:10BBE0009A008258D468002C06D152681D491E481C
:10BBF000FCF758FC00F072FD0133C2E71B68436399
:10BC0000E4E7A36B0022181D1849FCF7B5FF051ED9
:10BC10000ED0032243681A400AD11968144B4968B0
:10BC2000994205D1031D0121124818F093FD686067
:10BC3000200005B0F0BDC04658B8020075B900003C
:10BC40007DB60000F5BA0000EDB8000099BA00001A
:10BC5000C746020069B8000047480200FD470200DD
:10BC60002D3A0300043A030090AC02008E0F00004E
:10BC700045020000E0B7020037B50D001C000023AC
:10BC80001100009301220333280006F015FB012D5B
:10BC900004D0032D06D0074801F05CFD2068F6F7BC
:10BCA00005FE3EBD2068F5F775F9A2686168FFF7EB
:10BCB0005BFFF6E7813A03001FB5064B0A000193CC
:10BCC0004B6802938B68010001A8039300F002FF08
:10BCD00005B000BD1CB80200F8B50E0003271349DB
:10BCE000134AB0421CD003003B401BD104688C4275
:10BCF0001AD1406B002814D003689342F1D105009B
:10BD000044680C4B0835E418A4002C192868A54297
:10BD1000E5D23100FFF7E0FF002802D10435F5E756
:10BD20000120F8BD0020FCE71800FAE758B802002F
:10BD30004CA00200FFFFFF3FF0B585B00500019168
:10BD400008008B0717D10B68134A93420BD10123CC
:10BD5000029301AB03930024029E039FA6420DD1E0
:10BD60000E4805B0F0BD0E4A934204D103AA02A9C1
:10BD700017F059F8EFE70B4801F0ECFCA300F95875
:10BD8000094B994206D02800FFF7A6FF002801D1F1
:10BD90000134E3E70548E4E758B80200C4E70200CD
:10BDA0004CA00200CB3903004CB20200CCE70200E9
:10BDB00010B5830703D1054B02689A4202D00448AC
:10BDC00001F0C8FCFFF7B8FF10BDC04658B802002C
:10BDD00064390300F0B58BB0079310AB10CB009023
:10BDE00001911B78062A12D8012A08D93F230B702B
:10BDF0000B0001330193002301990B7001E0002A2D
:10BE0000F9D101209042804140420BB0F0BD009931
:10BE1000002929DA019B01995F1C2D230B708021D9
:10BE200009068C46009B63440093019BFF21099304
:10BE3000009BC90518000840884222D120234E21CA
:10BE4000079AF81C1A4013001143009A540212D1A9
:10BE500049225A403A70462253407970BB70002301
:10BE6000FB70019BC01AD0E7019F002BDDD0390089
:10BE700001370B70D9E74124634039707B70B9708A
:10BE8000EDE7002C00DA06240199013A7D1A551BD2
:10BE90002022079911430291672940D1002C00D13B
:10BEA000CEE1002B79D0A64A934200D9D4E0A5492F
:10BEB00000980EF021F9431E9841002300263030EF
:10BEC00003932033059004939F4B039A0099D05815
:10BED0000EF008F9002808D0049B039AF6189B4B33
:10BEE0000098D1580EF07EFD0090049B5B100493E7
:10BEF000039B04330393182BE6D115330393009A65
:10BF00008F4B93425DD38F4900980EF0F5F80028CF
:10BF100051D0002E7CD0FE239B05009351E0002BD6
:10BF2000C1D1029B662B38D1631CAB4200DBAC1E37
:10BF3000029B651C049300231E0003930593E343B7
:10BF4000DB171C40049B652B00D0EEE0651C002332
:10BF50000693069B9D424CDD00980FF04FF87B1C2A
:10BF60000893030030333B70059A069B934205D13A
:10BF7000002C03D0BB1C08932E237B700FF05EF8BF
:10BF8000011C00980EF060FE71490EF02BFD069B1F
:10BF9000009001330693089FDBE7631DAB4200DB93
:10BFA000AC1F029B652B00D1AFE0002504930395E5
:10BFB00005952E00C3E7009865490EF013FD013684
:10BFC0000090029B662B03D0672B39D1042E37DCFF
:10BFD000059B3B70029B672B01D1731EE418631C09
:10BFE000AB4200DBAC1E002C15D166230137039455
:10BFF0000493029B662B00D0B0E0012E00DDDDE053
:10C00000544900980EF078F8002800D0ACE0D5E054
:10C010002B2303937FE72E23250030227B70BB1C4C
:10C02000013E1F00002E76D0002D05D1039501237F
:10C030005B42059367334DE01A70013D0133EFE732
:10C040006B1FA3426CDC029A672A66D01300AC1FF8
:10C0500000250493059572E70023002603932033FF
:10C0600004933A4B039A0099D0580EF031F8002807
:10C0700008D0049B039AF618334B0098D1580EF061
:10C08000B1FC0090049B5B100493039B0433039367
:10C09000182BE6D12E4900980EF02EF8002805D076
:10C0A00000982D490EF09EFC01360090029B662BF5
:10C0B00012D1AE4214DAA3190133AB4204DBAC1B3C
:10C0C000023C631C00D10024002335190393013581
:10C0D00005966633049332E7029B652B00D0B1E0EE
:10C0E0006B1FA34200DCAC1F2B2300250393059597
:10C0F0003A33EFE7231DAB4200DB6C1F029BA642E5
:10C1000000DBA3E0731CE41ADEE7029B0025049326
:10C110002B2303934CE7039689E71C00029B97E7C8
:10C120000025029B059504930CE7049B672B00D028
:10C130000DE7251E00D00AE701252C0007E7C046C1
:10C14000FFFF7F3FF8FF7F3FB0B80200C8B8020092
:10C15000000020410000A040CDCCCC3D3E490098DD
:10C160000DF0CAFF002824D030217B1E1A782E2A19
:10C170004FD010003038092842D901330193019B78
:10C180001B78302B15D1019A52782E2A45D104996B
:10C19000662942D001994B70039B0A702D2B3AD12E
:10C1A000013E002E3BD03B00019A9A423AD3312304
:10C1B0001370029B672B01D1002C39D1039B002BFC
:10C1C00019D02022079B0A2113401A00452313434C
:10C1D0003B70039B30007B700DF034FE0A210DF0A4
:10C1E00017FF3031B97030000A210DF011FF3C1DEE
:10C1F0003031F970270000233B70099BF81A04E6E0
:10C20000392A02D001321A70B8E7019A19709342A4
:10C21000B5D0013BAAE70136C5E70137C3E72B23B9
:10C220000393C0E75A1E117819701300BCE71F0072
:10C230007B1E1A78302AFAD02E2ABFD11F00BDE704
:10C2400001242EE6029B672B00D153E704932B2396
:10C2500000250393FEE6C0460000A040F8B50700A5
:10C2600008680C0016F026FE05006068F6F744FD2D
:10C270000600022F0AD9A068F6F700FC0200310080
:10C28000280018F03CFB19F01BFAF8BD004AF6E74D
:10C2900040420F00F0B5486887B00F00F6F7EEFB9C
:10C2A000041E02DA002001F091F8BB68164A0193DF
:10C2B0009D186B1E9D41010002A81AF035FF049ED7
:10C2C0002200002130001CF080FD3868EDB2C30769
:10C2D0000AD433002200290019F0BFF902A90B4843
:10C2E000F4F700FE07B0F0BD43102000042C00D985
:10C2F00004200749019F00228F4200D0221AB21861
:10C3000029001AF001FCE9E75AECFFFFA0920200B5
:10C31000A6130000F0B50C0087B0012203A96068E5
:10C32000F6F766FDA3681349039A8B420DD10126E7
:10C33000049976424C1E01911419049900200D00B5
:10C34000002D05D119F0D7F90DE014000126F4E70E
:10C35000094F013DB84208D908481B18581E8341AF
:10C36000D8B219F06BF907B0F0BD27780002384356
:10C37000A419E5E7A6130000FFFF3F005AECFFFFFA
:10C3800070B546007508041C291C281C0EF020FE00
:10C3900000280BD11649281C0DF0A4FE002808D057
:10C3A0001449154816F03EFF00F098F9134801F0C3
:10C3B0000DF8002C11DA002E12D0FF23DB05E31854
:10C3C0009C22D20593420BD903F03EFA211C0500B2
:10C3D000043015F0B1FA280070BDE30DDB05EFE77E
:10C3E000201C0EF00BFE012540000543F3E7C0467C
:10C3F000FFFF7F7FBA3A030064AB0200D33A030029
:10C40000F0B50C00002585B0110020001E0000953D
:10C4100002232A0005F050FF0120AC422BD08442B9
:10C4200031D13068204226D103230340AB4203D1EF
:10C430001C4A016891421ED01B4A0240062A06D0BF
:10C44000002B0DD10268194B92699A4208D103A9B9
:10C45000F5F7D6F900231A000399F6F77FF80AE0FA
:10C46000032302001A40022A07D1FF22D2058018B6
:10C470009843FFF785FF05B0F0BDF6F7FFFA0123FB
:10C4800040001843F7E703A93068F5F7B9F904004D
:10C490007068039FF6F7F2FA2B00020039002000C3
:10C4A000DBE7C0462CB90200070080FF9D1D00009D
:10C4B000F8B51F000B4B15005918013909780DF01C
:10C4C00037FC00260400B74204D0013003210DF0F0
:10C4D0002FFC0600281E01D01CF0CBFC0334A4194D
:10C4E0002018F8BDAA3A0300F0B58DB00A9214AA3C
:10C4F000147815AA127806000F000792DA0742D5C1
:10C500005D100023002D01DA2D236D420693139A4E
:10C51000079B12992020FFF7CBFF3B6805908342D1
:10C5200004D219F0C6FE059B30603B6000213768DD
:10C53000059BFB185A1E11708D4240D00A3C09928F
:10C5400008920B94129928000DF078FC0B00303300
:10C55000092901D90B9B5B18089A541E2370079B6D
:10C56000002B48D000282DD0A7422BD2099B1B1BA3
:10C57000032B05D1079B013C2370A74222D20994CB
:10C5800005000894DEE79A0712D1244A19689142FF
:10C590000ED1079A02940392139A39000192129ACB
:10C5A00000920A9A19F020F8040020000DB0F0BDA6
:10C5B0000023326813700A9A34681360F5E79C1EF2
:10C5C00030232370139B002B05D018001CF051FC66
:10C5D000201A87421FD3069B002B04D0BC4202D9ED
:10C5E000069B013C23703368059A9B181B1B0A9A13
:10C5F000013B1360D9E7A742E4D20028C0D1E1E7AC
:10C60000C2540133139AD25C002AF9D1069B04006C
:10C61000002BE5D1E7E70023F4E7C0462CB9020080
:10C620001300144A10B50400934204D101222000E3
:10C6300000F0D4FE10BD104A934201D10322F6E768
:10C640000020072CF6D10D4A1A40062A0ED09A0770
:10C65000F0D11A680A4CA24208D00A4CA24205D076
:10C66000094CA24202D0094CA242E3D10A000720A1
:10C670001900DDE7C4E70200CCE70200070080FFF5
:10C680000C9A0200A09202004CA0020088E702006F
:10C69000C4600561466187614146C16149460162E6
:10C6A00051464162594681626946C1627146816064
:10C6B00000490847BDC600000020C046024B9A68EA
:10C6C00002609860002070477C2E0020024B9A6820
:10C6D00012689A607047C0467C2E00200E4A93680C
:10C6E000002B01D116F0AAF8196858609160181C47
:10C6F000C468056946698769C1698846016A8946CF
:10C70000416A8A46816A8B46C16A8D4681688E4637
:10C7100001207047FEE7C0467C2E002070B504F073
:10C720008DF90F4C0F4B0025A3620F4BE56263633D
:10C7300023002563A83303210C481D60A56403F082
:10C740003FFC0B4E0121300003F03AFC3000094A57
:10C75000094919F091F826606660E56570BDC0462C
:10C760007C2E0020FCA9020044A00200B42E002070
:10C77000C82E0020760F0000860F000070B506243A
:10C78000134EC3001C437368002205002100181DCE
:10C79000FCF7F2F9021E18D1F06D002807D0043022
:10C7A0002100FCF7E9F9002801D0406870BD0022A3
:10C7B00021000848FCF7E0F9021E06D12A000649CC
:10C7C0000648FBF76FFEFFF789FF5068EEE7C046AB
:10C7D0007C2E0020689D0200E63B0300B0AA020008
:10C7E0000A4B10B5040018685B6898420AD006210D
:10C7F000E300194304300022FCF7BEF9002801D001
:10C80000406810BD2000FFF7B9FFFAE77C2E00203A
:10C81000074B10B5D86D002801D1064810BD043073
:10C8200000220549FCF7A8F90028F6D04068F5E792
:10C830007C2E0020309C0200DE0E00000A00C100A9
:10C84000062010B5024B0143186819F015F810BD09
:10C850007C2E0020062110B5034BC0000143186850
:10C8600019F014F810BDC0467C2E00200A00C1004B
:10C87000062010B5024B0143586818F0FDFF10BDAB
:10C880007C2E0020062110B5034BC00001435868E0
:10C8900018F0FCFF10BDC0467C2E002037B5050007
:10C8A0000C00062806D10800F6F726FA00280DD05D
:10C8B0002C483EBDCB071BD54B10042816D80DF0D5
:10C8C00023FA03154E4E0700002BF1D02648F0E75F
:10C8D000C0221206934204D18020C00518F0F0FE59
:10C8E000E7E75B425B0001201843E2E7DB43F9E73F
:10C8F00002281AD11D4B0B40062B08D08B0714D1F0
:10C900000A681B4B92699A420FD1486802E0C80836
:10C9100019F026F8002806D101A92000F4F752FBEF
:10C92000019904F079F84300DDE72000F5F7BEFF38
:10C930004369002B0DD10F4BAD002000ED5815F0D1
:10C9400076FE2A0003000C490C48FBF7ABFDFFF70D
:10C95000C5FE2100280098470028AAD1EBE708006F
:10C96000A7E7C046C4E70200CCE70200070080FF4B
:10C970009D1D000094B80200723C030090AC0200C0
:10C98000F7B50400019116001F00F5F78FFF056948
:10C99000002D09D1200015F04AFE06490200064884
:10C9A000FBF780FDFFF79AFE3B0032000199200063
:10C9B000A847FEBD8739030090AC0200F8B50E0011
:10C9C00015001C00930714D113681E4A934202D12C
:10C9D0006B682360F8BD1C4A934207D1002802D03F
:10C9E000F5F764FF06006B6848C4F3E7174A934203
:10C9F00001D12560EEE75A68022117008F431449E0
:10CA00008F4202D013498A42F3D1002817D1124A2B
:10CA100093420BD0114A934208D0114A934205D059
:10CA2000104A934202D0104A934208D10C2019F0C8
:10CA300040FC0E4B4660036085602060CAE72560BD
:10CA40006060C7E7E0B70200A4B7020058B8020070
:10CA5000450200001A0200003CEA020078EA0200E7
:10CA6000B4EA0200F0EA02002CEB020070B9020006
:10CA7000F8B500231360536006000D001400F5F7AD
:10CA800015FFF92307005B009D4205D1836A002B47
:10CA900002D00F4B48C4F8BDFB69002B04D0220024
:10CAA000290030009847F6E7B86B0028F3D006213C
:10CAB000ED00294304301A00FCF75EF80028EAD0A4
:10CAC0004268230039003000FFF778FFE3E7C046F3
:10CAD000F89C020070B5160004000D00FFF7C8FFB7
:10CAE0003368002B15D10B4EA3070BD10A4B2268DC
:10CAF0009A4207D12B00626808493000FBF7D2FC4C
:10CB0000FFF7ECFD200015F092FD2B000200044918
:10CB1000F3E770BDE0A7020058B80200FF3B030036
:10CB2000263C030073B504000D001600F5F7BEFEA9
:10CB3000C369002B09D004220196009229006A469D
:10CB400020009847009B002B0AD0200015F06FFDB5
:10CB50002B00020003490448FBF7A4FCFFF7BEFDCD
:10CB600073BDC046263C0300E0A7020073B5040075
:10CB70000D00F5F79BFE174B426A06009A4226D03D
:10CB8000002D03D1102019F094FB0500736A002BCF
:10CB900012D1E6216A46FF312000FFF769FF009BB2
:10CBA000002B0FD1200015F042FD0B4902000B486D
:10CBB000FBF778FCFFF792FD29002000984700283A
:10CBC000E7D076BD29006846FCF742FDF9E7200072
:10CBD000F7E7C0465B260200953B030090AC0200DD
:10CBE00037B50400F5F762FE856A002D02D02000FB
:10CBF000A8473EBDF9216A4649002000FFF738FFEB
:10CC0000009B002B05D06A462900280017F0D6FEAD
:10CC1000EFE7200015F00BFD034902000348FBF786
:10CC200041FCFFF75BFDC046C73B030090AC020030
:10CC300030B505008FB003F0A3FE2800F5F736FEEF
:10CC4000846A002C05D02800A047040020000FB003
:10CC500030BDF9216A4649002800FFF709FF009B13
:10CC6000002B16D002A8FFF713FD002807D16A4653
:10CC7000010017F0A3FE0400FFF728FDE6E7039B81
:10CC800008491868FFF728F80028DFD10398FFF754
:10CC900025FD280015F0CBFC034902000348FBF7F3
:10CCA00001FCF4E7DCAB0200C73B030090AC0200E0
:10CCB000F0B513688FB00793002800D073E004002C
:10CCC000131D0393FF220B00090A13401140019327
:10CCD0004B000693069A019B05919B18039A9B00B3
:10CCE000D2580492039AD3185F68381E09D00020E6
:10CCF000BB0706D1944B3A689A4202D1380018F02B
:10CD0000B8FD059B1818049B4600002B50D1019BD1
:10CD1000581C83199800009319F0CBFA26000500DF
:10CD2000002C01D001260460019BB0009A00281855
:10CD300003991CF02EF8019B9B190293029B98000B
:10CD4000059B2818DA00019B9900039B59181CF0D9
:10CD500020F8029A069B944663440193002F12D058
:10CD600003243C4000D0A9E0774B3A689A4200D0B7
:10CD7000A4E0380018F095FD0323060000937368C3
:10CD80009C4200D27DE0019B029A02999A1A5208B5
:10CD90002B000798FFF7F4FD0400280019F0B8FAFB
:10CDA00020000FB0F0BD130008330393546889E7E7
:10CDB000049B9B072FD1049B644A1B68934202D0BB
:10CDC000634A934227D10AAA09A90498F5F7F8FE05
:10CDD000099B581C019BC01883199800009319F0F7
:10CDE00068FA26000500002C01D001260460019B92
:10CDF000B0009A00039928181BF0CBFF019B0A99F9
:10CE00009819099B80009A0028181BF0C2FF019B0B
:10CE1000099A9B1890E7019B181D831998000093AD
:10CE200019F047FA26000500002C01D00126046005
:10CE3000019BB0009A00039928181BF0AAFF019BE0
:10CE40000AA99B1904980293FFF790FE029B049095
:10CE50009C000498FFF7ECFE061E00D16EE7009BD5
:10CE6000029A934207D8D900280019F040FA050029
:10CE7000009B5B000093029B2E510133029304340C
:10CE8000E7E7B368E700D859002815D0042813D085
:10CE9000009B184205D12F4B02689A4201D115F030
:10CEA000BAFB019B019A9B00E85002320192B268E2
:10CEB000EB18D7197A685A60013460E70AAA264944
:10CEC0003800FFF707FE00210AAA080017F076FDD8
:10CED0000021FFF74BFE019B03909E000398FFF794
:10CEE000A7FE041E00D14EE7019B009A01339A422F
:10CEF0000BD853000093042B01D204230093009B12
:10CF00002800990019F0F3F9050003231C4207D10A
:10CF1000104B22689A4203D1200015F07CFB0400DC
:10CF2000E6210AAAFF313800FFF7D4FD0AAA002142
:10CF300001200C9417F042FD019BAC510233019388
:10CF4000AB1958600836C9E774C202004CA0020051
:10CF500088E702000C9A02006B02000070B50C001A
:10CF600086B0160083071CD10368204A934202D082
:10CF70001F4A934215D102AA01A9F5F721FE019B90
:10CF8000A3422CD31BD80023029DA000A34201D1B1
:10CF900006B070BD9900421A043AAA580133725083
:10CFA000F4E702A9FFF7E2FD002305000193019BCE
:10CFB0002800A34206D3FFF73BFE0028E8D022005A
:10CFC0000C490EE0FFF734FE002808D0019A0A4908
:10CFD000A31A5B189B00013298510192E7E7019A6E
:10CFE00006490748FBF75EFAFFF778FB4CA0020002
:10CFF00088E70200B33C0300FFFFFF3F903C0300C3
:10D0000008AD0200F7B5FF240E00090A26401500FE
:10D010000C40830731D10368384A934202D0384A22
:10D0200093422AD101AA6946F5F7CAFD009833193F
:10D0300083425BD883009C46002301999A00A34257
:10D040000FD1B400801B0919C01AAD1819F008FDE2
:10D05000019B28601C190023013601339E4207D131
:10D06000F7BD6746BF1A043FCF590133AF50E5E71C
:10D070009A0051426158A950EFE70021FFF776FD71
:10D08000002307000093009BB34218D3002108003F
:10D0900019F0E6FC06003800FFF7CAFD011E1BD19F
:10D0A000B168A14222D3A3008A00EB181E60AA181F
:10D0B000091B9D4214D1300019F0EEFCD0E7380076
:10D0C000FFF7B6FD002811D0009AB31A1B199B0078
:10D0D000013258510092D6E7300007F07DF8DAE7C8
:10D0E000F468D01A2058043B1860E2E7009A05491A
:10D0F0000548FBF7D7F9FFF7F1FAC0464CA002004C
:10D1000088E70200903C030008AD0200F0B591B042
:10D110001D0006000C001700F5F7C8FB334B9842C2
:10D1200007D12B003A002100300004F0E3FA11B0DF
:10D13000F0BD826A2E4B002A08D09C4230D13000CC
:10D14000904728600028F2D00120F0E79C4227D1C8
:10D15000F92101AA49003000FFF78AFC019B002B4E
:10D160000DD1D72101AA49003000FFF7B3FC039489
:10D1700001AA0021012017F021FC2860E4E704A89F
:10D18000FFF786FA002807D101AA010017F016FC64
:10D190002860FFF79BFAD7E7059B2B600220C6E7C4
:10D1A000002CDED13800F5F781FB1249FEF794FD23
:10D1B00001AA00280ED010493000FFF759FC019B4E
:10D1C000002B10D001AA2100200017F0F7FB2860E7
:10D1D0002000ACE709493000FFF74AFC019B002B17
:10D1E00001D00397C4E72F60D8E7C04634D20200CD
:10D1F000E4B30200D0A8020019020000CD02000032
:10D2000010B50400FBF794F9002808D00023200093
:10D210001A001900FFF7B4FB0400200010BD200025
:10D2200016F004F80028F8D10249034815F0FAFF77
:10D23000F2E7C046483C030090AC02007FB5C30053
:10D2400006201843054B01900491052001A9029383
:10D2500003930592FAF72AFB07B000BDE4B302007E
:10D260001423F0B58DB000AFFA1805000C00FFF7DD
:10D27000FFFBBB69002B06D022002C492C48FBF792
:10D2800011F9FFF72BFA786900284CD1280015F026
:10D2900065FE0028F0D01423F821FA182800490070
:10D2A000FFF7E6FB10227869B918F4F7A9FAB8601D
:10D2B000200018F05AFB6A463E69B968731C7B600F
:10D2C000C318FB600E33DB08DB00D31A9D466D46A6
:10D2D000320028001BF05DFD2E23AB557B6820003B
:10D2E000EB18BB6018F046FB0600200018F03DFB71
:10D2F00031000200B8681BF04CFDF968280003F00B
:10D30000DBFBC300062018430A4B10223B627B6202
:10D31000094BBA18BB620123FB620B33F861D118C9
:10D320000520FAF7C3FABD460DB0F0BDB13B0300CE
:10D330000CA90200E4B30200CCE70200F0B5174CE0
:10D340000F00616895B003912168060008A8049158
:10D3500062602360FFF79CF9051E06D0039B0998C5
:10D360006360049B2360FFF7B9F933683A0031002A
:10D3700005A8019304F06EFC2B002A00019905A872
:10D38000FDF740FF17F00BFB0500FFF79FF92800A2
:10D39000039B6360049B236015B0F0BD7C2E0020CE
:10D3A00010B5040000F004FD031E054802D0054935
:10D3B00017F040FB22000449FBF774F8FFF78EF9E1
:10D3C00074AA0200043B03002D3B0300010010B5CA
:10D3D000014817F02FFBC04608AD0200F0B58BB036
:10D3E00004900F000392202803D191420FD0AF4E3A
:10D3F000BFE0049B1B2B01D01E2B0DD103993800DD
:10D40000F5F7EAFA049B002803D01B2BEFD1A84EB6
:10D41000AFE01B2BFBD1EAE7049B212B3FD1039804
:10D42000FBF786F8002806D00399380015F004FFB2
:10D430000028ECD1DBE70324039B1C4005D1039AB1
:10D440009C4B126805929A4223D0049B9A4A9B00F7
:10D4500038009C5815F0EBF80500039815F0E7F834
:10D460002B000090220095499548FBF71BF847E1F7
:10D47000039AA300D3189D682800FBF759F80028E9
:10D4800000D158E12900380015F0D6FE0028BED1A1
:10D490000134039B5B680593A342E9D8A7E7012603
:10D4A000314200D116E1039B4D101E4000D1E7E050
:10D4B0005C10049B1D2BC8D818000CF02FFC1E001C
:10D4C00028002A002D0045004C004E0050005D0051
:10D4D00066007B008300B4001E0028002A002D0097
:10D4E00045004C004E0050005D0066007B0083004C
:10D4F000CC00D000C6FFD400D80025432E00700019
:10D500000300734000D5B6E00126064331E06540D4
:10D51000F4E72C402600F2E7002C02DA6948FFF716
:10D5200055FF1F2C08DC684B2341AB4204DBC023B2
:10D530001B062341AB4205DDE917280018F0B1F8BE
:10D5400007004BE0A540D9E7002CE7DB1F2C00DDEE
:10D550001F242541D2E72E19D1E72E1BCFE721004A
:10D560002800FAF751FC0028E6D1012665436D003A
:10D570002E4330000BB0F0BD002C00D1DDE02100C7
:10D58000280015F07DFD0600B9E7002C00D1D4E09D
:10D5900028000DF053FD051C20000DF04FFD011C6F
:10D5A000281C0DF047F8032302269843474B0643F7
:10D5B000F618DEE7002C00D1BFE02100280015F0AE
:10D5C0004FFDE0E72F00002C2ADA28000DF036FD91
:10D5D0000323022798433D4B0743FF183800F5F714
:10D5E00065F98369002B00D12FE7039A390004986D
:10D5F000984756E001231C4206D039003000FAF764
:10D6000003FC002898D17E43012C00D177E7390034
:10D6100038006410FAF7F8FB002800D08CE77F434D
:10D62000002CE7D16BE7002C00D186E0002102201E
:10D63000F9F720F821000600280015F021FD012748
:10D6400040003843B0602100280015F009FDB840C3
:10D650000743F7608DE7A54200DAD8E6C7E6A542A2
:10D6600000DDD4E6C3E6A54200DCD0E6BFE6A54275
:10D6700000DBCCE6BBE6300018F022F8060078E7C5
:10D680000323039A1340022B24D1114B1340062B82
:10D6900020D028000DF0D2FC039A011C0498FBF75F
:10D6A000E9F8061E00D064E7CFE6C046C4E70200F2
:10D6B000CCE702004CA002000CB70200703B030054
:10D6C00090AC02005B3B0300FFFFFF3F0000808047
:10D6D000070080FF049B1F2B00D07FE70398F5F71E
:10D6E000E5F883690400002B0CD1636A002B11D18B
:10D6F000039814F09CFF134902001348FAF7D2FE76
:10D70000FEF7ECFF3A00039904989847061E00D0F4
:10D710002FE7EAE706A90398FFF728FA040020009C
:10D72000FFF786FA002800D161E63900F5F754F9D1
:10D730000028F4D06BE6039587E60449044817F007
:10D7400079F9C046953B030090AC0200E40D03005C
:10D7500044AD0200010010B5014817F06BF9C04656
:10D7600090AC0200F8B504000D0017001E0000295F
:10D7700008D01868F5F79AF86368834202D0054824
:10D78000FFF7E8FF33003A002900A068FFF7F8F838
:10D79000F8BDC046EC3A030001214000014310B53A
:10D7A000024815F038FDFEF799FFC04628AB02008D
:10D7B000010010B5014817F03DF9C046ECAA02007F
:10D7C00010B5034A0349044819F024FB034810BD6F
:10D7D000B33D0300590D030084E80200E4B30200E6
:10D7E00010B5034A0349044819F014FB034810BD5F
:10D7F000DB3C0300590D030084E80200E4B302009F
:10D80000F7B50600194D0C00280013F023F931007C
:10D81000174813F0A5F8174813F01CF9164813F031
:10D8200019F9FF239B00E61821787F2901D0A64231
:10D8300006D1280013F00EF9104813F00BF9F7BDCC
:10D840006278A37850290CD80D48475C0D48405C9D
:10D85000019300923B0002000B4813F081F804345E
:10D86000E2E70A4813F07CF8F9E7C046AA3F030054
:10D87000D73F0300DF3F0300683F0300863F0300FC
:10D88000940C0300430C03000040030023400300FA
:10D89000F0B51D0087B006001A4817000C0013F001
:10D8A000D9F82900184813F05BF8184813F0D2F89B
:10D8B000174813F0CFF8AD006519AC4204D11148F8
:10D8C00013F0C8F807B0F0BD3878A278049020684B
:10D8D00023780003400E0390E0789B060009029035
:10D8E00020883178C004400E0190E0789B0E00073C
:10D8F000000F00901209074813F032F80434013683
:10D900000137DAE7AA3F0300F73E0300243F030094
:10D91000563F0300883F0300F7B50020214A224EFE
:10D9200012783368111D4900CC5A5F18598801904C
:10D93000A020C00584466405640D4C431B49A41215
:10D940000968787807270500BD43F82D1DD001250B
:10D95000C00885402800A1256746ED0001327851B6
:10D96000D2B2101D4000C55A1F186D0558886D0DA4
:10D9700068438012001BE4D00A4C2270019A002AEE
:10D9800002D00A4A33601160FEBD6046084A5C68F6
:10D990008450002903D001220B00002101920A00CB
:10D9A0000C00DEE7312E0020BC2A0020C02A002017
:10D9B0000C05000010B572B600220F4B18681A60F3
:10D9C00062B6904210D10D4B0D4A1B680D48934230
:10D9D00000D010001A7802705A8842805A6842605B
:10D9E000002219788A4200D310BD510044185918FA
:10D9F000098901322181F4E7C02A0020BC2A0020D5
:10DA0000C42A0020F42A0020044B054A1A6000238F
:10DA1000044A1360044A13707047C046BC2A0020B1
:10DA20004CBA0200C02A0020312E002010B5782206
:10DA30000249022000F068FF10BDC04619D900005D
:10DA4000421E084BFF3A10B504009A4207D8FFF770
:10DA5000B1FF054B241144801860002010BD012047
:10DA60004042FBE740410F00C02A0020044B1B68E6
:10DA7000002B01D1034B1B68588800017047C0463A
:10DA8000C02A0020BC2A0020F7B53D4A04000D0042
:10DA90000B00914200D913008022D200D31A0193C7
:10DAA000FFF788FF0122A24046680092164207D184
:10DAB0002300A0210327C133FF339B00C9055F501A
:10DAC000002703789F4206DB002D01D0132B0BD9D2
:10DAD0002C4B1860F7BD391D490042185278D20806
:10DAE000A24243D00137EDE7009A191D324342604C
:10DAF000019A490055050A5A6D0DD20AD2022A43ED
:10DB00000A525205E400520F4118144301334C707D
:10DB10000370851C012225E0009A013BDBB296438D
:10DB200003704660BB42F4DD04335B001B5A0B52AA
:10DB3000EFE72F00131D5B00195A2E894905490D87
:10DB4000531E1C1D6400245A6405640D8C4204D9C4
:10DB5000FC88023F7C81013BF3D205335B001E52FF
:10DB60000132023503789A42E3DBB1E7002DD3D0CE
:10DB7000019B5A050B5A520DDB0ADB021343D6E711
:10DB8000FF030000C02A002070B500210400FFF749
:10DB90007BFF00210D4B18680578A94200DB70BDA2
:10DBA0000B1D5B00C3185A78161CD208944201D092
:10DBB0000131F2E70822524232435A700123A02178
:10DBC000A340034AC9058B50E9E7C046BC2A0020A0
:10DBD0000C05000010B50C0017F0AFFD631E1842D5
:10DBE00007D00200230003490348FAF75BFCFEF765
:10DBF00075FD10BD4440030008AD020010B54A6831
:10DC00000249D20019F006F910BDC0466C4003006D
:10DC100070B50B0006001400101E0FD071681800BC
:10DC2000042A0ED1FFF7D6FF7368012B03D0022B15
:10DC300005D0006800E0007817F042FD70BD008854
:10DC4000FAE7FFF7C7FF05002000F4F743FF72680B
:10DC500003000548012A03D0022A03D02B60EDE718
:10DC60002B70EBE72B80E9E7E4B30200F7B52D4F0B
:10DC7000B43701972B4A2C49FC32536C8B4200D8A5
:10DC8000F7BD0325043B53641A68264B501CAC3384
:10DC90001E6804008108715C2C4064002141831AD5
:10DCA000294001300229F4D00326019912010968A4
:10DCB0001B018A181B499B08002BDBD00F2014681E
:10DCC000044229D119480068A04225D80D00B83572
:10DCD0002D68A54220D9241A200900900800AC30F4
:10DCE0000068A409009D0419207835406D00844621
:10DCF0002841304001280FD13700AF403D00674632
:10DD00003D4325700D00FC356C6C094FBC4206D2BA
:10DD1000201D686400982060013B0432CCE70C00B1
:10DD2000BC34F8E77C2E00203C2F0020302F002050
:10DD3000BC2F00200F23994370B506000D00081A70
:10DD400041210BF0F5FF0F4C02002300B0331860A7
:10DD500023002100AC331E608301EB1AB4310B6049
:10DD600023003000B83300211D601BF02EF8802303
:10DD7000FC345B020122A36400235242E364226567
:10DD8000636570BD7C2E0020A222034952008B5A8D
:10DD900001338B527047C0467C2E0020A2220349DB
:10DDA00052008B5A013B8B527047C0467C2E00209C
:10DDB000A223034A5B00D05A431E9841C0B2704769
:10DDC0007C2E0020F7B50400032589004318019339
:10DDD000019B9C4200D1F7BD0F232168194229D134
:10DDE000184B1A00B43212688A4223D81800B8308F
:10DDF000006888421ED9891A1A000F093800AC320F
:10DE00001268890951180A78284040009446024156
:10DE10002A40012A0ED12E0086403000664630434B
:10DE200008701800FC30416C074EB14206D20B1D41
:10DE300043640F60FFF71AFF0434C9E7BC331A606C
:10DE4000F8E7C0467C2E0020BC2F0020A22210B58F
:10DE500008485200835A0100013383520300002214
:10DE6000FC33BC310A60DA64034A27215A64FFF7A5
:10DE7000A9FF10BD7C2E00203C2F0020F8B5032602
:10DE80002E4C00252200BC321368AB4213D1022273
:10DE90001900032794462200B03212689200914282
:10DEA0002AD323000022FC335A654532FF32A35A9D
:10DEB000013BA352F8BD23001560214AFC335A648C
:10DEC0002300B0331B689B009D42D9D22200AC32A4
:10DED0001268AB08D35C2A00324052001341334031
:10DEE000032B07D12200FC32536C191D51641D60B5
:10DEF000FFF7BCFE0135E3E72000AC3000688A087C
:10DF0000801802780D0016003D406D002E413E4005
:10DF1000022E09D0032E0BD0012E07D13B00AB40BF
:10DF20009A430270012301E0002BF7D10131B2E7DF
:10DF30006346AB409A4302700023F7E77C2E002033
:10DF40003C2F0020334BF0B51A001900B832B43121
:10DF500009681268521A1900B0331E680260032360
:10DF60000022AC310F68140011009C4642608260B0
:10DF7000C260026142618261B60065468B08FB5C4B
:10DF80000D406D002B4165462B404568012B33D079
:10DF9000002B2BD0022B32D001318E420AD06546A5
:10DFA0008B08FB5C0D406D002B4165462B4001D07A
:10DFB000012BE2D1012C26D1056901350561856966
:10DFC000A54200D284618E4201D0012BD5D1C36815
:10DFD000934200D2C2608E4206D143681B01436067
:10DFE00083681B018360F0BD0022C6E784680132AC
:10DFF000013484601C00CFE701354560FAE7013544
:10E0000045600134C8E7022CD9D145690135456125
:10E01000D5E7C0467C2E0020F7B50F3003090193E9
:10E0200002D100242000FEBDA223474A5B00D35A40
:10E03000002BF6D14733FF33D35A5E425E41002BAB
:10E0400007D0414BFC33DA6C1B6D9A4201D306F0CA
:10E0500071F8002430213F273B4A3B4BB032126815
:10E06000FC339446384A5B6DAC3210689C4505D849
:10E07000002ED6D106F05EF80136EBE70325C25C30
:10E080002A4231D1019D0134A5422ED89B00191B93
:10E090004E1C5A1C012C03D12B4C9708FC3467658D
:10E0A000B40800190324270037407F00A446023C2F
:10E0B000BC40077802313C43234F0470AC378B429D
:10E0C00034D22149204DB431FC350C68E96C330160
:10E0D0008C46E418019B921B63441201002120002E
:10E0E000EB641AF072FE9DE700240C252A4206D14B
:10E0F000019D0134A54203D89B000133C7E70024EA
:10E100000A4206D1019D0134A54203D89B00023387
:10E11000BDE70024BA4306D1019A0134A24203D8D4
:10E120009B000333B3E7002401339FE73C68880872
:10E130002018644602250C406400A5402C00057898
:10E1400001312C430470BAE77C2E0020A22230B5A6
:10E15000164B52009A5A002A26D1002824D01A00C1
:10E16000B4321268801A1A00FC32546D0109800919
:10E17000A04200D25065AC331800032204688B081B
:10E18000E3180C00150014406400A5401C78013110
:10E19000AC431C7004688B08E35C0C001440640002
:10E1A00023411340022BE9D030BDC0467C2E002015
:10E1B0000F2203000240002070B5824228D1154C86
:10E1C00010002100B4310968994221D82000B830EC
:10E1D000056810009D421BD9AC345B1A24681909EC
:10E1E0009B09E55C0800032318404000054110002E
:10E1F0001D40012D0CD14D1C2E00AA08A25C1E4012
:10E2000076003241681A1A400135022AF4D0000122
:10E2100070BDC0467C2E0020F0B585B007000D0013
:10E220000292002807D101002800FFF7F5FE060042
:10E23000300005B0F0BD002903D1FFF787FF2E00A5
:10E24000F6E70F2100260140B142F1D153480E00FC
:10E250000300B4331B68BB42EAD80200B83212682C
:10E26000BA42E5D9FB1A1A0900920200AC321268D0
:10E270009B090192D25C0323009C23405B001A415E
:10E2800003231A40012AD3D14233FF33C35A002B50
:10E29000CED129000F310909B0308C460168032620
:10E2A00089000391210014000131039A914212D296
:10E2B00001988A08825C08003040400002413240E8
:10E2C000022A02D101340131EFE7002A03D10133E0
:10E2D000E2186245F7D3644501D13E00A8E76445E2
:10E2E00021D9009B032663441900009B0800E21813
:10E2F000AC239C46294B9C44634605001B6884085C
:10E300001C19330035406D00AB40257801309D432A
:10E3100025709042F0D1214B8908FC335A6D91420F
:10E32000DBD25965D9E71B19634523D303250226A0
:10E330001A49009BAC31E3180191009A62449A4259
:10E3400009D86346191B090120010A003818002169
:10E350001AF03BFDC1E70199180009689A088A186C
:10E360003100284040008140080011780133084303
:10E370001070E2E7029E002E00D159E7002128002C
:10E38000FFF74AFE061E00D152E7220139001AF0BB
:10E3900000FD3800FFF7DAFE4AE7C0467C2E002079
:10E3A00010B58CB005A8FFF7CDFD079B0A4C039371
:10E3B0000093059A069B0949200018F02BFD089B45
:10E3C000099A01930B9B06490393009320000A9B33
:10E3D00018F020FD0CB010BD84E80200BB40030023
:10E3E000DE400300F8B5434E434F3300B4331A68A0
:10E3F0004249380018F00EFD00243300B0331B688A
:10E400009B00A34223D93F2214422CD13200250085
:10E41000AC3210680321AA08825C294049000A41F5
:10E4200003210A4202D10135AB42F3D12A1B7F2AD4
:10E4300012D992093249380018F0ECFC2C003F2325
:10E440009C433300B0331B689B00A34204D83800C0
:10E450002C4918F01EFCF8BD2B4B22011A402B4909
:10E46000380018F0D7FC3200AC321268A308D35C35
:10E470000322224052001341032213403A32022B5E
:10E4800031D03032032B2ED03F3A012B2BD1330029
:10E49000B4331B682201D3581D4954228B4222D029
:10E4A0001C49083A8B421ED01B49083A8B421AD0AD
:10E4B0001A490F328B4216D019498B4213D0194991
:10E4C000123A8B420FD018498B420CD017490532B3
:10E4D0008B4208D01649043A8B4204D015492632A3
:10E4E0008B4200D11B3A1449380018F093FC0134D8
:10E4F00083E7C0467C2E002084E802007C400300B5
:10E5000097400300654F0300F0FF0F00B340030086
:10E510004CA0020088E7020074C202000C9A0200BC
:10E52000A092020030B30200F4B2020088B00200F0
:10E5300000EA020098B1020082000300C379024899
:10E54000002B00D101487047CCE70200C4E702006D
:10E5500010B5F4F7A7FE014810BDC046E4B30200B1
:10E5600010B50868F4F79EFE004810BDE4B3020041
:10E5700073B50D00022836D1012601A96868F3F7AA
:10E580003FF976423400019BC318834212D101A99E
:10E590002868F3F735F97342734162426241DBB296
:10E5A000D2B20199F4F7C2FF002820D110491148D6
:10E5B00016F040FA0278722A01D0772A06D1611C3F
:10E5C0000ED1723A544254410130DEE7622A01D042
:10E5D000742A05D1711C03D1743A56425641F3E7AF
:10E5E0000548FEF7F3FE012676423400CFE776BDFC
:10E5F0001B04030028AB02002341030007224368E9
:10E6000004481B791340044AD35C002B00D0034814
:10E610007047C046CCE70200DA000020C4E70200E1
:10E6200010B50124037A05499B005A580448224238
:10E6300000D10448A243CA5010BDC046242B00207C
:10E64000CCE70200C4E7020070B5037A064C05006F
:10E650009B001859400817F033F801222B7A9B00D1
:10E6600019590A401A5170BD242B002030B5A2223E
:10E67000A025D200ED05AA580723CA401100164C68
:10E680000340E056421EC90700D5421C022A0ADC9C
:10E69000002082421ADB1149CD5C854201D0C8546A
:10E6A0000230E25430BD072A09DD0C2A10DC0B4988
:10E6B0000320CD5C002DF4D10238C854F1E707499E
:10E6C0000320C95C0029ECD10800EAE70200E8E772
:10E6D00003200C22E5E7C046E2000020DA0000201B
:10E6E0001D4B70B559791879FFF7C0FF022805D185
:10E6F0001A490B689A1C012313430B60184B597974
:10E700001879FFF7B3FF022805D114494B689A1C0A
:10E71000012313434B60134C2000FAF79DFB124D6D
:10E72000A84203D161792079FFF7A0FF0F4C2000A8
:10E73000FAF792FBA84203D161792079FFF796FF9F
:10E740000B4C2000FAF788FBA84203D161792079AD
:10E75000FFF78CFF70BDC0461CA30200242B0020D5
:10E76000BCA20200ACA2020020B20200F4A202008D
:10E7700004A30200072203791340014AD05C7047CA
:10E78000DA0000208022044B52001A600123034A61
:10E790001360034A1360704700E100E00C8C0040F6
:10E7A000008000408022054B5200DA67044BFF3A9C
:10E7B0005A600022034B1A607047C04604E100E033
:10E7C000008000400C8C004070B5002501261E4BD7
:10E7D0001E4C1D601E4B18601E4BE650C046FFF7D6
:10E7E000E1FF1D4B1D4AE660E25002221C4BFF2058
:10E7F000E5500433E25008339218E250C1238022DE
:10E800009B001203E250053BFF3BE550C22440222F
:10E81000144BA400195981430A4380211A510C3426
:10E820001A5909061202120A0A431A51C022043464
:10E83000195981430A431A51802212041A60802216
:10E8400052041A6070BDC046D02F002000800040E6
:10E850003C2B0020FC0F00004C050000701700004E
:10E860000405000000E100E070B51F4C1F4D636C13
:10E87000002B0AD0002363641D4B1B689847A82314
:10E88000DB00EA5800018018E850A36C002B09D087
:10E890000023A364164B5B689847164B0001EA58A7
:10E8A0008018E850E36C002B0AD00023E364104B7F
:10E8B0009B689847A923DB00EA5800018018E850BC
:10E8C000236D002B0ED000230B4A2365AB580B4958
:10E8D0005B18AB500A4A1368063313608022094B59
:10E8E00012045A6070BDC046FC80004000800040A9
:10E8F0000C000020440500004C05000070170000CB
:10E90000D02F0020FCE100E0F7B50191032823D8C7
:10E91000134B8000C758C223124D9B00EF500123B8
:10E9200044192364A8230F210F4EDB009C46E358B3
:10E93000AE59921BD218D3170B409A1801990B4B62
:10E940001211C150C1239B00EF50634600200132D9
:10E9500012019619E650FEBD01204042FBE7C04679
:10E9600084BC0200008000404C0500000C00002028
:10E9700003280BD8074B8000C158C223064A9B00CE
:10E98000D150064B064AC250002070470120404239
:10E99000FBE7C04684BC0200008000400C00002061
:10E9A000494A020010B5024B1B68984710BDC0468B
:10E9B0003C2B002010B50024054AA1008B58002BE9
:10E9C00002D00020885098470134042CF4D110BDA7
:10E9D0002C2B0020074A89008B58002B06D1885029
:10E9E00080211800044A49045160704701204042C8
:10E9F000FBE7C0462C2B0020FCE100E0F8B50E0040
:10EA000005001400FFF7CEFE330003272B433B42E3
:10EA10000BD1BC4209D9A208310028000AF0AEF897
:10EA20002300BB43ED18F6183C40002C04D0220014
:10EA30003100280019F0D7FD80220449D2008B58FC
:10EA4000002BFCD0FFF79EFEF8BDC04600E0014061
:10EA5000F0B5060000248BB0194B1A48E15804F0B9
:10EA600001F803AFE05104341C2CF5D11423002429
:10EA7000734301930025AB00F958134816F0ACFC22
:10EA80000135300014F025FE072DF4D1013DAB0017
:10EA90000D48F95816F0A0FC300014F01AFE013DA4
:10EAA000F5D20134082C03D100F0D4FD0BB0F0BD39
:10EAB00001231C42DED1019814F00BFEDAE7C046B8
:10EAC000F0BC02002CB502001C00002010B519207B
:10EAD000FFF7BEFF004810BDE4B3020070B515009B
:10EAE000040016F016F82A000249200015F0CFFFA6
:10EAF00070BDC046F54A020070B543790D00002490
:10EB0000032B06D9836A074C9200E41AC369D358D1
:10EB1000E418032115F0EEFF447024120570847090
:10EB200070BDC046FD7F0000F7B500230400617191
:10EB300083608371E260036101330F00150043615C
:10EB4000032906D80121836949429A00C0691AF055
:10EB50003CF90023A3622362AA8BEB8BD218002A14
:10EB600000D10132384E2000310015F090FF2A8C80
:10EB70003100200015F08BFFE3682000197D15F0AF
:10EB8000B2FFE3682000997D15F0ADFFE368200037
:10EB9000197E15F0A8FFE3682000997E15F0A3FF09
:10EBA000042F27D1636A226A31009A1A200015F0D7
:10EBB0006EFF3100EA89200015F069FF3100AA8953
:10EBC000200015F064FF0026AB8CB34217DCFF2158
:10EBD000200015F09EFF042F35D1EA8A2B8B0237D7
:10EBE000D31801930023019A9A422CD0AA8C0021B9
:10EBF000009223E00221200015F068FFD9E7AA6AFD
:10EC0000F300D3181A78032A03D19978200015F05D
:10EC100080FF0136D8E70126A86ACA00821850781A
:10EC200030420AD05088984207D15268D200606BB7
:10EC300099003A430A500133D5E70131009A8A42DC
:10EC4000E9DC0222F2E7F7BDCD4A0200F7B5234B1B
:10EC50000500A8331B680191022B0DD847698F422C
:10EC60000AD2836A0269CF1B9C1A3B00234304D15A
:10EC7000AB6A2B61019B6B61F7BD062F01D90F2C8D
:10EC800018D900941F2C01D91F230093009B002644
:10EC90009C4203D83E00032F00D9032601212800FF
:10ECA00015F014FF009A730113430370009BBF1B00
:10ECB000E41ADAE70A4B3E009F4200D91E00022107
:10ECC000280015F003FF702233091340F03A224365
:10ECD0001343037046700094E8E7C0467C2E002082
:10ECE000FF07000070B50D000121040015F08FFF33
:10ECF0000E2D14D00F2D17D010210D2D10D017214F
:10ED0000200015F006FF0322A36A04210333934376
:10ED1000A362200015F0EEFE044B036003E0112116
:10ED2000200015F0F6FE70BD1221F9E728900200D0
:10ED3000F8B5174F05000C0016000F40002A1AD135
:10ED4000110015F064FF23040FD53221280015F0BF
:10ED5000E0FE3221280015F0DCFE3221280015F0FB
:10ED6000D8FE3221280015F0D4FE3A0035212800C3
:10ED7000FFF7C2FEF8BD3A004621FFF7BDFE7F2334
:10ED8000210A99433143C9B2280015F0C2FEF1E7C8
:10ED9000FF7FFFFFF0B5124B87B003AD40C90138CC
:10EDA00000930195032303F0B7FA68680D4F1E2402
:10EDB000B84202D014F07EF844B2A8680023B842EA
:10EDC00002D014F077F843B270680399437104716C
:10EDD00009F00EFF70680AF075FA380007B0F0BD50
:10EDE000C0BD0200E4B3020030B5124B8BB003ACDF
:10EDF00020C9013800930194032303F08DFA616860
:10EE000006A818F091F9039B089A5900237A0093F9
:10EE10006868079B08F088FA021E05D00649074873
:10EE2000F9F740FBFDF75AFC06A90548F2F75AF836
:10EE30000BB030BDD8BD02003041030028AB02004A
:10EE4000A092020030B5114B89B002AC20C9013844
:10EE500000930194032303F05FFA012205A960687F
:10EE6000F3F7C6FF029B059A5900237A009368685E
:10EE7000069B08F069FA021E05D005490548F9F716
:10EE800011FBFDF72BFC044809B030BDF0BD0200BA
:10EE90004241030028AB0200E4B302000021F8B5B0
:10EEA0004768080017F0DCFD08250600B1223B6822
:10EEB000D2009D508022002092001900985001221B
:10EEC000FC319A6088605A61104A8868002803D132
:10EED000002A19D0013AF8E70024A24204D00C4AD3
:10EEE0009C5863425C41E4B238000AF0EBF9002C14
:10EEF00005D001216B001943300005F06DF9013593
:10EF0000782DD3D13000F8BD1400EDE710270000B4
:10EF1000C404000010B5040001F018FD074B020006
:10EF20001B690749074817F075FFFFF739FA012CED
:10EF300001D1FFF757FA044810BDC0467C2E0020CF
:10EF40005541030084E80200E4B3020010B5F3F772
:10EF500095FDF5F763F8014810BDC046E4B3020023
:10EF600010B5FEF71BFF014810BDC046E4B3020018
:10EF700010B5FEF709FF014810BDC046E4B302001A
:10EF800010B586B0040005AB04AA03A902A801F0DD
:10EF900003FE059B029A0193049B064900930648D1
:10EFA000039B17F037FF012C01D101F031FE03481C
:10EFB00006B010BD6A41030084E80200E4B3020019
:10EFC00010B5084C002805D1A834236801305B0037
:10EFD000184310BD0868F3F751FDA83420600248BB
:10EFE000F7E7C0467C2E0020E4B3020001220100B6
:10EFF00003001140100000290CD10800990709D125
:10F000001B68054910008B4204D00448181A43427B
:10F010005841C0B27047C0462CB90200D4E7020084
:10F020000023FA21094A89001360094A1370094A2A
:10F030001360094A1160094A1370094A111D083208
:10F04000D3670122CB67074B1A707047442B00200F
:10F05000322E0020402B002018000020332E0020EC
:10F060007C2E0020342E002010B5084B084A197859
:10F07000002907D1916C002902D0FFF7D1FF10BD04
:10F0800030BFF4E700221A70F9E7C046342E0020A2
:10F090007C2E0020837F0248002B00D1014870475E
:10F0A000CCE70200C4E702000023A022E02110B553
:10F0B00083770C4BD2050902D1500B48F9F7EAFED1
:10F0C0000A48F9F7E7FE0A48F9F7E4FE0948F9F7B4
:10F0D000E1FE0948F9F7DEFE0848F9F7DBFE0848CB
:10F0E00010BDC0460C0500000CA3020014A30200D2
:10F0F00024A302002CA302003CA30200B4A202003D
:10F10000E4B30200F8B5164C2368002B07D1482061
:10F1100019F0D5FD0500134908F0F8F925601248EB
:10F12000124902680B68D21A0123312A04D96233CA
:10F1300093429B415B420233002201260C4D2E700C
:10F140002F78032FFCD101329342F8D10368206855
:10F150000B6018F081FF430001201843F8BDC04642
:10F16000482B0020D8BE0200D02F00204C2B0020BE
:10F17000352E002030B50D4C87B02378012B13D1EC
:10F180000B4B02221D680621002302A818F0EDF89F
:10F19000082204A9684619F0FCFD039B029A280086
:10F1A00008F030F90223237007B030BD352E00205F
:10F1B000482B0020A02010B51049C0054B7F5A1CD9
:10F1C000002B09D14C8C0E4BA3430E4C03510E4B1C
:10F1D0004A775200D05A0FE010335B00CB185C889E
:10F1E000A123DB00C450092AF1D10120FFF7C0FBA5
:10F1F000FFF7C0FF0120404210BDC0461C000020A8
:10F20000F01F00000C050000F4F6020073B5041EA8
:10F2100009D11A4D2B78002B2CD01949194816F01A
:10F22000DBF82C7073BD184D2B1DDE6FF3F73EFB22
:10F23000164B2100984214D0154B2340062B05D0C5
:10F24000A30712D1134B22689A420ED101A92000C4
:10F25000F2F7D6FA019B012B0CD1007817F01FFBB7
:10F260000100300016F0B8F8DCE70B490B4813F04A
:10F27000D9FFA864FFF7D4FED4E7C046332E0020A0
:10F28000A8E402001C0000207C2E002008E50200FB
:10F29000070080FF0C9A02001E42030090AC02009F
:10F2A000F7B5A123A021214AC905DB00CA500123DB
:10F2B000C27F0D3293401E4A8B50C37F01920133AF
:10F2C000DBB2032B2FD0C3770200030000212233CF
:10F2D0003632198002339342FBD10424C17F154F8B
:10F2E0004D000522EB5D7E195343134A7678D318FF
:10F2F0009B190126A640B44662461B7901345B0087
:10F30000C3185E8C063516435E840D2CE9D10122AC
:10F310000D318A40A023A121DB05C9005A50828EFD
:10F3200001995A50F7BD0023CDE7C046F01F0000F9
:10F330000C050000B24103001C00002070B5394BE1
:10F340008CB01A78022A07D1A0223749D2008A58F5
:10F35000012A07D003221A70344DAB7F002B03D152
:10F36000FFF708FF0CB070BD2800FFF799FF304A87
:10F37000304913680968063313608B4207D30024B1
:10F380002D4B14601B78012B0FD0022B45D000238E
:10F390002A8C6B77FF33FF331A42E1D0E1222749F1
:10F3A000D2000120FFF7B0FADCE7254E331DDB6FFA
:10F3B000002B04D033000833DB6F002B02D1FFF7A2
:10F3C0002FFEE4E7FEF7E0FC6846FDF761F9002850
:10F3D0000CD11C4B1868FDF703FC0400FDF776F90F
:10F3E000FEF7DCFC2000FFF711FFD0E7FEF7D6FCAC
:10F3F000019B15491868FCF76FFC0028F2D10198B1
:10F40000F3F754FA114B984203D11149114817F000
:10F4100001FD019B0024B364E4E70F49280015F0C7
:10F42000DBFFCCE7352E0020007000401C000020E0
:10F43000402B002018000020322E0020B5F10000E3
:10F440007C2E0020442B0020DCAB020074AA0200BA
:10F450001609030084E80200A8E40200F0B50024C5
:10F4600085B0154D02930AAB1B782E1D0700083599
:10F470000800210001920393F467EC67FDF776FB27
:10F480000E4B019A18600E4BF7671A60029A0D4BEB
:10F49000E8671A700C4B1C70FDF7A2FBFFF7B6FE75
:10F4A00001220A4B1C600A4B1A70039BA34201D035
:10F4B000FFF7DAFD05B0F0BD7C2E0020442B0020C4
:10F4C00018000020332E0020342E0020402B002076
:10F4D000322E0020F0B50024384B8FB01D1D0833AC
:10F4E000DC67374BEC6709AD80C9013801950093A3
:10F4F000052302F011FF6B68099C049307942B7B92
:10F500002E7A05932B7C20000393FFF76FFD2D4D82
:10F51000002806D103232340022B09D12C40062CBE
:10F5200006D007AB002201212748F1F75BFD0790C9
:10F5300007980540062D05D0830730D1224B02687D
:10F540009A422CD108A9F2F75BF9089B002B23D033
:10F55000012B0DD1002E0BD1039B002B08D100787D
:10F5600017F09DF907900799380015F035FF13E063
:10F57000079803F05FFB079009AB1B7C002B03D0BF
:10F580000798F5F739FF0790059B049A00930799B0
:10F5900033003800FFF762FF0C480FB0F0BDF3F7FF
:10F5A00085F90B4B9842E7D1002E02D1039B002B2B
:10F5B000D9D007A90120F7F75DF8DCE77C2E002001
:10F5C00084BF0200070080FF0C9A0200E4B302002F
:10F5D00008E5020070B51B4B8AB005AD40C9013883
:10F5E00000930195052302F097FE059C20000494EA
:10F5F000FFF7FCFC002807D103232340022B0AD18C
:10F60000114B1C40062C06D004AB002201210F48F0
:10F61000F1F7E8FC049003A90498F2F7F1F82A7CCA
:10F620002B7B03990092059A03F0EEFA2B7A0100E6
:10F630000093300000236A68FFF710FF04480AB007
:10F6400070BDC046ACBF0200070080FF0C9A0200EC
:10F65000E4B302000022074B10B51A70064B0232C9
:10F660001A70064B064A1B68063B1360FFF7FCFC4A
:10F6700010BDC046342E0020322E0020180000207D
:10F68000402B002010B5FFF7E5FF014810BDC04634
:10F69000E4B3020010B5042901D8042A02D90948AC
:10F6A000FDF794FE092B01D90748F9E705246143CA
:10F6B00041188A18137101229A40038C1343038462
:10F6C00010BDC046480903002B420300F8B5486846
:10F6D0000C000D68F3F7D2F90600A068F3F7CEF935
:10F6E0000700E068F3F7CAF93A0003003100280088
:10F6F000FFF7D0FF0048F8BDE4B3020010B50429BD
:10F7000001D8042A02D90448FDF760FE05235943B5
:10F7100040188018007910BD4809030070B5104CDE
:10F72000050021000F48F9F7CBFB21000E48F9F73F
:10F73000C7FB21000D48F9F7C3FB21000C48F9F77E
:10F74000BFFB21000B48F9F7BBFB21000A48F9F782
:10F75000B7FB15F0C7FE01230848AB7770BDC04664
:10F7600000B202000CA3020014A3020024A30200B2
:10F770002CA302003CA30200B4A20200E4B30200E6
:10F7800070B50D00F3F7DEF9041C2800F3F7DAF981
:10F79000211C0BF059FA051C15F0B1FE011C281CA8
:10F7A0000BF020F9211C0AF0ABFD0323020002201C
:10F7B0009A43024B1043C01870BDC04600008080C1
:10F7C00010B515F09CFE0323020002209A43024B61
:10F7D0001043C01810BDC0460000808010B5074C13
:10F7E000002802D00868A04203D106F05DFC20008A
:10F7F00010BDF3F76FF906F077FCF8E7E4B3020009
:10F8000010B50400F3F7ACFAF3F738F9002803DC7D
:10F810000021064815F00EF906F020FC15F050FF07
:10F82000042201002000F3F7B1FA10BD84A9020000
:10F8300010B50400082016F03CFD024B4460036044
:10F8400010BDC046C0C0020010B5102016F031FD3A
:10F850000400034B08C011F0F6FF200010BDC046A5
:10F860002CB9020070B50C00052804D80AF04CFA37
:10F8700006030C04131C0024200070BD8B680E4C82
:10F88000002BF9D10D4CF7E7081D12F043FC0124C1
:10F8900040000443F0E7FFF7D7FF211D05000430C7
:10F8A00012F05EF92C00E7E7FFF7CEFF211D0500FF
:10F8B000043012F065F9F5E7CCE70200C4E7020076
:10F8C00070B5050083070CD1104B02689A4208D12D
:10F8D000FFF7BAFF291D0400043012F036F92000AA
:10F8E00070BD2800F3F7CAF8C0231B06984206D162
:10F8F00080200021C00515F0D4FE0400EFE70124AC
:10F90000C317C018584040000443E8E72CB9020070
:10F9100007B5C30701D540100EBD043001A9F1F7AA
:10F9200007FA002801D00198F6E70249024815F0CD
:10F9300081F8C0464442030064AB0200F0B58BB0CE
:10F94000019001200D00170008402BD04B1002221F
:10F9500003A904A811F0AFFF04AEFB072BD57B1061
:10F96000022203A904A811F0A6FF04AD019B092BF4
:10F9700001D0162B3FD16B68002B68D0300012F0FD
:10F9800024FC041C280012F020FC011C201C0AF09E
:10F9900051FE032302249843704B0443E4182000D3
:10F9A0000BB0F0BD03240C4023D16D4B0A689A4282
:10F9B000F5D10E1DD1E703231F4205D1684A3968EE
:10F9C000914201D13D1DD1E73B40022B0CD1654B4B
:10F9D0003B40062B08D0300012F0F7FB3A00011C28
:10F9E0000198F8F747FF04E03A0029000198FCF776
:10F9F00017FE0400D3E7019B182B00D98AE0FFF71C
:10FA000023FF040001980AF07FF9444A3E50500D4C
:10FA100013191F72336572444A3E50500D13191F5B
:10FA200072336500201D2A00310012F041F9B6E75B
:10FA3000201D2A00310012F075F9B0E7201D2A00C0
:10FA4000310012F0A2FAAAE76B68002B03D14649F5
:10FA5000464814F0EFFF07A811F0F5FE2B00320026
:10FA6000201D07A9F0F7FEFF07A811F0F1FE96E7A9
:10FA70006B68002BEBD007A811F0E5FE211D2B00D1
:10FA8000320007A8EEE7201D2A00310012F08BF9A2
:10FA900085E7201D2A00310012F001FA7FE7201DC2
:10FAA0002A003100F0F768FF79E73800FFF730FFF0
:10FAB000021E02DA2E48FDF789FC019B201D310051
:10FAC000032B01D0102B02D1F0F7EEFE67E712F006
:10FAD0008EF864E76B68002B03D02B78DB0700D52A
:10FAE00079E7201D2A00310012F0D2FA57E76B683F
:10FAF000002BACD0FFF7A8FE0700211D04302B001F
:10FB00003200F0F7AFFF07A9022007970894F6F735
:10FB1000B1FD6EE72900300011F0F4FF03000198F9
:10FB200000241938042800D939E7124C0AF0ECF8FF
:10FB30000308120B0F00002B00DB30E70E4C2EE702
:10FB4000002BFBDC2BE7002B00DD28E7F6E7002B82
:10FB5000F4DA24E7002B00D021E7EFE700008080F3
:10FB60002CB90200070080FFE40D030044AD020041
:10FB70005B3B0300C4E70200CCE70200044B886053
:10FB80000B60044B08004B600023CB607047C046FD
:10FB90006C9802009F570200044B0B60037A0B71B4
:10FBA000436808008B600023CB607047F0C10200FF
:10FBB00010B504000C2016F07CFB034B446003607E
:10FBC0000223037210BDC0462CC2020010B50430DF
:10FBD00013F049FC004810BDE4B30200002803D034
:10FBE000012808D0002005E007224B680448934311
:10FBF00000D1044870474B68DB085B001843F9E705
:10FC0000CCE70200C4E702000B6870B506000D00E7
:10FC1000181D49681400F8F7AFFF002802D04368A8
:10FC2000002B10D1022E08D1094B022C06D1696895
:10FC3000084813F0F0FAFCF751FDAB68012C00D135
:10FC40004360180070BD022CFBD100224260F8E72F
:10FC5000E4B30200C0A9020070B504000D000B7AE5
:10FC6000164A9B0086B0995817F013F814492000E3
:10FC700017F00FF8134B02AA02932B7A0126137187
:10FC80006B68019304930023059302A815F091FD7E
:10FC9000051E05D10C49200016F0FBFF06B070BD13
:10FCA000002E03D10949200016F0F3FF012229009C
:10FCB0002000F2F713FE0026E7E7C04668C2020004
:10FCC000BA420300F0C10200BD42030045FC02003D
:10FCD000F0B513681400012287B00F680D00009280
:10FCE000D9080223060002F0E7FA022E12D10323FC
:10FCF0006868034018D101682A4AC968914213D143
:10FD00002A68904206D0059305A9686815F032FD6F
:10FD1000061E01D100253EE0381D01223168F8F7AA
:10FD20002BFF73684360EFE70021FCF71FFF039090
:10FD30000398FCF77DFF0028ECD00021FCF716FFAC
:10FD40000500FCF775FF02902800FCF771FF060024
:10FD50002800FCF76DFF029B002B03D0002E01D082
:10FD6000002802D01048FDF731FB381D012202990E
:10FD7000F8F702FF4660DBE7A368EE009E193168E2
:10FD8000002907D0042905D0381D0122F8F7F4FE18
:10FD90007368436001356368AB42EDD8034807B030
:10FDA000F0BDC0461D00010094420300E4B3020010
:10FDB00030B5002585B001A90400019515F0DAFCE5
:10FDC000A84203D109490A4814F034FE636802A925
:10FDD000083B63600368029343680393042328C0CD
:10FDE0000220F6F747FC05B030BDC0467142030063
:10FDF000C0A90200F7B50C0015001B280DD0002388
:10FE00001F2808D1081D00222900F8F7B5FE2C4B49
:10FE1000002800D12B4B1800FEBD03222B001340FD
:10FE2000114225D1284922688A4221D1002BF1D1E3
:10FE3000296891421ED1009301936946200015F074
:10FE400099FC01A90700280015F094FC0600002F7A
:10FE500031D00028DED031683868F2F7BDFD0028C7
:10FE6000D8D071687868F2F7B7FD0028E5D1D1E7FE
:10FE7000002BCFD1154B2A689A42CBD16A686368B0
:10FE8000534007229343C5D1019301A9200015F0E7
:10FE900071FC061E01D10A4BBDE7281D0022316806
:10FEA000F8F76AFE0028B5D041687068F2F794FD53
:10FEB0000028EAD1AEE7024B0028ABD1ABE7C04641
:10FEC000CCE70200C4E70200B0C2020074C2020024
:10FED000F7B50B681C4A04000D00934203D05A6822
:10FEE0001A4916F097FF1A49200016F0D2FE002397
:10FEF0000127019301A9280015F03CFC061E0CD136
:10FF00001449200016F0C5FE2B680F4A934203D017
:10FF10001149200016F0BDFEF7BD002F03D10F4997
:10FF2000200016F0B6FE012231682000F2F7D6FC60
:10FF30000B49200016F0ADFE012271682000F2F797
:10FF4000CDFC0027D6E7C04674C2020090420300F1
:10FF500043FC02005E070300A002030045FC020010
:10FF6000613A030010B504000C2016F0A2F9034B0F
:10FF7000446003600023037210BDC0462CC202001F
:10FF800010B504000C2016F094F9034B4460036094
:10FF90000123037210BDC0462CC2020010B504300C
:10FFA00000220C00F8F7E8FD002805D121000348E5
:10FFB00013F031F9FCF792FB406810BDC0A90200B4
:10FFC00010B5024B08C013F033FA10BD74C2020022
:10FFD000F8B50E00070000217068FCF7C7FD0E4C55
:10FFE0000500022F00D9B4687068F2F761FE00289E
:10FFF00009D115F008FC06002800FCF719FE011EC7
:020000040001F9
:1000000003D13000F8BD4010F3E7331D0122180082
:10001000F8F7B2FD4460EFE7E4B30200F0B5070083
:1000200089B000201E000D00019215F0ECFB0E4B74
:10003000040007609F4203D1042302791343037134
:10004000019B2B430DD03368AA00B218019905A873
:100050000394049313F0FAF9681C05AA03A9FFF7A7
:1000600037FE200009B0F0BDB0C2020010B50C0090
:10007000002A03D115F00AFC0A480EE0042A0DD12B
:1000800004300022F8F778FD002805D12100064849
:1000900013F0C1F8FCF722FB406810BD15F0ECFB33
:1000A000EAE7C046E4B30200C0A9020010B50100AF
:1000B00083880120A0229840044BD205D050CA88E2
:1000C000083117F0E3F8024810BDC0460C050000E7
:1000D000E4B30200EFB5070008001500F98802003C
:1000E00000233868F2F7A2FD03267043002D14D0D8
:1000F0003F18042D14D101237A7A01A952001A4322
:1001000001923A7A30009A401A430292BA7A9A409F
:1001100013430393F6F7AEFA0500280004B0E0BDE0
:10012000310001AA2800F2F76DFD019B1868F2F773
:10013000A5FC019B06005868F2F7A0FC019B050096
:100140009868F2F79BFCFF2E03D8FF2D01D8FF28FB
:1001500002D90448FDF73AF93D727E72B872024D39
:10016000DBE7C046FA420300E4B30200F7B51C0027
:10017000002300930233080011001A0002F09CF8DB
:10018000206812F097FE47B26068F2F777FC041E11
:1001900002DC1048FDF71AF90326300060430830EE
:1001A00016F087F80C4BA2B20500878072430360FB
:1001B000C4800021083018F008FE3B00A022C133A3
:1001C000FF33D2059B009E500123BB40034928000A
:1001D0005350FEBDE142030044C302000C05000081
:1001E000032210B50400C38800215A43083018F0D8
:1001F000ECFD2000FFF75AFF004810BDE4B30200F9
:100200000523020070B5094C094D20684343094895
:100210009B189B0018582B682260C0180F231940A8
:1002200009012860F7F7BCFD70BDC046502B0020C7
:10023000442A002080C30200A839030000B508004A
:1002400006292ED809F060FD040A10161B2128008B
:100250009A18E223DB00D218107800BDC432920055
:10026000D05C8006800EF8E7C4329200D05AC004F9
:10027000400EF2E7C4329200D0580003F8E7C432CF
:1002800092009A1890780009E7E7C43292009A1811
:10029000D0780007000FE0E7C43292009A18D078B7
:1002A000F1E7024B024A00201A60D6E70400002062
:1002B00009430300A83910B504000800062949D8ED
:1002C00009F022FD040A141F2A343F00E221A2187B
:1002D000C9005218137010BD3F210B401800C432E2
:1002E0009200135D8B4303431355F4E77F21C4321F
:1002F000920019401948135B890103400B431353C3
:10030000E9E77F21C432920019401059144B490388
:1003100003400B431351DEE70F20C4329200A218B2
:100320001901937803400B439370D4E70F210B40DE
:100330001800C4329200A218D3788B430343D370C1
:10034000C9E70F20C4329200A218D1781B010140E6
:100350000B43F4E7034B044A1A60BCE73FE0FFFF9E
:10036000FF1FF0FF0400002027430300F0B5D2B2C6
:1003700085B00E000293072113000B40013BDBB256
:10038000042B02D9294C2A4D25608A431F02002ADA
:1003900024D1284B3578C45C274B2409E443E4B2CC
:1003A0002D1BDB19EDB2039308276319039ADBB207
:1003B000D35C5A00D2B25BB20192002B33DA1A211D
:1003C0000320013FFFB2FFF71BFF019B002FF0D17D
:1003D0000134E4B2002CE7D135701AE0D443174958
:1003E000E4B2CE5C0825144B1B19DB5D5A00D2B277
:1003F0005BB20192002B0FDA05210220FFF700FF0C
:10040000013DEDB2019B002DF0D10134E4B2002C8E
:10041000E8D1029805B0F0BD31000120FFF7F0FEF1
:10042000002EE9D0ECE706210420CAE704000020F2
:1004300014430300190700009F480300FA4E03000D
:100440000022F0B505000F00FF200F248BB008AB91
:10045000654EDA710100C431890069188B781A0978
:10046000B25C234012011343CA788B7013071B0F31
:10047000F35CA243234013431A09B25C23401201E8
:100480001343CB700138E5D2E223DB00EE5CB30806
:10049000F31ADBB20493554B1B68002B0BD0E222FE
:1004A000C4218120D200890000013B00AA186918EC
:1004B0002818FDF7EDF900244823029403930194D2
:1004C000009481222B1912019B181B7818000593A8
:1004D0000723984320D008A92300059A0731280054
:1004E000FFF744FF0230C4B2023FFFB2002F78D0C2
:1004F0002B780393013EF6B2002E47D1E2222B194E
:10050000D2009B181E78B308F31ADBB204930023C1
:10051000029301930093D4E7354B009A9C469A5C72
:100520002300C4339B00EB18997809090A43314929
:100530008A5C019907926246DB78525C1907090FC1
:100540000A432C491B098A5C2B490692029A8A5C51
:1005500006991343079A8A182649C95C012389180A
:10056000FF2A00DC031CC918882309061B06C918CA
:10057000090F0020FFF744FE039B013BDBB203930E
:10058000002BB7D10134E4B2013FAEE7049B013B3D
:10059000DBB20493002B02D1059B002B18D1220063
:1005A000C4329200535D00999B069B0ECB18DBB2C0
:1005B0000093535B0199DB045B0ECB18DBB2019314
:1005C0005359029A1B035B0ED318DBB2029378E7F0
:1005D00008A92300059A07312800FFF7C7FE040089
:1005E0008CE70BB0F0BDC04623440300582A00201E
:1005F000EF4D0300FB4503009F470300064B1B5CC8
:10060000002B05D0054B185C4843C011C0B27047A1
:10061000034B185CFBE7C0464B470300C44503008F
:1006200084440300064B1B5C002B05D0054B185C73
:100630004843C011C0B27047034B185CFBE7C0468B
:100640004B470300FF4E0300D4440300F0B5037A88
:100650008DB004007F2B00D157E103000700002577
:100660000933FF330837099301953E787F2E00D078
:1006700087E000230693019306998B00E318039308
:100680001A7A481C1B7BC0B206907F2B00D11BE15D
:100690009F49CE5C8D5C9F49AE4200D0F1E08D5CFD
:1006A000CB5C0493039B597A019B5918CBB20193FD
:1006B000049BEB18DBB20793023B1B06DCD4A82794
:1006C000019B5D1BEBB20593A82F00D0E1E0039BDB
:1006D000039A5B7A527B5B08520899180291019940
:1006E00001988A18E221C31AD2B2DBB2C900A2185B
:1006F000E31852185B18157818782D1AEDB27F227E
:100700002B006DB293430893EB17E81858400299F9
:1007100009F07EFC2800CBB20299099309F092FB04
:10072000059A00251600C3B20A93029B9B18DBB200
:100730000B93320039002000FFF77EFD0A9B013643
:100740000B9AC018F6B2C3B2964200D1B6E0099A2D
:10075000AD18029AEDB2AA420DD8AD1A20216A4610
:1007600052181278EDB252B2002A00DAA4E0002B3F
:1007700001D00133DBB2320039002000FFF79AFDCF
:10078000D7E7012E77D12B003100019A200015F018
:1007900092F8BA78604BA1789B185B78300001938F
:1007A000FB780893FFF72AFF3F23E17803403000EE
:1007B0000293FFF737FF7F22584B9B5D1A40584B3F
:1007C00003929A5D0F231A400492564A925D1A4092
:1007D0000592554A925D1A4006923F22534B9B5D0B
:1007E00007937B78EB18DBB20A93029B13400293CA
:1007F0007F23184083019C462A003F21C432920087
:10080000135D0F268B4302990B431355135B484925
:100810000B4061460B431353039B10595903454B3F
:1008200003400B430498190C314000011351084355
:10083000A21890701B0E0598B34306990343090153
:100840001E400E43D67081226319079912019A182F
:100850001170E222D2009B180899019A01355218B2
:100860001A700A9BEDB29D42C6D1099B0437BB4268
:1008700000D0FAE6FDE6022E8BD12B00019AFF2173
:1008800084E72D48AE4201D9C55C09E78D5C835CE5
:1008900007E7049B019A39009A18D2B22000FFF7AB
:1008A000CBFC059A050039002000FFF7C5FC079B2B
:1008B0002D1AEDB2029322E7013B5BE70137FFB24D
:1008C000AF2F00D000E7D7E6023189006118019B05
:1008D000497859186368C9B2002B13D1E2238122E9
:1008E0001648DB001201E318A518001B1A18C432C1
:1008F0009200125D1E789206D20EB21A1A7001335F
:100900009D42F3D12000FFF79BFD0DB0F0BDC04626
:1009100034440300FB460300EF4E0300244503006C
:100920003343030083430300D34303009F4D03007D
:100930003FE0FFFFFF1FF0FF74450300F0F8FFFFEB
:10094000014BD8607047C0467C2E0020034B82B01C
:10095000D86801ABC01A02B07047C0467C2E002098
:10096000014B18617047C0467C2E002010B54E2107
:10097000024812F050FCFBF7B1FEC046A0AB0200EB
:1009800007B5054A01ABD1681269CB1A9A4201D862
:10099000FFF7ECFF07BDC0467C2E0020074B5B69CC
:1009A000002B01D1180006E05A68824204D8801A50
:1009B00004308000C05870471B68F1E77C2E00208F
:1009C00070B5144D04006B699868DB68834215D3D9
:1009D0000230C00015F07AFC6B69002803D19868DA
:1009E0004000FCF7DDFC5A68D96803609B68521828
:1009F0005B00836000234260C36068616A69D368FA
:100A00005068591C04339B000138D16040189C5039
:100A100070BDC0467C2E0020074B4118884204D38D
:100A2000D8B2002800D1013070475A01D31802789B
:100A300001305340F2E7C04605150000034B044A5D
:100A40005A6100229C331A607047C0467C2E0020F9
:100A5000E4C30200F0B585B001900E00FFF7DCFFA3
:100A6000144B02905C69002C01D120001EE027008D
:100A700010373D00E3689B00FB180393039B9D42E6
:100A800001D32468EFE72868029A037893420FD1D4
:100A90004378B3420CD102303200019918F06AF960
:100AA000002805D1ED1B6068AD10281805B0F0BD19
:100AB0000435E3E77C2E0020F0B585B0039001916A
:100AC000FFF7C8FF002861D1314D019B2F009C37F3
:100AD000DC1C3B68002B18D02E002E4AA036126872
:100AE00031680292A2188A420FD9020061181800D8
:100AF00015F00AFC0290002822D1264B020019684A
:100B0000386815F001FC029B3B602B009C331B688E
:100B1000002B20D12600802C00D2802630002F0010
:100B200015F0D4FB9C37386000280DD1200015F05B
:100B3000CDFB26003860002806D12000FCF730FCF1
:100B400033681B193360E0E72B00A0331E602B00D5
:100B50000022A4331A602B00A4331A689C352D6838
:100B6000A41801990398AD181C60FFF755FF019B6D
:100B700028701A006B70A81C039918F00AF900225B
:100B8000019B2800EB189A70FFF71AFF05B0F0BD23
:100B90007C2E0020202F0020F7B51D00160000231A
:100BA000070003600B6033602B60174B00915C699A
:100BB000002C02D0154B9C4204D133682A68D3180C
:100BC0002B60F7BD3B6801333B60E268009B9446B5
:100BD0001B68009A0193634413602200E36810329B
:100BE0009B00D3189A4207D32000FDF7E1FA2B6847
:100BF000246818182860DBE702CA30684978033097
:100C000009183160EEE7C0467C2E0020E4C30200E4
:100C10000C4B70B55C69002C02D00B4B9C4200D190
:100C200070BD2600E36810369D007519AE4201D3F1
:100C30002468F0E704CE05490232054816F0EAF8C8
:100C4000F4E7C0467C2E0020E4C302003C4F0300C2
:100C500084E80200044B054A98331B6804481A6074
:100C6000044A9A807047C0467C2E00207800040019
:100C7000E4B3020004040000084A10B513009833DE
:100C80001B689979002908D0916C0029F9D00021BE
:100C900099711B695879FCF7F7FE10BD7C2E002076
:100CA00013B5084C98342368188814F009FD23689C
:100CB0000090588814F004FD694601900220F5F771
:100CC000D9FC16BD7C2E002010B50D4C002803D099
:100CD0000868F6F7ABFB04000A492000F8F7F0F8C3
:100CE00060790021FCF7D0FE2000F8F7D3F800224D
:100CF000054B064898331B681A619A7110BDC046AF
:100D0000ACA2020010B202007C2E0020E4B302006C
:100D10001FB50C4B02AC00930194022301F0FCFAC6
:100D2000029A002A03D0084B98331B685A806268E5
:100D3000002A03D0044B98331B681A80034804B080
:100D400010BDC046D4D002007C2E0020E4B30200C7
:100D5000F0B5254B89B004AC00930194042301F055
:100D6000DBFA224F224A3B0098331B6804989A8092
:100D7000204B0340062B06D0830730D102681E4B60
:100D800092699A422BD1012303940293002598374C
:100D90003B681869F8F77EF83B6860681D61F6F7F4
:100DA00045FB16490600F8F78BF83B68144A9D711D
:100DB000126802999A60227B9981DA71DD81039A27
:100DC000012900D112685A6101221E619A71237AA9
:100DD000002B01D0FFF750FF0A4809B0F0BD03AA6D
:100DE00002A9F1F7EDFED1E794D002007C2E00209D
:100DF00004040000070080FF9D1D000010B20200E7
:100E0000D02F0020E4B30200F0B5274B89B004AD29
:100E100001950093042301F07FFA6B68A868049E93
:100E20000393F6F703FB214F040098373B681869DA
:100E3000F8F730F800223B681D491A612000F8F7E6
:100E40003FF8607980212D7BFCF71EFE002E1CD11F
:100E50006079FCF799FE039B002B13DB0022134BF8
:100E6000144998331B6803989A710968DA7141181C
:100E7000DA605A61023299601C619A71002D01D0CA
:100E8000FFF7FAFE0C4809B0F0BD31000B4808F03E
:100E90004FFFFCF7D5FD0028DDD06079FCF774FE2C
:100EA0000748FCF793FAC046B4D002007C2E00201D
:100EB00010B20200D02F0020E4B3020040420F0025
:100EC000EB6A030010B5182015F0F3F9064B9833C0
:100ED0001860064B0360064B838000238371036117
:100EE0004361044810BDC0467C2E002078000400F9
:100EF00004040000E4B30200F0B56D4C87B0260096
:100F000098363368002B40D09A79002A3DD0694D3D
:100F100099682A68914238D89A79022A0BD11B69BC
:100F200000215879FCF7B0FD2B6832680A339360D2
:100F30000123937129E09A79012A26D19A89D989C6
:100F4000914204D3DD79002D19D00021D98158694F
:100F5000012A02D0DA8992001058574A904216D1DD
:100F60001B69002158799834FCF78EFD246853489A
:100F7000218808F067FF0123A060A37105E09D713F
:100F80001869F7F787FF33681D6107B0F0BD05A941
:100F9000F0F736FC9834236801901B69802158795A
:100FA0000293059EFCF770FD019B24681F781F23A8
:100FB000218842481F4008F045FF618808F042FF41
:100FC0007D1EEDB20390012E5AD9019B5B78232B35
:100FD0004DD0622B50D1002D4BD0023FFDB26A1E86
:100FE00053425A415242022E4ED00121022301980F
:100FF000C05C3A2803D00F27384020710133207994
:1010000084469E420ED90198C05C3A280AD1581CE9
:10101000864207D9019F0233385C0F2738409E4231
:1010200035D86071092D3DD86346043B9A1852B2F9
:101030006F00234B002900D1224BD85B002A2EDB06
:101040001041FCF7FDFC1A4B039998331A68537949
:1010500059430B0017490A3B09680A2B00DA0A2397
:101060005B189360D3890133D381022361E70022A7
:10107000B9E72A000625B6E7002101230A00B6E7F2
:10108000002101230A00BAE733000121B7E70A264D
:101090007043019E6071F65C3E408019C1E7524288
:1010A0009040CEE7029B00215879FCF7EDFCCAE79F
:1010B0007C2E0020D02F0020E4B3020060EA000064
:1010C00014F7020006F70200F7B5CC1CA4000700D5
:1010D00020000E00019215F0ECF822000500054BEF
:1010E0004760866003600C3A01990C3017F051FE9E
:1010F0002800FEBD2CD102000021F0B5070087B00A
:10110000816414F0DFFCFB693C6ABB637B6AFC63AF
:10111000002B05DA3A00062140321170013306E057
:10112000002B07D03A00052140321170013B7B6251
:1011300007B0F0BD002833D0BB6A002B30D1390096
:10114000043340310B703A6BAE4B786BD3185B00B5
:101150001B5A013C9C42EBD017D9F96A8A4207D34B
:101160000831490015F0C3F8FB6A78630833FB6265
:101170003B6B5A1C3A637A6B5B009C527B6ACDE7EF
:10118000013B3B637B6A013B7B623B6B9D4A9A1848
:101190005200125A9442F3D3CAD002230B70C7E70D
:1011A0003C69631C03D1002240373A70C0E7380025
:1011B00014F030FC0490002800D129E13B004033BA
:1011C00005930023059A13703B69752B5AD0622B47
:1011D00007D17B69722B5CD001240B230022019282
:1011E00008E0722B51D17B69622B52D0049B012401
:1011F00001930A23390040310A78002A4ED10B703E
:10120000002C07D0380014F02DFC022C02D138003D
:1012100014F028FC3B690293222B01D02723029370
:10122000380014F01FFC0123029A03933B69934298
:101230000BD113007A69934207D1380014F012FCE5
:10124000380014F00FFC0323039300263C69631C51
:1012500000D1CEE0039B012B02D10A2C00D1C8E0C3
:10126000039B9E421DD338003100443015F0EFFF40
:101270000121380014F026FC380014F0CBFB0028C4
:10128000A2D155E701240A23A8E700240A230194E8
:10129000B0E7049B022401930B23ABE79A42AFD043
:1012A00046E7029BA34209D13800190044300136B9
:1012B00004F0B2FD380014F0D5FBC7E75C2C00D079
:1012C00091E0380014F0CEFB019B3D69002B06D065
:1012D00038005C21443004F09FFD2C0071E0622D49
:1012E00051D030D84E2D77D01AD8222D29D0272D85
:1012F00027D000260A2DDDD02C00303C0326072CF9
:10130000E6D87B69303B072B5BD8013E002E58D0D6
:10131000380014F0A7FB3B69E400303B1C19F0E7F0
:101320005C2D0ED00724612D21D0552DE4D13B003A
:1013300040331B780B2B2ED138005C21443004F055
:101340006BFD2C0013E0742D1FD007D86E2D1ED01E
:10135000722D0BD0662DCFD10C2408E0762D18D03D
:10136000E5D30226782DC7D1002428E00D243B00C8
:1013700040331B780A2B32D138002100443004F06E
:101380004BFD002696E70824F1E70924EFE70A243D
:10139000EDE70B24EBE70826752DE5D1043EE3E7E6
:1013A000380014F05FFB3D692800F7F76DF900285D
:1013B00000D144E1280011F0BBFF24012418013EB4
:1013C000EED20026631C00D174E70F4B9C42CED9AD
:1013D0000122059B1A70D4E70C48FCF7E9F9FF2CB1
:1013E000F6D80B2BF4D13800E1B2443015F0EBFE07
:1013F000C7E7039B9E4200D335E73B0003224033FF
:101400001A7030E7FFFFFF7FFFFF10003A6B030009
:101410002000F7F721F9041E386903D15F2801D0B5
:101420007F2842D93D0007233C0040352B704434CF
:10143000C1B2200015F0C7FE380014F013FB386964
:10144000431C1BD1200015F0ACFE002406007E4F8B
:10145000A300F958300017F002FD00281ED10D340A
:10146000E4B22C70102C00D062E6784BA8331A68D6
:101470000D23002A00D102332B7059E6F7F7ECF860
:10148000002808D138695F2805D07F2803D8F7F7EE
:10149000EFF80028D6D03B69D9B2CAE7002800DAB5
:1014A00046E60134222CD3D142E6F7F7E1F80028D2
:1014B0000FD03E00396940362E2916D109233370EA
:1014C0003D004435280004F0A7FC380014F0CAFAA7
:1014D00031E03B692E2B04D17869F7F7C9F8002871
:1014E000E7D100255A4C02234AE008233370302903
:1014F000E6D17A6918331343623B0024162BDFD8F8
:10150000544CDC4001231C40DAE7002C17D10300C7
:1015100020229343452B12D13C3B33706521280098
:1015200004F07AFC380014F09DFA396902220B00AD
:101530002B3B9343C6D03869431CE6D1F8E5F7F757
:101540008BF8002805D039692E290BD10923337077
:10155000B8E73869F7F78CF80028F4D13B692E2BEF
:10156000F1D0E5E50B00202293434A2BAAD1EDE709
:10157000633E9E43F6B272425641A41901350134CE
:101580002678002E02D03A69B242F1D1380014F028
:1015900069FA002E02D14037012206E6212E08D139
:1015A0003B693D2BF7D1380014F05CFA40374122FB
:1015B000FBE52E2E12D13C003B6940342E2B02D18C
:1015C0007B692E2B02D04A232370B1E5380014F03A
:1015D00049FA380014F046FA0C23F5E72A000134E2
:1015E000267802213300633B8B43DBB2002B0ED104
:1015F000637839690135994207D1380014F032FA1D
:101600002A00652E03D00234EAE7632EFBD1124B89
:101610009B5C3A0040321370190004229143422926
:1016200001D0442B03D1BB6A0133BB6280E543295F
:1016300002D0452B00D07BE5BB6A013BF5E70122D8
:10164000059B04001A7092E668D102007C2E0020EF
:10165000F96A030001204000B66B0300F7B5456846
:101660001600A8681F00019111F0CEFA0400A868C6
:1016700011F0D0FA11F0C8FA0300032058430734E0
:101680000019800014F015FE074B040003606B681E
:101690003200436000238560C36001993B0008303D
:1016A000F3F780F92000FEBD34D2020070B50500CA
:1016B00088680C0015F07CFC230002000249280019
:1016C00015F0A8FB70BDC046006C030010B50248C1
:1016D00011F09BFDFBF702F8DCAB020010B5040033
:1016E000082014F0E6FD024B4460036010BDC046C4
:1016F00070D20200F7B5C56804001E00002D02D1AB
:101700001D602800FEBD03691830834205D1184BC7
:10171000994203D01748FCF71DF819602000164FB6
:1017200011007B680830019363687B6001F0A6FDBF
:10173000019B05007B60012807D002280CD0002304
:10174000E36023691B683360DBE723691B68336050
:10175000002BD6D1E360D4E7A368986811F054FA5F
:10176000002305308000E36024186368EBE7C0467F
:10177000E4B302001E6C03007C2E002013B501AB05
:10178000FFF7B8FF01280ED0104C02280DD0019BA6
:10179000A34219D0002B17D001AA01210C4811F047
:1017A0002EFDFAF79BFF019816BD0198F1F77EF820
:1017B0000749FAF791FA002801D10198F1E7019859
:1017C000F6F73CFEA042F8D10020EDE7E4B30200BA
:1017D000DCAB020010B50B00022808D14A680549AD
:1017E0001868FFF7CBFF002803D1FFF76FFF8A6867
:1017F000F5E710BDE4B3020010B500220149FFF780
:10180000BDFF10BDE4B3020013B5114C01AB114A8A
:101810002100FFF76FFF012803D0022805D0200028
:1018200016BD0D490D4813F005F90198F1F73EF882
:101830000B49FAF751FA0028F1D10198F1F736F87F
:101840000849FAF749FA0028E9D10198FAF746FF62
:10185000E4B3020048A70200E06B0300A0AB020063
:10186000D0A80200DCAB0200F0B585B00500160080
:10187000080003AB02AA01A911F011FC0398364F2E
:10188000B84209D0032807D0F1F7F8F8B060002873
:1018900004D13248FBF79AFD0123B3600198B842A6
:1018A00029D10024B368A34200DC6C1E0298B84220
:1018B00025D1B368002B47DD2800002C2ADA6419F3
:1018C00001D5B368DC17002834DA401901D50120AE
:1018D0004042B368002B00DA0130B368002B2DDDE5
:1018E000A04200DA2000013B706058425841C0B26B
:1018F000346005B0F0BDF1F7C1F80400D6E7F1F7A8
:10190000BDF8B368002801DBDA0F8018002CD6DBA5
:10191000002B03DDAC42D6D92C00D4E7002BD2D06B
:10192000A54200D86C1E002804DA4019D4D5012045
:101930004042D1E7A842D0D92800CEE7002BD2D030
:10194000A042D0DD601CCEE7002C01DA0020B6E713
:1019500000208342E4D1C0E7E4B30200546C0300EA
:10196000F0B5060085B017001B2805D10A9A9742EA
:1019700009D0002005B0F0BD19281AD01C281AD0B3
:101980000A9A0A9717001A000B0011000A9A01928E
:10199000BA4200D901971D000C0000230093009B60
:1019A000019A934209D10A9BBB4220D0E1D3012086
:1019B000E0E71A26EAE71D26E8E70295039401CD41
:1019C00002CCF1F709F8002802D0009B0133E5E7CB
:1019D0001B2ECED0039B30001A68029B1968FBF7C0
:1019E000FDFC044BC01A43425841C0B2C2E71A2E54
:1019F000DDD1BEE7CCE70200F0B51E0085B0039054
:101A000018680D001700F0F751FF736801900293FA
:101A10000024022F0ED90123B2682900F1F706F93C
:101A20000400032F06D029000123F2680198F1F782
:101A3000FDF80500A54202D80848FBF7C7FC039A49
:101A4000A3000299D058F0F7C7FF002801D1013454
:101A5000F0E701206400204305B0F0BD6E6C030088
:101A6000002313B5044A046A09050093890C8A58B7
:101A7000A16B14F0BCF913BDACD20200F0B587B075
:101A800000931B7804000F0002922A2B05D1826874
:101A9000525C002A01D0A62A14D11A00213A022A47
:101AA0002DD8A568E8190378032B5CD104A96668D2
:101AB00014F067FAAB19984206D1676004992000C8
:101AC00014F0C3F907B0F0BD0378032B4BD105A97F
:101AD00014F057FA009B1B78212B04D1049B059A24
:101AE00013430493E6E7222B03D1049B059A53404A
:101AF000F7E7232BDED1059B049A1340F1E71A0088
:101B0000243A022A00D986E0A368D8190193037801
:101B1000032B28D1636804A9039314F032FA06005A
:101B2000019B039A9B189E42C7D0B378B01C75786E
:101B3000032B18D105A914F024FA0600372D35D14E
:101B4000059A1F2A0FDC4249049B114199420ADB86
:101B5000C021090611418B4205DB93400493049A8E
:101B600053005340DCD500226368029DDB1B0193C8
:101B7000561CED0969D1019B0135DB09FCD102320C
:101B800052193900200015F033FB0400009B029A23
:101B90001B7831001A330370013014F0AAF8701C5E
:101BA0002018019A290014F0A4F88BE7392D08D1E8
:101BB000059B1F2B01DD1F230593049B059A1341F1
:101BC000CCE72F2D03D1049B059A9B18C6E7302D37
:101BD00003D1049B059A9B1AC0E7312D09D10599C1
:101BE0000498F6F711F90028BDD1059B049A5343D8
:101BF000B4E7332DB7D00599352D06D10029B2D0E1
:101C0000049811F02DFA0490A9E70029ABD00498AC
:101C100011F036FAF7E7272BA5D1A368D8198378F6
:101C2000032BA0D14578023014F0BAF92F2D01D141
:101C3000049042E7302D06D14042430004905840C2
:101C400000D43AE78FE7C043F2E7320090E7C0469E
:101C5000FFFFFF3FF0B597B00890C020002560233C
:101C60000AAC80000F00160025706360A56014F0B8
:101C70002DFB2561E0606561A561E5612762E56294
:101C8000A84218D1C449C54811F0CCFA0023060077
:101C900013930D9814F03CFB002E00D1E1E10023DA
:101CA000BA6B39683000F6F769FC380013F087FF2B
:101CB0003000FAF713FD3822002E03D00232022E34
:101CC00000D02A000026B649009692005258200003
:101CD000B96B330014F08BF8102014F0EAFA1021DD
:101CE000040015F010FA0AADAB682A78002B00D179
:101CF00094E1002AC6D1EA68013BAB60DB00D3184F
:101D0000DA78A7499200525802921A689D88120206
:101D1000120A0592029ADB88527806920F220699DF
:101D20000A400492002D2DD030220393069B1340CD
:101D3000102B29D0202B65D0002E00D047E10123A5
:101D4000069A1A400992099A02992A405300CB1820
:101D500080215B88490107931B0B1B038B4200D03A
:101D60004DE13B00079940331B780905090D8B4273
:101D700000D02BE1002A00D123E13800FFF7BCF9A5
:101D80000135E0E76368CFE7002D01D0002E35D0A4
:101D90008022390052014031049BAB4201D8012618
:101DA000A1E7029B6E009B195B88180B0003904211
:101DB00013D108781B051B0D984221D121000AA8D8
:101DC00014F052F8002819D13B0040331B78052B42
:101DD00000D03AE17349744856E7049A6B1C934269
:101DE00006D2039A059900920AA8029A13F0FFFFFF
:101DF000029B9E1971880AA8FFF732FE002672E73F
:101E00000135C9E7002E0BD0029A6B009B5A1B0BC1
:101E1000032B47D10121200015F0B5F900230370F1
:101E2000049BAB4242D880200026029B049A0233D6
:101E30005100C9184001994271D1A368039A9818BA
:101E400000230493A2686368D318984272D3029B5C
:101E50001B78052B01D00C2B00D10126029B597851
:101E600040230B405842434149B25B421E40002987
:101E700000DA01260025039B0695D0180795049BE0
:101E80009D425ED1002E02D1079B012B69D006999D
:101E9000200015F0DCF9029B059A03992000FFF75A
:101EA000EDFDABE7012D00D879E78DE78021029B9E
:101EB0006E009E19738849011A0B12038A4225D1BC
:101EC0003A0040321278DBB29A421BD1072A07D17E
:101ED000B96CF86CFEF7F0FD0100200013F07DFFF7
:101EE000002D0AD1029B5B787F2B06D90E9B200028
:101EF000591C06930E9113F0A8FF3800FFF7FCF869
:101F000001358DE7002D00D149E75DE7039A6B1C91
:101F100000920599029A0AA813F069FF6AE71A88E5
:101F2000150B2D03854203D1D2B2062A00D9012612
:101F3000023380E7049B01210133049313F0FCFE7C
:101F400080E7069A037801320692002B04D0079BA3
:101F50000133079300230693012113F0EDFE0135B1
:101F60008DE7A268039B944663441D00049B9E4238
:101F700000D143E72B78002B07D1A3680122E91A8F
:101F8000200015F06CF90136F0E72800012113F06C
:101F9000D3FE0500F7E7C046856C030074AA020073
:101FA000ACD20200AD6C030048A90200012D00D1A3
:101FB000F5E601232A001A402ED0049A032A0DD0F8
:101FC00002E721000AA813F04FFFD9E60135049B70
:101FD000022BEBD10023012D00D1E0E6069A691E09
:101FE000D20705D5029A9288120B012A00D16908FE
:101FF000012900D04FE7002B00D1FFE64BE7039A01
:10200000059900920AA86B1C029A13F0F0FE07993A
:102010000AA8FFF725FD66E61300DFE7002A00D0D7
:1020200030E63B0040331E78002E00D0CCE66368DB
:10203000002B00D1C8E62B692000591C13F005FFC6
:10204000A3686B62EB69AB6223E6022B01D10A49FC
:10205000C1E60A3B09480A49012B00D814E60949A0
:1020600012E6380013F0ABFD089A13AB13CB13C282
:10207000089817B0F0BDC046BF6C030018AC020052
:10208000F36C03003D370300F7B5019111490400DB
:102090001700002514F0FDFD7B68AB4204D80E4903
:1020A000200014F0F6FDF7BD002D03D00B492000F1
:1020B00014F0EFFD019BAE009A5909492000BE19AA
:1020C00014F0A8FE0122B1682000F0F707FC0135EA
:1020D000E2E7C046E20D0300A002030045FC020057
:1020E000236D0300004870475CD60200004870472B
:1020F0000148E80110B5F0F7C1FC80F310880148F1
:1021000010BDC046E4B30200F0B508C98DB0059318
:10211000244B06AC013800930194062300F0FCF830
:10212000E068214E214FB04202D0F5F77FF9070059
:102130001F4B20690393B04202D0F5F777F9039063
:102140001C4B60690493B04202D0F5F76FF904901C
:10215000194D38002900F6F7B3FE29000398F6F769
:10216000AFFE29000498F6F7ABFE01200523049A80
:102170000399059D5279497904354042FB5652B284
:10218000009049B2280007F0EDFA0023A2686168C8
:10219000280007F06DFA2800069907F0A1FA300030
:1021A0000DB0F0BDA8D70200E4B30200CCA202003B
:1021B000DCA20200D4A2020030B20200F0B50E6828
:1021C00087B0736807000C00002B02D11248FBF7A0
:1021D000FDF84868F0F752FC010002A814F0A4FFD3
:1021E0000025032F03D1A068F0F748FC0500002468
:1021F000039B0193A34208D9301D290007F09AFBE5
:10220000049B185501930134F2E702A90348EEF745
:1022100069FE07B0F0BDC0469C6D0300A0920200AD
:1022200070B505006B6886B00800002B02D10B4822
:10223000FBF7CCF8012203A9F0F7DAFD039E340086
:10224000049AA31B01929A4205D92178281D07F010
:1022500071FB0134F4E7024806B070BD9C6D0300C9
:10226000E4B30200F0B505006B6889B00800140003
:10227000002B02D10E48FBF7A9F8012202A9F0F7C2
:10228000B7FD20000024022205A9029FF0F7B0FD4F
:10229000059E039B0193A34206D9395D281D07F0D3
:1022A00049FB30550134F4E7024809B0F0BDC0469F
:1022B0009C6D0300E4B3020010B51C0002AB1B7858
:1022C000002904D0002B02D10E48FBF743FAA242AA
:1022D00007D1824214D003000B490C48F6F7E2F80C
:1022E00006E0824206D9121A09490848F6F7DAF8D8
:1022F000FAF7F4F9844203D2030022000549ECE71F
:1023000010BDC046B06D0300B407030090AC0200DE
:10231000D96D03000B6E0300F0B50024170087B0E1
:102320000C9D03900491059302940194059B9C429B
:1023300006D1019B039A934240D22548FBF70AFA43
:10234000039B9C4213D26B889B05F6D4019B049A95
:1023500001330193A300D058FF226B88A6001340DD
:10236000012B24D1F0F7C8FC0D9B985517E00623EC
:1023700029880022C90019433800F6F7FDFB002820
:1023800010D16B88DB0506D52A8812491248F6F76A
:1023900089F8FAF7A3F90D9A6968A300D1500134BE
:1023A0000835C3E7029B406801330293D4E7022B50
:1023B00001D1F0F763FB0D9B9851F0E73B68029A5F
:1023C000DB08934201D90548B8E707B0F0BDC04625
:1023D000516E03003A6E030090AC0200726E03006F
:1023E000A3230021024A5B000248D1527047C04635
:1023F0007C2E0020E4B30200A3230121024A5B00EB
:102400000248D1527047C0467C2E0020E4B302003F
:10241000A323044A5B00D35A0348002B00D103488E
:102420007047C0467C2E0020CCE70200C4E70200C3
:1024300010B501F07FFE014810BDC046E4B30200B4
:1024400010B50C4C002808D1FC34236D18005A1C20
:1024500002D0180113F034F910BD0868F0F70EFB34
:10246000FC34031E044803DA01235B422365F3E7CF
:102470001B09FBE77C2E0020E4B302000300203B95
:102480005E2B00D93F20052320384343014A1068C2
:10249000C018704768000020044B0B6043684B6015
:1024A00083680800CB6000238B607047FCE102006A
:1024B00070B50500080068430130401008300C007A
:1024C00013F0F7FE0122044B857103600379447118
:1024D0009343037170BDC04608E5020010B503794F
:1024E000DB0702D50148FBF735F910BD906E0300FC
:1024F00070B50500202013F0DCFE05210B4B040015
:1025000003600800FFF7D4FF6B68EA68A0602361EE
:1025100062602A7C2000A276AA689B1863616B7CAB
:10252000E37613F022FF200070BDC0464CE50200A8
:1025300070B50D000400FFF7D1FF2800F0F79EFAF8
:102540000100092802D90448FAF740FF200013F0DF
:102550006EFF024870BDC0462B420300E4B3020088
:10256000F7B5C3684269040093420BD1037E052B83
:1025700008D1C37E181E43D0200013F0F6FEA068D9
:1025800013F063FF012500266B1E0193A76832003C
:102590002900380013F017FF3200030001993800BA
:1025A000013613F01DFF052EF0D10135052DEAD1BE
:1025B00000252A0000230421A068013513F010FF34
:1025C000052DF6D1227E637E9A421AD2207FFFF734
:1025D00055FF002507000426227E7B5DB21A1341B9
:1025E000012213400832534304212A00A068013518
:1025F00013F0F6FE052DEFD1237EA068013323767C
:10260000FEBD9A42F8D1E36861695A1CE2608A42D1
:1026100005D120232377A023DB002383ECE7587820
:102620002077FFF72BFFA17E0500002901D0064B84
:10263000F3E713F071FE40422076280013F084FE89
:1026400001306076D8E7C046FF050000F0B50C0009
:102650000B6889B0070018000493FFF73FFF656817
:102660002800F0F723F91E4B984202D01D48FBF7D3
:1026700071F8072F01D11C48F9E7A068F0F7FEF9BF
:102680000690E068F0F7FAF907902069F0F7F6F99C
:1026900005906069F0F7F2F9059B0600002B01DB5D
:1026A000002802DA1148FAF791FE062F14D0A0692B
:1026B000F0F7E4F90700E069F0F7E0F9059B039013
:1026C0000093280002970196079B069A049913F03D
:1026D000EAFE074809B0F0BD00200700EEE7C0465B
:1026E00008E50200BD6E0300D06E0300EA6E030031
:1026F000E4B3020070B5040008001600F0F7BEF95C
:1027000005003000F0F7BAF90600002D01DB0028C3
:1027100002DA0C48FAF75AFE200013F0AFFEA84286
:1027200004DD200013F0B8FEB04201DC0648F1E7FA
:1027300032002900200013F093FE430001201843CB
:1027400070BDC0462D6F0300466F0300F8B50D0045
:102750000C682000FFF7C2FE6868F0F78FF90600EA
:10276000A868F0F78BF90700002E01DB002802DAD9
:102770000F48FAF72BFEE868F0F780F90500092802
:1027800001D90C48F5E7200013F078FEB04204DDD3
:10279000200013F081FEB84201DC0748E9E72B0076
:1027A0003A003100200013F01BFE0448F8BDC0467B
:1027B0002D6F03002B420300466F0300E4B30200B9
:1027C000F7B50E0025490400019214F023FB019B8C
:1027D000002B03D12249200014F01CFB21492000CA
:1027E00014F018FB0025300013F056FEA84225DD3A
:1027F0000027300013F042FEB8420CDD39002A00F9
:10280000300013F02DFE184B18491A5C200014F00C
:1028100001FB0137EDE71649200014F0FBFA019B9C
:10282000002B09D1300013F037FE0138A84203DD38
:102830001049200014F0EEFA0135D4E709492000D0
:1028400014F0E8FA019B002B03D10B49200014F08F
:10285000E1FA0A49200014F0DDFAF7BDD36F030056
:10286000DA6F0300E66F0300E86F030082000300E5
:1028700095400300E06F0300654F0300A0020300D2
:10288000F0B50E00110000228BB01C000092032353
:102890003000FFF711FD032E00D9D5E0300007F01E
:1028A00033FA020B919105210800FFF701FE0700A2
:1028B000380013F0CAFD18E02068644B0340062B73
:1028C00007D0830700D07AE0614B02689A4200D0BB
:1028D00075E007A9EEF794FF079B03900593012B82
:1028E00006D1007813F0DBFF070038000BB0F0BD15
:1028F00000231E00039A029303990598511A8842F7
:1029000015DD11780A2901D03A2908D19E4200DA52
:102910001E00029B0133029300230132ECE70133D6
:102920002029FAD03929F8D94A48FAF74FFD002B67
:1029300005D0029A013202929E4200DA1E000299EC
:102940003000FFF7B5FD002507002C00039B049322
:10295000039A049B9B1A059A9A4223DD049B1B78D9
:102960000A2B01D03A2B0FD1A64207DD210000230C
:102970002A00380013F034FD0134F5E70024013556
:10298000049B01330493E3E7202B07D100232100AC
:102990002A00380013F024FD0134F1E7392BEFD879
:1029A000303BF4E7029BAB429FDDA6429DDD210058
:1029B00000232A00380013F013FD0134F5E7264800
:1029C000FAF7C8FE2068F0F759F805006068F0F7DC
:1029D00055F8029001002800FFF76AFD0700022E5B
:1029E00000D165E7012207A9A068F0F701FA002DE0
:1029F0000BDB029B002B08DB0024089B0394049351
:102A0000029B049A6B43934205D014488DE7039BC5
:102A100001345B190393029B9C4200D165E70026B9
:102A2000AE42F4D0039A079B9446049363449A5DA4
:102A3000131C092A00D909233100DBB22200380017
:102A400013F0CEFC0136EBE70548B9E7070080FF3D
:102A50000C9A0200566F03007F6F0300976F03000C
:102A6000B46F0300F0B585B0019105000021019815
:102A700007F024FB041E02D02148FAF7A7FC280027
:102A800013F0FCFC0600280013F006FD01003000E6
:102A9000FFF70EFD0700280013F0F0FCA0422CDD2C
:102AA0000026280013F0EAFCB04224DD32002100A9
:102AB000280013F0D5FC08F0C1FA019907F092FF45
:102AC0000AF096F800220F4B08F042FB0E4B002252
:102AD0000290039107F0B8FA0923002804D0029865
:102AE00003990AF015F8030032002100380013F0B2
:102AF00077FC0136D5E70134CDE7380005B0F0BDED
:102B0000026F03000000E03F00002240F0B587B0F4
:102B100004910592070013F0BFFC0400380013F085
:102B2000ADFC0290049813F0B7FC0190A04202D0D3
:102B30001948FAF74BFC01990298FFF7B9FC0025F8
:102B40000390029B9D4223DA0026019BB3421DDDC8
:102B500032002900380013F083FC32000400290001
:102B6000049813F07DFC059B002B0AD02318092B39
:102B700000DD092332002900039813F031FC0136EF
:102B8000E3E7231ADA43D2171340F3E70135D8E716
:102B9000039807B0F0BDC046F36F0300F8B504001A
:102BA00008000D001600EFF781FE164FB84201D065
:102BB00000200FE0053C042CFAD8200007F09AF81A
:102BC000141403F80B003000EFF7BCFF011C2800C1
:102BD000FFF748FFF8BD3000EFF7B4FF011CFE20FF
:102BE000800507F027FDF1E73000EFF75FFEB84200
:102BF000DED1624262413100D2B22800FFF786FF87
:102C0000E8E7C04608E50200F7B507000193142085
:102C100008AB0E0015001C7813F04BFB044B47600B
:102C20000360019B8660C56003744474FEBDC046AA
:102C300088E5020070B505000C2013F03AFB052171
:102C4000044B0400456003600800FFF731FCA060FE
:102C5000200070BDB0E102000139C9B2054B401837
:102C600080301970044A03781370044AD25C044B14
:102C70001A707047372E0020382E0020CF810300B5
:102C8000362E00200131C9B2054B40188030197032
:102C9000044A03781370044AD25C044B1A707047DC
:102CA000372E0020382E0020CF810300362E002042
:102CB000074B984206D9074B1818074B4118C918FB
:102CC00008787047054B18184118054BF7E7C046C0
:102CD000A4920000108003005B6DFFFF24700300CE
:102CE0000083FFFF03002022F0B57F254F265F27DA
:102CF000803304001A7089B003007F3019780A000D
:102D00002A406F2A26D90A003A401900013381313E
:102D10000A709842F2D17F22B64B1A702300643AAF
:102D2000FF331A70E4320292531CB348DBB20493AF
:102D30000370E31880331B78B0490B705B2B0ED106
:102D40009B22029B0A700133DBB20370E254012024
:102D500009B0F0BD5F2AD8D90A003240D5E72E2B42
:102D600013D10232D2B20270A21880321278A14876
:102D70000270A348825C0120024206D1029A0B70C5
:102D80001218D2B20292A354CEE10220994A1370D3
:102D90009B4AD25C104000D0A1E0002A15D1964891
:102DA000203203780A70E31880331A70029B0133D3
:102DB000DBB202930370782B01D8E254B4E19B2379
:102DC000029AA354049B0B70C1E716007F2552B2F0
:102DD000AE430E70002A03DB8A4B8B4A1A60B7E7BA
:102DE000413B8A4ADBB28A49D25CCB5C1202134374
:102DF0000393039B002101339BB218000393FFF759
:102E000057FF0306F5D5012300260127794D2B70C6
:102E100039000398FFF74CFF7B1CDBB20193282895
:102E20005FD1002E00D02F702D780135EDB2290032
:102E30000398FFF73DFF6B1CDBB2292854D17F2696
:102E4000069306990398FFF733FF069B3040013342
:102E5000DBB23D284AD10026684B049A1870664BB5
:102E60001A70644B019A1A70049B0593059B019993
:102E7000E31880331B7803980793FFF719FF079B2C
:102E80009842B6D1019B0133DBB20193AB422FD103
:102E9000002E02D0584B059A1A70049D013FFFB2D4
:102EA000544B390003981F70FFF702FF534E03067F
:102EB00000D509E1504B7F211870514B1B5C1A0063
:102EC0005BB28A433270002B18DA4B4B013DEDB2F6
:102ED0001D70631980331B789842DFD089E74D4B12
:102EE00086E70126019F93E71D00A0E70693A8E768
:102EF000059B01260133DBB20593B7E7307020282C
:102F00001BD0232825D02E282CD0262832D040288C
:102F10004ED05E2856D02B285CD03A2800D02EE127
:102F2000202629002000FFF797FE344A137833400B
:102F30001370B3D0304B1D78F3E729002000FFF762
:102F40008BFE0023F356002B00DA52E72A4B1D7844
:102F5000A4E729002000FFF77FFE402233781342C8
:102F6000F4D146E729002000FFF776FE33781B07EF
:102F7000ECD43EE729002000FFF76EFE10223378E4
:102F800013403370E2D11C4B1B78E1188031097873
:102F90003170482900D02CE7013B1749DBB20B7098
:102FA000E31880331B789343432B00D021E7CDE710
:102FB00029002000FFF750FE0422337813403370BD
:102FC000C4D116E729002000FFF746FE33789B06A0
:102FD000BCD40EE7084B013DEDB21D70651980357C
:102FE0002B78452BB2D010229343492B00D000E719
:102FF000ACE7C046382E0020372E0020362E0020A9
:10300000CF810300040000201070030055820300EC
:103010003B820300A59200006B1C924ADBB2137046
:10302000E31880331B7890490B70452B36D1A81CD0
:10303000C0B2231880331B788C4E33708C4EF656FA
:10304000002E02DB874B1D783FE010700B70522B77
:10305000F8D0532BF6D0442BF4D04C2B08D10335A9
:10306000EDB21570651980352B78592BEAD0C0E682
:10307000462B00D0BDE6EB1CDBB21370E3188033A7
:103080001B780B70552B00D0B3E60435EDB21570EC
:10309000651980352B784C2BD4D0AAE6492B00D06B
:1030A000A7E6AB1CDBB21370E31880331B780B7000
:1030B0004E2B00D09DE60335EDB2157065198035B5
:1030C0002B78472BBED094E6059D019B03980133D6
:1030D000DBB20193019A654B11001A70FFF7E8FD0E
:1030E000019B069A5F4F934220D100257F272E0037
:1030F00001990398FFF7DCFD03003B403D2B04D012
:10310000029A0132D2B20292A354019A0132D2B28F
:10311000010600D4A2E0002E02D0544A0199117099
:10312000514A1370059B0493049AFDE5504B7F218F
:103130001B5C4D4E1A005BB28A4338703270002B14
:1031400008DA0135EDB2631980331B783D70834294
:10315000BBD04EE63070202816D023281ED02E2853
:1031600026D026282DD0402848D05E2851D02B28A4
:1031700058D020263A2864D0252800D14CE73D4B72
:103180003D4A00201A60E3E529002000FFF77AFDA0
:103190000023F356002B00DB54E72AE62900200029
:1031A000FFF770FD40223378134200D04AE720E653
:1031B00029002000FFF766FD33781B0700D541E7A3
:1031C00017E629002000FFF75DFD10223378134039
:1031D000337000D036E73B78E118803109783170E0
:1031E000482900D005E60133DBB23B70E318803399
:1031F0001B789343432B00D0FBE523E729002000F5
:10320000FFF740FD042233781340337000D019E7F4
:10321000EFE529002000FFF735FD33789B0600D548
:1032200010E7E6E50135EDB23D70651980352B7884
:10323000452B00D106E710229343492B00D0D8E557
:1032400000E729002000FFF71DFD074A13783340EF
:10325000137000D139E7034B1D78F2E70192012684
:1032600046E7C046372E0020362E0020382E00209C
:10327000CF810300040000201A700300F0B503683A
:1032800099B00700986807910FF0BEFC431E0493A5
:10329000031D9B00FB1802933B0001220F218000BD
:1032A00014331B180393FB6806A81A4009180A7008
:1032B000032293430A930CA8F9F7EAF9031E00D0FE
:1032C00040E3079A7D68BC68002A00D19DE22A7815
:1032D0005E2A00D199E207980793F9F791FF04005D
:1032E0000AE0D64B63600434D54B9A6C002A00D1B7
:1032F0008AE200229C6C9A64F9F7E8F90D9421E3C4
:10330000D04BEFE7D04BEDE77F216B785B06DB1707
:103310003278DB01100052B2084003430136002A24
:10332000F6DB01225B001343DCE700237F213278C8
:10333000DB01100052B20840C3180136002AF6DB48
:10334000DB000622EFE703220336964308CEC9E7E7
:103350000023C7E700237F213278DB01100052B23F
:103360000840C3180136002AF6DB9B005B42029A34
:103370009858002800D027E3B449B5480FF052FF11
:10338000ADE700237F213278DB01100052B2084004
:10339000C3180136002AF6DB029A9B005B4298585C
:1033A00012F01EF9E5E700207F223378C0011900F2
:1033B0005BB2114008180136002BF6DB251DF9F72A
:1033C0000FFA60603EE000207F223378C0011900D0
:1033D0005BB2114008180136002BF6DB251DF9F70A
:1033E000CDF9EEE700217F223378C90118005BB2E6
:1033F000104041180136002BF6DB206811F0EDFA81
:10340000206071E700217F223378C90118005BB288
:10341000104041180136002BF6DB220001CCF9F7F1
:1034200059FB61E700207F223378C00119005BB2AD
:10343000114008180136002BF6DB21000839251F42
:10344000F8F73AFC2C004FE7251DF9F7E1F9B8E74A
:10345000251F042221682868EFF798FC2860F1E70F
:1034600000237F213278DB01100052B20840C318DC
:103470000136002AF6DB9B005B42029A21689950D4
:10348000F7E000237F213278DB01100052B20840C0
:10349000C3180136002AF6DB029A9B005B422168C2
:1034A0009858251F12F09EF8CCE700207F22337831
:1034B000C00119005BB2114008180136002BF6DB81
:1034C0002168251FF9F7BAF9BCE700207F2233787D
:1034D000C00119005BB2114008180136002BF6DB61
:1034E0002168251FF9F7C2F9ACE700217F22337864
:1034F000C90118005BB2104041180136002BF6DB01
:10350000231F1A682068F9F70DFB083CECE622003F
:10351000231F083A216812681868EFF737FC0C3C43
:10352000E2E600237F213278DB01100052B208402E
:10353000C3180136002AF6DB029A9B00D31A1A68D8
:10354000002A00D118E700221A60CDE600257F226C
:103550003378ED0119005BB211404D190136002B93
:10356000F6DB029BAD005D1B286812F039F80028DD
:1035700000D101E70021286812F034F8B4E60020F9
:103580007F223378C00119005BB211400818013660
:10359000002BF6DBF9F75EF9A6E600207F223378F0
:1035A000C00119005BB2114008180136002BF6DB90
:1035B000F9F768F998E6236894E62368A360231F67
:1035C0001B68636008348FE6231F19682268216036
:1035D000BAE7221F1368216823602300083B18689C
:1035E0001060196080E6737832781B021343ED187F
:1035F000184BEE1878E633787678206836021E434A
:103600000196EFF779FBEE1C251F2C00002800D156
:103610006AE6114A019B94466344F61864E63378DF
:103620007678206836021E430196EFF765FBEE1CA4
:10363000251F2C00002800D056E6EAE7C4E7020068
:103640007C2E0020E4B30200CCE702006F8203006E
:10365000B0AA02000380FFFF0080FFFF3378767876
:10366000206836021E430196EE1CEFF745FB00284A
:10367000CFD1043C38E633787678206836021E4392
:103680000196EE1CEFF738FB0028C2D0F1E7F121DC
:103690002668220030004900F9F71CFA2300F021C7
:1036A00008331A00300049000193F9F713FA00219A
:1036B000019A080011F082F9AB786A781B02134373
:1036C0000A9A0F210C320A920A9AEE1CF318136020
:1036D000022206ABC9180B780A9D1A43231D134317
:1036E0006B6000230A9A0B709360A060019CFBE55D
:1036F00025002368B54A0193083D934209D16360D0
:10370000A3602A000021032011F058F9019B2B60CF
:1037100098E60122019B134005932AD0231F1A68C3
:103720000592019A5210012A0DD1A84A0C3C1A6048
:10373000E260226100212200032011F03FF9059B85
:1037400023600323E3E72A68002106929F4A0320AF
:103750002A601A602300103B22601A00019311F0C6
:103760002DF9019B069A0C3C1A60059B23600523EA
:10377000CDE7019B63601800EFF798F8934B20604A
:10378000A3602A000599032011F018F9EFF7B4FAA5
:1037900000280DD001228D4B06A92B600A9B5B6887
:1037A00013400E32521813700A9B0C3B0A9349E6E1
:1037B0006368ACE7737832781B021343844AEB18D2
:1037C0009B186360EB78083423600F267F2102206A
:1037D000012506AA2368B6180B4206D1221F1668D7
:1037E000002B00D191E6183C7EE50A9A013B526815
:1037F00002426FD0220008C20523636014000A9BB6
:103800001E680A9B0C3B0A9335007D602B786E1C6A
:10381000180010385A2800D905E306F07FFA62FD37
:1038200071FD73FD040375FD040386FD94FD99FD90
:103830009BFDB2FDC4FDD4FDE3FDF3FD03FE15FECB
:1038400019FE21FE32FE46FE56FE66FE78FE82FE20
:1038500097FEB0FEBEFE0403040304030403CCFE83
:10386000CEFE2AFFD5FEDAFEE4FEECFE00FF1FFFCF
:103870002CFF04030403040338FF69FF63006300A3
:103880008000AE00BF00DD00DD00CBFFB30004030D
:103890000403040304030403040304030403E9000E
:1038A000FB0004030D011C01040325015201370133
:1038B00073018901380268029602800204039E01A6
:1038C000A901B401C101CD01EA0104022102CE0225
:1038D000ED02FE020A9A52682A4032700A9A0C3AA5
:1038E0000A9279E7737832781B0213430A9AEE1C26
:1038F0000C320A920A9AF31813602B7806A9403BFF
:103900005A4253410F22521810785B000A99034320
:1039100023434B6000230A9913708B60E4E423680F
:103920002A4A934200D1A4E6DA0707D55B10DBB23E
:10393000043C012B00D048E70222CEE1F8F7C6FE96
:1039400023680D930D9B23491868F8F7C5F90028E3
:1039500000D1AEE27A68002A00D1AAE21378432BA4
:1039600000D098E2937850781B02D11C0343CB1807
:103970007B60BB68103BBB609DE400212068F9F7C9
:10398000F5F83DE52500210020680C35F9F7EEF843
:10399000844200D156E50023236012E520003378ED
:1039A00076780C383602BC601E4303680196EE1C24
:1039B000002B02D12300083B1868F9F711F9002801
:1039C00002D1103C019B28E660608CE4E4B3020065
:1039D0000380FFFFDCAB020001220A9B06A95B68A3
:1039E00013400E32521813700A9B0C3B0A937BE46F
:1039F00000207F223378C00119005BB21140081803
:103A00000136002BF6DB8100641A04342100F2F742
:103A100031FEF5E400207F223378C00119005BB24B
:103A2000114008180136002BF6DB8100641A0434BB
:103A3000210013F015F8E3E400207F223378C00161
:103A400019005BB2114008180136002BF6DB251D6A
:103A500011F0D9FEB5E42500231F083D1A6821683E
:103A6000286811F009FFEDE400207F223378C001BF
:103A700019005BB2114008180136002BF6DB8100FB
:103A8000641A04342100ECF7D7FDB9E400237F2148
:103A90003278DB01100052B20840C3180136002A08
:103AA000F6DB251F28682168022B03D1CC4AF4F7E6
:103AB00009FAD3E4083C0A0001002068F4F702FA8E
:103AC0009EE400237F213278DB01100052B20840CF
:103AD000C3180136002AF6DB9A08920052421059A8
:103AE000032221681340251F002B02D100F074FB34
:103AF000A8E4012B03D12A6811F0BEFE05E50DF004
:103B000069FD9FE400257F213378ED011A005BB247
:103B10000A4055190136002BF6DB220029002068E7
:103B2000F9F71CFAAF4B5D19AD006419FFF7DCFB28
:103B300000257F213378ED011A005BB20A40551948
:103B40000136002BF6DB220029002068F9F75AFA2B
:103B5000FF222B0A13401540E5E70322F31C934391
:103B60000022186811001E1D251D0EF09EFF28E47E
:103B70000322F31C9343251F2268296818681E1D21
:103B80000EF093FF6AE40322F31C934319795E1D40
:103B90008A00A41A0434220018680EF0A2FF2FE451
:103BA0000322F31C934318798021C24349009200F9
:103BB0005E1DA4180143EEE700207F213378C00189
:103BC0001A005BB20A4010180136002BF6DBFF2505
:103BD000FF220100C3096D0011402B405B189B00C0
:103BE000E41A000A0240231D2068F8F7C9FEFFF717
:103BF00007FC00217F223378C90118005BB2104016
:103C000041180136002BF6DBFF22CB09520013408E
:103C1000CAB29B189B00E41A083C22000020F9F766
:103C200047F8FFF7EDFB00237F203278DB0111001E
:103C300052B20140CB180136002AF6DBFF211800F2
:103C4000FF250840DA096D002A40451C52199200F0
:103C5000A41A1B0A1940220010F0B0FEFFF7D0FB97
:103C600000217F223378C90118005BB2104041184F
:103C70000136002BF6DBFF22CB0952001340CAB2FB
:103C80009B189B00E41A0C3C22000120C7E70F227E
:103C900006ABD2181378002B00D14DE601210A9B08
:103CA0005B680B4013700A9B0C3B0A9344E60A9B2B
:103CB0005B6813420ED003220A9B21685B68934322
:103CC0001C0059609A600A9B08341E680A9B0C3BD2
:103CD0000A9399E50A9B0C3B0A930A9B03998B4232
:103CE000E5D2F8F7F3FC0020BC6019B0F0BD6B78AA
:103CF000022B03D1043C2068FFF7EFFA002BFAD126
:103D00000A9B039A934203D237493848FFF736FBA0
:103D10009868002801D0FFF7E0FA0C3BF1E7231F79
:103D20000593079B0193231F1868019B002B19D053
:103D30000021079B07910193019A0BABF9F7E6F974
:103D40000B9B012812D12E002360F8F7BFFC0F2334
:103D500006AA9B181A780A9B7E601343BC60FB601E
:103D60000120C2E70BAB019A2168E7E7002811D1D7
:103D7000043C002B00D11A4B2360019B002B19D06F
:103D80001B4918000FF058FA002813D0F8F79EFCD2
:103D9000019BD6E5174918000FF04EFA002805D010
:103DA0000B98F4F74BFB043C2060E6E7F8F78EFC39
:103DB0000B9BC6E5059CFFF797FA00207F2233781E
:103DC000C00119005BB2114008180136002BF6DB68
:103DD000251F2A682168F9F731FAFFF73FFBC04633
:103DE000E4B30200FFFFFF3FB5820300A0AB020077
:103DF000D0A80200DCAB020000217F223378C90189
:103E000018005BB2104041180136002BF6DB25008C
:103E100001CDF9F725FAFFF7D4FA2068251F10F035
:103E2000E8FDFFF70FFBAF2B05D80120803B5B00BF
:103E30000343FFF757FABF2B04D8B022D31A9B00D5
:103E4000FFF795FACF2B04D8C022D31A9B00FFF7B7
:103E500014FBD62B06D8D03B18002168F8F71EFDBE
:103E6000FFF7CEFAFA2B08D8251FD73B1800226897
:103E70002968F9F7B3FAFFF7F1FA454945480FF019
:103E8000D1F90400F8F722FC049B04339B00FB18D3
:103E90005C60022029E75E2B0BD1BC680D98231DC6
:103EA000BB60F4F7CBFA60607B6801337B60FFF79F
:103EB00002FA0D9B384A93422AD0384A934227D0BF
:103EC0003B6898680EF0A6FE0EF0A4FE7B68051D08
:103ED00028005C1B0EF098FE060028000EF09AFEEB
:103EE00005000EF091FEA41B060028000EF092FEC5
:103EF00005000EF089FE019028000EF08BFE0122D5
:103F00000378002B09D1330001990D98F4F736FBA3
:103F10000F2306AA9B1801211DE059B2002909DBD5
:103F200019001F255B09294001308C42EBD3641A2C
:103F3000D218E5E70F21E0251940ED001B012B40C9
:103F4000457802302B43F0E70A9A52680A401A700B
:103F50000A9A0C3A0A921A78002AF5D10A9903981B
:103F60000D9A81420DD3012119700A9B02311B6801
:103F70007B600A9B5B688B430A9904338A601A60F2
:103F8000F9E4049B04339B00FB185A6081E7C046A8
:103F90009B820300ECAA020048A7020058A7020077
:103FA000F0B5304B8FB007AE0138009304310723D2
:103FB0000196FEF7B1F90023B0682B4F0393B84286
:103FC00003D0EEF75BFDC3B2039370691825B842C6
:103FD00002D00EF06FFF45B2B0691924B84202D08A
:103FE0000EF068FF44B23069B8420DD005AA022134
:103FF000EEF708FE059B18680EF05CFF059B45B2C6
:1040000058680EF057FF44B201210E00A022AE40C6
:10401000A140164BD205D75815483E430590D650BF
:10402000D6588E43D650134A03218550C4502800D9
:1040300014F0A8FD2000032114F0A4FD079905A8A1
:1040400005F076FA0A9B039A089905A805F080FA0C
:104050000799094805F0F6FE084B01301880024820
:104060000FB0F0BD60E60200E4B3020014050000EA
:10407000002000400C050000C8320000C02D0020C8
:1040800010B5F5F743FB034B002800D1024B180095
:1040900010BDC046CCE70200C4E70200F7B50D0032
:1040A00014001E00002A07D0F5F730FB002805D1C8
:1040B0000B230124336064422000FEBD2E002F1923
:1040C000F5F730FB741C3070BC4213D00A4B1B88D0
:1040D00000930FF016FB0190F5F718FB260000285F
:1040E000EED10FF00EFB019BC01A009B8342F3D868
:1040F000641BE1E73C00FBE7C02D00200F2310B557
:104100001940012908D00300002909D0022909D14A
:1041100011F0D6FA030003E0044B002800D1044B51
:10412000180010BD11F0E7FAF4E7C046CCE7020032
:10413000C4E7020000B58BB0F9F788FE684612F0BC
:10414000C2FB054BD968091A8908F9F73BFEF9F754
:1041500095FE0BB000BDC0467C2E0020002803D089
:10416000012807D0002004E08B680448002B00D110
:10417000034870478B685B001843FAE7CCE70200FE
:10418000C4E70200044B88600B60044B08004B60DE
:104190000023CB607047C0466C980200EB680200B9
:1041A00000238168F0B5CA0F094C521852100E193D
:1041B0009A4201DC0748F0BDC568F11A9C008900ED
:1041C0002C196D5827682560C46801336750EFE7E4
:1041D000FFFFFF3FE4B3020070B583680D00416844
:1041E00004008B4212D3C900C06812F080F86368E3
:1041F0000A495A00A3686260D21A013352189B0020
:10420000E0609200C018002114F0DFFDA368E268AE
:10421000591C9B00A16002489D5070BDFFFFFF3FED
:10422000E4B30200F8B5070016004C10836812D5FD
:10423000E41810D500240D4D38002900FFF7CCFFFD
:10424000BB68591E9B00FA68181F8C4207DBA4004C
:104250002800A650F8BD9C42EDD91C00EBE7D3180E
:10426000083B1B68013913500300ECE7E4B302007C
:1042700070B50025040085601021C06812F037F881
:1042800004232900E0606360102214F09EFD0148C1
:1042900070BDC046E4B3020030B50C0085B0104BD1
:1042A00002AD04310093013802230195FEF734F882
:1042B00023680C4C996801290FD9D8680A4B029AD7
:1042C000C91889004118A24200D100222D79074B5C
:1042D000002D00D1064B12F016FB200005B030BDBA
:1042E000ACE60200E4B30200FFFFFF3FC4E70200B8
:1042F000CCE7020070B50C680B00A1680200002931
:1043000003D11949194810F095FB2068012A27D0DC
:104310005A680023EEF78AFCE168A26886008B19D0
:10432000013A1D680436A260121A92008919180019
:1043300014F038FD0021A368E0689A00115061680C
:1043400004290BD95B00994208D949088900E06823
:1043500011F0CDFF6368E0605B086360280070BD0A
:1043600001225242D5E7C046D482030084A902004C
:1043700007B5009001910220694612F02CFB6946B6
:1043800001900220FFF7B6FF00480EBDE4B3020023
:1043900070B50E000D490500002412F07AFCB368D8
:1043A000A34204D828000A4912F073FC70BD002C07
:1043B00003D00849280012F06CFCF168A300012228
:1043C00059582800EEF78AFA0134E8E70F35030060
:1043D0001D06030045FC020070B5032604000D0015
:1043E0000E4029D1174B0A689A4225D183688A6802
:1043F00099184368994210D904318900C06811F0B6
:1044000076FFAA68A368E0609B181A1D9B00626093
:10441000C0181022310014F0D8FCA368E968980095
:10442000E3681818AB689A0014F0B3FCAB68A26894
:10443000D318A360044870BD2900200012F0D4FAFC
:10444000F8E7C04688E70200E4B302000B4B70B502
:10445000050003600C000800042900D204206860F5
:10446000AC60800011F025FF6A68E860121BA400B0
:1044700092000019002114F0A8FC70BD88E702002A
:104480007FB50D00160012283ED005D8052819D09A
:1044900007283FD0002434E00300193B042BF9D84F
:1044A00093070DD1284B12689A4209D1B368009343
:1044B0008A68F368C968FDF753FA244C002820D1B4
:1044C000234C1EE0032300241340A34219D11C00F7
:1044D0001D4A3368934214D18B68B268981812F061
:1044E0009CFA0400AB68E9689A00C06814F051FCBB
:1044F000A868E36880001818B368F1689A0014F09F
:1045000048FC200004B070BD11002800FFF764FFD4
:104510002C00F6E703A91000EEF7EEFA0024A04203
:10452000EFD0039BA34200DA0394AB68039858438F
:1045300012F073FAC36804000093AA68039B042175
:10454000E86811F056FBDCE788E70200CCE70200E0
:10455000C4E70200F0B5032704008BB00E00100082
:104560000F40002A33D1002F2AD1654B0A689A42A6
:1045700026D104AAA068FDF777F9002802D1614886
:10458000F9F716F90599049BA268E0685D1A521ABA
:104590009B00890041189200C01814F003FCA36826
:1045A000AA00E818E368800018185242390014F095
:1045B0000CFCA3685D19A560534D28000BB0F0BD3D
:1045C00007A9022007940896FFF794FEF4E7042A4F
:1045D0002CD1A068002F1FD1494B0A689A421BD1E9
:1045E00007AAFDF741F9002806D107AAE168A068EB
:1045F00011F012FB0500E0E7079B0898C01A12F0C3
:104600000CFA8368E1689A00079B05009B00C918B3
:10461000C06814F0BEFBD0E7002301003200206820
:10462000EEF704FBE3688000C558C6E7364D002F5F
:1046300060D1334B0A689A425CD103AA02A9EEF713
:10464000BFFA07AA3100A068FDF70EF9002896D03E
:10465000079B029A08999E180191761AE068002E2D
:1046600027DDA368F1186368994206D9890011F023
:104670003EFEA368E0609B196360029A079BA168F5
:104680009B18F21A52180899E0689B00890041189B
:104690009200C01814F086FB029B03999A00079BB6
:1046A0009800E368181814F07DFBA3689E19A660B3
:1046B00083E79B000399C018920014F06AFB0899E5
:1046C000A268E368521A8900019359180798029B5F
:1046D0009200C018019B8000181814F063FBA368B7
:1046E000B200F018E368800052421818390014F044
:1046F0006CFBDAE702003100200012F0CFF95CE732
:10470000E8A402003B830300E4B3020010B53E2896
:1047100003D040282ED03C2813D1532924D013D8BD
:104720004C2921D007D8482950D049291CD04229EA
:1047300007D1012348E04F2903D3502914D9512927
:1047400047D02548F8F742FE68293FD006D86429AB
:104750003FD0662908D06229F3D1EAE76C2903D05B
:10476000712936D06929ECD101230420002A00D018
:10477000136010BD512926D010D849290CD006D875
:104780004229D6D0482918D00129DAD1D1E74C29BD
:1047900002D0D6D34F29D4D30423E6E76629FBD031
:1047A00006D86229C5D064290DD05329F4D0C8E7B2
:1047B0006929F1D003D86829C3D1022304E06C2908
:1047C000EAD07129BDD108231800CFE701230220C8
:1047D000CCE701230820C9E7E882030010B551287F
:1047E0003DD011D849282ED007D8422803D04828D8
:1047F00026D0012806D18B5C10E04F284BD017D86B
:104800004C2820D0002309E0682816D00AD8642854
:1048100036D066282AD06228F4D18B5601205B005E
:10482000184314E06C2803D0712811D06928E9D10D
:104830009200505810F044FF09E05200535EEDE73B
:104840005200535AEAE79200505810F054FF10BD3E
:10485000D2008A181068516810F023FFF7E7D200E1
:104860008A181068516810F037FFF0E703239200B0
:1048700050589843030002201843084BC018E6E73D
:10488000D2008A181068516808F004FA0323020065
:104890009A431300EFE792005058D8E70000808059
:1048A000F7B51700156801AA04000E00FFF72EFFE8
:1048B000402C05D1019B043C5A1EAA185D421540AC
:1048C0005A213E3C62426241B14289412B183B6011
:1048D000D2B22B00494212F0EEF804000D004F2E28
:1048E00008D0532E07D114F0C4FA00220100200092
:1048F000ECF72EFBFEBD662E06D10323022498435F
:10490000154B2043C018F5E7642E06D108F0C2F914
:104910000323040002209C43F2E75A2E0FD9802281
:104920000023D20512196B41002B04D1002A02DBAF
:1049300010F0C6FEDEE7290010F0B3FEDAE700292A
:1049400005D1064B984202D810F0D5FED2E72900D7
:1049500010F0C2FECEE7C04600008080FFFFFF3FA0
:10496000F0B589B0160005AA02931C6801900F00EB
:10497000FFF7CCFE019B0500402B06D1059B5A1E7C
:10498000A2185C423C2314400193029A63191360FD
:10499000019B3E3B03935A425341DBB20293642F87
:1049A00012D0662F0BD04F2F2AD12800042D00D90A
:1049B000042033002200029912F0A6F82CE0300007
:1049C000EEF7C0F80600F0E73000EEF7BBF808F0AD
:1049D0000FF9029B0690079108AA9B00D318083B89
:1049E00022001B680299042012F08EF8039B043405
:1049F0005A1E934108AA9B00D318083B1E68D4E7AF
:104A0000B3070BD1104B32689A4207D123002A001A
:104A10000299300010F021FE09B0F0BD3000EEF731
:104A20002DF80600042DC0D900215A2F02D9884242
:104A300000DAFF312A00200014F0C7F9019B3E2B59
:104A4000B3D12B1FE418B0E72CB90200F7B506006C
:104A50000F0014001D0064280DD0662804D04F28D4
:104A600013D19400E35105E0940018000F19EEF7FC
:104A700069F83860F7BD1800EEF764F808F0B8F888
:104A8000E4003F1938607960F4E703232B40019379
:104A900011D10E4B2A689A420DD1019A0100402093
:104AA000FFF734FE230043430200FB18019928005E
:104AB00010F0D3FDDEE72800EDF7E0FF2200030051
:104AC0003900300012F033F8D4E7C0462CB90200A8
:104AD00010B50B790349002B00D1034912F0D9F826
:104AE00010BDC046556B03004F6B030037B50C007B
:104AF000110000221D00009201232000FDF7DCFBC5
:104B0000002C05D02868EEF7F7F8034B002800D1F9
:104B1000024B18003EBDC046CCE70200C4E70200CD
:104B2000F0B505008BB008680C00ECF753FE04905C
:104B300004A812F050F800260127049B0390069366
:104B4000069B197800291AD13000F1F793FD012254
:104B5000070007A96068EEF74BF9079B089A0593D1
:104B60009B180193022D1FD9A068EDF787FF00283D
:104B700017DA089BC01814D52848F8F727FC080056
:104B8000F3F776FD002806D006A812F036F8069B4B
:104B90001B78732B00D13800069B3618013306931F
:104BA000CEE7059B181805900025B54202D33800C2
:104BB0000BB0F0BD049B01241878F3F759FD0028D1
:104BC00003D004A812F019F804000598019A0319FB
:104BD0009A42D1D3049B1B78732B10D02D19AB00B4
:104BE0000293049B013C14D3197805AA0398FFF79C
:104BF00057FE029AA300D31AFB185860F1E7210070
:104C0000ECF7BEF9059B1C19AB1C9B000594013504
:104C1000D851049B01330493C7E7C046F5820300D3
:104C2000F0B589B0039101921E00ECF7D3FD04901A
:104C300004A811F0D0FF00250290B54201D309B0BD
:104C4000F0BD049B18780028F9D0F3F711FD01247A
:104C5000002803D004A811F0D0FF0400039B019AA0
:104C60001B199A4202D21B48F8F7B0FB049B1B7831
:104C7000732B10D02D190E9BAF00DF19049B002C55
:104C800024D0A20052421978BA5803AB0298FFF719
:104C900067FE013CF2E70E9B6F1CAD00E858012255
:104CA00005A9EEF7A5F8069DA54200D925002A0022
:104CB0000599039814F06DF8039B621B58193D0089
:104CC000002114F082F8039B1C190394049B013308
:104CD0000493B2E7F5820300F0B50E0089B00390AB
:104CE00001CE0F0011F09FFF4410210004A812F024
:104CF0001BFA069D22000021280014F066F8039B91
:104D00000096013B2A1929003868FFF789FF04A99A
:104D10000248ECF7E7F809B0F0BDC046A0920200E7
:104D200030B50C0089B005000222606805A9EEF7D5
:104D30005FF8A068EDF7A2FE002806DA069B039351
:104D4000C01802D50848F8F741FB0599069AEB1EF2
:104D50008A18091820000C3000902068FFF760FFC7
:104D6000024809B030BDC046F5820300E4B302003A
:104D7000F0B587B0039205910D9A03990500521A78
:104D80000CA9097820200C00844339D030293BD06D
:104D90000CA902910121802401911C4036D0D40F2E
:104DA000A4186410171B002C37DD2600019B049308
:104DB000B34200DD04966B68049A0299286898470C
:104DC000049BF61A002EF1DC039B002B06D01A0080
:104DD00005996B6828689847039BE418002F0CDD41
:104DE000E419019EBE4200DD3E00320002992868AF
:104DF0006B689847BF1B002FF3DC200007B0F0BDA5
:104E0000074902911021C6E70649FAE701271F402A
:104E100001D11400C7E71700D6E70024D4E7C04645
:104E20001883030029830300F0B593B01C0018AB6E
:104E300020CB05901B780F0016000793CB070BD4EF
:104E40008B0703D1854B0A689A4205D03800EDF7ED
:104E500015FE01274000074381231D4209D1079B0E
:104E6000302B06D11A9B1B9A934200DA1A92002328
:104E70001B93380010F001FC0AAA1300002806DB7F
:104E8000AB070FD52B231370123B04AA9B18E1B27A
:104E9000EA0615D5022E0CD130221A704A1C5A701F
:104EA00002330DE013006A07F1D520221A7019238E
:104EB000EBE7082E3BD130221A70AA0534D4013317
:104EC00000220AA81A701B1A2C200693AB06DB17C7
:104ED00018400EAB0B9310230C931B9B0D92012BD0
:104EE00001DD40231D43402404ABDA752C400390C0
:104EF000029123D03B00019200960DAA0CA90BA8A9
:104F0000F7F7F2FA037807002D2B00D08EE004AA01
:104F1000D3750D9B1B9A013B01370D93012A00DDD0
:104F200097E00026340035E00A000E32B7E7102E75
:104F3000C6D130221A700A001732B0E70AAB0193CB
:104F400000963B000DAA0CA90BA8F7F7CDFA1B9B06
:104F500007002600012B1DDD0D9B1B9C9C4200DAE7
:104F60001C001A9BA3425EDD01261C1B2E4001D0B3
:104F70002600002401239D432F330793002C09D0E2
:104F8000103B0093002301941A0035490598FFF760
:104F9000EFFE04006B0621D5172104ABC9180B786E
:104FA000002B0AD000230122009301920598FFF7FD
:104FB000DFFE1A9B2418013B1A93069B002B0DD091
:104FC000012301930023069A00930AA90598FFF78D
:104FD000CFFE1A9B069A24189B1A1A931B9B012B2F
:104FE00001DC1A9B1B931B9B0D9A0193079B3900B5
:104FF000009305982B00FFF7BBFE2418002E09D064
:1050000020230093002301961A0015490598FFF705
:10501000AFFE24180B980EAB984201D011F078F92E
:10502000200013B0F0BD00263400A3E71B9B012B2A
:1050300000DC76E70D9B1B9C9C4200DA1C001723CA
:1050400004AA9B181B78002B00D00134069BE4189F
:1050500087E71B9C9C42F8DA1C00F6E72CB902009B
:105060003B830300F0B50600140000278DB00D004F
:105070002B78002B15D1A94217D30B78002B00D128
:1050800048E14B1C049320230025302208210420F2
:105090000893049B1B78002B11D10693013B0793C7
:1050A0005FE0252BE7D00135E2E76B1A04931A0085
:1050B000306873689847049B2900FF18DDE72D2BA3
:1050C00005D12C3B1D43049B01330493E1E72B2BBB
:1050D00001D1293BF6E7202B01D10543F3E7212B32
:1050E00001D10D43EFE7302B2CD110331D43089233
:1050F000E9E7069A4A43D318303B0693049B0133F1
:105100000493049B1B781A00303A092AF1D92E2BFC
:1051100047D1049B5B782A2B18D0049B0A210133CA
:10512000049300230793049B1B781A00303A092A42
:1051300017D8079A4A43D318303B0793049B01338F
:105140000493F0E700230A210693DAE7049B023375
:105150000493236804340793DB43079ADB171A4050
:105160000792049B1B786C3B5A425341049AD31814
:1051700004931B780593002B00D1CBE0642B00D166
:10518000A1E022D8502B29D00ED8453B022B00D8C5
:10519000A9E001220499306873689847013709949F
:1051A00052E001235B427AE7059B622B3CD057D843
:1051B000582BEED1231D0993069B01950393089B61
:1051C000029341230093313B7BE0059B712B53D02D
:1051D0000FD8672B00D886E0702BDAD1231D0993F6
:1051E000069B01950393089B029361230093513B17
:1051F00067E0059B752B5AD0782BEFD0732BC8D165
:10520000231D24680993002C49D0079B013303D147
:10521000200013F02EFE0790069B079A0193089B2F
:10522000210000932B000BE0231D09932368002B22
:105230000ED0069B04220193089B384900932B0053
:105240003000FFF795FD3F180499099C01310EE7E6
:10525000069B05220193089B314900932B00EFE741
:10526000231D099323680BA90B70069B0122019350
:10527000089B00932B00E3E7231D0BA920680993EB
:1052800010F07DFB079B0100013301D10B9B0793BD
:10529000069B079A0193089B00932B00D0E7069B7F
:1052A00006220193089B1F4900932B00C8E7231D8A
:1052B0000993069B01950393089B02936123009336
:1052C000573B00220AE0231D0993069B012203930A
:1052D000089B0195029361230093573B216830009E
:1052E00011F0E6FCAFE7072307349C432300206856
:1052F00061680833099307F0CDFC079B011C0293FA
:10530000069B059A0193089B300000932B0011F037
:105310003CFD98E738000DB0F0BDC04606830300A1
:105320000B830300118303000023F0B52F4E93B0CD
:10533000050006A81400336001910127F7F7A8F9CA
:105340002740031E35D1E2062DD56A68A9681120D1
:1053500010F028FC05002E6829000125019A03A8F9
:10536000FCF778FCA3082B400022310003A8F5F7D6
:1053700049FF04000320EEF751FE20000FF00FFB61
:1053800001204042EEF74AFE2C00F7F79FF9002F6C
:1053900024D029001648F4F7DDF93C000121144817
:1053A000F4F7D8F91AE0A306D5D528000DF0E3FAF2
:1053B000D0E701204042EEF731FE002F03D001215B
:1053C0000B48F4F7C7F90798EDF770FA0949F6F7B3
:1053D00083FC041E05D03468002FDFD1200013B0F9
:1053E000F0BD07990448EDF79DFAF5E7542B00202E
:1053F0003A83030054AC020084E8020010B586B082
:10540000202102A8802411F07EFE64001E480EF0C8
:1054100053F900231D4803930EF04EF9F4F782F977
:105420000128F3D002280BD119480EF045F902A843
:1054300011F08BFE01220020164B1A7006B010BD31
:10544000032802D100230393E8E7042804D0C1B263
:1054500002A811F0B8FEE1E70F480EF02DF9039B0A
:105460000193002B08D10A480EF026F902A811F08A
:105470006CFE80204000E1E71122012102A8FFF725
:1054800053FF2042C5D0D9E7F4830300A83A0300B4
:10549000DC3F0300EA000020720A030030B587B049
:1054A000202102A8802511F02EFE6D0037480EF055
:1054B00003F937480EF000F90024364902A8039496
:1054C0000DF0AEFB01280AD133480EF0F5F802A822
:1054D00011F03BFE2000314B1C7007B030BD02289C
:1054E00003D12D480EF0E8F8E0E7032801D12A485F
:1054F000E0E7042808D128480EF0DEF802A811F0F1
:1055000024FE80204000E8E7052827D124480EF03B
:10551000D3F80394F4F706F96B46C1B2DC1D217091
:105520000329E4D004290AD11B480EF0C5F8012153
:10553000162202A8FFF7F8FE2842BDD0CDE702A848
:1055400011F041FE23780D2B03D116480EF0B4F86C
:10555000E0E701212000F4F7FDF8DBE7039B002BD7
:10556000AAD002A811F01DFEF1F7A6FF00280BD06B
:105570000A2102A811F027FE0B4902A80DF050FBEA
:105580000328B4D00428ECD10021D1E73C830300E8
:105590008D830300B3830300DC3F0300EA00002097
:1055A000B8830300E8830300EF83030010B5EDF731
:1055B000C9FA044905F016FA04F0C8FD0EF089F89E
:1055C000014810BD00007A44E4B3020010B5EDF7C5
:1055D00055FA002801DD0EF07CF8014810BDC046E8
:1055E000E4B3020010B504000800EDF747FA6410B8
:1055F0002018034C400020400124204310BDC04629
:10560000FEFFFF7F10B5EDF739FA002801DD0EF03F
:105610005CF8014810BDC046E4B3020010B50EF0BE
:1056200070F8034B400018400123184310BDC046DA
:10563000FEFFFF7F10B50EF060F8034B40001840EE
:105640000123184310BDC046FEFFFF7F054B10B578
:105650009A6C002A04D00022986C9A64F7F73EF8FE
:1056600010BDC0467C2E002010B5034B186811F009
:105670009FFF10F025F810BD5829002010B5034BEE
:10568000186811F09CFF10F01BF810BD582900207D
:1056900010B5034B186811F099FF10F011F810BD08
:1056A000582900201FB500210320F0F7E3FF0A4B23
:1056B0000400196801A811F06EFF019810F000F8BD
:1056C000A06002980FF0FCFFE06003980FF0F8FF75
:1056D0002061200004B010BD5829002010B5EBF760
:1056E00059FC0023064A99008958814205D00133AC
:1056F0000C2BF8D10348F7F769FE180010BDC0461F
:10570000C4E802000F840300094A70B51378002B27
:105710000DD1084D2C78E4B2002C08D10133137060
:105720002B70054B186803685B6898472C7070BD38
:10573000392E00203A2E00205829002010B5FFF7FE
:10574000E3FF054B186811F062FF044B8000C3585B
:105750000620DB00184310BD58290020C4E80200D1
:1057600010B50800FFF7BAFF0400FFF7CDFF054BA7
:10577000186811F04CFF044BA04200D0034B1800F6
:1057800010BDC04658290020CCE70200C4E7020043
:1057900010B50800FFF7A2FF0400FFF7B5FF0123D3
:1057A000A340064A064811880B4200D105481188DB
:1057B000994311800022044B1A7010BDC22D0020A5
:1057C000CCE70200C4E70200432E0020F8B5FFF743
:1057D0009BFF134C13482378002B1FD02078002107
:1057E000C0B2F0F747FF012600220F4F2378934203
:1057F00012D915005308FB5C3540AD002B410F2535
:105800002B400A4D9B005B5906259100DB00411897
:105810002B438B600132E9E700232370F8BDC046BB
:10582000432E002044A002003B2E0020C4E80200CA
:1058300070B543885A1E0A2A1FD801252A009A40AB
:105840000F490888024392B20E480A8002780F2A54
:1058500013D802780C4CEA40A25C0678D2B20F2131
:105860002E420BD00A401B0113430278DBB25208D0
:10587000A35403780133DBB2037070BD8A43F3E7AE
:10588000C22D0020432E00203B2E0020F0B5060044
:1058900087B000AF7B60F960BA60FBF771F8B06861
:1058A0000DF0B2F93861B0680DF0B4F90DF0ACF953
:1058B000032358433B69C01883001D007B611435E6
:1058C0002C2B2CD86B460E35ED08ED005B1B9D464E
:1058D00000236C467B61002326606360BA687B68A6
:1058E000F9682000EFF75EF8154D00216B68200085
:1058F000236173686B60FDF7C1FC2369061E6B6052
:1059000013D1A3681D687B69002B04D0200010F020
:10591000FFFC002E11D12800BD4607B0F0BD2800C5
:1059200010F0D4FC041ED6D1CCE73B6903339B00B6
:10593000E3185D687B69002BE8D12800F6F7CEFEFE
:105940007C2E00200122030030B5134085B00400F6
:105950004510002B14D125491D00884210D0244940
:1059600088420DD0234B1500984209D003230340F1
:1059700009D1214A0168914205D10FF0DEFE0500F0
:10598000280005B030BD1D4A25002240062A05D05A
:10599000002B08D11A4B22689A4204D101A9200099
:1059A000EBF72EFFEBE72000ECF780FF154B98425A
:1059B00007D1FF23DB05E0180323984305F01EFB06
:1059C000DDE7114B984202D0104B984206D101AA54
:1059D00069462000EDF7F4F8019DD1E7022201A904
:1059E00020000CF03BFE0028CAD0F5E7E4B302002B
:1059F000C4E70200CCE702002CB90200070080FFD8
:105A00000C9A020088B002004CA0020088E7020055
:105A1000F7B506000F0000920193041E00D0446801
:105A20003800431E984120180430800010F041FCDB
:105A30000C4B050003600C4B5B684360009B83606C
:105A4000019BC360002E05D03100A2000831103048
:105A500013F09FF9002F02D00434A40067512800EE
:105A6000FEBDC04600EA02007C2E002070B5060094
:105A700010200D00140010F01CFC034B46608560E4
:105A80000360C46070BDC046C4E9020010B50C00DC
:105A9000ECF70CFF006B00280ED0E30702D503687B
:105AA000002B09D0A30702D54368002B04D063075D
:105AB00006D58368002B03D1024903480EF0BAFFD4
:105AC00010BDC0461F84030028AB0200F0B50F00D4
:105AD0008BB00400012138680392FFF7D7FF06005E
:105AE000012C22D13B68012118000393FFF7CEFF60
:105AF00080210700490006A811F005FB802400233F
:105B0000089E6400029305AB2200310003983D68B3
:105B1000A847431C28D105980B2800D0ACE0029B75
:105B2000002B34D159480BB0F0BD7868ECF7A6FFD4
:105B3000030002900133D5D00125337B029C2B4218
:105B400000D181E00026210006A811F0DCFA0395BF
:105B5000002C6ED0210006A811F015FB011E1ED1ED
:105B60004B494C480EF066FF002810D0029B1B18D2
:105B70000293844202D9241A3618C4E7802106A869
:105B8000490011F0EDFA802406006400BBE7029B97
:105B9000414807933B7BDB0775D5404873E0002302
:105BA0000093220005AB386811F00CFA059B050044
:105BB000002B0ED006A8210011F049FB05980B28F8
:105BC0005AD1079B0293002B33D106A811F0BDFADE
:105BD000A8E7844227D8089B30009C46079C634670
:105BE0009B5D039A59B2002912DA19001F2502227F
:105BF000A943C0290CD01900103D0132A943E02966
:105C000006D004329343F03B1A00511E8A410432FD
:105C10009619A64212D8029B3000013B0293A6427D
:105C2000DDD31C0094E7211A06A811F010FB002D0B
:105C3000D1D11A4806A9EBF755F974E7E443029B62
:105C4000A419E418060083E7029906A811F06CFA7B
:105C5000039B029A0093089905AB386811F0B2F9DA
:105C6000059B002B0AD006A811F06FFA059B074888
:105C70000B2B00D157E71800F7F78EFD337B079009
:105C800005482B4289D106A9D5E7C046E4B30200F6
:105C90003E84030074AA0200A09202000C9A020043
:105CA00030B50C0087B0012105002068FFF7EEFE3B
:105CB000022203A96068EDF79BF8049A022D06D929
:105CC000A068ECF7DBFE049A824200D902000023B0
:105CD00003990093206802AB11F074F9029B002B2A
:105CE00005D005480B2B05D01800F7F755FD4300EC
:105CF0000120184307B030BDE4B30200F0B589B00D
:105D00000191019B040001211868FFF7BFFE070005
:105D1000012C18D9019B5B685C10631C13D0210017
:105D200004A811F0F0F9631C03D0631E002C2FD0DF
:105D30001C00012104A811F026FA061E0AD11B49F5
:105D40001B480EF077FE0124102104A811F0DBF9A6
:105D50006442E8E70100019803AB012200683D6856
:105D6000A847431C0ED103980B2809D1059B01932A
:105D7000012B09D104A811F0E8F90E4809B0F0BDD3
:105D8000F7F70AFD00280CD1012104A811F05FFAF1
:105D90003B7B0948DB0700D4084804A9EBF7A2F8CD
:105DA000ECE733780A2BBED1F2E7C0463E8403000D
:105DB00074AA0200E4B302000C9A0200A09202004E
:105DC000F0B51F0004000D00160085B00221FFF79A
:105DD0005DFE03AB009732002900200011F0F2F8BD
:105DE000039B002B05D005480B2B05D01800F7F7B7
:105DF000D3FC43000120184305B0F0BDE4B302001A
:105E000070B50500140011F07EF9024B2560636047
:105E100070BDC046CF70020010B50C007F2906D8B7
:105E2000012111F0B0F9002800D0047010BD224B00
:105E3000994210D8022111F0A6F90028F6D040238B
:105E4000A2095B42134303703F2323408024644232
:105E50001C434470EAE7194B994214D8032111F00E
:105E600092F90028E2D02023220B5B4213433F210A
:105E700080220370A30952420B400C40134322437B
:105E800043708270D2E7042111F07DF90028CDD053
:105E90001023A20C5B4213433F2103708023220B8B
:105EA0005B420A401A434270A2090A400C401A435E
:105EB0001C438270C470B9E7FF070000FFFF0000B9
:105EC00007B5034B009068460193FFF7CBF807BD79
:105ED000CF700200BFF34F8F024B034ADA60BFF36B
:105EE0004F8FFEE700ED00E00400FA05F0B597B033
:105EF00018220021060010A812F067FF132110A835
:105F000012F024FD032110A812F0B6FD4C4B1B68C3
:105F1000002B00D10133DBB202934A4A0123002156
:105F20000BA803F015FA484B9E4200D9002672B622
:105F3000464B64211C68464B3000079303F082FFF8
:105F4000052510306843201808900A21300003F01E
:105F500079FF0A2104F05CF8103169436118099156
:105F600030000A2104F054F810314D4380236419A5
:105F70000A9400249B010193029B002B5DD0002515
:105F800000272E1F07AB9B190593032C03D18023F9
:105F900000249B01019307AB5B592E4A03936300D6
:105FA000D31804930023190006205843049A1618A6
:105FB0007678B4466246039EB25C10269446049AF4
:105FC000105C62460641164202D00120984001430F
:105FD0000133092BE8D1C9431F4B059A0901194028
:105FE0001268039B934225D1312F23DC00210BA89B
:105FF00012F00DFEFA23159A1199DB001068014288
:106000001BD0013B002BF9D1019B01345B000193B4
:10601000FA230137E4B25B009F42B6D10435102D5C
:10602000AED1074B1B68002BA6D0029F013FFBB2ED
:106030000293A1E7019B1943D9E7FFF74BFFC04645
:106040005C2B0020F0FF0000E70300006800002048
:10605000828403004C840300F01F0000F0B5002888
:106060001BDD0F4C421E276811000020BE09FB0FEC
:1060700073407B403E097D087340BF087B406B4006
:10608000DB072B4301251F0040002B401843E9404C
:10609000ECD18242E8D32760F0BD0248FCE7C0465D
:1060A000582B002017FCFFFF0023F0B50121A1268B
:1060B00004241F00094D0A480A4A2B60F6000160BB
:1060C000576051680029FCD081591B02013C0B43E9
:1060D000002CF5D12B6001234360F0BD582B00202C
:1060E00000D00040FCD00040014B18607047C04613
:1060F000582B0020020010B5014B12CB12C210BD6C
:10610000602B0020034B1A68034B1A607E225A60F2
:106110007047C04668000020602B002070B5051E47
:1061200014DD0B4E0B4C3368002B02D0206812F0AC
:1061300017FBFA2120680024074B89008361C462A1
:106140006943356012F014FB200070BD0348FCE782
:10615000682B0020982B00200562010017FCFFFF30
:10616000F8B5114F06003D68002D0AD1302012F01D
:10617000A6FD040002F08AFD0C4BA5612360E562D8
:106180003C600B4D2B68002B09D1102012F097FDBD
:10619000040012F03AFB20002C6012F010FB3000DB
:1061A000FFF7BCFFF8BDC046982B002070EF02003F
:1061B000942B0020014B18687047C046682B0020C4
:1061C00070B50D4C2368002B03D00C4B1B68002BC3
:1061D00002D10620FFF7C4FF206812F007FB02007F
:1061E0000749C3170D684E685219734120680A6049
:1061F0004B6012F001FB70BD942B0020982B002007
:106200001801002010B5FFF7DBFF0024054BA200AA
:10621000D058002802D003681B68984701340A2C24
:10622000F4D110BD6C2B002010B5FFF7C9FFFA2286
:10623000034B920018685968002303F067FF10BDF4
:106240001801002010B5FFF7BBFF024B1868596812
:1062500010BDC046180100200B4B10B51B68040090
:10626000002B03D0094B1B68002B02D10620FFF73F
:1062700077FF0023064A99008858002801D001338F
:10628000F9E78C5010BDC046942B0020982B0020BD
:106290006C2B0020002310B5044A99008C588442CE
:1062A00001D00133F9E70020885010BD6C2B00208D
:1062B00010B50400002902D00B78002B03D1034B4A
:1062C0002360200010BD11F014F8FAE798EB0200EB
:1062D000014B03607047C04698EB020010B50548BB
:1062E000054C206011F07FF8044A0549200012F0A7
:1062F000DFFC10BD98EB02009C2B0020000000206A
:10630000E5720200084B73B51C680500002C0AD02A
:106310000100266808310822684612F03AFD0CCDCB
:1063200031682000884773BDA02B002010B5054CB4
:106330000121200011F04BF8034A0449200012F01B
:10634000B7FC10BDA42B0020000000208B730200BE
:106350000388074A10B50120934208D0834202D037
:106360000020DB0703D41E20FFF7C0FD002010BD76
:10637000FFFF00000048704716FCFFFF10B53220F9
:10638000FFF7B4FD004810BD16FCFFFF10B5124C1E
:106390000023083482800460416202241422010038
:1063A0008371847203638386028136310A78C36005
:1063B000A243F1342240036143618361C3610362FC
:1063C0000A70020040321370021DD38701334387E5
:1063D0008387C38710BDC046B8EB0200F0B5544FA9
:1063E00097B03B6806000593002B00D08BE006AC0D
:1063F0000B331C222121200001F0CAF80EAD0B2323
:106400001D2222210AA801F0C3F80B231B222321FD
:10641000280001F0BDF8082012F051FC0122059B74
:106420001100049011F0CEFF3A21300011F0D1FE9E
:1064300000281DD0A38812ADAB80A3795C20AB717E
:106440003C4B1293A3681493237B2B73637B6B7376
:10645000A37BAB7312F033FC042301933633009318
:106460002A00049B3100040001F000FD3C604AE07A
:106470003221300011F0DDFE00281CD0A38812ADBF
:10648000AB80A3795C20AB712A4B1293A368149361
:10649000237B2B73637B6B73A37BAB7312F00FFCBB
:1064A000042301932E3300932A00049B310004003F
:1064B00001F07AFEDAE73C21300011F072FE00288C
:1064C0002CD0AB8812ACA380AB79A420A371194B5C
:1064D0001293AB6814932B7B23736B7B6373AB7B3F
:1064E000A37312F0ECFB052305000293013B01931B
:1064F000383300932200049B310001F0D5FB0E4B92
:106500003D6044351D600C4B094C1868002802D0D2
:10651000216811F00AF9206817B0F0BD442012F08C
:10652000CEFB042204990400FFF730FF9EE7C0462B
:10653000A82B0020A8EB0200AC2B0020F0B561498D
:10654000C56885B08D4254DA0300022236331B78C9
:10655000134059D104698C4264DA02003632127851
:10656000520768D4426901920200019E40328E4275
:106570006FDA010036310978090774D4002B7DD118
:1065800013780293002B16D006000127011DCB8F34
:10659000363601339BB2CB8703963678BC463740FC
:1065A00000D188E01D2B06D963469E43039B1E70D5
:1065B0000023CB87137010F063FF434A07239042F8
:1065C00076D94249043B8D4272DBC82201339200E6
:1065D00095426DDC023B8C426ADB013B944267DCF6
:1065E00001980433884263DB0133904260DC00236E
:1065F0005EE0C822002352009542ABDD0300363333
:106600001A7800239207A5D4012306001F0036360E
:1066100032785408A7433C0002279C40BA432243E7
:10662000327097E7C822520094429BDD0200363256
:106630001278520796D406000122363633789F0826
:10664000BA439700042293431A003A43327001235D
:1066500088E7C821019E49008E428FDD0100363156
:10666000097809078AD40100012636310B78DF0842
:10667000BE430827F600BB4333430B701378032B4C
:1066800000D97DE70133DBB21370012B03D1002168
:10669000031DD98774E7042B00D071E7020036325E
:1066A0001178033B0B43137000230430C3870B3373
:1066B000180005B0F0BD092B00D87CE7029BCF87FE
:1066C000013B77E770FEFFFFFF700200E0FCFFFF79
:1066D000F0B5040087B0C06806F050FA0090019150
:1066E000206906F04BFA04900591606906F046FABD
:1066F00002000600802000060B180F000098019988
:1067000006F0F8FE06F0C6FAE062051C06F07EFE12
:106710000390281C06F0CAFC051C039806F068FAD2
:10672000009A019B05F03AFC00900191281C06F0AC
:106730005FFA32003B0005F031FC02000B000098CC
:10674000019905F09DFE02000B000498059906F0E2
:10675000D1FE06F09FFA0022051C0023300039000C
:1067600003F086FC002806D1A5620223A279134318
:10677000A37107B0F0BD0021281C03F0B3FC0B4E41
:10678000002811D10A4F281C06F032FA02000B0033
:106790003000390005F074FE32003B0004F0D8FCF4
:1067A00006F078FAA062E0E7024FECE7EA2E4454E4
:1067B000FB21F9BFFB21F93F0048704716FCFFFFA2
:1067C00010B53320FFF792FB004810BD16FCFFFF09
:1067D000002310B50400838083710D4821640830C4
:1067E00020608020C000A061E0612062E3602000A2
:1067F000236163616362A362E36223636363A363F0
:10680000E3636364110010F047FF200010BDC04631
:10681000ECEB0200F0B5534F97B03B6806000593D0
:10682000002B00D08BE00B331C22212106A80AACE0
:1068300000F0AEFE0EAD0B231D222221200000F041
:10684000A7FE0B231B222321280000F0A1FE082015
:1068500012F035FA0122059B1100049011F0B2FDEF
:106860001D21300011F0CDFC00281DD0A38812ADF1
:10687000AB80A3796020AB713B4B1293A368149358
:10688000237B2B73637B6B73A37BAB7312F017FAC1
:1068900005230193183300932A00049B3100040060
:1068A00001F0B8FB3C604AE03C21300011F0D9FC1B
:1068B00000281CD0A38812ADAB80A3796020AB71F7
:1068C000294B1293A3681493237B2B73637B6B7305
:1068D000A37BAB7312F0F3F90523019337330093D5
:1068E0002A00049B3100040001F000FDDAE73C219E
:1068F000300011F056FC00282AD0AB8812ACA380DF
:10690000AB79A420A371184B1293AB6814932B7B23
:1069100023736B7B6373AB7BA37312F0D0F90523F6
:1069200005000293013B0193383300932200049B3E
:10693000310001F0B9F90D4B1D6044353D600B4B42
:10694000084A1B681068002B00D0436417B0F0BDE4
:10695000482012F0B4F9052204990400FFF738FF2B
:10696000A0E7C046AC2B0020A8EB0200A82B00201B
:1069700030B50425837985B004002B421BD1036810
:10698000DB699847200010F0C1FEA379A1882B4352
:10699000A37103220123684610F0E7FCA0790300ED
:1069A000AB43A3710223184043425841034B40427A
:1069B000184005B030BD0248FBE7C04614FCFFFF9D
:1069C00015FCFFFFF0B5040089B0406C10F012FE1A
:1069D000071C606C10F001FE02222100061C05A8B5
:1069E00010F0A5FE069804F029FB051C079804F09A
:1069F00025FB041C381C06F009FD0390381C06F02A
:106A000055FB0190301C06F001FD0290301C06F091
:106A10004DFB0399071C201C03F0E4FF0199061CA1
:106A2000281C03F0DFFF011C301C04F00DF9061CCC
:106A3000059804F003FB391C03F0D4FF0299071CEE
:106A4000281C03F0CFFF039903F0CCFF011C381C76
:106A500003F056FC0299051C201C03F0C3FF0199AA
:106A600003F0C0FF011C281C03F04AFC311C06F097
:106A700049FE0F4903F0B6FF06F0BAF80D4A0E4B77
:106A800004F082FE06F006F9011C0C4804F0DCF864
:106A90000021041C03F012FB002804D0201C044930
:106AA00003F02EFC041C201C04F0A8FA09B0F0BD71
:106AB0000000B443EA2E4454FB2119400000B442C4
:106AC0001FB50122010001A810F031FE029804F068
:106AD000B5FA041C019804F0B1FA211C06F012FE6C
:106AE0000D4903F07FFF06F083F80C4A0C4B04F0CD
:106AF0004BFE06F0CFF80021041C03F0DFFA00285B
:106B000004D0201C074903F0FBFB041C201C04F0EC
:106B100075FA04B010BDC04600003443EA2E445458
:106B2000FB2109400000B44310B5837904005A07E3
:106B30000DD49B0701D4FFF71BFF636C2000002BD3
:106B400002D0FFF73FFF10BDFFF7BAFFFBE7014898
:106B5000F9E7C04615FCFFFF82B0F0B50400EDB0C8
:106B600064207393729211F080FF052210A8110027
:106B700011F09CFC974911A801F0CEFD002221AB39
:106B80006CA91A605A609A600C339942F9D11922A3
:106B9000002113A812F019F9A06811F0B1F900262C
:106BA0000B90FF21A06800F0B5FB8B4FA06800F0B0
:106BB00041FB07960996884B9F4203D0874B9F4223
:106BC00000DBFDE0A06811F0E9F9A56884491AA886
:106BD000FFF76EFB78221AA9280000F071FB1AA8B3
:106BE00010F080FB00267C4F0322099B6068013374
:106BF0001A40099210F0DCFC0500606810F0DFFC20
:106C00000022784B05929D4210DB013205922A004A
:106C1000C8320BDBAA22042192000591954205DCC3
:106C200002220592C82D01DD013205920022069252
:106C3000984210DB012306930300C8330BDBAA2321
:106C400004329B000692984205DC02230693C82872
:106C500001DD0133069310A811F01FFC002513ABD2
:106C6000EB5C012B08D160496B00CA185278C95CF3
:106C700010A8FF2301F0E2FC0135192DEFD16B467E
:106C800018229A5E6B4610A81421595E099B01F0E8
:106C9000D5FC002F01DB0F2E07D90023A06800933D
:106CA00074301A0010A911F008FC01230893089B06
:106CB00005995A004C4B9B189A1E12788A4226D18D
:106CC000013B1B78069A934221D1089A6CAB9B1822
:106CD000663BFF3B0A931B78012B18D00C23079AC5
:106CE000216853431D0000220CA810F020FD21AAAA
:106CF0002B0094460CAA634423CA23C301220A9B97
:106D000001361A70079BF6B20133DBB20793089B7A
:106D1000013308931A2BCAD1642011F0A6FE079BF9
:106D2000643F3FB2182B00D845E71A0021A91AA8E2
:106D300010F05DFF6A461DAB23CB23C21B681360B6
:106D40001A991B9A1C9B206810F0B8FCE568002D6E
:106D50000CD0264912A8FFF7ABFA1C231AAA12A9D5
:106D6000280011F005FA12A810F0BCFAA06811F082
:106D700015F911A912A8A56811F087FB00221C4B78
:106D8000009212A901932800130000F06FFA12A8D4
:106D900011F06EFBFA20800011F067FEA06811F080
:106DA000FDF80B99A06800F0B5FA11A811F060FB8E
:106DB00010A811F05DFB6DB0F0BC08BC02B0184724
:106DC000002F02D00F2E00D00EE7A06800F032FA9C
:106DD0000AE7C046628603008C3C0000D18AFFFFB0
:106DE000A786030058FDFFFFC7860300BC8603008B
:106DF000DC050000F0B587B001930EAB1B880600E0
:106E000003930D9B0D000093019B02920C9F002B9E
:106E10003DD0002F02D1009BDB0738D5282011F090
:106E20004EFF0400103010F096FA029B18202580C7
:106E3000638011F044FF0500009B08220593019B2D
:106E4000002103600C30049711F0BFFF082204A951
:106E5000281D11F09EFF0F4B02226B610023039946
:106E6000E3602362636233680A43A560A2805B68C3
:106E7000210030009847002807D0200011F08DFA3B
:106E80002000282111F00CFF034807B0F0BD034893
:106E9000FBE7C0461378020016FCFFFF17FCFFFF5C
:106EA00030B54260002283600C4B04000160C26078
:106EB000186887B090420DD00592C03202926A469F
:106EC000074904AB049122CB22C2230003220521EF
:106ED000FFF790FF200007B030BDC046A02B002078
:106EE000596B0100F0B5040085B0637A9C46002B15
:106EF00004D1200010F099FE05B0F0BDA37A266FF2
:106F000001931023019AF35600259B1801229A4001
:106F10002900F36803920293029BAB4231DDB36810
:106F2000019A6B439B1872695B00E77AD3181A7851
:106F30005878E379012F14D15F1E3F1A10003A00F0
:106F40005B004343606F8218D3189B79634500DD73
:106F50006346627B1A4202D00123AB4019430135DC
:106F6000DAE7022F05D15F1EBA1A277A013F381AD5
:106F7000E6E7032FE4D1277A013FBF1A0200380069
:106F8000DEE71123C943F356606C99402369194029
:106F9000039B194311F03BFEA27B072AACD8637B0D
:106FA0000C495B006373531CDBB290004158A37320
:106FB000022A03D8080011F04DFD96E7064B200089
:106FC000236300236363054BE4622364143011F0F0
:106FD000CFFB91E718EC0200E56E0100157C020082
:106FE00010B50400044B036011F0BAFB200001F05F
:106FF00063FE200010BDC04670EF020010B5040013
:107000000E4B08330360FFF745F92000743011F090
:107010002FFA2000603011F02BFA2000583010F0C9
:1070200061F92000503010F05DF92000044B14305D
:107030006361FFF7D5FF200010BDC04638EC0200A9
:1070400084EF0200F8B500250400324B8580083338
:1070500003608571143016000F0001F017FE200048
:107060002D4BE562636125645030FFF731F9200054
:107070005830FFF72DF92000603001F0D9FA2000D8
:107080000423F25E33682667590009B2743011F0A8
:107090000DFA3368226FE37173680126237210239F
:1070A0006581A7802561D35691685918994204DDFE
:1070B0003000984001330543F8E711230120D356EF
:1070C000D1685918994206DD02009A4026690133B9
:1070D00032432261F6E7142011F0F1FD226900210C
:1070E0002A430123060002F033F9FF2322006372D2
:1070F0000133A381002348326664A3732000137018
:10710000A366FFF7A9F80123A27920001343A37116
:10711000F8BDC04638EC020084EF0200F0B5437AB7
:1071200085B00400002B04D1200010F07EFD05B0D6
:10713000F0BD0122837A11009C461023066F0025C2
:10714000F35603926344994002912900F368019336
:10715000019BAB422CDDB36872696B4363445B00F7
:10716000E77AD3181A785878E379012F10D15F1E87
:107170003F1A10003A005B004343606F8218D31837
:107180009B79002B02D0039BAB4019430135DFE70D
:10719000022F05D15F1EBA1A277A013F381AEAE793
:1071A000032FE8D1277A013FBF1A02003800E2E737
:1071B0001123C943F356606C994023691940029B1F
:1071C000194311F024FD667AB31EDBB2FC2B14D8F0
:1071D000FEF7F0FF0B4B0500236300230A486363AF
:1071E0000A4BFF21E4622364704302F02BFE290066
:1071F00041432000143011F0BBFA637A012B00D90F
:1072000095E791E72B7C0200B6030000157C020095
:107210001FB5012381881A00684610F0A6F80123E3
:1072200003491A00684610F0A0F805B000BDC0463A
:10723000FE0300001FB5030048331A780400002A3B
:107240000DD000221A70012381881A00684610F0C0
:107250008CF8012304491A00684610F086F82000D3
:10726000743011F01AF91FBDFF03000073B5079CBD
:107270000500002C1CDB060048363078002802D0C0
:107280003078012816D106981BB2C0B200902800B1
:1072900012B2743011F011F9002C07D02B004A33D0
:1072A0001C80002407234C352C803370200076BDD1
:1072B000014CFBE7014CF9E717FCFFFF12FCFFFF55
:1072C000F8B50400171E1DDD060048363378002B84
:1072D00002D03378012B17D12200E3795632013BDB
:1072E000137023000025200054331D80503010F00F
:1072F00016F823004A331F80022328004C342580CF
:107300003370F8BD0148FCE70148FAE717FCFFFFBE
:1073100012FCFFFFFF2902D841720020704701488C
:10732000FCE7C04617FCFFFF13B5040004A8007873
:107330000090200011F07EF9002801D1207516BDC3
:107340000048FCE70EFCFFFF13B5040004A800781A
:107350000090200011F056F9002801D1207516BDCB
:107360000048FCE70EFCFFFF7FB50D0011000F2267
:107370006A4404001E1E117016D0089B002B13DDFA
:10738000012329000093FFF7DFFF002802D0074800
:1073900004B070BD0090089B320029002000FFF768
:1073A000C3FF0028F4D0F2E70148F1E70EFCFFFF2D
:1073B00017FCFFFF10B5040086B0006C01F07AFDE9
:1073C000217BA0228B00185100200C4BD20098503A
:1073D0000B4A14309850636C68465B7CC91849B2FC
:1073E00010F02DFE039B019A03211A60207B0130CF
:1073F000C0B202F023FD217306B010BD0070004042
:107400000405000082B070B50400002588B00C921D
:107410000D93636C9A68AA420ADD197C02A8491987
:1074200049B210F00CFE069B039A01351A60F0E792
:107430005D7C237B02A8ED186DB2290010F0FFFDE2
:10744000039A059B01921A600021182202A811F0EC
:10745000BCFC02A80022290011F07DFA206C002853
:1074600002D0082111F01CFC082011F028FC290092
:10747000060001F0F9FC094B2000E3620023FA2129
:107480002363074B2664A462E3631030090111F003
:107490006FF908B070BC08BC02B01847B5730100A2
:1074A000E97F0200F0B504000E00150085B01F0052
:1074B0000CAB1B88103001930FF04DFF26806580C8
:1074C000182011F0FCFB02AE050033000AAA03CA23
:1074D00003C32F602800082700213A000C3011F068
:1074E00074FC3A003100281D11F053FC064B0222B7
:1074F0006B61200000230199A5600A43E360A2802C
:107500002362636205B0F0BDFF7F020070B5040026
:1075100086B010300D0001F0B9FB0023194AA362B8
:107520002261194AE363166865642373236063600C
:10753000A3609E4220D0154A28200492059311F0A2
:10754000BEFBC02305006A46029304AB03CB03C213
:107550002300062102222800FFF7A4FF3368290038
:107560005B6830009847002806D0280010F015FF0F
:107570002821280011F094FB00232000236406B08A
:1075800070BDC04684EF0200A02B002005740100EE
:1075900030B5002403730123034D8471056081809D
:1075A00082734373846030BDA8EB020070B58379A9
:1075B0000400DB0703D51821806811F071FBA37963
:1075C0009B0703D51821A06811F06AFBA3795B071C
:1075D00008D5A0230021164ADB00D150A06808314D
:1075E00011F05EFB0826A379334209D0A568002D6F
:1075F00006D0280010F0EDFF3100280011F050FBFC
:10760000A379DB0605D5A068002802D00368DB68F3
:1076100098476023A2791A4205D0A068002802D0BA
:1076200003685B6898470023A360A37170BDC046E0
:1076300000700040F7B50126037B040033422AD0D6
:10764000612385791D4017D1FFF7B0FF182011F095
:1076500036FB0E230700E35618220093637B2900B4
:10766000019311F0B2FB019A0099380011F073F9FF
:10767000A379A7603343A3716023A279A0681A425B
:1076800002D010F0EFFFFEBD436940681B68184050
:10769000431E9841F7E70148F5E7C04616FCFFFF97
:1076A00010B50124837941731C4004D0806811F027
:1076B000E3F9002010BD6022134203D0806810F06F
:1076C000D8FFF6E70048F5E716FCFFFF10B50029E4
:1076D00003DB024B196010F0FFFF10BDB02B002040
:1076E00070B504001E0004AB1D7801F099FA20006B
:1076F0000E4B40302360FEF7EBFD230001364C3388
:10770000013522001E701D730023E1214E32A36457
:107710006365138053809381D381013B20006364B0
:107720004902FFF7D3FF200070BDC04624B6020017
:10773000F7B580277F053D697C690822113C6C43C1
:1077400006002100684611F024FB104B009A9A4273
:1077500019D00093002301937969300013396943EC
:1077600010F093FC019A0099300010F0A6FC210063
:10777000300010F08AFC7969AB08133969432200A4
:10778000300010F08CFC0198FEBDC046FECA00001F
:10779000F0B50D00A9B00D9200213022060010A80E
:1077A0000B9311F012FB280011F063FB431C0C93A8
:1077B000102B00D9B6E00B9B202B00D9B2E029009A
:1077C000300010F0A1FC071E50D129000C9A10A81F
:1077D00011F0DFFA0D990B9A14A811F0DAFA802350
:1077E0005B051A695F690C92113F7A4330005D694D
:1077F0000B92FFF79DFF3022002104001CA811F01E
:10780000E4FA290000270C9B13395943300010F08B
:107810003CFC0D9730257D430B9B0833ED18A742A8
:1078200043DA290030221CA811F0B3FA10A91CA8D1
:1078300011F015FB002828D13C49300022000E91A0
:107840000F9410F03AFC6A46099513AB23CB23C280
:1078500023CB23C223CB23C23000129B1099119A51
:1078600010F039FC01230D930137D3E70D99103047
:107870000B9A11F07FFA30210400380011F010FA51
:10788000002CA2D1200029B0F0BD6A4609951FAB9B
:1078900023CB23C223CB23C223CB23C230001C998A
:1078A0001D9A1E9B10F017FCDEE7E5433023ED1711
:1078B00025405D430B9B08355D190D9B002B1DD1A9
:1078C0000C9B3021981E02F033FAA0422CD01749AD
:1078D0000134300022000E910F9410F0EEFB6A4646
:1078E000099513AB23CB23C223CB23C223CB23C2C3
:1078F00030001099119A129B10F0EDFB0B9930009B
:1079000010F0C3FB80235B0559690C230C9A1339D3
:1079100063434A430233110030000B9A10F0BFFB5F
:107920000024AFE7024CADE7024CABE7FECA000013
:1079300017FCFFFF13FCFFFF022802D10122014BBD
:107940001A707047442E002070B5064C050023784D
:10795000002B04D1044801F043F8012323702800D0
:1079600070BDC046452E00203979010070B50C006D
:107970000FF0B3FC002810D00023144DA40A2B7084
:10798000200010F0FDFB002803D00A2011F06DF854
:10799000F6E72B78002BFCD070BD02210C4B0D4A72
:1079A00099508021C90008005D58002DFCD0A1210C
:1079B000C9005C5019580029FCD000219950802141
:1079C000C9005A58002AFCD0E6E7C046442E0020E1
:1079D00000E0014004050000F8B50C0015001E0091
:1079E0000FF07BFC002811D00023174F3B703200B2
:1079F0002900200010F0C2FB002803D00A2011F05B
:107A000034F8F4E73B78002BFCD0F8BD01210F4897
:107A10000F4B844619508021C9005A58002AFCD0C7
:107A200080270022FF00964207DD910068586050D1
:107A3000D9590029FCD00132F5E7002261465A509D
:107A4000DA59002AFCD0E0E7442E002004050000AB
:107A500000E0014008B4024B9C46443808BC604733
:107A600085810200FA21F8B50389C9000400594351
:107A7000324810F0A2FCFA21890002F059F9304F87
:107A80002081A17A380010F098FC23002600250000
:107A900022894C33A072A0361A808C3531780023AD
:107AA0002A22286810F087FA002801D02548F8BD5E
:107AB00031781F235B22286810F07DFA0028F5D169
:107AC000317820235C22286810F075FA0028EDD167
:107AD000317801232C22286810F06DFA0028E5D1B6
:107AE000317801232D22286810F065FA0028DDD1B5
:107AF000317801232E22286810F05DFA0028D5D1B4
:107B0000A17A380010F054FC3178C3B20E222868F4
:107B100010F051FA0028C9D1FA212389890059436C
:107B2000064810F045FC01230343DBB231782A22DA
:107B3000286810F040FA0028B9D0B7E758EC0200E6
:107B400050EC02000EFCFFFF08B4024B9C46443888
:107B500008BC6047657A0100074B10B51A000400A5
:107B600008323C330260436444300FF062FD200071
:107B70000FF076FC200010BDB8EC020008B4024BF8
:107B80009C46443808BC6047597B010008B4024B4E
:107B90009C46443808BC60478F810200F0B504253C
:107BA00083798BB004002B4204D100F0EFFBA37962
:107BB0001D43A57120009030FFF73CFD0026B04228
:107BC0000FD12300A033197820000C2307AD0093B8
:107BD0008C302B0001220068FFF7C6FB061E03D085
:107BE0002C4E30000BB0F0BD0A2304AA9B182A7853
:107BF0005A706A781A700022985EAA785A70EA78E9
:107C00001A700022995E03912A795A706A791A7063
:107C100000229F5EAA795A70EA791A7000215A5E92
:107C200004922A7A5A706A7A1A7000215A5E059272
:107C3000AA7A5A70EA7A1F251A7000229B5EA27AED
:107C40009C46039B504359425143CB172B407A43E8
:107C50005B185B11A361C3172B401818D3171D4085
:107C60006423AD18059A5B425343A36764236146BE
:107C7000049A40115A434B43E2676D11221DE061A3
:107C800025622000D3670FF066FC200044300FF01F
:107C9000D8FCA6E70EFCFFFF08B4024B9C46443814
:107CA00008BC60479D7B0100F7B51E00040008ABCF
:107CB0001B881500019309AB00911A8831000AABAB
:107CC0001F88FEF763FB20003A0031004430FEF7C6
:107CD0007FFD134B20001A003C33636423000832FD
:107CE0002260009A8C331A60AB8890308380AB7925
:107CF000019A83710B4B03210360AB6883602B7B7C
:107D000003736B7B4373AB7B83732300A0331A80B5
:107D1000FFF7C6FC2000FFF7A5FE2000FEBDC04611
:107D2000B8EC0200A8EB0200F8B5FA260189B6000B
:107D300004007143264810F040FB310001F0F8FFC9
:107D4000244F2081A17A380010F037FB2500A07263
:107D50005835297800232A22606C10F02CF900286D
:107D600001D01D48F8BD297810232B22606C10F03B
:107D700022F90028F5D1297801232D22606C10F01A
:107D80001AF90028EDD1297801232E22606C10F019
:107D900012F90028E5D1A17A380010F009FB297802
:107DA000C3B20E22606C10F006F90028D9D12189E7
:107DB0000748714310F0FCFA01230343DBB2297832
:107DC0002A22606C10F0F7F80028CBD0C9E7C04633
:107DD00020ED020018ED02000EFCFFFF10B50400BC
:107DE000034B083303600FF03BFB200010BDC0467F
:107DF00080ED02007FB50425837904002B4204D175
:107E000000F0C4FAA3791D43A57120004830FFF7A4
:107E100011FC0025A8420DD1230058331978062300
:107E200002AE009301223300606CFFF79DFA051E3D
:107E300003D00D4D280004B070BD022300210420A2
:107E4000F356A27ADB00715630565B425343C000B2
:107E5000C90051434243A3612368E16122629B6AE6
:107E600020009847E6E7C0460EFCFFFFF8B5040087
:107E7000150006AA168807AA0F0012881900FEF737
:107E800085FA0F4B6764083323602300AA884833C0
:107E90009A80AA7920009A710A4AA264AA68226587
:107EA0002A7B1A736A7B5A73AA7B9A730023A37185
:107EB000230058331E80FFF737FF2000F8BDC0466F
:107EC00080ED0200A8EB020010B50400034B08335C
:107ED00003600FF0AEFB200010BDC04614EE0200A0
:107EE000F0B507005C3787B0040039780023102212
:107EF000806C10F060F80326002802D01F4807B0FD
:107F0000F0BD0F2502ABED1801233978082200934C
:107F1000A06C2B00FFF728FA184B9842EED02B7874
:107F2000334203D0642000F0BDFAEAE7FA26218943
:107F3000134DB6007143280010F03FFA310001F0F4
:107F4000F7FE20813978A0231122A06C10F033F8BD
:107F50000028D3D1A36C21890393714328003F7873
:107F600010F026FA01231843C3B2102239000398F7
:107F700010F021F80028C2D0C0E7C0460EFCFFFF79
:107F8000B4ED020070B50825837986B004002B4259
:107F900004D100F0FBF9A3791D43A57120004C30FA
:107FA000FFF748FB061E0DD023005C33197806232B
:107FB00004AD009301222B00A06CFFF7D5F9061E3B
:107FC00003D0134E300006B070BD0E232A786B44E8
:107FD0005A706A7820001A700022995E64224A431F
:107FE000A263AA785A70EA781A700022995E642215
:107FF000524251436163297959706979197000219E
:108000005B5E5A432368E2631B6A9847DAE7C0461F
:108010000EFCFFFFF8B50400150006AA168807AA93
:108020000F0012881900FEF7D3FB0D4BA76408332D
:1080300023602300AA884C339A80AA7920009A7181
:10804000084AE264AA6862652A7B1A736A7B5A73DB
:10805000AA7B1E829A73FFF743FF2000F8BDC0463B
:1080600014EE0200A8EB0200F7B5FA250189204FB3
:10807000AD0004006943380010F09FF9290001F0B9
:1080800057FEA17A20811B4810F097F92600636CF7
:10809000A0720093218958363378694338000193E0
:1080A00010F086F907230343DBB2202201990098E0
:1080B0000FF081FF002801D00F48FEBD317810235A
:1080C0002222606C0FF077FF0028F5D1A17A0948D1
:1080D000656C377810F06CF980235B420343DBB2A8
:1080E0002322390028000FF066FF0028E5D0E3E7DF
:1080F00048EE020040EE02000EFCFFFF10B5040047
:10810000034B083303600FF0ABF9200010BDC046ED
:10811000B8EE0200F0B50425837985B004002B4247
:1081200004D100F033F9A3791D43A5712000483034
:10813000FFF780FA061E0DD0230058331978062366
:1081400002AD0093A8222B00606CFFF70DF9061E0C
:1081500003D0144E300005B0F0BD1F200023EA5EAE
:10816000D31703409B180222A95E5B11CA17024075
:10817000521804216F5E5211F9170140C9194911B3
:108180002B806A80A980A07A5B42434352424243DB
:108190004143E3612368A26121629B6A2000984702
:1081A000D8E7C0460EFCFFFFF8B50400150006AA8C
:1081B000168807AA0F0012881900FEF7E7F80F4B80
:1081C0006764083323602300AA8848339A80AA7919
:1081D00020009A710A4AA264AA6822652A7B1A734F
:1081E0006A7B5A73AA7B9A730023A37123005833C6
:1081F0001E80FFF739FF2000F8BDC046B8EE020030
:10820000A8EB0200F7B5FA2504000189134EAD0072
:108210006943300010F0D1F8290001F089FD2700F2
:10822000A36C208100935C373B7881B269433000B6
:10823000019310F0BDF86022C3B2019900980FF0CD
:10824000BAFE002801D00648FEBD3978012362221B
:10825000A06C0FF0B0FE0028F6D0F4E7ECEE0200C0
:108260000EFCFFFF10B50400034B083303600FF052
:10827000E0F9200010BDC04614EF02007FB50825CC
:10828000837904002B4204D100F080F8A3791D43C8
:10829000A57120004C30FFF7CDF9051E0DD023004D
:1082A0005C331978062302AE0093E8223300A06CF9
:1082B000FFF75AF8051E03D00B4D280004B070BD1F
:1082C0000223F25E96235B425A4362630021725E90
:1082D00020005343A3630423F25E96235343E363D6
:1082E00023681B6A9847E8E70EFCFFFFF8B5040017
:1082F000150006AA168807AA0F0012881900FEF7B3
:1083000067FA0D4BA764083323602300AA884C3317
:108310009A80AA7920009A71084AE264AA68626584
:108320002A7B1A736A7B5A73AA7B1E829A73FFF7A1
:1083300069FF2000F8BDC04614EF0200A8EB020060
:1083400010B572B60B4B1C68002C08D020000FF043
:10835000A3FF0023E364084B2000E36310BD62B673
:108360005C2010F0ACFC5C220021040010F02DFD1C
:10837000EFE7C046D82B002000400020024B1878C1
:10838000012318407047C046462E0020002310B538
:1083900004499C006258002A01D00133F9E760507B
:1083A000100010BDBC2B002010B50024084BA2000B
:1083B000D058002802D003685B6898470134062C27
:1083C000F4D1044B1B68002B00D120BF10BDC04668
:1083D000BC2B0020D42B0020F8B5FFF7CFFF0028DE
:1083E0001CD02A4D2C68E36CDA0718D502273B43D2
:1083F000E364274B1E680423F26C30001343F364DC
:10840000636BF3630FF05FFF3000716C00F097FA5D
:108410002868C36C3B4201D000F0CBFAF8BD1D4F79
:108420001D4E3A683168002A1ED129602A6891429F
:1084300008D11B0706D52C60FFF7B6FF3B68002B61
:10844000FAD02B6029688C42E8D03368994214D165
:10845000124B4B63124B8B6320000FF034FF2968E3
:10846000626C4B6C20000DE0206DB84203D1606D52
:10847000002800D002002A60D8E79C42ECD10022FC
:1084800010004B6C00F01AFAC8E7C046E02B002041
:10849000B82B0020D42B0020DC2B0020FC3F002038
:1084A000F982020070B50500FFF768FF002803D1CC
:1084B000280010F0DAFA70BD0C4B1C68E36CDB0787
:1084C00006D5FFF73DFF0A4B1860002800D00400D6
:1084D000FDF7AAFE2D18A56420000FF0DDFE05496A
:1084E00020000FF0C7FEFFF777FFE4E7E02B002046
:1084F000B82B0020B42B002070B5114E3278022A20
:108500001AD081421AD90C1A072C17D90D0003234F
:1085100005432B4012D172B60A4DD2005051AA1811
:1085200051608022A408120614430460327801329C
:10853000327062B6180070BD0348FCE70348FAE7E2
:10854000482E0020E42B002013FCFFFF17FCFFFF48
:1085500070B5134C06002378124D002B0CD1124934
:1085600012482B70FFF7C8FF114B984202D11E2012
:10857000FDF7BCFC0123237000242B78A34209DD06
:108580000C49E300C91830000FF0BCFE002805D1EB
:108590000134F2E71420FDF7A9FC002070BDC046AD
:1085A000472E0020482E002000380020E02F002019
:1085B00017FCFFFFE42B002070B5002819D0104BEA
:1085C00010491C7800239C4216DDDA00555885427C
:1085D00010D28A18526882420CD9041F2368002BDB
:1085E00002DC1E20FDF782FC802322681B06134359
:1085F000236070BD0133E6E71E20FDF777FCF8E746
:10860000482E0020E42B00200268084B406810B57B
:10861000C018C000101803009A4205D81C688C428C
:1086200002D31800083BF7E710BDC046FFFFFF1F4D
:10863000014B03607047C04640EF020030B5006850
:108640004488A1420CDA8588AA4209DA002907DBAE
:10865000002A05DB5443401800198371002030BD07
:108660000048FCE717FCFFFFF0B5070085B00E00DF
:108670001D00002921DD002A1FDD002B1DD004680C
:10868000638803938B4200DD0391A3880293934296
:1086900000DD0292002306340193019B029A93426B
:1086A0000EDA29002000039A10F073FB3B68AD1925
:1086B0005B88E418019B0133EEE7024805B0F0BD8A
:1086C0000020FBE717FCFFFFF8B504000D001600C3
:1086D0001F00002901DB002A02DA0E4B2360F8BDDF
:1086E000100048430630FFF733FF20600EF078FE9D
:1086F00023685D8023689E80002F06D03B003200F7
:1087000029002000FFF7B0FFE9E720000FF0C5FEC9
:10871000E5E7C04640EF0200F7B506000D1E03D1A5
:10872000234B03603000FEBD00200F000400010059
:1087300001903B78002B1AD03022524294469C4440
:108740006246092A11D90A2B0AD1019B2418013348
:108750000193A14200DA2100002004000137E8E77C
:108760000028FBD001340020F8E70120F6E7019A49
:10877000300012B209B2FFF7A7FF33680A249A1D2E
:1087800001235B42180029780029CBD00F00303F2D
:10879000092F07D85F1C00D1002363435B18303BCF
:1087A0000135F0E7591CFBD0137001320300F7E7E5
:1087B00040EF0200F0B5040087B004A80E0001925B
:1087C0001D00FDF797FC236801995A88914233DA1E
:1087D0009B889D4230DA1F2E2ED9059B00939E4226
:1087E0002ADC05230022203E5E43049B9B19039351
:1087F0000021039BAE189B5C0293019BCF1823685A
:108800005888009087420EDA9888B0420BDDDB1959
:1088100010270F41009870431B1802980740781EDC
:1088200087417F429F7101310529E6D10132052A36
:10883000DED1002007B0F0BD0048FBE717FCFFFFCA
:10884000F7B50468070063880E1E01931EDD994288
:1088500018DA0023063400933B68009A9B889A42FA
:1088600012DA019BA1199D1B2A00200010F091FA39
:10887000601931000FF003FE3B685B88E418009B31
:108880000133E8E70FF009FE002000E00048FEBDDC
:1088900017FCFFFF10B50548054C20600EF0A3FD46
:1088A000044A0549200010F003FA10BD40EF020011
:1088B000F42B00200000002071840200002815D055
:1088C000006041608260C360046145618661C76188
:1088D000444604624C464462544684625C46C46228
:1088E000644604636E46466374468463002A06D079
:1088F000C46B043C043A25681560B442F9D18C6B12
:10890000A6464E6BB546002B06D0CC6B043C043B10
:108910001D682560B442F9D10C6BA446CC6AA3460D
:108920008C6AA2464C6AA1460C6AA046CF698E6941
:108930004D690C69CB688A680868496870470060AF
:1089400041608260C360046145618661C7614446DD
:1089500004624C464462544684625C46C462644687
:1089600004636E46466374468463C46B043C0439F6
:1089700025680D60B442F9D1C76986694569046903
:108980007047006041608260C36004614561866138
:10899000C761444604624C464462544684625C4665
:1089A000C462644604636C46446374468463046929
:1089B0007047846BA646446BA546046BA446C46A04
:1089C000A346846AA246446AA146046AA046C769CF
:1089D000866945690469C3688268006841687047B0
:1089E000014B18607047C046F82B002080B2002869
:1089F00007D1BFF34F8F034B034ADA60BFF34F8FAA
:108A0000FEE7704700ED00E00400FA050120054B89
:108A100010B51A7850401870034B1B68002B00D01B
:108A2000984710BD492E0020FC2B0020F0B5254BA7
:108A300085B01B78DBB20093002B18D0224E234F59
:108A400033685A425A41D2B201923A68002A14D18C
:108A5000009C002B0BD021E003983B6898472C002A
:108A600019E028003368984729E0002C05D005B0AC
:108A7000F0BD002CFBD1009C019403A80FF0AFFDCA
:108A8000009C0500052806D00028E5D00022110032
:108A9000FFF7ACFF0024019B002BE6D10C4B03A990
:108AA0001B880B800B4B1D6828000FF09AFD0528D2
:108AB000DFD00028D5D000221100FFF797FF002C4F
:108AC000ECD1D9E74A2E0020002C0020082C0020F1
:108AD000C42D00200C2C0020074B10B51B68002B68
:108AE00007D09847002803D000221100FFF77EFF2F
:108AF00010BDFFF79BFFFBE7042C002002210C4B6D
:108B00000C4A30B599508021C9000C005D58002DE9
:108B1000FCD0A121C900585019590029FCD00021CE
:108B200099508021C9005A58002AFCD030BDC04657
:108B300000E0014004050000032370B504009840E4
:108B40009C4315331840E73383408140012022685D
:108B50009A438918074B084A98508020C0000500A6
:108B60001E58002EFCD0216059590029FCD000214C
:108B7000995070BD00E001400405000070B501256A
:108B800080260D4B0D4CF6001D519D59002DFCD03B
:108B9000802592001218ED00091A904205D100229A
:108BA0001A515A59002AFCD070BD0E5806605E5901
:108BB000002EFCD00430F0E700E001400405000086
:108BC00070B504000D0016000021102210F0FDF811
:108BD000054B320023612900200000F011FB034BFC
:108BE00020001C6070BDC046A0860100102C002033
:108BF00010B50400016100F0BDFA014B1C6010BD0E
:108C0000102C002070B5054D04002B68834203D062
:108C1000016900F0AFFA2C6070BDC046102C002036
:108C200010B5040000F006F8014B2000236010BDD1
:108C300050EF02000C4B70B503600023436083606B
:108C4000C360036243628363962304009B01051D96
:108C5000C363280000F010FC28002200034900F044
:108C6000A7FC200070BDC04660EF02009F86020096
:108C700010B50400044B03600FF072FD200000F0FB
:108C80001BF8200010BDC04670EF0200084B10B565
:108C900008330360002343608360C360040000F076
:108CA000B3F8044920610FF06DFE200010BDC046EE
:108CB00090EF02002788020010B50400034B083330
:108CC00003600FF0BDFD200010BDC04690EF020014
:108CD000054B10B51B68002B04D11922182103483D
:108CE00000F0CAFB10BDC046AC2D0020D42F0020E0
:108CF000030010B50020022B0ADD0749033B9B004F
:108D00005A585850824204D0136810005B68984744
:108D100010BD01204042FBE7142C002070B50C0070
:108D20001500022810DC0F4B1B68002B01D1FFF748
:108D3000CFFF6619B44205D021780B4800F08AFCB9
:108D40000134F7E7280070BD0338084B8000C05895
:108D5000002803D003681B689847F4E701204042CD
:108D6000F1E7C046AC2D0020D42F0020142C0020A9
:108D700010B50C0002280BDC0C4B1B68002B01D13A
:108D8000FFF7A6FF0A480FF052FF2070012010BD28
:108D90000338084B8000C058002803D003689B6844
:108DA0009847F4E701204042F1E7C046AC2D00208F
:108DB000D42F0020142C0020030010B50120022B1A
:108DC00008DD033B054A9B009858002803D0036840
:108DD000DB68984710BD01204042FBE7142C0020BF
:108DE000030010B50020022B08DD033B05489B0063
:108DF0001858002803D003681B69984710BD01204C
:108E00004042FBE7142C002000487047A4EF02000A
:108E100010B502480FF0BFFD10BDC046A4EF020020
:108E20000848026803210A4302600749074A084BC1
:108E30009B1A03DD043BC858D050FBDC0548804733
:108E40000548004724050040A487030000000020D7
:108E5000140100203D9C010009010000FEE7FEE72F
:108E6000FEE7FEE7FEE7FEE770B50E000E4C0500DC
:108E70002100300000F0D2FE28600023E3565A1C87
:108E800001D1002302E0B3420CD1A368A02201204B
:108E90000649D2002B7188506A221B021343044AF0
:108EA0008B5070BD0C34E8E7C0EF0200007000404A
:108EB000040500000B4B0C4910B55A580B4C2240CE
:108EC0005A5002795C58120222435A5080200122E3
:108ED000C0001A6019581142FCD1A122D200985842
:108EE00080B210BD0070004004050000FF00FFFFCD
:108EF00001704B1C0AD001238B404360044BC360BC
:108F0000044B0361044B4361044B83607047C046CC
:108F1000080500500C0500501005005014050050C5
:108F2000F7B5A223A022DB00D205D358BE220193BD
:108F3000314B5200995800293FD0C121890059581E
:108F400000293ADA0024E025C0269C50ED00B60244
:108F50002A4BA700F85800282CD0294BE35C002BA3
:108F600017D0019B0121E3400B4227D02300A02210
:108F7000C133FF339B00D2059B589B039B0F032BF0
:108F80001CD0204B1B68E3400B4217D01E4B1B68C4
:108F90009847A023DB05FF187A5932420AD07A5944
:108FA0001A490A407A51019AE240D3071FD57A59EB
:108FB00032437A5101341F2CCAD1F7BD019B0122E3
:108FC000E3401342E5D12300A021C133FF339B00CE
:108FD000C9055B589B039B0F032BDAD10C4B1B6815
:108FE000E3401342D5D0084B02211B68D0E7802212
:108FF000795992020A43DCE7006000401C2D0020F2
:109000004B2E0020A02D0020982D0020FFFFFCFFFC
:109010009C2D002030B5040008004D1C1CD00F48CA
:1090200021600260BE2200200D4C5200A0500D4A6B
:109030008D00AB5001220C4B5A54C1228023920068
:109040001B06A350094B0A4C99580C40C021090437
:109050002143995040221A6030BDC046982D00200F
:10906000006000401C2D00204B2E002000E100E09D
:10907000FFFF00FF70B5A024E0250068E405830031
:10908000ED001B195C591F4E34405C511E4D0124EC
:109090002E68002A26D0A14203D181400E432E60C3
:1090A00006E0022904D18440184A11680C43146078
:1090B0002A680121C2400A4204D1144A1268C240FF
:1090C0000A420ED0A021A222C905D2008958F1324D
:1090D000C140FF329858C90711D5C0218902014308
:1090E000995070BD012902D181408E43D7E70229F2
:1090F000DED1844005490A68A2430A60D8E780218E
:10910000ECE7C046FFFFFCFFA02D00209C2D0020B7
:109110000368074A9950074AFC33196A002902D0AC
:10912000002018627047013A002AF6D10120F9E7C1
:109130001C050000A186010010B50368002A03D0B9
:10914000802202209200985001221C001A62084AD4
:10915000FC34E068002806D00020A322E060D200A2
:109160009B580B7010BD013A002AF2D10120F9E79B
:10917000A186010010B50B4C02680B4BA14205DC27
:109180000A498160CC214904D15010BD084CA1424C
:1091900004DC084981608021C904F5E70649816043
:1091A000CD21F9E78FD0030024050000A08601003F
:1091B0007F1A060090D00300801A060070B50400E4
:1091C0001000A025C026C130FF30F600ED0580005C
:1091D00046510800C130FF3080004651A12520686B
:1091E000ED004251054A815019002000FFF7C2FFEF
:1091F000A02305212268DB00D15070BD0C050000C2
:10920000F8B50E001500040000F002FC264AF1B289
:109210001378DBB2012B1DD1507888421AD1977890
:10922000E8B2874216D16373204B19000022FC314B
:109230002360657126718A62A021C9005A501C49B9
:1092400020005A5001325A502A003100194BFFF7C2
:10925000B5FFF8BD184BE8B21F78012F09D15F7830
:109260008F4206D19F78874203D102236373134B49
:10927000DBE71778002F04D1012313705170907031
:10928000D1E71A78002A04D101321A705970987007
:10929000EBE70B480FF031FB0023FC2223606571E4
:1092A00026719362FFDEC0466A2E00200030004027
:1092B000FC0F0000A08601006E2E00200040004040
:1092C000F9860300036800221900FC3110B58A6298
:1092D000A021C9005A5006495A5001325A5005225D
:1092E0000421825641568368FFF768FF10BDC046CF
:1092F000FC0F0000036800211A00FC3210B59160D9
:1093000001315961074B9168002905D0002404738D
:10931000FFF7D8FF200010BD013B002BF3D1012047
:10932000F9E7C046A1860100036810B51900FC31B9
:109330008A6A0020012A08D1044C1C5988625A61AB
:109340000238A40701D40120404210BDC40400002B
:109350000261064A10B54260054A01738260054AFF
:10936000190002600FF030FC10BDC046040500502B
:1093700010050050000700500023134A30B5D356A3
:1093800083421DD00123D35683421BD00223D356E0
:10939000834214D10223190045310C480C4CFF3193
:1093A00089000C5001210D005C00601C8540A1402B
:1093B000A120084C2943C0002150FF21D15430BDC9
:1093C0000023E8E70123E6E7EB000020006000400F
:1093D000031F020000F00140A820012110B5124A2D
:1093E000124B1488C00059601C50548810481C50FF
:1093F0009088A922D200985080220820920098508C
:1094000080200932FF32000398500A4A1078A222C5
:10941000D2009850084A1088084A985000221960D3
:10942000FC331A6510BDC046D200002000A00040E9
:1094300044050000EE000020D00000204C05000094
:10944000012310B50A4ADC0014598C4207DD013BA8
:10945000DB00D3185A680168064BCA5010BD0133AF
:10946000112BF0D180210268024B4905D150F5E75C
:1094700014F0020024050000F8B50F0016000122C8
:10948000244BBA400360A023234CDB051959050087
:109490000A431A518022195912060A430121B14088
:1094A0001A511A598A4396211A511A5989015200A0
:1094B00052081A51FFF7C4FF002204202B681749F5
:1094C0005A506C3958500121996019601900FC31CB
:1094D000CA6013495A506A6014391F325A501149F0
:1094E0005F5009185A501E517B1C03D003213800CD
:1094F0000FF048FB731C03D0032130000FF042FB38
:109500000122094B29001A60084807320FF041FC7C
:10951000F8BDC04600200040140500006C050000A6
:109520001C0500000C050000AC2D0020D42F0020ED
:10953000962310B5DB00994202DDFFF781FF10BDD5
:109540009E210268014BC902D150F8E724050000B2
:109550000168034B002A01D1CA5070470E22FBE775
:109560006C050000C1230E4A9B00D15810B50906B6
:1095700003D50C49096A002908D1D3585B0704D5E3
:10958000084B0021DB68002B01D110BD0121064BE7
:1095900018680028F9D0054B1B689847F5E7C046C6
:1095A00000200040FC200040A82D0020A42D002019
:1095B000034B1960436803499B005A507047C046EB
:1095C000A42D0020A82D002000681F4B30B5C31823
:1095D0005C4263415B00002A1CD0002911D00129A4
:1095E00014D0FF20C024DD00A8401849A4000A5967
:1095F0008243C020A84002430A5101229A400A60D7
:1096000030BDC122042192008150EAE7C1228021AD
:109610009200F9E7002908D00129F1D1C222802463
:10962000920084508258920806E0C22204219200DF
:10963000815082580339D2099143E1D001229A40E6
:109640001300034AD367DBE700E0FFBF00E100E05F
:1096500004E100E003681A00FC32106A0128FCD122
:1096600000201062014AC9B2995070471C050000E1
:1096700070B51D00A02304001600DB00002D0ED0E5
:1096800000224068C250082902D012480FF035F974
:10969000032E16D8300000F037FB170510120268B1
:1096A000D550F0E70223A0220B48D200002D0DD0A8
:1096B00061680B5002238B5070BD0423F3E706232F
:1096C000F1E706480FF019F90023ECE721680B5089
:1096D0000123F0E70A8703005405000023870300F5
:1096E000036810B55A1C0DD0A0220020164CD200E1
:1096F00098501000154AA14205DC80218904995038
:1097000001221A5010BD124CA14202DC8021C90472
:10971000F5E7104CA14202DC80210905EFE70E4C71
:10972000A14202DC80214905E9E70C4CA14202DCA0
:1097300080218905E3E70A4CA14202DC8021C905AA
:10974000DDE780210906DAE78FD003002405000059
:109750001FA107003F420F007F841E00FF083D004D
:10976000FF117A00F7B5009308AB1B7805005BB2D8
:109770000F0016000193013357D1614B1A78022A6A
:109780003ED15978FAB291423AD19978F2B29142E7
:1097900036D1DA786B461B789A4231D10123594C85
:1097A00003720123002201205B426B603900564B9B
:1097B0002C60E250E050A023C131FF31DB0589006D
:1097C000C850524967500099C131FF318900C850D3
:1097D000A1210098C90060503100C131FF318900DA
:1097E000CA50A223DB00E650FC3408212800E260C6
:1097F0001300FFF73DFF46492800FFF771FFF7BD53
:10980000444A1378DBB2022B0FD15078F9B2884268
:109810000BD19078F1B2884207D1D1786A4612789C
:10982000914202D12B723C4CBBE73A4B1A78002A8A
:1098300050D10232F9B21A705970F1B2997069467A
:109840000978354CD9702A72019B0133A9D00123C4
:1098500000222D495B4238002B6002336C6062505D
:109860006350A021C130FF30C90580004250300054
:10987000C130FF30800042500098C130FF3080007E
:1098800042500198C130FF3080004250A221C900EF
:1098900067501E49009866500439605001981F496E
:1098A00060502100FC318A60CA62A721C900635060
:1098B000103163501A481B4960501B481B496050C7
:1098C0008021042089006050F939FF392800FFF712
:1098D000CFFE94E70A4B1A78002A0CD102321A7094
:1098E000FAB25A70F2B29A706A461278054CDA707F
:1098F00001232B72A8E70E480EF0FFFFA4E7C04635
:109900006A2E002000300040FC0F00000C05000013
:1099100040420F006E2E0020004000401405000061
:10992000732E002044050000722E00203405000034
:109930003487030003681A00FC32D0680028FCD189
:1099400005481950D1680129FCD10021D160A3221A
:10995000D20098587047C0461C050000A023F0B5FF
:10996000284FDB00FA5885B001920022A024FA505B
:10997000E023254AE405DB00E658E2507833E1585D
:1099800001250291E250A1238022DB00D205E250A2
:109990000420E5500FF05FF9A222D200A3580397EC
:1099A0009B0F2B4228D0A35813242B4225D00120F3
:1099B000A023E0220299DB05D2009E507832995014
:1099C000A023039A0199DB00D15005B0F0BD0F4BE5
:1099D0000420EF500FF03FF9A123DB00EF500420EB
:1099E0000FF039F9A223DB00EB585B00DFD4013C18
:1099F000002CECD12000DBE71324A0250127ED0586
:109A0000F5E7C046004000400D0600000C050000D0
:109A1000A023E021134ADB05C90010B55A50783164
:109A20005A50114B00221900FC31CA600A62A12170
:109A30001E20C9005A500D4A0D4C9850CC200D4A9A
:109A400040049850A2200C4AC00014500B480C4C03
:109A5000145001205050A0220521D2009950FFF748
:109A60007DFF10BD0C060000004000400C0500000A
:109A7000384100402405000000F0014014050000BA
:109A80001C400040012310B50D4C0E49A3648023F7
:109A90009B00CB670C490D4A086D002804D00020BC
:109AA000086511680131116009490B60A923DB00C9
:109AB0001068E358010C9BB20004184310BDC04667
:109AC0000090004004E100E0FC900040B02D002038
:109AD00000E100E0F8B50F4C636C002B0FD00027BD
:109AE0000D4E67643378BB4209D00C4B1D68FFF7FD
:109AF000C9FF2D1ABD4202DC3770FFF789F9236DCB
:109B0000002B05D0064A1368013313600023236538
:109B1000F8BDC046FC900040742E0020B42D0020FB
:109B2000B02D002070B51B4D2878002831D10121BF
:109B3000194B1A4A596050608020C0050160516875
:109B40000029FCD000221649A2205A5004240121E9
:109B5000C000D9601C5008381A501248C2261A504A
:109B6000C12280209200000398508020400298502B
:109B70000D4AB60090590D4C0440C020000220430D
:109B80009051C02480206400800010511060196042
:109B9000297070BD752E002000900040FC00004030
:109BA000040500004C05000000E100E0FF00FFFF9D
:109BB000044B10B51B78002B01D1FFF7B3FFFFF763
:109BC00061FF10BD752E0020104B70B51B7804008E
:109BD000002B01D1FFF7A6FF0D4D0E4E2B78002B69
:109BE00002D03368A34210D0FFF74CFF201A0A2896
:109BF00003DCFFF747FF0A30040001232B70A82382
:109C0000054A3460DB00A4B2D45070BD752E00202C
:109C1000742E0020B42D00200090004010B50400E8
:109C2000431C07D00FF030F80400431C02D1024857
:109C30000EF063FE200010BD45870300224910B5D9
:109C40000B68DBB2012B0FD1204B1B681B070BD11C
:109C50001F4BE0241A68F02310001840224228D13C
:109C60001C4A12681A4227D00B68DBB2012B12D1B2
:109C7000164A126812070ED1F021154A12680A40DE
:109C8000402A08D1134A12680A4204D18021C12215
:109C9000C905D2008B508022A3230021D205DB000E
:109CA000D1500D4B9960013191609A68002AFCD027
:109CB00010BD3028D4D0D7E7084B094A1A6080225B
:109CC000084B12021A60CFE7E00F00F0E40F00F03B
:109CD000E80F00F0EC0F00F0FC000040040500402D
:109CE000DFFF07C0186C0040014B18687047C04682
:109CF000B82D002002B471464908490009564900B0
:109D00008E4402BC7047C04602B4714649084900FF
:109D1000095C49008E4402BC7047C04603B47146DA
:109D2000490840004900095E49008E4403BC704761
:109D3000002243088B4274D303098B425FD3030A8A
:109D40008B4244D3030B8B4228D3030C8B420DD39D
:109D5000FF22090212BA030C8B4202D3121209022B
:109D600065D0030B8B4219D300E0090AC30B8B4269
:109D700001D3CB03C01A5241830B8B4201D38B0317
:109D8000C01A5241430B8B4201D34B03C01A5241BC
:109D9000030B8B4201D30B03C01A5241C30A8B42FF
:109DA00001D3CB02C01A5241830A8B4201D38B02EA
:109DB000C01A5241430A8B4201D34B02C01A52418E
:109DC000030A8B4201D30B02C01A5241CDD2C30900
:109DD0008B4201D3CB01C01A524183098B4201D37C
:109DE0008B01C01A524143098B4201D34B01C01A67
:109DF000524103098B4201D30B01C01A5241C308DF
:109E00008B4201D3CB00C01A524183088B4201D34D
:109E10008B00C01A524143088B4201D34B00C01A39
:109E20005241411A00D20146524110467047FFE7A5
:109E300001B5002000F0F0F802BDC0460029F7D0BF
:109E400076E7704703460B437FD4002243088B42DA
:109E500074D303098B425FD3030A8B4244D3030BB1
:109E60008B4228D3030C8B420DD3FF22090212BA76
:109E7000030C8B4202D31212090265D0030B8B42F2
:109E800019D300E0090AC30B8B4201D3CB03C01ADC
:109E90005241830B8B4201D38B03C01A5241430BB7
:109EA0008B4201D34B03C01A5241030B8B4201D3A7
:109EB0000B03C01A5241C30A8B4201D3CB02C01A12
:109EC0005241830A8B4201D38B02C01A5241430A8A
:109ED0008B4201D34B02C01A5241030A8B4201D379
:109EE0000B02C01A5241CDD2C3098B4201D3CB0120
:109EF000C01A524183098B4201D38B01C01A5241CF
:109F000043098B4201D34B01C01A524103098B42D2
:109F100001D30B01C01A5241C3088B4201D3CB00BD
:109F2000C01A524183088B4201D38B00C01A5241A0
:109F300043088B4201D34B00C01A5241411A00D250
:109F400001465241104670475DE0CA0F00D04942B9
:109F5000031000D34042534000229C4603098B4229
:109F60002DD3030A8B4212D3FC22890112BA030AB1
:109F70008B420CD3890192118B4208D38901921133
:109F80008B4204D389013AD0921100E08909C309B8
:109F90008B4201D3CB01C01A524183098B4201D3BA
:109FA0008B01C01A524143098B4201D34B01C01AA5
:109FB000524103098B4201D30B01C01A5241C3081D
:109FC0008B4201D3CB00C01A524183088B4201D38C
:109FD0008B00C01A5241D9D243088B4201D34B00A7
:109FE000C01A5241411A00D20146634652415B10E9
:109FF000104601D34042002B00D5494270476346CA
:10A000005B1000D3404201B5002000F005F802BD0E
:10A010000029F8D016E770477047C0468446101CE8
:10A0200062468C46191C634600E0C0461FB501F02D
:10A030004DFF002801D40021C8421FBD10B501F01A
:10A04000A5FE4042013010BD10B501F03FFF0028D1
:10A0500001DB002010BD012010BDC04610B501F08D
:10A0600035FF002801DD002010BD012010BDC046D5
:10A0700010B501F0C7FE002801DC002010BD012052
:10A0800010BDC04610B501F0BDFE002801DA002069
:10A0900010BD012010BDC0468446081C6146FFE784
:10A0A0001FB500F04FFC002801D40021C8421FBD9D
:10A0B00010B500F0D1FB4042013010BD10B500F0EA
:10A0C00041FC002801DB002010BD012010BDC0466E
:10A0D00010B500F037FC002801DD002010BD012084
:10A0E00010BDC04610B500F0DFFB002801DC0020E9
:10A0F00010BD012010BDC04610B500F0D5FB0028F2
:10A1000001DA002010BD012010BDC046002B11D186
:10A11000002A0FD1002900D1002802D00021C94314
:10A12000081C07B4024802A14018029003BDC046B3
:10A13000E9FEFFFF03B4684601B5029800F01EF87F
:10A14000019B9E4602B00CBC7047C0469E2110B5D4
:10A15000C905041CFFF7D0FF002803D1201C00F024
:10A160004DFF10BD9E21201CC90500F06DFD00F0C3
:10A1700045FF80231B069C466044F2E7F0B54F463E
:10A180004646D646C0B5040082B00D0091469846BA
:10A190008B422FD82CD04146484602F01DFE2900A4
:10A1A0000600200002F018FE331A9C46203B9A4617
:10A1B00000D576E04B46524693401F004B46624620
:10A1C00093401E00AF4228D825D05346A41BBD4162
:10A1D000002B00DA7BE00022002300920193012390
:10A1E000524693400193012362469340009318E046
:10A1F0008242D0D900220023009201930A9B002BB7
:10A2000001D01C605D600098019902B01CBC9046B2
:10A210009946A246F0BDA342D7D90022002300925E
:10A2200001936346002BE9D0FB079846414672082C
:10A230000A437B0866460EE0AB4201D1A2420CD82D
:10A24000A41A9D41012024196D410021013E2418CA
:10A250004D41002E06D0AB42EED9013E24196D418E
:10A26000002EF8D100980199534600196941002B3E
:10A2700023DB2B005246D3402A006446E2401C00F8
:10A2800053461500002B2DDB26005746BE403300F9
:10A2900026006746BE403200801A99410090019125
:10A2A000ACE7624620239B1A4A46DA406146130017
:10A2B00042468A4017001F4380E7624620239B1ACC
:10A2C0002A0066469A402300F3401343D4E76246CF
:10A2D000202300219B1A0022009101920122DA40E2
:10A2E000019280E72023624626009B1ADE402F0061
:10A2F000B0466646B74046463B003343C8E7C046D3
:10A30000F8B54746CE4643025B0A4400C20F9C465E
:10A310004800DD004B02240E5B0A000E80B5984613
:10A3200026009146C90FDB00271A8A4229D0002F48
:10A3300015DD00284AD1002B00D095E0ED08FF2C58
:10A3400000D188E06B025B0AE6B25B02F605580AB0
:10A350003043D20710430CBC90469946F8BD002FFD
:10A3600000D087E0601CC0B2012800DCB6E0EE1A25
:10A37000720100D5C5E0002E3DD100220026002349
:10A38000E3E7002F00DC96E000285DD0FF2C60D0D2
:10A390008022D20413431B2F00DDECE02022D21BCD
:10A3A00018009340F8405A1E93410343ED186B0187
:10A3B0007BD50134FF2C00D1B7E0012207262A40CB
:10A3C0006B089A4D1D4015432E4029E0FF2CB5D057
:10A3D0008022D20413431B2F00DDB2E02022D21BC7
:10A3E00019009340F9405A1E93410B43ED1A6B013B
:10A3F0005BD5AD01AE09300002F0D0FC05388640D7
:10A40000844265DC041B330020200134E340041B3C
:10A41000A640751EAE41334307261D0000241E4092
:10A4200001224B461A40002E04D00F232B40042B50
:10A4300000D004356B0100D480E70134E6B2FF2C74
:10A440002FD1FF26002380E7002B52D1FF2C00D014
:10A4500074E70A00ED08002DF3D08023DB032B43C3
:10A460005B025B0AFF2670E7013F002FBED0FF2C86
:10A47000B1D163E7002C47D0FF2869D08024E404E1
:10A480007A4225431B2A00DDC5E02C002026D4405B
:10A49000B21A95406A1E954125435D1B040089460A
:10A4A000A5E7AB015B0A50E7002401224B461A40A6
:10A4B0006B07BAD142E7002F3BD10134E0B201284B
:10A4C0004ADDFF2CBDD00726ED186D082E40A7E70A
:10A4D0000723574D241A35401E40A1E7002C1BD1FD
:10A4E000002D6ED1002B00D19AE00A001D003C0027
:10A4F00024E7013F002F00D158E7FF2C00D04AE7A6
:10A50000A7E75E1B894676E7002D1CD10A00FF28CD
:10A510001FD004001D0011E7002D5DD1002B17D1C5
:10A5200080230022DB03FF260FE70A00FF2600231B
:10A530000BE7002C21D1002D66D1FF28E9D11D00A9
:10A5400087E7012352E77A1CA7D0FA43FF2899D165
:10A550000A001D00FF24F1E6002E21D1002D4FD06E
:10A56000002B4CD0ED186B019ED5314B07362E4099
:10A5700001241D4054E7012318E7FF28DFD0802481
:10A58000E4047F4225431B2F4DDC2026F61B2C00C4
:10A59000B540FC406A1E95412543ED18040006E7CE
:10A5A000002DCCD0002B00D153E780216046C90399
:10A5B000084203D04046084200D11D00012111404D
:10A5C00047E7002B00D1B9E6EA1A500125D5072646
:10A5D0005D1B2E40894623E7FF24002B00D1ADE60A
:10A5E00080226046D203104204D04046104201D17E
:10A5F0001D00894601224B46FF241A409EE62B008F
:10A60000DD080A0000249DE67A1CC6D0FF43FF281F
:10A61000B9D11D001DE701253FE7151E00D044E715
:10A620000022002391E60125B7E7C046FFFFFF7D2A
:10A63000FFFFFFFBF8B557464E464546DE4644024F
:10A64000E0B546008846640A360EC70F002E63D078
:10A65000FF2E24D08023E400DB041C430023994612
:10A660009B467F3E434642465D02D20F5B006D0A29
:10A670001B0E9046924665D0FF2B55D080220021BC
:10A68000ED00D2047F3B1543F61A43464A467B4011
:10A690000F2A00D98DE06D48920082589746002C11
:10A6A00054D108239946063BFF269B46DAE700254E
:10A6B000534602291BD0032900D1BFE0012928D02D
:10A6C00030007F30002820DD6A0704D00F222A40A6
:10A6D000042A00D004352A0103D530005C4A8030BA
:10A6E0001540FE2803DCAC01640AC2B201E0FF227F
:10A6F00000246402D205600ADB07104318433CBC07
:10A7000090469946A246AB46F8BD0122101A1B2876
:10A710007CDD00220024ECE7002C1DD104239946A7
:10A72000033B00269B469DE7FF3E002D20D10221E2
:10A7300043464A467B400A430F2AD8D845489200F0
:10A7400082589746002D19D10121F1E70C23994633
:10A75000093BFF269B4685E7200002F01FFB76267B
:10A76000431F9C4000237642361A99469B4679E760
:10A770004A4603231A439146032186E7280002F044
:10A780000DFB431F36189D40763600217DE780245F
:10A790000023E403FF22ACE700258023DB031C42F7
:10A7A00028D01D4226D12B435C02640A4346FF2277
:10A7B0009FE762016C01A24224D21B210025013EC9
:10A7C000012710006D005200002801DB944201D8DF
:10A7D000121B3D4301390029F3D11400621E94413C
:10A7E00025436DE7BA46594625005346022900D055
:10A7F00061E77CE78023DB031C436402640A3B00BF
:10A80000FF2276E7121B1A210125D9E79E362A007E
:10A81000B5402C00C240651EAC411443620704D011
:10A820000F222240042A00D00434620103D4A40180
:10A83000640A00225DE7012200245AE78024E40331
:10A840002C436402640AFF2253E7C0469CF00200D6
:10A85000FFFFFFF7DCF0020070B542004E024C0033
:10A8600045026D0A120EC30F760A240EC90FFF2A85
:10A870000FD0FF2C11D00120A24200D070BDB542F4
:10A88000FCD18B420DD0002AF8D12800451EA841EA
:10A89000F4E70120002DF1D1EBE70120002EEDD1EE
:10A8A000E9E70020EAE7C04670B54A004E024502DB
:10A8B00044006D0A240EC30F760A120EC90FFF2C36
:10A8C00015D0FF2A0ED0002C15D1002A01D1002E60
:10A8D0001CD0002D14D08B4227D00220013B184001
:10A8E000013870BD002EEED002204042F9E7002D65
:10A8F000FAD1FF2A0ED0002A0ED1002EEDD00BE0A7
:10A9000001230139994308000130EAE70020002DB6
:10A91000E7D0E2E7002EE7D18B42DED1944205DD9D
:10A920000221581E08400138DBE70024A24204DC63
:10A93000B542D2D80020B542D3D2581E0123984345
:10A940000130CEE730B5420044024D02C30F48004B
:10A95000640A120E6D0A000EC90FFF2A12D0FF28DA
:10A960000CD0002A12D1002819D1002D17D1002CAB
:10A970002BD00220013B1840013826E0002DF0D0FA
:10A98000022022E0002CFBD1FF281FD000281FD17D
:10A99000002D1DD10220013B1840013815E0002C8C
:10A9A0000ED08B42E5D10022904204DCAC42E0D8CC
:10A9B0000020AC4209D2581E01239843013004E024
:10A9C0000123013999430800013030BD002DD7D152
:10A9D0008B42CED18242E7DD0221581E0840013869
:10A9E000F3E7C046F0B54E4657464546DE46E0B56D
:10A9F00043025B0A450083B00F1C99462D0EC60F1B
:10AA0000002D57D0FF2D24D08020DB00C004184338
:10AA1000002381469A469B467F3D7C027A00FB0FCD
:10AA2000640A120E984623D0FF2A4BD0E3008024FC
:10AA30000020E4047F3A1C43AD186B1C4746019389
:10AA4000534677403A000F2B48D87D499B00CB589E
:10AA50009F46002B00D085E008339A46063B9B4674
:10AA60007C027A00FB0FFF25640A120E9846DBD1A8
:10AA7000002C00D090E0524601231A439246012058
:10AA8000DBE74C4658461700022824D0032800D1A3
:10AA9000CFE00022002301284DD15802D205400A00
:10AAA000FF071043384303B03CBC90469946A2468A
:10AAB000AB46F0BD002B5BD104239A46033B002537
:10AAC0009B46AAE7FF35002C60D1524602231A4369
:10AAD00092460220B1E7FF220023DEE74B461B0C23
:10AAE0009C464B462604360C180461463300220C63
:10AAF0006446000C43434E435043544380191A0CA0
:10AB00001218964203D9802149028C4664441B04E2
:10AB10001B0C1004C01883015E1EB341800E184345
:10AB2000130C1B199B0103431C00230179D501233E
:10AB300062081C401443019A7F32002A4DDD6307EE
:10AB400004D00F232340042B00D00434230103D569
:10AB50003C4B019A1C408032FE2ABCDCA3015B0AFC
:10AB6000D2B29AE70C239A46093BFF259B4654E74D
:10AB7000180002F013F94A46431F76259A40002335
:10AB80006D4291462D1A9A469B4646E7524603234C
:10AB90001A439246032050E7200002F0FFF8431FBB
:10ABA0002D1A9C40763D002047E780230027DB03D9
:10ABB000FF2272E7424666E74C463200584662E79B
:10ABC00080234A46DB031A4222D01C4220D1234371
:10ABD0005B025B0A4746FF225FE701239A1A1B2AA2
:10ABE00021DC23000199D3409E318C401A002300C0
:10ABF0005C1EA34113435A0704D00F221A40042AB3
:10AC000000D004335A0111D49B015B0A002244E7AF
:10AC100080234A46DB0313435B025B0A3700FF22B3
:10AC20003BE7019587E70022002336E70122002356
:10AC300033E78023DB0323435B025B0AFF222CE71D
:10AC40001CF10200FFFFFFF7F8B54746CE4644006F
:10AC5000C20F80B547024802400A84466646480053
:10AC60007F0A240EF60025009046FB00000EC90F57
:10AC7000B146FF2800D185E001267140261A914295
:10AC800057D0002E43DD002800D07FE04946002940
:10AC900000D1AAE0013E002E00D0F7E05B1A5A0175
:10ACA00000D48BE09B019C09200002F077F8053866
:10ACB0008440854200DDD3E0451B23002020013580
:10ACC000EB40451BAC40621E944123430724002502
:10ACD0001C40012241460A40002C04D00F2119409B
:10ACE000042900D00433590100D480E00135ECB2CE
:10ACF000FF2D00D0A3E0FF2400235B02E405580AE7
:10AD0000D207204310430CBC90469946F8BD002E54
:10AD100074D1601CC0B2012800DCA7E04A469C1A2E
:10AD2000620100D5B6E0002CBED100220024002331
:10AD3000E3E7002E00DC85E0002846D0FF2C49D058
:10AD400080224846D2041043814601221B2E09DC92
:10AD500020204C46801B84404A462000F240441E7E
:10AD6000A04102439B185A0128D50135FF2D00D17F
:10AD7000A8E00122072494491A405B080B401343C2
:10AD80001C40A6E7002E00D078E775E7FF2C54D0D2
:10AD900080224946D2041143894601221B2E09DC38
:10ADA00020214846891B88404A460100F240481E3F
:10ADB00081410A439B1A5A0100D573E7012241469B
:10ADC0000A40590700D089E711E04846002858D1C9
:10ADD000FF2C0CD1DB08002B00D18CE78020C003B6
:10ADE00003435B025B0AFF2487E7FF2C25D0DB08C7
:10ADF000FF2DF0D05B025B0AECB27EE7002C4DD059
:10AE0000FF2818D08024E404724223431B2A00DD6B
:10AE1000C4E01C002025D440AA1A93405A1E934136
:10AE200023434A460500D31A884638E7721CF8D0F7
:10AE3000F243FF28EAD10A004B46FF25D7E79B01E2
:10AE40005B0A5AE7002E41D1651CE9B2012945DDB4
:10AE5000FF2D00D14FE707244B445B081C4038E727
:10AE600007225A4B2D1A2340144032E7002C1DD1E3
:10AE7000002B7AD14B46002B00D191E00A0000252F
:10AE8000B5E7013E002E19D14B446CE7FF2C84D16D
:10AE9000FF25ACE74A468846D41A05E7002BC5D102
:10AEA0000A00FF28C8D005004B46A0E7002B49D177
:10AEB0004B46002B77D00A00FF2598E7FF2C00D0E7
:10AEC00043E787E70A00FF24002316E7002C15D18B
:10AED000002B57D1FF28E6D14B467BE7002C20D131
:10AEE000002B57D04946002953D04B445A0168D50E
:10AEF0000724364A1C4001251340EAE6FF28EBD020
:10AF00008022D204764213431B2E53DC2025AD1B36
:10AF10001A00AB40F2405C1EA34113434B440500B2
:10AF200021E7002BD8D04946002900D152E78021E3
:10AF3000C9030F4200D14DE76046084200D049E7FF
:10AF40004B4647E74846FF25002800D14FE78022BF
:10AF5000D203174204D06046104201D14B468846C6
:10AF600001224146FF250A4041E7484600281FD0FC
:10AF70001A1A500120D54A460724D31A1C40884685
:10AF80000025A6E6741CC9D0F643FF28BCD14B4669
:10AF900020E799464B460025DB082BE7012340E7D5
:10AFA00000220023A9E680230022DB03FF24A4E67D
:10AFB00000251CE70123B1E7002AF1D0130000258A
:10AFC000FCE60025FAE6C046FFFFFF7DFFFFFFFB22
:10AFD00042024B0240004900520A5B0A090E000E71
:10AFE000FF2806D00020FF2902D11800431E9841F7
:10AFF0007047FE38002AFBD1F4E7C0464102420008
:10B00000C30F490A120E00207E2A0DD99D2A0CD8A2
:10B01000802000040143952A0ADC9620821AD14040
:10B020004842002B00D108007047034A9818FBE7FC
:10B03000963A9140F4E7C046FFFFFF7F70B50028C5
:10B040003DD0C317C5185D40C40F280001F0A6FE0F
:10B050009E22121A962A07DCD2B2082833DD08385D
:10B0600085406802400A23E0992A0BDD0523290068
:10B070001B1AD94003001B339D402B005D1EAB41C2
:10B0800019430D00052801DD431F9D402B000F498A
:10B090000B406E0709D00F263540042D05D0043330
:10B0A0005D0102D59F220B40121A9B01580AD2B2B1
:10B0B0004002D205400AE4071043204370BD00243B
:10B0C00000220020F4E76802400AF1E7FFFFFFFBDF
:10B0D00070B5041E34D001F061FE9E22121A962A29
:10B0E00007DCD2B208282EDD083884406002400A0E
:10B0F00021E0992A09DD030021001B3399404B1EF2
:10B10000994105231B1ADC400C43052801DD431F30
:10B110009C4023000D490B40650709D00F252C40AA
:10B12000042C05D004335C0102D59F220B40121A77
:10B130009B01580AD2B24002D205400A104370BDAA
:10B1400000220020F7E76002400AF4E7FFFFFFFB60
:10B15000F0B54F464646D6460C000903C0B5490A2D
:10B16000470F5E0039431F03DB0F9C4665007B0AD7
:10B17000570F1F436D0DE40F760DA146C000B84672
:10B18000D200AB1B64457BD0002B5FDD002E00D0CE
:10B19000A4E03E00164300D112E15E1E002E00D056
:10B1A0009EE1871A4346B84280410125C91A4042B0
:10B1B000091A0B0200D431E149024E0A002E00D1D7
:10B1C0006EE1300001F0EAFD0300083B1F2B00DDBB
:10B1D00061E120223900D21A9E40D1409F400E43A7
:10B1E0009D4200DD51E15D1B6B1C1F2B00DD7CE1EE
:10B1F0002021C91A3D0030008F408840DD40791E73
:10B200008F41310007222843D940002507433A40A7
:10B21000002A09D00F233B40042B05D03B1DBB4225
:10B22000BF417F42C9191F000B0200D426E26A1CED
:10B23000C64B55056D0D9A4200D106E1C44AFF0880
:10B240000A40530752023B43120B8EE0002B00D002
:10B25000B8E06B1C5B055B0D012B00DC30E1871A4D
:10B260004346B842B641CB1A76429E1B330200D504
:10B270004CE13B003343A1D100220024002570E0C3
:10B28000002B00DCE5E0002E00D183E0AF4EB5429C
:10B2900060D0802636043743B846382B00DC3EE1C8
:10B2A000434613431F007A1E97413F18874280414F
:10B2B000404209180B0200D4B0E0A44B01359D4276
:10B2C00000D1C3E0A24A7B080A4001210F401F437E
:10B2D0005108D30707221F433A4099E79B4EB542D6
:10B2E00038D0802636043743B846382B00DDDCE002
:10B2F0001F2B00DC30E11E004746203EF740BC46D5
:10B30000202B04D04026F31A46469E4032431700B5
:10B3100063467A1E97411F43CCE0002B00D104E224
:10B320004346134300D159E14B07C008184380231B
:10B33000C9081B03194208D04546ED081D4204D137
:10B340004346D008590708432900420FC9007F4DE2
:10B350001143C0004B07CA087C49C00803438D4213
:10B3600068D012036D05120B6D0D00211203180039
:10B37000130B0A0D12051A43764B2D0513402B4370
:10B380005B00E4075B08234319001CBC9046994608
:10B39000A246F0BD3E00164312D05E1E002E00D025
:10B3A00000E1871887428041414440420918012545
:10B3B0000B0233D5022585E7644633004146100071
:10B3C0001D00C7E7002D00D0DAE00C000443F3D0E5
:10B3D0005C1C00D19FE15D4CA64200D12FE1DB4314
:10B3E000382B00DD66E11F2B00DD83E12024050002
:10B3F000E41A0F00DD40D940A0404346A7405B1A45
:10B40000441EA04198462F433843171ABA4292412E
:10B4100043465242991A64463500CAE607223A402A
:10B42000002A00D0F6E64B07CA084849FF083B430C
:10B430008D4296D11900114300D19EE1802109036C
:10B440000A431203120B414D8FE71500002200231F
:10B450008BE7002B00D0C7E06B1C5F057F0D012F31
:10B4600000DCF1E0394DAB4200D1B9E085180A00AB
:10B47000854289414244494251180722CF076D084D
:10B480002F4349083A401D00C2E607223049ED1A11
:10B4900031403A40BCE63E002838864000279FE60F
:10B4A000380001F07BFC20308EE6434613431F003A
:10B4B0007A1E9741C71BB84280414042091A78E67C
:10B4C0000E003B0006431343002D61D1002E00D037
:10B4D000F4E0002B00D11BE164463900100039E78D
:10B4E0001A4FBB427AD03300FFE630001F3DE840E0
:10B4F000202B03D04021CB1A9E4037437B1E9F4117
:10B50000072207433A400021002589E7171A4346DE
:10B51000BA42B641591A76428E1B64464EE61F2B3C
:10B5200000DDADE020264746F61AB740B9461700C1
:10B53000B246DF404E463E4337005646B240561EA6
:10B54000B24117434246DA408918AEE6FF070000D1
:10B55000FFFF7FFFFFFF0F8020264746F61AB74008
:10B56000B9461700B246DF404E463E4337005646C6
:10B57000B240561EB24117434246DA40891A99E753
:10B580007F4CA6425BD0802424045B42214327E702
:10B59000002E0CD1002B00D1CBE064463900100006
:10B5A000774DD7E6764FBB4218D0330075E6002BB7
:10B5B00014D04B07C00818438023C9081B03194245
:10B5C00007D0FC081C4204D17907D0080843E146A3
:10B5D00021004C46420FC9001143C000684DB9E636
:10B5E0001D0000220023C0E6002D5BD10D000543A5
:10B5F00000D1E2E65D1C00D1B0E0614DAE421FD04B
:10B60000DB43382B71DC1F2B00DD96E020250F007B
:10B61000ED1AAF40B9460700AA46DF404D463D430C
:10B620002F005546A840D940451EA84188440743ED
:10B63000BF18974292415142414435003AE6644670
:10B6400035004146100085E60B000343002D00D075
:10B6500063E6002BF5D04346134300D17AE6871802
:10B660008742804107224144404209183A400B0278
:10B6700000D4D5E6434B01351940C9E5380069E6E9
:10B680001E004746203EF740BC46202B04D04026F3
:10B69000F31A46469E403243170063467A1E97418E
:10B6A0001F4302E6364DAE42CAD080252D045B42D0
:10B6B0002943A6E70843411E8841A6E6002B00D196
:10B6C00048E6871A4346B842B641CB1A76429E1BDB
:10B6D00033024BD5171A4346BA429241591A524285
:10B6E000891A072264463A4092E501430F00791E09
:10B6F0008F419DE71C000F00203CE740202B03D02A
:10B700004024E31A99400843411E884138437CE6AF
:10B710000022002425E6171A4346BA429241591ADC
:10B720005242891A6446350043E541461000144DE3
:10B7300010E680220024120380E61D000F00203D49
:10B74000EF40BC46202B03D04025EB1A994008431C
:10B7500007006346781E87411F4369E787189742B1
:10B760009B4141445B42C9183500A3E53B0033438C
:10B77000CED0072231003A4052E600231A00F4E509
:10B78000FF070000FFFF7FFFF0B55746DE464E463D
:10B790004546E0B5834607000E03480085B0924653
:10B7A0001C00360B400DCD0F002800D19DE0954BBD
:10B7B000984239D08023F6001B041E43924A7B0F27
:10B7C00033439946944603006344009300230026C4
:10B7D000FF00029323031B0B98466300E40F5246BD
:10B7E0005B0D019400D1B3E086498B4200D19EE00D
:10B7F0004246D100802212040A435146490F1143A8
:10B800008B46814952468C4600996344CB1A0021ED
:10B81000D20000932B0063409A460F2E00D905E119
:10B820007A4BB6009B599F465B463343994600D0FE
:10B83000B8E002230826002700900293CAE7CB460F
:10B840003A0002990195019B9A46022927D00329C3
:10B8500000D180E2012944D06D49009B8C466344AD
:10B860001C00002C38DD530700D013E2D2085B46E1
:10B87000DB0109D55946674B19408B468021C90029
:10B880008C46009B63441C00634B9C4207DC5B4678
:10B8900064055F075B0217431B0B620D02E0002388
:10B8A0000027584A00211B031C0B0B0D1B052343CB
:10B8B00014055A4A380013401C4353466400DB0702
:10B8C00064081C43210005B03CBC90469946A24642
:10B8D000AB46F0BD0122524201231B1B382B00DC7A
:10B8E000ADE1002200230027DCE75B4633439946A5
:10B8F0005ED0002E00D18AE1300001F04FFA030043
:10B900000B3B1C2B00DD7BE11D22D31A5A460100A4
:10B91000DA4008398E4013005F46334399468F4022
:10B920003F4B00261B1A00930023029352E7414627
:10B9300053460B433B499B468C46009B6344009314
:10B940005B46002B3BD1022300221E43022161E70C
:10B95000434613439B4637D04346002B00D162E158
:10B96000404601F01BFA03000B3B1C2B00DD53E1AA
:10B9700002004146083A914088461D21CB1A5146A3
:10B98000D9400B0041460B439B46534693401A0057
:10B99000009B25499C46604403008C466344009309
:10B9A000002137E70323B14600900C26029311E7EC
:10B9B0000023009301330426002702930AE70323A0
:10B9C000C3461E43032125E701331E430022012104
:10B9D00020E700239A46802300271B03094A61E7DA
:10B9E000802349461B03194200D1E2E0594619421F
:10B9F00000D0DEE00B431B0317001B0BA246014ADD
:10BA000050E7C046FF07000001FCFFFF5CF10200A9
:10BA1000FF030000FFFFFFFEFE070000FFFF0F8097
:10BA20000DFCFFFF01F8FFFFF3030000D94500D92B
:10BA3000CBE000D1C6E03C0048460027009B013B1C
:10BA400000935B46160E1B021E43130298463304F6
:10BA50001B0C9946310C0191FEF7F0F94A4642431E
:10BA60000B04210C050019438A4207D98919013DAD
:10BA70008E4203D88A4201D9851E8919881A0199F4
:10BA8000FEF7DCF909048C464A4621046446424329
:10BA9000090C030021438A4204D98919013B8E42D3
:10BAA00000D8F1E02D041D43AB464346891A4246B7
:10BAB000280C12041D0C5B46140C22001B041B0CEA
:10BAC0005A4303946B434443029568431B19150C76
:10BAD000EB189C4203D980246402A44660441C0CE9
:10BAE00015041B042D0C20185D19814277D373D0E7
:10BAF0000C1AA24A7D1BAF42BF419446009B7F4275
:10BB00006344E01B1C00864200D1DBE00199FEF794
:10BB100095F94A4642430B04290C070019438A420F
:10BB200007D98919013F8E4203D88A4201D9871E5D
:10BB30008919881A0199FEF781F909044A4689464C
:10BB400029044D464243090C030029438A4207D980
:10BB50008919013B8E4203D88A4201D9831E891973
:10BB60003F04891A3A00039F1A43380013041B0C40
:10BB7000584381460298150C6F434343454348465A
:10BB8000000C8446DB1963449F4203D980204002A5
:10BB90008446654448461F0C00041B04000C7D19B4
:10BBA0001818A94200D284E000D17FE001231A4393
:10BBB00057E680234A461B0313431B031B0BAA466D
:10BBC0006F4A6FE6BA4200D935E74B46DC075808A2
:10BBD0007B081C43FF0734E70024AF4289D2474467
:10BBE0004745A4415B466442A4196418013BA64240
:10BBF0001ED2A0426DD800D1B6E0241A9B4678E749
:10BC000003005A46283B9A400027914688E658464A
:10BC100001F0C4F8203072E603005246283B9A40F7
:10BC200093460022B4E6504601F0B8F820309AE678
:10BC3000A642E2D1B845DCD9341A9B4659E71F2BFE
:10BC400065DC504C0099A4465C46614408008C4079
:10BC500011008240D940501E82410C4314435A4681
:10BC6000DA401300620709D00F222240042A05D0CF
:10BC70002200141D9442894149425B181A0262D580
:10BC80000122002300270DE68A4200D80AE7831E1E
:10BC9000891907E70F231340042B00D1E6E5171D90
:10BCA0009742924153429B44FA08E0E5002800D1B4
:10BCB000D7E57118531EB14227D3A94215D358D0E6
:10BCC0001A0073E7002B00DC04E6012300229B44EA
:10BCD000CDE502234744474589415B429C464942A2
:10BCE00089190C19E344241A03E743465F004745CA
:10BCF0009B41B8465B429E19023A8919A94200D07D
:10BD000054E7404500D051E7ABE51A00F6E71F21A4
:10BD10005F4649420C1BE740202B07D01A49009B85
:10BD20008C46634418005B4683401A43501E824190
:10BD30003A4307270023174009D00F210023114061
:10BD40001400042995D122005F075B021B0BD20867
:10BD500017430022A6E5802359461B030B431B0310
:10BD600017001B0B064A9DE5BD42B2D89B46002436
:10BD7000BFE68045B9D31A00C3E7C046FF03000001
:10BD8000FF0700001E0400003E040000F0B54F460F
:10BD90004646D6468446C0B58046194E18030F0362
:10BDA0004D00000B5C0082463F0B6D0DC90F9146A4
:10BDB000640DDB0F0120B5420AD0B44203D0A54286
:10BDC00001D157450CD01CBC90469946A246F0BD07
:10BDD00066463E43F7D1AC42F5D154461443F2D106
:10BDE0000120C845EFD1994207D0002DEBD1634621
:10BDF0001F433800471EB841E5E70020E3E7C0468F
:10BE0000FF070000F0B54F464646D6464D00C0B588
:10BE10000E03C90F8A462C491F035C008046360B6F
:10BE20006D0D91463F0B640DDB0F8D421ED08C4291
:10BE300016D0002D1ED130438446002C01D13A4348
:10BE400023D06246002A1AD09A4529D051460220B2
:10BE50000139084001381CBC90469946A246F0BD05
:10BE600039001143E5D002204042F4E73043FAD1D3
:10BE7000AC420FD0002C0FD13A43E7D00CE00122A6
:10BE8000013B934318000130E5E763460020002B97
:10BE9000E1D0DBE73A43E6D19A45D7D1A542D5DCDC
:10BEA000A54205DBBE42D1D808D00020BE42D2D286
:10BEB00050460123013898430130CCE7C845C5D826
:10BEC0000020C845F4D3C6E7FF070000F0B54F4691
:10BED0004646D6464D00C0B50E03C90F8A462E49C8
:10BEE0001F035C008046360B6D0D91463F0B640DC1
:10BEF000DB0F8D4218D08C4211D0002D18D1304369
:10BF00008446002C1ED13A431CD163460020002BEE
:10BF100030D0514602200139084001382AE039006A
:10BF20001143EAD0022025E03043FBD1AC4226D0B9
:10BF3000002C26D13A4324D1514602200139084031
:10BF4000013817E06246002A0FD09A45E1D1A54298
:10BF500005DBBE42DDD819D00020BE420AD25046D1
:10BF6000012301389843013004E00122013B93434F
:10BF7000180001301CBC90469946A246F0BD3A43D9
:10BF8000D0D19A45C5D1A542C3DCE0E7C845C0D8A9
:10BF90000020C845E3D3EDE7FF070000F0B55746A2
:10BFA000DE464E464546E0B5834606000F03480090
:10BFB00087B092461D003F0B400DCC0F002800D1EA
:10BFC0006FE0DE4B984238D08023FF001B041F43F4
:10BFD000730F3B430193DA4B0027994600239B469E
:10BFE000F60081442B0369001B0B52469846490D0D
:10BFF000ED0F002900D185E0D04B994200D173E0CC
:10C000004346DA0080231B0413435246CC48520FA8
:10C0100084461343524600206144D20089442100E3
:10C02000694000918C46012149448A460F2F00D96E
:10C0300090E0C449BF00CF59BF465B463B430193E4
:10C0400000D06AE102230827002681469B46C9E703
:10C0500032005846019B61460091022800D175E0EC
:10C06000032800D1FEE1012800D02CE100230027A5
:10C07000002600253F032A0D3F0BB34812053A4323
:10C0800002401B051343009A5B00D1075B080B437A
:10C090003000190007B03CBC90469946A246AB461A
:10C0A000F0BD5B463B43019300D12FE1002F00D14F
:10C0B000A5E1380000F072FE03000B3B1C2B00DDF5
:10C0C00096E11D22D31A5A460100DA405E4608392D
:10C0D0008F4013008E403B4301939C4B00271B1A5B
:10C0E000994600239B467DE7414653460B439349BF
:10C0F0008C46E144002B00D01AE1022202201743B3
:10C1000000228CE7134300D10DE14346002B00D100
:10C1100081E1404600F042FE02000B3A1C2A00DD9D
:10C1200072E10100434608398B4098461D239A1A54
:10C130005346D3401A004346134352468A40494669
:10C14000081A824989468144002068E77B4B002712
:10C1500000268EE7140C1204120C1100370C360462
:10C16000350C794328008C462E006043604483469A
:10C1700056432100300C8046584679434044029192
:10C18000844506D98846802149028C46E0444146D0
:10C1900002913604010C360C00048B4681191E0CEA
:10C1A0001B041B0C0391190079438C46280075432E
:10C1B0006544A8465843050C45447743A94203D932
:10C1C000802149028C466744290C8C4639000004C2
:10C1D000000C2D042D186144AB440591594604917F
:10C1E00001990F043F0C080C39005143424390461B
:10C1F00002008C46090C8B4662437C4344445C44F9
:10C20000A04503D98021490288464244210C884632
:10C2100061460904090C8C46390059434343704375
:10C220007E430F0CF6182404BE19644442448C4625
:10C23000B34203D980235B0298464044029B614687
:10C240009846049B370443449B46AB45AD416B4243
:10C250000D0405992D0C8C467F196744FD18A846DE
:10C260005D462D19A542A44193466442A446C344A9
:10C27000DC448F42BF4198459B4193459241A44580
:10C28000A4415B427F421F43360C52426442BF19B5
:10C290002243BF18624638184302D20D0399134354
:10C2A0006A020A43501E82416146ED0D2A434E0246
:10C2B0003243D90100D4B3E0012650083240024392
:10C2C000DE0732435B08224C5444002C62DD5107E8
:10C2D00009D00F201040042805D0101D9042924133
:10C2E00052429B180200D90104D580241948E40069
:10C2F000034054441848844200DD27E75E075B0290
:10C30000D2081F0B630516435B0DB2E60023994666
:10C310000133042700269B4664E6032301978146E8
:10C320000C279B465EE6012201201743002276E699
:10C33000032303201F43434671E6C046FF07000066
:10C3400001FCFFFF9CF10200FFFF0F800DFCFFFFCF
:10C35000FF030000FFFFFFFEFE0700000023802711
:10C3600000933F030026434B83E6019B3200A44623
:10C37000584670E6AC466EE6802701993F03394285
:10C380002DD03B422BD11F433F033F0B009516009E
:10C39000384B6EE601252D1B382D00DD66E61F2D7E
:10C3A00040DC35481C005044160082408440EE407A
:10C3B000501E824134431443EB40620709D00F22E0
:10C3C0002240042A05D02200141D9442804140429C
:10C3D0001B181A023ED501230027002649E68027B4
:10C3E000019B3F031F433F033F0B0094214B40E65B
:10C3F00003005A46283B9A40002601926DE65846B3
:10C4000000F0CCFC203057E603005246283B9A400F
:10C410001300002293E6504600F0C0FC20307BE67B
:10C42000CA4650E71F201E004042041BE640202D54
:10C4300003D0124C5444A3401A43501E824132434D
:10C4400007260027164009D00F20002310401400B3
:10C450000428B9D122005E075B021F0BD2081643E5
:10C46000002306E680273F031F433F033F0B1600D0
:10C47000004BFEE5FF0700001E0400003E04000024
:10C48000F8B557464E464546DE460C000903E0B572
:10C49000490A460F5F0031431E03DB0F760A9B46B5
:10C4A000530F3343C84E6500C000E40FD2006D0D3A
:10C4B000A24681467F0D9C469046B74200D1B9E026
:10C4C0005B46012673409B46EE1BA34500D183E0EB
:10C4D000002E63DD002F00D0B1E06346134300D18E
:10C4E00023E1731E002B00D0BAE1861A6346B042E6
:10C4F00080410125C91A4042091A0B0200D447E1C4
:10C5000049024B0A98464346002B00D189E1404638
:10C5100000F044FC0300083B1F2B00DD7CE12022DF
:10C520003000D21A4146D040994002009E400A4352
:10C530009D4200DD6AE15D1B6B1C1F2B00DD94E159
:10C54000202110003500C91A8E40DA408840DD40B5
:10C55000711E8E41110007222843002506433240F8
:10C56000002A09D00F233340042B05D0331DB342DA
:10C57000B641764289191E000B0200D43DE26A1CC6
:10C58000914B55056D0D9A4200D119E18F4AF6087D
:10C590000A40570752023743120B9BE0002E00D08F
:10C5A000C5E06E1C7605760D012E00DC48E167467D
:10C5B000861ACB1BB042BF417F42B8461F0043469C
:10C5C000FF1A3B00B8461B0200D55FE137439AD102
:10C5D00000220024002579E0002E00DCFAE0002F84
:10C5E00000D18DE0784B9D4267D0802367461B04C5
:10C5F0001F43BC46382E00DC52E1634613435A1EEB
:10C6000093411E1886428041404209180B0200D413
:10C61000BEE06D4B01359D4200D1D2E06B4A7308FC
:10C620000A4001210E401E435108D30707221E4332
:10C63000324095E71E00164300D045E740E7624BC5
:10C640009D423AD0802367461B041F43BC46382EC8
:10C6500000DDEBE01F2E00DC3AE133006746203BB3
:10C66000DF403B00202E05D04027BF1B6646BE4062
:10C67000324390464646721E96413343DAE0002B21
:10C6800000D114E26346134300D168E180234E07D2
:10C69000C008C9081B030643194208D06046C008F9
:10C6A000184204D163460100D2085E071643F30026
:10C6B0009946C900720F444D11434B46DE08424B68
:10C6C0004F073743CA089D4200D16EE012036D0543
:10C6D000120B6D0D00211203130B0A0D12051A43E4
:10C6E0003B4B2D0513402B435B00E4075B082343C2
:10C6F000380019003CBC90469946A246AB46F8BDAE
:10C700006346134311D0731E002B00D007E1861837
:10C710008642804161444042091801250B0237D509
:10C7200002257BE73E00614691463500C5E75C4641
:10C73000002D00D0E1E00B000343F3D0731C00D1C7
:10C74000ACE1214B9F4200D13AE1F343382B00DDAD
:10C750006FE11F2B00DD8CE120250E00ED1AAE40AD
:10C76000B0460600AA46DE40454635432E005546F3
:10C77000D940A8406346451EA8415B1A9C463043F9
:10C78000161AB242924163465242991A3D00B4E6EB
:10C7900007223240002A00D0E4E60B4BF6084F0790
:10C7A0003743CA089D4200D090E73B00134300D1B5
:10C7B000A6E180231B031A431203120B024D89E7E3
:10C7C00015000022002785E7FF070000FFFF7FFF1D
:10C7D000FFFF0F80002E00D0C7E06B1C5E05760DBA
:10C7E000012E00DCF0E0C84DAB4200D1B9E0851865
:10C7F0000A00854289416244494251180722CE0706
:10C800006D082E43490832401D00A9E6BF49ED1AC4
:10C81000114007223240A3E6320028388240002629
:10C8200086E6300000F0BAFA203073E66346134320
:10C830005A1E9341C61AB04280414042091A5CE632
:10C840000E00674606431743002D5ED1002E00D030
:10C85000F3E0002F00D11EE15C46614691462CE7D3
:10C86000A94FBE427BD01E00F1E610001F3DE840FC
:10C87000202B03D04021CB1A9A401643731E9E41B1
:10C880000722064332400021002583E7161A63463B
:10C89000B2428041591A40420B1A98465C4632E631
:10C8A0001F2E00DDABE02027BB1B9A466346574690
:10C8B000BB40994613004F46F3401F433B00574689
:10C8C000BA40571EBA4113436246F240891898E6AF
:10C8D0002027BB1B9A4663465746BB409946130028
:10C8E0004F46F3401F433B005746BA40571EBA41DC
:10C8F00013436246F240891A9CE7834B9F425FD004
:10C9000080252D047342294320E7002E0CD1002FEF
:10C9100000D1D0E05C46614691467B4DCDE67A4F32
:10C92000BE421CD01E0065E6002F18D0C0084E077E
:10C9300006438020C9080003014208D06346DC0892
:10C94000044204D12100DA46D2085E071643F30000
:10C95000994601245346C900720F11431C406A4D89
:10C96000ABE61D0000220027B4E6002D59D10B00D4
:10C97000034300D1D6E6731C00D1B2E0624B9F4264
:10C980001ED0F343382B6FDC1F2B00DD97E02025F2
:10C990000E00ED1AAE40B0460600AA46DE404546FF
:10C9A00035432E005546A840D940451EA8418C4429
:10C9B0000643B61896429241514261443D0025E635
:10C9C0003D006146914678E60B000343002D00D000
:10C9D00055E6002BF5D06346134300D16DE686186B
:10C9E0008642804161444042091800220B0200D473
:10C9F000D0E6464B01351940B2E5B1465DE633005D
:10CA00006746203BDF403B00202E05D04027BF1B60
:10CA10006646BE40324390464646721E96413343B8
:10CA2000EFE5394B9F42CBD080252D04734229433B
:10CA3000A8E70843411E8841A2E6002F00D13CE64A
:10CA40006346861ACF1AB0429B415B42FB1A984656
:10CA50001B024ED5161A6346B2429241591A5242EF
:10CA6000891A5C4600227BE501430E00711E8E414F
:10CA70009FE71D000E00203DEE40B046202B04D065
:10CA80004025EB1A99400843814648464346411EDB
:10CA90008841184374E60022002417E6161A6346FC
:10CAA000B2429241591A5242891A3D0025E5614627
:10CAB0009146154D01E680220024120379E61D00FF
:10CAC0000E00203DEE40B046202B04D04025EB1A4E
:10CAD0009940084381464E464346711E8E411E438F
:10CAE00067E7861896429B4161445B42C9183D0046
:10CAF0008CE547463743CED007224146324049E6CF
:10CB000000273A00E6E5C046FF070000FFFF7FFF71
:10CB100030B5144D0A034B00120B5B0DC90F0024F6
:10CB2000AB4211DD104CA34210DC8024640322438D
:10CB30000E4CE41A1F2C0CDD0D48C31ADA4013000A
:10CB40005C42002900D11C00200030BD094BCC18EC
:10CB5000FAE7094DE040AC4663449A4013000343B2
:10CB6000EEE7C046FE0300001D0400003304000091
:10CB700013040000FFFFFF7FEDFBFFFF70B50028EF
:10CB80002DD0C317C5185D40C40F280000F006F96A
:10CB9000154B1B1A5B055B0D0A2815DD0B3885400C
:10CBA00000222D032D0B002110002D030A0D2D0B4B
:10CBB00012052A430D4D1B052A4013435B00E40771
:10CBC0005B082343190070BD020029001532914013
:10CBD0000A000B21081AC5402D032D0BE3E70024A2
:10CBE000002300250022DEE71E040000FFFF0F8067
:10CBF0004100090E4B1C70B5DBB24602750AC40F2A
:10CC0000012B14DDE0239B006D07360BCB180021B0
:10CC10000A0D280012051C4D32435B052A405B08B3
:10CC200013435B00E4075B082343190070BD002930
:10CC300014D1002D1ED0280000F0B0F80A281CDC0A
:10CC40000B232A001B1ADA40030015339D400F4BBB
:10CC500012031B1A5B05160B5B0DD8E7002D06D0DF
:10CC6000320B802636036D071643094BCFE7084B7E
:10CC70000026CCE700230026C9E703002A000B3B6F
:10CC80009A400025E3E7C046FFFF0F8089030000BC
:10CC9000FF070000F0B54C00640D0B03621C5B0A3B
:10CCA000460F5205C90F1E43C500520D012A29DD4A
:10CCB000374BE718FE2F1CDC002F3BDD8001431EA5
:10CCC00098410722F3006D0F03432B431A40002ABB
:10CCD00004D00F221A40042A00D004338022D20448
:10CCE0001A4024D00137FAB2FF2F02D09B01580A14
:10CCF00001E0FF2200204002D205400AC90710438C
:10CD00000843F0BD3543002C04D1002D0AD1002288
:10CD10000020F0E7002DECD08020C0033043FF223C
:10CD2000E9E7002400235B02580AE2B2E3E7DB08EC
:10CD30003C00F8E73B001733F3DB80231B0433434D
:10CD40001E26F61B1F2E14DD02225242D71B1A008C
:10CD5000FA401700202E04D00E4A94466444A340A3
:10CD60001D432B005D1EAB4107223B431A400027A9
:10CD7000ADE7094A2800A218954093406C1EA541D2
:10CD8000F04007222B4303431A4000279FE7C04689
:10CD900080FCFFFFA2FCFFFF82FCFFFF1C210123A0
:10CDA0001B04984201D3000C10391B0A984201D38E
:10CDB000000A08391B09984201D30009043902A26C
:10CDC000105C40187047C0460403020201010101D3
:10CDD000000000000000000010B5002903D1FFF79B
:10CDE000DDFF203002E0081CFFF7D8FF10BDC04671
:10CDF000F0B5C646714B450000B5041C07006D0830
:10CE00009D4208DDFF23DB059D4271DC002800DC2C
:10CE10009DE06B486FE06B4B9D4200DD7AE06A4B12
:10CE20009D426BDD01267642211C201CFDF7DAFDB8
:10CE3000011C8046FDF7D6FD6449051CFDF7D2FDB7
:10CE40006349FDF75DFA291CFDF7CCFD6149FDF74B
:10CE500057FA291CFDF7C6FD5F49FDF751FA291C59
:10CE6000FDF7C0FD5D49FDF74BFA291CFDF7BAFD42
:10CE70005B49FDF745FA4146FDF7B4FD5949804647
:10CE8000281CFDF7AFFD5849FDF7DEFE291CFDF714
:10CE9000A9FD5649FDF7D8FE291CFDF7A3FD54490D
:10CEA000FDF7D2FE291CFDF79DFD5249FDF7CCFE92
:10CEB000291CFDF797FD011C4046FDF721FA211CB6
:10CEC000FDF790FD731C44D04B4BB600F158FDF7B5
:10CED000BBFE211CFDF7B8FE484B011CF058FDF7C6
:10CEE000B3FE002F07DA80231B069C46604402E055
:10CEF000011CFDF705FA04BC9046F0BD4049FDF762
:10CF0000FFF9FE218905FDF7EDF80300201C002B39
:10CF1000F1D187E700F008F93A4B041C9D421DDC73
:10CF2000394B9D4239DC011CFDF7EAF9FE218905E8
:10CF3000FDF78AFE8021051CC905201CFDF7E0F9DC
:10CF4000011C281CFDF776FB0026041C6CE72F480B
:10CF5000D1E7011C201CFDF777FECCE72C4B9D424E
:10CF600014DCFF218905FDF76FFEFF21051C8905F3
:10CF7000201CFDF737FDFE218905FDF7C1F9011CD5
:10CF8000281CFDF757FB0226041C4DE7011C214815
:10CF9000FDF750FB0326041C46E7FE218905FDF73B
:10CFA00053FEFE21051C8905201CFDF7A9F9011C73
:10CFB000281CFDF73FFB0126041C35E7FFFF7F50CF
:10CFC000DB0FC93FFFFFDF3EFFFFFF30D769853C26
:10CFD00059DA4B3D356B883D6E2EBA3D2549123EE0
:10CFE000ABAAAA3E21A215BD6BF16E3D95879D3D72
:10CFF000388EE33DCDCC4C3EECF10200DCF102007A
:10D00000CAF24971FFFF973FFFFF2F3FDB0FC9BFF8
:10D01000FFFF1B40000080BFF0B5C64643005F081D
:10D020001B0E7F3B00B5051C06001C00162B1CDCEC
:10D030008046002B21DB1A4F1F41074211D01949AE
:10D04000FDF75EF90021FDF74DF8002809D0002D0D
:10D0500004DD80231B0423419846A8444346BB4378
:10D060001E00301C04BC9046F0BD0F4B9F42F8D907
:10D07000011CFDF745F9061CF3E70A49FDF740F9E5
:10D080000021FDF72FF80028EBD0002D04DB002F46
:10D09000E7D0FE26B605E4E780263606E1E7C0467F
:10D0A000FFFF7F00CAF24971FFFF7F7F00B51C4A76
:10D0B000430083B05B08934218DD1A4A934204DDB3
:10D0C000011CFDF7C1FD03B000BD694602F0C6F9C1
:10D0D00003230199184001280CD0022817D00028FA
:10D0E00011D00098012202F0E1FFECE7002102F0EC
:10D0F00093FBE8E70122009802F0D8FF80231B068B
:10D100009C466044DFE7009802F086FBDBE700986E
:10D1100002F082FB80231B069C466044D3E7C04696
:10D12000D80F493FFFFF7F7F400040087047C0464F
:10D13000F0B5C64643005F081B0E7F3B00B5051CDB
:10D1400006001C00162B1CDC8046002B21DB194F2F
:10D150001F41074211D01849FDF7D2F80021FCF712
:10D16000C1FF002809D0002D04DA80231B042341CD
:10D170009846A8444346BB431E00301C04BC90465E
:10D18000F0BD0E4B9F42F8D9011CFDF7B9F8061C03
:10D19000F3E70949FDF7B4F80021FCF7A3FF0028E5
:10D1A000EBD0002D01DB0026E7E7002FE5D0044E91
:10D1B000E3E7C046FFFF7F00CAF24971FFFF7F7FB0
:10D1C000000080BF70B50C00002121600F494300B2
:10D1D00002005B088B4217DC002B15D00C4D0021A0
:10D1E000AB4208DC9821C905FDF7FCFB19210200C0
:10D1F00043005B0849420748DB150240FC207E3BA8
:10D200005B1880052360104370BDC046FFFF7F7F21
:10D21000FFFF7F00FFFF7F8070B5041C0D0003F04F
:10D22000A5FA002805D00021201CFCF741FF0028AA
:10D2300001D0201C70BD201C290000F083F8041CC4
:10D2400003F094FA002805D00021201CFCF730FFE1
:10D250000028EED003F0A6FA22230360E9E7C046D7
:10D2600043001B0E7F3B10B5162B05DC002B0EDB9D
:10D27000094A1A41024203D10860C00FC00710BD1D
:10D28000030093430B60191CFDF7DEFCF7E7C30FA7
:10D29000DB070B60F3E7C046FFFF7F0010B500F02F
:10D2A00001F810BD30B5430059081B0E7F3B83B019
:10D2B0000200162B1EDC00291AD00100C40F002B1F
:10D2C0001FDB1D4A1A41024212D05208024204D00A
:10D2D0009143802292031A411143184BA400E45851
:10D2E000201CFDF70DF801900198211CFDF7ACFC06
:10D2F00003B030BD124B9942FAD9011CFDF700F87A
:10D30000F6E743020D495B0AA0004558594219430C
:10D310008023490ADB03120D194012051143281C12
:10D32000FCF7EEFF01900198291CFDF78DFC4000F1
:10D330004008E4072043DBE7FFFF7F00FCF1020029
:10D34000FFFF7F7F420070B5031C0C0005005108F1
:10D350000FD0274EB1420DD8264881420ED9120E69
:10D360001219FE2A1CDC002A22DD2348D20528409F
:10D37000104370BD011CFCF7C3FFFAE79821181C8D
:10D38000C905FDF72FFB1D4A031C944204DB420034
:10D39000120E0500193AE3E71949FDF723FBE8E708
:10D3A000191C184803F0DCF91649FDF71BFBE0E7F0
:10D3B000110016310ADA144A191C944210DD114882
:10D3C00003F0CEF90F49FDF70DFBD2E7CC2119325E
:10D3D000D005094A890515402843FDF703FBC8E736
:10D3E000074803F0BDF90649FDF7FCFAC1E7C0465E
:10D3F000FFFF7F7FFFFF7F00FFFF7F80B03CFFFFCD
:10D400006042A20DCAF2497150C3000000B51C4A27
:10D41000430083B05B0893421BDD1A4A934204DD4C
:10D42000011CFDF711FC03B000BD694602F016F8BF
:10D43000032301991840012810D0022817D0002892
:10D4400010D0009802F0E8F980231B069C46604447
:10D45000E9E70022002102F029FEE4E7009802F04B
:10D46000DBF9E0E70098012202F020FEDBE70098FC
:10D47000012202F01BFE80231B069C466044D2E77B
:10D48000D80F493FFFFF7F7F00B5104A430083B0AC
:10D490005B08934214DD0E4A934204DD011CFDF744
:10D4A000D3FB03B000BD694601F0D8FF0222400063
:10D4B0001040013A121A0199009802F071FEF0E74B
:10D4C0000122002102F06CFEEBE7C046DA0F493F73
:10D4D000FFFF7F7F43001B0E7F3B162B04DC002BDE
:10D4E00003DB034A1A4190437047C00FC007FBE7B4
:10D4F000FFFF7F0010B500F073FC10BDF0B547468C
:10D50000CE4680B58DB004000D0000F025FD294BFE
:10D5100006001B780F005BB29846013310D0220042
:10D520002B002000290003F07FFF8146002807D14F
:10D530000022002320002900FCF786FD002806D1E8
:10D54000300039000DB00CBC90469946F0BD012367
:10D550000293194B0694079503934B460A9343464F
:10D5600004940595002B15D000230022190010000B
:10D57000FEF70AF9434608900991022B0ED103F0F9
:10D5800011F9212303600A9B0193002B0CD1089E03
:10D59000099FD5E7002300240893099402A803F00B
:10D5A000D7F80028EFD1EAE703F0FCF80A9B0193D3
:10D5B0000360ECE7EF00002004F20200F0B58DB04C
:10D5C000041C00F0A1FD0023224E051CF35601337C
:10D5D00031D0211C201CFDF7FBFC071E2BD1201C89
:10D5E000FFF7A2FDFE218905FCF77CFD002822D073
:10D5F00001230293184B201C03930A97FFF7F8FAB4
:10D600000690079104900591144803F0A3F80023B5
:10D61000F35608900991022B10D002A803F098F855
:10D6200000280BD00A9B0193002B0CD10898099974
:10D63000FFF730FB051C281C0DB0F0BD03F0B2F85D
:10D6400021230360EEE703F0ADF80A9B019303602A
:10D65000ECE7C046EF0000200CF2020030F20200BE
:10D66000F0B58DB0041C00F0B1FE0023224E051C65
:10D67000F356013331D0211C201CFDF7A9FC071EF5
:10D680002BD1201CFFF750FDFE218905FCF72AFD58
:10D69000002822D001230293184B201C03930A97E1
:10D6A000FFF7A6FA0690079104900591144803F03D
:10D6B00051F80023F35608900991022B10D002A8CC
:10D6C00003F046F800280BD00A9B0193002B0CD1E5
:10D6D00008980999FFF7DEFA051C281C0DB0F0BD6B
:10D6E00003F060F821230360EEE703F05BF80A9B88
:10D6F00001930360ECE7C046EF00002014F2020043
:10D7000030F2020010B500F0B3FF10BDF0B58BB0E1
:10D71000041C01F041F80023304E051CF356013380
:10D7200036D0201C03F022F8002831D02C49201CD0
:10D73000FCF7D8FC071E2ED12A49201CFCF7BEFCA2
:10D74000002825D004236D460093274B2F626B6081
:10D75000201CFFF74DFA00230022AA61EB61002391
:10D76000F35628616961A860E960022B31D0280076
:10D7700002F0EEFF00282CD02B6A002B03D003F020
:10D7800011F82B6A0360A869E969FFF783FA051CA1
:10D79000281C0BB0F0BD03236D460093124B201CD8
:10D7A0006B6000232B62FFF723FA0023F3562861F6
:10D7B0006961A860E960002B05D1E0220B4B1206DD
:10D7C000AA61EB61D3E700200949A861E961022B56
:10D7D000CDD102F0E7FF22230360CDE7EF00002068
:10D7E0008071B142B5F1CFC21CF20200FFFFEF47DA
:10D7F0000000F07FF0B5C64600B58CB0051C0C1CCF
:10D8000001F0C4F82D4B061C1B785BB2984601331F
:10D810003DD0211C201CFDF7DBFB002837D1291C43
:10D82000281CFDF7D5FB071E31D10021201CFCF779
:10D830003FFC00282BD001230293214B281C03938B
:10D840000A97FFF7D5F906000F00201C04960597EC
:10D85000FFF7CEF9434606900791002B1CD000231A
:10D86000002219001000FDF78FFF43460890099130
:10D87000022B13D102F096FF212303600A9B019330
:10D88000002B14D108980999FFF704FA061C301CE4
:10D890000CB004BC9046F0BD0896099702A802F0AF
:10D8A00057FF0028E6D00A9B0193002BEAD002F034
:10D8B00079FF0A9B01930360E4E7C046EF00002074
:10D8C00024F2020070B500258CB0041C01F0EEF8C3
:10D8D000354B061C5D576B1C0BD0211C201CFDF723
:10D8E00077FB002805D10021201CFCF7FBFB00285A
:10D8F00002D0301C0CB070BD2C4B0A90201C03933E
:10D90000FFF776F90690079104900591002D1BD141
:10D91000E022274B12060021201C08920993FCF7F5
:10D92000C7FB002837D00223029302A802F010FFA1
:10D93000002817D00A9B0193002B18D10898099949
:10D94000FFF7A8F9061CD4E700221A4B0021201C7F
:10D9500008920993FCF7ACFB00280ED00223029337
:10D96000022DE2D102F01EFF22230360E2E702F063
:10D9700019FF0A9B01930360E0E701230293022D44
:10D980000BD102F00FFF212303600B4802F0E2FEEF
:10D9900008900991CEE70123029302A802F0D8FE75
:10D9A0000028F2D1EDE7C046EF0000202CF2020083
:10D9B000FFFFEFC70000F0FF30F20200F0B54E4667
:10D9C0004546DE465746E0B500268FB0051C0C1CC8
:10D9D00001F0B2F9CB4B80469E579946731C39D063
:10D9E000211C201CFDF7F4FA8246002832D1291CA4
:10D9F000281CFDF7EDFA0021071E00D071E0281C5D
:10DA0000FCF756FB00282DD00021201CFCF750FB12
:10DA10008246002800D19CE004AB98460123424690
:10DA20000493B94B17625360281CFFF7E1F8434693
:10DA30009860D960201CFFF7DBF84346002218618C
:10DA40005961002341468A61CB61002E6BD0FE23D1
:10DA50009B05984640460FB03CBC90469946A2466E
:10DA6000AB46F0BD404602F081FE061E00D1A8E0A4
:10DA700000214046FCF71CFB0028EBD0281C02F0DC
:10DA800075FE0028E6D0201C02F070FE0028E1D0D0
:10DA900004AB98460423424604939B4B281C5360D6
:10DAA00000231362FFF7A4F843469860D960201C56
:10DAB000FFF79EF843460022186159610023414652
:10DAC0008A61CB614B461B785BB2022B04D0404687
:10DAD00002F03EFE00282CD102F064FE22230360F7
:10DAE00027E0201CFCF7E4FA0028B3D004AB9846EA
:10DAF000012342460493844B281C536052464346FC
:10DB00001A62FFF775F843469860D960201CFFF74A
:10DB10006FF8434600221861596141467B4B8A6188
:10DB2000CB61022E93D0404602F012FE002800D1B5
:10DB300097E043461B6A002B04D002F033FE4346B5
:10DB40001B6A036043469869D969FFF7A3F88046CA
:10DB500080E7201C02F00AFE002800D17AE70021AD
:10DB6000201CFCF7ABFA002800D173E704AB984601
:10DB7000012342460493644B281C5360434652469B
:10DB80001A62FFF735F843469860D960201CFFF70A
:10DB90002FF84346186159614B461B785BB2002B46
:10DBA00064D0002042465A499061D161022B62D173
:10DBB00002F0F8FD2123036043461B6A002BC1D00D
:10DBC000BBE7281C02F0D2FD002800D150E7201C42
:10DBD00002F0CCFD002800D14AE7281CFFF708F826
:10DBE00000900191201CFFF703F84B461B78029030
:10DBF00003915BB2414640469B46FDF7E9F904AB11
:10DC0000984600285FD103234246414604933E4B89
:10DC100010625360009A019B8A60CB60029A039B5A
:10DC20000A614B61FC21201C8905FCF7DBFE5B4689
:10DC3000041C002B25D1E0224146364B12068A6196
:10DC4000CB61281C0021FCF739FA002828D1404676
:10DC500002F07EFD0028AFD102F0A4FD2223036074
:10DC6000AAE702F09FFD2123036062E70022002360
:10DC700041468A61CB61404602F06AFD00289BD193
:10DC800096E741460022244B281C8A61CB61002183
:10DC9000FCF714FA002843D15B46022BDCD0D6E710
:10DCA000201CFFF7FFFA211CFCF702FA002805D11F
:10DCB000E0221A4B120641468A61CB614B461B7823
:10DCC0005BB29B46E8E70123424604930E4B166283
:10DCD0005360009B019C9360D460029B039C136182
:10DCE00054615B46002BC1D00021081CFCF7A2FC4C
:10DCF000FEF77EFF43469861D9615B46022B00D157
:10DD000056E7B8E7EF00002034F202000000F03FD1
:10DD10000000F0FFFFFFEF470000F07FFFFFEFC7BD
:10DD2000201CFFF7BFFA211CFCF7C2F90028C5D15F
:10DD30000022014BBFE7C0460000F0FFF0B5002510
:10DD40008DB0041C01F00EFD234B061C5D576B1CAF
:10DD50000BD0211C201CFDF73BF9071E05D100212B
:10DD6000201CFCF7ABF9002802D1301C0DB0F0BD2F
:10DD700001230293194B201C03930A97FEF738FFE7
:10DD8000002206900791049005910023002D15D0E4
:10DD900010001900FDF7F8FC08900991022D0FD131
:10DDA00002F000FD212303600A9B0193002B0DD19B
:10DDB00008980999FEF76EFF061CD6E708920993AA
:10DDC00002A802F0C5FC0028EED1E9E702F0EAFC67
:10DDD0000A9B01930360EBE7EF0000203CF2020096
:10DDE000F8B515004746CE465A001C006B4280B578
:10DDF0002B434B4F5208DB0F1343BB421DD84B0044
:10DE00005B089846464643420343DB0F894633434B
:10DE1000BB4212D8434BE3182B4339D00226A31739
:10DE20001E40CB0F1E434346034310D1022E47D062
:10DE3000032E08D13C483D4905E002000B002800B4
:10DE40002100FDF785F90CBC90469946F8BD1300FA
:10DE50002B4320D0BA4224D0B8451CD043469A1A4E
:10DE600012153C2A2FDC002C30DA3C322EDA00204E
:10DE70000021012E3ED0022E31D0002EE3D02C4ABC
:10DE80002C4BFEF7FDFA284A2B4BFEF7F9FADAE79E
:10DE900002F0C6FAD7E74B462348002B0EDB274992
:10DEA000D1E790452BD0022E0AD0032EC2D00020FD
:10DEB0000021012EC7D180210906C4E72049C2E70D
:10DEC00019481D49BFE718481C49D2E72A0023001A
:10DED000FDF75AFC02F038FC02F0A2FAC9E7144A36
:10DEE000144BFEF7CDFA02000B000F481249FEF763
:10DEF000C7FAA8E7802424060B191900A3E7022E0D
:10DF000006D0032E09D00848012E04D00D499AE707
:10DF10000D480E4997E70E4995E70B480D4992E7E2
:10DF20000000F07F000010C0182D4454FB2109C0F0
:10DF3000075C143326A6A13CFB210940FB21F93FD5
:10DF4000FB21F9BFFB21E93FD221337F7CD902407D
:10DF5000FB21E9BF7CD902C0F8B54746CE46674BE6
:10DF600080B50A000F00190005003940994200D120
:10DF70009BE004000100002F69DD3F1500D1B4E0F3
:10DF80005F4B12039C468023120B5B0313435B0021
:10DF9000CA0F67449B184A00F80703D5D20F5B00ED
:10DFA0009B188A0079108C4600218020162489460F
:10DFB00080030D189D4202DC29185B1B8144D50F9C
:10DFC0005B00013C5B1952004008002CF1D100209D
:10DFD0008046802020250027000609E08B425CD087
:10DFE000D40F5B00013DE31852004008002D16D00D
:10DFF000C4198B42F2DD27180E00002C49DB5B1A96
:10E00000A242894149425B1A121BD40F5B00013DB9
:10E0100080443100E31852004008002DE8D113433A
:10E020004ED143465B0837494A4688464946521016
:10E030004244C90702D5802109060B4361460F05FA
:10E04000BD18180029000CBC90469946F8BD7B000D
:10E050005B0803433900002BF5D0002F3CD1E30AC5
:10E06000153A6405002BFAD08020400303423FD1CB
:10E07000002700E00F005B00791C0342FAD0250066
:10E0800020208D40401A2900D71B2200C2401A438D
:10E0900076E7FE43F60F8E19B1E79442A0D8271811
:10E0A000002CF6DB1E000023AEE702003B00280038
:10E0B0003900FDF773FF2A003B00FDF749F8C2E77E
:10E0C0004346013303D0434601335B08ABE70123EA
:10E0D00098460023C144A6E73B000200FEF7D0F9B2
:10E0E00002000B00FDF750FBADE713000022BBE779
:10E0F0000127210020207F42C6E7C0460000F07FB4
:10E1000001FCFFFF0000E03FFE22F8B54300041CC5
:10E1100001005B089205934261D05ADC9B4A93420E
:10E1200062DC8C229205934200DCCEE0FCF75AFCC4
:10E130009749051CFCF756FC9649FCF7E1F8291CA9
:10E14000FCF750FC9449FCF77FFD291CFCF74AFCC6
:10E150009249FCF7D5F8291CFCF744FC9049FCF7E0
:10E1600073FD291CFCF73EFC8E49FCF7C9F8291CFD
:10E17000FCF738FC8C49061C281CFCF733FC8B4947
:10E18000FCF762FD291CFCF72DFC8949FCF7B8F867
:10E19000291CFCF727FC8749FCF756FD291CFCF7D6
:10E1A00021FCFE218905FCF7ABF8011C301CFCF7B3
:10E1B00041FA211CFCF716FC011C7F48FCF744FDCA
:10E1C000011C201CFCF740FD011C7C48FCF73CFDB9
:10E1D00004E0FCF739FD011CFCF72CFAF8BD002027
:10E1E000002CFBDC7648F9E7002870DBFE20800578
:10E1F000FCF72AFDFC218905FCF7F4FB041C01F067
:10E20000B1FA6349061C050B201CFCF7EBFB6149C6
:10E21000FCF776F8211CFCF7E5FB5F49FCF714FDE1
:10E22000211CFCF7DFFB5D49FCF76AF8211CFCF7B9
:10E23000D9FB5B49FCF708FD211CFCF7D3FB5949CE
:10E24000FCF75EF8211CFCF7CDFB5749071C201C8E
:10E25000FCF7C8FB5549FCF7F7FC211CFCF7C2FB97
:10E260005349FCF74DF8211CFCF7BCFB5149FCF766
:10E27000EBFC211CFCF7B6FBFE218905FCF740F8FE
:10E28000011C381CFCF7D6F9311CFCF7ABFB2D0345
:10E29000071C291C281CFCF7A5FB011C201CFCF7F3
:10E2A000D3FC291C041C301CFCF72AF8011C201C80
:10E2B000FCF7C0F9011C381CFCF722F8291CFCF7FC
:10E2C0001FF8011CFCF71CF888E73E4886E7FE2192
:10E2D0008905FCF715F8FC218905FCF783FB2C491F
:10E2E000041CFCF77FFB2B49FCF70AF8211CFCF708
:10E2F00079FB2949FCF7A8FC211CFCF773FB274993
:10E30000FBF7FEFF211CFCF76DFB2549FCF79CFC8D
:10E31000211CFCF767FB2349FBF7F2FF211CFCF7EC
:10E3200061FB061C201C01F01DFA1F49051C201C66
:10E33000FCF758FB1D49FCF787FC211CFCF752FB3E
:10E340001B49FBF7DDFF211CFCF74CFB1949FCF7CF
:10E350007BFC211CFCF746FBFE218905FBF7D0FF67
:10E36000011C301CFCF766F9291CFCF73BFB124929
:10E37000FCF76AFC291CFBF7C3FF011CFBF7C0FF7D
:10E38000011C1148FCF760FC28E7C046FFFFFF3E78
:10E3900008EF1138047F4F3A4611243DA80A4E3E3B
:10E3A00090B0A63EABAA2A3E2EC69D3D6133303FBB
:10E3B0002D57014039D119406821A233DA0FC93FE6
:10E3C000DB0F4940DB0FC93FDA0F4940F0B5FE23B0
:10E3D0004646D6464F464400C0B5051C06006408B4
:10E3E0009B059C4200D18AE07EDC8F4B9C420EDC78
:10E3F0008E4B9C4200DD8FE08D49FBF781FFFE21B3
:10E400008905FBF76FFE0300281C002B72D1281C26
:10E41000FEF78AFE011CFE208005FCF715FCFC219E
:10E420008905FCF7DFFA8349051CFCF7DBFA824912
:10E43000FBF766FF291CFCF7D5FA8049FCF704FCC2
:10E44000291CFCF7CFFA7E49FBF75AFF291CFCF781
:10E45000C9FA7C49FCF7F8FB291CFCF7C3FA7A4996
:10E46000FBF74EFF291CFCF7BDFA78498046281CB3
:10E47000FCF7B8FA7649FCF7E7FB291CFCF7B2FA7F
:10E480007449FBF73DFF291CFCF7ACFA7249FCF715
:10E49000DBFB291CFCF7A6FAFE218905FBF730FF00
:10E4A0008146281C01F05EF96C4B071C9C4200DC85
:10E4B0007DE049464046FCF7BDF8391CFCF792FA6E
:10E4C000391CFBF71DFF011CFBF71AFF6449FBF722
:10E4D00017FF011C6348FCF7B7FB002E0ADC802302
:10E4E0001B069C46604405E0011CFCF7ADFB011CCB
:10E4F000FCF7A0F81CBC90469946A246F0BD5949CD
:10E50000FCF770FA5849041C281CFCF76BFA011C34
:10E51000201CFBF7F5FEEDE7011CFCF763FA45490B
:10E52000041CFCF75FFA4449FBF7EAFE211CFCF7E8
:10E5300059FA4249FCF788FB211CFCF753FA404981
:10E54000FBF7DEFE211CFCF74DFA3E49FCF77CFB95
:10E55000211CFCF747FA3C49FBF7D2FE211CFCF7D3
:10E5600041FA3A49061C201CFCF73CFA3849FCF7F2
:10E570006BFB211CFCF736FA3649FBF7C1FE211C68
:10E58000FCF730FA3449FCF75FFB211CFCF72AFA50
:10E59000FE218905FBF7B4FE011C301CFCF74AF88C
:10E5A000291CFCF71FFA291CFBF7AAFEA2E7011C95
:10E5B000040BFBF7A5FE494682464046FCF73AF8B5
:10E5C000011C5046FCF70EFA24038046211C201C37
:10E5D000FCF708FA011C281CFCF736FB391C051C4B
:10E5E000201CFBF78DFE011C281CFCF723F8011CE6
:10E5F000FBF786FE011C1C48FCF726FB011C40466D
:10E60000FCF722FB211C051C201CFBF779FE011CDA
:10E610001648FCF719FB011C281CFCF715FB011C14
:10E620001248FCF711FB58E7FFFFFF3EFFFFFF31E9
:10E63000CAF2497108EF1138047F4F3A4611243D60
:10E64000A80A4E3E90B0A63EABAA2A3E2EC69D3DDD
:10E650006133303F2D57014039D119409999793FA5
:10E660002EBD3B33DB0FC93F2EBD3BB3DB0F493F14
:10E67000F0B54B00C6460C1CFF2100B55B08C90570
:10E680008B4217DC4200804652088A4212DCFE258B
:10E69000AD05AC4236D0A517AC46022567463D40D5
:10E6A000C70F3D43002A0CD1022D3CD0032D05D1CC
:10E6B000304803E0011C201CFBF722FE04BC9046FE
:10E6C000F0BD002B19D08B421FD08A4215D0D31A2F
:10E6D000DB153C2B29DC002C29DA3C3327DA00201F
:10E6E000012D34D0022D2AD0002DE7D02249FBF78E
:10E6F00007FE2249FCF7A8FAE0E74346002B10DBAF
:10E700001F48DBE7FEF774FBD8E79A4224D0022DBE
:10E7100009D0032DCCD00020012DCFD180200006C0
:10E72000CCE71848CAE71548C8E71548D8E7211CC0
:10E73000FBF780FFFEF7F8FCFEF75AFBD0E70E4927
:10E74000FBF7DEFD011C0D48FCF77EFAB6E78023DF
:10E750001B069C466044B1E7022D05D0032D07D06F
:10E76000012D03D00848A9E70848A7E70848A5E70E
:10E770000848A3E7DB0F49C02EBDBB33DB0F494080
:10E78000DB0FC93FDB0FC9BFDB0F493FE4CB1640AE
:10E79000DB0F49BFE4CB16C0F0B5FF22D6464F468B
:10E7A00046464300C0B5041C01005B08D2059342F5
:10E7B00031D8C50F934235D0634A904236DC0028E9
:10E7C00000DA88E0614A934235D9614A934200D821
:10E7D000A9E06049201CFCF705F95F4BAD00E95842
:10E7E000FBF78EFDFCF70AFC0500FCF727FC5B49F4
:10E7F000071CFCF7F7F8011C201CFCF725FA584908
:10E800008246381CFCF7EEF8071C391C5046FCF712
:10E810001BFA041C13E0FBF773FD1CBC90469946E1
:10E82000A246F0BD002DF8D00020F6E74D49081CA7
:10E83000FCF7D8F8F1E74C4A934264D90025211C33
:10E84000201CFCF7CFF84949061CFCF7CBF84849D7
:10E85000FCF7FAF9311CFCF7C5F84649FBF750FD07
:10E86000311CFCF7BFF84449FCF7EEF9311CFCF70A
:10E87000B9F84249FBF744FD311CFCF7B3F8011C21
:10E88000201CFCF7E1F9011C8046201CFCF7AAF8CB
:10E890008146002D25D080204146C005FCF7D4F9E3
:10E8A000011C4846FBF7C6FE011C381CFCF7CCF9DE
:10E8B0005146FCF7C9F9011CFE208005FCF7C4F99C
:10E8C0002B007D333CDAD8216435ED052818090585
:10E8D000FCF788F8A1E72A4A934200D872E70020A3
:10E8E0009BE780214046C905FCF7AEF9011C48466C
:10E8F000FBF7A0FE211CFCF7A7F9011CFE208005F8
:10E90000FCF7A2F989E71749201CFBF7F9FCFE2167
:10E910008905FBF7E7FB002890D0FE21201C890524
:10E92000FBF7EEFC79E7174BAF00F958201C0124E8
:10E93000FCF78AF9144B641B8246FF58651B64E799
:10E94000ED05281869E7C0461772B1421872B13E4A
:10E950009115853F3BAAB83F44F202008071313FD8
:10E96000D1F71737CAF24971FFFF7F314CBB313302
:10E970000EEADD3555B38A38610B363BABAA2A3E29
:10E98000B5F1CF424CF2020054F20200F8B54B0050
:10E99000071C5B0836D0414A44006408944231DCCD
:10E9A000013293422EDC9C4232DBC00FC5079C42F1
:10E9B0002FD03B4A944231DDE2157F3A38488342FA
:10E9C00056DC7E2618027642013E4000FCD510003F
:10E9D0007E3048DB80207C02640A0004044330005F
:10E9E0007E303BDB80234902490A1B040B43911B09
:10E9F000E21A00291BD06400002A01DB09D0540070
:10EA00000139F5E7381CFBF7EDFF011CFBF712FE9F
:10EA1000F8BDE80F234B8000C058F9E7200233D03F
:10EA20007E225242013A40000028FBDCC6E7002A61
:10EA300000DA2200002AECD019490B008A4203DCDC
:10EA40005200013E9A42FBDD33007E3313DA7E230F
:10EA50005B429E1B32412A431000D9E77E21494286
:10EA6000891B8B40C3E77E204042801A8440B6E772
:10EA7000DE157F3EABE70C4B7F369C4662442A4353
:10EA80001000F6053043C3E7934204DD7E22DE1515
:10EA90007F3E52429EE77E22524292E7FFFF7F7FF7
:10EAA000FFFF7F005CF20200000080FFF8B5DE4649
:10EAB00057464E4645460300E0B5420044D0002884
:10EAC0004DDB8E4A904251DC8D4A0021904206DC9B
:10EAD0009821C905FBF786FF192103004942DA1581
:10EAE0005B025C0A874B7F3AE01880231B040340DB
:10EAF000FE205218FE2180055840DD15204389056F
:10EB0000AD18FCF7A1F823000F335B02061C5B0A6B
:10EB10000F2B2FDC0021FBF7CBFA002800D19EE061
:10EB20000020002D15D02800FCF788FA7649041C37
:10EB3000FBF758FF7549051C201CFBF753FF011C10
:10EB4000281CFBF7DDFB04E0CC2000210006FBF7CE
:10EB500071FD3CBC90469946A246AB46F8BD011CEF
:10EB6000FCF772F80021FBF765FDF2E7011CFBF7EB
:10EB7000C7FBEEE78021C905FBF7C2FB011C301C77
:10EB8000FBF758FD80462800FCF758FA41468146BD
:10EB90004046FBF727FF5E4B011C9A468346FBF776
:10EBA00021FF5C49071CFBF71DFF5B49FBF7A8FB36
:10EBB000391CFBF717FF5949FBF7A2FB391CFBF780
:10EBC00011FF5749FBF79CFB5946FBF70BFF5549D3
:10EBD0008346381CFBF706FF5349FBF791FB391CB2
:10EBE000FBF700FF5149FBF78BFB391CFBF7FAFEE3
:10EBF000011C5846FBF784FB4D4BA2441C1B53469B
:10EC0000071C1C43002C65DDFC21301C8905FBF72B
:10EC1000E9FE311CFBF7E6FE011C041C381CFBF767
:10EC20006FFB4146FBF7DEFE071C002D44D0364942
:10EC30004846FBF7D7FE3549051C4846FBF7D2FE90
:10EC4000391CFBF75DFB011C201CFBF7FDFF311C91
:10EC5000FBF7FAFF011C281CFBF7F6FF79E73549A3
:10EC6000301CFBF7BFFE011CFC208005FBF7ECFF0E
:10EC7000311C041C301CFBF7B5FE011C201CFBF7EB
:10EC8000B1FE041C002D20D02800FCF7D7F91E4946
:10EC9000051CFBF7A7FE1D49071C281CFBF7A2FE5D
:10ECA000011C201CFBF7D0FF311CFBF7CDFF011C22
:10ECB000381CFBF7C9FF4CE7011C201CFBF7C4FF05
:10ECC000011C301CFBF7C0FF43E7211C301CFBF785
:10ECD000BBFF3EE7011C301CFBF7B6FF4146FBF7CC
:10ECE00081FE041C002DF0D007494846FBF77AFE50
:10ECF0000649051C4846FBF775FEA4E7FFFF7F7F2A
:10ED0000FFFF7F0020FB4A008071313FD1F71737AA
:10ED1000305CCFFF9788173E25333A3E2549923E17
:10ED2000ABAA2A3F4FD01C3E298E633ECDCCCC3EB1
:10ED300088C23500ABAAAA3EF0B557464E464546B6
:10ED4000DE46E0B54F0087B0061C0C1C0D007F08A6
:10ED500011D08146400043089846FF23DB059845C3
:10ED600003DD5C4801F00CFD07E09F420CDDFE2353
:10ED70009B059845F5D1FE20800507B03CBC904628
:10ED80009946A246AB46F0BD00239B46002E2DDBE4
:10ED9000FF23DB059F423ED0FE239B059F4244D0CC
:10EDA0008023DB059D421CD0FC239B059D4248D15E
:10EDB0004B46301C002B7ADAFEF7B6F9FF23DB0551
:10EDC000984502D04346002B45D15A46424B434416
:10EDD00013436FD0012AD0D180231B069C46604488
:10EDE000CBE7311C301CFBF7FDFDC6E73B4B9F42D8
:10EDF00024DC3B4B9F42CFDD9622FB15D31A3A0011
:10EE00001A4111009940B942C6D101231A40013379
:10EE10009B1A9B46C0E7FE239B059845ABD040DD7F
:10EE2000201C002DA9DA0020A7E7301C002DA4DA51
:10EE3000FE20311C8005FBF7FDFB9EE702239B466D
:10EE4000A6E7301CFEF770F9FF23DB0598451CD0C0
:10EE50004346002B19D0FE239B05984515D0F30F90
:10EE6000013B1A0000935B4613432AD09A23DB052B
:10EE70009F423BDD1B4B984500DD07E2002DD2DAB7
:10EE80001949081CFBF7AEFD77E7002D04DA011CD9
:10EE9000FE208005FBF7CEFB4B46002B00DB6CE72A
:10EEA00093E7002DBFDA80231B06E01865E700F02A
:10EEB00059FC62E7011CFBF7C7FE011CFBF7BAFB1C
:10EEC0005BE7311C301CFBF7BFFE011CFBF7B2FBFC
:10EED00053E7C04630F20200000080C0FFFF7F4BC6
:10EEE000FFFF7F3FF7FF7F3FCAF24971EB4B0022E4
:10EEF000984506DC9721C905FBF774FD182280466A
:10EF000052424346DB157F3B99184346FE225B0283
:10EF10005B0A92051A439046E14A0291934208DD4A
:10EF2000E04A934200DC6CE2DF4B01319C460291E7
:10EF3000E04400239A46FE2300259B05994601954F
:10EF400043464946181CFBF77FFE4646071C4946C8
:10EF500040460396FBF7D4F9011CFE208005FBF721
:10EF600069FB011C0590381C0497FBF73BFD4246EA
:10EF700053108022920513438022D20294466344A8
:10EF80001A00070B52443F03111C061C381C904604
:10EF9000FBF728FD011C0498FBF756FE4946824604
:10EFA0004046FBF751FE011C0398FBF74DFE391C50
:10EFB000FBF718FD011C5046FBF746FE0599FBF7D1
:10EFC00011FD311C8146301CFBF70CFD8046B74912
:10EFD000FBF708FDB649FBF793F94146FBF702FD45
:10EFE000B449FBF78DF94146FBF7FCFCB249FBF74E
:10EFF00087F94146FBF7F6FCB049FBF781F941463A
:10F00000FBF7F0FCAE49FBF77BF9414682464046F0
:10F01000FBF7E8FC011C5046FBF7E4FC8046311C82
:10F02000381CFBF76DF94946FBF7DCFC4146FBF762
:10F0300067F9391C8246381CFBF7D4FCA1490390C0
:10F04000FBF75EF95146FBF75BF9000B0303191C54
:10F05000381C9846FBF7C6FC9A49071C4046FBF74C
:10F06000F3FD0399FBF7F0FD011C5046FBF7ECFDA7
:10F07000311CFBF7B7FC494682464046FBF7B2FC21
:10F08000011C5046FBF73CF98246011C381CFBF77B
:10F0900037F9000B0303181C8B499846FBF7A2FCB9
:10F0A000391C061C4046FBF7CFFD011C5046FBF700
:10F0B000CBFD8649FBF796FC8549071C4046FBF7CC
:10F0C00091FC011C381CFBF71BF90199FBF718F99F
:10F0D00080460298FBF7B2FF82464146301CFBF7A0
:10F0E0000FF9291CFBF70CF95146FBF709F9070B3F
:10F0F0003F035146381CFBF7A7FD291CFBF7A4FD75
:10F10000311CFBF7A1FD011C4046FBF79DFD81462C
:10F110005D46009B013D1D4300D1B4E0FE239B05ED
:10F120009846250B2D03291C201CFBF78DFD391C4F
:10F13000FBF758FC211C061C4846FBF753FC011C3E
:10F14000301CFBF7DDF8291C8146381CFBF74AFC14
:10F15000011C051C83464846FBF7D2F84400061CF8
:10F1600007006408002800DCDFE08623DB059C4202
:10F1700000DDD2E000D1C1E0FC2300229B059246D5
:10F180009C4200DDDEE049465846FBF7B9F8040B27
:10F1900024035049201CFBF725FC5946061C201C63
:10F1A000FBF752FD011C4846FBF74EFD4A49FBF7B1
:10F1B00019FC4A49051C201CFBF714FC011C281CE7
:10F1C000FBF79EF8051C011C301CFBF799F8311C5D
:10F1D000041CFBF739FD011C281CFBF735FD211C25
:10F1E000061C201CFBF7FEFB3D49051CFBF7FAFB48
:10F1F0003C49FBF729FD291CFBF7F4FB3A49FBF7D7
:10F200007FF8291CFBF7EEFB3849FBF71DFD291C95
:10F21000FBF7E8FB3649FBF773F8291CFBF7E2FB29
:10F22000011C201CFBF710FD051C011C201CFBF71A
:10F23000D9FB8021071CC905281CFBF705FD011C13
:10F24000381CFBF7F7F9311C051C201CFBF7CAFB27
:10F25000311CFBF755F8011C281CFBF7F5FC211CA1
:10F26000FBF7F2FC011CFE208005FBF7EDFC53468A
:10F27000DB051B18DA15002A00DCD4E0181C414617
:10F28000FBF7B0FB79E51B4B98464AE71A4B9845CC
:10F2900077DD002D00DDF3E500206EE5FFFF7F0048
:10F2A00071C41C00D6B35D00000080FF42F1533EE4
:10F2B00055326C3E05A38B3EABAAAA3EB76DDB3E32
:10F2C0009A99193F000040400038763F4F38763F0A
:10F2D000A0C39D360072313F1872313F8CBEBF35DE
:10F2E0004CBB31330EEADD3555B38A38610B363B02
:10F2F000ABAA2A3E000080BF0700803F4C49484629
:10F30000FAF7FEFF291C8246301CFBF79DFC011C0E
:10F310005046FAF7E7FE002814D046494046FBF76E
:10F3200061FB4449FBF75EFB27E5434B9C4272DCE3
:10F3300000D021E7291CFBF787FC4946FAF7DCFEE1
:10F34000002868D1802212041300E4157E3C23417A
:10F350009E19F31530007602760A16431722DBB2A7
:10F3600036497F3B1941D31A1E4188430100B246FA
:10F37000002F01DA73429A46281CFBF765FC83468E
:10F3800001E7FE218905FBF75FFC2D49071CFBF710
:10F3900029FB2C49061C381CFBF724FBFA21051C11
:10F3A0008905381CFBF71EFB011C2748FBF74CFCAA
:10F3B000391CFBF717FB011CFC208005FBF744FC04
:10F3C000391C8246381CFBF70DFB011C5046FBF72D
:10F3D00009FB1E49FBF706FB011C281CFBF734FC4C
:10F3E000011C051C301CFAF78BFF070B3F03311C77
:10F3F000381CFBF729FC011C281CFBF725FC814667
:10F4000086E6134B134D019380239B039A46FF23FB
:10F410009B05994694E510494046FBF7E3FA0E49EF
:10F42000FBF7E0FAA9E45146FDF78CFF27E7C04659
:10F430003CAA3833CAF2497100001643FFFF7F002F
:10F4400000AAB83F70A5EC36ABAAAA3E3BAAB83FCB
:10F45000DCCFD13500C0153F6042A20DF0B5574654
:10F460004E46DE464546E0B5B04B470089B00C003D
:10F4700006007F089F426EDDAD4B9F421ADC0F23D2
:10F48000AC499F43002800DC71E0FBF7DDFBAA4B91
:10F49000061C9F4200D114E1A849FBF7D5FB011CD3
:10F4A0002060301CFBF7D0FBA449FBF7CDFB012506
:10F4B000606054E0A24B9F426FDDA24B9F4200DD93
:10F4C000F8E0862252429146FB1599444B46DD05F1
:10F4D0007D1B281CFBF792FDFBF7B0FD011C05907E
:10F4E000281CFBF7B1FB8721C905FBF77BFA804697
:10F4F000FBF784FDFBF7A2FD011C0690051C4046AE
:10F50000FBF7A2FB8721C905FBF76CFA00210790E6
:10F51000FAF7CEFD002800D105E10021281CFAF7FA
:10F52000C7FD434243410133874A21000192022231
:10F5300005A800924A4600F039FA0500002E0EDABE
:10F540008022120694462368454263442360636820
:10F550006344636003E00023002508604B602800DB
:10F5600009B03CBC90469946A246AB46F0BDFAF7BE
:10F57000C7FE714B061C9F4200D1C1E06F49FAF7EC
:10F58000BFFE011C2060301CFBF75EFB6B49FAF7E5
:10F59000B7FE012560606D42E1E7FDF7C5FD6B49EF
:10F5A0008046FBF71FFAFC218905FAF7A9FEFBF755
:10F5B00025FD0500FBF742FD5E498146FBF712FA87
:10F5C000011C4046FBF740FB5C4980464846FBF780
:10F5D00009FA8246011C40461F2D00DC83E0FBF740
:10F5E00033FB83465B46FF22DB0DFF151340FB1AFE
:10F5F000082B47DD56494846FBF7F4F98246011CC3
:10F600004046FBF721FB8346011C03904046FBF775
:10F610001BFB5146FBF718FB80464E494846FBF75B
:10F62000E1F94146FBF710FB011C82465846FBF707
:10F630000BFBFF22C30D1340D846FB1A8346192B40
:10F6400020DD45494846FBF7CDF9039B071C011C0B
:10F65000181C9A46FBF7F8FA011C80465046FBF747
:10F66000F3FA391CFBF7F0FA3C49071C4846FBF754
:10F67000B9F9391CFBF7E8FA011C82464046FBF752
:10F68000E3FA83465B46594623604046FBF7DCFAC3
:10F690005146FBF7D9FA6060002E00DB5FE780235C
:10F6A0001B065B44236080231B069C46604460600D
:10F6B0006D4254E7011CFBF7C7FA0025606020602B
:10F6C0004DE72349FBF7C0FA2249051CFBF7BCFABA
:10F6D000011C2060281CFBF7B7FA1E49FBF7B4FA9F
:10F6E000012560603BE7FBF7AFFAFF233A001C49B6
:10F6F0009A436B1E9B005B5883469A42C2D171E7C6
:10F700001349FAF7FDFD1349051CFAF7F9FD011C31
:10F710002060281CFBF798FA0E49FAF7F1FD012545
:10F7200060606D421BE70323FEE6C046D80F493FE9
:10F73000E3CB1640800FC93FD00FC93F4344353754
:10F74000800F4943FFFF7F7FE4F2020084F9223FEC
:10F750000044353708A3852E00A3852E32318D2431
:10F7600064F202002A49430070B50200041C5B08E1
:10F770008B423BD8002B38D000283EDB2549C615EC
:10F780008B420BD88020000420423DD1002300E0B2
:10F790000B005200591C0242FAD0F61A8023520282
:10F7A0001B04520A1A437F3E5300F10700D5930011
:10F7B000802270101921002600255204AC189C42AA
:10F7C00002DCA5181B1BB61801395B005208002982
:10F7D000F4D1002B02D0012301369E43FC239B056C
:10F7E0009C4676106644C005801970BD011CFBF76D
:10F7F000F9F8211CFAF784FDF7E7011CFBF724FA5E
:10F80000011CFAF717FFF0E701235B42C5E7C0468A
:10F81000FFFF7F7FFFFF7F00F8B54746CE46584B7E
:10F82000450080B5061C0F1C6D089D4248DCFBF7A7
:10F83000E5FB002800D19BE0311C301CFBF7D2F81F
:10F840005049041CFBF7CEF84F49FAF759FD211C2B
:10F85000FBF7C8F84D49FBF7F7F9211CFBF7C2F895
:10F860004B49FAF74DFD211CFBF7BCF84949FBF762
:10F87000EBF9211CFBF7B6F84749FAF741FD211CCB
:10F88000FBF7B0F88046FC21201C8905FBF7AAF89D
:10F890004146051C201CFBF7A5F8391C041C301C34
:10F8A000FBF7A0F8011C201CFBF7CEF9011C281C5B
:10F8B000FBF7CAF9011CFE208005FBF7C5F953E0F0
:10F8C000011CFBF78FF82F49041CFBF78BF82E491E
:10F8D000FAF716FD211CFBF785F82C49FBF7B4F964
:10F8E000211CFBF77FF82A49FAF70AFD211CFBF7D8
:10F8F00079F82849FBF7A8F9211CFBF773F826498A
:10F90000FAF7FEFC211CFBF76DF8244B80469D4264
:10F91000B9DD234B9D422EDCFF231B069C46FE20B7
:10F920006544291C8005FBF78FF98146FC21201CCA
:10F930008905FBF757F8291CFBF786F94146051C9A
:10F94000201CFBF74FF8391C041C301CFBF74AF84D
:10F95000011C201CFBF778F9011C281CFBF774F92B
:10F96000011C4846FBF770F90CBC90469946F8BD5F
:10F97000FE208005F8E70B4B0B4D9946D6E7C046B5
:10F98000FFFFFF314ED747ADF6740F317CF2933451
:10F99000010DD037610BB63AABAA2A3D9999993E31
:10F9A0000000483F0000383F0000903EF0B54E4652
:10F9B0004546DE465746E0B5DDB00B9166990390AB
:10F9C00007931800CB4B8900CE580723D11E441E45
:10F9D000C81703405B18D910CB43DB1719404B1CE9
:10F9E000DB00D31A05960194099104930D1B371976
:10F9F00019D4679A7F199046AB00013798440026C6
:10FA000020AC08E043469859FBF718FB0135A0519C
:10FA10000436BD4207D0002DF4DA00200135A05194
:10FA20000436BD42F7D1059B002B00DA24E3059B89
:10FA3000039901339B009946079B9A0094460092D4
:10FA40000022904648AA9346F422524261449246CC
:10FA50000F005CAB63449A44019B0026002B0FDB34
:10FA600055460026039C4544296801CCFAF7BAFFA5
:10FA7000011C301CFAF744FC043D061CBC42F3D1C7
:10FA80005B4642469E5004239C46E044C845E3D171
:10FA90000CA904228C46524262449446059DAB0058
:10FAA0009C4462468C460892039A083B6344944601
:10FAB0000A93009B63449A465A46AB000093D6587B
:10FAC000002D26DD8C4BA846EC1847AB99460CABB5
:10FAD0001D00A4005C44EE21301C8905FAF782FF6A
:10FAE000FBF78CFAFBF7AAFA8721C905071CFAF77E
:10FAF00079FF011C301CFBF7A7F8FBF77FFA2168A0
:10FB000001C5381CFAF7FCFB043C061C4C45E2D14D
:10FB10004546049F301C3900FDF714FCF821890587
:10FB2000041CFAF75FFFFDF703FB8221C905FAF712
:10FB300059FF011C201CFBF787F8061CFBF75EFA37
:10FB40000400FBF77BFA011C301CFBF77DF8061C58
:10FB5000002F00DCC4E06A1E92000CAB9B5808200A
:10FB60001900C01B0141641881405B1A0CA98B501D
:10FB70000722D21B134198464346002B29DD01344E
:10FB8000002D00DCF0E10C9F0123002F00D08EE05F
:10FB9000012D08D099000CAA57580133002F00D02E
:10FBA00086E09D42F6D1049B002B0EDD012B00D197
:10FBB000FCE0022B09D16B1E9B000CAAD2580292CA
:10FBC0003F2202990A400CA9CA504346022B00D199
:10FBD000D6E00021301CFAF76BFA002800D19DE036
:10FBE000059B691E8B420FDC0CAA94460022424BF7
:10FBF0000898EB189B0063441E68043B3243834221
:10FC0000FAD1002A00D0DCE0059B0CAA013B9B0046
:10FC1000D358002B00D0C7E001220A9B043B59684F
:10FC200001320029FAD052196B1C069293423ADC39
:10FC3000531B9B000293099B00275B199B0099466D
:10FC4000079B9C4620AB98466544AD00A844679A44
:10FC50004B469446DB1963445868FBF7EFF943467B
:10FC6000D851019B002B20DB4346DD193B00039C50
:10FC7000574600269A4600E0286802CCFAF7B2FE02
:10FC8000011C301CFAF73CFB043D061CA742F3D1D3
:10FC90005346BA461F00009BFB185B445E60029B04
:10FCA00004379F42D3D1069D06E70026F3E70021E3
:10FCB00080225200D71B0CAA57509D420EDD0CA982
:10FCC0008C4600999B006144D25808006344FF2190
:10FCD00000E01A688A1A04C38342FAD1012762E756
:10FCE000049B002B0AD16B1E9B000CAAD3581B123D
:10FCF000984641E728F60200FFFFFF3FFC218905F7
:10FD0000FAF7FAF9002800D021E100230021301C85
:10FD10009846FAF7CDF9002800D061E74346049FE2
:10FD2000301C794202940393FDF70CFB8721C9052F
:10FD3000041CFAF7E1F9002800D17EE1EE21201C35
:10FD40008905FAF74FFEFBF759F9FBF777F9872199
:10FD5000C905061CFAF746FE011C201CFAF774FFC1
:10FD6000FBF74CF9009A0CAB985008376B1C301C11
:10FD70009D0001930497FBF741F90CAB58513CE00F
:10FD8000FE20311C8005FAF75FFF061C002F00D112
:10FD90001FE7FE2004998005FDF7D4FA011C301CF2
:10FDA000FAF752FF061C14E701223CE76B1E9B008A
:10FDB0000CAAD25802927F2202990A400CA9CA507A
:10FDC00003E74346049A03930CA88B00C358083AF0
:10FDD000029401910492002B0FD1B1480B0084468C
:10FDE0000CA8634484469B006344043B5868013973
:10FDF000083A0028F9D004920191FE200499800568
:10FE0000FDF7A0FA019B061C002B00DA3AE19B00EB
:10FE10001D005C4604930CAB5859FBF70FF9311CDD
:10FE2000FAF7E0FDEE2160518905301CFAF7DAFDA2
:10FE3000043D061C2B1DEED1A346049B994D5B444B
:10FE40009846019B01339B4600239A4634AB994662
:10FE50005B460093059B9B465B460027002B14DB0B
:10FE6000002691480027002403E0043654450CDCAA
:10FE7000705943469959FAF7B5FD011C381CFAF739
:10FE80003FFA0134071CA345EFDA53464A469B006C
:10FE9000D75001239C46053BE2449C46009BE0442E
:10FEA0005345D9D1669B022B62DC002B1EDC13D19B
:10FEB000049B00204B441D0033AC2968043DFAF735
:10FEC0001FFAAC42F9D1039B002B03D080231B0601
:10FED0009C4660440B9B18600720029B18405DB055
:10FEE0003CBC90469946A246AB46F0BD019B002023
:10FEF000002B0DDB34AB9946019B00209B004B444B
:10FF00001D0033AE2968043DFAF7FAF9AE42F9D183
:10FF1000039B002B00D098E00B9B011C18603498C9
:10FF2000FAF792FE019B002B0EDD34AB01261D007B
:10FF3000019CB300E9580136FAF7E2F9B442F8DA65
:10FF4000039B002B00D08DE00B9B5860C4E702237D
:10FF500001349846002D00DD15E6FE20311C800599
:10FF6000FAF772FE061C34E600271CE634AB99460D
:10FF7000669B032BB0D1019B002B00DC8EE0019A25
:10FF800093009B464B46594694465B589846444BD3
:10FF9000454663449E00009333AB9A464E4437680F
:10FFA000291C381CFAF7ACF9041C011C381CFAF7A0
:10FFB0004BFE291CFAF7A4F9043EB0607460251CBE
:10FFC000B245ECD1019B012B68DD4B465A469E5849
:10FFD000009B4C469B009846444400E01C00276868
:10FFE000311C381CFAF78CF9051C011C381CFAF777
:10FFF0002BFE311CFAF784F9231F606025602E1C4C
:020000040002F8
:100000009945EBD14646002004364E443168043E03
:10001000FAF776F9B442F9D14B460399349A5B6802
:10002000002924D0802109068C460B996244634440
:1000300060440A604B6088604EE7201CFAF7DEFFE0
:10004000009A0CAB98500195D7E680230B9A1B06BB
:10005000C3181360011C3498FAF7F6FD019B002BBE
:1000600000DD62E780231B069C4660446CE70B9929
:100070000A604B6088602FE7079B9B00009348ABAA
:100080009B4605E5669B022B00DD6FE7002B00DD3C
:100090002CE70020002B00D115E71DE70020BBE76F
:1000A000FFFFFF3FFCF502000000C93FF8B54746DF
:1000B000CE4680B51700334A4300041C0E1C5B0873
:1000C000934205DCFAF79AFF0300201C002B46D070
:1000D000211C201CFAF786FC051C011C201CFAF7C9
:1000E00081FC29498046281CFAF77CFC2749FAF74D
:1000F000ABFD291CFAF776FC2549FAF701F9291C12
:10010000FAF770FC2349FAF79FFD291CFAF76AFCFD
:100110002149FAF7F5F88146002F24D0FC21301C44
:100120008905FAF75FFC4946071C4046FAF75AFC76
:10013000011C381CFAF788FD291CFAF753FC311C06
:10014000FAF782FD1549051C4046FAF74BFC011CE5
:10015000281CFAF7D5F8011C201CFAF775FD0CBC19
:1001600090469946F8BD011C281CFAF73BFC0B4948
:10017000FAF76AFD4146FAF735FC211CFAF7C0F898
:10018000EDE7C046FFFFFF31D3C92E2F342FD73202
:100190001BEF3836010D50398988083CABAA2A3E3E
:1001A000F0B5DE4657464E464546E0B58A4B46001A
:1001B00083B0041C88469246834676089E4212DC31
:1001C000FAF71CFF002828D1534601331E4300D103
:1001D000F5E05346012B00D1FBE0211C7F48FAF7E4
:1001E00029FA051CB5E07E4B9E4216DD002805DA93
:1001F00080231B069C46434498466444211C79484E
:10020000FAF722FD4146041C7748FAF71DFD211C30
:10021000FAF776F800239846041C211C201CFAF7F4
:10022000E1FB011C071CFAF7DDFB391C051C201C37
:10023000FAF7D8FB6D498146281CFAF7D3FB6C49C5
:10024000FAF75EF8291CFAF7CDFB6A49FAF758F875
:10025000291CFAF7C7FB6849FAF752F8291CFAF784
:10026000C1FB6649FAF74CF8291CFAF7BBFB644955
:10027000FAF746F8391CFAF7B5FB62490190281CD9
:10028000FAF7B0FB6049FAF73BF8291CFAF7AAFB2A
:100290005E49FAF735F8291CFAF7A4FB5C49FAF72E
:1002A0002FF8291CFAF79EFB5A49FAF729F8291C5E
:1002B000FAF798FB5849FAF723F8011C0198FAF766
:1002C0001FF84946FAF78EFB4146FAF719F8391C30
:1002D000FAF788FB4146FAF713F85049051C4846DF
:1002E000FAF780FB291CFAF70BF8011C071C201CED
:1002F000FAF706F83A4B051C9E4232DC5346012BB6
:1003000027D0011C060B3548FAF794F93603211C57
:100310008046050B301CFAF797FC2D03011C381C96
:10032000FAF792FC291CFAF75DFB291C041C301C0F
:10033000FAF758FBFE218905F9F7E2FF011C201CA2
:10034000F9F7DEFF4146FAF74DFB291CF9F7D8FF14
:10035000051C281C03B03CBC90469946A246AB46FF
:10036000F0BD5046FAF76AFE291C061C281CFAF755
:1003700039FB311C8046281CF9F7C2FF011C40469E
:10038000FAF758F9391CFAF75FFC011C201CFAF740
:100390005BFC011CF9F7B4FF011C301CFAF754FC9C
:1003A0005B46041C981702231840013B181AFAF701
:1003B00045FE011C201CFAF715FB051CC9E7201C93
:1003C000FCF7B2FE011CFE208005FAF733F9051C8C
:1003D000BFE7251CBDE7C046FFFF7F31000080BF9F
:1003E0003FA12C3FDA0F493F682122338453D9378C
:1003F0007AC09538B937813948DEBE3A1F37113C8B
:10040000D10D5D3D5FAE9BB745F4A338C8261A3ABF
:1004100016696B3BA427B33C8988083EABAAAA3E69
:10042000F8B54E4657464546DE46A04BE0B54E0071
:1004300080468A46894676089E420CDD9C4B9E4249
:1004400000DDA2E000D19DE04B46002B00DCE0E0A7
:10045000984B994AA1E0994B9E4200DDB3E0984B3E
:100460009E4200DCA1E001235B429B46424653468C
:1004700040465146FBF792FD02000B0006000F00BC
:10048000FBF78CFD04000D008E4A8F4BFBF786FDB9
:100490008E4A8F4BFAF75CFE22002B00FBF77EFDA5
:1004A0008C4A8D4BFAF754FE22002B00FBF776FDA9
:1004B0008A4A8B4BFAF74CFE22002B00FBF76EFDAD
:1004C000884A894BFAF744FE22002B00FBF766FDB1
:1004D000864A874BFAF73CFE32003B00FBF75EFD95
:1004E000844A06000F00844B20002900FBF756FDCC
:1004F000824A834BFBF7C4FF22002B00FBF74EFD23
:10050000804A814BFBF7BCFF22002B00FBF746FD26
:100510007E4A7F4BFBF7B4FF22002B00FBF73EFD2A
:100520007C4A7D4BFBF7ACFF22002B00FBF736FD2E
:1005300002000B0030003900FAF70AFE534642462B
:10054000FBF72CFD5B46013366D05B46734A744C67
:10055000DB00E418D3181A685B68FBF791FF42468A
:100560005346FBF78DFF02000B0020686168FBF724
:1005700087FF030048460A0000280EDA8022120690
:100580008A180AE0002800D15EE7424653464046FA
:100590005146FAF7DDFD03000A00180011003CBCCB
:1005A00090469946A246AB46F8BD5E4A5E4BFAF7C6
:1005B000CFFD00225D4BF9F75BFD002800D152E72B
:1005C00043465246E9E700F0BFF8594B04000D00DE
:1005D0009E422ADC574B9E4250DC02000B00FAF789
:1005E000B7FD0022514BFBF74BFF802306000F00A5
:1005F0000022DB0520002900FAF7AAFD0B0002000B
:1006000039003000FBF7C0F8002380468A469B463D
:100610002CE7284B484AC0E702000B0040465146F1
:10062000FBF72EFF03000A00B7E7444B9E421ADC9B
:100630000022434BFBF724FF002206000F00404B33
:1006400020002900FBF7AAFC0022384BFAF780FDB6
:100650000B00020039003000FBF796F802238046B9
:100660008A469B4602E70B00020036490020FBF752
:100670008BF8032380468A469B46F7E600222B4BE5
:10068000FBF7FEFE002206000F00284B2000290089
:10069000FAF75EFD0B00020039003000FBF774F83A
:1006A000012380468A469B46E0E6C046FFFF0F4492
:1006B0000000F07F182D4454FB21F93FFFFFDB3F82
:1006C000FFFF1F3E11DA22E33AAD903FEB0D762497
:1006D0004B7BA93F513DD0A0660DB13F6E204CC56C
:1006E000CD45B73FFF8300922449C23F0D55555574
:1006F0005555D53F2F6C6A2C44B4A2BF9AFDDE52EB
:100700002DDEAD3F6D9A74AFF2B0B33F711623FE8C
:10071000C671BC3FC4EB98999999C93F08900200F3
:10072000E88F02009C7500883CE4377E0000F03FB3
:10073000FFFFF23FFFFFE53FFB21F9BFFF7F0340D3
:100740000000F83F0000F0BF49004B081900704757
:1007500000207047002001497047C0460000F87F24
:100760004000C90FC90740080843704743000020F4
:10077000024A5B089A4240417047C046FFFF7F7FB4
:10078000004870470000C07F10B504000448130003
:10079000002804D00A000220210002F050F810BD09
:1007A0003F280200014B18687047C0466C000020CB
:1007B000084B10B50400002B02D0002100E000BF60
:1007C000054B1868836A002B00D09847200008F07A
:1007D0005AF8C0460000000094F60200002310B54D
:1007E000040003604360836081814366C2810361CA
:1007F00043618361190008225C3008F0E6FA054B7A
:1008000024626362044BA362044BE362044B2363E0
:1008100010BDC046A10A0200C90A0200010B020075
:10082000378E020010B5024908F078FA10BDC046B4
:10083000250E0200836913B50400002B28D18364C0
:10084000C3640365134B144A1B6882620193984288
:1008500001D101238361200000F020F860602000B6
:1008600000F01CF8A060200000F018F80022E06002
:1008700004216068FFF7B2FF01220921A068FFF799
:10088000ADFF02221221E068FFF7A8FF0123A36158
:1008900013BDC04694F6020025080200F8B51C4BB3
:1008A00007001E68B369002B02D13000FFF7C2FFBA
:1008B0004836B4687368013B04D53368002B07D011
:1008C0003668F6E70C22A55E002D0DD06834F2E7FD
:1008D0000421380008F00CFA30600028F0D10C2315
:1008E00004003B602000F8BD20000A4B65662560CF
:1008F0006560A560E36025616561A5610822290046
:100900005C3008F062FA6563A563A564E564E9E715
:1009100094F602000100FFFF70B500260C4D0D4C4F
:10092000641BA410A64209D1002608F04FFB0A4D13
:100930000A4C641BA410A64205D170BDB300EB584D
:1009400098470136EEE7B300EB5898470136F2E7D7
:10095000F0000020F0000020F00000201001002036
:100960000FB40B4B13B51C68002C05D0A369002BEA
:1009700002D12000FFF75EFF05AB049AA1682000BA
:10098000019300F0FBFA16BC08BC04B01847C0463F
:100990006C00002070B505000E00002804D08369AB
:1009A000002B01D1FFF746FFAB69AC68002B02D1E9
:1009B0002800FFF73FFF244B9C420FD16C68A389AE
:1009C0001B0702D52369002B1FD12100280000F04E
:1009D00017F9002819D00120404270BD1B4B9C42E2
:1009E00001D1AC68EBE71A4B9C42E8D1EC68E6E732
:1009F0000136A360002B04DAA2699A4216DC0A29A8
:100A000014D023685A1C22601970A3683178013B06
:100A10000029EDD1A360002B0FDA22000A31280053
:100A200000F084F8431CD6D00A20D6E72200280024
:100A300000F07CF8431CE8D1CDE70A2023685A1C5B
:100A400022601870C9E7C04654F6020074F602002E
:100A500034F6020010B5034B01001868FFF79AFF47
:100A600010BDC0466C00002010B5034B0100186893
:100A700008F0B3F910BDC0466C000020002370B52B
:100A8000064C050008001100236000F0F1FC431C37
:100A900003D12368002B00D02B6070BDDC2F002019
:100AA00070B50C000E25495F00F086FC002803DBC2
:100AB000636D1B18636570BDA389024A1340A3814F
:100AC000F9E7C046FFEFFFFFF8B51F008B8905006F
:100AD0000C001600DB0505D50E23C95E002202239B
:100AE00000F0CCF9A389054A28001340A381320005
:100AF0000E23E15E3B0000F06FF8F8BDFFEFFFFF53
:100B000070B50C000E25495F00F0B8F9A389421CAE
:100B100003D1054A1340A38170BD802252011343C3
:100B2000A3816065F8E7C046FFEFFFFFF8B5050059
:100B30000E001400002804D08369002B01D1FFF7B8
:100B400079FE224B9C422DD16C68A369A360A389D6
:100B50001B0731D52369002B2ED023682269F7B2F9
:100B6000981A6369F6B2834205DC2100280000F080
:100B700059F9002826D1A3680130013BA3602368FE
:100B80005A1C22601F706369834204D0A389DB076B
:100B90001AD50A2E18D12100280000F043F90028A8
:100BA00012D00FE00A4B9C4201D1AC68CDE7094B53
:100BB0009C42CAD1EC68C8E72100280000F020F868
:100BC0000028CAD0012676423000F8BD54F6020053
:100BD00074F6020034F6020070B50500080011003A
:100BE0000022064C22601A00F8F798F8431C03D143
:100BF0002368002B00D02B6070BDC046DC2F002086
:100C0000364B70B51D6806000C00002D05D0AB6991
:100C1000002B02D12800FFF70DFE314B9C420FD173
:100C20006C680C23E25E93B219072DD4D90611D457
:100C300009230120336037331343A381404270BD41
:100C4000284B9C4201D1AC68EBE7274B9C42E8D192
:100C5000EC68E6E75B0713D5616B002908D0230039
:100C60004433994202D0300007F092FB00236363C3
:100C70002422A3899343A381002363602369236013
:100C80000823A2891343A3812369002B0BD1A02140
:100C90008022A389890092000B40934203D0210057
:100CA000300000F027F90123A289134011D000235E
:100CB000A36063695B42A361002023698342BED1C4
:100CC0000C23E25E1306BAD540231343A3810138F7
:100CD000B5E7920700D46369A360EDE76C000020DC
:100CE00054F6020074F6020034F60200002370B5D8
:100CF000064C050008002360F7F7FAFF431C03D1F8
:100D00002368002B00D02B6070BDC046DC2F002074
:100D1000F7B58A8905000C00130760D44B68002BD7
:100D200004DC0B6C002B01DC0020FEBDE76A002F09
:100D3000FAD000232E682B6080235B01216A1A40C1
:100D400034D0606DA3895B0706D56368C01A636BF6
:100D5000002B01D0236CC01A0200216A0023280056
:100D6000E76AB847A189431C06D12B681D2B30D8F0
:100D70002B4ADA40D3072CD5002363602369236014
:100D8000CB0405D5431C02D12B68002B00D1606534
:100D9000616B2E600029C7D023004433994202D0F2
:100DA000280007F0F5FA00206063BEE70123280061
:100DB000B847431CC6D12B68002BC3D01D2B01D0D4
:100DC000162B01D12E60AFE74023A2891343A381E4
:100DD000ABE740230B430120A3814042A5E70F6905
:100DE000002FA1D00B680F60DB1B0193002392073B
:100DF00000D14B69A360019B002B00DC94E7019BB1
:100E00003A00216A2800A66AB047002803DC402384
:100E1000A2891343DFE7019B3F181B1A0193EAE7FE
:100E2000010040200B6970B505000C00002B01D1BA
:100E3000002070BD002804D08369002B01D1FFF78A
:100E4000F9FC0B4B9C4209D16C680C22A35E002B71
:100E5000EED021002800FFF75BFFEAE7054B9C423C
:100E600001D1AC68F1E7044B9C42EED1EC68ECE7B1
:100E700054F6020074F6020034F6020070B5050064
:100E8000080011000022064C22601A00F7F7A8FFA4
:100E9000431C03D12368002B00D02B6070BDC046DB
:100EA000DC2F002070B50E001D000E23C95E96B029
:100EB0001400002907DA00232B60B3891B0611D424
:100EC0008023DB000FE06A4600F08AFA0028F2DB9C
:100ED000F022019B12021340054A9B185A425341CB
:100EE0002B60EDE740230020236016B070BDC046A4
:100EF00000E0FFFFF7B502268B8905000C003342A6
:100F000006D0230047332360236101236361F7BDCB
:100F100001AB6A46FFF7C6FF00990700280007F0FB
:100F200032FA002808D10C22A35E9A05EFD40322DE
:100F300093431E43A681E4E70F4BAB628023A28953
:100F400020601343A381009B20616361019B002B00
:100F50000DD00E23E15E280000F054FA002806D0E0
:100F60000322A38993431A0001231343A381A08979
:100F70003843A081CBE7C04625080200F0B5A1B0F8
:100F800003900F0016001D00002805D0836905930B
:100F9000002B01D1FFF74EFC7B4B9F425CD1039BA2
:100FA0005F68BB891B0763D53B69002B60D00023BA
:100FB00008AC6361203363761033A3760795350060
:100FC0002B78002B01D0252B5CD1AB1B05930CD0CB
:100FD00032003900039807F079FF431C00D1C4E0C8
:100FE0006269059B9446634463612B78002B00D1B2
:100FF000BBE0012200235242626004A9543252181D
:101000006E1C2360E360A3601370A3653178052232
:101010005E4807F0A4FE751C002835D12268D3066F
:1010200004D5532304A95B1820211970130704D594
:10103000532304A95B182B21197033782A2B2CD049
:10104000350000210A20E3682A786E1C303A092A0C
:1010500064D900292ED026E04D4B9F4202D1039B3C
:101060009F689EE74B4B9F429BD1039BDF6898E7AD
:1010700039000398FFF7C4FD002898D001204042B2
:1010800021B0F0BD01359BE7404B2268C01A012317
:101090008340134323602E00B8E7079B191D1B688C
:1010A0000791002B01DB0B9304E05B42E36002231A
:1010B000134323602B782E2B0AD16B782A2B35D142
:1010C000079B02351A1D1B680792002B2BDB099327
:1010D000314E29780322300007F041FE002806D067
:1010E0004023801B83402268013513432360297805
:1010F00006222A486E1C217607F031FE00283AD0DD
:10110000274B002B25D10722079B07339343083336
:1011100007936369049A9B18636150E74343012175
:101120009B18350090E701235B42D0E700230A209B
:101130001A000135636029786E1C3039092903D9FA
:10114000002BC5D00992C3E7424301235218350052
:10115000F1E707AB00933A00124B2100039800E03F
:1011600000BF0490049B0133D3D1BB895B0600D53B
:1011700084E70D9884E707AB00933A00094B210000
:10118000039800F011F8ECE754F6020065870300BD
:1011900074F6020034F602006B8703006F870300C9
:1011A00000000000CD8E0200F0B589B004920A0064
:1011B00043320593039002920A7E0C000E9B6E2A26
:1011C00000D186E01FD8632A33D008D8002A00D186
:1011D0008CE0582A4DD0250042352A7030E0642A30
:1011E00001D0692AF7D1196825680A1D280629D572
:1011F00008681A60002803DA2D23029A404213700F
:101200006B4E0A274FE0732A74D008D86F2A1FD07C
:10121000702AE0D1202209680A43226003E0752A7F
:1012200016D0782AD7D12200782145321170614E2C
:1012300022E025001A684235111D196013682B70D1
:10124000012365E008681A606906D3D500B2D1E7CA
:1012500019682568081D186008682E0605D5544EC3
:1012600008276F2A1BD00A2719E06D06F7D580B230
:10127000F5E745314E4E0A7018682268011D006876
:101280001960150621D5D30702D520231A43226001
:101290001027002803D1202322689A4322602300CC
:1012A000002243331A706368A360002B58DB0422CA
:1012B000216891432160002854D1029D002B5AD00F
:1012C0002500337842352B7055E05506DBD580B2CA
:1012D000D9E71A680D68101D4969186013682E0651
:1012E00001D5196002E06D06FBD519800023029D2F
:1012F00023614FE01A68111D1960156800216268AA
:10130000280007F02CFD002801D0401B60606368B6
:1013100023610023029A13703CE023692A00049998
:101320000398059DA847431C3ED023689B0715D40E
:10133000079BE068984239DA180037E02200012361
:10134000193204990398059EB047431C2CD00135EF
:10135000E368079A9B1AAB42F0DCE9E70025F7E760
:101360000028ADD0029D3900F8F768FD735C013D9F
:101370002B700028F7D1082F09D12368DB0706D589
:1013800063682269934202DC3023013D2B70029B8B
:101390005B1B2361059B07AA00932100049B039814
:1013A00007F0A6FD431CB8D10120404209B0F0BDB2
:1013B000768703008787030070B5050008001100D9
:1013C0000022064C22601A00F7F7D2FC431C03D11E
:1013D0002368002B00D02B6070BDC046DC2F00209E
:1013E000002370B5064C050008001100236007F0CB
:1013F0002DFA431C03D12368002B00D02B6070BD55
:10140000DC2F0020002370B5064C05000800236087
:10141000F7F7D2FC431C03D12368002B00D02B60CC
:1014200070BDC046DC2F002070B50C4E0D031C03B0
:1014300049005B002D0B490D240B5B0DB14208D018
:10144000064900208B4203D114432000441EA041D2
:1014500070BD05430120002DFAD1F1E7FF07000020
:1014600058220120014B40421A607047DC2F0020B7
:1014700058220120014B40421A607047DC2F0020A7
:10148000C26810B50300002A05DD4168806881420A
:1014900008DB002010BD00208242FBD059689C6808
:1014A000A142F7DD012059684C00521820435A60D0
:1014B000F0E783684268C1689B1A5B1810B5581C36
:1014C000002900DD581EF8F7BDFCC343DB171840A8
:1014D00010BD70B5050008000021EBF747FB0400C4
:1014E0002000EBF7A5FB011E00D170BD2B1D0122D2
:1014F000180001F0D7FFF3E710B50400DEF756FF40
:101500002368036010BD70B50D00FFF7F5FF040000
:101510002900FFF7DEFF200070BD70B505000E004A
:10152000DEF744FF04003100DEF7F4FF2B682000F3
:10153000236070BDF7B50C6801900E002000002AF2
:101540000AD0DEF7A5FF0125019B9D4208D3336831
:1015500020001B682360FEBDDEF728FF0400F2E7D1
:10156000AB00F058844204D12000DEF7EDFF0135D6
:10157000EAE70021EBF7FAFA07003800EBF758FB2F
:10158000011EF4D02000DEF7A3FFF6E710B500221D
:10159000FFF7D0FF10BD30B58468C3686568990057
:1015A000AB4201D3002207E0E26801335258002A1F
:1015B00004D0042A02D0C360100030BD0431EFE72C
:1015C00010B50122DFF754F810BD10B50022DFF787
:1015D0004FF810BD10B50430012201F063FF10BDBB
:1015E000F7B50C000025060011001F00009501232F
:1015F0002A002000F0F760FEAC4207D12100200055
:10160000DFF71AF8040026602000FEBD290028003C
:10161000DFF712F8290004003868EBF7A7FA050095
:101620002800EBF705FB011EEDD02000FFF7D2FFED
:10163000F6E70B0010B5010000221800DFF754F8A0
:1016400010BD10B50022DFF74FF810BD02398142FE
:1016500002D30B88002BF9D00231081A40107047D2
:1016600070B51D090024954217D26C000919541B4E
:101670000F22250013400E883200012D02D04A8827
:1016800012043243DA40013D92B20280023102304C
:10169000002DF0D153425A41A41A200070BDF0B57C
:1016A000059C121B9446002227001400002F11D124
:1016B000059B5D004219491916006546002D12D19F
:1016C00063465B00D218002C01D014800232101A3D
:1016D0004010F0BD8E5A9D5A013F7619341984523C
:1016E000240C0232E2E70B88013D1C1934800231E0
:1016F000240C0236E2E7F7B50025089C2E002700EF
:101700000193121B002F0BD16400031915001F0059
:101710000919002D0FD152009918FFF797FFFEBD50
:101720004B5B013F9C46019B66445B5BF61A46534C
:1017300036140235E6E70C88013DA6193E800231D9
:1017400036140237E5E770B505000C00022900D217
:101750000224A868002803D02B689B08A34209D262
:10176000610004F0C4FD03232A68A40013401C4355
:10177000A8602C6070BD70B505000C2004F099FDC8
:1017800001212B780400DB07DA0F03788B43134326
:101790000222934303702B68216898080323820078
:1017A0000B40134323606B686360AB68002B02D16E
:1017B000A360200070BD400004F07BFDA0602B689A
:1017C000A9689A08520007F0E4FAF2E710B54B0056
:1017D000C018D218002901D1080010BD0238023A01
:1017E000038814881B1B02D404D10139F2E70120BD
:1017F0004042F2E70120F0E710B5041E05D08068F2
:1018000004F086FD200004F083FD10BD70B50500D6
:101810000C000221FFF797FF2B780122002C07DA3A
:1018200013432B70644200236B60002C03D170BD06
:1018300093432B70F7E76B685A1C6A60AA685B00D9
:101840009C52240CF1E700230360436083607047DF
:1018500010B5002805D003789B0702D4806804F0F7
:1018600057FD10BD70B50C0005004968FFF76BFF10
:1018700001212378A868DB07DA0F2B788B43134309
:101880002B706368A1686B6063685A0007F081FA87
:1018900070BD10B5002901D1416010BDFFF7B6FF42
:1018A000FBE770B50D000400FFF7CDFF2900200015
:1018B000FFF7EFFF70BD70B5012504788160AC4380
:1018C000250002242C4304709400032205681900AB
:1018D0002A402243026000224260FFF7DAFF70BD17
:1018E000F8B504001F0006AB1D7804211600FFF7B1
:1018F0002AFF23780122002D0CD0002F0ADA13438F
:10190000237000237242BB41002161601100194322
:1019100005D1F8BD9343237032003B00F4E76168C2
:101920001D04481C6060A06849000A52100C190C84
:1019300005432A000B00E9E7F7B50E1C01210378E7
:10194000F20F8B431343FF220370D201330C0700C5
:10195000134002D100237B60F7BD9342FAD07F236E
:101960007400240E5B42E518F4D4002D02D1FFF779
:101970004DFFF1E721000F236F39CA171A405218A3
:10198000802176021211760A090400920E43162D68
:1019900028DC08335D1BEE4000252C000099380040
:1019A000FFF7D1FE009B7B6063000193002C04D005
:1019B0001A000021B86807F008FA002D08D033009B
:1019C000AB40BA686100535210235D1BEE400134F6
:1019D000009B64005B009C42BED0BA681653360C74
:1019E0000234F8E71D40963CE217173D1D401340B6
:1019F0001C192411D2E7F0B504000D001E008B184D
:101A0000D100090985B001310293FFF79CFE2378CC
:101A10000122002E0DD013432370002328006360A1
:101A20000A9B9BB20393029B984204D3401B05B0D0
:101A3000F0BD9343F0E703781A00303A092A04D93D
:101A4000113A192A18D8373B1A000A9B9A42EDD24C
:101A50006368A7689C463E0001936346002B11D142
:101A6000019B5B00FB18002A01D01A800233DF1BA8
:101A70007F1067600130D6E71A00613A192AD5D87D
:101A8000573BE1E73188039B594301238A185B42A6
:101A900032809C44120C0236DFE7F8B504001500D2
:101AA0001E000127002902D0531EF618023FE9004C
:101AB0000F3109092000FFF746FE012223789343E6
:101AC000237000236360002D08D163685900A36868
:101AD00059181800FFF7BAFD6060F8BD00200F2B01
:101AE00008DC3278013D9A40104380B20833F61981
:101AF000002DF4D16168103B4A1C6260A268490065
:101B00008852E0E70A00416870B50500002903D15A
:101B100053680800002B14D013782C78DB07E007FB
:101B2000DB0FC00F181A0CD1536899420AD3013049
:101B3000994203D89268A868FFF748FEE30700D5EA
:101B4000404270BD01204042F8E710B504008842D1
:101B500001D0FFF787FE012223789343237010BD45
:101B600010B50400884201D0FFF77CFE01212278E5
:101B7000D307DB0FCB1A0B408A431343237010BDEE
:101B80007FB50400884201D0FFF76CFE6268002A2E
:101B90000BD101212000FFF7D6FD0123A26813809D
:101BA00022786360134323707FBD0E2601252378BE
:101BB0006E442B420AD0A168AB43237035803300BA
:101BC00000950800FFF797FD6060EDE7511C2000CD
:101BD000FFF7B9FDA1683580330000956268080001
:101BE000FFF75DFD237860601D432570DCE7F0B5ED
:101BF0000D00496887B004001600002901D0002AB2
:101C000005D129002000FFF72DFE07B0F0BDFFF73A
:101C10009AFD3300A9686A68A068FFF721FD60603B
:101C2000029001202B78DB07D90F237883430B43E5
:101C300023700342E9D00E23002102AA9B186A6890
:101C4000300919800392039A8A4201D0814212D14D
:101C5000039A8242D9D9A9684000405A01250F2130
:101C60000E402900B1400139014200D01D80198881
:101C700000290CD1C9E74A0094466746AA68BA5AB7
:101C8000002A10D00121039A19808242E3D8029AD7
:101C9000A0680121002A08D00091029A0100FFF7F4
:101CA000FEFC6060B1E70131CDE701806160ACE727
:101CB00073B553680C00496806001500994206D3B5
:101CC00008D89268A068FFF781FD002802DA230097
:101CD0002C001D0023782A7861685340DB0715D457
:101CE00001313000FFF72FFD6B68B0680093AB68DF
:101CF0006268A168FFF7D3FC012170602378DB07DD
:101D0000DA0F33788B431343337073BD3000FFF722
:101D10001AFD6B68B0680093AB686268A168FFF752
:101D2000EAFCE9E7F7B553680C00496806001500BE
:101D3000994208D30027994209D89268A068FFF712
:101D400045FDB84203DA230001272C001D0023784B
:101D50002A7861685340DB0719D501313000FFF75D
:101D6000F2FC6B68B0680093AB686268A168FFF72B
:101D700096FC706023780121DB07DB0F3278002F9F
:101D800001D0CB1A0B408A4313433370F7BD3000A8
:101D9000FFF7D9FC6B68B0680093AB686268A16814
:101DA000FFF7A9FCE5E7F0B54B68160052688BB069
:101DB00005000C00934201D234000E00012122786C
:101DC00063680A4201D132781140C9182800FFF730
:101DD000BAFCA36821780393636872680193B368BF
:101DE000347804930B0000266340A868B446DB07F0
:101DF00002D4CB07DB0F9C46C907CB0F1E00029312
:101E0000634607005B429BB2E40707937342E40F0B
:101E10009BB2089363429BB20693019B0594591EA3
:101E2000D31A09934B1C14D1019B590063464118E6
:101E3000002B02D001230B800231FFF707FC0122A7
:101E4000029B68601C402B7893431C432C700BB0A2
:101E5000F0BD039B089A1B8853409E19099B069A64
:101E60005B188B4206D8049B1A88069B5A40049B39
:101E700002330493059B0139D318079A0593334025
:101E800053409BB263443B801B0C059A9C46039BCA
:101E9000120C02330592360C02370393C2E7F0B5F9
:101EA0004B68160052688BB005000C00934201D2BB
:101EB00034000E000121227863680A4201D1327891
:101EC0001140C9182800FFF73EFCA368217802934F
:101ED0006368A8680093B368726803930123347839
:101EE000194200D12340C907C90F0E000191594280
:101EF00089B2E40707917142E40F89B20891614207
:101F000089B2009F06910099D21B05940139049073
:101F100009924A1C0ED1009B59004118FFF796FB0D
:101F20000122019B686023432C7894431C432C704E
:101F30000BB0F0BD029A089F12887A409619099A50
:101F4000069F5218BC468A4206D8039A1288574008
:101F5000BC46039A023203923700059A360C62445B
:101F600005921743079A01395740BAB29446049A2A
:101F700063441380059A1B0C120C0592049A0232DA
:101F80000492029A02320292C3E7F0B54B688BB01A
:101F900004000E001500002B02D05368002B03D163
:101FA000002363600BB0F0BD814237D10800FFF71A
:101FB000E2FB06000190A54200D1050073686A6843
:101FC00020009918FFF7BFFB236800219A085200F0
:101FD000A06806F0FAFEA3680593B3680599079315
:101FE00073680693AB6802936B689C46069B5B0024
:101FF00004930023049A023209926246002A3ED1D9
:1020000063602B78317822785940012319423CD102
:102010009A4322700198FFF7EFFBC3E70023019377
:102020008242CBD11000FFF7A6FB05000190C5E767
:102030001388DB190893038802301F00029B1B885A
:102040007B43089FDF19039B1780013B3F0C0393E1
:102050000232039B002BEBD1049BCB18002F03D043
:10206000099B049A5B188F52059A02319B1A012230
:1020700052429444029A5B1002320292BDE7069BE0
:10208000079803930A000027E3E713432370C1E78F
:10209000F8B54B6807001500002B03D00124137816
:1020A000234202D000237B60F8BD5368002B03D18C
:1020B0002100FFF7ABFBF7E70800FFF75CFB06002A
:1020C0002800FFF758FB210005003800FFF79EFBB2
:1020D0006B68002B11D0AB681B88234204D0320000
:1020E00039003800FFF751FFA96823006A6808002B
:1020F000FFF7B6FA6860002806D13000FFF77CFBD6
:102100002800FFF779FBCFE7320031003000FFF7FE
:102110003CFFDDE7816843680200002010B55B00EA
:10212000CB18023B9C1CA14204D31378DB0700D5DB
:10213000404210BD1C8800042043F2E7F0B587B090
:10214000039104921D00002901D0049A9D180024D7
:102150008268260000924268019201220292019A4E
:10216000002A26D0009A24041188049A10369A185E
:102170000C430592072E06DC009A02320092019A67
:10218000013A0192EBE701270278A1B23A4207D067
:10219000FF228A431100029A891889B20A0A029220
:1021A000039AC9B2002A06D06A1E9446117093425F
:1021B00007D107B0F0BD6A1C9446059A2970944572
:1021C000F7D0083E240A6546D4E7F8B58668436828
:1021D000050000205C003419023CA31C9E4206D37B
:1021E0002B78DB0702D580231B06C018F8BD8F2192
:1021F000C905F8F7F7FB071C2088F8F71FFF391C03
:10220000F8F77EF8E8E7F0B589B007930EAB1B78D6
:102210000F9F0600069114000393381E05D00B0093
:10222000023B1E2B03D90020387009B0F0BD756841
:10223000002D11D13B00002A09D130230370002367
:1022400001300370C01BF0E71A70013401332278AB
:102250001800002AF8D1F0E76D00280004F029F8F2
:102260002A00B168029006F094FD029B04975B1966
:102270000593079B01973A3B07930021059D029B1D
:10228000023DAB4212D93031392901D9079BC91817
:10229000019B5D1C1970029B059A93420ED3039B10
:1022A000002B2BD001231EE00195E6E728880904C6
:1022B00008430699F7F7C2FD2880E0E71A88002A4C
:1022C0000DD10233E8E7013802781A7001331FE0BC
:1022D00011781878013B10705970013223E0039B8C
:1022E000002BE1D00023049AAA1A032A04D1019AF0
:1022F0000399951C51700495002BD5D0029804F0D9
:1023000007F8002C07D0200006F0B3FD2B002018A2
:102310001D00A042D7D83378DB0702D52D232B70C0
:1023200001353A006B1E9A42D2D30023E81B2B7072
:102330007BE730B5884213D20378303B092B0FD8A6
:1023400000230A251360136804786B43303C1B1983
:1023500001301360814203D00378303B092BF2D95E
:1023600030BDF7B51E00009001920025994215D3AB
:10237000CC1A089B2F00AB4201DD27002C00009BEC
:1023800032001D190199280006F0F4FC002805D040
:10239000BC4202D0089BE418F1E700252800FEBDEE
:1023A000F8B50600102015000F0003F082FF0400AE
:1023B00006608560002F0FD029003800EEF72CFB57
:1023C0006060681C03F075FF2A00E06039000600B9
:1023D00006F0DFFC002373552000F8BD10B5002384
:1023E0000122DEF7C9FE10BD012210B500235242C2
:1023F000DEF7C2FE10BD012310B51A00DEF7BCFEE9
:1024000010BD012210B513005242DEF7B5FE10BD1B
:1024100010B50A0001000220DEF76CFF10BD10B5F8
:102420000A0001000020DEF765FF10BD10B50A00AC
:1024300001000120DEF75EFF10BDF0B50C0095B085
:1024400004280AD1C868E0F719FB002802D12068E7
:1024500015B0F0BD0690002802DA01235B42069316
:102460002068E0F723FA05006068E0F71FFA07909C
:10247000A84202D06068DEF7B7FCA068E0F716FA61
:10248000079B834201D0A068F5E70DA92068DEF71D
:1024900099FD0EA909906068DEF794FD0FA90B90D5
:1024A000A068DEF78FFD0E9B0D9A0A9000269342DE
:1024B000CDD80E9B0D9F002B5BD1002E04D00F9A20
:1024C0000A99300006F065FC0F9B039301230493E7
:1024D000099D26E0089F7B425F41059BDB19059320
:1024E0005F1B002E05D0039B3A00F018290006F070
:1024F00050FC039BDF19002E04D0F0190F9A0A99A3
:1025000006F047FC0E9A0F9B9446FB180393059B1D
:102510000D9A63441D00099B9F18049B7F1B013388
:102520000493049B069A93420ED0002F0CD00E9B6E
:102530000B9A08930123390000932800089BFFF7AA
:1025400010FF05900028C5D1002E05D0039B3A004E
:10255000F018290006F01DFC039BF918002E0CD181
:10256000049B002B00D172E710A804F0DDFD129E41
:102570009FE7002304930393AAE710A90798DEF7C7
:10258000B1FC65E7F0B50D0089B003A9070028008C
:10259000DEF718FD00240600039904A804F0C4FD2A
:1025A000069B0193039BA34207D82800E0F77EF91E
:1025B00004A9DEF797FC09B0F0BD305DB847019B78
:1025C00018550134EEE713B50C00012A09D101A911
:1025D000DEF7F8FC019B2060636042230020A360CB
:1025E00016BD00230B604B60013B8B600120F7E7B9
:1025F00013B5040001A98068DEF7E4FCE3680199E3
:10260000020000208B4205D2D25C0130520001331F
:102610001043E36016BD07B501A9DEF7D3FC0199AD
:10262000EEF74AFAC300062018430EBD704710B5F6
:10263000E0F73CF9406803F09DF910BD10B5830741
:1026400002D003F03DF810BD002803DB0123400059
:102650001843F8E703F04FF8F5E7704770B504004A
:102660000D001600E0F722F9C36A181E06D03200EA
:1026700029002000984743425841C0B270BD02284B
:1026800003D149000138084370470020FCE7704738
:1026900010B50C00022103F09FFD002802D0047049
:1026A000240A447010BDC36910B50400002B04D087
:1026B000B02109021943FFF7EBFFBD21A36909020D
:1026C00019432000FFF7E4FF10BD70B50D00042191
:1026D000140003F081FD002805D0057084702D0AD8
:1026E000240A4570C47070BD10B5DB001143194356
:1026F000FFF7CEFF10BD10B5072A09D8D200072971
:102700000CD80A438C21C9011143FFF7C1FF10BD4A
:1027100013004022083BDB001A43F0E7802308390E
:102720001943EEE74369890070B5CC58E0210500F4
:1027300043680902E41A043C23055B0D1943FFF7C3
:10274000A7FF2B680120022B07D1E40AE40204D082
:1027500080231B01E4186042604170BDF8B51D0084
:1027600043699200D45843680600E41A043C63109D
:10277000002D16D10A02D021FF27090211433B4048
:102780001943FFF785FF012332681D00022A05D196
:10279000BC4303D00134FF34654265411D4028002D
:1027A000F8BD802080228001204012021B050243D8
:1027B0001B0D1A438B01F021802009021943C00030
:1027C000A312034024031943A40E21433000FFF752
:1027D0007CFFE4E74369F822890070B5CC58F0210A
:1027E000050043681202E41A043C63109BB21A43CA
:1027F00063025B0D09021943FFF767FF2B68012095
:10280000022B07D1A40DA40504D08023DB03E41818
:102810006042604170BD10B5022901D104F05FFD36
:1028200010BD10B5040006F024FB01002000E0F705
:1028300049FEFF38431E9841400010BDFEE7704737
:10284000F0B585B000AFBB605B009B185C1C786086
:102850003960FA60A400042B20D823006A460E33A6
:10286000DB08DB00D31A9D4600266D4628003B6836
:10287000221F08C0B96A06F08CFAF9682B000131F2
:10288000BA687868EAF77CF80400002E02D03000BD
:1028900003F03EFD2000BD4605B0F0BD200003F072
:1028A00015FD051ED9D00600E0E707B5009313001B
:1028B0000A0081684068FFF7C3FF0EBD10B5F3F74B
:1028C000B3FC43000120184310BD8023F0B55B0525
:1028D00087B01D69E0F7B8FC037805AFFD2B19D16F
:1028E000E0F7B2FC03783B70E0F7AEFC0400E0F7E1
:1028F000B7FC00950290029B9C4218D1200002F088
:10290000B2F8012239002000ECF778F8E0F706FD74
:1029100007B0F0BDE0F7A4FC03783B70E0F7A0FC43
:102920000400E0F791FC6B4202900093E3E7009B08
:102930002000E61802F097F8200002F094F88023B7
:1029400035005B051B69009ADB09DB01B21A9B1994
:1029500001920393039B34009D42CCD02B78002B33
:1029600004D0802229000198ECF748F8019B8035BB
:1029700080330193EEE770B5050006F07AFA002384
:1029800001001A002800E0F7D1FD041E05D0280040
:1029900002F0B7FF2100E0F751FF70BD002210B533
:1029A00011001000E0F768FF10BD1FB5022201A959
:1029B000E0F71EFA002201A91000E0F75DFF05B064
:1029C00000BD70B51468012927D9102523000178AE
:1029D000AB4315D1302920D146781039831C3143BF
:1029E000782902D11560181A70BD002C19D16F29F1
:1029F00002D167391160F6E7622910D16039F9E731
:102A00000300082C0FD13029EDD1202243781A433E
:102A100003006F2AE7D1831CE5E7002C01D10A23CC
:102A200013600300DFE7022CDDD13029DBD1202247
:102A300043781A430300622AD5D1ECE713B50400AA
:102A40004068EAF7F5F800280BD0A3680190591CFC
:102A5000A16001215B000B43022069460093E3F76C
:102A600009FE16BDF8B507000C201D000E0003F08E
:102A700020FC0760040000212868EAF777F860600E
:102A80000020012E02D96868DFF7F8FFA06020005F
:102A9000F8BD10B5102003F01EFC07220378934305
:102AA0001A0001231343037010BD70B5040023788E
:102AB00008005B07150061685B0F052B0BD12368CD
:102AC000E268D802400DF2F7D1FF23889B0601D5BA
:102AD000EEF704FE70BD0A00A3682900F2F798FF24
:102AE000F3E770B50C0080214900214015000A1E53
:102AF00001D06A682968FFF7D8FF0223E2091A406B
:102B00009A40E1B2AA18EEF7DFFA70BD70B5038CF7
:102B1000046B032B03D10023C56A9D4205D18B00B2
:102B2000E25003F065FB012070BD9E00A65996425D
:102B300001D00133F1E70020F6E710B50400FFF7FC
:102B4000B2FD2000FFF7A3FD10BD8BB270B50500EC
:102B50000C0003844262032B05D1C36A00219A0052
:102B6000006B06F032F9043C6142614128000131FA
:102B700003F019FB28000021E0F746F970BD70B59D
:102B8000060034200D0003F094FB040020220021F5
:102B900006F01BF92900200003F0F2FAA662E562B4
:102BA000A80003F086FB2063200070BD10B5040070
:102BB000006B03F0ADFB0021200003F0E9FA2000D8
:102BC00003F0A6FB10BD10B54368984710BDF82070
:102BD0008023800202785B051B694D2A01D1C01A4F
:102BE00070478020C002FAE730B5010003687F25F6
:102BF00000201A78C001140052B22C402043013347
:102C0000002AF6DB0B6030BD07B5019001A8FFF785
:102C1000EBFF0EBD0023C3560130002BFADB7047DB
:102C200010B5E2F7BDF8E6F77DFDE2F7F7F800280A
:102C3000F9DB10BD73B5050001A98068DEF7C2F9A4
:102C4000EB68019A0400002093420CD2E4182000A3
:102C500000F034FB061B310001222000DEF778F97A
:102C6000EB689E19EE6076BD836870B55D1C04004C
:102C700085604068E0F774F8DFF700FF854201DB0C
:102C80000023A3600121A36804225B00194360684C
:102C9000E0F77CF870BD4123012800D00023180024
:102CA0007047202304304B60423308608B60002063
:102CB0007047A021037802000020C133FF33C9050B
:102CC0009B005850012318000138C046C046C0463A
:102CD000C046C046C046C046C046C046C046C046C4
:102CE000C046F1D1A220C00008581278D040184048
:102CF000704710B50120E2F79FFD10BD022310B50B
:102D000084171C40013B1C1B802342021B04520AF7
:102D1000C0151A43C3B2963B5918002903DD8A40F7
:102D20002000504310BD0B0000201F33FADB494246
:102D30000A41F5E707B508001100002200921300D0
:102D4000EFF7BAFAE2F73CFF0EBD10B50021E9F744
:102D50000DFF10BD3E2307B50022019069460220F9
:102D60000093DFF7CDFB0EBD10B50A0001000C206B
:102D7000EAF734FB10BD10B5020036210A20EAF74D
:102D80002DFB10BD10B502002E210A20EAF726FB0C
:102D900010BD30B5012485B00B00A04200D04C68B6
:102DA00069461868E9F7E2FE05002800E9F740FFE8
:102DB000021E02D1200005B030BD21000520EAF737
:102DC0000DFB0400F1E710B501000220E9F766FDF4
:102DD00010BD10B51A23E3F721F910BD10B5192362
:102DE000E3F71CF910BD10B58468C3686168020080
:102DF00000208B4204D2991C890001330859D3600A
:102E000010BD10B50C68020020000B00083061688E
:102E1000EEF7F2FD10BD030010B50A000830596846
:102E200002F053FF10BD436808300B60106070471C
:102E300010B503F06DFA10BDFC30C160026170473F
:102E4000002370B504001D007F26AA00A218FF32DF
:102E5000517C7F2906D102339B0019552000EDF7E4
:102E6000F5FB70BD0135EDB27E2907D102339B0021
:102E70001E552000EDF7EAFB0023E6E70029E4D029
:102E8000980020180172917C01334172D17CDBB231
:102E90008172127DC272D8E710B5E5F7DDFF0368D5
:102EA0000620DB00184310BD10B5EAF7DFFD02F085
:102EB00007FC10BD10B5E4F7B9FA407910BD4368BE
:102EC000F7B50500980003F0F4F9002607006968DB
:102ED000B14205D83B000022A868E9F751FD0BE09C
:102EE000B3000193EB18D868E9F7A2FE041E04D1E1
:102EF000380003F00DFA2000FEBDB300F850013693
:102F0000E5E710B500220400A05C8B5C002808D126
:102F1000584258410123184010BD98420AD101324D
:102F2000F2E7002BF9D1E5F7BBFB03000120584085
:102F3000C0B2EFE70020EFE770B50500080004F02D
:102F400030F9FFF718FD0400280000F06FFA0121A6
:102F5000020003002000EAF7F1F970BD07B5F42183
:102F60006A46FF31E9F784FD0098431E9841C0B2DC
:102F70000EBD10B50222E4F7EFFD10BD10B5012221
:102F8000E4F7EAFD10BD13B513000C000A1D411E45
:102F9000002000902068E4F717FE16BD13B513005B
:102FA0000C000A1D411E012000902068E4F70CFE71
:102FB00016BD73B50C00050001CC1600E4F7B2FE97
:102FC0000023691E009322003300E4F7FDFD76BD67
:102FD00073B56B46DE1D32000D00040000F0B8F83A
:102FE00033780100002B03D02A00200000F0DBF82A
:102FF00073BD37B56B460400DD1D2A0000F0A8F84C
:103000002A782378002A06D0012B02D902230370E4
:1030100037BD0023FBE7012BFAD90378002BF7D14A
:103020000233F4E770B505000E00100019001C0013
:1030300000F07EF80378002B04D1B368210028004B
:10304000984770BD012B01D1F368F7E74288022B46
:1030500004D13368210028009847F2E77368F9E744
:1030600010B50C00F6F7D4FF002903DA002C05DCBC
:10307000080010BD0029FBD0002CF9DA0919F7E788
:1030800010B5002806DB002901DACB43C018F6F79B
:10309000D9FE10BD0029FADB401A0130F7E710B560
:1030A00044680C6081681160C2681A6010BD10B578
:1030B000DFF748FDFAF70EFAE9F762F910BD10B52F
:1030C000DFF740FDFAF734F8E9F75AF910BD10B50B
:1030D000DFF738FDF9F7A0FFE9F752F910BDF7B5B2
:1030E00006004068041E13D00021E3F7C3FA002550
:1030F00004007368AB420BD9AB000193F3189868D6
:10310000E9F796FD071E05D12000FFF791FE3C0070
:103110002000FEBDAB00E31898600135E9E710B56B
:103120000400806A03F0F4F8200003F0F1F810BD09
:1031300030B500230400858C9D4201D8002030BDAD
:10314000A06ADA00801842688A42F8D00133F3E7B7
:1031500070B504000E001500FFF7EAFF00230028F9
:1031600016D1618CA38C8B4208D30631C900A06AAA
:1031700003F0BDF8638CA06206336384A38CA06A5D
:103180005A1CDB00C0180023A28403604660013390
:103190002B7070BD10B54368002B02D1FFF7C8FF3C
:1031A00010BD1800F7E7F7B544680E001700231E9E
:1031B00008D10023337004E00378022B01D10133DE
:1031C0000370F7BD5D68002DF3D018003900FFF7DC
:1031D000AFFF2B000028F5D00378023B022BE8D884
:1031E000042535706B46DE1D320039002000FFF7E4
:1031F000AFFF3378002BDFD005706468F2E710B5BD
:103200001300C4680022A04710BD002210B51100B1
:10321000FFF7F5FF10BD07B5019101AA0121FFF7E6
:10322000EEFF0EBD10B5E5F73DF910BD10B5DFF7A7
:103230003DFBE5F77DF910BD70B504000D00FFF70B
:10324000F5FF002803D02000DFF730FB0400290041
:103250002000E8F741FD70BD8368C268934203D245
:103260005A1C82601878704701204042FBE70368CF
:1032700010B50400002B02D0406803F049F820008C
:1032800003F046F810BD10B503785AB2002A0BDAE5
:103290007F2213403F3A1A4208D13F210130027881
:1032A00014008C43802C04D0180010BD93435208A6
:1032B000F1E79B010A4001301343F0E73F22013060
:1032C00003789343802B00D070470130F8E730B586
:1032D00000223F24814201D8100030BD01390B7813
:1032E000A343803B5D1EAB41D218F3E730B502002B
:1032F00041183F2400208A4200D330BD13780132A8
:10330000A343803B5D1EAB41C018F4E710B5040039
:10331000E5F7D6F9002800D02034200010BD10B504
:103320000400E5F7D9F9002800D0203C200010BDAA
:103330003038092802D92023984307387047F0B560
:10334000070085B00E0000680968FAF753FA3B6879
:103350003568011C041C181C0293F7F775FC291C26
:10336000F7F768F900210190201CF6F7A1FE00286C
:1033700017D00024002D01DA8024240600210198B2
:10338000F6F796FE002833D0291C0298F7F752F979
:103390000025002801DA80252D063D60346005B047
:1033A000F0BD01236A4600219373201CF6F786FEC8
:1033B000002801D16B46987301236A460021D3731C
:1033C000281CF6F77BFE002801D16B46D8736B46AC
:1033D0009A7BDB7B9A42D1D0291C201CF6F790FF08
:1033E000FE21041C89050198F7F72EFC0190C5E722
:1033F0000198F9F79DFE011C051C0198F7F724FCC4
:10340000FC218905F6F76EFE0028C6D0FE21281C97
:103410008905F6F775FF051CBFE7FF23DB05C91813
:10342000032310B59943E5F725FA10BD40687047AE
:1034300010B504004160002903D18160012323609D
:1034400010BDC80002F047FFA060F7E7CB00416065
:10345000072110B5046882602140194307230160E9
:103460001943017010BD037810B504009B0702D406
:10347000806802F04DFF0722236800211A400123D3
:10348000226013430222934361602370A16010BD48
:10349000002310B5040001604360880002F01BFFA8
:1034A000A06010BDF0B5036887B004000E00029262
:1034B000002B04D11300DB0761D5E5F79DFC31003B
:1034C0000220E9F7EBF94310180021680593F6F79D
:1034D000B5FC00270391039B0193019B9B00049380
:1034E000049AA3689B181D68002D0BD1029AD2077D
:1034F00045D5002F00D03B006268013262601E603B
:10350000350031E0042D16D1002F00D11F000198A5
:1035100021680130F6F792FC039B01918B42DCD1CC
:103520000122029B13422AD0002F22D063689B18ED
:1035300063603E60E4E731002800DFF74DFA0028C1
:10354000E5D0029B9B070FD563680198013B636040
:10355000A768049B01302168FE18F6F76FFC89000C
:10356000CB59002B03D13360280007B0F0BD0423F2
:10357000F9E72000E5F740FC21680598A7E700255A
:10358000F2E7002370B50168994201D1002513E0EC
:1035900086689C00341925680133002DF4D0042D71
:1035A000F2D04268013A42601800F6F747FC890001
:1035B0008B59002B02D12360280070BD0423FAE749
:1035C00010B50400806802F0A3FE0023236063604E
:1035D000A36010BD704710B54079EAF7D5FA10BD69
:1035E00013B5040008001100002200921300EEF74A
:1035F00063FE042002F05DFE046016BD70B5040099
:103600000D00002201794020F1F780F8E3682B607B
:10361000A3685843686023790020AB6070BD41689F
:1036200070B5C2688C6803000020A24207D29C6873
:10363000551C08791219C968DD60F1F7CFF870BD23
:1036400073B50E0000251C0011000223012230007A
:103650000095EEF731FE2068DEF7BCF80078012E09
:1036600003D12900E5F7CCFD76BD6168E5F788FE5A
:10367000FAE7F7B51D0000260223070000960800B0
:1036800011001A00EEF718FE0C2002F012FE07607F
:103690002B680400436031006868E9F767FAA060AE
:1036A0002000FEBD10B50400E5F7E6FF2000602114
:1036B00005F0F6FA200010BD10B5040005F0D9FBA6
:1036C00001002000E6F746F810BD10B505F0C2F97C
:1036D00010BDD0B5041E0FD0F2F7A6FD06000F00F6
:1036E000F2F7A2FD801BB941002905D1844203D91C
:1036F000F1F7ACFF30BFF3E7D0BD10B5F6F758FADD
:1037000010BD10B5F2F790FD10BD10B501242300D7
:10371000884202D00278534253412340180010BD22
:10372000037842780A3B1B02134302300B60704758
:10373000838BC26A01339BB28383118C994200D27E
:103740001384704770B505000C00100019002A683A
:10375000049BE4F7E1FDEB6AA4004360AB6AE05030
:1037600070BD13B50400080001A9FFF7D9FF019946
:10377000206B01F0ADFB13BDF0B587B005000C0068
:1037800004920593002B03D008230A7D13430B7585
:10379000049B6383EB6A1B78002B39D1059B049A49
:1037A0002100286B01F089FD07B0F0BD926AF3009B
:1037B000D31803931B78033B012B19D8002312E085
:1037C000029BA26ADB00D3181A78042A09D1039A53
:1037D0005B685168994204D15288286B01F025FA40
:1037E0000137029B01330293029AA38C9342E7DCD8
:1037F0000136EA6A938CB342D8DC002FCED0059B09
:103800003A0000932100049B286B01F06BFDCBE78D
:1038100000263700EDE773B51D000B781A3206005D
:10382000080093420ED101A902F0F0FB019B0400B5
:10383000984200D173BD30002100A847200002F05B
:10384000DBFBF3E7002BF5D03000A847F2E730B5FB
:10385000040085B0080003A902F093FB637905001A
:10386000012B08D1E36A02225B7D039900930300D8
:103870002000FFF767FF039BA06A990009584823BF
:103880002A002000E5F7E0FF05B030BD7FB5040059
:10389000080003A9160002F074FB63790500012BF0
:1038A00006D103000096072203992000FFF74AFF84
:1038B000280002F0A1FB039BA16A9B005D58020057
:1038C000402320002900E5F7BFFFE88904B070BD60
:1038D00070B5040008000D0002F08EFB010020000E
:1038E000E5F7F2FF29002000E5F7EEFF70BD10B507
:1038F0000400E5F7E9FF206B01F012FB10BD10B5E5
:103900000400E5F7E1FF206B01F041FB10BD70B54D
:1039100005001400A14200D170BD2800E5F7D4FFD6
:103920000100F7E710B50400FFF7F1FF0B21206B52
:1039300001F022FC10BDF0B5040085B008000F00B6
:10394000150002F059FB02F05CFB03A902F019FB21
:1039500063790600012B08D1E36A2A005B7D039995
:10396000009320003B00FFF7EDFE039BA06A990047
:10397000002309581A002000FFF7FEFE300002F075
:103980003BFB01002000E5F79FFF062D03D100213E
:10399000206B01F090FB002301211A00206B01F045
:1039A000BCFC05B0F0BD70B504000D0016009142DE
:1039B00005D10E21006BEBF795F9022113E00B788E
:1039C000AE2B14D1006B0E21EBF78CF9280002F01E
:1039D00058FB0028F1D1280002F013FB0100200061
:1039E000E5F772FF0321206B01F026FC70BDAF2BC1
:1039F0000CD1080002F005FB01002000E5F764FF90
:103A000002F0FFFA01008642E9D1D6E7E5F75CFF54
:103A1000D3E770B50D00160004000E21006BEBF724
:103A200061F9320029002000FFF7BDFF70BD70B5BD
:103A300015000400E5F748FF02F0E3FA2A00010050
:103A40002000FFF7B0FF70BDF8B500240500160098
:103A50001F00A14202D0E5F737FF0134BE4204D176
:103A6000286B210001F0AAFBF8BD31002800E5F722
:103A70002BFF0600F1E710B513000A000021FFF745
:103A8000E3FF10BDF8B5050016001F00E5F71CFFA9
:103A90000400B44200D1F8BD21002800E5F714FF6E
:103AA00039000400286B01F067FBF2E710B5022330
:103AB000FFF7E8FF10BD10B50123FFF7E3FF10BDCE
:103AC00010B50023FFF7DEFF10BD10B50400E5F7C9
:103AD000FBFE0621206B01F042FB10BDF7B5040090
:103AE0000D00170006690193731C0361BD4204D1E8
:103AF0003100206B01F045F9F7BD29002000E5F702
:103B0000E3FE05008742F1D032000199206B01F0FD
:103B100092FAEBE710B50023FFF7E0FF10BD10B5F8
:103B20000123FFF7DBFF10BDF7B50D000400110006
:103B3000280002F055FA290007002000E5F7C4FE2E
:103B4000002306000193032F03DD23690193013352
:103B5000236101230093009B01339F421BDC032F51
:103B600018DD2569206B6B1C2361290001F046FAE2
:103B70000199206B01F005F90121206B01F047F854
:103B8000206B01F00FFA206B01F001FA2900206B85
:103B900001F0F7F8F7BD3378012B33D17078B11C01
:103BA00036380B282CD8F6F7AFF83C2B062B2B2BEE
:103BB0002B2B252723291A252000E5F785FE009BBE
:103BC000060002330093BB4205DA206B01F0CBF90B
:103BD000206B01F0FEF92900206B01F0CDFA009B6B
:103BE000BB42B8DA019A0021206B01F024FAB2E757
:103BF0001B25E1E71C25DFE71D25DDE71E25DBE7AB
:103C00001F25D9E72225992B06D0300002F039FA7A
:103C1000023D002800D10335300002F0EDF901002B
:103C2000CAE71925C8E710B5C36A04005A7DFFF733
:103C30002DFE01002000E5F7E9FE10BD37B50400B8
:103C4000080001A9256B02F092F9019B226A9B00F2
:103C50002800995801F01DF937BD1FB504002368ED
:103C60000800002B0BD1002909D00B78192B06D99D
:103C700003AB02AA01A902F0F0F9029B23601FBD69
:103C8000F7B504000D001700914203D31100E5F7CA
:103C90001BFEF7BD0669731C03610B78902B27D1BF
:103CA000080002F0AEF901002000E5F70DFE31003A
:103CB0000190206B01F0D0F9002201992000E6F775
:103CC000BBF8280002F098F905002000FFF730FD4E
:103CD0003A0029002000FFF7D3FF206B310001F0EC
:103CE00019FAA38B206B013BA38301F0D9F9D0E72C
:103CF000E5F7EAFD31000500206B01F0ADF9206B1E
:103D000001F045F9E1E713B50400019101A875211F
:103D100002F08BF9019902002000FFF7B1FF13BDFB
:103D20007FB50400080003A9150002F02AF96279A2
:103D30000600012A05D10300009503992000FFF732
:103D400001FD206B01F0E2F8039BA26A9B009D58E5
:103D5000002329001A002000FFF70EFDE989206BDF
:103D600001F08BF8300002F047F903780100B82B1E
:103D700000D10021200002230022E6F743FBE8895E
:103D800004B070BD10B5C36A04005A7DFFF7C8FFC8
:103D900001002000E5F73AFE10BD91429241002358
:103DA00010B511401A00E6F72DFB10BDF0B5040068
:103DB000056985B003936B1C03610E00006B29003D
:103DC000170001F061F92000FFF7B2FC002F26D1A7
:103DD0000321206B00F01BFF31002000E5F774FD8C
:103DE0000321206B494200F012FF206B01F088F99B
:103DF000206B0E21EAF776FF2900206B00F0C1FF4F
:103E00000B9802F0FEF801002000E5F75DFDA38BA2
:103E1000206B013BA38301F043F905B0F0BD0A9B81
:103E20003A0000933100039B2000E6F799FCDCE7A1
:103E3000F0B5060087B008000D0002F0DDF8039031
:103E40000378FD221C00763414400CD1722103A8A3
:103E500002F0EBF80300039A009429003000E6F723
:103E60007FFC07B0F0BD892B1ED104A902F0CEF86B
:103E70007221059005A802F0D8F8040002F0BCF801
:103E8000049B984203D100942300059AE5E7059F1F
:103E9000200002F0B1F823003A00019000942900BC
:103EA0003000FFF783FFDCE700220190009213004F
:103EB000F5E710B54B234A22E6F758FE10BD10B5C2
:103EC00043234222E6F752FE10BDF8B50D00040070
:103ED000110028001600FFF718FC0021002835D13A
:103EE0002B78A62B34D1280002F08BF8050002F0C5
:103EF00083F8027813005733DBB2012B15D802F098
:103F000080F8070029002000E5F7DEFC20003200E1
:103F10003900FFF7FCFC31003800246B02F060F838
:103F2000411C200001F057F906E0C12A05D1BE3A34
:103F300029002000FFF7FFFCF8BD29002000E5F76D
:103F4000C3FC01002000E5F7BFFC0221206BE9E77C
:103F500029002000E5F7B8FC0121F7E7F8B50D00CE
:103F60000400110028001600FFF7CFFB071E06D043
:103F700000231A0019002000FFF766FD18E0280052
:103F800002F03FF8050002F037F8027813005733CB
:103F9000DBB2012B05D802F034F83300020029000F
:103FA000E9E7C12A05D1BB3A29002000FFF7C3FC8D
:103FB000F8BD33002A003900DDE770B54D780231D5
:103FC0000400E5F781FC2F2D04D10321206B01F0C3
:103FD000C6F870BD206B0421302DF8D00521F6E71E
:103FE00070B50D00040011002800FFF78EFB0021C2
:103FF00000280ED12B78742B0FD1280002F001F885
:1040000001002000E5F760FC01002000E5F75CFC02
:104010000221206B01F0A1F970BD29002000E5F715
:1040200053FC0121F5E7F0B5060087B00D00140040
:10403000002906D101212160306800F0B2FE07B0EE
:10404000F0BD00220B7801927E2B0CD1080001F00C
:10405000D8FF050001F0D0FF2100FFF761FB002D24
:10406000E8D0012301932B78002BE3D00A3B0F2BE0
:104070000AD805A92800FFF753FB019B002B01D1AB
:10408000059B23600599D7E7280002A901F0BEFF30
:10409000019B0500002B02D12100FFF741FB012409
:1040A0002F006442029B9F4223D1200003A901F00C
:1040B00031FC2F000400029B9F4225D1039801F0A0
:1040C00034FC0100306800F06CFE019B002BB6D080
:1040D000280001F091FF0400029B9C42AFD005A98B
:1040E0002000FFF71DFB05990400306800F0F0FE8A
:1040F000F2E705A93800FFF713FB0700059801F068
:1041000034FC01342418CDE7BD4202D22E232370A3
:10411000013404A93800FFF703FB05A90700049840
:1041200001F02DFC059A0100200004F032FE059BF1
:10413000E418C0E737B504000D00006B002100F063
:1041400054FE206B0E21EAF7CDFD2000290001AAC4
:104150003030FFF768FF01992000E5F757FC37BDC5
:1041600010B50278012A05D143780F3B58424341EC
:10417000180010BD0023032AFAD101F011FF03003B
:10418000581E8341F4E710B50278012A05D143781F
:104190000D3B58424341180010BD0023032AFAD1B9
:1041A00001F0FEFE43424341F5E7F0B5040085B05F
:1041B00008000E0015000093FFF7E5FF002809D066
:1041C000002D03D10099206B00F018FF300001F0A2
:1041D00013FF4FE03000FFF7C3FF002802D0002D8F
:1041E000F4D0EFE73378192B4ED903A9300001F052
:1041F0000DFF33780700362B2ED1002D28D1012654
:104200002369019301332361380001F0F5FE039B1C
:1042100098420DD13900009B2A002000FFF7C5FF0E
:1042200001990600206B00F0ACFD300005B0F0BD38
:1042300032003900019B6A402000FFF7B6FF0700FB
:10424000E2E73900009B2A002000FFF7AEFF0700DD
:10425000039EB742F5D1E8E7372B02D1002DF7D006
:10426000CDE7382B08D1012201006A40009B2000D5
:10427000FFF79BFF0600D8E7442B05D1300001F083
:1042800000FF0028ABD09BE731002000E5F71CFBC6
:10429000009A06002900206B00F0BCFEC5E7F0B5CF
:1042A00004000F00066987B00293B31C036131005C
:1042B000006B751C039200F064FD2900206B00F078
:1042C0000DFF002239002000E5F7B6FD380001F0AF
:1042D00093FE01F091FE039B834221D102992000BD
:1042E000E5F7F2FAE36A1978062912D1206B01F09A
:1042F00042F8206B00F04BFE3100206B00F07EFE98
:104300002900206B00F03DFD206B00F0F3FE07B0AC
:10431000F0BD0C9B206B9A00053200F09AFFEBE792
:104320000378C22B09D103A901F070FE330001000C
:1043300000222000FFF739FFCDE705A901F066FE56
:1043400001F05AFE070001F057FE01002000E5F7DA
:10435000BBFA206B012100F0AEFE0C9B059A0133E5
:1043600000933900029B2000FFF799FFC4E7F7B5DF
:10437000040008000F0001F03FFE01F042FE256935
:104380000022AB1C0100236120002B00FFF70DFF72
:104390006E1C390001902000E5F796FA3100206B81
:1043A00000F02CFE2900206B00F0EBFC0121206BBB
:1043B000494200F02CFC01992000E5F785FA310014
:1043C000206B00F0DEFCF7BDF0B589B00792038BDF
:1043D00007690493438B7E1C0593C38B0783069365
:1043E000BB1C0361838B4683C383040008000D005C
:1043F00001F002FE029001F0FFFD03902800FFF79C
:10440000C2FE00281ED123692800019301332361D5
:10441000FFF7A6FE002803D13100206B00F0EEFD6F
:104420000199206B00F0ADFC02992000E5F74CFAF1
:104430003100206B00F0A5FC019B01222900200027
:10444000FFF7B3FE049B079A2383059B6383069BB8
:10445000E383039B934203D019002000E5F734FA6D
:104460003900206B00F08DFC09B0F0BDF0B5040000
:10447000256985B06B1C0800236103910092FFF74A
:1044800082FE071E1FD0039801F0B6FD039001F0D5
:10449000B3FD0390039B009A93420ED06C2103A8B6
:1044A00001F0C3FD07000398B8423FD1009B9F4233
:1044B00003D039002000E5F707FA2900206B00F04F
:1044C00060FC05B0F0BD26690398731C2361FFF7FB
:1044D00047FE33003A00019003992000FFF765FE84
:1044E000010003902000E5F7EFF9019B070003901E
:1044F000002BE2D10099FFF708F9002809D1206BC1
:1045000000F080FB00280CD12900206B00F076FD24
:1045100007E0380001F070FD0099FFF7F6F8002879
:10452000EDD03100206B00F02CFCB3E701F069FD09
:104530000390FFF728FE0190002807D0039801F0B0
:104540005BFD039001F058FD0390ACE726690398EA
:10455000731C2361FFF704FE33000290019A039954
:104560002000FFF722FE010003902000E5F7ACF9E0
:10457000029B0390002BA0D1206B00F043FB00288E
:1045800003D12900206B00F039FD3100206B00F0D1
:10459000F8FB88E7F0B589B003910B7804000D00B3
:1045A000012B01D07B2B38D107950025612107A86D
:1045B00001F03BFD002607000798B84238D1039868
:1045C00001F01AFD220003900778303203000192B7
:1045D0003100012F03D15B78206B312B35D0206B5C
:1045E00000F003FC662103A801F01FFD0027039ED5
:1045F0000290029B9E423CD33900206B00F0DEFD0E
:10460000290004AA0198FFF70EFD039D029B9D421D
:104610003FD3206B00F0BBFC29E00026782BCED1E5
:10462000080001F0EEFC079001F0E6FC0500BDE794
:104630000378012B07D143784A2B04D1013601F0CE
:10464000DBFC0790B8E70336F9E700F0CEFB022168
:10465000206B00F012FC3900206B00F0AFFD0198D8
:1046600007AA2900FFF7DFFC206B00F0B3FB09B0BD
:10467000F0BD300001F0C5FC07A9FFF751F807991C
:10468000206B00F0FAFB300001F0B6FC01370600A9
:10469000AFE705A9280001F0B9FC06A9FFF740F82B
:1046A00006990500206B00F089FB059B0699AB423B
:1046B00005D007A92800FFF733F805000799200067
:1046C000E5F7A4F9A2E7F0B5062514001268CB00BF
:1046D00006008BB00F0004301D43002A29D12900A9
:1046E000E4F74AFA002802D0436823601FE005ABD4
:1046F0001874079031681800059606970894E6F735
:1047000045FF23680193002B11D1F22149008F420C
:104710000DD002AA3000E8F7ABF9029B002B06D0BF
:1047200002AA01990120049500F048F920600BB01D
:10473000F0BD6668002E07D102222900E4F71CFABA
:104740000028F4D00023D0E701222900E4F714FA6E
:104750004660F7E737B51D000023009301330400DE
:10476000080011001A00EDF7A7FD082001F0A1FDD7
:104770002B68436004603EBD37B51C0000230093E6
:1047800002330500080011001A00EDF795FD0C201A
:1047900001F08FFD236862680560826043603EBD62
:1047A00030B51400126887B0002A0CD101AB01901B
:1047B0000291039201000132180004941A74E6F782
:1047C000E5FE07B030BD806B0028FAD0CB00062193
:1047D000656804301943002D06D10222E4F7CCF9B4
:1047E0000028EED02560ECE70122E4F7C5F90028A7
:1047F000E7D06368436000232360E2E7F0B58BB045
:1048000003AD04000191170000210822280004F0E4
:10481000DCFA2C2305A88360012600232168037499
:104820004660C5600594E6F7B1FE039B3000042B9B
:1048300007D12069DEF73AF83A00C36A0199206986
:1048400098470BB0F0BDF0B589B001AE0400082266
:104850000F003000002104F0B8FAF523002503A86A
:104860005B004360C73BFF3B21688360C660057403
:104870000394E6F78BFE019B1800AB4208D0042B93
:1048800008D12069DEF712F83900436A2069984799
:1048900009B0F0BD32002900280000F08FF8F7E7DA
:1048A00010B5EE24002288B0640003AB01A9049483
:1048B000CD3C03900691FF3C016818001A740192E8
:1048C00002920594E6F762FE0198431E9841C0B239
:1048D00008B010BD10B50C00DDF7E8FF2100E7F7C8
:1048E0002BFA10BD70B50D000400DDF7DFFF2900C5
:1048F000E7F7F2F9031E00D02369180070BDF7B581
:10490000050001911600FEF7F8FE0700A023A22281
:10491000DB05D2009C580123EC401C40019B9C42CB
:1049200010D1FEF7EAFE0700A023A222DB05D20089
:104930009B580122EB4013409C420BD0FEF7DDFE5A
:10494000C01BFEBDFEF7D9FEC01BB042DED3022065
:104950004042F6E7FEF7D1FEC01BB042E4D301208F
:10496000F6E7102230B58DB0069200220392029233
:1049700001920A320B000500009206A907AA08ACB2
:1049800005A80594E7F7B0FD0100280002F081F9C1
:104990000598A04201D001F0BBFC0DB030BD002352
:1049A00010B51A001900E7F7EBFF10BD07B500229C
:1049B000019101AB0121E7F7E3FF0EBD10B5140033
:1049C0005268531E9A4193001018E31A0A000833E4
:1049D00001002068E7F7D4FF10BD07B56A46E8F785
:1049E00079F801990098002900D10EBDDEF7CAFBC5
:1049F000FBE7F8B5FEF71AFD00F053FF00250600AF
:104A00007368AB4200D8F8BDB368EF00DC59002CE6
:104A10000ED0042C0CD0E408200000F0ABFF03788B
:104A20005F2B05D0B3682000DF197968E7F706FF30
:104A30000135E5E710B5002903D1FEF7E6FBE7F7FE
:104A40004DFEFEF7EFFBFAE701204042704770B5DC
:104A50000D000400E9F7A6FE29002000F4F76CF829
:104A6000E9F790FE70BD10B50400E9F79BFE200049
:104A7000F4F744F8E9F786FE10BD802203005205E2
:104A800010690138184043425841C0B2704773B5AD
:104A900014006A46551D0B007F2629002200013DA7
:104AA00032402A70E409F9D18026491B984701ABAE
:104AB000591B76428C4204D16A4612795D1B4255DD
:104AC00073BD2A5D324302550134F3E70300006AE7
:104AD0005A790918032A02D81800196270471A6B0C
:104AE00019621018FAE710B50C000121FFF7EEFF6C
:104AF000047010BD0300806A5A790918032A02D88D
:104B00001800996270475A6A996280181A6B1018D7
:104B1000F8E710B50C000121FFF7ECFF047010BDA1
:104B200010B52821E9F7DAFF10BD10B52921E9F702
:104B3000D5FF10BD70B504001500FFF7EAFF032292
:104B4000A36A042103339343A3622000FFF7D2FF3B
:104B5000056070BD70B543790D000024032B06D9A4
:104B6000836A033CE41AC3699200D358E418032112
:104B7000FFF7C0FF4470240A0570847070BD10B543
:104B8000382001F0A8FB10BD10B504008161880039
:104B900001F08FFBE06110BD10B50400C06901F0A9
:104BA000B7FB200001F0B4FB10BD13B5437904003E
:104BB000012B18D00021FFF796FF6379032B13D147
:104BC000226AD01C9843A36A20626062E362C01824
:104BD00001F081FBE3682063D88A1B8BC01880003A
:104BE00001F079FB606313BD042BFCD1E068636ABC
:104BF000E26A216B9A18037D00930069636BDFF70B
:104C000023FAF0E78079431E9841C0B27047437998
:104C1000012B09D08368C918C3688160DA8B91427F
:104C200000DDD98300238371704770B50121140022
:104C30000500FFF7ECFF0F2C06D821005039C9B250
:104C40002800FFF766FF70BD220019212800E9F750
:104C500045FFF8E770B5150004000121FFF7D7FF05
:104C60002A001A212000E9F739FF70BD70B50D0048
:104C700004000121FFF7CBFF2A001B212000E9F7E8
:104C80002DFF70BD70B50D0004000121FFF7BFFFBF
:104C90002A001C212000E9F721FF70BD012170B519
:104CA000494214000500FFF7B2FF0F2C06D821007F
:104CB0004039C9B22800FFF72CFF70BD2200222125
:104CC0002800E9F70BFFF8E7012170B51500040093
:104CD0004942FFF79CFF2A0023212000E9F7FEFE4E
:104CE00070BD70B50D00012104004942FFF78FFF30
:104CF0002A0024212000E9F7F1FE70BD70B50D00F7
:104D0000012104004942FFF782FF2A0025212000EB
:104D1000E9F7E4FE70BD70B50D0004000021FFF757
:104D200076FF2A002A212000E9F7D8FE70BD70B571
:104D30000D0004000021FFF76AFF2A002B2120004C
:104D4000E9F7CCFE70BD70B505000498C91A44009F
:104D500000021843059B091B0600D4B2002B0AD0A1
:104D600002392800FFF753FF32000134E1B2280076
:104D7000E9F7B4FE70BD2800FFF749FF32002100BB
:104D8000F5E770B504000D000021FFF740FF6379DF
:104D9000012B05D0032B03D8A26AE369AD00EA50CA
:104DA00070BD70B50D00012104004942FFF72FFFCF
:104DB0002A0068212000E9F791FE70BD70B50D0052
:104DC00004000121FFF723FF2A0069212000E9F7F1
:104DD00085FE70BD012110B504004942FFF717FFA1
:104DE0006A212000FFF795FE10BDF7B50C000121E8
:104DF0000500FFF70CFF230010333F2B06D82100DE
:104E00008039C9B22800FFF784FEF7BD14212800BD
:104E1000FFF77FFE6B46053319007F20E2B21700D3
:104E20005E1E0740E4113770671C012F18D8402719
:104E30003A40013416D1002A02D1023B18701E00FC
:104E40002800891B8025FFF755FE002201AB9C1B23
:104E50006D42A2420CD16A4612799B1BC254D4E720
:104E60003300DBE7002AEBD00022023B1A70E6E7B2
:104E7000B15C294381540132EBE770B50D000400A9
:104E80000121FFF7C4FE2A0016212000E9F726FEC3
:104E900070BD70B504000D000121FFF7B8FE2000C1
:104EA0001721FFF736FE0322A36A0421033393433D
:104EB000A3622000FFF71EFE056070BD10B5040060
:104EC0000121FFF7A4FE18212000FFF722FE10BDEC
:104ED00070B50D0004000021FFF799FE2A001D2186
:104EE0002000E9F7FBFD70BD70B50E000121140034
:104EF0005300C91A0500FFF78AFE21004C1EA1418C
:104F0000320028001E31E9F7E9FD70BD10B504003C
:104F10000121FFF77CFE20212000FFF7FAFD10BDE4
:104F2000012110B504004942FFF771FE2121200044
:104F3000FFF7EFFD10BD70B50D00022104004942DE
:104F4000FFF765FE2A0026212000E9F7C7FD70BDA6
:104F5000032110B504004942FFF759FE2721200024
:104F6000FFF7D7FD10BD10B504000121FFF74FFE7C
:104F700030212000FFF7CDFD10BD10B50400022147
:104F8000FFF745FE31212000FFF7C3FD10BD0121D1
:104F900010B504004942FFF73AFE32212000FFF726
:104FA000B8FD10BD10B504000021FFF730FE33211D
:104FB0002000FFF7AEFD10BD70B504000D00FFF737
:104FC0007DFF2000FFF7EEFF29002000FFF7B3FF71
:104FD00070BD10B504000021FFF719FE3421200038
:104FE000FFF797FD10BD10B50400FFF767FF200025
:104FF000FFF7EFFF2000FFF7ABFF10BD70B50D000E
:1050000004000021FFF703FE2A0035212000E9F704
:1050100073FD70BD70B50E000121150049420400FA
:10502000FFF7F5FD2A003621002E00D137212000A0
:10503000E9F762FD70BD70B50E000121150049420F
:105040000400FFF7E4FD2A003821002E00D13921A9
:105050002000E9F751FD70BD70B50D00040002217C
:10506000FFF7D5FD2A003D212000FFF773FD70BD3D
:1050700070B50D0004000021FFF7C9FD2A003F2193
:105080002000FFF767FD70BD70B50D000400002122
:10509000FFF7BDFD2A0040212000FFF75BFD70BD3A
:1050A000012110B504004942FFF7B1FD4121200064
:1050B000FFF72FFD10BD70B50D002B005A1E934158
:1050C00003215B4219400400FFF7A1FD4721002D99
:1050D00000D105392000FFF71CFD70BD70B50D0033
:1050E00004000121FFF793FD2A0043212000FFF770
:1050F00031FD70BD042110B54942FFF788FD10BD98
:1051000010B504000021FFF782FD44212000FFF7C5
:1051100000FD10BD70B504000D00FFF7F1FF200089
:105120000E21E9F7DFFD29002000FFF72AFE20000D
:105130000221FFF76CFD20003E21FFF7EAFC04216D
:1051400020004942FFF763FD70BD10B50400002147
:10515000FFF75DFD45212000FFF7DBFC10BD70B5BA
:105160000C0000210500FFF752FD21003039280016
:10517000C9B2FFF7CEFC70BD70B505000C00222946
:1051800019D00026232901D10136033C0121280032
:105190004942293CFFF73BFDE1B22800FFF7B9FC8B
:1051A000002E07D000212800FFF731FDD62128006E
:1051B000FFF7AFFC70BD01261F24E7E770B50D00B7
:1051C00001210400491BFFF722FD2A005021200085
:1051D000E9F784FC70BD70B50D0001210400491B86
:1051E000FFF715FD2A0051212000E9F777FC70BD7B
:1051F00070B50D0004000121FFF709FD2A005321BD
:105200002000E9F76BFC70BD022110B50400494293
:10521000FFF7FDFC54212000FFF77BFC10BD70B5AB
:105220000D0001210400491BFFF7F1FC2A00562163
:105230002000E9F753FC70BD70B50D00012104009A
:10524000491BFFF7E4FC2A0058212000E9F746FC3F
:1052500070BDF8B50500170003290FD0042910D040
:10526000002402262800E143FFF7D1FCE219920056
:10527000324328005721E9F731FCF8BD002426000D
:10528000F0E70124FBE770B50D0004000139FFF7DA
:10529000BEFC2A0059212000E9F720FC70BD70B542
:1052A000140005000E008918FFF7B1FC22023243FA
:1052B00028005A21E9F712FC70BD70B51A430D00A1
:1052C00004000121002A07D1FFF7A1FC60212A690F
:1052D0002000FFF72FFC70BD4942FFF798FC2A69B8
:1052E0006121F5E770B50E0004990400D5B20B43B7
:1052F0000DD10121891AFFF78AFC62213269200051
:10530000FFF718FC29002000FFF703FC70BDD14314
:10531000FFF77DFC32696321F1E707B50193009245
:105320000B0064220021FFF70EFD07BD13B5012419
:10533000019300920B0066226142FFF704FD13BD4A
:10534000012110B549420400FFF761FC01235B21F4
:10535000A3712000FFF7DDFB10BD70B505000C0048
:105360004942FFF754FC28000221FFF7C3FB5C23EE
:105370004470037070BD10B504000021FFF747FCB6
:105380000423E2682000117D0B4313755D21FFF7B4
:10539000C0FB10BD012110B504004942FFF737FCE6
:1053A0000423E2682000117D0B4313755E21FFF793
:1053B000B0FB10BD10B50421FFF729FC10BD03217F
:1053C00010B54942FFF723FC10BD10B5EBF7BEFA4C
:1053D00043000120184310BDF0B585B003900800CC
:1053E0000D0001F04BF80524042803DC280001F02F
:1053F00045F80400280001F04FF80527042803DCD5
:10540000280001F049F80700039B01930023029351
:105410000093009BA34212DBE343DB171C400523F0
:105420006343039A0433D3180022042C2BDC1A7034
:105430005A709A70DA701A7101340533F5E7002654
:10544000BE420ADBFB430021DB173B40052B13D098
:10545000019AD21811710133F8E73200009928003F
:1054600000F0FEFF019B029A9B19187101238340F3
:105470001A4302920136E3E7009B01330093019B3C
:1054800005330193C5E7039B029A1A8405B0F0BD6A
:1054900073B5060008000D00002403F0EAFC2300A9
:1054A0000100220028000094EDF7AEFB012301006B
:1054B0000093300023009622E9F7D0FF73BD70B54A
:1054C000040008001600DDF7D9FA05003000DDF70A
:1054D000D5FA290002002000EAF710F94300012064
:1054E000184370BDA02104230320C9051A00C1324E
:1054F000FF32920001335050112BF7D170478020BA
:1055000010B5C005F0F7AAFDFE23FE2140029B0561
:10551000400A18438905F5F797FB10BD70B50D00DB
:10552000DDF7ACFA04002800DDF7A8FA844202DDBA
:105530000020E7F74BFF001B0130F0F78FFD00194B
:1055400000F0BEF870BDF8B5070008680C00DDF784
:1055500095FA0600012F09D1002804DDF0F77EFD41
:1055600000F0AEF8F8BD0020E7F730FF6068DDF727
:1055700085FA851B022F06D18642F4DA2800F0F75F
:105580006DFD8019ECE7A068DDF778FA041E0ADDEE
:10559000281801382100F4F755FC0028E3DDF0F766
:1055A0005DFD6043EDE70028DDD028180130F1E70C
:1055B00010B5DDF763FA04001E2801DC002802D1D3
:1055C0000020E7F703FF8020C005F0F747FD202209
:1055D0000123121B5B42D340184000F08CF810BD31
:1055E0004068704741607047F0B51C0087B00EAB53
:1055F0001B780F0005930FAB1B7804920393A368ED
:1056000006000D9A18010C99039BE6F751FF3B68C1
:105610000500834203D200F04CFE30603D603568E7
:10562000039B201D00930195059B0D9A0C99FCF797
:10563000EAFD049B1860280007B0F0BDF8B50E0025
:1056400017000500EAF700F904003B0032002900CA
:105650000430FCF722FA2000F8BDF8B50F00150061
:105660001E0004000021180003F0AFFB33002A00E5
:105670003900201DFCF762FDF8BD01220300104037
:1056800005D013410AD41800431E98417047996809
:105690000029FBD01B7910001342F7D001204042B3
:1056A000F4E7D3B50F000600EAF7CEF801230400B3
:1056B000009332003B000430FCF712F92000D6BD05
:1056C00043001A0010B5424002D40120184310BD17
:1056D000C117FFF7E6FFFAE7D3B50F000600EAF7B8
:1056E000B3F800230400009332003B000430FCF7C1
:1056F000F7F82000D6BD10B5830F03D14000013369
:10570000184310BD0021FFF7E7FFFAE7F0B585B0B9
:1057100004000E0017000393EAF796F8039B0500B8
:10572000009332003B0021680430FCF764F92368E1
:1057300018182060280005B0F0BD10B5C30701D5CA
:10574000401010BD0430FCF7E5FCFAE710B504305A
:10575000FCF73BFD10BD10B50122EAF755FA10BD6C
:1057600010B50222EAF750FA10BD10B50022EAF790
:105770004BFA10BD0B6870B58668DC00B34201D3EC
:10578000002208E0C268013312191568002D04D008
:10579000042D02D00B60100070BD0834EEE701004C
:1057A00010B50C318068FFF7E5FF002800D00068D5
:1057B00010BD1FB5010004000C318068FFF7DAFF4F
:1057C00000280DD02279012A0CD0022A0CD00268C0
:1057D00002A902924368022001930393E0F74AFF73
:1057E00004B010BD0068FBE74068F9E710B50C7A1B
:1057F0000023012C05D11F2803D14968EAF7FAFAE2
:105800000300180010BD70B50500102000F051FD18
:1058100004002900EAF7D4FB200070BD70B5050034
:105820008068FFF7F0FF2B68416803606B68040035
:10583000DA0807230B400121D200134343602A7981
:10584000D207D30F02798A431A4302239A43027183
:105850002B79D2B29B080B4003318A439B00134340
:105860000371AB68E968DA00C06803F092FA2000BF
:1058700070BD4068C008704770B515000400012273
:105880000430E3F779F94560200070BD022213B5BA
:1058900004000090019110006946EAF7B5F9200074
:1058A00016BD04307047012803D1CB885B00184334
:1058B00070470020FCE770B500221E2B02D91A00A9
:1058C0001E3AD2B2E2258418ED0064192478551CE2
:1058D000EDB27F2C12D0E22664188518F600E4B2EF
:1058E000AD192C700132D2B2934209D0E22685184C
:1058F000F600AD192D78FF2DF4D0ECE72A00E1E792
:1059000070BD10B5040003F0B4FA01002000EBF7FD
:10591000D3F810BD70B5050003300C0000F0C9FCD1
:10592000206045702068023070BDF8B54578871C4E
:10593000040029003800EBF78DF8061E0CD1290071
:105940003800EBF769F865192070AE702000EBF7AE
:1059500037F806003000F8BD200000F0D9FCF9E768
:1059600010B5EBF71BF8007810BD10B5EBF716F883
:10597000407810BD10B5EBF711F8023010BD10B52E
:105980000C00EBF70BF843780230236010BDF0B544
:105990000400170082680D00561821008BB0039395
:1059A0007B00F0185B190C319B00029101930528D4
:1059B00014D895002A0005A803F0EBF905AB581997
:1059C000019A039903F0E5F9606805AB3A003100EC
:1059D000E6F7D6FF040020000BB0F0BD800000F019
:1059E00068FC0600A36802999A0003F0D2F9A36844
:1059F000019A98000399301803F0CBF9A3683A0094
:105A0000E91860683300E6F7BBFF0400300000F0DF
:105A10007FFCE0E702690123272A21D0222A1FD038
:105A2000752A04D011000F339943622912D14169BC
:105A30000123272914D0222912D0722A0AD1002347
:105A400062290DD180690123272809D022384342D9
:105A5000434105E00023622A02D14269722AF1D053
:105A600018007047026910B504000A2A22D1C369E0
:105A70000133C36101232362636960682361A36901
:105A80006361A36898476369A0610D2B07D1033B4D
:105A90006361984203D16068A3689847A061A369D5
:105AA000013306D163695A1C03D00A2B01D00A23A3
:105AB000A36110BD036A092A02D10733023A934356
:105AC0000133D8E7F8B504000E000025012720694E
:105AD000431C01D12800F8BD0A2809D1002E02D0AC
:105AE000A36A002BF6D02000FFF7BCFF3D00EEE7D5
:105AF000E2F7A6FD002803D02000FFF7B3FFE6E79A
:105B00002369232B08D12000FFF7ACFF23695A1C1F
:105B1000DDD00A2BF7D1DAE75C2BDBD163690A2BE6
:105B2000D8D12000FFF79EFFE6E77FB5060054209E
:105B300001910292039300F0BCFB030001AD40C34E
:105B4000040007CD07C3022200250123524222622E
:105B50000C32E262E36123636562A562142000F007
:105B6000A8FB606320002021443001F0CCFA636B75
:105B700020001D80A56165612561FFF773FF20008E
:105B8000FFF770FF2000FFF76DFF2000EBF7B4FA7E
:105B9000E36B012B03D02300052240331A70200051
:105BA00004B070BD1FB5040001A8E2F731FD0199F2
:105BB000029A039B2000FFF7B8FF04B010BD10B598
:105BC000041E0CD0E368406898472000443001F080
:105BD000BCFA606B00F09CFB200000F099FB10BD4C
:105BE00010B50022EBF7CAFD002801D1EBF76EFDDE
:105BF00010BD4A43F8B507001E0014000025B54249
:105C000000D1F8BD22003900069803F0C2F8069BC7
:105C100001351B190693F2E7F7B50F000021536811
:105C2000080014680193966800F01AFF0500002E22
:105C300011DA019B9C4201DA2800FEBDA300F9584D
:105C40002800EEF7C9FAA419F3E7A300F9582800D1
:105C5000EEF7C2FAA419019B9C42F6DBECE770B5A3
:105C6000049E040015001B2813D10022B5420ED15A
:105C70001A000B0011003200AE4200D92A001800B1
:105C800003F078F81B2C10D144426041C2B21000DE
:105C900070BD192805D01C2805D032002E00150033
:105CA000E6E71A24E7E71D24E5E700229042EEDB51
:105CB00001320028EBD1AE4202D0AE424041E5E7CE
:105CC0001A3C601E8441E2B2E1E7F8B51700040017
:105CD000002589004618B44203D101206D002843F5
:105CE000F8BD390001CCDCF777FE431E98412D1832
:105CF000F1E710B57F2440181440431E1C70802427
:105D0000091A64425818002800DC10BD2000D2098E
:105D1000013B10431870F5E730B5010003687F259B
:105D200000201A78C001140052B22C402018013310
:105D3000002AF6DB0B6030BD13B5421C01920278DD
:105D40000C000300082A11D81000F3F7DDFF07113B
:105D50000F0509090F0F0B0005330193019816BDBC
:105D60000333FAE701A8FFF7D7FFF7E7192A01D8AD
:105D70000233F2E701A8FFF7CFFF01A8FFF7CCFF3E
:105D8000002CEBD0019B18180190E7E770B50400D8
:105D9000160008000021A3694D1CDB091BD102314C
:105DA00001F0F1F90823037029000130A269FFF71F
:105DB000A0FF6569A369AB4206D30835A900E06975
:105DC00000F095FA6561E061A369E269591C9B00E6
:105DD000A1619E5070BD2900DEE710B50C000221C4
:105DE00001F0D1F9230A0A330370447010BDF8B5ED
:105DF0001E00037804000D001700002B0DD1416830
:105E000083688B420ED31831C9000122C06800F0AC
:105E10007BFA002802D101232370F8BD6368E0609B
:105E200018336360A268E368511CD2009B18A1601C
:105E300019682D022A0A0D0E2D0615431D603A78A9
:105E40009E80DA70069ADA80E7E710B50C0005212B
:105E500001F099F903230370431C05301C700133D2
:105E600024128342FAD110BDF0B5046A89B0230030
:105E7000403303931D7807000E00072D0BD1A16C52
:105E8000E06CEAF719FE01003000FFF7A6FF2000E2
:105E9000EBF732F94DE0082D0DD100222300A16C63
:105EA000E06CDCF75BFB0200C3070ED5411030004D
:105EB000FFF7CBFFEBE7092D0CD100940122002363
:105EC000A16CE06CDCF7C6FB020031003800FFF784
:105ED0005DFFDCE72B000A3B012B40D8A16C04A836
:105EE00001F011F9A26CE16C04A801F0F0F82000B7
:105EF000EBF702F9039B1B789D42F3D00A3B00208D
:105F0000012B17D9059906980A2915D8EAF7D4FD67
:105F1000041E14D00A3D0321300001F034F96B1E39
:105F20009D4144700435240A0570847004A801F072
:105F30000CF9012009B0F0BDEAF78CFDE8E70698FE
:105F400005990A2D08D12200DBF702F80200310082
:105F50003800FFF71BFFE9E7DBF712F8F6E702214D
:105F6000300001F010F90123457003708FE713B57D
:105F70000130019001A80C00FFF7CEFE20600198CF
:105F800016BD002310B50B60C2185278DC00A24089
:105F90000C68013322430A60042BF5D1053010BD93
:105FA00007B501A9FFF7EDFF01980EBD37B5150044
:105FB00002780C00032A07D1FFF7F2FF012340000B
:105FC0001843206018003EBD0023082AFAD101A919
:105FD000FFF7CDFF019B9B005B5923600123F1E795
:105FE00070B50D000024A84201D3200070BD01212E
:105FF0000134FFF7A1FEF6E710B50121FFF79CFE83
:1060000010BD10B50021FFF797FE10BD13B501308C
:10601000019001A80C00FFF77FFE01A8FFF77CFEAE
:10602000019B18182060180016BD13B50400006805
:106030000378002B02D10130206016BD192B03D844
:106040000121FFF779FEF8E71A318B42F8D101A957
:10605000FFF7DCFF20600198EFE737B51C00431C19
:106060000193037801A81A3B0B601500FFF754FE5B
:10607000286001A8FFF750FE019B18182060180047
:106080003EBD07B501A9FFF7C1FF019B181A4342A6
:106090005841C0B20EBD10B58068002800D110BDB7
:1060A000446800F035F92000F7E7136870B5002B5D
:1060B0000DD14568AC1CA40024589D4207D09E0019
:1060C000A659B14204D102339B001B58136070BD26
:1060D0000133F2E74B6810B502339B000A005958B0
:1060E000EBF7D2FF10BD8168030010B5081E08D081
:1060F0000122013999604900114358680332DCF7E5
:1061000045FE10BD7FB51D0000240123060000944C
:10611000080011001A00ECF7CFF8F82102AAFF31AD
:106120002868E6F7A5FC029BA34208D021002000C6
:1061300002AAFEF743FC0400200004B070BD0C204E
:1061400000F0B7F806602B68040043602868DCF7AD
:1061500007FEDCF793FCA060EEE7802307B55B0544
:106160001A6E082100925B6E68460193DAF708FF09
:106170000EBD10B5EFF3108072B6FFF7A1FA10BD97
:1061800010B504000161880000F093F8606110BD53
:1061900010B50400002902D0C06800F0B9F86069A9
:1061A00000F0B6F810BD70B504000D0001290AD149
:1061B0000121036949429A00406902F006FE00236A
:1061C0002560636070BD0229F9D1406800F071F864
:1061D0006368E060A360F2E710B5046842680023DA
:1061E000022C01D1C3689B1889184160180010BDAA
:1061F0000368012B03DC426843698900CA50704779
:1062000042684B1E9B18494219404160704770B567
:106210000C001500FFF7E0FF0419002803D170BD42
:1062200005702D0A0130A042FAD1F8E770B50D00D3
:106230000400DCF73BFB2900036A04222000984796
:1062400070BD70B50D0016000400DCF72FFB3200A6
:10625000036A29002000984770BD70B50D00040046
:10626000DCF724FB2900036A00222000984770BD58
:1062700070B50D000400DCF719FB2A0083692100CA
:106280001F20984770BD00B589B001A8E7F75AFEF6
:106290000120039B5B00184309B000BD00B589B025
:1062A00001A8E7F74FFE0120029B5B00184309B0ED
:1062B00000BD10B500210400E7F7AEFE002804D1B0
:1062C000002C02D02000E7F76BF810BD10B50021BC
:1062D000E7F7A2FE10BD10B50400FFF7EAFF0028A3
:1062E00004D1002C02D02000E7F75AF810BD10B5F9
:1062F00001220C00E7F790FF002804D1002C02D007
:106300002000E7F74DF810BD10B5E7F785FF10BD89
:1063100010B5E7F71BFF10BD04230122591A030033
:106320008A40411D1878104003D101338B42F9D1C6
:1063300070470120FCE710B5012803D14868DCF75D
:106340000FFD10BD0020FCE710B504210400FFF78D
:10635000E3FF03000420002B06D103212000FFF7F8
:10636000DBFF431E9841023010BD002210B50369C7
:10637000027642690400C36093420ED21878A37E6D
:106380002077002B02D00523637605E0ECF776F842
:10639000FFF7DAFF0130607610BD202303771B3B47
:1063A000F2E705235A435118182903D10079000751
:1063B000C00F70470722CB08C01840791140084130
:1063C00001231840F5E783795A43511804224B08FA
:1063D000C018C0798900114008410F231840704748
:1063E00010B584796243511804228C002240F024B5
:1063F0001441934049084118C87904402343CB71A4
:1064000010BDF7B506000C001F000192BC420DDA6A
:10641000019D089B9D4207DA2A00002321003000DD
:10642000FFF7DEFF0135F4E70134EFE7F7BD0B01BD
:10643000194382794379534301335B10C31898425F
:1064400002D0C1710130FAE7704710B58379427903
:1064500000215A4301325210073002F0B6FC10BD41
:1064600010B50379DB0706D5FFF79BFF0300092072
:106470005843C0B210BDFFF7A6FFFBE70279052322
:10648000D20700D483791800704710B5FFF7F6FFE4
:1064900043000120184310BD02790523D20700D420
:1064A000437918007047F0B593B00493189B03929A
:1064B000DC43199AE41723400593D343DB171A40B2
:1064C0001A9B0D905E42039B029109929E4200DA54
:1064D0001E00F343DB171E40029B0D989C79039B23
:1064E000E7181A9BFF1AFFF7C9FF039B059A9D182F
:1064F000BD4200DD3D000695854200DD0690029B11
:106500000D985D79FFF7C8FF1A9B1A9ADB43DB17DA
:106510001A401B9B0A92DB431B9ADB171A400B9213
:106520001A9A059B944663440793A34200DD07949F
:10653000099A1B9B944663440893AB4200DD08957F
:10654000069B9E421ADA1B9B5C42049B9C4200DA2B
:106550001C00E343049ADB1794461C40049B1B9ADF
:10656000ED18099BAD1A63449D4200DD1D000595A1
:10657000854200DD0590059B9C4209DB089B0B9A38
:1065800000930A99079B0298FFF73BFF13B0F0BDF9
:10659000039B1A9A93422FDC069B5D1E731E0E937B
:1065A00001235B4209931B9A049B934229DC059BC0
:1065B000013B0F93631E109301235B4211931A9BBF
:1065C000039AEB189B1A0C930E9BAB4225D00F9F9E
:1065D000109BBB421AD03A0029000D98FFF740FFEC
:1065E00004991B9A0300521AD2190C990298FFF7CA
:1065F000F7FE119BFF18EBE7069B35000E93012376
:10660000D0E7059B0F9410930123D7E7099A099BC4
:106610009446ED180C9B6344D5E71A9B039A0A999C
:106620009D1A1B9B049AAE199F1A069B3C19ED18E4
:10663000059B0B9AFF18029833000097FFF7E1FEC5
:10664000089B3A0000930A992B000298FFF7D9FEA5
:10665000089B220000932900079B0298FFF7D1FEB8
:106660000094079B0B9A31008DE7F0B50B6887B05B
:1066700048680D000493DCF701FA0590A868DCF780
:10668000FDF90700E868DCF7F9F904002869DCF790
:10669000F5F9E343C543DB17ED171C40054029001E
:1066A0002000EBF705FF002306000393029301008F
:1066B0000195049800943B00059AFFF7F4FE300022
:1066C00007B0F0BD10B5FFF7E7FE43000120184307
:1066D00010BDF7B50600FFF7D1FE00903000FFF7C0
:1066E000DBFE010007000098EBF7E2FE00240190BA
:1066F000BC4212DA0025009B9D420CDA29002200E0
:106700003000FFF7ADFE2900030022000198FFF7DB
:1067100067FE0135EFE70134EAE70198FEBD10B5E9
:10672000FFF7D7FF10BDF7B50600FFF7A7FE0090F3
:106730003000FFF7B1FE019001000098EBF7B8FEC2
:1067400000240700019B9C4213DA0025009B9D4218
:106750000DDA290022003000FFF782FE092329000C
:106760001B1A22003800FFF73BFE0135EEE701342B
:10677000E8E73800FEBD10B5FFF7D5FF10BDF0B556
:1067800085B0170004000E00FFF778FE0100EBF75C
:106790008FFE05002000FFF771FE00230190039398
:1067A000029300903B00200032002900FFF77BFE9F
:1067B000280005B0F0BD10B504000800DCF75EF954
:1067C000002201002000FFF7DAFF10BD10B5040021
:1067D0000800DCF753F9002241422000FFF7CFFF09
:1067E00010BD10B504000800DCF748F900210200D4
:1067F0002000FFF7C4FF10BD10B504000800DCF74F
:106800003DF9002142422000FFF7B9FF10BDF7B566
:1068100007000800EBF732FE0424060004230025DD
:106820001B1B0193735D0122234113400832534324
:1068300001992A0038000135FFF7D2FD052DF1D16D
:10684000013CEBD2F7BD13B5040001A94068DAF7AB
:10685000D7FFA268019900238A4207D2815CE068D1
:10686000FFF7D5FFA3680133A360E368180016BDE6
:1068700073B504000E000020042A0FD101A960683E
:10688000DAF7BEFF00230500320001992068DCF72B
:10689000CDF9295CA068FFF7BAFFA06876BD052195
:1068A00070B505000800EBF703FE04002900FFF7B0
:1068B000AEFF200070BD10B5140008001100E2F713
:1068C00049FF200010BD046045608660C7604146F6
:1068D000016149464161514681615946C161614644
:1068E00001626946416268467047816810B5C368B5
:1068F0008C6802000020A34204D2C96898000133CA
:106900004058D36010BDF0B585B001900E000092E4
:106910000293EAF735F8019BB34201D305B0F0BD0D
:10692000019B3768043B0393009B002B04D0390084
:106930001800FEF73BF807003500039B1C1DA5421D
:106940000AD9009B2168002B1AD13A001920E6F7DA
:1069500045FD029B984211D0043DAC421BD2009BE6
:10696000002B12D12A6839001920E6F737FD029B67
:106970009842F1D023682A6822602B600394DCE7F8
:106980000098FEF713F80100DFE729680098FEF78A
:106990000DF80200E7E723683268039F2260336046
:1069A000341B019BA410EB1A013C08379B10A34237
:1069B00009DA2900029B009A0198FFF7A4FF35002D
:1069C0002E000197A7E73800029B009A3100FFF7DD
:1069D0009AFF019FF4E710B50C6802000B00E06815
:1069E000A168EBF709F810BD70B50400080000219C
:1069F000E6F7BCF805002800E6F71AF901002000C8
:106A0000002900D170BDEDF7E7FBF4E710B50A00EF
:106A10008168C068FFF759F910BD70B505001020F6
:106A2000FFF747FC04002900EDF710FD200070BDC2
:106A300073B50D00002411001E00009401232200F4
:106A40002800EBF739FCA54203D12800FFF7E5FF4A
:106A500076BD2000FFF7E1FF3168FFF7C5FFF7E7DC
:106A600070B50D000400FFF7D8FF002D03D0002300
:106A7000A400A34200D170BDE958C268D1500433CC
:106A8000F7E710B5C1688068FFF7EAFF10BD8368BB
:106A90000B60C368136070478160704770B5002356
:106AA000150004000A0081680068DCF7BFF8E3689D
:106AB0008000C55070BDF7B51C000125002A02D129
:106AC000431EE418023D00220023002906D00023C3
:106AD0000027E356DE0F00237242BB4100210DE088
:106AE000160E00961E020196267817023E433200CB
:106AF000009F019E64193E43330001318142EFD172
:106B00001000190003B0F0BD13B514000193130079
:106B100001AA002908D1020001A9200002F039F9D8
:106B200013BD815C197001330138FAD2F8E770B5F2
:106B30000C00512826D010D8482820D004D801288D
:106B400014D0422812D070BD4C2803D0502801D058
:106B50004928F8D192001351F5E768280FD007D8DB
:106B600064281BD0662813D06228ECD1A354EAE72E
:106B70006C28EFD0712805D06928E4D1EAE75200EB
:106B80001353E0E7D200A2181360DB175360DAE773
:106B900018009500F4F752FA2851D4E7D2001800F3
:106BA0008C18F5F7EBFF20606160CCE710B50B792E
:106BB00001215B001943E6F711FC10BD10B500235D
:106BC000012806D00B7901215B001943E5F766FE29
:106BD0000300180010BD026813783E2B05D83C2B2B
:106BE00005D2212B07D0402303E0402BFBD10132FB
:106BF0000260180070473E23F9E7F7B50500066804
:106C0000741C20780194E1F733FDA71B03000134C5
:106C10000028F6D1390028680A22DBF79FFC019B87
:106C200040102B60FEBD73B5DAF7D4FD00906846C6
:106C3000FFF7D1FF00240600009B1878002803D13D
:106C400064000130204376BDE1F712FD01250028E4
:106C500003D06846FFF7D1FF0500009B1978732920
:106C600004D16419009B01330093E5E701AA3000C9
:106C7000EDF74CFD019B5A1E5B42013DF2D3141906
:106C80001C400419F9E710B508001100E2F770FD87
:106C900010BD70B5050008000E0002F0EAF8041EF1
:106CA00004D002006B68310028689847200070BD4E
:106CB000F0B58DB0049314AB1B78070003930F233A
:106CC000080004A95B180021139E19708A4223D082
:106CD00088421DDA2D2240421A700F25129B0A3B72
:106CE00005930499F3F7AAF80A008446303209297B
:106CF00001D9059A5218102308A94C1904A9C918DA
:106D00004A55002D10D06346013D002BE9D10BE020
:106D1000B2072ED52B221A700028DED130221F2474
:106D200008ABDA7304ABE4180F21402504ABC91893
:106D300035400B78002D20D00025AB420BD001222E
:106D4000039B0192009338003300EEF711F8050021
:106D5000159B013B15930CAB1A1B159B210001934E
:106D6000039B380000933300EEF702F828180DB0AB
:106D7000F0BD7207D0D52022CDE7002BEBD008AABA
:106D80009442E8D9013C2370E5E7F0B51F008DB0CF
:106D900012AB1B7802900393081C2B23B90702D473
:106DA0007B07DB0F5B010193149B04AC0093210074
:106DB00013002022E5F70EF80600FB0507D5431C5B
:106DC0001F2B04D82522225400221E00E254402505
:106DD00021003D4012D0002322781D002F2A0DD81B
:106DE0000122009301920298EDF7C2FF09210500EC
:106DF000139B013E013B139302ABC918139B320056
:106E00000193039B029800933B00EDF7B1FF281814
:106E10000DB0F0BD0EB403B503AA02CA0192EEF79D
:106E200021F902B008BC03B01847802340109B052D
:106E3000C018C0234910401A80001B064008C01823
:106E400001231843704713B5040008001100002205
:106E500013000092EBF730FA6368984716BD37B518
:106E60001C000023050000930133080011001A00E4
:106E7000EBF722FA6B68206898473EBD37B51C00D7
:106E80000023050000930233080011001A00EBF7FD
:106E900013FA03CC6B6898473EBD37B51C0000233E
:106EA000050000930333080011001A00EBF704FA01
:106EB00007CC6B6898473EBDF0B51D0000230F005E
:106EC0000600012485B000934368110038001A00C1
:106ED000EBF7F2F9B3681C43002F05D1A047F16826
:106EE000EDF70CF905B0F0BD2868012F03D1EEF7DE
:106EF00029FDA047F3E7022F09D1EEF723FD070094
:106F00006868EEF71FFD01003800A047E7E7032F90
:106F10000ED1EEF717FD07006868EEF713FD02903B
:106F2000A868EEF70FFD029902003800A047D6E7E7
:106F3000EEF708FD07006868EEF704FD0290A86808
:106F4000EEF700FD0390E868EEF7FCFC039A0300FF
:106F500002993800A047C2E7F0B50D001700040001
:106F600001798288C90787B0C90F1E005208C388FB
:106F7000009128003900EBF79FF92379DB070CD546
:106F8000AA00B218390003A8FCF760FAA36803AAA4
:106F900031002800984707B0F0BDA36831002800F1
:106FA0009847F8E710B5FBF735FEFBF72DFE10BD4F
:106FB00010B58068FBF72EFEFBF72CFE0430FFF7C0
:106FC000F1FF10BDF0B585B01D000AAB1B781700AE
:106FD0000393039A0368029000911B6B920719D5E3
:106FE0005B68002401932C60002F10D02B003A0026
:106FF00000990298019EB047002808D0431C0BD18D
:107000002B680B2B03D1002C01D000232B60200018
:1070100005B0F0BD1B68E4E70122039B134205D1D4
:10702000009B3F1A1B1800932418DDE70400EEE7CD
:1070300010B50022EEF74AFD10BD30B50C0087B048
:107040000500012203A96068DBF7D2FE032D12D1EF
:10705000A068DBF73FFD0021049B5A1A01930492BC
:10706000824200D90200039B206859180223EEF7E0
:10707000A7FE07B030BD042D0BD1A068DBF72AFDB9
:107080000500E068DBF726FD0499A942E4D9290050
:10709000E2E7012000214042DEE770B505004368C9
:1070A0000120C9182B68060099420FD92B7B034099
:1070B000002083420AD10723103199430831A86880
:1070C0000C00FFF714F9A86030002C6070BD70B59B
:1070D0000E00110004001500FFF7DFFF002807D1A4
:1070E000237BDB070ED563682568AB420AD2ED1A15
:1070F000A3686268310098182A0001F053FE6368A3
:107100005D19656070BD10B50400002900D1013122
:107110000023216063600800FFF7CBF80122237B86
:10712000A0609343237310BD70B50D0004000131BE
:10713000FFF7E9FF656070BD00238260027B43605A
:1071400001331343016003737047037B10B50400E0
:10715000DB0702D48068FFF7DBF80023A36010BDD3
:10716000027B70B5002304000D00D20709D4036828
:107170008068C918FFF7BBF82168A0604318491957
:107180002160180070BD70B504000D00FFF785FF89
:10719000031E04D06168A3685B1849196160180078
:1071A00070BD0368426810B50400934205D0002307
:1071B000A26861685354A06810BD0121FFF7D0FF99
:1071C0000028F4D1F8E710B50C000121FFF7DBFF30
:1071D000002800D0047010BD70B5050008000C0038
:1071E00001F047FE210002002800FFF770FF70BD8C
:1071F000F8B546680400170035008E4200D90D002E
:10720000002F0FD039002000FFF747FF00280BD0D8
:10721000A0687B194119721BC01801F0C3FD636897
:10722000DF196760A0684019F8BD10B5140001228D
:10723000FFF7DEFF002800D0047010BD10B5140069
:107240000122FFF7D5FF002800D0047010BD43686D
:107250008B4202D20023436070475B1AFBE770B594
:1072600004001500626808008A4203D949198A425D
:1072700001D8606070BDA368121A521B5918181803
:1072800001F090FD63685D1B6560F3E77FB40C1C43
:1072900003265643351CA0230C21DB0305331B02B8
:1072A0005A180833011CEFF3108640B472B608E098
:1072B0001960064200D11160760807D10134013D02
:1072C00005D08026C04611602078F1E7FBE7116009
:1072D00040BC86F310887FBC70470020704710B513
:1072E000EEF7F8FD10B50400006800F086F8200005
:1072F00010BD70B5060008000D0001F0BAFD0400D5
:107300000530F1F725F9306000F06AF8336829009C
:107310005C803068621C043001F03BFD70BD70B5CC
:107320000B68040000680D00984205D000F065F875
:107330002868206000F057F8200070BD00229142BC
:1073400007DB03680222985E0022884201DD5B1899
:107350001A7910007047002310B503600400EEF79F
:1073600071FFA060E160200010BD70B50180428017
:1073700004001D00EEF766FFA060E160002D02D062
:107380002000EEF7BFFF200070BD10B504000068BC
:1073900000F033F8200010BDF8B5D443E4171440D2
:1073A000050020000C301F000E00F1F7D1F8286016
:1073B00000F016F82B681C722B685F60002E05D059
:1073C000286822000930310001F0E3FCF8BD0023F9
:1073D00010B504000A001900FFF7DEFF200010BD01
:1073E00003230380704710B50400EEF7B1FF0028B7
:1073F00002D123880233238010BD10B50400EEF7BC
:10740000A7FF002805D12388023B9BB2012B01D0A6
:10741000238010BD2000F1F7CFF8FAE770477047DE
:10742000036870B5040001811B6A98472368050052
:107430005B69200098472081280070BD0089704753
:10744000036870B5040081721B6A984723680500C1
:10745000DB6920009847A072280070BD807A7047D1
:107460007047704710B50400102101F019FC20008E
:1074700010BD10B50400442101F012FC200010BD25
:10748000C3680169426949435B4352435B189818DA
:1074900070477FB50400FFF7F3FF25009023060037
:1074A0001B04313598422AD9638F002B07D1013351
:1074B00008221B216846FFF758FF012363879023AA
:1074C0009B049E4219D9A38F002B07D101330922B7
:1074D0001B216846FFF749FF0123A3878023DB04B4
:1074E0009E420AD9E38F002B07D101330A221B21C8
:1074F0006846FFF73AFF0123E38700232B702B78C0
:10750000042B0ED801332B702000EFF717F8020080
:107510000B280BD1628601231B216846FFF725FF4C
:1075200015E00023E387A3876387EDE72300A18E9F
:10753000303381420CD11A78042A01D801321A70F2
:10754000A28E618E914202D01B78042BE2D87FBDBF
:10755000A0860022F3E730B50400036A8BB00093E5
:1075600002AD416A8269C369280000F06EFF230002
:107570000C3307CD07C30222A37920009343A371E4
:10758000FFF787FF0123A1881A0006A8FFF7EDFE89
:1075900000200BB030BD70B505000B680C00080072
:1075A0005B6A98472B000C3407CC07C3280070BDDA
:1075B00010B5040003685B6A9847E06810BD10B519
:1075C000040003685B6A9847206910BD10B5040089
:1075D00003685B6A9847606910BD10B504000368D2
:1075E0005B6A9847A3799B0702D42000EFF770F8F5
:1075F000A06A10BD10B5040003685B6A9847A379C0
:107600009B0702D42000EFF763F8E06A10BD408EBC
:107610007047036870B5040001811B6998472368AF
:1076200005009B69200098472081280070BD0089D3
:107630007047704710B50400482101F031FB20006D
:1076400010BD30B50400436BC26801699A1A8369A2
:107650008BB05A43836B92125B1AC16942634B43EE
:107660009B128363C16B406902AD091A206A4143D2
:107670008912E16300912800216C00F0E6FE2300EE
:10768000283307CD07C30123A1881A0006A8FFF7F6
:107690006CFE00200BB030BD002310B58371643345
:1076A00003810368040081801B6998470222A37943
:1076B00093431A0001231343A37110BD84B030B566
:1076C000069303000491059204AC0C3326CC26C328
:1076D00026CC26C322681A60022382791343837161
:1076E00030BC08BC04B01847030030B50C3134C9B5
:1076F00034C334C934C30A681A6030BD02238079A8
:107700001840704704238079184070478022002376
:10771000D2008261C26102620222C36003614361DE
:10772000436283799343837170474164704773B5B3
:107730000C00050016000B680800DB699847E36B36
:10774000280001960093626BA36B216C00F03EFE53
:10775000280076BD70B505000B680C000800DB69D9
:1077600098472B00283407CC07C3280070BDF0B51C
:1077700087B0010003A8FFF7EDFF0398F5F7FEF9C6
:10778000040004980D00F5F7F9F9060005980F00BC
:10779000F5F7F4F92200009001912B002000290058
:1077A000F4F7FCFB320004000D003B003000390010
:1077B000F4F7F4FB02000B0020002900F3F7C8FCEB
:1077C000009A019B04000D0010001900F4F7E6FB7D
:1077D00002000B0020002900F3F7BAFCF5F78EFE3B
:1077E000F5F796F907B0F0BD10B504000368DB6942
:1077F0009847A06A10BD10B504000368DB6998477C
:10780000E06A10BD10B504000368DB699847206B7F
:1078100010BD82B030B5050085B0089202A80822DC
:10782000099301F0B6FA039B029C5A10AD18DB07CE
:1078300001D52B681C590AA90822684601F0A9FA4B
:10784000089A099B2800A04705B030BC08BC02B0CC
:107850001847F8B50A6803680E000700981AF3F78E
:10786000EDFB72687B68051C981AF3F7E7FBB368B9
:10787000041CB868C01AF3F7E1FB291C061C281C7D
:10788000F3F7B0F8211C051C201CF3F7ABF8011C22
:10789000281CF2F735FD311C041C301CF3F7A2F84C
:1078A000011C201CF2F72CFDF8BDF0B585B001904D
:1078B00002910392FFF7CDFF0127041C061C039BD6
:1078C0009F4217DA0C217943029B01985918FFF760
:1078D000C0FF051C011C201CF2F704FC002800D08E
:1078E0002C1C291C301CF2F7E9FB002800D02E1CB0
:1078F0000137E4E7211C301CF3F7A6F905B0F0BD11
:10790000F0B58BB009938023DB000024C3600361D2
:107910004361002305000C2707910892046044602E
:10792000846084610293119B9C4265DB00270023E5
:10793000109C0593019700973E1C059B119A93425A
:1079400070DA210007A8FFF784FFF6F7F7F9011CAA
:1079500003900298F2F76EFEFE218905F3F774F9A1
:107960000490301CF3F74AFB06000498F3F746FB3B
:10797000864200DA06003000F3F760FB2368079ABE
:10798000061C981AF3F75AFB0399F2F753FE4000CE
:1079900004994008F3F726F8011C0098F2F7B0FCB0
:1079A000089B00900693069A6368981AF3F746FBC3
:1079B0000399F2F73FFE400004994008F3F712F8EC
:1079C000011C0198F2F79CFCA368019009980C3403
:1079D000181AF3F733FB0399F2F72CFE40000499D1
:1079E0004008F2F7FFFF011C381CF2F789FC059BE9
:1079F000071C01330593A0E739006143109B07A8DA
:107A00005918FFF726FFF6F799F9F3F7F7FAF3F7A6
:107A100015FB0299061CF2F765FB002800D00296C0
:107A2000013480E70099081CF2F7DCFF0199041C7F
:107A3000081CF2F7D7FF011C201CF2F761FC391C6F
:107A4000041C381CF2F7CEFF011C201CF2F758FC76
:107A5000F6F774F9041C011C0098F2F7EBFD311CD9
:107A6000F2F7C0FFFE218905F2F74AFC8921C9051A
:107A7000F2F7B8FFF3F7C2FA211CE8600198F2F7B9
:107A8000D9FD311CF2F7AEFFFE218905F2F738FC73
:107A90008921C905F2F7A6FFF3F7B0FA211C286186
:107AA000381CF2F7C7FD311CF2F79CFFFE21890557
:107AB000F2F726FC8921C905F2F794FFF3F79EFA45
:107AC000079B68612B60089B029800936B60099B81
:107AD000AB60F3F793FAA86128000BB0F0BDF0B5E6
:107AE0000025040017000B002E0028002A0091B08A
:107AF0000791BA4208DA19680132401859687618B5
:107B000099680C336D18F4E73900F2F79BF93900E6
:107B100020603000F2F796F9390060602800F2F733
:107B200091F93A00A06007992000FFF7BEFE0026F9
:107B30000DAB0A90059606960393C8235B42049307
:107B4000C8235B420293C8235B4201932200039B3C
:107B500023CA23C32268049B9446039A6344136098
:107B600062681D009446029B039A63445360A268B6
:107B700008939446019B039A6344936007993A00E3
:107B800003980993FFF791FE0A990B90F2F796FA82
:107B9000002805D0089B099E05930B9B06950A9328
:107BA000019BC83301931A00C8235B009A42CDD1D0
:107BB000029BC83302939342C5D1049B029AC833F7
:107BC00004939342BCD12368069A934206D163681A
:107BD000059A934202D1A368B34205D0069BA660E2
:107BE0002360059B6360A8E7200011B0F0BD70B56D
:107BF00004000D00160086B003A8FFF770FF2000F8
:107C0000019600950399049A059BFFF779FE2000E1
:107C100006B070BD4A6810B55310C0180B68D20783
:107C200001D50268D358984710BD10B50021406CAB
:107C300000F0EDFF10BD10B50400EFF7DFF92000F4
:107C4000782101F02DF8200010BD10B50400EFF7E9
:107C5000C7F92000302101F023F8200010BD70B5D5
:107C600005000400743501212800F0F7E9FD220029
:107C7000563213780133DBB21370E17901318B4254
:107C800022D1002326001370226D54360221525E49
:107C900033882021934205DA200019B25030FFF7D3
:107CA0004DFB0100E27900232800F0F783FD226DEF
:107CB00033880221525E934207DD230000224833BD
:107CC0001A702000EFF7A4FA70BD01333380FBE790
:107CD00070B505000600826D5C350221525E2B886E
:107CE000040074362021934204DA19B25830FFF7A9
:107CF00025FB0100002330001A00F0F75BFDA26DA8
:107D00002B880221525E934207DD23000022483374
:107D10001A702000EFF77CFA70BD01332B80FBE76F
:107D200073B504000600250074363000643500F099
:107D3000B4FB0023EA5E2100002360310093300091
:107D400000F0BBFB002804D123006C331B78002B10
:107D50000AD16622A256002A06D02B886C349B18C2
:107D60002B800123237073BD2300002248331A7037
:107D70002000EFF74DFAF6E7F0B506000021050008
:107D800004006636006E7156408864350023EA5E52
:107D90004B1D1B1A200085B06C3003909A4210DCFA
:107DA0000378002B0DD01C3D2B78062B02D1083018
:107DB00000F073FB002320002B70EFF729FA05B0C9
:107DC000F0BD27007437002A04DD494209B23800AB
:107DD000F0F736FD0023EA5E2100002360310093B6
:107DE000380000F06AFB0023F356002B05D1220077
:107DF000483213702000EFF70BFA0123039A137037
:107E000000232A88F3569B182B80D8E770B505000D
:107E100048352B780400002B31D0EEF7CBF9220047
:107E20004C3213881818230080B210804A331B8804
:107E3000834224D8002313802B78022B02D1200008
:107E4000FFF70DFF2B78032B02D12000FFF740FF37
:107E50002B78042B02D12000FFF762FF2B78052B33
:107E600002D02B78062B02D12000FFF785FF2B785C
:107E7000072B04D1002320002B70EFF7C9F970BD48
:107E80001FB5036F827A9B68040001339A4208D1C0
:107E90008188012302226846FFF767FA0023A37254
:107EA0001FBDEFF73BF92000FFF7B0FFA37A0133C6
:107EB000F5E710B583790400DB0704D5027B022ABD
:107EC00002D1FFF7DDFF10BD837A016F0133DBB212
:107ED000837289688B4201D100238372002A02D108
:107EE0002000EFF71BF9237B012B05D163730023DF
:107EF0002000A373EEF7F6FF2000FFF787FFE2E70D
:107F0000407A7047F0B5837987B004000D00DB0735
:107F100003D5002903D007B0F0BD0029FBD0102302
:107F2000216F01278A68CB5698180022984204DDF9
:107F30003E009E4001333243F8E71123C868CB5618
:107F4000012700211818984204DD3E009E400133AD
:107F50003143F8E70A43002D09D00123002101A88D
:107F6000F1F7F6F90123A2791343A371D3E72B00AC
:107F7000290001A8F1F7ECF9290001A800F012FE90
:107F80000122A3799343F0E710B50121FFF7BAFF6F
:107F900010BD10B50021FFF7B5FF10BD10B574304E
:107FA00000F07BFA10BD10B50400F0F709FE0023C5
:107FB0002000237510BD1FB503AC63700023227031
:107FC000009322000233EFF7BFF904B010BD1FB5D4
:107FD0000F2401236C4400932300EFF7C5F9002818
:107FE00000D1207804B010BD4A6810B55310C018F5
:107FF0000B68D20701D50268D358984710BD82B0EC
:1080000030B5050085B0089202A80822099300F057
:10801000C0FE039B029C5A10AD18DB0701D52B68EC
:108020001C590AA90822684600F0B3FE089A099B69
:108030002800A04705B030BC08BC02B0184770B596
:1080400004000D001822002100F0BFFE29002000CE
:1080500000F093FC200070BD0368426880689B18A4
:1080600010B518180321F1F7EDFE4B2800DA4B206C
:10807000A9235B00984200DD1800181A0821FF238D
:10808000FF315843F1F7DEFE10BD13B50C0001A817
:10809000EFF75AFC210001A8EFF768FC13BD73B598
:1080A0000D0014001E0001A8EFF74EFC33002A005B
:1080B000210001A8EFF790FC73BD802307B55B0595
:1080C000009101921A695B696946133B5A43022386
:1080D000FFF7E5FF07BD84B010B50492802203913D
:1080E000059352051369516952691139133A5A437C
:1080F0004B430F99CB1AD21803A90C23FFF7CFFFDC
:1081000010BC08BC04B0184780235B05F7B51A699A
:108110005B690191113B5A430092EFF709FB06009E
:10812000041E23D0302000F0CAFD302200210400BC
:10813000002500F04AFE30273B006B4300990831D0
:10814000C918B5420BDA3A00200000F022FE2100E7
:10815000019800F084FE002808D00135ECE7B54214
:1081600004D12000302100F09BFD00242000FEBD42
:1081700010B509680431EFF70BFB10BD29DF70471C
:1081800028DF704710B503685B6A984710BD10B5CB
:108190000400EFF7E1FC2000A42100F081FD2000A5
:1081A00010BD10B5C9B20D22FFF711FFC738434209
:1081B000584110BD10B503685B6A984710BD10B5F3
:1081C0000400EFF70BFE20005C2100F069FD2000A9
:1081D00010BD10B5C9B20D22FFF7F9FE5A3843425F
:1081E000584110BD10B50368DB69984710BD10B544
:1081F0000400EFF769FE2000602100F051FD20002F
:1082000010BD10B5C9B20722FFF7E1FEC4384342E2
:10821000584110BD10B503685B6A984710BD10B592
:108220000400EFF76BFF20005C2100F039FD200017
:1082300010BD10B5C9B20F22FFF7C9FE3338434253
:10824000584110BD10B50368DB69984710BD10B5E3
:108250000400F0F707F82000602100F021FD200065
:1082600010BD10B5C9B24F22FFF7B1FE40384342EE
:10827000584110BD72B60B680165002B05D14365EE
:108280008365086062B6704713005A6D002AFBD1FF
:10829000586583654265F5E7036D002B0FD072B614
:1082A000826D436D002A0BD05365436D002B01D0C6
:1082B000826D9A65002343658365036562B67047E6
:1082C000026D1360F1E770B50500EFF30884C36B2E
:1082D000006C1C1B6B6C1B1A9C420CD91F23203496
:1082E0009C43002801D0F0F767F92000F0F730F93F
:1082F00028640019686470BD10B5F0F755F8F0F700
:108300006BF8FAE7F0B58208830703D1031E02D1A8
:108310001800F0BD0132541C72B6802621C9360601
:10832000854225D90368002B02DB9B00C018F7E7C4
:108330005B005B08990041180F68002F08DA8D4236
:1083400006D931007F007F08DB1919430160F1E78E
:10835000A342EAD302329A4203D292008218954293
:1083600009D803685B005B08036062B6031DCFE7B2
:1083700062B60023CCE7191B80231B06043A0B438B
:1083800013600460F1E710B50800F0F7E1F810BDE4
:1083900010B50800F0F710F910BD10B5838804007F
:1083A0009B0703D51821806800F07AFC200010BDDF
:1083B00010B5F0F729F9406810BD10B5F0F724F9B1
:1083C000006810BD017042704360704782B0F0B524
:1083D00005920200069308AB1B7805ACE0CCE0C226
:1083E000002B1ED04A78002A05D0069A52424260DD
:1083F000079A524282604A68022A16D0032A1AD08B
:10840000012A04D102684168524201604260012B96
:1084100017D0022B05D143685B42436083685B42FF
:108420008360F0BC08BC02B0184702685242026088
:1084300042685242EAE74268016852420260416083
:10844000E5E7426803680260E7E782B037B50400F9
:10845000180007930B7806920193089B0093030082
:108460002000FFF7B3FF20003EBC08BC02B0184755
:1084700010B504000068FEF7C0FF200010BD10B565
:108480000A00002100F0A1FC10BD10B5040008682E
:108490002060FEF7A8FF200010BD10B500684388DB
:1084A000818806305943FFF7EAFF10BD10B504007C
:1084B0000023F0F709F9200010BDF0B587B0039153
:1084C0000CA90978070004910168002002914988ED
:1084D0008C468A426BDA029989888B4267DA039C60
:1084E0002668748801941419009484425FDDB5886D
:1084F0005C19059484425ADD824205DA0098604591
:1085000009DD6046009006E06046801A0090040095
:1085100001988442F6DC002B2FDA059C8C4200DDAA
:108520000C00B01D0026D11755422940B34202DA93
:10853000019D6E425E43029D761886190635111C18
:10854000002A00DA0021002209B2934201DD6246CE
:108550005A43049B51186D18002B1DD000221000A7
:10856000A24224DA002300998B420BDAF15C002945
:1085700001D0E95401300133F5E7CC1AAC42D0DD2B
:108580002C00CEE7039B01321B6801935B88F61831
:108590003B685B88ED18E3E7049B0193019BA342D2
:1085A00007DBE043009BC01720404343180007B09F
:1085B000F0BD31002800009A00F0EBFB039B1B6824
:1085C00002935B88F6183B685B88ED18019B0133CA
:1085D000E3E710B5040000F024FB200010BD51DFDC
:1085E000704761DF7047F8B506000F0004001518EA
:1085F000AC4200D1F8BDBB1B195D2000F0F79CFA1E
:108600000134F5E7F0B585B01C000AAB0500039115
:1086100016001F78F0F7F6FA01235F400097230059
:1086200032000399280000F07DFA201A441EA04170
:1086300005B0F0BDF0B585B01C000AAB0500039194
:1086400016001F78F0F7DEFA01235F400097230041
:1086500032000399280000F023FA201A441EA0419A
:1086600005B0F0BD836980681B681840431E9841BF
:10867000704710B5043000F0FFF910BD704710B519
:108680000400402100F00CFB200010BD10B500F0EC
:1086900045F810BD10B500F046F810BD704718231E
:1086A0004A1C5A43594382189268431810B5DB6834
:1086B000002A03D1002B00D0984710BD002BFCD01E
:1086C0001031411818009047F7E710B50400402119
:1086D00000F0E6FA200010BD70B50D000400043073
:1086E000F0F726FFE56370BD10B5043000F0ACFA7A
:1086F00010BD70B50C00030011000430221E0AD01A
:10870000182215004D435D19EC604C1C62439B1808
:1087100000229A600132F0F757FF70BD10B50430A7
:1087200000F085FA10BD10B50C000430F0F792FF90
:10873000200010BD10B5040043684269991800F08C
:1087400077F8E36A002B04D1A369002B00D0984787
:1087500010BDA0690028FBD021001C319847F7E725
:1087600010B5040000F06CF80023A361E36210BDB3
:1087700070B50D00040000F063F86561206900F039
:1087800064F94119200000F053F870BDC36A01007C
:1087900010B58069002B03D1002800D0804710BDA0
:1087A0000028FCD01C319847F9E710B50400F0F719
:1087B0005FFA2000302100F073FA200010BD03683A
:1087C00010B50400002B05D1C06800F03EF901236C
:1087D0006060236010BD10B504000068002804D05C
:1087E000E06800F032F96368C01A10BD10B5846803
:1087F000FFF7F1FF201810BD10B50400C06800F0AD
:1088000024F900236060A36010BD002310B503604D
:10881000436083600400F0F7F7FAE0602000FFF7A0
:10882000EBFF200010BD10B503689B68984710BD92
:1088300010B50A000300011D006900F0CEF810BD5C
:1088400010B5011D006900F0E4F810BD10B5022854
:1088500004D8802300209B014B6010BDF7F7A2FFD6
:108860000923036001204042F7E710B50120F7F724
:108870009FFF7047704710B5FFF7FCFFFFF7F9FF48
:10888000DAF7A0FB10BD10B5002801D000F001F808
:10889000FEE710B59AB0032102A800F06EF802219D
:1088A00008A800F06AF801210EA800F066F810216F
:1088B00014A800F062F89624059B039A20001A6021
:1088C000099A0C9B1A600F9A129B1A60159A179BB3
:1088D00001921A6000F0C9F8069B039A20001A6002
:1088E000099A0B9B1A600F9A119B01921A60159AB4
:1088F000189B1A6000F0B9F8DEE70FB4012010B53C
:10890000F7F756FF70B50D0004001600F0F7F0FA07
:108910006B1C07D00021200000F0B4F831002000CB
:1089200000F0AAF870BD70B5436804000D00002A7D
:108930000AD0C26813602000012100F0A3F82900CA
:10894000200000F099F870BD0269F3E710B503222A
:10895000FFF7D8FF10BD10B5FFF7D4FF10BD70B5FD
:108960000D0004001600F0F7C3FA6B1C04D03200AF
:1089700000212000FFF7D7FF70BD10B50022FFF7E0
:10898000EEFF10BD70B504000D0003681B6898472A
:1089900063681D6070BD036870B5DB6804009847AC
:1089A00063685A682368002A02D19B68984770BDA3
:1089B0005B681568984763682D1A5A68002D07DCB4
:1089C000916859601B68002BEAD050689847E7E728
:1089D000236810681B699847E9E770B50D0072B607
:1089E0004B60002346680A607468002C09D1002B94
:1089F0000DD1036875601B6910009847AC6062B6C2
:108A000070BD2168511AF2D42300A468EDE79D607F
:108A1000F4E710B572B6426853688B420DD19B687B
:108A200053600268002B03D19368984762B610BD6B
:108A3000126918689047F9E71300002BF6D09A687E
:108A40008A42F9D18A689A60F0E710B503685B68DA
:108A5000984710BD70B50400F1F7AAF80500F1F7CA
:108A6000A7F8401BA042FAD370BDFA2310B59B00B3
:108A70005843FFF7EFFF10BD10B5007840B200F08B
:108A800081F810BD002902D0012900D070470023D1
:108A9000A022C356D205C133FF339B009950F5E79E
:108AA000F7B50192B1221E0003684910D200995017
:108AB0008021012289005A50190000240500FC3150
:108AC000CC601A60771E019BA7420BDCD9190122EA
:108AD0002800F0F731FB002819D02800F0F7F2FB4E
:108AE0003E0010E0191900222800F0F725FB0028AD
:108AF0000BD02800F0F718FC06002800F0F7E2FB86
:108B0000002E00DB26003000FEBD0134DAE7089BB2
:108B1000002BF8D02B68FC339A68002AFCD0002286
:108B20009A60F0E7F8B51700B1221C000368D20084
:108B3000491099508022002592009D500122060084
:108B40009A60A54209DB069B002B04D03000F0F7A9
:108B5000D1FB002813D120000EE0795D3000F0F742
:108B6000D7FA002809D03000F0F7ACFB3000F0F75E
:108B7000DBFB002800DB2800F8BD0135E1E7012020
:108B80004042F9E7A0238000DB05C018E02310B5C0
:108B90000C24DB00C2588900A243C250C2581143C2
:108BA000C15010BDF8B505000E00002401273B00A0
:108BB000A3402A691A4203D060B23100FFF7E2FFF6
:108BC00001341F2CF3D1F8BD30B5002902D00129A2
:108BD0000FD030BD01220C0013008B4005691D42EF
:108BE00003D005688B00EB181C6001311F29F3D1FD
:108BF000EFE700230A009A400469144203D0046896
:108C00009A00A218116001331F2BF3D1E1E70B008A
:108C1000426810B5146801696340194061401160F1
:108C200010BD10B5407840B2F0F7A6FB10BD036848
:108C30001A00FC32D1680129FCD10021D160A322A5
:108C4000D2009858C0B270470368FC33D868013826
:108C500043425841704782B00190C046C046C0466A
:108C6000C046C046C046C046C046C046C046C046D4
:108C7000C046C046C046019B013B0193002BECD18E
:108C800002B07047704770470023CB565A1C01D181
:108C9000180002E0834201D1486870470C31F3E7C5
:108CA00010B500F001F810BD10B5EFF785FC10BD50
:108CB0000B0010B501001800F7F766FD10BD10B5E8
:108CC000041E00D101342000EFF742FC002807D138
:108CD000F1F70AF8002801D100F003F88047F2E725
:108CE00010BD10B50620F7F7BFFE0120FFF7CBFD42
:108CF00070B568254A1E55430E0029007431FFF7F0
:108D000042FB041E08D000212A00016046600C309E
:108D1000A060683200F059F8200070BDF7B504007B
:108D20000700002601914834002C01D13000FEBD1F
:108D30006368A5680093009B013B009301D52468FC
:108D4000F2E7AB89012B08D90E22AB5E013304D0C8
:108D500029003800019B984706436835EBE7C9B204
:108D60008218904201D10020704703788B42FBD0DB
:108D70000130F6E730B50024A24201D1002005E021
:108D8000035D651C0C5DA34201D0181B30BD2C0097
:108D9000F2E7002310B59A4200D110BDCC5CC45458
:108DA0000133F8E710B5884202D98B18984203D3F3
:108DB000002307E08B5C8354013AFBD210BDCC5CEE
:108DC000C45401339A42FAD1F8E7030012189342CF
:108DD00000D1704719700133F9E770B504000D0038
:108DE0001F2904D9162303600120404270BD436C43
:108DF000002B04D08A009B181A68002A08D1200092
:108E000000F015F82A0001002000F7F737FEEDE723
:108E10000020012AEAD0511C03D11623013023601F
:108E2000E4E7002428001C6090472000DEE710B52E
:108E3000F8F716FB10BD10B50E23C95EF7F756FF05
:108E400010BDC9B20378002B04D08B4200D170470B
:108E50000130F7E74B42594149420840F7E70278B1
:108E60000B78002A03D0013001319A42F7D0D01A92
:108E700070470023C25C0133002AFBD1581E7047A3
:108E8000002330B59A420AD0013AC45CCD5CAC42B2
:108E900004D1934202D00133002CF6D1631B180099
:108EA00030BD936810B5013B9360002B04DA9469E0
:108EB000A34207DB0A2905D01368581C10601970FB
:108EC000080010BDF7F732FE0100F9E7F8B506001B
:108ED0000F001400D518AC4201D1002007E0217822
:108EE0003A003000FFF7DDFF0134431CF3D1F8BD39
:108EF000F7B5150001938A680B6900900C00934246
:108F000000DA130022002B6043321278002A01D0CD
:108F100001332B6023689B0602D52B6802332B603C
:108F2000062723681F4027D0230043331B785A1E8F
:108F300093412268920630D422000199433200986E
:108F4000089EB047431C25D0062320682A68E168A4
:108F500003400025042B03D18D1AEB43DB171D4082
:108F6000A3682269934201DD9B1AED180027BD42D8
:108F700020D1002010E00137E3682A689B1ABB4229
:108F8000D2DD22000123193201990098089EB047D2
:108F9000431CF0D101204042FEBD3020E118433196
:108FA000087021005A1C45310978A2184332023357
:108FB0001170C1E7220001231A3201990098089E1E
:108FC000B047431CE6D00137D1E70000F8B5C046F2
:108FD000F8BC08BC9E467047F8B5C046F8BC08BC53
:108FE0009E467047000000004FBB610567ACDD3F47
:108FF000182D4454FB21E93F9BF681D20B73EF3FC0
:10900000182D4454FB21F93FE2652F227F2B7A3C37
:10901000075C143326A6813CBDCBF07A8807703CF0
:10902000075C143326A6913C30900200C101000079
:1090300058B802000100000081010000000000009B
:109040000000000000000000000000000000000020
:109050000000000000000000000000000000000010
:1090600000000000000000000000000058B80200EE
:10907000A2020000C50200005D0200000000000026
:109080009101000000000000FD020000D901000075
:10909000C10100000000000000000000000000000E
:1090A000000000000000000058B802006702000045
:1090B00000000000000000000000000000000000B0
:1090C0000000000000000000000000005B2602001D
:1090D00081140200000000000000000000000000F9
:1090E0000000000058B8020044020000DD03000048
:1090F000E115020000000000C5050000A507000002
:109100000000000000000000550300000000000007
:10911000000000000000000000000000BC91020000
:1091200058B80200B2020000DD030000E1150200A1
:1091300000000000C5050000A507000000000000B9
:1091400000000000550300000000000000000000C7
:109150000000000000000000BC910200B4EA020020
:10916000B504000078EA02004905000078EA020030
:10917000F91402002CEB02000200FFFF8D15020023
:109180002CEB02000200FFFF61050000B4EA0200C0
:10919000D1040000B4EA0200CB150200B4EA0200D8
:1091A000C1150200B4EA020071030000B4EA020033
:1091B00043160200B4EA02003316020074C2020031
:1091C0009700000012000000CC910200F60F000092
:1091D0005C9102002E0C0000649102003E0500002C
:1091E0006C910200761100008C9102004E1100007B
:1091F000749102005611000080910200AE1200002E
:1092000094910200B61200009C910200CE12000060
:10921000A491020016130000AC9102001E1300007E
:10922000B4910200D61400005C9202002E150000DA
:1092300064920200461600006C9202004E16000076
:1092400074920200DE1600007C920200FE160000FE
:1092500084920200F60E0000E8E0020078EA0200C4
:10926000A1050000B4EA020071050000B4EA0200A2
:109270001B150200B4EA020015050000B4EA020062
:10928000071502002CEB02000200FFFFED040000B6
:10929000A09202000000000000000000000000009A
:1092A00058B8020013020000211700000D1600003C
:1092B00000000000000000009D1D000000000000F4
:1092C00099150000CD0D000000000000C725020028
:1092D0000000000000000000DC92020074C20200E6
:1092E000B700000016000000EC920200E61100003A
:1092F000B493020056150000289402009612000054
:10930000CC9302005E150000349402004613000066
:1093100000940200D6150000589402006E1500005B
:1093200040940200EE150000649402009E110000BB
:10933000A89302002616000070940200D6130000C5
:1093400010940200761500004C94020006120000F2
:10935000C0930200361500001C9402000E1100009C
:109360009C930200BE130000089402000617000040
:109370007C94020006130000F0930200BE1200006D
:10938000D8930200C6120000E093020026130000EA
:10939000F8930200F6120000E89302002CEB0200A2
:1093A00004000400F11300002CEB02000400030091
:1093B000A91200002CEB020004000400DD230200CF
:1093C0002CEB02000300FFFF012500002CEB020044
:1093D00004000400F723020078EA02005915000097
:1093E00078EA02006915000078EA02008915000099
:1093F00078EA02004915000078EA020079150000B9
:10940000B4EA02009110000078EA0200B5140000EE
:109410002CEB0200020002001F2402002CEB0200D1
:10942000060004003B2402002CEB020004000400B0
:10943000E92302002CEB02000400040003240200D4
:109440002CEB020002000300F12300002CEB0200D1
:10945000020002002D2402002CEB02000200030097
:10946000B52200002CEB02000400030045120000AE
:109470002CEB0200020002001124020078EA020034
:10948000C514000078EA02002D2602000500000045
:109490000500000003000000090000000D040000AA
:1094A0006203030058B802000D0200000000000033
:1094B00000000000AB2802000000000000000000D7
:1094C000000000000000000000000000000000009C
:1094D000000000000000000000000000000000008C
:1094E00074C202001701000022000000F094020084
:1094F000860F0000BE0000006E02000008E50200BA
:10950000FE0400001C0000209605000054BC020070
:109510009E05000060BC0200C605000084E9020050
:109520006E0600009C990200A606000014BE020010
:109530006E0B000064000020EE0B000054000020C1
:10954000C600000014960200CE000000249602001F
:10955000D60000001C960200DE0000000896020003
:10956000E60000002C960200A6010000ACA202005A
:10957000AE010000F4A20200B601000004A3020044
:10958000BE0100000CA30200C601000014A30200EB
:10959000CE0100001CA30200D601000024A302009B
:1095A000DE0100002CA30200E601000034A302004B
:1095B000EE0100003CA30200F6010000B4A202008C
:1095C000FE010000BCA2020006020000C4A20200CC
:1095D0000E020000CCA2020016020000D4A202007B
:1095E0001E020000DCA2020026020000E4A202002B
:1095F0002E020000ECA2020036020000FCA20200D3
:1096000098B10200E09402002CEB0200000001007F
:10961000293200003CEA0200A13100003CEA0200CD
:10962000BD28020078EA0200B13100003CEA0200E5
:10963000F13100003CEA02005D3B00003CEA020020
:109640001D3A000078EA0200D93E00003CEA020020
:10965000553800002CEB02000100FFFF6D3B0000BD
:1096600074C202007F0000000F0000008896020014
:109670003CEA0200A139000078EA0200F93E00004D
:109680003CEA020061390000860F0000560D000020
:109690004E0F00004C960200C60000004C960200DF
:1096A0005E0D0000549602006E0500003496020024
:1096B000760500003C960200660D000078960200D8
:1096C0006E0D000000970200760D00004496020027
:1096D0007E0D000070960200860D000008970200C3
:1096E0008E0D000080960200CE0D000005000000E7
:1096F000D60D000001000000DE0D00000300000098
:109700003CEA02009D29020078EA0200AB2902002F
:1097100098B10200609602009201000099010000D9
:1097200098B102002897020074C2020047000000AE
:109730000800000038970200860F0000561600004F
:10974000CE0C0000DC9702002E170000B897020034
:109750008E12000084970200CE140000CC97020005
:1097600096100000A6130000BE11000078970200BA
:10977000F6140000AC9702002CEB02000000010080
:10978000193F000058D5020002000000AE0C000096
:1097900098970200189702004CA0020003000000F6
:1097A0000300000013000000050000002CEB020085
:1097B00002000200393F00004CA00200030000003C
:1097C0000700000009000000010000000C9A0200E0
:1097D0000000000008000000175003000C9A02006F
:1097E0000000000005000000C10403003CEA020084
:1097F0000D40000074C202001700000002000000CB
:1098000004980200860F0000FE0000004E0F0000CA
:10981000EC97020098B10200F497020058B80200D9
:109820003402000000000000652A02000000000071
:109830000000000000000000000000000000000028
:109840005B2602003D2A020000000000000000002C
:1098500000000000000000004B2B02003B2B020028
:10986000894700000D2B0200D142000058B80200C9
:10987000670200000000000000000000000000007F
:1098800000000000000000000000000000000000D8
:109890005B260200C72B0200000000000000000051
:1098A000000000000000000098B10200B098020023
:1098B00074C202001700000002000000C0980200FD
:1098C000860F00002610000026100000F4B20200EF
:1098D00058B80200CC0000000000000000000000AA
:1098E0000000000000000000000000000000000078
:1098F0000000000000000000000000000000000068
:1099000000000000000000000C99020074C2020078
:1099100047000000080000001C99020076060000C5
:109920008C9902007E0600009499020086060000D1
:109930005C9902008E06000064990200CE050000CA
:1099400074990200D60500007C990200DE05000033
:1099500084990200960600006C99020078EA0200E1
:109960008948000078EA02002148000078EA0200F5
:109970007548000078EA02003948000078EA0200E1
:109980004D48000078EA02006148000078EA0200D1
:109990000549000078EA0200FD470000D098020067
:1099A0000000000000000000954C0000854C000005
:1099B0008D4C000098B10200BC99020074C20200F4
:1099C0004700000008000000CC990200860F00004C
:1099D00016170000CE00000094E80200B615000043
:1099E0008CE80200BE1500009CE80200861600000C
:1099F000B4E802008E160000BCE8020076160000F3
:109A0000A4E802007E160000ACE8020058B802008C
:109A1000C002000065510000E50F000000000000DA
:109A20002D5100009D1D0000000000002D5300007E
:109A30001151000000000000C725020000000000D6
:109A400000000000489A020074C20200B700000043
:109A500016000000589A0200E6110000B4930200BC
:109A6000561500002894020096120000CC930200C4
:109A70005E150000349402004613000000940200BA
:109A8000D6150000589402006E15000040940200A4
:109A9000EE150000649402009E110000A8930200DD
:109AA0002616000070940200D613000010940200E5
:109AB000761500004C94020006120000C0930200CC
:109AC000361500001C9402000E1100009C93020049
:109AD000BE13000008940200061700007C940200E8
:109AE00006130000F0930200BE120000D89302009B
:109AF000C6120000E093020026130000F893020053
:109B0000F6120000E893020058B802006702000055
:109B10000000000000000000000000000000000045
:109B20000000000000000000000000005B260200B2
:109B3000692C02000000000000000000000000008E
:109B400000000000B4EA020065550000860F000026
:109B50006E0C0000960B0000909B02001E07000098
:109B6000849B0200060D0000989B0200760C00000A
:109B7000EC9B020074C202002F00000005000000F0
:109B80004C9B02002CEB02000100FFFF895B0000F0
:109B90003CEA0200595900003CEA02004D54000022
:109BA00074C202000F00000001000000B09B020020
:109BB0008E0C0000449B0200ACA20200F4A2020042
:109BC00004A302009001030100000000A5000100B1
:109BD00001000000E2000300E4B302008F01030073
:109BE000E4B3020098B10200749B020058B802006E
:109BF0008E01000000000000352D02000000000072
:109C0000972C0200E15B0000000000009955000065
:109C10000000000000000000A32C02000000000073
:109C200000000000A09B0200B4EA0200B55C000046
:109C30002CEB02000400FFFF895E000078EA0200BE
:109C40009964000078EA0200AD63000078EA02003F
:109C5000FD5E000078EA02002D5F000078EA020055
:109C6000552D020078EA02005D5F000078EA0200EC
:109C7000795F00002CEB020000000100E5640000A9
:109C8000B4EA0200692D02002CEB0200040003007C
:109C9000496300003CEA0200715E0000B4EA020081
:109CA0002163000078EA0200C72D020078EA020072
:109CB000772D020078EA02003D2602002CEB02001C
:109CC00000000100FD63000078EA02004B2D020055
:109CD00078EA0200612D00003CEA02007D5E00008F
:109CE0002CEB02000300FFFFD32D02002CEB02003F
:109CF0000300FFFFDD2D020078EA02005964000036
:109D000078EA0200852D020078EA0200F96000007E
:109D10002CEB020004000300756400002CEB020031
:109D20000100FFFF8D61000078EA0200416200003F
:109D30002CEB0200020002006D620000F0EA02005B
:109D40008D6300002CEB02000300FFFFE5620000C2
:109D50002CEB020002000200932D020098B10200D9
:109D6000649D020074C20200D70200005A00000085
:109D7000749D0200860F000076100000DE0E0000C9
:109D8000309C0200460F0000F4A30200AE0F00005A
:109D90003C9C020066100000D4E702009E10000008
:109DA000A09202008610000030B302003E110000B5
:109DB00074C20200A61100001C980200DE1100000F
:109DC0006CB30200EE11000088B002002612000001
:109DD000E4900200A61200002CB902009E130000BD
:109DE00088E70200DE130000B8A302008E14000012
:109DF0004CB20200161500006C9002004E150000D7
:109E000094D5020096150000209102004E05000036
:109E1000E8A40200061600000C9A02003E1600009C
:109E20001CB80200B61600004CA00200BE160000CE
:109E300058B802003E170000E8A60200C610000055
:109E4000A4B70200F6150000E0B702000E0E0000F5
:109E500028900200E60F0000449C0200061000005B
:109E60004C9C0200B60B0000549C020056100000EF
:109E70005C9C0200AE100000649C0200BE1000005A
:109E80006C9C02005E110000749C02007E110000B8
:109E9000809C0200AE11000000A40200B611000078
:109EA0000CA402004E120000889C02009E150000C7
:109EB0003C9D020056120000949C02005E120000BD
:109EC0009C9C020066120000A49C02009E00000000
:109ED00040B202007E120000AC9C0200861200001C
:109EE000B49C0200A6000000BC9C0200EE12000020
:109EF00094B702000E1300009CB702003613000056
:109F0000C89C020096130000D09C0200AE13000013
:109F1000D89C0200EE130000E09C02002E1400000A
:109F2000EC9C02007E140000F89C020096140000D5
:109F3000009D0200AE140000089D0200E61400001F
:109F4000109D0200EE1400001C9D02003E15000052
:109F5000289D020066150000309D0200CE1500000D
:109F6000449D020036160000509D0200FE0D0000C8
:109F70001CA80200E60D000068A70200EE0D00001C
:109F8000A4A70200F60D0000E0A70200060E0000E4
:109F900058A80200160E000094A802001E0E000031
:109FA000D0A80200260E00000CA902002E0E000010
:109FB00048A90200360E000084A90200460E0000E7
:109FC000FCA902003E0E0000C0A902004E0E0000D7
:109FD00038AA0200560E000074AA02005E0E0000AD
:109FE000B0AA02006E0E0000ECAA0200760E00007D
:109FF00028AB0200860E000064AB02008E0E00004B
:10A00000A0AB0200960E0000DCAB02009E0E00002A
:10A0100018AC0200A60E000054AC0200AE0E000008
:10A0200090AC0200B60E0000CCAC0200BE0E0000E8
:10A0300008AD0200C60E000044AD02009E140000F0
:10A04000D4BB02004CA002000000000058B802007F
:10A05000D6020000C1650000256800000000000075
:10A0600019660000B166000000000000B167000042
:10A07000A5650000000000000000000000000000D6
:10A08000000000009CA00200B4EA0200172E0200AB
:10A090002CEB020004000400032E020074C2020034
:10A0A0001700000002000000ACA002000E1100002A
:10A0B00088A002009612000090A0020078EA020038
:10A0C000992E020078EA020081720000B4EA0200D0
:10A0D0000172000074C20200670000000C00000062
:10A0E00004A1020074C20200670000000C0000001E
:10A0F00064A1020074C202006F0000000D000000A5
:10A10000C4A102003601000074A302002E01000069
:10A1100054A30200460100006CA302003E010000AF
:10A120004CA302004E01000064A30200560100008F
:10A130005CA302004E02000007000000560200006F
:10A14000030000005E020000010000003E0200006B
:10A15000C4A0020046020000CCA00200960100004C
:10A16000BCA002003601000074A302002E01000012
:10A1700054A30200460100006CA302004E0100003F
:10A1800064A30200560100005CA302005E0100000F
:10A190002CA202004E020000070000005602000040
:10A1A000030000005E020000010000003E0200000B
:10A1B000C4A0020046020000CCA0020096010000EC
:10A1C000BCA002003601000074A302002E010000B2
:10A1D00054A30200460100006CA302003E010000EF
:10A1E0004CA302004E01000064A3020056010000CF
:10A1F0005CA302006601000044A302004E020000BE
:10A200000700000056020000030000005E0200008C
:10A21000010000003E020000C4A00200460200004F
:10A22000CCA0020096010000BCA0020078EA020067
:10A23000A92E020058B80200230000000000000010
:10A24000000000000000000000000000000000000E
:10A2500000000000000000000000000000000000FE
:10A26000000000000000000000000000D4A0020078
:10A2700058B80200220000000000000000000000AA
:10A2800000000000000000000000000000000000CE
:10A2900000000000000000000000000000000000BE
:10A2A0000000000000000000E4A002007CA3020007
:10A2B0000003010034A202000A06040070A202009A
:10A2C0000B1A050070A202000C14010070A202001B
:10A2D0000D17010070A202000E16010070A202000C
:10A2E0000F15010070A202001010010070A2020000
:10A2F000130009007CA302000102010070A2020009
:10A30000141E09007CA302000201010034A2020015
:10A310000304040034A202000405040070A2020039
:10A320000511050070A20200060C040070A20200D4
:10A33000070B040070A202000812010070A20200C4
:10A34000090A040078EA0200CD73000078EA0200EE
:10A350004D73000078EA020049720000B4EA02007E
:10A36000A9730000B4EA020081730000B4EA02009D
:10A37000BD720000B4EA0200A171000058B80200EA
:10A3800024000000000000000000000000000000A9
:10A3900000000000000000000000000000000000BD
:10A3A00000000000000000000000000000000000AD
:10A3B00000000000F4A0020058B802007B02000078
:10A3C00000000000617400000000000000000000B8
:10A3D0000000000000000000000000005B260200FA
:10A3E000BF2E02000000000000000000000000007E
:10A3F000000000002CEB020002000500AD78000018
:10A400002CEB020002000300732F02002CEB020071
:10A41000020003007D2F020074C202002F00000022
:10A420000500000028A40200860F00000E0D0000A9
:10A43000160D000084A40200260D000090A4020066
:10A440001E0D000078A402004E0D0000E0A40200E2
:10A45000E100020240000000A701020248000000E3
:10A46000A601020280000000A50102028000000097
:10A47000A8010102000000002CEB02000300FFFF16
:10A48000872F02002CEB02000300FFFFB32F020016
:10A490002CEB02000300FFFF9D2F020058B80200C2
:10A4A0006702000000000000000000000000000043
:10A4B000000000000000000000000000000000009C
:10A4C0005B260200D97C00000000000000000000B4
:10A4D000000000000000000098B1020018A4020073
:10A4E00078EA0200257D000058B80200A9000000AB
:10A4F000717E00000000000000000000000000006D
:10A50000000000000000000000000000000000004B
:10A51000000000000000000000000000000000003B
:10A520000000000078EA02003D81000078EA0200A5
:10A530001D810000B4EA0200D180000078EA020028
:10A54000FD80000078EA0200CF300200B4EA020089
:10A55000A580000078EA02009D81000078EA0200F0
:10A56000E57E000078EA0200BD81000078EA020082
:10A57000857F000078EA0200BF300200B4EA0200E2
:10A580007980000078EA02004180000078EA020049
:10A590004D7F000078EA0200A17F000078EA020007
:10A5A0002D7F0000B4EA0200118000002CEB0200B5
:10A5B000020002004182000078EA0200D97F000018
:10A5C000B4EA0200DD81000078EA0200097F0000A1
:10A5D00078EA02007D81000078EA0200098200002A
:10A5E00078EA02005D81000078EA0200AF300200E4
:10A5F00098B10200F8A5020074C20200E700000052
:10A600001C00000008A60200860F0000E6130000F0
:10A61000F609000056F8ADC0C6140000DA0FC9C034
:10A62000DE150000D8A50200E6140000C0A5020057
:10A63000C611000064A50200B6130000ACA502001C
:10A640000611000054A50200AE150000D0A50200BE
:10A650005E160000E0A50200EE0F000024A5020037
:10A660002E1000002CA50200461000003CA50200A0
:10A670004E10000034A50200B610000044A50200F0
:10A68000FE1000004CA50200D61100006CA50200CF
:10A69000F611000074A50200FE1100007CA5020066
:10A6A0000E12000084A502006E130000A4A5020093
:10A6B00036140000B8A50200DE1200008CA50200CE
:10A6C000E612000094A50200FE1200009CA5020004
:10A6D000AE160000E8A502000E150000C8A5020095
:10A6E000361100005CA5020058B80200E702000025
:10A6F00000000000CD82000000000000000000000B
:10A700000000000000000000000000005B260200C6
:10A71000DF30020000000000000000000000000028
:10A72000000000002CEB02000200FFFFB5830000D8
:10A7300074C202000F0000000100000040A70200E8
:10A740004E0F000024A70200D0A802000000000065
:10A750000000000044A0020074AA020000000000F3
:10A760000000000044A0020058B80200BC01000034
:10A77000C9830000658300000000000000000000A5
:10A7800000000000518400000000000000000000F4
:10A7900000000000000000000000000094A802007B
:10A7A0000000000058B80200BD010000C98300008D
:10A7B00065830000000000000000000000000000B1
:10A7C00051840000000000000000000000000000B4
:10A7D000000000000000000094A80200000000003B
:10A7E00058B80200BE010000C98300006583000064
:10A7F0000000000000000000000000005184000084
:10A800000000000000000000000000000000000048
:10A810000000000094A802000000000058B80200E8
:10A82000BF010000C9830000658300000000000034
:10A830000000000000000000518400000000000043
:10A840000000000000000000000000000000000008
:10A850000000000030A7020058B80200C00100004C
:10A86000C9830000658300000000000000000000B4
:10A870000000000051840000000000000000000003
:10A8800000000000000000000000000094A802008A
:10A890000000000058B80200C2010000C983000097
:10A8A00065830000000000000000000000000000C0
:10A8B00051840000000000000000000000000000C3
:10A8C00000000000000000001CA8020000000000C2
:10A8D00058B80200C3010000C9830000658300006E
:10A8E0000000000000000000000000005184000093
:10A8F0000000000000000000000000000000000058
:10A90000000000001CA802000000000058B802006F
:10A91000C4010000C983000065830000000000003E
:10A920000000000000000000518400000000000052
:10A930000000000000000000000000000000000017
:10A9400094A802000000000058B80200C5010000F1
:10A95000C9830000658300000000000000000000C3
:10A960000000000051840000000000000000000012
:10A9700000000000000000000000000018AC020011
:10A980000000000058B80200C6010000C9830000A2
:10A9900065830000000000000000000000000000CF
:10A9A00051840000000000000000000000000000D2
:10A9B000000000000000000038AA020000000000B3
:10A9C00058B80200C7010000C98300006583000079
:10A9D00000000000000000000000000051840000A2
:10A9E0000000000000000000000000000000000067
:10A9F0000000000038AA02000000000058B8020061
:10AA0000C8010000C9830000658300000000000049
:10AA10000000000000000000518400000000000061
:10AA20000000000000000000000000000000000026
:10AA30001CA802000000000058B80200C901000074
:10AA4000C9830000658300000000000000000000D2
:10AA50000000000051840000000000000000000021
:10AA600000000000000000000000000094A80200A8
:10AA70000000000058B80200CA010000C9830000AD
:10AA800065830000000000000000000000000000DE
:10AA900051840000000000000000000000000000E1
:10AAA000000000000000000094A802000000000068
:10AAB00058B80200CB010000C98300006583000084
:10AAC00000000000000000000000000051840000B1
:10AAD0000000000000000000000000000000000076
:10AAE0000000000094A802000000000058B8020016
:10AAF000CD010000C9830000658300000000000054
:10AB00000000000000000000518400000000000070
:10AB10000000000000000000000000000000000035
:10AB2000A0AB02000000000058B80200CE010000F7
:10AB3000C9830000658300000000000000000000E1
:10AB40000000000051840000000000000000000030
:10AB500000000000000000000000000094A80200B7
:10AB60000000000058B80200D0010000C9830000B6
:10AB700065830000000000000000000000000000ED
:10AB800051840000000000000000000000000000F0
:10AB9000000000000000000068A7020000000000A4
:10ABA00058B80200D1010000C9830000658300008D
:10ABB00000000000000000000000000051840000C0
:10ABC0000000000000000000000000000000000085
:10ABD0000000000094A802000000000058B8020025
:10ABE000D2010000C983000065830000000000005E
:10ABF0000000000000000000518400000000000080
:10AC00000000000000000000000000000000000044
:10AC100094A802000000000058B80200D301000010
:10AC2000C9830000658300000000000000000000F0
:10AC3000000000005184000000000000000000003F
:10AC400000000000000000000000000094A80200C6
:10AC50000000000058B80200D4010000C9830000C1
:10AC600065830000000000000000000000000000FC
:10AC700051840000000000000000000000000000FF
:10AC800000000000000000001CA8020000000000FE
:10AC900058B80200D5010000C98300006583000098
:10ACA00000000000000000000000000051840000CF
:10ACB0000000000000000000000000000000000094
:10ACC0000000000094A802000000000058B8020034
:10ACD000D6010000C9830000658300000000000069
:10ACE000000000000000000051840000000000008F
:10ACF0000000000000000000000000000000000054
:10AD000008AD02000000000058B80200D7010000A2
:10AD1000C9830000658300000000000000000000FF
:10AD2000000000005184000000000000000000004E
:10AD300000000000000000000000000094A80200D5
:10AD40000000000058B80200D8010000C9830000CC
:10AD5000658300000000000000000000000000000B
:10AD6000518400000000000000000000000000000E
:10AD7000000000000000000068A7020000000000C2
:10AD800000960200AA0E030008960200DB0E0300E4
:10AD900024960200400F03001C960200BE0F030021
:10ADA0002C9602000310030084E902003710030010
:10ADB0006CE902008E10030074E90200C610030063
:10ADC0007CE90200FE10030054BC02008C11030059
:10ADD00060BC0200D811030074BC020024120300FE
:10ADE0007CBC0200661203006CBC0200E11203008E
:10ADF0008C990200451303009C9902007D13030007
:10AE000094990200201403005C990200AC14030022
:10AE1000649902004115030074990200A41503000F
:10AE20007C9902005016030084990200FC1603006E
:10AE30006C990200A81703001C000020DD17030016
:10AE40001CC00200FB17030004C00200A818030086
:10AE5000D4BF020041190300DCBF02006C190300DB
:10AE600010C00200FD190300F4BF0200861A03009F
:10AE7000ECBF0200A81A0300E4BF0200CC1A0300D2
:10AE8000FCBF02001A1B0300ACA20200751B0300EA
:10AE9000F4A20200A41B030004A30200D31B0300BE
:10AEA0000CA30200021C030014A30200311C0300C7
:10AEB0001CA30200601C030024A302008F1C0300DB
:10AEC0002CA30200BE1C030034A30200ED1C0300EF
:10AED0003CA302001C1D0300B4A202004B1D030092
:10AEE000BCA202007B1D0300C4A20200AB1D030034
:10AEF000CCA20200DB1D0300D4A202000B1E030043
:10AF0000DCA202003B1E0300E4A202006B1E030051
:10AF1000ECA202009B1E0300FCA20200CB1E030059
:10AF200074A30200FB1E030054A30200591F030078
:10AF30006CA30200A31F03004CA30200F91F03002F
:10AF400044A302006D20030014BE0200CB200300C6
:10AF50001CBE02006921030028BE0200B4210300C8
:10AF600008BE02000A22030008E502004C2203008A
:10AF700044E5020040230300CCE402006A230300FE
:10AF8000C4E4020095230300DCE40200242403004F
:10AF9000F0E40200AF240300F8E4020000250300FF
:10AFA00000E5020053250300E8E4020099250300B0
:10AFB000B0E40200E3250300B8E402001626030013
:10AFC000D4E40200CB2603006400002056270300CF
:10AFD000A0E602009B27030098E602003028030049
:10AFE00068EB02009828030080EB0200E9280300C8
:10AFF00074EB02002C2903008CEB0200AC29030047
:10B0000054000020F8290300D8D70200592A030071
:10B01000F0D702000C2B0300E4D70200542B0300EE
:10B02000F8D702007C2B030024D10200492C030036
:10B030000CD10200982C0300ECD00200072D030075
:10B04000F8D00200A72D0300E4D00200382E030040
:10B0500018D10200912E030004D10200BB2E030080
:10B0600014980200FB2E0300E4B90200162F03001F
:10B07000DCB902009A2F030014BD0200E62F030082
:10B080000CBD02001F30030058B802003D02000052
:10B090009D870000FD870000000000003D87000044
:10B0A0001B3402000000000000000000000000004F
:10B0B0000000000000000000000000000000000090
:10B0C00000000000CF00000019000000D0B0020016
:10B0D000760F000068B90200761000005C9D020047
:10B0E000AE0C000078BE020026100000A8980200F6
:10B0F000C616000090BC02000E17000050E80200C7
:10B10000E6130000F0A5020056160000209702008A
:10B110003612000044E10200BE000000009602006A
:10B12000F606000024D10200EE000000E4B902009F
:10B13000FE000000149802000601000014BD020089
:10B140001E0C00003CC30200360C0000B8C0020018
:10B150009E0C000020D60200560D00001097020041
:10B160006E0C0000E49B02000E0D0000D8A402004B
:10B1700016170000B4990200F60C0000CCD60200AD
:10B18000AE00000090BC0200B600000050E80200D3
:10B1900096160000B499020058B802008702000019
:10B1A000258A0000000000000000000000000000F0
:10B1B00000000000598A00000000000000000000AC
:10B1C000000000000000000000000000000000007F
:10B1D0000000000006000000000000000000000069
:10B1E00000000000000000002D000000D535020026
:10B1F00025000000D535020026000000D5350200EC
:10B200009F000000758E00002F000000758E00006A
:10B21000DE000000758E00008D010000D5350200B3
:10B2200030000000D5350200D4000000758E00000B
:10B230007D010000758E000028000000D735020057
:10B240002CEB020000000100058F000058B802003E
:10B250009102000000000000E13502000000000043
:10B2600000000000000000000000000000000000DE
:10B2700000000000000000000000000000000000CE
:10B280000000000000000000B4EA020095910000F8
:10B29000B4EA02002991000058B8020067020000D9
:10B2A000000000000000000000000000000000009E
:10B2B0000000000000000000000000005B2602000B
:10B2C0001F36020000000000000000000000000027
:10B2D0000000000074C2020017000000020000001D
:10B2E000E4B202001610000088B20200CE11000085
:10B2F00090B2020058B80200040200003594000029
:10B300004136020000000000ED9000004592000070
:10B3100000000000C1940000159100000000000032
:10B32000FD3502000000000000000000D4B2020061
:10B3300058B8020010020000359400006595000026
:10B3400000000000ED9000004592000000000000A9
:10B35000C19400001591000000000000FD350200BE
:10B360000000000000000000D4B2020058B8020043
:10B370003B020000000000007336020000000000E5
:10B3800000000000000000000000000000000000BD
:10B390005B260200C99500000000000000000000CC
:10B3A000000000000000000058B802006702000022
:10B3B000000000000000000000000000000000008D
:10B3C0000000000000000000000000005B260200FA
:10B3D000FD950000000000000000000000000000DB
:10B3E00000000000E8B3020058B80200CC010000E1
:10B3F0006996000000000000000000007F260200A7
:10B40000000000000000000000000000000000003C
:10B41000000000000000000000000000000000002C
:10B420000000000008E502000951815F08E5020004
:10B4300001047D4408E5020001C4554208E502000C
:10B44000011C531108E502000967140408E5020015
:10B450000184544708E50200094150CC08E5020088
:10B460000110957108E5020001447C4108E50200E5
:10B470000160030708E5020009FB93BF08E502002D
:10B4800001AAAAAA08E502000160100008E502006E
:10B490000142100008E502000184100008E50200E6
:10B4A0000108110008E502000100130008E5020090
:10B4B0000100700008E502000100100C08E5020020
:10B4C0000100108408E502000100104208E50200B6
:10B4D0000100102108E502000100900108E50200CA
:10B4E00001001C0008E502000940015508E50200C2
:10B4F00001317E4708E502000144454508E50200A8
:10B500000180280208E5020001E6780708E502004C
:10B51000017F03E508E5020009BFFE5F08E50200C0
:10B52000014308A708E50200014081E808E50200A0
:10B5300001EA7F4708E502000140390208E5020000
:10B5400001C47DA708E50200010A202208E50200E7
:10B550000184907308E502000184D17308E50200BC
:10B56000095ECABD08E502000951111508E502008F
:10B57000097E9DE708E5020001B57E4208E502006C
:10B5800001A5BCF508E502000118FFAF08E50200BF
:10B590000940011708E5020009117CCA08E502000C
:10B5A00001AE7EE708E50200010080E808E5020040
:10B5B00001632B0708E50200093FC6F808E5020011
:10B5C00001C0290708E5020009E4131508E5020097
:10B5D000010A104508E502000184104708E5020051
:10B5E00001C46D4708E5020001C07D0508E50200C1
:10B5F000096194F408E502000180A80F08E5020043
:10B6000001FB3BE708E5020001EE936208E502005A
:10B6100009C411F708E502000100A22200000000A1
:10B620000000000079960000A53602000F390200E4
:10B630000F39020069A50000273C02000F39020003
:10B6400025A00000773A0200399800000F39020067
:10B650002DAA000001AA000059AC0000FF3802002A
:10B66000E13F0200299800009545020091A90000E1
:10B6700005A9000029B000006D440200C943020082
:10B6800039A10000313E0200073D02000F390200DF
:10B690006F4302004F3802004F3802001F3B020088
:10B6A000153B0200CB3A0200293B02007D9A0000C4
:10B6B000C13A0200B73A0200AD3A0200D199000047
:10B6C000D1990000D1990000BB3F0200253902004A
:10B6D00089B000005D3F0200CB3E020011AD0000CA
:10B6E0009B3D0200EF38020063370200773A020008
:10B6F0002F3A0200133A0200773A0200D1380200D2
:10B70000853D02009DAC00003D3C020000000000B1
:10B710000000000000000000000000000000000029
:10B72000D9010000FA010000000000000000000044
:10B730000000000000000000000000000000000009
:10B7400000000000000000000000000000000000F9
:10B7500000000000000000000000000000000000E9
:10B7600000000000000000000000000000000000D9
:10B77000ED010000E6010000E1010000EB01000026
:10B78000E301000000000000DE01000000000000F6
:10B7900001000000B4EA0200D5480200B4EA020049
:10B7A000B1BD000058B802001802000000000000FF
:10B7B00055470200000000000000000000000000EB
:10B7C0000000000000000000000000000000000079
:10B7D0000000000000000000000000000000000069
:10B7E00058B80200BE0200000000000055470200E9
:10B7F0000000000000000000000000000000000049
:10B800000000000000000000000000000000000038
:10B8100000000000000000000000000058B8020016
:10B82000C702000035BA000079470200000000009E
:10B830000000000000000000E9B700000000000068
:10B8400000000000000000000000000000000000F8
:10B85000000000000000000058B80200D7020000FD
:10B8600059B8000079BC000075BA00007F260200BC
:10B8700000000000A14702000000000000000000DE
:10B8800000000000000000000000000000000000B8
:10B8900000000000DA010000EC010000E7010000F8
:10B8A0000000000000000000000000000100000097
:10B8B0001FB14F0A9595E62477CC2B3217B7D138B4
:10B8C0000AD7233CCDCCCC3DAEC59D74CA1B0E5AC5
:10B8D00020BCBE4C00401C460000C8420000204175
:10B8E0002CEB0200040003005DC200002CEB020000
:10B8F0000600040015C30000A4B70200ECB8020063
:10B9000074C20200170000000200000010B902001B
:10B9100016120000F8B80200A616000020B90200B6
:10B920002CEB02000600040095C2000058B802008B
:10B93000540200006349020001C40000000000003E
:10B9400065F800003DF90000000000000000000064
:10B9500000000000000000000000000000000000E7
:10B960000000000000B9020098B10200C82E0020BB
:10B9700058B802004502000000000000000000006E
:10B9800065D700000000000000000000000000007B
:10B9900000000000000000000000000000000000A7
:10B9A0000000000000000000000000003CEA02006F
:10B9B000E1D7000074C202001F0000000300000075
:10B9C000C4B90200860F0000EE0000004E0F000018
:10B9D000ACB90200F6000000DCB902003CEA02004B
:10B9E000C1D7000098B10200B4B902004CA0020017
:10B9F0000800000034B402003CB402002CB4020081
:10BA000054B402004CB402005CB4020064B40200FE
:10BA100044B402004CA002000C00000094B40200E8
:10BA20009CB40200A4B40200ACB40200B4B402009E
:10BA3000BCB40200C4B40200CCB40200D4B402000E
:10BA4000DCB4020084B402008CB402000100E20401
:10BA50000000000000FC00000000000000000000EA
:10BA600000000000000000000000000000000000D6
:10BA700000000000000000000000000094BA020076
:10BA80000200000094BA02000400000094BA020010
:10BA90000100000058B802007E020000FDDB00003B
:10BAA0000000000000000000000000000000000096
:10BAB0000000000011DC0000000000000000000099
:10BAC0000000000000000000000000000000000076
:10BAD00019360000C1360000000000000000000020
:10BAE0002CEB02000800040061E5000058B80200D9
:10BAF0009A010000000000000000000000000000AB
:10BB00000000000000000000000000000000000035
:10BB1000000000000000000000000000D0BA020099
:10BB20000000000030BB020078EA020051E500008E
:10BB300074C202004F0000000900000040BB020078
:10BB4000CE10000028BB0200960C000088BB02004B
:10BB5000060F000084940200160F0000E0BA0200F5
:10BB6000E60C000090BB0200AE06000068EB02008D
:10BB7000CE0B000074EB0200C60B000080EB02004D
:10BB8000B60600008CEB020078EA020011350000D6
:10BB900078EA02003DE5000058B802009B01000071
:10BBA0000000000000000000000000000000000095
:10BBB0000000000000000000000000000000000085
:10BBC0000000000000000000E0BB020000000000D8
:10BBD00030BB02002CEB02000200020071E5000005
:10BBE00019360000C136000000000000010000000E
:10BBF00058B80200B1000000000000000000000082
:10BC00000000000000000000000000000000000034
:10BC10000000000000000000000000000000000024
:10BC200000000000000000002CBC020074C20200F2
:10BC30001F000000030000003CBC0200A60500003D
:10BC400074BC0200AE0500007CBC0200B60500001A
:10BC50006CBC0200F0BB02001CA30200000000004C
:10BC6000F0BB0200BCA202000100000078EA020062
:10BC700049E6000078EA0200FDE5000078EA0200EB
:10BC800021E60000000001000000020000000400A6
:10BC900098B1020098BC020074C202001F000000AC
:10BCA00003000000A8BC0200860F0000C6160000BA
:10BCB00076140000289C02007E0E0000B0C2020034
:10BCC0003CEA0200CDEA000074C202001F0000003E
:10BCD00003000000D8BC0200860F0000060100002F
:10BCE0004E0F0000C0BC02000E0100000CBD02009F
:10BCF00000000000398EE33D398E633E398EE33E0D
:10BD0000ABAA2A3F721C473F0000803F3CEA02007A
:10BD1000CDEA000098B10200C8BC0200214B02002D
:10BD20002B4B0200174D02002F4D02002B4C02003E
:10BD3000554C02006D4C0200854C02009D4C0200E7
:10BD4000C94C0200E34C0200FD4C020058B802004E
:10BD5000D300000000000000000000000000000010
:10BD600000000000000000000000000000000000D3
:10BD700000000000000000000000000000000000C3
:10BD80000000000090BD020078EA02009DEE000075
:10BD900074C202002700000004000000A0BD0200E1
:10BDA000760B000008BE02007E15000088BD020070
:10BDB000AE0600001CBE0200B606000028BE02004F
:10BDC000DB000200A0860100DC000300E4B30200F7
:10BDD000DD000300E4B30200D70002010000000010
:10BDE000D800020100000000DA000100000000009D
:10BDF000D700020100000000D9000301000000008C
:10BE0000DA000100000000002CEB02000300FFFF3D
:10BE100095ED00004CBD0200DC2900202CEB020057
:10BE20000300FFFFE9ED00002CEB02000300FFFF21
:10BE300045EE00003CEA020071EF00003CEA02001F
:10BE400061EF000078EA02004DEF00002CEB0200E9
:10BE50000000010015EF00002CEB020000000100C3
:10BE6000C1EF00002CEB02000000010081EF000098
:10BE70003CEA0200CB53020098B1020080BE0200EF
:10BE800074C202004F0000000900000090BE0200D2
:10BE9000860F0000AE0C0000F61000008494020033
:10BEA000A614000058BE0200261400004CBE02007A
:10BEB0000615000064BE0200E615000070BE020018
:10BEC0006E12000034BE0200761200003CBE02007A
:10BED0004E13000044BE02000500000005000000F3
:10BEE00003000000090000000D040000E841030009
:10BEF00058B802009C000000000000000000000094
:10BF00000000000000000000000000000000000031
:10BF10000000000000000000000000000000000021
:10BF200000000000000000002CBF020074C20200EC
:10BF30004F000000090000003CBF0200A602000004
:10BF4000DCBF02009E02000010C0020006050000D7
:10BF50001CC002000E05000004C002002E0C0000F0
:10BF6000D4BF02006E050000F4BF02007605000099
:10BF7000ECBF02007E050000E4BF020026150000B1
:10BF8000FCBF02004E00030100000000A2000200FE
:10BF9000900100008501010200000000A5000102DF
:10BFA00001000000A600010200000000AA00030139
:10BFB00000000000A200020096000000A50001029F
:10BFC000010000005900010200000000A60001026B
:10BFD0000000000078EA020085F60000F0EA0200A6
:10BFE000BF54020078EA020095F0000078EA0200EF
:10BFF000A9F0000078EA02001DF7000078EA0200CC
:10C0000005F100002CEB02000300FFFFD5F5000056
:10C010002CEB020008000400CDF600002CEB02001F
:10C020000300FFFFD5F400002CEB0200000001002C
:10C03000DDF7000078EA020001F800003CEA0200A7
:10C04000C1F70000B4EA02001D550200B4EA020084
:10C0500081F700002CEB02000200030047550200AC
:10C0600074C20200470000000800000078C002000F
:10C0700078EA0200B1550200860F0000360C00007D
:10C080003E0C000070C00200460C000028C00200F8
:10C090004E0C000054C00200560C000044C00200C8
:10C0A0005E0C000034C00200360C00003CC00200F0
:10C0B000660C00004CC0020098B1020060C0020093
:10C0C00058B802000100000000000000000000005D
:10C0D0000000000000000000000000000000000060
:10C0E0000000000000000000000000000000000050
:10C0F00000000000000000000000000078EA0200DC
:10C10000CDFB000078EA02001D5802002CEB020073
:10C1100004000300D1FF0000A4B702000CC102001C
:10C120002CEB0200040003006B57020078EA0200C7
:10C1300065FF000078EA020081FF000074C202007F
:10C14000770000000E0000004CC102002E0C000021
:10C15000FCC002003E05000004C102001E120000E7
:10C1600018C102004612000020C102002E13000078
:10C170002CC102005E13000034C10200D61400007E
:10C18000BCC10200DE140000C8C10200A6150000F8
:10C19000D0C10200FE160000DCC10200261700001C
:10C1A000E8C102002E0F0000F8E00200C60F0000F8
:10C1B00000E10200FE0E0000F0E002002CEB0200A5
:10C1C000040003006157020078EA0200B1FD00009C
:10C1D0002CEB020004000300575702002CEB020076
:10C1E0000300FFFFD1FC000078EA0200B1FB000071
:10C1F00058B80200670200000000000000000000C4
:10C20000000000000000000000000000000000002E
:10C21000000000005B260200B3570200000000008F
:10C2200000000000000000000000000058B80200FC
:10C230002802000059FC000000000000000000007F
:10C2400000000000ED5702000000000000000000A8
:10C2500099FB00000000000000000000000000004A
:10C260000000000000000000C0420300CB420300B9
:10C27000D542030058B8020027020000D1FE00009A
:10C280001D00010000000000DDFB0000F5FD0000C6
:10C29000000000006D0001007DFB000000000000B8
:10C2A0000000000000000000000000003CC102008F
:10C2B00058B80200CF010000D1FE00001D000100AF
:10C2C00000000000DDFB0000F5FD000000000000A4
:10C2D0006D0001007DFB0000000000000000000078
:10C2E0000000000074C202003CC1020078EA0200B3
:10C2F000AD00010078EA0200E101010074C2020011
:10C3000017000000020000001CC3020074C20200FB
:10C3100017000000020000002CC302002E0C0000D9
:10C32000F4C2020006050000ECC20200860F000005
:10C330001E0C0000260C000044C3020098B102004D
:10C340000CC3020058B80200840100000000000085
:10C350006D01010000000000A7580200000000006D
:10C3600000000000D50001000000000000000000F7
:10C37000000000000000000000000000FCC20200FD
:10C38000A2000000A7000000A70000007F0000003E
:10C3900080000000E20000003C0000003C000000C3
:10C3A0000000000000000000E10000003C00000070
:10C3B0003B0000000000000000000000C80000007A
:10C3C0000000000000000000360000003700000000
:10C3D000C700000000000000000000003600000060
:10C3E0003600000000000000000000000A0000000D
:10C3F000E8020000364F0300394F0300434F0300AB
:10C40000474F03004B4F03004F4F0300554F0300AE
:10C410005B4F0300634F0300674F03008A4F030025
:10C42000954F0300A04F0300AD4F0300BA4F030028
:10C43000C64F0300D24F0300DD4F0300E74F030058
:10C44000EF4F0300F64F0300FE4F03000C500300B4
:10C450001550030020500300285003003050030003
:10C460003F50030047500300555003005C50030049
:10C4700066500300745003007B5003008650030095
:10C480009B500300B6500300C9500300D85003006E
:10C49000E8500300F6500300055103001951030052
:10C4A0003A5103005B5103006851030071510300CE
:10C4B0007E510300875103008F5103009451030004
:10C4C0009F510300AC510300B3510300BA51030064
:10C4D000C1510300C8510300CF510300D6510300DE
:10C4E000DD510300E4510300EB510300F25103005E
:10C4F000FA510300025203000A52030012520300D1
:10C500001A520300225203002A520300325203003F
:10C510003A52030045520300505203005A5203009E
:10C5200066520300705203008052030088520300D9
:10C530009052030098520300A1520300AA52030034
:10C54000B1520300BD520300C9520300D65203008A
:10C55000E4520300EF520300FC52030008530300AF
:10C560000F53030017530300255303002D530300FB
:10C57000335303003B530300465303004E53030061
:10C5800057530300635303006B53030076530300B8
:10C590007C5303008253030087530300915303002D
:10C5A0009A530300A3530300AC530300B553030095
:10C5B000BE530300C7530300D0530300D9530300F5
:10C5C000E2530300EC530300F6530300005403004E
:10C5D0000B54030015540300205403002A54030095
:10C5E000355403003F5403004A54030055540300DC
:10C5F00065540300725403007C5403008C54030000
:10C6000095540300A4540300AD540300B354030035
:10C61000C4540300D3540300E3540300EF54030055
:10C62000F6540300FF54030008550300115503009E
:10C630001F550300265503002E55030039550300EE
:10C6400045550300535503005B5503006355030034
:10C650006D55030075550300805503008855030090
:10C6600095550300A2550300B4550300C5550300BA
:10C67000D8550300E2550300E9550300F2550300C5
:10C68000FA550300035603000B560300125603002D
:10C690001956030020560300275603002F560300A7
:10C6A0003656030044560300565603005B560300FB
:10C6B0006156030069560300725603008356030057
:10C6C0008E56030099560300A6560300B456030085
:10C6D000C2560300DA560300EA560300F25603007E
:10C6E000FA560300025703000F57030021570300B7
:10C6F0002E5703003C5703004B57030050570300CD
:10C70000575703005E570300665703007057030036
:10C710007C570300875703008C5703009157030091
:10C72000965703009E570300B0570300BA57030003
:10C73000C4570300D4570300E0570300F457030025
:10C7400009580300175803001D580300245803001C
:10C750002C58030033580300375803003D5803009A
:10C76000465803004D58030053580300595803001E
:10C77000615803006D580300785803008058030087
:10C78000865803008D58030099580300A5580300EC
:10C79000AB580300B3580300BB580300C55803004F
:10C7A000D0580300D8580300E0580300EC580300A9
:10C7B000FA580300045903000B59030017590300EA
:10C7C00021590300285903002E5903003B59030047
:10C7D00046590300505903005C5903006559030092
:10C7E000705903007C590300865903008A590300DD
:10C7F0008F590300965903009D590300A259030065
:10C80000A7590300AE590300B5590300BB590300F3
:10C81000C1590300C7590300CD590300D159030082
:10C82000D8590300DD590300E2590300E959030018
:10C83000F0590300F5590300FC590300025A0300A4
:10C84000085A03000C5A0300115A0300175A030038
:10C850001F5A0300275A03002E5A0300355A0300BB
:10C860003C5A0300415A0300485A03004F5A030040
:10C87000545A03005B5A0300625A0300695A0300CA
:10C880006E5A0300755A03007C5A0300835A030052
:10C890008A5A0300905A0300965A03009C5A0300D8
:10C8A000A25A0300A85A0300AC5A0300B15A03006D
:10C8B000B95A0300C05A0300C75A0300CC5A0300F8
:10C8C000D15A0300D85A0300DD5A0300E45A03008A
:10C8D000EB5A0300F15A0300F75A0300FD5A030014
:10C8E000035B0300095B03000F5B0300155B0300A0
:10C8F000195B0300205B0300255B03002C5B030036
:10C90000315B0300385B03003E5B0300445B0300C4
:10C910004A5B0300505B0300565B03005C5B030053
:10C92000625B0300695B03006D5B0300725B0300E5
:10C93000785B0300805B0300875B03008E5B030072
:10C94000955B03009A5B0300A05B0300A65B0300FA
:10C95000AC5B0300B25B0300B85B0300BC5B03008D
:10C96000C15B0300C85B0300CF5B0300D65B030021
:10C97000DB5B0300E25B0300E95B0300EE5B0300AB
:10C98000F55B0300FB5B0300015C0300075C030035
:10C990000D5C0300115C0300185C03001E5C0300C7
:10C9A000245C03002A5C0300395C0300405C030044
:10C9B000475C0300525C0300595C0300625C0300A7
:10C9C000695C0300705C0300755C03007A5C030023
:10C9D000805C03008A5C0300955C0300A05C03009C
:10C9E000A65C0300AD5C0300BB5C0300C15C0300FC
:10C9F000C85C0300CF5C0300D65C0300DD5C030071
:10CA0000EE5C0300F95C0300045D03000C5D0300B1
:10CA1000155D0300235D03002A5D0300365D0300FE
:10CA2000405D0300495D0300535D03005B5D03004F
:10CA3000685D0300755D03007E5D0300895D030092
:10CA4000905D0300955D03009D5D0300AB5D0300F9
:10CA5000B55D0300C05D0300CA5D0300D45D030043
:10CA6000DE5D0300E75D0300F25D0300FC5D030093
:10CA7000065E03000D5E03001A5E0300235E0300E2
:10CA8000295E0300355E03003C5E0300455E030043
:10CA90004D5E0300555E03005D5E0300695E0300AA
:10CAA000715E03007A5E0300875E0300975E0300F9
:10CAB0009E5E0300A85E0300BD5E0300CC5E030023
:10CAC000D55E0300DD5E0300E75E0300EF5E03005A
:10CAD000FB5E0300055F03000D5F03001C5F0300A6
:10CAE000295F0300365F0300485F0300595F0300BE
:10CAF0006A5F03007A5F0300855F0300905F0300B5
:10CB00009C5F0300AC5F0300BA5F0300CD5F0300CE
:10CB1000DA5F0300E55F0300F95F030007600300CD
:10CB200015600300216003002C60030042600300D5
:10CB30004C6003005A6003006A60030079600300E0
:10CB40008960030097600300A4600300B0600300E5
:10CB5000BF600300CC600300E0600300EA600300F4
:10CB6000F560030007610300126103001E6103000A
:10CB70002D6103003B610300476103005061030026
:10CB80005B61030064610300726103008061030064
:10CB90008961030094610300A1610300AC6103009B
:10CBA000B7610300C0610300CA610300D3610300E1
:10CBB000DE610300EB610300F66103000062030025
:10CBC0000B62030016620300256203003662030055
:10CBD00041620300506203005E620300686203006A
:10CBE0007262030082620300886203008F620300A6
:10CBF000956203009D620300A3620300AA62030022
:10CC0000B3620300BA620300C2620300C962030098
:10CC1000D5620300DB620300E2620300EA62030004
:10CC2000F0620300F5620300FC6203000B63030083
:10CC3000166303001B6303002763030032630300D2
:10CC40003E63030046630300516303005C6303001B
:10CC50006363030069630300776303007F6303007A
:10CC6000896303008F630300956303009F630300E0
:10CC7000A7630300B2630300B8630300C06303004B
:10CC8000C8630300D0630300D7630300E1630300BC
:10CC9000EB630300F2630300FE6303000B64030015
:10CCA0001F640300256403002F6403003D64030038
:10CCB0004764030050640300596403006664030082
:10CCC0006C64030077640300836403008A640300D8
:10CCD00091640300986403009E640300A76403004A
:10CCE000AE640300B7640300BE640300C6640300BF
:10CCF000CE640300D5640300DE640300E664030031
:10CD0000F3640300FE6403000A6503001565030075
:10CD10001A650300266503002C65030036650300D1
:10CD2000406503004A650300516503005D6503002B
:10CD30006B6503007165030076650300876503007A
:10CD40008F650300986503009E650300AD650300D1
:10CD5000C3650300CD650300D7650300E4650300E8
:10CD6000F0650300FB650300036603001066030023
:10CD70001A660300226603002C660300396603006E
:10CD800044660300516603005B66030063660300AC
:10CD90006A660300756603007C660300876603000D
:10CDA0008D660300946603009C660300A46603007E
:10CDB000AA660300B1660300B9660300C0660300FB
:10CDC000C6660300CD660300D6660300DF66030077
:10CDD000E5660300ED660300F3660300F9660300F1
:10CDE00002670300086703000F670300156703006D
:10CDF0001B670300236703002B67030032670300F0
:10CE00003E67030049670300546703005A67030045
:10CE1000616703006A670300746703007A670300B1
:10CE2000816703008867030090670300966703002B
:10CE3000A3670300AA670300B0670300B967030094
:10CE4000BF670300C6670300D2670300D86703000B
:10CE5000DF670300EB670300F0670300FB67030075
:10CE6000016803000B6803001168030019680300E0
:10CE70002B680300326803003E6803004868030023
:10CE800050680300576803006A6803007368030072
:10CE90007D680300846803008E68030099680300BE
:10CEA000A1680300AA680300B2680300BB6803001E
:10CEB000C4680300CB680300D2680300D86803008D
:10CEC000DE680300E8680300F5680300FB68030000
:10CED0000669030011690300186903002169030052
:10CEE00029690300306903003C69030049690300B4
:10CEF000586903005F690300656903006C690300FA
:10CF0000746903007B690300836903008969030076
:10CF10008F69030097690300AE690300CC690300C1
:10CF2000D2690300D8690300E4690300EC690300D7
:10CF3000F8690300056A0300106A03001B6A030016
:10CF4000226A0300326A03003D6A0300456A030057
:10CF50004D6A0300546A0300636A03006A6A0300AF
:10CF6000716A0300796A0300856A03008E6A030010
:10CF70009C6A0300A56A0300AD6A0300B76A030058
:10CF8000BF6A0300C76A0300D06A0300DF6A0300B8
:10CF9000E56A03003CEA0200C50E010074C202000B
:10CFA000EF0000001D000000ACCF0200860F000063
:10CFB000F60600004E0F000094CF0200C6000000ED
:10CFC00004D10200260700000CD102002E07000049
:10CFD000E4D002001E070000F8D002000E07000097
:10CFE000ECD00200960B000018D102006E07000082
:10CFF00014DA02007607000044DA0200BE070000DF
:10D00000C0DD0200A607000000DD02009E07000050
:10D0100050DB0200D607000038E00200860700005F
:10D02000C8DA02005E070000A4D80200560700001C
:10D0300038D80200E607000098E002007E070000F2
:10D0400094DA0200C6070000C8DE0200CE07000026
:10D05000F4DE02004607000010D802006607000058
:10D060006CD902004E07000000D80200DE07000065
:10D0700074E002009607000034DB02008E07000017
:10D0800018DB0200B6070000A0DD0200AE070000BA
:10D0900080DD0200DE00030100000000E20003006A
:10D0A000ACA20200A500010001000000A6000100E2
:10D0B00000000000DF00020100000000E0000200AC
:10D0C000FFFFFFFFE2000300ACA20200A500010089
:10D0D00001000000E700020200000000E60002027A
:10D0E000000000003CEA0200A10C01002CEB020051
:10D0F0000100FFFF090E01002CEB02000100FFFF01
:10D10000510D01003CEA0200550C01002CEB02001D
:10D110000100FFFF110D01002CEB020000000100D7
:10D12000C90C010098B102009CCF020058B802005F
:10D130001A02000000000000000000008F590200E9
:10D1400000000000000000000000000000000000DF
:10D1500000000000000000000000000000000000CF
:10D1600000000000000000004F6B030011350300B9
:10D17000556B03005A6B0300646B0300686B03007C
:10D180006B6B0300726B030081390300786B030043
:10D1900094870300816B0300856B03008A6B030097
:10D1A0008F6B0300966B0300620D0300976A030008
:10D1B000B8360300876B0300820D0300C6500300DE
:10D1C000595003009E6B03001A370300A56B030040
:10D1D000630D0300AB570300CE820300A96B03006D
:10D1E000660D03005C0D030072640300B06B030066
:10D1F00078EA02000918010074C202001F00000052
:10D200000300000008D20200CE100000F0D102009E
:10D21000760D000020D202006E16000028D2020017
:10D22000B4EA0200E15B02002CEB020004000400FF
:10D23000D517010058B8020047020000AD160100E2
:10D2400000000000000000007F2602000000000037
:10D2500000000000000000005B260200F91701003A
:10D26000000000000000000000000000F8D10200F3
:10D2700058B8020047020000000000000000000053
:10D280005D1601007F260200000000000000000083
:10D29000000000000000000000000000000000008E
:10D2A000000000000000000000000000FCF8020088
:10D2B00000F902004CF8020026F9020014FA0200FC
:10D2C000BAF80200D4FA020066F80200D4F90200AB
:10D2D000DAF7020048F80200FCF90200D2FB020073
:10D2E000EAF9020092F9020074F902003EF9020024
:10D2F000B8F902006CF7020044F9020092FB020048
:10D3000016F9020004FB0200AAFB020080FA0200E8
:10D31000A4FA02009EF90200A8F90200CEF9020068
:10D3200028F70200C4F9020030F802003AFA0200BD
:10D33000B4F80200BAFB020022F7020002FA02006F
:10D340005AF7020084FA0200EEF80200DEF9020049
:10D35000AEF70200B8F70200A2F702009AF7020047
:10D36000F6FA0200EEFA0200FEFA02006AFA020081
:10D370004CFA020052FA0200B0FA020078F80200F9
:10D38000DEF70200CCFB0200000000001AFA0200E7
:10D3900004F90200AAF80200B0F8020058F80200EE
:10D3A00062F8020052F8020038F9020038FB02006D
:10D3B00052FB02005AFB020062FB020044FB020027
:10D3C0003EFB02004CFB0200E0FA020068FB020098
:10D3D0007AFB020082FB020088FB02006EFB020067
:10D3E00074FB02008EFB020040FA02000EFA0200FB
:10D3F00028FA0200C0F80200D6F80200D2F80200B3
:10D40000CCF80200C6F80200DAFA0200C0F7020007
:10D410000AF90200F0F90200F6F9020098F9020098
:10D420007EF9020084F902008AF902006CF9020018
:10D43000CAF90200D8F9020060F9020090F802006F
:10D4400066F7020066F9020096F802009CF80200F6
:10D45000B2F9020074F7020036F802005CF902002B
:10D4600052F902000EFB020024FB02001AFB02002C
:10D4700014FB02002CFB020030FB0200A2F80200A9
:10D48000B4FB02009EFB0200A4FB020070FA020043
:10D4900076FA020094FA02009AFA0200AAFA02004E
:10D4A000BEF902000CF802002AF8020020F802007F
:10D4B00026F8020008FA020060F702008AFA020069
:10D4C000E8F80200F4F80200AAF70200B4F702003C
:10D4D000E4F902007AF7020094F70200B6FA0200BB
:10D4E000BCFA0200C2FA0200C8FA0200CEFA020038
:10D4F000E6FA020046FA020058FA02005EFA02005A
:10D5000064FA020022FA0200DCF80200E2F80200EB
:10D510006CF8020072F802008AF802007EF802003D
:10D5200084F80200EAF702002EF7020034F7020046
:10D5300042F702003CF7020048F702004EF70200F3
:10D5400054F7020006F80200F2F70200FEF70200AC
:10D55000C0FB0200C6FB020058B80200D602000061
:10D56000D560020000000000000000001966000005
:10D57000B1660000AB600200B1670000A565000065
:10D58000000000000000000000000000000000009B
:10D590000000000058B80200A902000000000000CE
:10D5A0000561020000000000000000000000000013
:10D5B00000000000000000005B260200E76002009F
:10D5C000000000000000000000000000000000005B
:10D5D00074C202002F00000005000000E0D5020028
:10D5E000860F00009E0C00002E15000018D60200C9
:10D5F000EE0C000008D60200FE0C000010D602005F
:10D60000A60C0000ACD602003CEA02009D370000E8
:10D6100078EA0200E537000078EA0200E935000008
:10D6200098B10200D0D502009601000097010000D9
:10D6300098010000990100009E0100000C9A020070
:10D640000000000017000000846D03000C9A020027
:10D6500000000000080000001750030058D5020029
:10D66000050000008CD602004CD602007CD60200D9
:10D670009CD602003CD6020028D602000C9A02007A
:10D680000000000005000000276D03000C9A020056
:10D690000000000008000000175003000C9A020070
:10D6A00000000000560000002D6D03003CEA02005F
:10D6B000E52001003CEA02007361020078EA020002
:10D6C000F52001003CEA0200ED20010098B10200C3
:10D6D000D4D6020074C20200570000000A00000005
:10D6E000E4D60200860F0000F60C0000E6160000EB
:10D6F00034D70200C600000014960200DE060000C7
:10D70000C4D602006E110000B4D602008E110000D3
:10D71000BCD602000E1400008CBA0200FE130000FA
:10D720007CBA02000614000084BA02009E160000B3
:10D73000E0B802003CEA02005B61020058B8020057
:10D740007C0100000000000000000000000000005C
:10D7500000000000000000000000000000000000C9
:10D7600000000000000000000000000000000000B9
:10D770000000000078D7020074C2020027000000F9
:10D780000400000088D70200760B0000D8D7020002
:10D79000B6060000F0D70200AE060000E4D7020093
:10D7A000160C0000F8D702006F01020040420F0083
:10D7B00070010200080000007E010200000000006D
:10D7C0007F010302E4B3020080010302E4B302001C
:10D7D00081010302E4B302002CEB02000300FFFF0F
:10D7E000092101002CEB020004000300BD2101000F
:10D7F000B4EA020021220100F0EA020065220100E1
:10D800004CA0020002000000860800001E0A000072
:10D810004CA0020008000000E60800003E0B0000DB
:10D82000C60900006E0900003E0B00009E080000C3
:10D830003E0B0000960A00004CA0020019000000F8
:10D84000060900003E090000D60900005609000044
:10D85000660A0000560A00004E0900003E0900005A
:10D86000D609000056090000CE0A0000C60A0000D2
:10D870004E0900003E0900003609000016080000AD
:10D88000660A0000F60900006609000006080000AC
:10D89000FE0700003E080000660A0000CE0A0000F5
:10D8A000C60A00004CA0020030000000D6080000AC
:10D8B000F6090000CE0A0000EE070000F60700009F
:10D8C000EE070000CE0A0000F6090000D6080000AE
:10D8D000F6090000CE0A0000EE070000F60700007F
:10D8E000EE070000CE0A0000F6090000660A0000FC
:10D8F000EE070000DE080000660900006E09000067
:10D90000660900009E0800000E080000D60800000E
:10D91000F6090000CE0A0000EE070000F60700003E
:10D92000EE070000CE0A0000F6090000CE0A000053
:10D930004E0800008E090000660A00009E0A0000E2
:10D94000EE070000DE0800006E090000D6080000A7
:10D95000F6090000CE0A0000F6090000CE0A000019
:10D96000660A0000F6090000660900004CA00200EB
:10D97000280000001E0800004E08000016090000E4
:10D9800066080000360800003E0B00002E0800006C
:10D990004E08000016090000660800003608000066
:10D9A0003E0B000036080000160A00006E09000059
:10D9B000F6090000660A0000F60900006E09000082
:10D9C000F60900006E080000160900006609000054
:10D9D0009E080000760800003E0B00008E08000044
:10D9E00016090000660900009E0800007608000085
:10D9F0003E0B000096080000160A00006E090000A9
:10DA0000F6090000660A0000F60900006E09000031
:10DA1000F60900004CA002000A000000460B0000BE
:10DA2000CE0A0000CE0A0000CE0A00005E0A000006
:10DA3000560B0000660A0000660A0000660A000035
:10DA4000EE0900004CA00200120000009E09000038
:10DA50006E090000F6090000260900000E0A000009
:10DA6000260900000E0A00002E0900003E090000F1
:10DA7000660900006E090000F60900009E0800001B
:10DA8000660900002E0A00006E080000B6090000BA
:10DA9000560900004CA002000B000000EE08000038
:10DAA0004E0900003E0900005609000086090000EA
:10DAB000BE090000CE0900003E0900004E0900002A
:10DAC00056080000EE0800004CA002001200000002
:10DAD000D60800009E0800006E0900003E09000004
:10DAE000AE0A00003E090000AE0A00006E0A000007
:10DAF000CE0A00009E0800009E080000CE0A00002A
:10DB00003E0900008E0A00003E0900008E0A000057
:10DB1000660A00006E0900004CA00200050000002B
:10DB2000160B0000660A0000F609000066090000F6
:10DB30009E0800004CA00200050000001E09000025
:10DB400066090000F6090000660A0000CE0A00001F
:10DB50004CA002006A0000007E0A0000D60A000005
:10DB6000C60800007E0900006E080000AE09000033
:10DB7000A6080000760800004E080000AE0800006D
:10DB800066090000BE090000A60800006E0800003B
:10DB9000B60800006E0900006E0A0000D60A0000F8
:10DBA0006E0900006E0A0000A60800006609000069
:10DBB00066080000AE080000660800007609000054
:10DBC0006E0A0000DE0A00006E0900006E0A000006
:10DBD000A60800006E09000066080000A609000003
:10DBE0006E09000066090000A60800006608000033
:10DBF000AE080000C60900006E080000AE08000074
:10DC00006E0900006E0A0000A60800006609000008
:10DC1000A608000066080000BE08000066080000B4
:10DC2000AE08000066080000860A0000D60A000060
:10DC300096080000860A0000D60A00004E08000080
:10DC4000AE0800006E09000066080000160A000019
:10DC50006E090000F60900006E0A00007608000058
:10DC60004E080000860A0000D60A00004E08000098
:10DC70006E0A0000160A00006E090000A6080000E7
:10DC8000660800006E0A00006E090000F609000038
:10DC90006E0A000096080000860A0000D60A0000FE
:10DCA00096080000860A0000D60A00004E08000010
:10DCB0004E080000AE0800006E0900006608000073
:10DCC0006E0A0000D60A00006E0A000096080000E6
:10DCD0008E080000F60700004E0800006E0A0000E3
:10DCE000D60A00004E080000160A00006E09000067
:10DCF000F60900006E0A000076080000AE08000079
:10DD00004CA002001E000000060A0000F6090000F8
:10DD1000660A0000CE0A0000CE0A0000660A000073
:10DD2000F6090000660900009E0800009E08000039
:10DD300066090000F60900004E0A0000C60900004E
:10DD4000EE0900003E0A0000F6090000660A000025
:10DD5000CE0A0000CE0A0000660A0000F6090000A4
:10DD6000660900009E0800009E0800006609000089
:10DD7000F6090000E6090000460900005E090000FF
:10DD80004CA0020006000000160B00006E09000007
:10DD90009E080000060B00008E0800002E090000FF
:10DDA0004CA0020006000000FE0A00001609000058
:10DDB000F6090000260B0000260A00002E0B0000CA
:10DDC0004CA0020040000000FE080000F609000020
:10DDD000CE0A000016090000F6090000F60A00004D
:10DDE00016090000F6090000F6080000F609000018
:10DDF000CE0A000016090000F6090000F60A00002D
:10DE000016090000F6090000F60800006609000087
:10DE1000CE0A0000A6090000660A0000F60A00000B
:10DE2000A6090000660A0000F60800006609000066
:10DE3000CE0A0000A6090000660A0000F60A0000EB
:10DE4000A6090000660A00005E08000096090000AE
:10DE5000CE0A0000A6090000660A0000F60A0000CB
:10DE6000A6090000660A00005E080000960900008E
:10DE7000CE0A0000A6090000660A0000F60A0000AB
:10DE8000A6090000660A0000F6080000F609000076
:10DE9000CE0A000016090000F6090000F60A00008C
:10DEA00016090000F6090000F6080000F609000057
:10DEB000CE0A000016090000F6090000F60A00006C
:10DEC00016090000F60900004CA00200090000003D
:10DED00006090000EE0A00006E0A0000CE0A0000EB
:10DEE000E60A0000CE0A00003E0B00004E080000CB
:10DEF000F60800004CA002004F000000AE09000030
:10DF0000660800003E0B00004E0800004E080000AE
:10DF1000F60700004E0800000E0B00003E0B00004C
:10DF200066090000660900003E0B0000660800005C
:10DF3000160900003E0B00009E0800009E0800002D
:10DF40003E0B000066090000460A00003E09000082
:10DF5000160800003E0B0000EE070000EE07000070
:10DF6000D60A0000EE070000760A00003E0B000013
:10DF7000F6090000F60900003E0B00009E080000B4
:10DF8000660800003E0B00004E0800004E0800002E
:10DF90003E0B000016090000DE090000BE0900006B
:10DFA000660800003E0B00004E0800004E0800000E
:10DFB000F60700004E0800007E0800003E0B00003F
:10DFC000CE0A0000CE0A00003E0B000066090000E9
:10DFD000A60800003E0B0000EE070000EE07000060
:10DFE0003E0B0000EE070000460800001E0B00007C
:10DFF0008E0A00002E080000EE070000D60A00007E
:10E00000EE0700002E0A00002E080000EE070000B8
:10E01000D60A0000EE070000660900003E0B000073
:10E02000A6080000660900003E0B0000A6080000DC
:10E03000C60900005E0B00004CA002000D000000AD
:10E04000FE080000660900002E0A0000CE0A00004B
:10E05000BE090000F6090000AE0A0000EE0700004D
:10E06000260A0000660A0000260B00004E08000089
:10E07000360900004CA0020007000000FE09000065
:10E080004E0B0000860900004E0B0000D609000070
:10E090004E0B0000CE0800004CA002001200000051
:10E0A0000E090000B60A0000A60A0000C60A000019
:10E0B000560900002E0B0000260A0000C60A0000C8
:10E0C00056090000B60A00002E08000036090000BC
:10E0D00026080000A60A0000BE0A0000360A00005A
:10E0E000A60A0000360B0000B4EA020071620200CA
:10E0F000B4EA02005B620200B4EA02002D62020090
:10E10000F0EA0200436202003CEA0200312401000E
:10E110003CEA0200E12301003CEA0200F92301008D
:10E120003CEA0200112401003CEA02009D62020068
:10E130003CEA0200876202002CEB020000000100B2
:10E140004124010098B102004CE1020074C20200B7
:10E1500047000000080000005CE10200860F00009C
:10E1600036120000EE10000008E102006611000007
:10E1700010E102008611000018E10200D612000032
:10E1800020E102001E14000030E10200161400001D
:10E1900028E102006616000038E102002CEB0200C4
:10E1A0000C0008004D260100B4EA020031250100F0
:10E1B00058B80200B000000000000000000000009D
:10E1C00000000000376302000000000000000000B3
:10E1D00071680200992401000000000000000000A6
:10E1E00000000000000000000000000074C20200F7
:10E1F000770200004E00000038E2020058B802002A
:10E2000067020000000000000000000000000000A5
:10E2100000000000000000000000000000000000FE
:10E220005B260200476802000000000000000000BA
:10E2300000000000000000007E02000044E5020033
:10E2400086020000CCE40200A6020000C4E4020042
:10E250009E020000DCE40200AE020000F0E40200D6
:10E26000B6020000F8E40200BE02000000E5020071
:10E27000C6020000E8E402003E050000B0E402002F
:10E2800046050000B8E402008E020000D4E402005B
:10E2900096020000A8E10200D60200009CE1020004
:10E2A000DE0200002CB50200E602000034B50200D8
:10E2B000EE02000024B50200FE020000A4B5020038
:10E2C000F60200008CB5020006030000E4B4020070
:10E2D0000E03000024B40200160300006CB4020018
:10E2E0001E030000CCB502002603000094B5020016
:10E2F0002E0300000CB502003603000044B50200F6
:10E300003E03000014B602004603000064B502009C
:10E310004E03000094B40200560300009CB40200B7
:10E320005E030000A4B4020066030000ACB4020067
:10E330006E030000B4B4020076030000BCB4020017
:10E340007E030000C4B4020086030000CCB40200C7
:10E350008E030000D4B4020096030000DCB4020077
:10E360009E03000084B40200A60300008CB40200E7
:10E37000AE03000034B40200B60300003CB4020057
:10E38000BE0300002CB40200C603000054B4020017
:10E39000CE0300004CB40200D60300005CB40200BF
:10E3A000DE03000064B40200E603000044B402008F
:10E3B000EE030000F4B50200F6030000ECB5020025
:10E3C000FE0300007CB4020006040000F4B4020066
:10E3D0000E040000FCB4020016040000B4B50200F4
:10E3E0001E040000BCB50200260400007CB502003B
:10E3F0002E040000ECB40200360400004CB502000C
:10E400003E04000054B50200460400005CB5020062
:10E410004E04000074B50200560400000CB6020061
:10E420005E0400006CB5020066040000DCB502006A
:10E43000DE04000014BA0200D6040000ECB90200A9
:10E440006E040000FCB502007604000084B50200F2
:10E450007E04000004B50200860400003CB5020002
:10E460008E040000E4B502009604000074B40200BB
:10E470009E040000C4B50200A604000014B502000A
:10E48000AE040000D4B50200B60400001CB50200C2
:10E49000BE0400009CB50200C604000004B60200E1
:10E4A000CE040000ACB5020008E502000100000047
:10E4B00078EA02001F6702002CEB02000A00050048
:10E4C0006B660200F0EA0200F526010078EA02001D
:10E4D000C566020078EA0200776702002CEB0200B2
:10E4E000080004004D270100B4EA0200F9670200A9
:10E4F000B4EA0200B7670200B4EA0200CD67020086
:10E50000B4EA0200E367020058B802004C000000C1
:10E51000C127010081280100000000000000000068
:10E520009D2B010000000000000000000000000022
:10E5300000000000000000000000000000000000DB
:10E54000ECE1020078EA02008B64020058B8020095
:10E550006702000000000000000000000000000052
:10E5600000000000000000000000000000000000AB
:10E570005B26020061250100000000000000000091
:10E58000000000000000000058B80200AC000000CD
:10E59000000000000000000000000000000000007B
:10E5A000000000000000000000000000F124010055
:10E5B000000000000000000000000000000000005B
:10E5C0000000000058B802006C01000000000000CC
:10E5D000000000000000000000000000000000003B
:10E5E000000000000000000000000000000000002B
:10E5F0000000000000E602000000000010E602003B
:10E600009D400100B768020000000000000000000B
:10E6100074C20200470000000800000020E602006B
:10E62000760B0000A0E60200B60B000098E60200A0
:10E63000AE06000068EB0200C60B000080EB020093
:10E64000CE0B000074EB0200B60600008CEB02005B
:10E65000D60B000003000000DE0B000005000000E8
:10E660006F01020080250000700102000800000018
:10E6700071010300E4B30200720102000100000016
:10E6800073010302E4B3020074010302E4B3020065
:10E6900075010302E4B3020078EA02008140010040
:10E6A0002CEB02000300FFFFA13F01006A020302FE
:10E6B000E4B30200A802010200000000B4EA020074
:10E6C000D941010078EA02007142010078EA0200B3
:10E6D000836A0200B4EA02000D6A0200B4EA020092
:10E6E000D94301002CEB020004000400D7690200AA
:10E6F000F0EA02002542010074C202005F0000003F
:10E700000B00000008E7020016100000BCE6020043
:10E710002E0C0000C4E602003E050000CCE602001C
:10E720000E110000D4E60200CE110000DCE602006B
:10E7300096120000E4E602009E120000F0E60200DD
:10E74000D614000060E702002E1500006CE70200FE
:10E750004615000074E70200C61500007CE70200C1
:10E760002CEB020002000200F5420100B4EA0200B4
:10E770007143010078EA0200A14101002CEB020084
:10E780000300FFFF9942010058B802007302000025
:10E7900091430100316A0200000000005D41010068
:10E7A0008144010000000000554501008541010041
:10E7B0000000000000000000000000000000000059
:10E7C000F8E60200D4E7020000000000D4E70200EF
:10E7D0000100000058B802000C020000D14A0100FC
:10E7E000ED4A010000000000BD6B0200AD6B0200AD
:10E7F0000000000000000000000000000000000019
:10E800000000000000000000000000000000000008
:10E8100074C20200370000000600000020E8020079
:10E82000860F00000E170000A610000058E8020036
:10E83000B61400006CE80200BE14000060E802009C
:10E84000EE16000078E80200F616000078E80200F4
:10E8500098B1020010E8020078EA0200276C02007A
:10E860002CEB02000600FFFF214D01002CEB020003
:10E870000200FFFFD94C01002CEB02000400030052
:10E88000214B010000000000876C020078EA0200C2
:10E89000CD55010078EA0200AD55010078EA02008A
:10E8A00005560100B4EA0200E5550100B4EA020091
:10E8B0002B6E02003CEA02001D5601003CEA0200F9
:10E8C0003556010000000000C1000000C200000039
:10E8D000C3000000C4000000C5000000C600000026
:10E8E000C7000000C8000000C9000000CA00000006
:10E8F000CB00000074C202004700000008000000C6
:10E9000024E9020078EA0200A5560100B4EA0200F8
:10E9100061570100B4EA02009157010078EA020051
:10E92000CD570100CE0500006CE90200D6050000BD
:10E9300074E90200DE0500007CE90200E605000043
:10E9400004E90200EE05000064E90200F60500009B
:10E950000CE90200FE05000014E9020006060000B2
:10E960001CE9020078EA02003D57010078EA020043
:10E970006956010078EA02007D56010078EA02003B
:10E980009156010088E9020058B80200B700000063
:10E990000000000000000000000000000000000077
:10E9A0000000000000000000000000000000000067
:10E9B0000000000000000000000000000000000057
:10E9C000F4E8020058B80200450200000000000010
:10E9D00000000000B96E02007F2602000000000067
:10E9E0000000000000000000000000000000000027
:10E9F0000000000000000000000000000000000017
:10EA000058B80200450200000000000000000000AD
:10EA10008D5801007F260200000000000000000069
:10EA200000000000000000000000000000000000E6
:10EA300000000000000000000000000058B80200C4
:10EA4000450200000000000000000000476E0200C8
:10EA50007F2602000000000000000000000000000F
:10EA600000000000000000000000000000000000A6
:10EA7000000000000000000058B80200450200003D
:10EA800000000000000000005F6E02007F26020010
:10EA90000000000000000000000000000000000076
:10EAA0000000000000000000000000000000000066
:10EAB0000000000058B802004502000000000000FD
:10EAC000000000007D6E02007F26020000000000B2
:10EAD0000000000000000000000000000000000036
:10EAE0000000000000000000000000000000000026
:10EAF00058B80200450200000000000000000000BD
:10EB00009B6E02007F260200000000000000000053
:10EB100000000000000000000000000000000000F5
:10EB200000000000000000000000000058B80200D3
:10EB3000450200000000000000000000596F0200C4
:10EB40007F2602000000000000000000000000001E
:10EB500000000000000000000000000000000000B5
:10EB600000000000000000002CEB02000200020088
:10EB7000317002002CEB020004000300A15C0100D4
:10EB80002CEB020002000200FD5C01002CEB0200F5
:10EB9000040004003B700200FFFF000000000000C2
:10EBA00000000000000000001D7402001F7402003D
:10EBB00063740200657402000000000000000000A1
:10EBC0001D7402001F74020061740200737402005D
:10EBD000217402003D740200417402005D74020061
:10EBE000756301007D63010057750200000000009D
:10EBF000000000001D7402001F7402003376020042
:10EC000035760200B9670100137602002F76020004
:10EC1000C1670100437602000100000017000000F8
:10EC200046000000A30000005F010000D6020000C3
:10EC3000C4050000A00B0000000000000000000060
:10EC4000B37E02001F740200FD6F0100377C0200DA
:10EC500060EC02000300000078EC020008000000F5
:10EC6000020000000000000004000000010000009D
:10EC70000800000002000000C409000000000000BD
:10EC8000881300000800000010270000100000009A
:10EC9000204E000018000000803801002000000015
:10ECA000007102002800000000E2040030000000B3
:10ECB0000088130038000000000000000000000081
:10ECC0001D74020085810200597B01008F810200C2
:10ECD000217402003D740200417402005D74020060
:10ECE000657A01009D7B010057750200BCFFFFFFA4
:10ECF000000000001D740200557A01007D7B0100B8
:10ED00008D7B0100497B0100137602002F76020003
:10ED1000997C01004376020028ED02000300000008
:10ED200040ED0200080000000200000000000000AA
:10ED300004000000010000000800000002000000C4
:10ED4000E204000000000000C40900000800000008
:10ED500088130000100000001027000018000000B9
:10ED6000204E000020000000803801002800000034
:10ED7000007102003000000000C4090038000000EB
:10ED800000000000000000001D740200B5810200B8
:10ED9000DD7D0100BF810200217402003D7402008C
:10EDA000417402005D740200297D0100F57D0100BF
:10EDB00057750200BCED02000B000000D4300000CB
:10EDC00000000000A86100002000000050C3000007
:10EDD00040000000A086010060000000400D03001C
:10EDE00080000000801A06008800000000350C003A
:10EDF00090000000006A1800B000000000D430004D
:10EE0000D000000000A86100F00000000050C30026
:10EE1000F800000000000000000000001D74020067
:10EE2000E5810200C97E0100EF810200E17E010060
:10EE3000137602002F760200857F010043760200E0
:10EE400050EE02000400000070EE02000900000015
:10EE5000020000000000000004000000100000009C
:10EE6000080000002000000010000000300000003A
:10EE70006902000080000000E8020000900000002D
:10EE8000C40900007000000088130000600000004A
:10EE90001027000050000000204E0000400000003D
:10EEA000409C000030000000A0860100200000000F
:10EEB00040420F00100000000000000000000000B1
:10EEC0001D74020015820200FD8001001F820200F5
:10EED000217402003D740200417402005D7402005E
:10EEE000698001001581010057750200F4EE0200EF
:10EEF00004000000102700000C000000204E00005D
:10EF00000800000050C3000004000000A0860100BB
:10EF10000000000000000000000000001D7402005E
:10EF200045820200658201004F82020005820100D5
:10EF3000137602002F7602007D82010043760200E4
:10EF4000FFFF0100010000000000000000000000C1
:10EF50007D8602007F8602000000000000000000A5
:10EF60009D860200CB860200000000000000000029
:10EF7000E16F01004B7C02003587020000000000B9
:10EF800000000000718C0100AB8702008D87020039
:10EF90000000000000000000000000000000000071
:10EFA0006B880200ACEF0200142D0020259B0100AD
:10EFB000B19B0100858C0200878C0200C99B010077
:10EFC000010000000070004004000000020000008A
:10EFD00000700040080000000300000000700040C6
:10EFE000100000000400000000700040200000003D
:10EFF0000500000000700040400000000600000016
:10F000000070004080000000FF000000FFFFFFFFD5
:10F0100000000000B004000000F0040060090000DF
:10F0200000D00900C012000000B0130080250000CD
:10F03000005027004038000000003B00004B00005B
:10F0400000A04E008070000000F07500127A0000F1
:10F05000000080000096000000509D0000E10000CC
:10F0600000F0EB00002C010000903A0100C201000A
:10F0700000E0D7010084030000B0AF0390D003008C
:10F08000000000040008070000705F0700100E0079
:10F09000A4DFBE0E40420F0000000010B2A7010026
:10F0A000EEA6010012A70100B0A6010012A7010000
:10F0B0008EA7010012A70100B0A60100EEA6010074
:10F0C000EEA601008EA70100B0A60100E4A7010092
:10F0D000E4A70100E4A701009AA70100EEA6010041
:10F0E000EEA6010012A70100AEA6010012A70100C2
:10F0F0008EA7010012A70100AEA60100EEA6010036
:10F10000EEA601008EA70100AEA60100E4A7010053
:10F11000E4A70100E4A7010098A70100DCAA010010
:10F1200086AA010086AA0100B4AB010082AA0100F0
:10F1300082AA0100AAAB0100B4AB010082AA0100BF
:10F14000AAAB010082AA0100B4AB0100B8AB010078
:10F15000B8AB0100B8AB0100C0AB01002CBA010094
:10F160009EB80100E2B8010046B80100E2B8010013
:10F17000D2B90100E2B8010046B801009EB8010012
:10F180009EB80100D2B9010046B801003EB80100A6
:10F190003EB801003EB80100E0B9010054C10100D1
:10F1A00056C0010056C0010074C3010050C00100E8
:10F1B00050C001005CC3010074C3010050C00100D5
:10F1C0005CC3010050C0010074C301006AC30100A8
:10F1D0006AC301006AC3010078C301003863ED3ED1
:10F1E000DA0F493F5E987B3FDA0FC93F6937AC3190
:10F1F00068212233B40F14336821A2330000004B7E
:10F20000000000CB737172740000000061636F73C3
:10F21000660000006173696E6600000065787066C4
:10F2200000000000666D6F64660000006C6F67662A
:10F2300000000000706F7766000000007371727448
:10F24000660000000000003F000000BF8071313FF9
:10F25000807131BFD1F71737D1F717B70000000021
:10F2600000000080000FC93F000F494000CB9640CE
:10F27000000FC9400053FB4000CB164100ED2F4169
:10F28000000F49410031624100537B41003A8A41FD
:10F2900000CB9641005CA34100EDAF41007EBC4134
:10F2A000000FC94100A0D5410031E24100C2EE414A
:10F2B0000053FB4100F20342003A0A42008310422D
:10F2C00000CB164200141D42005C234200A52942D7
:10F2D00000ED2F4200363642007E3C4200C74242DB
:10F2E000000F4942A2000000F90000008300000066
:10F2F0006E0000004E0000004400000015000000F9
:10F3000029000000FC00000027000000570000005A
:10F31000D1000000F500000034000000DD00000016
:10F32000C0000000DB00000062000000950000004B
:10F33000990000003C000000430000009000000025
:10F3400041000000FE0000005100000063000000CA
:10F35000AB000000DE000000BB000000C5000000A4
:10F3600061000000B7000000240000006E000000F3
:10F370003A000000420000004D000000D2000000F2
:10F38000E000000006000000490000002E00000020
:10F39000EA00000009000000D10000009200000017
:10F3A0001C000000FE0000001D000000EB0000003B
:10F3B0001C000000B100000029000000A7000000B0
:10F3C0003E000000E8000000820000003500000060
:10F3D000F50000002E000000BB000000440000000B
:10F3E00084000000E90000009C00000070000000A4
:10F3F00026000000B40000005F0000007E00000056
:10F40000410000003900000091000000D60000001B
:10F4100039000000830000005300000039000000A4
:10F42000F40000009C000000840000005F00000069
:10F430008B000000BD000000F90000002800000063
:10F440003B0000001F000000F800000097000000D3
:10F45000FF000000DE000000050000009800000032
:10F460000F000000EF0000002F000000110000005E
:10F470008B0000005A0000000A0000006D00000030
:10F480001F0000006D000000360000007E0000003C
:10F49000CF00000027000000CB00000009000000A2
:10F4A000B70000004F000000460000003F000000D1
:10F4B000660000009E0000005F000000EA000000FF
:10F4C0002D0000007500000027000000BA000000B9
:10F4D000C7000000EB000000E5000000F1000000A4
:10F4E0007B0000003D000000070000003900000024
:10F4F000F70000008A0000005200000092000000A7
:10F50000EA0000006B000000FB0000005F0000004C
:10F51000B10000001F0000008D0000005D00000031
:10F52000080000005600000003000000300000004A
:10F5300046000000FC0000007B0000006B000000A3
:10F54000AB000000F0000000CF000000BC00000095
:10F55000200000009A000000F400000036000000C7
:10F560001D000000A9000000E30000009100000061
:10F57000610000005E000000E60000001B000000CB
:10F5800008000000650000009900000085000000F0
:10F590005F00000014000000A000000068000000F0
:10F5A000400000008D000000FF000000D8000000B7
:10F5B000800000004D0000007300000027000000E4
:10F5C00031000000060000000600000015000000E9
:10F5D00056000000CA00000073000000A8000000F0
:10F5E000C900000060000000E20000007B00000095
:10F5F000C00000008C0000006B0000000000C93F4C
:10F600000000F0390000DA370000A2330000842E39
:10F610000000502B0000C2270000D0220000C41FB1
:10F620000000C61B00004417040000000700000093
:10F6300009000000000000000000000000000000C1
:10F6400000000000000000000000000000000000BA
:10F6500000000000000000000000000000000000AA
:10F66000000000000000000000000000000000009A
:10F67000000000000000000000000000000000008A
:10F68000000000000000000000000000000000007A
:10F69000000000007000002000686E0200786F0219
:10F6A000008871020060C0020070C1020080C302C5
:10F6B000000002000400060008000A000C0011000F
:10F6C00017001D0025002F003B00490061007F004E
:10F6D000A700DF00250185010902B3029703C704D3
:10F6E0005B0671089D0CDF124B1C6D2A913F575F22
:10F6F000FF8E7BD6000002000200040007000D0010
:10F70000190031006100E108E907EE0E4D0DDA0B3A
:10F710002F0BF70961080000180E8E0C00008F0AED
:10F720006809233124203A101D317D2011109F33A8
:10F73000A0204810A013A120A220A320A2223210B2
:10F740007A20A12231107A20A3627A20A430A41258
:10F75000A720A520A5624D107A20253126208320E0
:10F7600083122F103010656212100710122313102D
:10F770007A206A306A6248107A208A1C07100810C2
:10F7800009100A100B100C100E100F100D102A206B
:10F790002B202C208B1236208C202C2346109930C5
:10F7A00047102B2344108C304510871129202962E3
:10F7B0008A208830883291202A2342108B304310CF
:10F7C000581C4E104F10501051105310541055101B
:10F7D000561058105710591052100921141035A501
:10F7E000151007109E30491078209E6342109F30FC
:10F7F0004310A7A51D10972022101C20A630A82377
:10F8000020107C20A630A612A720A8207E19361032
:10F81000381040103E103F10411022107F208020F1
:10F82000802223108130812126107F222610221071
:10F830001F3121207E206B18132014201520162044
:10F8400017200320352002200A21161002623D20D5
:10F850003E203E12352003203C244C1068202D30E1
:10F8600004103D323C200722181097209962342062
:10F870009B309A6249107A2034627A209A309C2216
:10F8800048109D309D33342048109B12A7209C20A7
:10F890006462682065306731642048106831071061
:10F8A0004A1074631A10491078203A6233203B30B2
:10F8B0003B210410213122203B100522062052302A
:10F8C00052125320542056123620062055624D10F5
:10F8D0005620543255205362582056209733982092
:10F8E00048109812202021208512272028202762E6
:10F8F0008620852086132F1030103D1000610130C6
:10F9000001323920391204104F20591509200A20DC
:10F910000B200D200C2015271D10972022103320BE
:10F9200049107820743003A8171007104210403097
:10F9300043103F30491078203F625A107A2010223D
:10F940001F106920132620107A20491078206C306F
:10F9500074306D2419107A20491078206C326D2093
:10F9600063220710653066336320481060634210DD
:10F97000662043100F241E105D2021105F205D12B1
:10F9800068205E205E62612068305F133110602065
:10F9900066200E22211067205C120E200F201AA470
:10F9A0002410483049107A201BA4241048304910F4
:10F9B0007C206931071048101122251069207D1222
:10F9C0001E201F201E2226107D20613262201C3145
:10F9D0001D2027100821281062124A100C102862DE
:10F9E000872089308962321085200D2229105A30F3
:10F9F0005A627A205B305B621E107A200B222A103A
:10FA00003330243125208220821237103910506281
:10FA100004200410043351204B10381304105020DC
:10FA20006B20962249107A3051180720082059205F
:10FA30005C201020112012200520202231102120CE
:10FA40004F126B20502092123220312031627A20E6
:10FA50003230322249109330931294209520942210
:10FA600049107A3095627A209630303392204810CF
:10FA7000781279205020796404100510182006109F
:10FA800018324F2026318520842084143110331001
:10FA9000351034107A121A2019207B2420101C20D3
:10FAA0001A107A2019621C207B307C121B201C202B
:10FAB00033337A2048108C628D208E308D122020B6
:10FAC0007A208E12A7208F208F62481090309033BA
:10FAD0008D204810063357204810571220207A20D6
:10FAE00047220710453091132D202E202F202E2342
:10FAF0004410302045102D2342109F3043102F22F8
:10FB00004A10071016242B10491078206E206E1210
:10FB10006F20732071627A20653070241B10713061
:10FB2000491078206F637220743073307232702005
:10FB300073231C104910782040334120481045623F
:10FB400049107A20442332100710453046624D1088
:10FB50007A2041134220432044204263071045305D
:10FB600046304322311047304833492048104C2258
:10FB7000321007104D624D107A2049134A204B2055
:10FB80004C204A6207104D304B2231104E304E61EE
:10FB9000071014252C107A204910782074307662D2
:10FBA0007A20773077621210212017242D107520CB
:10FBB00049107820753176204810223123203C10DE
:10FBC000A912AA203320AA221E107A2036222E1033
:10FBD000A9300C2136207A65726F2073746570002D
:10FBE00072616E67652825642C202564002C202511
:10FBF0006429002766726F7A656E736574272068C2
:10FC00006173206E6F20737563682061747472690C
:10FC10006275746500706F702066726F6D20616E22
:10FC200020656D707479207365740066726F7A65F3
:10FC30006E0073657428290066726F7A656E73654D
:10FC40007428007B002C200063616E277420636F92
:10FC50006E766572742027257127206F626A65634E
:10FC60007420746F20257120696D706C69636974EC
:10FC70006C790062797465732076616C7565206FAC
:10FC80007574206F662072616E67650077726F6EA3
:10FC900067206E756D626572206F66206172677590
:10FCA0006D656E7473006F6E6C7920736C6963653B
:10FCB00073207769746820737465703D3120286102
:10FCC0006B61204E6F6E65292061726520737570BF
:10FCD000706F7274656400696E636F6D706C6574CB
:10FCE0006520666F726D617400666F726D6174205D
:10FCF000726571756972657320612064696374004F
:10FD0000696E636F6D706C65746520666F726D618E
:10FD100074206B6579006E6F7420656E6F7567680F
:10FD200020617267756D656E747320666F722066F0
:10FD30006F726D617420737472696E67002525633C
:10FD400020726571756972657320696E74206F72B7
:10FD5000206368617200696E746567657220726500
:10FD600071756972656400756E737570706F727409
:10FD7000656420666F726D6174206368617261638F
:10FD8000746572202725632720283078257829205C
:10FD9000617420696E646578202564006E6F74203C
:10FDA000616C6C20617267756D656E747320636F32
:10FDB0006E76657274656420647572696E6720730F
:10FDC0007472696E6720666F726D617474696E67B4
:10FDD0000073696E676C6520277D2720656E636FF1
:10FDE000756E746572656420696E20666F726D61F0
:10FDF0007420737472696E670062616420636F6E51
:10FE000076657273696F6E20737065636966696584
:10FE10007200756E6D61746368656420277B2720AE
:10FE2000696E20666F726D617400657870656374C9
:10FE3000656420273A2720616674657220666F72B8
:10FE40006D617420737065636966696572006361D2
:10FE50006E2774207377697463682066726F6D20F3
:10FE60006175746F6D61746963206669656C642087
:10FE70006E756D626572696E6720746F206D616E5C
:10FE800075616C206669656C642073706563696672
:10FE900069636174696F6E007475706C6520696E5A
:10FEA000646578206F7574206F662072616E676577
:10FEB0000061747472696275746573206E6F74206A
:10FEC000737570706F727465642079657400636116
:10FED0006E2774207377697463682066726F6D2073
:10FEE0006D616E75616C206669656C642073706508
:10FEF00063696669636174696F6E20746F206175F0
:10FF0000746F6D61746963206669656C64206E75D9
:10FF10006D626572696E67003C3E3D5E00626364BF
:10FF20006545664667476E6F7378582500696E763B
:10FF3000616C696420666F726D61742073706563B3
:10FF40006966696572007369676E206E6F742061FF
:10FF50006C6C6F77656420696E20737472696E676C
:10FF600020666F726D617420737065636966696580
:10FF700072007369676E206E6F7420616C6C6F77AE
:10FF80006564207769746820696E7465676572209E
:10FF9000666F726D617420737065636966696572FE
:10FFA0002027632700756E6B6E6F776E20666F7209
:10FFB0006D617420636F6465202725632720666F59
:10FFC00072206F626A656374206F66207479706551
:10FFD000202725732700756E6B6E6F776E20666F16
:10FFE000726D617420636F64652027256327206626
:10FFF0006F72206F626A656374206F662074797017
:020000040003F7
:10000000652027666C6F61742700273D2720616C8F
:1000100069676E6D656E74206E6F7420616C6C6FB5
:1000200077656420696E20737472696E6720666FED
:10003000726D6174207370656369666965720075BD
:100040006E6B6E6F776E20666F726D617420636F7A
:100050006465202725632720666F72206F626A65BA
:100060006374206F6620747970652027737472271B
:1000700000656D70747920736570617261746F7260
:10008000005C2563005C5C005C6E005C72005C746C
:10009000005C78253032780073746172742F656E5D
:1000A0006420696E6469636573007375627374724A
:1000B000696E67206E6F7420666F756E64006A6F7C
:1000C000696E20657870656374732061206C697354
:1000D00074206F66207374722F6279746573206F59
:1000E000626A6563747320636F6E73697374656E9F
:1000F0007420776974682073656C66206F626A6526
:10010000637400252E2A73007273706C6974284E14
:100110006F6E652C6E290020090A0D0B0C00636FB1
:100120006D706C65782076616C756573206E6F7488
:1001300020737570706F7274656400696E76616C9F
:1001400069642073796E74617820666F72206E75B1
:100150006D62657200696E742829206172672032B1
:10016000206D757374206265203E3D203220616EE3
:1001700064203C3D20333600696E76616C696420F2
:1001800073796E74617820666F7220696E7465672A
:100190006572207769746820626173652025640048
:1001A0006F626A6563742077697468206275666639
:1001B00065722070726F746F636F6C2072657175F9
:1001C0006972656400257120696E646963657320D6
:1001D0006D75737420626520696E746567657273EE
:1001E0002C206E6F7420257300257120696E646564
:1001F00078206F7574206F662072616E6765006F7E
:10020000626A6563742027257327206973206E6FE7
:10021000742061207475706C65206F72206C697336
:100220007400726571756573746564206C656E67C2
:10023000746820256420627574206F626A65637437
:1002400020686173206C656E6774682025640063A4
:10025000616E277420636F6E76657274202573203B
:10026000746F20666C6F61740063616E2774206325
:100270006F6E7665727420257320746F20696E74BA
:10028000006F626A656374206F6620747970652000
:100290002725732720686173206E6F206C656E2898
:1002A000290054726163656261636B20286D6F730E
:1002B0007420726563656E742063616C6C206C6180
:1002C0007374293A0A00202046696C652022257142
:1002D000222C206C696E65202564002C20696E201C
:1002E00025710A003C25713E0027257327206F6287
:1002F0006A65637420646F6573206E6F7420737514
:1003000070706F7274206974656D2064656C6574BB
:10031000696F6E0027257327206F626A65637420FA
:100320006973206E6F742073756273637269707481
:1003300061626C650027257327206F626A656374AC
:1003400020646F6573206E6F7420737570706F72A8
:1003500074206974656D2061737369676E6D656E75
:1003600074000000040202040200000204040400FD
:100370000202000404030100000103030300010161
:10038000020303040201010301040301000300004E
:1003900004010102000003024D656D6F7279457220
:1003A000726F723A206C6578657220636F756C6449
:1003B000206E6F7420616C6C6F63617465206D6575
:1003C0006D6F7279006C696E65202575200025714E
:1003D00020006D61696E2E707900736F66742072F3
:1003E00065626F6F740D0A006E6F206D6F7265200D
:1003F00073746F7261676520737061636500492F64
:100400004F206F7065726174696F6E206F6E20632C
:100410006C6F7365642066696C650066696C652045
:100420006E6F7420666F756E640001000100E2EC6F
:10043000F0F4F8FC0004617267756D656E747320EA
:100440006D757374206265206B6579776F72647364
:1004500000756E6B6E6F776E20617267756D656E7D
:100460007420272571270076616C7565206F75747F
:10047000206F662072616E676520666F7220617200
:1004800067756D656E742027257127007265636539
:1004900069766564207061636B6574206973206E92
:1004A0006F74206120737472696E67007261646991
:1004B0006F206973206E6F7420656E61626C656475
:1004C00000332E342E30002B2D786B63642E636F37
:1004D0006D2F333533B32D2B0A7CC0207C0A7CB4BE
:1004E000205C302F89207C0A7CB2202F83205C89FD
:1004F000207C0A7C8820596F7527726520666C798C
:10050000696E672192204D6963726F507974686FCC
:100510006E2120202F7C88207C0A7C8C20486F77DD
:100520003FA6205C205C87207C0A7C8C202FB32097
:100530007C0A7C8A2030B5207C0A7C89202F7C5C58
:10054000B4207C0A7C8A207CB5207C0A7C852D84A2
:100550005F2F5F5C9E5F962D7C0A7CC0207C0A2BFF
:10056000C02D2B0A00006571016E65026373036381
:1005700063046D6905706C067673077663086869B5
:10058000096C730A67650B6C740C67740D6C65639A
:10059000616E206F6E6C79206861766520757020C1
:1005A000746F203420706172616D657465727320A0
:1005B000746F205468756D6220617373656D626C31
:1005C0007900706172616D6574657273206D757309
:1005D000742062652072656769737465727320693F
:1005E0006E2073657175656E636520723020746F5F
:1005F0002072330027257327206578706563747334
:1006000020616E2061646472657373206F6620746C
:10061000686520666F726D205B612C20625D0075DD
:100620006E737570706F72746564205468756D6256
:1006300020696E737472756374696F6E20272573F9
:1006400027207769746820256420617267756D655D
:100650006E7473006272616E6368206E6F742069DD
:100660006E2072616E67650004656F72086C736C52
:100670000C6C73721061737214616463187362633B
:100680001C726F7220747374246E656728636D70BA
:100690002C636D6E306F7272346D756C3862696385
:1006A0003C6D766E272573272065787065637473BB
:1006B00020616E20696E7465676572002725732757
:1006C00020696E7465676572203078257820646FC4
:1006D0006573206E6F742066697420696E206D6189
:1006E000736B203078257800272573272065787074
:1006F000656374732061206C6162656C006C61627B
:10070000656C2027257127206E6F742064656669EB
:100710006E656400272573272065787065637473A0
:10072000206174206D6F7374207225640027257317
:10073000272065787065637473206120726567692E
:10074000737465720027257327206578706563745C
:1007500073207B72302C2072312C202E2E2E7D00A7
:1007600000723000017231000272320003723300F5
:1007700004723400057235000672360007723700C5
:1007800008723800097239000A7231300B72313147
:100790000C7231320D7231330E7231340F723135C9
:1007A0000A736C000B6670000D7370000E6C7200A3
:1007B0000F70630066756E6374696F6E2074616B91
:1007C000657320256420706F736974696F6E616C46
:1007D00020617267756D656E747320627574202573
:1007E00064207765726520676976656E0066756E50
:1007F0006374696F6E20676F74206D756C746970B7
:100800006C652076616C75657320666F722061720D
:1008100067756D656E74202725712700756E657884
:10082000706563746564206B6579776F72642061AD
:100830007267756D656E7420272571270066756E69
:100840006374696F6E206D697373696E672072657A
:1008500071756972656420706F736974696F6E6118
:100860006C20617267756D656E7420232564006667
:10087000756E6374696F6E206D697373696E67203E
:100880007265717569726564206B6579776F7264E2
:1008900020617267756D656E74202725712700666B
:1008A000756E6374696F6E206D697373696E67200E
:1008B0006B6579776F72642D6F6E6C7920617267EA
:1008C000756D656E7400737472696E6720696E640D
:1008D00069636573206D75737420626520696E7439
:1008E00065676572732C206E6F74202573007374B6
:1008F00072696E6720696E646578206F7574206F09
:10090000662072616E6765005C7525303478005C26
:10091000552530387800416C6C6F636174696F6E77
:1009200020696E20696E74657272757074206861DA
:100930006E646C6572006E6F7420616E2041756428
:10094000696F4672616D6500696E646578206F75C8
:1009500074206F6620626F756E64730063616E6EE3
:100960006F742064656C65746520656C656D656E7B
:100970007473206F6620417564696F4672616D659E
:100980000063616E6E6F7420736574207265747598
:10099000726E5F70696E20776974686F757420700D
:1009A000696E0063616E27742073657420617474CE
:1009B00072696275746500636872282920617267C4
:1009C000206E6F7420696E2072616E6765283078C2
:1009D0003131303030302900617267206973206115
:1009E0006E20656D7074792073657175656E6365D1
:1009F000006F7264282920657870656374656420CF
:100A000061206368617261637465722C2062757421
:100A100020737472696E67206F66206C656E6774F0
:100A20006820256420666F756E6400332D617267DF
:100A300020706F772829206E6F7420737570706F27
:100A400072746564006D75737420757365206B65D1
:100A500079776F726420617267756D656E74206658
:100A60006F72206B65792066756E6374696F6E00B6
:100A70002C004F4B0050686F6E656D657320746F6E
:100A80006F206C6F6E6700496C6C6567616C2070DD
:100A9000697463680050686F6E656D65206E6F7471
:100AA00020756E64657273746F6F6400496E707543
:100AB000742070686F6E656D657300494E544552C1
:100AC0004E414C204552524F523A20496C6C65675A
:100AD000616C2070686F6E656D6520696E64657805
:100AE00000496E7365727420427265616474680DAA
:100AF0000050726F6365737365642070686F6E6514
:100B00006D6573000000000000A4A4A4A4A4A48444
:100B100084A4A48484848484848444444444444CCD
:100B20004C4C484C40404040404044444444484081
:100B30004C440000B4B4B49494944E4E4E4E4E4E79
:100B40004E4E4E4E4E4E4B4B4B4B4B4B4B4B4B4BE3
:100B50004B4B80C1C180C1C1C1C100000000000079
:100B60000000000000000000000000001010101045
:100B7000080C0804402420202400002420202420E5
:100B8000200020000000000000000000000004041D
:100B90000400000000000000000004040400000045
:100BA0000000000012121208080808080B060C0AC0
:100BB00005050B0A0A0A09080709070608060707B8
:100BC00007020502020202020206060706060208E2
:100BD00003011E0D0C0C0C0E090601020501010695
:100BE00001020601020802020402020601040601D3
:100BF00004C7FF00121212080B090B0E0F0B100C8A
:100C000006060E0C0E0C0B08080B0A09080808084B
:100C1000080305020202020202060608060602098D
:100C20000402010E0F0F0F0E0E0802020702010749
:100C3000020207020208020206020207020407017A
:100C4000040505202E3F2C2D494945414141415580
:100C5000414945554F524C575957524C57594D4E93
:100C60004E4451535346542F2F5A5A5644432A4AFE
:100C70002A2A2A45414F414F55422A2A442A2A47C7
:100C80002A2A472A2A502A2A542A2A4B2A2A4B2A15
:100C90002A5555552A2A2A2A2A5948484541484F53
:100CA00048585852584858585858482A2A2A2A2AE0
:100CB0002A58582A2A482A4848582A482A48482A56
:100CC0002A2A2A2A5959595757572A2A2A2A2A2A70
:100CD0002A2A2A582A2A2A2A2A2A2A2A2A2A2A5818
:100CE0002A2A4C4D4E2A313233343536373865781E
:100CF00070656374696E6720612070696E00696E4B
:100D000076616C696420706572696F6400696E76E3
:100D1000616C69642070756C6C0076616C7565201F
:100D20006D757374206265206265747765656E20E9
:100D30003020616E6420313032330076616C75652D
:100D4000206D7573742062652030206F7220310031
:100D5000696D706F727420000A2573007768696C82
:100D60006500666F72007472790063616E6E6F74F5
:100D700020706572666F726D2072656C6174697641
:100D80006520696D706F7274006E6F206D6F647591
:100D90006C65206E616D65642027257127005F5F9B
:100DA000696E69745F5F2E707900476C697463685F
:100DB00065733A2025640D0A007465787420746F99
:100DC0006F206C6F6E6700636F756C64206E6F745C
:100DD00020706172736520696E70757400736C6940
:100DE000636528006469766973696F6E2062792093
:100DF0007A65726F006D61746820646F6D61696EF1
:100E0000206572726F72000A000B0C0D0E0F00004D
:100E100000000000000000030303030300000000C3
:100E200000000000000000000000000000000301BE
:100E3000010101010101010101010101010145451A
:100E4000454545454545454501010101010101591A
:100E500059595959591919191919191919191919C2
:100E60001919191919191919190101010101016932
:100E700069696969692929292929292929292929A2
:100E800029292929292929292901010101004D6937
:100E900063726F426974416363656C65726F6D65FF
:100EA00074657220747970650A0055736566756C97
:100EB00020737475666620746F20636F6E74726F32
:100EC0006C20746865206D6963726F3A6269742082
:100ED00068617264776172652E0A00507574206DC6
:100EE0006963726F3A62697420696E2070616E691D
:100EF000632829206D6F646520616E6420646973C6
:100F0000706C617920616E20756E686170707920F7
:100F1000666163652E0A507265737320726573652E
:100F20007420627574746F6E20746F2065786974B4
:100F30002070616E69632829206D6F64652E0A0038
:100F4000507574206D6963726F3A62697420746FB2
:100F500020736C6565702874696D652920666F72F1
:100F600020736F6D65206D696C6C697365636F6E5E
:100F70006473202831207365636F6E64203D2031D7
:100F8000303030206D7329206F662074696D652EB6
:100F90000A736C65657028323030302920676976B5
:100FA0006573206D6963726F3A62697420612032E3
:100FB000207365636F6E64206E61702E0A00526547
:100FC0007475726E2072756E6E696E675F74696D8E
:100FD00065282920696E206D696C6C697365636F83
:100FE0006E64732073696E6365206D6963726F3A16
:100FF0006269742773206C61737420726573657401
:101000002E0A0052657475726E206D6963726F3AB4
:1010100062697427732074656D706572617475728E
:101020006520696E20646567726565732043656C31
:10103000636975732E0A00446574656374206D6975
:1010400063726F3A6269742773206D6F76656D65A0
:101050006E7420696E2033442E0A4974206D6561D8
:1010600073757265732074696C7420285820616EE2
:101070006420592920616E642075702D646F776E2D
:1010800020285A29206D6F74696F6E2E0A005265F0
:101090007475726E206D6963726F3A62697427733A
:1010A0002074696C7420285820616363656C6572D4
:1010B0006174696F6E2920696E206D696C6C692D91
:1010C0006727732E0A0052657475726E206D69630E
:1010D000726F3A62697427732074696C742028599E
:1010E00020616363656C65726174696F6E29206944
:1010F0006E206D696C6C692D6727732E0A0052652E
:101100007475726E206D6963726F3A6269742773C9
:101110002075702D646F776E206D6F74696F6E200F
:10112000285A20616363656C65726174696F6E290A
:1011300020696E206D696C6C692D6727732E0A5AC1
:10114000206973206120706F736974697665206E01
:10115000756D626572207768656E206D6F76696E59
:10116000672075702E204D6F76696E6720646F77EB
:101170006E2C205A2069732061206E656761746946
:101180007665206E756D6265722E0A006D696372F8
:101190006F3A62697427732027412720627574743F
:1011A0006F6E2E205768656E20627574746F6E20A6
:1011B0006973207072657373656420646F776E2C39
:1011C0002069735F70726573736564282920697381
:1011D00020547275652E0A006D6963726F3A6269F8
:1011E0007427732027422720627574746F6E2E2037
:1011F0005768656E20627574746F6E206973207015
:1012000072657373656420646F776E2C2069735FF9
:101210007072657373656428292069732054727530
:10122000652E0A0049662074686520627574746FC3
:101230006E206973207072657373656420646F77C4
:101240006E2C2069735F7072657373656428292042
:10125000697320547275652C20656C736520466136
:101260006C73652E0A00557365207761735F707229
:101270006573736564282920746F206C6561726ED4
:101280002069662074686520627574746F6E2077BB
:10129000617320707265737365642073696E636532
:1012A00020746865206C6173742074696D650A77B9
:1012B00061735F7072657373656428292077617349
:1012C0002063616C6C65642E2052657475726E7358
:1012D0002054727565206F722046616C73652E0A0A
:1012E00000557365206765745F707265737365730D
:1012F000282920746F2067657420746865207275D2
:101300006E6E696E6720746F74616C206F66206208
:101310007574746F6E20707265737365732C2061C1
:101320006E6420616C736F0A7265736574207468F3
:10133000697320636F756E74657220746F207A65AF
:10134000726F2E0A004769766573206120636F6DA6
:10135000706173732068656164696E67206265748B
:101360007765656E20302D333630207769746820BC
:1013700030206173206E6F7274682E0A0055736599
:10138000206D6963726F3A626974277320636F6DB1
:101390007061737320746F20646574656374207466
:1013A000686520646972656374696F6E2069742072
:1013B00069732068656164696E6720696E2E0A54DE
:1013C000686520636F6D706173732063616E206464
:1013D0006574656374206D61676E6574696320660A
:1013E00069656C64732E0A49742075736573207483
:1013F00068652045617274682773206D61676E654A
:10140000746963206669656C6420746F2064657418
:1014100065637420646972656374696F6E2E0A0077
:101420004966206D6963726F3A626974277320633D
:101430006F6D706173732069735F63616C69627251
:1014400061746564282920616E642061646A757323
:1014500074656420666F722061636375726163797D
:101460002C2072657475726E20547275652E0A494F
:101470006620636F6D70617373206861736E27748B
:10148000206265656E2061646A75737465642066A8
:101490006F722061636375726163792C2072657469
:1014A00075726E2046616C73652E0A004966206D68
:1014B0006963726F3A62697420697320636F6E6644
:1014C000757365642C2063616C6962726174652850
:1014D000292074686520636F6D7061737320746F69
:1014E0002061646A75737420746865206974732060
:1014F00061636375726163792E0A49742077696C40
:101500006C2061736B20796F7520746F20726F741B
:10151000617465207468652064657669636520740C
:101520006F2064726177206120636972636C65204B
:101530006F6E2074686520646973706C61792E0A1F
:10154000005265736574206D6963726F3A626974E5
:10155000277320636F6D70617373207573696E6795
:1015600020636C6561725F63616C6962726174694A
:101570006F6E282920636F6D6D616E642E0A52753F
:101580006E2063616C696272617465282920746FD2
:1015900020696D70726F7665206163637572616337
:1015A000792E0A0052657475726E206D61676E65E2
:1015B000746963206669656C64206465746563742E
:1015C000656420616C6F6E67206D6963726F3A624B
:1015D00069742773205820617869732E0A557375D2
:1015E000616C6C792C2074686520636F6D70617319
:1015F000732072657475726E7320746865206561FE
:101600007274682773206D61676E65746963206604
:1016100069656C6420696E206D6963726F2D546515
:10162000736C6120756E6974732E0A556E6C6573E8
:10163000732E2E2E61207374726F6E67206D61673A
:101640006E6574206973206E6561726279210A008B
:1016500052657475726E206D61676E657469632082
:101660006669656C64206465746563746564206193
:101670006C6F6E67206D6963726F3A62697427736D
:10168000205920617869732E0A557375616C6C79E5
:101690002C2074686520636F6D70617373207265B0
:1016A0007475726E73207468652065617274682742
:1016B00073206D61676E65746963206669656C642B
:1016C00020696E206D6963726F2D5465736C6120A3
:1016D000756E6974732E0A556E6C6573732E2E2E9B
:1016E00061207374726F6E67206D61676E65742020
:1016F0006973206E6561726279210A0052657475A2
:10170000726E206D61676E65746963206669656CD1
:101710006420646574656374656420616C6F6E67D2
:10172000206D6963726F3A6269742773205A206171
:101730007869732E0A557375616C6C792C20746806
:101740006520636F6D706173732072657475726E5E
:1017500073207468652065617274682773206D61F9
:10176000676E65746963206669656C6420696E20C4
:101770006D6963726F2D5465736C6120756E697449
:10178000732E0A556E6C6573732E2E2E6120737442
:10179000726F6E67206D61676E6574206973206E6D
:1017A0006561726279210A0052657475726E2073E8
:1017B0007472656E677468206F66206D61676E6510
:1017C000746963206669656C642061726F756E640C
:1017D000206D6963726F3A6269742E0A006D6963E5
:1017E000726F3A626974277320357835204C45440E
:1017F00020646973706C61792E0A005573652073DB
:10180000686F7728782920746F207072696E742051
:1018100074686520737472696E67206F7220696DD9
:10182000616765732027782720746F2074686520AE
:10183000646973706C61792E205472792073686FBB
:1018400077282748692127292E0A55736520736850
:101850006F7728732C20692920746F2073686F7745
:1018600020737472696E67202773272C206F6E6552
:101870002063686172616374657220617420612005
:1018800074696D65207769746820612064656C6196
:1018900079206F660A276927206D696C6C6973650A
:1018A000636F6E64732E0A00557365207363726FE5
:1018B0006C6C28732920746F207363726F6C6C20BA
:1018C00074686520737472696E67202773272061BE
:1018D00063726F73732074686520646973706C61E0
:1018E000792E0A557365207363726F6C6C28732CA4
:1018F00020692920746F207363726F6C6C2073747D
:1019000072696E67202773272077697468206120C9
:1019100064656C6179206F6620276927206D696C8A
:101920006C697365636F6E64732061667465720AB7
:1019300065616368206368617261637465722E0A11
:101940000055736520636C656172282920746F20CF
:10195000636C656172206D6963726F3A62697427A6
:101960007320646973706C61792E0A005573652069
:101970006765745F706978656C28782C20792920F8
:10198000746F2072657475726E2074686520646966
:1019900073706C61792773206272696768746E6511
:1019A0007373206174204C454420706978656C2005
:1019B00028782C79292E0A4272696768746E6573DB
:1019C000732063616E2062652066726F6D20302027
:1019D000284C4544206973206F66662920746F2067
:1019E0003920286D6178696D756D204C4544206201
:1019F00072696768746E657373292E0A0055736582
:101A0000207365745F706978656C28782C20792C58
:101A100020622920746F20736574207468652064C7
:101A20006973706C6179206174204C454420706941
:101A300078656C2028782C792920746F206272696F
:101A40006768746E657373202762270A7768696315
:101A5000682063616E20626520736574206265741E
:101A60007765656E203020286F66662920746F20A8
:101A700039202866756C6C206272696768746E65BF
:101A80007373292E0A00557365206F6E2829207400
:101A90006F207475726E206F6E20746865206469A3
:101AA00073706C61792E0A00557365206F66662825
:101AB0002920746F207475726E206F6666207468BA
:101AC0006520646973706C61792E0A005573652016
:101AD00069735F6F6E282920746F20717565727944
:101AE00020696620746865206D6963726F3A626967
:101AF00074277320646973706C6179206973206F37
:101B00006E20285472756529206F72206F666620DA
:101B10002846616C7365292E0A005573652072652D
:101B200061645F6C696768745F6C6576656C2829B1
:101B300020746F206765742074686520616D626928
:101B4000656E74206C69676874206C6576656C2CB2
:101B5000206265747765656E203020286461726B41
:101B60002920616E642032353520286272696768E9
:101B700074292E0A006D6963726F3A626974277363
:101B80002070696E2030206F6E2074686520676F4A
:101B90006C64206564676520636F6E6E6563746F47
:101BA000722E0A006D6963726F3A6269742773203E
:101BB00070696E2031206F6E2074686520676F6CCD
:101BC00064206564676520636F6E6E6563746F7211
:101BD0002E0A006D6963726F3A6269742773207010
:101BE000696E2032206F6E2074686520676F6C64A8
:101BF000206564676520636F6E6E6563746F722E17
:101C00000A006D6963726F3A6269742773207069A4
:101C10006E2033206F6E2074686520676F6C6420BF
:101C20006564676520636F6E6E6563746F722E0AFC
:101C3000006D6963726F3A62697427732070696E10
:101C40002034206F6E2074686520676F6C64206597
:101C500064676520636F6E6E6563746F722E0A0031
:101C60006D6963726F3A62697427732070696E20C0
:101C700035206F6E2074686520676F6C6420656422
:101C8000676520636F6E6E6563746F722E0A006DF8
:101C90006963726F3A62697427732070696E2036C7
:101CA000206F6E2074686520676F6C6420656467C0
:101CB0006520636F6E6E6563746F722E0A006D69C6
:101CC00063726F3A62697427732070696E203720DF
:101CD0006F6E2074686520676F6C6420656467654B
:101CE00020636F6E6E6563746F722E0A006D696398
:101CF000726F3A62697427732070696E2038206FA2
:101D00006E2074686520676F6C6420656467652069
:101D1000636F6E6E6563746F722E0A006D69637215
:101D20006F3A62697427732070696E2039206F6E74
:101D30002074686520676F6C642065646765206344
:101D40006F6E6E6563746F722E0A006D6963726FD9
:101D50003A62697427732070696E203130206F6E8B
:101D60002074686520676F6C642065646765206314
:101D70006F6E6E6563746F722E0A006D6963726FA9
:101D80003A62697427732070696E203131206F6E5A
:101D90002074686520676F6C6420656467652063E4
:101DA0006F6E6E6563746F722E0A006D6963726F79
:101DB0003A62697427732070696E203132206F6E29
:101DC0002074686520676F6C6420656467652063B4
:101DD0006F6E6E6563746F722E0A006D6963726F49
:101DE0003A62697427732070696E203133206F6EF8
:101DF0002074686520676F6C642065646765206384
:101E00006F6E6E6563746F722E0A006D6963726F18
:101E10003A62697427732070696E203134206F6EC6
:101E20002074686520676F6C642065646765206353
:101E30006F6E6E6563746F722E0A006D6963726FE8
:101E40003A62697427732070696E203135206F6E95
:101E50002074686520676F6C642065646765206323
:101E60006F6E6E6563746F722E0A006D6963726FB8
:101E70003A62697427732070696E203136206F6E64
:101E80002074686520676F6C6420656467652063F3
:101E90006F6E6E6563746F722E0A006D6963726F88
:101EA0003A62697427732070696E203139206F6E31
:101EB0002074686520676F6C6420656467652063C3
:101EC0006F6E6E6563746F722E0A006D6963726F58
:101ED0003A62697427732070696E203230206F6E09
:101EE0002074686520676F6C642065646765206393
:101EF0006F6E6E6563746F722E0A006D6963726F28
:101F00003A6269742C2077726974655F64696769E5
:101F100074616C2863686F6963652920746F20742D
:101F200068652070696E2E20596F7520686176652E
:101F30002074776F202763686F6963652720766157
:101F40006C7565732C0A3020286C6F29206F722005
:101F50003120286869292E0A006D6963726F3A6220
:101F600069742C20726561645F6469676974616C6F
:101F700028292076616C75652066726F6D20746803
:101F8000652070696E2061732065697468657220D0
:101F90003020286C6F29206F722031202868692931
:101FA0002E0A006D6963726F3A6269742C20777231
:101FB0006974655F616E616C6F672876616C7565C9
:101FC0002920746F207468652070696E2E20596F07
:101FD000752063616E2075736520616E792076616E
:101FE0006C7565206265747765656E0A3020616E78
:101FF0006420313032332E0A006D6963726F3A62A9
:1020000069742C20726561645F616E616C6F672812
:10201000292076616C75652066726F6D2074686525
:102020002070696E2E20576F772C20616E616C6F67
:102030006720686173206C6F7473206F662076610F
:102040006C7565730A2830202D20363535333529D7
:102050002E204469676974616C20686173206F6E1B
:102060006C79203020616E6420312E0A0049662090
:1020700070696E2069735F746F7563686564282981
:10208000206F6E206D6963726F3A6269742C2072E2
:10209000657475726E20547275652E204966206EC7
:1020A0006F7468696E6720697320746F75636869FF
:1020B0006E67207468652070696E2C0A726574758D
:1020C000726E2046616C73652E0A00436F6D6D75EC
:1020D0006E69636174652077697468206F6E65202E
:1020E0006F72206D6F7265206E616D65642064652E
:1020F000766963657320636F6E6E656374656420D3
:10210000746F206D6963726F3A6269742E20456145
:102110006368206E616D65640A6465766963652035
:1021200068617320616E2027616464726573732730
:102130002C20636F6D6D756E6963617465732075B6
:1021400073696E67204932432C20616E6420636F8F
:102150006E6E6563747320746F2074686520492FF8
:102160004F2070696E732E0A005573652072656189
:102170006428616464726573732C206E2920746F07
:10218000207265616420276E272062797465732050
:1021900066726F6D2074686520646576696365207A
:1021A0007769746820746869732061646472657308
:1021B000732E0A005573652077726974652861640F
:1021C00064726573732C206275666665722920746B
:1021D0006F20777269746520746F2074686520279A
:1021E00062756666657227206F6620746865206474
:1021F000657669636520617420746869732027615E
:10220000646472657373272E0A0055736520696EC6
:102210006974286672657175656E63792C207363C5
:102220006C2C207364612920746F20736574207492
:10223000686520627573206672657175656E637975
:1022400020616E642070696E732E0A0043726561AE
:10225000746520616E6420757365206275696C74A5
:102260002D696E20494D4147455320746F20736896
:102270006F77206F6E2074686520646973706C617D
:10228000792E205573653A0A496D616765280A20E1
:10229000202730393039303A270A20202739393978
:1022A00039393A270A20202739393939393A270A62
:1022B00020202730393939303A270A20202730307A
:1022C0003930303A27290A2E2E2E746F206D616B1B
:1022D000652061206E6577203578352068656172EC
:1022E0007420696D6167652E204E756D626572732D
:1022F00020676F2066726F6D203020286F66662918
:1023000020746F203920286272696768746573745D
:10231000292E204E6F74650A74686520636F6C6F98
:102320006E20273A2720746F2073657420746865C7
:1023300020656E64206F66206120726F772E0A0020
:1023400052657475726E207468652077696474686C
:10235000206F662074686520696D61676520696E0D
:1023600020706978656C732E0A0052657475726E00
:102370002074686520686569676874206F662074DA
:10238000686520696D61676520696E207069786590
:102390006C732E0A00557365206765745F706978E9
:1023A000656C28782C20792920746F2072657475EB
:1023B000726E2074686520696D616765277320629D
:1023C00072696768746E657373206174204C45444C
:1023D00020706978656C2028782C79292E0A427241
:1023E000696768746E6573732063616E206265202F
:1023F00066726F6D203020284C4544206973206F31
:1024000066662920746F203920286D6178696D75A2
:102410006D204C4544206272696768746E65737301
:10242000292E0A00557365207365745F706978659D
:102430006C28782C20792C20622920746F207365F9
:102440007420746865204C454420706978656C2060
:1024500028782C792920696E2074686520696D615F
:10246000676520746F206272696768746E65737344
:102470000A2762272077686963682063616E20629B
:102480006520736574206265747765656E20302001
:10249000286F66662920746F2039202866756C6C59
:1024A000206272696768746E657373292E0A00551D
:1024B00073652073686966745F6C65667428692942
:1024C00020746F206D616B65206120636F707920CF
:1024D0006F662074686520696D6167652062757438
:1024E000206D6F7665642027692720706978656C98
:1024F0007320746F20746865206C6566742E0A0002
:102500005573652073686966745F726967687428BB
:10251000692920746F206D616B65206120636F7085
:1025200079206F662074686520696D616765206237
:102530007574206D6F76656420276927207069782F
:10254000656C7320746F0A746865207269676874BB
:102550002E0A005573652073686966745F7570286C
:10256000692920746F206D616B65206120636F7035
:1025700079206F662074686520696D6167652062E7
:102580007574206D6F7665642027692720706978DF
:10259000656C732075702E0A005573652073686929
:1025A00066745F646F776E28692920746F206D618F
:1025B0006B65206120636F7079206F662074686599
:1025C00020696D61676520627574206D6F76656442
:1025D0002027692720706978656C7320646F776E97
:1025E0002E0A0055736520636F7079282920746F57
:1025F000206D616B652061206E6577206578616371
:102600007420636F7079206F662074686520696D2F
:102610006167652E0A005573652063726F702878B4
:10262000312C2079312C2078322C207932292074D9
:102630006F206D616B652061206375742D6F7574FB
:1026400020636F7079206F662074686520696D6102
:10265000676520776865726520636F6F7264696E65
:102660006174650A2878312C7931292069732074C6
:10267000686520746F70206C65667420636F726E7D
:102680006572206F6620746865206375742D6F75A0
:1026900074206172656120616E6420636F6F726483
:1026A000696E617465202878322C7932292069732B
:1026B000207468650A626F74746F6D207269676850
:1026C0007420636F726E65722E0A005573652069FF
:1026D0006E76657274282920746F206D616B652099
:1026E00061206E6567617469766520636F7079201B
:1026F0006F662074686520696D6167652E20576874
:10270000657265206120706978656C20776173203F
:10271000627269676874206F720A6F6E20696E203A
:10272000746865206F726967696E616C2C206974CA
:102730002069732064696D206F72206F666620695E
:102740006E20746865206E656761746976652063C4
:102750006F70792E0A00436F6D6D756E69636174D9
:1027600065207769746820612073657269616C20E7
:1027700064657669636520636F6E6E656374656416
:1027800020746F206D6963726F3A626974277320D9
:10279000492F4F2070696E732E0A005573652069AA
:1027A0006E6974282920746F2073657420757020F9
:1027B000636F6D6D756E69636174696F6E2E205500
:1027C00073652070696E7320302028545829206169
:1027D0006E6420312028525829207769746820615E
:1027E00020626175640A72617465206F66203936F3
:1027F00030302E0A4F7665727269646520746865A0
:102800002064656661756C747320666F7220276240
:1028100061756472617465272C2027706172697418
:10282000792720616E64202770696E73272E0A0055
:1028300049662074686572652061726520696E63FF
:102840006F6D696E6720636861726163746572732E
:102850002077616974696E6720746F2062652072E9
:102860006561642C20616E7928292077696C6C2061
:1028700072657475726E20547275652E0A4F746895
:102880006572776973652C2072657475726E73203A
:1028900046616C73652E0A0055736520726561642C
:1028A000282920746F2072656164206368617261F9
:1028B00063746572732E0A557365207265616428AE
:1028C0006E2920746F20726561642C206174206D04
:1028D0006F73742C20276E27206279746573206FC4
:1028E0006620646174612E0A00557365207265610B
:1028F000646C696E65282920746F2072656164209C
:1029000061206C696E65207468617420656E647303
:1029100020776974682061206E65776C696E652028
:102920006368617261637465722E0A005573652075
:1029300072656164696E746F286275662920746FB0
:10294000207265616420627974657320696E746FAA
:1029500020746865206275666665722027627566F8
:10296000272E0A5573652072656164696E746F283D
:10297000627566662C206E2920746F207265616412
:102980002C206174206D6F73742C20276E27206EAD
:10299000756D626572206F66206279746573206957
:1029A0006E746F2027627566272E0A0055736520A6
:1029B0007772697465286275662920746F20777252
:1029C0006974652074686520627974657320696E26
:1029D0002062756666657220276275662720746FAF
:1029E0002074686520636F6E6E656374656420642F
:1029F00065766963652E0A00436F6D6D756E696358
:102A0000617465207573696E6720612073657269F2
:102A1000616C207065726970686572616C20696EA6
:102A20007465726661636520285350492920646586
:102A30007669636520636F6E6E6563746564207488
:102A40006F0A6D6963726F3A626974277320492F48
:102A50004F2070696E732E0A0055736520696E6988
:102A600074282920746F2073657420757020636F3B
:102A70006D6D756E69636174696F6E2E204F76653A
:102A80007272696465207468652064656661756C3E
:102A9000747320666F722062617564726174652C54
:102AA000206D6F64652C0A53434C4B2C204D4F53C3
:102AB0004920616E64204D49534F2E205468652093
:102AC00064656661756C7420636F6E6E65637469AE
:102AD0006F6E73206172652070696E313320666F8E
:102AE000722053434C4B2C2070696E313520666F39
:102AF000720A4D4F534920616E642070696E313403
:102B000020666F72204D49534F2E0A005573652081
:102B10007772697465286275662920746F207772F0
:102B200069746520627974657320696E20627566C8
:102B300066657220276275662720746F2074686549
:102B400020636F6E6E656374656420646576696387
:102B5000652E0A005573652072656164286E292010
:102B6000746F207265616420276E27206279746516
:102B700073206F6620646174612E0A0055736520AE
:102B800077726974655F72656164696E746F286FCE
:102B900075742C20696E2920746F207772697465B2
:102BA0002074686520276F757427206275666665D6
:102BB0007220746F2074686520636F6E6E65637435
:102BC0006564206465766963650A616E6420726578
:102BD000616420616E7920726573706F6E73652019
:102BE000696E746F207468652027696E272062758E
:102BF000666665722E20546865206C656E67746821
:102C0000206F662074686520627566666572732041
:102C100073686F756C640A626520746865207361FF
:102C20006D652E2054686520627566666572732036
:102C300063616E206265207468652073616D652034
:102C40006F626A6563742E0A00506C756720696E46
:102C5000206120737065616B6572207769746820EC
:102C600063726F636F64696C6520636C6970732055
:102C7000616E64206D616B65206D6963726F3A628D
:102C8000697420676F20626C65657020616E6420D6
:102C9000626C6F6F702E0A00557365207365745FE8
:102CA00074656D706F286E756D6265722C20627030
:102CB0006D2920746F206D616B65206120626561F4
:102CC00074206C617374206120276E756D6265726B
:102CD00027206F66207469636B73206C6F6E6720AA
:102CE000616E640A706C617965642061742027628A
:102CF000706D2720626561747320706572206D6944
:102D00006E7574652E0A005573652070697463686A
:102D100028667265712C206C656E67746829207452
:102D20006F206D616B65206D6963726F3A626974C3
:102D300020706C61792061206E6F74652061742051
:102D4000276672657127206672657175656E637995
:102D500020666F720A276C656E67746827206D693C
:102D60006C6C697365636F6E64732E20452E672EDD
:102D7000207069746368283434302C20313030304E
:102D8000292077696C6C20706C617920636F6E63A9
:102D90006572742027412720666F72203120736589
:102DA000636F6E642E0A0055736520706C6179281C
:102DB0006D757369632920746F206D616B65206D7B
:102DC0006963726F3A62697420706C617920276D53
:102DD0007573696327206C697374206F66206E6F4A
:102DE0007465732E20547279206F75742074686531
:102DF0000A6275696C7420696E206D757369632051
:102E0000746F2073656520686F7720697420776F11
:102E1000726B732E20452E672E206D757369632E9D
:102E2000706C6179286D757369632E50554E4348F7
:102E30004C494E45292E0A00557365206765745F1D
:102E400074656D706F282920746F207265747572B7
:102E50006E20746865206E756D626572206F6620E5
:102E60007469636B7320696E2061206265617420F0
:102E7000616E64206E756D626572206F662062659A
:102E80006174730A706572206D696E7574652E0ABF
:102E90000055736520746F2073746F702829207437
:102EA0006865206D75736963207468617420697347
:102EB00020706C6179696E672E0A0049662074681B
:102EC000696E677320676F2077726F6E672C207250
:102ED00065736574282920746865206D757369634E
:102EE00020746F206974732064656661756C74204A
:102EF00073657474696E67732E0A005365653A20B2
:102F0000687474703A2F2F786B63642E636F6D2F23
:102F10003335332F0A00546865205A656E206F667A
:102F200020507974686F6E20646566696E657320E1
:102F30007768617420697420697320746F206265FA
:102F400020507974686F6E69632E20497420776F02
:102F5000756C646E277420666974206F6E207468C7
:102F600069730A64657669636520736F20776527E6
:102F70007665207772697474656E2061205A656E7B
:102F8000206F66204D6963726F507974686F6E2090
:102F9000696E73746561642E0A00557365206175EE
:102FA00074686F7273282920746F2072657665616A
:102FB0006C20746865206E616D6573206F66207487
:102FC00068652070656F706C652077686F2063722C
:102FD0006561746564207468697320736F667477C3
:102FE0006172652E0A00416C6C20796F75206E65E8
:102FF00065642E20557365206C6F76652E62616462
:1030000061626F6F6D282920746F20726570656131
:103010007420746865206566666563742E0A0048CE
:10302000656172206D7920736F756C2073706561B6
:103030006B3A0A546865207665727920696E7374FC
:10304000616E7420746861742049207361772079FF
:103050006F752C206469640A4D792068656172740B
:1030600020666C7920746F20796F75722073657299
:10307000766963652E0A0057656C636F6D65207411
:103080006F204D6963726F507974686F6E206F6E38
:1030900020746865206D6963726F3A626974210AF1
:1030A0000A54727920746865736520636F6D6D6171
:1030B0006E64733A0A2020646973706C61792E73B0
:1030C00063726F6C6C282748656C6C6F27290A2027
:1030D0002072756E6E696E675F74696D6528290A66
:1030E0002020736C6565702831303030290A20202B
:1030F000627574746F6E5F612E69735F7072657351
:1031000073656428290A5768617420646F207468A5
:1031100065736520636F6D6D616E647320646F3FCE
:103120002043616E20796F7520696D70726F7665CE
:10313000207468656D3F2048494E543A2075736588
:103140002074686520757020616E6420646F776EEE
:103150000A6172726F77206B65797320746F2067D4
:10316000657420796F757220636F6D6D616E642078
:10317000686973746F72792E20507265737320744E
:10318000686520544142206B657920746F20617519
:10319000746F2D636F6D706C6574650A756E66690A
:1031A0006E697368656420776F7264732028736F2B
:1031B0002027646927206265636F6D65732027642B
:1031C0006973706C61792720616674657220796F0C
:1031D0007520707265737320544142292E20546803
:1031E0006573650A747269636B7320736176652019
:1031F00061206C6F74206F6620747970696E67202F
:10320000616E64206C6F6F6B20636F6F6C210A0AB4
:103210004578706C6F72653A0A547970652027683A
:10322000656C7028736F6D657468696E67292720F7
:10323000746F2066696E64206F75742061626F75AB
:10324000742069742E20547970652027646972286F
:10325000736F6D657468696E67292720746F2073BA
:10326000656520776861740A69742063616E206403
:103270006F2E2054797065202764697228292720D1
:10328000746F207365652077686174207374756648
:103290006620697320617661696C61626C652E20BD
:1032A000466F7220676F6F646E6573732073616B16
:1032B000652C0A646F6E2774207479706520276905
:1032C0006D706F72742074686973272E0A0A436FD9
:1032D0006E74726F6C20636F6D6D616E64733A0A09
:1032E00020204354524C2D432020202020202020F9
:1032F0002D2D2073746F7020612072756E6E696E53
:10330000672070726F6772616D0A20204354524CBF
:103310002D4420202020202020202D2D206F6E20C5
:103320006120626C616E6B206C696E652C20646F2D
:10333000206120736F6674207265736574206F66F8
:1033400020746865206D6963726F3A6269740A203F
:10335000204354524C2D4520202020202020202D79
:103360002D20656E746572207061737465206D6FB9
:1033700064652C207475726E696E67206F666620B6
:103380006175746F2D696E64656E740A0A466F729A
:103390002061206C697374206F6620617661696CAE
:1033A00061626C65206D6F64756C65732C20747937
:1033B00070652068656C7028276D6F64756C657327
:1033C00027290A0A466F72206D6F726520696E6642
:1033D0006F726D6174696F6E2061626F75742050D9
:1033E0007974686F6E2C2076697369743A206874FA
:1033F00074703A2F2F707974686F6E2E6F72672F0A
:103400000A546F2066696E64206F75742061626F64
:103410007574204D6963726F507974686F6E2C20DB
:1034200076697369743A20687474703A2F2F6D69E5
:1034300063726F707974686F6E2E6F72672F0A50A7
:103440007974686F6E2F6D6963726F3A6269742068
:10345000646F63756D656E746174696F6E206973F6
:1034600020686572653A2068747470733A2F2F6D06
:103470006963726F6269742D6D6963726F707974BC
:10348000686F6E2E72656164746865646F63732E15
:10349000696F2F0A003C6D6F64756C65202725737A
:1034A000273E0050696E20256420696E202571201A
:1034B0006D6F646500506C757320616E79206D6F5F
:1034C00064756C6573206F6E207468652066696C26
:1034D0006573797374656D0A006F626A6563742041
:1034E00000206973206F6620747970652025730A47
:1034F00000202D2D20006279746561727261792837
:10350000620061727261792827256327002C205B95
:10351000004E6F6E65002020202020202020000813
:1035200008080808080808000506070409080A042E
:10353000031213141615170F0D0E111063616E2769
:10354000742061737369676E20746F206C69746591
:1035500072616C0063616E27742061737369676EBA
:1035600020746F2065787072657373696F6E00697F
:103570006C6C6567616C2065787072657373696FD8
:103580006E20666F72206175676D656E746564206C
:1035900061737369676E6D656E74006D756C7469C7
:1035A000706C65202A7820696E2061737369676E7C
:1035B0006D656E740063616E27742064656C65745C
:1035C000652065787072657373696F6E00657870D9
:1035D000656374696E67206B65793A76616C7565B1
:1035E00020666F722064696374696F6E617279001E
:1035F000657870656374696E67206A75737420619D
:103600002076616C756520666F7220736574007337
:103610007570657228292063616E27742066696E53
:10362000642073656C660027627265616B27206F8A
:10363000757473696465206C6F6F700027636F6EBB
:1036400074696E756527206F757473696465206C85
:103650006F6F7000696E76616C6964206D6963726A
:103660006F707974686F6E206465636F7261746FD8
:1036700072006E6F6E2D64656661756C7420617288
:1036800067756D656E7420666F6C6C6F7773206400
:10369000656661756C7420617267756D656E740026
:1036A0006964656E746966696572207265646566D1
:1036B000696E656420617320676C6F62616C006382
:1036C000616E2774206465636C617265206E6F6E35
:1036D0006C6F63616C20696E206F75746572206316
:1036E0006F6465006E6F2062696E64696E67206644
:1036F0006F72206E6F6E6C6F63616C20666F756E9B
:1037000064006964656E74696669657220726564D7
:103710006566696E6564206173206E6F6E6C6F63A1
:10372000616C002772657475726E27206F757473F3
:103730006964652066756E6374696F6E00696E7684
:10374000616C69642073796E746178006E616D6577
:103750002072657573656420666F7220617267758B
:103760006D656E7400696E6C696E6520617373655A
:103770006D626C6572206D757374206265206120C6
:1037800066756E6374696F6E00756E6B6E6F776EC3
:1037900020747970650072657475726E20616E6E4A
:1037A0006F746174696F6E206D757374206265202B
:1037B000616E206964656E7469666965720065781A
:1037C00070656374696E6720616E20617373656DE7
:1037D000626C657220696E737472756374696F6E62
:1037E00000276C6162656C2720726571756972656E
:1037F00073203120617267756D656E74006C616253
:10380000656C207265646566696E65640027616C2D
:1038100069676E2720726571756972657320312042
:10382000617267756D656E7400276461746127202D
:103830007265717569726573206174206C6561735E
:1038400074203220617267756D656E747300276431
:103850006174612720726571756972657320696E84
:10386000746567657220617267756D656E7473004B
:103870002A78206D7573742062652061737369679F
:103880006E6D656E74207461726765740063616E3D
:1038900027742068617665206D756C7469706C653D
:1038A000202A780063616E27742068617665206D38
:1038B000756C7469706C65202A2A78004C48532016
:1038C0006F66206B6579776F726420617267206D17
:1038D00075737420626520616E206964006E6F6E7E
:1038E0002D6B6579776F72642061726720616674F1
:1038F0006572202A2F2A2A006E6F6E2D6B657977EC
:103900006F726420617267206166746572206B65F6
:1039100079776F7264206172670064656661756CA7
:103920007420276578636570743A27206D75737409
:10393000206265206C61737400277969656C642767
:10394000206F7574736964652066756E6374696F42
:103950006E003C2573206F626A6563742061742079
:1039600025703E006973737562636C6173732829F7
:10397000206172672031206D75737420626520614B
:1039800020636C6173730027257327206F626A655B
:103990006374206973206E6F742063616C6C616264
:1039A0006C65005F5F696E69745F5F2829207368CA
:1039B0006F756C642072657475726E204E6F6E65E3
:1039C0002C206E6F7420272573270069737375622E
:1039D000636C6173732829206172672032206D75D2
:1039E0007374206265206120636C617373206F7251
:1039F0002061207475706C65206F6620636C617344
:103A000073657300747970652027257127206973A9
:103A1000206E6F7420616E206163636570746162F3
:103A20006C6520626173652074797065006D756CDA
:103A30007469706C65206261736573206861766576
:103A400020696E7374616E6365206C61792D6F758A
:103A50007420636F6E666C696374003C7375706587
:103A6000723A200063616E6E6F74206372656174D8
:103A700065202725712720696E7374616E636573F5
:103A800000747970652074616B65732031206F72EA
:103A9000203320617267756D656E7473003C636CD2
:103AA00061737320272571273E0000010102020285
:103AB0000203030303030303030463616E277420FB
:103AC000636F6E7665727420696E6620746F20690C
:103AD0006E740063616E277420636F6E7665727416
:103AE000204E614E20746F20696E7400617267759C
:103AF0006D656E74206861732077726F6E672074D5
:103B0000797065006D656D6F727920616C6C6F63A3
:103B10006174696F6E206661696C65642C206865EC
:103B20006170206973206C6F636B6564006D656DF7
:103B30006F727920616C6C6F636174696F6E20665F
:103B400061696C65642C20616C6C6F636174696E73
:103B500067202575206279746573006E65676174EE
:103B600069766520736869667420636F756E74008A
:103B7000756E737570706F7274656420747970659A
:103B80007320666F722025713A20272573272C2019
:103B9000272573270027257327206F626A656374C2
:103BA000206973206E6F74206974657261626C6540
:103BB0000063616E6E6F7420696D706F7274206E39
:103BC000616D652025710027257327206F626A6566
:103BD0006374206973206E6F7420616E2069746550
:103BE0007261746F72006E616D65202725712720E8
:103BF0006973206E6F7420646566696E6564007415
:103C0000797065206F626A656374202725712720AB
:103C1000686173206E6F2061747472696275746577
:103C200020272571270027257327206F626A656387
:103C30007420686173206E6F20617474726962759C
:103C40007465202725712700657863657074696F36
:103C50006E73206D75737420646572697665206675
:103C6000726F6D2042617365457863657074696F2A
:103C70006E00756E737570706F7274656420747900
:103C8000706520666F722025713A20272573270002
:103C90006E656564206D6F7265207468616E2025A5
:103CA000642076616C75657320746F20756E706129
:103CB000636B00746F6F206D616E792076616C7537
:103CC000657320746F20756E7061636B2028657852
:103CD0007065637465642025642900546865205A02
:103CE000656E206F66204D6963726F507974686FDE
:103CF0006E2C206279204E6963686F6C6173204876
:103D00002E20546F6C6C65727665790A0A436F6475
:103D1000652C0A4861636B2069742C0A4C657373C7
:103D2000206973206D6F72652C0A4B656570206980
:103D3000742073696D706C652C0A536D616C6C2016
:103D400069732062656175746966756C2C0A0A4234
:103D5000652062726176652120427265616B207414
:103D600068696E677321204C6561726E20616E64B4
:103D700020686176652066756E210A4578707265E7
:103D8000737320796F757273656C662077697468D8
:103D9000204D6963726F507974686F6E2E0A0A48FD
:103DA00061707079206861636B696E6721203A2DBC
:103DB000290A004D6963726F507974686F6E206FC5
:103DC0006E20746865206D6963726F3A6269742051
:103DD00069732062726F7567687420746F20796FE1
:103DE000752062793A0A44616D69656E20502E2013
:103DF00047656F7267652C204D61726B2053686157
:103E00006E6E6F6E2C205261646F6D697220446F0C
:103E100070696572616C736B692C204D6174746894
:103E2000657720456C73652C0A4361726F6C20576F
:103E3000696C6C696E672C20546F6D2056696E65D5
:103E4000722C20416C616E204A61636B736F6E2C23
:103E5000204E69636B20436F67686C616E2C204A4B
:103E60006F7365706820486169672C0A416C6578DA
:103E7000204368616E2C20416E6472656120477238
:103E8000616E64692C205061756C204567616E2CF1
:103E90002050696F7472204B617370727A796B2C49
:103EA00020416E64726577204D756C686F6C6C6133
:103EB0006E642C0A4D61747420576865656C657278
:103EC0002C204A6F6520476C616E63792C2041621B
:103ED0006269652042726F6F6B7320616E64204E61
:103EE0006963686F6C617320482E20546F6C6C6539
:103EF000727665792E0A0046696E616C2064617481
:103F00006120666F7220737065656368206F7574D9
:103F10007075742E202569206672616D65733A0D87
:103F20000A0D0A0020666C61677320616D706C3148
:103F300020667265713120616D706C322066726529
:103F4000713220616D706C33206672657133207040
:103F5000697463680D002D2D2D2D2D2D2D2D2D2DEA
:103F60002D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D81
:103F70002D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D71
:103F80002D2D2D2D2D2D0D00253569202535692050
:103F90002535692025356920253569202535692095
:103FA000253569202535690D0A003D3D3D3D3D3DE6
:103FB0003D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D31
:103FC0003D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D21
:103FD0003D3D3D3D3D0D0025733A0D0A0D0A002083
:103FE0006964782020202070686F6E656D652020E0
:103FF0006C656E67746820207374726573730D004E
:1040000020253369202020202020256325632020BF
:1040100020202020253369202020202020202569F1
:104020000D0A00202533692020202020203F3F203A
:10403000202020202025336920202020202020251A
:10404000690D0A00616464726573732025303878E5
:10405000206973206E6F7420616C69676E656420DF
:10406000746F202564206279746573003C25752D7A
:10407000626974206D656D6F72793E004743206DF3
:10408000656D6F7279206C61796F75743B20667213
:104090006F6D2025703A000A202020202020202843
:1040A0002575206C696E657320616C6C2066726585
:1040B0006529000A253035783A200047433A2074B4
:1040C0006F74616C3A2025752C20757365643A20F5
:1040D00025752C20667265653A2025750A00204EEC
:1040E0006F2E206F6620312D626C6F636B733A20E8
:1040F00025752C20322D626C6F636B733A20257509
:104100002C206D617820626C6B20737A3A202575C3
:104110002C206D6178206672656520737A3A2025BF
:10412000750A00696C6C6567616C206D6F64650071
:104130004932432072656164206572726F72202576
:104140006400493243207772697465206572726F2A
:104150007220256400737461636B3A202575206FAB
:104160007574206F662025750A0071737472207053
:104170006F6F6C3A206E5F706F6F6C3D25752C20F1
:104180006E5F717374723D25752C206E5F7374724F
:104190005F646174615F62797465733D25752C207D
:1041A0006E5F746F74616C5F62797465733D2575C1
:1041B0000A000000040202040200000204040400D9
:1041C00002020004040301000001030303000101D3
:1041D00002030304020101030104030100030000C0
:1041E00004010102000003020000040202040200B4
:1041F00000020404040002020004040301000001A0
:10420000030303000101020303040201010301048B
:1042100003010003000004010102000003026E6FAD
:104220007420616E20696D616765006272696768FC
:10423000746E657373206F7574206F6620626F757E
:104240006E6473006F766572666C6F7720636F6E55
:1042500076657274696E67206C6F6E6720696E7424
:1042600020746F206D616368696E6520776F72647A
:1042700000706F706974656D28293A2064696374F1
:10428000696F6E61727920697320656D7074790051
:1042900025712800646963742075706461746520F9
:1042A00073657175656E6365206861732077726FE1
:1042B0006E67206C656E67746800285B005D29007E
:1042C000646963745F6974656D7300646963745FC6
:1042D0006B65797300646963745F76616C7565738F
:1042E00000696E76616C6964206E756D626572201E
:1042F0006F6620706978656C7300696E76616C69B1
:104300006420636F6C6F7572005265616420657222
:10431000726F72004F75742D6F662D6275666665DB
:1043200072207265616400577269746520657272EB
:104330006F720000000000000D0D0E0F0F0F0F0F29
:104340000C0D0C0F0F0D0D0D0E0D0C0D0D0D0C09A0
:104350000900000000000000000B0B0B0B00000127
:104360000B00020E0F0F0F0F0D02040002040001DC
:104370000400010400000000000000000C00000028
:10438000000F0F00000000000A0B0D0E0D0C0C0BAF
:10439000090B0B0C0C0C08080C080A08080A030986
:1043A00006000000000000000003050304000000F8
:1043B000050A020E0D0C0D0C0800010000010000A2
:1043C0000100000100000000000000000A00000AD7
:1043D00000000000000000000807080801010001BB
:1043E00000070501000601000700050100080000A4
:1043F00003000000000000000000010000000000B9
:10440000010E010901000100000000000000000091
:104410000000000000000000000000000700000590
:104420000013100001020202030304040506080938
:104430000B0D0F00001F1F1F1F02020202020202CB
:1044400002020505020A020805050B0A090808A070
:104450000808171F121212121E1E14141414171714
:104460001A1A1D1D0202020202021A1D1B1A1D1B2E
:104470001A1D1B1A1D1B171D17171D17171D1717A0
:104480001D17171700131313130A0E12181A1614F8
:1044900010140E120E1212100C0E0A120E0A08063A
:1044A00006060611060606060E10090A080A060682
:1044B00006050600121A141A120C0606060606064F
:1044C000060606060606060606060606060A0A0684
:1044D00006062C1300434343435448423E282C1EF7
:1044E000242C4830241E32241C4418321E18522E0C
:1044F00036563643494F1A4249253342282F4F4FEB
:10450000424F6E0048261E2A1E221A1A1A424242A2
:104510006E6E6E5454541A1A1A4242426D566D54BD
:1045200054547F7F005B5B5B5B6E5D5B58595758F3
:1045300052595D3E52583E6E505D5A3C6E5A6E5115
:104540007965795B636A51795D525D674C5D65653C
:10455000796579005A58585858525151517979799A
:10456000706E6E5E5E5E5151517979796565705EEF
:104570005E5E080100020202020404040404040452
:1045800004040404040403030404030303030301F5
:1045900002030201030303030101030303020203F5
:1045A00002030000050505050404020002020003E1
:1045B00002000402000302000202000203000303DF
:1045C0000003B0A000000000000A0E13181B17150E
:1045D00010140E120E1212100D0F0B120E0B0906F4
:1045E00006060000000000000000000000000000BF
:1045F00000000000131B151B120D0000000000003E
:1046000000000000000000000000000000010102A6
:10461000020303040405050606070700010203045C
:1046200005060708090A0B0C0D0E0F00010304060E
:1046300007090A0C0D0F10121315160002040608C4
:104640000A0C0E10121416181A1C1E000205070A76
:104650000C0F111416191B1E202325000306090C2C
:104660000F1215181B1E2124272A2D0003070A0EDE
:104670001115181C1F23262A2D313400FCF8F4F0E4
:10468000ECE8E4E0DCD8D4D0CCC8C400FCF9F5F206
:10469000EEEBE7E4E0DDD9D6D2CFCB00FDFAF7F4BC
:1046A000F1EEEBE8E5E2DFDCD9D6D300FDFBF8F66E
:1046B000F3F1EEECE9E7E4E2DFDDDA00FEFCFAF824
:1046C000F6F4F2F0EEECEAE8E6E4E200FEFDFBFAD6
:1046D000F8F7F5F4F2F1EFEEECEBE900FFFEFDFC8C
:1046E000FBFAF9F8F7F6F5F4F3F2F100FFFFFEFE3E
:1046F000FDFDFCFCFBFBFAFAF9F9F80002020202EC
:10470000040404040404040404040404040302046C
:104710000402020202020101010101010101010181
:104720000102020201000100010005050505050462
:104730000402000102000102000102000102000265
:10474000020001030002030002A0A000000000001C
:104750000101010101010101010101010101010149
:104760000101010101010101010000000000000040
:104770000000000000000000000000010101010134
:104780000000000000000000000000000000000029
:104790000000000000000000000000000000009089
:1047A0009090909090909090909090909090909009
:1047B00090909090909090909090909090909090F9
:1047C00090909090909090909090909090909090E9
:1047D00090909090909090909090909090909090D9
:1047E00090909090909090909090909090909090C9
:1047F00090909090909090909090909090909090B9
:1048000090909090909090909090909090909090A8
:1048100090909090909090909090909090909070B8
:104820007070707070707070707070707070707088
:104830007070707070707070707070707070707078
:104840007070707070707070707070707070707068
:104850007070707070707070707070707070707058
:104860007070707070707070707070707070707048
:104870007070707070707070707070707070707038
:104880007070707070707070707070707070707028
:104890007070707070707070707070707070703850
:1048A000846B19C66318867398C6B11CCA318CC74D
:1048B0003188C23098463118C6350CCA310CC62131
:1048C00010246912C23114C471084A2249AB6AA883
:1048D000AC495132D55288936C94221554D2259606
:1048E000D450A5462108856B18C46310CE6B188C74
:1048F00071198C63350CC63399CC6CB54EA29946B0
:10490000212882952EE3309CC5309CA2B19C673152
:104910008866592C5318846750CAE30AACAB30AC94
:1049200062308C63109462B18C8228963398D6B52D
:104930004C6229A54AB59CC63114D6389C4BB48626
:104940006518AE671CA66319962319841308A6522E
:10495000ACCA22896EAB198C6234C46219866318A2
:10496000C42358D6A35042544AAD4A25116B6489DA
:104970004A63398A23312AEAA2A944C512CD4234B6
:104980008C62188C63114866319D44331D46319CFE
:10499000C6B10CCD3288C47318867308D663580725
:1049A00081E0F03C0787903C7C0FC7C0C0F07C1EC4
:1049B000078080001C7870F1C71FC00CFE1C1F1FF1
:1049C0000E0A7AC071F2838F030F0F0C0079F86121
:1049D000E0430F83E718F9C113DAE9638F0F83838C
:1049E00087C31F3C70F0E1E1E387B8710E20E38DCF
:1049F00048781C938730E1C1C1E478218383C38761
:104A00000639E5C387070E1C1C70F4719C603632B2
:104A1000C31E3CF38F0E3C70E3C78F0F0F0E3C7824
:104A2000F0E38706F0E307C199870F18787070FCF0
:104A3000F310B18C8C317C70E1863C646CB0E1E3A6
:104A40000F238F0F1E3E383C387B8F070E3CF41728
:104A50001E3C78F29E7249E32536385839E2DE3C36
:104A60007878E1C761E1E1B0F0F0C3C70E38C0F07B
:104A7000CE73731834B0E1C78E1C3CF838F0E1C136
:104A80008B868F1C7870F078ACB18F3931DB386150
:104A9000C30E0E387873171E391E3864E1F1C14E0B
:104AA0000F40A202C58F81A1FC120864E03C22E005
:104AB00045078E0C3290F01F2049E0F80C60F0178B
:104AC0001A41AAA4D08D12821E1E03F83E030C7355
:104AD000807044260324E13E044E041CC109CC9E90
:104AE000902107904364C00FC6909CC15B03E21DF8
:104AF00081E05E1D0384B82C0F80B183E030411E3D
:104B000043898350FC242E1383F17C4C2CC90D83E4
:104B1000B0B582E4E8069C07A0991D073E828F701D
:104B2000307440CA10E4E80F92143F06F8848843BA
:104B3000810A343941C6E31C4703B0B8130AC26482
:104B4000F818F960B3C0652060A68CC381203026B8
:104B50001E1C38D301B02640F40BC3421F853226F9
:104B60006040C9CB01EC112840FA0434E0704C8C51
:104B70001D07690316C80423E8C69A0B1A03E076DA
:104B80000605CF1EBC5831716600F83F04FC0C745A
:104B9000278A8071C23A2606C01F050F9840AE01D1
:104BA0007FC007FF000EFE0003DF8003EF801BF1D4
:104BB000C200E7E018FCE021FC803CFC400E7E00D7
:104BC0003F3E000FFE001FFF003EF007FC007E107E
:104BD0003FFF003F380E7C01870CFCC7003E040FEE
:104BE0003E1F0F0F1F0F028387CF03870F3FC007A2
:104BF0009E603FC003FE003FE077E1C0FEE0C3E0FF
:104C000001DFF80307007E70007C3818FE0C1E7868
:104C10001C7C3E0E1F1E1E3E007F8307DB87830722
:104C2000C7071071FF003FE201E0C1C3E1007FC090
:104C300005F020F8F070FE7879F8023F0C8F030F32
:104C40009FE0C1C78703C3C3B0E1E1C1E3E071F0F6
:104C500000FC707C0C3E380E1C70C3C70381C1C7BA
:104C6000E7000FC7871909EFC433E0C1FCF870F003
:104C700078F8F061C7001FF8017CF8F078703C7C90
:104C8000CE0E2183CF08078F08C1878F80C7E3002E
:104C900007F8E0EF0039F7800EF8E1E3F8219FC054
:104CA000FF03F807C01FF8C404FCC4C1BC87F00FA1
:104CB000C07F05E025ECC03E8447F08E03F803FB7F
:104CC000C019F8079C0C17F807E01FA1FC0FFC01A6
:104CD000F03F00FE03F01F00FD00FF880DF901FF0B
:104CE000007007C03E42F30DC47F80FC07F05EC039
:104CF0003F00783F81FF01F801C3E80CE4648FE4D2
:104D00000FF007F0C21F007FC06F807E03F807F02E
:104D10003FC0780F8207FE227770027603FE00FE06
:104D200067007CC7F18EC63BE03F84F319D8039936
:104D3000FC09B80FF8009D2461F90D00FD03F01F78
:104D4000903F01F81FD00FF83701F807F00FC03F70
:104D500000FE03F80FC03F00FA03F00F80FF01B818
:104D600007F001FC01BC80131E007FE1407FA07FA3
:104D7000B0003FC01FC0380FF01F80FF01FC03F1DF
:104D80007E01FE01F0FF007FC01D07F00FC07E0610
:104D9000E007E00FF806C1FE01FC03E00F00FC0095
:104DA0000000000000000000000000000000000003
:104DB000000000000000000000000000000000F102
:104DC000E2D3BB7C950102030300720002000000E5
:104DD00000000000000000000000000000000000D3
:104DE00000001B000019000000000000000000008F
:104DF0000000101010101010202020202020303033
:104E000030303030304040404040404050505050B2
:104E100050505050606060606060606060606060D2
:104E20007070707070707070707070707070707082
:104E30007070707070707070707070707070706082
:104E400060606060606060606060605050505050B2
:104E50005050504040404040404030303030303082
:104E600030202020202020101010101010000000F2
:104E70000000F0F0F0F0F0F0E0E0E0E0E0E0D0D0B2
:104E8000D0D0D0D0D0C0C0C0C0C0C0C0B0B0B0B012
:104E9000B0B0B0B0A0A0A0A0A0A0A0A0A0A0A0A0D2
:104EA0009090909090909090909090909090909002
:104EB000909090909090909090909090909090A0E2
:104EC000A0A0A0A0A0A0A0A0A0A0A0B0B0B0B0B092
:104ED000B0B0B0C0C0C0C0C0C0C0D0D0D0D0D0D0A2
:104EE000D0E0E0E0E0E0E0F0F0F0F0F0F000000012
:104EF00000E0E6ECF3F900060C06181A1717170085
:104F0000000000005449433F282C1F252D4931241F
:104F10001E33251D4518321E18532E36560000002C
:104F20000000000000000000000000000000004839
:104F3000271F2B1E220000000005000051282573AA
:104F4000290A008F012A00FA015F008A012F006CF4
:104F50000325236F007B032523780058057B3A2324
:104F6000627D00AF010A0073206D6178696D756D17
:104F700020726563757273696F6E20646570746802
:104F800020657863656564656400BD083C6D6F6489
:104F9000756C653E0080083C6C616D6264613E002A
:104FA000D40A3C6C697374636F6D703E00CC0A3C2C
:104FB00064696374636F6D703E0054093C7365747B
:104FC000636F6D703E0034093C67656E6578707282
:104FD0003E0052083C737472696E673E00E3073C02
:104FE000737464696E3E00B7057574662D3800945D
:104FF0000468656C70007305696E70757400E00B71
:10500000636F6C6C656374696F6E73001206737402
:105010007275637400C0086D6963726F62697400B1
:105020001005726573657400EA05736C6565700040
:10503000C80C72756E6E696E675F74696D6500D0BD
:105040000570616E696300E90B74656D706572616E
:105050007475726500A304746869730063076175F1
:1050600074686F727300F10B616E746967726176B8
:105070006974790055046C6F7665002C0862616470
:1050800061626F6F6D00CD124D6963726F4269741A
:105090004469676974616C50696E0007184D6963F3
:1050A000726F426974416E616C6F674469676974BD
:1050B000616C50696E0052104D6963726F42697481
:1050C000546F75636850696E00920C726561645F1D
:1050D0006469676974616C00FD0D77726974655F5E
:1050E0006469676974616C00620B726561645F6119
:1050F0006E616C6F67002D0C77726974655F616E0D
:10510000616C6F670008117365745F616E616C6F2D
:10511000675F706572696F6400EE1E7365745F612E
:105120006E616C6F675F706572696F645F6D6963F4
:10513000726F7365636F6E6473007A1E6765745F68
:10514000616E616C6F675F706572696F645F6D69D6
:1051500063726F7365636F6E647300040A69735FD3
:10516000746F7563686564007906756E7573656440
:1051700000C80A617564696F5F706C617900F3063D
:10518000627574746F6E008005746F7563680020BB
:1051900002337600AF086765745F6D6F646500E683
:1051A0000A4D6963726F426974494F000204706965
:1051B0006E3000030470696E3100010470696E3254
:1051C00000010470696E3300060470696E340007D4
:1051D0000470696E3500040470696E360005047051
:1051E000696E37000A0470696E38000B0470696ECE
:1051F0003900530570696E313000520570696E31A7
:105200003100510570696E313200500570696E31A0
:105210003300570570696E313400560570696E3180
:105220003500550570696E3136005A0570696E316A
:105230003900300570696E32300049086765745F67
:1052400070756C6C00DD087365745F70756C6C0054
:10525000BA0750554C4C5F555000AD0950554C4C59
:105260005F444F574E001E074E4F5F50554C4C0049
:10527000870D4D6963726F426974496D616765009E
:105280006205496D616765004205696D616765008A
:105290002305776964746800FA066865696768744D
:1052A00000B706696E7665727400CA0466696C6C34
:1052B00000B0097365745F706978656C00A4096754
:1052C00065745F706978656C00A10A7368696674BB
:1052D0005F6C65667400BA0B73686966745F7269A7
:1052E00067687400DF0873686966745F75700048EA
:1052F0000A73686966745F646F776E00E2096D6FA8
:105300006E6F737061636500F604626C6974000F00
:1053100005484541525400CF0B48454152545F5314
:105320004D414C4C001505484150505900930353D2
:105330004144009B05534D494C4500A608434F4E40
:105340004655534544002605414E475259000B0629
:1053500041534C45455000880953555250524953CA
:10536000454400C60553494C4C590030084641425B
:10537000554C4F55530005034D4548000A03594508
:10538000530004024E4F006E07434C4F434B3132E3
:1053900000DC06434C4F434B3100DF06434C4F4388
:1053A0004B3200DE06434C4F434B3300D906434C8F
:1053B0004F434B3400D806434C4F434B3500DB067C
:1053C000434C4F434B3600DA06434C4F434B3700B8
:1053D000D506434C4F434B3800D406434C4F434B08
:1053E00039006C07434C4F434B3130006D07434C41
:1053F0004F434B313100ED074152524F575F4E0042
:10540000C8084152524F575F4E4500E6074152527D
:105410004F575F4500B5084152524F575F53450003
:10542000F0074152524F575F5300A7084152524F65
:10543000575F535700F4074152524F575F5700DAF6
:10544000084152524F575F4E5700EB0854524941A2
:105450004E474C45008F0D545249414E474C455FD5
:105460004C45465400510A4348455353424F41521C
:105470004400A1074449414D4F4E4400610D444949
:10548000414D4F4E445F534D414C4C0084065351A7
:105490005541524500840C5351554152455F534D7F
:1054A000414C4C00EB06524142424954005E0343DA
:1054B0004F5700AB0E4D555349435F43524F544332
:1054C000484554005F0C4D555349435F5155415673
:1054D0004552006C0D4D555349435F51554156455A
:1054E00052530033095049544348464F524B00E24F
:1054F00004584D41530055065041434D414E00B4B0
:1055000006544152474554004506545348495254A5
:1055100000270B524F4C4C4552534B415445003CD5
:10552000044455434B00A105484F55534500C80856
:10553000544F52544F49534500560942555454450F
:1055400052464C5900E90B535449434B4649475581
:10555000524500C20547484F535400980553574FD2
:105560005244007D0747495241464645004805538D
:105570004B554C4C00C908554D4252454C4C4100CE
:105580009705534E414B4500F10A414C4C5F415247
:10559000524F575300C00A414C4C5F434C4F434B52
:1055A00053005A0F4D6963726F4269744469737096
:1055B0006C617900910E7365745F627269676874DB
:1055C0006E657373009E107365745F646973706CAD
:1055D00061795F6D6F6465001F07646973706C614A
:1055E0007900860473686F770028067363726F6CA6
:1055F0006C00500564656C617900B806737472695B
:1056000064650085057374617274008E0477616946
:10561000740039046C6F6F7000E004636F70790080
:105620000B0463726F7000B505736C696365009855
:10563000047465787400F60B536C69636564496D96
:1056400061676500BD0F5363726F6C6C696E675361
:105650007472696E670064026F6E008A036F66661B
:1056600000610569735F6F6E00C106466163616426
:105670006500160E4D6963726F42697442757474E9
:105680006F6E00ED08627574746F6E5F6100EE08F6
:10569000627574746F6E5F6200E60A69735F7072A0
:1056A000657373656400F90B7761735F707265737E
:1056B00073656400FD0B6765745F70726573736575
:1056C00073005B154D6963726F4269744163636572
:1056D0006C65726F6D65746572001E0D6163636544
:1056E0006C65726F6D657465720034056765745F13
:1056F000780035056765745F790036056765745F06
:105700007A00F40A6765745F76616C75657300D41E
:105710000F63757272656E745F6765737475726519
:1057200000070A69735F6765737475726500D80B4B
:105730007761735F6765737475726500180C6765D0
:10574000745F676573747572657300A0027570008D
:105750003704646F776E00DE046C65667400E505DF
:10576000726967687400210766616365207570005F
:1057700036096661636520646F776E00B6086672ED
:10578000656566616C6C00310233670094023667B0
:10579000005A0238670031057368616B6500100FAD
:1057A0004D6963726F426974436F6D70617373000A
:1057B0005507636F6D70617373002D0768656164D1
:1057C000696E6700230D69735F63616C6962726162
:1057D00074656400020963616C69627261746500DA
:1057E0004911636C6561725F63616C6962726174B7
:1057F000696F6E00F4126765745F6669656C645F5B
:10580000737472656E67746800B80B4D6963726F6C
:10581000426974493243005D0369326300B7047220
:10582000656164009805777269746500B604616407
:10583000647200CB016E00740362756600F206723A
:10584000657065617400E5046672657100530373E9
:10585000646100F90373636C0004056D757369631B
:1058600000A1096672657175656E6379007B0864D5
:1058700075726174696F6E00830570697463680086
:10588000F20370696E002104706C6179009B0973EA
:1058900065745F74656D706F008F096765745F7400
:1058A000656D706F00DA0362706D004305746963A3
:1058B0006B73009F054241444459009D0742415F7C
:1058C00044494E4700FC084249525448444159005B
:1058D000C805424C554553005905434841534500BE
:1058E000FC0944414441444144554D00480B454E58
:1058F0005445525441494E455200420746554E4583
:1059000052414C00D30446554E4B00AA094A554D0E
:10591000505F444F574E00FD074A554D505F55505C
:10592000003D044E59414E006B034F444500970A19
:10593000504F5745525F444F574E000108504F5744
:1059400045525F5550003A075052454C554445006A
:10595000EB0950554E43484C494E4500B10650594D
:1059600054484F4E00C70852494E47544F4E4500C9
:10597000640957415741574157414100170757455F
:105980004444494E4700C401610067026123002C72
:105990000461233A31002E0461233A330076026118
:1059A00032007002613400BB0461343A3100B90442
:1059B00061343A33000F03613A31000C03613A322B
:1059C000000A03613A34000B03613A3500C70162F3
:1059D00000DE0462323A31009402623300930262C4
:1059E0003400D80462343A3100DB0462343A3200C5
:1059F0009202623500D90462353A31000C03623AF2
:105A000031000F03623A3200C6016300A50263232E
:105A100000700363233500BB056323353A3100B8BA
:105A2000056323353A32006E0463233A310067047C
:105A300063233A3800FC0463323A3200B502633320
:105A4000007C0463333A33007B0463333A3400B29E
:105A500002633400F90463343A3100FB0463343ADE
:105A60003300FC0463343A3400B302633500780435
:105A700063353A31007B0463353A32007A0463358A
:105A80003A33007D0463353A34000D03633A310044
:105A90000E03633A32000F03633A33000803633A9C
:105AA00034000403633A3800C1016400C202642375
:105AB00000FF056423353A32000A0464233A3200B9
:105AC0000B0464233A3300D202643300D5026434F9
:105AD000001E0464343A3100D4026435001F0464AB
:105AE000353A31001C0464353A32000A03643A3115
:105AF000000903643A32000803643A33000F036478
:105B00003A34000E03643A35000D03643A3600035C
:105B100003643A3800C0016500BA0465333A3300C3
:105B2000F4026534003F0465343A3100F50265350E
:105B3000003F0465363A33000B03653A3100080331
:105B4000653A32000903653A33000E03653A3400C2
:105B50000F03653A35000C03653A36000203653AD7
:105B60003800E00465623A3800C30166000102664D
:105B70002300350366233500FD056623353A3200E0
:105B80004B0466233A3100480466233A320042044B
:105B900066233A380011026632000803663A310083
:105BA0000B03663A32000A03663A33000D03663A85
:105BB00034000103663A3800C201670021026723FE
:105BC00000EA0467233A3100E80467233A3300FA15
:105BD0000467333A310036026734007D0467343A93
:105BE00031007E0467343A32003702673500FC0426
:105BF00067353A31000903673A31000A03673A32E0
:105C0000000B03673A33000103673A3800D701728B
:105C100000CB0472343A32001C03723A31001F0385
:105C2000723A32001E03723A3300320C4D696372CD
:105C30006F42697455415254007704756172740063
:105C40001F04696E697400F508626175647261749D
:105C50006500490462697473004206706172697478
:105C600079009D0473746F7000410470696E730055
:105C70008902747800CF027278001303616E790094
:105C8000760772656164616C6C00F9087265616425
:105C90006C696E65004B0872656164696E746F00B3
:105CA0006A034F444400DD044556454E004A0B4DFF
:105CB0006963726F42697453504900CF037370690E
:105CC0000026046D6F646500720473636C6B001DC5
:105CD000046D6F7369009D046D69736F00890E77A1
:105CE000726974655F72656164696E746F006908DA
:105CF0006E656F706978656C0069084E656F5069F4
:105D000078656C007C05636C65617200BE0672612B
:105D10006E646F6D00660B67657472616E646269B4
:105D200074730092047365656400A30972616E6404
:105D300072616E676500AF0772616E64696E7400B0
:105D40002E0663686F696365000107756E69666F8B
:105D5000726D005305617564696F00AE0A41756428
:105D6000696F4672616D6500270A72657475726E9F
:105D70005F70696E00B806736F75726365005608D0
:105D8000636F707966726F6D00A2046E616D65005D
:105D900079026F7300B705756E616D65000B0B6D51
:105DA0006963726F707974686F6E009B07737973A3
:105DB0006E616D650062086E6F64656E616D650091
:105DC000EC0772656C6561736500BF077665727379
:105DD000696F6E001A074279746573494F001E0699
:105DE00054657874494F00F7087772697461626C82
:105DF000650098076C6973746469720060076D616F
:105E00006368696E6500200473697A6500040A6935
:105E1000735F706C6179696E67006D06737065659C
:105E2000636800AE0373617900940970726F6E6FDE
:105E3000756E636500B60473696E67003106746839
:105E4000726F6174006E056D6F7574680062057322
:105E50007065656400D40564656275670043097404
:105E600072616E736C61746500D405726164696FF0
:105E7000004F06636F6E66696700BF0A73656E64E4
:105E80005F627974657300880D7265636569766514
:105E90005F627974657300B90473656E64004E07C0
:105EA00072656365697665006B1272656365697614
:105EB000655F62797465735F696E746F00020C725E
:105EC0006563656976655F66756C6C0059066C651F
:105ED0006E677468009405717565756500260763C3
:105EE00068616E6E656C00DA05706F77657200A888
:105EF00009646174615F7261746500730761646451
:105F00007265737300BA0567726F7570007B0C520F
:105F10004154455F3235304B42495400DB0A52410F
:105F200054455F314D42495400580A524154455F2F
:105F3000324D424954002D0F41726974686D657489
:105F400069634572726F7200970E41737365727464
:105F5000696F6E4572726F7200210E4174747269BE
:105F6000627574654572726F7200070D42617365E8
:105F7000457863657074696F6E009108454F4645BA
:105F800072726F7200F008456C6C6970736973000F
:105F9000F209457863657074696F6E00160D476588
:105FA0006E657261746F724578697400200B496D7B
:105FB000706F72744572726F72005C10496E646526
:105FC0006E746174696F6E4572726F7200830A49F4
:105FD0006E6465784572726F7200EA084B657945A8
:105FE00072726F7200AF114B6579626F61726449B2
:105FF0006E7465727275707400FF0B4C6F6F6B7509
:10600000704572726F7200DC0B4D656D6F72794571
:1060100072726F7200BA094E616D654572726F726D
:106020000017084E6F6E655479706500C6134E6F89
:1060300074496D706C656D656E7465644572726FE0
:106040007200A1074F534572726F7200F00B4F72CE
:1060500064657265644469637400810D4F7665728E
:10606000666C6F774572726F7200610C52756E7458
:10607000696D654572726F7200EA0D53746F7049F5
:106080007465726174696F6E00940B53796E7461FC
:10609000784572726F7200200A53797374656D458A
:1060A000786974002509547970654572726F7200C1
:1060B000220C556E69636F64654572726F7200964B
:1060C0000A56616C75654572726F7200B6115A6539
:1060D000726F4469766973696F6E4572726F720090
:1060E000C4075F5F6164645F5F002B085F5F626F7E
:1060F0006F6C5F5F00420F5F5F6275696C645F6326
:106100006C6173735F5F00A7085F5F63616C6C5FB6
:106110005F002B095F5F636C6173735F5F00C60C88
:106120005F5F636F6E7461696E735F5F00FD0B5F2D
:106130005F64656C6974656D5F5F006D095F5F65C5
:106140006E7465725F5F0071065F5F65715F5F000F
:1061500045085F5F657869745F5F00A7065F5F67EA
:10616000655F5F00400B5F5F676574617474725FA9
:106170005F00260B5F5F6765746974656D5F5F0024
:10618000B6065F5F67745F5F00F7085F5F68617303
:10619000685F5F00380A5F5F696D706F72745F5F80
:1061A000005F085F5F696E69745F5F00CF085F5FC3
:1061B000697465725F5F00CC065F5F6C655F5F004E
:1061C000E2075F5F6C656E5F5F005D065F5F6C742A
:1061D0005F5F008E085F5F6D61696E5F5F00FF0A41
:1061E0005F5F6D6F64756C655F5F00E2085F5F6E97
:1061F000616D655F5F0079075F5F6E65775F5F0068
:1062000002085F5F6E6578745F5F00C8085F5F704B
:106210006174685F5F006B0C5F5F7175616C6E61CC
:106220006D655F5F00010E5F5F7265706C5F70721D
:10623000696E745F5F0010085F5F726570725F5F08
:1062400000610C5F5F72657665727365645F5F0005
:10625000320B5F5F7365746974656D5F5F00D007B3
:106260005F5F7374725F5F0021075F5F7375625FCA
:106270005F004F0D5F5F74726163656261636B5FA6
:106280005F009503616273001B0461636F730044D8
:106290000361646400A805616C69676E0044036172
:1062A0006C6C009104616E645F006B0661707065D8
:1062B0006E6400C20461726773007C056172726172
:1062C000790050046173696E00430961736D5F74F6
:1062D00068756D62006503617372001F046174610B
:1062E0006E00CD056174616E3200E00362696E007C
:1062F000CB02626C00EB04626F6F6C00970C626FF4
:10630000756E645F6D6574686F6400F70862756927
:106310006C74696E7300DF026278007609627974CA
:1063200065617272617900220862797465636F64D5
:1063300065006109627974656F72646572005C055D
:106340006279746573004D0863616C6373697A6583
:10635000000D0863616C6C61626C65000604636526
:10636000696C00DC0363687200B40B636C61737367
:106370006D6574686F64003305636C6F73650074DA
:1063800007636C6F73757265005003636C7A003B32
:1063900003636D70009B07636F6C6C65637400C072
:1063A00005636F6E7374003308636F707973696788
:1063B0006E007A03636F7300A605636F756E7400D9
:1063C000E805637073696400E905637073696500CB
:1063D00015046461746100CE0764656661756C7450
:1063E00000020764656772656573003F0464696352
:1063F00074002D09646963745F7669657700720AB9
:10640000646966666572656E6365009C11646966A1
:10641000666572656E63655F75706461746500FAC8
:106420000364697200910764697361626C650004BA
:106430000B64697361626C655F697271000F076458
:1064400069736361726400B8066469766D6F640095
:106450000406656E61626C6500910A656E61626C2E
:10646000655F697271000A03656E64001B08656EE2
:10647000647377697468007109656E756D65726122
:106480007465009B046576616C001E046578656325
:106490000085046578697400C80365787000630638
:1064A000657874656E640093046661627300250606
:1064B00066696C74657200010466696E6400350576
:1064C000666C6F6174007D05666C6F6F7200E50429
:1064D000666D6F64002606666F726D6174001C0540
:1064E000667265787000350A66726F6D5F627974E6
:1064F000657300370866726F6D6B65797300ED091F
:1065000066726F7A656E73657400270866756E63D0
:1065100074696F6E006102676300960967656E6556
:106520007261746F7200330367657400C00767653A
:106530007461747472009D07676C6F62616C7300A4
:106540008C076861736174747200B7046861736862
:1065500000AD09686561705F6C6F636B00560B6816
:106560006561705F756E6C6F636B00700368657852
:10657000002802696400170E696D706C656D656EA8
:10658000746174696F6E007B05696E6465780012D2
:1065900006696E73657274001603696E7400280CC8
:1065A000696E74657273656374696F6E0006136952
:1065B0006E74657273656374696F6E5F7570646124
:1065C000746500EB076973616C70686100A8076906
:1065D00073646967697400F70A69736469736A6F41
:1065E000696E74009A096973656E61626C65640016
:1065F000A608697366696E697465003E056973690A
:106600006E6600B60A6973696E7374616E636500C5
:10661000FC0769736C6F776572009E0569736E6124
:106620006E005B076973737061636500B50A697317
:10663000737562636C61737300B908697373756213
:1066400073657400FC0A69737375706572736574A1
:1066500000DD076973757070657200E30569746524
:106660006D73008F04697465720047086974657200
:1066700061746F7200A7046A6F696E00F6086B623E
:10668000645F696E74720032036B65790001046B9C
:106690006579730043056C6162656C0040056C644C
:1066A000657870005F036C6472005D046C647262F4
:1066B00000E2056C647265780057046C64726800CF
:1066C00062036C656E0027046C6973740089066C44
:1066D0006974746C65003B066C6F63616C730021B8
:1066E000036C6F6700C6056C6F77657200B6036C4C
:1066F000736C00A8036C737200E5066C73747269A6
:106700007000B9036D61700035046D61746800B18B
:10671000036D61780020036D656D0007056D656D83
:1067200031360041056D656D33320018046D656DBD
:10673000380052096D656D5F616C6C6F6300CB084A
:106740006D656D5F6672656500D1086D656D5F6929
:106750006E666F00AF036D696E0025046D6F646631
:1067600000BF066D6F64756C6500EC076D6F647536
:106770006C657300F1036D6F760065046D6F767460
:106780000066046D6F76770052056D6F7677740042
:1067900089036D7273001E0A6E616D656474757095
:1067A0006C650042046E65787400B4036E6F70000F
:1067B00090066F626A65637400FD036F637400D1B5
:1067C000046F70656E0087096F70745F6C65766525
:1067D0006C001C036F726400BC047061636B001F6B
:1067E000097061636B5F696E746F001C02706900F1
:1067F0003A08706C6174666F726D002A03706F7076
:1068000000BF07706F706974656D002D03706F773E
:106810000054057072696E74001C0F7072696E749A
:106820005F657863657074696F6E00BB0470757323
:106830006800B009717374725F696E666F008707D4
:1068400072616469616E73001A0572616E6765003A
:10685000E80472626974005F10726561645F6C695C
:106860006768745F6C6576656C00630672656D6F52
:1068700076650049077265706C61636500D00472CB
:106880006570720025077265766572736500A108F0
:10689000726576657273656400D2057266696E64AE
:1068A00000E90672696E64657800E705726F756EBF
:1068B0006400A5067273706C6974003B0672737491
:1068C000726970001A047363616E00CD04736469A9
:1068D0007600230373657000270373657400D40783
:1068E00073657461747472006C0A736574646566B0
:1068F00061756C7400B10373696E000B08736C658D
:1069000065705F6D73001308736C6565705F7573F8
:1069100000BF04736F7274005E06736F72746564F7
:1069200000B70573706C6974002104737172740090
:106930009709737461636B5F75736500740A737490
:10694000617274737769746800620C73746174693E
:10695000636D6574686F64005704737465700050EC
:10696000037374720032047374726200AD05737441
:106970007265780038047374726800290573747244
:106980006970002103737562002E0373756D00C476
:1069900005737570657200CE1473796D6D657472D0
:1069A00069635F646966666572656E636500601B36
:1069B00073796D6D65747269635F6469666665722B
:1069C000656E63655F75706461746500BC0373799F
:1069D0007300FE0374616E00F20974687265736877
:1069E0006F6C6400B3057468726F77009D097469F9
:1069F000636B735F61646400B10A7469636B735F96
:106A0000646966660042087469636B735F6D730046
:106A10005A087469636B735F757300F00474696D71
:106A20006500890D74696D655F70756C73655F7560
:106A30007300D808746F5F6279746573005B0574C6
:106A400072756E6300FD057475706C65009D04744D
:106A500079706500150C75636F6C6C656374696F94
:106A60006E73008B047564697600E30475696E7457
:106A700000F605756E696F6E000409756E697175B3
:106A8000655F6964000706756E7061636B000E0BCD
:106A9000756E7061636B5F66726F6D00B4067570C2
:106AA000646174650027057570706572004707752D
:106AB00073747275637400E5057574696D65004ED5
:106AC0000576616C7565007D0676616C7565730091
:106AD0006E0C76657273696F6E5F696E666F009D8E
:106AE0000377666900E6037A697000696E76616C07
:106AF00069642070697463680028295B5D7B7D2C64
:106B00003A3B407E3C653D633C653D3E653D633EB2
:106B1000653D2A653D632A653D2B653D2D653D65D7
:106B20003E26653D7C653D2F653D632F653D2565B2
:106B30003D5E653D3D653D212E00756E69636F6468
:106B400065206E616D6520657363617065730046D5
:106B5000616C73650054727565005F5F6465627592
:106B6000675F5F00616E64006173006173736572DB
:106B70007400627265616B00636F6E74696E756537
:106B80000064656C00656C696600656C7365006522
:106B900078636570740066696E616C6C79006C6115
:106BA0006D626461006E6F740072657475726E0060
:106BB0007969656C640042434445464748494B4CFB
:106BC0003D363E3758383F3957315032592F4E30C5
:106BD0004F5A3A543B553351345235533C564D403D
:106BE00067656E657261746F722069676E6F72653A
:106BF000642047656E657261746F724578697400D0
:106C00003C67656E657261746F72206F626A65635E
:106C10007420272571272061742025703E00636150
:106C20006E27742073656E64206E6F6E2D4E6F6ECE
:106C3000652076616C756520746F2061206A7573BC
:106C4000742D737461727465642067656E6572611A
:106C5000746F7200736C6963652073746570206370
:106C6000616E6E6F74206265207A65726F006F626C
:106C70006A656374206E6F7420696E207365717528
:106C8000656E63650070617273657220636F756C09
:106C900064206E6F7420616C6C6F63617465206535
:106CA0006E6F756768206D656D6F727900756E65C2
:106CB0007870656374656420696E64656E740075D0
:106CC0006E696E64656E7420646F6573206E6F7498
:106CD000206D6174636820616E79206F75746572D0
:106CE00020696E64656E746174696F6E206C657680
:106CF000656C0063616E6E6F74206D6978206279D7
:106D000074657320616E64206E6F6E627974657352
:106D1000206C69746572616C7300030000000000F0
:106D200000000025713D00312E302E31006D696369
:106D3000726F3A6269742076312E302E312B6230B8
:106D40006266346139206F6E20323031382D313235
:106D50002D31333B204D6963726F507974686F6ECB
:106D60002076312E392E322D33342D67643634316E
:106D70003534633733206F6E20323031372D303960
:106D80002D3031006D6963726F3A626974207769E2
:106D90007468206E524635313832320053504920E3
:106DA0006E6F7420696E697469616C6973656400E3
:106DB00066756E6374696F6E20646F6573206E6FA5
:106DC000742074616B65206B6579776F72642061E4
:106DD0007267756D656E74730066756E6374696F46
:106DE0006E206D697373696E67202564207265710A
:106DF000756972656420706F736974696F6E616C18
:106E000020617267756D656E74730066756E63746C
:106E1000696F6E20657870656374656420617420A5
:106E20006D6F737420256420617267756D656E7473
:106E3000732C20676F74202564002725712720613B
:106E40007267756D656E74207265717569726564BF
:106E500000657874726120706F736974696F6E6118
:106E60006C20617267756D656E74732067697665F5
:106E70006E006578747261206B6579776F7264203B
:106E8000617267756D656E747320676976656E00F3
:106E9000696D6167652063616E6E6F742062652045
:106EA0006D6F646966696564202874727920636F08
:106EB0007079696E672066697273742900657870ED
:106EC000656374696E6720616E20696D6167650036
:106ED0006D757374207370656369667920626F7471
:106EE00068206F6666736574730073697A652063E2
:106EF000616E6E6F74206265206E6567617469767D
:106F000065006272696768746E657373206D756C75
:106F10007469706C696572206D757374206E6F741E
:106F2000206265206E6567617469766500696E64CC
:106F300065782063616E6E6F74206265206E656790
:106F4000617469766500696E64657820746F6F207E
:106F50006C6172676500756E6578706563746564F1
:106F60002063686172616374657220696E20496D87
:106F700061676520646566696E6974696F6E004952
:106F80006D6167652873292074616B6573206120CA
:106F9000737472696E6700696D61676520646174FE
:106FA0006120697320696E636F7272656374207308
:106FB000697A6500496D61676528292074616B6590
:106FC00073203020746F203320617267756D656E99
:106FD000747300496D61676528000A202020200035
:106FE000270A20202020270030313233343536372D
:106FF000383900696D61676573206D75737420623F
:1070000065207468652073616D652073697A650019
:10701000457272203336363833004572722033366B
:10702000383934005DC12028412E293D4548345966
:107030002EA0284129203D41C82028415245292021
:107040003D4141D220284152294F3D4158D228414B
:107050005229233D454834D2205E28415329233DFF
:10706000455934D328412957413D41D82841572912
:107070003D414FB5203A28414E59293D4548344EAF
:1070800049D92841295E2B233D4559B5233A28414A
:107090004C4C59293D554C49D92028414C29233D78
:1070A00055CC28414741494E293D41584745483430
:1070B000CE233A28414729453D4948CA2841295EFF
:1070C000253D45D92841295E2B3A233D41C5203A2B
:1070D0002841295E2B203D4559B420284152522990
:1070E0003D4158D228415252293D414534D2205E7B
:1070F00028415229203D414135D2284152293D4164
:107100004135D228414952293D454834D228414988
:10711000293D4559B4284159293D4559B52841557E
:10712000293D414FB4233A28414C29203D55CC23D9
:107130003A28414C5329203D554CDA28414C4B29E3
:107140003D414F34CB28414C295E3D414FCC203A44
:107150002841424C45293D4559344255CC284142AD
:107160004C45293D41584255CC284129564F3D4573
:1071700059B428414E47292B3D4559344ECA284120
:1071800054415249293D4148544141345249D9283A
:107190004129544F4D3D41C52841295454493D4151
:1071A000C52028415429203D4145D4202841295457
:1071B0003D41C82841293D41C55DC22028422920C2
:1071C0003D424959B420284245295E233D4249C8E1
:1071D000284245494E47293D4249593449484ED8ED
:1071E0002028424F544829203D424F573454C8204C
:1071F0002842555329233D42494834DA2842524512
:10720000414B293D4252455935CB284255494C29DD
:107210003D42494834CC2842293DC25DC320284321
:1072200029203D534959B420284348295E3DCB5E6F
:1072300045284348293DCB284348412952233D4B0B
:107240004548B5284348293D43C820532843492988
:10725000233D534159B428434929413D53C828434C
:1072600049294F3D53C828434929454E3D53C82815
:1072700043495459293D5349485449D92843292B56
:107280003DD328434B293DCB28434F4D4D4F444FD1
:107290005245293D4B4141344D4148444F48D22845
:1072A000434F4D293D4B4148CD2843554954293D35
:1072B0004B4948D42843524541293D4B52495945F1
:1072C000D92843293DCB5DC420284429203D444989
:1072D00059B4202844522E29203D444141344B5476
:1072E00045D2233A2844454429203D444948C42EE8
:1072F00045284429203DC4233A5E45284429203DA1
:10730000D420284445295E233D4449C82028444FC1
:1073100029203D4455D72028444F4553293D444119
:1073200048DA28444F4E4529203D44414835CE286F
:10733000444F494E47293D4455573449484ED8207B
:1073400028444F57293D4441D72328445529413DDE
:107350004A55D723284455295E233D4A41D828441D
:10736000293DC45DC520284529203D49594959B4C6
:10737000233A28452920BD273A5E28452920BD20EB
:107380003A284529203D49D92328454429203DC490
:10739000233A2845294420BD2845562945523D45D4
:1073A0004834D62845295E253D4959B428455249D7
:1073B00029233D4959345249D928455249293D4547
:1073C00048345249C8233A28455229233D45D228FA
:1073D0004552524F52293D454834524F48D22845D4
:1073E00052415345293D494852455935D3284552C4
:1073F00029233D4548D2284552293D45D2202845DC
:1074000056454E293D4959564548CE233A284529E7
:1074100057BD40284557293D55D7284557293D593F
:1074200055D72845294F3D49D9233A262845532980
:10743000203D4948DA233A2845295320BD233A28DC
:10744000454C5929203D4C49D9233A28454D454EB4
:1074500054293D4D45484ED4284546554C293D4676
:107460005548CC284545293D4959B4284541524EF7
:10747000293D455235CE2028454152295E3D455291
:10748000B528454144293D4548C4233A284541296A
:10749000203D495941D82845412953553D4548B5D6
:1074A000284541293D4959B52845494748293D4581
:1074B00059B4284549293D4959B4202845594529F9
:1074C0003D4159B4284559293D49D9284555293DBB
:1074D000595557B528455155414C293D4959344BCB
:1074E0005755CC2845293D45C85DC620284629204A
:1074F0003D454834C62846554C293D465548CC287C
:10750000465249454E44293D46524548354EC428C9
:10751000464154484552293D46414134444845D2AC
:1075200028462946BD2846293DC65DC7202847294B
:10753000203D4A4959B428474956293D47494835CD
:10754000D620284729495E3DC728474529543D474D
:107550004548B553552847474553293D474A45486F
:1075600034D3284747293DC72042232847293DC710
:107570002847292B3DCA284752454154293D4752A7
:10758000455934D428474F4E29453D47414F35CEC4
:107590002328474829BD2028474E293DCE28472982
:1075A0003DC75DC820284829203D45593443C8209F
:1075B00028484156293D2F48414536D62028484580
:1075C0005245293D2F484959D22028484F55522924
:1075D0003D41573545D228484F57293D2F4841D77F
:1075E000284829233D2FC8284829BD5DC92028499E
:1075F0004E293D4948CE20284929203D4159B428EB
:107600004929203D41D928494E29443D415935CE8B
:1076100053454D2849293D49D920414E54284929EF
:107620003D41D928494552293D495945D2233A522D
:107630002849454429203D4959C428494544292021
:107640003D415935C42849454E293D49594548CE03
:1076500028494529543D41593445C8284927293DE1
:107660004159B5203A2849295E253D4159B5203A6E
:1076700028494529203D4159B4284929253D49D962
:10768000284945293D4959B4202849444541293DC7
:1076900041594449593541C82849295E2B3A233D6F
:1076A00049C828495229233D4159D228495A2925F8
:1076B0003D4159DA28495329253D4159DA495E2887
:1076C00049295E233D49C82B5E2849295E2B3D414F
:1076D000D9233A5E2849295E2B3D49C82849295EAD
:1076E0002B3D41D9284952293D45D22849474829AF
:1076F0003D4159B428494C44293D4159354CC42099
:107700002849474E293D494847CE2849474E292018
:107710003D415934CE2849474E295E3D415934CE2A
:107720002849474E29253D415934CE284943524FD7
:10773000293D4159344B524FC82849515545293D9F
:10774000495934CB2849293D49C85DCA20284A29CE
:10775000203D4A4559B4284A293DCA5DCB20284BD3
:1077600029203D4B4559B420284B294EBD284B2993
:107770003DCB5DCC20284C29203D454834CC284CBD
:107780004F2943233D4C4FD74C284C29BD233A5E0B
:10779000284C29253D55CC284C454144293D4C4990
:1077A00059C420284C41554748293D4C414534C6D1
:1077B000284C293DCC5DCD20284D29203D4548341D
:1077C000CD20284D522E29203D4D49483453544553
:1077D000D220284D532E293D4D494835DA20284DD9
:1077E00052532E29203D4D494834534958DA284DEB
:1077F0004F56293D4D555734D6284D414348494EA3
:10780000293D4D41485348495935CE4D284D29BD54
:10781000284D293DCD5DCE20284E29203D454834B8
:10782000CE45284E47292B3D4ECA284E4729523D6A
:107830004E58C7284E4729233D4E58C7284E474C1F
:1078400029253D4E584755CC284E47293D4ED8282E
:107850004E4B293D4E58CB20284E4F5729203D4EA8
:107860004157B44E284E29BD284E4F4E29453D4E16
:10787000414834CE284E293DCE5DCF20284F2920C7
:107880003D4F4834D7284F4629203D4148D620282F
:107890004F4829203D4F57B5284F524F554748294B
:1078A0003D4552344FD7233A284F5229203D45D2E7
:1078B000233A284F525329203D4552DA284F522966
:1078C0003D414FD220284F4E45293D574148CE23B8
:1078D000284F4E4529203D574148CE284F57293D36
:1078E0004FD720284F564552293D4F57355645D240
:1078F0005052284F29563D5557B4284F56293D41DF
:107900004834D6284F295E253D4F57B5284F295E6C
:10791000454E3D4FD7284F295E49233D4F57B52847
:107920004F4C29443D4F5734CC284F554748542994
:107930003D414F35D4284F554748293D414835C62C
:1079400020284F55293D41D748284F552953233DDD
:107950004157B4284F5553293D4158D3284F5552CC
:10796000293D4F48D2284F554C44293D554835C4F0
:10797000284F55295E4C3D4148B5284F5550293D6B
:10798000555735D0284F55293D41D7284F59293DC6
:107990004FD9284F494E47293D4F573449484ED873
:1079A000284F49293D4F59B5284F4F52293D4F483F
:1079B00035D2284F4F4B293D554835CB46284F4FA0
:1079C00044293D555735C44C284F4F44293D414823
:1079D00035C44D284F4F44293D555735C4284F4F86
:1079E00044293D554835C446284F4F54293D5548F4
:1079F00035D4284F4F293D5557B5284F27293D4F9E
:107A0000C8284F29453D4FD7284F29203D4FD7281B
:107A10004F41293D4F57B420284F4E4C59293D4FD7
:107A200057344E4C49D920284F4E4345293D5741A4
:107A300048344ED3284F4E2754293D4F57344ED407
:107A400043284F294E3D41C1284F294E473D41CF44
:107A5000203A5E284F294E3D41C849284F4E293DC6
:107A600055CE233A284F4E293D55CE235E284F4E02
:107A7000293D55CE284F2953543D4FD7284F4629ED
:107A80005E3D414F34C6284F54484552293D414838
:107A900035444845D252284F29423D5241C15E5299
:107AA000284F293A233D4F57B5284F535329203D9E
:107AB000414F35D3233A5E284F4D293D4148CD28CB
:107AC0004F293D41C15DD020285029203D504959C2
:107AD000B4285048293DC62850454F504C293D50A8
:107AE0004959355055CC28504F57293D504157B42E
:107AF0002850555429203D505548D428502950BD70
:107B000028502953BD2850294EBD2850524F462E8B
:107B1000293D50524F48464548345345D2285029B4
:107B20003DD05DD120285129203D4B595557B428CF
:107B300051554152293D4B574F4835D2285155296F
:107B40003D4BD72851293DCB5DD220285229203DDD
:107B5000414135D220285245295E233D5249D9283A
:107B6000522952BD2852293DD25DD32028532920C5
:107B70003D454834D3285348293D53C82328534909
:107B80004F4E293D5A4855CE28534F4D45293D5318
:107B90004148CD232853555229233D5A4845D228E0
:107BA00053555229233D534845D223285355292361
:107BB0003D5A4855D7232853535529233D534855FB
:107BC000D72328534544293D5AC423285329233D0C
:107BD000DA2853414944293D534548C45E28534956
:107BE0004F4E293D534855CE28532953BD2E285377
:107BF00029203DDA233A2E45285329203DDA233A1D
:107C00005E23285329203DD355285329203DD320D6
:107C10003A23285329203DDA2323285329203DDA0B
:107C20002028534348293D53CB285329432BBD23B8
:107C300028534D293D5A55CD2328534E29273D5AC7
:107C400055CD2853544C45293D5355CC2853293DF7
:107C5000D35DD420285429203D544959B4202854B8
:107C600048452920233D444849D9202854484529DE
:107C7000203D444841D828544F29203D5455D82010
:107C80002854484154293D44484145D4202854486B
:107C9000495329203D44484948D320285448455950
:107CA000293D444845D920285448455245293D445A
:107CB000484548D22854484552293D444845D22891
:107CC0005448454952293D44484548D22028544803
:107CD000414E29203D44484145CE20285448454D39
:107CE00029203D44484145CE285448455345292044
:107CF0003D44484959DA20285448454E293D4448D6
:107D00004548CE285448524F554748293D5448527B
:107D10005557B42854484F5345293D44484F48DAF5
:107D20002854484F55474829203D44484FD72854A8
:107D30004F444159293D5455584445D928544F4D35
:107D40004F2952524F573D54554D4141B528544F3C
:107D50002954414C3D544F57B52028544855532978
:107D60003D4448414834D3285448293D54C8233A17
:107D700028544544293D544958C45328544929237B
:107D80004E3D43C8285449294F3D53C828544929DA
:107D9000413D53C8285449454E293D534855CE28A6
:107DA00054555229233D434845D228545529413D35
:107DB000434855D7202854574F293D5455D7262896
:107DC0005429454E20BD2854293DD45DD520285541
:107DD00029203D595557B42028554E29493D59551C
:107DE00057CE2028554E293D4148CE202855504F8A
:107DF0004E293D415850414FCE4028555229233DF0
:107E0000554834D228555229233D59554834D22853
:107E10005552293D45D22855295E203D41C8285557
:107E2000295E5E3D4148B5285559293D4159B52047
:107E30004728552923BD4728552925BD47285529B9
:107E4000233DD7234E2855293D5955D7402855293C
:107E50003D55D72855293D5955D75DD62028562957
:107E6000203D564959B42856494557293D5659553C
:107E700057B52856293DD65DD720285729203D449F
:107E800041483442554C5955D72028574552452929
:107E90003D5745D22857412953483D5741C128579E
:107EA000412953543D5745D928574129533D5741FE
:107EB000C828574129543D5741C128574845524584
:107EC000293D57484548D22857484154293D5748ED
:107ED0004148D42857484F4C293D2F484F57CC286C
:107EE00057484F293D2F4855D7285748293D57C84F
:107EF0002857415229233D574548D22857415229F6
:107F00003D57414FD228574F52295E3D5745D22801
:107F10005752293DD228574F4D29413D575548CDFD
:107F200028574F4D29453D574948CD2857454129A8
:107F3000523D5745C82857414E54293D5741413578
:107F40004ED4414E5328574552293D45D2285729F2
:107F50003DD75DD820285829203D4548344BD220B4
:107F60002858293DDA2858293D4BD35DD920285976
:107F700029203D574159B428594F554E47293D595D
:107F800041484ED82028594F5552293D594F48D283
:107F90002028594F55293D5955D72028594553294F
:107FA0003D594548D3202859293DD9462859293DCE
:107FB00041D9505328594348293D4159CB233A5E72
:107FC0002859293D49D9233A5E285929493D49D99B
:107FD000203A285929203D41D9203A285929233DC2
:107FE00041D9203A2859295E2B3A233D49C8203AE5
:107FF0002859295E233D41D92859293D49C85DDAD0
:1080000020285A29203D5A4959B4285A293DDAEAEC
:10801000284129BD2821293DAE282229203D2D4176
:1080200048354E4B574F5754AD2822293D4B574F9B
:10803000573454AD2823293D204E4148344D424504
:10804000D22824293D20444141344C45D2282529B9
:108050003D20504552534548344ED42826293D20D2
:1080600041454EC4282729BD282A293D20414534B1
:1080700053544552494853CB282B293D20504C415D
:108080004834D3282C293DAC20282D29203DAD286B
:108090002D29BD282E293D20504F594ED4282F2957
:1080A0003D20534C41453453C82830293D205A497E
:1080B0005934524FD72028315354293D4645523424
:1080C00053D4202831305448293D544548344E5427
:1080D000C82831293D2057414834CE2028324E440B
:1080E000293D534548344B554EC42832293D205430
:1080F0005557B42028335244293D5448455234C47E
:108100002833293D205448524959B42834293D2068
:10811000464F4834D22028355448293D46494834F2
:108120004654C82835293D2046415934D6202836A2
:108130003429203D534948344B5354495920464F24
:1081400048D22836293D20534948344BD328372973
:108150003D20534548345655CE2028385448293DB3
:1081600045593454C82838293D20455934D4283934
:10817000293D204E415934CE283A293DAE283B298D
:108180003DAE283C293D204C4548345320444841CD
:1081900045CE283D293D204959344B57554CDA28C6
:1081A0003E293D20475245593454455220444841C8
:1081B00045CE283F293DBF2840293D20414536D4A2
:1081C000285E293D204B414534524958D45DC100B9
:1081D000000000000000000000000000000000009F
:1081E000000000000000000000000000000000008F
:1081F00002020202020282000002020202020203E2
:108200000303030303030303030202020202020245
:10821000C0A8B0ACC0A0B8A0C0BCA0ACA8ACC0A066
:10822000A0ACB4A4C0A8A8B0C0BC0000000200204C
:10823000209B20C0B920CDA34C8A8E0095F7A2398F
:10824000C5067EC726374E91F155A1FE24452DA7C0
:1082500036532E47DA7D7E7E7F80818282828484BF
:108260008484848587878888898A8B8B8C8C8C6CA6
:108270006F63616C207661726961626C6520726502
:10828000666572656E636564206265666F726520FF
:1082900061737369676E6D656E74006279746520D1
:1082A000636F6465206E6F7420696D706C656D65B9
:1082B0006E746564004E6F20616374697665206535
:1082C0007863657074696F6E20746F207265726177
:1082D00069736500706F702066726F6D20656D70D8
:1082E0007479206C697374006261642074797065BC
:1082F000636F64650062756666657220746F6F20D7
:10830000736D616C6C00747275650066616C736589
:1083100000286E756C6C2900202020202020202051
:1083200020202020202020200030303030303030FD
:108330003030303030303030300004004D696372FE
:108340006F507974686F6E2076312E392E322D334E
:10835000342D67643634313534633733206F6E2003
:10836000323031372D30392D30313B206D69637219
:108370006F3A6269742076312E302E31207769741D
:1083800068206E524635313832320D0A0054797009
:1083900065202268656C7028292220666F72206D26
:1083A0006F726520696E666F726D6174696F6E2E93
:1083B0000D0A003E3E3E20000D0A70617374652078
:1083C0006D6F64653B204374726C2D4320746F2085
:1083D00063616E63656C2C204374726C2D44207451
:1083E0006F2066696E6973680D0A3D3D3D20002E61
:1083F0002E2E2000726177205245504C3B20435472
:10840000524C2D4220746F20657869740D0A006902
:108410006E76616C6964206765737475726500734C
:10842000747265616D206F7065726174696F6E2022
:108430006E6F7420737570706F72746564006F7501
:1084400074206F66206D656D6F7279000000040204
:1084500002040200000204040400020200040403F7
:1084600001000001030303000101020303040201F0
:1084700001030104030100030000040101020000E4
:1084800003021B1B000E110000000000080808007A
:10849000080A4A4000000A5FEA5FEA0ED92ED36E4E
:1084A00019324489330C924C924D080800000004A4
:1084B000880808040804848488000A448A40000468
:1084C0008EC480000000048800000EC00000000080
:1084D000080001224488100C9252524C048C84846F
:1084E0008E1C824C901E1EC244924C06CA525FE201
:1084F0001FF01EC13E02448ED12E1FE24488100E92
:10850000D12ED12E0ED12EC4880008000800000400
:108510008004880244880482000EC00EC0080482D1
:1085200044880ED126C0040ED135B36C0C925ED2B5
:10853000521C925C925C0ED010100E1C9252525C37
:108540001ED01C901E1ED01C90100ED013712E1227
:10855000525ED2521C8808081C1FE242524C125430
:10856000981492101010101E113B75B1311139354D
:10857000B3710C9252524C1C925C90100C92524C63
:10858000861C925C92510ED00C825C1FE484848421
:10859000125252524C1131312A44113135BB7112F1
:1085A000524C9252112A4484841EC488101E0EC854
:1085B00008080E10080482410EC242424E048A404E
:1085C0000000000000001F0804800000000ED252CE
:1085D0004F10101C925C000ED0100E02424ED24E74
:1085E0000C925C900E06C81C88080ED24EC24C102D
:1085F000101C92520800080808024002424C101455
:108600009814920808080806001B75B131001C92E6
:108610005252000C92524C001C925C90000ED24EB2
:10862000C2000ED010100006C8049808080EC80733
:10863000001252524F0011312A4400113135BB0053
:10864000124C8C9200112A4498001EC4881E06C445
:108650008C8486080808080818080C881800000C84
:108660008360302C3235352C302C3235352C300AA5
:10867000302C3235352C302C3235352C300A302C1C
:10868000302C302C302C300A3235352C302C302C1C
:10869000302C3235350A302C3235352C3235352CEC
:1086A0003235352C300A0054494C5420544F204662
:1086B000494C4C2053435245454E2000636F6D702A
:1086C00061737343616C0000000100020003000449
:1086D0000000010101020103010401000201020284
:1086E0000203020402000301030203030304030064
:1086F0000401040204030404044E6F2061766169DE
:108700006C61626C6520493243004F6E6C79203891
:10871000626974732053504920737570706F72745E
:1087200065640053504920666F726D6174206572F4
:10873000726F72004E6F20617661696C61626C6568
:10874000205350490070696E6D6170206E6F742007
:10875000666F756E6420666F7220706572697068EE
:108760006572616C00232D302B2000686C4C006515
:10877000666745464700303132333435363738394D
:108780004142434445460030313233343536373880
:108790003961626364656600000000006C79FC7FEB
:1087A0000100000000000000720A0300773003009F
:1087B000494A0200494A0200494A0200E80300000F
:1087C000F0BE0200000000000000000000000000F9
:1087D0000000000000000000000000000000010098
:1087E0000000000000000000000000000000000089
:1087F00000000000000000003CD702000000000064
:108800000000000000000000C4E5020087840300AF
:10881000700000200000000054F6020074F6020010
:1088200034F602000000000000000000000000001C
:108830000000000000000000000000000000000038
:108840000000000000000000000000000000000028
:108850000000000000000000000000000000000018
:108860000000000000000000000000000000000008
:1088700000000000204EFFFF000000000101010188
:10888000010101010101050505050505050501FFBA
:1088900000000401E90000004D310000DD4C000043
:1088A000FD97000005610100DD6201002D630100FC
:0888B00095880100C1000000E1
:020000041000EA
:1010C0007CB0EE17FFFFFFFF0A0000000000E30006
:0C10D000FFFFFFFF2D6D0300000000007B
:0400000500018E2147
:00000001FF
"""
if __name__ == '__main__': # pragma: no cover
main(sys.argv[1:])
|
stestagg/mu
|
mu/contrib/uflash.py
|
Python
|
gpl-3.0
| 653,754
|
[
"VisIt"
] |
a700120c335dd464f087510372c38ce8bf67d6a4e5344a020c2cf04ec9ec10da
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pysam
import argparse
from time import clock
from collections import Counter
from sets import Set
parser = \
argparse.ArgumentParser(description='Extract reads with one end mapping to hg19 reference and other end mapping to viral genome'
)
parser.add_argument(
'--unknown',
dest='unknownName',
help='Namesorted unknown BAM file containing reads that were partially unalignable',
metavar='FILE',
action='store',
type=str,
nargs=1,
)
parser.add_argument(
'--trans',
dest='transName',
help='Output BAM file of trans reads between hg19 and viral',
metavar='FILE',
action='store',
type=str,
nargs=1,
)
parser.add_argument(
'--data',
dest='dataName',
help='Input BAM file',
metavar='FILE',
action='store',
type=str,
nargs=1,
)
parser.add_argument(
'--viral',
dest='viralName',
help='Output BAM file of viral reads',
metavar='FILE',
action='store',
type=str,
nargs=1,
)
parser.add_argument(
'--misc',
dest='miscName',
help='Output BAM file of misc. double unmapped reads',
metavar='FILE',
action='store',
default = None,
type=str,
nargs=1,
)
parser.add_argument(
'--output',
dest='outputName',
help='Output BAM file of augmented trans reads between reference organism and viral sequences',
metavar='FILE',
action='store',
type=str,
nargs=1,
)
parser.add_argument(
'--chrom_list',
dest='chrom_list',
help='Optional file that contains list of chromosomes from reference organism. All other sequences in the BAM file that are not in this list would be considered viral. The file contains a single line with the space-delimited list of chromosomes belonging to the reference organism. By default, all chromosomes starting with chr are considered human.',
metavar='FILE',
action='store',
type=str,
default = None,
nargs=1,
)
opts = parser.parse_args()
bamFile = pysam.Samfile(opts.dataName[0], 'rb')
transFile = pysam.Samfile(opts.transName[0], 'wb', template=bamFile)
viralFile = pysam.Samfile(opts.viralName[0], 'wb', template=bamFile)
unknownFile = pysam.Samfile(opts.unknownName[0], 'wb', template=bamFile)
chrom_list = {}
foo = [chrom_list.setdefault('human' if ref.find('chr') == 0 else 'viral',Set()).add(ref) for ref in bamFile.references]
if opts.chrom_list is not None:
chrom_list = {}
input = open(opts.chrom_list[0], 'r')
[chrom_list.setdefault('human',Set()).add(l) for l in input.next().strip().split()]
#[chrom_list.setdefault('viral',Set()).add(l) for l in input.next().strip().split(' ')]
miscFile = None
if (opts.miscName is not None):
miscFile = pysam.Samfile(opts.miscName[0], 'wb', template=bamFile)
qname = ''
q1ref = Set([])
q2ref = Set([])
q1aligns = []
q2aligns = []
#hg19refs = Set(map(lambda x: 'chr' + str(x), range(1, 23) + ['X', 'Y',
# 'M']))
transReads = 0
totalReads = 0
viralReads = 0
unknownReads = 0
oldalign = ''
totalaligns = 0
for a in bamFile:
totalaligns += 1
if a.qname != qname and qname != '':
if len([b for b in q1aligns if not b.is_secondary and not b.is_supplementary]) != 1 \
or len([b for b in q2aligns if not b.is_secondary and not b.is_supplementary]) != 1:
print 'No primary alignment', a.qname
print [(b, str(b)) for b in q1aligns if not b.is_secondary]
print [(b, str(b)) for b in q2aligns if not b.is_secondary]
exit()
trans = False
viral = False
unknown = False
totalReads += 1
if totalReads % 100000 == 0:
print clock(), totalReads, 'reads done: #(Trans reads) =', \
transReads, viralReads, a.qname, qname
len_q1ref = len(chrom_list['human'].intersection(q1ref))
len_q2ref = len(chrom_list['human'].intersection(q2ref))
if len_q1ref > 0 \
and len_q2ref == 0 and len(q2ref) \
> 0:
trans = True
if len_q2ref > 0 \
and len_q1ref == 0 and len(q1ref) \
> 0:
trans = True
if len_q2ref == 0 \
and len_q1ref == 0 and (len(q1ref)
> 0 or len(q2ref) > 0):
viral = True
if trans == True:
transReads += 1
if len([b for b in q1aligns if bamFile.getrname(b.tid)
in chrom_list['human']]) <= 3 or len([b for b in q2aligns
if bamFile.getrname(b.tid) in chrom_list['human']]) <= 3:
for b in q1aligns + q2aligns:
transFile.write(b)
if viral == True:
viralReads += 1
for b in q1aligns + q2aligns:
viralFile.write(b)
if viral == False and trans == False:
#At least one read maps to human and at least one read is unmapped
if (len([read for read in q1aligns if not read.is_unmapped and bamFile.references[read.tid] in chrom_list['human']])+len([read for read in q2aligns if not read.is_unmapped and bamFile.references[read.tid] in chrom_list['human']])) > 0 and (len([read for read in q2aligns if read.is_unmapped]) + len([read for read in q1aligns if read.is_unmapped])) > 0:
unknownReads += 1
for b in q1aligns + q2aligns:
seq = Counter(q1aligns[0].seq + q2aligns[0].seq)
if 'N' in seq and seq['N'] >= 5:
continue
unknownFile.write(b)
if (miscFile is not None and len([read for read in q2aligns if read.is_unmapped]) + len([read for read in q1aligns if read.is_unmapped])) >= 2:
for b in q1aligns + q2aligns:
seq = Counter(q1aligns[0].seq + q2aligns[0].seq)
if 'N' in seq and seq['N'] >= 5:
continue
miscFile.write(b)
if a.qname != qname:
# print qname, hg19refs, q1ref, q2ref, hg19refs.intersection(q1ref), hg19refs.intersection(q2ref)
qname = a.qname
q1aligns = []
q2aligns = []
q1ref = Set([])
q2ref = Set([])
if a.is_read1:
q1aligns.append(a)
if not a.is_unmapped and not a.mate_is_unmapped and a.tid != -1:
q1ref.add(bamFile.getrname(a.tid))
else:
q2aligns.append(a)
if not a.is_unmapped and not a.mate_is_unmapped and a.tid != -1:
q2ref.add(bamFile.getrname(a.tid))
oldalign = a
trans = False
viral = False
totalReads += 1
len_q1ref = len(chrom_list['human'].intersection(q1ref))
len_q2ref = len(chrom_list['human'].intersection(q2ref))
if len_q1ref > 0 \
and len_q2ref == 0 and len(q2ref) \
> 0:
trans = True
if len_q2ref > 0 \
and len_q1ref == 0 and len(q1ref) \
> 0:
trans = True
if len_q2ref == 0 \
and len_q1ref == 0 and (len(q1ref)
> 0 or len(q2ref) > 0):
viral = True
if trans == True:
transReads += 1
if len([b for b in q1aligns if bamFile.getrname(b.tid)
in chrom_list['human']]) <= 3 or len([b for b in q2aligns
if bamFile.getrname(b.tid) in chrom_list['human']]) <= 3:
for b in q1aligns + q2aligns:
transFile.write(b)
if viral == True:
viralReads += 1
for b in q1aligns + q2aligns:
viralFile.write(b)
if viral == False and trans == False:
#At least one read maps to human and at least one read is unmapped
if (len([read for read in q1aligns if not read.is_unmapped and bamFile.references[read.tid] in chrom_list['human']])+len([read for read in q2aligns if not read.is_unmapped and bamFile.references[read.tid] in chrom_list['human']])) > 0 and (len([read for read in q2aligns if read.is_unmapped]) + len([read for read in q1aligns if read.is_unmapped])) > 0:
unknownReads += 1
for b in q1aligns + q2aligns:
seq = Counter(q1aligns[0].seq + q2aligns[0].seq)
if 'N' in seq and seq['N'] >= 5:
continue
unknownFile.write(b)
if miscFile is not None and (len([read for read in q2aligns if read.is_unmapped]) + len([read for read in q1aligns if read.is_unmapped])) == 0:
for b in q1aligns + q2aligns:
seq = Counter(q1aligns[0].seq + q2aligns[0].seq)
if 'N' in seq and seq['N'] >= 5:
continue
miscFile.write(b)
transFile.close()
bamFile.close()
viralFile.close()
unknownFile.close()
if miscFile is not None:
miscFile.close()
print totalReads, transReads, viralReads
|
namphuon/ViFi
|
scripts/get_trans_new.py
|
Python
|
gpl-3.0
| 7,981
|
[
"pysam"
] |
4658d3a55b065a004a03d6e9f0dafb2fb0dd95eb0c51106a03dfa27c68872342
|
from math import sqrt
import numpy as np
from scipy import stats
from matplotlib import pyplot
#(0) Set parameters:
np.random.seed(0)
nResponsesA = 5
nResponsesB = 5
nIterations = 5000
### derived parameters:
nA,nB = nResponsesA, nResponsesB
df = nA + nB - 2
#(1) Generate Gaussian data and compute test statistic:
T = []
for i in range(nIterations):
yA,yB = np.random.randn(nResponsesA), np.random.randn(nResponsesB)
mA,mB = yA.mean(), yB.mean()
sA,sB = yA.std(ddof=1), yB.std(ddof=1)
s = sqrt( ((nA-1)*sA*sA + (nB-1)*sB*sB) / df )
t = (mA-mB) / ( s *sqrt(1.0/nA + 1.0/nB))
T.append(t)
T = np.asarray(T)
#(2) Survival functions:
heights = np.linspace(1, 4, 21)
sf = np.array( [ (T>h).mean() for h in heights] )
sfE = stats.t.sf(heights, df) #theoretical
sfN = stats.norm.sf(heights) #standard normal (for comparison)
#(3) Plot results:
pyplot.close('all')
ax = pyplot.axes()
ax.plot(heights, sf, 'o', label='Simulated')
ax.plot(heights, sfE, '-', label='Theoretical')
ax.plot(heights, sfN, 'r-', label='Standard normal')
ax.set_xlabel('$u$', size=20)
ax.set_ylabel('$P (t > u)$', size=20)
ax.legend()
ax.set_title('Two-sample t validation (0D)', size=20)
pyplot.show()
|
0todd0000/spm1d
|
spm1d/rft1d/examples/val_max_2_twosample_t_0d.py
|
Python
|
gpl-3.0
| 1,327
|
[
"Gaussian"
] |
f33de9a8787c5d5de9cf17f786d68c9d3e12804dee946c3e2336430154cc2183
|
# -*- coding: utf-8 -*-
"""
This class controls all the GUI for the player
menu screen.
"""
import sys
import pygame as pg
from . import setup, observer
from . import constants as c
from . import tools
#Python 2/3 compatibility.
if sys.version_info[0] == 2:
range = xrange
class SmallArrow(pg.sprite.Sprite):
"""
Small arrow for menu.
"""
def __init__(self, info_box):
super(SmallArrow, self).__init__()
self.image = setup.GFX['smallarrow']
self.rect = self.image.get_rect()
self.state = 'selectmenu'
self.state_dict = self.make_state_dict()
self.slots = info_box.slots
self.pos_list = []
def make_state_dict(self):
"""
Make state dictionary.
"""
state_dict = {'selectmenu': self.navigate_select_menu,
'itemsubmenu': self.navigate_item_submenu,
'magicsubmenu': self.navigate_magic_submenu}
return state_dict
def navigate_select_menu(self, pos_index):
"""
Nav the select menu.
"""
self.pos_list = self.make_select_menu_pos_list()
self.rect.topleft = self.pos_list[pos_index]
def navigate_item_submenu(self, pos_index):
"""Nav the item submenu"""
self.pos_list = self.make_item_menu_pos_list()
self.rect.topleft = self.pos_list[pos_index]
def navigate_magic_submenu(self, pos_index):
"""
Nav the magic submenu.
"""
self.pos_list = self.make_magic_menu_pos_list()
self.rect.topleft = self.pos_list[pos_index]
def make_magic_menu_pos_list(self):
"""
Make the list of possible arrow positions for magic submenu.
"""
pos_list = [(310, 119),
(310, 169)]
return pos_list
def make_select_menu_pos_list(self):
"""
Make the list of possible arrow positions.
"""
pos_list = []
for i in range(3):
pos = (35, 443 + (i * 45))
pos_list.append(pos)
return pos_list
def make_item_menu_pos_list(self):
"""
Make the list of arrow positions in the item submenu.
"""
pos_list = [(300, 173),
(300, 223),
(300, 323),
(300, 373),
(300, 478),
(300, 528),
(535, 478),
(535, 528)]
return pos_list
def update(self, pos_index):
"""
Update arrow position.
"""
state_function = self.state_dict[self.state]
state_function(pos_index)
def draw(self, surface):
"""
Draw to surface"""
surface.blit(self.image, self.rect)
class QuickStats(pg.sprite.Sprite):
def __init__(self, game_data):
self.inventory = game_data['player inventory']
self.game_data = game_data
self.health = game_data['player stats']['health']
self.stats = self.game_data['player stats']
self.font = pg.font.Font(setup.FONTS[c.MAIN_FONT], 22)
self.small_font = pg.font.Font(setup.FONTS[c.MAIN_FONT], 18)
self.image, self.rect = self.make_image()
def make_image(self):
"""
Make the surface for the gold box.
"""
stat_list = ['GOLD', 'health', 'magic']
magic_health_list = ['health', 'magic']
image = setup.GFX['goldbox']
rect = image.get_rect(left=10, top=244)
surface = pg.Surface(rect.size)
surface.set_colorkey(c.BLACK)
surface.blit(image, (0, 0))
for i, stat in enumerate(stat_list):
first_letter = stat[0].upper()
rest_of_letters = stat[1:]
if stat in magic_health_list:
current = self.stats[stat]['current']
max = self.stats[stat]['maximum']
text = "{}{}: {}/{}".format(first_letter, rest_of_letters, current, max)
elif stat == 'GOLD':
text = "Gold: {}".format(self.inventory[stat]['quantity'])
render = self.small_font.render(text, True, c.NEAR_BLACK)
x = 26
y = 45 + (i*30)
text_rect = render.get_rect(x=x,
centery=y)
surface.blit(render, text_rect)
if self.game_data['crown quest']:
crown = setup.GFX['crown']
crown_rect = crown.get_rect(x=178, y=40)
surface.blit(crown, crown_rect)
return surface, rect
def update(self):
"""
Update gold.
"""
self.image, self.rect = self.make_image()
def draw(self, surface):
"""
Draw to surface.
"""
surface.blit(self.image, self.rect)
class InfoBox(pg.sprite.Sprite):
def __init__(self, inventory, player_stats):
super(InfoBox, self).__init__()
self.inventory = inventory
self.player_stats = player_stats
self.attack_power = self.get_attack_power()
self.defense_power = self.get_defense_power()
self.font = pg.font.Font(setup.FONTS[c.MAIN_FONT], 22)
self.big_font = pg.font.Font(setup.FONTS[c.MAIN_FONT], 24)
self.title_font = pg.font.Font(setup.FONTS[c.MAIN_FONT], 28)
self.title_font.set_underline(True)
self.get_tile = tools.get_tile
self.sword = self.get_tile(48, 0, setup.GFX['shopsigns'], 16, 16, 2)
self.shield = self.get_tile(32, 0, setup.GFX['shopsigns'], 16, 16, 2)
self.potion = self.get_tile(16, 0, setup.GFX['shopsigns'], 16, 16, 2)
self.possible_potions = ['Healing Potion', 'ELIXIR', 'Ether Potion']
self.possible_armor = ['Wooden Shield', 'Chain Mail']
self.possible_weapons = ['Long Sword', 'Rapier']
self.possible_magic = ['Fire Blast', 'Cure']
self.quantity_items = ['Healing Potion', 'ELIXIR', 'Ether Potion']
self.slots = {}
self.state = 'invisible'
self.state_dict = self.make_state_dict()
self.print_slots = True
def get_attack_power(self):
"""
Calculate the current attack power based on equipped weapons.
"""
weapon = self.inventory['equipped weapon']
return self.inventory[weapon]['power']
def get_defense_power(self):
"""
Calculate the current defense power based on equipped weapons.
"""
defense_power = 0
for armor in self.inventory['equipped armor']:
defense_power += self.inventory[armor]['power']
return defense_power
def make_state_dict(self):
"""Make the dictionary of state methods"""
state_dict = {'stats': self.show_player_stats,
'items': self.show_items,
'magic': self.show_magic,
'invisible': self.show_nothing}
return state_dict
def show_player_stats(self):
"""Show the player's main stats"""
title = 'STATS'
stat_list = ['Level', 'experience to next level',
'health', 'magic', 'Attack Power',
'Defense Power', 'gold']
attack_power = 5
surface, rect = self.make_blank_info_box(title)
for i, stat in enumerate(stat_list):
if stat == 'health' or stat == 'magic':
text = "{}{}: {} / {}".format(stat[0].upper(),
stat[1:],
str(self.player_stats[stat]['current']),
str(self.player_stats[stat]['maximum']))
elif stat == 'experience to next level':
text = "{}{}: {}".format(stat[0].upper(),
stat[1:],
self.player_stats[stat])
elif stat == 'Attack Power':
text = "{}: {}".format(stat, self.get_attack_power())
elif stat == 'Defense Power':
text = "{}: {}".format(stat, self.get_defense_power())
elif stat == 'gold':
text = "Gold: {}".format(self.inventory['GOLD']['quantity'])
else:
text = "{}: {}".format(stat, str(self.player_stats[stat]))
text_image = self.font.render(text, True, c.NEAR_BLACK)
text_rect = text_image.get_rect(x=50, y=80+(i*50))
surface.blit(text_image, text_rect)
self.image = surface
self.rect = rect
def show_items(self):
"""Show list of items the player has"""
title = 'ITEMS'
potions = ['POTIONS']
weapons = ['WEAPONS']
armor = ['ARMOR']
for i, item in enumerate(self.inventory):
if item in self.possible_weapons:
if item == self.inventory['equipped weapon']:
item += " (E)"
weapons.append(item)
elif item in self.possible_armor:
if item in self.inventory['equipped armor']:
item += " (E)"
armor.append(item)
elif item in self.possible_potions:
potions.append(item)
self.slots = {}
self.assign_slots(weapons, 85)
self.assign_slots(armor, 235)
self.assign_slots(potions, 390)
surface, rect = self.make_blank_info_box(title)
self.blit_item_lists(surface)
self.sword['rect'].topleft = 40, 80
self.shield['rect'].topleft = 40, 230
self.potion['rect'].topleft = 40, 385
surface.blit(self.sword['surface'], self.sword['rect'])
surface.blit(self.shield['surface'], self.shield['rect'])
surface.blit(self.potion['surface'], self.potion['rect'])
self.image = surface
self.rect = rect
def assign_slots(self, item_list, starty, weapon_or_armor=False):
"""Assign each item to a slot in the menu"""
if len(item_list) > 3:
for i, item in enumerate(item_list[:3]):
posx = 80
posy = starty + (i * 50)
self.slots[(posx, posy)] = item
for i, item in enumerate(item_list[3:]):
posx = 315
posy = (starty + 50) + (i * 5)
self.slots[(posx, posy)] = item
else:
for i, item in enumerate(item_list):
posx = 80
posy = starty + (i * 50)
self.slots[(posx, posy)] = item
def assign_magic_slots(self, magic_list, starty):
"""
Assign each magic spell to a slot in the menu.
"""
for i, spell in enumerate(magic_list):
posx = 120
posy = starty + (i * 50)
self.slots[(posx, posy)] = spell
def blit_item_lists(self, surface):
"""Blit item list to info box surface"""
for coord in self.slots:
item = self.slots[coord]
if item in self.possible_potions:
text = "{}: {}".format(self.slots[coord],
self.inventory[item]['quantity'])
else:
text = "{}".format(self.slots[coord])
text_image = self.font.render(text, True, c.NEAR_BLACK)
text_rect = text_image.get_rect(topleft=coord)
surface.blit(text_image, text_rect)
def show_magic(self):
"""Show list of magic spells the player knows"""
title = 'MAGIC'
item_list = []
for item in self.inventory:
if item in self.possible_magic:
item_list.append(item)
item_list = sorted(item_list)
self.slots = {}
self.assign_magic_slots(item_list, 80)
surface, rect = self.make_blank_info_box(title)
for i, item in enumerate(item_list):
text_image = self.font.render(item, True, c.NEAR_BLACK)
text_rect = text_image.get_rect(x=100, y=80+(i*50))
surface.blit(text_image, text_rect)
self.image = surface
self.rect = rect
def show_nothing(self):
"""
Show nothing when the menu is opened from a level.
"""
self.image = pg.Surface((1, 1))
self.rect = self.image.get_rect()
self.image.fill(c.BLACK_BLUE)
def make_blank_info_box(self, title):
"""Make an info box with title, otherwise blank"""
image = setup.GFX['playerstatsbox']
rect = image.get_rect(left=285, top=35)
centerx = rect.width / 2
surface = pg.Surface(rect.size)
surface.set_colorkey(c.BLACK)
surface.blit(image, (0,0))
title_image = self.title_font.render(title, True, c.NEAR_BLACK)
title_rect = title_image.get_rect(centerx=centerx, y=30)
surface.blit(title_image, title_rect)
return surface, rect
def update(self):
state_function = self.state_dict[self.state]
state_function()
def draw(self, surface):
"""Draw to surface"""
surface.blit(self.image, self.rect)
class SelectionBox(pg.sprite.Sprite):
def __init__(self):
self.font = pg.font.Font(setup.FONTS[c.MAIN_FONT], 22)
self.image, self.rect = self.make_image()
def make_image(self):
choices = ['Items', 'Magic', 'Stats']
image = setup.GFX['goldbox']
rect = image.get_rect(left=10, top=425)
surface = pg.Surface(rect.size)
surface.set_colorkey(c.BLACK)
surface.blit(image, (0, 0))
for i, choice in enumerate(choices):
choice_image = self.font.render(choice, True, c.NEAR_BLACK)
choice_rect = choice_image.get_rect(x=100, y=(15 + (i * 45)))
surface.blit(choice_image, choice_rect)
return surface, rect
def draw(self, surface):
"""Draw to surface"""
surface.blit(self.image, self.rect)
class MenuGui(object):
def __init__(self, level, inventory, stats):
self.level = level
self.game_data = self.level.game_data
self.sfx_observer = observer.SoundEffects()
self.observers = [self.sfx_observer]
self.inventory = inventory
self.stats = stats
self.info_box = InfoBox(inventory, stats)
self.gold_box = QuickStats(self.game_data)
self.selection_box = SelectionBox()
self.arrow = SmallArrow(self.info_box)
self.arrow_index = 0
self.allow_input = False
def check_for_input(self, keys):
"""Check for input"""
if self.allow_input:
if keys[pg.K_DOWN]:
if self.arrow_index < len(self.arrow.pos_list) - 1:
self.notify(c.CLICK)
self.arrow_index += 1
self.allow_input = False
elif keys[pg.K_UP]:
if self.arrow_index > 0:
self.notify(c.CLICK)
self.arrow_index -= 1
self.allow_input = False
elif keys[pg.K_RIGHT]:
if self.info_box.state == 'items':
if not self.arrow.state == 'itemsubmenu':
self.notify(c.CLICK)
self.arrow_index = 0
self.arrow.state = 'itemsubmenu'
elif self.info_box.state == 'magic':
if not self.arrow.state == 'magicsubmenu':
self.notify(c.CLICK)
self.arrow_index = 0
self.arrow.state = 'magicsubmenu'
self.allow_input = False
elif keys[pg.K_LEFT]:
self.notify(c.CLICK)
self.arrow.state = 'selectmenu'
self.arrow_index = 0
self.allow_input = False
elif keys[pg.K_SPACE]:
self.notify(c.CLICK2)
if self.arrow.state == 'selectmenu':
if self.arrow_index == 0:
self.info_box.state = 'items'
self.arrow.state = 'itemsubmenu'
self.arrow_index = 0
elif self.arrow_index == 1:
self.info_box.state = 'magic'
self.arrow.state = 'magicsubmenu'
self.arrow_index = 0
elif self.arrow_index == 2:
self.info_box.state = 'stats'
elif self.arrow.state == 'itemsubmenu':
self.select_item()
elif self.arrow.state == 'magicsubmenu':
self.select_magic()
self.allow_input = False
elif keys[pg.K_RETURN]:
self.level.state = 'normal'
self.info_box.state = 'invisible'
self.allow_input = False
self.arrow_index = 0
self.arrow.state = 'selectmenu'
if (not keys[pg.K_DOWN]
and not keys[pg.K_UP]
and not keys[pg.K_RETURN]
and not keys[pg.K_SPACE]
and not keys[pg.K_RIGHT]
and not keys[pg.K_LEFT]):
self.allow_input = True
def notify(self, event):
"""
Notify all observers of event.
"""
for observer in self.observers:
observer.on_notify(event)
def select_item(self):
"""
Select item from item menu.
"""
health = self.game_data['player stats']['health']
posx = self.arrow.rect.x - 220
posy = self.arrow.rect.y - 38
if (posx, posy) in self.info_box.slots:
if self.info_box.slots[(posx, posy)][:7] == 'Healing':
potion = 'Healing Potion'
value = 30
self.drink_potion(potion, health, value)
elif self.info_box.slots[(posx, posy)][:5] == 'Ether':
potion = 'Ether Potion'
stat = self.game_data['player stats']['magic']
value = 30
self.drink_potion(potion, stat, value)
elif self.info_box.slots[(posx, posy)][:10] == 'Long Sword':
self.inventory['equipped weapon'] = 'Long Sword'
elif self.info_box.slots[(posx, posy)][:6] == 'Rapier':
self.inventory['equipped weapon'] = 'Rapier'
elif self.info_box.slots[(posx, posy)][:13] == 'Wooden Shield':
if 'Wooden Shield' in self.inventory['equipped armor']:
self.inventory['equipped armor'].remove('Wooden Shield')
else:
self.inventory['equipped armor'].append('Wooden Shield')
elif self.info_box.slots[(posx, posy)][:10] == 'Chain Mail':
if 'Chain Mail' in self.inventory['equipped armor']:
self.inventory['equipped armor'].remove('Chain Mail')
else:
self.inventory['equipped armor'].append('Chain Mail')
def select_magic(self):
"""
Select spell from magic menu.
"""
health = self.game_data['player stats']['health']
magic = self.game_data['player stats']['magic']
posx = self.arrow.rect.x - 190
posy = self.arrow.rect.y - 39
if (posx, posy) in self.info_box.slots:
if self.info_box.slots[(posx, posy)][:4] == 'Cure':
self.use_cure_spell()
def use_cure_spell(self):
"""
Use cure spell to heal player.
"""
health = self.game_data['player stats']['health']
magic = self.game_data['player stats']['magic']
inventory = self.game_data['player inventory']
if health['current'] != health['maximum']:
if magic['current'] >= inventory['Cure']['magic points']:
self.notify(c.POWERUP)
magic['current'] -= inventory['Cure']['magic points']
health['current'] += inventory['Cure']['power']
if health['current'] > health['maximum']:
health['current'] = health['maximum']
def drink_potion(self, potion, stat, value):
"""
Drink potion and change player stats.
"""
if stat['current'] != stat['maximum']:
self.notify(c.POWERUP)
self.inventory[potion]['quantity'] -= 1
stat['current'] += value
if stat['current'] > stat['maximum']:
stat['current'] = stat['maximum']
if not self.inventory[potion]['quantity']:
del self.inventory[potion]
def update(self, keys):
self.info_box.update()
self.gold_box.update()
self.arrow.update(self.arrow_index)
self.check_for_input(keys)
def draw(self, surface):
self.gold_box.draw(surface)
self.info_box.draw(surface)
self.selection_box.draw(surface)
self.arrow.draw(surface)
|
justinmeister/The-Stolen-Crown-RPG
|
data/menugui.py
|
Python
|
mit
| 20,934
|
[
"BLAST"
] |
5fd8c137f8d5757c29a3a4414c14db1802a38d5c863adb571e0986df3ebeb6e6
|
"""
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum = 22,
5
/ \
4 8
/ / \
11 13 4
/ \ \
7 2 1
return true, as there exist a root-to-leaf path 5->4->11->2 which sum is 22.
"""
# Definition for a binary tree node
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# @param root, a tree node
# @param sum, an integer
# @return a boolean
def pathSum(self, root, sum):
self.paths = []
self.hasPathSumHelper(root, sum, [])
return self.paths
def hasPathSumHelper(self, root, sum, path):
# base case
if root == None: return
# visit root
path.append(root.val)
# check end of leave nodes
if root.left == None and root.right == None and sum == root.val:
self.paths.append(list(path))
# visit children
else:
if root.left: self.hasPathSumHelper(root.left, sum - root.val, path)
if root.right: self.hasPathSumHelper(root.right, sum - root.val, path)
# backtrack
path.pop()
s = Solution()
t = TreeNode(1)
t.left = TreeNode(2)
t.right = TreeNode(1)
t.right.left = TreeNode(1)
print s.pathSum(t,3)
|
Ahmed--Mohsen/leetcode
|
path_sum_2.py
|
Python
|
mit
| 1,355
|
[
"VisIt"
] |
d4415b4404aa24fcacda5d57c2c3171ff02337986487494405e941ee23d165f8
|
# NOTE: This example uses the next generation Twilio helper library - for more
# information on how to download and install this version, visit
# https://www.twilio.com/docs/libraries/python
from twilio.rest import Client
from datetime import datetime
# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)
bindings = client.notify.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.bindings.list(
tag="new user",
start_date=datetime.strptime("2015-08-25", "%Y-%m-%d"))
for binding in bindings:
print(binding.sid)
|
teoreteetik/api-snippets
|
notifications/rest/bindings/list-binding/list-binding.6.x.py
|
Python
|
mit
| 653
|
[
"VisIt"
] |
eb3c2a101fbe86e68082a506b7fb27613afda8ea9cf38b61b6d8eef2950b5cf3
|
"""
The Job Sanity Agent accepts all jobs from the Job
receiver and screens them for the following problems:
- Output data already exists
- Problematic JDL
- Jobs with too much input data e.g. > 100 files
- Jobs with input data incorrectly specified e.g. castor:/
- Input sandbox not correctly uploaded.
"""
__RCSID__ = "$Id$"
import re
from DIRAC import S_OK, S_ERROR
from DIRAC.WorkloadManagementSystem.Executor.Base.OptimizerExecutor import OptimizerExecutor
from DIRAC.ConfigurationSystem.Client.Helpers import Registry
from DIRAC.WorkloadManagementSystem.Client.SandboxStoreClient import SandboxStoreClient
class JobSanity( OptimizerExecutor ):
"""
The specific Optimizer must provide the following methods:
- optimizeJob() - the main method called for each job
and it can provide:
- initializeOptimizer() before each execution cycle
"""
@classmethod
def initializeOptimizer( cls ):
"""Initialize specific parameters for JobSanityAgent.
"""
cls.sandboxClient = SandboxStoreClient( useCertificates = True )
return S_OK()
#############################################################################
def optimizeJob( self, jid, jobState ):
""" This method controls the order and presence of
each sanity check for submitted jobs. This should
be easily extended in the future to accommodate
any other potential checks.
"""
#Job JDL check
result = jobState.getAttribute( 'JobType' )
if not result['OK']:
return result
jobType = result['Value'].lower()
result = jobState.getManifest()
if not result[ 'OK' ]:
return result
manifest = result[ 'Value' ]
finalMsg = []
#Input data check
if self.ex_getOption( 'InputDataCheck', True ):
voName = manifest.getOption( "VirtualOrganization", "" )
if not voName:
return S_ERROR( "No VirtualOrganization defined in manifest" )
result = self.checkInputData( jobState, jobType, voName )
if not result[ 'OK' ]:
return result
finalMsg.append( "%s LFNs" % result[ 'Value' ] )
self.jobLog.info( "%s LFNs" % result[ 'Value' ] )
#Output data exists check # disabled
if self.ex_getOption( 'OutputDataCheck', False ):
if jobType != 'user':
result = self.checkOutputDataExists( jobState )
if not result[ 'OK' ]:
return result
finalMsg.append( "Output data OK" )
self.jobLog.info( "Output data OK" )
#Input Sandbox uploaded check
if self.ex_getOption( 'InputSandboxCheck', True ):
result = self.checkInputSandbox( jobState, manifest )
if not result[ 'OK' ]:
return result
finalMsg.append( "Assigned %s ISBs" % result[ 'Value' ] )
self.jobLog.info( "Assigned %s ISBs" % result[ 'Value' ] )
jobState.setParameter( 'JobSanityCheck', " | ".join( finalMsg ) )
return self.setNextOptimizer( jobState )
#############################################################################
def checkInputData( self, jobState, jobType, voName ):
"""This method checks both the amount of input
datasets for the job and whether the LFN conventions
are correct.
"""
result = jobState.getInputData()
if not result[ 'OK' ]:
self.jobLog.warn( 'Failed to get input data from JobDB' )
self.jobLog.warn( result['Message'] )
return S_ERROR( "Input Data Specification" )
data = result[ 'Value' ] # seems to be [''] when null, which isn't an empty list ;)
data = [ lfn.strip() for lfn in data if lfn.strip() ]
if not data:
return S_OK( 0 )
self.jobLog.debug( 'Input data requirement will be checked' )
self.jobLog.debug( 'Data is:\n\t%s' % "\n\t".join( data ) )
voRE = re.compile( "^(LFN:)?/%s/" % voName )
for lfn in data:
if not voRE.match( lfn ):
return S_ERROR( "Input data not correctly specified" )
if lfn.find( "//" ) > -1:
return S_ERROR( "Input data contains //" )
#only check limit for user jobs
if jobType == 'user':
maxLFNs = self.ex_getOption( 'MaxInputDataPerJob', 100 )
if len( data ) > maxLFNs:
message = '%s datasets selected. Max limit is %s.' % ( len( data ), maxLFNs )
jobState.setParameter( "DatasetCheck", message )
return S_ERROR( "Exceeded Maximum Dataset Limit (%s)" % maxLFNs )
return S_OK( len( data ) )
#############################################################################
def checkOutputDataExists( self, jobState ):
"""If the job output data is already in the LFC, this
method will fail the job for the attention of the
data manager. To be tidied for DIRAC3...
"""
# FIXME: To implement checkOutputDataExists
return S_OK()
#############################################################################
def checkInputSandbox( self, jobState, manifest ):
"""The number of input sandbox files, as specified in the job
JDL are checked in the JobDB.
"""
result = jobState.getAttributes( [ 'Owner', 'OwnerDN', 'OwnerGroup', 'DIRACSetup' ] )
if not result[ 'OK' ]:
return result
attDict = result[ 'Value' ]
ownerName = attDict[ 'Owner' ]
if not ownerName:
ownerDN = attDict[ 'OwnerDN' ]
if not ownerDN:
return S_ERROR( "Missing OwnerDN" )
result = Registry.getUsernameForDN( ownerDN )
if not result[ 'OK' ]:
return result
ownerName = result[ 'Value' ]
ownerGroup = attDict[ 'OwnerGroup' ]
if not ownerGroup:
return S_ERROR( "Missing OwnerGroup" )
jobSetup = attDict[ 'DIRACSetup' ]
if not jobSetup:
return S_ERROR( "Missing DIRACSetup" )
isbList = manifest.getOption( 'InputSandbox', [] )
sbsToAssign = []
for isb in isbList:
if isb.find( "SB:" ) == 0:
self.jobLog.info( "Found a sandbox", isb )
sbsToAssign.append( ( isb, "Input" ) )
numSBsToAssign = len( sbsToAssign )
if not numSBsToAssign:
return S_OK( 0 )
self.jobLog.info( "Assigning %s sandboxes on behalf of %s@%s" % ( numSBsToAssign, ownerName, ownerGroup ) )
result = self.sandboxClient.assignSandboxesToJob( jobState.jid, sbsToAssign, ownerName, ownerGroup, jobSetup )
if not result[ 'OK' ]:
self.jobLog.error( "Could not assign sandboxes in the SandboxStore" )
return S_ERROR( "Cannot assign sandbox to job" )
assigned = result[ 'Value' ]
if assigned != numSBsToAssign:
self.jobLog.error( "Could not assign all sandboxes (%s). Only assigned %s" % ( numSBsToAssign, assigned ) )
return S_OK( numSBsToAssign )
#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#
|
Andrew-McNab-UK/DIRAC
|
WorkloadManagementSystem/Executor/JobSanity.py
|
Python
|
gpl-3.0
| 6,735
|
[
"DIRAC"
] |
07ec4b8f3c6e5c497d7ec428b6bc3cca6b9e662ebc8b17fc8f0cdcf0173e742f
|
import urlparse
from dryscrape.driver.webkit import Driver as DefaultDriver
class Session(object):
""" A web scraping session based on a driver instance. Implements the proxy
pattern to pass unresolved method calls to the underlying driver.
If no `driver` is specified, the instance will create an instance of
``dryscrape.session.DefaultDriver`` to get a driver instance (defaults to
``dryscrape.driver.webkit.Driver``).
If `base_url` is present, relative URLs are completed with this URL base.
If not, the `get_base_url` method is called on itself to get the base URL. """
def __init__(self,
driver = None,
base_url = None):
self.driver = driver or DefaultDriver()
self.base_url = base_url
# implement proxy pattern
def __getattr__(self, attr):
""" Pass unresolved method calls to underlying driver. """
return getattr(self.driver, attr)
def visit(self, url):
""" Passes through the URL to the driver after completing it using the
instance's URL base. """
return self.driver.visit(self.complete_url(url))
def complete_url(self, url):
""" Completes a given URL with this instance's URL base. """
if self.base_url:
return urlparse.urljoin(self.base_url, url)
else:
return url
def interact(self, **local):
""" Drops the user into an interactive Python session with the ``sess`` variable
set to the current session instance. If keyword arguments are supplied, these
names will also be available within the session. """
import code
code.interact(local=dict(sess=self, **local))
|
nabilbendafi/plugin.video.rainiertamayo
|
resources/lib/dryscrape/session.py
|
Python
|
gpl-3.0
| 1,610
|
[
"VisIt"
] |
9aa3b4aabd56752d4ea38fa1a219a49dc1fb119a7a1becdb9cb07d46f9d560ea
|
import pytest
import math
from timeit import timeit
from astropy import units as u
from panoptes.pocs.filterwheel.simulator import FilterWheel as SimFilterWheel
from panoptes.pocs.camera.simulator.dslr import Camera as SimCamera
from panoptes.utils import error
@pytest.fixture(scope='function')
def filterwheel():
sim_filterwheel = SimFilterWheel(filter_names=['one', 'deux', 'drei', 'quattro'],
move_time=0.1 * u.second,
timeout=0.5 * u.second)
return sim_filterwheel
@pytest.fixture(scope='function')
def filterwheel_with_blank():
sim_filterwheel = SimFilterWheel(filter_names=['blank', 'deux', 'drei', 'quattro'],
move_time=0.1 * u.second,
timeout=0.5 * u.second,
dark_position='blank')
return sim_filterwheel
def test_init(filterwheel):
assert isinstance(filterwheel, SimFilterWheel)
assert filterwheel.is_connected
def test_camera_init():
sim_camera = SimCamera(filterwheel={'model': 'panoptes.pocs.filterwheel.simulator.FilterWheel',
'filter_names': ['one', 'deux', 'drei', 'quattro']})
assert isinstance(sim_camera.filterwheel, SimFilterWheel)
assert sim_camera.filterwheel.is_connected
assert sim_camera.filterwheel.uid
assert sim_camera.filterwheel.camera is sim_camera
def test_camera_no_filterwheel():
sim_camera = SimCamera()
assert sim_camera.filterwheel is None
def test_camera_association_on_init():
sim_camera = SimCamera()
sim_filterwheel = SimFilterWheel(filter_names=['one', 'deux', 'drei', 'quattro'],
camera=sim_camera)
assert sim_filterwheel.camera is sim_camera
def test_with_no_name():
with pytest.raises(ValueError):
SimFilterWheel()
# Basic property getting and (not) setting
def test_model(filterwheel):
model = filterwheel.model
assert model == 'panoptes.pocs.filterwheel.simulator.FilterWheel'
with pytest.raises(AttributeError):
filterwheel.model = "Airfix"
def test_name(filterwheel):
name = filterwheel.name
assert name == 'Simulated Filter Wheel'
with pytest.raises(AttributeError):
filterwheel.name = "Phillip"
def test_uid(filterwheel):
uid = filterwheel.uid
assert uid.startswith('SW')
assert len(uid) == 6
with pytest.raises(AttributeError):
filterwheel.uid = "Can't touch this"
def test_filter_names(filterwheel):
names = filterwheel.filter_names
assert isinstance(names, list)
for name in names:
assert isinstance(name, str)
with pytest.raises(AttributeError):
filterwheel.filter_names = ["Unsharp mask", "Gaussian blur"]
# Movement
def test_move_number(filterwheel):
assert filterwheel.position == 1
e = filterwheel.move_to(4)
assert math.isnan(filterwheel.position) # position is NaN while between filters
e.wait()
assert filterwheel.position == 4
e = filterwheel.move_to(3, blocking=True)
assert e.is_set()
assert filterwheel.position == 3
filterwheel.position = 4 # Move by assignment to position property blocks until complete
assert filterwheel.position == 4
def test_move_bad_number(filterwheel):
with pytest.raises(ValueError):
filterwheel.move_to(0, blocking=True) # No zero based numbering here!
with pytest.raises(ValueError):
filterwheel.move_to(-1, blocking=True) # Definitely not
with pytest.raises(ValueError):
filterwheel.position = 99 # Problems.
with pytest.raises(ValueError):
filterwheel.move_to(filterwheel._n_positions + 1, blocking=True) # Close, but...
filterwheel.move_to(filterwheel._n_positions, blocking=True) # OK
def test_move_name(filterwheel, caplog):
filterwheel.position = 1 # Start from a known position
e = filterwheel.move_to('quattro')
assert filterwheel.current_filter == 'UNKNOWN' # I'm between filters right now
e.wait()
assert filterwheel.current_filter == 'quattro'
e = filterwheel.move_to('o', blocking=True) # Matches leading substrings too
assert filterwheel.current_filter == 'one'
filterwheel.position = 'd' # In case of multiple matches logs a warning & uses the first match
assert filterwheel.current_filter == 'deux'
# WARNING followed by INFO level record about the move
assert caplog.records[-2].levelname == 'WARNING'
assert caplog.records[-1].levelname == 'INFO'
filterwheel.position = 'deux' # Check null move. Earlier version of simulator failed this!
assert filterwheel.current_filter == 'deux'
def test_move_bad_name(filterwheel):
with pytest.raises(ValueError):
filterwheel.move_to('cinco')
def test_move_timeout(caplog):
slow_filterwheel = SimFilterWheel(filter_names=['one', 'deux', 'drei', 'quattro'],
move_time=0.5,
timeout=0.2)
with pytest.raises(error.Timeout):
# Move should take 0.3 seconds, more than timeout.
slow_filterwheel.position = 4
assert slow_filterwheel.position != 4
@pytest.mark.parametrize("name, unidirectional, expected",
[("unidirectional", True, 0.3),
("bidirectional", False, 0.1)])
def test_move_times(name, unidirectional, expected):
sim_filterwheel = SimFilterWheel(filter_names=['one', 'deux', 'drei', 'quattro'],
move_time=0.1 * u.second,
unidirectional=unidirectional,
timeout=0.5 * u.second)
sim_filterwheel.position = 1
assert timeit("sim_filterwheel.position = 2", number=1, globals=locals()) == \
pytest.approx(0.1, rel=1e-1)
assert timeit("sim_filterwheel.position = 4", number=1, globals=locals()) == \
pytest.approx(0.2, rel=1.5e-1)
assert timeit("sim_filterwheel.position = 3", number=1, globals=locals()) == \
pytest.approx(expected, rel=2e-1)
def test_move_exposing(tmpdir):
sim_camera = SimCamera(filterwheel={'model': 'panoptes.pocs.filterwheel.simulator.FilterWheel',
'filter_names': ['one', 'deux', 'drei', 'quattro']})
fits_path = str(tmpdir.join('test_exposure.fits'))
readout_thread = sim_camera.take_exposure(filename=fits_path, seconds=0.1)
with pytest.raises(error.PanError):
# Attempt to move while camera is exposing
sim_camera.filterwheel.move_to(2, blocking=True)
assert sim_camera.filterwheel.position == 1 # Should not have moved
readout_thread.join()
def test_is_moving(filterwheel):
filterwheel.position = 1
assert not filterwheel.is_moving
assert filterwheel.is_ready
e = filterwheel.move_to(2)
assert filterwheel.is_moving
assert not filterwheel.is_ready
e.wait()
assert not filterwheel.is_moving
assert filterwheel.is_ready
def test_move_dark(filterwheel, filterwheel_with_blank):
with pytest.raises(error.NotFound):
filterwheel.move_to_dark_position()
filterwheel_with_blank.move_to('deux', blocking=True)
assert filterwheel_with_blank.current_filter == 'deux'
filterwheel_with_blank.move_to_dark_position(blocking=True)
assert filterwheel_with_blank.current_filter == 'blank'
def test_move_light(filterwheel, filterwheel_with_blank):
with pytest.raises(error.NotFound):
filterwheel.move_to_light_position()
with pytest.raises(error.NotFound):
# Won't have been set yet.
filterwheel_with_blank.move_to_light_position()
filterwheel_with_blank.move_to('deux', blocking=True)
assert filterwheel_with_blank.current_filter == 'deux'
filterwheel_with_blank.move_to_dark_position(blocking=True)
assert filterwheel_with_blank.current_filter == 'blank'
filterwheel_with_blank.move_to_light_position(blocking=True)
assert filterwheel_with_blank.current_filter == 'deux'
|
panoptes/POCS
|
tests/test_filterwheel.py
|
Python
|
mit
| 8,100
|
[
"Gaussian"
] |
ae4622fc43290a3cf61d3823c8872e2efbfe736916f2d21dd8e265ad3c9c1255
|
#
# Samples a 2d double-well distribution using Umbrella sampling in the temperature (parallel version)
#
# Usage:
# > mpirun -np N python -u doublewell_mpi.py
# where "N" is the number of cores to run on, e.g. 4
#
import usample.usample
import numpy as np
import emcee
#
# Sample a 2D distribution of the sum of two Gaussians
#
# Define the log probability function:
#
def log_prob_fn(p ):
x=p[0]
y=p[1]
# Two Gaussian distributions, centered on +/- 1
lpf = np.log( np.exp(-16*(x-1)**2) + np.exp(-16*(x+1)**2 ))
# And an independent Gaussian in another direction
lpf -= 0.5*y*y
return lpf
#
# Now create the umbrella sampler object
us = usample.UmbrellaSampler( log_prob_fn , mpi=True, debug=True, burn_acor=20 )
#
# Build umbrellas along a line between two points: the two peaks of the distribution.
# This line is a 1D "CV" or Collective Variable, embedded in the higher dimensions.
# The CV runs from (-1,0) to (1,0)
cvfn = ["line", [np.array([-1.0,0]), np.array([1.0,0])] ]
# In the cv coordinates the start of the line is "0" and the end is "1".
# We define the centers of the biasing distribution in the CVs.
# Here we define the centers of the four umbrellas:
centers = np.linspace( 0 , 1 , 4 )
# We may also make use of sampling using different temperatures within a window.
# Lets try sampling at a temperature of 1 and 5.
temps = [1,5]
# Note that this gives a total of 4x2=8 umbrellas overall.
# We are umbrella sampling in two directions:
# - perpendicular to the 1D line defined in "cvfn" (4 umbrellas)
# - the temperature (2 umbrellas)
# Feel free to experiment with the parameters.
#
#
# Other than a "line" in cvfn, we may also use "grid" to place umbrellas in a checkerboard.
# The usage looks like this:
##cvfn = ["grid", [np.array([-1.0,0]), np.array([1.0,0]), np.array([-1.0,1.0])] ]
##centers = [ [ii,jj] for ii in np.linspace( 0 , 1 , 3 ) for jj in np.linspace( 0 , 1 , 5 ) ]
# Where "grid" takes a list of three points [a,b,c] defining the 2D plane and the boundaries where
# the first grid line is (a->b) and the second is (a->c). These two lines need not be perpendicular.
#
#
# Once we have defined the umbrellas as above, we run using the following routine:
us.add_umbrellas( temperatures=temps, centers=centers, cvfn=cvfn , numwalkers=8 , ic=np.array([0,0]) , sampler=emcee.EnsembleSampler )
#
# Then run for 10000 steps in each window.
# Output stats every [freq] steps
# Try to replica exchange [repex]-many walkers every [freq] steps
#
pos,weights,prob = us.run(10000 , freq=100, repex=10 )
#
# We save the output
#
if (us.is_master() ):
x = np.append( pos , weights , axis=1 )
x = np.append( x , prob , axis=1 )
np.savetxt( 'results_doublewell_mpi.txt' , x )
us.close_pools()
|
c-matthews/usample
|
doublewell_mpi.py
|
Python
|
gpl-3.0
| 2,785
|
[
"Gaussian"
] |
126a2047a2297a3b87db58b36287ac0bc21783a6b331f8c32af4951061f94a8d
|
# This file is part of xrayutilities.
#
# xrayutilies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# Copyright (C) 2009 Eugen Wintersberger <eugen.wintersberger@desy.de>
# Copyright (C) 2010-2021 Dominik Kriegner <dominik.kriegner@gmail.com>
import glob
import os.path
import subprocess
import sys
import tempfile
import numpy
import setuptools
from setuptools import Extension, find_packages, setup
from setuptools.command.build_ext import build_ext
from setuptools.command.build_py import build_py
def has_flag(compiler, flagname, output_dir=None):
# see https://bugs.python.org/issue26689
"""Return a boolean indicating whether a flag name is supported on
the specified compiler.
"""
with tempfile.NamedTemporaryFile('w', suffix='.c', delete=False) as f:
f.write('int main (int argc, char **argv) { return 0; }')
f.close()
try:
obj = compiler.compile([f.name], output_dir=output_dir,
extra_postargs=[flagname])
os.remove(*obj)
except setuptools.distutils.errors.CompileError:
return False
finally:
os.remove(f.name)
return True
class build_ext_subclass(build_ext):
description = "Builds the Python C-extension of xrayutilities"
user_options = (
build_ext.user_options +
[('without-openmp', None, 'build without OpenMP support')])
def initialize_options(self):
super().initialize_options()
self.without_openmp = 0
def finalize_options(self):
super().finalize_options()
self.without_openmp = int(self.without_openmp)
def build_extensions(self):
c = self.compiler.compiler_type
# set extra compiler options
copt = {}
if c in copt:
for flag in copt[c]:
if has_flag(self.compiler, flag, self.build_temp):
for e in self.extensions:
e.extra_compile_args.append(flag)
# set openMP compiler options
if not self.without_openmp:
openmpflags = {'msvc': ('/openmp', None),
'mingw32': ('-fopenmp', '-fopenmp'),
'unix': ('-fopenmp', '-lgomp')}
if c in openmpflags:
flag, lib = openmpflags[c]
if has_flag(self.compiler, flag, self.build_temp):
for e in self.extensions:
e.extra_compile_args.append(flag)
if lib is not None:
e.extra_link_args.append(lib)
e.define_macros.append(('__OPENMP__', None))
super().build_extensions()
class build_with_database(build_py):
def build_database(self):
dbfilename = os.path.join(self.build_lib, 'xrayutilities',
'materials', 'data', 'elements.db')
cmd = [sys.executable,
os.path.join('lib', 'xrayutilities', 'materials',
'_create_database.py'),
dbfilename]
self.mkpath(os.path.dirname(dbfilename))
print('building database: {}'.format(dbfilename))
try:
if sys.version_info >= (3, 5):
subprocess.run(cmd, stderr=subprocess.PIPE,
stdout=subprocess.PIPE, check=True)
else:
subprocess.check_output(cmd)
except subprocess.CalledProcessError as cpe:
sys.stdout.buffer.write(cpe.stdout)
sys.stdout.buffer.write(cpe.stderr)
raise
def run(self):
super().run()
self.build_database()
cmdclass = {'build_py': build_with_database,
'build_ext': build_ext_subclass}
with open('README.md') as f:
long_description = f.read()
extmodul = Extension('xrayutilities.cxrayutilities',
sources=glob.glob(os.path.join('src', '*.c')))
with open('lib/xrayutilities/VERSION') as version_file:
version = version_file.read().strip().replace('\n', '.')
try:
import sphinx
from sphinx.setup_command import BuildDoc
class build_doc(BuildDoc):
def run(self):
# make sure the python path is pointing to the newly built
# code so that the documentation is built on this and not a
# previously installed version
build = self.get_finalized_command('build')
sys.path.insert(0, os.path.abspath(build.build_lib))
try:
sphinx.setup_command.BuildDoc.run(self)
except UnicodeDecodeError:
print("ERROR: unable to build documentation"
" because Sphinx do not handle"
" source path with non-ASCII characters. Please"
" try to move the source package to another"
" location (path with *only* ASCII characters)")
sys.path.pop(0)
cmdclass['build_doc'] = build_doc
except ImportError:
pass
setup(
name="xrayutilities",
version=version,
author="Eugen Wintersberger, Dominik Kriegner",
description="package for x-ray diffraction data evaluation",
classifiers=[
"Programming Language :: C",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: Physics",
"Intended Audience :: Science/Research",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU General Public License v2 or later "
"(GPLv2+)"
],
long_description=long_description,
long_description_content_type="text/markdown",
author_email="eugen.wintersberger@desy.de, dominik.kriegner@gmail.com",
maintainer="Dominik Kriegner",
maintainer_email="dominik.kriegner@gmail.com",
package_dir={'': 'lib'},
packages=find_packages('lib'),
package_data={
"xrayutilities": ["VERSION", "*.conf"],
"xrayutilities.materials": [os.path.join("data", "*")]
},
include_package_data=True,
python_requires='~=3.6',
setup_requires=['numpy', 'scipy', 'h5py'],
install_requires=['numpy>=1.9.2', 'scipy>=0.18.0', 'h5py'],
extras_require={
'plot': ["matplotlib>=3.1.0"],
'fit': ["lmfit>=1.0.1"],
'3D': ["mayavi"],
},
include_dirs=[numpy.get_include()],
ext_modules=[extmodul],
cmdclass=cmdclass,
url="https://xrayutilities.sourceforge.io",
license="GPLv2",
)
|
dkriegner/xrayutilities
|
setup.py
|
Python
|
gpl-2.0
| 7,251
|
[
"Mayavi"
] |
bba90129aed4de6b075c3093231501e1daf890316ce9db7007138465a451518a
|
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Builds the CIFAR-10 network.
Summary of available functions:
# Compute input images and labels for training. If you would like to run
# evaluations, use inputs() instead.
inputs, labels = distorted_inputs()
# Compute inference on the model inputs to make a prediction.
predictions = inference(inputs)
# Compute the total loss of the prediction with respect to the labels.
loss = loss(predictions, labels)
# Create a graph to run one step of training with respect to the loss.
train_op = train(loss, global_step)
"""
# pylint: disable=missing-docstring
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
import sys
import tarfile
import tensorflow as tf
from six.moves import urllib
from tensorflow.models.image.cifar10 import cifar10_input
FLAGS = tf.app.flags.FLAGS
# Basic model parameters.
tf.app.flags.DEFINE_integer('batch_size', 128,
"""Number of images to process in a batch.""")
tf.app.flags.DEFINE_string('data_dir', '/tmp/cifar10_data',
"""Path to the CIFAR-10 data directory.""")
# Global constants describing the CIFAR-10 data set.
IMAGE_SIZE = cifar10_input.IMAGE_SIZE
NUM_CLASSES = cifar10_input.NUM_CLASSES
NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN = cifar10_input.NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN
NUM_EXAMPLES_PER_EPOCH_FOR_EVAL = cifar10_input.NUM_EXAMPLES_PER_EPOCH_FOR_EVAL
# Constants describing the training process.
MOVING_AVERAGE_DECAY = 0.9999 # The decay to use for the moving average.
NUM_EPOCHS_PER_DECAY = 350.0 # Epochs after which learning rate decays.
LEARNING_RATE_DECAY_FACTOR = 0.1 # Learning rate decay factor.
INITIAL_LEARNING_RATE = 0.1 # Initial learning rate.
# If a model is trained with multiple GPU's prefix all Op names with tower_name
# to differentiate the operations. Note that this prefix is removed from the
# names of the summaries when visualizing a model.
TOWER_NAME = 'tower'
DATA_URL = 'http://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz'
def _activation_summary(x):
"""Helper to create summaries for activations.
Creates a summary that provides a histogram of activations.
Creates a summary that measure the sparsity of activations.
Args:
x: Tensor
Returns:
nothing
"""
# Remove 'tower_[0-9]/' from the name in case this is a multi-GPU training
# session. This helps the clarity of presentation on tensorboard.
tensor_name = re.sub('%s_[0-9]*/' % TOWER_NAME, '', x.op.name)
tf.histogram_summary(tensor_name + '/activations', x)
tf.scalar_summary(tensor_name + '/sparsity', tf.nn.zero_fraction(x))
def _variable_on_cpu(name, shape, initializer):
"""Helper to create a Variable stored on CPU memory.
Args:
name: name of the variable
shape: list of ints
initializer: initializer for Variable
Returns:
Variable Tensor
"""
with tf.device('/cpu:0'):
var = tf.get_variable(name, shape, initializer=initializer)
return var
def _variable_with_weight_decay(name, shape, stddev, wd):
"""Helper to create an initialized Variable with weight decay.
Note that the Variable is initialized with a truncated normal distribution.
A weight decay is added only if one is specified.
Args:
name: name of the variable
shape: list of ints
stddev: standard deviation of a truncated Gaussian
wd: add L2Loss weight decay multiplied by this float. If None, weight
decay is not added for this Variable.
Returns:
Variable Tensor
"""
var = _variable_on_cpu(name, shape,
tf.truncated_normal_initializer(stddev=stddev))
if wd:
weight_decay = tf.mul(tf.nn.l2_loss(var), wd, name='weight_loss')
tf.add_to_collection('losses', weight_decay)
return var
def distorted_inputs():
"""Construct distorted input for CIFAR training using the Reader ops.
Returns:
images: Images. 4D tensor of [batch_size, IMAGE_SIZE, IMAGE_SIZE, 3] size.
labels: Labels. 1D tensor of [batch_size] size.
Raises:
ValueError: If no data_dir
"""
if not FLAGS.data_dir:
raise ValueError('Please supply a data_dir')
data_dir = os.path.join(FLAGS.data_dir, 'cifar-10-batches-bin')
return cifar10_input.distorted_inputs(data_dir=data_dir,
batch_size=FLAGS.batch_size)
def inputs(eval_data):
"""Construct input for CIFAR evaluation using the Reader ops.
Args:
eval_data: bool, indicating if one should use the train or eval data set.
Returns:
images: Images. 4D tensor of [batch_size, IMAGE_SIZE, IMAGE_SIZE, 3] size.
labels: Labels. 1D tensor of [batch_size] size.
Raises:
ValueError: If no data_dir
"""
if not FLAGS.data_dir:
raise ValueError('Please supply a data_dir')
data_dir = os.path.join(FLAGS.data_dir, 'cifar-10-batches-bin')
return cifar10_input.inputs(eval_data=eval_data, data_dir=data_dir,
batch_size=FLAGS.batch_size)
def inference(images):
"""Build the CIFAR-10 model.
Args:
images: Images returned from distorted_inputs() or inputs().
Returns:
Logits.
"""
# We instantiate all variables using tf.get_variable() instead of
# tf.Variable() in order to share variables across multiple GPU training runs.
# If we only ran this model on a single GPU, we could simplify this function
# by replacing all instances of tf.get_variable() with tf.Variable().
#
# conv1
with tf.variable_scope('conv1') as scope:
kernel = _variable_with_weight_decay('weights', shape=[5, 5, 3, 64],
stddev=1e-4, wd=0.0)
conv = tf.nn.conv2d(images, kernel, [1, 1, 1, 1], padding='SAME')
biases = _variable_on_cpu('biases', [64], tf.constant_initializer(0.0))
bias = tf.nn.bias_add(conv, biases)
conv1 = tf.nn.relu(bias, name=scope.name)
_activation_summary(conv1)
# pool1
pool1 = tf.nn.max_pool(conv1, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1],
padding='SAME', name='pool1')
# norm1
norm1 = tf.nn.lrn(pool1, 4, bias=1.0, alpha=0.001 / 9.0, beta=0.75,
name='norm1')
# conv2
with tf.variable_scope('conv2') as scope:
kernel = _variable_with_weight_decay('weights', shape=[5, 5, 64, 64],
stddev=1e-4, wd=0.0)
conv = tf.nn.conv2d(norm1, kernel, [1, 1, 1, 1], padding='SAME')
biases = _variable_on_cpu('biases', [64], tf.constant_initializer(0.1))
bias = tf.nn.bias_add(conv, biases)
conv2 = tf.nn.relu(bias, name=scope.name)
_activation_summary(conv2)
# norm2
norm2 = tf.nn.lrn(conv2, 4, bias=1.0, alpha=0.001 / 9.0, beta=0.75,
name='norm2')
# pool2
pool2 = tf.nn.max_pool(norm2, ksize=[1, 3, 3, 1],
strides=[1, 2, 2, 1], padding='SAME', name='pool2')
# local3
with tf.variable_scope('local3') as scope:
# Move everything into depth so we can perform a single matrix multiply.
dim = 1
for d in pool2.get_shape()[1:].as_list():
dim *= d
reshape = tf.reshape(pool2, [FLAGS.batch_size, dim])
weights = _variable_with_weight_decay('weights', shape=[dim, 384],
stddev=0.04, wd=0.004)
biases = _variable_on_cpu('biases', [384], tf.constant_initializer(0.1))
local3 = tf.nn.relu(tf.matmul(reshape, weights) + biases, name=scope.name)
_activation_summary(local3)
# local4
with tf.variable_scope('local4') as scope:
weights = _variable_with_weight_decay('weights', shape=[384, 192],
stddev=0.04, wd=0.004)
biases = _variable_on_cpu('biases', [192], tf.constant_initializer(0.1))
local4 = tf.nn.relu(tf.matmul(local3, weights) + biases, name=scope.name)
_activation_summary(local4)
# softmax, i.e. softmax(WX + b)
with tf.variable_scope('softmax_linear') as scope:
weights = _variable_with_weight_decay('weights', [192, NUM_CLASSES],
stddev=1 / 192.0, wd=0.0)
biases = _variable_on_cpu('biases', [NUM_CLASSES],
tf.constant_initializer(0.0))
softmax_linear = tf.add(tf.matmul(local4, weights), biases, name=scope.name)
_activation_summary(softmax_linear)
return softmax_linear
def loss(logits, labels):
"""Add L2Loss to all the trainable variables.
Add summary for for "Loss" and "Loss/avg".
Args:
logits: Logits from inference().
labels: Labels from distorted_inputs or inputs(). 1-D tensor
of shape [batch_size]
Returns:
Loss tensor of type float.
"""
# Calculate the average cross entropy loss across the batch.
labels = tf.cast(labels, tf.int64)
cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(
logits, labels, name='cross_entropy_per_example')
cross_entropy_mean = tf.reduce_mean(cross_entropy, name='cross_entropy')
tf.add_to_collection('losses', cross_entropy_mean)
# The total loss is defined as the cross entropy loss plus all of the weight
# decay terms (L2 loss).
return tf.add_n(tf.get_collection('losses'), name='total_loss')
def _add_loss_summaries(total_loss):
"""Add summaries for losses in CIFAR-10 model.
Generates moving average for all losses and associated summaries for
visualizing the performance of the network.
Args:
total_loss: Total loss from loss().
Returns:
loss_averages_op: op for generating moving averages of losses.
"""
# Compute the moving average of all individual losses and the total loss.
loss_averages = tf.train.ExponentialMovingAverage(0.9, name='avg')
losses = tf.get_collection('losses')
loss_averages_op = loss_averages.apply(losses + [total_loss])
# Attach a scalar summary to all individual losses and the total loss; do the
# same for the averaged version of the losses.
for l in losses + [total_loss]:
# Name each loss as '(raw)' and name the moving average version of the loss
# as the original loss name.
tf.scalar_summary(l.op.name + ' (raw)', l)
tf.scalar_summary(l.op.name, loss_averages.average(l))
return loss_averages_op
def train(total_loss, global_step):
"""Train CIFAR-10 model.
Create an optimizer and apply to all trainable variables. Add moving
average for all trainable variables.
Args:
total_loss: Total loss from loss().
global_step: Integer Variable counting the number of training steps
processed.
Returns:
train_op: op for training.
"""
# Variables that affect learning rate.
num_batches_per_epoch = NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN / FLAGS.batch_size
decay_steps = int(num_batches_per_epoch * NUM_EPOCHS_PER_DECAY)
# Decay the learning rate exponentially based on the number of steps.
lr = tf.train.exponential_decay(INITIAL_LEARNING_RATE,
global_step,
decay_steps,
LEARNING_RATE_DECAY_FACTOR,
staircase=True)
tf.scalar_summary('learning_rate', lr)
# Generate moving averages of all losses and associated summaries.
loss_averages_op = _add_loss_summaries(total_loss)
# Compute gradients.
with tf.control_dependencies([loss_averages_op]):
opt = tf.train.GradientDescentOptimizer(lr)
grads = opt.compute_gradients(total_loss)
# Apply gradients.
apply_gradient_op = opt.apply_gradients(grads, global_step=global_step)
# Add histograms for trainable variables.
for var in tf.trainable_variables():
tf.histogram_summary(var.op.name, var)
# Add histograms for gradients.
for grad, var in grads:
if grad:
tf.histogram_summary(var.op.name + '/gradients', grad)
# Track the moving averages of all trainable variables.
variable_averages = tf.train.ExponentialMovingAverage(
MOVING_AVERAGE_DECAY, global_step)
variables_averages_op = variable_averages.apply(tf.trainable_variables())
with tf.control_dependencies([apply_gradient_op, variables_averages_op]):
train_op = tf.no_op(name='train')
return train_op
def maybe_download_and_extract():
"""Download and extract the tarball from Alex's web."""
dest_directory = FLAGS.data_dir
if not os.path.exists(dest_directory):
os.makedirs(dest_directory)
filename = DATA_URL.split('/')[-1]
filepath = os.path.join(dest_directory, filename)
if not os.path.exists(filepath):
def _progress(count, block_size, total_size):
sys.stdout.write('\r>> Downloading %s %.1f%%' % (filename,
float(count * block_size) / float(total_size) * 100.0))
sys.stdout.flush()
filepath, _ = urllib.request.urlretrieve(DATA_URL, filepath,
reporthook=_progress)
print()
statinfo = os.stat(filepath)
print('Successfully downloaded', filename, statinfo.st_size, 'bytes.')
tarfile.open(filepath, 'r:gz').extractall(dest_directory)
|
DailyActie/Surrogate-Model
|
01-codes/tensorflow-master/tensorflow/models/image/cifar10/cifar10.py
|
Python
|
mit
| 14,256
|
[
"Gaussian"
] |
1f3ffa035cf7e3a90df8ee0f7b11cf60eef3637dbded05adbf1fc835c25cfa24
|
# revset.py - revision set queries for mercurial
#
# Copyright 2010 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import re
import parser, util, error, discovery, hbisect, phases
import node
import bookmarks as bookmarksmod
import match as matchmod
from i18n import _
import encoding
def _revancestors(repo, revs, followfirst):
"""Like revlog.ancestors(), but supports followfirst."""
cut = followfirst and 1 or None
cl = repo.changelog
visit = list(revs)
seen = set([node.nullrev])
while visit:
for parent in cl.parentrevs(visit.pop(0))[:cut]:
if parent not in seen:
visit.append(parent)
seen.add(parent)
yield parent
def _revdescendants(repo, revs, followfirst):
"""Like revlog.descendants() but supports followfirst."""
cut = followfirst and 1 or None
cl = repo.changelog
first = min(revs)
nullrev = node.nullrev
if first == nullrev:
# Are there nodes with a null first parent and a non-null
# second one? Maybe. Do we care? Probably not.
for i in cl:
yield i
return
seen = set(revs)
for i in xrange(first + 1, len(cl)):
for x in cl.parentrevs(i)[:cut]:
if x != nullrev and x in seen:
seen.add(i)
yield i
break
elements = {
"(": (20, ("group", 1, ")"), ("func", 1, ")")),
"~": (18, None, ("ancestor", 18)),
"^": (18, None, ("parent", 18), ("parentpost", 18)),
"-": (5, ("negate", 19), ("minus", 5)),
"::": (17, ("dagrangepre", 17), ("dagrange", 17),
("dagrangepost", 17)),
"..": (17, ("dagrangepre", 17), ("dagrange", 17),
("dagrangepost", 17)),
":": (15, ("rangepre", 15), ("range", 15), ("rangepost", 15)),
"not": (10, ("not", 10)),
"!": (10, ("not", 10)),
"and": (5, None, ("and", 5)),
"&": (5, None, ("and", 5)),
"or": (4, None, ("or", 4)),
"|": (4, None, ("or", 4)),
"+": (4, None, ("or", 4)),
",": (2, None, ("list", 2)),
")": (0, None, None),
"symbol": (0, ("symbol",), None),
"string": (0, ("string",), None),
"end": (0, None, None),
}
keywords = set(['and', 'or', 'not'])
def tokenize(program):
pos, l = 0, len(program)
while pos < l:
c = program[pos]
if c.isspace(): # skip inter-token whitespace
pass
elif c == ':' and program[pos:pos + 2] == '::': # look ahead carefully
yield ('::', None, pos)
pos += 1 # skip ahead
elif c == '.' and program[pos:pos + 2] == '..': # look ahead carefully
yield ('..', None, pos)
pos += 1 # skip ahead
elif c in "():,-|&+!~^": # handle simple operators
yield (c, None, pos)
elif (c in '"\'' or c == 'r' and
program[pos:pos + 2] in ("r'", 'r"')): # handle quoted strings
if c == 'r':
pos += 1
c = program[pos]
decode = lambda x: x
else:
decode = lambda x: x.decode('string-escape')
pos += 1
s = pos
while pos < l: # find closing quote
d = program[pos]
if d == '\\': # skip over escaped characters
pos += 2
continue
if d == c:
yield ('string', decode(program[s:pos]), s)
break
pos += 1
else:
raise error.ParseError(_("unterminated string"), s)
elif c.isalnum() or c in '._' or ord(c) > 127: # gather up a symbol/keyword
s = pos
pos += 1
while pos < l: # find end of symbol
d = program[pos]
if not (d.isalnum() or d in "._/" or ord(d) > 127):
break
if d == '.' and program[pos - 1] == '.': # special case for ..
pos -= 1
break
pos += 1
sym = program[s:pos]
if sym in keywords: # operator keywords
yield (sym, None, s)
else:
yield ('symbol', sym, s)
pos -= 1
else:
raise error.ParseError(_("syntax error"), pos)
pos += 1
yield ('end', None, pos)
# helpers
def getstring(x, err):
if x and (x[0] == 'string' or x[0] == 'symbol'):
return x[1]
raise error.ParseError(err)
def getlist(x):
if not x:
return []
if x[0] == 'list':
return getlist(x[1]) + [x[2]]
return [x]
def getargs(x, min, max, err):
l = getlist(x)
if len(l) < min or (max >= 0 and len(l) > max):
raise error.ParseError(err)
return l
def getset(repo, subset, x):
if not x:
raise error.ParseError(_("missing argument"))
return methods[x[0]](repo, subset, *x[1:])
# operator methods
def stringset(repo, subset, x):
x = repo[x].rev()
if x == -1 and len(subset) == len(repo):
return [-1]
if len(subset) == len(repo) or x in subset:
return [x]
return []
def symbolset(repo, subset, x):
if x in symbols:
raise error.ParseError(_("can't use %s here") % x)
return stringset(repo, subset, x)
def rangeset(repo, subset, x, y):
m = getset(repo, subset, x)
if not m:
m = getset(repo, range(len(repo)), x)
n = getset(repo, subset, y)
if not n:
n = getset(repo, range(len(repo)), y)
if not m or not n:
return []
m, n = m[0], n[-1]
if m < n:
r = range(m, n + 1)
else:
r = range(m, n - 1, -1)
s = set(subset)
return [x for x in r if x in s]
def andset(repo, subset, x, y):
return getset(repo, getset(repo, subset, x), y)
def orset(repo, subset, x, y):
xl = getset(repo, subset, x)
s = set(xl)
yl = getset(repo, [r for r in subset if r not in s], y)
return xl + yl
def notset(repo, subset, x):
s = set(getset(repo, subset, x))
return [r for r in subset if r not in s]
def listset(repo, subset, a, b):
raise error.ParseError(_("can't use a list in this context"))
def func(repo, subset, a, b):
if a[0] == 'symbol' and a[1] in symbols:
return symbols[a[1]](repo, subset, b)
raise error.ParseError(_("not a function: %s") % a[1])
# functions
def adds(repo, subset, x):
"""``adds(pattern)``
Changesets that add a file matching pattern.
"""
# i18n: "adds" is a keyword
pat = getstring(x, _("adds requires a pattern"))
return checkstatus(repo, subset, pat, 1)
def ancestor(repo, subset, x):
"""``ancestor(single, single)``
Greatest common ancestor of the two changesets.
"""
# i18n: "ancestor" is a keyword
l = getargs(x, 2, 2, _("ancestor requires two arguments"))
r = range(len(repo))
a = getset(repo, r, l[0])
b = getset(repo, r, l[1])
if len(a) != 1 or len(b) != 1:
# i18n: "ancestor" is a keyword
raise error.ParseError(_("ancestor arguments must be single revisions"))
an = [repo[a[0]].ancestor(repo[b[0]]).rev()]
return [r for r in an if r in subset]
def _ancestors(repo, subset, x, followfirst=False):
args = getset(repo, range(len(repo)), x)
if not args:
return []
s = set(_revancestors(repo, args, followfirst)) | set(args)
return [r for r in subset if r in s]
def ancestors(repo, subset, x):
"""``ancestors(set)``
Changesets that are ancestors of a changeset in set.
"""
return _ancestors(repo, subset, x)
def _firstancestors(repo, subset, x):
# ``_firstancestors(set)``
# Like ``ancestors(set)`` but follows only the first parents.
return _ancestors(repo, subset, x, followfirst=True)
def ancestorspec(repo, subset, x, n):
"""``set~n``
Changesets that are the Nth ancestor (first parents only) of a changeset in set.
"""
try:
n = int(n[1])
except (TypeError, ValueError):
raise error.ParseError(_("~ expects a number"))
ps = set()
cl = repo.changelog
for r in getset(repo, subset, x):
for i in range(n):
r = cl.parentrevs(r)[0]
ps.add(r)
return [r for r in subset if r in ps]
def author(repo, subset, x):
"""``author(string)``
Alias for ``user(string)``.
"""
# i18n: "author" is a keyword
n = encoding.lower(getstring(x, _("author requires a string")))
return [r for r in subset if n in encoding.lower(repo[r].user())]
def bisect(repo, subset, x):
"""``bisect(string)``
Changesets marked in the specified bisect status:
- ``good``, ``bad``, ``skip``: csets explicitly marked as good/bad/skip
- ``goods``, ``bads`` : csets topologicaly good/bad
- ``range`` : csets taking part in the bisection
- ``pruned`` : csets that are goods, bads or skipped
- ``untested`` : csets whose fate is yet unknown
- ``ignored`` : csets ignored due to DAG topology
"""
status = getstring(x, _("bisect requires a string")).lower()
state = set(hbisect.get(repo, status))
return [r for r in subset if r in state]
# Backward-compatibility
# - no help entry so that we do not advertise it any more
def bisected(repo, subset, x):
return bisect(repo, subset, x)
def bookmark(repo, subset, x):
"""``bookmark([name])``
The named bookmark or all bookmarks.
"""
# i18n: "bookmark" is a keyword
args = getargs(x, 0, 1, _('bookmark takes one or no arguments'))
if args:
bm = getstring(args[0],
# i18n: "bookmark" is a keyword
_('the argument to bookmark must be a string'))
bmrev = bookmarksmod.listbookmarks(repo).get(bm, None)
if not bmrev:
raise util.Abort(_("bookmark '%s' does not exist") % bm)
bmrev = repo[bmrev].rev()
return [r for r in subset if r == bmrev]
bms = set([repo[r].rev()
for r in bookmarksmod.listbookmarks(repo).values()])
return [r for r in subset if r in bms]
def branch(repo, subset, x):
"""``branch(string or set)``
All changesets belonging to the given branch or the branches of the given
changesets.
"""
try:
b = getstring(x, '')
if b in repo.branchmap():
return [r for r in subset if repo[r].branch() == b]
except error.ParseError:
# not a string, but another revspec, e.g. tip()
pass
s = getset(repo, range(len(repo)), x)
b = set()
for r in s:
b.add(repo[r].branch())
s = set(s)
return [r for r in subset if r in s or repo[r].branch() in b]
def checkstatus(repo, subset, pat, field):
m = None
s = []
hasset = matchmod.patkind(pat) == 'set'
fname = None
for r in subset:
c = repo[r]
if not m or hasset:
m = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=c)
if not m.anypats() and len(m.files()) == 1:
fname = m.files()[0]
if fname is not None:
if fname not in c.files():
continue
else:
for f in c.files():
if m(f):
break
else:
continue
files = repo.status(c.p1().node(), c.node())[field]
if fname is not None:
if fname in files:
s.append(r)
else:
for f in files:
if m(f):
s.append(r)
break
return s
def _children(repo, narrow, parentset):
cs = set()
pr = repo.changelog.parentrevs
for r in narrow:
for p in pr(r):
if p in parentset:
cs.add(r)
return cs
def children(repo, subset, x):
"""``children(set)``
Child changesets of changesets in set.
"""
s = set(getset(repo, range(len(repo)), x))
cs = _children(repo, subset, s)
return [r for r in subset if r in cs]
def closed(repo, subset, x):
"""``closed()``
Changeset is closed.
"""
# i18n: "closed" is a keyword
getargs(x, 0, 0, _("closed takes no arguments"))
return [r for r in subset if repo[r].extra().get('close')]
def contains(repo, subset, x):
"""``contains(pattern)``
Revision contains a file matching pattern. See :hg:`help patterns`
for information about file patterns.
"""
# i18n: "contains" is a keyword
pat = getstring(x, _("contains requires a pattern"))
m = None
s = []
if not matchmod.patkind(pat):
for r in subset:
if pat in repo[r]:
s.append(r)
else:
for r in subset:
c = repo[r]
if not m or matchmod.patkind(pat) == 'set':
m = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=c)
for f in c.manifest():
if m(f):
s.append(r)
break
return s
def date(repo, subset, x):
"""``date(interval)``
Changesets within the interval, see :hg:`help dates`.
"""
# i18n: "date" is a keyword
ds = getstring(x, _("date requires a string"))
dm = util.matchdate(ds)
return [r for r in subset if dm(repo[r].date()[0])]
def desc(repo, subset, x):
"""``desc(string)``
Search commit message for string. The match is case-insensitive.
"""
# i18n: "desc" is a keyword
ds = encoding.lower(getstring(x, _("desc requires a string")))
l = []
for r in subset:
c = repo[r]
if ds in encoding.lower(c.description()):
l.append(r)
return l
def _descendants(repo, subset, x, followfirst=False):
args = getset(repo, range(len(repo)), x)
if not args:
return []
s = set(_revdescendants(repo, args, followfirst)) | set(args)
return [r for r in subset if r in s]
def descendants(repo, subset, x):
"""``descendants(set)``
Changesets which are descendants of changesets in set.
"""
return _descendants(repo, subset, x)
def _firstdescendants(repo, subset, x):
# ``_firstdescendants(set)``
# Like ``descendants(set)`` but follows only the first parents.
return _descendants(repo, subset, x, followfirst=True)
def draft(repo, subset, x):
"""``draft()``
Changeset in draft phase."""
getargs(x, 0, 0, _("draft takes no arguments"))
return [r for r in subset if repo._phaserev[r] == phases.draft]
def filelog(repo, subset, x):
"""``filelog(pattern)``
Changesets connected to the specified filelog.
"""
pat = getstring(x, _("filelog requires a pattern"))
m = matchmod.match(repo.root, repo.getcwd(), [pat], default='relpath',
ctx=repo[None])
s = set()
if not matchmod.patkind(pat):
for f in m.files():
fl = repo.file(f)
for fr in fl:
s.add(fl.linkrev(fr))
else:
for f in repo[None]:
if m(f):
fl = repo.file(f)
for fr in fl:
s.add(fl.linkrev(fr))
return [r for r in subset if r in s]
def first(repo, subset, x):
"""``first(set, [n])``
An alias for limit().
"""
return limit(repo, subset, x)
def _follow(repo, subset, x, name, followfirst=False):
l = getargs(x, 0, 1, _("%s takes no arguments or a filename") % name)
c = repo['.']
if l:
x = getstring(l[0], _("%s expected a filename") % name)
if x in c:
cx = c[x]
s = set(ctx.rev() for ctx in cx.ancestors(followfirst=followfirst))
# include the revision responsible for the most recent version
s.add(cx.linkrev())
else:
return []
else:
s = set(_revancestors(repo, [c.rev()], followfirst)) | set([c.rev()])
return [r for r in subset if r in s]
def follow(repo, subset, x):
"""``follow([file])``
An alias for ``::.`` (ancestors of the working copy's first parent).
If a filename is specified, the history of the given file is followed,
including copies.
"""
return _follow(repo, subset, x, 'follow')
def _followfirst(repo, subset, x):
# ``followfirst([file])``
# Like ``follow([file])`` but follows only the first parent of
# every revision or file revision.
return _follow(repo, subset, x, '_followfirst', followfirst=True)
def getall(repo, subset, x):
"""``all()``
All changesets, the same as ``0:tip``.
"""
# i18n: "all" is a keyword
getargs(x, 0, 0, _("all takes no arguments"))
return subset
def grep(repo, subset, x):
"""``grep(regex)``
Like ``keyword(string)`` but accepts a regex. Use ``grep(r'...')``
to ensure special escape characters are handled correctly. Unlike
``keyword(string)``, the match is case-sensitive.
"""
try:
# i18n: "grep" is a keyword
gr = re.compile(getstring(x, _("grep requires a string")))
except re.error, e:
raise error.ParseError(_('invalid match pattern: %s') % e)
l = []
for r in subset:
c = repo[r]
for e in c.files() + [c.user(), c.description()]:
if gr.search(e):
l.append(r)
break
return l
def _matchfiles(repo, subset, x):
# _matchfiles takes a revset list of prefixed arguments:
#
# [p:foo, i:bar, x:baz]
#
# builds a match object from them and filters subset. Allowed
# prefixes are 'p:' for regular patterns, 'i:' for include
# patterns and 'x:' for exclude patterns. Use 'r:' prefix to pass
# a revision identifier, or the empty string to reference the
# working directory, from which the match object is
# initialized. Use 'd:' to set the default matching mode, default
# to 'glob'. At most one 'r:' and 'd:' argument can be passed.
# i18n: "_matchfiles" is a keyword
l = getargs(x, 1, -1, _("_matchfiles requires at least one argument"))
pats, inc, exc = [], [], []
hasset = False
rev, default = None, None
for arg in l:
s = getstring(arg, _("_matchfiles requires string arguments"))
prefix, value = s[:2], s[2:]
if prefix == 'p:':
pats.append(value)
elif prefix == 'i:':
inc.append(value)
elif prefix == 'x:':
exc.append(value)
elif prefix == 'r:':
if rev is not None:
raise error.ParseError(_('_matchfiles expected at most one '
'revision'))
rev = value
elif prefix == 'd:':
if default is not None:
raise error.ParseError(_('_matchfiles expected at most one '
'default mode'))
default = value
else:
raise error.ParseError(_('invalid _matchfiles prefix: %s') % prefix)
if not hasset and matchmod.patkind(value) == 'set':
hasset = True
if not default:
default = 'glob'
m = None
s = []
for r in subset:
c = repo[r]
if not m or (hasset and rev is None):
ctx = c
if rev is not None:
ctx = repo[rev or None]
m = matchmod.match(repo.root, repo.getcwd(), pats, include=inc,
exclude=exc, ctx=ctx, default=default)
for f in c.files():
if m(f):
s.append(r)
break
return s
def hasfile(repo, subset, x):
"""``file(pattern)``
Changesets affecting files matched by pattern.
"""
# i18n: "file" is a keyword
pat = getstring(x, _("file requires a pattern"))
return _matchfiles(repo, subset, ('string', 'p:' + pat))
def head(repo, subset, x):
"""``head()``
Changeset is a named branch head.
"""
# i18n: "head" is a keyword
getargs(x, 0, 0, _("head takes no arguments"))
hs = set()
for b, ls in repo.branchmap().iteritems():
hs.update(repo[h].rev() for h in ls)
return [r for r in subset if r in hs]
def heads(repo, subset, x):
"""``heads(set)``
Members of set with no children in set.
"""
s = getset(repo, subset, x)
ps = set(parents(repo, subset, x))
return [r for r in s if r not in ps]
def keyword(repo, subset, x):
"""``keyword(string)``
Search commit message, user name, and names of changed files for
string. The match is case-insensitive.
"""
# i18n: "keyword" is a keyword
kw = encoding.lower(getstring(x, _("keyword requires a string")))
l = []
for r in subset:
c = repo[r]
t = " ".join(c.files() + [c.user(), c.description()])
if kw in encoding.lower(t):
l.append(r)
return l
def limit(repo, subset, x):
"""``limit(set, [n])``
First n members of set, defaulting to 1.
"""
# i18n: "limit" is a keyword
l = getargs(x, 1, 2, _("limit requires one or two arguments"))
try:
lim = 1
if len(l) == 2:
# i18n: "limit" is a keyword
lim = int(getstring(l[1], _("limit requires a number")))
except (TypeError, ValueError):
# i18n: "limit" is a keyword
raise error.ParseError(_("limit expects a number"))
ss = set(subset)
os = getset(repo, range(len(repo)), l[0])[:lim]
return [r for r in os if r in ss]
def last(repo, subset, x):
"""``last(set, [n])``
Last n members of set, defaulting to 1.
"""
# i18n: "last" is a keyword
l = getargs(x, 1, 2, _("last requires one or two arguments"))
try:
lim = 1
if len(l) == 2:
# i18n: "last" is a keyword
lim = int(getstring(l[1], _("last requires a number")))
except (TypeError, ValueError):
# i18n: "last" is a keyword
raise error.ParseError(_("last expects a number"))
ss = set(subset)
os = getset(repo, range(len(repo)), l[0])[-lim:]
return [r for r in os if r in ss]
def maxrev(repo, subset, x):
"""``max(set)``
Changeset with highest revision number in set.
"""
os = getset(repo, range(len(repo)), x)
if os:
m = max(os)
if m in subset:
return [m]
return []
def merge(repo, subset, x):
"""``merge()``
Changeset is a merge changeset.
"""
# i18n: "merge" is a keyword
getargs(x, 0, 0, _("merge takes no arguments"))
cl = repo.changelog
return [r for r in subset if cl.parentrevs(r)[1] != -1]
def minrev(repo, subset, x):
"""``min(set)``
Changeset with lowest revision number in set.
"""
os = getset(repo, range(len(repo)), x)
if os:
m = min(os)
if m in subset:
return [m]
return []
def modifies(repo, subset, x):
"""``modifies(pattern)``
Changesets modifying files matched by pattern.
"""
# i18n: "modifies" is a keyword
pat = getstring(x, _("modifies requires a pattern"))
return checkstatus(repo, subset, pat, 0)
def node_(repo, subset, x):
"""``id(string)``
Revision non-ambiguously specified by the given hex string prefix.
"""
# i18n: "id" is a keyword
l = getargs(x, 1, 1, _("id requires one argument"))
# i18n: "id" is a keyword
n = getstring(l[0], _("id requires a string"))
if len(n) == 40:
rn = repo[n].rev()
else:
rn = None
pm = repo.changelog._partialmatch(n)
if pm is not None:
rn = repo.changelog.rev(pm)
return [r for r in subset if r == rn]
def outgoing(repo, subset, x):
"""``outgoing([path])``
Changesets not found in the specified destination repository, or the
default push location.
"""
import hg # avoid start-up nasties
# i18n: "outgoing" is a keyword
l = getargs(x, 0, 1, _("outgoing takes one or no arguments"))
# i18n: "outgoing" is a keyword
dest = l and getstring(l[0], _("outgoing requires a repository path")) or ''
dest = repo.ui.expandpath(dest or 'default-push', dest or 'default')
dest, branches = hg.parseurl(dest)
revs, checkout = hg.addbranchrevs(repo, repo, branches, [])
if revs:
revs = [repo.lookup(rev) for rev in revs]
other = hg.peer(repo, {}, dest)
repo.ui.pushbuffer()
outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs)
repo.ui.popbuffer()
cl = repo.changelog
o = set([cl.rev(r) for r in outgoing.missing])
return [r for r in subset if r in o]
def p1(repo, subset, x):
"""``p1([set])``
First parent of changesets in set, or the working directory.
"""
if x is None:
p = repo[x].p1().rev()
return [r for r in subset if r == p]
ps = set()
cl = repo.changelog
for r in getset(repo, range(len(repo)), x):
ps.add(cl.parentrevs(r)[0])
return [r for r in subset if r in ps]
def p2(repo, subset, x):
"""``p2([set])``
Second parent of changesets in set, or the working directory.
"""
if x is None:
ps = repo[x].parents()
try:
p = ps[1].rev()
return [r for r in subset if r == p]
except IndexError:
return []
ps = set()
cl = repo.changelog
for r in getset(repo, range(len(repo)), x):
ps.add(cl.parentrevs(r)[1])
return [r for r in subset if r in ps]
def parents(repo, subset, x):
"""``parents([set])``
The set of all parents for all changesets in set, or the working directory.
"""
if x is None:
ps = tuple(p.rev() for p in repo[x].parents())
return [r for r in subset if r in ps]
ps = set()
cl = repo.changelog
for r in getset(repo, range(len(repo)), x):
ps.update(cl.parentrevs(r))
return [r for r in subset if r in ps]
def parentspec(repo, subset, x, n):
"""``set^0``
The set.
``set^1`` (or ``set^``), ``set^2``
First or second parent, respectively, of all changesets in set.
"""
try:
n = int(n[1])
if n not in (0, 1, 2):
raise ValueError
except (TypeError, ValueError):
raise error.ParseError(_("^ expects a number 0, 1, or 2"))
ps = set()
cl = repo.changelog
for r in getset(repo, subset, x):
if n == 0:
ps.add(r)
elif n == 1:
ps.add(cl.parentrevs(r)[0])
elif n == 2:
parents = cl.parentrevs(r)
if len(parents) > 1:
ps.add(parents[1])
return [r for r in subset if r in ps]
def present(repo, subset, x):
"""``present(set)``
An empty set, if any revision in set isn't found; otherwise,
all revisions in set.
If any of specified revisions is not present in the local repository,
the query is normally aborted. But this predicate allows the query
to continue even in such cases.
"""
try:
return getset(repo, subset, x)
except error.RepoLookupError:
return []
def public(repo, subset, x):
"""``public()``
Changeset in public phase."""
getargs(x, 0, 0, _("public takes no arguments"))
return [r for r in subset if repo._phaserev[r] == phases.public]
def remote(repo, subset, x):
"""``remote([id [,path]])``
Local revision that corresponds to the given identifier in a
remote repository, if present. Here, the '.' identifier is a
synonym for the current local branch.
"""
import hg # avoid start-up nasties
# i18n: "remote" is a keyword
l = getargs(x, 0, 2, _("remote takes one, two or no arguments"))
q = '.'
if len(l) > 0:
# i18n: "remote" is a keyword
q = getstring(l[0], _("remote requires a string id"))
if q == '.':
q = repo['.'].branch()
dest = ''
if len(l) > 1:
# i18n: "remote" is a keyword
dest = getstring(l[1], _("remote requires a repository path"))
dest = repo.ui.expandpath(dest or 'default')
dest, branches = hg.parseurl(dest)
revs, checkout = hg.addbranchrevs(repo, repo, branches, [])
if revs:
revs = [repo.lookup(rev) for rev in revs]
other = hg.peer(repo, {}, dest)
n = other.lookup(q)
if n in repo:
r = repo[n].rev()
if r in subset:
return [r]
return []
def removes(repo, subset, x):
"""``removes(pattern)``
Changesets which remove files matching pattern.
"""
# i18n: "removes" is a keyword
pat = getstring(x, _("removes requires a pattern"))
return checkstatus(repo, subset, pat, 2)
def rev(repo, subset, x):
"""``rev(number)``
Revision with the given numeric identifier.
"""
# i18n: "rev" is a keyword
l = getargs(x, 1, 1, _("rev requires one argument"))
try:
# i18n: "rev" is a keyword
l = int(getstring(l[0], _("rev requires a number")))
except (TypeError, ValueError):
# i18n: "rev" is a keyword
raise error.ParseError(_("rev expects a number"))
return [r for r in subset if r == l]
def matching(repo, subset, x):
"""``matching(revision [, field])``
Changesets in which a given set of fields match the set of fields in the
selected revision or set.
To match more than one field pass the list of fields to match separated
by spaces (e.g. ``author description``).
Valid fields are most regular revision fields and some special fields.
Regular revision fields are ``description``, ``author``, ``branch``,
``date``, ``files``, ``phase``, ``parents``, ``substate`` and ``user``.
Note that ``author`` and ``user`` are synonyms.
Special fields are ``summary`` and ``metadata``:
``summary`` matches the first line of the description.
``metadata`` is equivalent to matching ``description user date``
(i.e. it matches the main metadata fields).
``metadata`` is the default field which is used when no fields are
specified. You can match more than one field at a time.
"""
l = getargs(x, 1, 2, _("matching takes 1 or 2 arguments"))
revs = getset(repo, xrange(len(repo)), l[0])
fieldlist = ['metadata']
if len(l) > 1:
fieldlist = getstring(l[1],
_("matching requires a string "
"as its second argument")).split()
# Make sure that there are no repeated fields, and expand the
# 'special' 'metadata' field type
fields = []
for field in fieldlist:
if field == 'metadata':
fields += ['user', 'description', 'date']
else:
if field == 'author':
field = 'user'
fields.append(field)
fields = set(fields)
if 'summary' in fields and 'description' in fields:
# If a revision matches its description it also matches its summary
fields.discard('summary')
# We may want to match more than one field
# Not all fields take the same amount of time to be matched
# Sort the selected fields in order of increasing matching cost
fieldorder = ['phase', 'parents', 'user', 'date', 'branch', 'summary',
'files', 'description', 'substate']
def fieldkeyfunc(f):
try:
return fieldorder.index(f)
except ValueError:
# assume an unknown field is very costly
return len(fieldorder)
fields = list(fields)
fields.sort(key=fieldkeyfunc)
# Each field will be matched with its own "getfield" function
# which will be added to the getfieldfuncs array of functions
getfieldfuncs = []
_funcs = {
'user': lambda r: repo[r].user(),
'branch': lambda r: repo[r].branch(),
'date': lambda r: repo[r].date(),
'description': lambda r: repo[r].description(),
'files': lambda r: repo[r].files(),
'parents': lambda r: repo[r].parents(),
'phase': lambda r: repo[r].phase(),
'substate': lambda r: repo[r].substate,
'summary': lambda r: repo[r].description().splitlines()[0],
}
for info in fields:
getfield = _funcs.get(info, None)
if getfield is None:
raise error.ParseError(
_("unexpected field name passed to matching: %s") % info)
getfieldfuncs.append(getfield)
# convert the getfield array of functions into a "getinfo" function
# which returns an array of field values (or a single value if there
# is only one field to match)
getinfo = lambda r: [f(r) for f in getfieldfuncs]
matches = set()
for rev in revs:
target = getinfo(rev)
for r in subset:
match = True
for n, f in enumerate(getfieldfuncs):
if target[n] != f(r):
match = False
break
if match:
matches.add(r)
return [r for r in subset if r in matches]
def reverse(repo, subset, x):
"""``reverse(set)``
Reverse order of set.
"""
l = getset(repo, subset, x)
l.reverse()
return l
def roots(repo, subset, x):
"""``roots(set)``
Changesets in set with no parent changeset in set.
"""
s = set(getset(repo, xrange(len(repo)), x))
subset = [r for r in subset if r in s]
cs = _children(repo, subset, s)
return [r for r in subset if r not in cs]
def secret(repo, subset, x):
"""``secret()``
Changeset in secret phase."""
getargs(x, 0, 0, _("secret takes no arguments"))
return [r for r in subset if repo._phaserev[r] == phases.secret]
def sort(repo, subset, x):
"""``sort(set[, [-]key...])``
Sort set by keys. The default sort order is ascending, specify a key
as ``-key`` to sort in descending order.
The keys can be:
- ``rev`` for the revision number,
- ``branch`` for the branch name,
- ``desc`` for the commit message (description),
- ``user`` for user name (``author`` can be used as an alias),
- ``date`` for the commit date
"""
# i18n: "sort" is a keyword
l = getargs(x, 1, 2, _("sort requires one or two arguments"))
keys = "rev"
if len(l) == 2:
keys = getstring(l[1], _("sort spec must be a string"))
s = l[0]
keys = keys.split()
l = []
def invert(s):
return "".join(chr(255 - ord(c)) for c in s)
for r in getset(repo, subset, s):
c = repo[r]
e = []
for k in keys:
if k == 'rev':
e.append(r)
elif k == '-rev':
e.append(-r)
elif k == 'branch':
e.append(c.branch())
elif k == '-branch':
e.append(invert(c.branch()))
elif k == 'desc':
e.append(c.description())
elif k == '-desc':
e.append(invert(c.description()))
elif k in 'user author':
e.append(c.user())
elif k in '-user -author':
e.append(invert(c.user()))
elif k == 'date':
e.append(c.date()[0])
elif k == '-date':
e.append(-c.date()[0])
else:
raise error.ParseError(_("unknown sort key %r") % k)
e.append(r)
l.append(e)
l.sort()
return [e[-1] for e in l]
def tag(repo, subset, x):
"""``tag([name])``
The specified tag by name, or all tagged revisions if no name is given.
"""
# i18n: "tag" is a keyword
args = getargs(x, 0, 1, _("tag takes one or no arguments"))
cl = repo.changelog
if args:
tn = getstring(args[0],
# i18n: "tag" is a keyword
_('the argument to tag must be a string'))
if not repo.tags().get(tn, None):
raise util.Abort(_("tag '%s' does not exist") % tn)
s = set([cl.rev(n) for t, n in repo.tagslist() if t == tn])
else:
s = set([cl.rev(n) for t, n in repo.tagslist() if t != 'tip'])
return [r for r in subset if r in s]
def tagged(repo, subset, x):
return tag(repo, subset, x)
def user(repo, subset, x):
"""``user(string)``
User name contains string. The match is case-insensitive.
"""
return author(repo, subset, x)
# for internal use
def _list(repo, subset, x):
s = getstring(x, "internal error")
if not s:
return []
if not isinstance(subset, set):
subset = set(subset)
ls = [repo[r].rev() for r in s.split('\0')]
return [r for r in ls if r in subset]
symbols = {
"adds": adds,
"all": getall,
"ancestor": ancestor,
"ancestors": ancestors,
"_firstancestors": _firstancestors,
"author": author,
"bisect": bisect,
"bisected": bisected,
"bookmark": bookmark,
"branch": branch,
"children": children,
"closed": closed,
"contains": contains,
"date": date,
"desc": desc,
"descendants": descendants,
"_firstdescendants": _firstdescendants,
"draft": draft,
"file": hasfile,
"filelog": filelog,
"first": first,
"follow": follow,
"_followfirst": _followfirst,
"grep": grep,
"head": head,
"heads": heads,
"id": node_,
"keyword": keyword,
"last": last,
"limit": limit,
"_matchfiles": _matchfiles,
"max": maxrev,
"merge": merge,
"min": minrev,
"modifies": modifies,
"outgoing": outgoing,
"p1": p1,
"p2": p2,
"parents": parents,
"present": present,
"public": public,
"remote": remote,
"removes": removes,
"rev": rev,
"reverse": reverse,
"roots": roots,
"sort": sort,
"secret": secret,
"matching": matching,
"tag": tag,
"tagged": tagged,
"user": user,
"_list": _list,
}
methods = {
"range": rangeset,
"string": stringset,
"symbol": symbolset,
"and": andset,
"or": orset,
"not": notset,
"list": listset,
"func": func,
"ancestor": ancestorspec,
"parent": parentspec,
"parentpost": p1,
}
def optimize(x, small):
if x is None:
return 0, x
smallbonus = 1
if small:
smallbonus = .5
op = x[0]
if op == 'minus':
return optimize(('and', x[1], ('not', x[2])), small)
elif op == 'dagrange':
return optimize(('and', ('func', ('symbol', 'descendants'), x[1]),
('func', ('symbol', 'ancestors'), x[2])), small)
elif op == 'dagrangepre':
return optimize(('func', ('symbol', 'ancestors'), x[1]), small)
elif op == 'dagrangepost':
return optimize(('func', ('symbol', 'descendants'), x[1]), small)
elif op == 'rangepre':
return optimize(('range', ('string', '0'), x[1]), small)
elif op == 'rangepost':
return optimize(('range', x[1], ('string', 'tip')), small)
elif op == 'negate':
return optimize(('string',
'-' + getstring(x[1], _("can't negate that"))), small)
elif op in 'string symbol negate':
return smallbonus, x # single revisions are small
elif op == 'and' or op == 'dagrange':
wa, ta = optimize(x[1], True)
wb, tb = optimize(x[2], True)
w = min(wa, wb)
if wa > wb:
return w, (op, tb, ta)
return w, (op, ta, tb)
elif op == 'or':
wa, ta = optimize(x[1], False)
wb, tb = optimize(x[2], False)
if wb < wa:
wb, wa = wa, wb
return max(wa, wb), (op, ta, tb)
elif op == 'not':
o = optimize(x[1], not small)
return o[0], (op, o[1])
elif op == 'parentpost':
o = optimize(x[1], small)
return o[0], (op, o[1])
elif op == 'group':
return optimize(x[1], small)
elif op in 'range list parent ancestorspec':
if op == 'parent':
# x^:y means (x^) : y, not x ^ (:y)
post = ('parentpost', x[1])
if x[2][0] == 'dagrangepre':
return optimize(('dagrange', post, x[2][1]), small)
elif x[2][0] == 'rangepre':
return optimize(('range', post, x[2][1]), small)
wa, ta = optimize(x[1], small)
wb, tb = optimize(x[2], small)
return wa + wb, (op, ta, tb)
elif op == 'func':
f = getstring(x[1], _("not a symbol"))
wa, ta = optimize(x[2], small)
if f in ("author branch closed date desc file grep keyword "
"outgoing user"):
w = 10 # slow
elif f in "modifies adds removes":
w = 30 # slower
elif f == "contains":
w = 100 # very slow
elif f == "ancestor":
w = 1 * smallbonus
elif f in "reverse limit first":
w = 0
elif f in "sort":
w = 10 # assume most sorts look at changelog
else:
w = 1
return w + wa, (op, x[1], ta)
return 1, x
_aliasarg = ('func', ('symbol', '_aliasarg'))
def _getaliasarg(tree):
"""If tree matches ('func', ('symbol', '_aliasarg'), ('string', X))
return X, None otherwise.
"""
if (len(tree) == 3 and tree[:2] == _aliasarg
and tree[2][0] == 'string'):
return tree[2][1]
return None
def _checkaliasarg(tree, known=None):
"""Check tree contains no _aliasarg construct or only ones which
value is in known. Used to avoid alias placeholders injection.
"""
if isinstance(tree, tuple):
arg = _getaliasarg(tree)
if arg is not None and (not known or arg not in known):
raise error.ParseError(_("not a function: %s") % '_aliasarg')
for t in tree:
_checkaliasarg(t, known)
class revsetalias(object):
funcre = re.compile('^([^(]+)\(([^)]+)\)$')
args = None
def __init__(self, name, value):
'''Aliases like:
h = heads(default)
b($1) = ancestors($1) - ancestors(default)
'''
m = self.funcre.search(name)
if m:
self.name = m.group(1)
self.tree = ('func', ('symbol', m.group(1)))
self.args = [x.strip() for x in m.group(2).split(',')]
for arg in self.args:
# _aliasarg() is an unknown symbol only used separate
# alias argument placeholders from regular strings.
value = value.replace(arg, '_aliasarg(%r)' % (arg,))
else:
self.name = name
self.tree = ('symbol', name)
self.replacement, pos = parse(value)
if pos != len(value):
raise error.ParseError(_('invalid token'), pos)
# Check for placeholder injection
_checkaliasarg(self.replacement, self.args)
def _getalias(aliases, tree):
"""If tree looks like an unexpanded alias, return it. Return None
otherwise.
"""
if isinstance(tree, tuple) and tree:
if tree[0] == 'symbol' and len(tree) == 2:
name = tree[1]
alias = aliases.get(name)
if alias and alias.args is None and alias.tree == tree:
return alias
if tree[0] == 'func' and len(tree) > 1:
if tree[1][0] == 'symbol' and len(tree[1]) == 2:
name = tree[1][1]
alias = aliases.get(name)
if alias and alias.args is not None and alias.tree == tree[:2]:
return alias
return None
def _expandargs(tree, args):
"""Replace _aliasarg instances with the substitution value of the
same name in args, recursively.
"""
if not tree or not isinstance(tree, tuple):
return tree
arg = _getaliasarg(tree)
if arg is not None:
return args[arg]
return tuple(_expandargs(t, args) for t in tree)
def _expandaliases(aliases, tree, expanding):
"""Expand aliases in tree, recursively.
'aliases' is a dictionary mapping user defined aliases to
revsetalias objects.
"""
if not isinstance(tree, tuple):
# Do not expand raw strings
return tree
alias = _getalias(aliases, tree)
if alias is not None:
if alias in expanding:
raise error.ParseError(_('infinite expansion of revset alias "%s" '
'detected') % alias.name)
expanding.append(alias)
result = _expandaliases(aliases, alias.replacement, expanding)
expanding.pop()
if alias.args is not None:
l = getlist(tree[2])
if len(l) != len(alias.args):
raise error.ParseError(
_('invalid number of arguments: %s') % len(l))
l = [_expandaliases(aliases, a, []) for a in l]
result = _expandargs(result, dict(zip(alias.args, l)))
else:
result = tuple(_expandaliases(aliases, t, expanding)
for t in tree)
return result
def findaliases(ui, tree):
_checkaliasarg(tree)
aliases = {}
for k, v in ui.configitems('revsetalias'):
alias = revsetalias(k, v)
aliases[alias.name] = alias
return _expandaliases(aliases, tree, [])
parse = parser.parser(tokenize, elements).parse
def match(ui, spec):
if not spec:
raise error.ParseError(_("empty query"))
tree, pos = parse(spec)
if (pos != len(spec)):
raise error.ParseError(_("invalid token"), pos)
if ui:
tree = findaliases(ui, tree)
weight, tree = optimize(tree, True)
def mfunc(repo, subset):
return getset(repo, subset, tree)
return mfunc
def formatspec(expr, *args):
'''
This is a convenience function for using revsets internally, and
escapes arguments appropriately. Aliases are intentionally ignored
so that intended expression behavior isn't accidentally subverted.
Supported arguments:
%r = revset expression, parenthesized
%d = int(arg), no quoting
%s = string(arg), escaped and single-quoted
%b = arg.branch(), escaped and single-quoted
%n = hex(arg), single-quoted
%% = a literal '%'
Prefixing the type with 'l' specifies a parenthesized list of that type.
>>> formatspec('%r:: and %lr', '10 or 11', ("this()", "that()"))
'(10 or 11):: and ((this()) or (that()))'
>>> formatspec('%d:: and not %d::', 10, 20)
'10:: and not 20::'
>>> formatspec('%ld or %ld', [], [1])
"_list('') or 1"
>>> formatspec('keyword(%s)', 'foo\\xe9')
"keyword('foo\\\\xe9')"
>>> b = lambda: 'default'
>>> b.branch = b
>>> formatspec('branch(%b)', b)
"branch('default')"
>>> formatspec('root(%ls)', ['a', 'b', 'c', 'd'])
"root(_list('a\\x00b\\x00c\\x00d'))"
'''
def quote(s):
return repr(str(s))
def argtype(c, arg):
if c == 'd':
return str(int(arg))
elif c == 's':
return quote(arg)
elif c == 'r':
parse(arg) # make sure syntax errors are confined
return '(%s)' % arg
elif c == 'n':
return quote(node.hex(arg))
elif c == 'b':
return quote(arg.branch())
def listexp(s, t):
l = len(s)
if l == 0:
return "_list('')"
elif l == 1:
return argtype(t, s[0])
elif t == 'd':
return "_list('%s')" % "\0".join(str(int(a)) for a in s)
elif t == 's':
return "_list('%s')" % "\0".join(s)
elif t == 'n':
return "_list('%s')" % "\0".join(node.hex(a) for a in s)
elif t == 'b':
return "_list('%s')" % "\0".join(a.branch() for a in s)
m = l // 2
return '(%s or %s)' % (listexp(s[:m], t), listexp(s[m:], t))
ret = ''
pos = 0
arg = 0
while pos < len(expr):
c = expr[pos]
if c == '%':
pos += 1
d = expr[pos]
if d == '%':
ret += d
elif d in 'dsnbr':
ret += argtype(d, args[arg])
arg += 1
elif d == 'l':
# a list of some type
pos += 1
d = expr[pos]
ret += listexp(list(args[arg]), d)
arg += 1
else:
raise util.Abort('unexpected revspec format character %s' % d)
else:
ret += c
pos += 1
return ret
def prettyformat(tree):
def _prettyformat(tree, level, lines):
if not isinstance(tree, tuple) or tree[0] in ('string', 'symbol'):
lines.append((level, str(tree)))
else:
lines.append((level, '(%s' % tree[0]))
for s in tree[1:]:
_prettyformat(s, level + 1, lines)
lines[-1:] = [(lines[-1][0], lines[-1][1] + ')')]
lines = []
_prettyformat(tree, 0, lines)
output = '\n'.join((' '*l + s) for l, s in lines)
return output
# tell hggettext to extract docstrings from these functions:
i18nfunctions = symbols.values()
|
mikel-egana-aranguren/SADI-Galaxy-Docker
|
galaxy-dist/eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/revset.py
|
Python
|
gpl-3.0
| 48,655
|
[
"VisIt"
] |
69c3ab59ea9ffe266734ec9ab97f221e539996a410f569f6c2c8088f587100bd
|
##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2015 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors: Kyle A Beauchamp, Jason Swails
#
# MDTraj 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 MDTraj. If not, see <http://www.gnu.org/licenses/>.
##############################################################################
##############################################################################
# Imports
##############################################################################
from __future__ import print_function, division
import numpy as np
from mdtraj.utils import ensure_type
from mdtraj.utils.six.moves import range
from mdtraj.geometry import _geometry
__all__ = ['compute_distances', 'compute_displacements',
'compute_center_of_mass', 'find_closest_contact']
##############################################################################
# Functions
##############################################################################
def compute_distances(traj, atom_pairs, periodic=True, opt=True):
"""Compute the distances between pairs of atoms in each frame.
Parameters
----------
traj : Trajectory
An mtraj trajectory.
atom_pairs : np.ndarray, shape=(num_pairs, 2), dtype=int
Each row gives the indices of two atoms involved in the interaction.
periodic : bool, default=True
If `periodic` is True and the trajectory contains unitcell
information, we will compute distances under the minimum image
convention.
opt : bool, default=True
Use an optimized native library to calculate distances. Our optimized
SSE minimum image convention calculation implementation is over 1000x
faster than the naive numpy implementation.
Returns
-------
distances : np.ndarray, shape=(n_frames, num_pairs), dtype=float
The distance, in each frame, between each pair of atoms.
"""
xyz = ensure_type(traj.xyz, dtype=np.float32, ndim=3, name='traj.xyz', shape=(None, None, 3), warn_on_cast=False)
pairs = ensure_type(atom_pairs, dtype=np.int32, ndim=2, name='atom_pairs', shape=(None, 2), warn_on_cast=False)
if not np.all(np.logical_and(pairs < traj.n_atoms, pairs >= 0)):
raise ValueError('atom_pairs must be between 0 and %d' % traj.n_atoms)
if len(pairs) == 0:
return np.zeros((len(xyz), 0), dtype=np.float32)
if periodic and traj._have_unitcell:
box = ensure_type(traj.unitcell_vectors, dtype=np.float32, ndim=3, name='unitcell_vectors', shape=(len(xyz), 3, 3),
warn_on_cast=False)
orthogonal = np.allclose(traj.unitcell_angles, 90)
if opt:
out = np.empty((xyz.shape[0], pairs.shape[0]), dtype=np.float32)
_geometry._dist_mic(xyz, pairs, box.transpose(0, 2, 1).copy(), out, orthogonal)
return out
else:
return _distance_mic(xyz, pairs, box.transpose(0, 2, 1), orthogonal)
# either there are no unitcell vectors or they dont want to use them
if opt:
out = np.empty((xyz.shape[0], pairs.shape[0]), dtype=np.float32)
_geometry._dist(xyz, pairs, out)
return out
else:
return _distance(xyz, pairs)
def compute_displacements(traj, atom_pairs, periodic=True, opt=True):
"""Compute the displacement vector between pairs of atoms in each frame of a trajectory.
Parameters
----------
traj : Trajectory
Trajectory to compute distances in
atom_pairs : np.ndarray, shape[num_pairs, 2], dtype=int
Each row gives the indices of two atoms.
periodic : bool, default=True
If `periodic` is True and the trajectory contains unitcell
information, we will compute distances under the minimum image
convention.
opt : bool, default=True
Use an optimized native library to calculate distances. Our
optimized minimum image convention calculation implementation is
over 1000x faster than the naive numpy implementation.
Returns
-------
displacements : np.ndarray, shape=[n_frames, n_pairs, 3], dtype=float32
The displacememt vector, in each frame, between each pair of atoms.
"""
xyz = ensure_type(traj.xyz, dtype=np.float32, ndim=3, name='traj.xyz', shape=(None, None, 3), warn_on_cast=False)
pairs = ensure_type(np.asarray(atom_pairs), dtype=np.int32, ndim=2, name='atom_pairs', shape=(None, 2), warn_on_cast=False)
if not np.all(np.logical_and(pairs < traj.n_atoms, pairs >= 0)):
raise ValueError('atom_pairs must be between 0 and %d' % traj.n_atoms)
if periodic and traj._have_unitcell:
box = ensure_type(traj.unitcell_vectors, dtype=np.float32, ndim=3, name='unitcell_vectors', shape=(len(xyz), 3, 3),
warn_on_cast=False)
orthogonal = np.allclose(traj.unitcell_angles, 90)
if opt:
out = np.empty((xyz.shape[0], pairs.shape[0], 3), dtype=np.float32)
_geometry._dist_mic_displacement(xyz, pairs, box.transpose(0, 2, 1).copy(), out, orthogonal)
return out
else:
return _displacement_mic(xyz, pairs, box.transpose(0, 2, 1), orthogonal)
# either there are no unitcell vectors or they dont want to use them
if opt:
out = np.empty((xyz.shape[0], pairs.shape[0], 3), dtype=np.float32)
_geometry._dist_displacement(xyz, pairs, out)
return out
return _displacement(xyz, pairs)
def compute_center_of_mass(traj):
"""Compute the center of mass for each frame.
Parameters
----------
traj : Trajectory
Trajectory to compute center of mass for
Returns
-------
com : np.ndarray, shape=(n_frames, 3)
Coordinates of the center of mass for each frame
"""
com = np.zeros((traj.n_frames, 3))
masses = np.array([a.element.mass for a in traj.top.atoms])
masses /= masses.sum()
for i, x in enumerate(traj.xyz):
com[i, :] = x.astype('float64').T.dot(masses)
return com
def find_closest_contact(traj, group1, group2, frame=0, periodic=True):
"""Find the closest contact between two groups of atoms.
Given a frame of a Trajectory and two groups of atoms, identify the pair of
atoms (one from each group) that form the closest contact between the two groups.
Parameters
----------
traj : Trajectory
An mtraj trajectory.
group1 : np.ndarray, shape=(num_atoms), dtype=int
The indices of atoms in the first group.
group2 : np.ndarray, shape=(num_atoms), dtype=int
The indices of atoms in the second group.
frame : int, default=0
The frame of the Trajectory to take positions from
periodic : bool, default=True
If `periodic` is True and the trajectory contains unitcell
information, we will compute distances under the minimum image
convention.
Returns
-------
result : tuple (int, int, float)
The indices of the two atoms forming the closest contact, and the distance between them.
"""
xyz = ensure_type(traj.xyz, dtype=np.float32, ndim=3, name='traj.xyz', shape=(None, None, 3), warn_on_cast=False)[frame]
atoms1 = ensure_type(group1, dtype=np.int32, ndim=1, name='group1', warn_on_cast=False)
atoms2 = ensure_type(group2, dtype=np.int32, ndim=1, name='group2', warn_on_cast=False)
if periodic and traj._have_unitcell:
box = ensure_type(traj.unitcell_vectors, dtype=np.float32, ndim=3, name='unitcell_vectors', shape=(len(traj.xyz), 3, 3),
warn_on_cast=False)[frame]
else:
box = None
return _geometry._find_closest_contact(xyz, atoms1, atoms2, box)
##############################################################################
# pure python implementation of the core routines
##############################################################################
def _distance(xyz, pairs):
"Distance between pairs of points in each frame"
delta = np.diff(xyz[:, pairs], axis=2)[:, :, 0]
return (delta ** 2.).sum(-1) ** 0.5
def _displacement(xyz, pairs):
"Displacement vector between pairs of points in each frame"
value = np.diff(xyz[:, pairs], axis=2)[:, :, 0]
assert value.shape == (xyz.shape[0], pairs.shape[0], 3), 'v.shape %s, xyz.shape %s, pairs.shape %s' % (str(value.shape), str(xyz.shape), str(pairs.shape))
return value
def _reduce_box_vectors(vectors):
"""Make sure box vectors are in reduced form."""
(bv1, bv2, bv3) = vectors
bv3 -= bv2*round(bv3[1]/bv2[1]);
bv3 -= bv1*round(bv3[0]/bv1[0]);
bv2 -= bv1*round(bv2[0]/bv1[0]);
return (bv1, bv2, bv3)
def _distance_mic(xyz, pairs, box_vectors, orthogonal):
"""Distance between pairs of points in each frame under the minimum image
convention for periodic boundary conditions.
The computation follows scheme B.9 in Tukerman, M. "Statistical
Mechanics: Theory and Molecular Simulation", 2010.
This is a slow pure python implementation, mostly for testing.
"""
out = np.empty((xyz.shape[0], pairs.shape[0]), dtype=np.float32)
for i in range(len(xyz)):
bv1, bv2, bv3 = _reduce_box_vectors(box_vectors[i].T)
for j, (a,b) in enumerate(pairs):
r12 = xyz[i,b,:] - xyz[i,a,:]
r12 -= bv3*round(r12[2]/bv3[2]);
r12 -= bv2*round(r12[1]/bv2[1]);
r12 -= bv1*round(r12[0]/bv1[0]);
dist = np.linalg.norm(r12)
if not orthogonal:
for ii in range(-1, 2):
v1 = bv1*ii
for jj in range(-1, 2):
v12 = bv2*jj + v1
for kk in range(-1, 2):
new_r12 = r12 + v12 + bv3*kk
dist = min(dist, np.linalg.norm(new_r12))
out[i, j] = dist
return out
def _displacement_mic(xyz, pairs, box_vectors, orthogonal):
"""Displacement vector between pairs of points in each frame under the
minimum image convention for periodic boundary conditions.
The computation follows scheme B.9 in Tukerman, M. "Statistical
Mechanics: Theory and Molecular Simulation", 2010.
This is a very slow pure python implementation, mostly for testing.
"""
out = np.empty((xyz.shape[0], pairs.shape[0], 3), dtype=np.float32)
for i in range(len(xyz)):
bv1, bv2, bv3 = _reduce_box_vectors(box_vectors[i].T)
hinv = np.linalg.inv(np.array([bv1, bv2, bv3]).T)
for j, (a,b) in enumerate(pairs):
r12 = xyz[i,b,:] - xyz[i,a,:]
r12 -= bv3*round(r12[2]/bv3[2]);
r12 -= bv2*round(r12[1]/bv2[1]);
r12 -= bv1*round(r12[0]/bv1[0]);
min_disp = r12
dist2 = (r12*r12).sum()
if not orthogonal:
for ii in range(-1, 2):
v1 = bv1*ii
for jj in range(-1, 2):
v12 = bv2*jj+v1
for kk in range(-1, 2):
tmp = r12 + v12 + bv3*kk
new_dist2 = (tmp*tmp).sum()
if new_dist2 < dist2:
dist2 = new_dist2
min_disp = tmp
out[i, j] = min_disp
return out
|
swails/mdtraj
|
mdtraj/geometry/distance.py
|
Python
|
lgpl-2.1
| 12,042
|
[
"MDTraj"
] |
fa7e8ed4f91c17777d132bb9de5b8f903a9e5245ce61cddeba4de1e158343066
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.