text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
# coding: utf8 from wsgidav.dav_provider import DAVCollection, DAVNonCollection from wsgidav.dav_error import DAVError, HTTP_FORBIDDEN from wsgidav import util from wsgidav.addons.tracim import role, MyFileStream from time import mktime from datetime import datetime from os.path import normpath, dirname, basename try: from cStringIO import StringIO except ImportError: from StringIO import StringIO class Root(DAVCollection): def __init__(self, path, environ): super(Root, self).__init__(path, environ) def __repr__(self): return 'Root folder' def getCreationDate(self): return mktime(datetime.now().timetuple()) def getDisplayName(self): return 'Tracim - Home' def getLastModified(self): return mktime(datetime.now().timetuple()) def getMemberNames(self): return self.provider.get_all_workspaces(only_name=True) def getMember(self, workspace_name): workspace = self.provider.get_workspace({'label': workspace_name}) if not self.provider.has_right( self.environ["http_authenticator.username"], workspace.workspace_id, role["READER"] ): return None return Workspace(self.path + workspace.label, self.environ, workspace) def createEmptyResource(self, name): raise DAVError(HTTP_FORBIDDEN) def createCollection(self, name): raise DAVError(HTTP_FORBIDDEN) def getMemberList(self): memberlist = [] for name in self.getMemberNames(): member = self.getMember(name) if member is not None: memberlist.append(member) return memberlist class Workspace(DAVCollection): def __init__(self, path, environ, workspace): super(Workspace, self).__init__(path, environ) self.workspace = workspace def __repr__(self): return "Workspace: %s" % self.workspace.label def getCreationDate(self): return mktime(self.workspace.created.timetuple()) def getDisplayName(self): return self.workspace.label def getLastModified(self): return mktime(self.workspace.updated.timetuple()) def getMemberNames(self): return self.provider.get_workspace_children_id(self.workspace) def getMember(self, item_id): item = self.provider.get_item({'id': item_id, 'child_revision_id': None}) if not self.provider.has_right( self.environ["http_authenticator.username"], item.workspace_id, role["READER"] ): return None return Folder(self.path + item.item_name, self.environ, item) def createEmptyResource(self, name): raise DAVError(HTTP_FORBIDDEN) def createCollection(self, name): assert "/" not in name if not self.provider.has_right( self.environ["http_authenticator.username"], self.workspace.workspace_id, role["CONTENT_MANAGER"] ): raise DAVError(HTTP_FORBIDDEN) item = self.provider.add_item( item_name=name, item_type="FOLDER", workspace_id=self.workspace.workspace_id ) return Folder(self.path + name, self.environ, item) def delete(self): if not self.provider.has_right( self.environ["http_authenticator.username"], self.workspace.workspace_id, role["WORKSPACE_MANAGER"] ): raise DAVError(HTTP_FORBIDDEN) self.provider.delete_workspace(self.workspace) self.removeAllLocks(True) def copyMoveSingle(self, destpath, ismove): if ismove: self.provider.set_workspace_label(self.workspace, basename(normpath(destpath))) else: self.provider.add_workspace(basename(normpath(destpath))) def supportRecursiveMove(self, destpath): return True def moveRecursive(self, destpath): if not self.provider.has_right( self.environ["http_authenticator.username"], self.workspace.workspace_id, role["WORKSPACE_MANAGER"] ) or dirname(normpath(destpath)) != '/': raise DAVError(HTTP_FORBIDDEN) self.provider.set_workspace_label(self.workspace, basename(normpath(destpath))) def setLastModified(self, destpath, timestamp, dryrun): return False def getMemberList(self): memberlist = [] for name in self.getMemberNames(): member = self.getMember(name) if member is not None: memberlist.append(member) return memberlist class Folder(DAVCollection): def __init__(self, path, environ, item): super(Folder, self).__init__(path, environ) self.item = item def __repr__(self): return "Folder: %s" % self.item.item_name def getCreationDate(self): return mktime(self.item.created.timetuple()) def getDisplayName(self): return self.item.item_name def getLastModified(self): return mktime(self.item.updated.timetuple()) def getMemberNames(self): return self.provider.get_item_children(self.item.id) def getMember(self, item_id): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["READER"] ): return None item = self.provider.get_item({'id': item_id, 'child_revision_id': None}) return self.provider.getResourceInst(self.path + item.item_name, self.environ) def createEmptyResource(self, name): assert "/" not in name if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["CONTRIBUTOR"] ): raise DAVError(HTTP_FORBIDDEN) item = self.provider.add_item( item_name=name, item_type="FILE", workspace_id=self.item.workspace_id, parent_id=self.item.id ) return File(self.path + name, self.environ, item) def createCollection(self, name): assert "/" not in name if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["CONTENT_MANAGER"] ): raise DAVError(HTTP_FORBIDDEN) item = self.provider.add_item( item_name=name, item_type="FOLDER", workspace_id=self.item.workspace_id, parent_id=self.item.id ) return Folder(self.path + name, self.environ, item) def delete(self): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["CONTENT_MANAGER"] ): raise DAVError(HTTP_FORBIDDEN) self.provider.delete_item(self.item) self.removeAllLocks(True) def copyMoveSingle(self, destpath, ismove): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["CONTENT_MANAGER"] ) or dirname(normpath(destpath)) == '/': raise DAVError(HTTP_FORBIDDEN) if ismove: self.provider.move_item(self.item, destpath) else: self.provider.copy_item(self.item, destpath) def supportRecursiveMove(self, destpath): return True def moveRecursive(self, destpath): self.copyMoveSingle(destpath, True) def setLastModified(self, destpath, timestamp, dryrun): return False def getMemberList(self, copyOrMove=False): memberlist = [] for name in self.getMemberNames(): member = self.getMember(name) if member is not None: memberlist.append(member) print "j'ai : ", copyOrMove if memberlist != [] and not copyOrMove: memberlist.append(HistoryFolder(self.path + ".history", self.environ, self.item)) return memberlist def getDescendants(self, collections=True, resources=True, depthFirst=False, depth="infinity", addSelf=False, copyOrMove=False): assert depth in ("0", "1", "infinity") res = [] if addSelf and not depthFirst: res.append(self) if depth != "0" and self.isCollection: for child in self.getMemberList(copyOrMove): if not child: _ = self.getMemberList(copyOrMove) want = (collections and child.isCollection) or (resources and not child.isCollection) if want and not depthFirst: res.append(child) if child.isCollection and depth == "infinity": res.extend(child.getDescendants(collections, resources, depthFirst, depth, addSelf=False, copyOrMove=copyOrMove)) if want and depthFirst: res.append(child) if addSelf and depthFirst: res.append(self) return res class HistoryFolder(Folder): def __init__(self, path, environ, item): super(HistoryFolder, self).__init__(path, environ, item) def __repr__(self): return "Folder history of : %s" % self.item.item_name def getCreationDate(self): return mktime(datetime.now().timetuple()) def getDisplayName(self): return '.history' def getLastModified(self): return mktime(datetime.now().timetuple()) def getMember(self, item_id): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["READER"] ): return None item = self.provider.get_item({'id': item_id, 'child_revision_id': None}) if item.item_type == 'FOLDER': return None return HistoryFileFolder(self.path + item.item_name, self.environ, item) def createEmptyResource(self, name): raise DAVError(HTTP_FORBIDDEN) def createCollection(self, name): raise DAVError(HTTP_FORBIDDEN) def handleDelete(self): return True def handleCopy(self, destPath, depthInfinity): return True def handleMove(self, destPath): return True def setLastModified(self, destpath, timestamp, dryrun): return False def getMemberList(self, copyOrMove=False): memberlist = [] for name in self.getMemberNames(): member = self.getMember(name) if member is not None: memberlist.append(member) return memberlist class HistoryFileFolder(HistoryFolder): def __init__(self, path, environ, item): super(HistoryFileFolder, self).__init__(path, environ, item) def __repr__(self): return "File folder history of : %s" % self.item.item_name def getCreationDate(self): return mktime(datetime.now().timetuple()) def getDisplayName(self): return self.item.item_name def createCollection(self, name): raise DAVError(HTTP_FORBIDDEN) def getLastModified(self): return mktime(datetime.now().timetuple()) def getMemberNames(self): return self.provider.get_all_revisions_from_item(self.item, only_id=True) def getMember(self, item_id): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["READER"]): return None item = self.provider.get_item({'id': item_id}) if item.item_type in ["FILE"]: return HistoryFile(self.path + str(item.id) + '-' + item.item_name , self.environ, item) else: return HistoryOtherFile(self.path + str(item.id) + '-' + item.item_name, self.environ, item) class File(DAVNonCollection): def __init__(self, path, environ, item): super(File, self).__init__(path, environ) self.item = item self.filestream = MyFileStream(self.provider, self.item) def __repr__(self): return "File: %s" % self.item.item_name def getContentLength(self): return len(self.item.item_content) def getContentType(self): return util.guessMimeType(self.item.item_name) def getCreationDate(self): return mktime(self.item.created.timetuple()) def getDisplayName(self): return self.item.item_name def getLastModified(self): return mktime(self.item.updated.timetuple()) def getContent(self): filestream = StringIO() filestream.write(self.item.item_content) filestream.seek(0) return filestream def beginWrite(self, contentType=None): return self.filestream def delete(self): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["CONTENT_MANAGER"] ): raise DAVError(HTTP_FORBIDDEN) self.provider.delete_item(self.item) self.removeAllLocks(True) def copyMoveSingle(self, destpath, ismove): if not self.provider.has_right( self.environ["http_authenticator.username"], self.provider.get_workspace_id_from_path(destpath), role["CONTRIBUTOR"] ) or not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["READER"] ) or dirname(normpath(destpath)) == '/' \ or dirname(dirname(normpath(destpath))) == '/': raise DAVError(HTTP_FORBIDDEN) if ismove: self.provider.move_all_revisions(self.item, destpath) else: self.provider.copy_item(self.item, destpath) def supportRecursiveMove(self, dest): return True def moveRecursive(self, destpath): self.copyMoveSingle(destpath, True) def setLastModified(self, dest, timestamp, dryrun): return False class HistoryFile(File): def __init__(self, path, environ, item): super(HistoryFile, self).__init__(path, environ, item) def __repr__(self): return "File history: %s-%s" % (self.item.item_name, self.item.id) def getDisplayName(self): return str(self.item.id) + '-' + self.item.item_name def beginWrite(self, contentType=None): raise DAVError(HTTP_FORBIDDEN) def delete(self): raise DAVError(HTTP_FORBIDDEN) def handleDelete(self): return True def handleCopy(self, destPath, depthInfinity): return True def handleMove(self, destPath): return True def copyMoveSingle(self, destpath, ismove): raise DAVError(HTTP_FORBIDDEN) class OtherFile(File): def __init__(self, path, environ, item): super(OtherFile, self).__init__(path, environ, item) self.content = self.design(self.item.item_content) def __repr__(self): return "File: %s" % self.item.item_name def getContentLength(self): return len(self.content) def getContentType(self): return 'text/html' def getContent(self): filestream = StringIO() filestream.write(self.content) filestream.seek(0) return filestream def design(self, content): f = open('wsgidav/addons/tracim/style.css', 'r') style = f.read() f.close() file = ''' <html> <head> <title>Hey</title> <style>%s</style> </head> <body> <div> %s </div> </body> </html> ''' % (style, content) return file class HistoryOtherFile(OtherFile): def __init__(self, path, environ, item): super(HistoryOtherFile, self).__init__(path, environ, item) self.content = self.design(self.item.item_content) def __repr__(self): return "File history: %s-%s" % (self.item.item_name, self.item.id) def getDisplayName(self): return str(self.item.id) + '-' + self.item.item_name def beginWrite(self, contentType=None): raise DAVError(HTTP_FORBIDDEN) def delete(self): raise DAVError(HTTP_FORBIDDEN) def handleDelete(self): return True def handleCopy(self, destPath, depthInfinity): return True def handleMove(self, destPath): return True def copyMoveSingle(self, destpath, ismove): raise DAVError(HTTP_FORBIDDEN)
tracim/tracim-webdav
wsgidav/addons/tracim/sql_resources.py
Python
mit
16,929
0.000945
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # import posixpath import threading import time from abc import abstractmethod from kazoo.client import KazooClient from kazoo.retry import KazooRetry from mesos.interface import mesos_pb2 from twitter.common import log from twitter.common.concurrent.deferred import defer from twitter.common.exceptions import ExceptionalThread from twitter.common.metrics import LambdaGauge, Observable from twitter.common.quantity import Amount, Time from twitter.common.zookeeper.serverset import Endpoint, ServerSet from apache.aurora.executor.common.status_checker import ( StatusChecker, StatusCheckerProvider, StatusResult ) from apache.aurora.executor.common.task_info import ( mesos_task_instance_from_assigned_task, resolve_ports ) def make_endpoints(hostname, portmap, primary_port): """ Generate primary, additional endpoints from a portmap and primary_port. primary_port must be a name in the portmap dictionary. """ # Do int check as stop-gap measure against incompatible downstream clients. additional_endpoints = dict( (name, Endpoint(hostname, port)) for (name, port) in portmap.items() if isinstance(port, int)) # It's possible for the primary port to not have been allocated if this task # is using autoregistration, so register with a port of 0. return Endpoint(hostname, portmap.get(primary_port, 0)), additional_endpoints class AnnouncerCheckerProvider(StatusCheckerProvider): def __init__(self, name=None): self.name = name super(AnnouncerCheckerProvider, self).__init__() @abstractmethod def make_zk_client(self): """Create a ZooKeeper client which can be asyncronously started""" @abstractmethod def make_zk_path(self, assigned_task): """Given an assigned task return the path into where we should announce the task.""" def from_assigned_task(self, assigned_task, _): mesos_task = mesos_task_instance_from_assigned_task(assigned_task) if not mesos_task.has_announce(): return None portmap = resolve_ports(mesos_task, assigned_task.assignedPorts) # assigned_task.slaveHost is the --hostname argument passed into the mesos slave. # Using this allows overriding the hostname published into ZK when announcing. # If no argument was passed to the mesos-slave, the slave falls back to gethostname(). endpoint, additional = make_endpoints( assigned_task.slaveHost, portmap, mesos_task.announce().primary_port().get()) client = self.make_zk_client() path = self.make_zk_path(assigned_task) initial_interval = mesos_task.health_check_config().initial_interval_secs().get() interval = mesos_task.health_check_config().interval_secs().get() consecutive_failures = mesos_task.health_check_config().max_consecutive_failures().get() timeout_secs = initial_interval + (consecutive_failures * interval) return AnnouncerChecker( client, path, timeout_secs, endpoint, additional=additional, shard=assigned_task.instanceId, name=self.name) class DefaultAnnouncerCheckerProvider(AnnouncerCheckerProvider): DEFAULT_RETRY_MAX_DELAY = Amount(5, Time.MINUTES) DEFAULT_RETRY_POLICY = KazooRetry( max_tries=None, ignore_expire=True, max_delay=DEFAULT_RETRY_MAX_DELAY.as_(Time.SECONDS), ) def __init__(self, ensemble, root='/aurora'): self.__ensemble = ensemble self.__root = root super(DefaultAnnouncerCheckerProvider, self).__init__() def make_zk_client(self): return KazooClient(self.__ensemble, connection_retry=self.DEFAULT_RETRY_POLICY) def make_zk_path(self, assigned_task): config = assigned_task.task role, environment, name = ( config.job.role if config.job else config.owner.role, config.job.environment if config.job else config.environment, config.job.name if config.job else config.jobName) return posixpath.join(self.__root, role, environment, name) class ServerSetJoinThread(ExceptionalThread): """Background thread to reconnect to Serverset on session expiration.""" LOOP_WAIT = Amount(1, Time.SECONDS) def __init__(self, event, joiner, loop_wait=LOOP_WAIT): self._event = event self._joiner = joiner self._stopped = threading.Event() self._loop_wait = loop_wait super(ServerSetJoinThread, self).__init__() self.daemon = True def run(self): while True: if self._stopped.is_set(): break self._event.wait(timeout=self._loop_wait.as_(Time.SECONDS)) if not self._event.is_set(): continue log.debug('Join event triggered, joining serverset.') self._event.clear() self._joiner() def stop(self): self._stopped.set() class Announcer(Observable): class Error(Exception): pass EXCEPTION_WAIT = Amount(15, Time.SECONDS) def __init__(self, serverset, endpoint, additional=None, shard=None, clock=time, exception_wait=None): self._membership = None self._membership_termination = clock.time() self._endpoint = endpoint self._additional = additional or {} self._shard = shard self._serverset = serverset self._rejoin_event = threading.Event() self._clock = clock self._thread = None self._exception_wait = exception_wait or self.EXCEPTION_WAIT def disconnected_time(self): # Lockless membership length check membership_termination = self._membership_termination if membership_termination is None: return 0 return self._clock.time() - membership_termination def _join_inner(self): return self._serverset.join( endpoint=self._endpoint, additional=self._additional, shard=self._shard, expire_callback=self.on_expiration) def _join(self): if self._membership is not None: raise self.Error("join called, but already have membership!") while True: try: self._membership = self._join_inner() self._membership_termination = None except Exception as e: log.error('Failed to join ServerSet: %s' % e) self._clock.sleep(self._exception_wait.as_(Time.SECONDS)) else: break def start(self): self._thread = ServerSetJoinThread(self._rejoin_event, self._join) self._thread.start() self.rejoin() def rejoin(self): self._rejoin_event.set() def stop(self): thread, self._thread = self._thread, None thread.stop() if self._membership: self._serverset.cancel(self._membership) def on_expiration(self): self._membership = None if not self._thread: return self._membership_termination = self._clock.time() log.info('Zookeeper session expired.') self.rejoin() class AnnouncerChecker(StatusChecker): DEFAULT_NAME = 'announcer' def __init__(self, client, path, timeout_secs, endpoint, additional=None, shard=None, name=None): self.__client = client self.__connect_event = client.start_async() self.__timeout_secs = timeout_secs self.__announcer = Announcer(ServerSet(client, path), endpoint, additional=additional, shard=shard) self.__name = name or self.DEFAULT_NAME self.__status = None self.start_event = threading.Event() self.metrics.register(LambdaGauge('disconnected_time', self.__announcer.disconnected_time)) @property def status(self): return self.__status def name(self): return self.__name def __start(self): self.__connect_event.wait(timeout=self.__timeout_secs) if not self.__connect_event.is_set(): self.__status = StatusResult("Creating Announcer Serverset timed out.", mesos_pb2.TASK_FAILED) else: self.__announcer.start() self.start_event.set() def start(self): defer(self.__start) def stop(self): defer(self.__announcer.stop)
shahankhatch/aurora
src/main/python/apache/aurora/executor/common/announcer.py
Python
apache-2.0
8,388
0.008345
import argparse from ..api import _v1 class HelloHandler: def __init__( self, args: argparse.Namespace, now: _v1.Now, add_entry: _v1._private.AddEntry, ): self._args = args self._now = now self._add_entry = add_entry def __call__(self): self._add_entry(_v1.Entry(self._now, _v1.HELLO_ENTRY_NAME, False)) hello_command = _v1.Command( "hello", "Say '{hello_entry_name}' when you arrive in the morning...".format(hello_entry_name=_v1.HELLO_ENTRY_NAME), HelloHandler, lambda p: None, ) _v1.register_command(hello_command)
larose/utt
utt/plugins/0_hello.py
Python
gpl-3.0
593
0.003373
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone from django.conf import settings import model_utils.fields class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='ProctoredExam', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), ('course_id', models.CharField(max_length=255, db_index=True)), ('content_id', models.CharField(max_length=255, db_index=True)), ('external_id', models.CharField(max_length=255, null=True, db_index=True)), ('exam_name', models.TextField()), ('time_limit_mins', models.IntegerField()), ('due_date', models.DateTimeField(null=True)), ('is_proctored', models.BooleanField(default=False)), ('is_practice_exam', models.BooleanField(default=False)), ('is_active', models.BooleanField(default=False)), ], options={ 'db_table': 'proctoring_proctoredexam', }, ), migrations.CreateModel( name='ProctoredExamReviewPolicy', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), ('review_policy', models.TextField()), ('proctored_exam', models.ForeignKey(to='edx_proctoring.ProctoredExam')), ('set_by_user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'proctoring_proctoredexamreviewpolicy', 'verbose_name': 'Proctored exam review policy', 'verbose_name_plural': 'Proctored exam review policies', }, ), migrations.CreateModel( name='ProctoredExamReviewPolicyHistory', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), ('original_id', models.IntegerField(db_index=True)), ('review_policy', models.TextField()), ('proctored_exam', models.ForeignKey(to='edx_proctoring.ProctoredExam')), ('set_by_user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'proctoring_proctoredexamreviewpolicyhistory', 'verbose_name': 'proctored exam review policy history', }, ), migrations.CreateModel( name='ProctoredExamSoftwareSecureComment', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), ('start_time', models.IntegerField()), ('stop_time', models.IntegerField()), ('duration', models.IntegerField()), ('comment', models.TextField()), ('status', models.CharField(max_length=255)), ], options={ 'db_table': 'proctoring_proctoredexamstudentattemptcomment', 'verbose_name': 'proctored exam software secure comment', }, ), migrations.CreateModel( name='ProctoredExamSoftwareSecureReview', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), ('attempt_code', models.CharField(max_length=255, db_index=True)), ('review_status', models.CharField(max_length=255)), ('raw_data', models.TextField()), ('video_url', models.TextField()), ('exam', models.ForeignKey(to='edx_proctoring.ProctoredExam', null=True)), ('reviewed_by', models.ForeignKey(related_name='+', to=settings.AUTH_USER_MODEL, null=True)), ('student', models.ForeignKey(related_name='+', to=settings.AUTH_USER_MODEL, null=True)), ], options={ 'db_table': 'proctoring_proctoredexamsoftwaresecurereview', 'verbose_name': 'Proctored exam software secure review', }, ), migrations.CreateModel( name='ProctoredExamSoftwareSecureReviewHistory', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), ('attempt_code', models.CharField(max_length=255, db_index=True)), ('review_status', models.CharField(max_length=255)), ('raw_data', models.TextField()), ('video_url', models.TextField()), ('exam', models.ForeignKey(to='edx_proctoring.ProctoredExam', null=True)), ('reviewed_by', models.ForeignKey(related_name='+', to=settings.AUTH_USER_MODEL, null=True)), ('student', models.ForeignKey(related_name='+', to=settings.AUTH_USER_MODEL, null=True)), ], options={ 'db_table': 'proctoring_proctoredexamsoftwaresecurereviewhistory', 'verbose_name': 'Proctored exam review archive', }, ), migrations.CreateModel( name='ProctoredExamStudentAllowance', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), ('key', models.CharField(max_length=255)), ('value', models.CharField(max_length=255)), ('proctored_exam', models.ForeignKey(to='edx_proctoring.ProctoredExam')), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'proctoring_proctoredexamstudentallowance', 'verbose_name': 'proctored allowance', }, ), migrations.CreateModel( name='ProctoredExamStudentAllowanceHistory', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), ('allowance_id', models.IntegerField()), ('key', models.CharField(max_length=255)), ('value', models.CharField(max_length=255)), ('proctored_exam', models.ForeignKey(to='edx_proctoring.ProctoredExam')), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'proctoring_proctoredexamstudentallowancehistory', 'verbose_name': 'proctored allowance history', }, ), migrations.CreateModel( name='ProctoredExamStudentAttempt', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), ('started_at', models.DateTimeField(null=True)), ('completed_at', models.DateTimeField(null=True)), ('last_poll_timestamp', models.DateTimeField(null=True)), ('last_poll_ipaddr', models.CharField(max_length=32, null=True)), ('attempt_code', models.CharField(max_length=255, null=True, db_index=True)), ('external_id', models.CharField(max_length=255, null=True, db_index=True)), ('allowed_time_limit_mins', models.IntegerField()), ('status', models.CharField(max_length=64)), ('taking_as_proctored', models.BooleanField(default=False)), ('is_sample_attempt', models.BooleanField(default=False)), ('student_name', models.CharField(max_length=255)), ('review_policy_id', models.IntegerField(null=True)), ('proctored_exam', models.ForeignKey(to='edx_proctoring.ProctoredExam')), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'proctoring_proctoredexamstudentattempt', 'verbose_name': 'proctored exam attempt', }, ), migrations.CreateModel( name='ProctoredExamStudentAttemptHistory', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), ('attempt_id', models.IntegerField(null=True)), ('started_at', models.DateTimeField(null=True)), ('completed_at', models.DateTimeField(null=True)), ('attempt_code', models.CharField(max_length=255, null=True, db_index=True)), ('external_id', models.CharField(max_length=255, null=True, db_index=True)), ('allowed_time_limit_mins', models.IntegerField()), ('status', models.CharField(max_length=64)), ('taking_as_proctored', models.BooleanField(default=False)), ('is_sample_attempt', models.BooleanField(default=False)), ('student_name', models.CharField(max_length=255)), ('review_policy_id', models.IntegerField(null=True)), ('last_poll_timestamp', models.DateTimeField(null=True)), ('last_poll_ipaddr', models.CharField(max_length=32, null=True)), ('proctored_exam', models.ForeignKey(to='edx_proctoring.ProctoredExam')), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'proctoring_proctoredexamstudentattempthistory', 'verbose_name': 'proctored exam attempt history', }, ), migrations.AddField( model_name='proctoredexamsoftwaresecurecomment', name='review', field=models.ForeignKey(to='edx_proctoring.ProctoredExamSoftwareSecureReview'), ), migrations.AlterUniqueTogether( name='proctoredexam', unique_together=set([('course_id', 'content_id')]), ), migrations.AlterUniqueTogether( name='proctoredexamstudentattempt', unique_together=set([('user', 'proctored_exam')]), ), migrations.AlterUniqueTogether( name='proctoredexamstudentallowance', unique_together=set([('user', 'proctored_exam', 'key')]), ), ]
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/edx_proctoring/migrations/0001_initial.py
Python
agpl-3.0
13,525
0.00414
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django import forms from django.contrib import admin from django.contrib.auth.admin import UserAdmin as AuthUserAdmin from django.contrib.auth.forms import UserChangeForm, UserCreationForm from django.utils.translation import ugettext_lazy as _ from .models import User class MyUserChangeForm(UserChangeForm): class Meta(UserChangeForm.Meta): model = User class MyUserCreationForm(UserCreationForm): error_message = UserCreationForm.error_messages.update({ 'duplicate_username': _("This username has already been taken.") }) class Meta(UserCreationForm.Meta): model = User def clean_username(self): username = self.cleaned_data["username"] try: User.objects.get(username=username) except User.DoesNotExist: return username raise forms.ValidationError(self.error_messages['duplicate_username']) @admin.register(User) class UserAdmin(AuthUserAdmin): form = MyUserChangeForm add_form = MyUserCreationForm
dogukantufekci/supersalon
supersalon/users/admin.py
Python
bsd-3-clause
1,106
0.000904
#!/usr/bin/env python from sre_parse import isdigit import sys __author__ = 'jpijper' import roslib; roslib.load_manifest('smach_tutorials') import rospy import smach_ros from DialogStateMachine import SMDialog def main(): # To restrict the amount of feedback to the screen, a feedback level can be given on the command line. # Level 0 means show only the most urgent feedback and the higher the level, the more is shown. feedback_level = int(sys.argv[1]) if len(sys.argv) > 1 and isdigit(sys.argv[1]) else 10 rospy.init_node('sm_dialog_ask_device_on_finger') sm_top = SMDialog('ask_device_on_finger.csv', '192.168.0.4').sm_top ## inserted for smach_viewer # Create and start the introspection server #sis = smach_ros.IntrospectionServer('server_name', sm_top, '/SM_ROOT') #sis.start() ## end insert # Execute SMACH plan outcome = sm_top.execute() ## inserted for smach_viewer # Wait for ctrl-c to stop the application #rospy.spin() #sis.stop() ## end insert if __name__ == '__main__': main()
Rctue/DialogStateMachine
DialogTest_2_AskDeviceOnFinger.py
Python
gpl-2.0
1,079
0.013902
import json import numbers import html import config class command: """ Used to store an incoming player command """ def __init__(self, message): """ Called with a raw message string from a client :raise: ValueError if the message isn't a valid command """ # Try to parse it as a JSON command try: message = json.loads(message) except json.decoder.JSONDecodeError: # Message isn't valid JSON raise ValueError("Invalid JSON") # All commands must have a valid action if message.get("action") not in config.server.commands.validCommands: raise ValueError("Missing or invalid action") self.action = message["action"] # Check for a valid arg if it's required if self.action == config.server.commands.turn or self.action == config.server.commands.fire: if not isinstance(message.get("arg"), numbers.Number): raise ValueError("Missing or invalid arg") self.arg = message["arg"] elif self.action == config.server.commands.setInfo: self.arg = str(message.get("arg")) if len(self.arg) > config.server.commands.infoMaxLen: raise ValueError("Info string is longer than " + str(config.server.commands.infoMaxLen) + " characters") self.arg = html.escape(self.arg) self.arg = self.arg.replace("\n", " <br /> ") # Parse urls start = self.arg.find("http") while start != -1: end = self.arg.find(" ", start) if end == -1: end = len(self.arg) if self.arg[start:start + 7] == "http://" or self.arg[start:start + 8] == "https://": url = self.arg[start:end] aTag = "<a href='" + url + "' target='_blank'>" + url + "</a>" self.arg = self.arg[:start] + aTag + self.arg[end:] end += len(aTag) - len(url) start = self.arg.find("http", end) else: if "arg" in message: raise ValueError("Unexpected arg")
JoelEager/pyTanks.Server
dataModels/command.py
Python
mit
2,194
0.002735
# -*- coding: utf-8 -*- import boto.sqs import uuid from beaver.transports.base_transport import BaseTransport from beaver.transports.exception import TransportException class SqsTransport(BaseTransport): def __init__(self, beaver_config, logger=None): super(SqsTransport, self).__init__(beaver_config, logger=logger) self._access_key = beaver_config.get('sqs_aws_access_key') self._secret_key = beaver_config.get('sqs_aws_secret_key') self._region = beaver_config.get('sqs_aws_region') self._queue_name = beaver_config.get('sqs_aws_queue') try: if self._access_key is None and self._secret_key is None: self._connection = boto.sqs.connect_to_region(self._region) else: self._connection = boto.sqs.connect_to_region(self._region, aws_access_key_id=self._access_key, aws_secret_access_key=self._secret_key) if self._connection is None: self._logger.warn('Unable to connect to AWS - check your AWS credentials') raise TransportException('Unable to connect to AWS - check your AWS credentials') self._queue = self._connection.get_queue(self._queue_name) if self._queue is None: raise TransportException('Unable to access queue with name {0}'.format(self._queue_name)) except Exception, e: raise TransportException(e.message) def callback(self, filename, lines, **kwargs): timestamp = self.get_timestamp(**kwargs) if kwargs.get('timestamp', False): del kwargs['timestamp'] message_batch = [] for line in lines: message_batch.append((uuid.uuid4(), self.format(filename, line, timestamp, **kwargs), 0)) if len(message_batch) == 10: # SQS can only handle up to 10 messages in batch send self._logger.debug('Flushing 10 messages to SQS queue') self._send_message_batch(message_batch) message_batch = [] if len(message_batch) > 0: self._logger.debug('Flushing last {0} messages to SQS queue'.format(len(message_batch))) self._send_message_batch(message_batch) return True def _send_message_batch(self, message_batch): try: result = self._queue.write_batch(message_batch) if not result: self._logger.error('Error occurred sending messages to SQS queue {0}. result: {1}'.format( self._queue_name, result)) raise TransportException('Error occurred sending message to queue {0}'.format(self._queue_name)) except Exception, e: self._logger.exception('Exception occurred sending batch to SQS queue') raise TransportException(e.message) def interrupt(self): return True def unhandled(self): return True
moniker-dns/debian-beaver
beaver/transports/sqs_transport.py
Python
mit
3,043
0.003615
from django import forms from django.contrib import admin from django.utils.translation import ugettext from django.contrib.auth.admin import UserAdmin from django.contrib.admin.sites import NotRegistered from django.contrib.auth.models import User, Group, Permission from django.contrib.admin.widgets import FilteredSelectMultiple from .models import UserPermissionList, GroupPermissionList from .utils import update_permissions_user, \ update_user_groups, update_permissions_group class UserForm(forms.ModelForm): class Meta: model = User exclude = ('user_permissions', 'groups') class NonrelPermissionUserForm(UserForm): user_permissions = forms.MultipleChoiceField(required=False) groups = forms.MultipleChoiceField(required=False) def __init__(self, *args, **kwargs): super(NonrelPermissionUserForm, self).__init__(*args, **kwargs) self.fields['user_permissions'] = forms.MultipleChoiceField(required=False) self.fields['groups'] = forms.MultipleChoiceField(required=False) permissions_objs = Permission.objects.all().order_by('name') choices = [] for perm_obj in permissions_objs: choices.append([perm_obj.id, perm_obj.name]) self.fields['user_permissions'].choices = choices group_objs = Group.objects.all() choices = [] for group_obj in group_objs: choices.append([group_obj.id, group_obj.name]) self.fields['groups'].choices = choices try: user_perm_list = UserPermissionList.objects.get( user=kwargs['instance']) self.fields['user_permissions'].initial = user_perm_list.permission_fk_list self.fields['groups'].initial = user_perm_list.group_fk_list except (UserPermissionList.DoesNotExist, KeyError): self.fields['user_permissions'].initial = list() self.fields['groups'].initial = list() class NonrelPermissionCustomUserAdmin(UserAdmin): form = NonrelPermissionUserForm list_filter = ('is_staff', 'is_superuser', 'is_active') def save_model(self, request, obj, form, change): super(NonrelPermissionCustomUserAdmin, self).save_model(request, obj, form, change) try: if len(form.cleaned_data['user_permissions']) > 0: permissions = list(Permission.objects.filter( id__in=form.cleaned_data['user_permissions']).order_by('name')) else: permissions = [] update_permissions_user(permissions, obj) except KeyError: pass try: if len(form.cleaned_data['groups']) > 0: groups = list(Group.objects.filter( id__in=form.cleaned_data['groups'])) else: groups = [] update_user_groups(obj, groups) except KeyError: pass class PermissionAdmin(admin.ModelAdmin): ordering = ('name',) class GroupForm(forms.ModelForm): permissions = forms.MultipleChoiceField(required=False) def __init__(self, *args, **kwargs): # Temporarily exclude 'permissions' as it causes an # unsupported query to be executed original_exclude = self._meta.exclude self._meta.exclude = ['permissions',] + (self._meta.exclude if self._meta.exclude else []) super(GroupForm, self).__init__(*args, **kwargs) self._meta.exclude = original_exclude self.fields['permissions'] = forms.MultipleChoiceField(required=False, widget=FilteredSelectMultiple(ugettext('Permissions'), False)) permissions_objs = Permission.objects.all().order_by('name') choices = [] for perm_obj in permissions_objs: choices.append([perm_obj.id, perm_obj.name]) self.fields['permissions'].choices = choices try: current_perm_list = GroupPermissionList.objects.get( group=kwargs['instance']) self.fields['permissions'].initial = current_perm_list.permission_fk_list except (GroupPermissionList.DoesNotExist, KeyError): self.fields['permissions'].initial = [] class Meta: model = Group fields = ('name',) class CustomGroupAdmin(admin.ModelAdmin): form = GroupForm fieldsets = None def save_model(self, request, obj, form, change): super(CustomGroupAdmin, self).save_model(request, obj, form, change) if len(form.cleaned_data['permissions']) > 0: permissions = list(Permission.objects.filter( id__in=form.cleaned_data['permissions']).order_by('name')) else: permissions = [] update_permissions_group(permissions, obj) try: admin.site.unregister(User) except NotRegistered: pass try: admin.site.unregister(Group) except NotRegistered: pass admin.site.register(User, NonrelPermissionCustomUserAdmin) admin.site.register(Permission, PermissionAdmin) admin.site.register(Group, CustomGroupAdmin)
vongochung/ngudan
permission_backend_nonrel/admin.py
Python
bsd-3-clause
5,050
0.002178
"""This is (more-or-less) the example experiment described in the getting started section of the manual. In this experiment we simply measure the number of packets received as we ramp up the amount of traffic generated. """ import sys import random from network_tester import Experiment, to_csv # Take the SpiNNaker board IP/hostname from the command-line e = Experiment(sys.argv[1]) # Define a random network cores = [e.new_core() for _ in range(64)] flows = [e.new_flow(core, random.sample(cores, 8)) for core in cores] e.timestep = 1e-5 # 10 us # Sweep over a range of packet-generation probabilities num_steps = 10 for step in range(num_steps): with e.new_group() as group: e.probability = step / float(num_steps - 1) group.add_label("probability", e.probability) # Run each group for 1/10th of a second (with some time for warmup cooldown) e.warmup = 0.05 e.duration = 0.1 e.cooldown = 0.01 e.record_received = True # When the network saturates (for particularly high packet rates) realtime # deadlines will be missed in the packet sinks. We'll just ignore them in this # experiment. results = e.run(ignore_deadline_errors=True) totals = results.totals() # Plot the results import matplotlib.pyplot as plt plt.plot(totals["probability"], totals["received"]) plt.xlabel("Packet injection probability") plt.ylabel("Packets received at sinks") plt.show() # Produce an R-compatible CSV file. print(to_csv(totals))
project-rig/network_tester
examples/getting_started_example.py
Python
gpl-2.0
1,458
0.000686
import sys import threading import time io_lock = threading.Lock() blocker = threading.Lock() def block(i): t = threading.current_thread() with io_lock: print('{} with ident {} going to sleep'.format( t.name, t.ident)) if i: blocker.acquire() # acquired but never released time.sleep(0.2) with io_lock: print(t.name, 'finishing') return # Create and start several threads that "block" threads = [ threading.Thread(target=block, args=(i,)) for i in range(3) ] for t in threads: t.setDaemon(True) t.start() # Map the threads from their identifier to the thread object threads_by_ident = dict((t.ident, t) for t in threads) # Show where each thread is "blocked" time.sleep(0.01) with io_lock: for ident, frame in sys._current_frames().items(): t = threads_by_ident.get(ident) if not t: # Main thread continue print('{} stopped in {} at line {} of {}'.format( t.name, frame.f_code.co_name, frame.f_lineno, frame.f_code.co_filename))
jasonwee/asus-rt-n14uhp-mrtg
src/lesson_runtime_features/sys_current_frames.py
Python
apache-2.0
1,093
0
""" Tests for whether the standard library hooks in ``future`` are compatible with the ``requests`` package. """ from __future__ import absolute_import, unicode_literals, print_function from future import standard_library from future.tests.base import unittest, CodeHandler import textwrap import sys import os import io # Don't import requests first. This avoids the problem we want to expose: # with standard_library.suspend_hooks(): # try: # import requests # except ImportError: # requests = None class write_module(object): """ A context manager to streamline the tests. Creates a temp file for a module designed to be imported by the ``with`` block, then removes it afterwards. """ def __init__(self, code, tempdir): self.code = code self.tempdir = tempdir def __enter__(self): print('Creating {0}test_imports_future_stdlib.py ...'.format(self.tempdir)) with io.open(self.tempdir + 'test_imports_future_stdlib.py', 'wt', encoding='utf-8') as f: f.write(textwrap.dedent(self.code)) sys.path.insert(0, self.tempdir) return self def __exit__(self, exc_type, exc_val, exc_tb): """ If an exception occurred, we leave the file for inspection. """ sys.path.remove(self.tempdir) if exc_type is None: # No exception occurred os.remove(self.tempdir + 'test_imports_future_stdlib.py') try: os.remove(self.tempdir + 'test_imports_future_stdlib.pyc') except OSError: pass class TestRequests(CodeHandler): """ This class tests whether the requests module conflicts with the standard library import hooks, as in issue #19. """ def test_remove_hooks_then_requests(self): code = """ from future import standard_library standard_library.install_hooks() import builtins import http.client import html.parser """ with write_module(code, self.tempdir): import test_imports_future_stdlib standard_library.remove_hooks() try: import requests except ImportError: print("Requests doesn't seem to be available. Skipping requests test ...") else: r = requests.get('http://google.com') self.assertTrue(r) self.assertTrue(True) def test_requests_cm(self): """ Tests whether requests can be used importing standard_library modules previously with the hooks context manager """ code = """ from future import standard_library with standard_library.hooks(): import builtins import html.parser import http.client """ with write_module(code, self.tempdir): import test_imports_future_stdlib try: import requests except ImportError: print("Requests doesn't seem to be available. Skipping requests test ...") else: r = requests.get('http://google.com') self.assertTrue(r) self.assertTrue(True) if __name__ == '__main__': unittest.main()
hughperkins/kgsgo-dataset-preprocessor
thirdparty/future/tests/test_future/test_requests.py
Python
mpl-2.0
3,385
0.001182
def all_substr(string): s = set() length = len(string) for i in range(length): for j in range(i, length + 1): s.add(string[i:j]) return s def compr(string, substring): l = len(substring) c = string.count(substring) return len(string) - c * (l-1) + l def min_enc(string): x = len(string) for s in all_substr(string): y = compr(string, s) if y < x: x = y return x print(min_enc(input()))
JonSteinn/Kattis-Solutions
src/Red Rover/Python 3/rr.py
Python
gpl-3.0
479
0.004175
# Copyright (C) 2010-2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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. # # ESPResSo 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/>. """ Simulate the motion of a spherical red blood cell-like particle advected in a planar Poiseuille flow, with or without volume conservation. For more details, see :ref:`Immersed Boundary Method for soft elastic objects`. """ import espressomd required_features = ["LB_BOUNDARIES", "VIRTUAL_SITES_INERTIALESS_TRACERS", "EXPERIMENTAL_FEATURES"] espressomd.assert_features(required_features) from espressomd import lb, shapes, lbboundaries from espressomd.virtual_sites import VirtualSitesInertialessTracers import argparse parser = argparse.ArgumentParser() parser.add_argument( "--no-volcons", action="store_const", dest="volcons", const=False, help="Disable volume conservation", default=True) parser.add_argument( "--no-bending", action="store_const", dest="bending", const=False, help="Disable bending", default=True) args = parser.parse_args() if args.volcons and not args.bending: print('Note: removing bending will also remove volume conservation') args.volcons = False # System setup boxZ = 20 system = espressomd.System(box_l=(20, 20, boxZ)) system.time_step = 1 / 6. system.cell_system.skin = 0.1 system.virtual_sites = VirtualSitesInertialessTracers() print("Parallelization: " + str(system.cell_system.node_grid)) force = 0.001 from addSoft import AddSoft k1 = 0.1 k2 = 1 AddSoft(system, 10, 10, 10, k1, k2) # case without bending and volCons outputDir = "outputPure" # case with bending if args.bending: from addBending import AddBending kb = 1 AddBending(system, kb) outputDir = "outputBendPara" # case with bending and volCons if args.volcons: from addVolCons import AddVolCons kV = 10 AddVolCons(system, kV) outputDir = "outputVolParaCUDA" # Add LB Fluid lbf = lb.LBFluid(agrid=1, dens=1, visc=1, tau=system.time_step, ext_force_density=[force, 0, 0]) system.actors.add(lbf) system.thermostat.set_lb(LB_fluid=lbf, gamma=1.0, act_on_virtual=False) # Setup boundaries walls = [lbboundaries.LBBoundary() for k in range(2)] walls[0].set_params(shape=shapes.Wall(normal=[0, 0, 1], dist=0.5)) walls[1].set_params(shape=shapes.Wall(normal=[0, 0, -1], dist=-boxZ + 0.5)) for wall in walls: system.lbboundaries.add(wall) # make directory import os os.makedirs(outputDir) print('Saving data to ' + outputDir) # Perform integration from writeVTK import WriteVTK WriteVTK(system, str(outputDir + "/cell_" + str(0) + ".vtk")) stepSize = 1000 numSteps = 20 for i in range(numSteps): system.integrator.run(stepSize) WriteVTK(system, str(outputDir + "/cell_" + str(i + 1) + ".vtk")) print("Done " + str(i + 1) + " out of " + str(numSteps) + " steps.")
KaiSzuttor/espresso
samples/immersed_boundary/sampleImmersedBoundary.py
Python
gpl-3.0
3,388
0.001771
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "GPSstorage.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # issue is really that Django is missing to avoid masking other # exceptions on Python 2. try: import django except ImportError: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) raise execute_from_command_line(sys.argv)
seftler/GPSstorage
manage.py
Python
mit
808
0
# -*- coding: utf-8 -*- """ This is the common settings file, intended to set sane defaults. If you have a piece of configuration that's dependent on a set of feature flags being set, then create a function that returns the calculated value based on the value of FEATURES[...]. Modules that extend this one can change the feature configuration in an environment specific config file and re-calculate those values. We should make a method that calls all these config methods so that you just make one call at the end of your site-specific dev file to reset all the dependent variables (like INSTALLED_APPS) for you. Longer TODO: 1. Right now our treatment of static content in general and in particular course-specific static content is haphazard. 2. We should have a more disciplined approach to feature flagging, even if it just means that we stick them in a dict called FEATURES. 3. We need to handle configuration for multiple courses. This could be as multiple sites, but we do need a way to map their data assets. """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=W0401, W0611, W0614, C0103 import sys import os import imp from path import path from warnings import simplefilter from django.utils.translation import ugettext_lazy as _ from .discussionsettings import * from xmodule.modulestore.modulestore_settings import update_module_store_settings from lms.lib.xblock.mixin import LmsBlockMixin ################################### FEATURES ################################### # The display name of the platform to be used in templates/emails/etc. PLATFORM_NAME = "StudentEDX" CC_MERCHANT_NAME = PLATFORM_NAME PLATFORM_FACEBOOK_ACCOUNT = "http://www.facebook.com/studentedx" PLATFORM_TWITTER_ACCOUNT = "@studentedx" PLATFORM_TWITTER_URL = "https://twitter.com/studenedx" PLATFORM_MEETUP_URL = "http://www.meetup.com/YourMeetup"#<--------------------------- PLATFORM_LINKEDIN_URL = "http://www.linkedin.com/company/YourPlatform" #<--------------------------- PLATFORM_GOOGLE_PLUS_URL = "https://plus.google.com/u/0/b/105623299540915099930/105623299540915099930/about" COURSEWARE_ENABLED = True ENABLE_JASMINE = False DISCUSSION_SETTINGS = { 'MAX_COMMENT_DEPTH': 2, } # Features FEATURES = { 'SAMPLE': False, 'USE_DJANGO_PIPELINE': True, 'DISPLAY_DEBUG_INFO_TO_STAFF': True, 'DISPLAY_HISTOGRAMS_TO_STAFF': False, # For large courses this slows down courseware access for staff. 'REROUTE_ACTIVATION_EMAIL': False, # nonempty string = address for all activation emails 'DEBUG_LEVEL': 0, # 0 = lowest level, least verbose, 255 = max level, most verbose ## DO NOT SET TO True IN THIS FILE ## Doing so will cause all courses to be released on production 'DISABLE_START_DATES': False, # When True, all courses will be active, regardless of start date # When True, will only publicly list courses by the subdomain. Expects you # to define COURSE_LISTINGS, a dictionary mapping subdomains to lists of # course_ids (see dev_int.py for an example) 'SUBDOMAIN_COURSE_LISTINGS': False, # When True, will override certain branding with university specific values # Expects a SUBDOMAIN_BRANDING dictionary that maps the subdomain to the # university to use for branding purposes 'SUBDOMAIN_BRANDING': False, 'FORCE_UNIVERSITY_DOMAIN': False, # set this to the university domain to use, as an override to HTTP_HOST # set to None to do no university selection # for consistency in user-experience, keep the value of the following 3 settings # in sync with the corresponding ones in cms/envs/common.py 'ENABLE_DISCUSSION_SERVICE': True, 'ENABLE_TEXTBOOK': True, 'ENABLE_STUDENT_NOTES': True, # enables the student notes API and UI. # discussion home panel, which includes a subscription on/off setting for discussion digest emails. # this should remain off in production until digest notifications are online. 'ENABLE_DISCUSSION_HOME_PANEL': False, 'ENABLE_PSYCHOMETRICS': False, # real-time psychometrics (eg item response theory analysis in instructor dashboard) 'ENABLE_DJANGO_ADMIN_SITE': True, # set true to enable django's admin site, even on prod (e.g. for course ops) 'ENABLE_SQL_TRACKING_LOGS': False, 'ENABLE_LMS_MIGRATION': True, 'ENABLE_MANUAL_GIT_RELOAD': False, 'ENABLE_MASQUERADE': True, # allow course staff to change to student view of courseware 'ENABLE_SYSADMIN_DASHBOARD': False, # sysadmin dashboard, to see what courses are loaded, to delete & load courses 'DISABLE_LOGIN_BUTTON': False, # used in systems where login is automatic, eg MIT SSL # extrernal access methods 'ACCESS_REQUIRE_STAFF_FOR_COURSE': False, 'AUTH_USE_OPENID': False, 'AUTH_USE_CERTIFICATES': False, 'AUTH_USE_OPENID_PROVIDER': False, # Even though external_auth is in common, shib assumes the LMS views / urls, so it should only be enabled # in LMS 'AUTH_USE_SHIB': False, 'AUTH_USE_CAS': False, # This flag disables the requirement of having to agree to the TOS for users registering # with Shib. Feature was requested by Stanford's office of general counsel 'SHIB_DISABLE_TOS': False, # Toggles OAuth2 authentication provider 'ENABLE_OAUTH2_PROVIDER': False, # Can be turned off if course lists need to be hidden. Effects views and templates. 'COURSES_ARE_BROWSABLE': True, # Enables ability to restrict enrollment in specific courses by the user account login method 'RESTRICT_ENROLL_BY_REG_METHOD': False, # Enables the LMS bulk email feature for course staff 'ENABLE_INSTRUCTOR_EMAIL': True, # If True and ENABLE_INSTRUCTOR_EMAIL: Forces email to be explicitly turned on # for each course via django-admin interface. # If False and ENABLE_INSTRUCTOR_EMAIL: Email will be turned on by default # for all Mongo-backed courses. 'REQUIRE_COURSE_EMAIL_AUTH': True, # Analytics experiments - shows instructor analytics tab in LMS instructor dashboard. # Enabling this feature depends on installation of a separate analytics server. 'ENABLE_INSTRUCTOR_ANALYTICS': False, # enable analytics server. # WARNING: THIS SHOULD ALWAYS BE SET TO FALSE UNDER NORMAL # LMS OPERATION. See analytics.py for details about what # this does. 'RUN_AS_ANALYTICS_SERVER_ENABLED': False, # Flip to True when the YouTube iframe API breaks (again) 'USE_YOUTUBE_OBJECT_API': False, # Give a UI to show a student's submission history in a problem by the # Staff Debug tool. 'ENABLE_STUDENT_HISTORY_VIEW': True, # Segment.io for LMS--need to explicitly turn it on for production. 'SEGMENT_IO_LMS': False, # Provide a UI to allow users to submit feedback from the LMS (left-hand help modal) 'ENABLE_FEEDBACK_SUBMISSION': True, # Turn on a page that lets staff enter Python code to be run in the # sandbox, for testing whether it's enabled properly. 'ENABLE_DEBUG_RUN_PYTHON': False, # Enable URL that shows information about the status of variuous services 'ENABLE_SERVICE_STATUS': False, # Toggle to indicate use of a custom theme 'USE_CUSTOM_THEME': False, # Don't autoplay videos for students 'AUTOPLAY_VIDEOS': False, # Enable instructor dash to submit background tasks 'ENABLE_INSTRUCTOR_BACKGROUND_TASKS': True, # Enable instructor to assign individual due dates 'INDIVIDUAL_DUE_DATES': False, # Enable legacy instructor dashboard 'ENABLE_INSTRUCTOR_LEGACY_DASHBOARD': True, # Is this an edX-owned domain? (used on instructor dashboard) 'IS_EDX_DOMAIN': False, # Toggle to enable certificates of courses on dashboard 'ENABLE_VERIFIED_CERTIFICATES': False, # Allow use of the hint managment instructor view. 'ENABLE_HINTER_INSTRUCTOR_VIEW': False, # for load testing 'AUTOMATIC_AUTH_FOR_TESTING': False, # Toggle to enable chat availability (configured on a per-course # basis in Studio) 'ENABLE_CHAT': False, # Allow users to enroll with methods other than just honor code certificates 'MULTIPLE_ENROLLMENT_ROLES': True, # Toggle the availability of the shopping cart page 'ENABLE_SHOPPING_CART': True, # Toggle storing detailed billing information 'STORE_BILLING_INFO': False, # Enable flow for payments for course registration (DIFFERENT from verified student flow) 'ENABLE_PAID_COURSE_REGISTRATION': True, # Automatically approve student identity verification attempts 'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING': False, # Disable instructor dash buttons for downloading course data # when enrollment exceeds this number 'MAX_ENROLLMENT_INSTR_BUTTONS': 200, # Grade calculation started from the new instructor dashboard will write # grades CSV files to S3 and give links for downloads. 'ENABLE_S3_GRADE_DOWNLOADS': False, # whether to use password policy enforcement or not 'ENFORCE_PASSWORD_POLICY': False, # Give course staff unrestricted access to grade downloads (if set to False, # only edX superusers can perform the downloads) 'ALLOW_COURSE_STAFF_GRADE_DOWNLOADS': False, 'ENABLED_PAYMENT_REPORTS': ["refund_report", "itemized_purchase_report", "university_revenue_share", "certificate_status"], # Turn off account locking if failed login attempts exceeds a limit 'ENABLE_MAX_FAILED_LOGIN_ATTEMPTS': False, # Hide any Personally Identifiable Information from application logs 'SQUELCH_PII_IN_LOGS': False, # Toggles the embargo functionality, which enable embargoing for particular courses 'EMBARGO': False, # Toggles the embargo site functionality, which enable embargoing for the whole site 'SITE_EMBARGOED': False, # Whether the Wiki subsystem should be accessible via the direct /wiki/ paths. Setting this to True means # that people can submit content and modify the Wiki in any arbitrary manner. We're leaving this as True in the # defaults, so that we maintain current behavior 'ALLOW_WIKI_ROOT_ACCESS': True, # Turn on/off Microsites feature 'USE_MICROSITES': False, # Turn on third-party auth. Disabled for now because full implementations are not yet available. Remember to syncdb # if you enable this; we don't create tables by default. 'ENABLE_THIRD_PARTY_AUTH': True, # Toggle to enable alternate urls for marketing links 'ENABLE_MKTG_SITE': False, # Prevent concurrent logins per user 'PREVENT_CONCURRENT_LOGINS': True, # Turn off Advanced Security by default 'ADVANCED_SECURITY': True, # Show a "Download your certificate" on the Progress page if the lowest # nonzero grade cutoff is met 'SHOW_PROGRESS_SUCCESS_BUTTON': False, # When a logged in user goes to the homepage ('/') should the user be # redirected to the dashboard - this is default Open edX behavior. Set to # False to not redirect the user 'ALWAYS_REDIRECT_HOMEPAGE_TO_DASHBOARD_FOR_AUTHENTICATED_USER': True, # Expose Mobile REST API. Note that if you use this, you must also set # ENABLE_OAUTH2_PROVIDER to True 'ENABLE_MOBILE_REST_API': False, # Enable the new dashboard, account, and profile pages 'ENABLE_NEW_DASHBOARD': False, # Show a section in the membership tab of the instructor dashboard # to allow an upload of a CSV file that contains a list of new accounts to create # and register for course. 'ALLOW_AUTOMATED_SIGNUPS': False, # Display demographic data on the analytics tab in the instructor dashboard. 'DISPLAY_ANALYTICS_DEMOGRAPHICS': True } # Ignore static asset files on import which match this pattern ASSET_IGNORE_REGEX = r"(^\._.*$)|(^\.DS_Store$)|(^.*~$)" # Used for A/B testing DEFAULT_GROUPS = [] # If this is true, random scores will be generated for the purpose of debugging the profile graphs GENERATE_PROFILE_SCORES = False # Used with XQueue XQUEUE_WAITTIME_BETWEEN_REQUESTS = 5 # seconds ############################# SET PATH INFORMATION ############################# PROJECT_ROOT = path(__file__).abspath().dirname().dirname() # /edx-platform/lms REPO_ROOT = PROJECT_ROOT.dirname() COMMON_ROOT = REPO_ROOT / "common" ENV_ROOT = REPO_ROOT.dirname() # virtualenv dir /edx-platform is in COURSES_ROOT = ENV_ROOT / "data" DATA_DIR = COURSES_ROOT # TODO: Remove the rest of the sys.path modification here and in cms/envs/common.py sys.path.append(REPO_ROOT) sys.path.append(PROJECT_ROOT / 'djangoapps') sys.path.append(COMMON_ROOT / 'djangoapps') sys.path.append(COMMON_ROOT / 'lib') # For Node.js system_node_path = os.environ.get("NODE_PATH", REPO_ROOT / 'node_modules') node_paths = [ COMMON_ROOT / "static/js/vendor", COMMON_ROOT / "static/coffee/src", system_node_path, ] NODE_PATH = ':'.join(node_paths) # For geolocation ip database GEOIP_PATH = REPO_ROOT / "common/static/data/geoip/GeoIP.dat" GEOIPV6_PATH = REPO_ROOT / "common/static/data/geoip/GeoIPv6.dat" # Where to look for a status message STATUS_MESSAGE_PATH = ENV_ROOT / "status_message.json" ############################ OpenID Provider ################################## OPENID_PROVIDER_TRUSTED_ROOTS = ['cs50.net', '*.cs50.net'] ############################ OAUTH2 Provider ################################### # OpenID Connect issuer ID. Normally the URL of the authentication endpoint. OAUTH_OIDC_ISSUER = 'https:/example.com/oauth2' # OpenID Connect claim handlers OAUTH_OIDC_ID_TOKEN_HANDLERS = ( 'oauth2_provider.oidc.handlers.BasicIDTokenHandler', 'oauth2_provider.oidc.handlers.ProfileHandler', 'oauth2_provider.oidc.handlers.EmailHandler', 'oauth2_handler.IDTokenHandler' ) OAUTH_OIDC_USERINFO_HANDLERS = ( 'oauth2_provider.oidc.handlers.BasicUserInfoHandler', 'oauth2_provider.oidc.handlers.ProfileHandler', 'oauth2_provider.oidc.handlers.EmailHandler', 'oauth2_handler.UserInfoHandler' ) ################################## EDX WEB ##################################### # This is where we stick our compiled template files. Most of the app uses Mako # templates import tempfile MAKO_MODULE_DIR = os.path.join(tempfile.gettempdir(), 'mako_lms') MAKO_TEMPLATES = {} MAKO_TEMPLATES['main'] = [PROJECT_ROOT / 'templates', COMMON_ROOT / 'templates', COMMON_ROOT / 'lib' / 'capa' / 'capa' / 'templates', COMMON_ROOT / 'djangoapps' / 'pipeline_mako' / 'templates'] # This is where Django Template lookup is defined. There are a few of these # still left lying around. TEMPLATE_DIRS = [ PROJECT_ROOT / "templates", COMMON_ROOT / 'templates', COMMON_ROOT / 'lib' / 'capa' / 'capa' / 'templates', COMMON_ROOT / 'djangoapps' / 'pipeline_mako' / 'templates', ] TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', 'django.core.context_processors.static', 'django.contrib.messages.context_processors.messages', 'django.core.context_processors.i18n', 'django.contrib.auth.context_processors.auth', # this is required for admin 'django.core.context_processors.csrf', # Added for django-wiki 'django.core.context_processors.media', 'django.core.context_processors.tz', 'django.contrib.messages.context_processors.messages', 'sekizai.context_processors.sekizai', # Hack to get required link URLs to password reset templates 'edxmako.shortcuts.marketing_link_context_processor', # Allows the open edX footer to be leveraged in Django Templates. 'edxmako.shortcuts.open_source_footer_context_processor', # Shoppingcart processor (detects if request.user has a cart) 'shoppingcart.context_processor.user_has_cart_context_processor', # Allows the open edX footer to be leveraged in Django Templates. 'edxmako.shortcuts.microsite_footer_context_processor', ) # use the ratelimit backend to prevent brute force attacks AUTHENTICATION_BACKENDS = ( 'ratelimitbackend.backends.RateLimitModelBackend', ) STUDENT_FILEUPLOAD_MAX_SIZE = 4 * 1000 * 1000 # 4 MB MAX_FILEUPLOADS_PER_INPUT = 20 # FIXME: # We should have separate S3 staged URLs in case we need to make changes to # these assets and test them. LIB_URL = '/static/js/' # Dev machines shouldn't need the book # BOOK_URL = '/static/book/' BOOK_URL = 'https://mitxstatic.s3.amazonaws.com/book_images/' # For AWS deploys RSS_TIMEOUT = 600 # Configuration option for when we want to grab server error pages STATIC_GRAB = False DEV_CONTENT = True EDX_ROOT_URL = '' LOGIN_REDIRECT_URL = EDX_ROOT_URL + '/accounts/login' LOGIN_URL = EDX_ROOT_URL + '/accounts/login' COURSE_NAME = "6.002_Spring_2012" COURSE_NUMBER = "6.002x" COURSE_TITLE = "Circuits and Electronics" ### Dark code. Should be enabled in local settings for devel. ENABLE_MULTICOURSE = False # set to False to disable multicourse display (see lib.util.views.edXhome) WIKI_ENABLED = False ### COURSE_DEFAULT = '6.002x_Fall_2012' COURSE_SETTINGS = { '6.002x_Fall_2012': { 'number': '6.002x', 'title': 'Circuits and Electronics', 'xmlpath': '6002x/', 'location': 'i4x://edx/6002xs12/course/6.002x_Fall_2012', } } # IP addresses that are allowed to reload the course, etc. # TODO (vshnayder): Will probably need to change as we get real access control in. LMS_MIGRATION_ALLOWED_IPS = [] # These are standard regexes for pulling out info like course_ids, usage_ids, etc. # They are used so that URLs with deprecated-format strings still work. # Note: these intentionally greedily grab all chars up to the next slash including any pluses # DHM: I really wanted to ensure the separators were the same (+ or /) but all patts I tried had # too many inadvertent side effects :-( COURSE_KEY_PATTERN = r'(?P<course_key_string>[^/+]+(/|\+)[^/+]+(/|\+)[^/]+)' COURSE_ID_PATTERN = COURSE_KEY_PATTERN.replace('course_key_string', 'course_id') COURSE_KEY_REGEX = COURSE_KEY_PATTERN.replace('P<course_key_string>', ':') USAGE_KEY_PATTERN = r'(?P<usage_key_string>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))' ASSET_KEY_PATTERN = r'(?P<asset_key_string>(?:/?c4x(:/)?/[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))' USAGE_ID_PATTERN = r'(?P<usage_id>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))' ############################## EVENT TRACKING ################################# # FIXME: Should we be doing this truncation? TRACK_MAX_EVENT = 50000 DEBUG_TRACK_LOG = False TRACKING_BACKENDS = { 'logger': { 'ENGINE': 'track.backends.logger.LoggerBackend', 'OPTIONS': { 'name': 'tracking' } } } # We're already logging events, and we don't want to capture user # names/passwords. Heartbeat events are likely not interesting. TRACKING_IGNORE_URL_PATTERNS = [r'^/event', r'^/login', r'^/heartbeat', r'^/segmentio/event'] EVENT_TRACKING_ENABLED = True EVENT_TRACKING_BACKENDS = { 'logger': { 'ENGINE': 'eventtracking.backends.logger.LoggerBackend', 'OPTIONS': { 'name': 'tracking', 'max_event_size': TRACK_MAX_EVENT, } } } EVENT_TRACKING_PROCESSORS = [ { 'ENGINE': 'track.shim.LegacyFieldMappingProcessor' }, { 'ENGINE': 'track.shim.VideoEventProcessor' } ] # Backwards compatibility with ENABLE_SQL_TRACKING_LOGS feature flag. # In the future, adding the backend to TRACKING_BACKENDS should be enough. if FEATURES.get('ENABLE_SQL_TRACKING_LOGS'): TRACKING_BACKENDS.update({ 'sql': { 'ENGINE': 'track.backends.django.DjangoBackend' } }) EVENT_TRACKING_BACKENDS.update({ 'sql': { 'ENGINE': 'track.backends.django.DjangoBackend' } }) TRACKING_SEGMENTIO_WEBHOOK_SECRET = None TRACKING_SEGMENTIO_ALLOWED_TYPES = ['track'] TRACKING_SEGMENTIO_SOURCE_MAP = { 'analytics-android': 'mobile', 'analytics-ios': 'mobile', } ######################## GOOGLE ANALYTICS ########################### GOOGLE_ANALYTICS_ACCOUNT = None GOOGLE_ANALYTICS_LINKEDIN = 'GOOGLE_ANALYTICS_LINKEDIN_DUMMY' ######################## OPTIMIZELY ########################### OPTIMIZELY_PROJECT_ID = None ######################## subdomain specific settings ########################### COURSE_LISTINGS = {} SUBDOMAIN_BRANDING = {} VIRTUAL_UNIVERSITIES = [] ############# XBlock Configuration ########## # Import after sys.path fixup from xmodule.modulestore.inheritance import InheritanceMixin from xmodule.modulestore import prefer_xmodules from xmodule.x_module import XModuleMixin # This should be moved into an XBlock Runtime/Application object # once the responsibility of XBlock creation is moved out of modulestore - cpennington XBLOCK_MIXINS = (LmsBlockMixin, InheritanceMixin, XModuleMixin) # Allow any XBlock in the LMS XBLOCK_SELECT_FUNCTION = prefer_xmodules ############# ModuleStore Configuration ########## MODULESTORE_BRANCH = 'published-only' CONTENTSTORE = None DOC_STORE_CONFIG = { 'host': 'localhost', 'db': 'xmodule', 'collection': 'modulestore', 'asset_collection': 'assetstore', } MODULESTORE = { 'default': { 'ENGINE': 'xmodule.modulestore.mixed.MixedModuleStore', 'OPTIONS': { 'mappings': {}, 'stores': [ { 'NAME': 'draft', 'ENGINE': 'xmodule.modulestore.mongo.DraftMongoModuleStore', 'DOC_STORE_CONFIG': DOC_STORE_CONFIG, 'OPTIONS': { 'default_class': 'xmodule.hidden_module.HiddenDescriptor', 'fs_root': DATA_DIR, 'render_template': 'edxmako.shortcuts.render_to_string', } }, { 'NAME': 'xml', 'ENGINE': 'xmodule.modulestore.xml.XMLModuleStore', 'OPTIONS': { 'data_dir': DATA_DIR, 'default_class': 'xmodule.hidden_module.HiddenDescriptor', } }, { 'NAME': 'split', 'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore', 'DOC_STORE_CONFIG': DOC_STORE_CONFIG, 'OPTIONS': { 'default_class': 'xmodule.hidden_module.HiddenDescriptor', 'fs_root': DATA_DIR, 'render_template': 'edxmako.shortcuts.render_to_string', } }, ] } } } #################### Python sandbox ############################################ CODE_JAIL = { # Path to a sandboxed Python executable. None means don't bother. 'python_bin': None, # User to run as in the sandbox. 'user': 'sandbox', # Configurable limits. 'limits': { # How many CPU seconds can jailed code use? 'CPU': 1, }, } # Some courses are allowed to run unsafe code. This is a list of regexes, one # of them must match the course id for that course to run unsafe code. # # For example: # # COURSES_WITH_UNSAFE_CODE = [ # r"Harvard/XY123.1/.*" # ] COURSES_WITH_UNSAFE_CODE = [] ############################### DJANGO BUILT-INS ############################### # Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here DEBUG = False TEMPLATE_DEBUG = False USE_TZ = True SESSION_COOKIE_SECURE = False # CMS base CMS_BASE = 'localhost:8001' # Site info SITE_ID = 1 SITE_NAME = "example.com" HTTPS = 'on' ROOT_URLCONF = 'lms.urls' # NOTE: Please set ALLOWED_HOSTS to some sane value, as we do not allow the default '*' # Platform Email EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' DEFAULT_FROM_EMAIL = '[email protected]' DEFAULT_FEEDBACK_EMAIL = '[email protected]' SERVER_EMAIL = '[email protected]' TECH_SUPPORT_EMAIL = '[email protected]' CONTACT_EMAIL = '[email protected]' BUGS_EMAIL = '[email protected]' UNIVERSITY_EMAIL = '[email protected]' PRESS_EMAIL = '[email protected]' ADMINS = () MANAGERS = ADMINS # Static content STATIC_URL = '/static/' STATIC_ROOT = ENV_ROOT / "staticfiles" STATICFILES_DIRS = [ COMMON_ROOT / "static", PROJECT_ROOT / "static", ] FAVICON_PATH = 'images/favicon.ico' # Locale/Internationalization TIME_ZONE = 'America/New_York' # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name LANGUAGE_CODE = 'en' # http://www.i18nguy.com/unicode/language-identifiers.html # these languages display right to left LANGUAGES_BIDI = ("en@rtl", "he", "ar", "fa", "ur", "fa-ir") # Sourced from http://www.localeplanet.com/icu/ and wikipedia LANGUAGES = ( ('en', u'English'), ('en@rtl', u'English (right-to-left)'), ('eo', u'Dummy Language (Esperanto)'), # Dummy languaged used for testing ('fake2', u'Fake translations'), # Another dummy language for testing (not pushed to prod) ('am', u'አማርኛ'), # Amharic ('ar', u'العربية'), # Arabic ('az', u'azərbaycanca'), # Azerbaijani ('bg-bg', u'български (България)'), # Bulgarian (Bulgaria) ('bn-bd', u'বাংলা (বাংলাদেশ)'), # Bengali (Bangladesh) ('bn-in', u'বাংলা (ভারত)'), # Bengali (India) ('bs', u'bosanski'), # Bosnian ('ca', u'Català'), # Catalan ('ca@valencia', u'Català (València)'), # Catalan (Valencia) ('cs', u'Čeština'), # Czech ('cy', u'Cymraeg'), # Welsh ('da', u'dansk'), # Danish ('de-de', u'Deutsch (Deutschland)'), # German (Germany) ('el', u'Ελληνικά'), # Greek ('en-uk', u'English (United Kingdom)'), # English (United Kingdom) ('en@lolcat', u'LOLCAT English'), # LOLCAT English ('en@pirate', u'Pirate English'), # Pirate English ('es-419', u'Español (Latinoamérica)'), # Spanish (Latin America) ('es-ar', u'Español (Argentina)'), # Spanish (Argentina) ('es-ec', u'Español (Ecuador)'), # Spanish (Ecuador) ('es-es', u'Español (España)'), # Spanish (Spain) ('es-mx', u'Español (México)'), # Spanish (Mexico) ('es-pe', u'Español (Perú)'), # Spanish (Peru) ('et-ee', u'Eesti (Eesti)'), # Estonian (Estonia) ('eu-es', u'euskara (Espainia)'), # Basque (Spain) ('fa', u'فارسی'), # Persian ('fa-ir', u'فارسی (ایران)'), # Persian (Iran) ('fi-fi', u'Suomi (Suomi)'), # Finnish (Finland) ('fil', u'Filipino'), # Filipino ('fr', u'Français'), # French ('gl', u'Galego'), # Galician ('gu', u'ગુજરાતી'), # Gujarati ('he', u'עברית'), # Hebrew ('hi', u'हिन्दी'), # Hindi ('hr', u'hrvatski'), # Croatian ('hu', u'magyar'), # Hungarian ('hy-am', u'Հայերեն (Հայաստան)'), # Armenian (Armenia) ('id', u'Bahasa Indonesia'), # Indonesian ('it-it', u'Italiano (Italia)'), # Italian (Italy) ('ja-jp', u'日本語 (日本)'), # Japanese (Japan) ('kk-kz', u'қазақ тілі (Қазақстан)'), # Kazakh (Kazakhstan) ('km-kh', u'ភាសាខ្មែរ (កម្ពុជា)'), # Khmer (Cambodia) ('kn', u'ಕನ್ನಡ'), # Kannada ('ko-kr', u'한국어 (대한민국)'), # Korean (Korea) ('lt-lt', u'Lietuvių (Lietuva)'), # Lithuanian (Lithuania) ('ml', u'മലയാളം'), # Malayalam ('mn', u'Монгол хэл'), # Mongolian ('mr', u'मराठी'), # Marathi ('ms', u'Bahasa Melayu'), # Malay ('nb', u'Norsk bokmål'), # Norwegian Bokmål ('ne', u'नेपाली'), # Nepali ('nl-nl', u'Nederlands (Nederland)'), # Dutch (Netherlands) ('or', u'ଓଡ଼ିଆ'), # Oriya ('pl', u'Polski'), # Polish ('pt-br', u'Português (Brasil)'), # Portuguese (Brazil) ('pt-pt', u'Português (Portugal)'), # Portuguese (Portugal) ('ro', u'română'), # Romanian ('ru', u'Русский'), # Russian ('si', u'සිංහල'), # Sinhala ('sk', u'Slovenčina'), # Slovak ('sl', u'Slovenščina'), # Slovenian ('sq', u'shqip'), # Albanian ('sr', u'Српски'), # Serbian ('sv', u'svenska'), # Swedish ('sw', u'Kiswahili'), # Swahili ('ta', u'தமிழ்'), # Tamil ('te', u'తెలుగు'), # Telugu ('th', u'ไทย'), # Thai ('tr-tr', u'Türkçe (Türkiye)'), # Turkish (Turkey) ('uk', u'Українська'), # Ukranian ('ur', u'اردو'), # Urdu ('vi', u'Tiếng Việt'), # Vietnamese ('uz', u'Ўзбек'), # Uzbek ('zh-cn', u'中文 (简体)'), # Chinese (China) ('zh-hk', u'中文 (香港)'), # Chinese (Hong Kong) ('zh-tw', u'中文 (台灣)'), # Chinese (Taiwan) ) LANGUAGE_DICT = dict(LANGUAGES) USE_I18N = True USE_L10N = True # Localization strings (e.g. django.po) are under this directory LOCALE_PATHS = (REPO_ROOT + '/conf/locale',) # edx-platform/conf/locale/ # Messages MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage' # Guidelines for translators TRANSLATORS_GUIDE = 'https://github.com/edx/edx-platform/blob/master/docs/en_us/developers/source/i18n_translators_guide.rst' #################################### GITHUB ####################################### # gitreload is used in LMS-workflow to pull content from github # gitreload requests are only allowed from these IP addresses, which are # the advertised public IPs of the github WebHook servers. # These are listed, eg at https://github.com/edx/edx-platform/admin/hooks ALLOWED_GITRELOAD_IPS = ['207.97.227.253', '50.57.128.197', '108.171.174.178'] #################################### AWS ####################################### # S3BotoStorage insists on a timeout for uploaded assets. We should make it # permanent instead, but rather than trying to figure out exactly where that # setting is, I'm just bumping the expiration time to something absurd (100 # years). This is only used if DEFAULT_FILE_STORAGE is overriden to use S3 # in the global settings.py AWS_QUERYSTRING_EXPIRE = 10 * 365 * 24 * 60 * 60 # 10 years ################################# SIMPLEWIKI ################################### SIMPLE_WIKI_REQUIRE_LOGIN_EDIT = True SIMPLE_WIKI_REQUIRE_LOGIN_VIEW = False ################################# WIKI ################################### from course_wiki import settings as course_wiki_settings WIKI_ACCOUNT_HANDLING = False WIKI_EDITOR = 'course_wiki.editors.CodeMirror' WIKI_SHOW_MAX_CHILDREN = 0 # We don't use the little menu that shows children of an article in the breadcrumb WIKI_ANONYMOUS = False # Don't allow anonymous access until the styling is figured out WIKI_CAN_DELETE = course_wiki_settings.CAN_DELETE WIKI_CAN_MODERATE = course_wiki_settings.CAN_MODERATE WIKI_CAN_CHANGE_PERMISSIONS = course_wiki_settings.CAN_CHANGE_PERMISSIONS WIKI_CAN_ASSIGN = course_wiki_settings.CAN_ASSIGN WIKI_USE_BOOTSTRAP_SELECT_WIDGET = False WIKI_LINK_LIVE_LOOKUPS = False WIKI_LINK_DEFAULT_LEVEL = 2 ##### Feedback submission mechanism ##### FEEDBACK_SUBMISSION_EMAIL = None ##### Zendesk ##### ZENDESK_URL = None ZENDESK_USER = None ZENDESK_API_KEY = None ##### EMBARGO ##### EMBARGO_SITE_REDIRECT_URL = None ##### shoppingcart Payment ##### PAYMENT_SUPPORT_EMAIL = '[email protected]' ##### Using cybersource by default ##### CC_PROCESSOR_NAME = 'CyberSource' CC_PROCESSOR = { 'CyberSource': { 'SHARED_SECRET': '', 'MERCHANT_ID': '', 'SERIAL_NUMBER': '', 'ORDERPAGE_VERSION': '7', 'PURCHASE_ENDPOINT': '', }, 'CyberSource2': { "PURCHASE_ENDPOINT": '', "SECRET_KEY": '', "ACCESS_KEY": '', "PROFILE_ID": '', } } # Setting for PAID_COURSE_REGISTRATION, DOES NOT AFFECT VERIFIED STUDENTS PAID_COURSE_REGISTRATION_CURRENCY = ['usd', '$'] # Members of this group are allowed to generate payment reports PAYMENT_REPORT_GENERATOR_GROUP = 'shoppingcart_report_access' ################################# open ended grading config ##################### #By setting up the default settings with an incorrect user name and password, # will get an error when attempting to connect OPEN_ENDED_GRADING_INTERFACE = { 'url': 'http://example.com/peer_grading', 'username': 'incorrect_user', 'password': 'incorrect_pass', 'staff_grading': 'staff_grading', 'peer_grading': 'peer_grading', 'grading_controller': 'grading_controller' } # Used for testing, debugging peer grading MOCK_PEER_GRADING = False # Used for testing, debugging staff grading MOCK_STAFF_GRADING = False ################################# Jasmine ################################## JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee' ################################# Deprecation warnings ##################### # Ignore deprecation warnings (so we don't clutter Jenkins builds/production) simplefilter('ignore') ################################# Middleware ################################### # List of finder classes that know how to find static files in # various locations. STATICFILES_FINDERS = ( 'staticfiles.finders.FileSystemFinder', 'staticfiles.finders.AppDirectoriesFinder', 'pipeline.finders.PipelineFinder', ) # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'edxmako.makoloader.MakoFilesystemLoader', 'edxmako.makoloader.MakoAppDirectoriesLoader', ('django.template.loaders.cached.Loader', ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', )), # 'django.template.loaders.filesystem.Loader', # 'django.template.loaders.app_directories.Loader', ) MIDDLEWARE_CLASSES = ( 'request_cache.middleware.RequestCache', 'microsite_configuration.middleware.MicrositeMiddleware', 'django_comment_client.middleware.AjaxExceptionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', # Instead of AuthenticationMiddleware, we use a cached backed version #'django.contrib.auth.middleware.AuthenticationMiddleware', 'cache_toolbox.middleware.CacheBackedAuthenticationMiddleware', 'student.middleware.UserStandingMiddleware', 'contentserver.middleware.StaticContentServer', 'crum.CurrentRequestUserMiddleware', # Adds user tags to tracking events # Must go before TrackMiddleware, to get the context set up 'user_api.middleware.UserTagsEventContextMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'track.middleware.TrackMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'splash.middleware.SplashMiddleware', # Allows us to dark-launch particular languages 'dark_lang.middleware.DarkLangMiddleware', 'geoinfo.middleware.CountryMiddleware', 'embargo.middleware.EmbargoMiddleware', # Allows us to set user preferences # should be after DarkLangMiddleware 'lang_pref.middleware.LanguagePreferenceMiddleware', # Detects user-requested locale from 'accept-language' header in http request 'django.middleware.locale.LocaleMiddleware', 'django.middleware.transaction.TransactionMiddleware', # 'debug_toolbar.middleware.DebugToolbarMiddleware', 'django_comment_client.utils.ViewNameMiddleware', 'codejail.django_integration.ConfigureCodeJailMiddleware', # catches any uncaught RateLimitExceptions and returns a 403 instead of a 500 'ratelimitbackend.middleware.RateLimitMiddleware', # needs to run after locale middleware (or anything that modifies the request context) 'edxmako.middleware.MakoMiddleware', # for expiring inactive sessions 'session_inactivity_timeout.middleware.SessionInactivityTimeout', # use Django built in clickjacking protection 'django.middleware.clickjacking.XFrameOptionsMiddleware', # to redirected unenrolled students to the course info page 'courseware.middleware.RedirectUnenrolledMiddleware', 'course_wiki.middleware.WikiAccessMiddleware', ) # Clickjacking protection can be enabled by setting this to 'DENY' X_FRAME_OPTIONS = 'ALLOW' ############################### Pipeline ####################################### STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' from rooted_paths import rooted_glob courseware_js = ( [ 'coffee/src/' + pth + '.js' for pth in ['courseware', 'histogram', 'navigation', 'time'] ] + ['js/' + pth + '.js' for pth in ['ajax-error']] + sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/modules/**/*.js')) ) # Before a student accesses courseware, we do not # need many of the JS dependencies. This includes # only the dependencies used everywhere in the LMS # (including the dashboard/account/profile pages) # Currently, this partially duplicates the "main vendor" # JavaScript file, so only one of the two should be included # on a page at any time. # In the future, we will likely refactor this to use # RequireJS and an optimizer. base_vendor_js = [ 'js/vendor/jquery.min.js', 'js/vendor/jquery.cookie.js', 'js/vendor/underscore-min.js' ] main_vendor_js = base_vendor_js + [ 'js/vendor/require.js', 'js/RequireJS-namespace-undefine.js', 'js/vendor/json2.js', 'js/vendor/jquery-ui.min.js', 'js/vendor/jquery.qtip.min.js', 'js/vendor/swfobject/swfobject.js', 'js/vendor/jquery.ba-bbq.min.js', 'js/vendor/ova/annotator-full.js', 'js/vendor/ova/annotator-full-firebase-auth.js', 'js/vendor/ova/video.dev.js', 'js/vendor/ova/vjs.youtube.js', 'js/vendor/ova/rangeslider.js', 'js/vendor/ova/share-annotator.js', 'js/vendor/ova/richText-annotator.js', 'js/vendor/ova/reply-annotator.js', 'js/vendor/ova/tags-annotator.js', 'js/vendor/ova/flagging-annotator.js', 'js/vendor/ova/diacritic-annotator.js', 'js/vendor/ova/grouping-annotator.js', 'js/vendor/ova/jquery-Watch.js', 'js/vendor/ova/openseadragon.js', 'js/vendor/ova/OpenSeaDragonAnnotation.js', 'js/vendor/ova/ova.js', 'js/vendor/ova/catch/js/catch.js', 'js/vendor/ova/catch/js/handlebars-1.1.2.js', 'js/vendor/URI.min.js', ] dashboard_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/dashboard/**/*.js')) discussion_js = sorted(rooted_glob(COMMON_ROOT / 'static', 'coffee/src/discussion/**/*.js')) staff_grading_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/staff_grading/**/*.js')) open_ended_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/open_ended/**/*.js')) notes_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/notes/**/*.js')) instructor_dash_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/instructor_dashboard/**/*.js')) # JavaScript used by the student account and profile pages # These are not courseware, so they do not need many of the courseware-specific # JavaScript modules. student_account_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/student_account/**/*.js')) student_profile_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/student_profile/**/*.js')) PIPELINE_CSS = { 'style-vendor': { 'source_filenames': [ 'css/vendor/font-awesome.css', 'css/vendor/jquery.qtip.min.css', 'css/vendor/responsive-carousel/responsive-carousel.css', 'css/vendor/responsive-carousel/responsive-carousel.slide.css', ], 'output_filename': 'css/lms-style-vendor.css', }, 'style-vendor-tinymce-content': { 'source_filenames': [ 'js/vendor/tinymce/js/tinymce/skins/studio-tmce4/content.min.css' ], 'output_filename': 'css/lms-style-vendor-tinymce-content.css', }, 'style-vendor-tinymce-skin': { 'source_filenames': [ 'js/vendor/tinymce/js/tinymce/skins/studio-tmce4/skin.min.css' ], 'output_filename': 'css/lms-style-vendor-tinymce-skin.css', }, 'style-app': { 'source_filenames': [ 'sass/application.css', 'sass/ie.css' ], 'output_filename': 'css/lms-style-app.css', }, 'style-app-extend1': { 'source_filenames': [ 'sass/application-extend1.css', ], 'output_filename': 'css/lms-style-app-extend1.css', }, 'style-app-extend2': { 'source_filenames': [ 'sass/application-extend2.css', ], 'output_filename': 'css/lms-style-app-extend2.css', }, 'style-app-rtl': { 'source_filenames': [ 'sass/application-rtl.css', 'sass/ie-rtl.css' ], 'output_filename': 'css/lms-style-app-rtl.css', }, 'style-app-extend1-rtl': { 'source_filenames': [ 'sass/application-extend1-rtl.css', ], 'output_filename': 'css/lms-style-app-extend1-rtl.css', }, 'style-app-extend2-rtl': { 'source_filenames': [ 'sass/application-extend2-rtl.css', ], 'output_filename': 'css/lms-style-app-extend2-rtl.css', }, 'style-course-vendor': { 'source_filenames': [ 'js/vendor/CodeMirror/codemirror.css', 'css/vendor/jquery.treeview.css', 'css/vendor/ui-lightness/jquery-ui-1.8.22.custom.css', ], 'output_filename': 'css/lms-style-course-vendor.css', }, 'style-course': { 'source_filenames': [ 'sass/course.css', 'xmodule/modules.css', ], 'output_filename': 'css/lms-style-course.css', }, 'style-course-rtl': { 'source_filenames': [ 'sass/course-rtl.css', 'xmodule/modules.css', ], 'output_filename': 'css/lms-style-course-rtl.css', }, 'style-xmodule-annotations': { 'source_filenames': [ 'css/vendor/ova/annotator.css', 'css/vendor/ova/edx-annotator.css', 'css/vendor/ova/video-js.min.css', 'css/vendor/ova/rangeslider.css', 'css/vendor/ova/share-annotator.css', 'css/vendor/ova/richText-annotator.css', 'css/vendor/ova/tags-annotator.css', 'css/vendor/ova/flagging-annotator.css', 'css/vendor/ova/diacritic-annotator.css', 'css/vendor/ova/grouping-annotator.css', 'css/vendor/ova/ova.css', 'js/vendor/ova/catch/css/main.css' ], 'output_filename': 'css/lms-style-xmodule-annotations.css', }, } common_js = set(rooted_glob(COMMON_ROOT / 'static', 'coffee/src/**/*.js')) - set(courseware_js + discussion_js + staff_grading_js + open_ended_js + notes_js + instructor_dash_js) project_js = set(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/**/*.js')) - set(courseware_js + discussion_js + staff_grading_js + open_ended_js + notes_js + instructor_dash_js) PIPELINE_JS = { 'application': { # Application will contain all paths not in courseware_only_js 'source_filenames': sorted(common_js) + sorted(project_js) + [ 'js/form.ext.js', 'js/my_courses_dropdown.js', 'js/toggle_login_modal.js', 'js/sticky_filter.js', 'js/query-params.js', 'js/src/utility.js', 'js/src/accessibility_tools.js', 'js/src/ie_shim.js', 'js/src/string_utils.js', ], 'output_filename': 'js/lms-application.js', }, 'courseware': { 'source_filenames': courseware_js, 'output_filename': 'js/lms-courseware.js', }, 'base_vendor': { 'source_filenames': base_vendor_js, 'output_filename': 'js/lms-base-vendor.js', }, 'main_vendor': { 'source_filenames': main_vendor_js, 'output_filename': 'js/lms-main_vendor.js', }, 'module-descriptor-js': { 'source_filenames': rooted_glob(COMMON_ROOT / 'static/', 'xmodule/descriptors/js/*.js'), 'output_filename': 'js/lms-module-descriptors.js', }, 'module-js': { 'source_filenames': rooted_glob(COMMON_ROOT / 'static', 'xmodule/modules/js/*.js'), 'output_filename': 'js/lms-modules.js', }, 'discussion': { 'source_filenames': discussion_js, 'output_filename': 'js/discussion.js', }, 'staff_grading': { 'source_filenames': staff_grading_js, 'output_filename': 'js/staff_grading.js', }, 'open_ended': { 'source_filenames': open_ended_js, 'output_filename': 'js/open_ended.js', }, 'notes': { 'source_filenames': notes_js, 'output_filename': 'js/notes.js', }, 'instructor_dash': { 'source_filenames': instructor_dash_js, 'output_filename': 'js/instructor_dash.js', }, 'dashboard': { 'source_filenames': dashboard_js, 'output_filename': 'js/dashboard.js' }, 'student_account': { 'source_filenames': student_account_js, 'output_filename': 'js/student_account.js' }, 'student_profile': { 'source_filenames': student_profile_js, 'output_filename': 'js/student_profile.js' }, } PIPELINE_DISABLE_WRAPPER = True # Compile all coffee files in course data directories if they are out of date. # TODO: Remove this once we move data into Mongo. This is only temporary while # course data directories are still in use. if os.path.isdir(DATA_DIR): for course_dir in os.listdir(DATA_DIR): js_dir = DATA_DIR / course_dir / "js" if not os.path.isdir(js_dir): continue for filename in os.listdir(js_dir): if filename.endswith('coffee'): new_filename = os.path.splitext(filename)[0] + ".js" if os.path.exists(js_dir / new_filename): coffee_timestamp = os.stat(js_dir / filename).st_mtime js_timestamp = os.stat(js_dir / new_filename).st_mtime if coffee_timestamp <= js_timestamp: continue os.system("rm %s" % (js_dir / new_filename)) os.system("coffee -c %s" % (js_dir / filename)) PIPELINE_CSS_COMPRESSOR = None PIPELINE_JS_COMPRESSOR = "pipeline.compressors.uglifyjs.UglifyJSCompressor" STATICFILES_IGNORE_PATTERNS = ( "sass/*", "coffee/*", # Symlinks used by js-test-tool "xmodule_js", "common_static", ) PIPELINE_UGLIFYJS_BINARY = 'node_modules/.bin/uglifyjs' # Setting that will only affect the edX version of django-pipeline until our changes are merged upstream PIPELINE_COMPILE_INPLACE = True ################################# CELERY ###################################### # Message configuration CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json' CELERY_MESSAGE_COMPRESSION = 'gzip' # Results configuration CELERY_IGNORE_RESULT = False CELERY_STORE_ERRORS_EVEN_IF_IGNORED = True # Events configuration CELERY_TRACK_STARTED = True CELERY_SEND_EVENTS = True CELERY_SEND_TASK_SENT_EVENT = True # Exchange configuration CELERY_DEFAULT_EXCHANGE = 'edx.core' CELERY_DEFAULT_EXCHANGE_TYPE = 'direct' # Queues configuration HIGH_PRIORITY_QUEUE = 'edx.core.high' DEFAULT_PRIORITY_QUEUE = 'edx.core.default' LOW_PRIORITY_QUEUE = 'edx.core.low' HIGH_MEM_QUEUE = 'edx.core.high_mem' CELERY_QUEUE_HA_POLICY = 'all' CELERY_CREATE_MISSING_QUEUES = True CELERY_DEFAULT_QUEUE = DEFAULT_PRIORITY_QUEUE CELERY_DEFAULT_ROUTING_KEY = DEFAULT_PRIORITY_QUEUE CELERY_QUEUES = { HIGH_PRIORITY_QUEUE: {}, LOW_PRIORITY_QUEUE: {}, DEFAULT_PRIORITY_QUEUE: {}, HIGH_MEM_QUEUE: {}, } # let logging work as configured: CELERYD_HIJACK_ROOT_LOGGER = False ################################ Bulk Email ################################### # Suffix used to construct 'from' email address for bulk emails. # A course-specific identifier is prepended. BULK_EMAIL_DEFAULT_FROM_EMAIL = '[email protected]' # Parameters for breaking down course enrollment into subtasks. BULK_EMAIL_EMAILS_PER_TASK = 100 # Initial delay used for retrying tasks. Additional retries use # longer delays. Value is in seconds. BULK_EMAIL_DEFAULT_RETRY_DELAY = 30 # Maximum number of retries per task for errors that are not related # to throttling. BULK_EMAIL_MAX_RETRIES = 5 # Maximum number of retries per task for errors that are related to # throttling. If this is not set, then there is no cap on such retries. BULK_EMAIL_INFINITE_RETRY_CAP = 1000 # We want Bulk Email running on the high-priority queue, so we define the # routing key that points to it. At the moment, the name is the same. BULK_EMAIL_ROUTING_KEY = HIGH_PRIORITY_QUEUE # Flag to indicate if individual email addresses should be logged as they are sent # a bulk email message. BULK_EMAIL_LOG_SENT_EMAILS = False # Delay in seconds to sleep between individual mail messages being sent, # when a bulk email task is retried for rate-related reasons. Choose this # value depending on the number of workers that might be sending email in # parallel, and what the SES rate is. BULK_EMAIL_RETRY_DELAY_BETWEEN_SENDS = 0.02 ############################## Video ########################################## YOUTUBE = { # YouTube JavaScript API 'API': 'www.youtube.com/iframe_api', # URL to test YouTube availability 'TEST_URL': 'gdata.youtube.com/feeds/api/videos/', # Current youtube api for requesting transcripts. # For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g. 'TEXT_API': { 'url': 'video.google.com/timedtext', 'params': { 'lang': 'en', 'v': 'set_youtube_id_of_11_symbols_here', }, }, } ################################### APPS ###################################### INSTALLED_APPS = ( # Standard ones that are always installed... 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.sites', 'djcelery', 'south', # Database-backed configuration 'config_models', # Monitor the status of services 'service_status', # For asset pipelining 'edxmako', 'pipeline', 'staticfiles', 'static_replace', # Our courseware 'circuit', 'courseware', 'student', 'static_template_view', 'staticbook', 'track', 'eventtracking.django', 'util', 'certificates', 'dashboard', 'instructor', 'instructor_task', 'open_ended_grading', 'psychometrics', 'licenses', 'course_groups', 'bulk_email', # External auth (OpenID, shib) 'external_auth', 'django_openid_auth', # OAuth2 Provider 'provider', 'provider.oauth2', 'oauth2_provider', # For the wiki 'wiki', # The new django-wiki from benjaoming 'django_notify', 'course_wiki', # Our customizations 'mptt', 'sekizai', #'wiki.plugins.attachments', 'wiki.plugins.links', 'wiki.plugins.notifications', 'course_wiki.plugins.markdownedx', # Foldit integration 'foldit', # For testing 'django.contrib.admin', # only used in DEBUG mode 'django_nose', 'debug', # Discussion forums 'django_comment_client', 'django_comment_common', 'notes', # Splash screen 'splash', # Monitoring 'datadog', # User API 'rest_framework', 'user_api', # Shopping cart 'shoppingcart', # Notification preferences setting 'notification_prefs', 'notifier_api', # Different Course Modes 'course_modes', # Student Identity Verification 'verify_student', # Dark-launching languages 'dark_lang', # Microsite configuration 'microsite_configuration', # Student Identity Reverification 'reverification', 'embargo', # Monitoring functionality 'monitoring', # Course action state 'course_action_state', # Additional problem types 'edx_jsme', # Molecular Structure # Country list 'django_countries', # edX Mobile API 'mobile_api', # Surveys 'survey', 'parent_eng', # 'screamshot', # 'ParerntApp', ) ######################### MARKETING SITE ############################### EDXMKTG_COOKIE_NAME = 'edxloggedin' MKTG_URLS = {} MKTG_URL_LINK_MAP = { 'ABOUT': 'about_edx', 'CONTACT': 'contact', 'FAQ': 'help_edx', 'COURSES': 'courses', 'ROOT': 'root', 'TOS': 'tos', 'HONOR': 'honor', 'PRIVACY': 'privacy_edx', 'JOBS': 'jobs', 'NEWS': 'news', 'PRESS': 'press', 'BLOG': 'edx-blog', 'DONATE': 'donate', # Verified Certificates 'WHAT_IS_VERIFIED_CERT': 'verified-certificate', } ################# Student Verification ################# VERIFY_STUDENT = { "DAYS_GOOD_FOR": 365, # How many days is a verficiation good for? } ### This enables the Metrics tab for the Instructor dashboard ########### FEATURES['CLASS_DASHBOARD'] = False if FEATURES.get('CLASS_DASHBOARD'): INSTALLED_APPS += ('class_dashboard',) ######################## CAS authentication ########################### if FEATURES.get('AUTH_USE_CAS'): CAS_SERVER_URL = 'https://provide_your_cas_url_here' AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', 'django_cas.backends.CASBackend', ) INSTALLED_APPS += ('django_cas',) MIDDLEWARE_CLASSES += ('django_cas.middleware.CASMiddleware',) ###################### Registration ################################## # For each of the fields, give one of the following values: # - 'required': to display the field, and make it mandatory # - 'optional': to display the field, and make it non-mandatory # - 'hidden': to not display the field REGISTRATION_EXTRA_FIELDS = { 'level_of_education': 'optional', 'gender': 'optional', 'year_of_birth': 'optional', 'mailing_address': 'optional', 'goals': 'optional', 'honor_code': 'required', 'city': 'hidden', 'country': 'hidden', } ########################## CERTIFICATE NAME ######################## CERT_NAME_SHORT = "Certificate" CERT_NAME_LONG = "Certificate of Achievement" ###################### Grade Downloads ###################### GRADES_DOWNLOAD_ROUTING_KEY = HIGH_MEM_QUEUE GRADES_DOWNLOAD = { 'STORAGE_TYPE': 'localfs', 'BUCKET': 'edx-grades', 'ROOT_PATH': '/tmp/edx-s3/grades', } ######################## PROGRESS SUCCESS BUTTON ############################## # The following fields are available in the URL: {course_id} {student_id} PROGRESS_SUCCESS_BUTTON_URL = 'http://<domain>/<path>/{course_id}' PROGRESS_SUCCESS_BUTTON_TEXT_OVERRIDE = None #### PASSWORD POLICY SETTINGS ##### PASSWORD_MIN_LENGTH = None PASSWORD_MAX_LENGTH = None PASSWORD_COMPLEXITY = {} PASSWORD_DICTIONARY_EDIT_DISTANCE_THRESHOLD = None PASSWORD_DICTIONARY = [] ##################### LinkedIn ##################### INSTALLED_APPS += ('django_openid_auth',) ############################ LinkedIn Integration ############################# INSTALLED_APPS += ('linkedin',) LINKEDIN_API = { 'EMAIL_WHITELIST': [], 'COMPANY_ID': '2746406', } ############################ ORA 2 ############################################ # By default, don't use a file prefix ORA2_FILE_PREFIX = None # Default File Upload Storage bucket and prefix. Used by the FileUpload Service. FILE_UPLOAD_STORAGE_BUCKET_NAME = 'edxuploads' FILE_UPLOAD_STORAGE_PREFIX = 'submissions_attachments' ##### ACCOUNT LOCKOUT DEFAULT PARAMETERS ##### MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED = 5 MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS = 15 * 60 ##### LMS DEADLINE DISPLAY TIME_ZONE ####### TIME_ZONE_DISPLAYED_FOR_DEADLINES = 'UTC' # Source: # http://loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt according to http://en.wikipedia.org/wiki/ISO_639-1 ALL_LANGUAGES = ( [u"aa", u"Afar"], [u"ab", u"Abkhazian"], [u"af", u"Afrikaans"], [u"ak", u"Akan"], [u"sq", u"Albanian"], [u"am", u"Amharic"], [u"ar", u"Arabic"], [u"an", u"Aragonese"], [u"hy", u"Armenian"], [u"as", u"Assamese"], [u"av", u"Avaric"], [u"ae", u"Avestan"], [u"ay", u"Aymara"], [u"az", u"Azerbaijani"], [u"ba", u"Bashkir"], [u"bm", u"Bambara"], [u"eu", u"Basque"], [u"be", u"Belarusian"], [u"bn", u"Bengali"], [u"bh", u"Bihari languages"], [u"bi", u"Bislama"], [u"bs", u"Bosnian"], [u"br", u"Breton"], [u"bg", u"Bulgarian"], [u"my", u"Burmese"], [u"ca", u"Catalan"], [u"ch", u"Chamorro"], [u"ce", u"Chechen"], [u"zh", u"Chinese"], [u"cu", u"Church Slavic"], [u"cv", u"Chuvash"], [u"kw", u"Cornish"], [u"co", u"Corsican"], [u"cr", u"Cree"], [u"cs", u"Czech"], [u"da", u"Danish"], [u"dv", u"Divehi"], [u"nl", u"Dutch"], [u"dz", u"Dzongkha"], [u"en", u"English"], [u"eo", u"Esperanto"], [u"et", u"Estonian"], [u"ee", u"Ewe"], [u"fo", u"Faroese"], [u"fj", u"Fijian"], [u"fi", u"Finnish"], [u"fr", u"French"], [u"fy", u"Western Frisian"], [u"ff", u"Fulah"], [u"ka", u"Georgian"], [u"de", u"German"], [u"gd", u"Gaelic"], [u"ga", u"Irish"], [u"gl", u"Galician"], [u"gv", u"Manx"], [u"el", u"Greek"], [u"gn", u"Guarani"], [u"gu", u"Gujarati"], [u"ht", u"Haitian"], [u"ha", u"Hausa"], [u"he", u"Hebrew"], [u"hz", u"Herero"], [u"hi", u"Hindi"], [u"ho", u"Hiri Motu"], [u"hr", u"Croatian"], [u"hu", u"Hungarian"], [u"ig", u"Igbo"], [u"is", u"Icelandic"], [u"io", u"Ido"], [u"ii", u"Sichuan Yi"], [u"iu", u"Inuktitut"], [u"ie", u"Interlingue"], [u"ia", u"Interlingua"], [u"id", u"Indonesian"], [u"ik", u"Inupiaq"], [u"it", u"Italian"], [u"jv", u"Javanese"], [u"ja", u"Japanese"], [u"kl", u"Kalaallisut"], [u"kn", u"Kannada"], [u"ks", u"Kashmiri"], [u"kr", u"Kanuri"], [u"kk", u"Kazakh"], [u"km", u"Central Khmer"], [u"ki", u"Kikuyu"], [u"rw", u"Kinyarwanda"], [u"ky", u"Kirghiz"], [u"kv", u"Komi"], [u"kg", u"Kongo"], [u"ko", u"Korean"], [u"kj", u"Kuanyama"], [u"ku", u"Kurdish"], [u"lo", u"Lao"], [u"la", u"Latin"], [u"lv", u"Latvian"], [u"li", u"Limburgan"], [u"ln", u"Lingala"], [u"lt", u"Lithuanian"], [u"lb", u"Luxembourgish"], [u"lu", u"Luba-Katanga"], [u"lg", u"Ganda"], [u"mk", u"Macedonian"], [u"mh", u"Marshallese"], [u"ml", u"Malayalam"], [u"mi", u"Maori"], [u"mr", u"Marathi"], [u"ms", u"Malay"], [u"mg", u"Malagasy"], [u"mt", u"Maltese"], [u"mn", u"Mongolian"], [u"na", u"Nauru"], [u"nv", u"Navajo"], [u"nr", u"Ndebele, South"], [u"nd", u"Ndebele, North"], [u"ng", u"Ndonga"], [u"ne", u"Nepali"], [u"nn", u"Norwegian Nynorsk"], [u"nb", u"Bokmål, Norwegian"], [u"no", u"Norwegian"], [u"ny", u"Chichewa"], [u"oc", u"Occitan"], [u"oj", u"Ojibwa"], [u"or", u"Oriya"], [u"om", u"Oromo"], [u"os", u"Ossetian"], [u"pa", u"Panjabi"], [u"fa", u"Persian"], [u"pi", u"Pali"], [u"pl", u"Polish"], [u"pt", u"Portuguese"], [u"ps", u"Pushto"], [u"qu", u"Quechua"], [u"rm", u"Romansh"], [u"ro", u"Romanian"], [u"rn", u"Rundi"], [u"ru", u"Russian"], [u"sg", u"Sango"], [u"sa", u"Sanskrit"], [u"si", u"Sinhala"], [u"sk", u"Slovak"], [u"sl", u"Slovenian"], [u"se", u"Northern Sami"], [u"sm", u"Samoan"], [u"sn", u"Shona"], [u"sd", u"Sindhi"], [u"so", u"Somali"], [u"st", u"Sotho, Southern"], [u"es", u"Spanish"], [u"sc", u"Sardinian"], [u"sr", u"Serbian"], [u"ss", u"Swati"], [u"su", u"Sundanese"], [u"sw", u"Swahili"], [u"sv", u"Swedish"], [u"ty", u"Tahitian"], [u"ta", u"Tamil"], [u"tt", u"Tatar"], [u"te", u"Telugu"], [u"tg", u"Tajik"], [u"tl", u"Tagalog"], [u"th", u"Thai"], [u"bo", u"Tibetan"], [u"ti", u"Tigrinya"], [u"to", u"Tonga (Tonga Islands)"], [u"tn", u"Tswana"], [u"ts", u"Tsonga"], [u"tk", u"Turkmen"], [u"tr", u"Turkish"], [u"tw", u"Twi"], [u"ug", u"Uighur"], [u"uk", u"Ukrainian"], [u"ur", u"Urdu"], [u"uz", u"Uzbek"], [u"ve", u"Venda"], [u"vi", u"Vietnamese"], [u"vo", u"Volapük"], [u"cy", u"Welsh"], [u"wa", u"Walloon"], [u"wo", u"Wolof"], [u"xh", u"Xhosa"], [u"yi", u"Yiddish"], [u"yo", u"Yoruba"], [u"za", u"Zhuang"], [u"zu", u"Zulu"] ) ### Apps only installed in some instances OPTIONAL_APPS = ( 'mentoring', # edx-ora2 'submissions', 'openassessment', 'openassessment.assessment', 'openassessment.fileupload', 'openassessment.workflow', 'openassessment.xblock', # edxval 'edxval' ) for app_name in OPTIONAL_APPS: # First attempt to only find the module rather than actually importing it, # to avoid circular references - only try to import if it can't be found # by find_module, which doesn't work with import hooks try: imp.find_module(app_name) except ImportError: try: __import__(app_name) except ImportError: continue INSTALLED_APPS += (app_name,) # Stub for third_party_auth options. # See common/djangoapps/third_party_auth/settings.py for configuration details. THIRD_PARTY_AUTH = {} ### ADVANCED_SECURITY_CONFIG # Empty by default ADVANCED_SECURITY_CONFIG = {} ### External auth usage -- prefixes for ENROLLMENT_DOMAIN SHIBBOLETH_DOMAIN_PREFIX = 'shib:' OPENID_DOMAIN_PREFIX = 'openid:' ### Analytics Data API + Dashboard (Insights) settings ANALYTICS_DATA_URL = "" ANALYTICS_DATA_TOKEN = "" ANALYTICS_DASHBOARD_URL = "" ANALYTICS_DASHBOARD_NAME = PLATFORM_NAME + " Insights" # REGISTRATION CODES DISPLAY INFORMATION SUBTITUTIONS IN THE INVOICE ATTACHMENT INVOICE_CORP_ADDRESS = "Please place your corporate address\nin this configuration" INVOICE_PAYMENT_INSTRUCTIONS = "This is where you can\nput directions on how people\nbuying registration codes" # Country code overrides # Used by django-countries COUNTRIES_OVERRIDE = { "TW": _("Taiwan"), } # which access.py permission name to check in order to determine if a course is visible in # the course catalog. We default this to the legacy permission 'see_exists'. COURSE_CATALOG_VISIBILITY_PERMISSION = 'see_exists' # which access.py permission name to check in order to determine if a course about page is # visible. We default this to the legacy permission 'see_exists'. COURSE_ABOUT_VISIBILITY_PERMISSION = 'see_exists'
dsajkl/123
lms/envs/common.py
Python
agpl-3.0
62,841
0.002803
import importlib.util import logging import os import warnings from os import getenv from typing import Any, Optional, Mapping, ClassVar log = logging.getLogger(__name__) default_settings_dict = { 'connect_timeout_seconds': 15, 'read_timeout_seconds': 30, 'max_retry_attempts': 3, 'base_backoff_ms': 25, 'region': None, 'max_pool_connections': 10, 'extra_headers': None, } OVERRIDE_SETTINGS_PATH = getenv('PYNAMODB_CONFIG', '/etc/pynamodb/global_default_settings.py') def _load_module(name, path): # https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly spec = importlib.util.spec_from_file_location(name, path) module = importlib.util.module_from_spec(spec) # type: ignore spec.loader.exec_module(module) # type: ignore return module override_settings = {} if os.path.isfile(OVERRIDE_SETTINGS_PATH): override_settings = _load_module('__pynamodb_override_settings__', OVERRIDE_SETTINGS_PATH) if hasattr(override_settings, 'session_cls') or hasattr(override_settings, 'request_timeout_seconds'): warnings.warn("The `session_cls` and `request_timeout_second` options are no longer supported") log.info('Override settings for pynamo available {}'.format(OVERRIDE_SETTINGS_PATH)) else: log.info('Override settings for pynamo not available {}'.format(OVERRIDE_SETTINGS_PATH)) log.info('Using Default settings value') def get_settings_value(key: str) -> Any: """ Fetches the value from the override file. If the value is not present, then tries to fetch the values from constants.py """ if hasattr(override_settings, key): return getattr(override_settings, key) if key in default_settings_dict: return default_settings_dict[key] return None class OperationSettings: """ Settings applicable to an individual operation. When set, the settings in this object supersede the global and model settings. """ default: ClassVar['OperationSettings'] def __init__(self, *, extra_headers: Optional[Mapping[str, Optional[str]]] = None) -> None: """ Initializes operation settings. :param extra_headers: if set, extra headers to add to the HTTP request. The headers are merged on top of extra headers derived from settings or models' Meta classes. To delete a header, set its value to `None`. """ self.extra_headers = extra_headers OperationSettings.default = OperationSettings()
pynamodb/PynamoDB
pynamodb/settings.py
Python
mit
2,509
0.004384
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2001 David R. Hampton # Copyright (C) 2001-2006 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # Copyright (C) 2010 Jakim Friant # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # #------------------------------------------------------------------------- # # GRAMPS modules # #------------------------------------------------------------------------- from gramps.gen.utils.grampslocale import GrampsLocale from gramps.gen.display.name import NameDisplay #------------------------------------------------------------------------- # # Report # #------------------------------------------------------------------------- class Report(object): """ The Report base class. This is a base class for generating customized reports. It cannot be used as is, but it can be easily sub-classed to create a functional report generator. """ def __init__(self, database, options_class, user): self.database = database self.options_class = options_class self.doc = options_class.get_document() creator = database.get_researcher().get_name() self.doc.set_creator(creator) output = options_class.get_output() if output: self.standalone = True self.doc.open(options_class.get_output()) else: self.standalone = False def begin_report(self): pass def set_locale(self, language): """ Set the translator to one selected with stdoptions.add_localization_option(). """ if language == GrampsLocale.DEFAULT_TRANSLATION_STR: language = None locale = GrampsLocale(lang=language) self._ = locale.translation.gettext self._get_date = locale.get_date self._get_type = locale.get_type self._dd = locale.date_displayer self._name_display = NameDisplay(locale) # a legacy/historical name return locale def write_report(self): pass def end_report(self): if self.standalone: self.doc.close()
pmghalvorsen/gramps_branch
gramps/gen/plug/report/_reportbase.py
Python
gpl-2.0
2,801
0.002499
# fMBT, free Model Based Testing tool # Copyright (c) 2013, Intel Corporation. # # Author: [email protected] # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU Lesser General Public License, # version 2.1, as published by the Free Software Foundation. # # This program is distributed in the hope 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., # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. import client import server import messages import socket import subprocess import urlparse as _urlparse from messages import Exec, Exec_rv # Connection = client.Connection default_port = 8089 # PY class PythonShareError(Exception): pass class AuthenticationError(PythonShareError): pass class RemoteExecError(PythonShareError): pass class RemoteEvalError(PythonShareError): pass class AsyncStatus(object): pass class InProgress(AsyncStatus): pass # Misc helpers for client and server def _close(*args): for a in args: if a: try: a.close() except (socket.error, IOError): pass def connection(hostspec, password=None): if not "://" in hostspec: hostspec = "socket://" + hostspec scheme, netloc, _, _, _ = _urlparse.urlsplit(hostspec) if scheme == "socket": # Parse URL if "@" in netloc: userinfo, hostport = netloc.split("@", 1) else: userinfo, hostport = "", netloc if ":" in userinfo: userinfo_user, userinfo_password = userinfo.split(":", 1) else: userinfo_user, userinfo_password = userinfo, None if ":" in hostport: host, port = hostport.split(":") else: host, port = hostport, default_port # If userinfo has been given, authenticate using it. # Allow forms # socket://password@host:port # socket://dontcare:password@host:port if password == None and userinfo: if userinfo_password: password = userinfo_password else: password = userinfo return client.Connection(host, int(port), password=password) elif scheme == "shell": p = subprocess.Popen(hostspec[len("shell://"):], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) return client.Connection(p.stdout, p.stdin) else: raise ValueError('invalid URI "%s"' % (hostspec,))
pombreda/fMBT
pythonshare/pythonshare/__init__.py
Python
lgpl-2.1
2,903
0.004478
# -*- coding: utf-8 -*- #from django.contrib import admin
AdrianRibao/notifintime
notifintime/admin.py
Python
bsd-3-clause
58
0.017241
# =================================================================== # # Copyright (c) 2014, Legrandin <[email protected]> # All rights reserved. # # 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. # # 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 HOLDER 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. # =================================================================== from Cryptodome.Util.py3compat import bord from Cryptodome.Util._raw_api import (load_pycryptodome_raw_lib, VoidPointer, SmartPointer, create_string_buffer, get_raw_buffer, c_size_t, c_uint8_ptr) _raw_md2_lib = load_pycryptodome_raw_lib( "Cryptodome.Hash._MD2", """ int md2_init(void **shaState); int md2_destroy(void *shaState); int md2_update(void *hs, const uint8_t *buf, size_t len); int md2_digest(const void *shaState, uint8_t digest[20]); int md2_copy(const void *src, void *dst); """) class MD2Hash(object): """An MD2 hash object. Do not instantiate directly. Use the :func:`new` function. :ivar oid: ASN.1 Object ID :vartype oid: string :ivar block_size: the size in bytes of the internal message block, input to the compression function :vartype block_size: integer :ivar digest_size: the size in bytes of the resulting hash :vartype digest_size: integer """ # The size of the resulting hash in bytes. digest_size = 16 # The internal block size of the hash algorithm in bytes. block_size = 64 # ASN.1 Object ID oid = "1.2.840.113549.2.2" def __init__(self, data=None): state = VoidPointer() result = _raw_md2_lib.md2_init(state.address_of()) if result: raise ValueError("Error %d while instantiating MD2" % result) self._state = SmartPointer(state.get(), _raw_md2_lib.md2_destroy) if data: self.update(data) def update(self, data): """Continue hashing of a message by consuming the next chunk of data. Args: data (byte string/byte array/memoryview): The next chunk of the message being hashed. """ result = _raw_md2_lib.md2_update(self._state.get(), c_uint8_ptr(data), c_size_t(len(data))) if result: raise ValueError("Error %d while instantiating MD2" % result) def digest(self): """Return the **binary** (non-printable) digest of the message that has been hashed so far. :return: The hash digest, computed over the data processed so far. Binary form. :rtype: byte string """ bfr = create_string_buffer(self.digest_size) result = _raw_md2_lib.md2_digest(self._state.get(), bfr) if result: raise ValueError("Error %d while instantiating MD2" % result) return get_raw_buffer(bfr) def hexdigest(self): """Return the **printable** digest of the message that has been hashed so far. :return: The hash digest, computed over the data processed so far. Hexadecimal encoded. :rtype: string """ return "".join(["%02x" % bord(x) for x in self.digest()]) def copy(self): """Return a copy ("clone") of the hash object. The copy will have the same internal state as the original hash object. This can be used to efficiently compute the digests of strings that share a common initial substring. :return: A hash object of the same type """ clone = MD2Hash() result = _raw_md2_lib.md2_copy(self._state.get(), clone._state.get()) if result: raise ValueError("Error %d while copying MD2" % result) return clone def new(self, data=None): return MD2Hash(data) def new(data=None): """Create a new hash object. :parameter data: Optional. The very first chunk of the message to hash. It is equivalent to an early call to :meth:`MD2Hash.update`. :type data: byte string/byte array/memoryview :Return: A :class:`MD2Hash` hash object """ return MD2Hash().new(data) # The size of the resulting hash in bytes. digest_size = MD2Hash.digest_size # The internal block size of the hash algorithm in bytes. block_size = MD2Hash.block_size
hclivess/Stallion
nuitka/Cryptodome/Hash/MD2.py
Python
gpl-3.0
6,130
0.001305
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh.""" # pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long from import_shims.warn import warn_deprecated_import warn_deprecated_import('grades.exceptions', 'lms.djangoapps.grades.exceptions') from lms.djangoapps.grades.exceptions import *
eduNEXT/edunext-platform
import_shims/lms/grades/exceptions.py
Python
agpl-3.0
374
0.008021
import kronos import random @kronos.register('0 0 * * *') def complain(): complaints = [ "I forgot to migrate our applications's cron jobs to our new server! Darn!", "I'm out of complaints! Damnit!" ] print random.choice(complaints)
Weatherlyzer/weatherlyzer
base/cron.py
Python
mit
264
0.003788
import sysconfig # Category metadata. # Category icon show in the menu ICON = "icons/star2.svg" # Background color for category background in menu # and widget icon background in workflow. BACKGROUND = "light-blue" # Location of widget help files. WIDGET_HELP_PATH = ( # No local documentation (There are problems with it, so Orange3 widgets # usually don't use it) # Local documentation. This fake line is needed to access to the online # documentation ("{DEVELOP_ROOT}/doc/build/htmlhelp/index.html", None), # Online documentation url, used when the local documentation is not available. # Url should point to a page with a section Widgets. This section should # includes links to documentation pages of each widget. Matching is # performed by comparing link caption to widget name. # IMPORTANT TO PUT THE LAST SLASH '/' ("http://orange3-recommendation.readthedocs.io/en/latest/", "") ) """ *************************************************************************** ************************** CREDITS FOR THE ICONS ************************** *************************************************************************** - 'star.svg' icon made by [Freepik] from [www.flaticon.com] - 'starred-list' icon made by [Freepik] from [www.flaticon.com] - 'customer.svg' icon made by [Freepik] from [www.flaticon.com] - 'stars.svg' icon made by [ Alfredo Hernandez] from [www.flaticon.com] - 'star2.svg' icon made by [EpicCoders] from [www.flaticon.com] - 'brismf.svg' icon made by [Freepik] from [www.flaticon.com] - 'manager.svg' icon made by [Freepik] from [www.flaticon.com] - 'ranking.svg' icon made by [Freepik] from [www.flaticon.com] - 'candidates-ranking-graphic.svg' icon made by [Freepik] from [www.flaticon.com] - 'trustsvd.svg' icon made by [Zurb] from [www.flaticon.com] - 'organization.svg' icon made by [Freepik] from [www.flaticon.com] - 'task.svg' icon made by [Freepik] from [www.flaticon.com] - 'list.svg' icon made by [Freepik] from [www.flaticon.com] - 'ranking.svg' icon made by [Freepik] from [www.flaticon.com] """
salvacarrion/orange3-recommendation
orangecontrib/recommendation/widgets/__init__.py
Python
bsd-2-clause
2,082
0.001921
a = "nabb jasj jjs, jjsajdhh kjkda jj" a1 = a.split(",") for i in range(0,len(a1)): print (len(a1[i].split()))
shakcho/Indic-language-ngram-viewer
demo.py
Python
mit
120
0.033333
# Copyright (c) 2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import ast import json import uuid from oslo_config import cfg import pecan from pecan import hooks from poppy.common import errors from poppy.common import uri from poppy.common import util from poppy.transport.pecan.controllers import base from poppy.transport.pecan import hooks as poppy_hooks from poppy.transport.pecan.models.response import link from poppy.transport.pecan.models.response import service as resp_service_model from poppy.transport.validators import helpers from poppy.transport.validators.schemas import service from poppy.transport.validators.stoplight import decorators from poppy.transport.validators.stoplight import exceptions from poppy.transport.validators.stoplight import helpers as stoplight_helpers from poppy.transport.validators.stoplight import rule LIMITS_OPTIONS = [ cfg.IntOpt('max_services_per_page', default=20, help='Max number of services per page for list services'), ] LIMITS_GROUP = 'drivers:transport:limits' class ServiceAssetsController(base.Controller, hooks.HookController): __hooks__ = [poppy_hooks.Context(), poppy_hooks.Error()] @pecan.expose('json') @decorators.validate( service_id=rule.Rule( helpers.is_valid_service_id(), helpers.abort_with_message) ) def delete(self, service_id): purge_url = pecan.request.GET.get('url', '/*') purge_all = pecan.request.GET.get('all', False) hard = pecan.request.GET.get('hard', 'True') if purge_url: try: purge_url.encode('ascii') except (UnicodeDecodeError, UnicodeEncodeError): pecan.abort(400, detail='non ascii character present in url') if hard and hard.lower() == 'false': hard = 'False' if hard and hard.lower() == 'true': hard = 'True' try: hard = ast.literal_eval(hard) except ValueError: pecan.abort(400, detail='hard can only be set to True or False') if hard not in [True, False]: pecan.abort(400, detail='hard can only be set to True or False') purge_all = ( True if purge_all and purge_all.lower() == 'true' else False) if purge_all and purge_url != '/*': pecan.abort(400, detail='Cannot provide all=true ' 'and a url at the same time') services_controller = self._driver.manager.services_controller try: services_controller.purge(self.project_id, service_id, hard, purge_url) except errors.ServiceStatusNotDeployed as e: pecan.abort(400, detail=str(e)) except LookupError as e: pecan.abort(404, detail=str(e)) service_url = str( uri.encode(u'{0}/v1.0/services/{1}'.format( pecan.request.host_url, service_id))) return pecan.Response(None, 202, headers={"Location": service_url}) class ServicesController(base.Controller, hooks.HookController): __hooks__ = [poppy_hooks.Context(), poppy_hooks.Error()] def __init__(self, driver): super(ServicesController, self).__init__(driver) self._conf = driver.conf self._conf.register_opts(LIMITS_OPTIONS, group=LIMITS_GROUP) self.limits_conf = self._conf[LIMITS_GROUP] self.max_services_per_page = self.limits_conf.max_services_per_page # Add assets controller here # need to initialize a nested controller with a parameter driver, # so added it in __init__ method. # see more in: http://pecan.readthedocs.org/en/latest/rest.html self.__class__.assets = ServiceAssetsController(driver) @pecan.expose('json') def get_all(self): marker = pecan.request.GET.get('marker', None) limit = pecan.request.GET.get('limit', 10) try: limit = int(limit) if limit <= 0: pecan.abort(400, detail=u'Limit should be greater than 0') if limit > self.max_services_per_page: error = u'Limit should be less than or equal to {0}'.format( self.max_services_per_page) pecan.abort(400, detail=error) except ValueError: error = (u'Limit should be an integer greater than 0 and less' u' or equal to {0}'.format(self.max_services_per_page)) pecan.abort(400, detail=error) try: if marker is not None: marker = str(uuid.UUID(marker)) except ValueError: pecan.abort(400, detail="Marker must be a valid UUID") services_controller = self._driver.manager.services_controller service_resultset = services_controller.list( self.project_id, marker, limit) results = [ resp_service_model.Model(s, self) for s in service_resultset] links = [] if len(results) >= limit: links.append( link.Model(u'{0}/services?marker={1}&limit={2}'.format( self.base_url, results[-1]['id'], limit), 'next')) return { 'links': links, 'services': results } @pecan.expose('json') @decorators.validate( service_id=rule.Rule( helpers.is_valid_service_id(), helpers.abort_with_message) ) def get_one(self, service_id): services_controller = self._driver.manager.services_controller try: service_obj = services_controller.get( self.project_id, service_id) except ValueError: pecan.abort(404, detail='service %s could not be found' % service_id) # convert a service model into a response service model return resp_service_model.Model(service_obj, self) @pecan.expose('json') @decorators.validate( request=rule.Rule( helpers.json_matches_service_schema( service.ServiceSchema.get_schema("service", "POST")), helpers.abort_with_message, stoplight_helpers.pecan_getter)) def post(self): services_controller = self._driver.manager.services_controller service_json_dict = json.loads(pecan.request.body.decode('utf-8')) service_id = None try: service_obj = services_controller.create(self.project_id, self.auth_token, service_json_dict) service_id = service_obj.service_id except LookupError as e: # error handler for no flavor pecan.abort(400, detail=str(e)) except ValueError as e: # error handler for existing service name pecan.abort(400, detail=str(e)) service_url = str( uri.encode(u'{0}/v1.0/services/{1}'.format( pecan.request.host_url, service_id))) return pecan.Response(None, 202, headers={"Location": service_url}) @pecan.expose('json') @decorators.validate( service_id=rule.Rule( helpers.is_valid_service_id(), helpers.abort_with_message) ) def delete(self, service_id): services_controller = self._driver.manager.services_controller try: services_controller.delete(self.project_id, service_id) except LookupError as e: pecan.abort(404, detail=str(e)) except ValueError as e: pecan.abort(404, detail=str(e)) return pecan.Response(None, 202) @pecan.expose('json') @decorators.validate( service_id=rule.Rule( helpers.is_valid_service_id(), helpers.abort_with_message), request=rule.Rule( helpers.json_matches_service_schema( service.ServiceSchema.get_schema("service", "PATCH")), helpers.abort_with_message, stoplight_helpers.pecan_getter)) def patch_one(self, service_id): service_updates = json.loads(pecan.request.body.decode('utf-8')) services_controller = self._driver.manager.services_controller try: services_controller.update( self.project_id, service_id, self.auth_token, service_updates) except exceptions.ValidationFailed as e: pecan.abort(400, detail=u'{0}'.format(e)) except LookupError as e: # error handler for no flavor pecan.abort(400, detail=str(e)) except ValueError as e: # error handler for existing service name pecan.abort(400, detail=str(e)) except errors.ServiceNotFound as e: pecan.abort(404, detail=str(e)) except errors.ServiceStatusNeitherDeployedNorFailed as e: pecan.abort(400, detail=str(e)) except Exception as e: pecan.abort(400, detail=util.help_escape(str(e))) service_url = str( uri.encode(u'{0}/v1.0/services/{1}'.format( pecan.request.host_url, service_id))) return pecan.Response(None, 202, headers={"Location": service_url})
obulpathi/poppy
poppy/transport/pecan/controllers/v1/services.py
Python
apache-2.0
9,877
0
from pandac.PandaModules import * from toontown.toonbase.ToonBaseGlobal import * from direct.gui.DirectGui import * from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.fsm import StateData from toontown.toontowngui import TTDialog from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from direct.directnotify import DirectNotifyGlobal class Trolley(StateData.StateData): notify = DirectNotifyGlobal.directNotify.newCategory('Trolley') def __init__(self, safeZone, parentFSM, doneEvent): StateData.StateData.__init__(self, doneEvent) self.fsm = ClassicFSM.ClassicFSM('Trolley', [ State.State('start', self.enterStart, self.exitStart, ['requestBoard', 'trolleyHFA', 'trolleyTFA']), State.State('trolleyHFA', self.enterTrolleyHFA, self.exitTrolleyHFA, ['final']), State.State('trolleyTFA', self.enterTrolleyTFA, self.exitTrolleyTFA, ['final']), State.State('requestBoard', self.enterRequestBoard, self.exitRequestBoard, ['boarding']), State.State('boarding', self.enterBoarding, self.exitBoarding, ['boarded']), State.State('boarded', self.enterBoarded, self.exitBoarded, ['requestExit', 'trolleyLeaving', 'final']), State.State('requestExit', self.enterRequestExit, self.exitRequestExit, ['exiting', 'trolleyLeaving']), State.State('trolleyLeaving', self.enterTrolleyLeaving, self.exitTrolleyLeaving, ['final']), State.State('exiting', self.enterExiting, self.exitExiting, ['final']), State.State('final', self.enterFinal, self.exitFinal, ['start'])], 'start', 'final') self.parentFSM = parentFSM return None def load(self): self.parentFSM.getStateNamed('trolley').addChild(self.fsm) self.buttonModels = loader.loadModel('phase_3.5/models/gui/inventory_gui') self.upButton = self.buttonModels.find('**//InventoryButtonUp') self.downButton = self.buttonModels.find('**/InventoryButtonDown') self.rolloverButton = self.buttonModels.find('**/InventoryButtonRollover') def unload(self): self.parentFSM.getStateNamed('trolley').removeChild(self.fsm) del self.fsm del self.parentFSM self.buttonModels.removeNode() del self.buttonModels del self.upButton del self.downButton del self.rolloverButton def enter(self): self.fsm.enterInitialState() if base.localAvatar.hp > 0: messenger.send('enterTrolleyOK') self.fsm.request('requestBoard') else: self.fsm.request('trolleyHFA') return None def exit(self): self.ignoreAll() return None def enterStart(self): return None def exitStart(self): return None def enterTrolleyHFA(self): self.noTrolleyBox = TTDialog.TTGlobalDialog(message=TTLocalizer.TrolleyHFAMessage, doneEvent='noTrolleyAck', style=TTDialog.Acknowledge) self.noTrolleyBox.show() base.localAvatar.b_setAnimState('neutral', 1) self.accept('noTrolleyAck', self.__handleNoTrolleyAck) def exitTrolleyHFA(self): self.ignore('noTrolleyAck') self.noTrolleyBox.cleanup() del self.noTrolleyBox def enterTrolleyTFA(self): self.noTrolleyBox = TTDialog.TTGlobalDialog(message=TTLocalizer.TrolleyTFAMessage, doneEvent='noTrolleyAck', style=TTDialog.Acknowledge) self.noTrolleyBox.show() base.localAvatar.b_setAnimState('neutral', 1) self.accept('noTrolleyAck', self.__handleNoTrolleyAck) def exitTrolleyTFA(self): self.ignore('noTrolleyAck') self.noTrolleyBox.cleanup() del self.noTrolleyBox def __handleNoTrolleyAck(self): ntbDoneStatus = self.noTrolleyBox.doneStatus if ntbDoneStatus == 'ok': doneStatus = {} doneStatus['mode'] = 'reject' messenger.send(self.doneEvent, [doneStatus]) else: self.notify.error('Unrecognized doneStatus: ' + str(ntbDoneStatus)) def enterRequestBoard(self): return None def handleRejectBoard(self): doneStatus = {} doneStatus['mode'] = 'reject' messenger.send(self.doneEvent, [doneStatus]) def exitRequestBoard(self): return None def enterBoarding(self, nodePath): camera.wrtReparentTo(nodePath) self.cameraBoardTrack = LerpPosHprInterval(camera, 1.5, Point3(-35, 0, 8), Point3(-90, 0, 0)) self.cameraBoardTrack.start() return None def exitBoarding(self): self.ignore('boardedTrolley') return None def enterBoarded(self): if base.config.GetBool('want-qa-regression', 0): self.notify.info('QA-REGRESSION: RIDETHETROLLEY: Ride the Trolley') self.enableExitButton() return None def exitBoarded(self): self.cameraBoardTrack.finish() self.disableExitButton() return None def enableExitButton(self): self.exitButton = DirectButton(relief=None, text=TTLocalizer.TrolleyHopOff, text_fg=(1, 1, 0.65, 1), text_pos=(0, -0.23), text_scale=TTLocalizer.TexitButton, image=(self.upButton, self.downButton, self.rolloverButton), image_color=(1, 0, 0, 1), image_scale=(20, 1, 11), pos=(0, 0, 0.8), scale=0.15, command=lambda self = self: self.fsm.request('requestExit')) return def disableExitButton(self): self.exitButton.destroy() def enterRequestExit(self): messenger.send('trolleyExitButton') return None def exitRequestExit(self): return None def enterTrolleyLeaving(self): camera.lerpPosHprXYZHPR(0, 18.55, 3.75, -180, 0, 0, 3, blendType='easeInOut', task='leavingCamera') self.acceptOnce('playMinigame', self.handlePlayMinigame) return None def handlePlayMinigame(self, zoneId, minigameId): base.localAvatar.b_setParent(ToontownGlobals.SPHidden) doneStatus = {} doneStatus['mode'] = 'minigame' doneStatus['zoneId'] = zoneId doneStatus['minigameId'] = minigameId messenger.send(self.doneEvent, [doneStatus]) def exitTrolleyLeaving(self): self.ignore('playMinigame') taskMgr.remove('leavingCamera') return None def enterExiting(self): return None def handleOffTrolley(self): doneStatus = {} doneStatus['mode'] = 'exit' messenger.send(self.doneEvent, [doneStatus]) return None def exitExiting(self): return None def enterFinal(self): return None def exitFinal(self): return None
ksmit799/Toontown-Source
toontown/trolley/Trolley.py
Python
mit
7,361
0.005434
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, tools, _ from odoo.exceptions import ValidationError from odoo.addons import decimal_precision as dp from odoo.addons.website.models import ir_http from odoo.tools.translate import html_translate from odoo.osv import expression class ProductStyle(models.Model): _name = "product.style" _description = 'Product Style' name = fields.Char(string='Style Name', required=True) html_class = fields.Char(string='HTML Classes') class ProductPricelist(models.Model): _inherit = "product.pricelist" def _default_website(self): """ Find the first company's website, if there is one. """ company_id = self.env.user.company_id.id if self._context.get('default_company_id'): company_id = self._context.get('default_company_id') domain = [('company_id', '=', company_id)] return self.env['website'].search(domain, limit=1) website_id = fields.Many2one('website', string="Website", default=_default_website) code = fields.Char(string='E-commerce Promotional Code', groups="base.group_user") selectable = fields.Boolean(help="Allow the end user to choose this price list") def clear_cache(self): # website._get_pl_partner_order() is cached to avoid to recompute at each request the # list of available pricelists. So, we need to invalidate the cache when # we change the config of website price list to force to recompute. website = self.env['website'] website._get_pl_partner_order.clear_cache(website) @api.model def create(self, data): if data.get('company_id') and not data.get('website_id'): # l10n modules install will change the company currency, creating a # pricelist for that currency. Do not use user's company in that # case as module install are done with OdooBot (company 1) self = self.with_context(default_company_id=data['company_id']) res = super(ProductPricelist, self).create(data) self.clear_cache() return res @api.multi def write(self, data): res = super(ProductPricelist, self).write(data) self.clear_cache() return res @api.multi def unlink(self): res = super(ProductPricelist, self).unlink() self.clear_cache() return res def _get_partner_pricelist_multi_search_domain_hook(self): domain = super(ProductPricelist, self)._get_partner_pricelist_multi_search_domain_hook() website = ir_http.get_request_website() if website: domain += self._get_website_pricelists_domain(website.id) return domain def _get_partner_pricelist_multi_filter_hook(self): res = super(ProductPricelist, self)._get_partner_pricelist_multi_filter_hook() website = ir_http.get_request_website() if website: res = res.filtered(lambda pl: pl._is_available_on_website(website.id)) return res @api.multi def _is_available_on_website(self, website_id): """ To be able to be used on a website, a pricelist should either: - Have its `website_id` set to current website (specific pricelist). - Have no `website_id` set and should be `selectable` (generic pricelist) or should have a `code` (generic promotion). Note: A pricelist without a website_id, not selectable and without a code is a backend pricelist. Change in this method should be reflected in `_get_website_pricelists_domain`. """ self.ensure_one() return self.website_id.id == website_id or (not self.website_id and (self.selectable or self.sudo().code)) def _get_website_pricelists_domain(self, website_id): ''' Check above `_is_available_on_website` for explanation. Change in this method should be reflected in `_is_available_on_website`. ''' return [ '|', ('website_id', '=', website_id), '&', ('website_id', '=', False), '|', ('selectable', '=', True), ('code', '!=', False), ] def _get_partner_pricelist_multi(self, partner_ids, company_id=None): ''' If `property_product_pricelist` is read from website, we should use the website's company and not the user's one. Passing a `company_id` to super will avoid using the current user's company. ''' website = ir_http.get_request_website() if not company_id and website: company_id = website.company_id.id return super(ProductPricelist, self)._get_partner_pricelist_multi(partner_ids, company_id) @api.onchange('company_id') def _onchange_company_id(self): ''' Show only the company's website ''' domain = self.company_id and [('company_id', '=', self.company_id.id)] or [] return {'domain': {'website_id': domain}} @api.constrains('company_id', 'website_id') def _check_websites_in_company(self): '''Prevent misconfiguration multi-website/multi-companies. If the record has a company, the website should be from that company. ''' for record in self.filtered(lambda pl: pl.website_id and pl.company_id): if record.website_id.company_id != record.company_id: raise ValidationError(_("Only the company's websites are allowed. \ Leave the Company field empty or select a website from that company.")) class ProductPublicCategory(models.Model): _name = "product.public.category" _inherit = ["website.seo.metadata", "website.multi.mixin"] _description = "Website Product Category" _order = "sequence, name" name = fields.Char(required=True, translate=True) parent_id = fields.Many2one('product.public.category', string='Parent Category', index=True) child_id = fields.One2many('product.public.category', 'parent_id', string='Children Categories') sequence = fields.Integer(help="Gives the sequence order when displaying a list of product categories.") # NOTE: there is no 'default image', because by default we don't show # thumbnails for categories. However if we have a thumbnail for at least one # category, then we display a default image on the other, so that the # buttons have consistent styling. # In this case, the default image is set by the js code. image = fields.Binary(help="This field holds the image used as image for the category, limited to 1024x1024px.") website_description = fields.Html('Category Description', sanitize_attributes=False, translate=html_translate) image_medium = fields.Binary(string='Medium-sized image', help="Medium-sized image of the category. It is automatically " "resized as a 128x128px image, with aspect ratio preserved. " "Use this field in form views or some kanban views.") image_small = fields.Binary(string='Small-sized image', help="Small-sized image of the category. It is automatically " "resized as a 64x64px image, with aspect ratio preserved. " "Use this field anywhere a small image is required.") @api.model def create(self, vals): tools.image_resize_images(vals) return super(ProductPublicCategory, self).create(vals) @api.multi def write(self, vals): tools.image_resize_images(vals) return super(ProductPublicCategory, self).write(vals) @api.constrains('parent_id') def check_parent_id(self): if not self._check_recursion(): raise ValueError(_('Error ! You cannot create recursive categories.')) @api.multi def name_get(self): res = [] for category in self: names = [category.name] parent_category = category.parent_id while parent_category: names.append(parent_category.name) parent_category = parent_category.parent_id res.append((category.id, ' / '.join(reversed(names)))) return res class ProductTemplate(models.Model): _inherit = ["product.template", "website.seo.metadata", 'website.published.multi.mixin', 'rating.mixin'] _name = 'product.template' _mail_post_access = 'read' website_description = fields.Html('Description for the website', sanitize_attributes=False, translate=html_translate) alternative_product_ids = fields.Many2many('product.template', 'product_alternative_rel', 'src_id', 'dest_id', string='Alternative Products', help='Suggest alternatives to your customer' '(upsell strategy).Those product show up on the product page.') accessory_product_ids = fields.Many2many('product.product', 'product_accessory_rel', 'src_id', 'dest_id', string='Accessory Products', help='Accessories show up when the customer' 'reviews the cart before payment (cross-sell strategy).') website_size_x = fields.Integer('Size X', default=1) website_size_y = fields.Integer('Size Y', default=1) website_style_ids = fields.Many2many('product.style', string='Styles') website_sequence = fields.Integer('Website Sequence', help="Determine the display order in the Website E-commerce", default=lambda self: self._default_website_sequence()) public_categ_ids = fields.Many2many('product.public.category', string='Website Product Category', help="The product will be available in each mentioned e-commerce category. Go to" "Shop > Customize and enable 'E-commerce categories' to view all e-commerce categories.") product_template_image_ids = fields.One2many('product.image', 'product_tmpl_id', string="Extra Product Images", copy=True) @api.multi def _has_no_variant_attributes(self): """Return whether this `product.template` has at least one no_variant attribute. :return: True if at least one no_variant attribute, False otherwise :rtype: bool """ self.ensure_one() return any(a.create_variant == 'no_variant' for a in self._get_valid_product_attributes()) @api.multi def _has_is_custom_values(self): self.ensure_one() """Return whether this `product.template` has at least one is_custom attribute value. :return: True if at least one is_custom attribute value, False otherwise :rtype: bool """ return any(v.is_custom for v in self._get_valid_product_attribute_values()) @api.multi def _get_possible_variants_sorted(self, parent_combination=None): """Return the sorted recordset of variants that are possible. The order is based on the order of the attributes and their values. See `_get_possible_variants` for the limitations of this method with dynamic or no_variant attributes, and also for a warning about performances. :param parent_combination: combination from which `self` is an optional or accessory product :type parent_combination: recordset `product.template.attribute.value` :return: the sorted variants that are possible :rtype: recordset of `product.product` """ self.ensure_one() def _sort_key_attribute_value(value): # if you change this order, keep it in sync with _order from `product.attribute` return (value.attribute_id.sequence, value.attribute_id.id) def _sort_key_variant(variant): """ We assume all variants will have the same attributes, with only one value for each. - first level sort: same as "product.attribute"._order - second level sort: same as "product.attribute.value"._order """ keys = [] for attribute in variant.attribute_value_ids.sorted(_sort_key_attribute_value): # if you change this order, keep it in sync with _order from `product.attribute.value` keys.append(attribute.sequence) keys.append(attribute.id) return keys return self._get_possible_variants(parent_combination).sorted(_sort_key_variant) @api.multi def _get_combination_info(self, combination=False, product_id=False, add_qty=1, pricelist=False, parent_combination=False, only_template=False): """Override for website, where we want to: - take the website pricelist if no pricelist is set - apply the b2b/b2c setting to the result This will work when adding website_id to the context, which is done automatically when called from routes with website=True. """ self.ensure_one() current_website = False if self.env.context.get('website_id'): current_website = self.env['website'].get_current_website() if not pricelist: pricelist = current_website.get_current_pricelist() combination_info = super(ProductTemplate, self)._get_combination_info( combination=combination, product_id=product_id, add_qty=add_qty, pricelist=pricelist, parent_combination=parent_combination, only_template=only_template) if self.env.context.get('website_id'): partner = self.env.user.partner_id company_id = current_website.company_id product = self.env['product.product'].browse(combination_info['product_id']) or self tax_display = self.env.user.has_group('account.group_show_line_subtotals_tax_excluded') and 'total_excluded' or 'total_included' taxes = partner.property_account_position_id.map_tax(product.sudo().taxes_id.filtered(lambda x: x.company_id == company_id), product, partner) # The list_price is always the price of one. quantity_1 = 1 price = taxes.compute_all(combination_info['price'], pricelist.currency_id, quantity_1, product, partner)[tax_display] if pricelist.discount_policy == 'without_discount': list_price = taxes.compute_all(combination_info['list_price'], pricelist.currency_id, quantity_1, product, partner)[tax_display] else: list_price = price has_discounted_price = pricelist.currency_id.compare_amounts(list_price, price) == 1 combination_info.update( price=price, list_price=list_price, has_discounted_price=has_discounted_price, ) return combination_info @api.multi def _create_first_product_variant(self, log_warning=False): """Create if necessary and possible and return the first product variant for this template. :param log_warning: whether a warning should be logged on fail :type log_warning: bool :return: the first product variant or none :rtype: recordset of `product.product` """ return self._create_product_variant(self._get_first_possible_combination(), log_warning) @api.multi def _get_current_company_fallback(self, **kwargs): """Override: if a website is set on the product or given, fallback to the company of the website. Otherwise use the one from parent method.""" res = super(ProductTemplate, self)._get_current_company_fallback(**kwargs) website = self.website_id or kwargs.get('website') return website and website.company_id or res def _default_website_sequence(self): self._cr.execute("SELECT MIN(website_sequence) FROM %s" % self._table) min_sequence = self._cr.fetchone()[0] return min_sequence and min_sequence - 1 or 10 def set_sequence_top(self): self.website_sequence = self.sudo().search([], order='website_sequence desc', limit=1).website_sequence + 1 def set_sequence_bottom(self): self.website_sequence = self.sudo().search([], order='website_sequence', limit=1).website_sequence - 1 def set_sequence_up(self): previous_product_tmpl = self.sudo().search( [('website_sequence', '>', self.website_sequence), ('website_published', '=', self.website_published)], order='website_sequence', limit=1) if previous_product_tmpl: previous_product_tmpl.website_sequence, self.website_sequence = self.website_sequence, previous_product_tmpl.website_sequence else: self.set_sequence_top() def set_sequence_down(self): next_prodcut_tmpl = self.search([('website_sequence', '<', self.website_sequence), ('website_published', '=', self.website_published)], order='website_sequence desc', limit=1) if next_prodcut_tmpl: next_prodcut_tmpl.website_sequence, self.website_sequence = self.website_sequence, next_prodcut_tmpl.website_sequence else: return self.set_sequence_bottom() def _default_website_meta(self): res = super(ProductTemplate, self)._default_website_meta() res['default_opengraph']['og:description'] = res['default_twitter']['twitter:description'] = self.description_sale res['default_opengraph']['og:title'] = res['default_twitter']['twitter:title'] = self.name res['default_opengraph']['og:image'] = res['default_twitter']['twitter:image'] = "/web/image/product.template/%s/image" % (self.id) return res @api.multi def _compute_website_url(self): super(ProductTemplate, self)._compute_website_url() for product in self: product.website_url = "/shop/product/%s" % (product.id,) # --------------------------------------------------------- # Rating Mixin API # --------------------------------------------------------- @api.multi def _rating_domain(self): """ Only take the published rating into account to compute avg and count """ domain = super(ProductTemplate, self)._rating_domain() return expression.AND([domain, [('website_published', '=', True)]]) @api.multi def _get_images(self): """Return a list of records implementing `image.mixin` to display on the carousel on the website for this template. This returns a list and not a recordset because the records might be from different models (template and image). It contains in this order: the main image of the template and the Template Extra Images. """ self.ensure_one() return [self] + list(self.product_template_image_ids) class Product(models.Model): _inherit = "product.product" website_id = fields.Many2one(related='product_tmpl_id.website_id', readonly=False) product_variant_image_ids = fields.One2many('product.image', 'product_variant_id', string="Extra Variant Images") @api.multi def website_publish_button(self): self.ensure_one() return self.product_tmpl_id.website_publish_button() @api.multi def _get_images(self): """Return a list of records implementing `image.mixin` to display on the carousel on the website for this variant. This returns a list and not a recordset because the records might be from different models (template, variant and image). It contains in this order: the main image of the variant (if set), the Variant Extra Images, and the Template Extra Images. """ self.ensure_one() variant_images = list(self.product_variant_image_ids) if self.image_raw_original: # if the main variant image is set, display it first variant_images = [self] + variant_images else: # If the main variant image is empty, it will fallback to template # image, in this case insert it after the other variant images, so # that all variant images are first and all template images last. variant_images = variant_images + [self] # [1:] to remove the main image from the template, we only display # the template extra images here return variant_images + self.product_tmpl_id._get_images()[1:]
t3dev/odoo
addons/website_sale/models/product.py
Python
gpl-3.0
20,625
0.003782
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompanying this file. This file is # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF # ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. import os import subprocess import tempfile from awscli.customizations.emr import constants from awscli.customizations.emr import emrutils from awscli.customizations.emr import sshutils from awscli.customizations.emr.command import Command KEY_PAIR_FILE_HELP_TEXT = '\nA value for the variable Key Pair File ' \ 'can be set in the AWS CLI config file using the ' \ '"aws configure set emr.key_pair_file <value>" command.\n' class Socks(Command): NAME = 'socks' DESCRIPTION = ('Create a socks tunnel on port 8157 from your machine ' 'to the master.\n%s' % KEY_PAIR_FILE_HELP_TEXT) ARG_TABLE = [ {'name': 'cluster-id', 'required': True, 'help_text': 'Cluster Id of cluster you want to ssh into'}, {'name': 'key-pair-file', 'required': True, 'help_text': 'Private key file to use for login'}, ] def _run_main_command(self, parsed_args, parsed_globals): try: master_dns = sshutils.validate_and_find_master_dns( session=self._session, parsed_globals=parsed_globals, cluster_id=parsed_args.cluster_id) key_file = parsed_args.key_pair_file sshutils.validate_ssh_with_key_file(key_file) f = tempfile.NamedTemporaryFile(delete=False) if (emrutils.which('ssh') or emrutils.which('ssh.exe')): command = ['ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'ServerAliveInterval=10', '-ND', '8157', '-i', parsed_args.key_pair_file, constants.SSH_USER + '@' + master_dns] else: command = ['putty', '-ssh', '-i', parsed_args.key_pair_file, constants.SSH_USER + '@' + master_dns, '-N', '-D', '8157'] print(' '.join(command)) rc = subprocess.call(command) return rc except KeyboardInterrupt: print('Disabling Socks Tunnel.') return 0 class SSH(Command): NAME = 'ssh' DESCRIPTION = ('SSH into master node of the cluster.\n%s' % KEY_PAIR_FILE_HELP_TEXT) ARG_TABLE = [ {'name': 'cluster-id', 'required': True, 'help_text': 'Cluster Id of cluster you want to ssh into'}, {'name': 'key-pair-file', 'required': True, 'help_text': 'Private key file to use for login'}, {'name': 'command', 'help_text': 'Command to execute on Master Node'} ] def _run_main_command(self, parsed_args, parsed_globals): master_dns = sshutils.validate_and_find_master_dns( session=self._session, parsed_globals=parsed_globals, cluster_id=parsed_args.cluster_id) key_file = parsed_args.key_pair_file sshutils.validate_ssh_with_key_file(key_file) f = tempfile.NamedTemporaryFile(delete=False) if (emrutils.which('ssh') or emrutils.which('ssh.exe')): command = ['ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'ServerAliveInterval=10', '-i', parsed_args.key_pair_file, constants.SSH_USER + '@' + master_dns, '-t'] if parsed_args.command: command.append(parsed_args.command) else: command = ['putty', '-ssh', '-i', parsed_args.key_pair_file, constants.SSH_USER + '@' + master_dns, '-t'] if parsed_args.command: f.write(parsed_args.command) f.write('\nread -n1 -r -p "Command completed. Press any key."') command.append('-m') command.append(f.name) f.close() print(' '.join(command)) rc = subprocess.call(command) os.remove(f.name) return rc class Put(Command): NAME = 'put' DESCRIPTION = ('Put file onto the master node.\n%s' % KEY_PAIR_FILE_HELP_TEXT) ARG_TABLE = [ {'name': 'cluster-id', 'required': True, 'help_text': 'Cluster Id of cluster you want to put file onto'}, {'name': 'key-pair-file', 'required': True, 'help_text': 'Private key file to use for login'}, {'name': 'src', 'required': True, 'help_text': 'Source file path on local machine'}, {'name': 'dest', 'help_text': 'Destination file path on remote host'} ] def _run_main_command(self, parsed_args, parsed_globals): master_dns = sshutils.validate_and_find_master_dns( session=self._session, parsed_globals=parsed_globals, cluster_id=parsed_args.cluster_id) key_file = parsed_args.key_pair_file sshutils.validate_scp_with_key_file(key_file) if (emrutils.which('scp') or emrutils.which('scp.exe')): command = ['scp', '-r', '-o StrictHostKeyChecking=no', '-i', parsed_args.key_pair_file, parsed_args.src, constants.SSH_USER + '@' + master_dns] else: command = ['pscp', '-scp', '-r', '-i', parsed_args.key_pair_file, parsed_args.src, constants.SSH_USER + '@' + master_dns] # if the instance is not terminated if parsed_args.dest: command[-1] = command[-1] + ":" + parsed_args.dest else: command[-1] = command[-1] + ":" + parsed_args.src.split('/')[-1] print(' '.join(command)) rc = subprocess.call(command) return rc class Get(Command): NAME = 'get' DESCRIPTION = ('Get file from master node.\n%s' % KEY_PAIR_FILE_HELP_TEXT) ARG_TABLE = [ {'name': 'cluster-id', 'required': True, 'help_text': 'Cluster Id of cluster you want to get file from'}, {'name': 'key-pair-file', 'required': True, 'help_text': 'Private key file to use for login'}, {'name': 'src', 'required': True, 'help_text': 'Source file path on remote host'}, {'name': 'dest', 'help_text': 'Destination file path on your machine'} ] def _run_main_command(self, parsed_args, parsed_globals): master_dns = sshutils.validate_and_find_master_dns( session=self._session, parsed_globals=parsed_globals, cluster_id=parsed_args.cluster_id) key_file = parsed_args.key_pair_file sshutils.validate_scp_with_key_file(key_file) if (emrutils.which('scp') or emrutils.which('scp.exe')): command = ['scp', '-r', '-o StrictHostKeyChecking=no', '-i', parsed_args.key_pair_file, constants.SSH_USER + '@' + master_dns + ':' + parsed_args.src] else: command = ['pscp', '-scp', '-r', '-i', parsed_args.key_pair_file, constants.SSH_USER + '@' + master_dns + ':' + parsed_args.src] if parsed_args.dest: command.append(parsed_args.dest) else: command.append(parsed_args.src.split('/')[-1]) print(' '.join(command)) rc = subprocess.call(command) return rc
mnahm5/django-estore
Lib/site-packages/awscli/customizations/emr/ssh.py
Python
mit
7,731
0
from functools import wraps import json from django.http import JsonResponse, HttpResponseNotAllowed from django.utils.decorators import available_attrs def methods(method_list): def decorator(func): @wraps(func, assigned=available_attrs(func)) def inner(request, *args, **kw): if request.method not in method_list: return HttpResponseNotAllowed(method_list, 'Method Not Allow') return func(request, *args, **kw) return inner return decorator def get_headers(request): headers = {} for key, value in request.META.iteritems():#use iterator if key.startswith('HTTP_'): headers['-'.join(key.split('_')[1:]).title()] = value elif key.startswith('CONTENT'): headers['-'.join(key.split('_')).title()] = value return headers def no_get(request): rep_dict = { 'args': request.GET, 'data': request.body, 'files': request.FILES, 'form': request.POST, 'headers': get_headers(request), 'json': None, 'origin': request.META['REMOTE_ADDR'], 'url': request.build_absolute_uri(), } if 'json' in request.content_type: try: rep_dict['json'] = json.loads(request.body) except: pass return rep_dict
baby5/Django-httpbin
httpbin/bin/helpers.py
Python
mit
1,339
0.004481
from unittest import mock from unittest import TestCase from sewer.dns_providers.rackspace import RackspaceDns from . import test_utils class TestRackspace(TestCase): """ """ def setUp(self): self.domain_name = "example.com" self.domain_dns_value = "mock-domain_dns_value" self.RACKSPACE_USERNAME = "mock_username" self.RACKSPACE_API_KEY = "mock-api-key" self.RACKSPACE_API_TOKEN = "mock-api-token" with mock.patch("requests.post") as mock_requests_post, mock.patch( "requests.get" ) as mock_requests_get, mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.get_rackspace_credentials" ) as mock_get_credentials, mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.find_dns_zone_id", autospec=True ) as mock_find_dns_zone_id: mock_requests_post.return_value = test_utils.MockResponse() mock_requests_get.return_value = test_utils.MockResponse() mock_get_credentials.return_value = "mock-api-token", "http://example.com/" mock_find_dns_zone_id.return_value = "mock_zone_id" self.dns_class = RackspaceDns( RACKSPACE_USERNAME=self.RACKSPACE_USERNAME, RACKSPACE_API_KEY=self.RACKSPACE_API_KEY ) def tearDown(self): pass def test_find_dns_zone_id(self): with mock.patch("requests.get") as mock_requests_get: # see: https://developer.rackspace.com/docs/cloud-dns/v1/api-reference/domains/ mock_dns_zone_id = 1_239_932 mock_requests_content = { "domains": [ { "name": self.domain_name, "id": mock_dns_zone_id, "comment": "Optional domain comment...", "updated": "2011-06-24T01:23:15.000+0000", "accountId": 1234, "emailAddress": "[email protected]", "created": "2011-06-24T01:12:51.000+0000", } ] } mock_requests_get.return_value = test_utils.MockResponse(200, mock_requests_content) dns_zone_id = self.dns_class.find_dns_zone_id(self.domain_name) self.assertEqual(dns_zone_id, mock_dns_zone_id) self.assertTrue(mock_requests_get.called) def test_find_dns_record_id(self): with mock.patch("requests.get") as mock_requests_get, mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.find_dns_zone_id" ) as mock_find_dns_zone_id: # see: https://developer.rackspace.com/docs/cloud-dns/v1/api-reference/records/ mock_dns_record_id = "A-1234" mock_requests_content = { "totalEntries": 1, "records": [ { "name": self.domain_name, "id": mock_dns_record_id, "type": "A", "data": self.domain_dns_value, "updated": "2011-05-19T13:07:08.000+0000", "ttl": 5771, "created": "2011-05-18T19:53:09.000+0000", } ], } mock_requests_get.return_value = test_utils.MockResponse(200, mock_requests_content) mock_find_dns_zone_id.return_value = 1_239_932 dns_record_id = self.dns_class.find_dns_record_id( self.domain_name, self.domain_dns_value ) self.assertEqual(dns_record_id, mock_dns_record_id) self.assertTrue(mock_requests_get.called) self.assertTrue(mock_find_dns_zone_id.called) def test_delete_dns_record_is_not_called_by_create_dns_record(self): with mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.find_dns_zone_id" ) as mock_find_dns_zone_id, mock.patch("requests.post") as mock_requests_post, mock.patch( "requests.get" ) as mock_requests_get, mock.patch( "requests.delete" ) as mock_requests_delete, mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.delete_dns_record" ) as mock_delete_dns_record, mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.poll_callback_url" ) as mock_poll_callback_url: mock_find_dns_zone_id.return_value = "mock_zone_id" mock_requests_get.return_value = ( mock_requests_delete.return_value ) = mock_delete_dns_record.return_value = test_utils.MockResponse() mock_requests_content = {"callbackUrl": "http://example.com/callbackUrl"} mock_requests_post.return_value = test_utils.MockResponse(202, mock_requests_content) mock_poll_callback_url.return_value = 1 self.dns_class.create_dns_record( domain_name=self.domain_name, domain_dns_value=self.domain_dns_value ) self.assertFalse(mock_delete_dns_record.called) def test_rackspace_is_called_by_create_dns_record(self): with mock.patch("requests.post") as mock_requests_post, mock.patch( "requests.get" ) as mock_requests_get, mock.patch("requests.delete") as mock_requests_delete, mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.delete_dns_record" ) as mock_delete_dns_record, mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.find_dns_zone_id" ) as mock_find_dns_zone_id, mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.poll_callback_url" ) as mock_poll_callback_url: mock_requests_content = {"callbackUrl": "http://example.com/callbackUrl"} mock_requests_post.return_value = test_utils.MockResponse(202, mock_requests_content) mock_requests_get.return_value = ( mock_requests_delete.return_value ) = mock_delete_dns_record.return_value = test_utils.MockResponse() mock_find_dns_zone_id.return_value = "mock_zone_id" mock_poll_callback_url.return_value = 1 self.dns_class.create_dns_record( domain_name=self.domain_name, domain_dns_value=self.domain_dns_value ) expected = { "headers": {"X-Auth-Token": "mock-api-token", "Content-Type": "application/json"}, "data": self.domain_dns_value, } self.assertDictEqual(expected["headers"], mock_requests_post.call_args[1]["headers"]) self.assertEqual( expected["data"], mock_requests_post.call_args[1]["json"]["records"][0]["data"] ) def test_rackspace_is_called_by_delete_dns_record(self): with mock.patch("requests.post") as mock_requests_post, mock.patch( "requests.get" ) as mock_requests_get, mock.patch("requests.delete") as mock_requests_delete, mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.find_dns_zone_id" ) as mock_find_dns_zone_id, mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.poll_callback_url" ) as mock_poll_callback_url, mock.patch( "sewer.dns_providers.rackspace.RackspaceDns.find_dns_record_id" ) as mock_find_dns_record_id: mock_requests_content = {"callbackUrl": "http://example.com/callbackUrl"} mock_requests_post.return_value = ( mock_requests_get.return_value ) = test_utils.MockResponse() mock_requests_delete.return_value = test_utils.MockResponse(202, mock_requests_content) mock_find_dns_zone_id.return_value = "mock_zone_id" mock_poll_callback_url.return_value = 1 mock_find_dns_record_id.return_value = "mock_record_id" self.dns_class.delete_dns_record( domain_name=self.domain_name, domain_dns_value=self.domain_dns_value ) expected = { "headers": {"X-Auth-Token": "mock-api-token", "Content-Type": "application/json"}, "url": "http://example.com/domains/mock_zone_id/records/?id=mock_record_id", } self.assertDictEqual(expected["headers"], mock_requests_delete.call_args[1]["headers"]) self.assertEqual(expected["url"], mock_requests_delete.call_args[0][0])
komuW/sewer
sewer/dns_providers/tests/test_rackspace.py
Python
mit
8,481
0.003184
"""Support the ISY-994 controllers.""" import asyncio from functools import partial from typing import Optional from urllib.parse import urlparse from pyisy import ISY import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME from homeassistant.core import HomeAssistant, callback from homeassistant.helpers import config_validation as cv import homeassistant.helpers.device_registry as dr from homeassistant.helpers.typing import ConfigType from .const import ( _LOGGER, CONF_IGNORE_STRING, CONF_RESTORE_LIGHT_STATE, CONF_SENSOR_STRING, CONF_TLS_VER, CONF_VAR_SENSOR_STRING, DEFAULT_IGNORE_STRING, DEFAULT_RESTORE_LIGHT_STATE, DEFAULT_SENSOR_STRING, DEFAULT_VAR_SENSOR_STRING, DOMAIN, ISY994_ISY, ISY994_NODES, ISY994_PROGRAMS, ISY994_VARIABLES, MANUFACTURER, SUPPORTED_PLATFORMS, SUPPORTED_PROGRAM_PLATFORMS, UNDO_UPDATE_LISTENER, ) from .helpers import _categorize_nodes, _categorize_programs, _categorize_variables from .services import async_setup_services, async_unload_services CONFIG_SCHEMA = vol.Schema( { DOMAIN: vol.Schema( { vol.Required(CONF_HOST): cv.url, vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_PASSWORD): cv.string, vol.Optional(CONF_TLS_VER): vol.Coerce(float), vol.Optional( CONF_IGNORE_STRING, default=DEFAULT_IGNORE_STRING ): cv.string, vol.Optional( CONF_SENSOR_STRING, default=DEFAULT_SENSOR_STRING ): cv.string, vol.Optional( CONF_VAR_SENSOR_STRING, default=DEFAULT_VAR_SENSOR_STRING ): cv.string, vol.Required( CONF_RESTORE_LIGHT_STATE, default=DEFAULT_RESTORE_LIGHT_STATE ): bool, } ) }, extra=vol.ALLOW_EXTRA, ) async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the isy994 integration from YAML.""" isy_config: Optional[ConfigType] = config.get(DOMAIN) hass.data.setdefault(DOMAIN, {}) if not isy_config: return True # Only import if we haven't before. config_entry = _async_find_matching_config_entry(hass) if not config_entry: hass.async_create_task( hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_IMPORT}, data=dict(isy_config), ) ) return True # Update the entry based on the YAML configuration, in case it changed. hass.config_entries.async_update_entry(config_entry, data=dict(isy_config)) return True @callback def _async_find_matching_config_entry(hass): for entry in hass.config_entries.async_entries(DOMAIN): if entry.source == config_entries.SOURCE_IMPORT: return entry async def async_setup_entry( hass: HomeAssistant, entry: config_entries.ConfigEntry ) -> bool: """Set up the ISY 994 integration.""" # As there currently is no way to import options from yaml # when setting up a config entry, we fallback to adding # the options to the config entry and pull them out here if # they are missing from the options _async_import_options_from_data_if_missing(hass, entry) hass.data[DOMAIN][entry.entry_id] = {} hass_isy_data = hass.data[DOMAIN][entry.entry_id] hass_isy_data[ISY994_NODES] = {} for platform in SUPPORTED_PLATFORMS: hass_isy_data[ISY994_NODES][platform] = [] hass_isy_data[ISY994_PROGRAMS] = {} for platform in SUPPORTED_PROGRAM_PLATFORMS: hass_isy_data[ISY994_PROGRAMS][platform] = [] hass_isy_data[ISY994_VARIABLES] = [] isy_config = entry.data isy_options = entry.options # Required user = isy_config[CONF_USERNAME] password = isy_config[CONF_PASSWORD] host = urlparse(isy_config[CONF_HOST]) # Optional tls_version = isy_config.get(CONF_TLS_VER) ignore_identifier = isy_options.get(CONF_IGNORE_STRING, DEFAULT_IGNORE_STRING) sensor_identifier = isy_options.get(CONF_SENSOR_STRING, DEFAULT_SENSOR_STRING) variable_identifier = isy_options.get( CONF_VAR_SENSOR_STRING, DEFAULT_VAR_SENSOR_STRING ) if host.scheme == "http": https = False port = host.port or 80 elif host.scheme == "https": https = True port = host.port or 443 else: _LOGGER.error("isy994 host value in configuration is invalid") return False # Connect to ISY controller. isy = await hass.async_add_executor_job( partial( ISY, host.hostname, port, username=user, password=password, use_https=https, tls_ver=tls_version, log=_LOGGER, webroot=host.path, ) ) if not isy.connected: return False _categorize_nodes(hass_isy_data, isy.nodes, ignore_identifier, sensor_identifier) _categorize_programs(hass_isy_data, isy.programs) _categorize_variables(hass_isy_data, isy.variables, variable_identifier) # Dump ISY Clock Information. Future: Add ISY as sensor to Hass with attrs _LOGGER.info(repr(isy.clock)) hass_isy_data[ISY994_ISY] = isy await _async_get_or_create_isy_device_in_registry(hass, entry, isy) # Load platforms for the devices in the ISY controller that we support. for platform in SUPPORTED_PLATFORMS: hass.async_create_task( hass.config_entries.async_forward_entry_setup(entry, platform) ) def _start_auto_update() -> None: """Start isy auto update.""" _LOGGER.debug("ISY Starting Event Stream and automatic updates") isy.auto_update = True await hass.async_add_executor_job(_start_auto_update) undo_listener = entry.add_update_listener(_async_update_listener) hass_isy_data[UNDO_UPDATE_LISTENER] = undo_listener # Register Integration-wide Services: async_setup_services(hass) return True async def _async_update_listener( hass: HomeAssistant, entry: config_entries.ConfigEntry ): """Handle options update.""" await hass.config_entries.async_reload(entry.entry_id) @callback def _async_import_options_from_data_if_missing( hass: HomeAssistant, entry: config_entries.ConfigEntry ): options = dict(entry.options) modified = False for importable_option in [ CONF_IGNORE_STRING, CONF_SENSOR_STRING, CONF_RESTORE_LIGHT_STATE, ]: if importable_option not in entry.options and importable_option in entry.data: options[importable_option] = entry.data[importable_option] modified = True if modified: hass.config_entries.async_update_entry(entry, options=options) async def _async_get_or_create_isy_device_in_registry( hass: HomeAssistant, entry: config_entries.ConfigEntry, isy ) -> None: device_registry = await dr.async_get_registry(hass) device_registry.async_get_or_create( config_entry_id=entry.entry_id, connections={(dr.CONNECTION_NETWORK_MAC, isy.configuration["uuid"])}, identifiers={(DOMAIN, isy.configuration["uuid"])}, manufacturer=MANUFACTURER, name=isy.configuration["name"], model=isy.configuration["model"], sw_version=isy.configuration["firmware"], ) async def async_unload_entry( hass: HomeAssistant, entry: config_entries.ConfigEntry ) -> bool: """Unload a config entry.""" unload_ok = all( await asyncio.gather( *[ hass.config_entries.async_forward_entry_unload(entry, platform) for platform in SUPPORTED_PLATFORMS ] ) ) hass_isy_data = hass.data[DOMAIN][entry.entry_id] isy = hass_isy_data[ISY994_ISY] def _stop_auto_update() -> None: """Start isy auto update.""" _LOGGER.debug("ISY Stopping Event Stream and automatic updates") isy.auto_update = False await hass.async_add_executor_job(_stop_auto_update) hass_isy_data[UNDO_UPDATE_LISTENER]() if unload_ok: hass.data[DOMAIN].pop(entry.entry_id) async_unload_services(hass) return unload_ok
tchellomello/home-assistant
homeassistant/components/isy994/__init__.py
Python
apache-2.0
8,442
0.000711
from __future__ import print_function import re, os, sys, multiprocessing, zipfile, Queue from bs4 import BeautifulSoup import pandas as pd import numpy as np from urlparse import urlparse #https://pypi.python.org/pypi/etaprogress/ from etaprogress.progress import ProgressBar #337304 total HTML files, some are actually NOT in either the training or testing set #process_zips = ["./data/0.zip", "./data/1.zip", "./data/2.zip", "./data/3.zip", "./data/4.zip"] process_zips = ["./data/0.zip"] def parseFile(contents, filename, sponsored): nodes = [sponsored, filename] #use lxml parser for faster speed cleaned = BeautifulSoup(contents, "lxml") for anchor in cleaned.findAll('a', href=True): if anchor['href'].startswith("http"): try: parsedurl = urlparse(anchor['href']) parsedurl = parsedurl.netloc.replace("www.", "", 1) parsedurl = re.sub('[^0-9a-zA-Z\.]+', '', parsedurl) #remove non-alphanumeric and non-period literals nodes.append(parsedurl) except ValueError: print("IPv6 URL?") return nodes def addNodes(nodes): for n in nodes: if n not in q: q.append(n) train = pd.read_csv("./data/train.csv", header=0, delimiter=",", quoting=3) sample = pd.read_csv("./data/sampleSubmission.csv", header=0, delimiter=",", quoting=3) print("Starting processing...") q = [] for i, zipFile in enumerate(process_zips): archive = zipfile.ZipFile(zipFile, 'r') file_paths = zipfile.ZipFile.namelist(archive) bar = ProgressBar(len(file_paths), max_width=40) pool = multiprocessing.Pool(processes=multiprocessing.cpu_count()-1 or 1) for k, file_path in enumerate(file_paths): data = archive.read(file_path) openfile = file_path[2:] #filename sponsored = train.loc[train['file'] == openfile] if not sponsored.empty: pool.apply_async(parseFile, args = (data, openfile, int(sponsored['sponsored']), ), callback = addNodes) testing = sample.loc[sample['file'] == openfile] if not testing.empty: pool.apply_async(parseFile, args = (data, openfile, 2, ), callback = addNodes) bar.numerator = k print("Folder:", i, bar, end='\r') sys.stdout.flush() pool.close() pool.join() print() print("Size: ", len(q)) #print("Sponsored pages: ", G.out_degree("SPONSORED")) #print("Normal pages: ", G.out_degree("NOTSPONSORED")) #if G.out_degree("TESTING") != 235917: #print("Error, invalid number of testing nodes.") #if G.out_degree("SPONSORED") + G.out_degree("NOTSPONSORED") != 101107: #print("Error, invalid number of training nodes.")
carlsonp/kaggle-TrulyNative
processURLS_count.py
Python
gpl-3.0
2,502
0.031575
""" Dtella - Core P2P Module Copyright (C) 2008 Dtella Labs (http://www.dtella.org) Copyright (C) 2008 Paul Marks $Id$ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. """ import struct import heapq import time import random import bisect import socket from binascii import hexlify from twisted.internet.protocol import DatagramProtocol from twisted.internet import reactor, defer from twisted.python.runtime import seconds import twisted.internet.error import dtella.local_config as local import dtella.common.crypto from dtella.common.util import (RandSet, dcall_discard, dcall_timeleft, randbytes, validateNick, word_wrap, md5, parse_incoming_info, get_version_string, parse_dtella_tag, CHECK, SSLHACK_filter_flags) from dtella.common.ipv4 import Ad, SubnetMatcher from dtella.common.log import LOG from zope.interface import implements from zope.interface.verify import verifyClass from dtella.common.interfaces import IDtellaNickNode # Check for some non-fatal but noteworthy conditions. def doWarnings(): import twisted from twisted.python import versions if (twisted.version < versions.Version('twisted', 8, 0, 0)): LOG.warning("You should get Twisted 8 or later. Previous versions " "have some bugs that affect Dtella.") try: import dtella.bridge except ImportError: # Don't warn about GMP for clients, because verifying a signature # is fast enough without it (~1ms on a Core2) pass else: import Crypto.PublicKey try: import Crypto.PublicKey._fastmath except ImportError: LOG.warning("Your version of PyCrypto was compiled without " "GMP (fastmath). Signing messages will be slower.") doWarnings() # Miscellaneous Exceptions class BadPacketError(Exception): pass class BadTimingError(Exception): pass class BadBroadcast(Exception): pass class Reject(Exception): pass class NickError(Exception): pass class MessageCollisionError(Exception): pass # How many seconds our node will last without incoming pings ONLINE_TIMEOUT = 30.0 # How many seconds our node will stay online without a DC client NO_CLIENT_TIMEOUT = 60.0 * 5 # Reconnect time range. Currently 10sec .. 15min RECONNECT_RANGE = (10, 60*15) NODE_EXPIRE_EXTEND = 15.0 PKTNUM_BUF = 20 # Status Flags PERSIST_BIT = 0x1 # Ping Flags IWANT_BIT = 0x01 GOTACK_BIT = 0x02 REQ_BIT = 0x04 ACK_BIT = 0x08 NBLIST_BIT = 0x10 OFFLINE_BIT = 0x20 # Broadcast Flags REJECT_BIT = 0x1 # Ack flags ACK_REJECT_BIT = 0x1 # Sync Flags TIMEDOUT_BIT = 0x1 # Chat Flags SLASHME_BIT = 0x1 NOTICE_BIT = 0x2 # ConnectToMe Flags USE_SSL_BIT = 0x1 # ACK Modes ACK_PRIVATE = 1 ACK_BROADCAST = 2 # Bridge topic change CHANGE_BIT = 0x1 # Bridge Kick flags REJOIN_BIT = 0x1 # Bridge general flags MODERATED_BIT = 0x1 # Init response codes CODE_IP_OK = 0 CODE_IP_FOREIGN = 1 CODE_IP_BANNED = 2 ############################################################################## class NickManager(object): def __init__(self, main): self.main = main self.nickmap = {} # {nick.lower() -> Node} def getNickList(self): return [n.nick for n in self.nickmap.itervalues()] def lookupNick(self, nick): # Might raise KeyError return self.nickmap[nick.lower()] def removeNode(self, n, reason): try: if self.nickmap[n.nick.lower()] is not n: raise KeyError except KeyError: return del self.nickmap[n.nick.lower()] so = self.main.getStateObserver() if so: so.event_RemoveNick(n, reason) # Clean up nick-specific stuff if n.is_peer: n.nickRemoved(self.main) def addNode(self, n): if not n.nick: return lnick = n.nick.lower() if lnick in self.nickmap: raise NickError("collision") so = self.main.getStateObserver() if so: # Might raise NickError so.event_AddNick(n) so.event_UpdateInfo(n) self.nickmap[lnick] = n def setInfoInList(self, n, info): # Set the info of the node, and synchronize the info with # an observer if it changes. if not n.setInfo(info): # dcinfo hasn't changed, so there's nothing to send return # Look for this node in the nickmap try: if self.nickmap[n.nick.lower()] is not n: raise KeyError except KeyError: return # Push new dcinfo to dch/ircs so = self.main.getStateObserver() if so: so.event_UpdateInfo(n) ############################################################################## class PeerHandler(DatagramProtocol): # Panic rate limit for broadcast traffic CHOKE_RATE = 100000 # bytes per second CHOKE_PERIOD = 5 # how many seconds to average over def __init__(self, main): self.main = main self.remap_ip = None self.choke_time = seconds() - self.CHOKE_PERIOD self.choke_reported = seconds() - 999 # True iff we're shutting down after a socket failure. self.stopping_protocol = False def stopProtocol(self): # If this is the final termination, don't do anything. if not reactor.running: return self.main.showLoginStatus("UDP socket was reset.") # Otherwise, our UDP port randomly died, so try reconnecting. # Disable transmits during the shutdown. self.stopping_protocol = True try: self.main.shutdown(reconnect='instant') finally: self.stopping_protocol = False def getSocketState(self): # Figure out the state of our UDP socket. if self.stopping_protocol: return 'dying' elif not self.transport: return 'dead' elif hasattr(self.transport, "d"): return 'dying' else: return 'alive' def sendPacket(self, data, addr, broadcast=False): # Send a packet, passing it through the encrypter # returns False if an error occurs if self.stopping_protocol: # Still cleaning up after a socket asplosion. return False self.main.logPacket("%s -> %s:%d" % (data[:2], addr[0], addr[1])) data = self.main.pk_enc.encrypt(data) # For broadcast traffic, set a safety limit on data rate, # in order to protect the physical network from DoS attacks. if broadcast: now = seconds() self.choke_time = max(self.choke_time, now - self.CHOKE_PERIOD) penalty = (1.0 * len(data) * self.CHOKE_PERIOD / self.CHOKE_RATE) # Have we used up the buffer time? if self.choke_time + penalty >= now: # Tell the user what's going on, but only once every # 10 seconds. if self.choke_reported < now - 10: self.main.showLoginStatus( "!!! Dropping broadcast packets due to " "excessive flood !!!") self.choke_reported = now # Don't send packet return False # Nibble something off the choke buffer self.choke_time += penalty self.main.logPacket( "choke=%f" % (now - (self.choke_time+penalty))) # Send the packet try: self.transport.write(data, addr) except socket.error: return False except RuntimeError: # Workaround the Twisted infinite recursion bug return False return True def datagramReceived(self, rawdata, addr, altport=False): ad = Ad().setAddrTuple(addr) if not ad.port: return # This will remap a router's internal IP to its external IP, # if the remapping is known. if self.remap_ip and ad.ip == self.remap_ip[0]: ad.orig_ip = ad.ip ad.ip = self.remap_ip[1] # Special handler for search results directly from DC if rawdata[:4] == '$SR ': dch = self.main.getOnlineDCH() if dch and ad.auth('sb', self.main): dch.pushSearchResult(rawdata) return try: try: data = self.main.pk_enc.decrypt(rawdata) except ValueError, e: raise BadPacketError("Decrypt Failed: " + str(e)) if len(data) < 2: raise BadPacketError("Too Short") kind = data[:2] if not kind.isalpha(): raise BadPacketError("Kind not alphabetical") if altport: kind += "_alt" self.main.logPacket("%s <- %s:%d" % (kind, addr[0], addr[1])) # Make sure the sender's IP is permitted, but delay the check if # it's an initialize packet. if kind not in ('IQ', 'EC', 'IR', 'IC_alt'): if not ad.auth('sbx', self.main): raise BadPacketError("Invalid source IP") try: method = getattr(self, 'handlePacket_%s' % kind) except AttributeError: raise BadPacketError("Unknown kind: %s" % kind) # arg1: Address the packet came from # arg2: The unencrypted packet method(ad, data) except (BadPacketError, BadTimingError), e: self.main.logPacket("Bad Packet/Timing: %s" % str(e)) def decodePacket(self, fmt, data): if fmt[-1] == '+': fmt = fmt[:-1] size = struct.calcsize(fmt) rest = (data[size:],) data = data[:size] else: rest = () try: parts = struct.unpack(fmt, data) except struct.error: raise BadPacketError("Can't decode packet") return parts + rest def decodeString1(self, data, factor=1): try: length, = struct.unpack('!B', data[:1]) except struct.error: raise BadPacketError("Can't decode 1string") length *= factor if len(data) < 1+length: raise BadPacketError("Bad 1string length") return data[1:1+length], data[1+length:] def decodeString2(self, data, max_len=1024): try: length, = struct.unpack('!H', data[:2]) except struct.error: raise BadPacketError("Can't decode 2string") if length > max_len or len(data) < 2+length: raise BadPacketError("Bad 2string length") return data[2:2+length], data[2+length:] def decodeChunkList(self, fmt, data): size = struct.calcsize(fmt) try: return [struct.unpack(fmt, data[i:i+size]) for i in range(0, len(data), size)] except struct.error: raise BadPacketError("Can't decode chunk list") def decodeNodeList(self, data): nbs, rest = self.decodeString1(data, 6) nbs = self.decodeChunkList('!6s', nbs) nbs = [ipp for ipp, in nbs if Ad().setRawIPPort(ipp).auth('sx', self.main)] return nbs, rest def decodeNodeTimeList(self, data): nbs, rest = self.decodeString1(data, 6+4) nbs = [(ipp, age) for (ipp, age) in self.decodeChunkList('!6sI', nbs) if Ad().setRawIPPort(ipp).auth('sx', self.main)] return nbs, rest def checkSource(self, src_ipp, ad, exempt_ip=False): # Sometimes the source port number gets changed by NAT, but this # ensures that the source IP address matches the reported one. src_ad = Ad().setRawIPPort(src_ipp) if exempt_ip: kinds = 'sx' else: kinds = 's' if not src_ad.auth(kinds, self.main): raise BadPacketError("Invalid Source IP") if not src_ad.auth('b', self.main): raise BadPacketError("Source IP banned") if src_ad.ip != ad.ip: raise BadPacketError("Source IP mismatch") osm = self.main.osm if osm and src_ipp == osm.me.ipp: raise BadPacketError("Packet came from myself!?") self.main.state.refreshPeer(src_ad, 0) return src_ad def handleBroadcast(self, ad, data, check_cb, bridgey=False): (kind, nb_ipp, hop, flags, src_ipp, rest ) = self.decodePacket('!2s6sBB6s+', data) osm = self.main.osm if not osm: raise BadTimingError("Not ready to route '%s' packet" % kind) # Make sure nb_ipp agrees with the sender's IP self.checkSource(nb_ipp, ad, exempt_ip=True) # Make sure the src_ipp is valid. # Any broadcast which might be from a bridge is 'bridgey' src_ad = Ad().setRawIPPort(src_ipp) if bridgey: kinds = 'sbx' else: kinds = 'sb' if not src_ad.auth(kinds, self.main): raise BadPacketError("Invalid forwarded source IP") # Make sure this came from one of my ping neighbors. # This helps a little to prevent the injection of random broadcast # traffic into the network. try: if not osm.pgm.pnbs[nb_ipp].got_ack: raise KeyError except KeyError: raise BadTimingError("Broadcast packet not from a ping neighbor") ack_flags = 0 # Check if we've seen this message before. ack_key = osm.mrm.generateKey(data) if osm.mrm.pokeMessage(ack_key, nb_ipp): # Ack and skip the rest self.sendAckPacket(nb_ipp, ACK_BROADCAST, ack_flags, ack_key) return # Get the source node object, if any try: src_n = osm.lookup_ipp[src_ipp] except KeyError: src_n = None try: # Filter all non-bridgey broadcasts from bridge nodes. if not bridgey and self.isFromBridgeNode(src_n, src_ipp): raise BadBroadcast("Bridge can't use " + kind) # Callback the check_cb function check_cb(src_n, src_ipp, rest) except BadBroadcast, e: self.main.logPacket("Bad Broadcast: %s" % str(e)) # Mark that we've seen this message, but don't forward it. osm.mrm.newMessage(data, tries=0, nb_ipp=nb_ipp) # Ack and skip the rest self.sendAckPacket(nb_ipp, ACK_BROADCAST, ack_flags, ack_key) return except Reject: # check_cb told us to reject this broadcast if src_ipp == nb_ipp: # If this is from a neighbor, just set the flag. # We'll send the ack later. ack_flags |= ACK_REJECT_BIT elif not (flags & REJECT_BIT): # Not from a neighbor, so send a reject packet immediately. self.sendAckPacket( src_ipp, ACK_BROADCAST, ACK_REJECT_BIT, ack_key) # Set this flag to indicate to forwarded neighbors that we've # rejected the message. flags |= REJECT_BIT if hop > 0: # Start with the broadcast header packet = osm.mrm.broadcastHeader(kind, src_ipp, hop-1, flags) # Keep the rest of the message intact packet.append(rest) # Pass this message to MessageRoutingManager, so it will be # forwarded to all of my neighbors. osm.mrm.newMessage(''.join(packet), tries=2, nb_ipp=nb_ipp) # Ack the neighbor self.sendAckPacket(nb_ipp, ACK_BROADCAST, ack_flags, ack_key) # Update the original sender's age in the peer cache src_ad = Ad().setRawIPPort(src_ipp) self.main.state.refreshPeer(src_ad, 0) def handlePrivMsg(self, ad, data, cb): # Common code for handling private messages (PM, CA, CP) (kind, src_ipp, ack_key, src_nhash, dst_nhash, rest ) = self.decodePacket('!2s6s8s4s4s+', data) # If we're not on the network, ignore it. osm = self.main.osm if not osm: raise BadTimingError("Not ready to handle private message") ack_flags = 0 try: # Make sure src_ipp agrees with the sender's IP self.checkSource(src_ipp, ad) # Make sure we're ready to receive it dch = self.main.getOnlineDCH() if not dch: raise Reject try: n = osm.lookup_ipp[src_ipp] except KeyError: raise Reject("Unknown node") if src_nhash != n.nickHash(): raise Reject("Source nickhash mismatch") if dst_nhash != osm.me.nickHash(): raise Reject("Dest nickhash mismatch") if n.pokePMKey(ack_key): # Haven't seen this message before, so handle it cb(dch, n, rest) except (BadPacketError, BadTimingError, Reject): ack_flags |= ACK_REJECT_BIT # Send acknowledgement self.sendAckPacket(src_ipp, ACK_PRIVATE, ack_flags, ack_key) def sendAckPacket(self, ipp, mode, flags, ack_key): packet = ['AK'] packet.append(self.main.osm.me.ipp) packet.append(struct.pack("!BB", mode, flags)) packet.append(ack_key) ad = Ad().setRawIPPort(ipp) self.main.ph.sendPacket(''.join(packet), ad.getAddrTuple()) def isOutdatedStatus(self, n, pktnum): # This prevents a node's older status messages from taking # precedence over newer messages. if n is None: # Node doesn't exist, can't be outdated return False if n.bridge_data: # Don't allow updates for a bridge node return True if n.status_pktnum is None: # Don't have a pktnum yet, can't be outdated return False if 0 < (n.status_pktnum - pktnum) % 0x100000000 < PKTNUM_BUF: self.main.logPacket("Outdated Status") return True return False def isMyStatus(self, src_ipp, pktnum, sendfull): # This makes corrections to any stray messages on the network that # would have an adverse effect on my current state. osm = self.main.osm # If it's not for me, nothing's wrong. if src_ipp != osm.me.ipp: return False # If it's old, ignore it. if 0 < (osm.me.status_pktnum - pktnum) % 0x100000000 < PKTNUM_BUF: self.main.logPacket("Outdated from-me packet") return True # If it's from my near future, then repair my packet number if 0 < (pktnum - osm.me.status_pktnum) % 0x100000000 < 2 * PKTNUM_BUF: osm.me.status_pktnum = pktnum # If I'm syncd, retransmit my status if osm.syncd: self.main.logPacket("Reacting to an impersonated status") osm.sendMyStatus(sendfull) return True def isFromBridgeNode(self, src_n, src_ipp): # Return true if a source matches a known bridge node. # This is not authenticated, so it should only be used to drop # packets that a bridge shouldn't be sending. osm = self.main.osm return ((src_n and src_n.bridge_data) or (osm and osm.bsm and src_ipp == osm.me.ipp)) def handlePacket_IQ(self, ad, data): # Initialization Request; someone else is trying to get online (kind, myip, port ) = self.decodePacket('!2s4sH', data) if port == 0: raise BadPacketError("Zero Port") # The IPPort which is allegedly mine my_ad = Ad().setRawIP(myip) my_ad.port = self.main.state.udp_port # src_ad is supposed to be the sender node's "true external IPPort" src_ad = Ad() src_ad.port = port if ad.isPrivate() and my_ad.auth('sx', self.main): # If the request came from a private IP address, but was sent # toward a public IP address, then assume the sender node also # has the same public IP address. src_ad.ip = my_ad.ip else: src_ad.ip = ad.ip if not src_ad.auth('sx', self.main): ip_code = CODE_IP_FOREIGN elif not src_ad.auth('b', self.main): ip_code = CODE_IP_BANNED else: ip_code = CODE_IP_OK osm = self.main.osm state = self.main.state # Provide a max of 48 addresses in a normal response, # 8 addresses in a little cache response IR_LEN = 48 IC_LEN = 8 # Lists of stuff node_ipps = [] ir_nodes = [] ir_peercache = [] ic_peercache = [] if ip_code != CODE_IP_OK: # For invalid IPs, send no neighbors, and a small peercache # just so they can try for a second opinion. IR_LEN = IC_LEN elif osm and osm.syncd: # Get a random sample of online nodes (plus me). indices = xrange(len(osm.nodes) + 1) try: indices = random.sample(indices, IR_LEN) except ValueError: pass # Remap the list of indices into a list of ipps. # For the one out-of-bounds index, fill in 'me'. def get_ipp(i): try: return osm.nodes[i].ipp except IndexError: return osm.me.ipp node_ipps = [get_ipp(i) for i in indices] elif osm: # Not syncd yet, don't add any online nodes pass elif (self.main.reconnect_dcall and self.main.accept_IQ_trigger and my_ad.auth('sx', self.main)): # If we've recently failed to connect, then go online # as the sole node on the network. Then report our node ipp # so this other node can try to join us. self.main.addMyIPReport(src_ad, my_ad) self.main.startNodeSync(()) osm = self.main.osm node_ipps = [osm.me.ipp] # Get my own IPP (if I know it) if osm: my_ipp = osm.me.ipp else: my_ipp = None now = time.time() # For each node, add its ip:port, and age. for ipp in node_ipps: if ipp == my_ipp: age = 0 else: try: age = max(now - state.peers[ipp], 0) except KeyError: # If the entry has expired from the cache # (not very likely), then assume 1 hour age = 60*60 ir_nodes.append(struct.pack('!6sI', ipp, int(age))) # Convert node_ipps into a set, for O(1) lookups node_ipps = set(node_ipps) # Grab the youngest peers in our cache. for when,ipp in state.getYoungestPeers(IR_LEN): # Add packet data to the outlist age = max(int(now - when), 0) pc_entry = struct.pack('!6sI', ipp, int(age)) if (len(node_ipps) + len(ir_peercache) < IR_LEN and ipp not in node_ipps): ir_peercache.append(pc_entry) if len(ic_peercache) < IC_LEN: ic_peercache.append(pc_entry) # === IC response packet === packet = ['IC'] # My IPPort packet.append(my_ad.getRawIPPort()) # Add 4-byte sender's IP address packet.append(src_ad.getRawIP()) # Add 1-byte flag: 1 if IP is invalid packet.append(struct.pack('!B', ip_code)) # Add the peercache list packet.append(struct.pack('!B', len(ic_peercache))) packet.extend(ic_peercache) # Send IC packet to alternate port, undo NAT remapping if ad.orig_ip: ad.ip = ad.orig_ip self.sendPacket(''.join(packet), ad.getAddrTuple()) # === IR response packet === packet = ['IR'] # My IPPort packet.append(my_ad.getRawIPPort()) # Add to packet: 4-byte sender's IP address packet.append(src_ad.getRawIP()) # Add 1-byte flag: 1 if IP is invalid packet.append(struct.pack('!B', ip_code)) # Add the node list packet.append(struct.pack('!B', len(ir_nodes))) packet.extend(ir_nodes) # Now add the peercache list packet.append(struct.pack('!B', len(ir_peercache))) packet.extend(ir_peercache) # Send IR packet to dtella port self.sendPacket(''.join(packet), src_ad.getAddrTuple()) # Update the sender in my peer cache (if valid) self.main.state.refreshPeer(src_ad, 0) def handlePacket_IC_alt(self, ad, data): # Initialization Peer Cache (Alt port) (kind, src_ipp, myip, code, rest ) = self.decodePacket('!2s6s4sB+', data) src_ad = Ad().setRawIPPort(src_ipp) if ad.isPrivate(): if not src_ad.auth('sx', self.main): raise BadPacketError("Invalid reported source IP") else: self.checkSource(src_ipp, ad, exempt_ip=True) pc, rest = self.decodeNodeTimeList(rest) if rest: raise BadPacketError("Extra data") if code not in (CODE_IP_OK, CODE_IP_FOREIGN, CODE_IP_BANNED): raise BadPacketError("Bad Response Code") if not self.main.icm: raise BadTimingError("Not in initial connection mode") self.main.icm.receivedInitResponse(src_ipp, myip, code, pc) def handlePacket_IR(self, ad, data): # Initialization Response (kind, src_ipp, myip, code, rest ) = self.decodePacket('!2s6s4sB+', data) src_ad = Ad().setRawIPPort(src_ipp) if ad.isPrivate(): if not src_ad.auth('sx', self.main): raise BadPacketError("Invalid reported source IP") else: self.checkSource(src_ipp, ad, exempt_ip=True) # Node list, Peer Cache nd, rest = self.decodeNodeTimeList(rest) pc, rest = self.decodeNodeTimeList(rest) if rest: raise BadPacketError("Extra data") if code not in (CODE_IP_OK, CODE_IP_FOREIGN, CODE_IP_BANNED): raise BadPacketError("Bad Response Code") if not self.main.icm: raise BadTimingError("Not in initial connection mode") self.main.icm.receivedInitResponse(src_ipp, myip, code, pc, nd) def handlePacket_NS(self, ad, data): # Broadcast: Node Status osm = self.main.osm def check_cb(src_n, src_ipp, rest): (pktnum, expire, sesid, uptime, flags, rest ) = self.decodePacket('!IH4sIB+', rest) nick, rest = self.decodeString1(rest) info, rest = self.decodeString1(rest) persist = bool(flags & PERSIST_BIT) # 2011-08-21: allow 'rest' to be non-empty, in case we want to add # new fields someday. if len(rest) > 1024: raise BadPacketError("Too much extra data") if not (5 <= expire <= 30*60): raise BadPacketError("Expire time out of range") # Make sure this isn't about me if self.isMyStatus(src_ipp, pktnum, sendfull=True): raise BadBroadcast("Impersonating me") if self.isOutdatedStatus(src_n, pktnum): raise BadBroadcast("Outdated") n = osm.refreshNodeStatus( src_ipp, pktnum, expire, sesid, uptime, persist, nick, info) # They had a nick, now they don't. This indicates a problem. # Stop forwarding and notify the user. if nick and not n.nick: raise Reject self.handleBroadcast(ad, data, check_cb) def handlePacket_NH(self, ad, data): # Broadcast: Node Status Hash (keep-alive) osm = self.main.osm def check_cb(src_n, src_ipp, rest): (pktnum, expire, infohash ) = self.decodePacket('!IH4s', rest) if not (5 <= expire <= 30*60): raise BadPacketError("Expire time out of range") # Make sure this isn't about me if self.isMyStatus(src_ipp, pktnum, sendfull=True): raise BadBroadcast("Impersonating me") if self.isOutdatedStatus(src_n, pktnum): raise BadBroadcast("Outdated") if osm.syncd: if src_n and src_n.infohash == infohash: # We are syncd, and this node matches, so extend the # expire timeout and keep forwarding. src_n.status_pktnum = pktnum osm.scheduleNodeExpire(src_n, expire + NODE_EXPIRE_EXTEND) return else: # Syncd, and we don't recognize it raise Reject else: if not (src_n and src_n.expire_dcall): # Not syncd, don't know enough about this node yet, # so just forward blindly. return elif src_n.infohash == infohash: # We know about this node already, and the infohash # matches, so extend timeout and keep forwarding src_n.status_pktnum = pktnum osm.scheduleNodeExpire(src_n, expire + NODE_EXPIRE_EXTEND) return else: # Not syncd, but we know the infohash is wrong. raise Reject self.handleBroadcast(ad, data, check_cb) def handlePacket_NX(self, ad, data): # Broadcast: Node exiting osm = self.main.osm def check_cb(src_n, src_ipp, rest): (sesid, ) = self.decodePacket('!4s', rest) if osm.syncd: if src_ipp == osm.me.ipp and sesid == osm.me.sesid: # Yikes! Make me a new session id and rebroadcast it. osm.me.sesid = randbytes(4) osm.reorderNodesList() osm.sendMyStatus() osm.pgm.scheduleMakeNewLinks() raise BadBroadcast("Tried to exit me") if not src_n: raise BadBroadcast("Node not online") if sesid != src_n.sesid: raise BadBroadcast("Wrong session ID") elif not src_n: # Not syncd, and haven't seen this node yet. # Forward blindly return # Remove node osm.nodeExited(src_n, "Received NX") self.handleBroadcast(ad, data, check_cb) def handlePacket_NF(self, ad, data): # Broadcast: Node failure osm = self.main.osm def check_cb(src_n, src_ipp, rest): (pktnum, sesid, ) = self.decodePacket('!I4s', rest) # Make sure this isn't about me if self.isMyStatus(src_ipp, pktnum, sendfull=False): raise BadBroadcast("I'm not dead!") if not (src_n and src_n.expire_dcall): raise BadBroadcast("Nonexistent node") if src_n.sesid != sesid: raise BadBroadcast("Wrong session ID") if self.isOutdatedStatus(src_n, pktnum): raise BadBroadcast("Outdated") # Reduce the expiration time. If that node isn't actually # dead, it will rebroadcast a status update to correct it. if (dcall_timeleft(src_n.expire_dcall) > NODE_EXPIRE_EXTEND): osm.scheduleNodeExpire(src_n, NODE_EXPIRE_EXTEND) self.handleBroadcast(ad, data, check_cb) def handlePacket_PF(self, ad, data): # Direct: Possible Falure (precursor to NF) osm = self.main.osm if not (osm and osm.syncd): raise BadTimingError("Not ready for PF") (kind, nb_ipp, dead_ipp, pktnum, sesid ) = self.decodePacket('!2s6s6sI4s', data) self.checkSource(nb_ipp, ad, exempt_ip=True) try: n = osm.lookup_ipp[dead_ipp] except KeyError: raise BadTimingError("PF received for not-online node") if n.sesid != sesid: raise BadTimingError("PF has the wrong session ID") if self.isOutdatedStatus(n, pktnum): raise BadTimingError("PF is outdated") osm.pgm.handleNodeFailure(n.ipp, nb_ipp) def handlePacket_CH(self, ad, data): # Broadcast: Chat message osm = self.main.osm def check_cb(src_n, src_ipp, rest): (pktnum, nhash, flags, rest ) = self.decodePacket('!I4sB+', rest) text, rest = self.decodeString2(rest) if rest: raise BadPacketError("Extra data") if src_ipp == osm.me.ipp: # Possibly a spoofed chat from me if nhash == osm.me.nickHash(): dch = self.main.getOnlineDCH() if dch: dch.pushStatus( "*** Chat spoofing detected: %s" % text) raise BadBroadcast("Spoofed chat") if not osm.syncd: # Not syncd, forward blindly return if osm.isModerated(): # Note: this may desync the sender's chat_pktnum, causing # their next valid message to be delayed by 2 seconds, but # it's better than broadcasting useless traffic. raise BadBroadcast("Chat is moderated") elif src_n and nhash == src_n.nickHash(): osm.cms.addMessage( src_n, pktnum, src_n.nick, text, flags) else: raise Reject self.handleBroadcast(ad, data, check_cb) def handlePacket_TP(self, ad, data): # Broadcast: Set topic osm = self.main.osm def check_cb(src_n, src_ipp, rest): (pktnum, nhash, rest ) = self.decodePacket('!I4s+', rest) topic, rest = self.decodeString1(rest) if rest: raise BadPacketError("Extra data") if src_ipp == osm.me.ipp: # Possibly a spoofed topic from me if nhash == osm.me.nickHash(): dch = self.main.getOnlineDCH() if dch: dch.pushStatus( "*** Topic spoofing detected: %s" % topic) raise BadBroadcast("Spoofed topic") if not osm.syncd: # Not syncd, forward blindly return None if src_n and nhash == src_n.nickHash(): osm.tm.gotTopic(src_n, topic) else: raise Reject self.handleBroadcast(ad, data, check_cb) def handlePacket_SQ(self, ad, data): # Broadcast: Search Request osm = self.main.osm def check_cb(src_n, src_ipp, rest): (pktnum, rest ) = self.decodePacket("!I+", rest) string, rest = self.decodeString1(rest) if rest: raise BadPacketError("Extra data") if src_ipp == osm.me.ipp: raise BadBroadcast("Spoofed search") if not osm.syncd: # Not syncd, forward blindly return if src_n: # Looks good dch = self.main.getOnlineDCH() if dch: dch.pushSearchRequest(src_ipp, string) else: # From an invalid node raise Reject self.handleBroadcast(ad, data, check_cb) def handlePacket_AK(self, ad, data): # Direct: Acknowledgement osm = self.main.osm if not osm: raise BadTimingError("Not ready for AK packet") (kind, src_ipp, mode, flags, ack_key ) = self.decodePacket('!2s6sBB8s', data) self.checkSource(src_ipp, ad, exempt_ip=True) reject = bool(flags & ACK_REJECT_BIT) if mode == ACK_PRIVATE: # Handle a private message ack if not osm.syncd: raise BadTimingError("Not ready for PM AK packet") try: n = osm.lookup_ipp[src_ipp] except KeyError: raise BadTimingError("AK: Unknown PM ACK node") else: n.receivedPrivateMessageAck(ack_key, reject) elif mode == ACK_BROADCAST: # Handle a broadcast ack if osm.syncd and reject: osm.mrm.receivedRejection(ack_key, src_ipp) # Tell MRM to stop retransmitting message to this neighbor osm.mrm.pokeMessage(ack_key, src_ipp) else: raise BadPacketError("Unknown AK mode") def handlePacket_CA(self, ad, data): # Direct: ConnectToMe def cb(dch, n, rest): # SSLHACK: newer Dtella versions have an extra flags byte, to allow # for SSL connection requests. Try to decode both forms. try: flags, port = self.decodePacket('!BH', rest) except BadPacketError: flags = 0 port, = self.decodePacket('!H', rest) if port == 0: raise BadPacketError("Zero port") ad = Ad().setRawIPPort(n.ipp) ad.port = port use_ssl = bool(flags & USE_SSL_BIT) dch.pushConnectToMe(ad, use_ssl) self.handlePrivMsg(ad, data, cb) def handlePacket_CP(self, ad, data): # Direct: RevConnectToMe def cb(dch, n, rest): if rest: raise BadPacketError("Extra data") n.openRevConnectWindow() dch.pushRevConnectToMe(n.nick) self.handlePrivMsg(ad, data, cb) def handlePacket_PM(self, ad, data): # Direct: Private Message def cb(dch, n, rest): flags, rest = self.decodePacket('!B+', rest) text, rest = self.decodeString2(rest) if rest: raise BadPacketError("Extra data") notice = bool(flags & NOTICE_BIT) if notice: nick = "*N %s" % n.nick dch.pushChatMessage(nick, text) else: dch.pushPrivMsg(n.nick, text) self.handlePrivMsg(ad, data, cb) def handlePacket_PG(self, ad, data): # Direct: Local Ping osm = self.main.osm if not osm: raise BadTimingError("Not ready to receive pings yet") (kind, src_ipp, flags, rest ) = self.decodePacket('!2s6sB+', data) self.checkSource(src_ipp, ad, exempt_ip=True) uwant = bool(flags & IWANT_BIT) u_got_ack = bool(flags & GOTACK_BIT) req = bool(flags & REQ_BIT) ack = bool(flags & ACK_BIT) nblist = bool(flags & NBLIST_BIT) if req: req_key, rest = self.decodePacket('!4s+', rest) else: req_key = None if ack: ack_key, rest = self.decodePacket('!4s+', rest) else: ack_key = None if nblist: # Get neighbor list nbs, rest = self.decodeNodeList(rest) if len(nbs) > 8: raise BadPacketError("Too many neighbors") if len(set(nbs)) != len(nbs): raise BadPacketError("Neighbors not all unique") else: nbs = None if rest: raise BadPacketError("Extra Data") osm.pgm.receivedPing(src_ipp, uwant, u_got_ack, req_key, ack_key, nbs) def handlePacket_YQ(self, ad, data): # Sync Request (kind, nb_ipp, hop, flags, src_ipp, sesid ) = self.decodePacket('!2s6sBB6s4s', data) osm = self.main.osm if not (osm and osm.syncd): raise BadTimingError("Not ready to handle a sync request") # Hidden nodes shouldn't be getting sync requests. if self.main.hide_node: raise BadTimingError("Hidden node can't handle sync requests.") self.checkSource(nb_ipp, ad, exempt_ip=True) src_ad = Ad().setRawIPPort(src_ipp) if not src_ad.auth('sbx', self.main): raise BadPacketError("Invalid source IP") timedout = bool(flags & TIMEDOUT_BIT) if not 0 <= hop <= 2: raise BadPacketError("Bad hop count") elif hop == 2 and src_ipp != nb_ipp: raise BadPacketError("Source ip mismatch") # Decrease hop count, and call handler osm.yqrm.receivedSyncRequest(nb_ipp, src_ipp, sesid, hop, timedout) def handlePacket_YR(self, ad, data): # Sync Reply osm = self.main.osm if not (osm and osm.sm): raise BadTimingError("Not ready for sync reply") (kind, src_ipp, pktnum, expire, sesid, uptime, flags, rest ) = self.decodePacket('!2s6sIH4sIB+', data) self.checkSource(src_ipp, ad) persist = bool(flags & PERSIST_BIT) nick, rest = self.decodeString1(rest) info, rest = self.decodeString1(rest) topic, rest = self.decodeString1(rest) c_nbs, rest = self.decodeNodeList(rest) u_nbs, rest = self.decodeNodeList(rest) # 2011-08-21: allow 'rest' to be non-empty, in case we want to add # new fields someday. if len(rest) > 1024: raise BadPacketError("Too much extra data") if not (5 <= expire <= 30*60): raise BadPacketError("Expire time out of range") try: n = osm.lookup_ipp[src_ipp] except KeyError: n = None if self.isFromBridgeNode(n, src_ipp): raise BadPacketError("Bridge can't use YR") # Check for outdated status, in case an NS already arrived. if not self.isOutdatedStatus(n, pktnum): n = osm.refreshNodeStatus( src_ipp, pktnum, expire, sesid, uptime, persist, nick, info) if topic: osm.tm.receivedSyncTopic(n, topic) osm.sm.receivedSyncReply(src_ipp, c_nbs, u_nbs) def handlePacket_EC(self, ad, data): # Login echo osm = self.main.osm if not osm: raise BadTimingError("Not ready for login echo") (kind, rand ) = self.decodePacket('!2s8s', data) osm.receivedLoginEcho(ad, rand) ############################################################################## class InitialContactManager(DatagramProtocol): # Scans through a list of known IP:Ports, and send a small ping to a # bunch of them. Collect addresses of known online peers, and eventually # Pass off the list to the neighbor connection manager. class PeerInfo(object): # Keep the latest timestamps at the top of the heap. __lt__ = lambda self,other: self.seen > other.seen __le__ = lambda self,other: self.seen >= other.seen def __init__(self, ipp, seen): self.ipp = ipp self.seen = seen self.inheap = True self.timeout_dcall = None self.alt_reply = False self.bad_code = False def __init__(self, main): self.main = main self.deferred = None self.peers = {} # {IPPort -> PeerInfo object} for ipp, seen in self.main.state.peers.iteritems(): self.peers[ipp] = self.PeerInfo(ipp, seen) self.heap = self.peers.values() heapq.heapify(self.heap) self.waitreply = set() self.node_ipps = set() self.initrequest_dcall = None self.finish_dcall = None self.counters = { 'good':0, 'foreign_ip':0, 'banned_ip':0, 'dead_port':0} def start(self): CHECK(self.deferred is None) self.deferred = defer.Deferred() self.main.showLoginStatus("Scanning For Online Nodes...", counter=1) # Get the main UDP socket's bind interface (usually empty) bind_ip = self.main.ph.transport.interface # Listen on an arbitrary UDP port try: reactor.listenUDP(0, self, interface=bind_ip) except twisted.internet.error.BindError: self.main.showLoginStatus("Failed to bind alt UDP port!") self.deferred.callback(('no_nodes', None)) else: self.scheduleInitRequest() return self.deferred def newPeer(self, ipp, seen): # Called by PeerAddressManager try: p = self.peers[ipp] except KeyError: p = self.peers[ipp] = self.PeerInfo(ipp, seen) heapq.heappush(self.heap, p) self.scheduleInitRequest() else: if seen > p.seen: p.seen = seen # Bubble it up the heap. # This takes O(n) and uses an undocumented heapq function... if p.inheap: heapq._siftdown(self.heap, 0, self.heap.index(p)) def scheduleInitRequest(self): if not self.deferred: return if self.initrequest_dcall: return def cb(): self.initrequest_dcall = None try: p = heapq.heappop(self.heap) except IndexError: self.checkStatus() return p.inheap = False ad = Ad().setRawIPPort(p.ipp) packet = ['IQ'] packet.append(ad.getRawIP()) packet.append(struct.pack('!H', self.main.state.udp_port)) self.main.logPacket("IQ -> %s:%d" % ad.getAddrTuple()) packet = self.main.pk_enc.encrypt(''.join(packet)) try: # Send from the alternate port self.transport.write(packet, ad.getAddrTuple()) except (AttributeError, socket.error): # Socket got funky, let the timeouts take care of it. pass except RuntimeError: # Workaround for the Twisted infinte recursion bug pass else: self.schedulePeerContactTimeout(p) self.initrequest_dcall = reactor.callLater(0.05, cb) self.initrequest_dcall = reactor.callLater(0, cb) def schedulePeerContactTimeout(self, p): CHECK(p not in self.waitreply) self.waitreply.add(p) def cb(): p.timeout_dcall = None self.waitreply.remove(p) if p.alt_reply: self.recordResultType('dead_port') self.checkStatus() p.timeout_dcall = reactor.callLater(5.0, cb) def cancelPeerContactTimeout(self, p): try: self.waitreply.remove(p) except KeyError: return False dcall_discard(p, 'timeout_dcall') return True def receivedInitResponse(self, src_ipp, myip, code, pc, nd=None): # Get my own IP address my_ad = Ad().setRawIP(myip) self.main.logPacket("Init Response: myip=%s code=%d" % (my_ad.getTextIP(), code)) try: p = self.peers[src_ipp] except KeyError: raise BadPacketError("Didn't ask for this response") if nd is None: # IC packet # Ignore if we've already gotten one, or if # The IR has already arrived, or expired. if p.alt_reply or p.timeout_dcall is None: return p.alt_reply = True else: # IR packet if not self.cancelPeerContactTimeout(p): # Wasn't waiting for this reply return # Add some new peers to our cache if pc: for ipp, age in pc: ad = Ad().setRawIPPort(ipp) self.main.state.refreshPeer(ad, age) # Add my own IP to the list, even if it's banned. src_ad = Ad().setRawIPPort(src_ipp) self.main.addMyIPReport(src_ad, my_ad) if code != CODE_IP_OK: if not p.bad_code: p.bad_code = True if code == CODE_IP_FOREIGN: self.recordResultType('foreign_ip') elif code == CODE_IP_BANNED: self.recordResultType('banned_ip') self.cancelPeerContactTimeout(p) self.checkStatus() return # Add the node who sent this packet to the cache self.main.state.refreshPeer(src_ad, 0) # If this is an IC packet, stop here. if nd is None: return # Add to set of currently online nodes if nd: for ipp, age in nd: ad = Ad().setRawIPPort(ipp) # Add to the peer cache self.main.state.refreshPeer(ad, age) # Add to set of probably-active nodes self.node_ipps.add(ipp) self.recordResultType('good') # Check if there's nothing left to do self.checkStatus() def recordResultType(self, kind): self.main.logPacket("Recording result: '%s'" % kind) self.counters[kind] += 1 # Finish init after 5 seconds of inactivity if self.finish_dcall: self.finish_dcall.reset(5.0) return def cb(): self.finish_dcall = None self.checkStatus(finished=True) self.finish_dcall = reactor.callLater(5.0, cb) def checkStatus(self, finished=False): # Stop if # - We receive 5 good replies, which make up >= 10% of the total # - We receive 50 total replies # - There is a 5-second gap of no new replies # After stopping, successful if good makes up >= 10% of the total total = sum(self.counters.values()) ngood = self.counters['good'] if not (self.heap or self.waitreply) or total >= 50: finished = True if finished: if total > 0 and ngood >= total * 0.10: self.initCompleted(good=True) else: self.initCompleted(good=False) elif ngood >= 5 and ngood >= total * 0.10: self.initCompleted(good=True) def initCompleted(self, good): self.shutdown() if good: self.deferred.callback(('good', self.node_ipps)) else: # In a tie, prefer 'banned_ip' over 'foreign_ip', etc. rank = [] i = 3 for name in ('banned_ip', 'foreign_ip', 'dead_port'): rank.append( (self.counters[name], i, name) ) i -= 1 # Sort in descending order rank.sort(reverse=True) if rank[0][0] == 0: # Nobody replied self.deferred.callback(('no_nodes', None)) else: # Return the name of the failure which occurred most self.deferred.callback((rank[0][2], None)) def datagramReceived(self, data, addr): # Let the main PeerHandler take care of decoding packets sent # to the alternate UDP port. self.main.ph.datagramReceived(data, addr, altport=True) def shutdown(self): # Cancel all dcalls dcall_discard(self, 'initrequest_dcall') dcall_discard(self, 'finish_dcall') for p in self.peers.values(): dcall_discard(p, 'timeout_dcall') # Close socket if self.transport: self.transport.stopListening() ############################################################################## class Node(object): implements(IDtellaNickNode) __lt__ = lambda self,other: self.dist < other.dist __le__ = lambda self,other: self.dist <= other.dist # For statistics (bridge nicks are False) is_peer = True # This will be redefined for bridge nodes bridge_data = None # Remember when we receive a RevConnect rcWindow_dcall = None def __init__(self, ipp): # Dtella Tracking stuff self.ipp = ipp # 6-byte IP:Port self.sesid = None # 4-byte session ID self.dist = None # 16-byte md5 "distance" self.expire_dcall = None # dcall for expiring stale nodes self.status_pktnum = None # Pktnum of last status update # ChatMessageSequencer stuff self.chatq = [] self.chatq_base = None self.chatq_dcall = None # ack_key -> timeout DelayedCall self.msgkeys_out = {} self.msgkeys_in = {} # General Info self.nick = '' self.dcinfo = '' self.location = '' self.shared = 0 self.dttag = "" self.infohash = None self.uptime = 0.0 self.persist = False def calcDistance(self, me): # Distance is pseudo-random, to keep the network spread out my_key = me.ipp + me.sesid nb_key = self.ipp + self.sesid if my_key <= nb_key: self.dist = md5(my_key + nb_key).digest() else: self.dist = md5(nb_key + my_key).digest() def nickHash(self): # Return a 4-byte hash to prevent a transient nick mismapping if self.nick: return md5(self.ipp + self.sesid + self.nick).digest()[:4] else: return None def flags(self): flags = (self.persist and PERSIST_BIT) return struct.pack('!B', flags) def getPMAckKey(self): # Generate random packet ID for messages going TO this node while 1: ack_key = randbytes(8) if ack_key not in self.msgkeys_out: break return ack_key def pokePMKey(self, ack_key): # Schedule expiration of a PM ack key, for messages we # receive _FROM_ this node. # Return True if this is a new key try: self.msgkeys_in[ack_key].reset(60.0) return False except KeyError: def cb(): self.msgkeys_in.pop(ack_key) self.msgkeys_in[ack_key] = reactor.callLater(60.0, cb) return True def setInfo(self, info): old_dcinfo = self.dcinfo self.dcinfo, self.location, self.shared = ( parse_incoming_info(SSLHACK_filter_flags(info))) if self.sesid is None: # Node is uninitialized self.infohash = None else: self.infohash = md5( self.sesid + self.flags() + self.nick + '|' + info ).digest()[:4] return self.dcinfo != old_dcinfo def setNoUser(self): # Wipe out the nick, and set info to contain only a Dt tag. self.nick = '' if self.dttag: self.setInfo("<%s>" % self.dttag) else: self.setInfo("") def openRevConnectWindow(self): # When get a RevConnect, create a 5-second window during # which errors are suppressed for outgoing connects. if self.rcWindow_dcall: self.rcWindow_dcall.reset(5.0) return def cb(): del self.rcWindow_dcall self.rcWindow_dcall = reactor.callLater(5.0, cb) def checkRevConnectWindow(self): # If the RevConnect window is open, close it and return True. if self.rcWindow_dcall: self.rcWindow_dcall.cancel() del self.rcWindow_dcall return True else: return False def sendPrivateMessage(self, ph, ack_key, packet, fail_cb): # Send an ACK-able direct message to this node def cb(tries): if tries == 0: del self.msgkeys_out[ack_key] fail_cb("Timeout") return ad = Ad().setRawIPPort(self.ipp) ph.sendPacket(packet, ad.getAddrTuple()) # Set timeout for outbound message # This will be cancelled if we receive an AK in time. dcall = reactor.callLater(1.0, cb, tries-1) dcall.pm_fail_cb = fail_cb self.msgkeys_out[ack_key] = dcall # Send it 3 times, then fail. cb(3) def receivedPrivateMessageAck(self, ack_key, reject): # Got an ACK for a private message try: dcall = self.msgkeys_out.pop(ack_key) except KeyError: return if reject: dcall.pm_fail_cb("Rejected") dcall.cancel() def event_PrivateMessage(self, main, text, fail_cb): osm = main.osm if len(text) > 1024: text = text[:1024-12] + ' [Truncated]' flags = 0 ack_key = self.getPMAckKey() packet = ['PM'] packet.append(osm.me.ipp) packet.append(ack_key) packet.append(osm.me.nickHash()) packet.append(self.nickHash()) packet.append(struct.pack('!BH', flags, len(text))) packet.append(text) packet = ''.join(packet) self.sendPrivateMessage(main.ph, ack_key, packet, fail_cb) def event_ConnectToMe(self, main, port, use_ssl, fail_cb): osm = main.osm ack_key = self.getPMAckKey() flags = (use_ssl and USE_SSL_BIT) packet = ['CA'] packet.append(osm.me.ipp) packet.append(ack_key) packet.append(osm.me.nickHash()) packet.append(self.nickHash()) if flags: # SSLHACK: This packet can't be understood by older Dtella # versions, but stripping the SSL flag from MyINFO should # prevent it from happening very often. packet.append(struct.pack('!B', flags)) packet.append(struct.pack('!H', port)) packet = ''.join(packet) self.sendPrivateMessage(main.ph, ack_key, packet, fail_cb) def event_RevConnectToMe(self, main, fail_cb): osm = main.osm ack_key = self.getPMAckKey() packet = ['CP'] packet.append(osm.me.ipp) packet.append(ack_key) packet.append(osm.me.nickHash()) packet.append(self.nickHash()) packet = ''.join(packet) self.sendPrivateMessage(main.ph, ack_key, packet, fail_cb) def nickRemoved(self, main): osm = main.osm # Cancel all pending privmsg timeouts for dcall in self.msgkeys_in.itervalues(): dcall.cancel() for dcall in self.msgkeys_out.itervalues(): dcall.cancel() self.msgkeys_in.clear() self.msgkeys_out.clear() osm.cms.clearQueue(self) # Bridge stuff if osm.bsm: osm.bsm.nickRemoved(self) def shutdown(self, main): dcall_discard(self, 'expire_dcall') dcall_discard(self, 'rcWindow_dcall') self.nickRemoved(main) if self.bridge_data: self.bridge_data.shutdown() verifyClass(IDtellaNickNode, Node) class MeNode(Node): info_out = "" def event_PrivateMessage(self, main, text, fail_cb): dch = main.getOnlineDCH() if dch: dch.pushPrivMsg(dch.nick, text) else: fail_cb("I'm not online!") def event_ConnectToMe(self, main, port, use_ssl, fail_cb): fail_cb("can't get files from yourself!") def event_RevConnectToMe(self, main, fail_cb): fail_cb("can't get files from yourself!") verifyClass(IDtellaNickNode, MeNode) ############################################################################## class SyncManager(object): class SyncInfo(object): def __init__(self, ipp): self.ipp = ipp self.timeout_dcall = None self.fail_limit = 2 # Used for stats self.in_total = False self.in_done = False self.proxy_request = False def __init__(self, main): self.main = main self.uncontacted = RandSet() self.waitcount = 0 self.info = {} for n in self.main.osm.nodes: s = self.info[n.ipp] = self.SyncInfo(n.ipp) s.in_total = True self.uncontacted.add(n.ipp) # Keep stats for how far along we are self.stats_done = 0 self.stats_total = len(self.uncontacted) self.stats_lastbar = -1 self.proxy_success = 0 self.proxy_failed = 0 self.main.showLoginStatus("Network Sync In Progress...", counter='inc') self.showProgress_dcall = None self.showProgress() # Start smaller to prevent an initial flood self.request_limit = 2 self.advanceQueue() def updateStats(self, s, done, total): # Update the sync statistics for a single node. if done > 0 and not s.in_done: s.in_done = True self.stats_done += 1 elif done < 0 and s.in_done: s.in_done = False self.stats_done -= 1 if total > 0 and not s.in_total: s.in_total = True self.stats_total += 1 elif total < 0 and s.in_total: s.in_total = False self.stats_total -= 1 def showProgress(self): # Notify the user of the sync stats, if they've changed. MAX = 20 done = self.stats_done total = self.stats_total if total == 0: bar = MAX else: bar = (MAX * done) // total dcall_discard(self, 'showProgress_dcall') def cb(): self.showProgress_dcall = None if bar == self.stats_lastbar: return self.stats_lastbar = bar progress = '>'*bar + '_'*(MAX-bar) self.main.showLoginStatus( "[%s] (%d/%d)" % (progress, done, total)) if bar == MAX: # The final update should draw immediately cb() else: # Otherwise, only draw once per reactor loop self.showProgress_dcall = reactor.callLater(0, cb) def advanceQueue(self): # Raise request limit the first time it fills up if self.request_limit < 5 and self.waitcount >= 5: self.request_limit = 5 while self.waitcount < self.request_limit: try: # Grab an arbitrary (semi-pseudorandom) uncontacted node. ipp = self.uncontacted.pop() except KeyError: # Ran out of nodes; see if we're done yet. if self.waitcount == 0: dcall_discard(self, 'showProgress_dcall') self.main.osm.syncComplete() return s = self.info[ipp] osm = self.main.osm ph = self.main.ph hops = 2 flags = (s.fail_limit < 2) and TIMEDOUT_BIT # Send the sync request packet = osm.mrm.broadcastHeader('YQ', osm.me.ipp, hops, flags) packet.append(osm.me.sesid) ad = Ad().setRawIPPort(s.ipp) ph.sendPacket(''.join(packet), ad.getAddrTuple()) self.scheduleSyncTimeout(s) def giveUpNode(self, ipp): # This node seems to have left the network, so don't contact it. try: s = self.info.pop(ipp) except KeyError: return self.uncontacted.discard(ipp) self.cancelSyncTimeout(s) self.updateStats(s, -1, -1) self.showProgress() def receivedSyncReply(self, src_ipp, c_nbs, u_nbs): my_ipp = self.main.osm.me.ipp # Loop through all the nodes that were just contacted by proxy for ipp in c_nbs: if ipp == my_ipp: continue try: s = self.info[ipp] except KeyError: # Haven't seen this one before, set a timeout because # we should be hearing a reply. s = self.info[ipp] = self.SyncInfo(ipp) self.scheduleSyncTimeout(s, proxy=True) self.updateStats(s, 0, +1) else: if ipp in self.uncontacted: # Seen this node, had planned to ping it later. # Pretend like we just pinged it now. self.uncontacted.discard(ipp) self.scheduleSyncTimeout(s, proxy=True) # Loop through all the nodes which weren't contacted by this # host, but that the host is neighbors with. for ipp in u_nbs: if ipp == my_ipp: continue if ipp not in self.info: # If we haven't heard of this node before, create some # info and plan on pinging it later s = self.info[ipp] = self.SyncInfo(ipp) self.uncontacted.add(ipp) self.updateStats(s, 0, +1) self.advanceQueue() # Mark off that we've received a reply. try: s = self.info[src_ipp] except KeyError: s = self.info[src_ipp] = self.SyncInfo(src_ipp) # Keep track of NAT stats if s.proxy_request: s.proxy_request = False if s.fail_limit == 2: self.proxy_success += 1 elif s.fail_limit == 1: self.proxy_failed += 1 if (self.proxy_failed + self.proxy_success >= 10 and self.proxy_failed > self.proxy_success): self.main.needPortForward() return self.uncontacted.discard(src_ipp) self.updateStats(s, +1, +1) self.showProgress() self.cancelSyncTimeout(s) def scheduleSyncTimeout(self, s, proxy=False): if s.timeout_dcall: return def cb(): s.timeout_dcall = None self.waitcount -= 1 s.fail_limit -= 1 if s.fail_limit > 0: # Try again later self.uncontacted.add(s.ipp) else: self.updateStats(s, 0, -1) self.showProgress() self.advanceQueue() # Remember if this was requested first by another node if s.fail_limit == 2 and proxy: s.proxy_request = True self.waitcount += 1 s.timeout_dcall = reactor.callLater(2.0, cb) def cancelSyncTimeout(self, s): if not s.timeout_dcall: return dcall_discard(s, 'timeout_dcall') self.waitcount -= 1 self.advanceQueue() def shutdown(self): # Cancel all timeouts dcall_discard(self, 'showProgress_dcall') for s in self.info.values(): dcall_discard(s, 'timeout_dcall') ############################################################################## class OnlineStateManager(object): def __init__(self, main, my_ipp, node_ipps, bcm=None, bsm=None): self.main = main self.main.osm = self self.syncd = False # Don't allow myself in the nodes list if node_ipps: node_ipps.discard(my_ipp) # Create a Node for me self.me = MeNode(my_ipp) self.me.sesid = randbytes(4) self.me.uptime = seconds() # NickManager self.nkm = NickManager(main) # MessageRoutingManager self.mrm = MessageRoutingManager(main) # PingManager self.pgm = PingManager(main) # TopicManager self.tm = TopicManager(main) # BanManager self.banm = BanManager(main) # ChatMessageSequencer self.cms = ChatMessageSequencer(main) # BridgeClientManager / BridgeServerManager self.bcm = bcm self.bsm = bsm # SyncManager (init after contacting the first neighbor) self.sm = None # Init all these when sync is established: self.yqrm = None # SyncRequestRoutingManager self.sendStatus_dcall = None # Keep track of outbound status rate limiting self.statusLimit_time = seconds() - 999 self.statusLimit_dcall = None self.sendLoginEcho() # List of online nodes, sorted by random distance. self.nodes = [] # Index of online nodes: ipp -> Node() self.lookup_ipp = {} for ipp in node_ipps: self.addNodeToNodesList(Node(ipp)) # Initially, we'll just connect to random nodes. # This list will be sorted after syncing is finished. random.shuffle(self.nodes) if self.nodes: self.main.showLoginStatus( "Joining The Network.", counter='inc') self.pgm.scheduleMakeNewLinks() else: self.main.showLoginStatus( "Creating a new empty network.", counter='inc') self.syncComplete() def syncComplete(self): # Forget the SyncManager self.sm = None # Unconfirmed nodes (without an expiration) can't exist once the # network is syncd, so purge them from the nodes list. old_nodes = self.nodes self.nodes = [] self.lookup_ipp.clear() for n in old_nodes: if n.expire_dcall: self.addNodeToNodesList(n) else: self.pgm.removeOutboundLink(n.ipp) self.reorderNodesList() # Get ready to handle Sync requests from other nodes self.yqrm = SyncRequestRoutingManager(self.main) self.syncd = True if self.bsm: self.bsm.syncComplete() # Connect to the "closest" neighbors self.pgm.scheduleMakeNewLinks() # Tell observers to get the nick list, topic, etc. self.main.stateChange_DtellaUp() self.main.showLoginStatus( "Sync Complete; You're Online!", counter='inc') def refreshNodeStatus(self, src_ipp, pktnum, expire, sesid, uptime, persist, nick, info): CHECK(src_ipp != self.me.ipp) try: n = self.lookup_ipp[src_ipp] in_nodes = True except KeyError: n = Node(src_ipp) in_nodes = False self.main.logPacket("Status: %s %d (%s)" % (hexlify(src_ipp), expire, nick)) # Update the last-seen status packet number n.status_pktnum = pktnum # Change uptime to a fixed time when the node went up uptime = seconds() - uptime if self.syncd and in_nodes and n.sesid != sesid: # session ID changed; remove n from sorted nodes list # so that it will be reinserted into the correct place self.removeNodeFromNodesList(n) in_nodes = False # Update info n.sesid = sesid n.uptime = uptime n.persist = persist # Save version info n.dttag = parse_dtella_tag(info) if nick == n.nick: # Nick hasn't changed, just update info self.nkm.setInfoInList(n, info) else: # Nick has changed. # Remove old nick, if it's in there self.nkm.removeNode(n, "No DC client") # Run a sanity check on the new nick if nick and validateNick(nick) != '': # Malformed n.setNoUser() else: # Good nick, update the info n.nick = nick n.setInfo(info) # Try to add the new nick (no-op if the nick is empty) try: self.nkm.addNode(n) except NickError: n.setNoUser() # If n isn't in nodes list, then add it if not in_nodes: self.addNodeToNodesList(n) # Expire this node after the expected retransmit self.scheduleNodeExpire(n, expire + NODE_EXPIRE_EXTEND) # Possibly make this new node an outgoing link self.pgm.scheduleMakeNewLinks() # Return the node return n def nodeExited(self, n, reason): # Node n dropped off the network dcall_discard(n, 'expire_dcall') self.removeNodeFromNodesList(n) # Tell the TopicManager this node is leaving self.tm.checkLeavingNode(n) # If it's a bridge node, clean up the extra data if n.bridge_data: n.bridge_data.myNodeExited() del n.bridge_data # Remove from the nick mapping self.nkm.removeNode(n, reason) n.dttag = "" n.setNoUser() # Remove from the SyncManager, if it's active if self.sm: self.sm.giveUpNode(n.ipp) # Remove from outbound links; find more if needed. if self.pgm.removeOutboundLink(n.ipp): self.pgm.scheduleMakeNewLinks() def addNodeToNodesList(self, n): if self.syncd: n.calcDistance(self.me) bisect.insort(self.nodes, n) else: self.nodes.append(n) self.lookup_ipp[n.ipp] = n def removeNodeFromNodesList(self, n): # Remove a node from self.nodes. It must exist. if self.syncd: i = bisect.bisect_left(self.nodes, n) CHECK(self.nodes[i] == n) del self.nodes[i] else: self.nodes.remove(n) del self.lookup_ipp[n.ipp] def reorderNodesList(self): # Recalculate and sort all nodes in the nodes list. for n in self.nodes: n.calcDistance(self.me) self.nodes.sort() def scheduleNodeExpire(self, n, when): # Schedule a timer for the given node to expire from the network if n.expire_dcall: n.expire_dcall.reset(when) return def cb(): n.expire_dcall = None self.nodeExited(n, "Node Timeout") n.expire_dcall = reactor.callLater(when, cb) def getStatus(self): status = [] # My Session ID status.append(self.me.sesid) # My Uptime and Flags status.append(struct.pack('!I', int(seconds() - self.me.uptime))) status.append(self.me.flags()) # My Nick status.append(struct.pack('!B', len(self.me.nick))) status.append(self.me.nick) # My Info status.append(struct.pack('!B', len(self.me.info_out))) status.append(self.me.info_out) return status def updateMyInfo(self, send=False): # Grab my info from the DC client (if any) and maybe broadcast # it into the network. # If I'm a bridge, send bridge state instead. if self.bsm: if self.syncd: self.bsm.sendState() return dch = self.main.getOnlineDCH() me = self.me old_state = (me.nick, me.info_out, me.persist) me.persist = self.main.state.persistent me.dttag = get_version_string() if dch: me.info_out = dch.formatMyInfo() nick = dch.nick else: me.info_out = "<%s>" % me.dttag nick = '' if me.nick == nick: # Nick hasn't changed, just update info self.nkm.setInfoInList(me, me.info_out) else: # Nick has changed # Remove old node, if I'm in there self.nkm.removeNode(me, "Removing Myself") # Set new info me.nick = nick me.setInfo(me.info_out) # Add it back in, (no-op if my nick is empty) try: self.nkm.addNode(me) except NickError: # Nick collision. Force the DC client to go invisible. # This will recursively call updateMyInfo with an empty nick. lines = [ "The nick <%s> is already in use on this network." % nick, "Please change your nick, or type !REJOIN to try again." ] self.main.kickObserver(lines=lines, rejoin_time=None) return changed = (old_state != (me.nick, me.info_out, me.persist)) if (send or changed) and self.syncd: self.sendMyStatus() def sendMyStatus(self, sendfull=True): # Immediately send my status, and keep sending updates over time. # This should never be called for a bridge. CHECK(not self.bsm) # Skip this stuff for hidden nodes. if self.main.hide_node: return self.checkStatusLimit() def cb(sendfull): # Choose an expiration time so that the network handles # approximately 1 status update per second, but set bounds of # about 1-15 minutes expire = max(60.0, min(900.0, len(self.nodes))) expire *= random.uniform(0.9, 1.1) self.sendStatus_dcall = reactor.callLater(expire, cb, False) pkt_id = struct.pack('!I', self.mrm.getPacketNumber_status()) if sendfull: packet = self.mrm.broadcastHeader('NS', self.me.ipp) packet.append(pkt_id) packet.append(struct.pack('!H', int(expire))) packet.extend(self.getStatus()) else: packet = self.mrm.broadcastHeader('NH', self.me.ipp) packet.append(pkt_id) packet.append(struct.pack('!H', expire)) packet.append(self.me.infohash) self.mrm.newMessage(''.join(packet), tries=8) dcall_discard(self, 'sendStatus_dcall') cb(sendfull) def checkStatusLimit(self): # Do a sanity check on the rate of status updates that I'm sending. # If other nodes are causing me to trigger a lot, then something's # amiss, so go to sleep for a while. if self.statusLimit_dcall: return # Limit to 8 updates over 8 seconds now = seconds() self.statusLimit_time = max(self.statusLimit_time, now-8.0) self.statusLimit_time += 1.0 if self.statusLimit_time < now: return def cb(): self.statusLimit_dcall = None self.main.showLoginStatus("*** YIKES! Too many status updates!") self.main.shutdown(reconnect='max') self.statusLimit_dcall = reactor.callLater(0, cb) def isModerated(self): if self.bcm: return self.bcm.isModerated() if self.bsm: return self.bsm.isModerated() return False def sendLoginEcho(self): # Send a packet to myself, in order to determine how my router # (if any) reacts to loopback'd packets. def cb(): self.loginEcho_dcall = None self.loginEcho_rand = None self.main.logPacket("No EC response") echorand = ''.join([chr(random.randint(0,255)) for i in range(8)]) packet = ['EC'] packet.append(echorand) ad = Ad().setRawIPPort(self.me.ipp) self.main.ph.sendPacket(''.join(packet), ad.getAddrTuple()) self.loginEcho_dcall = reactor.callLater(3.0, cb) self.loginEcho_rand = echorand def receivedLoginEcho(self, ad, rand): if rand != self.loginEcho_rand: raise BadPacketError("EC Rand mismatch") myad = Ad().setRawIPPort(self.me.ipp) dcall_discard(self, 'loginEcho_dcall') self.loginEcho_rand = None if ad.ip == myad.ip: return if ad.isPrivate(): # This matches an RFC1918 address, so it looks like a router. # Remap this address to my external IP in the future self.main.ph.remap_ip = (ad.ip, myad.ip) self.main.logPacket("EC: Remap %s->%s" % (ad.getTextIP(), myad.getTextIP())) else: self.main.logPacket("EC: Not RFC1918") def makeExitPacket(self): packet = self.mrm.broadcastHeader('NX', self.me.ipp) packet.append(self.me.sesid) return ''.join(packet) def shutdown(self): # Cancel all the dcalls here dcall_discard(self, 'sendStatus_dcall') dcall_discard(self, 'statusLimit_dcall') # If I'm still syncing, shutdown the SyncManager if self.sm: self.sm.shutdown() # Shut down the MessageRoutingManager (and broadcast NX) if self.mrm: self.mrm.shutdown() # Shut down the BridgeServerManager if self.bsm: self.bsm.shutdown() # Shut down all nodes for n in self.nodes: n.shutdown(self.main) # Shut down the PingManager (and notify outbounds) if self.pgm: self.pgm.shutdown() # Shut down the BanManager (just cancels some dcalls) if self.banm: self.banm.shutdown() # Shut down the BridgeClientManager if self.bcm: self.bcm.shutdown() # Shut down the SyncRequestRoutingManager if self.yqrm: self.yqrm.shutdown() ############################################################################## class PingManager(object): class PingNeighbor(object): def __init__(self, ipp): self.ipp = ipp self.outbound = False self.inbound = False self.ping_reqs = {} # {ack_key: time sent} self.sendPing_dcall = None # dcall for sending pings self.deadNb_dcall = None # keep track of node failure self.got_ack = False self.u_got_ack = False self.ping_nbs = None self.avg_ping = None def stillAlive(self): # return True if the connection hasn't timed out yet return (self.sendPing_dcall and self.sendPing_dcall.args[0] >= 0) def stronglyConnected(self): # return True if both ends are willing to accept broadcast traffic return (self.got_ack and self.u_got_ack) OUTLINK_GOAL = 3 def __init__(self, main): self.main = main self.chopExcessLinks_dcall = None self.makeNewLinks_dcall = None # All of my ping neighbors: ipp -> PingNeighbor() self.pnbs = {} self.onlineTimeout_dcall = None self.scheduleOnlineTimeout() def receivedPing(self, src_ipp, uwant, u_got_ack, req_key, ack_key, nbs): osm = self.main.osm try: pn = self.pnbs[src_ipp] except KeyError: # If we're not fully online yet, then reject pings that we never # asked for. if not osm.syncd: raise BadTimingError("Not ready to accept pings yet") pn = self.pnbs[src_ipp] = self.PingNeighbor(src_ipp) CHECK(osm.syncd or pn.outbound) # Save list of this node's neighbors if nbs is not None: pn.ping_nbs = tuple(nbs) # Mark neighbor as inbound iff we got a uwant pn.inbound = uwant # If they requested an ACK, then we'll want to ping soon ping_now = bool(req_key) was_stronglyConnected = pn.stronglyConnected() # Keep track of whether the remote node has received an ack from us pn.u_got_ack = u_got_ack # If this ping contains an acknowledgement... if ack_key: try: sendtime = pn.ping_reqs[ack_key] except KeyError: raise BadPacketError("PG: unknown ack") # Keep track of ping delay delay = seconds() - sendtime self.main.logPacket("Ping: %f ms" % (delay * 1000.0)) if pn.avg_ping is None: pn.avg_ping = delay else: pn.avg_ping = 0.8 * pn.avg_ping + 0.2 * delay # If we just got the first ack, then send a ping now to # send the GOTACK bit to neighbor if not pn.got_ack: pn.got_ack = True ping_now = True dcall_discard(pn, 'deadNb_dcall') # Schedule next ping in ~5 seconds self.pingWithRetransmit(pn, tries=4, later=True) # Got ack, so reset the online timeout self.scheduleOnlineTimeout() if not was_stronglyConnected and pn.stronglyConnected(): # Just got strongly connected. if pn.outbound: self.scheduleChopExcessLinks() # If we have a good solid link, then the sync procedure # can begin. if not (osm.syncd or osm.sm): osm.sm = SyncManager(self.main) # Decide whether to request an ACK. This is in a nested # function to make the logic more redable. def i_req(): if not (pn.outbound or pn.inbound): # Don't request an ack for an unwanted connection return False if not pn.stillAlive(): # Try to revitalize this connection return True if (ping_now and hasattr(pn.sendPing_dcall, 'ping_is_shortable') and dcall_timeleft(pn.sendPing_dcall) <= 1.0 ): # We've got a REQ to send out in a very short time, so # send it out early with this packet we're sending already. return True return False if i_req(): # Send a ping with ACK requesting + retransmits self.pingWithRetransmit(pn, tries=4, later=False, ack_key=req_key) elif ping_now: # Send a ping without an ACK request self.sendPing(pn, i_req=False, ack_key=req_key) # If neither end wants this connection, throw it away. if not (pn.outbound or pn.inbound): self.cancelInactiveLink(pn) def pingWithRetransmit(self, pn, tries, later, ack_key=None): dcall_discard(pn, 'sendPing_dcall') pn.ping_reqs.clear() def cb(tries): pn.sendPing_dcall = None # Send the ping self.sendPing(pn, True) # While tries is positive, use 1 second intervals. # When it hits zero, trigger a timeout. As it goes negative, # pings get progressively more spaced out. if tries > 0: when = 1.0 else: tries = max(tries, -7) when = 2.0 ** -tries # max of 128 sec # Tweak the delay when *= random.uniform(0.9, 1.1) # Schedule retransmit pn.sendPing_dcall = reactor.callLater(when, cb, tries-1) # Just failed now if tries == 0: if self.main.osm.syncd and pn.got_ack: # Note that we had to set sendPing_dcall before this. self.handleNodeFailure(pn.ipp) pn.got_ack = False # If this was an inbound node, forget it. pn.inbound = False if pn.outbound: # An outbound link just failed. Go find another one. self.scheduleMakeNewLinks() else: # Neither side wants this link. Clean up. self.cancelInactiveLink(pn) if later: when = 5.0 else: # Send first ping self.sendPing(pn, True, ack_key) tries -= 1 when = 1.0 # Schedule retransmit(s) when *= random.uniform(0.9, 1.1) pn.sendPing_dcall = reactor.callLater(when, cb, tries) # Leave a flag value in the dcall so we can test whether this # ping can be made a bit sooner if later: pn.sendPing_dcall.ping_is_shortable = True def cancelInactiveLink(self, pn): # Quietly remove an unwanted ping neighbor. CHECK(not pn.inbound) CHECK(not pn.outbound) dcall_discard(pn, 'sendPing_dcall') dcall_discard(pn, 'deadNb_dcall') del self.pnbs[pn.ipp] def instaKillNeighbor(self, pn): # Unconditionally drop neighbor connection (used for bans) iwant = pn.outbound pn.inbound = False pn.outbound = False self.cancelInactiveLink(pn) if iwant: self.scheduleMakeNewLinks() def handleNodeFailure(self, ipp, nb_ipp=None): osm = self.main.osm CHECK(osm and osm.syncd) # If this node isn't my neighbor, then don't even bother. try: pn = self.pnbs[ipp] except KeyError: return # Only accept a remote failure if that node is a neighbor of pn. if nb_ipp and pn.ping_nbs is not None and nb_ipp not in pn.ping_nbs: return # If this node's not online, don't bother. try: n = osm.lookup_ipp[ipp] except KeyError: return # A bridge node will just have to time out on its own if n.bridge_data: return # If the node's about to expire anyway, don't bother if dcall_timeleft(n.expire_dcall) <= NODE_EXPIRE_EXTEND * 1.1: return failedMe = not pn.stillAlive() # Trigger an NF message if I've experienced a failure, and: # - someone else just experienced a failure, or # - someone else experienced a failure recently, or # - I seem to be pn's only neighbor. pkt_id = struct.pack('!I', n.status_pktnum) if failedMe and (nb_ipp or pn.deadNb_dcall or pn.ping_nbs==()): dcall_discard(pn, 'deadNb_dcall') packet = osm.mrm.broadcastHeader('NF', n.ipp) packet.append(pkt_id) packet.append(n.sesid) try: osm.mrm.newMessage(''.join(packet), tries=2) except MessageCollisionError: # It's possible, but rare, that we've seen this NF before # without fully processing it. pass osm.scheduleNodeExpire(n, NODE_EXPIRE_EXTEND) elif nb_ipp: # If this failure was reported by someone else, then set the # deadNb_dcall, so when I detect a failure, I'll be sure of it. def cb(): pn.deadNb_dcall = None dcall_discard(pn, 'deadNb_dcall') pn.deadNb_dcall = reactor.callLater(15.0, cb) elif pn.ping_nbs: # Reported by me, and pn has neighbors, so # Send Possible Failure message to pn's neighbors packet = ['PF'] packet.append(osm.me.ipp) packet.append(n.ipp) packet.append(pkt_id) packet.append(n.sesid) packet = ''.join(packet) for nb_ipp in pn.ping_nbs: ad = Ad().setRawIPPort(nb_ipp) self.main.ph.sendPacket(packet, ad.getAddrTuple()) def scheduleMakeNewLinks(self): # Call this whenever a new sync'd node is added # Or when a connected link dies # This never needs to run more than once per reactor loop if self.makeNewLinks_dcall: return def cb(): self.makeNewLinks_dcall = None osm = self.main.osm # Make sure the K closest nonbroken nodes are marked as outbound n_alive = 0 for n in osm.nodes: try: pn = self.pnbs[n.ipp] except KeyError: pn = self.pnbs[n.ipp] = self.PingNeighbor(n.ipp) if not pn.outbound: if not pn.inbound: # Completely new link tries = 2 elif pn.stronglyConnected(): # An active inbound link is being marked as outbound, # so we might want to close some other outbound # link. Note that this won't run until the next # reactor loop. self.scheduleChopExcessLinks() tries = 4 else: # Existing link, not strongly connected yet tries = 2 pn.outbound = True self.pingWithRetransmit(pn, tries=tries, later=False) if pn.outbound and pn.stillAlive(): n_alive += 1 if n_alive >= self.OUTLINK_GOAL: break self.makeNewLinks_dcall = reactor.callLater(0, cb) def scheduleChopExcessLinks(self): # Call this whenever a link goes from a connecting state to an # active state. # This never needs to run more than once per reactor loop if self.chopExcessLinks_dcall: return def cb(): self.chopExcessLinks_dcall = None osm = self.main.osm # Keep a set of unwanted outbound neighbors. We will remove # wanted neighbors from this set, and kill what remains. unwanted = set(pn.ipp for pn in self.pnbs.itervalues() if pn.outbound) n_alive = 0 for n in osm.nodes: try: pn = self.pnbs[n.ipp] if not pn.outbound: raise KeyError except KeyError: # We ran out of nodes before hitting the target number # of strongly connected nodes. That means stuff's still # connecting, and there's no need to remove anyone. unwanted.clear() break # This neighbor is NOT unwanted. unwanted.remove(pn.ipp) # Stop once we reach the desired number of outbound links. if pn.stronglyConnected(): n_alive += 1 if n_alive == self.OUTLINK_GOAL: break # If any unwanted links remain, remove them. for ipp in unwanted: CHECK(self.removeOutboundLink(ipp)) self.chopExcessLinks_dcall = reactor.callLater(0, cb) def scheduleOnlineTimeout(self): # This will automatically shut down the node if we don't get any # ping acknowledgements for a while if self.onlineTimeout_dcall: self.onlineTimeout_dcall.reset(ONLINE_TIMEOUT) return def cb(): self.onlineTimeout_dcall = None self.main.showLoginStatus("Lost Sync!") self.main.shutdown(reconnect='normal') self.onlineTimeout_dcall = reactor.callLater(ONLINE_TIMEOUT, cb) def removeOutboundLink(self, ipp): try: pn = self.pnbs[ipp] except KeyError: return False if not pn.outbound: return False # Send iwant=0 to neighbor pn.outbound = False if pn.inbound: self.pingWithRetransmit(pn, tries=4, later=False) else: self.sendPing(pn, i_req=False, ack_key=None) self.cancelInactiveLink(pn) return True def sendPing(self, pn, i_req, ack_key=None): # Transmit a single ping to the given node osm = self.main.osm # Expire old ack requests if pn.ping_reqs: now = seconds() for req_key, when in pn.ping_reqs.items(): if now - when > 15.0: del pn.ping_reqs[req_key] iwant = pn.outbound # For now, include neighbor list only when requesting an ack. nblist = i_req # Offline bit is set if this neighbor is not recognized. # (this just gets ignored, but it could be useful someday) offline = osm.syncd and (pn.ipp not in osm.lookup_ipp) # Build packet packet = ['PG'] packet.append(osm.me.ipp) flags = ((iwant and IWANT_BIT) | (pn.got_ack and GOTACK_BIT) | (i_req and REQ_BIT) | (bool(ack_key) and ACK_BIT) | (nblist and NBLIST_BIT) | (offline and OFFLINE_BIT) ) packet.append(struct.pack('!B', flags)) if i_req: # I'm requesting that this packet be acknowledged, so generate # a new req_key while True: req_key = randbytes(4) if req_key not in pn.ping_reqs: break pn.ping_reqs[req_key] = seconds() packet.append(req_key) if ack_key: packet.append(ack_key) if nblist: if osm.syncd: # Grab my list of ping neighbors. nbs = [pn_it.ipp for pn_it in self.pnbs.itervalues() if (pn_it.ipp != pn.ipp and pn_it.ipp in osm.lookup_ipp and pn_it.stronglyConnected())] # Don't bother sending more than 8 nbs.sort() del nbs[8:] else: nbs = [] packet.append(struct.pack("!B", len(nbs))) packet.extend(nbs) ad = Ad().setRawIPPort(pn.ipp) self.main.ph.sendPacket(''.join(packet), ad.getAddrTuple()) def shutdown(self): dcall_discard(self, 'chopExcessLinks_dcall') dcall_discard(self, 'makeNewLinks_dcall') dcall_discard(self, 'onlineTimeout_dcall') outbounds = [pn for pn in self.pnbs.itervalues() if pn.outbound] for pn in self.pnbs.values(): # can't use itervalues pn.inbound = False pn.outbound = False self.cancelInactiveLink(pn) for pn in outbounds: self.sendPing(pn, i_req=False, ack_key=None) ############################################################################## class MessageRoutingManager(object): class Message(object): # This is set for my own status messages only. status_pktnum = None def __init__(self, data, tries, sendto, ph): # Message expiration timer. self.expire_dcall = None # If no tries remain, don't try to send anything. if not tries > 0: return # {neighbor ipp -> retry dcall} self.sending = {} create_time = seconds() for nb_ipp in sendto: self.scheduleSend(data, tries, nb_ipp, create_time, ph) self.cleanupIfDoneSending() def scheduleSend(self, data, tries, nb_ipp, create_time, ph): # Get ready to pass this message to a neighbor. # If we're passing an NF to the node who's dying, then up the # number of retries to 8, because it's rather important. if data[0:2] == 'NF' and data[10:16] == nb_ipp: tries = 8 def cb(tries): # Ack timeout/retransmit callback send_data = data # Decrease the hop count by the number of seconds the packet # has been buffered. buffered_time = int(seconds() - create_time) if buffered_time > 0: hops = ord(data[8]) - buffered_time if hops >= 0: # Splice in the reduced hop count. send_data = "%s%c%s" % (data[:8], hops, data[9:]) else: # Drop packet. tries = 0 # Make an attempt now if tries > 0: addr = Ad().setRawIPPort(nb_ipp).getAddrTuple() ph.sendPacket(send_data, addr, broadcast=True) # Reschedule another attempt if tries-1 > 0: when = random.uniform(1.0, 2.0) self.sending[nb_ipp] = reactor.callLater(when, cb, tries-1) else: del self.sending[nb_ipp] self.cleanupIfDoneSending() # Send on the next reactor loop. This gives us a bit of time # to listen for dupes from neighbors. self.sending[nb_ipp] = reactor.callLater(0, cb, tries) def cancelSendToNeighbor(self, nb_ipp): # This neighbor already has the message, so don't send it. try: self.sending.pop(nb_ipp).cancel() except (AttributeError, KeyError): return self.cleanupIfDoneSending() def cleanupIfDoneSending(self): # If no sends are left, free up some RAM. if not self.sending: del self.sending def scheduleExpire(self, msgs, ack_key): # Forget about this message, eventually. if self.expire_dcall: self.expire_dcall.reset(180.0) return def cb(): self.expire_dcall = None self.cancelAllSends() del msgs[ack_key] self.expire_dcall = reactor.callLater(180.0, cb) def cancelAllSends(self): # Cancel any pending sends. try: self.sending except AttributeError: return for d in self.sending.itervalues(): d.cancel() del self.sending def __init__(self, main): self.main = main self.msgs = {} self.rcollide_last_NS = None self.rcollide_ipps = set() r = random.randint(0, 0xFFFFFFFF) self.search_pktnum = r self.chat_pktnum = r self.main.osm.me.status_pktnum = r def generateKey(self, data): # 0:2 = kind # 2:8 = neighbor ipp # 8:9 = hop limit # 9:10 = flags # 10:16 = source ipp # 16: = "the rest" return md5(data[0:2] + data[10:]).digest()[:8] def pokeMessage(self, ack_key, nb_ipp): # If we know about this message, then mark down that this neighbor # has acknowledged it. try: m = self.msgs[ack_key] except KeyError: # Don't know about this message return False # Extend the expiration time. m.scheduleExpire(self.msgs, ack_key) # If not locally-generated, tell the message that this neighbor # acknowledged it. if nb_ipp: m.cancelSendToNeighbor(nb_ipp) # Message is known. return True def newMessage(self, data, tries, nb_ipp=None): # Forward a new message to my neighbors kind = data[0:2] ack_key = self.generateKey(data) if ack_key in self.msgs: raise MessageCollisionError("Duplicate " + kind) ph = self.main.ph osm = self.main.osm # Get my current neighbors who we know to be alive. We don't # need to verify pn.u_got_ack because it doesn't really matter. sendto = (pn.ipp for pn in osm.pgm.pnbs.itervalues() if pn.got_ack) # Start sending. m = self.msgs[ack_key] = self.Message(data, tries, sendto, ph) CHECK(self.pokeMessage(ack_key, nb_ipp)) if data[10:16] == osm.me.ipp: CHECK(not self.main.hide_node) if kind in ('NH','CH','SQ','TP'): # Save the current status_pktnum for this message, because # it's useful if we receive a Reject message later. m.status_pktnum = osm.me.status_pktnum elif kind == 'NS': # Save my last NS message, so that if it gets rejected, # it can be interpreted as a remote nick collision. self.rcollide_last_NS = m self.rcollide_ipps.clear() def receivedRejection(self, ack_key, ipp): # Broadcast rejection, sent in response to a previous broadcast if # another node doesn't recognize us on the network. # We attach a status_pktnum to any broadcast which could possibly # be rejected. If this matches my status_pktnum now, then we should # broadcast a new status, which will change status_pktnum and # prevent this same broadcast from triggering another status update. osm = self.main.osm try: m = self.msgs[ack_key] except KeyError: raise BadTimingError("Reject refers to an unknown broadcast") if m is self.rcollide_last_NS: # Remote nick collision might have occurred self.rcollide_ipps.add(ipp) if len(self.rcollide_ipps) > 1: # Multiple nodes have reported a problem, so tell the user. dch = self.main.getOnlineDCH() if dch: dch.remoteNickCollision() # No more reports until next time self.rcollide_last_NS = None self.rcollide_ipps.clear() if osm.me.status_pktnum == m.status_pktnum: # One of my hash-containing broadcasts has been rejected, so # send my full status to refresh everyone. # (Note: m.status_pktnum is None for irrelevant messages.) osm.sendMyStatus() def getPacketNumber_search(self): self.search_pktnum = (self.search_pktnum + 1) % 0x100000000 return self.search_pktnum def getPacketNumber_chat(self): self.chat_pktnum = (self.chat_pktnum + 1) % 0x100000000 return self.chat_pktnum def getPacketNumber_status(self): me = self.main.osm.me me.status_pktnum = (me.status_pktnum + 1) % 0x100000000 return me.status_pktnum def broadcastHeader(self, kind, src_ipp, hops=32, flags=0): # Build the header used for all broadcast packets packet = [kind] packet.append(self.main.osm.me.ipp) packet.append(struct.pack('!BB', hops, flags)) packet.append(src_ipp) return packet def shutdown(self): # Cancel everything for m in self.msgs.values(): dcall_discard(m, 'expire_dcall') m.cancelAllSends() self.msgs.clear() # Immediately broadcast NX to my neighbors ph = self.main.ph osm = self.main.osm if osm and osm.syncd and not self.main.hide_node: packet = osm.makeExitPacket() for pn in osm.pgm.pnbs.itervalues(): ad = Ad().setRawIPPort(pn.ipp) ph.sendPacket(packet, ad.getAddrTuple(), broadcast=True) ############################################################################## class SyncRequestRoutingManager(object): class Message(object): def __init__(self): self.nbs = {} # {ipp: max hop count} self.expire_dcall = None def scheduleExpire(self, msgs, key): if self.expire_dcall: self.expire_dcall.reset(180.0) return def cb(): del msgs[key] self.expire_dcall = reactor.callLater(180.0, cb) def __init__(self, main): self.main = main self.msgs = {} def receivedSyncRequest(self, nb_ipp, src_ipp, sesid, hop, timedout): osm = self.main.osm ph = self.main.ph key = (src_ipp, sesid) # Get ipp of all syncd neighbors who we've heard from recently CHECK(osm and osm.syncd) my_nbs = [pn.ipp for pn in osm.pgm.pnbs.itervalues() if pn.got_ack and pn.ipp in osm.lookup_ipp] # Put neighbors in random order random.shuffle(my_nbs) # See if we've seen this sync message before try: m = self.msgs[key] isnew = False except KeyError: m = self.msgs[key] = self.Message() isnew = True # Expire the message in a while m.scheduleExpire(self.msgs, key) # Set the hop value of the neighbor who sent us this packet try: if m.nbs[nb_ipp] < hop+1: raise KeyError except KeyError: m.nbs[nb_ipp] = hop+1 if hop > 0: # Build packet to forward packet = osm.mrm.broadcastHeader('YQ', src_ipp, hop-1) packet.append(sesid) packet = ''.join(packet) # Contacted/Uncontacted lists cont = [] uncont = [] for ipp in my_nbs: # If we've already contacted enough nodes, or we know this # node has already been contacted with a higher hop count, # then don't forward the sync request to it. try: if len(cont) >= 3 or m.nbs[ipp] >= hop-1: uncont.append(ipp) continue except KeyError: pass cont.append(ipp) m.nbs[ipp] = hop-1 ad = Ad().setRawIPPort(ipp) ph.sendPacket(packet, ad.getAddrTuple(), broadcast=True) else: # no hops left cont = [] uncont = my_nbs # Cut off after 16 nodes, just in case uncont = uncont[:16] if isnew or timedout: self.sendSyncReply(src_ipp, cont, uncont) def sendSyncReply(self, src_ipp, cont, uncont): ad = Ad().setRawIPPort(src_ipp) osm = self.main.osm CHECK(osm and osm.syncd) # Build Packet packet = ['YR'] # My IP:Port packet.append(osm.me.ipp) # My last pktnum packet.append(struct.pack('!I', osm.me.status_pktnum)) # If we send a YR which is almost expired, followed closely by # an NH with an extended expire time, then a race condition exists, # because the target could discard the NH before receiving the YR. # So, if we're about to expire, go send a status update NOW so that # we'll have a big expire time to give to the target. expire = dcall_timeleft(osm.sendStatus_dcall) if expire <= 5.0: osm.sendMyStatus(sendfull=False) expire = dcall_timeleft(osm.sendStatus_dcall) # Exact time left before my status expires. # (The receiver will add a few buffer seconds.) packet.append(struct.pack('!H', int(expire))) # Session ID, Uptime, Flags, Nick, Info packet.extend(osm.getStatus()) # If I think I set the topic last, then put it in here. # It's up to the receiving end whether they'll believe me. if osm.tm.topic_node is osm.me: topic = osm.tm.topic else: topic = "" packet.append(struct.pack('!B', len(topic))) packet.append(topic) # Contacted Nodes packet.append(struct.pack('!B', len(cont))) packet.extend(cont) # Uncontacted Nodes packet.append(struct.pack('!B', len(uncont))) packet.extend(uncont) self.main.ph.sendPacket(''.join(packet), ad.getAddrTuple()) def shutdown(self): # Cancel all timeouts for m in self.msgs.values(): dcall_discard(m, 'expire_dcall') ############################################################################## class ChatMessageSequencer(object): # If chat messages arrive out-of-order, this will delay # some messages for a couple seconds waiting for packets to arrive. def __init__(self, main): self.main = main def addMessage(self, n, pktnum, nick, text, flags): if not self.main.getStateObserver(): return # False == the bridge wants us to queue everything unlocked = not hasattr(n, 'dns_pending') msg = (nick, text, flags) if n.chatq_base is None: n.chatq_base = pktnum # How far forward/back to accept messages FUZZ = 10 # Find the pktnum index relative to the current base. # If it's slightly older, this will be negative. idx = ((pktnum - n.chatq_base + FUZZ) % 0x100000000) - FUZZ if idx < 0: # Older message, send out of order if unlocked: self.sendMessage(n, msg) elif idx >= FUZZ: # Way out there; put this at the end and dump everything if unlocked: n.chatq.append(msg) self.flushQueue(n) else: # From the near future: (0 <= idx < PKTNUM_BUF) # Make sure the queue is big enough; # put a timestamp in the empty spaces. extra = (idx - len(n.chatq)) + 1 if extra > 0: n.chatq.extend([seconds()] * extra) # Insert the current message into its space if (type(n.chatq[idx]) is float): n.chatq[idx] = msg # Possible spoof? # Don't know which one's real, so flush the queue and move on. elif n.chatq[idx] != msg: if unlocked: n.chatq.insert(idx + 1, msg) self.flushQueue(n) return if unlocked: self.advanceQueue(n) def advanceQueue(self, n): # Send first block of available messages while n.chatq and (type(n.chatq[0]) is not float): msg = n.chatq.pop(0) n.chatq_base = (n.chatq_base + 1) % 0x100000000 self.sendMessage(n, msg) dcall_discard(n, 'chatq_dcall') # If any messages remain, send them later. if not n.chatq: return def cb(): n.chatq_dcall = None # Forget any missing messages at the beginning while n.chatq and (type(n.chatq[0]) is float): n.chatq.pop(0) n.chatq_base = (n.chatq_base + 1) % 0x100000000 # Send the first block of available messages self.advanceQueue(n) # The first queue entry contains a timestamp. # Let the gap survive for 2 seconds total. when = max(0, n.chatq[0] + 2.0 - seconds()) n.chatq_dcall = reactor.callLater(when, cb) def flushQueue(self, n): # Send all the messages in the queue, in order for msg in n.chatq: if (type(msg) is not float): self.sendMessage(n, msg) self.clearQueue(n) def clearQueue(self, n): # Reset everything to normal del n.chatq[:] dcall_discard(n, 'chatq_dcall') n.chatq_base = None def sendMessage(self, n, msg): so = self.main.getStateObserver() if so: nick, text, flags = msg so.event_ChatMessage(n, nick, text, flags) ############################################################################## class BanManager(object): def __init__(self, main): self.main = main self.rebuild_bans_dcall = None self.ban_matcher = SubnetMatcher() self.isBanned = self.ban_matcher.containsIP def scheduleRebuildBans(self): if self.rebuild_bans_dcall: return def cb(): self.rebuild_bans_dcall = None osm = self.main.osm self.ban_matcher.clear() # Get all bans from bridges. if osm.bcm: for bridge in osm.bcm.bridges: for b in bridge.bans.itervalues(): if b.enable: self.ban_matcher.addRange(b.ipmask) # If I'm a bridge, get bans from IRC. if osm.bsm and self.main.ism: for ipmask in self.main.ism.bans: self.ban_matcher.addRange(ipmask) self.enforceAllBans() # This time is slightly above zero, so that broadcast deliveries # will have a chance to take place before carnage occurs. self.rebuild_bans_dcall = reactor.callLater(1.0, cb) def enforceAllBans(self): osm = self.main.osm # Check all the online nodes. for n in list(osm.nodes): int_ip = Ad().setRawIPPort(n.ipp).getIntIP() if self.isBanned(int_ip): osm.nodeExited(n, "Node Banned") # Check my ping neighbors. for pn in osm.pgm.pnbs.values(): # can't use itervalues int_ip = Ad().setRawIPPort(pn.ipp).getIntIP() if self.isBanned(int_ip): osm.pgm.instaKillNeighbor(pn) # Check myself if not osm.bsm: int_ip = Ad().setRawIPPort(osm.me.ipp).getIntIP() if self.isBanned(int_ip): self.main.showLoginStatus("You were banned.") self.main.shutdown(reconnect='max') def shutdown(self): dcall_discard(self, 'rebuild_bans_dcall') ############################################################################## class TopicManager(object): def __init__(self, main): self.main = main self.topic = "" self.topic_whoset = "" self.topic_node = None self.waiting = True def gotTopic(self, n, topic): self.updateTopic(n, n.nick, topic, changed=True) def receivedSyncTopic(self, n, topic): # Topic arrived from a YR packet if self.waiting: self.updateTopic(n, n.nick, topic, changed=False) def updateTopic(self, n, nick, topic, changed): # Don't want any more SyncTopics self.waiting = False # Don't allow a non-bridge node to override a bridge's topic if self.topic_node and n: if self.topic_node.bridge_data and (not n.bridge_data): return False # Sanitize the topic topic = topic[:255].replace('\r','').replace('\n','') # Get old topic old_topic = self.topic # Store stuff self.topic = topic self.topic_whoset = nick self.topic_node = n # Without DC, there's nothing to say dch = self.main.getOnlineDCH() if not dch: return True # If it's changed, push it to the title bar if topic != old_topic: dch.pushTopic(topic) # If a change was reported, tell the user that it changed. if changed and nick: dch.pushStatus("%s changed the topic to: %s" % (nick, topic)) # If a change wasn't reported, but it's new to us, and it's not # empty, then just say what the topic is. if not changed and topic and topic != old_topic: dch.pushStatus(self.getFormattedTopic()) return True def broadcastNewTopic(self, topic): osm = self.main.osm if len(topic) > 255: topic = topic[:255] # Update topic locally if not self.updateTopic(osm.me, osm.me.nick, topic, changed=True): # Topic is controlled by a bridge node self.topic_node.bridge_data.sendTopicChange(topic) return packet = osm.mrm.broadcastHeader('TP', osm.me.ipp) packet.append(struct.pack('!I', osm.mrm.getPacketNumber_search())) packet.append(osm.me.nickHash()) packet.append(struct.pack('!B', len(topic))) packet.append(topic) osm.mrm.newMessage(''.join(packet), tries=4) def getFormattedTopic(self): if not self.topic: return "There is currently no topic set." text = "The topic is: %s" % self.topic if self.topic_node and self.topic_node.nick: whoset = self.topic_node.nick else: whoset = self.topic_whoset if whoset: text += " (set by %s)" % whoset return text def checkLeavingNode(self, n): # If the node who set the topic leaves, wipe out the topic if self.topic_node is n: self.updateTopic(None, "", "", changed=False) ############################################################################## class DtellaMain_Base(object): def __init__(self): self.myip_reports = [] self.reconnect_dcall = None self.reconnect_interval = RECONNECT_RANGE[0] # Initial Connection Manager self.icm = None # Neighbor Connection Manager self.osm = None self.accept_IQ_trigger = False # Pakcet Encoder self.pk_enc = dtella.common.crypto.PacketEncoder(local.network_key) # Register a function that runs before shutting down reactor.addSystemEventTrigger('before', 'shutdown', self.cleanupOnExit) # Set to True to prevent this node from broadcasting. self.hide_node = False def cleanupOnExit(self): raise NotImplementedError("Override me!") def reconnectDesired(self): raise NotImplementedError("Override me!") def startConnecting(self): raise NotImplementedError("Override me!") def startInitialContact(self): # If all the conditions are right, start connection procedure CHECK(not (self.icm or self.osm)) dcall_discard(self, 'reconnect_dcall') def cb(result): self.icm = None result, node_ipps = result if result == 'good': self.startNodeSync(node_ipps) elif result == 'banned_ip': self.showLoginStatus( "Your IP seems to be banned from this network.") self.shutdown(reconnect='max') elif result == 'foreign_ip': try: my_ip = self.selectMyIP(allow_bad=True).getTextIP() except ValueError: my_ip = "?" self.showLoginStatus( "Your IP address (%s) is not authorized to use " "this network." % my_ip) self.shutdown(reconnect='max') elif result == 'dead_port': self.needPortForward() elif result == 'no_nodes': self.showLoginStatus( "No online nodes found.") self.shutdown(reconnect='normal') # If we receive an IQ packet after finding no nodes, then # assume we're a root node and form an empty network if not self.hide_node: self.accept_IQ_trigger = True else: # Impossible result CHECK(False) self.ph.remap_ip = None self.icm = InitialContactManager(self) self.icm.start().addCallback(cb) def needPortForward(self): self.showLoginStatus( "*** UDP PORT FORWARD REQUIRED ***") text = ( "In order for Dtella to communicate properly, it needs to " "receive UDP traffic from the Internet. Dtella is currently " "listening on UDP port %d, but the packets appear to be " "getting blocked, most likely by a firewall or a router. " "If this is the case, then you will have to configure your " "firewall or router to allow UDP traffic through on this " "port. You may tell Dtella to use a different port from " "now on by typing !UDP followed by a number." " " "Note: You will also need to unblock or forward a TCP port " "for your DC++ client to be able to transfer files." % self.state.udp_port ) for line in word_wrap(text): self.showLoginStatus(line) self.shutdown(reconnect='max') def startNodeSync(self, node_ipps): # Determine my IP address and enable the osm CHECK(not (self.icm or self.osm)) # Reset the reconnect interval self.reconnect_interval = RECONNECT_RANGE[0] dcall_discard(self, 'reconnect_dcall') # Get my address and port try: my_ipp = self.selectMyIP().getRawIPPort() except ValueError: self.showLoginStatus("Can't determine my own IP?!") return # Look up my location string if local.use_locations: self.queryLocation(my_ipp) # Get Bridge Client/Server Manager, or nothing. b = self.getBridgeManager() # Enable the object that keeps us online self.osm = OnlineStateManager(self, my_ipp, node_ipps, **b) def getBridgeManager(self): raise NotImplementedError("Override me!") def queryLocation(self, my_ipp): raise NotImplementedError("Override me!") def logPacket(self, text): raise NotImplementedError("Override me!") def showLoginStatus(self, text, counter=None): raise NotImplementedError("Override me!") def shutdown(self, reconnect): # Do a total shutdown of this Dtella node # It's possible for these both to be None, but we still # want to reconnect. (i.e. after an ICM failure) if (self.icm or self.osm): self.showLoginStatus("Shutting down.") dcall_discard(self, 'reconnect_dcall') self.accept_IQ_trigger = False # Shut down InitialContactManager if self.icm: self.icm.shutdown() self.icm = None # Shut down OnlineStateManager if self.osm: # Notify any observers that all the nicks are gone. if self.osm.syncd: self.stateChange_DtellaDown() self.osm.shutdown() self.osm = None # Notify some random handlers of the shutdown self.afterShutdownHandlers() # Schedule a Reconnect (maybe) ... # Check if a reconnect makes sense right now if not self.reconnectDesired(): return if reconnect == 'no': return elif reconnect == 'max': self.reconnect_interval = RECONNECT_RANGE[1] else: CHECK(reconnect in ('normal', 'instant')) if reconnect == 'instant': # Just do an instant reconnect without saying anything. when = 0 self.reconnect_interval = RECONNECT_RANGE[0] else: # Decide how long to wait before reconnecting when = self.reconnect_interval * random.uniform(0.8, 1.2) # Increase the reconnect interval logarithmically self.reconnect_interval = min(self.reconnect_interval * 1.5, RECONNECT_RANGE[1]) self.showLoginStatus("--") self.showLoginStatus( "Next reconnect attempt in %d seconds." % when) def cb(): self.reconnect_dcall = None self.startConnecting() self.reconnect_dcall = reactor.callLater(when, cb) def afterShutdownHandlers(self): raise NotImplementedError("Override me!") def getOnlineDCH(self): raise NotImplementedError("Override me!") def getStateObserver(self): raise NotImplementedError("Override me!") def kickObserver(self, lines, rejoin_time): so = self.getStateObserver() CHECK(so) # Act as if Dtella is shutting down. self.stateChange_DtellaDown() # Force the observer to go invisible, with a kick message. so.event_KickMe(lines, rejoin_time) # Send empty state to Dtella. self.stateChange_ObserverDown() def stateChange_ObserverUp(self): # Called after a DC client / IRC server / etc. has become available. osm = self.osm if osm and osm.syncd: self.osm.updateMyInfo() # Make sure the observer's still online, because a nick collison # in updateMyInfo could have killed it. so = self.getStateObserver() if so: so.event_DtellaUp() def stateChange_ObserverDown(self): # Called after a DC client / IRC server / etc. has gone away. CHECK(not self.getStateObserver()) osm = self.osm if osm and osm.syncd: osm.updateMyInfo() # Cancel all nick-specific messages. for n in osm.nodes: n.nickRemoved(self) def stateChange_DtellaUp(self): # Called after Dtella has finished syncing. osm = self.osm CHECK(osm and osm.syncd) osm.updateMyInfo(send=True) so = self.getStateObserver() if so: so.event_DtellaUp() def stateChange_DtellaDown(self): # Called before Dtella network shuts down. so = self.getStateObserver() if so: # Remove every nick. for n in self.osm.nkm.nickmap.itervalues(): so.event_RemoveNick(n, "Removing All Nicks") so.event_DtellaDown() def addMyIPReport(self, from_ad, my_ad): # from_ad = the IP who sent us this guess # my_ad = the IP that seems to belong to us CHECK(from_ad.auth('sx', self)) fromip = from_ad.getRawIP() myip = my_ad.getRawIP() # If we already have a report from this fromip in the list, remove it. try: i = [r[0] for r in self.myip_reports].index(fromip) del self.myip_reports[i] except ValueError: pass # Only let list grow to 5 entries del self.myip_reports[:-4] # Append this guess to the end self.myip_reports.append((fromip, myip)) def selectMyIP(self, allow_bad=False): # Out of the last 5 responses, pick the IP that occurs most often. # In case of a tie, pick the more recent one. # Map from ip -> list of indexes ip_hits = {} for i, (reporter, ip) in enumerate(self.myip_reports): try: ip_hits[ip].append(i) except KeyError: ip_hits[ip] = [i] # Sort by (hit count, highest index) descending. scores = [(len(hits), hits[-1], ip) for ip, hits in ip_hits.iteritems()] scores.sort(reverse=True) for hit_count, highest_index, ip in scores: ad = Ad().setRawIP(ip) ad.port = self.state.udp_port if allow_bad or ad.auth('sx', self): return ad raise ValueError
pmarks-net/dtella
dtella/common/core.py
Python
gpl-2.0
131,965
0.001523
""" Studio editing view for OpenAssessment XBlock. """ import copy import logging from uuid import uuid4 from django.template.loader import get_template from django.utils.translation import ugettext_lazy from voluptuous import MultipleInvalid from xblock.fields import List, Scope from xblock.core import XBlock from web_fragments.fragment import Fragment from openassessment.xblock.data_conversion import ( create_rubric_dict, make_django_template_key, update_assessments_format ) from openassessment.xblock.defaults import DEFAULT_EDITOR_ASSESSMENTS_ORDER, DEFAULT_RUBRIC_FEEDBACK_TEXT from openassessment.xblock.resolve_dates import resolve_dates, parse_date_value, DateValidationError, InvalidDateFormat from openassessment.xblock.schema import EDITOR_UPDATE_SCHEMA from openassessment.xblock.validation import validator from openassessment.xblock.editor_config import AVAILABLE_EDITORS from openassessment.xblock.load_static import LoadStatic logger = logging.getLogger(__name__) # pylint: disable=invalid-name class StudioMixin: """ Studio editing view for OpenAssessment XBlock. """ DEFAULT_CRITERIA = [ { 'label': '', 'options': [ { 'label': '' }, ] } ] NECESSITY_OPTIONS = { "required": ugettext_lazy("Required"), "optional": ugettext_lazy("Optional"), "": ugettext_lazy("None") } # Build editor options from AVAILABLE_EDITORS AVAILABLE_EDITOR_OPTIONS = { key: val.get('display_name', key) for key, val in AVAILABLE_EDITORS.items() } STUDIO_EDITING_TEMPLATE = 'openassessmentblock/edit/oa_edit.html' BASE_EDITOR_ASSESSMENTS_ORDER = copy.deepcopy(DEFAULT_EDITOR_ASSESSMENTS_ORDER) # Since the XBlock problem definition contains only assessment # modules that are enabled, we need to keep track of the order # that the user left assessments in the editor, including # the ones that were disabled. This allows us to keep the order # that the user specified. editor_assessments_order = List( default=DEFAULT_EDITOR_ASSESSMENTS_ORDER, scope=Scope.content, help="The order to display assessments in the editor." ) def studio_view(self, context=None): # pylint: disable=unused-argument """ Render the OpenAssessment XBlock for editing in Studio. Args: context: Not actively used for this view. Returns: (Fragment): An HTML fragment for editing the configuration of this XBlock. """ rendered_template = get_template( self.STUDIO_EDITING_TEMPLATE ).render(self.editor_context()) fragment = Fragment(rendered_template) fragment.add_javascript_url(LoadStatic.get_url('openassessment-studio.js')) js_context_dict = { "ALLOWED_IMAGE_EXTENSIONS": self.ALLOWED_IMAGE_EXTENSIONS, "ALLOWED_FILE_EXTENSIONS": self.ALLOWED_FILE_EXTENSIONS, "FILE_EXT_BLACK_LIST": self.FILE_EXT_BLACK_LIST, } fragment.initialize_js('OpenAssessmentEditor', js_context_dict) return fragment def editor_context(self): """ Update the XBlock's XML. Returns: dict with keys 'rubric' (unicode), 'prompt' (unicode), 'title' (unicode), 'submission_start' (unicode), 'submission_due' (unicode), 'assessments (dict) """ # In the authoring GUI, date and time fields should never be null. # Therefore, we need to resolve all "default" dates to datetime objects # before displaying them in the editor. try: __, __, date_ranges = resolve_dates( # pylint: disable=redeclared-assigned-name self.start, self.due, [ (self.submission_start, self.submission_due) ] + [ (asmnt.get('start'), asmnt.get('due')) for asmnt in self.valid_assessments ], self._ ) except (DateValidationError, InvalidDateFormat): # If the dates are somehow invalid, we still want users to be able to edit the ORA, # so just present the dates as they are. def _parse_date_safe(date): try: return parse_date_value(date, self._) except InvalidDateFormat: return '' date_ranges = [ (_parse_date_safe(self.submission_start), _parse_date_safe(self.submission_due)) ] + [ (_parse_date_safe(asmnt.get('start')), _parse_date_safe(asmnt.get('due'))) for asmnt in self.valid_assessments ] submission_start, submission_due = date_ranges[0] assessments = self._assessments_editor_context(date_ranges[1:]) self.editor_assessments_order = self._editor_assessments_order_context() # Every rubric requires one criterion. If there is no criteria # configured for the XBlock, return one empty default criterion, with # an empty default option. criteria = copy.deepcopy(self.rubric_criteria_with_labels) if not criteria: criteria = self.DEFAULT_CRITERIA # To maintain backwards compatibility, if there is no # feedback_default_text configured for the xblock, use the default text feedback_default_text = copy.deepcopy(self.rubric_feedback_default_text) if not feedback_default_text: feedback_default_text = DEFAULT_RUBRIC_FEEDBACK_TEXT course_id = self.location.course_key if hasattr(self, 'location') else None # If allowed file types haven't been explicitly set, load from a preset white_listed_file_types = self.get_allowed_file_types_or_preset() white_listed_file_types_string = ','.join(white_listed_file_types) if white_listed_file_types else '' # If rubric reuse is enabled, include information about the other ORAs in this course rubric_reuse_data = {} if self.is_rubric_reuse_enabled: rubric_reuse_data = self.get_other_ora_blocks_for_rubric_editor_context() return { 'prompts': self.prompts, 'prompts_type': self.prompts_type, 'title': self.title, 'submission_due': submission_due, 'submission_start': submission_start, 'assessments': assessments, 'criteria': criteria, 'feedbackprompt': self.rubric_feedback_prompt, 'feedback_default_text': feedback_default_text, 'text_response': self.text_response if self.text_response else '', 'text_response_editor': self.text_response_editor if self.text_response_editor else 'text', 'file_upload_response': self.file_upload_response if self.file_upload_response else '', 'necessity_options': self.NECESSITY_OPTIONS, 'available_editor_options': self.AVAILABLE_EDITOR_OPTIONS, 'file_upload_type': self.file_upload_type, 'allow_multiple_files': self.allow_multiple_files, 'white_listed_file_types': white_listed_file_types_string, 'allow_latex': self.allow_latex, 'leaderboard_show': self.leaderboard_show, 'editor_assessments_order': [ make_django_template_key(asmnt) for asmnt in self.editor_assessments_order ], 'teams_feature_enabled': self.team_submissions_enabled, 'teams_enabled': self.teams_enabled, 'base_asset_url': self._get_base_url_path_for_course_assets(course_id), 'is_released': self.is_released(), 'teamsets': self.get_teamsets(course_id), 'selected_teamset_id': self.selected_teamset_id, 'show_rubric_during_response': self.show_rubric_during_response, 'rubric_reuse_enabled': self.is_rubric_reuse_enabled, 'rubric_reuse_data': rubric_reuse_data, 'block_location': str(self.location), } @XBlock.json_handler def update_editor_context(self, data, suffix=''): # pylint: disable=unused-argument """ Update the XBlock's configuration. Args: data (dict): Data from the request; should have the format described in the editor schema. Keyword Arguments: suffix (str): Not used Returns: dict with keys 'success' (bool) and 'msg' (str) """ # Validate and sanitize the data using a schema # If the data is invalid, this means something is wrong with # our JavaScript, so we log an exception. try: data = EDITOR_UPDATE_SCHEMA(data) except MultipleInvalid: logger.exception('Editor context is invalid') return {'success': False, 'msg': self._('Error updating XBlock configuration')} # Check that the editor assessment order contains all the assessments. current_order = set(data['editor_assessments_order']) if set(DEFAULT_EDITOR_ASSESSMENTS_ORDER) != current_order: # Backwards compatibility: "staff-assessment" may not be present. # If that is the only problem with this data, just add it manually and continue. if set(DEFAULT_EDITOR_ASSESSMENTS_ORDER) == current_order | {'staff-assessment'}: data['editor_assessments_order'].append('staff-assessment') logger.info('Backwards compatibility: editor_assessments_order now contains staff-assessment') else: logger.exception('editor_assessments_order does not contain all expected assessment types') return {'success': False, 'msg': self._('Error updating XBlock configuration')} if not data['text_response'] and not data['file_upload_response']: return { 'success': False, 'msg': self._("Error: Text Response and File Upload Response cannot both be disabled") } if not data['text_response'] and data['file_upload_response'] == 'optional': return {'success': False, 'msg': self._("Error: When Text Response is disabled, File Upload Response must be Required")} if not data['file_upload_response'] and data['text_response'] == 'optional': return {'success': False, 'msg': self._("Error: When File Upload Response is disabled, Text Response must be Required")} # Backwards compatibility: We used to treat "name" as both a user-facing label # and a unique identifier for criteria and options. # Now we treat "name" as a unique identifier, and we've added an additional "label" # field that we display to the user. # If the JavaScript editor sends us a criterion or option without a "name" # field, we should assign it a unique identifier. for criterion in data['criteria']: if 'name' not in criterion: criterion['name'] = uuid4().hex for option in criterion['options']: if 'name' not in option: option['name'] = uuid4().hex xblock_validator = validator(self, self._) success, msg = xblock_validator( create_rubric_dict(data['prompts'], data['criteria']), data['assessments'], submission_start=data['submission_start'], submission_due=data['submission_due'], leaderboard_show=data['leaderboard_show'] ) if not success: return {'success': False, 'msg': self._('Validation error: {error}').format(error=msg)} # At this point, all the input data has been validated, # so we can safely modify the XBlock fields. self.title = data['title'] self.display_name = data['title'] self.prompts = data['prompts'] self.prompts_type = data['prompts_type'] self.rubric_criteria = data['criteria'] self.rubric_assessments = data['assessments'] self.editor_assessments_order = data['editor_assessments_order'] self.rubric_feedback_prompt = data['feedback_prompt'] self.rubric_feedback_default_text = data['feedback_default_text'] self.submission_start = data['submission_start'] self.submission_due = data['submission_due'] self.text_response = data['text_response'] self.text_response_editor = data['text_response_editor'] self.file_upload_response = data['file_upload_response'] if data['file_upload_response']: self.file_upload_type = data['file_upload_type'] self.white_listed_file_types_string = data['white_listed_file_types'] else: self.file_upload_type = None self.white_listed_file_types_string = None self.allow_multiple_files = bool(data['allow_multiple_files']) self.allow_latex = bool(data['allow_latex']) self.leaderboard_show = data['leaderboard_show'] self.teams_enabled = bool(data.get('teams_enabled', False)) self.selected_teamset_id = data.get('selected_teamset_id', '') self.show_rubric_during_response = data.get('show_rubric_during_response', False) return {'success': True, 'msg': self._('Successfully updated OpenAssessment XBlock')} @XBlock.json_handler def check_released(self, data, suffix=''): # pylint: disable=unused-argument """ Check whether the problem has been released. Args: data (dict): Not used Keyword Arguments: suffix (str): Not used Returns: dict with keys 'success' (bool), 'message' (unicode), and 'is_released' (bool) """ # There aren't currently any server-side error conditions we report to the client, # but we send success/msg values anyway for consistency with other handlers. return { 'success': True, 'msg': '', 'is_released': self.is_released() } def _assessments_editor_context(self, assessment_dates): """ Transform the rubric assessments list into the context we will pass to the Django template. Args: assessment_dates: List of assessment date ranges (tuples of start/end datetimes). Returns: dict """ assessments = {} for asmnt, date_range in zip(self.rubric_assessments, assessment_dates): # Django Templates cannot handle dict keys with dashes, so we'll convert # the dashes to underscores. template_name = make_django_template_key(asmnt['name']) assessments[template_name] = copy.deepcopy(asmnt) assessments[template_name]['start'] = date_range[0] assessments[template_name]['due'] = date_range[1] # In addition to the data in the student training assessment, we need to include two additional # pieces of information: a blank context to render the empty template with, and the criteria # for each example (so we don't have any complicated logic within the template). Though this # could be accomplished within the template, we are opting to remove logic from the template. student_training_module = self.get_assessment_module('student-training') student_training_template = { 'answer': { 'parts': [ {'text': ''} for _ in self.prompts ] } } criteria_list = copy.deepcopy(self.rubric_criteria_with_labels) for criterion in criteria_list: criterion['option_selected'] = "" student_training_template['criteria'] = criteria_list if student_training_module: student_training_module = update_assessments_format([student_training_module])[0] example_list = [] # Adds each example to a modified version of the student training module dictionary. for example in student_training_module['examples']: criteria_list = copy.deepcopy(self.rubric_criteria_with_labels) # Equivalent to a Join Query, this adds the selected option to the Criterion's dictionary, so that # it can be easily referenced in the template without searching through the selected options. for criterion in criteria_list: for option_selected in example['options_selected']: if option_selected['criterion'] == criterion['name']: criterion['option_selected'] = option_selected['option'] example_list.append({ 'answer': example['answer'], 'criteria': criteria_list, }) assessments['training'] = {'examples': example_list, 'template': student_training_template} # If we don't have student training enabled, we still need to render a single (empty, or default) example else: assessments['training'] = {'examples': [student_training_template], 'template': student_training_template} return assessments def _editor_assessments_order_context(self): """ Create a list of assessment names in the order the user last set in the editor, including assessments that are not currently enabled. Returns: list of assessment names """ # Start with the default order, to pick up any assessment types that have been added # since the user last saved their ordering. effective_order = copy.deepcopy(self.BASE_EDITOR_ASSESSMENTS_ORDER) # Account for changes the user has made to the default order user_order = copy.deepcopy(self.editor_assessments_order) effective_order = self._subset_in_relative_order(effective_order, user_order) # Account for inconsistencies between the user's order and the problems # that are currently enabled in the problem (These cannot be changed) enabled_assessments = [asmnt['name'] for asmnt in self.valid_assessments] enabled_ordered_assessments = [ assessment for assessment in enabled_assessments if assessment in user_order ] effective_order = self._subset_in_relative_order(effective_order, enabled_ordered_assessments) return effective_order def _subset_in_relative_order(self, superset, subset): """ Returns a copy of superset, with entries that appear in subset being reordered to match their relative ordering in subset. """ superset_indices = [superset.index(item) for item in subset] sorted_superset_indices = sorted(superset_indices) if superset_indices != sorted_superset_indices: for index, superset_index in enumerate(sorted_superset_indices): superset[superset_index] = subset[index] return superset def _get_base_url_path_for_course_assets(self, course_key): """ Returns base url path for course assets """ if course_key is None: return None placeholder_id = uuid4().hex # create a dummy asset location with a fake but unique name. strip off the name, and return it url_path = str(course_key.make_asset_key('asset', placeholder_id).for_branch(None)) if not url_path.startswith('/'): url_path = '/' + url_path return url_path.replace(placeholder_id, '') def get_team_configuration(self, course_id): """ Returns a dict with team configuration settings. """ configuration_service = self.runtime.service(self, 'teams_configuration') team_configuration = configuration_service.get_teams_configuration(course_id) if not team_configuration: return None return team_configuration def get_teamsets(self, course_id): """ Wrapper around get_team_configuration that returns team names only for display """ team_configuration = self.get_team_configuration(course_id) if not team_configuration: return None return team_configuration.teamsets
edx/edx-ora2
openassessment/xblock/studio_mixin.py
Python
agpl-3.0
20,504
0.003414
#!/usr/bin/env python3 # # Locate casts in the code # import cppcheckdata import sys for arg in sys.argv[1:]: if arg.startswith('-'): continue print('Checking %s...' % arg) data = cppcheckdata.CppcheckData(arg) for cfg in data.iterconfigurations(): print('Checking %s, config %s...' % (arg, cfg.name)) for token in cfg.tokenlist: if token.str != '(' or not token.astOperand1 or token.astOperand2: continue # Is it a lambda? if token.astOperand1.str == '{': continue # we probably have a cast.. if there is something inside the parentheses # there is a cast. Otherwise this is a function call. typetok = token.next if not typetok.isName: continue # cast number => skip output if token.astOperand1.isNumber: continue # void cast => often used to suppress compiler warnings if typetok.str == 'void': continue cppcheckdata.reportError(token, 'information', 'found a cast', 'findcasts', 'cast') sys.exit(cppcheckdata.EXIT_CODE)
boos/cppcheck
addons/findcasts.py
Python
gpl-3.0
1,197
0.001671
import sys import os from pkg_resources import resource_filename pythonversion = sys.version_info.major from six import StringIO import mock import nose.tools as nt import numpy as np import numpy.testing as nptest import matplotlib.pyplot as plt import pandas import pandas.util.testing as pdtest import pybmpdb from wqio import utils from wqio import testing mock_figure = mock.Mock(spec=plt.Figure) @nt.nottest def get_data_file(filename): return resource_filename("wqio.data", filename) @nt.nottest def get_tex_file(filename): return resource_filename("pybmpdb.tex", filename) @nt.nottest class mock_parameter(object): def __init__(self): self.name = 'Carbon Dioxide' self.tex = r'$[\mathrm{CO}_2]$' self.units = 'mg/L' def paramunit(self, *args, **kwargs): return 'Carbon Dioxide (mg/L)' @nt.nottest class mock_location(object): def __init__(self, include): self.N = 25 self.ND = 5 self.min = 0.123456 self.max = 123.456 self.mean = 12.3456 self.mean_conf_interval = np.array([-1, 1]) + self.mean self.logmean = 12.3456 self.logmean_conf_interval = np.array([-1, 1]) + self.logmean self.geomean = 12.3456 self.geomean_conf_interval = np.array([-1, 1]) + self.geomean self.std = 4.56123 self.logstd = 4.56123 self.cov = 5.61234 self.skew = 6.12345 self.pctl25 = 0.612345 self.median = 1.23456 self.median_conf_interval = np.array([-1, 1]) + self.median self.pctl75 = 2.34561 self.include = include self.exclude = not self.include pass @nt.nottest class mock_dataset(object): def __init__(self, infl_include, effl_include): self.influent = mock_location(infl_include) self.effluent = mock_location(effl_include) self.n_pairs = 22 self.wilcoxon_p = 0.0005 self.mannwhitney_p = 0.456123 self.definition = { 'parameter': mock_parameter(), 'category': 'testbmp' } def scatterplot(self, *args, **kwargs): return mock_figure() def statplot(self, *args, **kwargs): return mock_figure() class _base_DatasetSummary_Mixin(object): def main_setup(self): self.known_paramgroup = 'Metals' self.known_bmp = 'testbmp' self.known_latex_file_name = 'metalstestbmpcarbondioxide' self.ds_sum = pybmpdb.DatasetSummary(self.ds, self.known_paramgroup, 'testfigpath') self.known_latex_input_tt = r"""\subsection{testbmp} \begin{table}[h!] \caption{test table title} \centering \begin{tabular}{l l l l l} \toprule \textbf{Statistic} & \textbf{Inlet} & \textbf{Outlet} \\ \toprule Count & 25 & 25 \\ \midrule Number of NDs & 5 & 5 \\ \midrule Min; Max & 0.123; 123 & 0.123; 123 \\ \midrule Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Standard Deviation & 4.56 & 4.56 \\ \midrule Log. Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Log. Standard Deviation & 4.56 & 4.56 \\ \midrule Geo. Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Coeff. of Variation & 5.61 & 5.61 \\ \midrule Skewness & 6.12 & 6.12 \\ \midrule Median & 1.23 & 1.23 \\ %% (95\% confidence interval) & (0.235; 2.23) & (0.235; 2.23) \\ \midrule Quartiles & 0.612; 2.35 & 0.612; 2.35 \\ \toprule Number of Pairs & \multicolumn{2}{c} {22} \\ \midrule Wilcoxon p-value & \multicolumn{2}{c} {$<0.001$} \\ \midrule Mann-Whitney p-value & \multicolumn{2}{c} {0.456} \\ \bottomrule \end{tabular} \end{table} \begin{figure}[hb] % FIGURE \centering \includegraphics[scale=1.00]{testfigpath/statplot/metalstestbmpcarbondioxidestats.pdf} \caption{Box and Probability Plots of Carbon Dioxide at testbmp BMPs} \end{figure} \begin{figure}[hb] % FIGURE \centering \includegraphics[scale=1.00]{testfigpath/scatterplot/metalstestbmpcarbondioxidescatter.pdf} \caption{Influent vs. Effluent Plots of Carbon Dioxide at testbmp BMPs} \end{figure} \clearpage""" + '\n' self.known_latex_input_ff = '' self.known_latex_input_ft = r"""\subsection{testbmp} \begin{table}[h!] \caption{test table title} \centering \begin{tabular}{l l l l l} \toprule \textbf{Statistic} & \textbf{Inlet} & \textbf{Outlet} \\ \toprule Count & NA & 25 \\ \midrule Number of NDs & NA & 5 \\ \midrule Min; Max & NA & 0.123; 123 \\ \midrule Mean & NA & 12.3 \\ %% (95\% confidence interval) & NA & (11.3; 13.3) \\ \midrule Standard Deviation & NA & 4.56 \\ \midrule Log. Mean & NA & 12.3 \\ %% (95\% confidence interval) & NA & (11.3; 13.3) \\ \midrule Log. Standard Deviation & NA & 4.56 \\ \midrule Geo. Mean & NA & 12.3 \\ %% (95\% confidence interval) & NA & (11.3; 13.3) \\ \midrule Coeff. of Variation & NA & 5.61 \\ \midrule Skewness & NA & 6.12 \\ \midrule Median & NA & 1.23 \\ %% (95\% confidence interval) & NA & (0.235; 2.23) \\ \midrule Quartiles & NA & 0.612; 2.35 \\ \toprule Number of Pairs & \multicolumn{2}{c} {NA} \\ \midrule Wilcoxon p-value & \multicolumn{2}{c} {NA} \\ \midrule Mann-Whitney p-value & \multicolumn{2}{c} {NA} \\ \bottomrule \end{tabular} \end{table} \begin{figure}[hb] % FIGURE \centering \includegraphics[scale=1.00]{testfigpath/statplot/metalstestbmpcarbondioxidestats.pdf} \caption{Box and Probability Plots of Carbon Dioxide at testbmp BMPs} \end{figure} \begin{figure}[hb] % FIGURE \centering \includegraphics[scale=1.00]{testfigpath/scatterplot/metalstestbmpcarbondioxidescatter.pdf} \caption{Influent vs. Effluent Plots of Carbon Dioxide at testbmp BMPs} \end{figure} \clearpage""" + '\n' def test_paramgroup(self): nt.assert_true(hasattr(self.ds_sum, 'paramgroup')) nt.assert_true(isinstance(self.ds_sum.paramgroup, str)) nt.assert_equal(self.ds_sum.paramgroup, self.known_paramgroup) def test_ds(self): nt.assert_true(hasattr(self.ds_sum, 'ds')) nt.assert_true(isinstance(self.ds_sum.ds, mock_dataset)) def test_parameter(self): nt.assert_true(hasattr(self.ds_sum, 'parameter')) nt.assert_true(isinstance(self.ds_sum.parameter, mock_parameter)) def test_bmp(self): nt.assert_true(hasattr(self.ds_sum, 'bmp')) nt.assert_true(isinstance(self.ds_sum.bmp, str)) nt.assert_equal(self.ds_sum.bmp, self.known_bmp) def test_latex_file_name(self): nt.assert_true(hasattr(self.ds_sum, 'latex_file_name')) nt.assert_true(isinstance(self.ds_sum.latex_file_name, str)) nt.assert_equal(self.ds_sum.latex_file_name, self.known_latex_file_name) def test__tex_table_row_basic(self): r = self.ds_sum._tex_table_row('The Medians', 'median') nt.assert_equal(r, self.known_r_basic) def test__tex_table_row_forceint(self): r = self.ds_sum._tex_table_row('Counts', 'N', forceint=True, sigfigs=1) nt.assert_equal(r, self.known_r_forceint) def test__tex_table_row_advanced(self): r = self.ds_sum._tex_table_row('Mean CI', 'mean_conf_interval', rule='top', twoval=True, ci=True, sigfigs=2) nt.assert_equal(r, self.known_r_advanced) def test__text_table_row_twoattrs(self): r = self.ds_sum._tex_table_row('Quartiles', ['pctl25', 'pctl75'], twoval=True) nt.assert_equal(r, self.known_r_twoattrs) def test__make_tex_figure(self): fig = self.ds_sum._make_tex_figure('testfig.png', 'test caption') known_fig = r""" \begin{figure}[hb] % FIGURE \centering \includegraphics[scale=1.00]{testfig.png} \caption{test caption} \end{figure} \clearpage""" + '\n' nt.assert_equal(fig, known_fig) def test_makeTexInput(self): if self.scenario == 'TT': known_tstring = self.known_latex_input_tt elif self.scenario == 'FT': known_tstring = self.known_latex_input_ft else: known_tstring = self.known_latex_input_ff tstring = self.ds_sum.makeTexInput('test table title') try: nt.assert_equal(tstring, known_tstring) except: with open('{}_out_test.test'.format(self.scenario), 'w') as test: test.write(tstring) with open('{}_out_known.test'.format(self.scenario), 'w') as known: known.write(known_tstring) raise class test_DatasetSummary_TT(_base_DatasetSummary_Mixin): def setup(self): self.scenario = 'TT' self.ds = mock_dataset(True, True) self.known_r_basic = r''' \midrule The Medians & 1.23 & 1.23 \\''' self.known_r_advanced = r''' \toprule Mean CI & (11; 13) & (11; 13) \\''' self.known_r_twoattrs = r''' \midrule Quartiles & 0.612; 2.35 & 0.612; 2.35 \\''' self.known_r_forceint = r''' \midrule Counts & 25 & 25 \\''' self.main_setup() def test__make_tex_table(self): table = self.ds_sum._make_tex_table('test title') known_table = r""" \begin{table}[h!] \caption{test title} \centering \begin{tabular}{l l l l l} \toprule \textbf{Statistic} & \textbf{Inlet} & \textbf{Outlet} \\ \toprule Count & 25 & 25 \\ \midrule Number of NDs & 5 & 5 \\ \midrule Min; Max & 0.123; 123 & 0.123; 123 \\ \midrule Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Standard Deviation & 4.56 & 4.56 \\ \midrule Log. Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Log. Standard Deviation & 4.56 & 4.56 \\ \midrule Geo. Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Coeff. of Variation & 5.61 & 5.61 \\ \midrule Skewness & 6.12 & 6.12 \\ \midrule Median & 1.23 & 1.23 \\ %% (95\% confidence interval) & (0.235; 2.23) & (0.235; 2.23) \\ \midrule Quartiles & 0.612; 2.35 & 0.612; 2.35 \\ \toprule Number of Pairs & \multicolumn{2}{c} {22} \\ \midrule Wilcoxon p-value & \multicolumn{2}{c} {$<0.001$} \\ \midrule Mann-Whitney p-value & \multicolumn{2}{c} {0.456} \\ \bottomrule \end{tabular} \end{table}""" + '\n' try: nt.assert_equal(table, known_table) except: with open('make_tex_table_res.test', 'w') as f: f.write(table) with open('make_tex_table_exp.test', 'w') as f: f.write(known_table) raise class test_DatasetSummary_TF(_base_DatasetSummary_Mixin): def setup(self): self.scenario = 'TF' self.ds = mock_dataset(True, False) self.main_setup() self.known_r_basic = r''' \midrule The Medians & 1.23 & NA \\''' self.known_r_advanced = r''' \toprule Mean CI & (11; 13) & NA \\''' self.known_r_twoattrs = r''' \midrule Quartiles & 0.612; 2.35 & NA \\''' self.known_r_forceint = r''' \midrule Counts & 25 & NA \\''' class test_DatasetSummary_FT(_base_DatasetSummary_Mixin): def setup(self): self.scenario = 'FT' self.ds = mock_dataset(False, True) self.main_setup() self.known_r_basic = r''' \midrule The Medians & NA & 1.23 \\''' self.known_r_advanced = r''' \toprule Mean CI & NA & (11; 13) \\''' self.known_r_twoattrs = r''' \midrule Quartiles & NA & 0.612; 2.35 \\''' self.known_r_forceint = r''' \midrule Counts & NA & 25 \\''' class test_DatasetSummary_FF(_base_DatasetSummary_Mixin): def setup(self): self.scenario = 'FF' self.ds = mock_dataset(False, False) self.main_setup() self.known_r_basic = r''' \midrule The Medians & NA & NA \\''' self.known_r_advanced = r''' \toprule Mean CI & NA & NA \\''' self.known_r_twoattrs = r''' \midrule Quartiles & NA & NA \\''' self.known_r_forceint = r''' \midrule Counts & NA & NA \\''' class test_CategoricalSummary(object): def setup(self): includes = [ (True, True), (True, False), (True, True), (False, False), (False, True) ] self.datasets = [mock_dataset(*inc) for inc in includes] self.known_paramgroup = 'Metals' self.known_dataset_count = 3 self.csum = pybmpdb.CategoricalSummary( self.datasets, self.known_paramgroup, 'basepath', 'testfigpath' ) self.known_latex_input_content = input_file_string self.known_latex_report_content = ( '\\begin{document}test report title\n' '\\input{testpath.tex}\n' '\\end{document}\n' ) self.test_templatefile = 'testtemplate.tex' with open(self.test_templatefile, 'w') as f: f.write('\\begin{document}__VARTITLE') def teardown(self): os.remove(self.test_templatefile) #if os.path.exists(self.scatter_fig_path) # os.remove(self.csum()) def test_datasets(self): nt.assert_true(hasattr(self.csum, 'datasets')) for ds in self.csum.datasets: nt.assert_true(isinstance(ds, mock_dataset)) nt.assert_equal(self.known_dataset_count, len(self.csum.datasets)) def test_paramgroup(self): nt.assert_true(hasattr(self.csum, 'paramgroup')) nt.assert_true(isinstance(self.csum.paramgroup, str)) nt.assert_equal(self.csum.paramgroup, self.known_paramgroup) @nptest.dec.skipif(pythonversion == 2) def test__make_input_file_IO(self): with StringIO() as inputIO: self.csum._make_input_file_IO(inputIO) input_string = inputIO.getvalue() testing.assert_bigstring_equal( input_string, self.known_latex_input_content, 'test__make_input_file_IO_res.tex', 'test__make_input_file_IO_exp.test' ) @nptest.dec.skipif(pythonversion == 2) def test__make_report_IO(self): with StringIO() as reportIO: with open(self.test_templatefile, 'r') as templateIO: self.csum._make_report_IO( templateIO, 'testpath.tex', reportIO, 'test report title' ) testing.assert_bigstring_equal( reportIO.getvalue(), self.known_latex_report_content, 'test_reportIO.tex', 'test_reportIO_expected.tex' ) @nptest.dec.skipif(pythonversion == 2) def test_makeReport(self): templatepath = get_tex_file('draft_template.tex') inputpath = get_tex_file('inputs_{}.tex'.format(self.csum.paramgroup.lower())) reportpath = get_tex_file('report_{}.tex'.format(self.csum.paramgroup.lower())) self.csum.makeReport( self.test_templatefile, 'testpath.tex', reportpath, 'test report title', regenfigs=False ) with open(reportpath, 'r') as rp: testing.assert_bigstring_equal( rp.read(), self.known_latex_report_content, 'test_report.tex', 'test_report_expected.tex' ) input_file_string = r'''\section{Carbon Dioxide} \subsection{testbmp} \begin{table}[h!] \caption{Statistics for Carbon Dioxide (mg/L) at testbmp BMPs} \centering \begin{tabular}{l l l l l} \toprule \textbf{Statistic} & \textbf{Inlet} & \textbf{Outlet} \\ \toprule Count & 25 & 25 \\ \midrule Number of NDs & 5 & 5 \\ \midrule Min; Max & 0.123; 123 & 0.123; 123 \\ \midrule Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Standard Deviation & 4.56 & 4.56 \\ \midrule Log. Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Log. Standard Deviation & 4.56 & 4.56 \\ \midrule Geo. Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Coeff. of Variation & 5.61 & 5.61 \\ \midrule Skewness & 6.12 & 6.12 \\ \midrule Median & 1.23 & 1.23 \\ %% (95\% confidence interval) & (0.235; 2.23) & (0.235; 2.23) \\ \midrule Quartiles & 0.612; 2.35 & 0.612; 2.35 \\ \toprule Number of Pairs & \multicolumn{2}{c} {22} \\ \midrule Wilcoxon p-value & \multicolumn{2}{c} {$<0.001$} \\ \midrule Mann-Whitney p-value & \multicolumn{2}{c} {0.456} \\ \bottomrule \end{tabular} \end{table} \begin{figure}[hb] % FIGURE \centering \includegraphics[scale=1.00]{testfigpath/statplot/metalstestbmpcarbondioxidestats.pdf} \caption{Box and Probability Plots of Carbon Dioxide at testbmp BMPs} \end{figure} \begin{figure}[hb] % FIGURE \centering \includegraphics[scale=1.00]{testfigpath/scatterplot/metalstestbmpcarbondioxidescatter.pdf} \caption{Influent vs. Effluent Plots of Carbon Dioxide at testbmp BMPs} \end{figure} \clearpage \clearpage \subsection{testbmp} \begin{table}[h!] \caption{Statistics for Carbon Dioxide (mg/L) at testbmp BMPs} \centering \begin{tabular}{l l l l l} \toprule \textbf{Statistic} & \textbf{Inlet} & \textbf{Outlet} \\ \toprule Count & 25 & 25 \\ \midrule Number of NDs & 5 & 5 \\ \midrule Min; Max & 0.123; 123 & 0.123; 123 \\ \midrule Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Standard Deviation & 4.56 & 4.56 \\ \midrule Log. Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Log. Standard Deviation & 4.56 & 4.56 \\ \midrule Geo. Mean & 12.3 & 12.3 \\ %% (95\% confidence interval) & (11.3; 13.3) & (11.3; 13.3) \\ \midrule Coeff. of Variation & 5.61 & 5.61 \\ \midrule Skewness & 6.12 & 6.12 \\ \midrule Median & 1.23 & 1.23 \\ %% (95\% confidence interval) & (0.235; 2.23) & (0.235; 2.23) \\ \midrule Quartiles & 0.612; 2.35 & 0.612; 2.35 \\ \toprule Number of Pairs & \multicolumn{2}{c} {22} \\ \midrule Wilcoxon p-value & \multicolumn{2}{c} {$<0.001$} \\ \midrule Mann-Whitney p-value & \multicolumn{2}{c} {0.456} \\ \bottomrule \end{tabular} \end{table} \begin{figure}[hb] % FIGURE \centering \includegraphics[scale=1.00]{testfigpath/statplot/metalstestbmpcarbondioxidestats.pdf} \caption{Box and Probability Plots of Carbon Dioxide at testbmp BMPs} \end{figure} \begin{figure}[hb] % FIGURE \centering \includegraphics[scale=1.00]{testfigpath/scatterplot/metalstestbmpcarbondioxidescatter.pdf} \caption{Influent vs. Effluent Plots of Carbon Dioxide at testbmp BMPs} \end{figure} \clearpage \clearpage \subsection{testbmp} \begin{table}[h!] \caption{Statistics for Carbon Dioxide (mg/L) at testbmp BMPs} \centering \begin{tabular}{l l l l l} \toprule \textbf{Statistic} & \textbf{Inlet} & \textbf{Outlet} \\ \toprule Count & NA & 25 \\ \midrule Number of NDs & NA & 5 \\ \midrule Min; Max & NA & 0.123; 123 \\ \midrule Mean & NA & 12.3 \\ %% (95\% confidence interval) & NA & (11.3; 13.3) \\ \midrule Standard Deviation & NA & 4.56 \\ \midrule Log. Mean & NA & 12.3 \\ %% (95\% confidence interval) & NA & (11.3; 13.3) \\ \midrule Log. Standard Deviation & NA & 4.56 \\ \midrule Geo. Mean & NA & 12.3 \\ %% (95\% confidence interval) & NA & (11.3; 13.3) \\ \midrule Coeff. of Variation & NA & 5.61 \\ \midrule Skewness & NA & 6.12 \\ \midrule Median & NA & 1.23 \\ %% (95\% confidence interval) & NA & (0.235; 2.23) \\ \midrule Quartiles & NA & 0.612; 2.35 \\ \toprule Number of Pairs & \multicolumn{2}{c} {NA} \\ \midrule Wilcoxon p-value & \multicolumn{2}{c} {NA} \\ \midrule Mann-Whitney p-value & \multicolumn{2}{c} {NA} \\ \bottomrule \end{tabular} \end{table} \begin{figure}[hb] % FIGURE \centering \includegraphics[scale=1.00]{testfigpath/statplot/metalstestbmpcarbondioxidestats.pdf} \caption{Box and Probability Plots of Carbon Dioxide at testbmp BMPs} \end{figure} \begin{figure}[hb] % FIGURE \centering \includegraphics[scale=1.00]{testfigpath/scatterplot/metalstestbmpcarbondioxidescatter.pdf} \caption{Influent vs. Effluent Plots of Carbon Dioxide at testbmp BMPs} \end{figure} \clearpage \clearpage ''' class test_helpers(object): def setup(self): if os.name == 'posix': dbfile = 'testdata.csv' else: dbfile = 'testdata.accdb' self.dbfile = get_data_file(dbfile) self.db = pybmpdb.dataAccess.Database(self.dbfile) self.known_pfcs = [ 'NCDOT_PFC_A', 'NCDOT_PFC_B', 'NCDOT_PFC_D', 'AustinTX3PFC', 'AustinTX1PFC', 'AustinTX2PFC' ] self.known_shape = (2250, 2) self.known_shape_excl = (2168, 2) def test_getSummaryData_smoke(self): df, db = pybmpdb.summary.getSummaryData(dbpath=self.dbfile) nt.assert_tuple_equal(df.shape, self.known_shape) def test_getSummaryDataExclusive_smoke(self): exbmps = ['15.2Apex', '7.6Apex'] df, db = pybmpdb.summary.getSummaryData(dbpath=self.dbfile, excludedbmps=exbmps) nt.assert_tuple_equal(df.shape, self.known_shape_excl) for x in exbmps: nt.assert_true(x not in df.index.get_level_values('bmp').unique()) def test_setMPLStyle_smoke(self): pybmpdb.summary.setMPLStyle() @nptest.dec.skipif(os.name == 'posix') def test_getPFCs(self): pfcs = pybmpdb.summary.getPFCs(self.db) nt.assert_list_equal(pfcs, self.known_pfcs) @nt.nottest def _do_filter_test(index_cols, infilename, outfilename, fxn, *args): infile = get_data_file(infilename) outfile = get_data_file(outfilename) input_df = pandas.read_csv(infile, index_col=index_cols) expected_df = pandas.read_csv(outfile, index_col=index_cols).sort() test_df = fxn(input_df, *args).sort() pdtest.assert_frame_equal(expected_df.reset_index(), test_df.reset_index()) def test__pick_best_station(): index_cols = ['site', 'bmp', 'storm', 'parameter', 'station'] _do_filter_test( index_cols, 'test_pick_station_input.csv', 'test_pick_station_output.csv', pybmpdb.summary._pick_best_station ) def test__pick_best_sampletype(): index_cols = ['site', 'bmp', 'storm', 'parameter', 'station', 'sampletype'] _do_filter_test( index_cols, 'test_pick_sampletype_input.csv', 'test_pick_sampletype_output.csv', pybmpdb.summary._pick_best_sampletype ) def test__filter_onesided_BMPs(): index_cols = ['category', 'site', 'bmp', 'storm', 'parameter', 'station'] _do_filter_test( index_cols, 'test_filter_onesidedbmps_input.csv', 'test_filter_onesidedbmps_output.csv', pybmpdb.summary._filter_onesided_BMPs ) def test__filter_by_storm_count(): index_cols = ['category', 'site', 'bmp', 'storm', 'parameter', 'station'] _do_filter_test( index_cols, 'test_filter_bmp-storm_counts_input.csv', 'test_filter_storm_counts_output.csv', pybmpdb.summary._filter_by_storm_count, 6 ) def test__filter_by_BMP_count(): index_cols = ['category', 'site', 'bmp', 'parameter', 'station'] _do_filter_test( index_cols, 'test_filter_bmp-storm_counts_input.csv', 'test_filter_bmp_counts_output.csv', pybmpdb.summary._filter_by_BMP_count, 4 ) def test_statDump(): pass def test__writeStatLine(): pass def test_writeDiffStatLine(): pass def test_diffStatsDump(): pass def test_sbpat_stats(): pass def test_paramTables(): pass def test_paramBoxplots(): pass def test_doBoxPlot(): pass def test_makeBMPLabel(): pass
lucashtnguyen/pybmpdb
pybmpdb/tests/summary_tests.py
Python
bsd-3-clause
29,742
0.001143
from mindfeed.mindfeed import main if __name__ == "__main__": main()
zeckalpha/mindfeed
mindfeed/__init__.py
Python
mit
75
0
from .ppo import PPOAgent
qsheeeeen/Self-Driving-Car
rl_toolbox/agent/__init__.py
Python
mit
26
0
from subprocess import call import os from flask.ext.script import Manager from commands.utils import perform def alt_exec(cmd, alt=None): """ Tries to execute command. If command not found, it tries to execute the alternative comand """ try: call(cmd) except OSError as e: if e.errno == os.errno.ENOENT and alt: try: call(alt) except OSError as ex: raise ex else: raise e StaticCommand = Manager(usage='Commands to build static') def npm(): """ Run npm install script """ with perform( name='static npm', before='run npm install', ): alt_exec( cmd=["npm", "install"], ) @StaticCommand.option( '--allow-root', dest='allow_root', default=False, help='Force scripts to allow execution by root user', action='store_true', ) @StaticCommand.option( '--silent', dest='silent', default=False, help='Do not ask user anything', action='store_true', ) def bower(allow_root, silent): """ Run bower install script """ with perform( name='static bower', before='run bower install', ): cmd_args = list() if allow_root: cmd_args.append("--allow-root") if silent: cmd_args.append("--silent") alt_exec( cmd=["bower", "install"] + cmd_args, alt=["./node_modules/bower/bin/bower", "install"] + cmd_args, ) @StaticCommand.option( '--deploy-type', dest='deploy_type', default="production", help='Set deploy type ' '(production with minifying, development without minifying etc.)' ) def gulp(deploy_type=None): """ Run gulp build script """ with perform( name='static gulp', before='run gulp', ): cmd_args = list() if deploy_type is not None: cmd_args.append("--type") cmd_args.append(deploy_type) alt_exec( cmd=["gulp"] + cmd_args, alt=["./node_modules/gulp/bin/gulp.js"] + cmd_args, ) @StaticCommand.option( '--allow-root', dest='allow_root', default=False, help='Force scripts to allow execution by root user', action='store_true', ) @StaticCommand.option( '--deploy-type', dest='deploy_type', default="production", help='Set deploy type ' '(production with minifying, development without minifying etc.)' ) @StaticCommand.option( '--silent', dest='silent', default=False, help='Do not ask user anything', action='store_true', ) def collect(allow_root, deploy_type, silent): npm() bower(allow_root, silent) gulp(deploy_type) @StaticCommand.command def clean(): """ Clean built static files """ with perform( name='static clean', before='run gulp clean', ): alt_exec( cmd=["gulp", "clean"], alt=["./node_modules/gulp/bin/gulp.js", "clean"], )
uaprom-summer-2015/Meowth
commands/static.py
Python
bsd-3-clause
3,080
0
import pytest from cfme import test_requirements from cfme.configure import about @test_requirements.appliance @pytest.mark.tier(3) @pytest.mark.sauce def test_appliance_version(appliance): """Check version presented in UI against version retrieved directly from the machine. Version retrieved from appliance is in this format: 1.2.3.4 Version in the UI is always: 1.2.3.4.20140505xyzblabla So we check whether the UI version starts with SSH version Polarion: assignee: jhenner casecomponent: Appliance caseimportance: high initialEstimate: 1/4h """ ssh_version = str(appliance.version) ui_version = about.get_detail(about.VERSION, server=appliance.server) assert ui_version.startswith(ssh_version), "UI: {}, SSH: {}".format(ui_version, ssh_version)
izapolsk/integration_tests
cfme/tests/configure/test_version.py
Python
gpl-2.0
824
0.002427
#------------------------------------------------------------------------------- # Name: run_jensen # Purpose: Automated execution of diatomic M-L computations in the form # of Jensen et al. J Chem Phys 126, 014103 (2007) # # Author: Brian # # Created: 8 May 2015 # Copyright: (c) Brian 2015 # License: The MIT License; see "license.txt" for full license terms # and contributor agreement. # # This file is a standalone module for execution of M-L diatomic # computations in ORCA, approximately per the approach given in # the above citation. # # http://www.github.com/bskinn/run_jensen # #------------------------------------------------------------------------------- # Module-level imports import os, logging, time, re, csv import h5py as h5, numpy as np from opan.const import DEF, E_Software as E_SW, E_FileType as E_FT # Module-level variables # Constant strings repofname = 'jensen.h5' csvfname = 'jensen.csv' csv_multfname = 'jensen_mult.csv' pausefname = 'pause' dir_fmt = 'jensen_%Y%m%d_%H%M%S' sep = "_" NA_str = "NA" fail_conv = "FAILED" # Adjustable parameters (not all actually are adjustable yet) exec_cmd = 'runorca_pal.bat' opt_str = '! TIGHTOPT' convergers = ["", "! KDIIS", "! SOSCF"] #, "! NRSCF"] req_tag_strs = ['<MOREAD>', '<MULT>', '<XYZ>', '<OPT>', '<CONV>', \ '<CHARGE>'] init_dia_sep = 2.1 # Angstroms fixed_dia_sep = True ditch_sep_thresh = 4.0 geom_scale = 0.75 pausetime = 2.0 skip_atoms = False # Class for logging information class log_names(object): filename = 'jensen_log.txt' fmt = "%(levelname)-8s [%(asctime)s] %(message)s" datefmt = "%H:%M:%S" loggername = 'rjLogger' handlername = 'rjHandler' formattername = 'rjFormatter' ## end class log_names # Class for names of subgroups class h5_names(object): max_mult = 'max_mult' mult_prfx = 'm' chg_prfx = 'q' ref_prfx = 'r' run_base = 'base' converger = 'conv' out_en = 'energy' out_zpe = 'zpe' out_enth = 'enthalpy' out_bondlen = 'bond_length' out_dipmom = 'dipole_moment' out_freq = 'freq' min_en = 'min_en' min_en_mult = 'min_en_mult' min_en_ref = 'min_en_ref' min_en_zpe = 'min_en_zpe' min_en_enth = 'min_en_enth' min_en_bondlen = 'min_en_bondlen' min_en_dipmom = 'min_en_dipmom' min_en_freq = 'min_en_freq' ## end class h5_names # Regex patterns for quick testing p_multgrp = re.compile("/" + h5_names.mult_prfx + "(?P<mult>[0-9]+)$") p_refgrp = re.compile("/" + h5_names.ref_prfx + "(?P<ref>[0-9]+)$") # Atomic numbers for elements, and the max associated unpaired electrons metals = set(range(21,31)) nonmetals = set([1, 6, 7, 8, 9, 16, 17, 35]) cation_nms = set([1,8]) max_unpaired = {1: 1, 6: 4, 7: 3, 8: 2, 9: 1, 16: 4, 17: 1, 35: 1, \ 21: 3, 22: 4, 23: 5, 24: 6, 25: 7, 26: 6, 27: 5, \ 28: 4, 29: 3, 30: 2} mult_range = range(1,13) def do_run(template_file, wkdir=None): """ Top-level function for doing a series of runs """ # Imports from opan.utils import make_timestamp from opan.const import atomSym # If wkdir specified, try changing there first if not wkdir == None: old_wkdir = os.getcwd() os.chdir(wkdir) ## end if # Pull in the template with open(template_file) as f: template_str = f.read() ## end with # Create working folder, enter dir_name = time.strftime(dir_fmt) os.mkdir(dir_name) os.chdir(dir_name) # Set up and create the log, and log wkdir setup_logger() logger = logging.getLogger(log_names.loggername) logger.info("Jensen calc series started: " + time.strftime("%c")) logger.info("Working in directory: " + os.getcwd()) # Proofread the template proof_template(template_str) # Log the template file contents logger.info("Template file '" + template_file + "' contents:\n\n" + \ template_str) # Log the metals and nonmetals to be processed, including those # nonmetals for which the monocations will be calculated. logger.info("Metals: " + ", ".join([atomSym[a].capitalize() \ for a in metals])) logger.info("Non-metals: " + ", ".join([atomSym[a].capitalize() \ for a in nonmetals])) logger.info("Cations calculated for non-metals: " + \ ", ".join([atomSym[a].capitalize() for a in cation_nms])) # Log the geometry scale-down factor, if used if fixed_dia_sep: logger.info("Using fixed initial diatomic separation of " + \ str(init_dia_sep) + " Angstroms.") else: logger.info("Using geometry scale-down factor: " + str(geom_scale)) ## end if # Store the starting time start_time = time.time() # Create the data repository repo = h5.File(repofname, 'a') # Log notice if skipping atoms if skip_atoms: logger.warning("SKIPPING ATOM COMPUTATIONS") else: # Loop atoms (atomic calculations) for at in metals.union(nonmetals): run_mono(at, template_str, repo) repo.flush() ## next at ## end if # Loop atom pairs (diatomics) for run execution for m in metals: for nm in nonmetals: # Run the diatomic optimizations run_dia(m, nm, 0, template_str, repo) # Ensure repository is updated repo.flush() # Run the diatomic monocation optimizations for hydrides, oxides if nm in cation_nms: run_dia(m, nm, 1, template_str, repo) ## end if # Ensure repository is updated repo.flush() # Clear any residual temp files from failed comps clear_tmp(atomSym[m].capitalize() + atomSym[nm].capitalize()) ## next nm ## next m # Close the repository repo.close() # Exit the working directory; if wkdir not specified then just go to # parent directory; otherwise restore the old wd. if wkdir == None: os.chdir('..') else: os.chdir(old_wkdir) ## end if # Log end of execution logger.info("Calc series ended: " + time.strftime("%c")) logger.info("Total elapsed time: " + \ make_timestamp(time.time() - start_time)) ## end def do_run def continue_dia(template_file, m, nm, chg, mult, ref, wkdir=None): # Imports from opan.utils import make_timestamp from opan.const import atomSym # If wkdir specified, try changing there first if not wkdir == None: old_wkdir = os.getcwd() os.chdir(wkdir) ## end if # Pull in the template with open(template_file) as f: template_str = f.read() ## end with # Set up and create the log, and log wkdir setup_logger() logger = logging.getLogger(log_names.loggername) logger.info("============ RESTART ============") logger.info("Jensen calc series resumed: " + time.strftime("%c")) logger.info("Working in directory: " + os.getcwd()) # Proofread the template proof_template(template_str) # Log the template file contents logger.info("Template file '" + template_file + "' contents:\n\n" + \ template_str) # Store the starting time start_time = time.time() # Retrieve the data repository repo = h5.File(repofname, 'a') # Log the restart logger.info("Restarting '" + build_base(m, nm, chg) + \ "' at multiplicity " + str(mult) + ", reference " + \ "multiplicity " + str(ref)) # Run the diatomic optimizations, with restart point run_dia(m, nm, chg, template_str, repo, startvals=(mult, ref)) # Ensure repository is updated repo.flush() # Clear any residual temp files from failed comps clear_tmp(atomSym[m].capitalize() + atomSym[nm].capitalize()) # Close the repository repo.close() # If workdir specified, return to old if wkdir != None: os.chdir(old_wkdir) ## end if # Log end of execution logger.info("Diatomic recalc ended: " + time.strftime("%c")) logger.info("Total elapsed time: " + \ make_timestamp(time.time() - start_time)) ## end def continue_dia def recover_results(skip_if_good=True, log_clobber=False, log_debug=False): """ #DOC: Docstring for recover_results """ # Imports from opan.const import atomSym from opan.output import ORCA_OUTPUT from opan.error import OUTPUTError, XYZError, HESSError from opan.xyz import OPAN_XYZ as XYZ from opan.hess import ORCA_HESS as HESS from opan.utils import make_timestamp import logging # Bind repo repo = h5.File(repofname) # Set up the logger setup_logger() logger = logging.getLogger(log_names.loggername) # Enable debug logging if flagged if log_debug: logger.setLevel(logging.DEBUG) ## end if # Log starting recover attempt logger.info("Starting results recovery: " + time.strftime("%c")) # Store the starting time start_time = time.time() # If wipe indicated, pop everything from the repo if not skip_if_good: repo.clear() repo.flush() logger.info("Repository contents cleared.") ## end if # Monoatomics first for at in nonmetals.union(metals): # Create/retrieve the base group and the max_mult value atgp = repo.require_group(atomSym[at].capitalize()) max_mult = max_unpaired[at] + 1 h5_clobber_dataset(atgp, name=h5_names.max_mult, data=max_mult, \ log_clobber=log_clobber) # Loop over multiplicities, retrieving data for mult in range(max_mult, -(max_mult % 2), -2): # Pre-retrieve the group (or, attempt, at least) mgp = atgp.get(h5_names.mult_prfx + str(mult)) # Define the base string base = atomSym[at].capitalize() + sep + str(mult) # If skip_if_good, mult group is found, and converger is not FAIL, # then skip to next mult if skip_if_good and mgp != None: # Pull the prior dataset and check (fragile if it's # a group, instead). d_prior_conv = mgp.get(h5_names.converger) if d_prior_conv != None and d_prior_conv.value != fail_conv: # Skip! logger.debug("Skipping re-import of '" + base + "'") continue ## to next mult ## end if ## end if # Going to import - log it logger.info("(Re-)importing data for '" + base + "'") # Define run filename fname = base + '.' + DEF.File_Extensions[E_SW.ORCA][E_FT.output] # If the output file exists... if os.path.isfile(fname): # Try to import it, skipping the rest of the loop on an # OUTPUTError try: oo = ORCA_OUTPUT(fname) except (OUTPUTError, IOError): logger.error("Could not process output file for " + \ "computation '" + base + "'") continue ## end try # Should be good to create/retrieve multiplicity subgroup and # populate it. Rebind since mgp could be None from above # code. Start with storing the base name. mgp = atgp.require_group(h5_names.mult_prfx + str(mult)) h5_clobber_dataset(mgp,name=h5_names.run_base, data=base, \ log_clobber=log_clobber) # Now store the results, starting with detecting the converger. with open(base + '.' + DEF.File_Extensions[E_SW.ORCA] \ [E_FT.inputfile], 'r') as f: conv_name = find_conv_name(f.read()) ## end with store_mono_results(mgp, conv_name, oo, log_clobber=log_clobber) else: logger.error("Could not locate output file for " + \ "computation '" + base + "'") ## end if ## next mult # Parse the data for the different multiplicities to find the optimum parse_mono_mults(atgp, log_clobber=log_clobber) # Flush the repo once for each atom repo.flush() ## next at # Now the diatomics for m in metals: for nm in nonmetals: for chg in (0,1): if chg == 0 or nm in cation_nms: # Retrieve the data # Create/retrieve group in the repo for the diatomic # and charge diagp = repo.require_group(build_base(m, nm, chg)) # Get the max multiplicity for the diatomic and store max_mult = max_unpaired[m] + max_unpaired[nm] + 1 - chg h5_clobber_dataset(diagp, name=h5_names.max_mult, \ data=max_mult, log_clobber=log_clobber) ## end if # Loop over multiplicities, retrieving data, until # minimum mult is reached for mult in range(max_mult, -(max_mult % 2), -2): # Create/retrieve multiplicity subgroup in repo mgp = diagp.require_group(h5_names.mult_prfx + \ str(mult)) # Loop over reference multiplicities, from max_mult to # current mult for ref in range(max_mult, mult-2, -2): # Attempt pre-retrieve of ref group rgp = mgp.get(h5_names.ref_prfx + str(ref)) # Store base string base = build_base(m, nm, chg, mult, ref) # If skip_if_good, mult group is found, and # converger is not FAIL, then skip to next refmult if skip_if_good and rgp != None: # Pull the prior dataset and check (fragile if # it's a group, instead). d_prior_conv = rgp.get(h5_names.converger) if d_prior_conv != None and \ d_prior_conv.value != fail_conv: # Skip! logger.debug("Skipping re-import of '" + \ base + "'") continue ## to next refmult ## end if ## end if # Going to import - log it logger.info("(Re-)importing data for '" + \ base + "'") # Create/retrieve ref multiplicity subgroup, since # rgp may be None after above code. rgp = mgp.require_group(h5_names.ref_prfx + \ str(ref)) # Write base string to repo h5_clobber_dataset(rgp, name=h5_names.run_base, \ data=base, log_clobber=log_clobber) # Detect and store the nominal converger, logging # error and continuing to next refmult if file # load fails try: with open(base + '.' + \ DEF.File_Extensions[E_SW.ORCA] \ [E_FT.inputfile], 'r') as f: conv_name = find_conv_name(f.read()) ## end with except IOError: logger.error("Could not process input file" + \ " for computation '" + base + "'") h5_clobber_dataset(rgp, \ name=h5_names.converger, \ data=fail_conv, \ log_clobber=log_clobber) continue ## end try h5_clobber_dataset(rgp, name=h5_names.converger, \ data=conv_name, log_clobber=log_clobber) # Check for successful computation; log failure if # not try: # Have to consider a possibly broken or # missing .out file oo = ORCA_OUTPUT(base + '.' + \ DEF.File_Extensions[E_SW.ORCA][E_FT.output]) except (OUTPUTError, IOError): logger.error("Could not process output file" + \ " for computation '" + base + "'") h5_clobber_dataset(rgp, \ name=h5_names.converger, \ data=fail_conv, \ log_clobber=log_clobber) continue ## end try if not (oo.completed and oo.converged and \ oo.optimized): # Log failure and continue to next refmult logger.error(base + " opt failed to " + \ " converge in all computations.") h5_clobber_dataset(rgp, \ name=h5_names.converger, \ data=fail_conv, \ log_clobber=log_clobber) # Skip remainder of processing of this refmult continue ## to next refmult ## end if # Store useful outputs to repo - bond length, final # energy, HESS stuff, dipole moment try: xyz = XYZ(path=(base + '.' + \ DEF.File_Extensions[E_SW.ORCA][E_FT.xyz])) except (XYZError, IOError): logger.error("Error parsing XYZ file for '" + \ base + "'") h5_clobber_dataset(rgp, \ name=h5_names.converger, \ data=fail_conv, \ log_clobber=log_clobber) continue ## end try try: hess = HESS(base + '.' + \ DEF.File_Extensions[E_SW.ORCA][E_FT.hess]) except (HESSError, IOError): logger.error("Error parsing HESS file for '" + \ base + "'") h5_clobber_dataset(rgp, \ name=h5_names.converger, \ data=fail_conv, \ log_clobber=log_clobber) continue ## end try # Pull the results; store any halt code halt = store_dia_results(rgp, oo, xyz, hess, \ log_clobber=log_clobber) # Check for error states; report and halt if found if halt == h5_names.out_freq: logger.error(base + " yielded an imaginary" + \ " frequency.") h5_clobber_dataset(rgp, \ name=h5_names.converger, \ data=fail_conv, \ log_clobber=log_clobber) continue ## to next refmult ## end if ## next ref ## next mult # Identify the minimum-energy multiplicity and associated # properties. May be inaccurate if key runs fail. # parse_dia_mults created to allow re-running after the # fact, once such key runs have been tweaked manually # to re-run satisfactorily. parse_dia_mults(diagp, log_clobber=log_clobber) # Flush repo once per diatomic repo.flush() ## end if ## next q ## next nm ## next m # Close the repo repo.close() # Log end of execution logger.info("Data import ended: " + time.strftime("%c")) logger.info("Total elapsed time: " + \ make_timestamp(time.time() - start_time)) ## end def recover_results def find_conv_name(inpstr): """ #DOC: Docstring for find_conv_name """ retstr = "" if inpstr.upper().find("KDIIS") > -1: retstr = "KDIIS" if inpstr.upper().find("SOSCF") > -1: retstr = ("" if len(retstr) == 0 else " & ") + "SOSCF" if len(retstr) == 0: retstr = "default" if inpstr.upper().find("SLOWCONV") > -1: retstr += " & SLOWCONV" return retstr ## end def find_conv_name def write_csv(repo): """ #DOC: Docstring for write_csv Is split into its own method to enable re-running later on """ # Imports from opan.const import atomSym # Generate the csv with open(csvfname, mode='w') as csv_f: # Create the CSV writer object w = csv.writer(csv_f, dialect='excel') # Write a header line w.writerow(["M", "NM", "E_M", "H_M", "E_NM", "H_NM", "E_dia", "H_dia", \ "ZPE_dia", \ "E_ion", "H_ion", "ZPE_ion", "Mult_0", "Mult_1", "BDE", "IE", \ "Bond_0", "Bond_1", \ "Dipole_0", "Dipole_1"]) for m in metals: # Link the metal repo group and helper name string m_name = atomSym[m].capitalize() m_gp = repo.get(m_name) # Stores None if group not present. for nm in nonmetals: # Helper name strings nm_name = atomSym[nm].capitalize() dia_name = m_name + nm_name # Group links; all store None if group is not present. nm_gp = repo.get(nm_name) dia_gp = repo.get(build_base(m, nm, 0)) ion_gp = repo.get(build_base(m, nm, 1)) # Pull data, if present, and calculate results # Energies en_m = safe_retr(m_gp, h5_names.min_en, \ m_name + " energy") enth_m = safe_retr(m_gp, h5_names.min_en_enth, \ m_name + " enthalpy correction") en_nm = safe_retr(nm_gp, h5_names.min_en, \ nm_name + " energy") enth_nm = safe_retr(nm_gp, h5_names.min_en_enth, \ nm_name + " enthalpy correction") en_dia = safe_retr(dia_gp, h5_names.min_en, \ dia_name + " energy") enth_dia = safe_retr(dia_gp, h5_names.min_en_enth, \ dia_name + " enthalpy correction") zpe_dia = safe_retr(dia_gp, h5_names.min_en_zpe, \ dia_name + " ZPE correction") # Calculate the bond dissociation energy try: bde = (en_m + enth_m + en_nm + enth_nm) - \ (en_dia + enth_dia + zpe_dia) except TypeError: bde = NA_str ## end try # Store flag for logging absent values (suppress logging for # nonmetals that are not supposed to have cations calc-ed). lgabs = nm in cation_nms # Retrieve the energies of the monocation diatomic en_ion = safe_retr(ion_gp, h5_names.min_en, \ dia_name + " monocation energy", \ log_absent=lgabs) enth_ion = safe_retr(ion_gp, h5_names.min_en_enth, \ dia_name + " monocation enthalpy correction", \ log_absent=lgabs) zpe_ion = safe_retr(ion_gp, h5_names.min_en_zpe, \ dia_name + " monocation ZPE correction", \ log_absent=lgabs) # Calculate the ionization energy try: ie = (en_ion + enth_ion + zpe_ion) - \ (en_dia + enth_dia + zpe_dia) except TypeError: ie = NA_str ## end try # Get the bond length, dipole moment, and ground spin state min_mult_0 = safe_retr(dia_gp, h5_names.min_en_mult, \ dia_name + " ground multiplicity") bondlen_0 = safe_retr(dia_gp, h5_names.min_en_bondlen, \ dia_name + " bond length") dipmom_0 = safe_retr(dia_gp, h5_names.min_en_dipmom, \ dia_name + " dipole moment") min_mult_1 = safe_retr(ion_gp, h5_names.min_en_mult, \ dia_name + " cation ground multiplicity", \ log_absent=lgabs) bondlen_1 = safe_retr(ion_gp, h5_names.min_en_bondlen, \ dia_name + " cation bond length", \ log_absent=lgabs) dipmom_1 = safe_retr(ion_gp, h5_names.min_en_dipmom, \ dia_name + " cation dipole moment", \ log_absent=lgabs) # Write the CSV line w.writerow([m_name, nm_name, en_m, enth_m, en_nm, enth_nm, \ en_dia, enth_dia, \ zpe_dia, en_ion, enth_ion, zpe_ion, min_mult_0, \ min_mult_1, \ bde, ie, \ bondlen_0, bondlen_1, \ dipmom_0, dipmom_1]) ## next nm ## next m ## end with (closes csv file) ## end def write_csv def write_mult_csv(repo, absolute=False): """ #DOC: Docstring for write_mult_csv """ # Imports from opan.const import atomSym # Generate the csv with open(csv_multfname, mode='w') as csv_f: # Create the CSV writer object w = csv.writer(csv_f, dialect='excel') # Write a header line w.writerow(['M', 'NM', 'q'] + [str(i) for i in mult_range]) # Loop through all available metals; store the name for convenience for m in metals: m_name = atomSym[m].capitalize() # Loop the nonmetals for nm in nonmetals: # Store the name & diatomic helper nm_name = atomSym[nm].capitalize() # Loop the two charges for q_val in [0,1]: # Set the group wk_gp = repo.get(m_name + nm_name + sep + \ h5_names.chg_prfx + str(q_val)) # Check existence if not wk_gp == None: # Exists; reset the storage array and energy reference row_ary = [] en_ref = 0.0 if absolute else \ (0.0 if (wk_gp.get(h5_names.min_en) == None) \ else wk_gp.get(h5_names.min_en).value) # Store metal, nonmetal and charge map(row_ary.append, [m_name, nm_name, str(q_val)]) # Search the full mult range for mult in mult_range: # Try to store the mult group mgp = wk_gp.get(h5_names.mult_prfx + str(mult)) # Check if found, and out_en exists if (not mgp == None) and \ (not mgp.get(h5_names.out_en) == None): # If found, tag the energy into the row array row_ary.append( \ str(mgp.get(h5_names.out_en).value - \ en_ref)) else: # If not, tag empty string row_ary.append('') ## end if ## next mult # Write a csv row for the species w.writerow(row_ary) ## end if wk_gp exists ## next q_val ## next nm ## next m ## end with ## end def write_mult_csv #TODO: Write further CSV writers, perhaps a general one that writes a CSV for # a quantity specified by some sort of 'enum'? Or/also, one that generates # summaries of properties across the matrix of multiplicities and reference # wavefunctions? def run_mono(at, template_str, repo): """ #DOC: Docstring for run_mono """ # Imports from opan.const import atomSym, PHYS from opan.utils.execute import execute_orca as exor from time import sleep import os, logging # Retrieve the logger logger = logging.getLogger(log_names.loggername) # Create/retrieve the group for the atom in the repository atgp = repo.require_group(atomSym[at].capitalize()) # Get the max multiplicity for the atom and store max_mult = max_unpaired[at] + 1 h5_clobber_dataset(atgp, name=h5_names.max_mult, data=max_mult, \ log_clobber=True) # Loop until at minimum possible multiplicity for mult in range(max_mult, -(max_mult % 2), -2): # Create/retrieve multiplicity subgroup mgp = atgp.require_group(h5_names.mult_prfx + str(mult)) # Define and store run base string base = atomSym[at].capitalize() + sep + str(mult) h5_clobber_dataset(mgp,name=h5_names.run_base, data=base, \ log_clobber=True) # Try executing, iterating through the convergers for conv in convergers: # Store converger reporting name conv_name = conv if conv != "" else "default" # Run the calc, storing the ORCA_OUTPUT object oo = exor(template_str, os.getcwd(), [exec_cmd, base], \ sim_name=base, \ subs=[('OPT', ''), ('CONV', conv), ('MULT', str(mult)), \ ('CHARGE', '0'), \ ('MOREAD', '! NOAUTOSTART'), \ ('XYZ', atomSym[at] + " 0 0 0")])[0] # Check if completed and converged if oo.completed and oo.converged: logger.info(base + " converged using " + conv_name) break else: logger.warning(base + " did not converge using " + conv_name) ## end if # Run again, with SLOWCONV conv_name += " & SLOWCONV" oo = exor(template_str, os.getcwd(), [exec_cmd, base], \ sim_name=base, \ subs=[('OPT', ''), ('CONV', conv + "\n! SLOWCONV"), \ ('MULT', str(mult)), ('CHARGE', '0'), \ ('MOREAD', '! NOAUTOSTART'), \ ('XYZ', atomSym[at] + " 0 0 0")])[0] # Again, check if completed / converged if oo.completed and oo.converged: logger.info(base + " converged using " + conv_name) break else: logger.warning(base + " did not converge using " + conv_name) ## end if else: # If never broken, then the whole series of computations failed. # Log and skip to next multiplicity. logger.error(base + " failed to converge in all computations.") h5_clobber_dataset(mgp,name=h5_names.converger, \ data=fail_conv, log_clobber=True) continue ## to next mult ## next conv # Store useful outputs store_mono_results(mgp, conv_name, oo, log_clobber=True) # Flush the repo repo.flush() ## next mult # Parse the data for the different multiplicities to find the optimum parse_mono_mults(atgp, log_clobber=True) # Pause if indicator file present while os.path.isfile(os.path.join(os.getcwd(),pausefname)): sleep(pausetime) ## loop ## end def run_mono def run_dia(m, nm, chg, template_str, repo, startvals=None): """ #DOC: Docstring for run_dia """ # Imports from opan.const import atomSym, PHYS from opan.utils.execute import execute_orca as exor from opan.xyz import OPAN_XYZ as XYZ from opan.hess import ORCA_HESS as HESS import os, logging from time import sleep # Retrieve logger logger = logging.getLogger(log_names.loggername) # Create/retrieve group in the repo for the diatomic & charge diagp = repo.require_group(build_base(m, nm, chg)) # Get the max multiplicity for the diatomic and store max_mult = max_unpaired[m] + max_unpaired[nm] + 1 - chg h5_clobber_dataset(diagp, name=h5_names.max_mult, data=max_mult, \ log_clobber=True) ## end if # Loop over multiplicities, optimizing, until minimum mult is reached for mult in range(max_mult, -(max_mult % 2), -2): # Drop to next multiplicity if not to be run if startvals != None: if mult > startvals[0]: continue ## end if ## end if # Create/retrieve multiplicity subgroup in repo mgp = diagp.require_group(h5_names.mult_prfx + str(mult)) # Loop over reference multiplicities, from max_mult to current mult for ref in range(max_mult, mult-2, -2): # Drop to next ref if not to be run if startvals != None: if ref > startvals[1] and mult == startvals[0]: continue ## end if ## end if # Create/retrieve ref multiplicity subgroup rgp = mgp.require_group(h5_names.ref_prfx + str(ref)) # Set & write base string to repo base = build_base(m, nm, chg, mult, ref) h5_clobber_dataset(rgp, name=h5_names.run_base, data=base, \ log_clobber=True) # If ref is the same as mult, then start fresh. Otherwise, insist # on starting from a prior wavefunction. if ref != mult: # Build stuff from prior. Start by defining the MOREAD string, # which is unambiguous moread_str = build_moread(m, nm, chg, ref, ref) # Only worry about the prior geom if basing sep on it if fixed_dia_sep: # Just use the fixed value xyz_str = def_dia_xyz(m, nm, init_dia_sep) else: # Load the xyz info. Presume two atoms. x = XYZ(path=(build_base(m, nm, chg, ref, ref) + ".xyz")) # Check that sep not too large if x.Dist_single(0,0,1) * PHYS.Ang_per_Bohr > \ ditch_sep_thresh: # Too large; use default xyz_str = def_dia_xyz(m, nm, init_dia_sep) else: # OK. Use scaled value from prior, if not too small xyz_str = def_dia_xyz(m, nm, \ dist=max( \ geom_scale * x.Dist_single(0,0,1) * \ PHYS.Ang_per_Bohr, init_dia_sep ) ) ## end if ## end if else: # Build from scratch if ref == mult moread_str = "! NOAUTOSTART" xyz_str = def_dia_xyz(m, nm, init_dia_sep) ## end if # Try executing, looping across convergers. Should probably use a # very small number for %geom MaxIter and perhaps consider a # Calc_Hess true, to try to avoid unbound cases taking forever # to run. for conv in convergers: # Pause if pause-file touched while os.path.isfile(os.path.join(os.getcwd(),pausefname)): sleep(pausetime) ## loop # Update the reporting name for the converger conv_name = (conv if conv != "" else "default") + " & SLOWCONV" # Try all convergers with SLOWCONV, clearing temp # files first clear_tmp(base) oo = exor(template_str, os.getcwd(), [exec_cmd, base], \ sim_name=base, \ subs=[('OPT', str(opt_str)), \ ('CONV', conv + "\n! SLOWCONV"), \ ('MULT', str(mult)), \ ('CHARGE', str(chg)), \ ('MOREAD', moread_str), \ ('XYZ', xyz_str) ])[0] ## [0] here b/c execute returns a tuple of objects # Check if completed, converged and optimized; store 'last_' # variables and break if so if oo.completed and oo.converged and oo.optimized: logger.info(base + " opt converged from '" + \ ("model" if ref == mult else \ build_base(m, nm, chg, ref)) + \ "' using " + conv_name) h5_clobber_dataset(rgp, name=h5_names.converger, \ data=conv_name, log_clobber=True) break ## for conv in convergers else: logger.warning(base + " opt did not converge using " + \ conv_name) ## end if else: ## on for conv in convergers: # If never broken, then the whole series of computations failed. # Try one last go with KDIIS and NUMFREQ, clearing any # temp files first, but only if ANFREQ is found in the # template if template_str.upper().find('ANFREQ') > -1: clear_tmp(base) oo = exor(template_str.replace("ANFREQ", \ "NUMFREQ \n%freq Increment 0.01 end"), \ os.getcwd(), [exec_cmd, base], \ sim_name=base, \ subs=[('OPT', str(opt)), \ ('CONV', "! KDIIS \n! SLOWCONV "), \ ('MULT', str(mult)), \ ('CHARGE', str(chg)), \ ('MOREAD', moread_str), \ ('XYZ', xyz_str) ])[0] # Check if completed, converged and optimized; store 'last_' # variables if so; if not, log and skip to next # multiplicity. if oo.completed and oo.converged and oo.optimized: logger.info(base + " opt converged from '" + \ ("model" if mult == ref else \ build_base(m, nm, chg, ref)) + \ "' using KDIIS & SLOWCONV & NUMFREQ") h5_clobber_dataset(rgp, name=h5_names.converger, \ data="KDIIS & SLOWCONV & NUMFREQ", \ log_clobber=True) else: # Log failure and return. logger.error(base + \ " opt failed to converge in all computations.") h5_clobber_dataset(rgp, name=h5_names.converger, \ data=fail_conv, log_clobber=True) # Skip remainder of processing of this diatomic return ## end if run succeeded else: # Log failure and return. logger.error(base + \ " opt failed to converge in all computations.") h5_clobber_dataset(rgp, name=h5_names.converger, \ data=fail_conv, log_clobber=True) # Skip remainder of processing of this diatomic return ## end if ANFREQ present in template ## next conv # Store useful outputs to repo - bond length, final energy, HESS # stuff, dipole moment. Must catch for possible corrupted or # absent output files. try: xyz = XYZ(path=(base + ".xyz")) except (XYZError, IOError): logger.error("Error parsing XYZ file for '" + base + "'") h5_clobber_dataset(rgp, name=h5_names.converger, \ data=fail_conv, log_clobber=True) return ## end try try: hess = HESS(base + ".hess") except (HESSError, IOError): logger.error("Error parsing HESS file for '" + \ base + "'") h5_clobber_dataset(rgp, name=h5_names.converger, \ data=fail_conv, log_clobber=True) return ## end try # Attempt the storage of the results; flush repo halt = store_dia_results(rgp, oo, xyz, hess, log_clobber=True) repo.flush() # Check for error states; report and halt if found if halt == h5_names.out_freq: logger.error(base + " yielded a zero/imaginary frequency.") h5_clobber_dataset(rgp, name=h5_names.converger, \ data=fail_conv, log_clobber=True) repo.flush() return ## end if ## next ref ## next mult # Identify the minimum-energy multiplicity and associated properties. # May be inaccurate if key runs fail. parse_dia_mults created to allow re- # running after the fact, once such key runs have been tweaked manually # to re-run satisfactorily. parse_dia_mults(diagp, log_clobber=True) ## end def run_dia def store_mono_results(mgp, conv_name, oo, log_clobber=False): """ #DOC: store_mono_results docstring """ # Store useful outputs storage_data = ( (h5_names.converger, conv_name), (h5_names.out_en, oo.en_last()[oo.EN.SCFFINAL]), (h5_names.out_zpe, oo.thermo[oo.THERMO.E_ZPE]), (h5_names.out_enth, oo.thermo[oo.THERMO.H_IG]) ) for item in storage_data: h5_clobber_dataset(mgp,name=item[0], data=item[1], \ log_clobber=log_clobber) ## next item # DON'T flush the repo; do it outside the call ## end def store_mono_results def store_dia_results(rgp, oo, xyz, hess, log_clobber=False): """ #DOC: store_dia_results docstring """ # Imports from opan.const import PHYS #TODO: Expand data stored in store_run_results as ORCA_OUTPUT expanded # Store the data, overwriting if it exists storage_data = ( (h5_names.out_en, oo.en_last()[oo.EN.SCFFINAL]), (h5_names.out_zpe, oo.thermo[oo.THERMO.E_ZPE]), (h5_names.out_enth, oo.thermo[oo.THERMO.H_IG]), (h5_names.out_dipmom, oo.dipmoms[-1]), (h5_names.out_bondlen, \ PHYS.Ang_per_Bohr * xyz.Dist_single(0,0,1)), (h5_names.out_freq, hess.freqs[-1]) ) for item in storage_data: h5_clobber_dataset(rgp, name=item[0], data=item[1], \ log_clobber=log_clobber) ## next item # DON'T flush the repo, do it outside the call # Initialize need-to-halt return value halt = None # If the frequency is negative, then halt is called for if hess.freqs[-1] <= 0: halt = h5_names.out_freq ## end if # Return as appropriate return halt ## end def store_dia_results def parse_mono_mults(atgp, log_clobber=False): """ #DOC: parse_mono_mults docstring """ # Imports from opan.const import atomSym import logging # Try to bind the logger -- should ALWAYS be bound when this is called # under normal execution circumstances, but will not be available if # called from the interpreter. logger = logging.getLogger(log_names.loggername) if len(logger.handlers) == 0: logger = None ## end if # Initialize the minimum energy to zero, which everything should be less # than! Also init min_mult to ~error value. min_en = 0.0 min_mult = 0 # Loop over all multiplicity groups to identify the lowest-energy # multiplicity for g in atgp.values(): # Check if a given value is a group and that its name matches the # pattern expected of a multiplicity group if isinstance(g, h5.Group) and p_multgrp.search(g.name) != None: # Confirm energy value exists if g.get(h5_names.out_en) != None: # Check if the reported SCF final energy is less than the # current minimum. if g.get(h5_names.out_en).value < min_en: # If so, update the minimum and store the multiplicity min_en = np.float_(g.get(h5_names.out_en).value) min_mult = np.int_(p_multgrp.search(g.name).group("mult")) ## end if ## end if ## end if ## next g # If minimum energy remains unchanged, then nothing found. Note as error # and skip remainder of import operation if min_en == 0.0: if logger != None: logger.error("No results found for group '" + atgp.name + "'") atgp.file.flush() return ## end if ## end if # Store the minimum energy and multiplicity, and retrieve/store the other # thermo values h5_clobber_dataset(atgp, name=h5_names.min_en, data=min_en, \ log_clobber=log_clobber) h5_clobber_dataset(atgp, name=h5_names.min_en_mult, data=min_mult, \ log_clobber=log_clobber) # Try to retrieve the appropriate group mgp = atgp.get(h5_names.mult_prfx + str(min_mult)) # Something should be retrievable -- at least one computation on any # given atom should succeed. (Historically, *all* have succeeded!) h5_clobber_dataset(atgp, name=h5_names.min_en_zpe, \ data=mgp.get(h5_names.out_zpe).value, log_clobber=log_clobber) h5_clobber_dataset(atgp, name=h5_names.min_en_enth, \ data=mgp.get(h5_names.out_enth).value, log_clobber=log_clobber) # Flush the repo atgp.file.flush() ## end def parse_mono_mults def parse_dia_mults(diagp, log_clobber=False): """ #DOC: parse_dia_mults docstring """ # Imports from opan.const import atomSym import logging # Try to bind the logger -- should ALWAYS be bound when this is called # under normal execution circumstances, but will not be available if # called from the interpreter. logger = logging.getLogger(log_names.loggername) if len(logger.handlers) == 0: logger = None ## end if # Initialize the minimum energy to zero, which everything should be less # than! Also init min_mult to ~error value. min_en = 0.0 min_mult = 0 min_ref = 0 # Identify lowest-energy multiplicity and wavefunction reference; push # info to repo for mg in diagp.values(): # Check if a given value is a group and that its name matches the # pattern expected of a multiplicity group if isinstance(mg, h5.Group) and p_multgrp.search(mg.name) != None: # Loop over items in the multiplicity group for rg in mg.values(): # Check if group and name matches ref group pattern if isinstance(rg, h5.Group) and \ p_refgrp.search(rg.name) != None: # Check if output energy value exists if not rg.get(h5_names.out_en) == None: # Check if the reported SCF final energy is less than # the current minimum. if rg.get(h5_names.out_en).value < min_en: # If so, update the minimum and store the # multiplicity/reference wfn min_en = np.float_(rg.get(h5_names.out_en).value) min_mult = np.int_(p_multgrp.search(mg.name) \ .group("mult")) min_ref = np.int_(p_refgrp.search(rg.name) \ .group("ref")) ## end if ## end if ## end if ## end if ## end if ## next g # If minimum energy remains unchanged, then nothing found. Note as error # and skip remainder of import operation if min_en == 0.0: if logger != None: logger.error("No results found for group '" + diagp.name + "'") diagp.file.flush() return ## end if ## end if # Retrieve the appropriate min groups (should never fail, unless NO DATA # whatsoever exists for the diatomic) mg = diagp.get(h5_names.mult_prfx + str(min_mult)) rg = mg.get(h5_names.ref_prfx + str(min_ref)) # Store the minimum energy and multiplicity, and retrieve/store the other # thermo values storage_data = ( (h5_names.min_en, min_en), (h5_names.min_en_mult, min_mult), (h5_names.min_en_ref, min_ref), (h5_names.min_en_zpe, rg.get(h5_names.out_zpe).value), (h5_names.min_en_enth, rg.get(h5_names.out_enth).value), (h5_names.min_en_bondlen, rg.get(h5_names.out_bondlen).value), (h5_names.min_en_dipmom, rg.get(h5_names.out_dipmom).value) ) for item in storage_data: h5_clobber_dataset(diagp, name=item[0], data=item[1], \ log_clobber=log_clobber) ## next item # Flush the repo diagp.file.flush() ## end def parse_dia_mults def merge_h5(f1, f2): """ #DOC: merge_h5 docstring """ # Imports # Load the files hf1 = h5.File(f1) hf2 = h5.File(f2) # Loop over all root objects in h2, low-level copying to h1. Must check # if each exists in h1, and if so, delete. # Start by popping any values out of hf1 if they exist [hf1.pop(v.name, None) for v in hf2.values()] # Flush hf1 to ensure the disk version is up to date hf1.flush() # Low-level copy of all hf2 items to hf1 [h5.h5o.copy(hf2.id, v.name, hf1.id, v.name) for v in hf2.values()] # Close everything hf2.close() hf1.close() ## end def merge_h5 def clear_tmp(base): """ #DOC: clear_tmp docstring """ # Imports import os [os.remove(os.path.join(os.getcwd(), fn)) for fn \ in os.listdir(os.getcwd()) \ if (fn.find(base) == 0 and \ (fn[-3:] == "tmp" or fn[-5:] == "tmp.0" or \ fn[-5:] == "cpout"))] ## end def clear_tmp def def_dia_xyz(m, nm, dist=init_dia_sep): """ #DOC: def_dia_xyz docstring """ # Imports from opan.const import atomSym # Construct and return the xyz info xyz_str = " " + atomSym[m].capitalize() + " 0 0 0 \n" + \ " " + atomSym[nm].capitalize() + " 0 0 " + str(dist) return xyz_str ## end def def_dia_xyz def build_moread(m, nm, chg, mult, ref=None): """ #DOC: build_moread docstring """ mo_str = '"' + build_base(m, nm, chg, mult, ref) + '.gbw"' mo_str = '! MOREAD\n%moinp ' + mo_str return mo_str ## end def build_moread def build_base(m, nm, chg, mult=None, ref=None): """ #DOC: build_base docstring """ # Imports from opan.const import atomSym base_str = atomSym[m].capitalize() + atomSym[nm].capitalize() + sep + \ h5_names.chg_prfx + ("_" if chg < 0 else "") + str(abs(chg)) + \ (h5_names.mult_prfx + str(mult) if mult != None else "") + \ (h5_names.ref_prfx + str(ref) if ref != None else "") return base_str ## end def build_base def safe_retr(group, dataname, errdesc, log_absent=True): """ #DOC: docstring for safe_retr """ # Imports import logging try: workvar = group.get(dataname).value except AttributeError: if log_absent: logging.getLogger(log_names.loggername) \ .error(errdesc + " absent from repository.") ## end if workvar = NA_str ## end try return workvar ## end def safe_retr def proof_template(template_str): for tag in req_tag_strs: if template_str.find(tag) == -1: raise(ValueError("'" + tag + "' tag absent from template.")) ## end if ## next tag ## end def proof_template def setup_logger(): """ #DOC: setup_logger docstring """ # Imports import logging, logging.config # Define the configuration dictionary dictLogConfig = { "version": 1, "loggers": { log_names.loggername: { "handlers": [log_names.handlername], "level": "INFO" } }, "handlers": { log_names.handlername: { "class": "logging.FileHandler", "formatter": log_names.formattername, "filename": os.path.join(os.getcwd(),log_names.filename) } }, "formatters": { log_names.formattername: { "format": log_names.fmt, "datefmt": log_names.datefmt } } } # Apply the config logging.config.dictConfig(dictLogConfig) ## end def setup_logger def continue_tuple(tupstr): """ #DOC: continue_tuple docstring """ # Imports import argparse from opan.const import atomSym # Ensure enclosing parentheses workstr = ('(' if tupstr[0] != '(' else "") + \ tupstr + \ (')' if tupstr[-1] != ')' else "") # Try the tuple strip-and-split conversion try: out_tup = tuple(map(int,workstr[1:-1].split(','))) except (ValueError, TypeError): msg = '"' + tupstr + '" is not a tuple of integers' raise(argparse.ArgumentTypeError(msg)) ## end try # Must be length five if not len(out_tup) == 5: msg = 'Argument must contain five integers: "' + tupstr + '"' raise(argparse.ArgumentTypeError(msg)) ## end if # Must be an implemented metal if not out_tup[0] in metals: msg = "Metal '" + str(out_tup[0]) + "' (" + atomSym[out_tup[0]] + \ ") not implemented" raise(argparse.ArgumentTypeError(msg)) ## end if # Must be an implemented nonmetal if not out_tup[1] in nonmetals: msg = "Nonmetal '" + str(out_tup[1]) + "' (" + atomSym[out_tup[1]] + \ ") not implemented" raise(argparse.ArgumentTypeError(msg)) ## end if # Return the tuple return out_tup ## end def continue_tuple def h5_clobber_dataset(grp, name, shape=None, dtype=None, \ data=None, log_clobber=False, **kwargs): """ #DOC: h5_clobber_dataset docstring. """ # Imports import logging, h5py as h5 # Retrieve logger -- reset to None if no handler bound, indicating a # presumed call from the interpreter logger = logging.getLogger(log_names.loggername) if len(logger.handlers) == 0: logger = None ## end if # Check existence of desired object if name in grp.keys(): # Complain if it's not a dataset - WILL NOT FIND A SAME-NAMED GROUP if not isinstance(grp.get(name), h5.Dataset): # Catches links &c. raise(ValueError("Item '" + name + "' is not a dataset")) ## end if # Clobber and flush repo; log if indicated grp.pop(name) if log_clobber and not logger == None: logger.info("Dataset '" + name + "' in group '" + grp.name + \ "' was overwritten.") ## end if ## end if # Either way, add new grp.create_dataset(name, shape=shape, dtype=dtype, data=data, **kwargs) ## end def h5_clobber_dataset if __name__ == '__main__': # Imports import argparse as ap # Param name strings TMPLT_FILE = 'template_file' WKDIR = 'wkdir' EXEC = 'exec' OPT = 'opt' METALS = 'metals' NONMETALS = 'nonmetals' CATION_NMS = 'cation_nms' INIT_SEP_DIA = 'init_sep_dia' SKIP_ATOMS = 'skip_atoms' CONT_DIA = 'continue_dia' # Create the parser prs = ap.ArgumentParser(description="Perform Jensen diatomics " + \ "calculation series.\n\nBackground execution with " + \ "stderr redirected to a file or to /dev/null " + \ "is recommended.") # Template file argument prs.add_argument(TMPLT_FILE, help="Name of input template file") # Continuing an errored-out diatomic prs.add_argument("--" + CONT_DIA, help="Tuple of information to resume " + \ "computation of a halted diatomic.\n" + \ "Format: (m, nm, chg, mult, ref), " + \ "where 'mult' and 'ref' are the " + \ "values at which to restart computation.", metavar="TUPLE", type=continue_tuple, \ default=None) # Working directory argument prs.add_argument("--" + WKDIR, help="Path to working directory with " + \ "template file (defaults to current directory)", \ default=os.getcwd()) # Execution script prs.add_argument("--" + EXEC, help="ORCA execution command (default: " + \ exec_cmd + ")", default=None) # OPT command prs.add_argument("--" + OPT, help="Optimization settings for diatomics " + \ "(default: '" + opt_str + "')", default=None) # Overwrites of metals and nonmetals (incl cation ones) prs.add_argument("--" + METALS, help="Metals to run; pass as " + \ "stringified array of atomic numbers (e.g., '[21, 23, 29]';" + \ " default: " + str(sorted(list(metals))) + ". Only Sc-Zn " + \ "currently supported.", default=None) prs.add_argument("--" + NONMETALS, help="Nonmetals to run; pass as " + \ "stringified array of atomic numbers (e.g., '[1, 6, 9]'; " + \ "default: " + str(sorted(list(nonmetals))) + ". Only these " + \ "defaults currently supported.", default=None) prs.add_argument("--" + CATION_NMS, help="Nonmetals to run as " + \ "monopositive cations; pass as " + \ "stringified array of atomic numbers (e.g., '[1, 8]'; " + \ "this is the default). Any nonmetals are valid.", default=None) # Twiddlers for execution settings prs.add_argument("--" + INIT_SEP_DIA, help="Initial separation between " + \ "atoms in diatomic computations, in Angstroms. " + \ "Default is " + str(init_dia_sep) + " Angstroms.", default=None) prs.add_argument("--" + SKIP_ATOMS, help="Skip atom computations, " + \ "generally for debugging purposes.", default=False, \ const=True, action='store_const') # Make the param namespace and retrieve the params dictionary ns = prs.parse_args() params = vars(ns) # Overwrite the metals, nonmetals, cations, initial diatomic separation, # etc. if specified if not params[METALS] == None: metals = set(eval(params[METALS])) ## end if if not params[NONMETALS] == None: nonmetals = set(eval(params[NONMETALS])) ## end if if not params[CATION_NMS] == None: cation_nms = set(eval(params[CATION_NMS])) ## end if if not params[INIT_SEP_DIA] == None: init_dia_sep = float(params[INIT_SEP_DIA]) ## end if if not params[OPT] == None: opt_str = params[OPT] ## end if if not params[EXEC] == None: exec_cmd = params[EXEC] ## end if skip_atoms = bool(params[SKIP_ATOMS]) # Check for whether a diatomic restart was requested if params[CONT_DIA] == None: # Execute the run do_run(params[TMPLT_FILE], wkdir=params[WKDIR]) else: # Execute a diatomic restart continue_dia(params[TMPLT_FILE], *params[CONT_DIA], \ wkdir=params[WKDIR]) ## end if ## end if main
bskinn/run_jensen
run_jensen.py
Python
mit
65,917
0.008829
from django.contrib import admin from django.db import models from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget from django_summernote.settings import summernote_config, get_attachment_model __widget__ = SummernoteWidget if summernote_config['iframe'] \ else SummernoteInplaceWidget class SummernoteInlineModelAdmin(admin.options.InlineModelAdmin): formfield_overrides = {models.TextField: {'widget': __widget__}} class SummernoteModelAdmin(admin.ModelAdmin): formfield_overrides = {models.TextField: {'widget': __widget__}} class AttachmentAdmin(admin.ModelAdmin): list_display = ['name', 'file', 'uploaded'] search_fields = ['name'] ordering = ('-id',) def save_model(self, request, obj, form, change): obj.name = obj.file.name if (not obj.name) else obj.name super(AttachmentAdmin, self).save_model(request, obj, form, change) admin.site.register(get_attachment_model(), AttachmentAdmin)
lqez/django-summernote
django_summernote/admin.py
Python
mit
974
0.001027
import pygame pygame.init() #-- SCREEN CHARACTERISTICS ------------------------->>> background_color = (255,255,255) (width, height) = (300, 200) class Particle: def __init__(self, (x, y), radius): self.x = x self.y = y self.radius = radius self.color = (255, 0, 0) self.thickness = 1 def display(self): pygame.draw.circle(screen, self.color, (self.x, self.y), self.radius, self.thickness) #-- RENDER SCREEN ---------------------------------->>> screen = pygame.display.set_mode((width, height)) screen.fill(background_color) #pygame.draw.circle(canvas, color, position(x,y), radius, thickness) particle = Particle((150, 100), 20) particle.display() #-- RUN LOOP --------------------------------------->>> pygame.display.flip() running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False
withtwoemms/pygame-explorations
render_particle.py
Python
mit
926
0.009719
""" For using OpenGL to render to an off screen buffer Ref: """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from OpenGL.GL import * from OpenGL.raw.GL.VERSION import GL_1_1,GL_1_2, GL_3_0 class OffScreenRender(object): def __init__(self, width=1920, height=1080): super(OffScreenRender, self).__init__() self._width = width self._height = height self._fbo = None self._render_buf = None self._init_fbo() self._oldViewPort = (ctypes.c_int*4)*4 def __enter__(self): self.activate() def __exit__(self, type, value, traceback): self.deactivate() return False def __del__(self): self._cleanup() super(OffScreenRender, self).__del__() def activate(self): glBindFramebuffer(GL_FRAMEBUFFER, self._fbo) self._oldViewPort = glGetIntegerv(GL_VIEWPORT) side = min(self._width, self._height) glViewport(int((self._width - side)/2), int((self._height - side)/2), side, side) def deactivate(self): glBindFramebuffer(GL_FRAMEBUFFER, 0) glViewport(*self._oldViewPort) def read_into(self, buf, x=0, y=0, width=None, height=None): glReadBuffer(GL_COLOR_ATTACHMENT0) width = width is not None or self._width, height = height is not None or self._height, glReadPixels(0, 0, width, height, GL_BGRA, #GL_RGBA, alot faster, but incorrect :() GL_UNSIGNED_BYTE, buf) #outputType=None) #GL_1_1.glReadPixels( def get_size(self): return self._width*self._height*4 def _init_fbo(self, depth=True): fbo = glGenFramebuffers(1) self._fbo = fbo glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo) render_buf = glGenRenderbuffers(1) self._render_buf = render_buf glBindRenderbuffer(GL_RENDERBUFFER, render_buf) glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, self._width, self._height) glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, render_buf) if depth: depth = glGenRenderbuffers(1) self._depth = depth glBindRenderbuffer(GL_RENDERBUFFER, depth) glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, self._width, self._height) glBindRenderbuffer(GL_RENDERBUFFER, 0) glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depth) assert GL_FRAMEBUFFER_COMPLETE == glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) glBindFramebuffer(GL_FRAMEBUFFER, 0); def _cleanup(self): if self._fbo is not None: glDeleteFramebuffers(self._fbo) self._fbo = None if self._render_buf is not None: glDeleteRenderbuffers(self._render_buf) self._render_buf = None
mpvismer/gltk
offscreenrender.py
Python
mit
3,321
0.013851
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2014 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. import logging import os import sys import utils COMPUTE_IMAGE_PACKAGES_GIT_URL = ( 'https://github.com/GoogleCloudPlatform/compute-image-packages.git') IMAGE_FILE='disk.raw' SETUP_PACKAGES_ESSENTIAL = 'grep file'.split() SETUP_PACKAGES = ('pacman wget gcc make parted git setconf libaio sudo ' 'fakeroot').split() IMAGE_PACKAGES = ('base tar wget ' 'curl sudo mkinitcpio syslinux dhcp ethtool irqbalance ' 'ntp psmisc openssh udev less bash-completion zip unzip ' 'python2 python3').split() def main(): args = utils.DecodeArgs(sys.argv[1]) utils.SetupLogging(quiet=args['quiet'], verbose=args['verbose']) logging.info('Setup Bootstrapper Environment') utils.SetupArchLocale() InstallPackagesForStagingEnvironment() image_path = os.path.join(os.getcwd(), IMAGE_FILE) CreateImage(image_path, size_gb=int(args['size_gb'])) mount_path = utils.CreateTempDirectory(base_dir='/') image_mapping = utils.ImageMapper(image_path, mount_path) try: image_mapping.Map() primary_mapping = image_mapping.GetFirstMapping() image_mapping_path = primary_mapping['path'] FormatImage(image_mapping_path) try: image_mapping.Mount() utils.CreateDirectory('/run/shm') utils.CreateDirectory(os.path.join(mount_path, 'run', 'shm')) InstallArchLinux(mount_path) disk_uuid = SetupFileSystem(mount_path, image_mapping_path) ConfigureArchInstall( args, mount_path, primary_mapping['parent'], disk_uuid) utils.DeleteDirectory(os.path.join(mount_path, 'run', 'shm')) PurgeDisk(mount_path) finally: image_mapping.Unmount() ShrinkDisk(image_mapping_path) finally: image_mapping.Unmap() utils.Run(['parted', image_path, 'set', '1', 'boot', 'on']) utils.Sync() def ConfigureArchInstall(args, mount_path, parent_path, disk_uuid): relative_builder_path = utils.CopyBuilder(mount_path) utils.LogStep('Download compute-image-packages') packages_dir = utils.CreateTempDirectory(mount_path) utils.Run(['git', 'clone', COMPUTE_IMAGE_PACKAGES_GIT_URL, packages_dir]) utils.CreateDirectory(os.path.join(mount_path, '')) packages_dir = os.path.relpath(packages_dir, mount_path) params = { 'packages_dir': '/%s' % packages_dir, 'device': parent_path, 'disk_uuid': disk_uuid, 'accounts': args['accounts'], 'debugmode': args['debugmode'], } params.update(args) config_arch_py = os.path.join( '/', relative_builder_path, 'arch-image.py') utils.RunChroot(mount_path, '%s "%s"' % (config_arch_py, utils.EncodeArgs(params)), use_custom_path=False) utils.DeleteDirectory(os.path.join(mount_path, relative_builder_path)) def InstallPackagesForStagingEnvironment(): utils.InstallPackages(SETUP_PACKAGES_ESSENTIAL) utils.InstallPackages(SETUP_PACKAGES) utils.SetupArchLocale() utils.AurInstall(name='multipath-tools-git') utils.AurInstall(name='zerofree') def CreateImage(image_path, size_gb=10, fs_type='ext4'): utils.LogStep('Create Image') utils.Run(['rm', '-f', image_path]) utils.Run(['truncate', image_path, '--size=%sG' % size_gb]) utils.Run(['parted', image_path, 'mklabel', 'msdos']) utils.Run(['parted', image_path, 'mkpart', 'primary', fs_type, '1', str(int(size_gb) * 1024)]) def FormatImage(image_mapping_path): utils.LogStep('Format Image') utils.Run(['mkfs', image_mapping_path]) utils.Sync() def InstallArchLinux(base_dir): utils.LogStep('Install Arch Linux') utils.Pacstrap(base_dir, IMAGE_PACKAGES) def SetupFileSystem(base_dir, image_mapping_path): utils.LogStep('File Systems') _, fstab_contents, _ = utils.Run(['genfstab', '-p', base_dir], capture_output=True) utils.WriteFile(os.path.join(base_dir, 'etc', 'fstab'), fstab_contents) _, disk_uuid, _ = utils.Run(['blkid', '-s', 'UUID', '-o', 'value', image_mapping_path], capture_output=True) disk_uuid = disk_uuid.strip() utils.WriteFile(os.path.join(base_dir, 'etc', 'fstab'), 'UUID=%s / ext4 defaults 0 1' % disk_uuid) utils.Run(['tune2fs', '-i', '1', '-U', disk_uuid, image_mapping_path]) return disk_uuid def PurgeDisk(mount_path): paths = ['/var/cache', '/var/log', '/var/lib/pacman/sync'] for path in paths: utils.DeleteDirectory(os.path.join(mount_path, path)) def ShrinkDisk(image_mapping_path): utils.LogStep('Shrink Disk') utils.Run(['zerofree', image_mapping_path]) main()
d4l3k/compute-archlinux-image-builder
arch-staging.py
Python
apache-2.0
5,271
0.011762
from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \ cpython_only import io import re from re import Scanner import sys import string import traceback from weakref import proxy # Misc tests from Tim Peters' re.doc # WARNING: Don't change details in these tests if you don't know # what you're doing. Some of these tests were carefully modeled to # cover most of the code. import unittest class ReTests(unittest.TestCase): def test_keep_buffer(self): # See bug 14212 b = bytearray(b'x') it = re.finditer(b'a', b) with self.assertRaises(BufferError): b.extend(b'x'*400) list(it) del it gc_collect() b.extend(b'x'*400) def test_weakref(self): s = 'QabbbcR' x = re.compile('ab+c') y = proxy(x) self.assertEqual(x.findall('QabbbcR'), y.findall('QabbbcR')) def test_search_star_plus(self): self.assertEqual(re.search('x*', 'axx').span(0), (0, 0)) self.assertEqual(re.search('x*', 'axx').span(), (0, 0)) self.assertEqual(re.search('x+', 'axx').span(0), (1, 3)) self.assertEqual(re.search('x+', 'axx').span(), (1, 3)) self.assertEqual(re.search('x', 'aaa'), None) self.assertEqual(re.match('a*', 'xxx').span(0), (0, 0)) self.assertEqual(re.match('a*', 'xxx').span(), (0, 0)) self.assertEqual(re.match('x*', 'xxxa').span(0), (0, 3)) self.assertEqual(re.match('x*', 'xxxa').span(), (0, 3)) self.assertEqual(re.match('a+', 'xxx'), None) def bump_num(self, matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) def test_basic_re_sub(self): self.assertEqual(re.sub("(?i)b+", "x", "bbbb BBBB"), 'x x') self.assertEqual(re.sub(r'\d+', self.bump_num, '08.2 -2 23x99y'), '9.3 -3 24x100y') self.assertEqual(re.sub(r'\d+', self.bump_num, '08.2 -2 23x99y', 3), '9.3 -3 23x99y') self.assertEqual(re.sub('.', lambda m: r"\n", 'x'), '\\n') self.assertEqual(re.sub('.', r"\n", 'x'), '\n') s = r"\1\1" self.assertEqual(re.sub('(.)', s, 'x'), 'xx') self.assertEqual(re.sub('(.)', re.escape(s), 'x'), s) self.assertEqual(re.sub('(.)', lambda m: s, 'x'), s) self.assertEqual(re.sub('(?P<a>x)', '\g<a>\g<a>', 'xx'), 'xxxx') self.assertEqual(re.sub('(?P<a>x)', '\g<a>\g<1>', 'xx'), 'xxxx') self.assertEqual(re.sub('(?P<unk>x)', '\g<unk>\g<unk>', 'xx'), 'xxxx') self.assertEqual(re.sub('(?P<unk>x)', '\g<1>\g<1>', 'xx'), 'xxxx') self.assertEqual(re.sub('a',r'\t\n\v\r\f\a\b\B\Z\a\A\w\W\s\S\d\D','a'), '\t\n\v\r\f\a\b\\B\\Z\a\\A\\w\\W\\s\\S\\d\\D') self.assertEqual(re.sub('a', '\t\n\v\r\f\a', 'a'), '\t\n\v\r\f\a') self.assertEqual(re.sub('a', '\t\n\v\r\f\a', 'a'), (chr(9)+chr(10)+chr(11)+chr(13)+chr(12)+chr(7))) self.assertEqual(re.sub('^\s*', 'X', 'test'), 'Xtest') def test_bug_449964(self): # fails for group followed by other escape self.assertEqual(re.sub(r'(?P<unk>x)', '\g<1>\g<1>\\b', 'xx'), 'xx\bxx\b') def test_bug_449000(self): # Test for sub() on escaped characters self.assertEqual(re.sub(r'\r\n', r'\n', 'abc\r\ndef\r\n'), 'abc\ndef\n') self.assertEqual(re.sub('\r\n', r'\n', 'abc\r\ndef\r\n'), 'abc\ndef\n') self.assertEqual(re.sub(r'\r\n', '\n', 'abc\r\ndef\r\n'), 'abc\ndef\n') self.assertEqual(re.sub('\r\n', '\n', 'abc\r\ndef\r\n'), 'abc\ndef\n') def test_bug_1661(self): # Verify that flags do not get silently ignored with compiled patterns pattern = re.compile('.') self.assertRaises(ValueError, re.match, pattern, 'A', re.I) self.assertRaises(ValueError, re.search, pattern, 'A', re.I) self.assertRaises(ValueError, re.findall, pattern, 'A', re.I) self.assertRaises(ValueError, re.compile, pattern, re.I) def test_bug_3629(self): # A regex that triggered a bug in the sre-code validator re.compile("(?P<quote>)(?(quote))") def test_sub_template_numeric_escape(self): # bug 776311 and friends self.assertEqual(re.sub('x', r'\0', 'x'), '\0') self.assertEqual(re.sub('x', r'\000', 'x'), '\000') self.assertEqual(re.sub('x', r'\001', 'x'), '\001') self.assertEqual(re.sub('x', r'\008', 'x'), '\0' + '8') self.assertEqual(re.sub('x', r'\009', 'x'), '\0' + '9') self.assertEqual(re.sub('x', r'\111', 'x'), '\111') self.assertEqual(re.sub('x', r'\117', 'x'), '\117') self.assertEqual(re.sub('x', r'\1111', 'x'), '\1111') self.assertEqual(re.sub('x', r'\1111', 'x'), '\111' + '1') self.assertEqual(re.sub('x', r'\00', 'x'), '\x00') self.assertEqual(re.sub('x', r'\07', 'x'), '\x07') self.assertEqual(re.sub('x', r'\08', 'x'), '\0' + '8') self.assertEqual(re.sub('x', r'\09', 'x'), '\0' + '9') self.assertEqual(re.sub('x', r'\0a', 'x'), '\0' + 'a') self.assertEqual(re.sub('x', r'\400', 'x'), '\0') self.assertEqual(re.sub('x', r'\777', 'x'), '\377') self.assertRaises(re.error, re.sub, 'x', r'\1', 'x') self.assertRaises(re.error, re.sub, 'x', r'\8', 'x') self.assertRaises(re.error, re.sub, 'x', r'\9', 'x') self.assertRaises(re.error, re.sub, 'x', r'\11', 'x') self.assertRaises(re.error, re.sub, 'x', r'\18', 'x') self.assertRaises(re.error, re.sub, 'x', r'\1a', 'x') self.assertRaises(re.error, re.sub, 'x', r'\90', 'x') self.assertRaises(re.error, re.sub, 'x', r'\99', 'x') self.assertRaises(re.error, re.sub, 'x', r'\118', 'x') # r'\11' + '8' self.assertRaises(re.error, re.sub, 'x', r'\11a', 'x') self.assertRaises(re.error, re.sub, 'x', r'\181', 'x') # r'\18' + '1' self.assertRaises(re.error, re.sub, 'x', r'\800', 'x') # r'\80' + '0' # in python2.3 (etc), these loop endlessly in sre_parser.py self.assertEqual(re.sub('(((((((((((x)))))))))))', r'\11', 'x'), 'x') self.assertEqual(re.sub('((((((((((y))))))))))(.)', r'\118', 'xyz'), 'xz8') self.assertEqual(re.sub('((((((((((y))))))))))(.)', r'\11a', 'xyz'), 'xza') def test_qualified_re_sub(self): self.assertEqual(re.sub('a', 'b', 'aaaaa'), 'bbbbb') self.assertEqual(re.sub('a', 'b', 'aaaaa', 1), 'baaaa') def test_bug_114660(self): self.assertEqual(re.sub(r'(\S)\s+(\S)', r'\1 \2', 'hello there'), 'hello there') def test_bug_462270(self): # Test for empty sub() behaviour, see SF bug #462270 self.assertEqual(re.sub('x*', '-', 'abxd'), '-a-b-d-') self.assertEqual(re.sub('x+', '-', 'abxd'), 'ab-d') def test_symbolic_groups(self): re.compile('(?P<a>x)(?P=a)(?(a)y)') re.compile('(?P<a1>x)(?P=a1)(?(a1)y)') self.assertRaises(re.error, re.compile, '(?P<a>)(?P<a>)') self.assertRaises(re.error, re.compile, '(?Px)') self.assertRaises(re.error, re.compile, '(?P=)') self.assertRaises(re.error, re.compile, '(?P=1)') self.assertRaises(re.error, re.compile, '(?P=a)') self.assertRaises(re.error, re.compile, '(?P=a1)') self.assertRaises(re.error, re.compile, '(?P=a.)') self.assertRaises(re.error, re.compile, '(?P<)') self.assertRaises(re.error, re.compile, '(?P<>)') self.assertRaises(re.error, re.compile, '(?P<1>)') self.assertRaises(re.error, re.compile, '(?P<a.>)') self.assertRaises(re.error, re.compile, '(?())') self.assertRaises(re.error, re.compile, '(?(a))') self.assertRaises(re.error, re.compile, '(?(1a))') self.assertRaises(re.error, re.compile, '(?(a.))') def test_symbolic_refs(self): self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g<a', 'xx') self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g<', 'xx') self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g', 'xx') self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g<a a>', 'xx') self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g<>', 'xx') self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g<1a1>', 'xx') self.assertRaises(IndexError, re.sub, '(?P<a>x)', '\g<ab>', 'xx') self.assertRaises(re.error, re.sub, '(?P<a>x)|(?P<b>y)', '\g<b>', 'xx') self.assertRaises(re.error, re.sub, '(?P<a>x)|(?P<b>y)', '\\2', 'xx') self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g<-1>', 'xx') def test_re_subn(self): self.assertEqual(re.subn("(?i)b+", "x", "bbbb BBBB"), ('x x', 2)) self.assertEqual(re.subn("b+", "x", "bbbb BBBB"), ('x BBBB', 1)) self.assertEqual(re.subn("b+", "x", "xyz"), ('xyz', 0)) self.assertEqual(re.subn("b*", "x", "xyz"), ('xxxyxzx', 4)) self.assertEqual(re.subn("b*", "x", "xyz", 2), ('xxxyz', 2)) def test_re_split(self): self.assertEqual(re.split(":", ":a:b::c"), ['', 'a', 'b', '', 'c']) self.assertEqual(re.split(":*", ":a:b::c"), ['', 'a', 'b', 'c']) self.assertEqual(re.split("(:*)", ":a:b::c"), ['', ':', 'a', ':', 'b', '::', 'c']) self.assertEqual(re.split("(?::*)", ":a:b::c"), ['', 'a', 'b', 'c']) self.assertEqual(re.split("(:)*", ":a:b::c"), ['', ':', 'a', ':', 'b', ':', 'c']) self.assertEqual(re.split("([b:]+)", ":a:b::c"), ['', ':', 'a', ':b::', 'c']) self.assertEqual(re.split("(b)|(:+)", ":a:b::c"), ['', None, ':', 'a', None, ':', '', 'b', None, '', None, '::', 'c']) self.assertEqual(re.split("(?:b)|(?::+)", ":a:b::c"), ['', 'a', '', '', 'c']) def test_qualified_re_split(self): self.assertEqual(re.split(":", ":a:b::c", 2), ['', 'a', 'b::c']) self.assertEqual(re.split(':', 'a:b:c:d', 2), ['a', 'b', 'c:d']) self.assertEqual(re.split("(:)", ":a:b::c", 2), ['', ':', 'a', ':', 'b::c']) self.assertEqual(re.split("(:*)", ":a:b::c", 2), ['', ':', 'a', ':', 'b::c']) def test_re_findall(self): self.assertEqual(re.findall(":+", "abc"), []) self.assertEqual(re.findall(":+", "a:b::c:::d"), [":", "::", ":::"]) self.assertEqual(re.findall("(:+)", "a:b::c:::d"), [":", "::", ":::"]) self.assertEqual(re.findall("(:)(:*)", "a:b::c:::d"), [(":", ""), (":", ":"), (":", "::")]) def test_bug_117612(self): self.assertEqual(re.findall(r"(a|(b))", "aba"), [("a", ""),("b", "b"),("a", "")]) def test_re_match(self): self.assertEqual(re.match('a', 'a').groups(), ()) self.assertEqual(re.match('(a)', 'a').groups(), ('a',)) self.assertEqual(re.match(r'(a)', 'a').group(0), 'a') self.assertEqual(re.match(r'(a)', 'a').group(1), 'a') self.assertEqual(re.match(r'(a)', 'a').group(1, 1), ('a', 'a')) pat = re.compile('((a)|(b))(c)?') self.assertEqual(pat.match('a').groups(), ('a', 'a', None, None)) self.assertEqual(pat.match('b').groups(), ('b', None, 'b', None)) self.assertEqual(pat.match('ac').groups(), ('a', 'a', None, 'c')) self.assertEqual(pat.match('bc').groups(), ('b', None, 'b', 'c')) self.assertEqual(pat.match('bc').groups(""), ('b', "", 'b', 'c')) # A single group m = re.match('(a)', 'a') self.assertEqual(m.group(0), 'a') self.assertEqual(m.group(0), 'a') self.assertEqual(m.group(1), 'a') self.assertEqual(m.group(1, 1), ('a', 'a')) pat = re.compile('(?:(?P<a1>a)|(?P<b2>b))(?P<c3>c)?') self.assertEqual(pat.match('a').group(1, 2, 3), ('a', None, None)) self.assertEqual(pat.match('b').group('a1', 'b2', 'c3'), (None, 'b', None)) self.assertEqual(pat.match('ac').group(1, 'b2', 3), ('a', None, 'c')) def test_re_groupref_exists(self): self.assertEqual(re.match('^(\()?([^()]+)(?(1)\))$', '(a)').groups(), ('(', 'a')) self.assertEqual(re.match('^(\()?([^()]+)(?(1)\))$', 'a').groups(), (None, 'a')) self.assertEqual(re.match('^(\()?([^()]+)(?(1)\))$', 'a)'), None) self.assertEqual(re.match('^(\()?([^()]+)(?(1)\))$', '(a'), None) self.assertEqual(re.match('^(?:(a)|c)((?(1)b|d))$', 'ab').groups(), ('a', 'b')) self.assertEqual(re.match('^(?:(a)|c)((?(1)b|d))$', 'cd').groups(), (None, 'd')) self.assertEqual(re.match('^(?:(a)|c)((?(1)|d))$', 'cd').groups(), (None, 'd')) self.assertEqual(re.match('^(?:(a)|c)((?(1)|d))$', 'a').groups(), ('a', '')) # Tests for bug #1177831: exercise groups other than the first group p = re.compile('(?P<g1>a)(?P<g2>b)?((?(g2)c|d))') self.assertEqual(p.match('abc').groups(), ('a', 'b', 'c')) self.assertEqual(p.match('ad').groups(), ('a', None, 'd')) self.assertEqual(p.match('abd'), None) self.assertEqual(p.match('ac'), None) def test_re_groupref(self): self.assertEqual(re.match(r'^(\|)?([^()]+)\1$', '|a|').groups(), ('|', 'a')) self.assertEqual(re.match(r'^(\|)?([^()]+)\1?$', 'a').groups(), (None, 'a')) self.assertEqual(re.match(r'^(\|)?([^()]+)\1$', 'a|'), None) self.assertEqual(re.match(r'^(\|)?([^()]+)\1$', '|a'), None) self.assertEqual(re.match(r'^(?:(a)|c)(\1)$', 'aa').groups(), ('a', 'a')) self.assertEqual(re.match(r'^(?:(a)|c)(\1)?$', 'c').groups(), (None, None)) def test_groupdict(self): self.assertEqual(re.match('(?P<first>first) (?P<second>second)', 'first second').groupdict(), {'first':'first', 'second':'second'}) def test_expand(self): self.assertEqual(re.match("(?P<first>first) (?P<second>second)", "first second") .expand(r"\2 \1 \g<second> \g<first>"), "second first second first") def test_repeat_minmax(self): self.assertEqual(re.match("^(\w){1}$", "abc"), None) self.assertEqual(re.match("^(\w){1}?$", "abc"), None) self.assertEqual(re.match("^(\w){1,2}$", "abc"), None) self.assertEqual(re.match("^(\w){1,2}?$", "abc"), None) self.assertEqual(re.match("^(\w){3}$", "abc").group(1), "c") self.assertEqual(re.match("^(\w){1,3}$", "abc").group(1), "c") self.assertEqual(re.match("^(\w){1,4}$", "abc").group(1), "c") self.assertEqual(re.match("^(\w){3,4}?$", "abc").group(1), "c") self.assertEqual(re.match("^(\w){3}?$", "abc").group(1), "c") self.assertEqual(re.match("^(\w){1,3}?$", "abc").group(1), "c") self.assertEqual(re.match("^(\w){1,4}?$", "abc").group(1), "c") self.assertEqual(re.match("^(\w){3,4}?$", "abc").group(1), "c") self.assertEqual(re.match("^x{1}$", "xxx"), None) self.assertEqual(re.match("^x{1}?$", "xxx"), None) self.assertEqual(re.match("^x{1,2}$", "xxx"), None) self.assertEqual(re.match("^x{1,2}?$", "xxx"), None) self.assertNotEqual(re.match("^x{3}$", "xxx"), None) self.assertNotEqual(re.match("^x{1,3}$", "xxx"), None) self.assertNotEqual(re.match("^x{1,4}$", "xxx"), None) self.assertNotEqual(re.match("^x{3,4}?$", "xxx"), None) self.assertNotEqual(re.match("^x{3}?$", "xxx"), None) self.assertNotEqual(re.match("^x{1,3}?$", "xxx"), None) self.assertNotEqual(re.match("^x{1,4}?$", "xxx"), None) self.assertNotEqual(re.match("^x{3,4}?$", "xxx"), None) self.assertEqual(re.match("^x{}$", "xxx"), None) self.assertNotEqual(re.match("^x{}$", "x{}"), None) def test_getattr(self): self.assertEqual(re.compile("(?i)(a)(b)").pattern, "(?i)(a)(b)") self.assertEqual(re.compile("(?i)(a)(b)").flags, re.I | re.U) self.assertEqual(re.compile("(?i)(a)(b)").groups, 2) self.assertEqual(re.compile("(?i)(a)(b)").groupindex, {}) self.assertEqual(re.compile("(?i)(?P<first>a)(?P<other>b)").groupindex, {'first': 1, 'other': 2}) self.assertEqual(re.match("(a)", "a").pos, 0) self.assertEqual(re.match("(a)", "a").endpos, 1) self.assertEqual(re.match("(a)", "a").string, "a") self.assertEqual(re.match("(a)", "a").regs, ((0, 1), (0, 1))) self.assertNotEqual(re.match("(a)", "a").re, None) def test_special_escapes(self): self.assertEqual(re.search(r"\b(b.)\b", "abcd abc bcd bx").group(1), "bx") self.assertEqual(re.search(r"\B(b.)\B", "abc bcd bc abxd").group(1), "bx") self.assertEqual(re.search(r"\b(b.)\b", "abcd abc bcd bx", re.LOCALE).group(1), "bx") self.assertEqual(re.search(r"\B(b.)\B", "abc bcd bc abxd", re.LOCALE).group(1), "bx") self.assertEqual(re.search(r"\b(b.)\b", "abcd abc bcd bx", re.UNICODE).group(1), "bx") self.assertEqual(re.search(r"\B(b.)\B", "abc bcd bc abxd", re.UNICODE).group(1), "bx") self.assertEqual(re.search(r"^abc$", "\nabc\n", re.M).group(0), "abc") self.assertEqual(re.search(r"^\Aabc\Z$", "abc", re.M).group(0), "abc") self.assertEqual(re.search(r"^\Aabc\Z$", "\nabc\n", re.M), None) self.assertEqual(re.search(r"\b(b.)\b", "abcd abc bcd bx").group(1), "bx") self.assertEqual(re.search(r"\B(b.)\B", "abc bcd bc abxd").group(1), "bx") self.assertEqual(re.search(r"^abc$", "\nabc\n", re.M).group(0), "abc") self.assertEqual(re.search(r"^\Aabc\Z$", "abc", re.M).group(0), "abc") self.assertEqual(re.search(r"^\Aabc\Z$", "\nabc\n", re.M), None) self.assertEqual(re.search(r"\d\D\w\W\s\S", "1aa! a").group(0), "1aa! a") self.assertEqual(re.search(r"\d\D\w\W\s\S", "1aa! a", re.LOCALE).group(0), "1aa! a") self.assertEqual(re.search(r"\d\D\w\W\s\S", "1aa! a", re.UNICODE).group(0), "1aa! a") def test_string_boundaries(self): # See http://bugs.python.org/issue10713 self.assertEqual(re.search(r"\b(abc)\b", "abc").group(1), "abc") # There's a word boundary at the start of a string. self.assertTrue(re.match(r"\b", "abc")) # A non-empty string includes a non-boundary zero-length match. self.assertTrue(re.search(r"\B", "abc")) # There is no non-boundary match at the start of a string. self.assertFalse(re.match(r"\B", "abc")) # However, an empty string contains no word boundaries, and also no # non-boundaries. self.assertEqual(re.search(r"\B", ""), None) # This one is questionable and different from the perlre behaviour, # but describes current behavior. self.assertEqual(re.search(r"\b", ""), None) # A single word-character string has two boundaries, but no # non-boundary gaps. self.assertEqual(len(re.findall(r"\b", "a")), 2) self.assertEqual(len(re.findall(r"\B", "a")), 0) # If there are no words, there are no boundaries self.assertEqual(len(re.findall(r"\b", " ")), 0) self.assertEqual(len(re.findall(r"\b", " ")), 0) # Can match around the whitespace. self.assertEqual(len(re.findall(r"\B", " ")), 2) def test_bigcharset(self): self.assertEqual(re.match("([\u2222\u2223])", "\u2222").group(1), "\u2222") self.assertEqual(re.match("([\u2222\u2223])", "\u2222", re.UNICODE).group(1), "\u2222") def test_big_codesize(self): # Issue #1160 r = re.compile('|'.join(('%d'%x for x in range(10000)))) self.assertIsNotNone(r.match('1000')) self.assertIsNotNone(r.match('9999')) def test_anyall(self): self.assertEqual(re.match("a.b", "a\nb", re.DOTALL).group(0), "a\nb") self.assertEqual(re.match("a.*b", "a\n\nb", re.DOTALL).group(0), "a\n\nb") def test_non_consuming(self): self.assertEqual(re.match("(a(?=\s[^a]))", "a b").group(1), "a") self.assertEqual(re.match("(a(?=\s[^a]*))", "a b").group(1), "a") self.assertEqual(re.match("(a(?=\s[abc]))", "a b").group(1), "a") self.assertEqual(re.match("(a(?=\s[abc]*))", "a bc").group(1), "a") self.assertEqual(re.match(r"(a)(?=\s\1)", "a a").group(1), "a") self.assertEqual(re.match(r"(a)(?=\s\1*)", "a aa").group(1), "a") self.assertEqual(re.match(r"(a)(?=\s(abc|a))", "a a").group(1), "a") self.assertEqual(re.match(r"(a(?!\s[^a]))", "a a").group(1), "a") self.assertEqual(re.match(r"(a(?!\s[abc]))", "a d").group(1), "a") self.assertEqual(re.match(r"(a)(?!\s\1)", "a b").group(1), "a") self.assertEqual(re.match(r"(a)(?!\s(abc|a))", "a b").group(1), "a") def test_ignore_case(self): self.assertEqual(re.match("abc", "ABC", re.I).group(0), "ABC") self.assertEqual(re.match("abc", "ABC", re.I).group(0), "ABC") self.assertEqual(re.match(r"(a\s[^a])", "a b", re.I).group(1), "a b") self.assertEqual(re.match(r"(a\s[^a]*)", "a bb", re.I).group(1), "a bb") self.assertEqual(re.match(r"(a\s[abc])", "a b", re.I).group(1), "a b") self.assertEqual(re.match(r"(a\s[abc]*)", "a bb", re.I).group(1), "a bb") self.assertEqual(re.match(r"((a)\s\2)", "a a", re.I).group(1), "a a") self.assertEqual(re.match(r"((a)\s\2*)", "a aa", re.I).group(1), "a aa") self.assertEqual(re.match(r"((a)\s(abc|a))", "a a", re.I).group(1), "a a") self.assertEqual(re.match(r"((a)\s(abc|a)*)", "a aa", re.I).group(1), "a aa") def test_category(self): self.assertEqual(re.match(r"(\s)", " ").group(1), " ") def test_getlower(self): import _sre self.assertEqual(_sre.getlower(ord('A'), 0), ord('a')) self.assertEqual(_sre.getlower(ord('A'), re.LOCALE), ord('a')) self.assertEqual(_sre.getlower(ord('A'), re.UNICODE), ord('a')) self.assertEqual(re.match("abc", "ABC", re.I).group(0), "ABC") self.assertEqual(re.match("abc", "ABC", re.I).group(0), "ABC") def test_not_literal(self): self.assertEqual(re.search("\s([^a])", " b").group(1), "b") self.assertEqual(re.search("\s([^a]*)", " bb").group(1), "bb") def test_search_coverage(self): self.assertEqual(re.search("\s(b)", " b").group(1), "b") self.assertEqual(re.search("a\s", "a ").group(0), "a ") def assertMatch(self, pattern, text, match=None, span=None, matcher=re.match): if match is None and span is None: # the pattern matches the whole text match = text span = (0, len(text)) elif match is None or span is None: raise ValueError('If match is not None, span should be specified ' '(and vice versa).') m = matcher(pattern, text) self.assertTrue(m) self.assertEqual(m.group(), match) self.assertEqual(m.span(), span) def test_re_escape(self): alnum_chars = string.ascii_letters + string.digits + '_' p = ''.join(chr(i) for i in range(256)) for c in p: if c in alnum_chars: self.assertEqual(re.escape(c), c) elif c == '\x00': self.assertEqual(re.escape(c), '\\000') else: self.assertEqual(re.escape(c), '\\' + c) self.assertMatch(re.escape(c), c) self.assertMatch(re.escape(p), p) def test_re_escape_byte(self): alnum_chars = (string.ascii_letters + string.digits + '_').encode('ascii') p = bytes(range(256)) for i in p: b = bytes([i]) if b in alnum_chars: self.assertEqual(re.escape(b), b) elif i == 0: self.assertEqual(re.escape(b), b'\\000') else: self.assertEqual(re.escape(b), b'\\' + b) self.assertMatch(re.escape(b), b) self.assertMatch(re.escape(p), p) def test_re_escape_non_ascii(self): s = 'xxx\u2620\u2620\u2620xxx' s_escaped = re.escape(s) self.assertEqual(s_escaped, 'xxx\\\u2620\\\u2620\\\u2620xxx') self.assertMatch(s_escaped, s) self.assertMatch('.%s+.' % re.escape('\u2620'), s, 'x\u2620\u2620\u2620x', (2, 7), re.search) def test_re_escape_non_ascii_bytes(self): b = 'y\u2620y\u2620y'.encode('utf-8') b_escaped = re.escape(b) self.assertEqual(b_escaped, b'y\\\xe2\\\x98\\\xa0y\\\xe2\\\x98\\\xa0y') self.assertMatch(b_escaped, b) res = re.findall(re.escape('\u2620'.encode('utf-8')), b) self.assertEqual(len(res), 2) def pickle_test(self, pickle): oldpat = re.compile('a(?:b|(c|e){1,2}?|d)+?(.)') s = pickle.dumps(oldpat) newpat = pickle.loads(s) self.assertEqual(oldpat, newpat) def test_constants(self): self.assertEqual(re.I, re.IGNORECASE) self.assertEqual(re.L, re.LOCALE) self.assertEqual(re.M, re.MULTILINE) self.assertEqual(re.S, re.DOTALL) self.assertEqual(re.X, re.VERBOSE) def test_flags(self): for flag in [re.I, re.M, re.X, re.S, re.L]: self.assertNotEqual(re.compile('^pattern$', flag), None) def test_sre_character_literals(self): for i in [0, 8, 16, 32, 64, 127, 128, 255, 256, 0xFFFF, 0x10000, 0x10FFFF]: if i < 256: self.assertIsNotNone(re.match(r"\%03o" % i, chr(i))) self.assertIsNotNone(re.match(r"\%03o0" % i, chr(i)+"0")) self.assertIsNotNone(re.match(r"\%03o8" % i, chr(i)+"8")) self.assertIsNotNone(re.match(r"\x%02x" % i, chr(i))) self.assertIsNotNone(re.match(r"\x%02x0" % i, chr(i)+"0")) self.assertIsNotNone(re.match(r"\x%02xz" % i, chr(i)+"z")) if i < 0x10000: self.assertIsNotNone(re.match(r"\u%04x" % i, chr(i))) self.assertIsNotNone(re.match(r"\u%04x0" % i, chr(i)+"0")) self.assertIsNotNone(re.match(r"\u%04xz" % i, chr(i)+"z")) self.assertIsNotNone(re.match(r"\U%08x" % i, chr(i))) self.assertIsNotNone(re.match(r"\U%08x0" % i, chr(i)+"0")) self.assertIsNotNone(re.match(r"\U%08xz" % i, chr(i)+"z")) self.assertIsNotNone(re.match(r"\0", "\000")) self.assertIsNotNone(re.match(r"\08", "\0008")) self.assertIsNotNone(re.match(r"\01", "\001")) self.assertIsNotNone(re.match(r"\018", "\0018")) self.assertIsNotNone(re.match(r"\567", chr(0o167))) self.assertRaises(re.error, re.match, r"\911", "") self.assertRaises(re.error, re.match, r"\x1", "") self.assertRaises(re.error, re.match, r"\x1z", "") self.assertRaises(re.error, re.match, r"\u123", "") self.assertRaises(re.error, re.match, r"\u123z", "") self.assertRaises(re.error, re.match, r"\U0001234", "") self.assertRaises(re.error, re.match, r"\U0001234z", "") self.assertRaises(re.error, re.match, r"\U00110000", "") def test_sre_character_class_literals(self): for i in [0, 8, 16, 32, 64, 127, 128, 255, 256, 0xFFFF, 0x10000, 0x10FFFF]: if i < 256: self.assertIsNotNone(re.match(r"[\%o]" % i, chr(i))) self.assertIsNotNone(re.match(r"[\%o8]" % i, chr(i))) self.assertIsNotNone(re.match(r"[\%03o]" % i, chr(i))) self.assertIsNotNone(re.match(r"[\%03o0]" % i, chr(i))) self.assertIsNotNone(re.match(r"[\%03o8]" % i, chr(i))) self.assertIsNotNone(re.match(r"[\x%02x]" % i, chr(i))) self.assertIsNotNone(re.match(r"[\x%02x0]" % i, chr(i))) self.assertIsNotNone(re.match(r"[\x%02xz]" % i, chr(i))) if i < 0x10000: self.assertIsNotNone(re.match(r"[\u%04x]" % i, chr(i))) self.assertIsNotNone(re.match(r"[\u%04x0]" % i, chr(i))) self.assertIsNotNone(re.match(r"[\u%04xz]" % i, chr(i))) self.assertIsNotNone(re.match(r"[\U%08x]" % i, chr(i))) self.assertIsNotNone(re.match(r"[\U%08x0]" % i, chr(i)+"0")) self.assertIsNotNone(re.match(r"[\U%08xz]" % i, chr(i)+"z")) self.assertIsNotNone(re.match(r"[\U0001d49c-\U0001d4b5]", "\U0001d49e")) self.assertRaises(re.error, re.match, r"[\911]", "") self.assertRaises(re.error, re.match, r"[\x1z]", "") self.assertRaises(re.error, re.match, r"[\u123z]", "") self.assertRaises(re.error, re.match, r"[\U0001234z]", "") self.assertRaises(re.error, re.match, r"[\U00110000]", "") def test_sre_byte_literals(self): for i in [0, 8, 16, 32, 64, 127, 128, 255]: self.assertIsNotNone(re.match((r"\%03o" % i).encode(), bytes([i]))) self.assertIsNotNone(re.match((r"\%03o0" % i).encode(), bytes([i])+b"0")) self.assertIsNotNone(re.match((r"\%03o8" % i).encode(), bytes([i])+b"8")) self.assertIsNotNone(re.match((r"\x%02x" % i).encode(), bytes([i]))) self.assertIsNotNone(re.match((r"\x%02x0" % i).encode(), bytes([i])+b"0")) self.assertIsNotNone(re.match((r"\x%02xz" % i).encode(), bytes([i])+b"z")) self.assertIsNotNone(re.match(br"\u", b'u')) self.assertIsNotNone(re.match(br"\U", b'U')) self.assertIsNotNone(re.match(br"\0", b"\000")) self.assertIsNotNone(re.match(br"\08", b"\0008")) self.assertIsNotNone(re.match(br"\01", b"\001")) self.assertIsNotNone(re.match(br"\018", b"\0018")) self.assertIsNotNone(re.match(br"\567", bytes([0o167]))) self.assertRaises(re.error, re.match, br"\911", b"") self.assertRaises(re.error, re.match, br"\x1", b"") self.assertRaises(re.error, re.match, br"\x1z", b"") def test_sre_byte_class_literals(self): for i in [0, 8, 16, 32, 64, 127, 128, 255]: self.assertIsNotNone(re.match((r"[\%o]" % i).encode(), bytes([i]))) self.assertIsNotNone(re.match((r"[\%o8]" % i).encode(), bytes([i]))) self.assertIsNotNone(re.match((r"[\%03o]" % i).encode(), bytes([i]))) self.assertIsNotNone(re.match((r"[\%03o0]" % i).encode(), bytes([i]))) self.assertIsNotNone(re.match((r"[\%03o8]" % i).encode(), bytes([i]))) self.assertIsNotNone(re.match((r"[\x%02x]" % i).encode(), bytes([i]))) self.assertIsNotNone(re.match((r"[\x%02x0]" % i).encode(), bytes([i]))) self.assertIsNotNone(re.match((r"[\x%02xz]" % i).encode(), bytes([i]))) self.assertIsNotNone(re.match(br"[\u]", b'u')) self.assertIsNotNone(re.match(br"[\U]", b'U')) self.assertRaises(re.error, re.match, br"[\911]", "") self.assertRaises(re.error, re.match, br"[\x1z]", "") def test_bug_113254(self): self.assertEqual(re.match(r'(a)|(b)', 'b').start(1), -1) self.assertEqual(re.match(r'(a)|(b)', 'b').end(1), -1) self.assertEqual(re.match(r'(a)|(b)', 'b').span(1), (-1, -1)) def test_bug_527371(self): # bug described in patches 527371/672491 self.assertEqual(re.match(r'(a)?a','a').lastindex, None) self.assertEqual(re.match(r'(a)(b)?b','ab').lastindex, 1) self.assertEqual(re.match(r'(?P<a>a)(?P<b>b)?b','ab').lastgroup, 'a') self.assertEqual(re.match("(?P<a>a(b))", "ab").lastgroup, 'a') self.assertEqual(re.match("((a))", "a").lastindex, 1) def test_bug_545855(self): # bug 545855 -- This pattern failed to cause a compile error as it # should, instead provoking a TypeError. self.assertRaises(re.error, re.compile, 'foo[a-') def test_bug_418626(self): # bugs 418626 at al. -- Testing Greg Chapman's addition of op code # SRE_OP_MIN_REPEAT_ONE for eliminating recursion on simple uses of # pattern '*?' on a long string. self.assertEqual(re.match('.*?c', 10000*'ab'+'cd').end(0), 20001) self.assertEqual(re.match('.*?cd', 5000*'ab'+'c'+5000*'ab'+'cde').end(0), 20003) self.assertEqual(re.match('.*?cd', 20000*'abc'+'de').end(0), 60001) # non-simple '*?' still used to hit the recursion limit, before the # non-recursive scheme was implemented. self.assertEqual(re.search('(a|b)*?c', 10000*'ab'+'cd').end(0), 20001) def test_bug_612074(self): pat="["+re.escape("\u2039")+"]" self.assertEqual(re.compile(pat) and 1, 1) def test_stack_overflow(self): # nasty cases that used to overflow the straightforward recursive # implementation of repeated groups. self.assertEqual(re.match('(x)*', 50000*'x').group(1), 'x') self.assertEqual(re.match('(x)*y', 50000*'x'+'y').group(1), 'x') self.assertEqual(re.match('(x)*?y', 50000*'x'+'y').group(1), 'x') def test_unlimited_zero_width_repeat(self): # Issue #9669 self.assertIsNone(re.match(r'(?:a?)*y', 'z')) self.assertIsNone(re.match(r'(?:a?)+y', 'z')) self.assertIsNone(re.match(r'(?:a?){2,}y', 'z')) self.assertIsNone(re.match(r'(?:a?)*?y', 'z')) self.assertIsNone(re.match(r'(?:a?)+?y', 'z')) self.assertIsNone(re.match(r'(?:a?){2,}?y', 'z')) def test_scanner(self): def s_ident(scanner, token): return token def s_operator(scanner, token): return "op%s" % token def s_float(scanner, token): return float(token) def s_int(scanner, token): return int(token) scanner = Scanner([ (r"[a-zA-Z_]\w*", s_ident), (r"\d+\.\d*", s_float), (r"\d+", s_int), (r"=|\+|-|\*|/", s_operator), (r"\s+", None), ]) self.assertNotEqual(scanner.scanner.scanner("").pattern, None) self.assertEqual(scanner.scan("sum = 3*foo + 312.50 + bar"), (['sum', 'op=', 3, 'op*', 'foo', 'op+', 312.5, 'op+', 'bar'], '')) def test_bug_448951(self): # bug 448951 (similar to 429357, but with single char match) # (Also test greedy matches.) for op in '','?','*': self.assertEqual(re.match(r'((.%s):)?z'%op, 'z').groups(), (None, None)) self.assertEqual(re.match(r'((.%s):)?z'%op, 'a:z').groups(), ('a:', 'a')) def test_bug_725106(self): # capturing groups in alternatives in repeats self.assertEqual(re.match('^((a)|b)*', 'abc').groups(), ('b', 'a')) self.assertEqual(re.match('^(([ab])|c)*', 'abc').groups(), ('c', 'b')) self.assertEqual(re.match('^((d)|[ab])*', 'abc').groups(), ('b', None)) self.assertEqual(re.match('^((a)c|[ab])*', 'abc').groups(), ('b', None)) self.assertEqual(re.match('^((a)|b)*?c', 'abc').groups(), ('b', 'a')) self.assertEqual(re.match('^(([ab])|c)*?d', 'abcd').groups(), ('c', 'b')) self.assertEqual(re.match('^((d)|[ab])*?c', 'abc').groups(), ('b', None)) self.assertEqual(re.match('^((a)c|[ab])*?c', 'abc').groups(), ('b', None)) def test_bug_725149(self): # mark_stack_base restoring before restoring marks self.assertEqual(re.match('(a)(?:(?=(b)*)c)*', 'abb').groups(), ('a', None)) self.assertEqual(re.match('(a)((?!(b)*))*', 'abb').groups(), ('a', None, None)) def test_bug_764548(self): # bug 764548, re.compile() barfs on str/unicode subclasses class my_unicode(str): pass pat = re.compile(my_unicode("abc")) self.assertEqual(pat.match("xyz"), None) def test_finditer(self): iter = re.finditer(r":+", "a:b::c:::d") self.assertEqual([item.group(0) for item in iter], [":", "::", ":::"]) pat = re.compile(r":+") iter = pat.finditer("a:b::c:::d", 1, 10) self.assertEqual([item.group(0) for item in iter], [":", "::", ":::"]) pat = re.compile(r":+") iter = pat.finditer("a:b::c:::d", pos=1, endpos=10) self.assertEqual([item.group(0) for item in iter], [":", "::", ":::"]) pat = re.compile(r":+") iter = pat.finditer("a:b::c:::d", endpos=10, pos=1) self.assertEqual([item.group(0) for item in iter], [":", "::", ":::"]) pat = re.compile(r":+") iter = pat.finditer("a:b::c:::d", pos=3, endpos=8) self.assertEqual([item.group(0) for item in iter], ["::", "::"]) def test_bug_926075(self): self.assertTrue(re.compile('bug_926075') is not re.compile(b'bug_926075')) def test_bug_931848(self): pattern = eval('"[\u002E\u3002\uFF0E\uFF61]"') self.assertEqual(re.compile(pattern).split("a.b.c"), ['a','b','c']) def test_bug_581080(self): iter = re.finditer(r"\s", "a b") self.assertEqual(next(iter).span(), (1,2)) self.assertRaises(StopIteration, next, iter) scanner = re.compile(r"\s").scanner("a b") self.assertEqual(scanner.search().span(), (1, 2)) self.assertEqual(scanner.search(), None) def test_bug_817234(self): iter = re.finditer(r".*", "asdf") self.assertEqual(next(iter).span(), (0, 4)) self.assertEqual(next(iter).span(), (4, 4)) self.assertRaises(StopIteration, next, iter) def test_bug_6561(self): # '\d' should match characters in Unicode category 'Nd' # (Number, Decimal Digit), but not those in 'Nl' (Number, # Letter) or 'No' (Number, Other). decimal_digits = [ '\u0037', # '\N{DIGIT SEVEN}', category 'Nd' '\u0e58', # '\N{THAI DIGIT SIX}', category 'Nd' '\uff10', # '\N{FULLWIDTH DIGIT ZERO}', category 'Nd' ] for x in decimal_digits: self.assertEqual(re.match('^\d$', x).group(0), x) not_decimal_digits = [ '\u2165', # '\N{ROMAN NUMERAL SIX}', category 'Nl' '\u3039', # '\N{HANGZHOU NUMERAL TWENTY}', category 'Nl' '\u2082', # '\N{SUBSCRIPT TWO}', category 'No' '\u32b4', # '\N{CIRCLED NUMBER THIRTY NINE}', category 'No' ] for x in not_decimal_digits: self.assertIsNone(re.match('^\d$', x)) def test_empty_array(self): # SF buf 1647541 import array for typecode in 'bBuhHiIlLfd': a = array.array(typecode) self.assertEqual(re.compile(b"bla").match(a), None) self.assertEqual(re.compile(b"").match(a).groups(), ()) def test_inline_flags(self): # Bug #1700 upper_char = chr(0x1ea0) # Latin Capital Letter A with Dot Bellow lower_char = chr(0x1ea1) # Latin Small Letter A with Dot Bellow p = re.compile(upper_char, re.I | re.U) q = p.match(lower_char) self.assertNotEqual(q, None) p = re.compile(lower_char, re.I | re.U) q = p.match(upper_char) self.assertNotEqual(q, None) p = re.compile('(?i)' + upper_char, re.U) q = p.match(lower_char) self.assertNotEqual(q, None) p = re.compile('(?i)' + lower_char, re.U) q = p.match(upper_char) self.assertNotEqual(q, None) p = re.compile('(?iu)' + upper_char) q = p.match(lower_char) self.assertNotEqual(q, None) p = re.compile('(?iu)' + lower_char) q = p.match(upper_char) self.assertNotEqual(q, None) def test_dollar_matches_twice(self): "$ matches the end of string, and just before the terminating \n" pattern = re.compile('$') self.assertEqual(pattern.sub('#', 'a\nb\n'), 'a\nb#\n#') self.assertEqual(pattern.sub('#', 'a\nb\nc'), 'a\nb\nc#') self.assertEqual(pattern.sub('#', '\n'), '#\n#') pattern = re.compile('$', re.MULTILINE) self.assertEqual(pattern.sub('#', 'a\nb\n' ), 'a#\nb#\n#' ) self.assertEqual(pattern.sub('#', 'a\nb\nc'), 'a#\nb#\nc#') self.assertEqual(pattern.sub('#', '\n'), '#\n#') def test_bytes_str_mixing(self): # Mixing str and bytes is disallowed pat = re.compile('.') bpat = re.compile(b'.') self.assertRaises(TypeError, pat.match, b'b') self.assertRaises(TypeError, bpat.match, 'b') self.assertRaises(TypeError, pat.sub, b'b', 'c') self.assertRaises(TypeError, pat.sub, 'b', b'c') self.assertRaises(TypeError, pat.sub, b'b', b'c') self.assertRaises(TypeError, bpat.sub, b'b', 'c') self.assertRaises(TypeError, bpat.sub, 'b', b'c') self.assertRaises(TypeError, bpat.sub, 'b', 'c') def test_ascii_and_unicode_flag(self): # String patterns for flags in (0, re.UNICODE): pat = re.compile('\xc0', flags | re.IGNORECASE) self.assertNotEqual(pat.match('\xe0'), None) pat = re.compile('\w', flags) self.assertNotEqual(pat.match('\xe0'), None) pat = re.compile('\xc0', re.ASCII | re.IGNORECASE) self.assertEqual(pat.match('\xe0'), None) pat = re.compile('(?a)\xc0', re.IGNORECASE) self.assertEqual(pat.match('\xe0'), None) pat = re.compile('\w', re.ASCII) self.assertEqual(pat.match('\xe0'), None) pat = re.compile('(?a)\w') self.assertEqual(pat.match('\xe0'), None) # Bytes patterns for flags in (0, re.ASCII): pat = re.compile(b'\xc0', re.IGNORECASE) self.assertEqual(pat.match(b'\xe0'), None) pat = re.compile(b'\w') self.assertEqual(pat.match(b'\xe0'), None) # Incompatibilities self.assertRaises(ValueError, re.compile, b'\w', re.UNICODE) self.assertRaises(ValueError, re.compile, b'(?u)\w') self.assertRaises(ValueError, re.compile, '\w', re.UNICODE | re.ASCII) self.assertRaises(ValueError, re.compile, '(?u)\w', re.ASCII) self.assertRaises(ValueError, re.compile, '(?a)\w', re.UNICODE) self.assertRaises(ValueError, re.compile, '(?au)\w') def test_bug_6509(self): # Replacement strings of both types must parse properly. # all strings pat = re.compile('a(\w)') self.assertEqual(pat.sub('b\\1', 'ac'), 'bc') pat = re.compile('a(.)') self.assertEqual(pat.sub('b\\1', 'a\u1234'), 'b\u1234') pat = re.compile('..') self.assertEqual(pat.sub(lambda m: 'str', 'a5'), 'str') # all bytes pat = re.compile(b'a(\w)') self.assertEqual(pat.sub(b'b\\1', b'ac'), b'bc') pat = re.compile(b'a(.)') self.assertEqual(pat.sub(b'b\\1', b'a\xCD'), b'b\xCD') pat = re.compile(b'..') self.assertEqual(pat.sub(lambda m: b'bytes', b'a5'), b'bytes') def test_dealloc(self): # issue 3299: check for segfault in debug build import _sre # the overflow limit is different on wide and narrow builds and it # depends on the definition of SRE_CODE (see sre.h). # 2**128 should be big enough to overflow on both. For smaller values # a RuntimeError is raised instead of OverflowError. long_overflow = 2**128 self.assertRaises(TypeError, re.finditer, "a", {}) self.assertRaises(OverflowError, _sre.compile, "abc", 0, [long_overflow]) self.assertRaises(TypeError, _sre.compile, {}, 0, []) def test_search_dot_unicode(self): self.assertIsNotNone(re.search("123.*-", '123abc-')) self.assertIsNotNone(re.search("123.*-", '123\xe9-')) self.assertIsNotNone(re.search("123.*-", '123\u20ac-')) self.assertIsNotNone(re.search("123.*-", '123\U0010ffff-')) self.assertIsNotNone(re.search("123.*-", '123\xe9\u20ac\U0010ffff-')) def test_compile(self): # Test return value when given string and pattern as parameter pattern = re.compile('random pattern') self.assertIsInstance(pattern, re._pattern_type) same_pattern = re.compile(pattern) self.assertIsInstance(same_pattern, re._pattern_type) self.assertIs(same_pattern, pattern) # Test behaviour when not given a string or pattern as parameter self.assertRaises(TypeError, re.compile, 0) def test_bug_13899(self): # Issue #13899: re pattern r"[\A]" should work like "A" but matches # nothing. Ditto B and Z. self.assertEqual(re.findall(r'[\A\B\b\C\Z]', 'AB\bCZ'), ['A', 'B', '\b', 'C', 'Z']) @bigmemtest(size=_2G, memuse=1) def test_large_search(self, size): # Issue #10182: indices were 32-bit-truncated. s = 'a' * size m = re.search('$', s) self.assertIsNotNone(m) self.assertEqual(m.start(), size) self.assertEqual(m.end(), size) # The huge memuse is because of re.sub() using a list and a join() # to create the replacement result. @bigmemtest(size=_2G, memuse=16 + 2) def test_large_subn(self, size): # Issue #10182: indices were 32-bit-truncated. s = 'a' * size r, n = re.subn('', '', s) self.assertEqual(r, s) self.assertEqual(n, size + 1) def test_bug_16688(self): # Issue 16688: Backreferences make case-insensitive regex fail on # non-ASCII strings. self.assertEqual(re.findall(r"(?i)(a)\1", "aa \u0100"), ['a']) self.assertEqual(re.match(r"(?s).{1,3}", "\u0100\u0100").span(), (0, 2)) def test_repeat_minmax_overflow(self): # Issue #13169 string = "x" * 100000 self.assertEqual(re.match(r".{65535}", string).span(), (0, 65535)) self.assertEqual(re.match(r".{,65535}", string).span(), (0, 65535)) self.assertEqual(re.match(r".{65535,}?", string).span(), (0, 65535)) self.assertEqual(re.match(r".{65536}", string).span(), (0, 65536)) self.assertEqual(re.match(r".{,65536}", string).span(), (0, 65536)) self.assertEqual(re.match(r".{65536,}?", string).span(), (0, 65536)) # 2**128 should be big enough to overflow both SRE_CODE and Py_ssize_t. self.assertRaises(OverflowError, re.compile, r".{%d}" % 2**128) self.assertRaises(OverflowError, re.compile, r".{,%d}" % 2**128) self.assertRaises(OverflowError, re.compile, r".{%d,}?" % 2**128) self.assertRaises(OverflowError, re.compile, r".{%d,%d}" % (2**129, 2**128)) @cpython_only def test_repeat_minmax_overflow_maxrepeat(self): try: from _sre import MAXREPEAT except ImportError: self.skipTest('requires _sre.MAXREPEAT constant') string = "x" * 100000 self.assertIsNone(re.match(r".{%d}" % (MAXREPEAT - 1), string)) self.assertEqual(re.match(r".{,%d}" % (MAXREPEAT - 1), string).span(), (0, 100000)) self.assertIsNone(re.match(r".{%d,}?" % (MAXREPEAT - 1), string)) self.assertRaises(OverflowError, re.compile, r".{%d}" % MAXREPEAT) self.assertRaises(OverflowError, re.compile, r".{,%d}" % MAXREPEAT) self.assertRaises(OverflowError, re.compile, r".{%d,}?" % MAXREPEAT) def run_re_tests(): from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR if verbose: print('Running re_tests test suite') else: # To save time, only run the first and last 10 tests #tests = tests[:10] + tests[-10:] pass for t in tests: sys.stdout.flush() pattern = s = outcome = repl = expected = None if len(t) == 5: pattern, s, outcome, repl, expected = t elif len(t) == 3: pattern, s, outcome = t else: raise ValueError('Test tuples should have 3 or 5 fields', t) try: obj = re.compile(pattern) except re.error: if outcome == SYNTAX_ERROR: pass # Expected a syntax error else: print('=== Syntax error:', t) except KeyboardInterrupt: raise KeyboardInterrupt except: print('*** Unexpected error ***', t) if verbose: traceback.print_exc(file=sys.stdout) else: try: result = obj.search(s) except re.error as msg: print('=== Unexpected exception', t, repr(msg)) if outcome == SYNTAX_ERROR: # This should have been a syntax error; forget it. pass elif outcome == FAIL: if result is None: pass # No match, as expected else: print('=== Succeeded incorrectly', t) elif outcome == SUCCEED: if result is not None: # Matched, as expected, so now we compute the # result string and compare it to our expected result. start, end = result.span(0) vardict={'found': result.group(0), 'groups': result.group(), 'flags': result.re.flags} for i in range(1, 100): try: gi = result.group(i) # Special hack because else the string concat fails: if gi is None: gi = "None" except IndexError: gi = "Error" vardict['g%d' % i] = gi for i in result.re.groupindex.keys(): try: gi = result.group(i) if gi is None: gi = "None" except IndexError: gi = "Error" vardict[i] = gi repl = eval(repl, vardict) if repl != expected: print('=== grouping error', t, end=' ') print(repr(repl) + ' should be ' + repr(expected)) else: print('=== Failed incorrectly', t) # Try the match with both pattern and string converted to # bytes, and check that it still succeeds. try: bpat = bytes(pattern, "ascii") bs = bytes(s, "ascii") except UnicodeEncodeError: # skip non-ascii tests pass else: try: bpat = re.compile(bpat) except Exception: print('=== Fails on bytes pattern compile', t) if verbose: traceback.print_exc(file=sys.stdout) else: bytes_result = bpat.search(bs) if bytes_result is None: print('=== Fails on bytes pattern match', t) # Try the match with the search area limited to the extent # of the match and see if it still succeeds. \B will # break (because it won't match at the end or start of a # string), so we'll ignore patterns that feature it. if pattern[:2] != '\\B' and pattern[-2:] != '\\B' \ and result is not None: obj = re.compile(pattern) result = obj.search(s, result.start(0), result.end(0) + 1) if result is None: print('=== Failed on range-limited match', t) # Try the match with IGNORECASE enabled, and check that it # still succeeds. obj = re.compile(pattern, re.IGNORECASE) result = obj.search(s) if result is None: print('=== Fails on case-insensitive match', t) # Try the match with LOCALE enabled, and check that it # still succeeds. if '(?u)' not in pattern: obj = re.compile(pattern, re.LOCALE) result = obj.search(s) if result is None: print('=== Fails on locale-sensitive match', t) # Try the match with UNICODE locale enabled, and check # that it still succeeds. obj = re.compile(pattern, re.UNICODE) result = obj.search(s) if result is None: print('=== Fails on unicode-sensitive match', t) def test_main(): run_unittest(ReTests) run_re_tests() if __name__ == "__main__": test_main()
mancoast/CPythonPyc_test
fail/331_test_re.py
Python
gpl-3.0
54,426
0.002536
#/bin/env/python A=[3,4,5,5,2] M=6 def solution(M, A) : n=len(A) total = 0 for back in xrange(n) : front = back while front < n and A[front] not in A[back:front] : total += 1 front += 1 if total >= 1000000000 : return 1000000000 return total print solution(M, A)
ffakhraei/pProj
python/codility/ch15/countDistinctSlices.py
Python
gpl-3.0
350
0.04
"""Contain common module fields.""" # pylint: disable=too-many-public-methods from __future__ import absolute_import import re from django.db import models from django.core.exceptions import ValidationError class NameField(models.CharField): """Item name string field. This field is limited to 64 characters and contains the name(string). Good examples: * "name_lastname" * "name@lasrname" * 64 characters name Bad examples: * 65 characters name """ MAX_LEN = 150 def __init__(self, max_length=MAX_LEN, *args, **kwargs): super(NameField, self).__init__(*args, max_length=max_length, **kwargs) class DynamicIPAddressField(models.CharField): """DNS name or IP address.""" MAX_LEN = 64 def __init__(self, max_length=MAX_LEN, *args, **kwargs): super(DynamicIPAddressField, self).__init__(*args, max_length=max_length, **kwargs) class MACAddressField(models.CharField): """MAC address field.""" MAX_LEN = 17 # enables writing exactly 16 characters MAC_ADDRESS_REGEX = '(([0-9a-fA-F]{2}):){5}[0-9a-fA-F]{2}' def __init__(self, max_length=MAX_LEN, *args, **kwargs): super(MACAddressField, self).__init__(*args, max_length=max_length, **kwargs) def validate(self, value, model_instance): """Validate that the input value is a MAC address.""" super(MACAddressField, self).validate(value, model_instance) if re.match(self.MAC_ADDRESS_REGEX, value) is None: raise ValidationError('The input MAC address does not match the ' 'pattern of a MAC address') class PathField(models.CharField): r"""File-system path string field. This field is limited to 200 characters and contains string path split by slashes or backslashes. Good examples: * "/mnt/home/code/a.txt" * "/./a" * "c:\\windows\\temp" Bad examples: * "//mnt//@%$2" * "c:\;" """ MAX_LEN = 200 def __init__(self, max_length=MAX_LEN, *args, **kwargs): super(PathField, self).__init__(*args, max_length=max_length, **kwargs) class VersionField(models.CharField): """Item version string field. This field is limited to 10 characters and contains numbers and characters separated by dots. Good examples: * "4.12F" * "1.1423" Bad examples: * "4,12F" * "1/1423" """ MAX_LEN = 10 def __init__(self, max_length=MAX_LEN, *args, **kwargs): super(VersionField, self).__init__(*args, max_length=max_length, **kwargs) class PortField(models.PositiveSmallIntegerField): """Port number field (for IP connections).""" pass
gregoil/rotest
src/rotest/common/django_utils/fields.py
Python
mit
2,999
0
"""Flow based node and edge disjoint paths.""" import networkx as nx from networkx.exception import NetworkXNoPath # Define the default maximum flow function to use for the undelying # maximum flow computations from networkx.algorithms.flow import edmonds_karp from networkx.algorithms.flow import preflow_push from networkx.algorithms.flow import shortest_augmenting_path default_flow_func = edmonds_karp # Functions to build auxiliary data structures. from .utils import build_auxiliary_node_connectivity from .utils import build_auxiliary_edge_connectivity from itertools import filterfalse as _filterfalse __all__ = [ "edge_disjoint_paths", "node_disjoint_paths", ] def edge_disjoint_paths( G, s, t, flow_func=None, cutoff=None, auxiliary=None, residual=None ): """Returns the edges disjoint paths between source and target. Edge disjoint paths are paths that do not share any edge. The number of edge disjoint paths between source and target is equal to their edge connectivity. Parameters ---------- G : NetworkX graph s : node Source node for the flow. t : node Sink node for the flow. flow_func : function A function for computing the maximum flow among a pair of nodes. The function has to accept at least three parameters: a Digraph, a source node, and a target node. And return a residual network that follows NetworkX conventions (see :meth:`maximum_flow` for details). If flow_func is None, the default maximum flow function (:meth:`edmonds_karp`) is used. The choice of the default function may change from version to version and should not be relied on. Default value: None. cutoff : int Maximum number of paths to yield. Some of the maximum flow algorithms, such as :meth:`edmonds_karp` (the default) and :meth:`shortest_augmenting_path` support the cutoff parameter, and will terminate when the flow value reaches or exceeds the cutoff. Other algorithms will ignore this parameter. Default value: None. auxiliary : NetworkX DiGraph Auxiliary digraph to compute flow based edge connectivity. It has to have a graph attribute called mapping with a dictionary mapping node names in G and in the auxiliary digraph. If provided it will be reused instead of recreated. Default value: None. residual : NetworkX DiGraph Residual network to compute maximum flow. If provided it will be reused instead of recreated. Default value: None. Returns ------- paths : generator A generator of edge independent paths. Raises ------ NetworkXNoPath If there is no path between source and target. NetworkXError If source or target are not in the graph G. See also -------- :meth:`node_disjoint_paths` :meth:`edge_connectivity` :meth:`maximum_flow` :meth:`edmonds_karp` :meth:`preflow_push` :meth:`shortest_augmenting_path` Examples -------- We use in this example the platonic icosahedral graph, which has node edge connectivity 5, thus there are 5 edge disjoint paths between any pair of nodes. >>> G = nx.icosahedral_graph() >>> len(list(nx.edge_disjoint_paths(G, 0, 6))) 5 If you need to compute edge disjoint paths on several pairs of nodes in the same graph, it is recommended that you reuse the data structures that NetworkX uses in the computation: the auxiliary digraph for edge connectivity, and the residual network for the underlying maximum flow computation. Example of how to compute edge disjoint paths among all pairs of nodes of the platonic icosahedral graph reusing the data structures. >>> import itertools >>> # You also have to explicitly import the function for >>> # building the auxiliary digraph from the connectivity package >>> from networkx.algorithms.connectivity import ( ... build_auxiliary_edge_connectivity) >>> H = build_auxiliary_edge_connectivity(G) >>> # And the function for building the residual network from the >>> # flow package >>> from networkx.algorithms.flow import build_residual_network >>> # Note that the auxiliary digraph has an edge attribute named capacity >>> R = build_residual_network(H, 'capacity') >>> result = {n: {} for n in G} >>> # Reuse the auxiliary digraph and the residual network by passing them >>> # as arguments >>> for u, v in itertools.combinations(G, 2): ... k = len(list(nx.edge_disjoint_paths(G, u, v, auxiliary=H, residual=R))) ... result[u][v] = k >>> all(result[u][v] == 5 for u, v in itertools.combinations(G, 2)) True You can also use alternative flow algorithms for computing edge disjoint paths. For instance, in dense networks the algorithm :meth:`shortest_augmenting_path` will usually perform better than the default :meth:`edmonds_karp` which is faster for sparse networks with highly skewed degree distributions. Alternative flow functions have to be explicitly imported from the flow package. >>> from networkx.algorithms.flow import shortest_augmenting_path >>> len(list(nx.edge_disjoint_paths(G, 0, 6, flow_func=shortest_augmenting_path))) 5 Notes ----- This is a flow based implementation of edge disjoint paths. We compute the maximum flow between source and target on an auxiliary directed network. The saturated edges in the residual network after running the maximum flow algorithm correspond to edge disjoint paths between source and target in the original network. This function handles both directed and undirected graphs, and can use all flow algorithms from NetworkX flow package. """ if s not in G: raise nx.NetworkXError(f"node {s} not in graph") if t not in G: raise nx.NetworkXError(f"node {t} not in graph") if flow_func is None: flow_func = default_flow_func if auxiliary is None: H = build_auxiliary_edge_connectivity(G) else: H = auxiliary # Maximum possible edge disjoint paths possible = min(H.out_degree(s), H.in_degree(t)) if not possible: raise NetworkXNoPath if cutoff is None: cutoff = possible else: cutoff = min(cutoff, possible) # Compute maximum flow between source and target. Flow functions in # NetworkX return a residual network. kwargs = dict( capacity="capacity", residual=residual, cutoff=cutoff, value_only=True ) if flow_func is preflow_push: del kwargs["cutoff"] if flow_func is shortest_augmenting_path: kwargs["two_phase"] = True R = flow_func(H, s, t, **kwargs) if R.graph["flow_value"] == 0: raise NetworkXNoPath # Saturated edges in the residual network form the edge disjoint paths # between source and target cutset = [ (u, v) for u, v, d in R.edges(data=True) if d["capacity"] == d["flow"] and d["flow"] > 0 ] # This is equivalent of what flow.utils.build_flow_dict returns, but # only for the nodes with saturated edges and without reporting 0 flows. flow_dict = {n: {} for edge in cutset for n in edge} for u, v in cutset: flow_dict[u][v] = 1 # Rebuild the edge disjoint paths from the flow dictionary. paths_found = 0 for v in list(flow_dict[s]): if paths_found >= cutoff: # preflow_push does not support cutoff: we have to # keep track of the paths founds and stop at cutoff. break path = [s] if v == t: path.append(v) yield path continue u = v while u != t: path.append(u) try: u, _ = flow_dict[u].popitem() except KeyError: break else: path.append(t) yield path paths_found += 1 def node_disjoint_paths( G, s, t, flow_func=None, cutoff=None, auxiliary=None, residual=None ): r"""Computes node disjoint paths between source and target. Node disjoint paths are paths that only share their first and last nodes. The number of node independent paths between two nodes is equal to their local node connectivity. Parameters ---------- G : NetworkX graph s : node Source node. t : node Target node. flow_func : function A function for computing the maximum flow among a pair of nodes. The function has to accept at least three parameters: a Digraph, a source node, and a target node. And return a residual network that follows NetworkX conventions (see :meth:`maximum_flow` for details). If flow_func is None, the default maximum flow function (:meth:`edmonds_karp`) is used. See below for details. The choice of the default function may change from version to version and should not be relied on. Default value: None. cutoff : int Maximum number of paths to yield. Some of the maximum flow algorithms, such as :meth:`edmonds_karp` (the default) and :meth:`shortest_augmenting_path` support the cutoff parameter, and will terminate when the flow value reaches or exceeds the cutoff. Other algorithms will ignore this parameter. Default value: None. auxiliary : NetworkX DiGraph Auxiliary digraph to compute flow based node connectivity. It has to have a graph attribute called mapping with a dictionary mapping node names in G and in the auxiliary digraph. If provided it will be reused instead of recreated. Default value: None. residual : NetworkX DiGraph Residual network to compute maximum flow. If provided it will be reused instead of recreated. Default value: None. Returns ------- paths : generator Generator of node disjoint paths. Raises ------ NetworkXNoPath If there is no path between source and target. NetworkXError If source or target are not in the graph G. Examples -------- We use in this example the platonic icosahedral graph, which has node node connectivity 5, thus there are 5 node disjoint paths between any pair of non neighbor nodes. >>> G = nx.icosahedral_graph() >>> len(list(nx.node_disjoint_paths(G, 0, 6))) 5 If you need to compute node disjoint paths between several pairs of nodes in the same graph, it is recommended that you reuse the data structures that NetworkX uses in the computation: the auxiliary digraph for node connectivity and node cuts, and the residual network for the underlying maximum flow computation. Example of how to compute node disjoint paths reusing the data structures: >>> # You also have to explicitly import the function for >>> # building the auxiliary digraph from the connectivity package >>> from networkx.algorithms.connectivity import ( ... build_auxiliary_node_connectivity) >>> H = build_auxiliary_node_connectivity(G) >>> # And the function for building the residual network from the >>> # flow package >>> from networkx.algorithms.flow import build_residual_network >>> # Note that the auxiliary digraph has an edge attribute named capacity >>> R = build_residual_network(H, 'capacity') >>> # Reuse the auxiliary digraph and the residual network by passing them >>> # as arguments >>> len(list(nx.node_disjoint_paths(G, 0, 6, auxiliary=H, residual=R))) 5 You can also use alternative flow algorithms for computing node disjoint paths. For instance, in dense networks the algorithm :meth:`shortest_augmenting_path` will usually perform better than the default :meth:`edmonds_karp` which is faster for sparse networks with highly skewed degree distributions. Alternative flow functions have to be explicitly imported from the flow package. >>> from networkx.algorithms.flow import shortest_augmenting_path >>> len(list(nx.node_disjoint_paths(G, 0, 6, flow_func=shortest_augmenting_path))) 5 Notes ----- This is a flow based implementation of node disjoint paths. We compute the maximum flow between source and target on an auxiliary directed network. The saturated edges in the residual network after running the maximum flow algorithm correspond to node disjoint paths between source and target in the original network. This function handles both directed and undirected graphs, and can use all flow algorithms from NetworkX flow package. See also -------- :meth:`edge_disjoint_paths` :meth:`node_connectivity` :meth:`maximum_flow` :meth:`edmonds_karp` :meth:`preflow_push` :meth:`shortest_augmenting_path` """ if s not in G: raise nx.NetworkXError(f"node {s} not in graph") if t not in G: raise nx.NetworkXError(f"node {t} not in graph") if auxiliary is None: H = build_auxiliary_node_connectivity(G) else: H = auxiliary mapping = H.graph.get("mapping", None) if mapping is None: raise nx.NetworkXError("Invalid auxiliary digraph.") # Maximum possible edge disjoint paths possible = min(H.out_degree(f"{mapping[s]}B"), H.in_degree(f"{mapping[t]}A")) if not possible: raise NetworkXNoPath if cutoff is None: cutoff = possible else: cutoff = min(cutoff, possible) kwargs = dict(flow_func=flow_func, residual=residual, auxiliary=H, cutoff=cutoff) # The edge disjoint paths in the auxiliary digraph correspond to the node # disjoint paths in the original graph. paths_edges = edge_disjoint_paths(H, f"{mapping[s]}B", f"{mapping[t]}A", **kwargs) for path in paths_edges: # Each node in the original graph maps to two nodes in auxiliary graph yield list(_unique_everseen(H.nodes[node]["id"] for node in path)) def _unique_everseen(iterable): # Adapted from https://docs.python.org/3/library/itertools.html examples "List unique elements, preserving order. Remember all elements ever seen." # unique_everseen('AAAABBBCCDAABBB') --> A B C D seen = set() seen_add = seen.add for element in _filterfalse(seen.__contains__, iterable): seen_add(element) yield element
SpaceGroupUCL/qgisSpaceSyntaxToolkit
esstoolkit/external/networkx/algorithms/connectivity/disjoint_paths.py
Python
gpl-3.0
14,544
0.000619
# Copyright 2015 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import contextlib import copy import datetime import mock from oslo_serialization import jsonutils from oslo_utils import timeutils import six from testtools import matchers from cinder import context from cinder import exception from cinder import objects from cinder.objects import base from cinder.objects import fields from cinder import test from cinder.tests import fake_notifier class MyOwnedObject(base.CinderPersistentObject, base.CinderObject): VERSION = '1.0' fields = {'baz': fields.Field(fields.Integer())} class MyObj(base.CinderPersistentObject, base.CinderObject, base.CinderObjectDictCompat): VERSION = '1.6' fields = {'foo': fields.Field(fields.Integer(), default=1), 'bar': fields.Field(fields.String()), 'missing': fields.Field(fields.String()), 'readonly': fields.Field(fields.Integer(), read_only=True), 'rel_object': fields.ObjectField('MyOwnedObject', nullable=True), 'rel_objects': fields.ListOfObjectsField('MyOwnedObject', nullable=True), } @staticmethod def _from_db_object(context, obj, db_obj): self = MyObj() self.foo = db_obj['foo'] self.bar = db_obj['bar'] self.missing = db_obj['missing'] self.readonly = 1 return self def obj_load_attr(self, attrname): setattr(self, attrname, 'loaded!') @base.remotable_classmethod def query(cls, context): obj = cls(context=context, foo=1, bar='bar') obj.obj_reset_changes() return obj @base.remotable def marco(self, context): return 'polo' @base.remotable def _update_test(self, context): if context.project_id == 'alternate': self.bar = 'alternate-context' else: self.bar = 'updated' @base.remotable def save(self, context): self.obj_reset_changes() @base.remotable def refresh(self, context): self.foo = 321 self.bar = 'refreshed' self.obj_reset_changes() @base.remotable def modify_save_modify(self, context): self.bar = 'meow' self.save() self.foo = 42 self.rel_object = MyOwnedObject(baz=42) def obj_make_compatible(self, primitive, target_version): super(MyObj, self).obj_make_compatible(primitive, target_version) # NOTE(danms): Simulate an older version that had a different # format for the 'bar' attribute if target_version == '1.1' and 'bar' in primitive: primitive['bar'] = 'old%s' % primitive['bar'] class MyObjDiffVers(MyObj): VERSION = '1.5' @classmethod def obj_name(cls): return 'MyObj' class MyObj2(object): @classmethod def obj_name(cls): return 'MyObj' @base.remotable_classmethod def query(cls, *args, **kwargs): pass class RandomMixInWithNoFields(object): """Used to test object inheritance using a mixin that has no fields.""" pass class TestSubclassedObject(RandomMixInWithNoFields, MyObj): fields = {'new_field': fields.Field(fields.String())} class TestMetaclass(test.TestCase): def test_obj_tracking(self): @six.add_metaclass(base.CinderObjectMetaclass) class NewBaseClass(object): VERSION = '1.0' fields = {} @classmethod def obj_name(cls): return cls.__name__ class Fake1TestObj1(NewBaseClass): @classmethod def obj_name(cls): return 'fake1' class Fake1TestObj2(Fake1TestObj1): pass class Fake1TestObj3(Fake1TestObj1): VERSION = '1.1' class Fake2TestObj1(NewBaseClass): @classmethod def obj_name(cls): return 'fake2' class Fake1TestObj4(Fake1TestObj3): VERSION = '1.2' class Fake2TestObj2(Fake2TestObj1): VERSION = '1.1' class Fake1TestObj5(Fake1TestObj1): VERSION = '1.1' # Newest versions first in the list. Duplicate versions take the # newest object. expected = {'fake1': [Fake1TestObj4, Fake1TestObj5, Fake1TestObj2], 'fake2': [Fake2TestObj2, Fake2TestObj1]} self.assertEqual(expected, NewBaseClass._obj_classes) # The following should work, also. self.assertEqual(expected, Fake1TestObj1._obj_classes) self.assertEqual(expected, Fake1TestObj2._obj_classes) self.assertEqual(expected, Fake1TestObj3._obj_classes) self.assertEqual(expected, Fake1TestObj4._obj_classes) self.assertEqual(expected, Fake1TestObj5._obj_classes) self.assertEqual(expected, Fake2TestObj1._obj_classes) self.assertEqual(expected, Fake2TestObj2._obj_classes) def test_field_checking(self): def create_class(field): class TestField(base.CinderObject): VERSION = '1.5' fields = {'foo': field()} return TestField create_class(fields.BooleanField) self.assertRaises(exception.ObjectFieldInvalid, create_class, fields.Boolean) self.assertRaises(exception.ObjectFieldInvalid, create_class, int) class TestObjToPrimitive(test.TestCase): def test_obj_to_primitive_list(self): class MyObjElement(base.CinderObject): fields = {'foo': fields.IntegerField()} def __init__(self, foo): super(MyObjElement, self).__init__() self.foo = foo class MyList(base.ObjectListBase, base.CinderObject): fields = {'objects': fields.ListOfObjectsField('MyObjElement')} mylist = MyList() mylist.objects = [MyObjElement(1), MyObjElement(2), MyObjElement(3)] self.assertEqual([1, 2, 3], [x['foo'] for x in base.obj_to_primitive(mylist)]) def test_obj_to_primitive_dict(self): myobj = MyObj(foo=1, bar='foo') self.assertEqual({'foo': 1, 'bar': 'foo'}, base.obj_to_primitive(myobj)) def test_obj_to_primitive_recursive(self): class MyList(base.ObjectListBase, base.CinderObject): fields = {'objects': fields.ListOfObjectsField('MyObj')} mylist = MyList(objects=[MyObj(), MyObj()]) for i, value in enumerate(mylist): value.foo = i self.assertEqual([{'foo': 0}, {'foo': 1}], base.obj_to_primitive(mylist)) class TestObjMakeList(test.TestCase): def test_obj_make_list(self): class MyList(base.ObjectListBase, base.CinderObject): pass db_objs = [{'foo': 1, 'bar': 'baz', 'missing': 'banana'}, {'foo': 2, 'bar': 'bat', 'missing': 'apple'}, ] mylist = base.obj_make_list('ctxt', MyList(), MyObj, db_objs) self.assertEqual(2, len(mylist)) self.assertEqual('ctxt', mylist._context) for index, item in enumerate(mylist): self.assertEqual(db_objs[index]['foo'], item.foo) self.assertEqual(db_objs[index]['bar'], item.bar) self.assertEqual(db_objs[index]['missing'], item.missing) def compare_obj(test, obj, db_obj, subs=None, allow_missing=None, comparators=None): """Compare a CinderObject and a dict-like database object. This automatically converts TZ-aware datetimes and iterates over the fields of the object. :param:test: The TestCase doing the comparison :param:obj: The CinderObject to examine :param:db_obj: The dict-like database object to use as reference :param:subs: A dict of objkey=dbkey field substitutions :param:allow_missing: A list of fields that may not be in db_obj :param:comparators: Map of comparator functions to use for certain fields """ if subs is None: subs = {} if allow_missing is None: allow_missing = [] if comparators is None: comparators = {} for key in obj.fields: if key in allow_missing and not obj.obj_attr_is_set(key): continue obj_val = getattr(obj, key) db_key = subs.get(key, key) db_val = db_obj[db_key] if isinstance(obj_val, datetime.datetime): obj_val = obj_val.replace(tzinfo=None) if key in comparators: comparator = comparators[key] comparator(db_val, obj_val) else: test.assertEqual(db_val, obj_val) class _BaseTestCase(test.TestCase): def setUp(self): super(_BaseTestCase, self).setUp() self.remote_object_calls = list() self.user_id = 'fake-user' self.project_id = 'fake-project' self.context = context.RequestContext(self.user_id, self.project_id) fake_notifier.stub_notifier(self.stubs) self.addCleanup(fake_notifier.reset) def compare_obj(self, obj, db_obj, subs=None, allow_missing=None, comparators=None): compare_obj(self, obj, db_obj, subs=subs, allow_missing=allow_missing, comparators=comparators) def json_comparator(self, expected, obj_val): # json-ify an object field for comparison with its db str # equivalent self.assertEqual(expected, jsonutils.dumps(obj_val)) def str_comparator(self, expected, obj_val): """Compare an object field to a string in the db by performing a simple coercion on the object field value. """ self.assertEqual(expected, str(obj_val)) def assertNotIsInstance(self, obj, cls, msg=None): """Python < v2.7 compatibility. Assert 'not isinstance(obj, cls).""" try: f = super(_BaseTestCase, self).assertNotIsInstance except AttributeError: self.assertThat(obj, matchers.Not(matchers.IsInstance(cls)), message=msg or '') else: f(obj, cls, msg=msg) class _LocalTest(_BaseTestCase): def setUp(self): super(_LocalTest, self).setUp() # Just in case base.CinderObject.indirection_api = None def assertRemotes(self): self.assertEqual(self.remote_object_calls, []) @contextlib.contextmanager def things_temporarily_local(): _api = base.CinderObject.indirection_api base.CinderObject.indirection_api = None yield base.CinderObject.indirection_api = _api class _TestObject(object): def test_object_attrs_in_init(self): # Now check the test one in this file. Should be newest version self.assertEqual('1.6', objects.MyObj.VERSION) def test_hydration_type_error(self): primitive = {'cinder_object.name': 'MyObj', 'cinder_object.namespace': 'cinder', 'cinder_object.version': '1.5', 'cinder_object.data': {'foo': 'a'}} self.assertRaises(ValueError, MyObj.obj_from_primitive, primitive) def test_hydration(self): primitive = {'cinder_object.name': 'MyObj', 'cinder_object.namespace': 'cinder', 'cinder_object.version': '1.5', 'cinder_object.data': {'foo': 1}} real_method = MyObj._obj_from_primitive def _obj_from_primitive(*args): return real_method(*args) with mock.patch.object(MyObj, '_obj_from_primitive') as ofp: ofp.side_effect = _obj_from_primitive obj = MyObj.obj_from_primitive(primitive) ofp.assert_called_once_with(None, '1.5', primitive) self.assertEqual(obj.foo, 1) def test_hydration_version_different(self): primitive = {'cinder_object.name': 'MyObj', 'cinder_object.namespace': 'cinder', 'cinder_object.version': '1.2', 'cinder_object.data': {'foo': 1}} obj = MyObj.obj_from_primitive(primitive) self.assertEqual(obj.foo, 1) self.assertEqual('1.2', obj.VERSION) def test_hydration_bad_ns(self): primitive = {'cinder_object.name': 'MyObj', 'cinder_object.namespace': 'foo', 'cinder_object.version': '1.5', 'cinder_object.data': {'foo': 1}} self.assertRaises(exception.UnsupportedObjectError, MyObj.obj_from_primitive, primitive) def test_hydration_additional_unexpected_stuff(self): primitive = {'cinder_object.name': 'MyObj', 'cinder_object.namespace': 'cinder', 'cinder_object.version': '1.5.1', 'cinder_object.data': { 'foo': 1, 'unexpected_thing': 'foobar'}} obj = MyObj.obj_from_primitive(primitive) self.assertEqual(1, obj.foo) self.assertFalse(hasattr(obj, 'unexpected_thing')) # NOTE(danms): If we call obj_from_primitive() directly # with a version containing .z, we'll get that version # in the resulting object. In reality, when using the # serializer, we'll get that snipped off (tested # elsewhere) self.assertEqual('1.5.1', obj.VERSION) def test_dehydration(self): expected = {'cinder_object.name': 'MyObj', 'cinder_object.namespace': 'cinder', 'cinder_object.version': '1.6', 'cinder_object.data': {'foo': 1}} obj = MyObj(foo=1) obj.obj_reset_changes() self.assertEqual(obj.obj_to_primitive(), expected) def test_object_property(self): obj = MyObj(foo=1) self.assertEqual(obj.foo, 1) def test_object_property_type_error(self): obj = MyObj() def fail(): obj.foo = 'a' self.assertRaises(ValueError, fail) def test_object_dict_syntax(self): obj = MyObj(foo=123, bar='bar') self.assertEqual(obj['foo'], 123) self.assertEqual(sorted(obj.items(), key=lambda x: x[0]), [('bar', 'bar'), ('foo', 123)]) self.assertEqual(sorted(list(obj.iteritems()), key=lambda x: x[0]), [('bar', 'bar'), ('foo', 123)]) def test_load(self): obj = MyObj() self.assertEqual(obj.bar, 'loaded!') def test_load_in_base(self): class Foo(base.CinderObject): fields = {'foobar': fields.Field(fields.Integer())} obj = Foo() with self.assertRaisesRegex(NotImplementedError, ".*foobar.*"): obj.foobar def test_loaded_in_primitive(self): obj = MyObj(foo=1) obj.obj_reset_changes() self.assertEqual(obj.bar, 'loaded!') expected = {'cinder_object.name': 'MyObj', 'cinder_object.namespace': 'cinder', 'cinder_object.version': '1.6', 'cinder_object.changes': ['bar'], 'cinder_object.data': {'foo': 1, 'bar': 'loaded!'}} self.assertEqual(obj.obj_to_primitive(), expected) def test_changes_in_primitive(self): obj = MyObj(foo=123) self.assertEqual(obj.obj_what_changed(), set(['foo'])) primitive = obj.obj_to_primitive() self.assertIn('cinder_object.changes', primitive) obj2 = MyObj.obj_from_primitive(primitive) self.assertEqual(obj2.obj_what_changed(), set(['foo'])) obj2.obj_reset_changes() self.assertEqual(obj2.obj_what_changed(), set()) def test_obj_class_from_name(self): obj = base.CinderObject.obj_class_from_name('MyObj', '1.5') self.assertEqual('1.5', obj.VERSION) def test_obj_class_from_name_latest_compatible(self): obj = base.CinderObject.obj_class_from_name('MyObj', '1.1') self.assertEqual('1.6', obj.VERSION) def test_unknown_objtype(self): self.assertRaises(exception.UnsupportedObjectError, base.CinderObject.obj_class_from_name, 'foo', '1.0') def test_obj_class_from_name_supported_version(self): error = None try: base.CinderObject.obj_class_from_name('MyObj', '1.25') except exception.IncompatibleObjectVersion as error: pass self.assertIsNotNone(error) self.assertEqual('1.6', error.kwargs['supported']) def test_with_alternate_context(self): ctxt1 = context.RequestContext('foo', 'foo') ctxt2 = context.RequestContext('bar', 'alternate') obj = MyObj.query(ctxt1) obj._update_test(ctxt2) self.assertEqual(obj.bar, 'alternate-context') self.assertRemotes() def test_orphaned_object(self): obj = MyObj.query(self.context) obj._context = None self.assertRaises(exception.OrphanedObjectError, obj._update_test) self.assertRemotes() def test_changed_1(self): obj = MyObj.query(self.context) obj.foo = 123 self.assertEqual(obj.obj_what_changed(), set(['foo'])) obj._update_test(self.context) self.assertEqual(obj.obj_what_changed(), set(['foo', 'bar'])) self.assertEqual(obj.foo, 123) self.assertRemotes() def test_changed_2(self): obj = MyObj.query(self.context) obj.foo = 123 self.assertEqual(obj.obj_what_changed(), set(['foo'])) obj.save() self.assertEqual(obj.obj_what_changed(), set([])) self.assertEqual(obj.foo, 123) self.assertRemotes() def test_changed_3(self): obj = MyObj.query(self.context) obj.foo = 123 self.assertEqual(obj.obj_what_changed(), set(['foo'])) obj.refresh() self.assertEqual(obj.obj_what_changed(), set([])) self.assertEqual(obj.foo, 321) self.assertEqual(obj.bar, 'refreshed') self.assertRemotes() def test_changed_4(self): obj = MyObj.query(self.context) obj.bar = 'something' self.assertEqual(obj.obj_what_changed(), set(['bar'])) obj.modify_save_modify(self.context) self.assertEqual(obj.obj_what_changed(), set(['foo', 'rel_object'])) self.assertEqual(obj.foo, 42) self.assertEqual(obj.bar, 'meow') self.assertIsInstance(obj.rel_object, MyOwnedObject) self.assertRemotes() def test_changed_with_sub_object(self): class ParentObject(base.CinderObject): fields = {'foo': fields.IntegerField(), 'bar': fields.ObjectField('MyObj'), } obj = ParentObject() self.assertEqual(set(), obj.obj_what_changed()) obj.foo = 1 self.assertEqual(set(['foo']), obj.obj_what_changed()) bar = MyObj() obj.bar = bar self.assertEqual(set(['foo', 'bar']), obj.obj_what_changed()) obj.obj_reset_changes() self.assertEqual(set(), obj.obj_what_changed()) bar.foo = 1 self.assertEqual(set(['bar']), obj.obj_what_changed()) def test_static_result(self): obj = MyObj.query(self.context) self.assertEqual(obj.bar, 'bar') result = obj.marco() self.assertEqual(result, 'polo') self.assertRemotes() def test_updates(self): obj = MyObj.query(self.context) self.assertEqual(obj.foo, 1) obj._update_test() self.assertEqual(obj.bar, 'updated') self.assertRemotes() def test_base_attributes(self): dt = datetime.datetime(1955, 11, 5) obj = MyObj(created_at=dt, updated_at=dt, deleted_at=None, deleted=False) expected = {'cinder_object.name': 'MyObj', 'cinder_object.namespace': 'cinder', 'cinder_object.version': '1.6', 'cinder_object.changes': ['created_at', 'deleted', 'deleted_at', 'updated_at'], 'cinder_object.data': {'created_at': timeutils.isotime(dt), 'updated_at': timeutils.isotime(dt), 'deleted_at': None, 'deleted': False, } } self.assertEqual(obj.obj_to_primitive(), expected) def test_contains(self): obj = MyObj() self.assertNotIn('foo', obj) obj.foo = 1 self.assertIn('foo', obj) self.assertNotIn('does_not_exist', obj) def test_obj_attr_is_set(self): obj = MyObj(foo=1) self.assertTrue(obj.obj_attr_is_set('foo')) self.assertFalse(obj.obj_attr_is_set('bar')) self.assertRaises(AttributeError, obj.obj_attr_is_set, 'bang') def test_get(self): obj = MyObj(foo=1) # Foo has value, should not get the default self.assertEqual(1, obj.get('foo', 2)) # Foo has value, should return the value without error self.assertEqual(1, obj.get('foo')) # Bar is not loaded, so we should get the default self.assertEqual('not-loaded', obj.get('bar', 'not-loaded')) # Bar without a default should lazy-load self.assertEqual('loaded!', obj.get('bar')) # Bar now has a default, but loaded value should be returned self.assertEqual('loaded!', obj.get('bar', 'not-loaded')) # Invalid attribute should return None self.assertEqual(None, obj.get('nothing')) def test_object_inheritance(self): base_fields = base.CinderPersistentObject.fields.keys() myobj_fields = (['foo', 'bar', 'missing', 'readonly', 'rel_object', 'rel_objects'] + base_fields) myobj3_fields = ['new_field'] self.assertTrue(issubclass(TestSubclassedObject, MyObj)) self.assertEqual(len(myobj_fields), len(MyObj.fields)) self.assertEqual(set(myobj_fields), set(MyObj.fields.keys())) self.assertEqual(len(myobj_fields) + len(myobj3_fields), len(TestSubclassedObject.fields)) self.assertEqual(set(myobj_fields) | set(myobj3_fields), set(TestSubclassedObject.fields.keys())) def test_obj_as_admin(self): obj = MyObj(context=self.context) def fake(*args, **kwargs): self.assertTrue(obj._context.is_admin) with mock.patch.object(obj, 'obj_reset_changes') as mock_fn: mock_fn.side_effect = fake with obj.obj_as_admin(): obj.save() self.assertTrue(mock_fn.called) self.assertFalse(obj._context.is_admin) def test_obj_as_admin_orphaned(self): def testme(): obj = MyObj() with obj.obj_as_admin(): pass self.assertRaises(exception.OrphanedObjectError, testme) def test_get_changes(self): obj = MyObj() self.assertEqual({}, obj.obj_get_changes()) obj.foo = 123 self.assertEqual({'foo': 123}, obj.obj_get_changes()) obj.bar = 'test' self.assertEqual({'foo': 123, 'bar': 'test'}, obj.obj_get_changes()) obj.obj_reset_changes() self.assertEqual({}, obj.obj_get_changes()) def test_obj_fields(self): class TestObj(base.CinderObject): fields = {'foo': fields.Field(fields.Integer())} obj_extra_fields = ['bar'] @property def bar(self): return 'this is bar' obj = TestObj() self.assertEqual(['foo', 'bar'], obj.obj_fields) def test_obj_constructor(self): obj = MyObj(context=self.context, foo=123, bar='abc') self.assertEqual(123, obj.foo) self.assertEqual('abc', obj.bar) self.assertEqual(set(['foo', 'bar']), obj.obj_what_changed()) def test_obj_read_only(self): obj = MyObj(context=self.context, foo=123, bar='abc') obj.readonly = 1 self.assertRaises(exception.ReadOnlyFieldError, setattr, obj, 'readonly', 2) def test_obj_repr(self): obj = MyObj(foo=123) self.assertEqual('MyObj(bar=<?>,created_at=<?>,deleted=<?>,' 'deleted_at=<?>,foo=123,missing=<?>,readonly=<?>,' 'rel_object=<?>,rel_objects=<?>,updated_at=<?>)', repr(obj)) def test_obj_make_obj_compatible(self): subobj = MyOwnedObject(baz=1) obj = MyObj(rel_object=subobj) obj.obj_relationships = { 'rel_object': [('1.5', '1.1'), ('1.7', '1.2')], } primitive = obj.obj_to_primitive()['cinder_object.data'] with mock.patch.object(subobj, 'obj_make_compatible') as mock_compat: obj._obj_make_obj_compatible(copy.copy(primitive), '1.8', 'rel_object') self.assertFalse(mock_compat.called) with mock.patch.object(subobj, 'obj_make_compatible') as mock_compat: obj._obj_make_obj_compatible(copy.copy(primitive), '1.7', 'rel_object') mock_compat.assert_called_once_with( primitive['rel_object']['cinder_object.data'], '1.2') self.assertEqual('1.2', primitive['rel_object']['cinder_object.version']) with mock.patch.object(subobj, 'obj_make_compatible') as mock_compat: obj._obj_make_obj_compatible(copy.copy(primitive), '1.6', 'rel_object') mock_compat.assert_called_once_with( primitive['rel_object']['cinder_object.data'], '1.1') self.assertEqual('1.1', primitive['rel_object']['cinder_object.version']) with mock.patch.object(subobj, 'obj_make_compatible') as mock_compat: obj._obj_make_obj_compatible(copy.copy(primitive), '1.5', 'rel_object') mock_compat.assert_called_once_with( primitive['rel_object']['cinder_object.data'], '1.1') self.assertEqual('1.1', primitive['rel_object']['cinder_object.version']) with mock.patch.object(subobj, 'obj_make_compatible') as mock_compat: _prim = copy.copy(primitive) obj._obj_make_obj_compatible(_prim, '1.4', 'rel_object') self.assertFalse(mock_compat.called) self.assertNotIn('rel_object', _prim) def test_obj_make_compatible_hits_sub_objects(self): subobj = MyOwnedObject(baz=1) obj = MyObj(foo=123, rel_object=subobj) obj.obj_relationships = {'rel_object': [('1.0', '1.0')]} with mock.patch.object(obj, '_obj_make_obj_compatible') as mock_compat: obj.obj_make_compatible({'rel_object': 'foo'}, '1.10') mock_compat.assert_called_once_with({'rel_object': 'foo'}, '1.10', 'rel_object') def test_obj_make_compatible_skips_unset_sub_objects(self): obj = MyObj(foo=123) obj.obj_relationships = {'rel_object': [('1.0', '1.0')]} with mock.patch.object(obj, '_obj_make_obj_compatible') as mock_compat: obj.obj_make_compatible({'rel_object': 'foo'}, '1.10') self.assertFalse(mock_compat.called) def test_obj_make_compatible_complains_about_missing_rules(self): subobj = MyOwnedObject(baz=1) obj = MyObj(foo=123, rel_object=subobj) obj.obj_relationships = {} self.assertRaises(exception.ObjectActionError, obj.obj_make_compatible, {}, '1.0') def test_obj_make_compatible_handles_list_of_objects(self): subobj = MyOwnedObject(baz=1) obj = MyObj(rel_objects=[subobj]) obj.obj_relationships = {'rel_objects': [('1.0', '1.123')]} def fake_make_compat(primitive, version): self.assertEqual('1.123', version) self.assertIn('baz', primitive) with mock.patch.object(subobj, 'obj_make_compatible') as mock_mc: mock_mc.side_effect = fake_make_compat obj.obj_to_primitive('1.0') self.assertTrue(mock_mc.called) class TestObject(_LocalTest, _TestObject): def test_set_defaults(self): obj = MyObj() obj.obj_set_defaults('foo') self.assertTrue(obj.obj_attr_is_set('foo')) self.assertEqual(1, obj.foo) def test_set_defaults_no_default(self): obj = MyObj() self.assertRaises(exception.ObjectActionError, obj.obj_set_defaults, 'bar') def test_set_all_defaults(self): obj = MyObj() obj.obj_set_defaults() self.assertEqual(set(['deleted', 'foo']), obj.obj_what_changed()) self.assertEqual(1, obj.foo) class TestObjectListBase(test.TestCase): def test_list_like_operations(self): class MyElement(base.CinderObject): fields = {'foo': fields.IntegerField()} def __init__(self, foo): super(MyElement, self).__init__() self.foo = foo class Foo(base.ObjectListBase, base.CinderObject): fields = {'objects': fields.ListOfObjectsField('MyElement')} objlist = Foo(context='foo', objects=[MyElement(1), MyElement(2), MyElement(3)]) self.assertEqual(list(objlist), objlist.objects) self.assertEqual(len(objlist), 3) self.assertIn(objlist.objects[0], objlist) self.assertEqual(list(objlist[:1]), [objlist.objects[0]]) self.assertEqual(objlist[:1]._context, 'foo') self.assertEqual(objlist[2], objlist.objects[2]) self.assertEqual(objlist.count(objlist.objects[0]), 1) self.assertEqual(objlist.index(objlist.objects[1]), 1) objlist.sort(key=lambda x: x.foo, reverse=True) self.assertEqual([3, 2, 1], [x.foo for x in objlist]) def test_serialization(self): class Foo(base.ObjectListBase, base.CinderObject): fields = {'objects': fields.ListOfObjectsField('Bar')} class Bar(base.CinderObject): fields = {'foo': fields.Field(fields.String())} obj = Foo(objects=[]) for i in 'abc': bar = Bar(foo=i) obj.objects.append(bar) obj2 = base.CinderObject.obj_from_primitive(obj.obj_to_primitive()) self.assertFalse(obj is obj2) self.assertEqual([x.foo for x in obj], [y.foo for y in obj2]) def test_list_changes(self): class Foo(base.ObjectListBase, base.CinderObject): fields = {'objects': fields.ListOfObjectsField('Bar')} class Bar(base.CinderObject): fields = {'foo': fields.StringField()} obj = Foo(objects=[]) self.assertEqual(set(['objects']), obj.obj_what_changed()) obj.objects.append(Bar(foo='test')) self.assertEqual(set(['objects']), obj.obj_what_changed()) obj.obj_reset_changes() # This should still look dirty because the child is dirty self.assertEqual(set(['objects']), obj.obj_what_changed()) obj.objects[0].obj_reset_changes() # This should now look clean because the child is clean self.assertEqual(set(), obj.obj_what_changed()) def test_initialize_objects(self): class Foo(base.ObjectListBase, base.CinderObject): fields = {'objects': fields.ListOfObjectsField('Bar')} class Bar(base.CinderObject): fields = {'foo': fields.StringField()} obj = Foo() self.assertEqual([], obj.objects) self.assertEqual(set(), obj.obj_what_changed()) def test_obj_repr(self): class Foo(base.ObjectListBase, base.CinderObject): fields = {'objects': fields.ListOfObjectsField('Bar')} class Bar(base.CinderObject): fields = {'uuid': fields.StringField()} obj = Foo(objects=[Bar(uuid='fake-uuid')]) self.assertEqual('Foo(objects=[Bar(fake-uuid)])', repr(obj)) class TestObjectSerializer(_BaseTestCase): def test_serialize_entity_primitive(self): ser = base.CinderObjectSerializer() for thing in (1, 'foo', [1, 2], {'foo': 'bar'}): self.assertEqual(thing, ser.serialize_entity(None, thing)) def test_deserialize_entity_primitive(self): ser = base.CinderObjectSerializer() for thing in (1, 'foo', [1, 2], {'foo': 'bar'}): self.assertEqual(thing, ser.deserialize_entity(None, thing)) def _test_deserialize_entity_newer(self, obj_version, backported_to, my_version='1.6'): ser = base.CinderObjectSerializer() ser._conductor = mock.Mock() ser._conductor.object_backport.return_value = 'backported' class MyTestObj(MyObj): VERSION = my_version obj = MyTestObj() obj.VERSION = obj_version primitive = obj.obj_to_primitive() ser.deserialize_entity(self.context, primitive) if backported_to is None: self.assertFalse(ser._conductor.object_backport.called) def test_deserialize_entity_newer_revision_does_not_backport_zero(self): self._test_deserialize_entity_newer('1.6.0', None) def test_deserialize_entity_newer_revision_does_not_backport(self): self._test_deserialize_entity_newer('1.6.1', None) def test_deserialize_dot_z_with_extra_stuff(self): primitive = {'cinder_object.name': 'MyObj', 'cinder_object.namespace': 'cinder', 'cinder_object.version': '1.6.1', 'cinder_object.data': { 'foo': 1, 'unexpected_thing': 'foobar'}} ser = base.CinderObjectSerializer() obj = ser.deserialize_entity(self.context, primitive) self.assertEqual(1, obj.foo) self.assertFalse(hasattr(obj, 'unexpected_thing')) # NOTE(danms): The serializer is where the logic lives that # avoids backports for cases where only a .z difference in # the received object version is detected. As a result, we # end up with a version of what we expected, effectively the # .0 of the object. self.assertEqual('1.6', obj.VERSION) def test_object_serialization(self): ser = base.CinderObjectSerializer() obj = MyObj() primitive = ser.serialize_entity(self.context, obj) self.assertIn('cinder_object.name', primitive) obj2 = ser.deserialize_entity(self.context, primitive) self.assertIsInstance(obj2, MyObj) self.assertEqual(self.context, obj2._context) def test_object_serialization_iterables(self): ser = base.CinderObjectSerializer() obj = MyObj() for iterable in (list, tuple, set): thing = iterable([obj]) primitive = ser.serialize_entity(self.context, thing) self.assertEqual(1, len(primitive)) for item in primitive: self.assertNotIsInstance(item, base.CinderObject) thing2 = ser.deserialize_entity(self.context, primitive) self.assertEqual(1, len(thing2)) for item in thing2: self.assertIsInstance(item, MyObj) # dict case thing = {'key': obj} primitive = ser.serialize_entity(self.context, thing) self.assertEqual(1, len(primitive)) for item in primitive.itervalues(): self.assertNotIsInstance(item, base.CinderObject) thing2 = ser.deserialize_entity(self.context, primitive) self.assertEqual(1, len(thing2)) for item in thing2.itervalues(): self.assertIsInstance(item, MyObj) # object-action updates dict case thing = {'foo': obj.obj_to_primitive()} primitive = ser.serialize_entity(self.context, thing) self.assertEqual(thing, primitive) thing2 = ser.deserialize_entity(self.context, thing) self.assertIsInstance(thing2['foo'], base.CinderObject)
tmenjo/cinder-2015.1.1
cinder/tests/objects/test_objects.py
Python
apache-2.0
36,876
0
import turtle class C(turtle.TurtleScreenBase): pass
siosio/intellij-community
python/testData/override/qualified.py
Python
apache-2.0
57
0.035088
#!/usr/bin/env python import json import numpy import scipy.sparse as sp from optparse import OptionParser __author__ = "Gregory Ditzler" __copyright__ = "Copyright 2014, EESI Laboratory (Drexel University)" __credits__ = ["Gregory Ditzler"] __license__ = "GPL" __version__ = "0.1.0" __maintainer__ = "Gregory Ditzler" __email__ = "[email protected]" def load_biom(fname): """ load a biom file and return a dense matrix :fname - string containing the path to the biom file :data - numpy array containing the OTU matrix :samples - list containing the sample IDs (important for knowing the labels in the data matrix) :features - list containing the feature names """ o = json.loads(open(fname,"U").read()) if o["matrix_type"] == "sparse": data = load_sparse(o) else: data = load_dense(o) samples = [] for sid in o["columns"]: samples.append(sid["id"]) features = [] for sid in o["rows"]: # check to see if the taxonomy is listed, this will generally lead to more # descriptive names for the taxonomies. if sid.has_key("metadata") and sid["metadata"] != None: if sid["metadata"].has_key("taxonomy"): #features.append(str( \ # sid["metadata"]["taxonomy"]).strip( \ # "[]").replace(",",";").replace("u'","").replace("'","")) features.append(json.dumps(sid["metadata"]["taxonomy"])) else: features.append(sid["id"]) else: features.append(sid["id"]) return data, samples, features def load_dense(obj): """ load a biom file in dense format :obj - json dictionary from biom file :data - dense data matrix """ n_feat,n_sample = obj["shape"] data = np.array(obj["data"], order="F") return data.transpose() def load_sparse(obj): """ load a biom file in sparse format :obj - json dictionary from biom file :data - dense data matrix """ n_feat,n_sample = obj["shape"] data = numpy.zeros((n_feat, n_sample),order="F") for val in obj["data"]: data[val[0], val[1]] = val[2] data = data.transpose() return data def load_map(fname): """ load a map file. this function does not have any dependecies on qiime's tools. the returned object is a dictionary of dictionaries. the dictionary is indexed by the sample_ID and there is an added field for the the available meta-data. each element in the dictionary is a dictionary with the keys of the meta-data. :fname - string containing the map file path :meta_data - dictionary containin the mapping file information """ f = open(fname, "U") mfile = [] for line in f: mfile.append(line.replace("\n","").replace("#","").split("\t")) meta_data_header = mfile.pop(0) meta_data = {} for sample in mfile: sample_id = sample[0] meta_data[sample_id] = {} for identifier, value in map(None, meta_data_header, sample): meta_data[sample_id][identifier] = value return meta_data
gditzler/BigLS2014-Code
src/bmu.py
Python
gpl-3.0
2,945
0.021053
""" A script for testing / benchmarking HMM Implementations """ import argparse import collections import logging import time import hmmlearn.hmm import numpy as np import sklearn.base LOG = logging.getLogger(__file__) class Benchmark: def __init__(self, repeat, n_iter, verbose): self.repeat = repeat self.n_iter = n_iter self.verbose = verbose def benchmark(self, sequences, lengths, model, tag): elapsed = [] for i in range(self.repeat): start = time.time() cloned = sklearn.base.clone(model) cloned.fit(sequences, lengths) end = time.time() elapsed.append(end-start) self.log_one_run(start, end, cloned, tag) return np.asarray(elapsed) def generate_training_sequences(self): pass def new_model(self, implementation): pass def run(self, results_file): runtimes = collections.defaultdict(dict) sequences, lengths = self.generate_training_sequences() for implementation in ["scaling", "log"]: model = self.new_model(implementation) LOG.info(f"{model.__class__.__name__}: testing {implementation}") key = f"{model.__class__.__name__}|EM|hmmlearn-{implementation}" elapsed = self.benchmark(sequences, lengths, model, key) runtimes[key]["mean"] = elapsed.mean() runtimes[key]["std"] = elapsed.std() with open(results_file, mode="w") as fd: fd.write("configuration,mean,std,n_iterations,repeat\n") for key, value in runtimes.items(): fd.write(f"{key},{value['mean']},{value['std']}," f"{self.n_iter},{self.repeat}\n") def log_one_run(self, start, end, model, tag): LOG.info(f"Training Took {end-start} seconds {tag}") LOG.info(f"startprob={model.startprob_}") LOG.info(f"transmat={model.transmat_}") class GaussianBenchmark(Benchmark): def new_model(self, implementation): return hmmlearn.hmm.GaussianHMM( n_components=4, n_iter=self.n_iter, covariance_type="full", implementation=implementation, verbose=self.verbose ) def generate_training_sequences(self): sampler = hmmlearn.hmm.GaussianHMM( n_components=4, covariance_type="full", init_params="", verbose=self.verbose ) sampler.startprob_ = np.asarray([0, 0, 0, 1]) sampler.transmat_ = np.asarray([ [.2, .2, .3, .3], [.3, .2, .2, .3], [.2, .3, .3, .2], [.3, .3, .2, .2], ]) sampler.means_ = np.asarray([ -1.5, 0, 1.5, 3 ]).reshape(4, 1) sampler.covars_ = np.asarray([ .5, .5, .5, .5 ]).reshape(4, 1, 1,) sequences, states = sampler.sample(50000) lengths = [len(sequences)] return sequences, lengths def log_one_run(self, start, end, model, tag): super().log_one_run(start, end, model, tag) LOG.info(f"means={model.means_}") LOG.info(f"covars={model.covars_}") class MultinomialBenchmark(Benchmark): def new_model(self, implementation): return hmmlearn.hmm.MultinomialHMM( n_components=3, n_iter=self.n_iter, verbose=self.verbose, implementation=implementation ) def generate_training_sequences(self): sampler = hmmlearn.hmm.MultinomialHMM(n_components=3) sampler.startprob_ = np.array([0.6, 0.3, 0.1]) sampler.transmat_ = np.array([[0.6, 0.2, 0.2], [0.3, 0.5, 0.2], [0.4, 0.3, 0.3]]) sampler.emissionprob_ = np.array([ [.1, .5, .1, .3], [.1, .2, .4, .3], [0, .5, .5, .0], ]) sequences, states = sampler.sample(50000) lengths = [len(sequences)] return sequences, lengths def log_one_run(self, start, end, model, tag): super().log_one_run(start, end, model, tag) LOG.info(f"emissions={model.emissionprob_}") class MultivariateGaussianBenchmark(GaussianBenchmark): def generate_training_sequences(self): sampler = hmmlearn.hmm.GaussianHMM( n_components=4, covariance_type="full", init_params="" ) sampler.startprob_ = np.asarray([0, 0, 0, 1]) sampler.transmat_ = np.asarray([ [.2, .2, .3, .3], [.3, .2, .2, .3], [.2, .3, .3, .2], [.3, .3, .2, .2], ]) sampler.means_ = np.asarray([ [-1.5, 0], [0, 0], [1.5, 0], [3, 0] ]) sampler.covars_ = np.asarray([ [[.5, 0], [0, .5]], [[.5, 0], [0, 0.5]], [[.5, 0], [0, .5]], [[0.5, 0], [0, 0.5]], ]) observed, hidden = sampler.sample(50000) lengths = [len(observed)] return observed, lengths class GMMBenchmark(GaussianBenchmark): def generate_training_sequences(self): sampler = hmmlearn.hmm.GMMHMM( n_components=4, n_mix=3, covariance_type="full", init_params="" ) sampler.startprob_ = [.25, .25, .25, .25] sampler.transmat_ = [ [.1, .3, .3, .3], [.3, .1, .3, .3], [.3, .3, .1, .3], [.3, .3, .3, .1], ] sampler.weights_ = [ [.2, .2, .6], [.6, .2, .2], [.2, .6, .2], [.1, .1, .8], ] sampler.means_ = np.asarray([ [[-10], [-12], [-9]], [[-5], [-4], [-3]], [[-1.5], [0], [1.5]], [[5], [7], [9]], ]) sampler.covars_ = np.asarray([ [[[.125]], [[.125]], [[.125]]], [[[.125]], [[.125]], [[.125]]], [[[.125]], [[.125]], [[.125]]], [[[.125]], [[.125]], [[.125]]], ]) n_sequences = 10 length = 5_000 sequences = [] for i in range(n_sequences): sequences.append(sampler.sample(5000)[0]) return np.concatenate(sequences), [length] * n_sequences def new_model(self, implementation): return hmmlearn.hmm.GMMHMM( n_components=4, n_mix=3, n_iter=self.n_iter, covariance_type="full", verbose=self.verbose, implementation=implementation ) def log_one_run(self, start, end, model, tag): super().log_one_run(start, end, model, tag) LOG.info(f"weights_={model.weights_}") def main(): parser = argparse.ArgumentParser() parser.add_argument("--all", action="store_true") parser.add_argument("--categorical", action="store_true") parser.add_argument("--gaussian", action="store_true") parser.add_argument("--multivariate-gaussian", action="store_true") parser.add_argument("--gaussian-mixture", action="store_true") parser.add_argument("--repeat", type=int, default=10) parser.add_argument("--verbose", action="store_true") parser.add_argument("--n-iter", type=int, default=100) args = parser.parse_args() if args.all: args.categorical = True args.gaussian = True args.multivariate_gaussian = True args.gaussian_mixture = True if args.categorical: bench = MultinomialBenchmark( repeat=args.repeat, n_iter=args.n_iter, verbose=args.verbose, ) bench.run("categorical.benchmark.csv") if args.gaussian: bench = GaussianBenchmark( repeat=args.repeat, n_iter=args.n_iter, verbose=args.verbose, ) bench.run("gaussian.benchmark.csv") if args.multivariate_gaussian: bench = MultivariateGaussianBenchmark( repeat=args.repeat, n_iter=args.n_iter, verbose=args.verbose, ) bench.run("multivariate_gaussian.benchmark.csv") if args.gaussian_mixture: bench = GMMBenchmark( repeat=args.repeat, n_iter=args.n_iter, verbose=args.verbose, ) bench.run("gmm.benchmark.csv") if __name__ == "__main__": logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.DEBUG ) main()
hmmlearn/hmmlearn
scripts/benchmark.py
Python
bsd-3-clause
8,715
0.000115
from apero_imac.models import * from django.shortcuts import render_to_response from datetime import datetime def home(request): return render_to_response('home.html', locals()) def about(request): return render_to_response('about.html', locals())
Elfhir/apero-imac
apero_imac/views.py
Python
mpl-2.0
255
0.023529
import os import nipype.interfaces.utility as util from CPAC.utils.interfaces.function import Function from CPAC.pipeline import nipype_pipeline_engine as pe def run_surface(post_freesurfer_folder, freesurfer_folder, subject, t1w_restore_image, atlas_space_t1w_image, atlas_transform, inverse_atlas_transform, atlas_space_bold, scout_bold, surf_atlas_dir, gray_ordinates_dir, gray_ordinates_res, high_res_mesh, low_res_mesh, subcortical_gray_labels, freesurfer_labels, fmri_res, smooth_fwhm): import os import subprocess freesurfer_folder = os.path.join(freesurfer_folder, 'recon_all') # DCAN-HCP PostFreeSurfer # Ref: https://github.com/DCAN-Labs/DCAN-HCP/blob/master/PostFreeSurfer/PostFreeSurferPipeline.sh cmd = ['bash', '/code/CPAC/surface/PostFreeSurfer/run.sh', '--post_freesurfer_folder', post_freesurfer_folder, \ '--freesurfer_folder', freesurfer_folder, '--subject', subject, \ '--t1w_restore', t1w_restore_image, '--atlas_t1w', atlas_space_t1w_image, \ '--atlas_transform', atlas_transform, '--inverse_atlas_transform', inverse_atlas_transform, \ '--surfatlasdir', surf_atlas_dir, '--grayordinatesdir', gray_ordinates_dir, '--grayordinatesres', gray_ordinates_res, \ '--hiresmesh', high_res_mesh, '--lowresmesh', low_res_mesh, \ '--subcortgraylabels', subcortical_gray_labels, '--freesurferlabels', freesurfer_labels] subprocess.check_output(cmd) # DCAN-HCP fMRISurface # https://github.com/DCAN-Labs/DCAN-HCP/blob/master/fMRISurface/GenericfMRISurfaceProcessingPipeline.sh cmd = ['bash', '/code/CPAC/surface/fMRISurface/run.sh', '--post_freesurfer_folder', post_freesurfer_folder,\ '--subject', subject, '--fmri', atlas_space_bold, '--scout', scout_bold, '--lowresmesh', low_res_mesh, '--grayordinatesres', gray_ordinates_res, '--fmrires', fmri_res, '--smoothingFWHM', smooth_fwhm] subprocess.check_output(cmd) out_file = os.path.join(post_freesurfer_folder, 'MNINonLinear/Results/task-rest01/task-rest01_Atlas.dtseries.nii') return out_file def surface_connector(wf, cfg, strat_pool, pipe_num, opt): surf = pe.Node(util.Function(input_names=['post_freesurfer_folder', 'freesurfer_folder', 'subject', 't1w_restore_image', 'atlas_space_t1w_image', 'atlas_transform', 'inverse_atlas_transform', 'atlas_space_bold', 'scout_bold', 'surf_atlas_dir', 'gray_ordinates_dir', 'gray_ordinates_res', 'high_res_mesh', 'low_res_mesh', 'subcortical_gray_labels', 'freesurfer_labels', 'fmri_res', 'smooth_fwhm'], output_names=['out_file'], function=run_surface), name=f'post_freesurfer_{pipe_num}') surf.inputs.subject = cfg['subject_id'] surf.inputs.post_freesurfer_folder = os.path.join(cfg.pipeline_setup['working_directory']['path'], 'cpac_'+cfg['subject_id'], f'post_freesurfer_{pipe_num}') surf.inputs.surf_atlas_dir = cfg.surface_analysis['post_freesurfer']['surf_atlas_dir'] surf.inputs.gray_ordinates_dir = cfg.surface_analysis['post_freesurfer']['gray_ordinates_dir'] surf.inputs.subcortical_gray_labels = cfg.surface_analysis['post_freesurfer']['subcortical_gray_labels'] surf.inputs.freesurfer_labels = cfg.surface_analysis['post_freesurfer']['freesurfer_labels'] # convert integers to strings as subprocess requires string inputs surf.inputs.gray_ordinates_res = str(cfg.surface_analysis['post_freesurfer']['gray_ordinates_res']) surf.inputs.high_res_mesh = str(cfg.surface_analysis['post_freesurfer']['high_res_mesh']) surf.inputs.low_res_mesh = str(cfg.surface_analysis['post_freesurfer']['low_res_mesh']) surf.inputs.fmri_res = str(cfg.surface_analysis['post_freesurfer']['fmri_res']) surf.inputs.smooth_fwhm = str(cfg.surface_analysis['post_freesurfer']['smooth_fwhm']) node, out = strat_pool.get_data('freesurfer-subject-dir') wf.connect(node, out, surf, 'freesurfer_folder') node, out = strat_pool.get_data('desc-restore_T1w') wf.connect(node, out, surf, 't1w_restore_image') node, out = strat_pool.get_data('space-template_desc-head_T1w') wf.connect(node, out, surf, 'atlas_space_t1w_image') node, out = strat_pool.get_data('from-T1w_to-template_mode-image_xfm') wf.connect(node, out, surf, 'atlas_transform') node, out = strat_pool.get_data('from-template_to-T1w_mode-image_xfm') wf.connect(node, out, surf, 'inverse_atlas_transform') node, out = strat_pool.get_data('space-template_desc-brain_bold') wf.connect(node, out, surf, 'atlas_space_bold') node, out = strat_pool.get_data('space-template_desc-scout_bold') wf.connect(node, out, surf, 'scout_bold') outputs = { 'space-fsLR_den-32k_bold-dtseries': (surf, 'out_file') } return wf, outputs def surface_preproc(wf, cfg, strat_pool, pipe_num, opt=None): ''' {"name": "surface_preproc", "config": ["surface_analysis", "post_freesurfer"], "switch": ["run"], "option_key": "None", "option_val": "None", "inputs": ["freesurfer-subject-dir", "desc-restore_T1w", "space-template_desc-head_T1w", "from-T1w_to-template_mode-image_xfm", "from-template_to-T1w_mode-image_xfm", "space-template_desc-brain_bold", "space-template_desc-scout_bold"], "outputs": ["space-fsLR_den-32k_bold-dtseries"]} ''' wf, outputs = surface_connector(wf, cfg, strat_pool, pipe_num, opt) return (wf, outputs)
FCP-INDI/C-PAC
CPAC/surface/surf_preproc.py
Python
bsd-3-clause
6,597
0.00864
# -*- coding: utf-8 -*- cont = 0 v = [] for i in range(6): v.append(float(raw_input())) if (v[i] > 0): cont = cont + 1 print("%d valores positivos" % cont)
bergolho1337/URI-Online-Judge
Basicos/Python/1060/main.py
Python
gpl-2.0
173
0
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Unit tests for the 'grit build' tool. ''' import codecs import os import sys import tempfile if __name__ == '__main__': sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) import unittest from grit import util from grit.tool import build class BuildUnittest(unittest.TestCase): def testFindTranslationsWithSubstitutions(self): # This is a regression test; we had a bug where GRIT would fail to find # messages with substitutions e.g. "Hello [IDS_USER]" where IDS_USER is # another <message>. output_dir = tempfile.mkdtemp() builder = build.RcBuilder() class DummyOpts(object): def __init__(self): self.input = util.PathFromRoot('grit/testdata/substitute.grd') self.verbose = False self.extra_verbose = False builder.Run(DummyOpts(), ['-o', output_dir]) def testGenerateDepFile(self): output_dir = tempfile.mkdtemp() builder = build.RcBuilder() class DummyOpts(object): def __init__(self): self.input = util.PathFromRoot('grit/testdata/substitute.grd') self.verbose = False self.extra_verbose = False expected_dep_file = os.path.join(output_dir, 'substitute.grd.d') builder.Run(DummyOpts(), ['-o', output_dir, '--depdir', output_dir, '--depfile', expected_dep_file]) self.failUnless(os.path.isfile(expected_dep_file)) with open(expected_dep_file) as f: line = f.readline() (dep_output_file, deps_string) = line.split(': ') deps = deps_string.split(' ') self.failUnlessEqual("resource.h", dep_output_file) self.failUnlessEqual(1, len(deps)) self.failUnlessEqual(deps[0], util.PathFromRoot('grit/testdata/substitute.xmb')) def testGenerateDepFileWithResourceIds(self): output_dir = tempfile.mkdtemp() builder = build.RcBuilder() class DummyOpts(object): def __init__(self): self.input = util.PathFromRoot('grit/testdata/substitute_no_ids.grd') self.verbose = False self.extra_verbose = False expected_dep_file = os.path.join(output_dir, 'substitute_no_ids.grd.d') builder.Run(DummyOpts(), ['-f', util.PathFromRoot('grit/testdata/resource_ids'), '-o', output_dir, '--depdir', output_dir, '--depfile', expected_dep_file]) self.failUnless(os.path.isfile(expected_dep_file)) with open(expected_dep_file) as f: line = f.readline() (dep_output_file, deps_string) = line.split(': ') deps = deps_string.split(' ') self.failUnlessEqual("resource.h", dep_output_file) self.failUnlessEqual(2, len(deps)) self.failUnlessEqual(deps[0], util.PathFromRoot('grit/testdata/substitute.xmb')) self.failUnlessEqual(deps[1], util.PathFromRoot('grit/testdata/resource_ids')) def testAssertOutputs(self): output_dir = tempfile.mkdtemp() class DummyOpts(object): def __init__(self): self.input = util.PathFromRoot('grit/testdata/substitute.grd') self.verbose = False self.extra_verbose = False # Incomplete output file list should fail. builder_fail = build.RcBuilder() self.failUnlessEqual(2, builder_fail.Run(DummyOpts(), [ '-o', output_dir, '-a', os.path.abspath( os.path.join(output_dir, 'en_generated_resources.rc'))])) # Complete output file list should succeed. builder_ok = build.RcBuilder() self.failUnlessEqual(0, builder_ok.Run(DummyOpts(), [ '-o', output_dir, '-a', os.path.abspath( os.path.join(output_dir, 'en_generated_resources.rc')), '-a', os.path.abspath( os.path.join(output_dir, 'sv_generated_resources.rc')), '-a', os.path.abspath( os.path.join(output_dir, 'resource.h'))])) def _verifyWhitelistedOutput(self, filename, whitelisted_ids, non_whitelisted_ids, encoding='utf8'): self.failUnless(os.path.exists(filename)) whitelisted_ids_found = [] non_whitelisted_ids_found = [] with codecs.open(filename, encoding=encoding) as f: for line in f.readlines(): for whitelisted_id in whitelisted_ids: if whitelisted_id in line: whitelisted_ids_found.append(whitelisted_id) for non_whitelisted_id in non_whitelisted_ids: if non_whitelisted_id in line: non_whitelisted_ids_found.append(non_whitelisted_id) self.longMessage = True self.assertEqual(whitelisted_ids, whitelisted_ids_found, '\nin file {}'.format(os.path.basename(filename))) non_whitelisted_msg = ('Non-Whitelisted IDs {} found in {}' .format(non_whitelisted_ids_found, os.path.basename(filename))) self.assertFalse(non_whitelisted_ids_found, non_whitelisted_msg) def testWhitelistStrings(self): output_dir = tempfile.mkdtemp() builder = build.RcBuilder() class DummyOpts(object): def __init__(self): self.input = util.PathFromRoot('grit/testdata/whitelist_strings.grd') self.verbose = False self.extra_verbose = False whitelist_file = util.PathFromRoot('grit/testdata/whitelist.txt') builder.Run(DummyOpts(), ['-o', output_dir, '-w', whitelist_file]) header = os.path.join(output_dir, 'whitelist_test_resources.h') rc = os.path.join(output_dir, 'en_whitelist_test_strings.rc') whitelisted_ids = ['IDS_MESSAGE_WHITELISTED'] non_whitelisted_ids = ['IDS_MESSAGE_NOT_WHITELISTED'] self._verifyWhitelistedOutput( header, whitelisted_ids, non_whitelisted_ids, ) self._verifyWhitelistedOutput( rc, whitelisted_ids, non_whitelisted_ids, encoding='utf16' ) def testWhitelistResources(self): output_dir = tempfile.mkdtemp() builder = build.RcBuilder() class DummyOpts(object): def __init__(self): self.input = util.PathFromRoot('grit/testdata/whitelist_resources.grd') self.verbose = False self.extra_verbose = False whitelist_file = util.PathFromRoot('grit/testdata/whitelist.txt') builder.Run(DummyOpts(), ['-o', output_dir, '-w', whitelist_file]) header = os.path.join(output_dir, 'whitelist_test_resources.h') map_cc = os.path.join(output_dir, 'whitelist_test_resources_map.cc') map_h = os.path.join(output_dir, 'whitelist_test_resources_map.h') pak = os.path.join(output_dir, 'whitelist_test_resources.pak') # Ensure the resource map header and .pak files exist, but don't verify # their content. self.failUnless(os.path.exists(map_h)) self.failUnless(os.path.exists(pak)) whitelisted_ids = [ 'IDR_STRUCTURE_WHITELISTED', 'IDR_STRUCTURE_IN_TRUE_IF_WHITELISTED', 'IDR_INCLUDE_WHITELISTED', ] non_whitelisted_ids = [ 'IDR_STRUCTURE_NOT_WHITELISTED', 'IDR_STRUCTURE_IN_TRUE_IF_NOT_WHITELISTED', 'IDR_STRUCTURE_IN_FALSE_IF_WHITELISTED', 'IDR_STRUCTURE_IN_FALSE_IF_NOT_WHITELISTED', 'IDR_INCLUDE_NOT_WHITELISTED', ] for output_file in (header, map_cc): self._verifyWhitelistedOutput( output_file, whitelisted_ids, non_whitelisted_ids, ) def testOutputAllResourceDefinesTrue(self): output_dir = tempfile.mkdtemp() builder = build.RcBuilder() class DummyOpts(object): def __init__(self): self.input = util.PathFromRoot('grit/testdata/whitelist_resources.grd') self.verbose = False self.extra_verbose = False whitelist_file = util.PathFromRoot('grit/testdata/whitelist.txt') builder.Run(DummyOpts(), ['-o', output_dir, '-w', whitelist_file, '--output-all-resource-defines',]) header = os.path.join(output_dir, 'whitelist_test_resources.h') map_cc = os.path.join(output_dir, 'whitelist_test_resources_map.cc') whitelisted_ids = [ 'IDR_STRUCTURE_WHITELISTED', 'IDR_STRUCTURE_NOT_WHITELISTED', 'IDR_STRUCTURE_IN_TRUE_IF_WHITELISTED', 'IDR_STRUCTURE_IN_TRUE_IF_NOT_WHITELISTED', 'IDR_STRUCTURE_IN_FALSE_IF_WHITELISTED', 'IDR_STRUCTURE_IN_FALSE_IF_NOT_WHITELISTED', 'IDR_INCLUDE_WHITELISTED', 'IDR_INCLUDE_NOT_WHITELISTED', ] non_whitelisted_ids = [] for output_file in (header, map_cc): self._verifyWhitelistedOutput( output_file, whitelisted_ids, non_whitelisted_ids, ) def testOutputAllResourceDefinesFalse(self): output_dir = tempfile.mkdtemp() builder = build.RcBuilder() class DummyOpts(object): def __init__(self): self.input = util.PathFromRoot('grit/testdata/whitelist_resources.grd') self.verbose = False self.extra_verbose = False whitelist_file = util.PathFromRoot('grit/testdata/whitelist.txt') builder.Run(DummyOpts(), ['-o', output_dir, '-w', whitelist_file, '--no-output-all-resource-defines',]) header = os.path.join(output_dir, 'whitelist_test_resources.h') map_cc = os.path.join(output_dir, 'whitelist_test_resources_map.cc') whitelisted_ids = [ 'IDR_STRUCTURE_WHITELISTED', 'IDR_STRUCTURE_IN_TRUE_IF_WHITELISTED', 'IDR_INCLUDE_WHITELISTED', ] non_whitelisted_ids = [ 'IDR_STRUCTURE_NOT_WHITELISTED', 'IDR_STRUCTURE_IN_TRUE_IF_NOT_WHITELISTED', 'IDR_STRUCTURE_IN_FALSE_IF_WHITELISTED', 'IDR_STRUCTURE_IN_FALSE_IF_NOT_WHITELISTED', 'IDR_INCLUDE_NOT_WHITELISTED', ] for output_file in (header, map_cc): self._verifyWhitelistedOutput( output_file, whitelisted_ids, non_whitelisted_ids, ) def testWriteOnlyNew(self): output_dir = tempfile.mkdtemp() builder = build.RcBuilder() class DummyOpts(object): def __init__(self): self.input = util.PathFromRoot('grit/testdata/substitute.grd') self.verbose = False self.extra_verbose = False UNCHANGED = 10 header = os.path.join(output_dir, 'resource.h') builder.Run(DummyOpts(), ['-o', output_dir]) self.failUnless(os.path.exists(header)) first_mtime = os.stat(header).st_mtime os.utime(header, (UNCHANGED, UNCHANGED)) builder.Run(DummyOpts(), ['-o', output_dir, '--write-only-new', '0']) self.failUnless(os.path.exists(header)) second_mtime = os.stat(header).st_mtime os.utime(header, (UNCHANGED, UNCHANGED)) builder.Run(DummyOpts(), ['-o', output_dir, '--write-only-new', '1']) self.failUnless(os.path.exists(header)) third_mtime = os.stat(header).st_mtime self.assertTrue(abs(second_mtime - UNCHANGED) > 5) self.assertTrue(abs(third_mtime - UNCHANGED) < 5) if __name__ == '__main__': unittest.main()
sgraham/nope
tools/grit/grit/tool/build_unittest.py
Python
bsd-3-clause
11,256
0.00613
# coding: utf-8 # (c) 2015, Toshio Kuratomi <[email protected]> # # 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/>. # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from io import StringIO from units.compat import unittest from ansible import errors from ansible.module_utils.six import text_type, binary_type from ansible.module_utils.common._collections_compat import Sequence, Set, Mapping from ansible.parsing.yaml.loader import AnsibleLoader from ansible.parsing import vault from ansible.parsing.yaml.objects import AnsibleVaultEncryptedUnicode from ansible.parsing.yaml.dumper import AnsibleDumper from units.mock.yaml_helper import YamlTestUtils from units.mock.vault_helper import TextVaultSecret from yaml.parser import ParserError from yaml.scanner import ScannerError class NameStringIO(StringIO): """In py2.6, StringIO doesn't let you set name because a baseclass has it as readonly property""" name = None def __init__(self, *args, **kwargs): super(NameStringIO, self).__init__(*args, **kwargs) class TestAnsibleLoaderBasic(unittest.TestCase): def test_parse_number(self): stream = StringIO(u""" 1 """) loader = AnsibleLoader(stream, 'myfile.yml') data = loader.get_single_data() self.assertEqual(data, 1) # No line/column info saved yet def test_parse_string(self): stream = StringIO(u""" Ansible """) loader = AnsibleLoader(stream, 'myfile.yml') data = loader.get_single_data() self.assertEqual(data, u'Ansible') self.assertIsInstance(data, text_type) self.assertEqual(data.ansible_pos, ('myfile.yml', 2, 17)) def test_parse_utf8_string(self): stream = StringIO(u""" Cafè Eñyei """) loader = AnsibleLoader(stream, 'myfile.yml') data = loader.get_single_data() self.assertEqual(data, u'Cafè Eñyei') self.assertIsInstance(data, text_type) self.assertEqual(data.ansible_pos, ('myfile.yml', 2, 17)) def test_parse_dict(self): stream = StringIO(u""" webster: daniel oed: oxford """) loader = AnsibleLoader(stream, 'myfile.yml') data = loader.get_single_data() self.assertEqual(data, {'webster': 'daniel', 'oed': 'oxford'}) self.assertEqual(len(data), 2) self.assertIsInstance(list(data.keys())[0], text_type) self.assertIsInstance(list(data.values())[0], text_type) # Beginning of the first key self.assertEqual(data.ansible_pos, ('myfile.yml', 2, 17)) self.assertEqual(data[u'webster'].ansible_pos, ('myfile.yml', 2, 26)) self.assertEqual(data[u'oed'].ansible_pos, ('myfile.yml', 3, 22)) def test_parse_list(self): stream = StringIO(u""" - a - b """) loader = AnsibleLoader(stream, 'myfile.yml') data = loader.get_single_data() self.assertEqual(data, [u'a', u'b']) self.assertEqual(len(data), 2) self.assertIsInstance(data[0], text_type) self.assertEqual(data.ansible_pos, ('myfile.yml', 2, 17)) self.assertEqual(data[0].ansible_pos, ('myfile.yml', 2, 19)) self.assertEqual(data[1].ansible_pos, ('myfile.yml', 3, 19)) def test_parse_short_dict(self): stream = StringIO(u"""{"foo": "bar"}""") loader = AnsibleLoader(stream, 'myfile.yml') data = loader.get_single_data() self.assertEqual(data, dict(foo=u'bar')) self.assertEqual(data.ansible_pos, ('myfile.yml', 1, 1)) self.assertEqual(data[u'foo'].ansible_pos, ('myfile.yml', 1, 9)) stream = StringIO(u"""foo: bar""") loader = AnsibleLoader(stream, 'myfile.yml') data = loader.get_single_data() self.assertEqual(data, dict(foo=u'bar')) self.assertEqual(data.ansible_pos, ('myfile.yml', 1, 1)) self.assertEqual(data[u'foo'].ansible_pos, ('myfile.yml', 1, 6)) def test_error_conditions(self): stream = StringIO(u"""{""") loader = AnsibleLoader(stream, 'myfile.yml') self.assertRaises(ParserError, loader.get_single_data) def test_tab_error(self): stream = StringIO(u"""---\nhosts: localhost\nvars:\n foo: bar\n\tblip: baz""") loader = AnsibleLoader(stream, 'myfile.yml') self.assertRaises(ScannerError, loader.get_single_data) def test_front_matter(self): stream = StringIO(u"""---\nfoo: bar""") loader = AnsibleLoader(stream, 'myfile.yml') data = loader.get_single_data() self.assertEqual(data, dict(foo=u'bar')) self.assertEqual(data.ansible_pos, ('myfile.yml', 2, 1)) self.assertEqual(data[u'foo'].ansible_pos, ('myfile.yml', 2, 6)) # Initial indent (See: #6348) stream = StringIO(u""" - foo: bar\n baz: qux""") loader = AnsibleLoader(stream, 'myfile.yml') data = loader.get_single_data() self.assertEqual(data, [{u'foo': u'bar', u'baz': u'qux'}]) self.assertEqual(data.ansible_pos, ('myfile.yml', 1, 2)) self.assertEqual(data[0].ansible_pos, ('myfile.yml', 1, 4)) self.assertEqual(data[0][u'foo'].ansible_pos, ('myfile.yml', 1, 9)) self.assertEqual(data[0][u'baz'].ansible_pos, ('myfile.yml', 2, 9)) class TestAnsibleLoaderVault(unittest.TestCase, YamlTestUtils): def setUp(self): self.vault_password = "hunter42" vault_secret = TextVaultSecret(self.vault_password) self.vault_secrets = [('vault_secret', vault_secret), ('default', vault_secret)] self.vault = vault.VaultLib(self.vault_secrets) @property def vault_secret(self): return vault.match_encrypt_secret(self.vault_secrets)[1] def test_wrong_password(self): plaintext = u"Ansible" bob_password = "this is a different password" bobs_secret = TextVaultSecret(bob_password) bobs_secrets = [('default', bobs_secret)] bobs_vault = vault.VaultLib(bobs_secrets) ciphertext = bobs_vault.encrypt(plaintext, vault.match_encrypt_secret(bobs_secrets)[1]) try: self.vault.decrypt(ciphertext) except Exception as e: self.assertIsInstance(e, errors.AnsibleError) self.assertEqual(e.message, 'Decryption failed (no vault secrets were found that could decrypt)') def _encrypt_plaintext(self, plaintext): # Construct a yaml repr of a vault by hand vaulted_var_bytes = self.vault.encrypt(plaintext, self.vault_secret) # add yaml tag vaulted_var = vaulted_var_bytes.decode() lines = vaulted_var.splitlines() lines2 = [] for line in lines: lines2.append(' %s' % line) vaulted_var = '\n'.join(lines2) tagged_vaulted_var = u"""!vault |\n%s""" % vaulted_var return tagged_vaulted_var def _build_stream(self, yaml_text): stream = NameStringIO(yaml_text) stream.name = 'my.yml' return stream def _loader(self, stream): return AnsibleLoader(stream, vault_secrets=self.vault.secrets) def _load_yaml(self, yaml_text, password): stream = self._build_stream(yaml_text) loader = self._loader(stream) data_from_yaml = loader.get_single_data() return data_from_yaml def test_dump_load_cycle(self): avu = AnsibleVaultEncryptedUnicode.from_plaintext('The plaintext for test_dump_load_cycle.', self.vault, self.vault_secret) self._dump_load_cycle(avu) def test_embedded_vault_from_dump(self): avu = AnsibleVaultEncryptedUnicode.from_plaintext('setec astronomy', self.vault, self.vault_secret) blip = {'stuff1': [{'a dict key': 24}, {'shhh-ssh-secrets': avu, 'nothing to see here': 'move along'}], 'another key': 24.1} blip = ['some string', 'another string', avu] stream = NameStringIO() self._dump_stream(blip, stream, dumper=AnsibleDumper) stream.seek(0) stream.seek(0) loader = self._loader(stream) data_from_yaml = loader.get_data() stream2 = NameStringIO(u'') # verify we can dump the object again self._dump_stream(data_from_yaml, stream2, dumper=AnsibleDumper) def test_embedded_vault(self): plaintext_var = u"""This is the plaintext string.""" tagged_vaulted_var = self._encrypt_plaintext(plaintext_var) another_vaulted_var = self._encrypt_plaintext(plaintext_var) different_var = u"""A different string that is not the same as the first one.""" different_vaulted_var = self._encrypt_plaintext(different_var) yaml_text = u"""---\nwebster: daniel\noed: oxford\nthe_secret: %s\nanother_secret: %s\ndifferent_secret: %s""" % (tagged_vaulted_var, another_vaulted_var, different_vaulted_var) data_from_yaml = self._load_yaml(yaml_text, self.vault_password) vault_string = data_from_yaml['the_secret'] self.assertEqual(plaintext_var, data_from_yaml['the_secret']) test_dict = {} test_dict[vault_string] = 'did this work?' self.assertEqual(vault_string.data, vault_string) # This looks weird and useless, but the object in question has a custom __eq__ self.assertEqual(vault_string, vault_string) another_vault_string = data_from_yaml['another_secret'] different_vault_string = data_from_yaml['different_secret'] self.assertEqual(vault_string, another_vault_string) self.assertNotEqual(vault_string, different_vault_string) # More testing of __eq__/__ne__ self.assertTrue('some string' != vault_string) self.assertNotEqual('some string', vault_string) # Note this is a compare of the str/unicode of these, they are different types # so we want to test self == other, and other == self etc self.assertEqual(plaintext_var, vault_string) self.assertEqual(vault_string, plaintext_var) self.assertFalse(plaintext_var != vault_string) self.assertFalse(vault_string != plaintext_var) class TestAnsibleLoaderPlay(unittest.TestCase): def setUp(self): stream = NameStringIO(u""" - hosts: localhost vars: number: 1 string: Ansible utf8_string: Cafè Eñyei dictionary: webster: daniel oed: oxford list: - a - b - 1 - 2 tasks: - name: Test case ping: data: "{{ utf8_string }}" - name: Test 2 ping: data: "Cafè Eñyei" - name: Test 3 command: "printf 'Cafè Eñyei\\n'" """) self.play_filename = '/path/to/myplay.yml' stream.name = self.play_filename self.loader = AnsibleLoader(stream) self.data = self.loader.get_single_data() def tearDown(self): pass def test_data_complete(self): self.assertEqual(len(self.data), 1) self.assertIsInstance(self.data, list) self.assertEqual(frozenset(self.data[0].keys()), frozenset((u'hosts', u'vars', u'tasks'))) self.assertEqual(self.data[0][u'hosts'], u'localhost') self.assertEqual(self.data[0][u'vars'][u'number'], 1) self.assertEqual(self.data[0][u'vars'][u'string'], u'Ansible') self.assertEqual(self.data[0][u'vars'][u'utf8_string'], u'Cafè Eñyei') self.assertEqual(self.data[0][u'vars'][u'dictionary'], { u'webster': u'daniel', u'oed': u'oxford' }) self.assertEqual(self.data[0][u'vars'][u'list'], [u'a', u'b', 1, 2]) self.assertEqual(self.data[0][u'tasks'], [ {u'name': u'Test case', u'ping': {u'data': u'{{ utf8_string }}'}}, {u'name': u'Test 2', u'ping': {u'data': u'Cafè Eñyei'}}, {u'name': u'Test 3', u'command': u'printf \'Cafè Eñyei\n\''}, ]) def walk(self, data): # Make sure there's no str in the data self.assertNotIsInstance(data, binary_type) # Descend into various container types if isinstance(data, text_type): # strings are a sequence so we have to be explicit here return elif isinstance(data, (Sequence, Set)): for element in data: self.walk(element) elif isinstance(data, Mapping): for k, v in data.items(): self.walk(k) self.walk(v) # Scalars were all checked so we're good to go return def test_no_str_in_data(self): # Checks that no strings are str type self.walk(self.data) def check_vars(self): # Numbers don't have line/col information yet # self.assertEqual(self.data[0][u'vars'][u'number'].ansible_pos, (self.play_filename, 4, 21)) self.assertEqual(self.data[0][u'vars'][u'string'].ansible_pos, (self.play_filename, 5, 29)) self.assertEqual(self.data[0][u'vars'][u'utf8_string'].ansible_pos, (self.play_filename, 6, 34)) self.assertEqual(self.data[0][u'vars'][u'dictionary'].ansible_pos, (self.play_filename, 8, 23)) self.assertEqual(self.data[0][u'vars'][u'dictionary'][u'webster'].ansible_pos, (self.play_filename, 8, 32)) self.assertEqual(self.data[0][u'vars'][u'dictionary'][u'oed'].ansible_pos, (self.play_filename, 9, 28)) self.assertEqual(self.data[0][u'vars'][u'list'].ansible_pos, (self.play_filename, 11, 23)) self.assertEqual(self.data[0][u'vars'][u'list'][0].ansible_pos, (self.play_filename, 11, 25)) self.assertEqual(self.data[0][u'vars'][u'list'][1].ansible_pos, (self.play_filename, 12, 25)) # Numbers don't have line/col info yet # self.assertEqual(self.data[0][u'vars'][u'list'][2].ansible_pos, (self.play_filename, 13, 25)) # self.assertEqual(self.data[0][u'vars'][u'list'][3].ansible_pos, (self.play_filename, 14, 25)) def check_tasks(self): # # First Task # self.assertEqual(self.data[0][u'tasks'][0].ansible_pos, (self.play_filename, 16, 23)) self.assertEqual(self.data[0][u'tasks'][0][u'name'].ansible_pos, (self.play_filename, 16, 29)) self.assertEqual(self.data[0][u'tasks'][0][u'ping'].ansible_pos, (self.play_filename, 18, 25)) self.assertEqual(self.data[0][u'tasks'][0][u'ping'][u'data'].ansible_pos, (self.play_filename, 18, 31)) # # Second Task # self.assertEqual(self.data[0][u'tasks'][1].ansible_pos, (self.play_filename, 20, 23)) self.assertEqual(self.data[0][u'tasks'][1][u'name'].ansible_pos, (self.play_filename, 20, 29)) self.assertEqual(self.data[0][u'tasks'][1][u'ping'].ansible_pos, (self.play_filename, 22, 25)) self.assertEqual(self.data[0][u'tasks'][1][u'ping'][u'data'].ansible_pos, (self.play_filename, 22, 31)) # # Third Task # self.assertEqual(self.data[0][u'tasks'][2].ansible_pos, (self.play_filename, 24, 23)) self.assertEqual(self.data[0][u'tasks'][2][u'name'].ansible_pos, (self.play_filename, 24, 29)) self.assertEqual(self.data[0][u'tasks'][2][u'command'].ansible_pos, (self.play_filename, 25, 32)) def test_line_numbers(self): # Check the line/column numbers are correct # Note: Remember, currently dicts begin at the start of their first entry self.assertEqual(self.data[0].ansible_pos, (self.play_filename, 2, 19)) self.assertEqual(self.data[0][u'hosts'].ansible_pos, (self.play_filename, 2, 26)) self.assertEqual(self.data[0][u'vars'].ansible_pos, (self.play_filename, 4, 21)) self.check_vars() self.assertEqual(self.data[0][u'tasks'].ansible_pos, (self.play_filename, 16, 21)) self.check_tasks()
ganeshrn/ansible
test/units/parsing/yaml/test_loader.py
Python
gpl-3.0
17,230
0.002266
# -*- coding: utf-8 -*- from django.contrib.contenttypes.models import ContentType from django.db import models class TCMSLogManager(models.Manager): def for_model(self, model): """ QuerySet for all comments for a particular model (either an instance or a class). """ ct = ContentType.objects.get_for_model(model) qs = self.get_queryset().filter(content_type=ct) if isinstance(model, models.Model): qs = qs.filter(object_pk=model.pk) return qs
Nitrate/Nitrate
src/tcms/logs/managers.py
Python
gpl-2.0
527
0
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2015-2016 James Clark <[email protected]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. """ nrburst_pickle_preserve.py Crunch together pickles from nrburst_match.py """ import sys import glob import cPickle as pickle import numpy as np pickle_files = glob.glob(sys.argv[1]+'*pickle') user_tag = sys.argv[2] delta_samp=100 sample_pairs=zip(range(0,1000,delta_samp), range(delta_samp-1,1000,delta_samp)) # Get numbers for pre-allocation sim_instances = [name.split('-')[1] for name in pickle_files] sim_names = np.unique(sim_instances) # XXX: assume all sample runs have same number of jobs.. n_sample_runs = sim_instances.count(sim_names[0]) # Load first one to extract data for preallocation current_matches, current_masses, current_inclinations, config, \ simulations = pickle.load(open(pickle_files[0],'r')) nSims = len(sim_names) nsampls = config.nsampls * n_sample_runs # --- Preallocate matches = np.zeros(shape=(nSims, nsampls)) masses = np.zeros(shape=(nSims, nsampls)) inclinations = np.zeros(shape=(nSims, nsampls)) # be a bit careful with the simulations object setattr(simulations, 'simulations', []) setattr(simulations, 'nsimulations', nSims) for f, name in enumerate(sim_names): startidx=0 endidx=len(current_matches[0]) for s in xrange(n_sample_runs): if n_sample_runs>1: file = glob.glob('*%s-minsamp_%d-maxsamp_%d*'%( name, min(sample_pairs[s]), max(sample_pairs[s])))[0] else: file = pickle_files[f] current_matches, current_masses, current_inclinations, config, \ current_simulations = pickle.load(open(file,'r')) matches[f,startidx:endidx] = current_matches[0] masses[f,startidx:endidx] = current_masses[0] inclinations[f,startidx:endidx] = current_inclinations[0] startidx += len(current_matches[0]) endidx = startidx + len(current_matches[0]) simulations.simulations.append(current_simulations.simulations[0]) filename=user_tag+'_'+config.algorithm+'.pickle' pickle.dump([matches, masses, inclinations, config, simulations], open(filename, "wb"))
astroclark/numrel_bursts
nrburst_utils/nrburst_pickle_preserve.py
Python
gpl-2.0
2,870
0.007666
# The MIT License # # Copyright (c) 2008 James Piechota # # 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. import sys import os import unittest import difflib import filecmp import ns.bridge.io.CDLReader as CDLReader import ns.evolve.Genotype as Genotype class TestGenotype(unittest.TestCase): def setUp(self): self.scratchFile = "R:/scratch/out.cdl" def tearDown(self): try: os.remove(self.scratchFile) except: pass def testOutputChannels(self): ''' Test that the Genotype calculates the right output channels. ''' input = "R:/massive/testdata/cdl/man/CDL/embedded_simple.cdl" agentSpec = CDLReader.read(input, CDLReader.kEvolveTokens) geno = Genotype.Genotype(agentSpec) expectedChannels = [ "ty", "rx", "ry", "rz", "height", "leg_length", "shirt_map", "walk", "walk_45L", "walk_sad", "walk->walk_45L", "walk->walk_sad", "walk_45L->walk", "walk_45L->walk_sad", "walk_sad->walk", "walk_sad->walk_45L", "walk:rate", "walk_45L:rate", "walk_sad:rate" ] self.assertEqual(sorted(expectedChannels), sorted(geno.outputChannels())) #os.system("xdiff.exe %s %s" % (input, self.scratchFile)) suite = unittest.TestLoader().loadTestsFromTestCase(TestGenotype)
redpawfx/massiveImporter
python/ns/tests/TestGenotype.py
Python
mit
2,335
0.02227
from dxr.lines import Ref from dxr.utils import search_url class _PythonPluginAttr(object): plugin = 'python' class ClassRef(Ref, _PythonPluginAttr): """A reference attached to a class definition""" def menu_items(self): qualname = self.menu_data yield {'html': 'Find subclasses', 'title': 'Find subclasses of this class', 'href': search_url(self.tree, '+derived:' + qualname), 'icon': 'type'} yield {'html': 'Find base classes', 'title': 'Find base classes of this class', 'href': search_url(self.tree, '+bases:' + qualname), 'icon': 'type'}
bozzmob/dxr
dxr/plugins/python/menus.py
Python
mit
674
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun """ from twisted.internet import reactor from twisted.internet import protocol class EchoClient(protocol.Protocol): def connectionMade(self): self.transport.write(bytes("hello zengchunyun", "utf8")) def dataReceived(self, data): print("server said: {}".format(data)) self.transport.loseConnection() def connectionLost(self, reason): print("Connection lost") class EchoFactory(protocol.ClientFactory): protocol = EchoClient def clientConnectionFailed(self, connector, reason): print("Connection failed - goodbye") reactor.stop() def clientConnectionLost(self, connector, reason): print("Connection lost - goodbye") reactor.stop() def main(): f = EchoFactory() reactor.connectTCP("localhost", 1234, f) reactor.run() if __name__ == "__main__": main()
zengchunyun/s12
day9/temp/ext/twisted_client.py
Python
gpl-2.0
935
0.00107
""" xml.py - Copyright (C) 2016 Tobias Helfenstein <[email protected]> Copyright (C) 2016 Anton Hammer <[email protected]> Copyright (C) 2016 Sebastian Hein <[email protected]> Copyright (C) 2016 Hochschule für Forstwirtschaft Rottenburg <[email protected]> This file is part of Wuchshüllenrechner. Wuchshüllenrechner 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. Wuchshüllenrechner 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 xml.etree.ElementTree as ElementTree import logging import os import lib.files as FileHandling from lib.variants import Fence, Tube, VariantItem, Project class XMLFileWriter(): """ Creates a simple about dialog. The about dialog contains general information about the application and shows the copyright notice. That's why the class has no attributes or return values. """ def __init__(self): """The constructor initializes the class XMLFileWriter.""" pass def writeXMLFile(self, project, items, xmlfile): # check, if the filename is valid if not FileHandling.filename_is_valid(xmlfile, "xml"): raise ValueError("file name not valid") newfile = xmlfile.strip() # temporarily add _tmp to the filename, if the file already exists exists = os.path.isfile(newfile) if exists: newfile = newfile.replace(".xml", "_tmp.xml", 1) # write all XML data to the file try: xml = self.createXMLData(project, items) xml.write(newfile, xml_declaration=True, encoding="utf-8") if exists: os.remove(xmlfile.strip()) os.rename(newfile, xmlfile.strip()) except OSError: return False return True def createXMLData(self, project, items): # create root element with its project information root = ElementTree.Element("project") header = ElementTree.SubElement(root, "header") for p in project: data = ElementTree.SubElement(header, p) data.text = str(project[p]).strip() # create item list with its entries dataset = ElementTree.SubElement(root, "data") self.writeItemTree(items, dataset) return ElementTree.ElementTree(root) def writeItemTree(self, tree, element): for child in tree.children: item, plant, protection = child.prepareSerialization() # first serialize item's general data without an own element variantEntry = self.writeTags(item, "variant") element.append(variantEntry) # serialize plant data with its own element plantElement = self.writeTags(plant, "plant") variantEntry.append(plantElement) # at last serialize protection data with its own element protectionElement = self.writeTags(protection, "protection") variantEntry.append(protectionElement) if child.hasChildren(): childrenElement = ElementTree.SubElement(variantEntry, "children") self.writeItemTree(child, childrenElement) def writeTags(self, dictionary, name): # avoid side effects element = ElementTree.Element(name.strip()) for key, value in dictionary.items(): data = ElementTree.SubElement(element, key) data.text = str(value).strip() return element class XMLFileReader(): """Creates a simple about dialog. The about dialog contains general information about the application and shows the copyright notice. That's why the class has no attributes or return values. """ def __init__(self): """The constructor initializes the class XMLFileReader.""" self.root = None def readXMLFile(self, xmlfile): # check, if the filename is valid if not FileHandling.filename_is_valid(xmlfile, "xml"): raise ValueError("file name not valid") try: xml = ElementTree.parse(xmlfile) self.root = xml.getroot() except ElementTree.ParseError: return False return True def readItemTree(self, element): items = [] for variantEntry in element: kind = int(variantEntry.findtext("type", "-1")) child = VariantItem(protection=kind) item, plant, protection = child.prepareSerialization() # first read item's general data item = self.readTags(item, variantEntry) # read plant data plantElement = variantEntry.find("plant") plant = self.readTags(plant, plantElement) # at last read protection data protectionElement = variantEntry.find("protection") protection = self.readTags(protection, protectionElement) # add item to list child.deserialize((item, plant, protection)) items.append(child) childrenElement = variantEntry.find("children") if childrenElement: items.extend(self.readItemTree(childrenElement)) return items def readTags(self, dictionary, element): # avoid side effects tags = {} for key in dictionary: kind = type(dictionary[key]) data = element.findtext(key) if data: tags[key] = kind(data) return tags def getProject(self): if not self.root: return None project = Project() header = self.root.find("header") if None is not header: return self.readTags(project.__dict__, header) else: return None def getItems(self): if not self.root: return None dataset = self.root.find("data") try: items = self.readItemTree(dataset) except TypeError: return None return items
tobiashelfenstein/wuchshuellenrechner
wuchshuellenrechner/lib/xml.py
Python
gpl-3.0
6,767
0.005619
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import os import fnmatch import logging from gcdt_bundler.bundler_utils import glob_files, get_path_info from . import here ROOT_DIR = here('./resources/static_files') log = logging.getLogger(__name__) def test_find_two_files(): result = list(glob_files(ROOT_DIR, ['a/**'])) #assert list(result) == [ # (ROOT_DIR + '/a/aa.txt', 'a/aa.txt'), # (ROOT_DIR + '/a/ab.txt', 'a/ab.txt') #] assert (ROOT_DIR + '/a/aa.txt', 'a/aa.txt') in result assert (ROOT_DIR + '/a/ab.txt', 'a/ab.txt') in result def test_default_include(): result = list(glob_files(ROOT_DIR)) assert (ROOT_DIR + '/a/aa.txt', 'a/aa.txt') in result assert (ROOT_DIR + '/a/ab.txt', 'a/ab.txt') in result assert (ROOT_DIR + '/b/ba.txt', 'b/ba.txt') in result assert (ROOT_DIR + '/b/bb.txt', 'b/bb.txt') in result def test_later_include_has_precedence(): # note: this testcase is not exactly relevant any more since the tag # mechanism has been removed result = list(glob_files(ROOT_DIR, ['**', 'a/**'])) assert (ROOT_DIR + '/b/ba.txt', 'b/ba.txt') in result assert (ROOT_DIR + '/b/bb.txt', 'b/bb.txt') in result assert (ROOT_DIR + '/a/aa.txt', 'a/aa.txt') in result assert (ROOT_DIR + '/a/ab.txt', 'a/ab.txt') in result def test_exclude_file(): result = glob_files(ROOT_DIR, ['a/**'], ['a/aa.txt']) assert list(result) == [ (ROOT_DIR + '/a/ab.txt', 'a/ab.txt') ] def test_exclude_file_with_gcdtignore(): result = glob_files(ROOT_DIR, ['a/**'], gcdtignore=['aa.txt']) assert list(result) == [ (ROOT_DIR + '/a/ab.txt', 'a/ab.txt') ] def test_how_crazy_is_it(): f = '/a/b/c/d.txt' p = '/a/**/d.txt' assert fnmatch.fnmatchcase(f, p) def test_get_path_info_relative(): path = {'source': 'codedeploy', 'target': ''} base, ptz, target = get_path_info(path) assert base == os.getcwd() assert ptz == 'codedeploy' assert target == '/' def test_get_path_info_abs(): path = {'source': os.getcwd() + '/codedeploy', 'target': ''} base, ptz, target = get_path_info(path) assert base == os.getcwd() assert ptz == 'codedeploy' assert target == '/'
glomex/gcdt-bundler
tests/test_bundler_utils.py
Python
mit
2,286
0.000875
# -*- coding: utf-8 -*- from ..internal.misc import json from ..internal.MultiAccount import MultiAccount class OverLoadMe(MultiAccount): __name__ = "OverLoadMe" __type__ = "account" __version__ = "0.13" __status__ = "testing" __config__ = [("mh_mode", "all;listed;unlisted", "Filter hosters to use", "all"), ("mh_list", "str", "Hoster list (comma separated)", ""), ("mh_interval", "int", "Reload interval in hours", 12)] __description__ = """Over-Load.me account plugin""" __license__ = "GPLv3" __authors__ = [("marley", "[email protected]")] def grab_hosters(self, user, password, data): html = self.load("https://api.over-load.me/hoster.php", get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}) return [x for x in map( str.strip, html.replace("\"", "").split(",")) if x] def grab_info(self, user, password, data): html = self.load("https://api.over-load.me/account.php", get={'user': user, 'auth': password}).strip() data = json.loads(html) self.log_debug(data) #: Check for premium if data['membership'] == "Free": return {'premium': False, 'validuntil': None, 'trafficleft': None} else: return {'premium': True, 'validuntil': data['expirationunix'], 'trafficleft': -1} def signin(self, user, password, data): html = self.load("https://api.over-load.me/account.php", get={'user': user, 'auth': password}).strip() data = json.loads(html) if data['err'] == 1: self.fail_login()
Arno-Nymous/pyload
module/plugins/accounts/OverLoadMe.py
Python
gpl-3.0
1,824
0.001096
# Copyright 2008 (C) Nicira, Inc. # # This file is part of NOX. # # NOX 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. # # NOX 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 NOX. If not, see <http://www.gnu.org/licenses/>. #====================================================================== # # DHCP Message Format # # 0 1 2 3 # 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ # | op (1) | htype (1) | hlen (1) | hops (1) | # +---------------+---------------+---------------+---------------+ # | xid (4) | # +-------------------------------+-------------------------------+ # | secs (2) | flags (2) | # +-------------------------------+-------------------------------+ # | ciaddr (4) | # +---------------------------------------------------------------+ # | yiaddr (4) | # +---------------------------------------------------------------+ # | siaddr (4) | # +---------------------------------------------------------------+ # | giaddr (4) | # +---------------------------------------------------------------+ # | | # | chaddr (16) | # | | # | | # +---------------------------------------------------------------+ # | | # | sname (64) | # +---------------------------------------------------------------+ # | | # | file (128) | # +---------------------------------------------------------------+ # | | # | options (variable) | # +---------------------------------------------------------------+ # #====================================================================== import struct from packet_utils import * from packet_exceptions import * from array import * from packet_base import packet_base class dhcp(packet_base): "DHCP Packet struct" STRUCT_BOUNDARY = 28 MIN_LEN = 240 SERVER_PORT = 67 CLIENT_PORT = 68 BROADCAST_FLAG = 0x8000 BOOTREQUEST = 1 BOOTREPLY = 2 MSG_TYPE_OPT = 53 NUM_MSG_TYPES = 8 DISCOVER_MSG = 1 OFFER_MSG = 2 REQUEST_MSG = 3 DECLINE_MSG = 4 ACK_MSG = 5 NAK_MSG = 6 RELEASE_MSG = 7 INFORM_MSG = 8 SUBNET_MASK_OPT = 1 GATEWAY_OPT = 3 DNS_SERVER_OPT = 6 HOST_NAME_OPT = 12 DOMAIN_NAME_OPT = 15 MTU_OPT = 26 BCAST_ADDR_OPT = 28 REQUEST_IP_OPT = 50 REQUEST_LEASE_OPT = 51 OVERLOAD_OPT = 52 SERVER_ID_OPT = 54 PARAM_REQ_OPT = 55 T1_OPT = 58 T2_OPT = 59 CLIENT_ID_OPT = 61 PAD_OPT = 0 END_OPT = 255 MAGIC = array('B', '\x63\x82\x53\x63') def __init__(self, arr=None, prev=None): self.prev = prev if self.prev == None: self.op = 0 self.htype = 0 self.hlen = 0 self.hops = 0 self.xid = 0 self.secs = 0 self.flags = 0 self.ciaddr = 0 self.yiaddr = 0 self.siaddr = 0 self.giaddr = 0 self.chaddr = array('B') self.sname = array('B') self.file = array('B') self.magic = array('B') self.options = array('B') self.parsedOptions = {} else: if type(arr) == type(''): arr = array('B', arr) assert(type(arr) == array) self.arr = arr self.parse() def __str__(self): if self.parsed == False: return "" return ' '.join(('[','op:'+str(self.op),'htype:'+str(self.htype), \ 'hlen:'+str(self.hlen),'hops:'+str(self.hops), \ 'xid:'+str(self.xid),'secs:'+str(self.secs), \ 'flags:'+str(self.flags), \ 'ciaddr:'+ip_to_str(self.ciaddr), \ 'yiaddr:'+ip_to_str(self.yiaddr), \ 'siaddr:'+ip_to_str(self.siaddr), \ 'giaddr:'+ip_to_str(self.giaddr), \ 'chaddr:'+mac_to_str(self.chaddr[:self.hlen]), \ 'magic:'+str(self.magic), \ 'options:'+str(self.options),']')) def parse(self): dlen = len(self.arr) if dlen < dhcp.MIN_LEN: print '(dhcp parse) warning DHCP packet data too short to parse header: data len %u' % dlen return None (self.op, self.htype, self.hlen, self.hops, self.xid, self.secs, \ self.flags, self.ciaddr, self.yiaddr, self.siaddr, self.giaddr) \ = struct.unpack('!BBBBIHHIIII', self.arr[:28]) self.chaddr = self.arr[28:44] self.sname = self.arr[44:108] self.file = self.arr[102:236] self.magic = self.arr[236:240] self.hdr_len = dlen self.parsed = True if self.hlen > 16: print '(dhcp parse) DHCP hlen %u too long' % self.hlen return for i in range(4): if dhcp.MAGIC[i] != self.magic[i]: print '(dhcp parse) bad DHCP magic value %s' % str(self.magic) return self.parsedOptions = {} self.options = self.arr[240:] self.parseOptions() self.parsed = True def parseOptions(self): self.parsedOptions = {} self.parseOptionSegment(self.options) if self.parsedOptions.has_key(dhcp.OVERLOAD_OPT): opt_val = self.parsedOptions[dhcp.OVERLOAD_OPT] if opt_val[0] != 1: print 'DHCP overload option has bad len %u' % opt_val[0] return if opt_val[1] == 1 or opt_val[1] == 3: self.parseOptionSegment(self.file) if opt_val[1] == 2 or opt_val[1] == 3: self.parseOptionSegment(self.sname) def parseOptionSegment(self, barr): ofs = 0; len = barr.buffer_info()[1] while ofs < len: opt = barr[ofs] if opt == dhcp.END_OPT: return ofs += 1 if opt == dhcp.PAD_OPT: continue if ofs >= len: print 'DHCP option ofs extends past segment' return opt_len = barr[ofs] ofs += 1 # Account for the length octet if ofs + opt_len > len: return False if self.parsedOptions.has_key(opt): print '(parseOptionSegment) ignoring duplicate DHCP option: %d' % opt else: self.parsedOptions[opt] = barr[ofs:ofs+opt_len] ofs += opt_len print 'DHCP end of option segment before END option' def hdr(self): fmt = '!BBBBIHHIIII16s64s128s4s%us' % self.options.buffer_info()[1] return struct.pack(fmt, self.op, self.htype, self.hlen, \ self.hops, self.xid, self.secs, self.flags, \ self.ciaddr, self.yiaddr, self.siaddr, self.giaddr, \ self.chaddr.tostring(), self.sname.tostring(), \ self.file.tostring(), self.magic.tostring(), \ self.options.tostring()) def hasParsedOption(self, opt, len): if self.parsedOptions.has_key(opt) == False: return False if len != None and self.parsedOptions[opt][0][0] != len: return False return True def addUnparsedOption(self, code, len, val): self.options.append(code) self.options.append(len) self.options.extend(val)
bigswitch/snac-nox-zaku
src/nox/lib/packet/dhcp.py
Python
gpl-3.0
8,935
0.005708
#!/usr/local/bin/python3 import secrets, string length = 16 chars = string.ascii_letters + string.digits + '!@#$%^&*()' print(''.join(secrets.choice(chars) for i in range(length)))
supermari0/config
utils/pwgen.py
Python
gpl-2.0
183
0.005464
import os import sys import glob import json import subprocess from collections import defaultdict from utils import UnicodeReader, slugify, count_pages, combine_pdfs, parser import addresscleaner from click2mail import Click2MailBatch parser.add_argument("directory", help="Path to downloaded mail batch") parser.add_argument("--skip-letters", action='store_true', default=False) parser.add_argument("--skip-postcards", action='store_true', default=False) def fix_lines(address): """ Click2Mail screws up addresses with 3 lines. If we have only one address line, put it in "address1". If we have more, put the first in "organization", and subsequent ones in "addressN". """ lines = [a for a in [ address.get('organization', None), address.get('address1', None), address.get('address2', None), address.get('address3', None)] if a] if len(lines) == 1: address['organization'] = '' address['address1'] = lines[0] address['address2'] = '' address['address3'] = '' if len(lines) >= 2: address['organization'] = lines[0] address['address1'] = lines[1] address['address2'] = '' address['address3'] = '' if len(lines) >= 3: address['address2'] = lines[2] address['address3'] = '' if len(lines) >= 4: address['address3'] = lines[3] return address def collate_letters(mailing_dir, letters, page=1): # Sort by recipient. recipient_letters = defaultdict(list) for letter in letters: recipient_letters[(letter['recipient'], letter['sender'])].append(letter) # Assemble list of files and jobs. files = [] jobs = {} for (recipient, sender), letters in recipient_letters.iteritems(): count = 0 for letter in letters: filename = os.path.join(mailing_dir, letter["file"]) files.append(filename) count += count_pages(filename) end = page + count jobs[recipient] = { "startingPage": page, "endingPage": end - 1, "recipients": [fix_lines(addresscleaner.parse_address(recipient))], "sender": addresscleaner.parse_address(sender), "type": "letter" } page = end vals = jobs.values() vals.sort(key=lambda j: j['startingPage']) return files, vals, page def collate_postcards(postcards, page=1): # Collate postcards into a list per type and sender. type_sender_postcards = defaultdict(list) for letter in postcards: key = (letter['type'], letter['sender']) type_sender_postcards[key].append(letter) files = [] jobs = [] for (postcard_type, sender), letters in type_sender_postcards.iteritems(): files.append(os.path.join( os.path.dirname(__file__), "postcards", "{}.pdf".format(postcard_type) )) jobs.append({ "startingPage": page + len(files) - 1, "endingPage": page + len(files) - 1, "recipients": [ fix_lines(addresscleaner.parse_address(letter['recipient'])) for letter in letters ], "sender": addresscleaner.parse_address(sender), "type": "postcard", }) return files, jobs, page + len(files) def run_batch(args, files, jobs): filename = combine_pdfs(files) print "Building job with", filename batch = Click2MailBatch( username=args.username, password=args.password, filename=filename, jobs=jobs, staging=args.staging) if batch.run(args.dry_run): os.remove(filename) def main(): args = parser.parse_args() if args.directory.endswith(".zip"): directory = os.path.abspath(args.directory[0:-len(".zip")]) if not os.path.exists(directory): subprocess.check_call([ "unzip", args.directory, "-d", os.path.dirname(args.directory) ]) else: directory = args.directory with open(os.path.join(directory, "manifest.json")) as fh: manifest = json.load(fh) if manifest["letters"] and not args.skip_letters: lfiles, ljobs, lpage = collate_letters(directory, manifest["letters"], 1) print "Found", len(ljobs), "letter jobs" if ljobs: run_batch(args, lfiles, ljobs) if manifest["postcards"] and not args.skip_postcards: pfiles, pjobs, ppage = collate_postcards(manifest["postcards"], 1) print "Found", len(pjobs), "postcard jobs" if pjobs: run_batch(args, pfiles, pjobs) if __name__ == "__main__": main()
yourcelf/btb
printing/print_mail.py
Python
agpl-3.0
4,703
0.002126
#!/usr/bin/env python from nose.tools import * from networkx import * from networkx.convert import * from networkx.algorithms.operators import * from networkx.generators.classic import barbell_graph,cycle_graph class TestRelabel(): def test_convert_node_labels_to_integers(self): # test that empty graph converts fine for all options G=empty_graph() H=convert_node_labels_to_integers(G,100) assert_equal(H.name, '(empty_graph(0))_with_int_labels') assert_equal(H.nodes(), []) assert_equal(H.edges(), []) for opt in ["default", "sorted", "increasing degree", "decreasing degree"]: G=empty_graph() H=convert_node_labels_to_integers(G,100, ordering=opt) assert_equal(H.name, '(empty_graph(0))_with_int_labels') assert_equal(H.nodes(), []) assert_equal(H.edges(), []) G=empty_graph() G.add_edges_from([('A','B'),('A','C'),('B','C'),('C','D')]) G.name="paw" H=convert_node_labels_to_integers(G) degH=H.degree().values() degG=G.degree().values() assert_equal(sorted(degH), sorted(degG)) H=convert_node_labels_to_integers(G,1000) degH=H.degree().values() degG=G.degree().values() assert_equal(sorted(degH), sorted(degG)) assert_equal(H.nodes(), [1000, 1001, 1002, 1003]) H=convert_node_labels_to_integers(G,ordering="increasing degree") degH=H.degree().values() degG=G.degree().values() assert_equal(sorted(degH), sorted(degG)) assert_equal(degree(H,0), 1) assert_equal(degree(H,1), 2) assert_equal(degree(H,2), 2) assert_equal(degree(H,3), 3) H=convert_node_labels_to_integers(G,ordering="decreasing degree") degH=H.degree().values() degG=G.degree().values() assert_equal(sorted(degH), sorted(degG)) assert_equal(degree(H,0), 3) assert_equal(degree(H,1), 2) assert_equal(degree(H,2), 2) assert_equal(degree(H,3), 1) H=convert_node_labels_to_integers(G,ordering="increasing degree", discard_old_labels=False) degH=H.degree().values() degG=G.degree().values() assert_equal(sorted(degH), sorted(degG)) assert_equal(degree(H,0), 1) assert_equal(degree(H,1), 2) assert_equal(degree(H,2), 2) assert_equal(degree(H,3), 3) mapping=H.node_labels assert_equal(mapping['C'], 3) assert_equal(mapping['D'], 0) assert_true(mapping['A']==1 or mapping['A']==2) assert_true(mapping['B']==1 or mapping['B']==2) G=empty_graph() G.add_edges_from([('C','D'),('A','B'),('A','C'),('B','C')]) G.name="paw" H=convert_node_labels_to_integers(G,ordering="sorted") degH=H.degree().values() degG=G.degree().values() assert_equal(sorted(degH), sorted(degG)) H=convert_node_labels_to_integers(G,ordering="sorted", discard_old_labels=False) mapping=H.node_labels assert_equal(mapping['A'], 0) assert_equal(mapping['B'], 1) assert_equal(mapping['C'], 2) assert_equal(mapping['D'], 3) assert_raises(networkx.exception.NetworkXError, convert_node_labels_to_integers, G, ordering="increasing age") def test_relabel_nodes_copy(self): G=empty_graph() G.add_edges_from([('A','B'),('A','C'),('B','C'),('C','D')]) mapping={'A':'aardvark','B':'bear','C':'cat','D':'dog'} H=relabel_nodes(G,mapping) assert_equal(sorted(H.nodes()), ['aardvark', 'bear', 'cat', 'dog']) def test_relabel_nodes_function(self): G=empty_graph() G.add_edges_from([('A','B'),('A','C'),('B','C'),('C','D')]) # function mapping no longer encouraged but works def mapping(n): return ord(n) H=relabel_nodes(G,mapping) assert_equal(sorted(H.nodes()), [65, 66, 67, 68]) def test_relabel_nodes_graph(self): G=Graph([('A','B'),('A','C'),('B','C'),('C','D')]) mapping={'A':'aardvark','B':'bear','C':'cat','D':'dog'} H=relabel_nodes(G,mapping) assert_equal(sorted(H.nodes()), ['aardvark', 'bear', 'cat', 'dog']) def test_relabel_nodes_digraph(self): G=DiGraph([('A','B'),('A','C'),('B','C'),('C','D')]) mapping={'A':'aardvark','B':'bear','C':'cat','D':'dog'} H=relabel_nodes(G,mapping,copy=False) assert_equal(sorted(H.nodes()), ['aardvark', 'bear', 'cat', 'dog']) def test_relabel_nodes_multigraph(self): G=MultiGraph([('a','b'),('a','b')]) mapping={'a':'aardvark','b':'bear'} G=relabel_nodes(G,mapping,copy=False) assert_equal(sorted(G.nodes()), ['aardvark', 'bear']) assert_equal(sorted(G.edges()), [('aardvark', 'bear'), ('aardvark', 'bear')]) def test_relabel_nodes_multidigraph(self): G=MultiDiGraph([('a','b'),('a','b')]) mapping={'a':'aardvark','b':'bear'} G=relabel_nodes(G,mapping,copy=False) assert_equal(sorted(G.nodes()), ['aardvark', 'bear']) assert_equal(sorted(G.edges()), [('aardvark', 'bear'), ('aardvark', 'bear')]) @raises(KeyError) def test_relabel_nodes_missing(self): G=Graph([('A','B'),('A','C'),('B','C'),('C','D')]) mapping={0:'aardvark'} G=relabel_nodes(G,mapping,copy=False) def test_relabel_toposort(self): K5=nx.complete_graph(4) G=nx.complete_graph(4) G=nx.relabel_nodes(G,dict( [(i,i+1) for i in range(4)]),copy=False) nx.is_isomorphic(K5,G) G=nx.complete_graph(4) G=nx.relabel_nodes(G,dict( [(i,i-1) for i in range(4)]),copy=False) nx.is_isomorphic(K5,G)
ChristianKniep/QNIB
serverfiles/usr/local/lib/networkx-1.6/networkx/tests/test_relabel.py
Python
gpl-2.0
5,962
0.032372
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='django-quickadmin', version='0.1.2', description='Django application automatically registers all found models into admin area', long_description=long_description, url='https://github.com/zniper/django-quickadmin', author='Ha Pham', author_email='[email protected]', license='MIT', classifiers=[ 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], keywords='django admin models register python', packages=find_packages(exclude=['contrib', 'docs', 'tests*']), install_requires=[''], extras_require={ 'dev': ['check-manifest'], 'test': ['coverage'], }, )
zniper/django-quickadmin
setup.py
Python
mit
1,119
0.000894
import os from zeroinstall.injector import namespaces from zeroinstall.injector.reader import InvalidInterface, load_feed from xml.dom import minidom, Node, XMLNS_NAMESPACE import tempfile from logging import warn, info group_impl_attribs = ['version', 'version-modifier', 'released', 'main', 'stability', 'arch', 'license', 'doc-dir', 'self-test', 'langs', 'local-path'] known_elements = { 'interface' : ['uri', 'min-injector-version', 'main'], # (main is deprecated) 'name' : [], 'summary' : [], 'description' : [], 'needs-terminal' : [], 'homepage' : [], 'category' : ['type'], 'icon' : ['type', 'href'], 'feed' : ['src', 'arch'], 'feed-for' : ['interface'], 'group' : group_impl_attribs, 'implementation' : ['id'] + group_impl_attribs, 'package-implementation' : ['package', 'main', 'distributions'], 'manifest-digest' : ['sha1new', 'sha256'], 'command' : ['name', 'path', 'shell-command'], 'arg' : [], 'archive' : ['href', 'size', 'extract', 'type', 'start-offset'], 'recipe' : [], 'requires' : ['interface', 'use'], 'runner' : ['interface', 'use', 'command'], 'version' : ['not-before', 'before'], 'environment' : ['name', 'insert', 'value', 'default', 'mode'], 'executable-in-var' : ['name', 'command'], 'executable-in-path' : ['name', 'command'], #'overlay' : ['src', 'mount-point'], } def checkElement(elem): if elem.namespaceURI != namespaces.XMLNS_IFACE: info("Note: Skipping unknown (but namespaced) element <%s>", elem.localName) return # Namespaces elements are OK if elem.localName not in known_elements: warn("Unknown Zero Install element <%s>.\nNon Zero-Install elements should be namespaced.", elem.localName) return known_attrs = known_elements[elem.localName] for (uri, name), value in elem.attributes.itemsNS(): if uri == XMLNS_NAMESPACE: continue # Namespace declarations are fine if uri: info("Note: Skipping unknown (but namespaced) attribute '%s'", name) continue if name not in known_attrs: warn("Unknown Zero Install attribute '%s' on <%s>.\nNon Zero-Install attributes should be namespaced.", name, elem.localName) for child in elem.childNodes: if child.nodeType == Node.ELEMENT_NODE: checkElement(child) def check(data, warnings = True, implementation_id_alg=None, generate_sizes=False): fd, tmp_name = tempfile.mkstemp(prefix = '0publish-validate-') os.close(fd) try: tmp_file = file(tmp_name, 'w') tmp_file.write(data) tmp_file.close() try: feed = load_feed(tmp_name, local=True, implementation_id_alg=implementation_id_alg, generate_sizes=generate_sizes) except InvalidInterface, ex: raise except Exception, ex: warn("Internal error: %s", ex) raise InvalidInterface(str(ex)) finally: os.unlink(tmp_name) if warnings: doc = minidom.parseString(data) checkElement(doc.documentElement) return feed
timdiels/0publish
validator.py
Python
lgpl-2.1
2,847
0.038286
# -*- coding: utf-8 -*- # # restblog documentation build configuration file, created by # sphinx-quickstart on Mon Jul 12 17:19:21 2010. # # 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 sys, os # 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.append(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.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # 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 = u'restblog' copyright = u'2010, Luis Artola' # 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 full version, including alpha/beta/rc tags. release = os.getenv( 'VERSION', '0.0.0' ) # The short X.Y version. version = release.rsplit( '.', 1 )[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 = [] # 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 = True # 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 = [] # -- 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 = 'sphinxdoc' # 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 = [] # 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 = ['_static'] # 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 = True # 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 = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = '' # Output file base name for HTML help builder. htmlhelp_basename = 'restblogdoc' # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'restblog.tex', u'restblog Documentation', u'Luis Artola', '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 # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'restblog', u'restblog Documentation', [u'Luis Artola'], 1) ] # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'http://docs.python.org/': None}
artolaluis/restblog
docs/source/conf.py
Python
bsd-3-clause
7,320
0.007104
from flask import Flask from flask.ext.bootstrap import Bootstrap from flask.ext.mail import Mail from flask.ext.moment import Moment from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from flask.ext.pagedown import PageDown from config import config bootstrap = Bootstrap() mail = Mail() moment = Moment() db = SQLAlchemy() pagedown = PageDown() login_manager = LoginManager() login_manager.session_protection = 'strong' login_manager.login_view = 'auth.login' def create_app(config_name): app = Flask(__name__) app.config.from_object(config[config_name]) config[config_name].init_app(app) bootstrap.init_app(app) mail.init_app(app) moment.init_app(app) db.init_app(app) login_manager.init_app(app) pagedown.init_app(app) from .main import main as main_blueprint app.register_blueprint(main_blueprint) from .auth import auth as auth_blueprint app.register_blueprint(auth_blueprint, url_prefix='/auth') return app
fakdora/flaksy-upto-login
app/__init__.py
Python
mit
1,012
0
from sys import exit from random import randint class Scene(object): def enter(self): print "This scene is not yet configured. Subclass it and implement enrer()." exit(1) class Engine(object): def __init__(self, scene_map): self.scene_map = scene_map def play(self): current_scene = self.scene_map.opening_scene() last_scene = self.scene_map.next_scene('finished') while current_scene != last_scene: next_scene_name = current_scene.enter() current_scene = self.scene_map.next_scene(next_scene_name) # ne sure tp print out the last scene current_scene.enter() class Death(Scene): quips = [ "You died. You kinda suck at this.", "Your mum would be proud..if she were smarter.", "Such a luser.", "I have a small puppy that's better at this." ] def enter(self): print Death.quips[randint(0, len(self.quips)-1)] exit(1) class CentralCorridor(Scene): def enter(self): print "The Gothons of Planet #25 have invaded your ship and destroyed your entire crew. You are the last surviving member and your last mission is to get the neutron destruct bomb from the Weapons Armory, put it in the bridge, and blow the ship up after getting into an escape pod." print "\n" print "You're running down the central corridor to the Weapons Armory when a Gothon jumps out, red scaly skin, dark grimy teeth, and evil clown costumes flowing around his hate filled body. He's blocking the door to the Armory and about to pull a weapon to blast you." action = raw_input("> ") if action == "shoot!": print "Quick on the drae you yank out your blaster anf fire it at the Gothon. His clown costume is flowing and moving around his body, which throws off your aim. Your laser hits his costume but misses him entirly. This makes him fly into an insane rage and blast you repeadedly in the face until you are dead. Then he eats you." return 'death' elif action == "dodge!": print "Like a world class boxer you dodge, weave, slip and slide right as the Gothon's blaster cracks a laser past your head. In the middle of your artful dodge your foor slips and you bang your head on the metal wall and pass out. You wake up shortly after only to die as the Gothon stomps on your head and eats you." return 'death' elif action == "tell a joke": print "Lucky for you they made you learn Gothon insults in the academy. You tell the one Gothon joke you know: \nLbhe zbgure vf fb sbg, jura fur fvgf nebhaq gur ubhfr, fur fvgf nebhaq gur. \n The Gothon stops, tries not to laugh, then busts out laughing and can't stop. While he's laughing you run up and shoot him square in the head putting him down, then jump through the Weapon Armory door." return 'laser_weapon_armory' else: print "DOES NOT COMPUTE!" return 'central_corridor' class LaserWeaponArmory(Scene): def enter(self): print "A lot of things happen in here. Blablabla." code = "%d%d%d" % (randint(1,9), randint(1,9), randint(1,9)) guess = raw_input("[keypad]> ") guesses = 0 while guess != code and guesses < 10: print "BZZZZZEED!" guesses += 1 guess = raw_input("[keypad]> ") if guess == code: print "Go to the bridge." return 'the_bridge' else: print "Ups. Ypu die." return 'death' class TheBridge(Scene): def enter(self): print "You have a bomb under your arm and haven't pulled your weapon yet as more Gorthons emerge." action = raw_input("> ") if action == "throw the bomb": print "You die." return 'death' elif action == "slowly place the bomb": print "You run to the escape podto get off this tin can." return 'escape_pod' else: print "DOES NOT COMPUTE!" return 'the_bridge' class EscapePod(Scene): def enter(self): print "There's 5 pods, which one do you take?" good_pot = randint(1,5) guess = raw_input("[pod #]> ") if int(guess) != good_pod: print "You die." return 'death' else: print "You won!" return 'finished' class Finished(Scene): def enter(self): print "You won! Good job!" return 'finished' class Map(object): scenes = { 'central_corridor': CentralCorridor(), 'laser_weapon_armory': LaserWeaponArmory(), 'the_bridge': TheBridge(), 'escape_pod': EscapePod(), 'death': Death(), 'finished': Finished(), } def __init__(self, start_scene): self.start_scene = start_scene def next_scene(self, scene_name): val = Map.scenes.get(scene_name) return val def opening_scene(self): return self.next_scene(self.start_scene) a_map = Map('central_corridor') a_game = Engine(a_map) a_game.play()
tridvaodin/Assignments-Valya-Maskaliova
LPTHW/ex43.py
Python
gpl-2.0
5,149
0.004273
# -*- coding: utf-8 -*- ############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: [email protected] ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are met: ## ## - Redistributions of source code must retain the above copyright notice, ## this list of conditions and the following disclaimer. ## - Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## - Neither the name of the New York University 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 HOLDER 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." ## ############################################################################### # Resource object code # # Created: Thu Mar 20 11:39:03 2014 # by: The Resource Compiler for PyQt (Qt v4.8.5) # # WARNING! All changes made in this file will be lost! from __future__ import division from PyQt4 import QtCore qt_resource_data = b"\ \x00\x00\x33\x77\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x80\x00\x00\x00\x80\x08\x06\x00\x00\x00\xc3\x3e\x61\xcb\ \x00\x00\x20\x00\x49\x44\x41\x54\x78\x9c\xed\xbd\x79\x9c\x1d\x57\ \x79\xe7\xfd\x7d\x4e\xd5\x5d\x7a\xd7\xda\xda\x2d\xdb\x92\x77\x79\ \x37\xb6\x71\x26\x36\x06\x13\xe2\x04\xc2\x92\x18\x48\x08\x0a\x19\ \xf2\x4e\x98\x30\x21\x21\x04\xb2\xcd\xe7\x93\x99\x24\x84\x21\x0c\ \x49\xde\x37\x13\x66\x86\x84\x64\x42\xc0\x01\x4c\x20\x4c\x06\x08\ \x13\x36\x93\x78\x03\x1b\x6f\xb2\x8c\x65\xc9\x96\xd5\x52\x4b\xea\ \x56\xb7\x7a\xbb\x5b\xd5\x39\xcf\xf3\xfe\x71\xea\xde\xbe\x6a\xc9\ \x2b\x96\x5a\xc6\xfa\x7d\x54\xaa\x7b\xeb\x56\xdd\x3e\x75\x9f\xdf\ \x79\xb6\xf3\x9c\x53\x70\x0a\xa7\x70\x0a\xa7\x70\x0a\xa7\x70\x0a\ \xa7\x70\x0a\xa7\x70\x0a\x2f\x2e\x88\x99\x2d\x76\x1b\x4e\x61\x11\ \xe1\x16\xbb\x01\xa7\xb0\xb8\x38\x45\x80\x17\x39\x4e\x11\xe0\x45\ \x8e\x74\xb1\x1b\xb0\x98\xb8\xe2\x8a\x2b\x3a\x0e\xd0\xdd\x77\xdf\ \x2d\x8b\xd9\x96\xc5\xc2\x29\x0d\xf0\x22\xc7\x8b\x5a\x03\x74\x43\ \x44\x56\x03\x55\xa0\x09\x4c\x99\x59\x73\x91\x9b\x74\x42\x70\x8a\ \x00\xf3\xb8\x04\x58\x0d\x1c\x00\xee\x2b\xf6\x3f\xf0\x38\x45\x80\ \x79\xac\x06\x4e\x2f\x5e\x57\x17\xb1\x1d\x27\x14\xa7\x7c\x80\x17\ \x39\x5e\xb4\x1a\x60\xec\xcd\x72\xd3\x0f\xf7\x9f\xd9\x79\xff\xfa\ \x4b\x79\xc9\x7f\xbc\x97\xf1\x45\x6c\xd2\xa2\xe0\x07\x36\x15\x3c\ \xf6\x66\x59\x0f\xbc\x14\xb8\x1a\xd8\x00\xdc\xf4\x1c\xbe\xe6\x16\ \x60\x04\xb8\x13\xb8\x63\xf8\x53\xb6\xf7\xf9\x6b\xe1\xc9\x81\x1f\ \x28\x02\x8c\xbd\x59\x6e\x22\x0a\xfa\xb9\x08\xfb\x99\xe2\x16\xe0\ \x96\xe1\x4f\xd9\x2d\xc7\xf1\x6f\x9c\x30\xbc\xe0\x09\x30\xf6\x66\ \xb9\x1a\xf8\x35\x9e\xa5\xd0\x67\x72\xbe\x74\x7f\x6b\xe9\x8f\xb5\ \xdf\xaf\x08\x87\xef\x3d\x6f\x88\x4b\x9f\xe5\x9f\xbf\x05\xf8\xe3\ \xe1\x4f\xd9\x9d\xcf\xf2\xba\x93\x06\x2f\x58\x02\x8c\xbd\x59\xde\ \x0d\xbc\x9b\xa8\xde\x8f\x82\xc1\xde\x66\xe0\xbb\xdf\x36\xf2\x3d\ \x46\xf2\x59\xc7\x80\x29\xa9\x19\xa9\x4b\x19\x2e\x57\x39\x6b\xe1\ \x35\xcd\x39\xf6\xfa\x8c\x29\x71\xe4\x22\x84\x1b\x73\x5a\xab\x81\ \x4b\x85\x74\x6d\x2f\x9b\x7a\x12\x56\x3c\x49\x73\x46\x80\x3f\x19\ \xfe\x94\xfd\xc9\xf3\x76\x83\x27\x08\x2f\x38\x02\x14\x6a\xfe\xc3\ \x1c\x43\xf0\xb3\xc6\x97\xbf\x04\x33\x9f\x12\x06\x5d\xc2\x65\x2e\ \x61\xd5\xf3\xf5\x77\x7d\xce\x74\x6b\x8e\xdd\x3f\xea\x69\xdc\xe0\ \xe8\x3d\x7f\x80\x8b\x16\x9e\x63\xb0\x57\x8d\xf7\xac\xf9\xb4\x7d\ \xe6\xf9\xfa\xbb\xc7\x1b\x2f\x18\x02\x14\xaa\xfe\x8f\x89\x8e\x5d\ \x07\x19\x7c\xf7\x0b\xf0\xbd\x4f\x25\x9c\xe3\x12\x2e\x5f\x78\xdd\ \xf0\x86\x61\x00\x56\x6d\x58\xd9\x39\x56\xe9\xad\x30\xb4\x7c\xe8\ \xa8\xbf\x31\x3d\x31\x4d\xab\xde\xea\xbc\x3f\x38\x12\x83\x82\xb1\ \x91\xb1\xa3\xce\x6d\xce\x31\xf2\xf2\x3a\x63\x6f\xaa\xb2\x72\x6d\ \x95\xd3\xba\x3f\xf3\xc6\xb7\x9b\x81\x5f\x3b\xf3\xb3\x76\xdb\xb3\ \xb9\xc7\xc5\xc0\x0b\x82\x00\x63\x6f\x96\xcf\xb0\xc0\xc6\xd7\xe1\ \x8b\xbf\xe3\x18\xdf\x9b\xf2\xb6\xee\xe3\xc3\x1b\x86\x59\xb5\x61\ \x25\x9b\xcf\xbc\x88\x25\x43\x2b\x58\x39\xb0\x91\xde\x4a\x14\xf6\ \xca\x81\x8d\xf4\x55\x8e\x16\x7c\xad\x35\xcd\xf8\xec\x13\xf1\x7b\ \x8b\xd7\xf5\xd6\x0c\x87\x66\xf7\x74\xce\x69\xd6\x5b\xcc\x4c\x4c\ \x73\x70\x64\xfc\x28\x42\x54\x0f\x72\xf7\x7b\x13\xfa\x2e\x1a\xe4\ \xbc\xee\xe3\xb9\xf2\xf9\xf5\xb7\x70\x93\x99\x85\xef\xe3\xf6\x8f\ \x2b\x4e\x6a\x02\x14\xa1\xdc\x67\xe8\xea\xf5\x39\xdc\xf3\xff\x39\ \x76\xdd\x99\xf2\xc6\xf6\xb1\xe1\x0d\xc3\x5c\x7c\xf1\x95\x9c\xb5\ \xf9\x62\x4e\x5b\xbe\x85\x15\x03\xa7\x1d\xeb\xeb\x9e\x13\x0e\xcd\ \xee\x61\xcf\xc4\x36\x0e\xcd\x8e\x30\x31\x37\x32\xdf\xb6\x91\xb1\ \xa3\xc8\x70\xe6\x21\xee\xff\x0f\x25\x56\x6c\xe8\x61\x5d\xfb\x58\ \xa6\xdc\x73\xcf\x04\x3f\xfd\xba\xaf\xb3\xcb\xcc\xf4\x79\x6b\xd8\ \xf3\x84\x93\x96\x00\x85\xca\xff\x0c\x5d\xb6\xfe\x13\x8e\x2f\x7d\ \x21\xa5\xe3\xb9\x5f\x70\xd9\x45\xbc\xf4\xea\x57\xb1\x65\xe3\xb5\ \xf4\x96\x07\x8f\x7b\x9b\xea\xd9\x0c\x8f\xec\xbf\x9d\x91\x89\xed\ \x34\xb2\x19\x20\x6a\x86\x91\x1d\x23\xec\x79\x64\x9e\x1c\x2f\x9d\ \xe4\xe1\x5f\xeb\x9f\xd7\x06\x99\x72\xf0\xbe\x49\x7e\xfe\x35\x5f\ \xe3\x6b\x66\x96\x1d\xf7\x86\x3e\x0b\x9c\x94\x04\x28\x7a\x7e\xe7\ \x17\x55\x18\xfd\x4f\x25\xd2\x87\x85\x61\x80\x4b\xaf\xb9\x82\xeb\ \xaf\x79\x3d\x67\xaf\xbe\x7a\xd1\xda\xb8\xe3\xc0\x9d\xec\x38\xf8\ \xed\x0e\x11\x00\xf6\x3c\x32\xc2\xa3\xf7\xed\x04\xe0\xac\x9c\xd9\ \xdf\xcc\xb1\xc1\x94\x0e\x33\xff\xeb\x43\xbc\xf4\x43\xdb\xb8\x0f\ \x68\xd9\x49\xf2\xc3\x9f\x74\x04\x28\x84\x7f\x3b\x45\xcf\x9f\x16\ \x76\xfc\x46\xca\xd9\x13\x02\x43\xcb\x07\xf9\xc9\x9f\x7a\x3b\x97\ \x6d\xfe\xd1\xc5\x6d\x64\x17\x1e\x1c\xf9\x1a\x3b\x0f\x7e\xa7\xf3\ \xbe\x59\x6f\xb1\xed\xf6\x6d\x4c\x4f\xcc\xb0\xdc\xe0\x37\x6b\x1c\ \x3a\xbd\x1c\xc3\xc7\x46\xe0\xd0\x1f\x3e\xc0\x4d\x1f\xdd\xc1\x3d\ \x40\xed\x64\x30\x09\x27\x23\x01\x6e\xa7\xb0\xf9\x2d\x98\xf8\xd9\ \x32\xcb\x01\xce\xbb\x64\x0b\x6f\x7c\xcd\xbb\x58\xd6\xb7\x76\x51\ \xdb\x77\x2c\x4c\xd6\x46\xb9\xfb\xf1\x7f\xa4\x99\xcf\x75\x8e\x3d\ \x7a\xdf\xce\x8e\x59\xf8\xcb\x06\xf5\xa1\x84\x5e\x80\xf1\x26\x8f\ \x6e\xf9\x02\x37\x01\x8f\x01\x73\x8b\xad\x09\x4e\x2a\x02\x8c\xbd\ \x59\x3e\x4c\xcc\xea\xd1\x82\x89\x5f\x29\xb1\x7c\x42\xe0\xaa\xeb\ \x5f\xca\x6b\x5f\xf6\x4e\x7a\x4a\x03\x8b\xdc\xc2\x27\x47\x23\x9f\ \xe5\xb6\x47\x3f\x7d\x04\x09\xc6\x46\xc6\x78\xf0\xf6\x87\x58\x6e\ \xf0\xc1\xe6\x3c\x09\xee\x9e\xe0\xcb\x3f\xfe\x55\xde\x07\x3c\x0e\ \xd4\x17\x93\x04\x27\x0d\x01\x16\xda\xfd\xdf\x29\xc1\x0e\x81\x2b\ \xaf\xbf\x9a\xd7\x5c\xfb\x0e\xaa\xa5\xfe\x45\x6c\xdd\x33\x43\x33\ \x9f\xe3\xce\x5d\x9f\xa5\x99\xd7\x3a\xc7\xda\x24\x38\xdb\xe0\xfd\ \xf9\xfc\xb9\x37\x7d\x93\x5f\xfa\xd6\x41\xbe\x0e\x3c\xb1\x98\xd5\ \x47\x27\xd3\x70\xf0\xbb\xdb\x2f\x6e\x4e\x98\xda\x21\x2c\xb9\xf0\ \x9a\x0b\xb8\xfc\xa2\x97\x53\x4a\x2a\x04\xcd\x9f\xea\xda\x93\x02\ \xa5\xa4\xc2\x69\xcb\x2f\x62\xc7\x81\x3b\x3a\xc7\x86\x37\x0c\x73\ \xe1\x35\xf0\xe0\xed\x0f\xf1\x71\x68\x6e\x2d\x8a\x4d\x7e\xf9\x3c\ \xde\xf4\xad\x83\xec\x03\x1a\x22\xb2\xdf\xcc\x16\xe5\x06\x4f\x26\ \x02\xdc\x04\xd0\x80\xa9\xcf\x27\x2c\x19\x5a\x3e\xc8\xe6\xb3\x2f\ \x60\xfd\xd2\x73\x5f\x10\xc2\x6f\x63\xfd\xd2\x73\x39\x30\xbd\x93\ \x99\xc6\x7c\x69\xc1\xf0\x86\x61\x86\x96\x8f\xf0\x8f\x13\x33\xd5\ \x9f\x68\xd0\x5c\x92\x50\xbd\x64\x19\x97\x00\x1b\x81\x59\xa0\x26\ \x22\x93\x8b\x61\x0a\x4e\x0a\x02\x14\x03\x3b\x1b\x00\x3e\x9f\xc4\ \x63\x67\x5d\xba\x99\x75\x4b\xce\xc5\x87\x67\x2f\xfc\xff\xfc\x2b\ \xff\xbd\xf3\xfa\xfc\x4b\x36\x71\xd3\xcf\xff\x48\xe7\xfd\xf6\xfb\ \x1e\xe3\x96\xbf\xfe\x0a\xe7\x5f\xb2\x89\xed\xf7\xed\xea\x1c\xbf\ \xe9\xe7\x5f\xc5\xf9\x97\x9c\xd9\xb9\x7e\xe1\x75\x4f\x75\x7c\x21\ \xd6\x2d\x39\xf7\x08\x02\xb4\xef\xe7\xee\xaf\x7e\x97\xff\x9d\xc0\ \x56\x60\xb0\xc4\xd0\x9f\x5e\xc9\x8d\xbf\xfa\x6d\x66\x88\xf5\x87\ \xb3\xc0\x09\xcf\x11\x9c\x2c\x25\x61\x9d\x34\xef\x43\x2e\xf6\xfe\ \xa1\xe5\x43\xa4\x49\x19\xaf\xd9\x33\xde\xf6\x8f\x1e\xe4\x9d\x6f\ \x7c\x3f\xdf\xfc\xf2\xdd\xa8\x29\x6a\xca\x2d\xff\xeb\xff\x72\xfd\ \xd9\x6f\xef\x9c\x73\x60\x74\x8c\x6f\x7e\xf9\x6e\x3e\xf2\x81\x4f\ \x77\xce\x79\xe8\xbe\x5d\xbc\xf3\x8d\xef\xe7\x77\xdf\xf5\xe7\x78\ \xcd\x18\xdb\x3f\xc9\x47\x3e\xf0\x69\xfe\xfc\x03\x7f\x77\x8c\xef\ \x0d\x4f\xdb\x8e\x34\x29\x1f\x75\x83\x43\xcb\x87\x18\x5a\x3e\xc8\ \x23\xa5\xf9\x7a\xc3\x7f\x33\xcc\x16\x60\x29\xb0\x06\xe8\x3b\x11\ \x3f\xf4\x42\x9c\x14\x1a\x80\xae\x54\xef\x0e\x81\x0b\xcf\x89\xc9\ \xbf\xde\xf2\x10\x41\xfd\x33\xfe\x92\x87\xee\xdd\xc9\xf6\xfb\x1e\ \xe3\x0d\x6f\x7b\x39\xff\xee\x7d\xaf\x07\xe0\x7b\xf7\xef\x66\xfc\ \xc0\xe1\xce\xf7\x68\x91\x96\x5f\x78\xce\xaf\xfe\xf4\x87\x79\xf8\ \xbe\xc7\x79\xe8\xde\x9d\xfc\xf6\x9f\xfc\x3c\xef\x7f\xf7\x5f\xf1\ \xd9\xbf\xfe\x2a\xcb\x86\x07\xf9\x97\xaf\xdc\xcb\xc3\xf7\x3d\xce\ \x1b\xde\xf6\x72\x5e\xb7\xf5\xba\xa7\x6d\x53\x6f\xf9\xe8\xf1\x06\ \x88\xa6\x60\xc7\xc4\x7c\xe2\x68\x43\x1f\x1b\x80\x1e\x60\x15\xb0\ \x54\x44\x66\xcd\xec\x99\xdf\xf0\xf3\x80\x93\x85\x00\xc7\xc4\x74\ \xfd\x20\xbd\x95\xa5\xcf\xf8\xfc\xa5\xc3\xfd\xac\x58\xbd\x84\xcf\ \xfd\xaf\xaf\xb3\xfd\xde\xc7\x78\xed\xd6\x6b\x01\x38\xf7\xe2\xd3\ \xc9\x43\xd4\xae\xbe\x10\xde\x59\x17\xae\xef\x1c\xdb\xb4\x65\x2d\ \xbf\xf1\xe1\xad\x7c\xf0\x3d\x1f\x67\xff\xe8\x38\x9b\xb6\xac\xe5\ \x8f\xfe\xf6\x3f\xf0\xde\x9f\xfd\x33\x3e\xfa\xc1\xcf\x01\xf0\x0b\ \xef\x7d\x2d\xaf\xdd\x7a\x6d\xe7\x9a\xa7\x42\xbd\x75\xf8\x98\xc7\ \xab\xbd\x95\x63\x1d\x4e\x81\x65\xc4\xaa\xe4\x43\xc0\xcc\xb1\x4e\ \x3a\x5e\x58\x74\x13\x50\x8c\xef\x03\x70\x47\xd1\x9a\xf6\x10\x6e\ \x23\x9f\x25\x68\xf6\x8c\xb7\xcd\x5b\xd6\xf0\xde\x0f\xfd\x0c\x6f\ \xfd\x77\xaf\x24\xa9\x79\xbe\xf3\x99\x7b\x78\xe2\x6b\x3b\xb9\xf5\ \xaf\x6e\x23\xcd\x3c\xaa\x39\xda\xd6\x04\xea\x8f\xb8\xf6\x58\xc7\ \x5f\xf3\xb3\xd7\x74\xda\xf9\xea\x9f\xbd\xfa\x19\xb7\xa3\x91\xcf\ \x1e\xf3\x5e\xdb\xf7\x75\x47\xd7\xaf\xfe\xde\x2d\x5c\x08\x0c\x00\ \xc3\x10\xf3\x04\x27\x12\x27\xb5\x06\x38\x38\xfd\x38\x69\xde\x43\ \xd6\xcc\xc9\x1a\x2d\xf2\x66\x46\xbf\xd6\xf0\x73\x73\xe4\xb3\x73\ \xf8\x5a\x9d\xfe\x50\x63\x53\xcf\x1c\xae\x51\xa7\x27\xab\x71\x9a\ \xaf\x71\xc3\xb2\x04\x7d\x73\x3f\xd5\x52\x4e\x4f\x72\x90\xd9\xba\ \x67\xea\xa3\xdf\x20\x1b\x38\x8b\xe1\x0d\x3f\x04\x44\x41\xfb\xae\ \xde\xfc\xbd\xfb\x77\x1f\x71\x7c\xc7\x83\x7b\xf9\xd0\x7b\x6f\x66\ \xc5\xaa\x21\x0e\x1d\x9c\xe6\x7d\x6f\xfd\x08\xef\xf9\xe0\x1b\x59\ \xbe\xea\xe9\x07\x9d\xc6\x66\x77\x3f\xdb\x5b\x2d\x03\xfd\xc5\xfe\ \x84\xe2\x84\x13\x20\x4d\xc4\x39\x21\xb9\xe6\x0c\x7a\xce\x5c\xc9\ \x4a\x13\xf6\xbf\x75\x39\xcc\x2a\xac\x5d\x0e\xaf\xac\xc2\xda\x3b\ \xee\xa1\x2f\x11\x96\xa5\x81\xd5\x3d\xb7\x52\x05\x7a\xcb\x39\xae\ \x6c\x58\xef\x69\xd8\xd0\xe9\x0c\xac\xea\xa1\xd4\x53\xc6\xaa\xab\ \xa0\xba\x12\x7a\xd6\xd2\x93\xb4\x30\x69\x20\x89\x07\x01\x2c\xc3\ \xfc\x2c\x64\xd3\x30\x77\x90\xb1\x87\xf6\xd0\xfc\xe7\x4f\x70\xee\ \x99\xa7\xf1\xbf\x3f\x71\x1b\x57\xbc\x7c\x33\x00\x5f\xba\xf9\xdb\ \xfc\xe3\x27\x6e\xe7\xac\x0b\xd7\x71\xe6\x96\x55\x6c\xbf\xef\x31\ \xfe\xdf\xdf\xfa\x3c\x00\xef\xfa\xc0\xeb\xb8\xeb\x6b\xdf\xe3\x8b\ \x9f\xbc\x8b\xff\xfa\xbe\x4f\xf1\x7b\x7f\xf5\x73\x4f\x79\x7f\x53\ \xf5\xfd\x47\x0c\x10\x75\xa3\x3d\x74\xfc\xd2\xae\x11\x80\x0f\x6d\ \x63\x3b\x51\x13\x57\x80\x8a\x88\x24\x27\xb2\x7e\xe0\x84\x12\xa0\ \x9c\x8a\xdc\xfe\x3e\x3e\x7a\xd6\x3a\xb9\xc9\xaa\x83\x83\x5a\x5a\ \x4e\x5a\xe9\xa7\xd4\x23\x58\xdf\x00\x56\xdd\xc8\xb9\x7d\x67\xd2\ \xd7\x9b\x20\x55\x41\x7a\x87\xa1\xba\x0e\x4a\x2b\x00\x8f\xa9\x47\ \xcc\x83\xe5\xa0\x39\x68\x86\x69\x0b\xd1\x16\x68\x13\x42\x1d\x09\ \x75\xd4\xcf\xe1\x42\x0d\xb4\x81\x84\x06\x58\x03\x2b\x1b\xab\xb7\ \xf4\x73\xc9\xf8\x0c\x37\x1c\x0c\xfc\xdd\x23\x33\xfc\xf4\x4b\xfe\ \xb0\xd3\xb6\xcd\x17\xae\xe5\xca\x57\x9c\xcd\xe0\x8a\x0a\xef\xfc\ \xf1\xbf\x61\xf9\xaa\x01\x7e\xf7\x63\x6f\xe1\x8c\x0b\x56\x72\xc6\ \x05\x2b\x59\xb2\xb2\x97\x4f\xfe\xe9\x37\xf8\x93\xdf\xfc\x7b\x7e\ \xf9\x0f\x5f\x73\xcc\xfb\xf3\x21\x67\xb2\xb6\xef\x49\xef\xbf\xd9\ \x55\x6d\x74\x0c\x94\x88\x91\x40\x09\xf8\xc1\x24\x40\xe6\xcd\x3e\ \xf6\x36\x69\x5d\x70\xfd\x0f\x0d\xf6\xfd\xd0\xaf\x43\xba\x14\x92\ \x5e\xcc\x0c\x11\x81\x4e\x1e\xc4\x30\x0b\xf1\xbd\x29\x58\x06\xe6\ \xe7\x37\xcd\x0a\x02\xb4\xe6\xb7\xd0\x88\x9b\xd6\x23\x19\xb4\xfd\ \xbe\x01\xa1\x1e\x37\xad\x73\xc6\xb9\xc6\xe9\x5f\x19\xe7\x75\x3f\ \x77\x3d\x95\xc1\x79\x63\xbc\x79\xcb\x1a\x96\x0e\xf7\xe3\x43\xc6\ \x2f\xfd\xc1\x8d\x2c\x5b\x35\xc0\xe9\xe7\x2d\xef\x98\x89\x1b\xde\ \x78\x21\x43\x2b\xaa\x2c\x5b\x35\x70\x84\xe9\x68\x23\x68\xce\x81\ \x99\x5d\x4f\x99\xb4\x1a\x1b\x19\xe3\xec\xae\x54\xcf\x9e\x1a\x8b\ \x3e\xcf\xe0\x84\x9b\x80\x1d\xfb\xf9\x6a\x6d\xd7\xed\xef\xe8\xdb\ \xfc\x29\xc7\x9a\xb7\x82\x4b\x00\x0c\x15\x01\x03\x0c\x2c\x12\x40\ \x30\xd0\x00\x16\xba\x84\xef\x23\x21\x34\x3b\x92\x00\x1a\x05\x4c\ \x68\x20\xa1\x56\x08\xbd\x56\x6c\x75\x08\x73\xe0\xe7\x28\x0d\xe6\ \xac\xe9\x83\xc3\x6b\x96\xb3\xf1\x8a\x23\x07\x97\xf2\x10\x7b\xe8\ \x25\xd7\x9d\x76\xc4\xfb\x36\x9e\xec\x78\x1e\x9a\x1c\xae\x8f\x3e\ \x65\x78\x38\x3d\x31\xcd\xf4\xc4\x0c\xd7\xe6\x34\x29\xd2\xc1\xff\ \x3a\xc6\x43\xdd\x5f\x03\xd4\x8a\xfd\x09\xc3\x09\x27\xc0\x57\x1e\ \xe6\xce\xb7\xbd\x54\x77\x95\x6e\xfb\xfb\xb3\x96\x5c\xb0\x0d\x39\ \xe3\x5d\xd0\xbb\x29\x7e\x68\xc5\x7f\x66\x51\xd0\x00\x84\x42\xe8\ \x61\x5e\xf5\x5b\xbb\xf7\x67\x10\x9a\x1d\xf5\x1f\xb5\xc0\x42\xe1\ \xd7\xa2\xf0\x43\x2d\x9e\xdb\x82\xe9\x06\xa8\xe6\xf8\xf0\x94\x2a\ \xf9\x19\x61\x2e\x3b\xfc\xa4\x36\xbf\x1b\x8f\xde\x1b\x0b\x45\x7e\ \x22\x00\x09\x4c\xe7\xcc\xbc\xfb\xdb\xb4\xe7\x13\x28\xd0\x22\x16\ \x8a\x9c\xd0\xfa\xc1\x13\x4e\x80\xfb\xf6\xd8\xfe\x97\x9f\x2b\xaf\ \xfc\xdd\x1b\xf3\x8f\x6f\x1e\xdb\xf6\xc3\xab\x26\x7e\x85\xe4\xac\ \xad\xd8\x8a\x1f\x03\x12\x10\xed\xa8\x7e\x45\x11\xd3\xae\xde\x9f\ \x63\x1d\xfb\xdf\x56\xfd\x4d\xac\xad\xee\x3b\x82\x9f\xc3\xfc\x5c\ \xd1\xeb\x67\x8b\xad\x86\x79\x65\x76\x3f\x4c\xd4\x52\xe8\x6b\x91\ \xeb\x73\xbf\xfd\x56\x5e\xa7\xe5\x6b\x9d\xc4\xd2\x53\x61\x6c\x64\ \x8c\xe9\x89\x19\x5e\x93\xc5\x71\x00\x80\xbb\x0f\xf1\x10\x05\xe5\ \x89\x29\xe0\x39\x16\x21\x15\xbc\x28\x61\xe0\xd7\xbf\x67\x4f\x9c\ \xbf\x5a\x5e\xfb\xe1\xd7\xf2\x47\x67\xce\x36\xfe\xed\xc6\xc9\x8f\ \xba\xea\x59\xdb\xe0\x8c\x7f\x0b\xa5\x41\x30\xc5\x54\x71\xe8\xbc\ \xfa\x57\x8f\x59\x8e\x1c\x61\xff\x9b\x98\x36\xa3\xa3\x17\x1a\xe0\ \x6b\xa0\x35\x2c\xcc\x21\x85\xca\x6f\x6f\xe6\x73\x24\xc0\xe8\x08\ \xac\xb8\xf2\x42\x6a\x9b\xd2\xa3\x54\xf9\xd3\xc1\x4c\xc9\x43\x0b\ \xaf\x19\xcf\xb4\x98\xa7\x7b\x38\x78\x6b\xd7\xb4\xf3\x0f\x3e\xc8\ \xed\xc4\x9e\x0f\x71\x1c\x60\x0c\xa8\x3f\xab\x06\x3d\x0f\x58\xb4\ \x3c\xc0\xf6\x03\x36\x95\x26\xf2\x8e\x3f\xb8\x91\x07\x6e\x98\xb1\ \x3f\xd8\x74\xe8\xb6\xa1\x25\xae\x1f\x39\xe3\x67\xc0\x14\xd1\x00\ \x1d\x02\x74\xa9\x7f\x6d\xdb\xff\x66\x47\x03\xb4\x6d\x3f\xa1\x16\ \x49\xd0\xe9\xf9\x33\xe0\xa7\xc1\xb7\xc0\x03\x09\x8c\xee\x01\xb6\ \xac\x7a\xc6\xc2\x37\x53\xd4\x02\x6a\xe1\x19\x0b\xbd\x8d\xee\x82\ \x90\xf7\x36\x69\x90\xd0\x03\xf0\xb5\xfd\xdc\x71\xff\x61\xa6\x89\ \x1a\x20\x00\x93\xc4\x01\xa1\x17\x0f\x01\x00\x7c\x30\xed\x2d\xcb\ \x47\xca\xc2\xc6\x44\xdc\xaf\x5f\xf8\xe3\xff\x86\x34\xd4\xba\x7c\ \x80\x6e\x0d\xd0\xb6\xfd\xdd\x0e\x60\x73\xde\xfb\x0f\xf5\x42\xf8\ \xb5\xa2\xd7\xcf\x14\x24\x28\x84\x6f\x82\x59\x0f\xa3\xa3\x75\xdc\ \x6b\x57\x90\x87\xfd\x4f\xd2\xaa\xa8\x95\xcd\xe6\x5f\x3f\x17\x74\ \x97\x84\xfd\x97\x26\x8d\x25\x85\xf0\xf7\xd4\xd8\xfb\x33\xdf\xe2\ \x2b\xc5\x69\x8e\xa8\xfa\x0f\x02\x87\x4f\xf4\x38\x00\x2c\x32\x01\ \xd6\x0e\x4a\xef\x1f\xbc\x8a\xdf\xbf\x7e\x4b\xcf\x2f\x9f\xf7\x93\ \xaf\x21\xed\xeb\x89\x42\x44\xbb\x08\xd0\xf6\xfc\x73\x4c\x73\xc4\ \x32\x08\xad\x05\x04\x68\xce\xf7\x7e\x5f\xf4\xfe\x30\x0b\x79\x33\ \xfa\xd4\x39\x50\x19\xa0\x56\xef\x63\xfc\x60\x9d\x50\x9a\x7e\xd6\ \xbd\xf9\x99\x62\x61\x51\xe8\x6f\xd4\x98\x58\x52\xd4\x35\x4e\xe7\ \xcc\xfc\xc2\x6d\x7c\x86\xc8\x2c\x89\x37\xc8\x61\x60\x3f\x31\x02\ \x38\xe1\x58\x34\x02\x5c\xb5\x41\xd6\x7d\xf0\x46\x3e\x7a\xe5\x45\ \x4b\x6f\xdc\xf4\x86\x37\x92\x2c\x5d\x63\x16\x66\xe7\x63\x7f\x0d\ \x62\x9d\x08\x20\xda\x7f\x42\x8e\x5a\x0b\x2c\x43\x7c\xb3\x13\xef\ \x5b\xb7\xfa\x2f\x08\x60\x3e\x8b\x82\xcf\x88\xcb\x3e\x55\x4b\xd4\ \xf7\xb7\x98\x2a\x55\x29\x49\xf3\xfb\xe9\xdc\x4f\x8a\xee\xb2\xf0\ \xcd\x19\xb5\xdf\xcc\xd1\xa1\x42\xf8\x00\x37\x7d\x83\xbf\xbc\xff\ \x30\x53\x5d\x97\x4c\x03\x7b\x88\xf6\xff\xc5\x53\x11\xf4\xe3\x67\ \xcb\xc5\xbf\x7f\x03\xb7\x9c\x77\xf5\x19\x67\x6d\x78\xd5\x2b\xb1\ \xb4\xcf\xc4\xcf\xc4\x3c\x80\x29\xa0\x98\xaa\x09\x41\xda\xea\x5f\ \x34\x47\x43\x8e\xb3\xb6\xfa\x6f\x40\x68\xa1\xa1\x8e\x6b\x27\x7a\ \xfc\x1c\xf8\x3a\x96\x79\xa4\x45\x14\x7c\x13\xf0\x60\xeb\xce\xe4\ \x91\xc7\x46\xa8\x9e\xbb\x8c\xfc\x79\x8c\xb4\x8e\x35\x31\xe4\xea\ \x09\x76\xbc\x67\x80\xb3\x29\xc5\xf7\xd3\x39\x33\xbf\x7d\x0f\x9f\ \xb9\xff\x30\xdd\xc3\x84\x0d\xe0\x09\x60\x17\x30\xb3\x58\x85\xa1\ \x27\x9c\x00\xaf\x3e\x5b\xae\x7d\xe7\xd5\xdc\x7c\xc5\x8f\x9e\xbb\ \x6e\xe9\x95\x57\x01\x21\x3a\x6a\x42\x91\x07\x8a\x04\x38\x32\x01\ \x14\x7b\xbf\xb4\x13\x40\xa1\x5b\xfd\x17\xb6\x3f\xab\x41\x2b\x83\ \x96\xc5\x5e\x9f\x13\x6d\xbf\x07\x92\x0a\x0c\x9e\xcd\xf4\xce\xfb\ \x58\x72\xc3\x55\x8c\x3f\x0f\x23\xae\xc7\x9a\x1a\x76\xc6\x38\xdb\ \xde\x59\x62\xf9\xc6\x01\xce\x6e\x1f\x1b\xa9\x31\xf2\xf6\xdb\x3a\ \xc2\x37\xa2\xdd\xcf\x88\x05\xb0\x8f\x00\x63\x8b\x55\x0f\x08\x27\ \x98\x00\xaf\xda\x24\x5b\x7e\xe5\x1a\x3e\x73\xd5\x6b\x4e\x5f\xb5\ \xec\x92\xf3\xa2\x9d\x46\xe8\x92\x3e\xa8\x71\x84\xf7\xaf\x6d\x07\ \x30\x2b\x84\x5d\xc4\xfa\xf9\x2c\xe4\xd9\xbc\x9d\x0f\x74\x04\x6e\ \x1e\xa4\xfb\x7d\xdf\x00\x94\x4e\xe3\xe1\xdd\x4a\x65\xc5\x73\x1b\ \x01\x7f\xaa\xc9\xa1\x83\x93\x2b\x78\x87\x4d\xef\x7f\xc9\x50\xbe\ \xa5\xfb\xf8\xfd\x87\x79\xe8\x47\xfe\x2f\x37\x33\x6f\xf3\x85\xd8\ \xda\x7d\xc0\x76\x60\x2f\x31\x01\xb4\x68\x38\x61\x04\x38\x77\xb9\ \xac\xfa\xbd\x97\xf1\x89\xcb\x7e\x78\xd5\xf0\xf2\xf3\xd7\x83\x3f\ \xcc\x11\xc2\x6f\x0b\xdb\xf2\xc2\xf1\xeb\xca\xf1\x6b\x1d\x7c\x23\ \x7e\x1e\x42\x14\x76\xb1\x49\xd7\xeb\x4e\x8f\x0f\x40\xde\xe5\x3f\ \x2e\x3d\x8f\x6c\x74\x9a\x7a\x80\x99\xc6\x34\xf5\xd6\xf4\xf7\x3d\ \x3d\x5c\x1b\x7d\x5c\xd5\xac\xf2\x13\x69\x83\x73\xfb\x0f\x41\x2c\ \xeb\x02\x62\xaf\xff\xd0\x36\xfe\xcf\xa7\x77\xf3\x78\xbc\x39\x4a\ \xc4\x9e\x5f\x07\x46\x81\x87\x89\xea\x7f\x51\xe7\x04\xc0\x09\x22\ \x40\xea\x44\xfe\xf8\x65\xbc\xff\xdc\x73\xdd\x45\xab\x2e\x2f\x63\ \xad\xbd\xc5\x4d\x6b\x31\xd8\xe3\x31\x0b\x16\x5f\x77\x27\x7e\xbc\ \x45\x62\x58\x5b\x29\x88\x69\x21\x74\xa5\x23\x78\x6b\x0b\xbf\xb8\ \x94\x42\xf0\xc1\x43\xcb\x43\xef\x92\x0d\x3c\x7a\xd7\x08\xf5\x72\ \x99\x7b\x6e\xfd\xd7\x67\x54\xd5\xb3\x10\x3e\x63\xa6\x39\xcb\xde\ \x1b\x72\xf2\x97\x27\xf4\x5c\x3a\x54\x3b\x9b\xbe\x23\x1d\xf7\x71\ \x5f\xe6\xaf\x9f\xa8\xde\xf1\xe1\xbb\x67\xbe\x40\xec\xd9\x42\x1c\ \xe6\x75\xc4\x64\xcf\x6e\xa2\xda\xdf\x47\x9c\x1a\xb6\xe8\x93\x32\ \x4e\x08\x01\xae\x5b\xcf\xcb\x36\xad\xe6\xe7\xce\xbd\xae\x2c\xe4\ \x93\x26\x88\x74\xab\x7d\x33\x35\x41\x25\x46\x00\x01\x54\x31\x33\ \x13\x43\x28\x5c\x82\xb6\x55\x70\x6d\x2b\x2a\x60\xad\xf8\x15\xd2\ \xa5\x01\x64\x9e\x3f\x64\x05\x01\xfa\x06\x4f\x63\xec\xc1\xcf\xc1\ \x8a\x15\x33\x87\xc7\x46\xf6\xa6\x15\x06\xab\xfd\xac\x5f\xd8\xce\ \xe6\x1c\x7b\x7d\x6b\xde\x41\xb8\x21\x27\x5f\x65\x70\xa1\xa3\x74\ \x7a\x3f\xeb\x87\x06\x38\xff\x58\xf7\x37\xee\xcb\xfc\xc3\xd4\x30\ \x9f\x9f\x5a\x05\xf0\xd2\xb5\x6b\xf7\x3f\x36\x3a\x3a\x7a\x3f\x90\ \xc4\x56\x71\x88\xd8\xe3\x1f\x25\x26\x7c\x4e\x9a\xc9\xa1\xc7\x9d\ \x00\xef\xfb\xa5\xb7\xf5\xbc\x61\x13\xef\xbf\xf4\x6a\xd2\x72\x4f\ \x93\xe8\xee\x74\x2f\xcc\x6d\x98\xc6\xd1\xe0\xb6\x1b\xd0\xd9\xda\ \xc2\x6f\xe7\xcb\xa4\x0c\x03\xcb\x41\x6b\x8c\x3d\x3c\xc3\x8e\xbb\ \xe1\xac\x73\x60\xd5\xaa\xe2\xbc\xc2\xfe\xfb\x42\xf0\x0d\x1f\xfd\ \x3f\xa9\x1f\x62\x64\xe7\x1e\x5e\xbb\x7a\xcd\xe0\x7b\x34\x0a\xf1\ \xfe\x83\x6c\x5f\xd8\xd6\x8b\x97\x72\xfe\xb3\xa9\xc9\xd9\x36\xc5\ \x03\x7f\x39\xba\xec\xc0\x8e\xf2\x19\x47\xd4\x89\xaf\x59\xb3\xe6\ \x2d\xa3\xa3\xa3\x0f\x13\xeb\xfb\xf6\x12\x7b\xfe\xbe\x4b\x2f\xbd\ \xf4\x15\xce\xb9\x9b\x01\xae\xb8\xe2\x8a\x93\x62\x85\xf2\xe3\x4e\ \x80\x6b\xd7\xf2\xa3\x72\x88\x97\xac\x39\x87\xae\x48\xd7\xe6\x39\ \xd0\x16\xf4\x42\x02\xe8\x82\x7d\x65\x09\x2c\xbb\x18\xf3\x53\xec\ \xfd\xd7\x47\xf8\xf6\xed\xd0\x6a\xc1\x9e\xfd\x70\xc9\x79\x70\xce\ \xe6\xa8\x1d\x72\x0f\xcd\x30\x4f\x80\xde\xa1\x01\x66\x0e\xee\x66\ \xfc\x40\x93\x57\x9c\x57\x82\x89\xf8\x67\x2f\x5e\x7a\xec\xde\xfc\ \x74\xd8\x36\xc5\x03\x5f\xdf\xcf\x7d\xef\x7f\x80\xef\xc4\xd6\x4d\ \x96\xd7\xae\xad\x4e\xae\x59\xb3\xe6\xcd\x0b\x4e\x55\x62\x8a\x77\ \x27\xb0\xfb\xb2\xcb\x2e\xbb\x51\x44\x6e\x7e\x2e\x7f\xf3\x78\xe2\ \xb8\x12\x40\x7d\xee\x0e\xdd\xfd\xf5\x77\x5d\x77\x15\xa9\x18\x31\ \xf8\x69\x0b\xbe\x2d\x70\x78\x7a\x02\xf4\x0d\xc3\xfa\x57\x43\xeb\ \x30\x8f\xfd\xd3\x36\xee\xbe\xab\x49\x2b\x83\xc9\x89\x78\xca\xbf\ \xcc\xc2\xde\x51\xb8\xea\x32\x20\x81\xa6\xc7\x5a\x01\xf1\x01\xfa\ \xaa\xc6\xc4\x43\xf7\xd2\xcc\xa0\xa7\xfe\xec\xd6\x7f\x7e\x78\x9a\ \x7b\x27\x5b\x1c\xbe\x7f\x92\xc7\xbf\xbc\x8f\x5d\xdf\x3e\xc4\x54\ \xfc\x0b\x94\x89\xe5\xdc\x00\xc9\xe8\xe8\xe8\x36\xe0\x93\x6b\xd6\ \xac\x79\x4b\xd7\xe5\x09\xb1\xc2\xa7\xf7\xa2\x8b\x2e\x7a\xbd\x88\ \xfc\xcd\xc2\xef\x17\x91\x75\x44\x07\x71\xd1\x56\x28\x3f\xae\x04\ \xd8\xfe\xc5\xbf\x3d\x2f\xad\x8f\xfc\xf0\xba\x33\x98\x8f\x74\x8b\ \x74\x4f\xf7\x79\x12\x7d\x3c\x59\x40\x00\xc1\x30\x7a\x86\xe1\xcc\ \x7f\x0f\x7e\x8e\xdd\x5f\xfe\x2a\x77\xdd\x3e\x41\xa3\x01\x07\x0e\ \x62\x3b\xa7\x78\xac\x2f\xa1\x77\xdd\x00\x6b\x6a\x73\x30\x7a\x00\ \x5e\x72\x25\xf4\x0d\x42\xd0\x22\xdb\x2b\x35\x1e\x79\xb8\xc1\xb4\ \x67\xec\x8c\xcf\xf8\x3f\xa9\xd7\xa3\x31\xf9\xed\x0b\xb9\xc8\x40\ \x44\xd0\x44\xf0\x0e\xf4\x3f\xdf\xcf\xbd\x45\x93\xda\x42\x76\xcc\ \xb7\xd5\x88\x02\x4d\x8a\xdf\x4d\x88\x8e\xde\x2c\x30\x33\x3a\x3a\ \xfa\xc0\xe8\xe8\xe8\xa7\x89\xe5\xdd\x2b\x8b\xeb\x57\x6c\xdc\xb8\ \xf1\x4d\xa5\x52\xa9\x33\xef\xb1\x8d\xe9\xe9\xe9\xdf\x02\xae\x29\ \xbe\x73\xd1\x56\x28\x3f\xae\x04\xf8\xde\x57\x3f\xf7\xf6\x33\xce\ \x20\x29\x97\xe8\xf4\x7e\x13\x4c\x8e\x74\x02\x30\xc3\x5c\xb7\x36\ \x28\xd2\x01\x92\x96\x85\xf3\x7e\x0d\xd2\x21\x76\xff\xc3\x9f\x71\ \xdb\xad\x7b\xac\x56\x43\x0e\x8e\xe1\xbf\x7c\x90\xdb\xbf\x3d\xcd\ \x57\x13\x61\xfa\x4d\xab\x79\xf5\x59\xfd\xbc\xa2\x5e\xc7\x1d\xfc\ \x22\x5c\x79\x35\xb6\x6e\x3d\x92\x00\x95\xcc\x38\xb0\x2b\x30\x78\ \xfe\x15\x4f\xd4\xbf\x7c\x77\x46\x14\x4c\xf9\x0f\x1f\xa4\x3d\x2f\ \xac\x08\x1a\x09\xcc\x97\x65\x27\xc4\x9e\x99\x74\x9d\x93\x15\x5b\ \xbd\xd8\x37\x80\x29\x62\x1a\x77\x92\x38\xa8\x93\x10\xe7\xfb\x9d\ \x0f\xac\x5a\xbb\x76\xed\x25\x2b\x56\xac\x38\x6a\x01\xcb\xe9\xe9\ \xe9\xdf\xd9\xb9\x73\xe7\x38\x70\x16\xf3\x95\xc0\x8b\xb2\x42\xf9\ \x71\x23\xc0\xe8\xb6\x7b\xfa\x76\x7d\xeb\x2b\x37\xbe\x6c\x2b\x47\ \xab\xfe\x85\xe8\xee\x63\xed\x0d\x81\x2d\xef\x86\xc1\x4b\xd9\xfd\ \x85\x3f\xe2\x9b\xff\xb4\x9d\xb9\x1a\x8c\x1f\xa2\x71\xeb\x18\x7f\ \x71\xd7\x34\xf7\x03\xb3\xde\xd8\xfd\xd9\x03\x7c\xf6\xa6\x61\xb6\ \x9e\xd1\xc7\x7f\xcc\x73\xfa\xfe\xe5\x56\x38\xef\x7c\x38\xef\x3c\ \x98\x1b\x87\xdd\x07\xa1\x74\xc9\xf2\x6f\x01\xf7\x13\xcb\xaf\x07\ \xa0\x9d\xa8\x3d\x4a\xd8\x70\x24\x29\x28\x5e\xcf\x12\x85\xdc\xde\ \xd7\x89\x24\xa8\x01\x4d\x33\x0b\x22\x92\x10\xb5\x82\xdf\xb8\x71\ \xe3\x4f\x3f\x85\xf0\x0f\x12\x67\x03\x95\x8b\x5f\xe7\x84\x97\x82\ \xb5\x71\xdc\x08\x10\x7c\x7e\x46\x39\xf1\xa7\xad\x58\xc6\xfc\xad\ \x45\xf5\x1f\x3d\xfe\x36\xec\x18\x7b\x05\xd6\x5d\x05\x6b\x6f\xe4\ \xf0\x9d\x9f\xe3\xd6\xbf\xfb\x26\xb3\x73\x30\x79\x88\x7c\xfc\x10\ \xbf\x5f\x9b\xe6\xcb\x5b\xa0\x5c\x82\x6c\x10\x66\x57\x19\x7e\xfc\ \x20\xff\xbd\x7f\x88\xc7\x56\x2c\xe3\x4f\xcd\x58\xbd\xed\x41\x38\ \x7c\x18\x0e\x6d\x84\xdc\xe3\xaf\x7e\xc5\x8d\xff\xcc\xa7\xbe\x72\ \x2f\x85\x06\x60\x5e\xe0\xdd\xd5\xb8\x6d\x2c\xac\xcf\xeb\xd6\x00\ \xed\xcd\x2f\x0c\xe5\x0a\x12\x4c\x5d\x74\xd1\x45\xe7\x3d\x89\xda\ \x3f\x4a\xf8\x1b\x36\x6c\xd8\x30\x3c\x3c\xfc\x7e\x58\x9c\xc8\xe0\ \xf8\x99\x00\xa3\x6f\x78\x39\x3d\x9d\xcc\x1c\x1c\x5b\x0b\x2c\xec\ \xfd\x80\x95\xab\x70\xf6\x9b\x68\x3c\x71\x3b\x5f\xf9\xf3\x8f\x30\ \x35\x13\x98\x9e\x12\x76\xcf\x56\xef\x9d\x9e\x6a\xdc\x73\x11\x94\ \xd3\x22\xdb\xef\x21\x11\xe8\xed\x83\x52\x6b\x9a\x6f\x1c\x68\xf0\ \xda\xe1\xd5\xfc\x59\x92\x72\xe5\xbe\xbd\xc8\x81\x51\x50\x65\xe2\ \x9c\x8b\x2e\xdd\x66\x66\x47\xcd\xd9\x2a\x7a\xed\x31\x35\xc0\x73\ \xa9\xcf\xbb\xfc\xf2\xcb\xdf\x00\x1c\xe5\xf0\x3d\x85\xf0\xdf\xf1\ \x6c\xff\xc6\xf3\x89\xe3\x3a\x35\x6c\x70\x10\xb2\x0c\xf3\x19\x16\ \x72\x4c\xb3\x62\x54\x37\xeb\xda\xda\x69\xfe\x1c\xf3\x39\x96\x67\ \x18\xa7\x5d\x6e\xe2\xa7\xed\x8e\x8f\xfc\x37\x46\x0f\x78\x66\x67\ \x60\xa4\x31\xc0\x9e\xc1\xf5\x57\x4d\xad\x5c\xf9\xc6\x69\x18\x0e\ \xd1\x0b\x2f\x25\x90\x4a\x24\x72\xa2\x90\x64\x19\x8f\xed\x1f\xe5\ \xa6\x7a\x9d\x8f\x9b\xa1\x3e\x60\x33\x9e\xd1\xf7\xff\xb7\xff\x79\ \x4c\x07\xcb\xcc\x82\x99\x35\xcd\xac\xd6\xb5\x35\x9f\x8b\xf0\xaf\ \xb8\xe2\x8a\x9b\x88\x4b\xdb\x1d\x81\x67\x23\x7c\x11\x59\x27\x22\ \xa7\x8b\xc8\x6a\x11\x39\xee\x7e\xc1\x71\x25\x40\xa9\x02\xb5\x0c\ \x99\xcb\x90\x5a\xb1\x35\x32\xac\x91\x41\x33\x83\x46\xb1\xb5\x3f\ \x9f\xcb\x90\x56\xb9\x22\x2c\x19\x96\x27\xbe\xfc\x39\xee\xfd\xce\ \x28\x8d\x3a\x4c\x35\xcb\xec\x29\x2d\x8f\xb5\x02\x4b\x96\xbc\xfd\ \x10\x6c\x9c\x84\x21\x0f\x69\x91\x51\x90\xc2\x5d\x17\x05\x66\x3d\ \xd3\x07\x0e\xf0\xae\x89\x19\x7e\x1d\x98\x6d\x29\x77\x7f\xec\x6f\ \x6f\x3e\x11\x99\xb7\xef\x4b\xf8\x5d\x91\xc1\xcb\x88\xcf\x30\x5a\ \x72\x7c\x9b\x7b\x9c\xa3\x80\x5c\x61\x2e\xa3\x93\xf8\x75\x0b\xdd\ \x7f\xba\x34\x7f\x11\x1b\xae\x3c\xad\x17\x3f\xf9\x30\x5f\xbb\x65\ \x07\xf5\x06\x78\x8f\x3e\xa6\xcb\x5d\x48\x1c\x52\x98\xdc\x69\x38\ \xdd\x43\x16\xa0\xb9\x04\x9a\xc9\xfc\x40\xb2\x7a\x30\x07\x36\x05\ \x7e\xee\x10\x1f\x79\xb4\xc9\x77\x27\x84\xe9\xe3\x79\x9f\x4f\x86\ \x67\x29\xfc\x45\x89\x0c\x8e\x2b\x01\xea\x8d\x98\x8f\x87\x48\x02\ \x8e\x41\x00\x28\xf2\x40\x06\x95\x12\x94\x2b\xb3\x3c\xf8\xf5\x59\ \xf6\x8c\xc6\x92\xad\xe6\x1c\x77\xcf\xe5\xad\x47\x59\xda\xfb\x16\ \x44\x30\x11\x5a\xb0\x24\x83\xd3\x33\xa8\x1b\xcc\xae\x80\x39\x01\ \x75\xc5\x16\x62\xd5\x80\x4d\x43\xb8\x6d\x8e\x7f\x4d\x4b\x25\x35\ \xcb\x4e\x68\xee\x7d\x7a\x7a\xfa\xb7\x0a\x81\x3e\x53\xe1\x2f\x4a\ \x64\x70\x5c\x09\x30\x37\x17\xbd\xb4\xb6\xd7\x2f\x9d\xff\x8e\x44\ \xdb\x97\x5e\x3a\x08\xcc\x79\xee\xb9\xad\x73\x2c\xab\x4d\xf3\x0f\ \xcb\x9b\x93\x4f\x8c\x4f\x4e\xde\x3b\x0d\xeb\x9a\x30\xa4\x90\x78\ \x58\x12\x60\x55\x15\x76\xaf\x04\x6f\xe0\x35\xba\x15\xbe\x05\x5a\ \x86\x70\x57\x51\x5e\x9a\x65\x27\x46\xf8\x6d\x0f\xbe\xc8\xf0\x5d\ \xc3\x7c\x6f\x7e\xb6\xc2\x3f\x48\x1c\x3f\x38\xf6\x3c\xf3\xe7\x11\ \xc7\x33\x0a\x98\x1d\xdd\xc7\xec\x81\xfd\x0c\xac\x5c\xc9\x42\xc1\ \xdb\x82\x37\x02\xd0\x6b\x70\xe8\x71\x18\x3d\x18\x8f\x67\x2d\x1e\ \xcf\x9a\x6c\xef\x87\xa0\xc5\xe0\x5e\x06\xeb\x35\xda\x7f\xa7\x50\ \xae\x13\x6b\x8a\x92\x82\x04\x21\x9e\x1b\xee\x01\x9d\x01\x5d\xa4\ \x51\xb7\x76\x68\xf9\x5c\x85\xff\x10\x71\x21\xc9\xe3\x5e\x28\x7a\ \xdc\x08\x30\x9e\xf1\xf0\x6d\x63\xfc\x7b\xf7\x2d\xfe\xc7\x15\x2f\ \x61\x60\xf5\xda\x8e\x2f\xd0\xae\x8e\xe9\xc0\xa2\xdd\x16\xdf\x80\ \x3d\xbb\xa0\x15\x15\x9f\xec\x6f\xf5\x4c\xb5\x68\x54\x07\x61\xaa\ \x3f\x8e\xed\x34\x72\xa8\x79\x58\x19\x62\xdb\x0f\xb8\x42\x55\xd6\ \xc1\xe7\x05\x01\x76\x41\x38\xb0\x78\xc2\x87\x98\xdb\x3f\x00\xb0\ \x71\xe3\xc6\x8b\x56\xac\x58\xf1\x6c\x85\xff\x28\x71\x6c\xe0\xb8\ \x4f\x13\x3b\x6e\x04\xb8\xec\xea\xab\xed\xd6\x5a\xf9\xd3\xab\xf7\ \x66\x35\xef\xf9\xab\x2b\xae\x64\xd9\x9a\xd5\x60\x72\xec\x44\x90\ \x00\xa3\x53\xb0\x3d\x2e\xdb\x8f\x22\x8c\x0d\xac\xba\xaa\x79\x68\ \xf7\xb0\x42\x63\x10\xea\x4b\xa1\x26\x30\x55\x85\xdd\xf5\x68\xeb\ \xa7\x97\xc0\xa1\x7a\x1c\x04\xf4\x59\x14\xbe\x7e\x6f\x71\x85\x0f\ \x31\x45\x7c\x1f\x50\x5d\xb1\x62\xc5\x5f\x2f\xfc\x70\xa1\xf0\x2f\ \xbf\xfc\xf2\xdf\x6d\x7f\xd6\x6a\xb5\xde\xbe\x6d\xdb\xb6\xef\x9c\ \xa8\x39\x82\xc7\xd5\x07\x38\xe7\x9c\x73\x6c\xe2\xc1\x07\xff\x29\ \x31\x7e\x41\xee\x96\x9b\x2f\xb9\xc4\xaa\xc3\x6b\x8e\xee\xfe\x6d\ \x4c\x34\xe1\x50\x51\x34\x5d\xd7\x32\x59\xa9\xc4\x61\xd8\x90\xc7\ \xa8\xb1\xbe\x14\xe6\x96\x40\x6b\x19\x64\x06\x4d\x0f\xad\x3a\xe4\ \x39\xf8\x29\xf0\xfb\xc0\xef\x58\x7c\xe1\x53\x8c\xea\x1d\x80\x98\ \xdd\xeb\xc6\x93\xf4\xfc\x0e\x2a\x95\xca\xc7\x2e\xbf\xfc\xf2\x59\ \xe2\x03\xa9\x8e\x3b\x8e\x6b\x1e\x60\x68\xc9\x12\x9b\x05\x7d\xe8\ \x8c\x0b\xfb\xbe\xc5\xa6\xea\xed\xdf\x2d\xb1\xe7\xf1\xa2\x96\xb3\ \xbd\xe5\xc5\xd6\xce\x0d\x34\xe2\xb5\x33\x56\x21\x38\x47\x03\x06\ \x26\xe1\xb4\x7d\xb0\x72\x22\x12\xb6\x65\xd0\x14\xc8\x1a\x90\x29\ \xe4\xd3\x90\xef\x38\x49\x84\xff\x54\x28\x22\x83\x63\xa9\xfd\x85\ \xf8\xcc\x05\x17\x5c\xf0\x8b\x22\x32\x58\x64\x2a\x8f\x1b\x8e\xfb\ \x5a\xc1\x97\x5f\x76\xd9\x9b\x1d\xdc\x2c\x66\xf4\x37\x6b\x72\x75\ \x78\x9c\x2d\xe7\x78\xd6\xac\x39\x7a\x6a\x46\x9e\xc3\x9d\xb7\xc7\ \xc8\x61\xd7\x21\xbe\x79\xd7\x0c\x0f\x6b\xcc\xf0\xb5\x4a\xf0\xf8\ \x2a\xb8\xeb\x1c\x18\x11\xc8\xea\xd1\x21\xcc\x67\xc1\xdf\x0e\x61\ \xf6\x24\x7e\x2c\x0b\x1c\x3b\x32\xa0\xb0\xf9\x5b\xb6\x6c\x39\xbf\ \x52\xa9\x7c\x6c\xe1\x35\x05\x61\xfe\x82\xe3\xe8\x0f\x1c\x57\x0d\ \x70\xc5\x15\x57\xfc\x94\x38\xf7\x49\x13\x31\x13\xb1\xb9\x6a\x1f\ \xdf\x4e\xce\x60\xdb\x76\x37\xb3\x77\x04\xc9\x32\x24\x8f\x1b\x79\ \x86\xb4\x5a\x48\x08\xd1\x42\xf8\x9c\x07\x80\x83\x85\xe3\xe7\x9a\ \x50\x9a\x8d\xc9\x9e\xd6\x4c\xf4\x13\xf3\x59\xf0\x77\xbc\x00\x84\ \x5f\xe0\x88\xc8\x80\x2e\x87\x6f\xdb\xb6\x6d\x7f\x03\xf3\x8f\xc0\ \x69\x63\x68\x68\xe8\x03\x9b\x37\x6f\xfe\x45\x60\xc9\xf1\xd2\x04\ \xc7\xf4\x01\xae\xdb\x2a\x57\x11\x8b\x1a\x2e\x2e\xce\x29\x01\x6b\ \x81\x97\x14\x37\x50\x29\x8e\x09\xd1\xd9\x39\xc8\xfc\x60\xca\x77\ \x80\xd1\xda\xf6\xcb\x01\xfe\x0e\x00\x91\x76\x77\xd7\x03\xcd\xfc\ \xfd\x5f\xda\xab\xe5\x10\x78\xc7\x59\x2d\x86\xd6\x14\xc5\xd4\x06\ \x34\x1b\x9d\x26\x84\x1e\x78\xb8\x0a\xe3\x1e\xd6\x84\x98\x11\x3b\ \x00\xcc\xb6\x20\x9b\x2b\x66\x05\x3c\x00\x61\xe6\x24\x78\xe8\xc2\ \x33\x44\xc7\x2f\x20\x46\x2e\xbb\x89\xa1\x5e\xbb\x77\xdf\x72\xc1\ \x05\x17\xbc\xa3\xa7\xa7\xe7\x7f\x74\x5f\x34\x34\x34\xf4\xfe\xcd\ \x9b\x37\xb3\xec\xc2\x9d\x07\xae\x7d\xab\x2c\x11\xe1\xaa\xe2\x23\ \x03\xd6\x01\x57\x42\x77\xe9\x2c\x1e\xb8\x83\x58\x8b\xd8\x2e\x94\ \xbf\x07\x18\xbd\xf5\xe3\xf6\xcf\x0b\x1b\x25\xd7\xbe\x95\x7e\xe0\ \x5c\xe0\x0c\xe0\x6c\x62\x7d\x7b\x0f\xb1\x38\xa2\x87\xf8\xe3\xf7\ \x30\x3f\x8c\xda\x26\x40\x85\x28\xf4\x76\x85\x4c\x4a\xd4\x28\x6d\ \x52\x89\xe5\xe5\x24\x34\xfa\x44\x1b\x7d\xce\xcf\x2c\x95\xa9\x83\ \x73\xff\x69\xdf\xe3\x8f\x1f\x12\x58\xb3\x3e\x61\xdd\x6b\xd6\xf1\ \xba\xb3\x4e\x67\xd9\xca\xe1\x18\x1a\x36\x1b\xf0\xc8\xf7\xc0\x8c\ \xc6\xc1\x51\x7e\xe2\xb1\x26\x7b\x27\xa0\xa7\x15\xbf\xb7\x36\x00\ \x13\x2b\x61\x6e\x1f\xf8\x7b\x21\x9c\x0c\x4f\xdc\x78\xa6\x28\x06\ \x76\x96\x10\x7f\xcf\x76\x7d\x41\xad\x5b\xb5\x8b\xc8\xe0\xe6\xcd\ \x9b\x7f\x69\xc9\x8a\x9e\x0f\xa4\x83\x87\x71\x3d\x35\x92\x9e\x1a\ \x52\xca\xe0\x88\xf1\x52\xba\xdf\x77\x0b\x7f\xe1\x0c\x89\xf6\xec\ \xc8\x16\xf3\xc5\x2c\x7b\x88\x9d\xf6\x41\xe0\x0e\xb9\xf6\xad\xfc\ \x3c\x45\xed\x5a\x7b\x3f\xbc\x61\xb8\x17\xe8\x1d\x5e\xbf\xb2\x07\ \xb3\x3e\x83\x9e\x4a\x4f\xa5\x3a\xb8\x6c\xa8\x2c\x42\x15\x28\x23\ \x51\x0b\xcc\x4c\x4c\xa7\xad\x7a\x2b\x2d\x82\xbb\x74\x6c\xef\xb8\ \x03\xdc\xd8\xc8\x58\xda\xd5\xe0\x04\x90\x56\x9d\xc7\xa6\x46\x79\ \xf4\xc0\x23\xec\x6c\x4d\x72\xf8\xf4\x84\xf4\x75\xeb\xf9\xb9\xf5\ \x6b\x59\xb7\x62\x25\xd2\x6a\xc2\xae\x5d\x60\x46\x7d\x6c\x3f\x3f\ \x52\x6f\xf0\x88\xc4\x70\xcf\x37\xa3\x6b\x10\x76\x42\x78\x18\x42\ \x38\x89\x9d\xbd\xe7\x82\xeb\xb6\xca\x7a\x33\xde\x84\xf1\x46\x71\ \x5c\xb9\xe0\x63\x2b\x16\x99\xb4\xae\xe7\x1f\x5a\xa5\xb7\x62\x43\ \xcb\x87\xcc\xac\x4d\x04\x0b\x40\x98\x9e\x98\xd1\x56\xad\xd9\x9e\ \x1c\xd7\x3a\x38\x72\xa8\x65\x90\x8d\x8f\x8c\x35\x11\xea\x40\x4d\ \xda\xfb\x6b\xdf\xca\x4f\x0f\x6f\x18\xee\x1b\x5e\xbf\xb2\x6f\xd3\ \xe9\x17\xf6\x0d\x0e\x2c\xeb\x5f\xde\xbb\xa1\xaf\xa7\x3c\xd8\xa7\ \x66\xfd\x4b\xab\x6b\xfb\x7b\xca\x83\x7d\x40\x8f\x08\x65\xe7\x5c\ \x05\xa8\xd4\xb3\xd9\xca\x44\x6d\x24\x11\x21\x69\x64\xb3\xa5\xc9\ \xfa\x88\xab\xb7\x66\xdd\x64\x6d\x44\x10\x12\xc0\xb5\x1a\x99\xcc\ \x4e\x4c\x73\x70\xef\xb8\x1b\xdb\x33\xd6\x9e\x06\x04\x02\xd3\x07\ \xf9\xea\xf8\x0e\xfe\xe7\x9a\x11\xf6\xbc\x62\x1d\x1f\x5d\x33\xcc\ \x25\xfd\x03\xb0\x27\xe6\x01\x66\xf7\x8c\x72\x69\xab\xc9\xc1\xbd\ \xa0\x12\x27\x91\xe9\xf6\x22\xc7\x7f\x32\x7b\xfa\xcf\x16\xd7\x6d\ \x95\xf5\xc0\xaf\x52\x3c\x29\xa5\x8d\xe2\xf9\x87\xd2\xf5\xfc\x43\ \xeb\x7a\xfe\xa1\x15\x4f\x49\x33\x8a\xdf\xc3\xd4\xc2\x5c\x73\xca\ \xc6\x67\x9f\x30\x33\x74\xae\x31\x15\xc6\x67\x9e\xf0\x8d\x6c\xd6\ \x1f\x9a\x1d\x69\x69\xb0\xcc\x8c\x56\xab\xd1\x6a\xce\x1e\x9e\xa9\ \x1d\x1a\x9d\x98\x1b\xdf\x37\x3e\x2b\x9f\xba\xe7\x77\x5e\x7f\xda\ \xf2\x2d\x3d\x4b\xaa\x6b\xfb\x6b\xb5\xc6\xd2\x56\xb3\xb5\x34\xcf\ \xfd\xa0\xa9\xf5\x8b\xd0\x6f\x46\x9f\x08\x55\x71\xae\xd7\x39\x29\ \x25\x49\x52\x11\x27\x95\xc4\x25\x25\xe7\xa4\x24\xce\x25\x22\x38\ \xe7\x5c\x9a\xa4\x89\x88\x88\x9b\x9c\x1b\x71\x23\x93\xdb\xdd\xc4\ \xdc\x5e\x99\xac\xed\x85\x98\xfc\x71\x63\x23\xe3\x72\x70\x64\x9c\ \xf1\x91\x31\x90\x48\x06\x0d\xfc\x59\xed\x01\xfe\xee\x47\xe7\xf8\ \xe8\x92\x41\x2e\xac\xc5\xf5\x21\xa6\xbe\x78\x80\x8b\x9e\xa8\xb3\ \xf7\xd0\x0f\x90\xb0\xbb\x71\x2c\xc1\x1f\xe3\xf9\x87\x9d\x94\x49\ \xb1\x94\x9e\x15\xaf\xdb\x7b\x4c\xad\x1d\xfa\x9a\x6a\x3c\xa2\xaa\ \x66\x6a\x21\x84\xe0\x55\x2d\x98\xaa\x1f\x9f\x19\xf1\x23\x87\xb6\ \x67\xe3\xd3\x7b\x5b\x87\x6b\xa3\x4d\x33\x1a\x66\xcc\xca\xf7\x0e\ \xdd\x7a\x23\xd0\x33\x33\x3d\x37\x34\x31\x3e\x39\xdc\x6c\x66\xcb\ \x81\x3e\x11\x06\x12\x97\xf4\x89\x93\xde\x24\x71\x95\x24\x49\x2a\ \xce\xb9\x9e\x24\x4d\xca\xc5\xfb\xd4\x39\x57\x12\x91\xc4\x39\x49\ \xc4\xb9\xd4\x39\x49\x92\xc4\x39\x44\x9c\xc4\x4d\x9a\xf9\xac\xec\ \x38\x70\xa7\xec\x3d\xfc\xb0\x6b\x64\x33\x26\x82\x34\xeb\x99\xec\ \xdd\x31\x22\x7b\x76\x8c\xb4\xed\x98\x64\x53\x7c\xec\xb2\xfb\xd8\ \x58\x0b\x8c\x7e\x67\x8a\x0f\x3c\x54\xb3\x1d\x27\x50\x1e\x27\x14\ \xd7\x6d\x95\x0f\x11\x9f\x90\x22\x00\x17\x5c\x76\x91\xbd\xf4\xea\ \x57\xc9\x96\x8d\xd7\xca\xb1\x9e\x7f\x68\x66\xdd\x45\xf4\xb4\x5f\ \xab\x46\xc1\x47\xc9\x9b\x59\xe4\x86\x9a\xaa\xaa\x9a\x86\xa0\xaa\ \x21\xf8\xa0\xea\x83\x0f\x5e\xd5\xbc\xcf\x7d\x56\x6b\x4e\x67\x8f\ \xee\xbf\xbb\xb9\x6f\xe2\xd1\x86\x6c\x3f\xf8\xb5\xeb\x81\xea\xe1\ \xc9\xe9\x25\x07\xf6\x8d\xaf\x69\x36\x5b\xcb\x92\xc4\xf5\x39\xe7\ \x7a\x9d\x73\xbd\x69\x29\xed\x4b\x12\x57\x75\xce\xf5\x24\x89\xeb\ \x71\x49\x52\x4e\x23\x09\xaa\xce\xb9\xc4\x25\xae\x04\x24\x69\x92\ \xa4\x5d\xda\xc0\xb9\xc4\x25\x80\x13\x11\x44\xc4\x39\x11\xd9\x71\ \xf0\x2e\x1e\x1d\xfb\x8e\x34\xb2\x99\x62\xd4\x0c\x19\x79\x64\x2f\ \x8f\xde\xbf\x53\x00\x2a\x69\xef\xbe\xfe\x74\xed\x0d\x9f\xff\x8b\ \x9d\x3b\x7e\x90\xd4\x7c\x1b\x45\xaf\xff\x17\x88\xd3\xd2\x2e\xbd\ \xe6\x0a\xb9\xfe\x9a\xd7\xcb\xd9\xab\xaf\xee\xdc\xab\x99\xb5\x43\ \xf3\x85\xf7\xdf\x2e\x87\x68\xab\xfd\xce\x25\x85\x11\x30\xb5\xd8\ \xfb\x31\x34\x84\xa0\xaa\x16\x29\x10\x42\x08\x3e\x64\xaa\xe6\xbd\ \xf7\x99\x06\xcd\xf2\xdc\xb7\x42\x08\xad\xd4\x9b\x6f\x02\xe4\x21\ \x6f\xb6\xf2\x56\xdd\x87\xbc\x27\x98\x93\x24\x71\x22\xe6\x9c\x12\ \x5c\x62\x09\x2e\x49\x9c\x33\x91\xc4\x12\xf5\x2a\x96\xa4\x09\xce\ \xb9\x52\xa2\x89\x24\x89\xb3\x40\xc0\x99\xc3\x89\x98\x98\x43\x14\ \x92\xc4\x59\x3b\xf3\xef\x9c\x93\x33\x87\x2f\x77\x67\x0e\x5f\x6e\ \xdb\xf6\x7d\xa3\xfd\xac\x3d\xd9\x70\xce\x06\x86\x37\x0c\xdb\xb6\ \x3b\xb6\x31\x3d\x31\xb3\xb6\xe5\x77\x3e\x7c\xe5\xeb\xf9\x05\x11\ \xf9\xdb\xc5\x9c\x37\xff\x7c\xe3\xba\xad\xf2\x53\xc0\xcd\x80\x74\ \x3d\xff\x50\x01\x72\xcd\x1d\x74\x86\xc0\x8f\x22\x7e\xb1\x88\xea\ \xfc\xf1\x76\x7f\x67\xfe\x7c\x35\x33\xd5\x18\x14\xa9\x2a\x6a\x86\ \x6a\x30\x35\xb3\xa0\xc1\x82\x29\x41\x03\x6a\x8a\xd7\x80\x37\x8f\ \x0f\xc1\xd2\x10\xf2\x48\x80\xbc\xd5\x08\xea\x1b\xde\xe7\x73\xe2\ \x1c\xaa\x82\x4b\x1c\x58\x42\x50\x4f\x92\x26\x38\x71\xaa\x89\xd3\ \x24\x4d\xc4\x2c\x88\x4b\x12\x51\xf5\x12\x82\xa4\x22\xce\x92\xc4\ \xa9\x38\x49\x93\x24\xde\x8f\x6a\x82\x73\xce\x89\x60\x1a\x00\x91\ \x20\x22\x72\xee\xea\x1f\x72\xab\x06\x37\x71\xcf\xe3\xff\x47\x9b\ \x7e\x4e\xca\x3d\x65\x2e\x7f\xc5\x65\xec\xbc\x6f\x97\xec\xd9\x31\ \x62\xd5\x7e\xfe\xf2\xb2\x1f\xa3\x2a\x22\x7f\x4d\x2c\xb9\x7e\x41\ \x6b\x83\xeb\xb6\xca\x4f\x02\x9f\x04\xec\xbc\x4b\xb6\x58\xf1\xfc\ \x43\xf1\x3e\xc3\xac\x98\x13\x15\xd5\x3c\x2c\x24\x40\xf7\xc8\x59\ \x21\x78\x11\x41\x4d\x0b\x3f\x80\x79\xbf\xc0\xcc\x54\x4d\x35\xb2\ \xc1\x42\xf4\x05\x2c\x84\xa0\x21\x36\xef\x44\xdf\x00\x00\x13\x32\ \x49\x44\x41\x54\xa8\x85\xa0\x04\x1f\x88\xf6\xc1\x9b\x6a\x20\x55\ \x0d\x19\x20\x66\xda\xf4\x79\x5e\xcf\xf3\xbc\x9c\xa4\x09\xaa\x62\ \x89\x39\x67\xaa\x88\x13\x34\x04\x75\x89\x13\x23\x15\xd5\xe0\x34\ \x4d\x48\x4c\x63\x8f\x77\x4e\x93\xc4\x99\x99\x13\xe7\xc4\x9b\x39\ \x11\x11\x33\x53\x44\x9c\x39\x27\x26\x22\x22\x82\x20\xe2\x00\x1d\ \xaa\x0e\xcb\x4b\x37\xdf\xc4\x1d\x3b\x6f\xa1\xe9\xe7\xc4\x0c\x36\ \x5d\xbc\xc9\x06\x97\x0f\xca\xb6\x3b\x1e\xb2\xfe\xe5\xfc\xd9\x45\ \xaf\xa4\xfa\xc0\x3f\xf3\x31\x11\x99\x3b\x99\x9f\xc0\xfd\x54\xb8\ \x6e\xab\xbc\x01\xf8\x04\x10\x8a\xe7\x1f\x4a\x4f\x69\x80\x10\xbc\ \x98\xe1\xe2\xb2\xb8\xed\xa2\xb8\x88\x23\x87\x4b\x8f\x84\x16\x0e\ \x1f\x85\xff\x50\x68\x7f\xac\x70\x03\xa2\x3b\xa0\xa1\xf0\x06\x09\ \x3e\x98\x99\x59\x08\xc1\x34\x14\xe6\x20\xa8\xf9\xe0\x35\x84\xa0\ \xa9\xd7\xbc\x05\x58\x2b\x6b\x95\x72\x9f\x37\xf2\x90\x97\x82\x79\ \x9c\x73\x92\x7b\x21\x49\x9d\x25\x89\x93\xe0\x9c\x25\xe6\x24\x98\ \xb7\x24\x49\x70\xe6\x2c\x09\x2e\x9a\x82\xc4\x11\x34\xba\xfa\x69\ \x29\x29\x8b\xba\x5c\x84\xd4\x25\x0e\xe7\x9c\x89\x16\x81\x80\x2b\ \x58\x20\xe2\x50\x2c\x75\x15\x77\xd5\xa6\xd7\x73\xd7\xae\xcf\xc5\ \x67\xed\x09\xac\x5c\xbf\x92\x2d\x2f\xbd\x40\xb6\xdd\xfe\x10\x4b\ \x56\xf3\x47\x9b\x5e\xc2\xd4\xae\xef\xf0\x05\x11\x39\x21\xe3\xe3\ \xcf\x27\xae\xdb\x2a\x57\x02\x7f\x0b\xe8\x95\xd7\x5f\x6d\xaf\xbe\ \xf6\x17\x49\x5d\xc5\x65\x3e\x13\x53\x95\x76\x15\x3c\xf3\xfb\x4e\ \xf1\x94\x41\xb7\xe7\xd7\xf9\x4c\xe7\x23\x80\x38\x87\xaa\x7d\xc2\ \xbc\xf0\x2d\x84\xb6\x1f\xa0\xc1\x4c\x2d\xf8\x60\x21\xc4\x18\xc1\ \x87\x60\xde\x7b\x0d\x5e\xcd\x87\x40\x1a\x22\x01\x50\xf3\xcd\xdc\ \x67\xb5\x2c\x6b\xa5\xce\x39\x44\xd0\xb4\x94\x9a\xe6\x82\xaa\x33\ \xe7\x9c\xa9\x39\x24\x38\xd2\xd4\x21\xc1\x69\x9a\x26\xaa\x38\x5c\ \x70\x26\x4e\xd4\x39\xb1\xa0\xce\x5c\xe2\x4a\x49\xe2\x40\xc5\x92\ \xe8\x28\x02\x88\x68\xb4\x08\x40\x28\xe8\xa0\x89\x2b\xcb\x86\x65\ \x17\xca\x8e\x03\x77\xb6\x6f\xde\x56\xae\x5f\xe9\xb6\x5c\x73\x01\ \xdb\x6e\x7f\x88\xd5\x9b\xf8\xe0\xae\xef\xb0\x1d\x78\xf4\x05\x48\ \x82\xbf\x01\x7c\xfb\xf9\x87\xa9\x2b\x3b\xef\x33\xd3\xd8\xeb\xe7\ \x33\x7b\x66\xdd\xaa\xbe\x4d\x88\x63\xd5\xcf\xc6\xfd\xbc\x0b\x60\ \x6d\xa8\xc6\xb5\x75\x54\x4d\x23\x07\xd4\x88\x87\x83\xaa\xaa\x0f\ \x41\x35\x68\xee\xbd\x8f\x2f\x43\x08\xde\xab\x4f\x83\xe6\x39\x40\ \xab\xd5\x4c\x7c\xc8\xeb\x41\x7d\x1a\x14\x8b\xc2\x0c\x94\xca\x09\ \xaa\x42\x92\x26\x04\x13\x73\x22\x18\x09\xce\x39\x55\x15\x5c\x88\ \xbd\xdc\x25\x4e\x13\xe7\x70\x89\x53\x67\xce\x54\x23\x29\xd4\x89\ \x3a\x75\x26\x22\x2e\x8a\x5c\x3c\xe0\x62\x7d\xa7\x13\xe7\xc4\xad\ \x1d\x3a\x5b\x0e\x4c\xef\x74\x33\x8d\x43\x80\x21\x88\xad\x5c\xbf\ \x92\xc1\xe5\x83\x32\x3d\x31\xb3\xf4\xfc\x6b\x79\xd7\xf6\x6f\xf1\ \xa7\x44\x12\x4c\xbf\x10\x52\xc0\xd7\x6d\x95\x77\x02\x6b\x86\x96\ \x0f\x86\xcd\x67\x5f\xc0\xba\x25\xe7\x48\xee\x5b\xa8\x9a\x60\x88\ \xb6\x3d\x36\x3a\x2a\xff\x88\x50\xaf\x1d\xf3\x77\x1f\x6f\xab\xfb\ \xf8\xba\x1d\x0d\x68\xb1\x8f\xe2\xd6\x18\x0a\x98\x59\x4c\x95\x7b\ \x1f\x82\x06\xcd\x35\xa8\x0f\x21\xa8\xf7\x21\x04\xaf\x3e\x84\xe0\ \x43\x50\x9f\xfa\x90\xe7\x80\x05\xf3\x49\xab\xd9\x6c\x7a\x1f\x4a\ \xce\x09\x6a\x45\x17\x6d\x7a\x92\x34\xb1\xa0\xde\x5c\xe2\xcc\x39\ \x27\x6a\x41\x93\xc4\x29\x22\x96\xa4\xce\x12\xe7\xcc\xa9\x33\x4d\ \x9c\x49\x90\x92\x73\x4e\x5d\xe2\xd4\x39\x29\x89\x88\x39\x27\x2a\ \xce\x25\xce\x39\x15\xc1\x89\x48\x52\xd0\xc1\x39\x91\x80\xe0\xd6\ \x0c\x9e\x6d\xd3\xf5\xf1\x22\x5b\x68\x01\x13\xb7\xf9\xe2\x4d\xdc\ \xf3\xf5\x7b\x65\xc9\x1a\x7e\x04\xf8\x27\x62\x4e\x7b\x27\x8b\xb4\ \xa8\xe2\xb3\xc4\xff\x03\x64\x67\x5d\xba\xd9\xd6\x0e\x9d\x2b\x59\ \x9e\x25\xc1\x07\x17\x82\x1a\x10\x44\x10\x59\xd8\xc9\xdb\x07\xda\ \x16\xbe\x1d\x15\xcc\x1f\xef\x7c\xd2\x36\xf9\x6d\x6d\x10\xa3\x40\ \x14\xcc\x82\x8f\x66\xde\x54\x55\x83\xe5\x21\x66\x03\x7c\xf0\x21\ \x0b\xaa\x3e\xe4\x21\x0b\x41\x7d\xf0\x21\x4f\xbd\xc6\xc2\xed\x66\ \xab\x91\xe7\x3e\x6b\xe4\x79\x48\x45\xd0\x24\x49\x4c\x9c\x20\x82\ \x06\x73\x31\x0a\x88\xf5\x5c\xea\xd4\x85\xd4\x12\x01\x34\xd1\xa2\ \xd7\x07\x51\xe7\x9c\x77\x89\x54\x9d\x73\x96\xa8\x33\x44\x34\x49\ \x9c\xba\xc4\xa5\x4e\xc5\x44\xc4\xc4\x49\xe2\x9c\x98\xa8\xa4\x22\ \x62\x44\x42\x68\xe2\x4a\x62\x86\x08\x38\x33\x40\x4c\x07\x97\x0d\ \xca\xd0\xb2\x41\x99\x9e\x9c\x19\x3a\xfd\x12\x6e\xd8\x7d\x1f\x73\ \xc0\x94\x88\xb4\x6c\x11\x96\x55\x7d\xa6\xb8\x6e\xab\xfc\x04\x30\ \x3c\xb4\x7c\x30\x1f\x5a\x3e\x64\x89\x4b\x93\x66\xab\xe1\x42\x08\ \xda\x1d\xcc\x31\x2f\xf2\x36\xda\x62\x97\x05\x8e\xa0\x98\x99\x89\ \x48\xe1\xed\x77\x27\x82\xa2\x36\x34\x33\xd5\x60\xa1\x30\x07\x21\ \x04\xf5\x66\xa6\x3e\x0f\xde\xcc\xda\xbd\x3e\x0f\x5e\x73\xef\x43\ \xae\xaa\xb9\xcf\x43\x96\x06\xf5\x3e\x7e\x59\x68\xa9\x85\x54\xd5\ \x27\x88\xa0\x16\xa2\x03\x27\xa2\x52\x98\x03\xe7\xc4\x92\xa8\xe2\ \x51\x0d\xe6\x9c\x78\x35\x31\xa7\xce\x8b\x13\x4d\x9c\x0b\xce\x1c\ \x89\x73\x16\x54\xd4\x39\xa7\x21\x88\xba\x44\xd4\x89\x24\x2e\x71\ \xa9\xb8\xf8\x1a\x11\x75\xae\x93\x31\x4c\x2a\x6e\xc0\x99\x9a\xe0\ \x24\xfe\x00\x91\xf7\x6e\xe5\xfa\x95\x36\x3d\x31\xe3\x96\xae\xe1\ \xa2\xdd\xf7\x71\x27\x71\x08\xf4\x30\x27\xf8\xf1\x6a\xcf\x12\x37\ \x02\xfe\xb4\x73\x36\x98\x99\x49\x59\xfa\x5d\x96\xb5\x50\x55\x45\ \x44\xe9\x8e\x6a\x8f\xa5\xff\x0b\x8f\xa0\xe8\xee\xd2\x11\xfc\xfc\ \x39\x6d\x3b\xa0\x1a\x34\xba\x14\x51\x07\x04\xd5\x82\x04\x41\x7d\ \x08\xea\x55\x2d\xf8\xdc\x67\xa6\xe6\x43\xd0\x2c\x84\x90\xe7\x59\ \x68\xa9\x6a\xcb\xe7\xa1\x95\xe6\x21\x0b\x80\xd5\x9b\x0d\x87\xb3\ \x3c\x58\xc8\x4c\x8d\x10\x34\x94\x4a\xa9\xb8\xc4\x89\x79\xd5\x42\ \xfd\x6b\x6a\x89\xe1\x09\xe2\xa2\x60\x93\xc4\xa9\x88\x53\xe7\x24\ \xb8\x44\x42\x12\x12\x75\x4e\xbc\x38\xa9\xb8\xc4\x45\x73\x10\x24\ \x88\x48\xc9\x25\xce\x5c\x24\x94\xba\x44\x12\x27\x92\x02\xe6\x12\ \x67\x8d\x6c\xda\x99\xe1\x50\x73\x22\x88\x89\x08\x8a\x54\x7a\x2a\ \x30\xbf\x5e\x48\x3f\xb1\x2e\x61\xaf\x88\x1c\x31\x94\x7a\x92\xc1\ \x13\x87\x5f\x55\x03\xe9\xe4\xec\x01\x57\xa2\xdf\x1b\x9d\x58\x7f\ \x61\xd7\x3f\x3a\xf2\x8b\xe1\x72\xfb\xc3\x76\xc8\xd7\x59\x4b\xa5\ \xb0\x01\x6d\x3f\x42\x83\xd7\xa0\x66\x21\x76\xff\xb8\xd0\x72\xf0\ \x21\xd7\x60\xc1\xfb\x90\x85\xa0\x79\xf0\x9a\x05\x1f\x5a\x21\x68\ \x33\x84\xd0\x0a\x5e\x5b\x69\xd0\x4c\x01\x73\x89\xfa\x3c\x6f\xe5\ \x59\x96\x89\x4b\x9c\x95\xca\x89\xe5\x59\x4b\x24\x88\x02\x9a\x4a\ \x62\x66\xa2\x86\x53\x20\xc4\x64\x90\xa8\xaa\x98\x38\xb1\x34\x75\ \x1a\x4c\x08\xa1\xa3\xf6\x83\xa8\x54\x44\xc4\x27\x89\xab\x38\x27\ \x2a\x2a\x41\x44\x52\xe7\x24\x71\xea\x52\xe7\x44\x01\x27\x2a\xae\ \x9e\xcd\xa6\xa6\xa6\x08\x69\x74\x11\xcd\x21\xf8\x15\xeb\x56\x8a\ \x19\xae\x6f\x29\xe7\x11\x6b\x0d\x96\x12\x8b\x55\x26\x38\x79\x7d\ \x81\xeb\x81\xc6\xca\xf5\x2b\x9d\xcf\xcd\xe6\xea\xd3\xa5\xfe\x72\ \x29\xd0\x35\x8e\xb3\x40\xc7\xb7\x05\x4c\x91\x2f\x81\x28\xf7\xee\ \xe4\x90\xcc\x0f\x02\x75\xbc\x7f\x6d\x3b\x83\x1a\x34\xa8\x9a\xc7\ \xac\x08\xff\x2c\x44\x3b\xaf\x99\x06\xcd\x54\x35\xcf\xb3\xd0\x54\ \xd5\xcc\xe7\xa1\x69\x66\x99\xcf\x43\x23\xf5\x21\x33\x40\x6a\x73\ \xb5\x50\x9b\xab\x67\xcd\x46\x46\x6f\x7f\x55\x6b\x73\x4d\x4d\xd2\ \x04\x87\x2b\xd2\x4f\x8a\x88\x98\x8b\xab\xb9\x69\x12\x3d\x7b\x2f\ \x82\x4f\x12\x17\x42\x70\xed\x9e\x9f\xb9\xe0\x82\x38\xf1\x4e\x24\ \xb8\x44\x4a\xce\xb9\x20\x4e\xca\xce\x49\x29\x6a\x05\x29\x49\x10\ \x13\xa2\x26\x10\x91\x64\x6c\x7a\xb7\x6a\xb0\xd4\x25\x82\x05\x13\ \x11\x12\x13\x11\xe7\xcc\x31\xff\x60\x05\x88\xc5\x29\x4b\x88\x05\ \x29\x27\x2b\x01\x5a\xc4\xde\xef\x42\xae\xd5\x03\x53\xbb\xb3\xf5\ \x43\x7d\x47\xe6\xf8\x8f\xf4\x00\x0c\x10\x27\xe2\x98\xb7\x08\x40\ \x27\x0d\xdc\x6d\x21\x0a\x85\xdf\xfe\x87\x6a\x50\xd5\x98\xf1\xf5\ \x98\xa9\xf7\x9a\x43\xdb\xee\x6b\xee\xf3\xd0\x52\xb5\x2c\x04\xcd\ \xd5\x6b\x33\x6a\x00\x6d\x6a\xd0\x66\x9a\x87\x96\x02\x56\xea\x71\ \x78\xcd\x5d\x5a\x91\x90\xc5\xd4\x80\x53\x1f\xa4\x5c\x29\x11\x34\ \x98\x7a\x31\x33\x0b\xd1\x93\x17\x1f\x4c\x54\x44\x54\x44\x42\xa2\ \xa2\x78\xf1\x49\xe2\x7a\x00\xef\x12\x09\xce\xb9\x5c\x9c\x64\xce\ \x49\x8f\x73\x92\x3b\x27\x5e\xa2\x26\x08\xce\x39\xef\x9c\xa4\x05\ \x11\x92\xb9\xd6\x78\xa9\xd6\x98\x4d\x9c\xc3\x82\x11\xc4\x91\x8a\ \x88\x89\x98\x1b\xdb\x77\x08\x33\x5c\xed\x30\xdb\x88\x44\x48\x28\ \xa6\x86\x1f\x4f\x09\x7e\x9f\xf8\x12\x70\xdd\xd8\xc8\x98\x1b\x5c\ \xba\x34\x69\xb6\x66\x92\x71\xdb\x63\x83\x3d\xc3\x47\x9a\x7a\x39\ \x62\x9d\xdc\x4e\x8f\x97\x98\x37\x03\x8b\x5e\x77\xe7\x81\x6a\x5d\ \x29\x71\x8d\xcf\xaa\x31\x55\x53\x88\x0e\xa0\x9a\xa9\xc5\x24\x5f\ \x1e\x82\x66\xd1\x27\x50\x9f\x67\xa1\x19\xb5\x80\xb5\x7c\x1e\x4d\ \x80\xa9\xb5\x82\x0f\xf5\xd4\x6b\x9c\x37\x37\x3b\x3b\xa7\x6a\x3e\ \xa4\xe5\x34\x6f\xd6\x33\x6b\x35\x72\xeb\xe9\x2b\x9b\x36\x3d\x80\ \x89\x13\x73\xce\x45\xad\x13\x4c\x9d\x09\x51\x85\x8b\x0f\x2a\x01\ \xc1\xbb\xe0\x72\x97\x88\x97\x40\xee\x12\xe7\x45\xa4\x2a\x51\xf8\ \x3d\x2e\x91\xf8\xb9\x93\x8a\x4b\xa4\x0c\x92\xb8\x44\x82\xa1\xa5\ \x89\xb9\x51\x55\x2c\x05\x52\x11\x92\xf8\x13\x98\xc3\x89\x6b\xcc\ \xb5\x14\x23\x8d\x21\x0e\x4a\x34\x03\x27\x3b\x01\x9a\xc0\x9c\x99\ \x95\x83\xb7\x92\xcf\x55\x26\x66\xf6\x93\xd0\x4b\xe2\x52\x93\xf9\ \x60\xaf\xdb\xce\x43\x7b\xfa\xa4\x8b\xf6\x5f\x8a\x45\xaa\xba\x9c\ \xc3\xee\x3a\x00\x03\xd4\x2c\xaa\x7f\x83\xa0\xd1\x0f\xc8\x35\x68\ \x6e\x46\x08\x3e\xb4\x7c\x16\xb2\xe2\x58\x16\xbc\x36\xbd\xd7\xa6\ \x06\x6d\xe5\x59\xa8\xab\x6a\xab\x6d\x02\xa8\xcd\xd6\x2c\xad\x38\ \x6d\x35\x9a\x5e\x1c\x26\xce\xac\xd5\x6a\x59\x6f\x7f\x05\x9f\x87\ \x10\x32\xd5\x24\x75\x06\x84\x98\xec\x11\x25\x66\xf4\x02\x90\xbb\ \x44\x02\x44\x93\xe0\x9c\xf4\xb8\xd4\xe5\x4e\x24\x73\x4e\xaa\x88\ \x78\x71\x94\xd3\x34\xa9\x88\xe0\x5d\xe2\x72\xe7\xa4\x6c\x79\xd0\ \x89\xfa\x88\x37\x09\x25\x11\x4a\x24\x12\x44\x48\xc4\x08\xce\xc5\ \x3a\xc3\xb1\xbd\xe3\x66\x06\x87\x47\x3b\x1a\x60\x61\x6d\xdc\xc9\ \x88\x6f\x00\x97\xec\x79\x64\x6f\x7e\xce\x65\x4b\xd2\xe0\xcd\x02\ \x19\xa3\x93\x8f\xb2\xa2\x7f\x83\x39\x99\xaf\xc5\x3d\x42\xf0\x42\ \x1c\x2d\x89\x07\x45\xa2\x23\x58\x04\xfa\x44\x8d\xd1\x49\x00\x75\ \x8a\x40\x82\xcd\xf7\x7c\x6f\x10\x34\x58\x1e\x7c\xc8\x55\x2d\x0f\ \x5e\x5b\x1a\xb4\xe5\x73\x6d\x9a\x59\x16\x82\xb6\x34\x68\xa3\xd5\ \xf2\x8d\xe0\xa3\x09\x00\xb0\xa9\xc9\x59\x03\xac\xd5\xcc\xad\x7f\ \xa8\xaa\xd6\xf4\xb9\x88\x93\x7a\xbd\x91\x25\x89\x53\x49\x45\x72\ \x9f\x8b\x99\xa9\x78\x31\x97\x44\xf5\xef\x9c\x78\x55\xcb\xa3\xda\ \x17\x0f\x78\xe7\x5c\x46\x4e\xd5\x39\xc9\x5d\x2a\xb9\x73\xae\x25\ \x42\x35\x04\x97\x89\x93\x4c\x44\x2a\x2a\x79\x65\x2e\x3b\x94\x1b\ \xa1\x1c\xb5\x04\x65\x33\x4a\xce\x51\x2a\xe6\x0f\xda\xec\xc4\x8c\ \xce\x4c\xcc\xa6\xc1\x33\xbd\xe7\x41\xb6\x11\x7b\x44\x7b\xfd\x9e\ \x13\xfe\x84\xad\x67\x8a\x5b\x3f\x6e\xb7\x5f\xb7\x55\xde\x30\x33\ \x39\xbb\x6a\xf6\xf0\x8c\x94\x4a\x3d\x41\x83\x09\x92\xd9\xc1\xc3\ \x4f\x30\xd8\xbb\x92\x84\x32\x31\xba\x03\x71\x71\xf1\x5b\x71\x1d\ \x32\x38\x27\xed\x09\xf5\x47\x40\xcc\x50\x9b\x1f\x1c\xd6\x10\x54\ \x4d\x2d\x60\xa8\x9a\xe5\xc1\x6b\xde\x0e\xf9\x34\x74\x04\xde\xd2\ \x60\x99\xcf\x43\x33\x04\x6b\x06\xaf\xed\xad\x91\xb6\x9f\x9d\xb7\ \xf7\xb1\x71\x3b\xeb\x92\xd5\x1a\x34\xa7\xd9\x68\xaa\x4b\x49\x9a\ \xf5\xa6\x77\x4e\x2c\x2d\xc5\xe1\x5d\x44\xd4\xd4\xbc\x73\xa2\xde\ \x9b\x8a\x8b\x8b\xb2\x3b\x27\x5e\x54\xbc\x88\xe4\x22\xb4\x9c\x93\ \x1e\x04\xef\x9c\xcb\x45\xc9\x44\xa4\x92\x24\x2e\x0f\x41\x2a\x92\ \x48\xde\xf4\xb3\x79\xae\x75\x2f\x4e\x72\x11\xc9\x5d\x62\x65\x4c\ \x54\x0a\x35\x2f\x10\x4c\x29\x3d\xf6\xe0\xee\x92\x19\x3a\xb1\x97\ \xdb\x89\xd5\xae\x46\x54\xaf\x8b\xb6\xaa\xd6\xb3\xc0\x17\x05\x7e\ \x6a\xf7\x43\x4f\x70\xe6\x96\x73\x54\x83\x39\x33\x33\x4f\xc6\xa1\ \x6c\xd4\x2a\xa5\x3e\x7a\x4a\x03\x1d\x21\xc7\x41\x32\x92\xf9\xf4\ \x60\x31\x7a\x1a\x13\x63\xd6\x3e\x1e\x45\x6f\x98\x45\xf5\x6f\xaa\ \xc1\x14\x8d\x86\xd9\xbc\xaa\x79\x0d\x51\xe5\xab\x5a\xe6\xb3\xe8\ \xf1\x07\x6f\x4d\x9f\x87\xa6\xaa\x35\x43\xd0\x96\x7a\x6d\xf8\x5c\ \x5b\x69\xae\x91\x00\x3f\xb2\xf5\x3c\xfb\xa7\xbf\xd9\xa6\xab\x4f\ \x1f\x34\x20\x99\x99\x6c\x6a\x5a\x72\xa1\x54\x49\xd5\x9c\x59\xb3\ \x96\xab\x19\x94\x2a\x89\x59\xc0\x30\x0b\xe2\x24\x38\x27\x21\x28\ \x41\x62\xef\xcf\x9c\x93\x5c\x9c\xe4\x66\x96\x39\x27\x15\xe7\xa4\ \x25\x89\xab\xb8\x40\xcb\x6b\x56\xf1\xda\xac\x4a\x62\x15\x97\x48\ \x4e\xb0\x4a\x92\xba\x8a\x42\x6e\x46\x70\x86\x07\xca\xa2\x56\x3a\ \x3c\x36\xa9\xd3\x93\xb3\xa6\x39\xb5\x5d\xdf\xe1\x4e\x62\xef\x57\ \xa2\xf0\xa7\x58\xe4\x75\xf6\x9f\x0e\xb7\x7e\xdc\xbe\xf1\xc3\x6f\ \x91\x97\xcc\x4e\xcd\xad\x9b\x3c\x30\x19\xfa\x87\x86\xe6\x7d\x16\ \x31\x0d\xf9\xac\x6b\x50\xb3\x52\xda\x23\xe5\x52\x05\x41\x5c\x21\ \x7a\x57\x18\x00\x27\x9d\x65\xb1\xe3\x55\xc5\xbe\xab\x10\x14\x33\ \xa2\xf7\x1f\x6b\x00\xcd\x9b\xb5\x09\xd0\xee\xfd\x96\x05\xaf\xad\ \xe0\xb5\xa9\xc1\x5a\xaa\x16\x85\x1f\x8f\x35\xd2\x3c\xb4\x78\xcf\ \x0d\x7f\x6f\x1f\xfe\xea\x4f\x4a\x30\x8f\x57\x4f\xff\x50\x59\xbd\ \xa6\x6e\x76\xb2\x19\x48\x54\x82\x0a\xb9\x0f\x38\x27\x34\x9b\x9e\ \xb4\xec\x82\x13\xd1\xac\x19\x34\x29\x39\xaf\x6a\x3e\x49\x5c\x2e\ \x8e\x8a\x20\x5e\x1c\x99\x88\x64\x08\x15\x71\xb4\x34\xf3\x55\x13\ \x9f\x99\x59\x25\x49\x25\x13\x93\xaa\xaa\x65\x2e\x91\x2a\x5e\x7b\ \x62\xd2\x88\x80\x91\x9b\xe1\x0f\x8f\x4d\x56\x76\xde\xbf\x33\x20\ \x84\x27\x1e\xe0\xf3\xc4\xde\x9e\x30\xbf\xfe\xee\x04\x27\x39\x01\ \x00\x82\xe7\x93\x2e\xe5\x6d\x8f\x6d\x7b\xdc\xaf\xdb\xb4\xb1\x77\ \x68\xd9\x10\xc4\xdc\x7e\xdc\xa3\x92\xe7\xb3\xd2\x68\xd6\x48\x5c\ \xea\x4a\x69\x99\x38\x3c\x82\x43\x70\x14\x4e\x62\x57\x3e\xa0\x13\ \x12\xc7\xfa\xaf\xf8\x78\x15\x0d\x16\x54\xcd\x9b\x5a\xa6\x6a\x41\ \xbd\xe5\x41\x35\xb3\x60\x2d\x0d\xd6\x0a\x05\x09\x34\x58\x53\xd5\ \x5a\x79\xe6\x9b\x59\x2b\xab\x7b\x1f\xb2\x23\xe6\x06\xbe\xf2\xad\ \xe7\x74\x4f\x15\x6b\xbf\x76\x3d\x03\x25\xe9\xe9\x2f\xa5\xc1\xab\ \xf3\xb9\xc6\xe2\xcf\x92\x4b\x35\x58\x0a\x94\x54\x2d\x2d\x57\x92\ \x8a\x99\x95\x44\xa4\x0c\x56\x46\xac\xaa\x1a\x2a\x92\xc4\x89\x24\ \x49\x22\x15\x71\xd2\x23\x8e\xaa\x73\x52\x11\x91\xaa\x4b\xa5\xa7\ \x88\x0a\x7a\xc4\x51\x15\x91\xca\xf4\xc4\x54\x75\xd7\x03\xbb\x2a\ \x22\x54\x0e\xec\xe2\x1b\x7b\xb7\xf3\x38\x51\xf8\xed\x47\xac\x3d\ \x0a\xec\x34\xb3\xb9\xe3\x22\xb5\xe7\x19\x97\xbf\x5a\xce\x03\x5e\ \x9d\x35\x18\x5a\xbf\x69\x43\x69\x68\xc5\xd0\x11\x23\x99\xe2\xba\ \x9c\x3e\x17\xcb\x27\x9d\xc4\xa2\xca\x82\x0c\xd1\x4c\x14\x7b\xeb\ \x88\x1f\x30\x62\xc5\x97\x5a\x08\x3e\x3e\x59\x4b\x15\xaf\x6d\xfb\ \xef\x35\x0b\xde\x62\x49\xb8\x6a\xe6\x7d\xe8\x64\x00\x7d\xae\x2d\ \x53\x5a\x47\x10\x40\x44\xe4\xfa\xb7\x9c\xd1\x59\xd0\x65\x60\x59\ \x39\x99\x9d\xcc\xac\x67\x20\x4d\x2a\x3d\xa9\x34\xe6\x72\x49\x4b\ \x2e\x29\x55\x92\x34\x6b\x86\xa2\x1a\xb8\xb3\xd2\x66\x49\x9c\xa4\ \x22\x94\xc1\x4a\x20\x65\x11\xca\xe2\xa4\x02\x94\x93\x54\x2a\x22\ \x54\x9d\x93\x1e\x71\x52\x49\x52\xa9\x02\x3d\x49\xea\xaa\x22\xf4\ \xb8\x44\xaa\xfb\x76\xed\xab\x1c\xdc\x3b\xd6\x2b\x42\x75\xec\x31\ \xfe\x75\xdf\xf7\xd8\xc3\xfc\xcc\x23\x25\x3e\x5e\xed\x11\x60\xfc\ \x24\x4e\x03\x1f\x01\x11\x71\xe7\xfe\x1b\xce\x2d\x55\x78\x45\x9e\ \xd1\xb7\x7c\xf5\x72\x56\x9d\xb6\xca\x64\x7e\x9d\x84\xa2\x6a\xb6\ \x43\x04\x27\x8e\xa4\xf3\x5a\x0a\xd3\x60\xb8\xce\x15\xdd\x23\x80\ \x8a\x8f\x6e\xa0\xe5\x85\xfd\xf7\xaa\xd6\x6a\x9b\x01\x9f\x6b\x2b\ \x0e\x07\x5b\xcb\x8c\x96\x69\x3c\xe6\x33\x6d\x99\xe1\x8f\x9a\x1d\ \xdc\x9d\xa2\xbc\xfe\x67\xce\x10\x0a\x4d\xd0\xbf\xac\x2c\x21\x57\ \x97\x94\x5c\xa2\xc1\x5c\xd6\x0c\x92\xa4\x92\x38\x27\x25\x97\x8a\ \x68\xb0\x34\x49\x5d\x7b\x1e\x61\x09\x28\x25\xa9\x94\xcc\xa8\x88\ \x50\x76\x89\x2b\x8b\x50\x71\x89\x54\x9c\x93\xaa\x48\x14\x3e\x42\ \x35\x78\x5f\x7d\xe2\x7b\xbb\x7b\xeb\xb3\xf5\xaa\x08\x3d\x63\xbb\ \xb9\x67\xf4\x11\xf6\x31\x3f\xe5\x0c\xe2\xe0\xcf\x6e\x60\x9f\x2d\ \xc2\xaa\xda\xdf\x0f\x44\xa4\x74\xfa\xc5\x9c\xdd\x33\xc4\x4b\x42\ \x4e\xa5\xa7\xaf\x2a\xeb\xce\x5a\x4f\xb9\x12\xdd\x02\x71\x85\xa0\ \x21\x3a\x82\x4e\xa2\x19\x80\xa4\x18\x3e\x8f\xbd\x7f\xbe\x6e\xb0\ \x78\xba\x9e\x05\x55\x82\x59\xbb\xe6\xd3\x7c\xf0\x9a\x99\xb6\x7d\ \x00\xcb\xd4\x5b\x5e\xd8\xfe\x2c\x7e\x46\xee\x73\xcd\xcc\x2c\x0b\ \xb9\xe5\x4f\x3a\x3d\x5c\x44\xe4\xfa\x9f\x39\x43\x56\x9e\xd6\x2b\ \x00\xe3\x7b\xea\x1d\x3b\x54\xe9\x4d\x92\x52\x35\x91\x56\xdd\x8b\ \x29\x69\x92\x4a\xe2\x12\x49\xda\x44\x10\xa4\x84\x50\x72\x89\xa4\ \x40\x49\x44\xca\xe2\x28\x27\x89\x94\xc5\x49\x45\x84\x4a\xd1\xf3\ \xab\x13\x07\x26\xaa\xfb\x1f\xdf\xdf\x83\xa3\xd7\x14\xf7\xf8\x77\ \xb9\xab\x3e\x8d\x67\x5e\xf8\x42\x74\xfc\xf6\x53\x3c\x5e\xf5\x85\ \x50\x10\xd2\x8d\x42\x80\xe5\xc1\x95\xac\x58\x75\x26\x97\x99\xd1\ \x0b\xc8\xf0\xfa\x95\xb2\x7c\xcd\xb2\x22\x0c\x14\x69\x13\x41\x1c\ \x4e\x20\x89\xf3\x2b\x3a\xbe\x40\xb7\x1f\x00\x60\x45\xd1\xaf\x16\ \xbd\x3e\x98\xe2\x63\x18\x48\xae\x51\x23\x64\x21\xd7\x2c\x78\xcb\ \x34\x58\x86\x90\xfb\x96\xe6\x79\x2b\x64\x40\xae\xc1\x8e\xd6\x00\ \x0b\x1b\x5e\x68\x01\x00\xc6\xf6\xd4\xe4\xcc\x4b\x96\xba\xb9\xc9\ \x4c\x7a\x06\x52\xd1\x60\x4e\xd5\x5c\xde\x54\x49\xcb\x2e\x49\x52\ \x49\xcc\x70\x2e\x89\xa6\x41\x90\x92\x99\xa5\x2e\x91\x14\xa1\x94\ \x24\xae\x84\x50\xd5\x10\xca\x93\x07\x27\x2b\x93\x07\x26\x0a\xdb\ \x4f\x4f\x7d\x9a\xc9\xc7\xef\x65\x0f\xf3\x82\x6f\x4f\x36\x6d\x02\ \xe3\xc5\xf6\x82\x13\x7e\x1b\x6d\x12\x00\xfd\xeb\xce\xe5\xf4\x6a\ \x3f\x2b\x8b\x02\x5f\xb7\x6c\xf5\x52\x96\xad\x5a\xea\xd2\x52\xea\ \x92\x92\x38\x90\x44\x1c\x0e\xc3\xc5\xac\xa0\x39\x33\xda\xfe\x00\ \x20\x52\xcc\x07\x32\x2d\xc2\x40\x33\xf3\xea\x63\x04\x10\x82\xe5\ \xea\x2d\x0f\x41\xbd\x29\xb9\xaa\xb5\x7c\x4b\x73\x97\x88\xcf\xb3\ \xe0\xb3\x46\xc8\x9c\x13\x1f\x9e\x8e\x00\xbf\xf7\xc5\x97\x0b\xc0\ \x37\x6f\xde\xdd\x9d\x90\x58\xe8\x28\xba\xee\xd7\x69\xd9\x25\x66\ \xe6\x92\xd4\x25\x6d\x22\x98\x92\x8a\x50\xaa\xcd\xcc\xa5\xb3\x53\ \x73\xe5\xb9\xe9\xd9\x92\x08\x15\x11\xaa\xf5\x69\x6a\xe3\x4f\x30\ \xd3\x98\xe9\xa4\x79\x53\x8a\xc9\xa4\xc4\x64\xcf\xe1\x62\x6b\xbe\ \x50\x85\xdf\x46\x41\x82\x12\xd0\x53\xe9\x65\x60\xc9\x1a\x96\xf6\ \x0e\x31\x24\xd1\x01\x74\x03\x4b\x07\xdc\xc0\xd2\xfe\x64\x70\xf9\ \x80\x73\x4e\x1c\xf3\x79\x01\xc7\xfc\xf4\x7b\x57\x84\x7f\x86\x61\ \xc1\x9b\xaa\x9a\x62\x04\x9f\xab\x37\xb5\x3c\xee\xe3\x02\xd7\x79\ \x2b\xb4\xb5\x81\x17\x91\xd0\xaa\xfb\x2c\x49\xc5\x37\x6b\x21\x66\ \x72\x9f\x8a\x00\x6d\xfc\xde\x17\x5f\x2e\x0b\x48\x40\xd1\x28\x66\ \x27\x5b\x32\xb0\xac\xd2\xf1\x15\x4a\x55\x97\xb4\x35\x42\x9e\x79\ \x97\xb7\x5a\xc9\xdc\xcc\x5c\x52\x9b\x9e\x4b\xcc\xe2\x5a\x03\xe2\ \x48\x1b\x33\xe4\x93\xfb\x68\x35\x66\x30\xe6\xa7\x99\xb7\x37\x88\ \xc2\x6f\x2f\xcd\x9e\xbf\xd0\x85\xdf\x46\x41\x82\x84\x62\x8a\x7d\ \xa5\x8f\xea\xd0\x2a\x06\xfa\x86\xe8\x2d\x04\x9e\x88\x43\x06\x96\ \x0e\x24\x83\xcb\xfa\x93\x6a\x6f\xd5\x95\x7b\x4a\x0e\x23\xd6\x4b\ \x14\x30\x35\x82\x8f\xa1\xa0\xe9\xfc\xdc\x8f\x76\xaf\xcf\x5b\x21\ \x88\x48\xde\xee\xf1\xe5\x6a\x62\x79\x2b\xe4\x8d\x5a\x1e\x9a\x73\ \x99\xcf\xb3\xcc\x7c\x9e\xe9\x33\x5e\x22\xe6\x9a\x37\xac\x75\xd5\ \x9e\x2a\xdf\xb8\xf9\x71\x6b\x9b\x85\xb1\x3d\x35\xc9\xb3\x9c\x25\ \xc3\x25\xa9\x4d\xe5\xd2\xb7\xa4\x24\x73\xd3\x35\x07\x50\x9b\xa9\ \xb5\xb5\x83\x73\x31\x52\x70\x79\x0b\xc9\x9b\xd8\xf4\x18\xa1\x19\ \x83\xb8\xf6\x39\x6d\xc1\xb7\x47\xc6\xda\x0f\x64\x68\x11\xd7\x01\ \x38\xd9\x73\xff\xcf\x1a\x85\xd3\x97\x12\xcd\x42\x5a\xee\xa1\x34\ \xb0\x82\x6a\xcf\x00\x3d\xa5\x2a\x95\xe8\x03\x20\x22\x24\x08\xc9\ \xc0\xd2\x01\x11\x41\x06\x96\xf4\x3b\x55\xc3\x14\x4b\x4a\x89\x95\ \x4a\x15\xd3\x10\xf3\x01\xc1\xab\xcf\x33\xcd\x5b\x8d\x96\xe6\x4d\ \x1f\xf2\x4c\x33\x81\xd0\xa8\x37\x43\xf0\x84\xac\xd1\x34\x0d\x71\ \xfd\x76\x0d\x71\x02\xd1\x93\x12\xe0\xba\xad\x22\xb7\x7e\xdc\xac\ \xbd\x2f\x1a\x7d\xd4\x8c\x85\x8d\x17\x23\xf5\xa9\x62\xa1\xc7\x25\ \x48\x56\x47\xca\xbd\x88\x6f\x75\x96\x7a\x91\xd6\x1c\x34\x6b\x50\ \x08\xbd\x9d\xfe\x74\x5d\x5b\xfb\x7b\xdb\x8b\x1b\xe4\xbc\xc0\x16\ \x80\x78\x2e\x68\x87\x7a\xcc\x87\xba\x09\x90\x94\x7b\x48\x87\x86\ \xa9\x94\xaa\x94\x2b\xbd\x54\x5c\x42\xa9\xa8\x09\x90\xa2\x44\x54\ \xb4\xa8\x2e\x34\x45\x2d\x14\x4f\x56\x34\x82\x2a\x21\xe4\xe4\x71\ \x6c\x00\xaf\x9e\x90\xa4\x90\xb7\xc8\xc5\x61\x18\xa1\xd5\x20\xf8\ \x16\xda\x9c\x7b\x0a\x02\x3c\x4d\xa3\x8f\xc2\xc6\x8b\xa3\x10\xdb\ \x64\x18\x7f\x62\xfe\x92\xae\xfd\xc2\xad\x7d\xfc\x88\x55\x2e\x7e\ \x10\x7b\xfc\x53\xa1\x8b\x08\xdd\xda\xb0\xbb\x73\xc8\x92\x55\x54\ \x4a\x55\x92\x72\x2f\x15\x53\x0c\x8b\x89\x23\x97\x92\x98\x11\x30\ \xd4\xb4\x20\x40\x86\xcf\x1a\x04\x49\x22\x39\x5a\x0d\x82\x4b\xd0\ \xda\xe1\xce\x78\x4a\x67\x7b\x4e\xab\x84\x3d\x19\x09\x16\x9e\x76\ \x8c\xd7\xc7\xcc\x6b\xd3\x95\xdf\x7e\xd6\x8d\xf9\x01\x42\x3b\xde\ \xe7\x48\xed\xd8\x4d\x84\x63\x8d\x0d\xc0\x91\xb3\x8b\xba\x37\x3d\ \xc6\xb1\xee\xe1\xf4\xe7\x46\x80\xa7\xb9\x81\xa3\x0e\x3f\xc9\xe9\ \x9d\x3f\xfc\x62\x17\xfc\x42\x74\xfd\x8e\xdd\x64\xe8\x26\xc0\x42\ \x2d\xda\xfd\xfb\x3d\x99\xc0\x8f\x10\x7c\xfb\xf5\x71\x59\x27\xf0\ \xe9\x34\xc4\x29\x81\x3f\x73\x2c\x20\xc3\x93\x99\xd1\x85\x38\x96\ \x46\x58\x78\x3c\x7e\xe9\x29\x59\xbc\xf0\xb0\x80\x14\x4f\x87\xa3\ \x04\xdc\xdd\x01\x4f\x11\xe0\x45\x8e\xe3\xba\x52\xe8\x29\x9c\xfc\ \x38\x45\x80\x17\x39\x4e\x11\xe0\x45\x8e\x53\x04\x78\x91\xe3\x14\ \x01\x5e\xe4\x38\x45\x80\x17\x39\x4e\x11\xe0\x45\x8e\x53\x04\x78\ \x91\xe3\x14\x01\x5e\xe4\x38\x45\x80\x17\x39\x4e\x11\xe0\x45\x8e\ \xff\x1f\xb9\x16\x9b\x37\x03\x92\x29\x11\x00\x00\x00\x00\x49\x45\ \x4e\x44\xae\x42\x60\x82\ \x00\x00\x1b\x4b\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x80\x00\x00\x00\x80\x08\x06\x00\x00\x00\xc3\x3e\x61\xcb\ \x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x89\x00\x00\x0b\x89\ \x01\x37\xc9\xcb\xad\x00\x00\x1a\xfd\x49\x44\x41\x54\x78\x9c\xed\ \x9d\x7b\x94\x24\x57\x5d\xc7\x3f\xf7\xde\xea\xee\x99\x9e\x9d\xd9\ \x99\x7d\xb3\xd9\xe7\xe4\x61\xc8\x63\x09\x02\x47\xe4\x25\x68\x8c\ \x72\xe4\x18\x0f\x12\x4c\x50\xf1\x44\x85\x03\xa8\x41\x3c\x01\x23\ \x12\x94\xf8\x38\x49\x20\x04\x45\x41\x4f\x34\x40\xf0\x48\x42\x7c\ \x90\x28\x41\x36\x1b\x31\x48\x20\x07\xc5\xc4\x24\x0b\x86\x28\xc4\ \x00\x71\x57\x36\x31\xcb\x30\xaf\xee\xba\xf7\xfa\xc7\xbd\xb7\xea\ \x56\x75\xf7\xcc\xec\x4c\xf7\x66\x7b\xbb\x7f\x7b\x7a\xab\xab\xba\ \xa7\xaa\xba\xbe\xdf\xdf\xf7\xf7\xb8\xb7\xba\x61\x68\x43\x1b\xda\ \xe0\x9a\xe8\xe2\x7e\x04\x90\xf8\x47\xc5\x2f\x55\x97\xf6\xff\x74\ \x99\xf1\x8f\x14\xd0\xa5\x87\xf5\x8f\xbe\xb6\xa4\x4b\xfb\x11\x38\ \xb0\xab\x17\x5d\x74\xd1\xb6\x8b\x2e\xba\xe8\xb9\x47\x8f\x1e\xad\ \x35\x9b\x4d\xa5\xb5\x96\xd6\xda\x6e\x11\xed\xb8\x98\x10\xc2\x4a\ \x29\xad\x52\xca\x5c\x77\xdd\x75\x07\x1f\x79\xe4\x91\x27\x80\x45\ \xa0\xe1\x97\x4d\xff\x38\x69\x88\xb0\x16\x13\x80\x04\x46\x81\x2d\ \x1f\xfe\xf0\x87\x5f\x6b\xfb\xc4\x8c\x31\x85\x87\xd6\x3a\x7b\xa4\ \x69\x6a\xd3\x34\xb5\x8b\x8b\x8b\xf6\xf0\xe1\xc3\x87\xee\xbb\xef\ \xbe\x3b\xae\xb9\xe6\x9a\x5f\x04\x4e\x07\xb6\x03\x93\xfe\x33\x27\ \xfe\xf3\xf7\x15\xc9\x83\xc9\x2e\xee\xa7\x02\x8c\x3d\xfe\xf8\xe3\ \x13\x5d\xda\x67\xd7\xcd\x5a\x8b\xd6\x9a\x34\x4d\x69\x36\x9b\x34\ \x1a\x0d\x16\x17\x17\x99\x9f\x9f\x67\x6e\x6e\x8e\xd9\xd9\x59\xbe\ \xfb\xdd\xef\x32\x33\x33\xc3\xcc\xcc\x0c\x47\x8f\x1e\x65\x66\x66\ \x06\x29\xe5\xd6\x53\x4e\x39\xe5\xe5\x97\x5e\x7a\xe9\x0d\x8f\x3d\ \xf6\xd8\x3f\x7f\xf0\x83\x1f\x7c\x0d\xb0\x05\x58\x0f\xd4\x71\x24\ \x08\x61\xb0\xaf\xac\x5b\x04\x08\x21\x60\xe4\xe8\xd1\xa3\xeb\xba\ \xb4\xcf\xe3\x6a\xd6\x16\x55\xdc\x18\x93\x6d\xb7\xd6\x62\x8c\x21\ \x4d\x53\xa4\x94\x5b\x5f\xf9\xca\x57\xbe\xfb\xa1\x87\x1e\xba\xf5\ \xc2\x0b\x2f\xfc\x5e\x60\x0a\x58\x07\xd4\x70\xd7\xa0\xaf\xd4\xa0\ \x9b\x04\x90\x40\x65\x76\x76\xb6\xd6\xa5\x7d\x3e\x6d\x16\xc8\x10\ \x2f\x03\x09\xac\xb5\xcc\xcf\xcf\xb3\x69\xd3\xa6\x7d\xef\x7f\xff\ \xfb\x3f\x7e\xc3\x0d\x37\xbc\x1e\xd8\x04\x8c\x93\x93\xa0\x6f\xd4\ \xa0\x5b\x04\x00\x4f\x02\xad\x75\xbf\x67\xfe\x05\x0b\xe0\xc7\x24\ \x00\x98\x9f\x9f\x67\x64\x64\x64\xec\xc2\x0b\x2f\x7c\xfb\x3d\xf7\ \xdc\xf3\x7e\xf2\x90\x30\x42\x1f\x85\x84\x6e\x12\x00\xfa\xe4\x43\ \xaf\xc5\x02\x11\xd2\x34\x65\x76\x76\x16\xa5\x14\xa7\x9f\x7e\xfa\ \x05\xf7\xdf\x7f\xff\x5f\x4e\x4f\x4f\x4f\xd3\x67\x24\xe8\x36\x01\ \x4e\x5a\x0b\xf2\x0f\x79\x68\x68\x34\x1a\xa4\x69\x8a\x52\x8a\xed\ \xdb\xb7\x9f\x7b\xfb\xed\xb7\xdf\xb4\x6d\xdb\xb6\xbe\x22\xc1\x90\ \x00\xcb\x58\xf0\xf8\x78\x3d\x90\xc1\x5a\xcb\xc2\xc2\x02\x4a\x29\ \x94\x52\x6c\xd9\xb2\x65\xef\x81\x03\x07\x3e\xbc\x75\xeb\xd6\x53\ \xe9\x13\x12\x0c\x09\x70\x0c\xd6\x2e\x39\x9c\x9b\x9b\xcb\x08\x10\ \x48\x70\xd7\x5d\x77\xdd\xd8\x2f\x24\x18\x38\x02\x08\xd1\x1d\x0c\ \x02\x09\x8c\x31\x34\x1a\x8d\xbe\x25\xc1\xc0\x11\x20\xb6\x6e\x90\ \xc1\x18\x43\xb3\xd9\x24\x49\x92\xbe\x24\xc1\x40\x11\x20\x00\x2e\ \x84\x68\x01\xbf\x13\x19\xda\xbd\xb7\x6c\x21\x11\xec\x47\x12\x0c\ \x14\x01\xa0\x08\x74\x00\x57\x4a\xd9\xf1\x3d\x2b\xd9\xbe\xb0\xb0\ \x80\x94\xb2\x2f\x49\x30\x70\x04\x80\xf6\x40\x06\x32\x74\x52\x86\ \x40\x92\x76\xef\x0b\xe0\xf7\x23\x09\x06\x8e\x00\x2b\x91\xfe\xa0\ \x0a\x71\xc8\x88\x97\xb1\x62\xc4\xcf\xfb\x91\x04\x03\x47\x00\x68\ \xf5\xe2\xf2\xb2\xbc\x6d\xb9\x47\x6c\xfd\x46\x82\x81\x24\x00\xb4\ \xf7\xea\xa5\xc2\x40\x3b\x55\x68\x47\x1c\xe8\x2f\x12\x0c\x24\x01\ \x56\xea\xf9\xed\x00\x2f\x93\xa1\x53\x95\xb0\x1c\x09\x3e\xfb\xd9\ \xcf\xde\xb8\x7b\xf7\xee\xa7\x9d\x04\x03\x49\x00\x68\x2f\xf1\x9d\ \xaa\x81\xa5\xc0\x8f\x49\x52\xb6\xa5\x48\x30\x35\x35\xb5\x77\xff\ \xfe\xfd\x4f\x3b\x09\x06\x96\x00\xb0\xb2\x98\x5f\xf6\xf4\x78\x5d\ \x29\xb5\x6c\x9f\xe0\x44\x27\xc1\xc0\x12\xa0\x53\x42\x57\xf6\xe8\ \x32\x31\xc2\xeb\xcb\x85\x80\xd8\x4e\x64\x12\x0c\x2c\x01\x82\xad\ \x46\x05\x82\xe7\x07\x50\x57\xd2\x52\x3e\x51\x49\x30\xd0\x04\x58\ \x4e\x05\xda\x25\x8b\xe1\xb5\x00\x68\x00\x75\x25\x76\x22\x92\xa0\ \xef\x09\x50\x9e\xb2\x55\x9e\xdc\xb9\x9c\x2d\xd5\x13\x58\x2a\xf1\ \x2b\x87\x82\x95\xda\x4a\x48\xb0\x67\xcf\x9e\x69\x60\x82\xe3\x30\ \xc7\xb0\xaf\x09\x10\xc0\xbe\xe7\xbf\xef\xe6\x96\x07\x3e\xda\x15\ \x12\x2c\x95\xfc\xb5\x0b\x05\x61\xfb\xb1\xd8\x72\x24\xf8\xf4\xa7\ \x3f\xfd\x21\xdc\x1c\xc3\xf2\x44\xd3\xae\x5b\xdf\x12\xa0\x3c\x53\ \xf7\xcd\x9f\xfc\x05\x6e\x7e\xe0\xa6\x55\xa9\xc1\x6a\x12\xc2\x58\ \xfe\x8f\x45\x01\x82\x2d\x47\x82\x03\x07\x0e\x5c\x8b\x9b\x6d\xbc\ \x0e\x77\xcf\x45\x4f\xa6\x9b\x77\xeb\xd6\xb0\xe3\x6a\xe5\x59\xba\ \x5a\x6b\x00\xde\x72\xc7\xeb\xb0\xd6\xf2\xea\x73\x7e\xa6\x6d\x2f\ \x7f\x39\x13\x42\x60\xad\xcd\xde\x1f\x9e\x4b\x29\xb3\xd9\xc0\x4a\ \xa9\xec\x78\xc1\xf3\xb5\xd6\x1c\x39\x72\x24\x23\xa3\x31\x26\x7b\ \xc4\x24\x8d\xa7\x92\x85\x47\xb5\x5a\x25\x49\x12\x46\x47\x47\x19\ \x19\x19\xc9\xce\x65\xdf\xbe\x7d\x3f\xb4\x7f\xff\xfe\x77\x5d\x70\ \xc1\x05\xbf\x49\x7e\x0b\x9a\x09\x97\x60\x6d\x57\x30\xb7\xbe\x24\ \x40\xb0\x00\x7e\x00\x04\xe0\xd7\x3e\xf5\x7a\x8c\x31\xfc\xd4\xb9\ \x3f\x5b\x48\xce\x96\x23\x41\xdc\x12\x0e\x60\xc7\xe0\xc7\x7f\x5f\ \x7e\x8f\xb5\x96\x66\xb3\x89\xd6\x3a\x03\x3e\x7e\x1e\x80\xd7\x5a\ \xb7\x10\x60\x6e\x6e\xae\x70\x1e\xe3\xe3\xe3\x8c\x8f\x8f\x53\xa9\ \x54\x38\xef\xbc\xf3\x7e\xe2\xea\xab\xaf\xfe\xb7\x2b\xae\xb8\xe2\ \x66\xf2\x9b\x52\x53\xba\x48\x80\xbe\x0e\x01\xe1\x6e\x9d\x66\xb3\ \x09\xc0\xcf\x3d\xef\x75\x8c\x56\xc7\xb8\xfc\xd3\x6f\xe0\xe6\x07\ \x6e\x22\x4d\xd3\x82\xd7\x2d\x67\x9d\x42\x40\x39\xfe\x97\x93\xc0\ \x38\x1c\x2c\xf5\x3c\x49\x92\x8e\xef\x0f\x8f\xb9\xb9\x39\x0e\x1f\ \x3e\xcc\x91\x23\x47\x00\xb8\xe4\x92\x4b\xae\x38\xff\xfc\xf3\xcf\ \x25\xbf\xfb\xa8\xab\xa1\xa0\x2f\x09\x50\x96\xff\xa0\x00\x7b\xa6\ \xf6\xf2\xae\x0b\x7e\x9f\xd1\xea\x18\x6f\xdd\xff\x46\x6e\x79\xf0\ \xa3\x99\x27\xae\x96\x04\x2b\x49\x0a\xcb\xa0\x86\x47\x92\x24\x19\ \xe8\x31\x09\xda\x6d\x2f\x3f\xd2\x34\xe5\x89\x27\x9e\xa0\x52\xa9\ \xd4\xaf\xbf\xfe\xfa\xab\x80\x0d\xb8\xfb\x10\x2b\x0c\x32\x01\xca\ \xb7\x6b\x69\xad\x31\x51\x08\xd8\xb3\x61\xba\x40\x82\x9b\x1f\xb8\ \x69\xd5\x24\xe8\xf4\xbc\x13\x09\x62\xf0\x63\x30\x63\xb0\xcb\x04\ \x89\x89\x12\x27\x83\x61\xbf\x33\x33\x33\x6c\xda\xb4\xe9\xec\xcb\ \x2e\xbb\xec\x87\x70\x55\x41\x95\x2e\x56\x05\x7d\x47\x80\xd8\xb2\ \x30\x10\x11\x00\x8a\x24\x78\xdb\x9d\x6f\x3a\x66\x12\x2c\x57\xfb\ \x2f\x55\x1e\xc6\xa0\x07\x40\xe3\xf5\x76\x6a\x51\xf6\xfe\xf2\xb6\ \xf9\xf9\x79\xde\xf8\xc6\x37\xfe\x0a\xee\x96\xf4\xf8\x6e\xe4\x35\ \x5b\x5f\x13\x00\xbc\x12\x18\xd3\xb2\xfd\x44\x20\x41\x00\x3e\x06\ \xba\x1c\x02\xda\x29\x43\x99\x0c\x42\x08\xd6\xaf\x5f\xbf\xfb\xf2\ \xcb\x2f\x7f\x29\x30\x46\x17\xcb\xc2\xbe\x27\x00\xb4\xde\xda\x1d\ \xac\x5b\x24\x58\xae\x21\x54\x1e\x17\x28\x7b\x74\xb9\xce\x6f\x47\ \x86\x4e\xe1\x21\x1c\xab\xd9\x6c\xf2\x8a\x57\xbc\xe2\xc7\xe8\x72\ \x32\xd8\xf7\x04\x58\x0e\xc4\x6e\x90\x60\x25\x5d\xc1\x72\x77\xb0\ \x5d\x72\x18\x83\x5a\x26\x43\xa7\x64\x30\x7e\x6d\xc7\x8e\x1d\xe7\ \xe2\x14\x20\xe4\x01\x6b\xb6\xbe\x27\xc0\x4a\xac\x97\x24\x88\x01\ \x5f\xaa\x84\x2c\x13\xa1\x4c\x86\xa5\x92\xc8\x40\xac\xf5\xeb\xd7\ \x6f\xc4\x7d\x2d\x4d\x08\x01\x6b\xb6\x81\x20\x00\xf4\x8e\x04\x65\ \x90\x97\x22\xc7\x52\x64\x28\x87\x82\x78\x3d\xe4\x0b\xbe\xf9\x54\ \xa5\xf8\xbd\x44\x6b\x0a\x03\x7d\x4d\x80\x63\x1d\xf4\xe9\x05\x09\ \xda\x91\xa1\x5d\x6e\x50\xce\x0f\x3a\x49\x7e\xa7\xca\x20\x3c\xe8\ \xf2\xd7\xd0\xf4\x35\x01\x56\x63\xdd\x22\x41\xd9\xdb\x97\xea\x1c\ \xc6\x44\x58\x2e\x94\x2c\xf5\xf0\xfd\x88\xae\x0e\x08\x0d\x1c\x01\ \xa0\xb7\x25\x62\x39\x09\xec\x54\x2d\xc4\x55\xc3\x72\xe5\x64\xfc\ \x9e\x70\x0a\xdd\xba\x16\x3d\x21\x40\xbb\x49\x1a\xbd\x7c\x98\x63\ \x0c\x05\xd0\x9b\x12\xb1\x13\xd0\x4b\x25\x89\xed\x3c\xbf\x04\x76\ \x39\x04\x74\xd5\x7a\x46\x80\x78\x24\xac\x57\x8f\xd5\x4e\x00\x09\ \xd6\xed\x70\xd0\x29\x21\x5c\x2a\x54\xb4\xfb\x9b\x72\x4f\x20\xde\ \x77\xb7\x2d\xa3\xd9\xe4\x3b\x78\x56\x52\x15\xef\x5b\xcd\x4e\xac\ \x15\x12\x83\xb2\x29\xb5\xf5\xc9\xfa\xcd\xfb\xa6\xcf\xdb\xdd\xbd\ \x53\x6c\x73\x3c\x3f\x1a\xaa\xb5\x23\xc2\x77\x16\x9f\xe2\x9b\x73\ \xdf\xe0\x23\x17\xdf\xbc\xaa\xfd\x3d\xfa\xe4\xd7\xf8\xad\xfd\x6f\ \x67\xbe\x31\xcb\xb5\x3f\xfc\x01\x2e\xde\xf7\xda\x96\x78\xbd\xec\ \x39\x75\x98\x9a\xd6\xee\x1b\xc6\xca\xaf\x1d\x8b\x4d\x4c\x4c\x5c\ \x08\x3c\x0c\xfc\x0f\x30\x8b\x9b\x23\xb0\xea\xe1\xe1\x7c\x3e\x80\ \x60\x52\x2a\xf5\xd2\x9d\x93\xbb\xa9\x57\xeb\x64\xdc\x28\x7d\x76\ \x19\xfd\x41\x27\x7b\xaa\xf9\xa4\x7f\xc7\xf1\xb9\xbf\x61\xfb\xc6\ \xed\xbc\xf9\x65\x97\x2f\x7b\x31\x6d\xfc\xcc\xe4\xdb\x76\xae\xdf\ \xcd\x3b\xcf\xff\x1d\xae\x3a\xf0\x0e\xde\x76\xe7\x9b\x00\xb8\x78\ \xdf\x6b\x81\xe2\x5d\xc1\x4b\x59\x78\x5d\x08\x51\x00\x3b\xde\x16\ \x96\x40\x36\xc7\xa0\xfc\xb5\x33\xd9\x19\x96\xd6\x57\x42\xc2\xd5\ \x58\xcb\x84\x90\x57\x9f\xf7\x1a\xce\xdc\x72\x96\x87\x2e\x1c\x54\ \x20\x44\x11\x50\x81\x00\x51\x06\x39\x5a\x13\x45\xb9\x92\x85\xbf\ \xf5\xff\x77\xf9\x33\x35\xd3\x06\x50\x74\x07\x53\x76\x0e\x1b\xb6\ \x14\xe8\xc0\xb6\xf1\x67\xf0\xeb\x2f\xbd\x92\xab\x3f\xf3\x3b\x6b\ \x26\x41\xf8\x9b\x76\x20\x06\xaf\x8f\xe5\xbc\x3c\xe1\x24\x9e\x95\ \xd4\x6b\x6b\x21\x40\x53\x37\x58\x68\xce\xe7\x20\xc9\x12\xec\xbe\ \x12\x89\x09\x22\xb3\xa7\xb2\x44\x1c\xf2\x35\x11\xbf\xd2\xcb\x0f\ \x67\x0b\x90\xb7\x57\x85\xf0\x1e\x83\xb1\xf9\xb6\xad\x13\x5b\x79\ \xcb\x0f\xbc\x95\xeb\xef\xbe\x76\xd5\x24\x08\xef\x89\xc1\xee\x44\ \x84\x70\x7e\xbd\x88\xed\x2b\xb5\x16\x02\x34\xf4\x22\x0b\x7a\x3e\ \xf7\x65\x1d\x40\x07\x10\xad\x10\x8b\xe2\x96\xc2\xe5\xc9\x40\x2f\ \x7b\x3f\x20\x97\x26\x44\x39\x7c\x94\xbd\xb6\x00\xb4\xb1\x6d\xde\ \xdb\xe6\x7d\xb6\xd5\xf7\x03\x11\xc2\xc6\x2d\x63\x5b\xf8\xa5\x17\ \xfe\x2a\x7f\x74\xcf\xfb\xd6\x44\x82\xf8\x7d\x31\x19\xe2\xd7\xca\ \x61\xa1\x1d\x59\xc3\xb6\xe3\x16\x02\x1a\xba\xc1\x42\xba\xe0\xf1\ \x69\xe7\xfd\x71\x16\x10\x3e\xa0\x5b\x8b\xad\xa0\x11\x22\x5a\x0b\ \x61\xc3\x87\x48\x19\xa9\xca\x4a\xcd\x62\x23\x14\xad\xcf\x82\xdc\ \xb6\x16\xa2\xd8\x1c\x66\x4b\x07\x35\xb0\xc5\xd7\x36\xad\xdb\xc4\ \xeb\x9e\xff\x06\x6e\xb8\xf7\x83\x5d\x23\x41\x78\xbe\x94\x22\x94\ \xc3\xc0\xb1\x1c\x67\xb5\xd6\x1a\x02\xcc\x22\x8b\xe9\x7c\x11\x7a\ \xd1\x2a\xed\x22\xd7\xfd\x16\x6f\xcd\x41\x17\xc8\x00\xbe\x5f\x77\ \xaf\xcb\x28\x05\x68\xa3\x0f\x9d\x3e\xb3\x75\xff\xb5\x78\xb8\x0d\ \x34\x88\x89\x90\xf7\x07\xe2\xbf\x68\x49\xb6\xe2\xd7\x22\x25\xd9\ \x58\xdf\xc8\xcf\x3d\xef\x52\x3e\xf2\xc5\x0f\xad\x99\x04\xf1\x7b\ \xcb\x1e\xdf\x29\x71\x7d\xda\x72\x80\x46\xda\x64\x51\x2f\x84\xd3\ \xc8\x41\x2a\x79\xa9\xd0\xad\xf3\xe5\x21\x78\xb4\x03\xdb\x2d\x65\ \x46\x96\xb2\x1a\x08\x40\x66\x7f\x1b\x5e\xa7\x73\x51\x53\xf2\x70\ \x03\x60\xad\xff\xc9\x0e\x9b\x3d\xf7\xf0\x63\x8d\x7f\x6e\x7d\x32\ \x68\x6d\x6b\x52\x48\x54\x96\x95\x42\xcc\x64\x7d\x8a\x8b\x9f\xf3\ \x1a\x3e\xf6\xa5\xbf\xe8\x0a\x09\x82\x95\x55\xa1\x70\x0e\xab\xec\ \x69\xac\xd6\xda\x2a\xc0\x42\x3a\x4f\x5b\xd0\xc3\xff\xa2\x35\xab\ \x77\x2a\x21\xdc\x32\x10\xc0\x93\x40\x9a\xf0\x41\x8b\x24\x10\x2d\ \x49\x66\x6c\x71\x62\xd4\x3a\xe3\xc7\x42\x16\xfb\x2d\x3e\xd9\x0a\ \x6b\x11\xd0\x99\x0a\xf8\xec\xdf\x58\x83\xb5\x91\x5a\x94\x2c\x56\ \x0d\x21\x60\x72\x6c\x3d\x3f\xf9\xec\x8b\xf8\xeb\xfb\x6e\xed\x2a\ \x09\xca\x7f\xb7\x54\x18\xe8\xa5\xb5\x4d\x02\x17\x03\x01\xca\xd2\ \x5e\xf6\x56\x42\x37\x4c\x20\xc8\x3b\x56\xaa\x44\x80\xf0\x17\x81\ \x24\x21\x0f\x90\x02\x97\x64\xe6\x07\xc8\x8f\x15\x1d\xb7\x70\x19\ \x4a\x89\x9c\x89\xe5\x34\x40\x6a\x4d\x44\x8a\x9c\x1c\xc6\xaf\x1b\ \x6b\xb0\x26\x7f\x4f\x61\xf7\x71\xbe\x60\x41\x24\x82\xc9\xb1\x09\ \x7e\xfc\xbc\x1f\xe7\xb6\xfb\x6f\xeb\x3a\x09\x62\x2b\xef\xe3\x78\ \x84\x81\x16\x02\x2c\x1a\x97\x04\xb6\xd6\xf8\x71\xd2\x27\x32\x40\ \x95\x10\x08\x2b\x91\xa4\x6e\xbb\x94\xe8\x0c\x6c\x4f\x90\x10\x0e\ \xac\xc8\xb6\xb5\x2b\x29\x57\xf2\x79\x1d\xc0\xb1\xb7\xfb\x65\x94\ \xcc\x39\xc9\x37\xb9\x2a\x78\x42\x18\x93\x13\xc2\x58\x83\xb1\x16\ \x63\x75\x29\x47\x08\xfb\xf3\x47\xd3\x20\x13\xc1\xf8\xe8\x3a\x5e\ \x7e\xee\x8f\xf2\xa9\x07\xff\xa1\xa7\x24\x38\xde\xd6\x1a\x02\x52\ \x57\x06\x16\x9b\x3a\x64\xeb\x42\x08\x94\xf7\x76\x29\x04\x5a\x48\ \x9f\xe8\x49\x94\x90\x1e\xe4\x28\x07\x90\x31\xf8\x0e\x64\x69\x8b\ \x4a\x80\xdf\x6f\xc0\xa1\xdd\x65\x6c\x57\xdb\x17\x25\x1f\xc8\x40\ \xf7\x5e\x6f\x82\xc7\x47\xc0\xe3\x80\x0f\x24\x08\xdb\xb4\xd5\xd9\ \x41\xca\x2a\x40\x0a\xb2\x2a\x58\x57\xaf\x73\xfe\x39\x3f\xc8\x81\ \x87\xee\x3a\x69\x48\xd0\x1a\x02\x8c\x6b\x04\x15\x1b\x37\x0e\x28\ \x25\x1c\xf0\x5a\x3a\xd0\xa5\x08\x4b\x85\x40\x60\x44\x34\xea\xe5\ \x82\x02\x42\x47\x39\x81\x74\x44\x30\x61\xdf\x36\x4f\xfc\xa4\xcd\ \x8f\xd4\x99\x01\x21\xf9\xcb\x4b\xbe\x0c\xac\x00\xb2\x89\xd5\xc0\ \xdd\x8a\xa5\x03\x21\x6c\x4e\x02\x6b\x2d\xda\x9a\x9c\x04\xc6\x3d\ \xd7\xd6\x42\x56\x51\x90\x1f\x21\x85\xa4\x26\x18\xab\x8f\xf2\x92\ \xb3\x5f\xc4\xdd\x07\x3f\x77\x52\x90\xa0\x7d\x27\x50\xcf\x13\x92\ \x30\x89\x4b\xf0\xa4\x90\x68\x91\x22\x85\x44\x59\x07\xba\xf4\x44\ \x10\x42\xa3\x84\xc0\x58\xe9\xdf\x2b\x3c\x21\x9c\x4a\x48\xeb\x49\ \xa1\xf3\xca\x20\x24\x7f\x41\x01\xfc\x9d\x76\xee\x24\x96\xcc\x7d\ \x6c\xc6\x85\x2c\xe6\x1b\x9f\xf5\x67\x21\xc0\x25\x81\xc1\xd3\xad\ \x07\xdc\x58\x83\xc5\x81\x9c\x85\x01\x2c\x46\x6b\xb4\x0f\x07\x26\ \x7a\x7f\x08\x37\xd9\xf9\xa5\x86\xca\x88\xa2\x5e\xaf\xf1\x82\xb3\ \x9e\xc7\xe7\xbf\xfc\xc5\xbe\x27\x41\x6b\x0e\x90\x2e\xb2\xd8\x5c\ \xc8\x32\x75\x07\xb2\x7b\x28\xa1\x90\xc2\x79\xba\x14\x1a\x65\x3d\ \xd8\x52\x61\x84\x8b\xfb\x12\x07\x78\x08\x0b\xd6\x4a\xf7\x9a\x27\ \x81\x0c\xe1\x41\x8b\xc8\xd9\x3d\x0d\xa2\xde\x42\x7b\xb3\x51\xd3\ \xce\x97\x7f\x51\xd6\x6e\x42\x49\x18\x49\x7b\x50\x06\x6d\x83\xf4\ \xfb\xa5\x31\x4e\xfa\x4d\xc8\x07\x82\x02\xe8\x7c\x3d\xeb\x0b\xe4\ \x59\xc2\xe2\x8c\x25\xa9\x4b\x46\xea\x15\x9e\xfb\xcc\x67\xf1\x2f\ \x5f\xf9\xf7\xbe\x26\x41\xfb\x32\x50\x2f\xf8\x1a\x5d\x22\xad\x8b\ \xed\x4a\x2a\x0f\xbc\x5b\x97\x42\x61\xa4\x03\x5c\x69\xed\xbc\x5d\ \x4a\xac\x10\x18\xa1\x32\x22\x58\x91\x41\xee\x54\xc1\x86\x90\xe0\ \x65\x3f\xce\x03\x4c\xf9\x82\xb5\x36\x05\xe2\xa4\x0f\x5f\xdf\xe7\ \x92\x5f\xca\x01\x32\xf9\x2f\x26\x7c\x46\x1b\x34\x0e\xe0\xa0\x0a\ \xc6\x1a\x52\x9b\xcf\x35\x48\xad\xc6\x18\x9d\xf5\x0f\x0a\xed\xe3\ \x19\xa8\x5a\xc5\x48\x3d\xe1\xd9\xcf\x3c\x93\xfb\xbe\xf2\x95\xbe\ \x25\x41\xdb\x56\xf0\xa2\x9e\x47\x09\xe5\x80\xc6\x01\x6f\xad\x46\ \x2a\xb7\x6e\x91\x28\x34\xd6\x48\xac\x90\x8e\x18\x48\x94\x11\x58\ \x29\x91\x18\xac\x15\x8e\x0c\x2e\x65\x6c\xf9\x07\xe4\xca\x00\x20\ \x24\x32\xbb\xca\xc5\xfa\x23\xbe\xf8\xae\xb7\x63\xb2\xf8\x5f\xe8\ \xaa\x45\x09\x5f\x21\xd1\x23\xf7\x7a\x1d\x91\x21\xf7\xfa\xa0\x02\ \x1a\xad\x9d\x0a\xe8\xb0\x6e\x0d\xda\x64\xcd\x66\x42\xe5\xb1\xf0\ \x14\x50\x6f\x52\xa9\x2b\x4e\x3b\xe3\x14\xbe\xfa\xf0\x37\x78\xdb\ \x9d\x6f\xc2\x5a\xcb\xc5\xfb\x5e\x4b\x92\x24\x85\x19\x40\x6b\xb5\ \xe3\x36\x16\xf0\xd4\xc2\x93\x68\xb1\xe0\x3c\x5d\x4a\x12\x91\x50\ \xab\x8c\x92\x08\x89\xd2\x21\xee\x2b\x2a\x42\x51\x4d\x46\x50\x3e\ \x19\x44\xba\x89\xaa\xc6\x28\x14\x12\x29\x05\xae\x5d\x64\x70\xcd\ \x5f\x41\x14\x00\x7c\xe3\x83\x88\x10\x1a\x5b\x0c\x08\x91\x00\xe4\ \x1e\x18\xb7\x7a\x0b\xcf\xb3\xb8\x1f\xf5\x00\x02\xb0\x3e\x47\x08\ \x71\x7e\x21\x5d\xcc\x08\xa0\x7d\xf2\xd7\x34\x0d\x16\x75\x13\x63\ \xd2\x6c\xdb\x42\x3a\x4f\xc3\xa4\x19\x31\x16\xf5\x42\xa1\x64\xe4\ \x29\x18\xdd\x50\xa1\x3a\xa6\xd8\xba\xb7\xce\xe1\xaf\xcf\xf1\xeb\ \x07\x7e\x09\x29\x04\x3f\xe5\x27\x95\xf4\x9f\x02\x98\x05\x66\x1b\ \xda\x4d\x47\x12\x8e\x00\x0b\x7a\xce\xcb\xbe\x24\x91\xfe\x4e\x57\ \x21\x91\x0d\x47\x92\x90\x1b\x64\xe1\x41\x4a\x12\x59\xa1\x22\x13\ \x1f\xf7\x65\xd6\x21\x94\xf8\xfc\x20\x8c\x06\x8a\x48\x13\x84\xa4\ \x78\xb9\x8a\x21\x20\xaf\xe9\x4b\xdd\x3f\xe3\x3c\xde\xf8\x6d\x4d\ \xb3\x98\x65\xf8\x99\xf4\x9b\x3c\xeb\xcf\x96\x26\x8a\xfb\x46\x93\ \x9a\xfc\xf5\xd4\xe8\x82\x22\xa4\xbe\x71\xd4\x72\xbd\xbe\x9b\x32\ \x32\x91\x50\x5b\xa7\x58\x37\x55\x61\xe6\x48\x93\x1b\xef\xfb\x00\ \xaf\x3a\xfb\xa7\x0b\xde\x7f\xa2\x12\xa1\x85\x00\x4a\xf8\xb9\x68\ \x42\x91\x48\x95\xc5\x7b\xa7\x06\x7e\x36\xab\xdf\xee\x80\x97\x59\ \x35\xa0\xbc\x3a\x48\x21\x71\x65\xbd\x41\x20\xb0\xe4\xc9\x9e\xf5\ \x4d\xa0\x62\xa7\x31\xbc\x43\xb3\x6c\x12\xd8\xb2\xb4\x59\x1e\x10\ \xd6\xb3\x64\xd5\x4a\x0f\xb6\xc4\x08\x83\xb0\x1a\x6d\x04\xc2\x48\ \x0c\x06\x21\x9d\xcc\x0b\x8b\x6b\x5e\xe1\x62\x3f\x06\x90\x60\x8c\ \x00\x95\x46\x87\x4b\xd0\x26\xcd\xaf\x55\x4d\x30\xf1\x8c\x11\x84\ \x14\xcc\x3c\xd9\x64\xe6\x48\x93\xd3\x27\x9f\xc9\x9f\xbf\xfc\x56\ \x9a\xcd\x66\x57\xe7\xf2\x1d\xb7\x10\x10\xb2\x7d\x07\x7e\x00\x5e\ \x22\x45\x82\x52\x3e\x21\x14\x12\x25\x93\xac\x3a\x48\x84\x44\xaa\ \x92\x0a\x84\x72\xd0\x27\x84\xca\x77\x09\x0b\x9d\x41\xf0\x5e\x9f\ \x77\x05\x7d\xea\x54\x3a\xab\xa8\x14\xcb\x12\x3e\x9b\xa9\x81\x11\ \x79\xb9\xa7\x8d\x45\x5a\x07\xb0\xb4\x06\x69\x05\xc6\x5a\xb4\x15\ \x18\x2b\x90\x68\x34\x6e\x5d\x58\x81\xb6\x20\x0c\xae\x2c\x15\xc2\ \x71\x50\xba\x1e\x85\x06\xb0\x09\x98\xd4\xdd\x8e\xa1\x01\x91\xa0\ \x6d\x8a\xaa\x09\x26\x77\x8e\x22\x24\xcc\x7c\xbb\xc9\x13\x8f\xce\ \x33\x3d\x7e\x06\x7f\xf8\x92\x0f\x31\x22\x47\x0b\xbf\x33\x78\x22\ \x5b\x1b\x05\x90\x25\xf0\xfd\x9d\x2a\xbe\x12\x48\x82\x22\x78\x35\ \x48\x22\xaf\x4f\x0a\x0d\x22\x4f\x08\x5f\x29\xc8\xac\x49\x24\xf3\ \x30\x40\xab\x44\x16\xe2\x7f\xb0\x72\x87\x2e\xaa\xd1\x5d\x89\x17\ \x32\x7f\x83\x14\x3e\xeb\x37\x12\x2d\x0c\xd2\x87\x00\x69\x05\xa9\ \x09\x9d\x49\x8b\xb4\x9a\xd4\x38\xf0\xb5\x14\x08\xab\x49\x8d\x70\ \x40\x5b\x81\xd1\xa9\x2b\x4b\x8d\xf0\xcb\xd4\x9d\x93\x84\x4a\xb5\ \xca\xf8\xce\x0a\x28\x98\xf9\xdf\x06\xdf\xfe\xfa\x3c\x7b\xc7\x4e\ \xe3\x9a\xe7\x7d\x80\x7a\x32\xd6\x32\x29\xf4\x44\xb6\x8e\x0a\x10\ \x83\xef\x14\xc1\xab\x80\x2c\xa9\x40\xb4\x9e\x87\x03\xe9\xc3\x81\ \x27\x84\x6f\x1d\xab\x20\x89\x04\x32\x64\x0d\xe6\x5c\x11\xc0\x55\ \x04\xd1\x39\x85\xcc\x1f\x88\x6a\xff\x3c\x07\x90\x59\xe2\x27\x7d\ \x93\x47\x63\x84\x75\x29\xa8\xb5\x5e\xf6\x0d\x42\x6a\x8c\x95\xa4\ \xd6\x20\x6c\x08\x3a\x02\xac\x70\x25\xa8\x74\x72\x2f\x8c\x40\x2b\ \x40\x6b\x0f\xbe\x05\x99\x00\x29\x49\x55\x32\xb9\x6b\x04\x23\x34\ \x4f\x1c\x9e\xe3\x7f\xff\x6b\x9e\x3d\x63\xa7\x72\xd5\x79\xef\x63\ \xbc\x36\xd1\x76\x26\xf1\x89\x4c\x82\xf6\x04\x68\x03\xbe\x12\x01\ \x6c\x45\xa2\xf2\xf8\x9f\x48\x95\x79\x7c\x46\x04\x29\xb2\x6a\xc1\ \xc9\xbf\x97\x7e\x51\x0c\x01\x32\xc8\xbf\x8c\xbc\xbf\xd0\x09\x76\ \x49\xa0\xbb\x7c\xaa\x98\xfd\x9b\xd0\xfc\x71\x31\x3e\x24\x85\x32\ \xc4\xfc\x90\x00\xa2\x91\x52\x60\x10\xa4\x56\x22\xac\xf1\xde\x8e\ \x3b\xae\x30\x08\xad\x49\x25\x5e\xee\x0d\x46\xa6\x8e\x75\x41\xf6\ \x25\x60\xa0\x52\xaf\xb1\x71\x77\x1d\x2d\x34\x87\x1e\xff\x0e\x87\ \x1f\x99\x63\xcf\xd8\xa9\xbc\x6b\xdf\xf5\x6c\x18\xdb\x48\xb5\x5a\ \xa5\x5a\xad\x52\xa9\x54\x0a\xf3\xf9\x4f\x64\x6b\x43\x00\xd5\x16\ \xfc\x2c\xf1\x53\x61\x3d\xf2\x7c\x99\x78\x45\x08\x8d\x22\x91\x11\ \x42\x46\xe0\xcb\x08\x74\xe7\x29\x44\x61\x20\xe4\x04\xa2\x25\x03\ \x80\x36\xa3\x80\xc2\x66\x5e\x6f\xb2\x41\x9f\x18\x7c\x89\xb5\x86\ \xd4\x3a\x79\x77\x03\x52\x4e\x0d\xb4\x01\x21\x71\x79\x40\xf0\x76\ \x0b\x68\x27\xf7\xc2\x24\x4e\x0d\x3c\x09\x8c\xb6\xd4\xea\x8a\x2d\ \x7b\x26\xd0\x32\xe5\x5b\xdf\x9a\xe5\x9b\x0f\x1f\x65\xf7\xe8\x74\ \x06\x7e\xad\x56\x63\x64\x64\x84\x5a\xad\x96\x11\xe0\xe9\x9c\xec\ \xb9\x52\x6b\x25\x80\x14\xed\xc1\x97\xc1\xdb\xa3\xf0\xe0\xbd\x3c\ \x11\x0a\xa9\xf2\x0e\xa1\x12\x71\x2e\xe0\x2b\x04\xa1\x10\x32\x22\ \x40\x34\x68\x24\x45\xb1\x6b\xd6\x4a\x81\xa8\x0f\x10\x7a\xf3\x51\ \xbd\x6f\x44\x4e\x00\x57\xee\x69\x5f\xfe\xf9\xc1\x27\x2b\xd0\xd6\ \x6d\xf7\x61\x9c\xd4\x0a\xb0\x2e\xf7\xf7\x99\xa4\xcb\xf8\xbd\xc7\ \x5b\x93\x20\x65\x8a\x35\x96\xa9\xc9\x31\x36\xef\x18\xc7\x48\xcd\ \xa3\xdf\x38\xca\x7f\x1e\xfc\x36\xbb\x47\xa7\xb9\xea\x59\xd7\x33\ \x55\xdf\xc0\xe8\xe8\x28\xf5\x7a\x9d\x91\x91\x91\xec\x8b\x1f\xa3\ \x9b\x39\x0b\xe7\x7d\xa2\x59\xdb\x24\x30\xc4\xf2\xd8\xd3\x13\xa9\ \x50\x9e\x00\x89\x08\xf5\x7f\x5c\x19\x94\xf3\x81\x50\x11\xc4\x83\ \x46\x32\x03\x5e\x85\x3c\x80\x9c\x08\x71\x5b\xb8\x9d\x85\x96\x2f\ \xde\xf3\x03\x01\x74\x18\xef\xb7\x12\x2b\x8c\xab\x02\x4c\xe8\xeb\ \x0b\x9f\xf1\x5b\x9f\xf0\x85\xa1\x67\x37\x1e\xa1\x83\xa7\x4b\xc0\ \x24\x05\x12\x60\x24\x1b\x36\x8e\xf1\x8c\x53\x26\x69\xd8\x06\xff\ \xf5\xd8\x21\x0e\x3e\xf0\x78\x0e\xfe\xd8\x46\xea\xf5\x7a\x06\x7e\ \x4c\x80\x3e\x0e\x01\x1e\xf0\x2c\xa1\x53\x0e\xe4\xa8\x32\x08\xc4\ \xc8\xfa\x04\x71\x75\x90\x85\x01\x85\x92\xb9\x0a\x88\x88\x18\xa1\ \x12\x88\x09\x20\xdd\xc1\x3d\xfc\xb2\x4d\x15\x60\xf2\xa6\x0f\xc5\ \xd6\xaf\xf4\x25\xa0\x09\x5e\xee\xa7\x56\x09\x2b\xdc\x4d\x17\xbe\ \xc7\x2f\xa4\x1b\x7f\x48\xad\x01\xa3\x11\x0a\xd0\x09\x48\xe3\x49\ \x20\xbc\xec\x3b\x12\x6c\xda\x38\xce\x8e\x9d\x1b\x1c\xf8\x5f\x3f\ \xcc\x97\xee\x7f\xf4\xa4\x02\x1f\x3a\x85\x00\xa9\x1c\xc8\x42\xfa\ \x84\x2f\xc9\xc0\x2d\x80\xef\xd7\x93\x4c\x31\x5c\xa5\x90\x28\xd9\ \x22\xff\x85\x1c\x40\xf8\xb9\x02\x52\x44\x73\x09\xdb\x25\x82\x22\ \x17\x7f\xab\xdc\x73\x19\x8d\xfd\x5b\x57\xf7\x07\xef\x77\x75\xbf\ \x8c\x46\xf5\xdc\x90\xb4\xd0\xd2\x79\xba\x75\xf5\x3d\x46\xb8\x1c\ \xc0\x00\xca\x83\x8e\xaf\xf7\xa5\x05\x93\xb0\x65\xd3\x3a\xf6\xec\ \xd8\xc4\xa2\x6d\xf2\xf0\xa3\xdf\xe2\x0b\xff\xf6\x30\xbb\x7c\xcc\ \x9f\xf4\xb2\x3f\x3a\x3a\x4a\xad\x56\xeb\x18\xf7\x4f\x54\xd9\x8f\ \xad\x95\x00\xe4\xb2\x9d\x88\x62\x33\xa8\x2d\xf8\xb2\x58\x11\x64\ \xdd\xc0\xd0\x39\x2c\xe4\x02\xbe\x42\x10\x12\x81\x2c\xe4\x01\x42\ \x44\x13\x4d\x4b\x89\x60\x48\x00\xcb\x8d\x20\x6b\xad\xab\xfb\x09\ \xc3\xb7\x22\x8b\xfd\xce\xd3\x35\xc2\x48\x84\xd2\x08\x9b\x20\x8d\ \x6b\xf1\xba\x46\x0f\x80\x00\x9b\xe6\x07\x91\x12\x0c\x3c\x63\xd3\ \x14\xa7\xee\xd8\x46\xd3\x36\x38\xf8\xb5\xc7\xf8\xcc\x17\x1f\x64\ \xd7\xe8\x34\x57\xed\xbb\x9e\xa9\xb1\x0d\x27\x85\xe7\x07\xeb\x98\ \x03\xe4\xdd\xbd\x38\xe6\x97\xc1\x57\x59\xf6\x9f\x84\x1c\x20\x4e\ \x0c\xa3\xaa\x40\x49\xe9\xba\x82\x51\x25\xa0\x0a\x04\x90\x2d\xde\ \x9f\x5b\x69\x12\x48\x94\x00\xba\x26\x90\xcf\xfc\x85\x6b\xfa\x68\ \xe3\x47\x19\x8d\xc4\x48\x4d\x6a\x43\x67\xcf\x57\x1b\x16\x74\xd6\ \xe0\xf1\x19\x3f\x16\x74\xc2\x29\x9b\xd6\x73\xe6\xce\x53\x68\xd8\ \x26\xff\xfe\x9f\x5f\xe3\x8e\x7b\xff\xf5\xa4\x05\x1f\x96\xc8\x01\ \x64\x06\x78\xc8\xec\x13\x1f\x0e\x62\xcf\x0f\xdd\xc1\xb8\x5b\x18\ \x3c\x3f\x2f\x1b\x0b\x0a\xe0\x09\xe1\xb2\x7f\x55\x50\x00\x81\x00\ \x29\x68\x57\x3c\x19\xf0\x33\x7f\x2c\xd6\x87\x03\x57\xf7\x6b\xdf\ \x0d\x8c\xbc\x5f\x18\x8c\xd6\xa4\xd2\x35\x7c\xb0\x02\x6d\xb4\x8b\ \xf1\x02\x84\x8e\xca\xbc\x40\x02\x01\xbb\x36\x6d\xe6\xec\x9d\xbb\ \x69\xd8\x26\x5f\x7c\xe4\xab\xfc\xcd\xe7\xef\x71\xb2\x7f\xee\x7b\ \x99\xac\x4f\x65\xb2\xbf\x54\xb9\xd7\x0f\xb2\x1f\x5b\x0b\x01\x4e\ \xd9\xb6\x91\x9d\x53\x9b\xa9\x88\x84\x8a\xa8\x50\x51\x49\xfe\x5c\ \xb8\xe7\x89\x5f\x97\x42\x21\x55\x82\x14\xee\xa1\x50\x48\x91\x78\ \x4f\x57\x7e\xbb\x4b\x12\x9d\xe4\x27\xde\xd3\x65\xb6\x0c\x77\x0e\ \x89\xcc\xf5\x97\xe8\x03\x90\x4f\x02\x81\x30\xcd\xdb\x78\x45\x30\ \x7c\xf3\x3b\x8f\x30\x97\xce\x38\x05\x50\x79\x7b\x57\xf8\x16\x30\ \x36\x75\x95\x80\x0a\x3d\x7f\x47\x02\x2b\xe0\x8c\x2d\xbb\x38\x7b\ \xfb\x2e\x9a\x36\xe5\xf3\x8f\x1c\xe4\x63\x9f\xfb\x4c\x06\x7e\xec\ \xf9\x21\xee\xf7\xbb\xe7\x07\x6b\x21\xc0\x9e\xad\x5b\x38\x63\xdb\ \x4e\x6a\xa2\x42\x4d\x54\xa9\x52\xa1\x26\xab\x54\xa8\x50\x13\x15\ \xaa\x54\xa8\x8a\x2a\x8a\x0a\x42\x54\x10\xd9\x32\x01\x51\x45\x90\ \x64\xeb\x6e\x20\xa8\x02\x42\xb9\x75\x14\xa0\xc8\x6f\x35\x93\xa5\ \x5b\xcc\xca\xd6\x66\x46\x50\xb6\xb4\x41\x16\x08\xd3\xc0\xf6\x4c\ \x9c\xc3\x17\x1e\xbf\x9d\xd9\xc6\x51\x74\x28\xff\x30\xa4\xf8\x19\ \xbf\x26\x21\x95\xc6\x0f\xee\x58\xac\x4e\xb0\x22\xe5\x07\x76\x9f\ \xc5\xae\xa9\xcd\x34\x68\x72\xf7\x7f\x3c\xc0\x8d\x77\xff\xc3\x40\ \x80\x0f\x6d\x08\x70\xf8\xc9\xa7\x18\x11\x55\xe7\xf1\x24\x85\x65\ \x82\xa2\x4a\x82\x14\x15\x0f\x66\x05\x21\x54\xfe\x5c\x2a\x24\x0a\ \x3c\xf8\xa0\x32\x22\x38\xad\x75\x5e\x5f\xae\xf7\x0b\x3e\xbf\x92\ \xd1\xe0\xd2\xc8\xfc\xba\xda\x38\x67\x6e\x3e\x13\xa5\xaa\xac\xab\ \x4c\xb2\x90\xce\x22\xac\xf6\xd9\xbe\x70\x33\x9c\x35\x59\x99\x97\ \x4a\x89\x35\xa0\x24\xbc\x78\xe7\xf7\x32\x3d\xe5\x12\xbe\x3b\xff\ \xe3\x4b\xfc\xf1\x3f\x7d\x82\x5d\xa3\x7b\xf9\xed\x73\xaf\x6b\x91\ \xfd\xb8\xcd\xdb\xcf\xb2\x1f\x5b\x0b\x01\x6e\xfb\xc2\xbd\x4f\xc7\ \x79\xac\xd9\x2e\x3c\xe7\x95\xfc\xde\x8f\x5c\x4d\x22\x5d\x72\xea\ \xbc\x5f\xbb\x8e\x9f\x01\x54\x02\xd9\x08\x1f\x20\x52\x5e\xb4\xfb\ \x39\x4c\xaf\xdf\x8e\xa5\xc1\xa7\xbe\x7c\x2f\xef\xf9\xc7\x5b\x3c\ \xf8\xef\x65\xaa\x7e\x72\x7b\x7e\xb0\x8c\x00\xa2\xc1\xfd\x0d\xd2\ \x97\x1e\xeb\x0e\xac\x41\xa0\x49\xcc\x13\xd4\xf5\x61\xb6\xbe\x60\ \xef\x8b\x5f\xf2\xba\x57\xbf\xe1\x67\x0e\x1d\x3a\x84\x4e\xd3\xe5\ \x77\xb0\x06\x0b\x9e\xf7\xdf\x73\x5f\xe3\xe6\x87\x6e\xe4\xb2\x17\ \xbe\x85\x44\x25\x24\x4a\xf9\x2e\x9f\xf0\xb5\x3d\x25\x12\x58\x5e\ \xb8\xe3\x85\xec\x5d\xbf\x13\x4b\x93\xdb\xbf\xfc\x39\x7e\xf7\xae\ \x8f\x0c\x1c\xf8\x10\x11\xe0\xff\xae\xe1\x28\x70\xf7\x2a\xf6\x21\ \x70\xdf\x5d\x3b\x01\xec\xda\xf5\xf3\xa7\xef\x7e\xee\xb6\xe7\xf3\ \xb8\x79\x9c\x46\xa3\xd1\xa5\xd3\x74\x16\x4b\x6d\xfc\xc5\x4b\x61\ \x34\xf1\xd0\xd1\x43\xa8\x9a\xab\x58\x84\xd2\x5e\xf6\x93\x12\x09\ \x14\xdf\xbf\xed\xc5\xec\x9d\xda\x05\xb6\xc9\xdf\x3e\xf4\x19\x7e\ \xfb\xce\x3f\x75\xe0\x9f\xf3\xde\xac\xb7\x7f\x32\xcb\x7e\x6c\xdd\ \xfe\xd1\x28\x0b\x50\xa9\x54\x18\x1b\x1b\xa3\x52\xa9\x74\x79\xf7\ \xd1\x81\xac\xfb\xb5\x90\x34\x4d\x49\x66\xdd\xc7\x10\xa1\x5c\x95\ \x0a\x5d\x98\x3d\x96\x77\xf9\x9e\xbf\xed\x65\xec\x99\x9c\x06\xdb\ \xe0\x6f\xbe\xbc\x9f\x77\xee\xff\x83\x1c\xfc\xb1\x7c\x60\xe7\x64\ \xf7\xfc\x60\x3d\xf9\xd5\xb0\x5a\xad\xc6\xc4\xc4\x04\x8b\x8b\x8b\ \xbd\xd8\x7d\xe6\xf9\x5a\x6b\x1a\x8d\x06\xd5\x6a\x15\x20\xeb\x46\ \x26\x52\x15\x7b\xfb\x02\x2a\x95\x3a\xe7\x6e\x7e\x31\x7b\x26\x4e\ \xc3\xd2\xe0\xaf\x0f\x7e\x92\xb7\x7f\xea\xda\x81\x06\x1f\x7a\x40\ \x00\x21\x84\x0d\xbf\x7f\x97\x24\xbd\xf9\x55\xba\xd8\xfb\x85\x10\ \x24\x5e\x69\xc2\x54\x35\x25\x64\x94\xec\x29\x92\x4a\x8d\x17\xed\ \xb8\x84\x89\xea\x24\xd0\xe4\xaf\x1e\xfc\x04\x57\xdc\xf1\x2e\x76\ \x8d\xec\xe5\x9d\x67\xbf\x87\xf5\xa3\x93\x59\x67\x2f\x06\x3e\x0c\ \xe9\xf6\xcb\xf4\xae\xd5\x58\x4f\x10\xaa\x56\xab\x5d\x9f\x13\x5f\ \xbe\xf8\xc1\xfb\x01\x12\xe5\x3e\x86\xf4\x43\xd6\xca\x27\x7b\x56\ \x58\x2a\x49\x95\xe7\x6f\xbf\x84\xf5\xd5\x2d\x80\xe6\x96\x07\x6f\ \xe5\xad\x9f\xfc\x0d\x07\xfe\x39\xef\xc9\x12\xbe\x38\xee\x57\x2a\ \x95\x93\xde\xf3\x83\xf5\x84\x00\xe1\xe2\xa5\x3d\xa8\x02\xca\xdf\ \xb3\x97\xa6\x69\xf6\x5c\x92\x0f\x51\x5b\xa1\xa8\x55\x6a\x7c\xdf\ \xb6\x8b\x99\xa8\x6c\x01\x2c\xb7\x3c\x78\x33\x97\xff\xfd\xaf\x0e\ \xc1\x8f\xac\xeb\x04\x30\xc6\xa0\x94\x2a\x80\xd4\x8b\x63\x84\xfd\ \x4b\x29\xa3\x9b\x4c\xf2\x7b\x17\x93\x4a\x8d\xe7\x6c\xb9\x88\x89\ \x64\x0b\x16\xb8\xe5\xc1\x9b\x78\xcb\xdf\xbd\x81\x5d\x23\x7b\xb9\ \xf2\xec\x77\x33\x39\x3a\x95\x81\x1e\xa4\x3f\xfe\x15\x8f\x60\x27\ \xa3\xec\xc7\xd6\xb3\x9f\x8e\xed\xa5\xf7\x48\x99\xff\x9c\x6b\x7c\ \x9c\x30\x94\x5d\x53\x75\xce\xdb\xfc\x2a\xc6\xd4\x66\x00\x3e\xfe\ \xd0\x47\x78\xf3\xdf\xbd\x3e\x03\x7f\xe8\xf9\xb9\xf5\x84\x00\xbd\ \xbc\x1d\x6a\xa9\xef\xcf\x13\x42\x52\x55\xa3\x3c\x77\xeb\xc5\xd4\ \xc4\x14\x00\x1f\x3f\xf8\x51\x2e\xbb\xfd\x17\x87\xe0\x77\xb0\x9e\ \xfe\x78\x74\x2f\xe4\xb3\xfc\x8d\xdc\xd6\xda\x70\xcf\x38\x20\x39\ \x63\xe2\x02\xc2\x0f\x6a\xdd\x7a\xf0\x2f\xf8\x95\xdb\x7e\x9e\x9d\ \x23\x7b\xb9\xf2\xac\x5c\xf6\xe3\x21\xdd\x41\x94\xfd\xd8\x4e\xfc\ \x79\xcb\x4b\x58\x7b\x4f\xcd\xc1\xff\xe5\xdb\x2e\x65\xe7\xc8\x5e\ \xde\x79\xd6\xbb\x99\xac\x4f\xb5\x4c\xe6\x18\x64\xcf\x0f\xd6\xd7\ \x3f\x1f\xdf\xc9\x02\xf8\xbb\xea\xd3\x5c\x79\xe6\xb5\x43\xf0\x97\ \xb0\x93\x22\x04\xc4\x87\xc9\xc0\x1f\x9d\xe6\x1d\xdf\x73\x4d\x61\ \x48\x37\x4c\xe0\x1c\x74\xd9\x8f\xed\xa4\x52\x80\x3f\xb9\xf7\x7d\ \xdc\xf1\xf0\x27\x1c\xf8\x67\x5e\x53\x68\xef\x0e\x3d\xbf\xbd\xf5\ \x3d\x01\x62\x00\xef\x78\xf8\x13\xec\xae\x9f\xca\x95\xcf\x74\xb2\ \x3f\x32\x32\x32\x04\x7f\x19\x3b\x29\x42\x40\x68\x04\xed\x1d\x3b\ \x8d\xdf\x3a\xe7\x3a\xc6\x6b\x13\xd4\x6a\xb5\xa1\xec\xaf\xc0\xfa\ \x5e\x01\xc2\x80\xcd\xf4\xc4\x19\xfc\xde\xb3\xff\x90\xba\x72\xc3\ \xd0\xa1\xcc\x1b\x7a\xfe\xd2\xd6\xb7\x04\x88\xbf\x7e\x65\xe7\xc4\ \x2e\xae\x7f\xc1\x9f\x31\x22\x47\x91\x52\x52\xa9\x54\xa8\x56\xab\ \xd9\xd4\xed\x21\xf8\x9d\xad\x27\x63\x01\xc1\x7a\x25\xb1\xf1\x37\ \x70\x48\x29\xd9\x3e\xbe\x93\x34\x4d\x09\x5f\xb7\x1e\x08\x70\x32\ \xcf\xe4\xe9\x96\xf5\xa5\x02\xc4\xde\x9f\x24\x09\xd6\xda\xc2\x00\ \x54\xf9\x97\xb8\x87\x9e\xdf\xd9\xfa\x92\x00\x40\x46\x00\x6b\x6d\ \x26\xf3\xf1\xf6\xf2\x6f\xf3\x0e\xad\xbd\xf5\x5d\x15\x10\xef\x37\ \x80\x1d\xcf\xda\x69\xf7\xd5\x6c\x43\xd9\xef\x6c\x7d\xa9\x00\x01\ \xf0\x58\x05\xe2\xd7\xc2\x72\xe8\xf9\xcb\x5b\x5f\x12\x00\x8a\x24\ \x68\x3f\x34\x3c\x04\x7f\x25\xd6\x53\x02\xc4\x15\xc1\xf1\xb6\xa1\ \xec\xaf\xcc\xfa\x7a\x38\x78\x68\x6b\xb7\x21\x01\x06\xdc\xfa\xb2\ \x0a\x18\x5a\xf7\x6c\xa8\x00\x03\x6e\x43\x02\x0c\xb8\xf5\xe5\x58\ \xc0\xd0\xba\x67\x43\x05\x18\x70\x1b\x12\x60\xc0\x6d\x48\x80\x01\ \xb7\x61\x19\x38\xe0\x36\x54\x80\x01\xb7\x6e\x13\xc0\x0a\x21\x86\ \x6e\xdf\x7b\xeb\xda\x35\xee\x66\x08\x30\x80\x56\x4a\x65\x5f\x0a\ \xb0\x79\xf3\xe6\x2e\xee\x7e\x68\xde\x52\xdc\xb5\xee\x0a\x09\x86\ \x21\x60\xc0\xad\x1b\x83\xe6\x02\xa7\x24\x63\xc0\x56\xe0\x54\xe0\ \x34\x60\x07\xb0\x01\xa8\x31\x24\xda\x5a\x4c\x03\x0b\xc0\x11\xe0\ \x51\xe0\xab\xc0\xd7\xfd\xfa\x3c\xe1\xe7\x14\x57\x69\xdd\x0a\x01\ \x16\x77\xa2\xf3\xc0\x93\xc0\xb7\x70\x52\x75\x04\xa8\x12\x7e\x2a\ \x74\x68\xc7\x6a\x16\x07\x70\x03\x38\x0a\x1c\xf2\xcb\x45\xd6\x08\ \x7c\xb0\x6e\x11\xc0\x00\x4d\x60\x16\xf8\x36\x8e\x0c\xff\x07\x8c\ \x74\xf1\x18\x83\x6c\x29\x30\x87\x03\xff\x09\x9c\xa3\xe9\x6e\xec\ \xb8\x1b\xe0\x84\x64\x24\xc5\x9d\x98\xf5\xcb\x9a\xdf\xff\xd0\xfb\ \xd7\x66\x41\x05\x9a\x38\xcf\x9f\xf7\x4b\x4d\x17\xab\x81\xa1\x0d\ \x6d\x68\x83\x68\xff\x0f\x35\x0c\xec\x2e\xc0\xed\x7d\xa5\x00\x00\ \x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\ \x00\x00\x0a\x85\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x80\x00\x00\x00\x80\x08\x06\x00\x00\x00\xc3\x3e\x61\xcb\ \x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x89\x00\x00\x0b\x89\ \x01\x37\xc9\xcb\xad\x00\x00\x0a\x37\x49\x44\x41\x54\x78\x9c\xed\ \x9d\xcd\x6f\xd4\x48\x1a\xc6\x1f\x77\xa7\xc9\x07\x44\x91\x96\x15\ \x01\x36\xda\xd5\x6a\x85\xd8\x13\x87\xe5\x80\x06\x69\x0f\x5c\xb3\ \x97\xb9\xed\x81\xcb\x9e\xe6\x32\x0c\x8d\xc4\x79\xef\x1c\x01\x31\ \x7f\xc4\x5c\x98\xd3\x72\x43\xb0\x1a\x69\x25\xe6\x46\x6e\xac\x60\ \xd0\x08\x12\x14\xb4\xa4\xe9\x74\xd2\xb6\xeb\xc3\xde\x43\xe8\x8e\ \x53\x5d\xb6\xcb\x76\xd9\x71\xec\xf7\x27\x45\xb6\xab\xca\x6f\xbd\ \xae\x7a\x5c\x55\x2e\x57\x3b\x00\x41\x10\x04\x41\x10\x04\x41\x10\ \x04\x41\x10\x04\x41\x10\x04\x41\x10\x4d\xc6\x49\x8a\x7c\xf0\xe0\ \x41\x58\x95\x23\x44\x79\xf4\xfb\xfd\xd8\x7a\x9e\x4b\x3b\xf9\xf6\ \xed\xdb\x76\xbd\x21\x2a\xe5\xe1\xc3\x87\x89\xf1\x9d\x8a\xfc\x20\ \x6a\x0a\x09\xa0\xe5\x90\x00\x5a\x0e\x09\xa0\xe5\x90\x00\x5a\x0e\ \x09\xa0\xe5\x90\x00\x5a\x4e\xea\x3c\x80\x29\x6f\xdf\xbe\xc5\xb9\ \x73\xe7\x6c\x99\x3b\xc2\xc7\x8f\x1f\xc9\xb6\xc2\x70\x38\xc4\xc5\ \x8b\x17\x0b\xdb\xb1\x26\x80\xf9\xf9\x79\x9c\x3e\x7d\xda\x96\x39\ \xb2\x9d\xc2\x70\x38\xb4\x62\xc7\x9a\x00\x8e\x9b\x5b\xb7\x6e\x55\ \x9e\xe7\xa3\x47\x8f\x2a\xcf\xd3\x36\x8d\x11\x00\x00\x3c\xf8\xfe\ \xfb\xca\xf2\xea\x7f\xfb\x6d\x65\x79\x95\x49\xa3\x04\x20\x1c\xa0\ \xf3\xd5\x75\x38\xd7\xaf\xe7\x38\xdb\xec\xbd\x97\xfc\xe1\x07\xe0\ \xfd\xfb\x1c\xf6\xeb\x49\xa3\x04\xc0\x01\xf4\xae\x5e\x45\xef\x9b\ \x6f\x4a\xcb\x83\xfd\xf4\x13\x02\x12\x40\x3d\x11\x0e\xd0\xf1\x5c\ \x74\x07\x83\xf8\x44\x61\xb1\x37\xdc\x52\x08\xc8\xc4\x97\xe8\x27\ \x8b\x66\x09\x00\x40\xd7\x73\x11\x0c\x76\x8a\x19\x4a\x10\x89\x10\ \x1c\xb2\x98\xf5\x5a\xd1\x28\x01\x70\x07\xe8\xba\x2e\xe6\x76\x0a\ \x0a\x20\x01\x21\x04\x04\xb5\x00\xf5\x44\x00\x10\x9e\x07\x39\x18\ \xcc\xdc\xc5\xb6\x96\x36\x09\xc1\x21\x2c\xd9\xaa\x03\xcd\x12\x80\ \x03\x48\xcf\x85\xc8\xd3\x05\x18\x8e\x0d\xa8\x05\x88\x61\x7b\x7b\ \x7b\x66\x76\xaa\xd3\xb1\xf3\xaa\x81\x31\x86\xd1\x68\x94\x9a\x8e\ \xe3\xa0\x0b\x48\x1c\x04\x9a\x12\x23\x08\x2e\xc4\xb4\x05\x78\xf5\ \xea\x55\xa2\x09\x53\xbf\xd3\x08\x82\x60\x26\x6c\x65\x65\xa5\xb0\ \x5d\xc0\xa2\x00\x56\x57\x57\xad\xcc\x4d\xeb\xd8\xda\xda\x32\xb2\ \x2d\x1c\x40\x78\x2e\x78\xd1\x41\x60\x52\x1e\x92\x4f\x5b\x80\xcb\ \x97\x2f\x27\xa6\x35\xf5\x3b\x0f\x5b\x5b\x5b\x56\xec\x34\xab\x0b\ \x00\xc0\x3d\x0f\x9d\x69\x0b\x60\xa9\xe7\x0f\x0f\x2d\x71\x2e\xe8\ \x29\xa0\xae\x70\x07\x70\x3c\x17\x30\x6e\x01\xb2\x0b\x84\x4b\x4e\ \xf3\x00\x75\x45\x00\x70\x5c\x17\xa1\xad\x2e\x40\x33\x0e\xe0\x42\ \x60\xb6\x47\x3e\xb9\x34\x4b\x00\x0e\x10\x7a\x2e\x64\x46\x01\x64\ \x69\x07\x84\x10\x08\xa9\x05\xa8\x27\x1c\x07\x83\x40\x47\xf0\xc3\ \xc0\x82\x53\xbf\x2a\x41\xd4\x76\x03\x68\x94\x00\x84\x03\x20\x90\ \x00\x2b\x79\x98\x46\x2d\x40\x3d\x69\xd2\x0c\x5d\x55\x34\x4a\x00\ \xbc\x41\x77\x66\x55\x34\x4a\x00\xd4\x02\x64\xc7\x9a\x00\x6c\x2d\ \x52\xd4\x31\x1a\x8d\x8c\x66\xbe\xaa\x9e\xa3\x4f\xf3\xc9\xd4\xef\ \xe3\xc4\x9a\x00\x16\x16\x16\x66\xe6\xa7\x75\x73\xd8\x79\x60\x8c\ \x61\x79\x79\x39\x35\x5d\xd5\xe3\xf3\x34\x9f\x4c\xfd\x4e\x43\xf7\ \x4e\xa5\x76\xab\x82\xcb\x5c\x02\x3d\x1a\x8d\x8c\x0a\xb2\xea\x16\ \x20\xcd\x27\x53\xbf\xf3\x50\x3b\x01\xd4\x81\x9f\xff\xd1\x8c\x95\ \xba\x55\xd2\x18\x01\xe4\x59\xa3\x1f\xfd\x2d\x41\x13\xd6\xf8\xe7\ \x81\x7e\x1b\xd8\x72\x48\x00\x2d\x87\x04\xd0\x72\x48\x00\x2d\x87\ \x04\xd0\x72\x48\x00\x2d\xa7\xf6\x8f\x81\xe3\xf1\x18\x4f\x9f\x3e\ \xc5\xc6\xc6\x06\x5c\xd7\x2d\x2d\x1f\xdb\x3f\x2f\x5f\x5c\x5c\xc4\ \xb5\x6b\xd7\xb0\xbe\xbe\x8e\xa5\xa5\x25\xab\xb6\x6d\x52\xeb\x65\ \xe1\xae\xeb\xe2\xf1\xe3\xc7\xd8\x29\xf1\x97\x3e\x65\xe1\xba\x2e\ \x9e\x3f\x7f\x8e\x8d\x8d\x0d\xdc\xbc\x79\xb3\x90\xad\xd6\x2e\x0b\ \x7f\xf2\xe4\xc9\xb4\xf2\x17\x17\x17\x71\xe5\xca\x15\x9c\x3d\x7b\ \xd6\x6a\x1e\x65\x4c\xd7\x7e\xfa\xf4\x09\x2f\x5e\xbc\x00\x00\xec\ \xec\xec\xe0\xcd\x9b\x37\x58\x5f\x5f\xb7\x9a\x47\x2b\x96\x85\x3f\ \x7b\xf6\x0c\xc0\x41\xe5\xf7\xfb\x7d\xac\xad\xad\x59\xcf\xa3\xac\ \xb5\xfb\x37\x6e\xdc\xc0\xbd\x7b\xf7\x00\x00\x2f\x5f\xbe\xb4\x2e\ \x00\x5b\xd4\x7a\x10\x38\xe9\xf3\xd7\xd6\xd6\x4a\xa9\xfc\x32\x59\ \x5b\x5b\xc3\xf9\xf3\xe7\x01\x00\x9b\x9b\x9b\xc7\xec\x4d\x3c\xb5\ \x16\x00\x51\x3e\xa5\x76\x01\xa1\xa5\x15\xb9\x61\x18\x5a\xb3\x15\ \x67\xbf\x6c\x8a\xe4\xe1\x38\xe5\xbd\xe7\xb6\x26\x00\xdd\x05\xda\ \x2c\xd8\xb2\x2a\xa9\x4c\x71\x45\xed\xda\x16\x80\x2d\x9f\xad\x09\ \x40\xf7\xa8\xd2\x76\x01\xa8\xf9\xd8\xc4\xd6\x6a\xab\xca\x5a\x80\ \x3b\x77\xee\xe4\xb6\xfd\xfa\xf5\x6b\xf4\xfb\xfd\xcc\xe7\xdd\xbf\ \x7f\x3f\x35\x8d\xa9\x00\x8a\xf8\x0f\xc0\xba\xff\x95\xb5\x00\xa6\ \x4a\x0b\xc3\x70\x26\xad\xea\xe4\xfe\x5f\xbe\xcb\xe0\x5a\x7e\xba\ \x7b\x9b\x58\xf8\xef\x63\xa3\x42\xca\xd2\x02\xfc\xfe\xbb\x5f\x8a\ \xba\x66\x84\xff\x7e\x01\xdb\x3f\x5e\x9c\xfa\x15\xd7\xba\xda\x68\ \x05\x52\x05\x60\x5a\x38\xba\x82\x54\x8f\xfd\xe5\x3f\xe1\xec\x12\ \xf0\xdb\xa5\xf4\x41\x4d\x5e\x7d\xbf\x1b\x86\x60\x32\xc0\x82\x26\ \x7f\x6d\x3e\x19\x04\x30\xff\x87\x5d\x2c\x3b\xab\x58\x76\xca\xf9\ \xfe\x2f\x00\xfc\x2f\xf8\x05\x81\x18\x4f\x7d\x8b\x6e\xa3\xd8\xea\ \xba\xac\x09\x60\x30\x18\xcc\xa4\x55\x07\x2f\x9c\x4b\x5c\x3d\xdf\ \xc5\xdf\xfe\xdc\x99\xa9\x61\x5b\x3d\xe4\xfd\xff\x70\xfc\x2a\x0e\ \xee\x0c\x93\xd9\xb2\xd1\x68\x64\x7c\x8d\x82\x49\xfc\xf1\xd4\x5f\ \x71\xb5\xf7\xf7\x42\x3e\xc6\x11\x02\xf8\x97\xfb\x4f\xec\xf0\x5f\ \x01\x1c\xfa\x1f\xe7\x5f\xad\x04\xb0\xb2\xb2\x32\x33\x59\x23\xe5\ \xd1\xdf\xe8\x09\x21\xe1\x71\x07\x23\xdf\x60\xfa\x21\xe7\xb5\x31\ \x16\x40\xca\x03\x01\x4c\x26\x62\x12\xb3\x09\x43\xa3\x74\x00\x20\ \xb8\x04\xeb\x78\x70\xe7\x76\x73\x78\x66\x76\x41\x9c\x73\x48\x71\ \xd4\xff\x6e\xb7\x3b\x93\xee\xdd\xbb\x77\xf5\x12\x40\x10\x04\xa9\ \x5d\x80\xe0\x12\xae\xef\x60\xe4\x95\x37\xff\xc4\xb8\x9c\x16\xa0\ \xed\x2e\x40\x30\x09\xbf\xeb\xc2\x95\xc5\x97\x64\xc7\xe5\xc8\x38\ \x83\x50\xfc\xd7\xf9\xa7\x2b\xef\x3c\xa4\x0a\x40\xbd\x8b\xe3\x08\ \xc3\x70\x26\xad\x3a\x48\x11\x5c\xc2\x65\x1d\xec\x7a\x19\x1c\x0f\ \x63\x0f\xb4\xf8\x4c\x42\x7c\x69\x01\x4c\x06\x49\x59\x06\x53\x82\ \x05\xf0\xe7\x5c\x8c\x7b\x87\x02\xb0\xfd\x00\xc9\x38\x83\xe4\xe9\ \xfe\xeb\xca\x3b\x0f\x95\x0e\x02\x0f\x5a\x80\x2e\x76\xc7\x7a\xc7\ \x6d\x14\xa6\xcf\x82\xd2\x5a\x00\xce\x24\xfc\x9e\x8b\x7d\x31\x11\ \x80\xfd\xf9\x03\xce\xd8\x8c\xff\x27\x62\x10\x68\x22\x00\x2e\x24\ \xc6\x9e\xc4\x70\x6c\xd6\x05\xe4\xb9\x3c\x9f\xc9\xe9\x18\xc0\x7a\ \x17\xc0\x25\x3c\x3e\xc6\x3e\xff\x9c\xd3\xbb\x74\x18\x6f\xb0\x00\ \x04\x0f\xe0\xfa\x12\x43\x77\x76\x50\x93\x62\x5c\x1f\xac\x09\x63\ \x4c\x42\x0a\xa9\xcd\x5f\x6f\x3a\xe3\x18\xa0\xe7\x62\xbf\xf7\xd9\ \x20\xb5\x41\xde\x9a\x30\xd6\xe4\x16\x40\x70\x89\x7d\xaf\x83\xc1\ \x5e\x79\x3f\xe4\xf6\xca\x6c\x01\x98\x84\xdb\x1b\x63\x6f\x2e\xfb\ \x87\x28\x4d\xab\x8a\x31\x7f\x3a\x06\x38\x51\x02\x30\x7a\x0a\x10\ \x12\x63\xaf\x83\xcf\xfb\xf1\x5d\x40\xd1\x8b\xf2\x7c\x89\xa0\xc4\ \xa7\x00\x6f\x6e\x8c\x51\x27\xda\x02\x58\x7a\xe3\xf9\x65\x7b\xd0\ \x02\x38\x53\xdf\xa2\xdb\x28\x95\x3d\x05\xd8\x9c\x0a\xe6\x5c\x62\ \xdf\x73\x30\xd8\x9b\xc4\x1b\x7a\x99\x01\x9f\x49\x74\x4a\x1b\x03\ \x04\x70\xfd\x31\x46\x4e\xd6\x35\x8a\xe6\x1f\xae\xf6\x7d\x1f\x82\ \xf7\x30\x87\x43\xff\x1b\x33\x15\x2c\xb8\xc4\xbe\x0b\xec\xc4\xe5\ \x3a\x93\x55\xf6\x7e\xd4\xf7\x05\x4e\x95\xd8\x02\xb8\x18\x63\x37\ \xd4\x0b\x20\xb7\x9e\x23\xf9\xfb\x8c\x41\x8a\xee\x11\x01\xe8\x4f\ \xa9\x59\x17\x60\x2c\x80\x31\xe0\xe4\x74\x7c\xf6\xb4\x59\x3b\x9e\ \x2f\xd1\x2d\xf1\x31\x70\x1c\xec\x03\xb2\xab\xcd\x3b\x3d\xaf\xf4\ \x34\x8c\xf9\x08\xc4\xfc\xd4\xb7\x78\x5b\x15\x09\xc0\xb4\x99\x19\ \x0e\x87\x33\x0e\xa9\x53\x98\x42\x48\xec\xb9\x01\x7c\xf5\x6b\x4e\ \x16\xdf\x0b\xf8\x3c\xc4\xfc\x17\x9f\x3f\x7c\xf8\x90\x9a\x7e\x6f\ \x6f\x2f\x5b\x0b\x20\xf6\xc1\x99\xc9\xb7\x48\xf2\x5d\x05\x93\x3e\ \x9c\xd0\x07\x70\xe8\x7f\xdc\x84\x4f\x25\x5d\x80\x69\x26\x67\xce\ \x9c\xc1\x85\x0b\x17\x12\xd3\x70\x1e\x80\x1b\x7f\xc7\x25\xbf\x0c\ \x24\x24\xd0\x85\xd1\x7f\xed\x0c\xc3\xd0\xf8\xbf\x7b\x0a\x26\x71\ \xf0\xa9\x68\x2f\xb7\x6f\x46\xcc\x7f\x02\x90\xec\xff\xe6\xe6\x66\ \xfd\xc7\x00\x2a\x82\x57\xf3\x9d\x6d\xd9\x09\x80\x6e\x39\x13\x41\ \x56\x30\xd4\x76\x2d\xba\x80\x13\x29\x80\x6e\x00\x9c\x2a\x63\x10\ \xa8\xde\x71\xe5\xcc\x06\x4e\xad\x37\x55\x00\xe5\x16\x1b\x20\x51\ \xde\x53\x80\x4d\xd2\x72\x6d\x9c\x00\xb8\x28\xb1\x05\x88\x64\x2d\ \x9d\xf2\x9e\x02\xaa\xa4\x71\x02\xa8\x74\x0c\x80\x63\x1a\x03\x58\ \x6c\xde\x6a\x21\x00\xd3\x91\x66\x10\x04\x33\x69\xd5\x25\x61\x55\ \x09\x40\x74\x4f\x46\x17\x90\x46\xda\x54\xf0\x89\x7b\x0a\x58\xed\ \x6d\x9b\x79\x55\x90\xdf\xcc\x1d\xcc\xd5\xdb\x16\xc0\xe2\x38\xf9\ \x31\xd7\x36\xb5\x78\x19\x54\xe4\x5d\x80\xda\x02\x7c\xfd\xbb\x7f\ \x67\x70\xad\x38\xb6\x57\x04\x5d\x1a\x7e\x5d\xd4\xa5\x4c\x4c\xfc\ \x8a\x13\x40\xed\x5b\x80\xe8\xf1\xdd\xbb\x77\x33\xba\x76\x48\xde\ \x9f\x70\x9b\x14\x10\x63\xcc\x28\x5d\x1e\xff\x8b\xfe\xf4\x3c\x6d\ \x49\x58\xad\x06\x81\xbb\xbb\xbb\x56\x1c\xd2\x91\x65\xe9\x76\x5b\ \x6c\x03\xc5\x5f\x9d\x03\x16\xbb\x80\x4b\x97\x2e\x15\x76\x26\x0e\ \xd3\x65\xdb\x6d\xb2\x0d\x54\xf4\x2e\xa0\x4c\x05\x13\xc7\x0f\x09\ \xa0\xe5\x90\x00\x5a\x0e\x09\xa0\xe5\x90\x00\x5a\x8e\xb5\xa7\x00\ \xe2\x64\x42\x02\x68\x39\xf4\x99\xb8\x96\x93\xda\x02\x4c\xbe\xd6\ \x49\x10\x04\x41\x34\x8d\xba\xfc\xbb\xe5\xba\xf8\x51\x35\xc7\xfe\ \x8c\x9d\xa7\xe0\xab\xae\xac\x22\xf9\xd9\xf2\xb5\x48\x45\x55\x5d\ \xc9\x99\xf2\x33\x29\xa0\xbc\x69\xd4\xb0\x2a\xed\xa4\xa5\x8d\x0b\ \x8f\x2b\xbc\x2c\x85\xaa\xa6\xd5\x9d\x6b\x62\xaf\x2c\x3b\x47\x48\ \x2a\x4c\x5d\xc1\x3b\x29\xf1\xba\xad\x49\x7c\xde\xb8\xb4\x73\x74\ \xc7\x69\x02\x0a\x63\xf6\xe3\xe2\xe2\xd2\xe8\xe2\xf3\xc6\x65\x89\ \x9f\xec\x9b\x08\xc8\xe8\x0e\x71\x70\x38\x5f\xe0\xe0\xa8\x10\x8a\ \x1c\xa7\xc5\xa1\x60\xbe\x30\x08\x53\x89\x16\x5c\x68\x10\x66\x7a\ \x1c\x68\xc2\x75\x69\xb3\xda\x35\xc9\x37\x49\xd0\xa9\xf3\x00\x1d\ \x1c\x0a\x20\xba\x8d\x8a\x42\x0d\xd3\xc5\xc5\xa5\x49\xda\xc6\xa5\ \x4f\xca\x47\xfd\x8b\x0a\x28\x4e\x4c\xd1\xc2\x89\x2b\xbc\x00\xfa\ \x4a\x0a\x94\xf8\x40\x89\x53\xc3\x74\xe1\x71\x5b\x35\x2c\x29\x1f\ \xd5\xc7\xa8\xef\xd1\x34\x33\xe8\x04\xa0\xde\x29\x9d\xc8\x5f\x57\ \x09\x53\x2b\xa3\xa3\xc4\x45\xd3\xab\xe7\xea\xfe\x4c\xd2\x24\xe5\ \x67\x22\xaa\xe8\x7e\x14\xb5\xf0\x4c\x2b\x2b\xfa\xa7\x0b\xd3\xa5\ \x91\x19\xd2\x4c\xf6\x93\xf2\x0b\x63\xce\xc5\x97\xad\xf3\x25\x7c\ \xb2\x9d\x92\xd4\x02\xa8\x77\x52\x17\xe9\x95\xd2\xc5\xd1\x8a\x8c\ \x9e\x93\xb4\x6f\x9a\x4e\x15\x8b\x9a\xaf\xba\xaf\x13\xa2\x49\x0b\ \xa0\x2b\xf8\xc9\x56\x26\xec\x47\x2b\x47\x1a\xee\x9b\xa6\x8b\x56\ \xac\x4e\x10\x93\x6b\x8a\xde\xed\x61\x24\x5c\x3b\x06\xa0\x77\x01\ \x2d\x27\xa9\x05\xd0\xf5\x75\xba\xf0\xe8\xdd\x36\x39\x96\xa0\x2e\ \xa0\x0e\x5d\x80\x3a\xae\x99\x41\x27\x80\x68\x5f\x11\xad\xfc\x10\ \x47\x9b\x14\x1a\x04\xd6\x7f\x10\x18\x0d\x43\x64\x3b\x25\xed\x29\ \x60\xd2\xb7\xa8\xc7\x59\x1e\xc7\xe2\x8e\xd3\xe2\x80\xf8\x4a\x33\ \x39\x86\x41\x98\x8a\xae\xb0\x92\xc2\x4c\x8f\xd5\x9b\x28\x2e\x6d\ \x56\xbb\x26\xf9\xc6\xde\xfd\x40\x7c\x41\xe8\xe2\xd4\x82\xd3\xc5\ \xeb\xb6\x26\xf1\x79\xe3\xd2\xce\xd1\x1d\x27\x5d\x33\x70\xb4\xc0\ \xd4\xc2\xd3\xc5\xc5\xa5\xd1\xc5\xe7\x8d\xcb\x12\x3f\xd9\x4f\x8a\ \x9f\x92\x56\x18\x45\xd2\x24\x55\x42\xd9\x76\xd2\xd2\x26\xb5\x00\ \x59\xc2\x4d\xd2\xea\xce\x35\xb1\x57\x96\x1d\x82\x20\x08\x82\x20\ \x08\x82\x20\x08\x82\x20\x08\x82\x20\x08\x82\x20\x5a\xc4\xff\x01\ \x12\x7e\x4b\xc7\x19\x95\xbc\xe3\x00\x00\x00\x00\x49\x45\x4e\x44\ \xae\x42\x60\x82\ \x00\x00\x23\x98\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x80\x00\x00\x00\x80\x08\x06\x00\x00\x00\xc3\x3e\x61\xcb\ \x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x89\x00\x00\x0b\x89\ \x01\x37\xc9\xcb\xad\x00\x00\x20\x00\x49\x44\x41\x54\x78\x9c\xed\ \x9d\x79\xb4\x1d\x47\x7d\xe7\x3f\xd5\x7d\xd7\xa7\xb7\xe9\x3d\x49\ \x96\x64\x6d\x5e\xc1\x78\x85\xf1\x18\x1b\x8c\x2d\x30\x09\x66\x18\ \x8c\x71\xc6\x8e\x25\x9b\x41\x99\xe5\x9c\x31\xe7\x24\x38\x93\x85\ \x81\x1c\x07\x67\x4e\x86\xe0\x0c\x99\x68\x4e\x4e\x02\x3e\x40\x10\ \x4c\x6c\x19\x0c\x8c\x88\x87\x7d\x89\xcc\x98\x65\x0c\x38\xb2\x25\ \xdb\xf2\x22\xf3\x2c\xcb\x96\xb5\x3d\xbd\xed\xee\xdd\x55\xf3\x47\ \xf5\x52\xd5\xb7\xef\x7d\xf7\xed\xef\xc9\xfa\x9d\xf3\xde\xed\xae\ \xea\xaa\xae\xfa\x7d\xbf\xf5\xab\x5f\x55\x57\x57\xc3\x69\x39\x2d\ \xa7\xe5\xb5\x2b\x62\xa1\x0b\x30\x2f\x72\x13\x1b\xc9\xb3\x09\x00\ \x41\x3f\x70\x59\x8b\x2b\xf7\xa0\x18\x01\xa0\xc6\x10\x5f\xe7\xc5\ \x79\x29\xdf\x02\xca\xa9\x45\x80\x5b\xb8\x94\x2c\x97\xa1\xd8\x84\ \xc3\x66\x60\x13\x4e\x00\xfc\x74\x45\x32\x04\x0c\x21\xd9\x8d\x60\ \x88\x0a\xbb\x4f\x25\x62\x2c\x6d\x02\xe8\x96\x7d\x23\x0e\x9b\x11\ \x6c\xc6\xa1\x7f\x5e\xee\x2b\x19\x41\xb1\x1b\xc9\x6e\x6a\xec\x5a\ \xca\x84\x58\x7a\x04\xb8\x85\x4b\xc9\xb0\x0d\x87\x1b\x3b\x6d\xdd\ \xfd\x6b\xb2\x14\xba\x1c\xdc\xbc\xc3\xf2\xb5\x59\x1c\x21\x50\x0a\ \x14\xa0\x94\x42\x29\x00\x85\x2f\x61\xe4\x70\x1d\xaf\xa6\xa8\x97\ \x25\xe3\x47\xbd\xce\xca\x24\xd9\x83\x64\x37\x1e\x3b\xf8\x0a\x8f\ \x4f\xb7\x6a\x0b\x21\x4b\x83\x00\x37\xd3\x47\x86\x6d\xb8\x6c\xc3\ \x69\xd9\x7f\xd3\x33\x90\xe1\x8c\x73\x0a\xf4\x0d\x66\x59\x7b\x6e\ \x81\xde\x35\x39\x0a\x5d\x0e\x52\x29\x64\x00\xb4\x94\x1a\x74\xa9\ \x88\xc3\xa5\x3e\x57\x8a\xe0\x57\xa1\x82\xeb\x4a\x23\x1e\xe5\x93\ \x3e\x27\x5e\xac\x53\x3a\xe9\x71\xf2\xa5\x06\xd5\x51\xbf\x75\x59\ \x25\x7b\xf0\xd9\x81\xc7\x0e\x1e\x64\x74\x2e\xd4\x31\x9b\xb2\xb8\ \x09\x70\x13\x1b\x29\x72\x37\x2e\xdb\xd2\xa2\xf3\x45\x87\x8d\x17\ \x2f\x63\xc3\xf9\x45\xd6\x9e\x57\xa0\x7b\x20\x8b\x1f\x02\xad\x42\ \xa0\xa7\x0f\x7e\x78\xad\x4a\xfc\x55\x46\x1a\x0c\xbf\x58\xe7\xc4\ \xc1\x3a\x27\x0e\x68\x8b\xd1\x24\xba\x9b\xd8\x45\x85\xbb\x17\x73\ \x17\xb1\x38\x09\xb0\x85\x6b\x71\xb8\x13\x97\x1b\x93\x51\xf9\xa2\ \xc3\xb9\x97\x76\xf3\x86\x6b\x7b\x59\xbb\xb1\xa8\x81\x94\x0a\x05\ \xf3\x02\xbe\x92\x32\x11\xa6\x38\xf6\x5c\x8d\xe3\x07\x6a\x1c\x3f\ \x50\xc7\xaf\xa7\x90\xc1\x67\xc7\x62\x25\xc2\xe2\x22\x80\x6e\xf1\ \xdb\xd3\x80\x5f\x7f\x7e\x91\x0b\xaf\xea\xe3\xc2\x2b\x7b\xf1\x15\ \x28\x54\x47\xe0\xd7\xea\x3e\x9e\x0f\x95\x9a\x8f\x52\x50\xad\xf9\ \x51\xbf\xef\x79\x0a\xdf\xd3\xe9\x51\x90\x71\x43\x75\x68\x10\x5d\ \xd7\x41\x00\x8e\x2b\x10\x42\x20\x84\x6a\x02\x3f\x26\x0c\x48\x5f\ \x71\x74\x7f\x8d\x23\xfb\xab\x8c\xbd\x92\xe2\x3f\x2c\x42\x22\x2c\ \x0e\x02\xdc\x4c\x1f\x59\xee\x26\xc3\x9d\xc9\xa8\x8b\xae\xea\xe5\ \xca\xf7\x0c\xd2\xbf\x22\x8b\x52\xb4\x05\xdf\xf3\x15\xa5\x9a\x47\ \xb9\xea\x51\xad\xfb\x54\x6a\x32\xf0\xf4\x02\xc0\x50\xd6\x79\x78\ \x1a\x87\x29\x2b\x2c\xbc\x26\x8a\x43\x93\x21\x93\x11\x38\xae\xc0\ \x75\x45\x04\xbe\x49\x04\xdd\x4d\xf8\x1c\xfa\x55\x85\xe3\xcf\xd5\ \x9a\xeb\xeb\xb1\x9d\x06\x77\x2f\x06\x1f\x61\xe1\x09\xb0\x95\xf7\ \xe1\xb0\x23\x39\x84\xbb\xf8\xaa\x3e\xae\x7e\xef\x20\x3d\x83\xd9\ \xc8\x8c\xa7\x81\x5f\x6d\x48\xc6\x2b\x0d\x46\x4a\x0d\x6a\x75\x19\ \x01\x65\x83\x37\x73\xf0\xa3\x73\x23\x6f\xa5\x14\x99\x8c\xc0\xcd\ \x08\x9c\x8c\x88\xe2\x4c\x32\xd4\xc6\x7c\x0e\x3d\x56\xe1\xc4\xf3\ \x75\xbb\xde\x92\x11\x24\xdb\xb8\x9f\x6f\xcc\x85\x5a\x3b\x95\x85\ \x23\xc0\xcd\xf4\x91\x63\x47\xd2\xdc\x9f\x73\xc9\x32\xde\xb5\x65\ \x0d\xbd\x03\x2e\x12\x52\xc1\x6f\xf8\x92\x93\xa5\x3a\x27\x23\xd0\ \xb1\x5a\xe9\x7c\x81\x4f\x22\x2f\x27\xa3\x2d\x84\x9b\x09\x86\x99\ \x32\xb6\x0e\xb5\x71\x9f\x97\x1e\xad\x30\x7a\xa8\x61\xeb\xc1\x67\ \x17\x75\xb6\x2d\x94\x35\x58\x18\x02\xa4\xb4\xfa\xc1\x33\x73\xbc\ \x7b\xcb\x1a\x36\x9c\xdf\x85\x54\x32\x15\xfc\xf1\xaa\xc7\x70\xa9\ \xc6\xc9\x89\x40\x89\x8a\x45\x03\x7e\xb2\x1c\x6e\x56\xe0\xb8\x00\ \xc2\xb2\x0a\xe3\xaf\x36\x38\xf8\xf3\x32\x8d\x92\x8a\xf5\xb1\x80\ \xd6\x60\xfe\x09\xb0\x95\xbf\x4e\xf6\xf5\xd7\xbc\x77\x25\xd7\xdc\ \xb0\x32\x70\xdc\x9a\xc1\x1f\xaf\x79\x1c\x19\xad\x30\x51\xf5\x82\ \x49\x1b\x16\x35\xf8\x66\x98\x70\xd1\x16\x81\x20\x5e\x82\x94\x8a\ \x23\xfb\x6a\x1c\x7d\x2a\xe1\x1f\x78\x6c\xe7\x7e\x7e\x7f\x96\x34\ \xdd\x91\xcc\x1f\x01\x6e\xa6\x8f\x3c\xbb\xcd\x89\x9c\x15\x67\xe6\ \x78\xff\xbf\x5f\xc7\x19\xeb\x0b\xa9\xe0\x8f\xd5\x3c\x0e\x8f\x56\ \x99\xa8\x36\x62\xa5\xc2\x92\x01\x3f\x0a\x52\x0a\xe1\xe8\x2e\x02\ \x25\x02\x6b\x00\x95\x61\x9f\x43\xbf\x2c\x53\x1b\x93\xb1\x9e\xf4\ \xf4\xf2\x8d\xf3\xd5\x25\xcc\x0f\x01\x6e\xe1\x52\x72\xec\x36\x4d\ \xfe\xa5\x6f\xe9\xe7\x37\x6f\x3d\x83\x7c\xd1\x6d\x02\xdf\xf3\x15\ \x2f\x8d\x54\x18\x2e\xd5\x63\xa0\x96\x30\xf8\xe6\xb9\x70\x40\x38\ \x22\xea\x12\xfc\x9a\xe4\xd5\xbd\x55\x46\x5f\x32\x86\x8d\x92\x21\ \xea\xdc\x38\x1f\xd3\xca\x73\x4f\x80\x2d\x5c\x8b\xcb\xae\x10\xfc\ \x4c\x41\xf0\x9e\x2d\x6b\xb8\xe4\x2d\xfd\x28\x68\x02\xff\xc8\x78\ \x8d\xc3\xa3\x55\x7c\xa9\x4e\x2d\xf0\xcd\x3c\x01\x21\x82\xb2\x06\ \xd6\x60\xe4\x60\x83\x57\x9f\xa8\xc6\x7a\x93\x8c\x50\x67\xf3\x5c\ \x93\xc0\x9d\xcb\xcc\xb9\x8d\x0f\x92\x61\x17\x82\x02\x40\xa1\xe8\ \xf0\xef\x3e\x72\x16\x67\x5f\xd8\xdd\x04\x7e\xb5\xe1\x73\xe0\x78\ \x89\xe3\xa5\x7a\x30\x96\x3e\x45\xc1\x0f\xef\x25\x8d\x70\x09\xf9\ \x6e\x97\x65\xab\x32\x8c\x1f\x6e\xe8\x38\x41\x01\x87\x5b\xb9\x98\ \x57\xd9\x3b\x77\x24\x98\x3b\x02\xdc\xc6\x07\x71\xd9\x11\x9e\xae\ \x5e\x5f\xe0\xf6\x3f\xdc\xc8\xe0\xea\x7c\x13\xf8\xc3\xe5\x3a\xcf\ \x1f\x2f\x51\xf5\xa4\x0d\xd4\x29\x0a\xbe\x55\x36\x19\xc7\xb9\x39\ \xc1\xb2\x41\x97\xca\x88\xd4\x53\xca\x9a\x04\x37\x72\x11\x43\x73\ \x45\x82\xb9\x21\x40\x0a\xf8\xdb\xfe\x68\x13\xcb\xfa\x32\x4d\xe0\ \x1f\x1c\x29\xf3\xd2\x48\x05\x99\x54\xd0\x6b\x01\xfc\x94\x3c\xdd\ \x9c\x43\xf7\xea\x0c\xe5\xe3\x7e\xfc\x5c\x61\x0e\x49\x30\xfb\x3e\ \xc0\x16\xae\x25\xcb\xee\xf0\x34\x04\x3f\x5b\x74\x2c\xf0\x1b\x52\ \xf2\xdc\xf1\x12\xe3\x35\xaf\x19\xa8\xd7\x28\xf8\x66\xd9\xfc\x86\ \xe2\xe5\xc7\x2a\xd4\x27\x8c\x11\x42\x95\xcb\x66\xdb\x27\x70\x66\ \x33\x33\x6e\xe1\x52\x5c\x76\x85\xa7\xad\xc0\x2f\xd5\x3d\xf6\x1f\ \x9b\x38\x0d\x7e\x9b\xba\x39\x19\xc1\xda\xcb\x0a\xe4\xba\x0d\x88\ \x72\xec\xe6\x16\x2e\x9d\x09\x44\x49\x99\x3d\x0b\xa0\xc7\xf9\x43\ \xa1\xb7\x3f\x19\xf8\x9e\x34\xc1\x3b\x0d\x3e\xc9\x3c\x03\xfd\xf8\ \x9e\xe2\xf0\x9e\x2a\xf5\x52\x60\x09\x24\x43\xd4\xb8\x6c\xb6\xe6\ \x09\x66\xc7\x02\xc4\x93\x3c\xfd\xa0\xbd\xfd\xdb\xff\x70\xe3\x69\ \xf0\x67\x08\xbe\x42\x3f\x5b\x58\xf5\x86\x7c\x30\xad\x0c\x38\x6c\ \x22\x1f\x77\xb1\x33\x95\xd9\x21\x40\x8e\xed\xe1\x0c\x5f\xa1\xe8\ \xb0\xed\x8f\x37\x51\xec\x72\x4f\x83\x3f\x43\xf0\xc3\xf0\x4c\xde\ \x61\xf5\xc5\x05\x93\x04\x97\xb1\x95\xbf\x9e\x11\x66\x81\xcc\x7c\ \x14\xa0\x3d\xfe\xbb\xc3\xd3\xf7\x7c\x60\x4d\xd3\x38\xff\x34\xf8\ \xd3\x07\x3f\xbc\xc6\xc9\x09\xdc\xac\xa0\x32\x1c\xac\x47\x74\xb8\ \x92\x0b\xd9\xc3\x5e\x9e\x99\x26\x72\x41\x36\x33\x91\x9b\xd8\x88\ \x60\x7b\x78\xfa\xe6\x77\x0e\x34\xcd\xf0\x35\xa4\xe4\x85\x93\xe5\ \x19\x81\x2f\x7d\x85\xf4\x15\xc8\xc4\xb5\xd0\x9c\x67\x22\xbf\x53\ \x01\xfc\x90\xf8\xcb\x56\x65\xe8\x59\x93\x89\xf5\xef\xb0\x83\x9b\ \xd8\x38\x1d\xe8\xe2\x2c\x66\x22\x5d\xf1\x23\xdd\x33\xd6\x17\xf8\ \xcd\xdf\x5e\x6d\x81\x2f\x81\xfd\xc7\x26\x28\xd7\xfd\x69\x83\xaf\ \x82\x3f\xe9\x29\xfc\xba\x42\x7a\x7a\x8a\xf8\xb5\x06\x7e\xa8\xae\ \xe5\x9b\x72\x64\xbb\x02\xdf\xdd\xa1\x9f\xae\x78\xbe\x65\x3a\x32\ \x7d\x02\x6c\xe1\xc3\xc1\xdb\x37\xe4\x8b\x0e\xbf\x75\xc7\x99\x4d\ \xe0\xff\x7a\xb8\x34\x73\xf0\xd1\x8b\x37\x95\xaf\x17\x76\xfa\x0d\ \xf0\x6b\x9a\x10\xaf\x19\xf0\x8d\xfb\x21\x60\xf0\xbc\x7c\x8c\x83\ \xc3\x66\xb6\xf0\xe1\x69\x61\xc8\x74\x7d\x00\xbd\x86\x2f\x9a\xe3\ \xbf\xee\xb7\x56\x71\xee\xc5\x3d\x16\xf8\xc7\x4a\x35\x5e\x19\xab\ \xce\x18\x7c\x14\x48\x4f\x77\x03\x51\x9c\x04\x15\x86\x09\xc2\x27\ \x2b\xa7\x34\xf8\x4a\x01\x42\x57\xd5\xc9\xe9\xf4\xd1\x63\x64\xc1\ \x95\xbc\x8e\xcf\xf0\x14\x29\x0b\x10\xdb\xcb\xf4\x2c\x80\xf6\xfa\ \xfb\x01\xce\x3c\xaf\xc8\x15\xef\x1c\xb4\xc0\x2f\xd5\x3d\x0e\x9d\ \xac\xcc\x0a\xf8\xd1\xb9\x04\xe5\xc3\xea\xdc\x7a\x7d\x2c\x75\x77\ \xe0\x55\x15\x5e\x55\xa2\x4c\x82\x9c\x8a\xe0\x03\xf8\x71\x9e\xbd\ \xeb\xb2\x76\x57\x90\x8b\x7d\xb1\xa9\xc8\xd4\x09\xa0\x1f\xef\x6e\ \x0b\x4f\xdf\x7d\xeb\x9a\xa6\x47\xba\x43\xc3\xb1\xd3\x37\x2b\xde\ \xbe\x0c\x08\x20\xe1\xe3\xaf\xff\x5b\xee\x7d\xe3\x3f\xf2\xa6\xbe\ \xb7\x46\xa4\xf0\x1b\x50\x2f\x2b\xbc\x9a\x3c\x75\xc1\x0f\x89\x1d\ \x3c\x3c\x12\x08\xfa\xcf\xca\xc5\xb8\xb8\x6c\x9b\xce\x2c\xe1\xd4\ \x09\x60\x0c\xf9\xde\xf4\x8e\xe5\xac\x5a\x9f\xb7\xc0\x7f\x65\xb4\ \x1a\xf5\xfb\xb3\x36\xd4\x53\x31\x01\x50\x70\xf9\xf2\xab\xf9\xec\ \xe5\xff\x87\x3f\xbb\xf0\x6f\x59\x93\x5f\x8f\xf2\x75\x9c\x57\x53\ \xd4\x26\x64\xf4\xa6\xce\x29\x07\xbe\x02\xe5\xc5\xf5\xc8\xf7\xb9\ \x74\xad\x34\x7a\xf1\x69\x58\x81\xa9\x11\x40\xbf\xb1\xb3\x19\xb4\ \xe3\xb7\xf9\x86\x95\x16\xf8\x35\x4f\x72\x38\xe8\xf7\x67\x73\x9c\ \xaf\x9d\x40\x85\x94\xd2\x2a\xce\x0d\x67\x6e\xe5\x5b\x9b\x9f\xe0\ \x8f\x2e\xf8\x04\xdd\x4e\x6f\x6c\x11\xaa\x8a\xda\xb8\x7e\xa4\x7a\ \x2a\x81\x1f\x95\xc3\x03\x82\x05\x25\x3d\xeb\xb3\x88\x78\x82\x68\ \x33\x5b\xb8\x76\x2a\x90\x4e\x8d\x00\x46\xeb\xff\x97\xef\x1c\x20\ \x57\x14\xd6\x1a\xbe\xa1\xe1\xf2\xac\x83\x1f\x5b\x80\xd8\xfc\x25\ \xe5\xf6\xb3\xee\xe0\xdb\xd7\x3d\xce\x1d\xe7\x7d\x44\xfb\x06\x81\ \x7f\xd0\x28\xfb\xd4\x4b\x52\x0f\x1d\x5b\x94\x63\xc9\x81\xaf\x34\ \xc9\x95\xaf\x03\x32\x05\x41\xf7\x5a\x63\x6e\xc0\xc0\xa8\x13\xe9\ \x9c\x00\x89\xd6\x7f\xf9\x75\xfd\x4d\x0b\x38\xf5\xaa\xdd\xd9\x05\ \x1f\x45\xec\x03\xb4\x79\x29\xb7\x37\xdb\xcf\x87\x5e\xff\x51\xbe\ \xfb\x1b\x4f\xf0\xbe\xf5\x5b\xa3\xfe\x52\xd6\xb5\x35\xa8\x4f\xf8\ \xd1\x48\x62\x29\x83\x1f\x86\xcb\x46\xdc\x12\xba\xd7\x64\xa6\x6d\ \x05\x3a\x27\x80\x13\x2f\xe5\xbe\xfc\xba\xe5\xe4\x82\xc5\x9c\x4a\ \xe9\xa5\xdb\x2f\x9e\x28\xcf\x09\xf8\x5a\x09\x4a\xbf\xdc\x69\x2c\ \xa3\x6a\x25\x67\x2e\xdb\xc8\x27\x2e\xff\x34\x5f\xbb\xee\x11\x2e\ \x1f\xbc\x3a\x4a\xe7\xd5\xa1\x3a\x2a\xa9\x97\x65\x13\xc8\x4b\x0d\ \x7c\x14\xe0\xa1\x15\x0f\x08\x57\xb0\xcc\x9e\x21\x6c\x7a\xc5\xae\ \x95\x74\x46\x80\x9b\xd8\x68\xbe\xc1\xf3\xc6\xb7\xf7\x5b\xe0\x0f\ \x97\xea\xd4\x3d\x3f\xa5\x12\xed\x15\xd4\xf1\xdc\x7e\x30\xec\x53\ \xd2\xd0\xc8\x24\x72\x41\xff\x25\x7c\xe9\xed\xdf\xe2\x4b\x6f\xff\ \x26\xaf\xef\xbb\x38\xb0\x22\x7a\xc8\x58\x1d\x91\x34\x2a\xd2\x2a\ \xef\x92\x02\x3f\xf8\x91\x8d\x20\x4e\x40\xd7\x2a\xc3\x19\x74\xb9\ \xb1\xd3\x29\xe2\xce\x08\x50\x88\x19\x75\xd1\x55\xbd\x14\x96\xb9\ \x11\xf8\x0a\xc5\xab\x63\x95\xb9\x03\x3f\x48\x1b\x7a\xfa\x69\x3e\ \x40\x3b\xb9\x62\xd5\xdb\xd8\xf5\xee\x9f\xf0\x17\x6f\xfe\x34\x6b\ \xbb\x36\xe8\x19\x45\x1f\xea\x25\x45\x65\xc4\xb7\x1c\xc5\xa5\x04\ \x3e\x0a\x64\x5d\xe7\xa5\x50\xb8\x05\x41\xd1\x1c\x11\x14\xd2\xf7\ \x54\x48\x4a\x67\x04\x70\xe2\xcc\x2e\xdd\xdc\x6f\x81\x7f\x62\xa2\ \x4e\xbd\x21\xe7\x0c\xfc\xd8\x02\xd0\x51\x17\xd0\x4a\x6e\x3a\xe7\ \x36\x76\xbf\xff\x49\x7e\xf7\x92\x8f\xd2\x93\xe9\x43\x29\x3d\xc3\ \x58\x1d\xf3\xa9\x8e\xfa\xf8\x0d\x45\x2b\xa5\x2f\x46\xf0\xa3\x38\ \xe3\x9d\xd3\xa2\x69\x05\x9c\xd9\x22\x80\x7e\x8f\xaf\x1f\xa0\x77\ \x30\xc3\xea\x0d\x05\xeb\x45\xcd\x93\xa5\xda\xdc\x82\x1f\xfe\x05\ \x26\x7c\xa6\xf2\x7b\x97\x7d\x8c\x87\xff\xcd\x3e\xb6\x5d\xf0\xa1\ \x78\xd5\x4d\x1d\xaa\x23\x92\xda\x84\x6c\xf9\x8c\x61\x51\x82\xaf\ \x14\x32\x9c\xf3\x00\x72\x7d\x0e\x4e\x3e\x9a\x1d\xdc\xc4\x56\xde\ \x37\x99\x3e\x26\x27\x80\x88\xfb\xfe\x37\xbd\x63\xb9\x05\x7e\xb9\ \xe6\x31\x51\xf5\x8d\x4a\xb4\x57\xd0\xf4\x9f\xe7\xab\x60\x78\x67\ \x28\x6d\x06\xd2\x9b\xeb\xe7\xae\x37\xdf\xc3\x8f\x6f\x79\x92\x9b\ \xce\xbd\x2d\x78\x8b\x57\xe1\x55\x24\xe5\x61\x9f\x7a\xc9\xd7\x61\ \x56\xd9\xda\xd7\x0d\xe6\x1f\x7c\x00\xfc\xe0\x99\x48\x90\xbc\xb8\ \xd2\x80\x54\x34\x6f\xb4\x91\x94\x29\x11\xe0\xec\x4b\xba\x23\xf0\ \xa5\x54\x1c\x9f\xa8\x1b\x95\x68\xaf\xa0\x19\x2d\xe6\x08\x5e\xa8\ \x9c\x0d\x0b\x60\xca\xba\x9e\x8d\x7c\xea\xda\x7b\x79\xe0\x5f\x7f\ \x9b\x37\xaf\x7e\x5b\xf4\xba\x56\xbd\xa4\x89\xd0\x28\xcb\x8e\xea\ \x06\x0b\x04\x7e\xa8\xdb\x5a\x70\x8d\x48\x74\x03\x33\x26\x80\x61\ \xfe\x57\xae\xcb\xd3\x33\x98\xb1\x36\x67\x18\x2b\x37\x52\x0b\x36\ \xab\xe0\xab\xe0\xf9\xff\x0c\x7d\x80\x76\x72\xe5\xda\x6b\xf8\xf2\ \x0d\xdf\xe1\x81\x1b\xbe\xcd\xba\xee\x0d\x91\xd3\x59\x1f\x97\x94\ \x4e\x78\xd1\x33\x86\xb4\xba\xc1\xc2\x82\x8f\xd2\xce\xa0\x5e\xde\ \xab\x70\x8a\x82\x4c\xd1\x78\x48\x34\xc9\x9c\xc0\x64\x16\x60\x73\ \x78\x70\xf6\x25\xcb\x2c\xf0\x47\xcb\x8d\xd8\x24\xcf\x29\xf8\x01\ \xf0\x93\x4c\x04\xcd\x86\x5c\x75\xe6\x35\xfc\xf4\x03\xfb\xf9\xab\ \x77\xdc\x1b\x13\xc1\x83\xea\x88\xaf\x47\x0c\x8d\x44\x5d\x58\x78\ \xf0\x95\x02\x3c\x50\xbe\x8a\xda\x46\x76\xb9\xd5\x0d\x6c\x6e\x57\ \xe7\xf6\x04\x70\xe2\xc4\x1b\x2e\xee\xb2\xf6\xe4\x19\xaf\x34\xe6\ \x05\x7c\xb3\x1b\x08\x75\x33\xd7\x72\xcb\x05\x1f\xe0\x3b\x5b\x7e\ \xce\xef\x5f\xf1\x27\xf4\xe4\x7a\x51\x0a\xfc\x9a\xa2\x32\xec\x53\ \x1b\xf3\xe3\x3e\x77\x0e\xc0\x57\x12\x54\x43\xcf\xf4\xa9\xba\xc2\ \xaf\x28\x64\x39\xf8\x0b\x8e\xfd\x09\x85\x3f\x16\xfc\x8d\x2b\xfc\ \x31\x89\x77\x5c\x22\x47\x15\xfe\xa8\x22\x9b\x35\x56\xfb\x3b\xed\ \xbb\x81\xd6\x04\xb8\x99\xbe\x70\xa5\x6f\x26\x2f\x58\xb5\x2e\x1f\ \x81\xaf\x14\x8c\x55\xbc\xf9\x01\x1f\xec\x89\xa0\xf9\x60\x00\xd0\ \x97\xef\xe7\x0f\xae\xfc\x13\x7e\xfe\x3b\xfb\xb9\xe5\x82\xdb\x23\ \x4b\x54\xaf\x28\xed\x28\x4e\xd8\x8e\x62\xa7\xe0\xcb\xba\x44\x36\ \x62\x40\xbd\x00\x34\x6f\x58\xe1\x9d\x50\xf8\xc3\x0a\x6f\x0c\xfc\ \x31\xf0\xc6\x40\x96\xd0\xc0\x57\x14\xaa\x02\xb2\x82\xee\xf3\x1b\ \xda\x3a\xa9\x86\xd2\xc7\x65\x7d\x8e\x07\x99\xa2\x03\xa1\xb5\x6c\ \xb3\xb1\xa6\x8e\x6e\x25\x99\x38\xe1\xaa\xf5\x36\xf8\x95\xba\x8f\ \x34\x16\x27\xcc\x29\xf8\x41\x7c\x34\x15\x3c\xcf\xd2\x57\xe8\x67\ \xfb\xf5\x9f\xe5\xd1\xff\xb0\x9f\x77\x9d\xf3\x5e\xbd\xc3\x87\xa7\ \x1f\x3b\x97\x4f\xf8\x34\x2a\x32\x15\x7c\x59\x57\xc8\xaa\xc2\x2f\ \x2b\xbc\x31\x49\xe3\xa4\xa4\x7e\xc2\xc7\x1b\x53\xf8\xa3\x1a\x48\ \xbf\xac\x81\x94\x0d\x15\xeb\x32\xfa\x17\xbe\xb5\x13\x33\xde\xd2\ \x25\xb1\x1e\x41\xe7\x63\x5e\x9d\xe9\x32\xac\x40\x1b\x3f\xa0\x35\ \x01\x8c\xbe\x63\xed\x79\x45\x6b\x1f\xbe\xf1\x8a\x37\x6f\xe0\xeb\ \xb8\x90\x05\x66\x73\x9a\x5f\x59\xdf\xb7\x91\x1d\xef\xff\x0a\x5f\ \xbb\xf5\xbb\xbc\x65\xfd\x35\xba\x38\x3e\xd4\x46\x25\xa5\xa3\x1e\ \x8d\x71\x89\x37\x21\x69\x8c\x48\xea\x27\x24\xde\x98\xc2\x2b\x69\ \x13\xae\x1a\x68\xff\x45\x09\x92\xb0\x46\x3d\x77\xd2\xb8\x19\xd6\ \xd5\xb4\x22\x06\x1d\xe2\xd7\xba\x14\xd6\x6a\x21\x85\xb2\x09\xd0\ \xc6\x0f\x68\x4d\x00\xa3\xff\x3f\xe3\xec\x82\xa1\x7f\x45\xb9\xaa\ \x77\xb3\x98\x0f\xf0\xcd\x11\x80\x94\xf3\xd6\x03\xb4\x94\xb7\x6e\ \xb8\x86\xff\xbd\xf5\x7b\xec\xb8\xe9\x2b\xac\xcd\x6f\xa0\x31\xa1\ \x68\x8c\x2b\x4a\xc7\x3c\xca\xc3\x5e\xf4\x46\xaf\x59\xce\x64\x99\ \xe3\xfa\xc7\xfa\x02\x10\x49\x4b\x92\x48\xaf\xcc\x03\x93\x30\x82\ \xc8\x61\x55\x42\x81\x00\xb7\x60\x11\xa0\x65\x37\xd0\xce\x09\xdc\ \x14\x1e\xf4\x0e\x66\xac\x1d\x38\x6b\x75\x7f\xde\xc0\x8f\xf2\x0f\ \x46\x02\x0b\xce\x80\x40\xfe\xd5\xf9\x37\xb0\xe7\x3f\x3f\xcb\x27\ \xde\xf3\x29\xfa\x0a\x7d\xa0\xc0\xf7\xa0\x3a\x2e\xa9\x95\x25\xd2\ \x78\x0f\x82\xb4\xba\xa5\x54\xa4\xc9\x2a\x90\xd0\x65\x14\x60\xe8\ \x36\x0e\xd2\x3e\x40\x10\xec\xe4\x85\xd6\x17\x80\x68\xbd\xab\x7a\ \x3b\x0b\x10\x25\x5a\x36\x90\x8d\xc0\xaf\xd6\x7d\xfc\x10\x88\x79\ \x00\x3f\xba\x4e\x6a\x0b\xb4\xd8\xe4\x8e\xb7\xfe\x2e\x8f\xff\xf1\ \xb3\x7c\xe4\xba\xbb\xe8\xcb\xeb\x67\x0c\x5e\xb0\x06\xa1\x51\x8d\ \xe7\x0f\xc0\x34\xe3\x76\xcb\x8f\xe2\x4c\x62\x28\xf3\xfa\xe8\x2a\ \x2b\x9f\x64\x3a\xe5\xab\xa8\x97\x71\x97\x89\x38\x61\x1b\x47\x30\ \x9d\x00\xc6\xe2\xc2\xd5\xe7\x16\x22\xf0\xa5\x52\x34\xbc\xd9\xdd\ \x7e\x75\x32\xf0\x15\xc4\x23\x80\x79\x1c\x05\x4c\x45\xfa\x8a\xfd\ \xfc\x97\xdf\xb8\x8b\xff\xfb\xe1\x5f\xb0\xf5\x5f\x7c\x00\x11\xd4\ \xb3\x51\x55\x54\xc7\x25\x5e\x5d\xda\x2d\x38\x51\x87\xd4\x96\x6f\ \xc4\x0b\x23\x9d\x6a\x93\x2e\x7c\x30\x24\x02\xeb\x6f\x75\x03\x2d\ \x1e\x0f\xa7\x13\xc0\x35\xb6\x6d\x55\xc6\xee\xda\x0a\xaa\xf5\x78\ \x7a\x74\x3e\xc0\x8f\xee\xa5\x16\x87\x0f\xd0\x4e\x36\x0c\x6c\xe2\ \xd3\xbf\xfd\x79\x1e\xff\xe8\xb3\x5c\x7d\xf6\x35\x51\x99\xeb\x65\ \x45\x75\xc2\xc7\xf7\x74\xe9\xcd\x77\xf2\xad\x7a\x43\xac\x27\xf3\ \x9a\x10\xe0\xb4\x74\x66\xa8\x10\x7a\x07\x32\x42\x33\x60\x24\xc8\ \xa7\x77\x03\xe9\x04\x30\xcc\xff\xea\x73\x0a\xd6\x96\xeb\xe1\xd6\ \xac\xf3\x0d\xfe\x62\xb6\x00\x49\xd9\x38\xb0\x89\x6f\xde\xf1\x03\ \xbe\x79\xc7\xf7\xb9\xfa\x9c\x6b\x50\xe8\x35\x8a\xb5\x92\x4f\xb5\ \xe4\x47\xfe\x81\xd5\x25\x08\xa2\xba\x05\xb3\xba\x3a\x2e\xad\xe5\ \xc7\x5c\x21\x4e\x21\xc0\x78\x26\xa0\x84\x4a\x3a\x82\xa9\x9f\xd3\ \x49\x27\x80\x8a\x09\xa0\x88\xc1\xd7\x4b\xb3\xd4\xbc\x82\x1f\x85\ \xcd\xd2\x93\xc0\xf9\x94\xb7\x9d\x7b\x2d\xdf\xfa\xd0\x0f\xf8\xcc\ \xad\x9f\x63\xc3\xf2\x8d\xa0\xb4\xa3\x58\x19\x97\xd4\x2a\xe1\x3b\ \x0c\x09\x34\x0d\xb0\xd3\xe6\x06\x9a\xc0\x57\xa2\x39\x5d\x70\x24\ \x8c\x55\x62\xb4\xf8\x52\xda\xa4\x4f\x03\x2d\xf0\x15\x34\xbc\xf9\ \x05\x5f\x0f\x03\x8d\x67\x02\x4b\x50\x6e\xbb\xe2\x83\x3c\xf9\xa7\ \xcf\xf3\xd1\xeb\xef\xd2\x23\x06\xc0\xaf\x2b\xaa\x13\x92\x46\x4d\ \x5a\x4f\x39\xa3\xfa\x87\x66\xdf\x20\x7d\x93\xbe\x0d\xb1\xc0\x17\ \x98\x53\x0e\x6d\x65\x52\x02\xe8\x39\x80\xf8\x4b\x1b\x9e\x97\x78\ \x44\x1a\xde\x7d\x8e\xc0\x0f\x6b\x37\x97\x4f\x03\xe7\x4b\x3e\x76\ \xfd\x9f\x46\x44\xd0\x96\x55\xe9\x97\x59\x4a\xb6\xa3\x18\x4d\x25\ \x1b\x69\xcd\xe3\x24\xae\x4d\xe0\x87\x17\x75\xb0\xde\xab\xd5\x25\ \x51\x7f\xa1\x9f\xff\xc7\x8e\xe0\x82\x80\xaf\x88\xf6\xd3\x53\x84\ \xf9\x2d\xcd\xbf\xbe\x62\x1f\x1f\xbb\xfe\x2e\x9e\xfa\xf8\xf3\xdc\ \x76\xc5\xbf\x8d\xf4\x51\xaf\x2a\xaa\x25\x1f\xdf\x58\xdc\x11\x61\ \xa0\xec\x80\x34\x62\x44\xa4\x09\x81\x0f\x87\x82\x93\x48\x26\x35\ \xd4\x18\x37\x26\xbf\xb1\xb3\x10\xe0\xab\xa0\x0c\x28\x90\x52\x36\ \xbd\x21\xb4\x14\x65\x5d\xff\x7a\x3e\xbd\xe5\xb3\x5c\x7d\xce\xdb\ \xf8\x4f\xf7\xfd\x47\x5d\x37\x5f\x51\x2b\xfb\x64\xf3\x02\x37\x13\ \xb4\x4d\x65\xf9\x87\x2d\xfc\x01\x83\x34\xa1\x4b\x10\x76\x03\x93\ \x48\x3a\x01\x0c\x09\x95\x1f\x7e\x60\x69\xde\x5b\x7e\x60\xfe\x09\ \x86\x80\xd2\xf7\xf1\xfd\x39\x5e\x18\x30\x0f\x72\x70\xf8\x45\x3e\ \xf9\xdd\xff\xc6\xfd\x8f\xfe\x03\xa0\x41\x14\x0e\x64\xf3\x0e\x8e\ \x13\x3b\x76\x20\xd2\xfd\x01\x1d\xd5\x3c\x4a\x30\xbb\x80\x69\x13\ \x20\xfc\x7e\x2e\x44\x4e\x98\x54\xfa\x23\x4b\xf3\x0e\x7e\x22\x9d\ \xef\xcb\x25\x4d\x80\xd1\xca\x28\xf7\x3e\xf2\x77\xdc\xf3\xbd\x4f\ \x44\x80\x0a\x01\xd9\xbc\x20\x93\x71\x0c\xfd\x06\x7b\x1e\x24\xfd\ \x01\xe3\xd8\x1a\x25\x84\x61\x01\xf0\x69\x53\xcd\x69\xd2\x8a\x00\ \x7b\x40\x2f\x24\x08\x1d\xc0\x88\x7d\xf3\x0d\x3e\x21\x09\xf5\xb1\ \x94\x4b\x97\x00\xff\xfd\x07\x9f\xe4\xde\x47\x3e\xcd\x68\x25\xde\ \xe2\x2f\x93\x17\x64\x72\x22\x18\xfb\x0b\xdb\xdc\x8b\x04\xf8\x04\ \x00\x87\xc4\xa0\x85\x55\x40\xe9\x3d\x33\xd2\x3e\x61\x97\x90\x49\ \xbb\x80\x93\xaf\x34\x18\xd8\x98\xd7\xe6\x3f\xbc\xf9\x3c\x83\x1f\ \x87\x2b\x7c\x6f\xe9\x75\x01\x5f\x79\x6c\x27\x9f\xfa\xe1\x3d\x1c\ \x1c\x79\x29\xd2\x8b\x9b\x15\xe4\x8a\x51\x73\x8d\x24\xf6\xb1\x5a\ \xb4\xfc\x64\x5c\x84\x09\x1a\x4d\xa1\xc1\x47\x05\x6b\x05\x27\x91\ \x49\x09\x50\xaf\xc8\xa6\x8f\x2a\x2e\x04\xf8\xca\x53\x48\x7f\x69\ \x75\x01\x3f\x1b\xfa\x29\x7f\xf5\xa3\xbf\xe4\x67\x43\x3f\x89\x74\ \xe2\x64\x04\xb9\x62\xd0\xcf\x27\x5b\x77\xa4\x0a\xc3\xb4\xc7\xea\ \x69\x8e\x0b\x0e\xc2\x63\x91\x25\x76\x02\x1d\x66\xe0\x03\x98\x85\ \x62\x81\xc1\x97\x7a\xac\xec\x07\x2b\x5e\x96\x82\x13\x78\x68\xe4\ \x25\xfe\xe0\x1b\x1f\xe6\x67\x43\x3f\x8d\x81\x77\x21\x5b\x74\x71\ \x33\x71\x8b\xb7\x00\x4e\x82\x9f\x34\xed\xc4\xfa\x6a\x8a\x0b\xff\ \x39\x80\x10\x46\x17\x62\x14\x4a\x30\x94\x56\xd6\x56\x3e\xc0\xee\ \xf0\x70\xf4\x68\xc3\xfa\x9c\x2a\x02\x6b\x8f\xfb\xb9\x04\x5f\xfa\ \x8a\x46\x59\x45\x6f\xeb\x00\xf8\x8b\xd8\x07\x38\x34\xf2\x12\xff\ \xf3\xc7\xff\x83\xaf\x3e\xfe\x95\x38\x50\x40\xae\xcb\x21\x93\x73\ \x6c\x53\x6f\xc4\x87\x13\x5c\xa9\x0f\x7d\xa2\xdf\xe6\x38\x54\xd8\ \x03\x04\xfa\xc9\x63\xce\x0c\xe3\x8f\x19\x57\xcb\xa9\x10\xc0\x90\ \x46\x29\x9e\xb3\x96\x0a\x5c\x57\xd0\x98\x87\x0d\x99\xbc\xba\xde\ \x00\x8a\x44\x1a\xb9\x08\xbb\x80\xb1\xea\x18\x3b\x7e\xf1\x79\xbe\ \xf0\x8b\xbf\x67\xac\xaa\x1d\x3c\x21\x20\x5b\x70\xc8\x16\x04\xa2\ \x69\x19\x18\xb6\xbe\x20\x76\xf8\xda\xb5\x7c\xf3\xa6\x49\x4b\x09\ \x90\x33\xe6\x0c\x92\xc3\x40\x3f\x1e\xd9\x99\x92\x4e\x80\x9d\x3c\ \x8c\x9e\xa4\x62\xf4\xd5\x86\x35\x12\x88\x9e\x54\xcd\x11\xf8\xfa\ \x15\x6e\x85\x6c\xe8\x25\x52\x56\x7a\x40\xca\xc5\xd5\x05\x7c\xf1\ \x97\x5f\xe0\x6f\x7e\xb2\x9d\xf1\xea\x78\xd4\x4a\x33\x79\x41\xbe\ \xe8\x20\x9c\xd8\xc9\x6b\x3f\xb7\x6f\x80\x08\xb6\xde\x8c\xfe\x42\ \x98\x71\x34\x13\x43\x14\x0c\x0b\x20\x14\x72\x4c\xc5\x24\x68\xf1\ \x9d\x81\xd6\x16\x40\x32\x82\x43\xbf\x57\xb3\xbf\xa2\xed\xb8\x0e\ \x28\x7f\x6e\xc0\xf7\x15\x8d\x8a\x8a\x5e\x00\x89\xd3\x1b\x5d\xc0\ \x22\xb1\x00\x3f\x7c\xfe\xfb\xfc\xc5\x3f\xfd\x39\x2f\x8f\xbe\x1c\ \x85\xb9\x59\x41\xbe\xdb\xc5\x75\x85\x5d\xb7\x24\xc0\x24\xe2\x48\ \x58\x05\xec\x74\xa6\xb4\xea\x12\x94\x02\x8a\x22\x8a\x0b\xb7\x90\ \x01\x5a\x9a\x7f\x68\xdf\x05\xec\x21\x78\x33\xe8\xc4\x50\x9d\xe5\ \x1b\x72\x9a\x00\x62\x6e\x5a\xbe\xf4\x15\x5e\x39\x1e\xef\xc7\x3e\ \x86\xb2\xd2\x2c\xf4\x3c\xc0\x2f\x0e\x3d\xca\xdf\xfd\xec\x6f\xf8\ \xc5\xa1\x47\x83\x82\xea\x8f\x43\x16\x7b\x5d\xdc\xac\x63\x58\xc7\ \x20\xda\x6c\xa5\x49\xb3\x9f\x66\x15\x52\x8e\x92\x21\xc9\x96\xaf\ \x00\x96\x05\xc7\x42\x87\xca\x32\x66\x17\x30\xd4\xaa\x3e\xed\x2c\ \xc0\x9e\x70\x65\xf0\xd8\x91\x06\xfd\xeb\x03\x02\xb8\xcc\x3e\xf8\ \x0d\x6d\xf6\x55\x22\x4f\x4b\x09\x41\xe4\x42\x59\x80\x57\xc6\x5e\ \xe6\x2f\x7f\xfc\x49\xfe\xe9\x85\x1f\x06\xe5\x01\x1c\x28\xf4\xb8\ \xe4\x8a\x4e\xa2\xc5\x13\x4f\xd3\x62\xd4\x22\x74\xf8\x68\x6e\xc1\ \xf6\x71\x8b\x96\xaf\x9a\xd3\x85\xf7\xd4\xe6\x5f\x45\xd3\x0a\x09\ \x07\x70\x77\xab\x7a\xb5\x26\x80\x60\x4f\x78\x38\x76\x44\x7f\xb2\ \x55\x49\x19\x8d\x5f\xa3\x9b\xcf\x10\x7c\xbf\x91\x70\xf6\x12\x4a\ \x88\x8c\x40\x64\x01\xe6\xd7\x07\x18\xaf\x8d\xf3\xa9\x47\xee\xe1\ \xa1\xa7\x8d\xcf\xfa\x0a\xc8\x77\x3b\xe4\xba\x1c\x84\xb0\xc7\xf3\ \xd3\x6d\xf9\x41\xb6\xa9\x0e\x5f\x6a\x57\x62\xea\x4a\x01\xdd\x80\ \x31\xd0\x90\x25\x2b\xf3\x3d\xb4\x90\xd6\x04\xa8\xb0\x9b\x6e\x7d\ \x38\xfc\x62\x1d\x25\x65\x04\x84\x9b\x11\x78\x8d\xd0\x34\xcf\x12\ \xf8\xa1\x12\x8c\x3c\x23\xe5\x19\x7f\xf3\x35\x0a\x18\xaf\x8d\xb3\ \x73\xef\x7d\xec\x7c\xe2\x3e\x26\x6a\xe3\x51\x11\x73\x45\x41\xbe\ \xc7\xb5\x1e\xd8\x24\x01\xe9\xc4\xe1\x8b\x23\xe2\xdf\x8e\xe6\x00\ \xcc\x70\x83\x18\xa2\x1b\x94\x31\xda\x90\x13\xc6\x3d\xaa\xd3\x21\ \xc0\xd7\x79\x91\xdb\x19\xc2\x61\x53\x75\xcc\xa7\x3c\xea\x53\xe8\ \x71\x63\x02\xcc\x70\x13\xc6\x26\xf0\x13\xe9\x94\x15\x16\xe7\x31\ \x1f\xf3\x00\xdf\x7c\xf6\x21\x3e\xf7\xab\x7b\x79\x65\xfc\x70\x54\ \xb6\x4c\x5e\x50\xec\x73\xa3\x4f\xc3\x5b\x75\xc3\xac\x86\x41\x5e\ \x52\xe2\x8c\x40\x91\x12\xa7\xc0\x9e\xde\x4d\xc6\x91\x24\x88\x82\ \x5e\xc0\x8d\xc1\xf7\x4b\x0a\xc2\x69\x60\xc9\x10\x5f\xe7\xc5\x56\ \x75\x6d\x3f\x0f\xa0\x27\x84\xb6\x01\x9c\x3c\x58\x67\xf5\x1b\x8a\ \x28\xa5\x70\x5c\x31\xb3\x3e\xdf\x53\xf8\xb5\xf8\xd5\xa6\x54\x25\ \x34\x97\x45\xd7\x67\x0e\x67\x02\x1f\x3b\xfc\x2b\xfe\xfc\xc7\xff\ \x95\x57\x43\xe0\xd1\x3e\x4f\xb1\x3f\x43\xb6\xa0\x87\x74\x56\xdd\ \xc2\xa2\xb5\x00\x2a\x8a\x33\x5a\xb7\x29\x2d\x2d\x86\x95\x77\x4a\ \xcb\x8f\xae\xd1\x17\x8a\xde\x38\x4e\x01\x72\xd4\x62\xc8\xee\x76\ \x75\x9e\x6c\x22\x68\x37\x01\x01\x8e\x3d\x57\xe3\x8c\x0b\x0a\x28\ \x09\x6e\xb8\xdc\x78\x1a\xe0\x2b\x5f\x4f\xed\xc6\xe6\xcb\x48\x67\ \xd4\x52\x28\x61\xa5\x0f\xf3\x98\x0b\x0b\xf0\xcf\xaf\x3e\xc6\x17\ \xf6\x7c\x9e\x7f\x3e\xfc\x58\x14\x26\x04\x14\xfa\x5c\x0a\xdd\xae\ \x5d\xc6\xb8\x88\xf1\x6f\xda\x73\x79\xcc\x96\xda\x6c\xd3\x27\xb5\ \x18\x06\x69\x2c\xa2\x99\x84\x0a\xf4\x22\xfa\x62\xf0\x01\x94\x4d\ \x80\x5d\xb4\x91\xf6\x04\xa8\xb3\x8b\xa2\x3e\x3c\x7e\xa0\x4e\xa3\ \x22\x71\x73\x1a\x18\xd7\x15\xc6\x8e\xe0\x74\x06\x7e\x30\xc9\x43\ \x62\xa8\x17\x83\x2f\x02\xf0\x13\xad\xca\x38\x9f\x4d\x1f\xe0\xd5\ \x89\xc3\xec\x78\xfc\xef\xf9\xce\x81\x6f\x47\xe5\x06\x28\xf6\xbb\ \xe4\xbb\xf5\x44\x4e\x6a\xdd\x30\xca\x4f\xa2\x95\xa6\x35\x55\xeb\ \xbc\x75\xeb\xb6\xf2\x34\x89\x61\xe8\x33\x09\x7e\x68\xfe\xa3\x3c\ \x3d\x85\x1c\x36\x32\x6c\xcc\xc4\x02\x3c\xc8\x28\xb7\xb3\x27\x5c\ \x22\x76\xfc\x40\x9d\x55\xaf\xcf\x6b\x2b\x10\xf9\x01\x34\x2b\xa8\ \x0d\xf8\xc9\x71\xbe\x0a\x81\x37\x34\x91\x54\x90\x69\x02\x66\x63\ \x1e\x60\xa2\x3e\xc1\x17\xf7\x7e\x81\xaf\x3d\xfd\x55\x2b\x3c\xdf\ \xed\x50\xec\x73\x71\x32\xf6\x07\x28\x4c\xf3\x1d\xb7\xce\xf0\xbc\ \x19\xe0\xb8\x39\x26\x5a\xb7\x09\x68\xd2\xec\x93\xa8\x77\x27\xe0\ \x2b\x10\x03\x76\x59\xfc\x61\x23\x43\x9f\x5d\x93\x7d\x5f\x70\xd2\ \x67\x01\x28\xb6\x83\xfe\x2e\xcd\xf1\x03\x35\x56\x9e\x9f\xd7\x7e\ \x40\xc6\xf0\x82\x27\x01\x1f\xa5\x97\x41\xc7\x63\xe0\x58\x44\xe2\ \x3c\x8d\x50\xe6\xaf\x3f\x43\x1f\xe0\x7f\xed\xfb\x22\x5f\x7b\xe6\ \xab\x94\xea\xa5\x28\x2c\x53\x10\x74\xf5\xbb\x64\x0b\x4e\xba\x53\ \x67\x96\x2d\x19\x67\x14\xbe\xa5\x53\x17\x86\x25\x17\x73\x18\x89\ \x92\xd6\xb0\x13\xf0\xc9\x02\x7d\xc2\xba\x9f\x3c\x6e\xde\xb1\xbd\ \xf9\x87\x4e\x08\x60\x74\x03\x27\x5e\xa8\x53\x1d\xf7\xc9\x2d\xd3\ \x0b\x16\x1d\x57\xe0\xf9\x31\xaa\xad\xc0\x97\x9e\x42\x1a\x6f\xae\ \x62\x55\xca\x38\x36\xcc\x9f\x1e\x13\x87\xf9\xc4\xc7\xd3\xb5\x00\ \xdf\x1f\xfa\x1e\xff\xb0\xef\x4b\x1c\x29\x1d\x89\xc2\x9c\x0c\x2c\ \x5b\x91\x21\xd7\xe5\xd8\xad\x3a\x49\x42\x8c\xb8\xe8\xd7\x52\xb4\ \x9d\x2e\x09\x7e\xbb\x96\x3f\x4d\xf0\x55\xd0\xfa\xcd\xb2\xa8\x9a\ \x42\x9d\x34\x0a\x54\x9f\x0d\x02\x3c\xc8\x28\xb7\xb1\x2b\xdc\x2b\ \xf8\xc8\x53\x55\xd6\x5d\xde\x65\x74\x03\xc9\x4a\x84\xca\x08\x0a\ \x2c\x15\x5e\xb8\x34\x49\x85\xce\x9d\x5d\x51\xdb\x4c\xaa\xf8\x21\ \x90\x11\x1f\x5e\x33\xd5\x99\xc0\x27\x8e\x3d\xc1\x67\x1f\xff\x0c\ \x2f\x8c\x1c\x20\xec\x6a\x84\x03\x5d\x03\x2e\x85\x3e\xb7\x89\x88\ \x56\x1f\xdc\x34\x1c\x8b\x0b\x65\x95\x91\x44\x3a\x8c\xba\x19\xe9\ \x92\xfe\xcc\x4c\xc0\xc7\x05\x56\xd9\xf7\xf3\x63\x6e\x83\xcf\x8e\ \x4e\x3e\x2f\x3b\x39\x01\x00\x24\xdb\x43\x02\x1c\xdd\x5f\xe3\xcc\ \x37\x75\xa1\x94\x42\xb8\xc1\xf2\x80\x56\xe0\x2b\xbd\x0b\xa7\xe5\ \xd1\x87\x05\x0e\xd6\x15\x58\xca\x4a\x9b\x03\xb0\xa3\x3a\x9e\x09\ \x7c\x61\xe4\x05\x3e\xb7\xf7\x5e\xf6\x1e\xdf\x6b\xb1\xa9\xb8\xdc\ \xa5\x6b\x20\x13\xbd\x41\x6b\xde\x2f\xb6\x00\x31\x72\x26\x11\x9b\ \x66\xea\x0c\x0b\xa5\x4f\x13\xad\x9b\x44\x9e\xb3\x05\x3e\x20\x56\ \x12\xbd\xfc\x19\x66\x29\x5f\x31\x6e\x2c\x3b\xfb\x9c\x5c\x67\x04\ \xd8\xc9\xc3\xe1\xa4\x50\x6d\x42\x72\xf4\x99\x2a\x2b\xce\xcb\xa3\ \xa4\xc2\xc9\x0a\xa4\x35\x8f\x1f\x17\x58\x7a\xfa\xc9\x5e\x53\x0b\ \xb0\x34\x13\x3e\xf6\x35\x94\x97\x6c\x71\x01\x03\x14\x93\x8f\x02\ \x8e\x96\x8f\xf0\xc0\xfe\x9d\xfc\xe8\xa5\x1f\x5a\xe1\xb9\x6e\x87\ \xee\x95\x59\x3d\x91\x63\x30\xcb\x6a\xdd\x46\x39\xc2\x30\xb3\xa5\ \x4f\xfb\x91\xee\x2c\x83\x8f\x03\xac\xb2\x75\x24\x8f\xaa\x78\x63\ \x28\xc9\x10\x3b\x79\xb8\xa5\x92\x0c\xe9\x8c\x00\xfa\x4e\x77\x13\ \x38\x83\x87\x7e\x55\x61\xf0\x9c\xf0\xe1\x90\x88\xb4\x64\xad\xe1\ \x53\xfa\x99\x7e\x52\x09\x51\xa9\x2d\xa0\x8d\x56\x15\x5e\x12\xd5\ \x4c\x67\x68\x8d\x28\x4c\x04\x02\x29\x35\x26\x78\xe8\x85\x87\xf8\ \xf2\x33\x3b\xa3\x7b\x28\xf4\x6a\x9c\x65\x2b\x32\x64\x8b\x4e\x94\ \xde\xb4\x2e\xe6\xbd\x3a\x9e\xa9\x33\xaa\x01\xd8\xab\x77\xcd\xbc\ \xe7\x02\x7c\x05\xac\x54\xf6\xd0\x0f\xf0\x0f\x5a\x65\xbf\xbb\x49\ \x41\x2d\xa4\x73\x02\xdc\xc7\x17\xb9\x5d\x7f\x2e\xae\x3e\x21\x39\ \xf6\x7c\x8d\xc1\xb3\xf2\xda\x19\x71\x04\xd2\x4f\xbc\x33\xe8\x25\ \x2a\x1a\x17\xce\x6e\x55\xa1\x49\x35\x49\xa1\x12\xe6\xd6\xac\x69\ \x8a\x3c\x74\xe0\x1f\x79\xe0\x99\x9d\x94\x1a\xb1\x67\xef\x64\x05\ \x3d\x2b\x32\x14\xfb\xdc\x26\x30\xcc\xac\xec\xf6\x6e\xcb\x94\x5a\ \xbe\x05\x9e\x7d\xbf\xd9\x04\x5f\x65\x15\xe2\x0c\xbb\xfc\xfe\x51\ \x45\xf4\xc5\x40\xc9\x10\xf7\xf1\xc5\x74\x4d\x35\x4b\xe7\x04\xd0\ \x99\x6f\xc7\xd1\xec\x7a\xe5\x57\x55\x06\x36\xe9\x39\x01\xc7\xd5\ \x9f\x6e\x33\x2b\xe7\x7b\x91\xaa\x9a\xb2\xb1\x14\x84\x51\xf9\x50\ \x04\xf6\x26\x8c\x60\x29\x3f\x94\x1f\x1d\xfc\x21\x0f\xec\xdf\xc9\ \xd1\xf2\xd1\x38\xa9\x03\x5d\x83\x19\xba\x57\x66\xac\xbc\x53\x3d\ \x7a\x65\x87\x58\x23\x8f\x28\xc6\x2e\x87\x95\xe7\x7c\x83\xaf\x14\ \x62\x3d\xd6\xbc\xbf\x02\xd4\x34\x5b\x3f\x4c\x95\x00\x0d\xb6\xe3\ \xb0\x0d\x87\x4d\xf5\x92\xe4\xc4\x73\x35\x96\x9f\x9d\x43\xa1\x34\ \x09\x82\x3e\x48\x7a\x61\xc9\x4c\x04\x13\x4a\x48\x10\xc3\x52\x7e\ \x62\x07\xce\xe8\x2f\x90\x7d\xc7\xf7\xf2\xc0\xfe\x9d\xec\x3b\xbe\ \xcf\xca\xa3\x6b\xd0\xa5\x7b\x65\x06\x11\xae\xc8\x89\x6e\x1d\xa3\ \x1a\xe5\x89\x6d\x65\xd2\xc8\x96\xea\xf0\x99\x0b\x38\xe7\x19\x7c\ \xba\x81\x7e\x1b\x7c\xf9\xca\xf4\x5b\x3f\x4c\xf5\xd3\xb1\x4f\x51\ \xe3\x62\x46\xc2\xed\x47\x27\x8e\x78\x0c\x9e\x9b\xc3\x11\x02\x84\ \xd0\x9b\x47\x4a\xdd\xf7\x93\xa8\xa8\x59\xa1\xa6\xbe\xd6\x8c\x33\ \x95\x1e\xfc\xd6\xc6\x25\xb5\x71\x3d\x64\xd8\x77\x7c\x1f\x0f\x1d\ \x78\xc8\x6a\xf5\x85\x5e\x87\x81\x4d\x39\x0a\xfd\xae\x7e\x3e\x0f\ \x4d\x60\x84\x12\x39\xff\x09\x12\x46\xd7\x47\xe7\x41\x39\x0c\xf2\ \x2d\x28\xf8\x0e\x88\xf3\x80\x8c\x88\xdb\x84\xa7\x50\x4f\x1b\x85\ \x96\xdc\xc9\xde\xf4\xb5\x7f\xad\x64\xea\xdf\x0e\xde\xcb\xe3\x5c\ \xcc\x8d\x08\x56\xab\x60\xd7\xcc\x9e\xd5\xd9\x68\x96\xcf\x6f\x10\ \xad\x47\x33\xdb\x78\x74\xac\x94\xb5\xb0\xd4\x6e\x79\x2a\x71\xae\ \xe3\x4d\x02\x98\xfd\x7c\xa6\x28\x58\xbe\x21\x47\xf7\xaa\xb8\xd5\ \x9b\xe9\xc2\x80\xa6\x3d\x79\x48\x01\xdf\xfa\x4d\x00\xcc\x02\x83\ \xaf\x40\x6c\x04\x7a\x0d\xf0\x95\x42\xbe\xa8\x60\x2c\xb8\x56\xb2\ \x87\xfb\xb8\x83\x29\xca\xf4\xbe\x1d\xec\xc7\xdf\x10\x3a\xfe\x6c\ \x9d\xf1\x60\xc5\x90\x7e\x5c\x1a\x95\xdd\xa8\x44\x54\x6a\x1d\x64\ \x1b\x80\x20\xac\xd9\x62\xe8\x07\xb0\xc6\x42\xc7\x60\x04\xe0\xe4\ \x04\xfd\x1b\xb2\xac\x7a\x5d\x81\x5c\xb7\x63\x03\x65\xdd\x38\xe5\ \xd5\x6a\x5a\xb4\xfc\x28\xfd\xe2\x03\x9f\x41\x60\x85\x0d\xbe\x1a\ \x53\x10\x3f\xb5\xb6\x30\x99\x8a\x4c\x8f\x00\x3b\x79\x18\x3f\x9e\ \x68\x38\xf4\x68\x19\xaf\x16\xae\x44\x35\x18\x60\x00\x19\x1e\x34\ \x11\x03\x52\x36\x81\x0e\x97\x53\x8b\x00\xf8\x20\xb9\x0b\x3d\x6b\ \xb2\xac\x7a\x5d\x9e\xae\x81\x0c\xd1\xe2\xd4\x38\xcb\xe0\x20\xa5\ \x75\xa7\xb5\xfc\x84\xd2\x17\x25\xf8\x45\x60\x83\xa1\x4e\xa5\xc0\ \x57\xa8\xe7\x0c\x75\x79\x6c\xef\x74\xdc\x9f\x94\xe9\x11\x00\xa0\ \xce\x9d\x48\xfd\xb2\x41\xa3\xac\x38\xfa\x54\x35\xfe\xc4\x7b\x30\ \x35\x10\x4a\xda\x50\x4f\x25\xe2\xf4\xd4\x5c\xb0\xab\x81\xa9\x20\ \xf4\x71\xd7\x80\xcb\x9a\x8b\x8a\xf4\xae\xc9\x46\x0b\x52\x2c\xce\ \x10\xde\x33\x4e\xa3\xcc\x5f\xf3\x5e\x29\x4a\x5f\x8c\xe0\x2b\x17\ \x38\x8b\x68\xcc\xaf\x82\x8b\xe5\x41\x6c\xc7\xaf\x31\x35\xcf\xdf\ \x94\xa9\xfb\x00\xa1\x3c\x45\x8d\x8b\xd8\x8f\xc3\xad\x00\x95\x93\ \x3e\xf9\x1e\x87\x6c\x97\xd3\xac\x04\xac\x46\x69\x59\x01\x11\xbf\ \xd0\x6e\x5f\x23\xe2\x74\xf9\x5e\x97\x42\x7f\x26\x78\xd1\x22\x26\ \x86\x50\x89\xfe\x3d\x69\xda\xc1\x06\x2a\x3a\xc6\xba\xdf\xa2\x04\ \x5f\x81\x38\x1f\xe8\xb6\xc1\x57\xc3\xd8\x8b\xbc\x3d\x6e\xe4\xcb\ \x3c\x93\x06\x51\x27\x32\x7d\x02\x00\xec\xe5\x19\x2e\xa4\x1f\x87\ \x2b\x01\x4a\xc7\x3c\x7a\xd7\x04\x40\x19\x2d\xd8\x04\xdc\xac\xac\ \x19\x67\x5d\x83\xa1\x3c\x12\x69\x4c\x96\x08\x43\xc1\xc9\x96\x0f\ \x4d\x24\x5c\x52\xe0\x9f\x05\x2c\x4f\x80\x5f\x05\xf5\x94\xa1\x2c\ \x6d\xfa\xef\x6d\x05\x4f\x27\x32\x33\x02\x00\xbc\x9e\x9f\xe3\x72\ \x7d\x38\x2a\xa8\x0c\xfb\xf4\x9c\x91\x89\x3a\x97\x50\x09\x61\xa1\ \x05\xa6\x89\x0f\xae\x31\x95\x6f\x92\xc6\x4c\xa7\x8c\x58\x65\xa4\ \x23\x56\x6a\x9a\xd2\x97\x2c\xf8\x2b\x12\xe0\x7b\xa0\x9e\xc6\x34\ \xfd\x7b\xb8\x8f\xf7\x77\x06\x52\x6b\x99\xbe\x0f\x10\xca\x83\x8c\ \x52\x67\x5b\xe8\x0f\xd4\xc6\x25\x47\x9e\xaa\xea\x38\x15\x9a\xe9\ \xf0\x4d\xc5\xe6\x47\xc1\x76\xd7\x10\x80\x6f\x00\x02\xf1\x1b\xb0\ \xed\x46\x0f\xa7\x32\xf8\x00\xea\x79\x20\x1c\x01\x4b\x46\x28\x4f\ \xfe\x45\xb0\x4e\x64\xe6\x16\x00\xe0\x49\x8e\x98\xfe\x40\xa3\xac\ \x97\x7f\x2d\x5b\xa1\x77\x2c\x48\x7a\xfb\x46\xdd\x8d\x83\x18\xc8\ \xe4\xbe\x06\x49\x87\x2f\x09\xc6\xa9\x0e\xbe\x7c\x0e\x38\x61\x28\ \xc0\xe3\x7a\x1e\x9c\xda\x84\x4f\x2b\x99\x1d\x02\x80\xf6\x07\x2e\ \x62\x28\x9c\x25\xac\x4f\x48\xbc\xaa\xa4\x6b\x45\x38\x27\x1f\x30\ \x39\x5c\x49\x66\x28\xc8\x62\x05\x86\x82\x08\x5a\x3e\x44\xf1\x49\ \x85\xbf\x26\xc0\x3f\x66\xe8\xd9\x67\x1b\xf7\x63\xbc\xa6\x34\x33\ \x99\x3d\x02\x80\x9e\x25\xbc\x88\x4d\xe1\x22\xd2\xfa\x84\x24\x53\ \x10\x7a\x09\x99\xa1\x20\xab\x39\x87\xde\x7e\x70\xaa\x20\x5e\x23\ \xaa\x94\x0d\xd4\xa9\x08\xbe\x0b\xe2\x6c\x60\x30\x05\xfc\x23\xc0\ \x21\x43\x57\x1e\xdb\xb9\x9f\x7b\x3a\xc6\xa3\x03\x99\x5d\x02\x00\ \xec\xe5\x1b\x26\x09\xca\xc7\x7d\xbc\xaa\xa2\x6b\x30\x63\x01\x1f\ \x8d\xd9\x8d\xc6\x9f\x54\xd0\xa9\x0e\x3e\xb9\x60\xa8\xd7\x9b\x02\ \xfe\xaf\x81\x83\x86\x5e\x7d\x76\x70\xff\xd4\xa7\x7a\x27\x93\xd9\ \x27\x00\x34\x91\xa0\x5e\x92\x78\x35\x9b\x04\x49\x6f\xff\x35\x07\ \x7e\x3f\x70\x3e\x90\x6f\x61\xf6\x93\xeb\xfb\xee\xe3\x77\xa6\x81\ \xc4\xa4\x32\x37\x04\x80\x74\x12\x54\x15\x85\x7e\xb7\x69\x88\xf8\ \x9a\x02\xdf\x01\xd6\x81\xd8\x20\xc0\x49\x19\xea\x1d\x20\xd9\xe7\ \xcf\x19\xf8\x30\x97\x04\x80\x54\x12\x94\x4f\xfa\x14\xfb\x1d\x44\ \xc6\xf0\xf5\x0d\xc5\x9e\xd2\xe0\x77\xeb\xfe\x5e\x2c\xb7\x1f\xec\ \x80\xd2\x1f\x83\x7c\x1a\xac\x9d\x7c\xe6\x18\x7c\x98\x6b\x02\x80\ \x26\xc1\x1b\x18\xc1\xe5\x7a\xd0\x1f\x49\x9c\x38\xea\x91\xef\x71\ \xc8\x14\x1c\xfd\xdc\xc0\x81\x48\xab\xa7\x22\xf8\x8e\x42\x9c\x09\ \x62\xa3\x80\x6c\x0a\xf8\xa3\xa0\xf6\x11\x4f\xf2\x80\xf6\xf6\xef\ \xe3\xcf\x66\x03\x82\x76\x32\xf7\x04\x00\xd8\xc7\xff\xe3\x42\xf6\ \x00\xd7\x23\x28\xa0\xa0\x74\x4c\x2f\x1f\x2a\xf4\xb9\x44\x6b\xf0\ \x9d\x60\xd2\x27\x04\xea\x14\x00\x9f\x95\x0a\x71\x2e\xd0\x93\x58\ \xc6\x15\x5c\x2c\x0f\x02\x07\xe2\x72\x22\x19\xc1\xe7\x56\xee\xe7\ \xcb\xb3\xa2\xfb\x49\xa4\x83\xbd\x24\x67\x51\x6e\xe1\x52\x72\xec\ \x30\xb7\xa3\xcf\x76\x09\x06\xce\xcb\x91\xed\x72\x10\x84\xad\x43\ \x45\xdf\xc5\x0d\x77\x09\x5f\x72\xe0\x0f\x80\x58\x03\xe4\x62\x6c\ \x4d\xf0\x55\x29\x78\xa4\x5b\x36\xf4\x23\xd9\x43\x9d\x6d\xad\x76\ \xf4\x9a\x0b\x99\x1f\x0b\x10\xca\x93\x1c\xe1\x75\x3c\x80\xc3\xea\ \x90\x04\xb2\x01\xa5\x23\x3e\x20\xc8\x76\x3b\x7a\x65\x8f\xd0\xcf\ \xfe\x45\x06\xfd\xc0\xc7\x5f\x22\xe0\x3b\xc0\xf2\xa0\x9f\x1f\x04\ \xdc\x14\xf0\x3d\x85\x7a\x59\xa1\x9e\x05\x1a\x86\x6e\x7c\x76\x50\ \xe7\x56\x1e\x6c\xbd\x99\xc3\x5c\xc8\xfc\x5a\x00\x53\xb6\xf2\x3e\ \x1c\x76\xe0\xc4\x5f\x27\x71\xf3\x82\xfe\xb3\xb2\x14\x06\x6c\x5e\ \x2a\x15\x7c\x60\xb9\xae\x15\xb8\xe8\xc0\xcf\xea\x37\x75\xd4\x00\ \x08\xd7\xd8\xdf\x3f\xce\x12\x05\xc8\x13\x0a\xf5\x6b\x65\xf7\xf5\ \x92\x11\xe4\xec\xce\xee\x4d\x45\x16\x8e\x00\xa0\x3f\x51\x9f\x63\ \x47\xf8\xda\x59\x28\xb9\x5e\x87\xde\xf5\x19\xf2\x7d\x7a\x4b\x1a\ \x73\xff\x7b\x25\x35\x11\x64\xf0\x09\x75\x58\x20\xf0\xb3\x40\x2f\ \x88\xe5\x40\xd1\x7c\x49\xa3\x19\x7c\x39\xaa\x90\x07\x55\xbc\x7e\ \x2f\x14\x9f\x5d\xd4\xd9\xd6\xc9\x3b\x7c\x73\x25\x0b\x4b\x80\x50\ \xb4\x35\xd8\x6e\x7e\xaf\x10\x34\x11\x7a\xd6\x67\xc8\xf5\xc5\x0f\ \x2d\xad\x56\x15\x90\x41\xd5\x94\xfe\x42\x77\xf8\x06\xf2\x5c\x80\ \xef\x00\x5d\x20\x96\x01\xcb\x94\xb1\x29\x23\x2d\xc1\x97\xa3\x4a\ \xbf\xb1\x93\x04\x5e\x32\x84\xcf\xb6\xe9\x2e\xe3\x9a\x4d\x59\x1c\ \x04\x08\x65\x2b\x1f\xc7\xe1\x4e\xb3\x5b\x00\xfd\x09\xd4\xee\x75\ \x19\xf2\x83\x8e\x5e\x0e\x06\xd1\xbe\xa9\xca\xb8\x4e\xf9\x01\x11\ \xea\x20\xeb\x0a\x24\xc8\x2a\x53\x07\x3f\x4f\x04\x38\x12\x7c\xf1\ \xad\x00\x00\x03\x3e\x49\x44\x41\x54\x59\xa0\x00\xa2\xd0\xda\xb4\ \x9b\x25\x09\x77\xe8\xf0\x5f\x56\xb6\x83\x07\xa1\xb9\xdf\xce\xfd\ \x73\x3f\xbc\xeb\x54\xa6\x43\x80\xa9\xa4\x51\x93\x5f\x92\x90\x9b\ \xe9\x23\xcb\x9d\x69\x44\x10\x2e\xe4\x07\x5d\xf2\x2b\x1c\x0a\xcb\ \x9d\xa6\xcc\x23\x80\x13\x40\x41\x4c\x08\x15\x5c\xa4\x8c\x0b\xa2\ \xeb\xba\x6c\x70\xcd\x45\xac\x93\x81\x2f\x27\x14\xf2\xb0\x42\x9e\ \x20\x7e\x49\x33\xba\x79\x00\x7c\x83\xed\x0b\x69\xee\xd3\xa4\x13\ \x30\xa7\x7b\x8d\xa0\x59\x15\x9d\x4b\x1b\x22\x80\x1e\x21\xe4\x07\ \x1d\xf2\x03\x0e\xd9\x7e\xa7\xf5\x32\x34\xe2\x96\x6e\xc6\x05\xae\ \x85\xb1\xbd\xba\x9a\x12\xf8\x52\xe9\x96\x2e\x47\x15\xf2\x84\x8a\ \xb7\x65\x33\x45\x32\x84\x64\xc7\x62\x04\x3e\x94\x76\xe0\x26\xe3\ \x44\x22\x2c\x2d\x3e\xed\xb7\x93\xf8\x76\x71\xdd\x5c\xc3\xef\x71\ \x06\xef\xa2\xc8\x1b\x5b\x15\x36\xdb\x2b\xc8\xf6\x39\xb8\xdd\x82\ \xcc\x32\x81\x93\x0b\xfa\xe8\x59\x02\x5f\x36\x14\xb2\x04\xfe\xa8\ \xde\x85\x5b\x25\xfb\x75\x53\x3c\x1e\xe1\x65\x7e\xcc\xc3\x7c\x1f\ \xd8\x4f\xbc\x96\x47\xb5\xf8\x9d\x2c\x6e\x2a\xf1\x66\x35\x5b\xc5\ \x47\xd2\x8a\x00\x49\x70\x1c\xe3\xd8\x24\xc2\x4c\xce\x27\x8b\xa3\ \xe9\xbe\x67\xf1\x66\x2e\x60\x2b\x7d\x5c\x41\x96\xb5\x2d\xca\x1e\ \xa5\xc8\xf4\x08\x9c\xa2\xc0\xc9\x82\xc8\x82\xdb\x25\x62\xf0\x01\ \x0a\xfa\x52\x55\x47\x77\x0f\xc1\x5d\xfd\x4a\xe0\x5c\x36\x14\xb2\ \xac\xf4\xae\x9b\x93\x7d\xaa\x50\x32\xc4\x28\xdf\xe5\x31\x7e\xca\ \xcb\xfc\x1a\xbd\x76\x37\xf2\x07\x83\x5f\x95\xf8\x4b\x0b\x6b\x15\ \x37\x9d\xf3\xe4\xb7\x56\x9b\x48\x30\x19\x01\xc2\x2f\xcf\x24\x7f\ \x4d\x52\x24\xc3\xd2\xe2\x5a\x5d\xd3\xee\xb7\xd5\xf5\xfa\xf8\x5c\ \xae\xe4\x4c\x2e\x66\x15\x6f\xa4\xc8\x9b\x5a\xd4\x63\x6e\xc5\xe3\ \x11\x8e\xf1\x4b\xf6\xf1\x24\x87\x39\x06\xbc\x42\x0c\x80\x4c\xfc\ \xb6\x0a\x6f\xf5\x9b\x0c\xa3\xcd\x35\xb4\x49\x67\x5e\xd3\x11\x01\ \xcc\x16\xe9\x24\xfe\xdc\x44\x78\x12\x20\x27\x11\x67\x5e\x9f\x4c\ \x9b\xf6\xd7\xc9\x35\x69\xf7\x5b\xc6\x05\x5c\xc0\x3a\xce\xa1\x87\ \x35\x14\x38\x8b\x0c\xeb\x52\xea\x36\x7d\xd1\x2f\x60\x3c\xc3\x18\ \x2f\xf3\x12\x43\xec\xe3\x45\xb4\x8f\x53\x42\x2b\xd8\x54\x76\xbb\ \x3f\x15\xa4\xeb\xf4\x9a\xf0\x38\x2d\xef\x24\xc8\xed\xf2\x4f\xed\ \x3a\xda\x11\x20\x09\x8c\xcb\xe4\xa0\xb8\xd8\x40\xba\x89\x3c\x5a\ \x1d\x77\x7a\x5d\xb2\x4c\xc9\xfb\x0a\x2b\xbf\xf3\xd8\x44\x2f\x0e\ \x03\xac\xc6\xa5\x46\x91\xe5\xe4\x58\x89\x83\x8f\xc0\x47\x20\xd1\ \xa3\x3b\x81\xc2\x41\xe1\xd2\xe0\x55\xca\x9c\x40\x52\xe0\x10\xcf\ \xe1\xd3\xc5\xd3\x1c\x44\x0f\x08\x7d\x20\x7c\xf9\x5d\x26\x80\x49\ \x2a\xdd\xef\xf0\xb8\xd3\xeb\x4c\x60\x5b\x11\x22\x79\xff\x64\x99\ \x20\x41\x80\xa9\xed\x0f\xb0\x74\x44\x2b\xe7\x39\x86\xd0\xa4\x38\ \x48\x7a\xf7\x92\x4c\x93\x34\xa1\x3e\x7a\x1a\x27\x83\xdd\x8a\x4e\ \x19\x69\x47\x80\xa4\x42\x5a\x85\x9b\x26\x39\x3c\xf7\x99\xdf\x2e\ \x60\x2a\x7e\x85\x79\x9c\x56\xdf\xc9\xfa\xd2\x34\xb3\xbb\x58\xbb\ \x80\xa4\x53\xd8\x24\x69\x04\x30\x1d\xe5\xa4\x03\x11\xc6\x2d\xbc\ \x13\xd8\xba\x0c\xc9\xb4\xa4\x1c\x4f\x66\x01\xc0\x6e\xf1\x49\x65\ \xb6\x72\xc0\xda\x91\x67\x21\x9d\xc0\xd4\xfe\x1f\x26\xef\x02\x24\ \xb6\xa2\xc2\xf3\x85\x19\x06\x4e\xed\x3e\x74\x10\x96\x94\x34\x65\ \xb5\x0b\x9b\xca\x70\x2c\x19\x9e\x76\xed\x54\xf3\xed\xe4\xbe\x6d\ \xbb\xad\x56\x8a\x48\x8b\x4b\x2a\x2e\x2d\x3e\xed\xb7\x93\xf8\xe9\ \xc6\x4d\x96\x26\xed\xbc\x5d\x9d\xc1\x56\x58\x52\x79\x69\x71\xad\ \xae\x49\x8b\x9f\x6e\xdc\x54\xe2\xc3\xe3\x76\xf1\x91\x4c\xa6\x8c\ \x99\x5c\xd3\x0e\x84\xb9\xce\x67\xb2\x6b\xdb\x59\x80\xa9\x84\x77\ \x72\x6d\x5a\xda\x4e\xf2\x9b\xab\x7c\x4e\xcb\x69\x39\x2d\xa7\x25\ \x90\xff\x0f\xef\x1c\x86\x3c\x32\xce\x0d\x59\x00\x00\x00\x00\x49\ \x45\x4e\x44\xae\x42\x60\x82\ \x00\x00\x2d\x91\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x80\x00\x00\x00\x80\x08\x06\x00\x00\x00\xc3\x3e\x61\xcb\ \x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x89\x00\x00\x0b\x89\ \x01\x37\xc9\xcb\xad\x00\x00\x20\x00\x49\x44\x41\x54\x78\x9c\xed\ \x7d\x7b\x74\x1c\xd7\x79\xdf\xef\xce\x63\x1f\x58\x3c\x16\x24\x41\ \x82\x0f\x11\x20\x45\x51\x0f\xca\x22\x15\xd9\x4a\xe2\x4a\x16\x59\ \xc7\x76\x52\x3b\x91\x9c\x36\x49\x6b\xc7\x91\x9c\x34\x49\x73\x4e\ \x12\xd9\x27\x6d\xd2\x3f\x7a\x2a\xfb\x9c\x34\xc9\x49\x9b\xc8\x6a\ \x4f\x93\xf8\x34\x31\xe3\x46\x7e\xc8\x51\x22\xcb\x91\x12\x37\x71\ \x2c\xca\x7a\xdb\xa2\x4c\x91\x22\x45\x3d\xf8\x04\x29\x10\x04\x08\ \x60\x01\x2c\x76\xe7\x71\xbf\xaf\x7f\xcc\xdc\x3b\x77\x66\x67\x41\ \x12\x04\x20\x8a\xc6\x87\xb3\x98\xd7\x9d\xd9\x99\xf9\x7d\x8f\xdf\ \xf7\xdd\x3b\xb3\xc0\xb2\x2c\xcb\xb2\x2c\xcb\xb2\x2c\xcb\xb2\x2c\ \xcb\xb2\x2c\xcb\xb2\x2c\xcb\xb2\x2c\xcb\xb2\x2c\xcb\xb2\xfc\x40\ \x88\x78\xbb\x4f\xe0\x4a\x97\xbb\xef\xef\xdb\x01\x58\xd5\x30\x04\ \x2c\x0b\x3b\x41\x00\xc0\x03\xcc\x18\x64\x46\x55\x08\xb1\x83\x99\ \x41\x92\xf7\x00\x0c\x66\x1c\x67\xa6\x27\x11\xc8\x3d\x0f\x7d\xb6\ \x76\x7c\xb1\xcf\x6f\x59\x01\xe6\x21\xbf\xf4\xa7\xeb\x77\x02\x00\ \x93\xa8\x0a\x88\x1d\x00\x81\x59\xf4\x80\x68\x07\x47\x4d\x06\x01\ \x31\x08\x06\x98\x19\x6a\xca\x00\xc0\x0c\xce\xae\xe7\xfc\xf5\x44\ \xbc\x0f\x24\x1f\xf8\xeb\xcf\xd6\xfe\x72\xb1\xae\x65\x59\x01\x00\ \xdc\xbd\x7b\xa0\x5a\x02\x76\x20\x04\x20\x30\x08\x81\xc1\xc8\x52\ \xc5\x76\x66\xaa\xc6\xcd\x76\x00\xa2\xaa\x41\x05\x52\xc0\x21\x03\ \x70\x1e\xb8\xb1\x85\x83\x99\xb1\xba\xba\x11\x05\xb7\x14\xb7\x89\ \x3e\x67\xcf\x0d\xc1\xf3\x1b\x99\xfd\x22\x45\x08\x43\xfe\xe4\xa3\ \xbf\x57\xdb\xb7\xd0\xd7\x7e\xc5\x2a\xc0\xaf\xee\x1e\x18\x74\x1c\ \x67\x10\x00\x40\x1c\x81\x07\x80\xc1\x77\x20\x9a\x81\x10\x62\xa7\ \xb2\x38\xa0\x15\x58\x73\x3e\xc6\x2f\xb1\x50\x28\x4b\x8d\xb6\x17\ \xdd\x0a\xd6\xf4\x0e\x82\x19\x28\xba\x1d\x58\xd3\x3b\x00\x62\x46\ \x4f\x65\x15\xba\x3b\x56\x82\x99\xd0\x55\x59\x89\xae\xca\x0a\x30\ \x11\x88\x25\x88\xa3\x29\xb3\x8c\x96\x49\xa2\xe1\xcd\x60\xe8\xcc\ \xeb\x38\x32\xb4\x1f\xc7\x4e\xbe\x82\xa6\xdf\x00\x88\x41\x44\x93\ \x92\xc3\x5d\x8f\xfe\xde\xec\x82\x2a\xc1\x3b\x4a\x01\xee\x7d\xf0\ \x9a\x1d\xb0\xad\x6a\x18\x86\xb0\x2c\x6b\x27\x00\x08\xa0\x87\x81\ \x1d\x31\x2a\x83\x42\x88\x41\x05\x16\x14\x48\xc6\x72\x8c\x6b\x06\ \xd4\x6c\xdb\xa8\x5d\x7f\xef\xd5\x28\xb9\x15\x30\x33\x06\xd7\xdc\ \x14\x2b\x08\x63\x60\xf5\xbb\xe2\xfd\x19\x1b\x57\xdf\x08\x06\x81\ \x99\x62\xcb\x25\x10\x08\x4c\x04\x06\x81\x98\x62\x80\xa3\x36\x1a\ \x74\x4a\x14\xc0\x54\x06\xa2\x30\x9a\xa7\x10\x4d\xaf\x8e\x6f\x3f\ \xf7\x35\x1c\x3b\x79\x28\x3a\x36\xf1\x24\x05\xe1\xae\x47\xff\xc7\ \xc2\x29\xc1\xdb\xaa\x00\xf7\xee\xde\x5e\x75\x3a\xb1\x03\x61\x08\ \x16\xa2\x2a\x44\x14\x4f\x49\x60\x40\x30\x0f\xc6\x16\xb9\x03\x40\ \x95\xc1\x1a\x00\x00\x89\x15\x22\xb5\x6a\x4e\xe0\x7b\x2b\xfd\xa8\ \x56\xfa\xc1\xcc\xa9\xf9\x08\xe8\x4e\x30\x18\x6b\xab\x57\xa3\x58\ \xe8\xd0\xdf\xc5\x31\xd0\x11\xc8\xac\x81\x27\x26\x20\x9e\x2a\xe0\ \x99\x49\x2b\x83\x09\x78\x32\x95\xa9\x69\x0a\x7c\x92\xc9\xb2\x9a\ \xa7\x10\xc4\x12\xfb\x5f\x7d\x1a\xcf\xbd\xf8\x4d\x30\x33\xa4\xe4\ \x3d\xdf\xf8\xc3\xe9\x5d\x0b\x85\xc1\x92\x29\xc0\x6f\xff\xf5\x8e\ \xdd\xcc\x18\x04\x08\xc2\xb2\x76\x32\xd8\xb0\x42\x8e\xc1\x4c\x6e\ \xb8\x5a\xc7\x09\x8a\x09\xa8\xc6\xf2\xa6\xd5\x37\xeb\x36\x9b\x56\ \xef\x00\x00\x94\xdc\x4e\xf4\x57\xb7\xe8\xf9\xb5\xbd\x57\x27\x31\ \xb8\xe5\xfb\xd4\x7a\x6e\x01\x3d\xa5\x00\x4c\x00\x33\x08\x0c\x30\ \xe9\x29\x33\x47\x16\xcf\xe6\x87\x35\xb0\x5a\x21\x62\xb7\xaf\xbd\ \x02\xb5\x01\xdf\x50\x02\xc9\x61\xb4\x8d\x42\xfc\xe3\x93\x5f\xc5\ \x89\xa1\xd7\xc0\xcc\x08\xa4\xbc\xf9\xef\x17\xc8\x0b\x38\x0b\x71\ \x90\xf3\xc9\x6f\xfd\xf5\xb6\x9d\x0c\xba\x87\x05\x00\x30\x98\x42\ \x0d\x24\x67\x94\xa0\xe4\x56\x34\x78\xd5\x8e\x7e\xf4\x56\xfa\xc1\ \x00\xd6\x56\xb7\xa0\xe4\x76\x02\x00\xd6\xf6\x6e\x89\x2d\x16\xa6\ \x99\xc7\x62\xb8\x79\x05\xa3\xfa\x0e\x0d\xb2\x39\x9f\x56\x34\xf5\ \xa7\xcf\x8d\x0d\xeb\x37\x40\x07\x0c\xcb\x37\xda\x92\x6a\xaf\x8f\ \x41\x5a\x11\xd4\xb2\x0a\x13\xc4\x9c\x52\x12\xfd\xa1\xf4\x32\x31\ \x61\xc7\x8d\xb7\xe1\xf8\xc9\xc3\x00\x33\x2c\xc6\xdd\x00\xde\x39\ \x0a\x10\x32\x4f\x3a\x90\x51\x2c\xed\xdb\x8e\x81\xbe\xed\x00\x18\ \xfd\x1a\x54\xc6\x60\xdf\x0e\x00\x22\x76\x49\x0c\x36\x9c\x93\x00\ \x0c\x50\xe3\xed\xc6\x8a\xd6\x50\x60\x82\xac\xd6\x24\x31\x41\x13\ \x38\x03\xe8\x44\x59\x12\xb0\x13\xf7\x1f\x81\xaa\xbd\x12\x12\xcb\ \xd7\x8a\x10\x83\x08\xa4\x81\x4b\x58\xbe\x8a\xff\x06\xb8\x30\xda\ \x1b\xa1\x23\xaf\x5d\x6f\xb5\x0f\x9d\x1d\xdd\x98\x9e\xa9\x01\xc0\ \x3d\x00\x3e\xbd\x10\xd8\x2c\x59\x08\xf8\xcd\xaf\x5c\x3b\x61\x09\ \x54\x07\xfb\xb6\xe3\x9e\x9d\x7f\xdc\xf2\xf5\x42\xff\xe7\x64\x7d\ \x06\xf4\x96\xa5\x8c\xa5\xa7\xda\x99\x00\x03\x09\xab\x37\x42\x8f\ \xe9\x01\x92\x90\x93\xf5\x00\x86\x85\x1b\x56\xdf\x12\xff\x91\x06\ \x2d\x35\x8f\x38\xee\x13\xa5\x62\x3f\x9b\x3c\x80\x32\x53\x0e\x21\ \x0d\x2e\x20\x49\xe2\xe0\xab\xdf\xc5\x77\xf7\xfe\x33\xc0\x00\x85\ \xe1\xae\xc7\x1f\xf0\xf6\xcc\x1f\x91\x48\xac\x4b\x3d\xc0\x05\x0b\ \xd3\x1e\x66\xc6\xb1\x91\x7d\x18\xae\xbd\x16\x01\x62\x7c\x12\x22\ \x65\x4c\x41\xc6\xc7\xf8\xe3\x04\x28\xd3\xdd\x22\x03\x88\x99\x63\ \xab\x38\x9e\x00\x1a\x5b\x1f\x38\xb5\x2e\xb2\x74\xca\xb4\xcd\x9c\ \x5b\x0e\xf8\x9c\xd9\x07\xf1\x79\x93\x61\xd9\x66\x3b\xc4\x64\x30\ \xcd\x1d\x12\x45\x4a\x14\x28\x21\x8e\x1b\xd6\x6f\x8e\x2f\x93\x41\ \xb0\x76\x2e\x04\x2c\x4b\xa6\x00\x2c\xf9\x49\x05\xc4\xcb\x27\xbe\ \x85\xc3\x23\x4f\x23\x20\xaf\x15\x5c\xa4\x81\x6d\x01\xdd\x00\x3e\ \x01\xd0\x00\xd1\x6c\x6f\x02\x6c\x6e\x57\x60\xb4\x80\x1f\xc7\xf1\ \x94\xc5\x9b\x4a\x98\x69\x8b\x04\x30\x53\xc9\x22\x00\x93\xef\x55\ \xdb\x49\x79\x03\xa4\x5d\x7d\xe2\x19\xa2\x79\x66\x19\xd7\x0a\xd4\ \x72\x34\xdf\x51\xa9\xa0\xda\xb3\x2a\xb6\x19\xde\xbe\x10\xb8\x2c\ \x99\x02\xf8\x61\xf0\xf5\xd8\xd3\x62\xb4\x76\x12\xb5\xc6\x59\xbc\ \x3c\xf4\x4d\xd4\xbd\x09\x28\x86\x6d\xc6\x5c\x95\xa0\x73\x66\x7d\ \x9a\x60\x65\x80\xd6\x60\x73\x0e\x58\x26\xa0\xa6\x55\xa7\x63\xb0\ \x8e\xc5\x99\xd8\xde\xd2\x3e\xf3\xa1\xd4\xb1\x5b\xc3\x80\x69\xed\ \x2d\xc4\x0f\xe9\x76\x5a\x51\x74\xd6\x20\xf5\x7e\xd5\xea\x4a\x30\ \x33\x04\xa3\x7a\xbe\x7b\x7e\x21\xb2\x64\x0a\xf0\xf9\x4f\x9e\x38\ \x4e\x44\xc7\xc1\x8c\xa1\xb3\x87\xe0\x05\xb3\xf0\x65\x13\xfb\x4f\ \xfd\x13\x86\x6b\xaf\x27\x16\x96\xeb\xc6\x73\x40\x4d\x85\x88\x04\ \x50\x68\xa0\xb9\x05\x10\x93\x90\x71\xcc\xc2\xd3\xfb\xe7\xb9\xf4\ \x36\x6e\x3e\x87\xac\x65\x5d\x77\xb6\x0e\x40\xb9\xeb\xa5\xe1\x0d\ \x64\x2a\xa5\xa4\x9c\x76\xb3\xcd\x99\xd8\x30\x68\x41\x70\x59\x3a\ \x0e\x00\x80\x09\x7b\x98\x80\xd9\xe6\x34\x9e\xda\xff\x10\x26\x67\ \xce\x42\xb2\xc4\xd1\xd1\xbd\x78\x75\xf8\x3b\x08\xa5\x87\xa8\xd8\ \x62\x80\xa5\x2d\xde\x5c\x67\xc6\x64\x45\xe0\xd2\xa0\x11\x32\xe0\ \xb5\xb8\x7e\xf3\x18\xa6\x25\x26\xdb\xa8\xc5\xfa\xa3\xef\x49\xac\ \x3d\xeb\x79\xda\x29\x46\xc6\xfa\x0d\x17\xaf\x95\x05\xd2\xd8\xd7\ \x20\x89\x24\x53\xc7\x9b\x9a\x1e\x07\x33\x40\x0b\x83\xff\xd2\x2a\ \xc0\x0c\x85\x9f\x96\x44\xfb\x98\x19\xb3\xcd\x69\x3c\x73\xe0\x61\ \x9c\x3a\x7b\x18\xc4\x12\xa3\xd3\x27\xf1\xd2\x89\xc7\x31\xe3\x9d\ \xcb\xe1\x00\x39\x16\x68\x6c\xa3\x9c\x75\xdc\x62\xdd\x66\x5a\x96\ \x89\xed\x66\x3c\xce\x96\x75\x99\x40\x48\xdc\x72\xb6\xc2\xa7\xeb\ \xf8\x19\x77\x9f\x3d\x5e\xab\xa7\x30\x2d\x3f\xe1\x01\x4c\x0a\xf8\ \x4c\xe1\x88\x09\x13\x93\xa3\x08\x02\x4f\x19\xc1\xe4\x42\x60\x62\ \x2f\xc4\x41\x2e\x54\x5e\x7e\xb4\xd6\xdc\x76\x67\xf7\x43\x0e\xa1\ \x1f\x02\x3b\xc0\xc0\xd9\x89\x13\x98\xf5\xa6\x51\xed\x5c\x0d\xc9\ \x21\xde\x9a\x3c\x0c\xdb\x72\xd1\x5d\x5a\xa5\x63\xbd\x4a\x16\x55\ \x4e\x0f\x91\xce\xdf\xa1\x6a\x02\x22\xbd\x4e\x73\x05\x63\xd9\x74\ \xf7\xba\xae\x68\x2a\x0f\x9b\x6d\x33\xde\xc2\xf0\x3c\x0a\x58\x33\ \x63\x50\x04\xaf\x25\xa6\x6b\xe2\x67\x28\x8b\x8a\xf1\xc6\x47\x85\ \x80\x68\xbb\x4c\x14\x23\xf6\x02\xc3\x67\x4e\xe0\xd8\x9b\x6f\x20\ \x26\x81\x0f\x1d\x7d\x91\xf6\x5c\x2a\x26\x4b\xaa\x00\x40\xa4\x04\ \x2f\x3e\x3a\xf9\xe8\x2d\x3f\xd9\x5d\x03\xc4\x8f\x03\xc0\xf4\xec\ \x38\xc6\x26\x4f\xa1\xb7\xbb\x1f\xb6\xe5\xe0\xdc\xcc\x10\xa6\xbd\ \x31\xac\xa8\xac\x87\x25\x2c\x68\x10\x91\xad\xf8\x65\x96\x81\x74\ \xbe\x6f\x2a\x42\xa6\xf0\x13\xb5\x4a\x3c\x87\x06\x5d\x2b\x87\x2a\ \xf7\x26\xa1\x48\x79\x10\xb4\xf0\x13\xc3\x33\xa4\x48\xa4\xe9\xfa\ \x25\x5a\x3c\x84\x99\x0d\xc0\xdc\x26\xb5\x07\x48\xbc\x80\xc4\xeb\ \xaf\xed\xc7\xf8\xb9\xb1\x28\x0d\x24\xfa\xec\xb1\xbd\x7c\xfc\x52\ \xf1\x58\xd2\x10\x60\xca\x9f\xfd\xd2\x89\xcf\x91\xa4\x5d\x44\x3c\ \xc9\x0c\x4c\xd7\xc7\xf1\xdd\x57\x1e\xc7\x78\x6d\x18\xc4\x21\x46\ \x6a\x47\xf1\xc2\x91\xbf\xc1\x74\x73\x34\x86\x22\x1b\xe7\x0d\x6b\ \xcb\x86\x81\x16\x2e\x90\x69\xa7\x0a\x33\x9c\xb5\xe8\x0c\x41\xcc\ \xb8\xeb\x3c\x76\xdf\x52\xb5\xcb\x78\x84\xb4\xbb\xcf\x10\xbe\xdc\ \x0e\xa0\x44\x09\xf4\xf1\xe3\x6d\x13\xe3\xa3\x60\x8a\x94\x32\x6c\ \xca\x05\x29\x05\x2f\xb9\x07\x30\x65\xef\xdf\xd5\x8e\xbf\xfb\x27\ \x7a\x1e\x62\xa6\x9d\x10\xa2\x9f\x48\xe2\xcc\xb9\x63\x60\x26\x74\ \x57\x56\xc2\x97\x4d\x0c\x9d\x7b\x05\xb6\x55\x40\x4f\xc7\x6a\x20\ \x65\xd5\x4a\xb2\xd5\x3e\xe5\x2d\x60\x58\x75\x5e\xd9\x37\xb1\x74\ \x53\x71\x54\x85\x2f\x45\x3a\xdb\xb8\xff\x68\x5b\x54\xe2\x26\x35\ \x45\x86\xe5\x43\x59\xbe\xd9\x13\x98\x54\x05\x99\x29\x19\x1f\x60\ \x76\x10\xc5\xcb\xaa\xbd\xef\x37\xb1\x6f\xef\xf3\x60\x49\x20\xe2\ \x7d\x4f\x7c\x81\x1e\x58\x08\x0c\xde\x56\x05\x00\x80\xbd\x8f\xd7\ \x26\x6f\x7c\x3f\x1e\xb2\x9c\x62\x3f\x10\xf1\x82\xc9\xe9\x51\x4c\ \xcf\x4e\xa0\xda\xb5\x0a\x80\xc0\xe8\xf4\x09\x4c\x35\xce\x62\x55\ \xe7\x46\x58\xc2\x32\xc2\x01\xa7\x41\x37\xc1\xcd\x80\xad\xc1\x3f\ \x9f\xfb\xd7\x53\xd2\xed\x49\x73\x84\xb4\xeb\xd7\xde\x24\x43\xf4\ \x52\x31\x3c\x35\xaf\xe2\x7d\x12\xff\x53\x5d\xc2\x90\x29\xe0\x85\ \xd0\xec\x07\x67\xcf\xbe\x85\x23\x6f\xbc\x16\x5f\x32\x7f\xf3\xd8\ \x4b\xfc\xe8\x42\xdc\xff\xb7\x5d\x01\x00\xe0\xe5\xff\xe7\x35\x5f\ \x7a\xac\xf6\xe8\xcd\x1f\xee\xae\x01\xf8\x71\x00\x68\x34\x66\x30\ \x3a\x7e\x0a\x5d\x95\x5e\x38\x8e\x8b\xe9\xc6\x39\x9c\x9e\x3c\x8c\ \x15\x95\x75\x28\x3a\x15\xa4\xbd\x41\xa2\x10\x09\xa0\x94\xf1\x08\ \xe9\xf8\xde\x0a\x78\x02\x3c\xb4\x02\x18\x96\x6e\x64\x16\x69\x97\ \xcf\xa9\xea\x5e\x36\xcf\x37\x2d\x3f\x9b\xe6\x65\xbb\x7f\x4d\x77\ \x2f\x59\xc2\xb1\x0a\xf1\x1d\x12\x38\x79\xf2\x0d\x0c\x9f\x3e\xa5\ \xae\xe1\x8b\xc7\x5e\xe2\xe7\x17\xe2\xde\xbf\x6d\x1c\x20\x4f\xfe\ \xfc\x3f\x0c\x7d\x8e\x02\xb9\x8b\x24\x4d\x32\x33\x9a\xde\x2c\x0e\ \xbe\xfe\x1c\x46\xc6\x4e\x82\x38\x84\x17\xcc\xa2\xee\x4d\xea\x9b\ \x6d\x16\x4e\x28\xe5\x62\x93\xb8\x4f\x30\xb7\x25\xeb\xcc\xe2\x4e\ \xcb\x72\x36\x45\x33\x2c\x38\x4d\xe6\x12\xab\xa6\x38\x97\x4f\xc7\ \xfd\x36\x1f\xb3\xe3\x87\xd2\xc7\x50\xe7\x0b\x06\x6c\xe1\xc0\x16\ \x0e\x2c\xcb\xc1\xc8\xf0\x69\xad\xc0\x92\x69\xc1\x46\x04\x5d\x56\ \x0a\x00\x00\x7f\xf1\x1b\xa7\xf7\x84\xfe\xf4\x26\x92\xbc\x8f\x89\ \x11\x86\x01\x8e\x9c\x38\x80\xd3\x6f\x1d\xc5\x6d\xd7\xfe\x3b\xac\ \xe9\xd9\x94\x62\xd7\xe9\x22\x8e\x01\x72\x0b\x59\x6b\xb5\xc4\x34\ \x2b\x97\x99\x6d\xd9\xef\x90\x99\x63\x99\x03\x3a\x92\x38\x1e\xa5\ \x7d\x32\xa3\x48\x86\x75\x53\x46\xb9\x8c\x63\xb1\x56\x0a\x09\x4b\ \x38\xb0\x2c\x1b\x56\xac\x04\x67\x47\xde\x02\x13\x83\x09\x78\xf2\ \x2f\xb0\x67\xa1\xee\xf7\x92\x8c\x07\xb8\x58\xf9\xe2\xa7\x6b\x93\ \x40\xed\xe6\x4f\x3e\xb0\xfe\x11\x61\xe1\x2e\x66\x60\x68\xf8\x0d\ \x94\xdc\xce\x98\xa0\xc1\x48\xeb\x62\xe1\x88\xec\xe9\x50\xa0\xfb\ \xfe\x91\x8a\xf1\x09\x01\x04\x92\xbe\x7c\x63\x5b\x8a\xf4\x19\xae\ \x3f\x15\xdf\x19\x69\x2f\x90\x9d\xa6\x15\x40\xcf\x43\x66\x94\x22\ \xea\xf6\xd5\x6e\xdf\xc8\x0a\x8a\x96\x0b\x5b\x38\x10\x16\x61\x62\ \x7c\x14\x81\x1f\x22\xca\x40\x17\xce\xfa\x81\xcb\x54\x01\x00\xe0\ \xee\xfb\xd7\xdd\x03\x81\xbb\x14\xde\x03\xfd\xdb\xc0\x2c\xf5\xf6\ \xf3\xd6\x00\x52\xcc\x3f\x5e\x6b\x16\x87\x74\x7d\xa0\x95\xf8\xa5\ \x63\x7e\x1a\xec\x7c\x1e\x90\x56\x82\x54\x0a\x97\x49\xed\x52\x29\ \x60\xcb\xc0\xd0\x24\x3c\xb8\x76\x11\x96\x70\x20\x40\x38\x77\x6e\ \x04\x32\x54\x1d\x66\x0b\x33\x12\x48\xc9\x65\xa9\x00\xbf\xf0\xb9\ \xb5\xbb\x85\xc0\x3d\x4c\x11\xa0\x3f\xbc\xed\x23\xf8\xe0\xad\xbf\ \x98\x58\x3f\x60\xb0\x79\x23\x21\x34\xab\x7b\x06\xf0\xaa\x6d\x42\ \x00\x61\x10\x3d\x68\xe2\x47\x86\x07\xd0\xdb\xc1\x06\xd8\x86\x32\ \xe8\xf5\xad\x35\x02\xbd\x5e\x75\xed\x9a\x20\x6b\xd0\x43\x83\x9f\ \x98\x0a\x11\x79\x84\x92\xdb\xa5\x8f\x37\x72\x26\x22\x7f\x91\x02\ \xf0\xcb\x0b\x79\xaf\x2f\x2b\x05\xb8\xfb\xfe\x35\x83\xcc\xd6\x23\ \x16\xc4\x0e\x10\x50\x2c\x74\xe0\x83\x3f\xfc\x49\x6c\xbf\x66\x57\ \x04\x0a\x80\xa4\x7c\x1b\xcd\xb3\x1a\x44\x94\xb2\xfa\x78\x9b\x51\ \x05\x34\x97\xf3\x53\x3f\x4a\xda\x70\xc6\xfa\x63\x6f\x90\x55\x04\ \x95\x06\xb6\xba\x7e\x4a\x0d\xfb\x6e\xe5\x0d\x19\x22\x18\xb3\x7e\ \xe2\x68\x14\xb0\x63\x17\x60\x5b\x2e\x98\x09\x82\x09\x67\xce\x9c\ \x02\x28\x56\xe8\x60\xe1\xe2\x3f\x70\x19\x29\xc0\xc7\xff\xfb\x9a\ \x9d\xcc\xe2\x11\x21\x50\x65\x62\xf4\x74\xf6\xe1\x67\xde\xff\x9f\ \xb0\x66\xa5\x22\x7d\x66\x6b\x06\x58\xa4\x5c\x7d\x34\x6e\x30\x5b\ \x06\x46\x0a\xe4\xb4\x37\x30\x6a\x00\x66\xed\x9f\xb3\x4a\x90\xc4\ \xfc\x3c\x4f\x90\x8e\xff\x99\x98\x6f\xf2\x80\xbc\xaa\x1f\x1b\xe0\ \x53\x18\x8f\x04\x96\xe8\x2c\x74\xc2\x16\x0e\x24\x42\x34\x1b\x53\ \x18\x1b\x3d\x83\xb8\xfe\x8f\x27\xbf\x7c\x05\x86\x80\x4f\xfc\xd1\ \xea\x4f\x09\x61\xdd\x0f\x00\x4c\xc0\x40\xff\x0d\xf8\x37\x3f\xf6\ \x1f\x51\x2a\x74\xc4\xac\x3a\xee\xff\x51\x50\x2b\x6d\x10\xac\x67\ \xd9\x04\x57\xad\x31\x88\x1d\x90\x84\x08\xad\x14\xda\x43\xb4\x23\ \x7d\x69\x0e\x40\x79\x84\xb0\x0d\xf8\x4c\x26\x1f\xc8\xc4\x7e\x05\ \x7c\x66\xfc\x3f\xb1\x44\x28\x3d\x38\x76\x01\x81\xf4\x40\x4c\x18\ \x1d\x1b\x86\x0c\xd5\xf7\x2e\xac\xf5\x03\x6f\xb3\x02\xdc\x79\x5f\ \x4f\xb5\xbb\xb3\x78\xbf\x80\x75\x4f\x4c\x70\xf0\x9e\x6d\x3f\x81\ \x0f\xdc\xfa\x09\x40\x20\x8e\xf9\xca\x92\x13\x49\xd8\x3e\xb4\x95\ \x47\xeb\xcd\x82\x90\x6e\x68\x00\x99\x29\x16\xa5\x00\x4e\xc2\x43\ \xda\xca\xcd\x30\x90\xe5\x04\xd4\x62\xf1\x79\x35\x09\x33\xcd\x93\ \x2a\x1d\x34\x32\x00\x49\x21\xbc\xb0\x8e\x46\x30\x8d\x20\x6c\x62\ \x7d\xf5\x06\xd8\x96\x0b\x1b\xc0\x99\x91\x21\x90\xd4\x99\xcf\x82\ \x3f\x1b\xf8\xb6\x29\xc0\x9d\xf7\xf5\x54\xbb\x3a\x4b\x4f\x40\x88\ \x1d\x1c\xc7\xfb\x8f\xdc\xfe\x2b\xb8\x66\xe3\xbb\x23\xe0\x19\x91\ \xd9\x73\x52\x0e\xd5\xa3\x86\x19\x60\x11\x6b\x85\x06\x39\x6a\x93\ \x10\x43\x86\xee\x03\xe0\x34\xf8\xb9\x19\xc0\x1c\xa9\x5f\xb6\x37\ \x30\xed\x11\x64\xc6\x13\x90\x26\x7a\x5a\x01\x72\xdc\x7f\x48\x3e\ \xfc\xb0\x01\x2f\xa8\xc3\x0b\x67\x53\xdb\xba\xcb\x7d\xd1\x00\x79\ \x66\x0c\x9d\x3a\xa2\xef\x19\x03\x0b\x4a\x00\x81\xb7\x49\x01\x3e\ \xf6\xbb\x7d\x3b\x44\x41\x3c\x01\x44\xf1\x7e\xf5\x8a\x8d\xf8\xf0\ \xed\xbf\x8c\xd5\x2b\x06\xa0\x52\x3d\x65\xe4\x26\xfc\x2a\xf6\xe7\ \x13\xbe\x78\x2e\x93\x09\x20\x6b\xfd\x29\x4b\x37\xb7\xe7\x13\xbf\ \x14\xe9\xcb\x74\x02\xb5\xe6\xff\x14\xd7\xf1\xb3\x5e\x20\x9a\x0f\ \x64\x13\x7e\xd8\x40\x33\x98\x41\x20\x9b\x19\xe5\x88\x8e\xd1\x53\ \x5e\x03\xd7\x2a\x40\x5d\xf9\xf1\x13\x87\xf5\x7d\x93\x74\x05\x78\ \x80\x9f\xfb\xfd\x95\x3b\x85\x10\x8f\x08\x16\x55\x66\xc6\xc6\xfe\ \xeb\xf0\xd1\xf7\xff\x06\x8a\x85\x0a\x28\x06\xdf\x7c\x58\x81\x90\ \x3c\x2d\x60\xfc\x43\x34\x97\xb6\x7e\xb5\xa0\x99\xbe\xb9\x9c\x2a\ \xf4\xb4\x7a\x83\x04\x58\xe5\x01\x0c\x12\x68\xb2\xfe\x0c\xf3\xcf\ \xb3\x7c\xc5\xfc\x95\x6b\xf7\xc3\x06\x7c\xd9\x40\x28\x03\x23\x2c\ \x90\x1e\xf1\x6b\x1e\xa7\xb7\x63\x1d\x1c\xab\x08\x21\x04\x86\x47\ \x8e\x27\xee\x1f\xc0\xb3\x0b\x4c\x00\x81\x25\x56\x80\x8f\xfd\x7e\ \xdf\x3d\x42\x88\xdd\x40\x64\xa9\xdb\xb6\xbc\x17\x3f\x71\xfb\x2f\ \x02\x10\x29\xcb\x17\xa9\x99\x48\x09\xf4\xc6\x78\x86\xcd\x86\xda\ \xd5\x9b\x19\x80\x9a\x4b\xdc\x7d\xda\xe5\x9b\x4a\x60\xb8\xff\xb6\ \xc0\x27\x8a\xd1\x96\x03\x50\x08\x5f\x36\xe1\xcb\x06\xfc\xb0\x81\ \x40\x7a\x46\x18\x48\x73\x02\xb3\xa3\xc8\x2c\x5b\xf7\x94\xd7\xc0\ \xb1\x23\x05\x18\x1a\x3e\x02\x0a\xa3\xab\x5f\x0c\x02\x08\x2c\xa1\ \x02\xfc\xdc\xef\xae\xb8\x07\xc0\x6e\xc5\xc8\x77\xde\xfa\xb3\xb8\ \x65\xdb\x8f\x69\xab\xd7\x8f\x85\xa9\xd0\x1e\xcf\xab\x1e\xd1\x74\ \xe1\xcf\x24\x7d\xf1\x2a\x03\x74\x3d\x35\x43\x40\x3b\x2f\xa0\xc0\ \xcf\x2a\x40\x6e\xfe\x9f\x06\x3d\xa4\x00\x81\x6c\x22\x90\x1e\x02\ \xd9\x40\x20\xfd\x74\x2d\x20\x47\x59\x5a\x79\x42\xfc\x89\x97\x7b\ \x3b\xd6\xc1\xb5\x8b\x10\xb0\x30\x3c\x7c\x3c\x09\x6d\xc0\x93\x0b\ \x0c\x09\x80\x25\x52\x80\x9f\xfd\x6f\x2b\xef\xb2\x84\xb5\x5b\x5d\ \xcc\x87\x6e\xfb\x05\x6c\xdb\xf2\xa3\x20\x4a\xc0\x37\x25\x15\xf7\ \x73\x79\x40\x66\x5e\x11\x42\x24\x8a\x91\xf5\x08\xe7\x23\x7e\x30\ \xad\xde\x18\x11\xa4\xd6\x49\x0a\x10\x48\x0f\xa1\xf4\x11\xc8\x26\ \x42\xf2\x20\x29\x49\xf1\xe6\x4c\x0b\x29\xdf\xea\xd3\xf5\x02\x82\ \x63\xb9\xe8\x2e\xf5\xc1\x12\x36\x2c\x61\xe3\xc8\xf1\x03\xfa\x9e\ \xf0\x22\x64\x00\xc0\x12\x28\xc0\xcf\xdc\xd7\xb3\x43\x10\x76\x73\ \x94\xc8\xe3\x83\xb7\xfd\x3c\xae\xdb\xfc\x1e\x10\x45\xef\x63\x01\ \xa2\x49\x14\xe7\x73\x1e\x55\x34\x42\x81\x99\x0f\xb2\x39\x6f\x16\ \x80\xb2\x39\x7f\xca\x2b\x28\x6e\x60\xc6\xfb\xb4\xe5\x2b\x86\x2e\ \xc9\x47\x48\x01\x24\xf9\x29\xcb\x9e\xcb\xba\xb3\xd5\xc0\xe4\xa9\ \x9e\x0c\x31\xa4\x0c\xf8\x31\x71\x5c\xd5\x39\x08\xc7\x2a\xc0\xb6\ \x1c\x34\x9b\xb3\x18\x1b\x3f\xa3\x6f\x43\x10\xbc\x03\x15\xe0\xce\ \xfb\x7a\x06\x85\x6d\x47\x6c\x9f\x19\x1f\xb8\xed\x63\xb8\xee\xea\ \x77\x1b\x6e\x3f\x76\xfc\x29\x90\xa3\xb5\x89\x45\x1b\x85\x1f\xa4\ \x2d\x3f\x9a\xcb\xcc\x23\x63\xfd\x79\x96\x0f\x8e\x9e\x41\x88\xa7\ \xc4\x84\x90\x7c\x84\xe4\x47\x60\x68\x52\xd8\x5a\xf6\x8d\xe6\xb9\ \x05\xf8\x16\xcb\xa6\x8c\x17\x30\xc0\x37\xad\x9e\x8d\xac\x61\x45\ \x65\x5d\x54\x06\x16\x2e\x8e\x9e\xfc\x9e\x26\x80\xcc\x98\x7c\xe1\ \x21\x1c\x5f\x0c\x8c\x16\x4d\x01\xee\xbc\xaf\xa7\x5a\xb4\xec\x47\ \x44\xfc\x62\xa5\xeb\xae\x7e\x37\xae\xdd\x7c\x0b\x24\x49\x1d\xd7\ \x93\x67\x82\x85\x06\x31\x2d\x9a\xff\x67\x26\x99\xff\x19\xb0\x25\ \x05\x00\x90\xbc\x60\x81\xa3\x97\x2d\x70\x0c\x74\xe4\xf2\x33\xc4\ \x0f\x9c\x06\x3c\xa7\x16\xd0\x62\xf1\x26\x29\xa4\x36\x5e\xc0\x0c\ \x07\x2d\xef\x06\x32\xc7\x04\x10\xfa\xbb\xaf\x81\x63\xb9\xb0\xad\ \x02\x4e\x9f\x39\x62\x72\x9c\x45\xb1\x7e\x60\x11\x15\xa0\xc0\xd6\ \xfd\x00\x76\x30\x31\xd6\xf5\x6f\xc6\xae\xf7\xfe\x0c\x24\x85\x11\ \xd8\x02\x00\x44\x34\xe6\xcd\x00\x5e\x18\x21\x01\x50\x4e\x80\xa0\ \x7a\x01\x15\xb0\x00\x10\x52\x00\x6d\xf3\x4c\x20\x0a\x53\x8c\xbf\ \x85\xf4\xe9\x58\x9f\x57\xf0\x69\xa3\x04\x06\x07\x68\xb5\xf8\xf6\ \xbd\x81\x17\x0c\x3e\xa5\x3d\x41\x34\xe6\xd1\x85\x63\xb9\x38\x7c\ \xe4\x45\x53\xe9\x17\x85\x00\x02\x8b\xa4\x00\x3f\xfd\x5f\x7a\xee\ \x42\xdc\x9d\xdb\xd5\xd9\x8b\x0f\xed\xfc\x38\x88\x55\xcc\x17\x71\ \x5d\x5f\x80\x21\xe3\x69\x74\x83\x01\xc4\xe1\x21\xb1\xb6\x48\x54\ \x1c\x57\xf3\x99\x38\x1f\x2d\x9c\x1f\xfc\x3c\xe0\x5b\x6a\xff\xe7\ \x2b\x00\x9d\x8f\x03\xb4\x56\x07\x93\xe2\x50\x1e\xf8\x11\x91\xec\ \x28\xf6\xa2\xe4\x56\x60\x5b\x36\x6c\xcb\xc5\xc1\x37\x5e\xd0\xf7\ \x73\xb1\x08\x20\xb0\x08\x0a\x70\xe7\xbd\x3d\x55\x21\xc4\x6e\x55\ \x9c\xd9\x75\xfb\xbf\x06\x0b\x89\x66\x58\xd7\x6d\xf2\xde\x4a\xc1\ \xa9\x99\xd6\x62\x0f\x8c\xd4\x4e\x01\x9e\x05\x3f\x01\x39\xc3\xfe\ \x63\xeb\xce\xf2\x80\x74\xca\xd7\x4e\x09\xb2\x19\x41\x3e\xf0\xad\ \x15\xc1\x36\x1c\x20\x07\x7c\x22\x42\x7f\xf7\x16\x00\x16\x04\x2c\ \xbc\x7a\xe4\x7b\x50\x63\x21\x00\x60\x7a\x7a\x71\x6a\x00\xc0\x22\ \x28\x80\xd5\xc9\xbb\x11\x57\xf9\x76\xdc\x74\x1b\x7a\xab\xab\xa0\ \x6b\xfb\x30\xa2\x7a\x3a\xb7\xcb\xa1\x00\x26\xb3\x47\x32\x0f\x24\ \xd6\x0e\xb4\x05\xbd\xad\xf5\x5f\x44\x08\xc8\xad\x02\x66\xf9\x80\ \xaa\x0a\x52\xbe\xf5\x5f\x08\xf8\xc4\x84\x15\x95\xf5\xfa\x96\x1c\ \x3f\x7d\xc8\xc8\x66\x70\xfc\xe5\x47\xb1\x20\xcf\x01\xe6\xc9\x82\ \x2a\xc0\x9d\xbf\x53\xd9\x29\x20\xee\x62\x66\xac\xe8\x5d\x8d\xed\ \x37\xbe\x57\xc7\x6f\xc0\xa4\x74\x79\xa4\xcf\x24\x76\x48\x6e\x80\ \xf9\x5f\x93\xa2\x3c\xb7\x1f\xaf\x3f\x6f\x28\x20\xa4\x15\x23\xed\ \xf2\x29\x6e\xe3\x58\x2e\x98\x19\x3e\x35\x5a\x3d\xc1\x9c\xee\xbf\ \x8d\x22\xa4\x06\x83\xa6\xc1\x67\x96\xe8\xed\x58\xa7\x39\xc7\xc1\ \xd7\x9f\x07\x27\xf7\x67\xd1\xdc\x3f\xb0\xc0\x0a\x20\x84\x15\x55\ \xfa\x18\x78\xef\x8f\xfc\x78\xca\xf2\xa3\xed\x40\xfb\xd7\x12\xb1\ \x79\xd1\xc9\xba\x78\x9a\x38\x82\x56\xc0\x75\xcb\x36\xa0\xb7\xba\ \x7e\xc5\x39\x5a\x79\x40\xd1\xa9\xa0\xe8\x54\x74\x6a\x18\x48\x0f\ \x92\x82\x58\x39\x4c\x2f\x60\x02\xce\x6d\x2c\x3f\x01\x3e\xed\x09\ \x64\xaa\x38\x44\x2c\xb1\xa6\x7b\x33\xd4\x18\x81\xe3\xa7\x0e\x19\ \x77\x60\xe1\x7b\x00\x4d\x59\x30\x05\xb8\xf3\xb7\xbb\x3e\x05\x88\ \x41\x26\xe0\xfa\xeb\x7e\x08\xd5\x9e\x95\xa9\x7c\x1f\x00\x04\xb7\ \x03\x3f\x11\x36\x35\x26\x0b\x3c\x5a\x8b\x3e\x69\x45\x30\x40\xd7\ \xf3\xc8\xa4\x7c\x4a\x29\xd2\x69\xa0\x63\x15\xd1\xd3\xb1\x06\x42\ \x58\x90\x32\x00\xb3\x0f\xc1\x02\x92\x02\x0c\x0d\x1d\x45\x10\xf8\ \xd8\x38\xb0\x19\x66\x97\xb0\xa9\x10\x3a\x0c\x40\x66\x52\xc2\x74\ \xca\x97\x7e\x43\x68\xa4\x0c\xd5\xf2\x5a\x48\x0a\x60\x09\x1b\xe3\ \x13\x23\x18\x3d\x77\x5a\xdf\x01\xa2\xc5\x8b\xff\xc0\x02\x29\xc0\ \x1d\xf7\xa2\xca\xcc\xf7\x81\x81\x82\x5b\xc4\x8d\x37\xde\x1a\x81\ \xcf\x66\x5a\x27\xda\xda\xbe\x29\x66\xcc\xd7\xcb\x6a\xce\x20\x88\ \xb9\x19\x40\x0a\xf4\x1c\x37\x9f\xa7\x04\xcc\xa8\x96\xd7\xa2\xab\ \xd4\xa7\xab\x7f\x2a\x5b\x69\x78\x33\x78\x69\xef\xd3\x98\x9c\x38\ \x07\x66\xc6\xf8\xb9\x51\x5c\x7f\xe3\x4d\xb0\x6c\xfb\x02\xc2\x40\ \xa6\x4f\xa0\xad\x27\x90\xe8\xeb\x1a\x8c\x52\x64\x11\xe0\xd8\xd0\ \xc1\xd4\xfd\x98\x99\x79\x07\x84\x80\x6e\xa7\xf2\x29\xc4\x7d\xfb\ \x5b\xaf\xdd\x0e\xc7\x71\x62\xeb\x37\x13\xfa\xf3\x2b\x40\xb6\xde\ \x17\xcd\x29\x85\x48\x93\xc2\x56\x12\x98\x6c\x6f\x1f\x02\x12\xab\ \x07\x33\x84\xb0\xb1\xbe\x7a\x1d\x8a\x76\x07\x42\xf2\x21\xe2\x73\ \x14\x10\x98\xa8\x9d\xc5\x33\x2f\x3c\x86\xd9\x46\x3d\x6a\x4f\x8c\ \xc9\xf1\x71\xbc\xf4\xc2\xf3\xb8\xf6\xc6\x1b\xd1\xd1\xd9\x71\x61\ \x3c\x80\x32\xcb\x4a\x01\x8c\x2c\xa1\xbb\xbc\x1a\xa1\xf4\x01\x08\ \x1c\x3e\xfa\x62\x72\xed\x8b\x4c\x00\x81\x05\x50\x80\x3b\xee\x45\ \x95\xc1\xf7\x82\x81\x4a\xa5\x0b\x5b\xb7\xbe\x0b\xc4\x52\xe7\xfa\ \x00\x74\x97\xde\x85\x79\x80\xf8\x7f\x96\xf9\xe7\x7a\x80\x74\xec\ \x4f\x65\x03\xe7\x21\x81\x25\xb7\x0b\xeb\x7b\xae\x87\x6b\x17\x21\ \x29\x88\x1f\xc4\xb4\x00\x08\x1c\x3d\x79\x10\xcf\xed\xfd\x87\xe8\ \x18\x1c\x7f\x57\x3c\x6d\x34\x66\x71\xe0\xa5\x97\x30\xb0\x65\x33\ \x56\xad\xe9\x4b\x14\x00\xd9\x6a\x60\x9e\x27\x48\xba\x86\xd5\x7a\ \x30\xd0\x55\x5c\x19\x55\x28\x01\x9c\x3c\xf5\xba\x79\x3b\x16\xd5\ \xfa\x81\x05\x50\x80\x4e\xab\x7c\x0f\x38\xaa\xf5\x6f\xdd\xfa\xae\ \xc8\xfa\x49\xc6\x1d\x3c\x69\x0f\xa0\xff\xb7\x29\x04\xcc\xed\x01\ \x92\x34\x2f\xd7\x03\x18\xeb\xe7\x26\x81\x84\xb2\xdb\x8d\x6b\xfa\ \x7e\x18\x60\x68\x97\xaf\xac\x7f\xff\xa1\x67\xf0\xfd\x83\x7b\x22\ \x65\x33\x14\x20\x59\x66\x04\x32\xc0\x9b\x07\x0f\x63\xba\x36\x85\ \x8d\x5b\x36\x42\x75\x22\x25\xd3\x8c\x02\x64\xca\xc4\xba\xc8\x15\ \x9f\x6f\x67\xb1\x37\x1e\x3b\xc0\x38\x72\xe2\x80\x79\x17\x16\xad\ \x02\xa8\xe4\x92\x15\x80\x25\xee\x85\x0d\xb8\x6e\x01\x03\x9b\xae\ \x49\x88\x1f\xc3\x28\xfb\x02\xa9\xb7\x82\xb6\x26\xfd\xe0\xec\xd2\ \xf9\x3c\x40\x4a\x11\x5a\x63\x7f\x3b\x0f\xd0\x51\xe8\xc1\xf5\x6b\ \xee\x00\x00\x6d\xf9\x02\x16\x88\x18\xdf\xf9\xee\xd7\xf1\xda\xd1\ \x97\x72\x2d\xbf\x55\x21\x18\xc3\x27\x4e\x63\x7a\x72\x0a\x5b\xde\ \xb5\x05\x96\x63\xa5\x2c\x7e\x4e\x22\xc8\xa4\xaf\x65\x45\xc7\x06\ \x04\xd2\x07\x33\x70\x24\x13\xff\x69\x11\x86\x80\x65\xe5\x92\x14\ \xe0\x43\xbf\x5e\xbc\x07\x02\x83\x4c\x8c\x6b\xb6\x6e\x83\xed\xd8\ \xda\xfa\x81\x6c\x27\x4f\xc6\xec\xcd\xc5\x14\xfa\x59\x3f\x90\x70\ \x80\x84\xf1\x1b\xcb\x19\xf7\x9f\x97\x11\xa8\xe5\x4a\xa1\x17\xef\ \x5a\xfb\x01\x08\x08\xc3\xf2\x2d\x30\x11\xfe\xf1\x3b\x5f\xc2\xb1\ \xd3\x07\x72\x81\x0f\x1a\x01\xea\x93\x4d\x30\x31\xca\xdd\x45\xb8\ \x45\x47\x6f\x9b\x1a\xaf\x61\xdf\xd3\xfb\xb0\xf5\xe6\x6b\x50\xee\ \x2c\xe5\x13\x40\xc3\x13\x30\x12\x65\x02\xa2\x17\x62\x47\xd6\x4f\ \xa9\xfe\x7f\x00\x78\xe6\x4b\x8b\x9b\x01\x00\x97\xa8\x00\x02\x7c\ \xb7\x8a\xc5\x1b\x37\x6d\xd6\xc4\x4f\x18\xa0\x67\x7b\xfe\xb4\xe4\ \x78\x01\x73\x63\x52\x13\x48\x5b\x7c\xae\x22\xe4\x64\x04\x59\x25\ \xe8\x2a\xae\xc4\x0f\x6d\xf8\x08\x20\x04\x24\xf9\xb1\xe5\x0b\x30\ \x11\xfe\xe1\xc9\x2f\xe2\xe8\xa9\x03\x06\xe8\xd1\x77\x91\x64\x34\ \xa6\x3d\x78\x75\x5f\x9f\x59\x63\xca\x43\x58\x94\x28\x74\xb8\xd1\ \x59\x30\x83\x64\x88\x83\xcf\x1f\xc2\xc0\xf5\x57\x61\xc5\xda\x6a\ \x26\xed\x4b\x3a\x86\xf4\xb9\xea\x4b\x61\x94\xdd\x6e\x04\xa1\x07\ \xb2\x24\x86\x47\x4e\x24\x77\x60\x11\xeb\xff\xa6\xcc\x5b\x01\x3e\ \xf4\xab\x18\x04\xc4\x4e\x26\xc6\xc0\xe6\x2d\x28\x77\x94\xf5\x08\ \x1f\xb3\xc7\x2f\x0a\x05\x4a\x2e\x8a\x06\xea\xff\x66\xcc\x4f\x7b\ \x80\xd6\x30\x90\x47\x04\x1d\xab\x80\x9b\x37\x7c\x04\xae\x53\x8e\ \xd9\xbe\x15\x83\xcf\x78\xec\x89\x2f\xe0\xcd\x93\xfb\x5a\xdc\xbc\ \x0c\x25\xea\x13\x0d\xc8\x20\xa9\x64\x32\x63\x52\x08\x54\x03\x2f\ \x84\x0c\x09\xc5\x0e\x37\x19\xa9\xce\x8c\x63\xaf\x9c\x44\x6d\xac\ \x86\xab\x6e\x58\x87\xec\xf8\x00\x7d\x9e\x0c\x43\x71\x81\xa2\x53\ \x89\x46\x08\x93\x8b\x93\x43\x6f\x98\x37\xe2\xf2\x56\x00\xb2\xdc\ \x7b\xad\x18\x93\xab\x06\x37\xc5\xfd\xfc\x0a\x60\x91\xc9\x02\x52\ \x14\x70\x0e\x51\xc4\x2e\xb3\xac\xfe\xb7\x28\x42\x6b\x26\x90\x55\ \x02\xd7\x2a\xe2\x5f\x6c\xfe\x18\x2a\x85\x2a\x42\x0a\x60\xc1\x82\ \x8c\xc1\xff\xc6\xb7\x3f\x8f\xd7\x8e\x7f\x2f\x05\x3c\x98\x11\x78\ \x12\xf5\xc9\x86\xee\x90\x61\xc6\xf1\x50\xe2\xa3\x00\xe0\xd8\x78\ \x44\x08\x0c\x92\x24\x34\x67\x3c\xb8\x25\x17\xc2\x12\x7a\xff\xb1\ \xd3\x13\x98\x99\x9c\xc5\xc0\xf6\x75\x70\x4b\x96\x61\xf1\xad\xe0\ \xdb\xc2\x81\x25\x6c\xf8\x61\x13\xb3\x33\x63\xf0\xbc\x86\x79\x27\ \x16\xb5\x02\xa8\x64\xfe\x21\x80\xa3\xee\xde\x8e\x4a\x05\x2b\xfb\ \x56\xc6\xa9\x9f\xa1\x00\xa6\xeb\x37\xdc\x7d\xfb\x6a\x00\x9b\xcd\ \xd2\xeb\x4c\xa0\xe3\xe5\x24\x0c\xe4\x65\x03\x89\x32\x6c\xbf\xea\ \xa7\x50\x2d\xf7\x23\xd4\xa9\x5e\xd4\xf6\x91\x6f\xfd\x6f\x1c\x3a\ \xfa\x7c\x02\x4a\x0c\xa0\xdf\x08\x30\x5b\x6b\x26\x67\xc0\xd8\x53\ \x9b\xc2\x47\x55\x3e\xbe\xfd\x4e\xdc\xdc\xd3\x8d\xdd\x42\x44\xef\ \x2d\xf0\x1b\x01\x1c\xd7\x86\xb0\x85\xf6\x04\xb3\x53\x0d\xbc\xf6\ \xec\x31\x0c\x6c\x5f\x8b\x4a\x6f\x19\x5a\x79\x33\xee\xbf\x52\xec\ \x85\x1f\x36\x61\x5b\x61\xd6\xfa\x97\x84\x00\x02\xf3\x54\x80\x7f\ \xf9\xef\xad\x7b\x10\xa7\x7e\x9b\xb7\x5e\x93\xaa\xfa\x69\x2f\xc0\ \x06\xd4\xa2\x1d\xe8\xc6\x88\x1f\x53\x34\xe0\xc9\x7f\xd3\xfa\xd3\ \x7c\x80\x5b\x14\x42\xad\xbb\xae\xff\x76\x6c\x5e\xf5\xee\x54\x91\ \x87\x19\x78\xf8\x1f\x1f\xc0\x2b\x6f\x3e\xd3\x42\xf8\xbc\x19\x1f\ \x4d\x23\xde\x33\xe1\x73\xdf\x79\x30\xfd\xc3\x0c\xb1\x22\x7c\xf4\ \xf6\x4f\xe0\x33\x96\xc0\x7d\x00\x10\x06\x12\x42\x0a\x58\xb6\xa5\ \x15\x29\x94\x12\x6f\xbe\x30\x84\x75\xd7\xf5\x61\xd5\x40\x35\xf1\ \x30\xf1\xf5\x31\x03\x05\xa7\x8c\x20\x6c\x40\x0a\x17\xa3\xa3\x6f\ \xa5\x6e\xc1\x52\x10\x40\x60\x9e\x0a\x20\x2c\xdc\xa9\x2c\x6f\xfd\ \xe0\x55\x91\xfb\x8f\xfd\x7c\xaa\xde\x2f\x92\xa1\xde\x17\xf7\xdb\ \x14\xca\xf2\xf5\xbf\x36\xd6\xaf\xb6\xb4\x72\x81\x15\x95\xf5\xb8\ \x75\xe0\xa7\x75\x85\x0d\x00\x88\x19\xcf\xbe\xf4\x18\xf6\xbf\xfe\ \x64\x6c\xf5\x89\x02\xcc\x4e\x35\x11\x34\x43\x7d\x06\x44\xf8\xe4\ \x53\x0f\xe2\x2f\xdb\x9d\xe1\x53\x7f\x85\xcf\xdc\xf6\xf3\xd8\x67\ \x09\xec\x56\x4f\x34\x4b\x96\x7a\x94\x93\xba\x3f\x6f\x1d\x1e\x45\ \x63\xca\xc3\xda\x6b\x57\xc1\xb6\x2d\x23\x14\x30\x42\x19\xc0\x0f\ \x9b\xb0\x44\x88\xe1\xe1\x53\xc9\xd5\x2f\xd2\x33\x00\x79\x72\xd1\ \x0a\x70\xc7\xdd\xa8\x82\xc4\x5d\x0c\x46\xff\x86\x75\xb0\x1d\x2b\ \x72\xff\x40\xae\x17\x50\x92\xe2\x00\x73\x8c\x08\x49\x07\x02\x93\ \x13\xe4\x29\x42\x2b\xf0\x0c\xa0\x60\x97\xf1\xe1\x6d\xbf\x85\xec\ \x5e\xcf\xbd\xf4\x18\xbe\xf1\xe4\x9f\x40\x73\x84\x18\xfc\xc6\xb4\ \xa7\xc1\x67\xc6\x24\x33\x3e\x3d\x17\xf8\x4a\x9e\x7e\x10\x5f\x7f\ \xef\xc7\x70\xdc\xb1\xb1\x5b\xc4\xaf\xbe\x4d\xba\xac\x13\x99\x78\ \x6b\x0a\x8d\x69\x0f\x03\x37\xf5\xc3\x2d\x39\xc9\xf7\xfa\xd3\xf0\ \x83\x06\xc0\x16\x26\x27\xce\x99\x97\xbd\x24\xee\x1f\x98\xdf\x4b\ \xa2\x76\xaa\x54\x69\xf5\xfa\x35\xf1\xb3\xed\xf1\xa3\xce\xe6\xbb\ \x6e\x28\xfd\xd8\xb3\x8c\x07\x66\x46\x4f\xc4\xaa\x5f\xc3\x4a\xda\ \x49\x0e\xe3\xed\xc6\x23\xd3\xea\xb8\xf1\x7a\x49\xa1\xd1\x5e\x26\ \xbf\xac\x95\x79\xd4\x7a\xd7\xd6\x5f\x44\xc1\x29\xa5\xea\x00\x47\ \x4f\x1e\xc0\xc3\xff\x7c\x7f\x94\xb6\x11\xc7\x2f\x5c\x62\x34\xa6\ \xd2\xe0\x87\x12\xbb\x2e\x04\x7c\x25\xcf\x7e\x19\xfb\x6a\x53\xd8\ \xc5\x3c\xf7\x3e\xcd\x69\x0f\x6f\xbe\x30\x84\xa9\xb3\x33\x49\xc8\ \xf1\x67\xe1\x85\x0d\x8c\x8c\x9c\x4e\xb5\x5d\x2a\x02\x08\xcc\xc3\ \x03\x08\x81\x3b\xd4\x18\x8f\xde\x55\x55\x10\xc5\xd6\xaf\xea\xfd\ \xba\x07\x50\x2d\xeb\x3d\x2f\xe2\x5b\x8c\xe8\x9f\xc3\x07\xb2\x79\ \xbf\xf6\x01\xcc\xd8\xbe\xe1\x43\x18\x58\xb1\x1d\x92\x02\x3d\xf0\ \x62\x64\xec\x04\xfe\xec\xe1\xdf\x32\x58\x7d\x64\x81\xcd\xba\x8f\ \xc0\x33\xc0\x0f\x9c\x0f\x78\x6f\x6c\x3f\x78\xcb\x2d\x70\x2f\xe2\ \x64\xb1\xf7\xd1\xbd\x75\x00\xbf\xfc\xbe\x8f\xe3\x80\xb0\xf1\x47\ \xed\xda\xc9\x90\x70\xf2\xc0\x08\xfa\x06\x7b\xb1\x6a\xa0\x8a\x90\ \x7c\x34\xbc\x19\x8c\x8e\x9c\x49\xb7\x5b\x22\x02\x08\xcc\x43\x01\ \x88\xb0\xd3\x12\x8c\xae\xde\x2e\x14\x3a\x8a\xd1\x03\x1e\x22\x9d\ \xf6\xa5\x47\xfb\x9a\x7d\x00\x17\xa0\x04\x6c\x06\x81\x3c\x45\xc8\ \x84\x00\x24\x0a\xd1\x55\x5c\x85\x5b\xae\xfa\xc9\xf8\x81\x8e\x00\ \x92\x42\x4c\xcd\x8c\xe3\xf3\x0f\xff\x0e\x66\x1b\xd3\x29\x06\x1e\ \x78\xd2\xb4\xfc\xa9\x60\xaa\xfb\xdf\xce\x1c\x1d\x38\x03\xf8\x6b\ \xe6\x3a\xbd\x72\xb9\x0c\x29\xa5\xb4\x2c\x8b\x3d\xcf\x23\xdf\xf7\ \xe5\x0d\x37\xdc\xc0\xae\xeb\xd2\x5b\x2f\xd4\xff\x7c\xcd\x2d\xc7\ \x5e\xb5\x0b\xf2\x2b\x42\xa0\xa7\xdd\x31\x46\x8f\x4f\xa0\x39\xed\ \xa1\x7f\xeb\x2a\xcc\x7a\x35\x8c\x8f\x9d\x4b\x6d\x5f\x8c\x87\x40\ \xdb\xc9\xc5\x7b\x00\x60\x07\x33\xa3\xab\xa7\xd3\x00\x3f\x1b\xfb\ \xa3\x96\x2d\xa0\x73\xbb\xa2\x50\x4e\x0a\xd8\xd6\xf2\x8d\xf6\x19\ \x25\xb8\x63\xeb\x3d\xb0\x2c\x3b\x7e\xc0\x23\x44\x28\x7d\xec\xfe\ \xfa\x7f\xc5\xe9\xb3\x6f\xa6\x88\x59\xe8\xcb\x54\x75\x4f\x4e\x57\ \x7f\xb3\x79\x72\xd3\x49\xc7\x41\x57\xde\x35\x5b\x96\xc5\x42\x08\ \x96\x52\x4a\x22\xa2\x30\x0c\xc9\x75\x5d\x59\x2a\x95\xd8\x75\x5d\ \xe9\x79\x1e\x09\x21\xa8\xb7\xb7\x97\x66\x0e\x57\x9e\x2b\x0f\xbe\ \x79\x7b\xa1\xbb\xfe\xa0\x10\xb8\xa9\xdd\x7d\x9c\x3e\x37\x0b\x7f\ \xff\x19\x6c\xbc\xce\x46\x7d\x6a\xc6\xbc\xec\x3d\xed\xf6\x59\x0c\ \x99\x77\x1d\xa0\x52\xed\xd4\xe9\x9f\x06\x9a\xb3\x63\xfb\xc5\xbc\ \x43\x80\xde\x6d\xae\x1a\x80\xde\xce\xd8\xb6\xee\xfd\xe8\xeb\x1c\ \xd4\x75\x75\x62\x89\x6f\x3e\xfd\x45\x1c\x78\xe3\xa9\x54\x9e\x4f\ \x92\xe0\xcf\x26\xcf\x17\xc8\x99\xce\xcf\x34\x87\xae\x3e\x60\x59\ \x28\x67\xcf\xc2\xb2\x2c\x0a\xc3\x90\x00\xb0\x65\x59\x92\x99\x45\ \x18\x86\xd2\x71\x1c\x61\x59\x96\x08\x82\x80\x5c\xd7\x85\xeb\xba\ \xc2\x71\x1c\xe1\x79\x9e\x70\x5d\x57\xd4\x8f\x6e\x3e\x15\xac\x19\ \xfb\xc9\xca\x9a\x33\xbf\x27\x6c\xfe\x78\xbb\xab\xf4\xea\x3e\xde\ \xd8\x7b\x2c\x7b\xe9\x4b\x66\xfd\xc0\x25\x28\x40\x67\x4f\x87\xf1\ \xa0\x47\xb6\xf2\x97\x0f\xfc\x9c\x61\x20\x65\xf1\xd9\x39\xd6\x8b\ \x8a\xf1\x9b\x75\x01\xd7\x2e\x61\xfb\x86\x0f\x46\xe0\x83\xc1\x4c\ \x38\x36\x74\x10\x7f\xfb\xad\xff\x99\x4a\xbb\x54\xe1\x46\x79\x02\ \x39\x5b\xfe\x42\xf3\xe4\x75\xff\x24\x04\x4a\xfa\x1c\x23\x4b\x67\ \x21\x04\x01\x20\xcb\xb2\xc8\xb2\x2c\x0a\x82\x40\x10\x91\x74\x1c\ \x07\x52\x4a\x10\x91\x90\x32\x2a\x7d\x87\x61\x08\x22\x12\xc5\x62\ \x11\x9e\xe7\xa1\x50\x28\xa0\xf1\x56\xef\x4c\x38\xba\xfa\xd7\xbb\ \x6e\x38\xf8\x8c\xed\x86\x7f\x72\xa1\xf7\x95\x96\xa0\x0b\xd8\x94\ \x79\x2b\x40\xb9\x27\xae\xfd\xb7\x8d\xff\x66\x21\x28\xd9\x9e\x57\ \xf7\x69\x15\xa3\x62\xa6\x77\x48\x77\x10\x99\x65\xe0\x1f\xdd\xf4\ \x53\x10\xb0\x10\xc8\x26\x18\x8c\x99\x7a\x0d\x9f\xff\xda\x7f\x06\ \x91\x7e\xb6\x2e\x8a\xfb\xcd\x10\x24\xa3\xfd\xc8\x77\x9f\x6e\x1e\ \xdf\xf6\x7f\x81\x84\xf0\x09\x21\x98\x88\x48\x08\xc1\x96\x65\x09\ \x22\x12\x96\x65\x81\x23\x11\x8e\xe3\x58\x52\x4a\x76\x1c\x87\xe3\ \x30\x60\x85\x61\xc8\x85\x42\xc1\x0a\xc3\x50\x12\x91\x88\x15\x43\ \x54\x2a\x15\xd1\x6c\x36\x45\xe3\xf5\xed\x5f\x2e\x0f\x1c\xdc\x6f\ \x55\x9a\x8f\xcf\xc5\x0b\x8c\x5b\xb5\x64\x19\x00\x70\x09\x0a\x60\ \xd9\x88\x0a\x1f\x0a\xec\x54\xe7\x4f\xba\x18\xd4\x3e\xf6\x9b\x92\ \x63\xfb\x59\xf7\x8f\x84\xf0\xa9\xf5\x6b\xba\x36\x63\xe3\xca\x9b\ \x10\xc8\xa6\x5e\xf7\x8d\x7f\xfe\x3c\xc6\x6b\x67\x92\xfd\x19\x90\ \x81\x8c\xde\xb6\x09\x80\xa4\x75\xa4\x39\x74\xf5\x1f\x33\x73\x21\ \x3a\x45\xc1\x06\xf8\x82\x22\x11\x96\x65\x81\x88\x98\x99\xd9\x75\ \x5d\x26\x22\xb8\xae\x2b\xc2\x30\xb4\xd4\x32\x33\x0b\x05\x3c\x11\ \x09\x00\x30\x15\x21\x0c\x43\x71\x66\xff\x86\x03\xab\xae\x1d\xdf\ \x56\x58\x31\xfe\xf7\x73\xf1\x02\x66\x4c\x3e\xf5\x20\x8e\xa3\x6d\ \x89\x74\xe1\x65\x5e\x0a\xe0\xb8\x36\x88\xc3\xa4\xf0\xa3\xc2\x40\ \xbc\x14\x4d\xcc\x2a\xa0\xb1\xfe\xbc\x92\x93\x03\xe8\x8a\x5f\xb2\ \xac\x96\xae\xef\x7f\x1f\x82\xb0\xa9\x43\xcb\xeb\x47\xbe\x8f\xa7\ \xf7\x7e\x3d\x89\xfb\x00\x98\x18\x61\x10\xbf\x81\x44\xa2\x1e\x8c\ \xae\xfb\x1c\x35\x2b\x1e\x00\x37\x06\x9f\x0c\xf0\x95\xd5\x4b\x66\ \x16\x00\x84\x65\x59\x16\x11\xb1\x6d\xdb\x4c\x44\x31\xf5\x88\x80\ \x2f\x14\x0a\x42\x4a\x89\x62\xb1\x28\x82\x20\x10\xe5\x72\x59\x78\ \x9e\x97\x02\x6f\xc5\x8a\x15\x98\x78\xd3\x9e\x2a\x16\x37\xbc\xb7\ \xfa\xae\x03\x7f\x20\x6c\xfe\xf5\x36\x97\xfe\x32\x12\xf0\x97\x44\ \x09\xe6\xa5\x00\x1d\x3d\xe5\xb8\xfc\x0b\x20\x87\x03\x9c\xef\xa1\ \xcf\xd6\x05\xce\x99\xa4\x2b\x82\x2d\xd5\x40\x06\x06\x56\xde\x84\ \x6a\xc7\x5a\xf8\xb2\x09\x01\xa0\xd1\xac\xe3\xa1\xc7\xfe\x58\xbb\ \x79\x93\xf5\xab\xc3\xc9\x46\xf7\x97\xc3\xf1\xfe\x13\x42\xc0\x89\ \x9a\x44\x55\x8d\xd8\xda\xc9\xb6\x6d\x41\x44\x82\x99\x85\xc8\xf0\ \x15\xdf\xf7\xe1\x38\xc9\x2d\x8b\x15\x04\x00\xe0\x79\x1e\x5b\x56\ \x7e\x5d\x6d\x7c\x7c\x1c\xb6\x1d\xfd\x34\x43\xfd\xf0\x0f\xfd\x4e\ \xf9\xda\xef\xef\xb7\x6c\xfa\x43\x21\xd2\x3f\xfe\xc8\xad\xf1\x7f\ \xd1\x95\x60\x5e\x0a\x10\x55\xd3\xa2\x87\x3d\x85\x40\x8b\x27\x50\ \xa7\xdc\x02\x7c\x4b\x69\x38\x5e\x9d\x3e\xba\x19\x03\xd2\x54\x30\ \xa3\x04\x5b\x56\xff\x48\x0c\x7e\xf4\xbd\x4f\x3c\xfb\x37\x18\x9f\ \x3c\x9b\xca\xf7\x49\xb2\x2e\x00\x51\xe0\x1c\xf0\x4e\x6e\xfd\x3b\ \x00\x1a\x60\x21\x84\xc5\x26\xb9\x88\x4f\x6f\x2e\x45\xd0\xd7\x20\ \x12\xaa\x1b\x7b\x00\xae\xd7\xeb\x29\x25\x51\x62\xdb\xb6\x6e\x3b\ \xf4\xcc\x55\x7f\xb5\xf1\xd6\xd3\x2f\xa3\x14\x7e\x4d\x08\x0c\xe8\ \xe3\x2d\x71\x06\x00\x5c\x02\x07\xd0\xcf\xf9\xb7\xed\x05\x4c\xc6\ \x03\x5e\xc8\x03\x21\xa6\x70\xca\x15\x64\xea\x01\xb1\xfb\xdf\xd0\ \x7b\x03\x1c\xab\x80\x20\x6c\x00\x42\xa0\x56\x3b\x87\x67\xbf\xf7\ \x0f\xf1\x8f\x2a\x25\x5e\x42\xbf\x64\x41\xa2\xee\x0d\x5f\xf5\x00\ \x62\xf0\x81\xc8\x82\x0d\x25\x60\x66\x56\xdb\xce\x6b\x75\xbe\xef\ \xb3\xb2\x6a\x20\xf2\x00\x8e\xe3\xb0\x65\x45\xa3\x24\xea\xf5\x3a\ \xbb\xae\xcb\x8e\xe3\xb0\x09\xfe\xc8\xc8\x08\xdb\xb6\x8d\x73\x07\ \xb7\xee\xeb\xb9\xf6\xc4\xad\x6e\xa5\xfe\x35\x61\xe1\x0e\x00\x20\ \x5e\x5a\x02\x08\x5c\xaa\x07\x50\xb9\xbe\x31\x02\xc8\x04\x3f\x95\ \x1a\xa6\x64\x8e\xde\xa0\xcc\x3a\xce\x2a\x41\x6c\xad\x83\x2b\x6f\ \x86\x2f\x1b\xd1\xe8\x1e\x21\xf0\xed\xa7\x1e\x46\xb3\x59\x47\xd2\ \x84\xc1\xc9\x60\x1e\xc8\x46\xf7\x57\x68\x66\xe5\xa8\xe9\xb6\xf5\ \xd9\x08\xa1\x98\x25\x0b\x21\x98\x99\x85\x94\x52\x81\x99\x3a\xb1\ \x20\x08\xd8\x71\x1c\x96\x52\xc2\xb2\x2c\x0e\x82\x80\x14\xf0\x0a\ \x7c\x35\xcd\x8a\xeb\xba\x6c\x4e\xfd\x93\xd7\x4d\x3c\xb7\x77\xef\ \x8f\xbd\xef\xe3\xf8\x05\x16\x38\xfe\xf4\x97\x71\x3c\xf3\x7d\x97\ \x27\x07\x30\xd3\xb0\xa4\x20\xa3\xb6\xa9\xc2\x90\xfe\x87\x64\xee\ \xfc\x9e\x20\xaf\x37\x30\x9b\x12\xae\xed\xd9\x1a\x5b\x85\x64\x98\ \x50\x00\x00\x0d\x37\x49\x44\x41\x54\xbf\x07\x21\x04\xa6\xa7\x26\ \xf1\xf2\x81\xe7\x92\x22\x91\xe1\x01\x00\x80\xa5\x38\xeb\x9d\xdc\ \xfa\x0d\x66\x4e\x05\x69\x03\x78\x00\x80\x65\x59\x3a\x58\x65\xdb\ \xc5\x40\x93\x94\x52\x83\x1c\xa7\x8b\xac\x42\x41\xa3\xd1\xd0\x16\ \xaf\x14\xa2\x56\xab\x71\xa1\x50\x60\xc7\x71\x38\xb6\xfe\x16\x50\ \xbf\xf3\x25\x7c\x31\xfb\x9d\x4b\x25\xf3\x52\x00\xbf\x11\xe6\x74\ \x7b\x2a\x88\x5b\x6b\xf9\xe9\xb9\x8b\x14\xce\xce\x32\x56\x75\x0e\ \x20\x90\x4d\x08\x11\x3d\x4f\xff\x9d\x67\x1e\x8b\x5f\xbc\x94\x7f\ \x88\x70\xbc\xff\x81\x76\xe0\xc7\xe9\x1f\x0b\x21\x74\xca\xa7\x2c\ \x5f\xd5\x04\xe2\xc2\x90\x06\x5a\xcd\xfb\xbe\xcf\xae\xeb\xb2\xe7\ \x79\x5c\x28\x14\x48\x79\x0d\xcb\xb2\xd8\x75\x5d\x52\xca\xe0\x38\ \x0e\x9b\xd6\x5f\x28\x14\xb8\x5c\x2e\xf3\xde\xbd\x7b\xb3\x1e\x66\ \x49\xad\x1f\x98\xb7\x02\x04\xfa\x66\x27\x36\xdd\xca\xdd\x17\x4c\ \x8c\x83\x76\x14\xaa\xa8\x14\xaa\xf1\x40\x0a\x0b\xbe\xef\xe3\xe0\ \xc1\x17\xdb\xee\x4a\x81\x73\xc0\x1f\x5d\xff\x8a\xc9\x40\x33\xe0\ \x93\x4a\x05\x39\x22\x05\x0a\x68\x62\x66\x64\xb7\xd9\xb6\x4d\x61\ \x18\x92\xe3\x38\xa4\x52\x42\x05\xba\x65\x59\x6c\xdb\x36\xc7\xf1\ \x1f\xca\xfa\x01\x1d\xfb\x19\x00\x0c\xf0\xcd\x2b\x5c\x72\xf0\x81\ \x4b\x20\x81\xcc\x9c\x7e\x97\xb3\x16\xa3\xe2\x37\xc7\xf8\x8f\x39\ \x8f\xdd\x32\x93\xac\xe8\xeb\x8a\xad\x1f\x16\x84\xb0\xf0\xca\xc1\ \xbd\x73\x1e\x4b\x4e\xf6\x7d\x35\x75\x76\x6d\xc0\x27\x22\x8a\xd2\ \x7d\x62\x29\x25\xdb\xb6\xad\xd7\x2b\x97\x1e\x86\x21\xd9\xb6\xcd\ \xb6\x6d\x53\x6c\xfd\xe4\xfb\x3e\x15\x0a\x05\x52\xee\xbf\x5e\xaf\ \x73\xb1\x58\xa4\x7a\xbd\x4e\xa6\xf5\xdb\xb6\xcd\xca\xfa\x33\x97\ \x9a\xbd\xca\x25\x0d\x05\xf3\x56\x80\xfa\xf8\x2c\x2a\xbd\x1d\x29\ \xa0\x23\x89\xce\xdf\x2c\x02\x5d\x64\x12\x60\x1e\x26\x3b\x8b\x8e\ \xd8\xfa\x95\xfb\x3f\x74\xe8\xfc\xd6\xaf\x88\x9f\x02\x9f\x99\x29\ \x76\xf5\x04\xc3\xd5\xab\x29\x00\x8a\x95\x80\x98\x59\x5b\x3c\x00\ \x8e\xe7\xd9\xb6\x6d\x12\x42\xb0\xe3\x38\x64\xba\x7d\x29\xa5\x76\ \xfd\xc5\x62\x91\x5c\xd7\xe5\x91\x91\x11\x2e\x95\x4a\x79\xae\x3f\ \x21\x52\xad\x97\xba\x24\x32\x6f\x05\xf0\x1b\x21\x3a\xaa\x46\xba\ \x26\xd2\x7a\x60\xa8\x81\x91\x5d\x5f\xc0\x81\xb9\xed\x02\x3a\x8b\ \x2b\x41\x24\xe1\x73\x13\x16\x2c\x4c\x4e\x4c\xa0\x36\xd1\xfe\xe1\ \xd9\x70\xba\xf7\xef\xd4\xbc\x10\x82\x8c\x78\xaf\x80\x66\xc3\xf2\ \xc9\xb0\x78\x22\x22\x92\x52\x32\x11\x91\xe3\x38\x14\x04\x01\xbb\ \xae\x4b\x00\x48\x31\x7f\x35\xf5\x3c\x8f\x5c\xd7\x25\x95\xfa\xe5\ \xb9\xfe\x0b\x88\xfb\xef\x1c\x12\x08\x00\x63\x27\x27\xd1\xb9\xb2\ \x03\xb6\x1b\x71\xab\xe8\x6d\xad\x22\xd7\x1b\xb4\x5b\xbc\x58\x29\ \xb9\x5d\x51\xec\x8f\xdd\xff\x29\xe3\x5d\xfa\x59\x61\x29\x46\x82\ \x33\x03\xcf\x03\x10\x79\xe0\x2b\xc0\x2d\xcb\x62\x13\x7c\x33\x1c\ \x00\x90\xaa\xbd\xe3\x38\x32\x0c\x43\x92\x52\x92\x6d\xdb\xac\x5c\ \xbf\xe7\x79\x54\x2c\x16\xc9\x24\x7e\x85\x42\x81\x1c\xc7\xe1\xf1\ \xf1\x71\x52\xae\xff\x3c\x71\xff\x6d\x01\x1f\x98\xc7\x98\x40\x35\ \x60\xa1\x39\xe3\xe3\xf8\xf7\xdf\x8a\x9e\x9c\x61\xe8\x41\x96\x6c\ \x8c\xb7\x53\x63\x07\x2f\xe9\x63\x1c\xcf\xb1\x0a\x08\x82\x26\xfc\ \x30\xfa\xbc\x75\xea\x74\xdb\xf3\x94\x5e\xf9\xdb\x39\x4c\x3f\x05\ \x7e\x2c\x32\x26\x79\xa9\xa9\x1a\xf8\x11\x7b\x07\x19\xc7\x7f\xfd\ \x71\x1c\x87\x3c\xcf\x23\x15\x02\x9a\xcd\x26\x39\x8e\xc3\x33\x33\ \x33\x34\x47\xdc\xe7\xcc\x07\x78\x1b\xc1\x07\xe6\xa1\x00\x34\x8e\ \x9f\xe6\xb8\x64\xa9\x94\x20\xf4\xe5\x1c\xe0\x29\xe5\x40\xeb\xe5\ \xe7\x7c\x98\x11\xed\x93\x51\x22\x4b\x44\x0f\x9e\x2a\xf0\x9b\xcd\ \x59\x4c\x66\x86\x52\x99\x12\x9c\x5b\xf3\x2d\x20\xd5\xc5\xab\x40\ \x97\xa6\xb5\x5b\x96\x95\x0b\xbe\x94\x52\x2a\xc6\x6f\x59\x16\xd9\ \xb6\x4d\x41\x10\x90\x6d\xdb\x24\xa5\x94\x0a\x78\xd7\x75\xa9\xd9\ \x6c\x52\xa1\x50\xa0\x99\x99\x19\x6d\xf1\x63\x63\x63\x94\x49\xf9\ \xcc\x9f\x3d\xbb\x2c\xc0\x07\xe6\xa1\x00\x4f\x3f\x8e\x49\xbf\x89\ \xf7\x73\x5c\xb6\x6c\xce\xf8\x78\xf3\x85\x21\x34\xa6\xbd\x18\x30\ \x64\x3e\x0c\x50\xf4\xe1\x0b\xf8\x80\xa2\x1d\xb3\xc7\xb1\xe0\x68\ \xf0\xfd\xa0\x81\xf1\x73\xa3\x90\x24\x73\xcf\x91\x42\xeb\xa8\x9c\ \x5a\x71\x86\x88\x74\x8c\x37\x40\x37\xdd\x7f\xca\xed\x2b\x25\xb0\ \x6d\x5b\x1a\x40\xcb\x30\x0c\x55\xdc\xa7\x20\x08\x48\x8d\x07\x54\ \x71\xbf\x50\x28\x50\xad\x56\x63\xdb\xb6\xb9\x5c\x2e\xd3\x3b\x05\ \x7c\x60\x7e\xbf\x1e\x2e\x4e\x1d\x82\x77\x62\x3f\xfe\xcf\xc6\x1b\ \x31\x28\x2c\x6c\x67\x62\x4c\x8f\xd6\x51\xe9\x2d\xc3\x76\x6d\x7d\ \x69\xf3\x21\xff\xa6\xe8\x0a\x23\x03\x8e\x5d\x40\xf4\x1c\x7f\x34\ \xfc\x7b\xe4\xd4\x19\xd4\xce\xe5\x13\x40\x9a\xed\xfc\x9a\x9c\x5a\ \x75\x58\x55\xea\x60\x90\x3d\x66\xa6\xb8\xdc\x2b\x11\x8f\xf8\x61\ \x66\x1d\xf3\x2d\xcb\x62\x29\xa5\x62\xf3\x32\x9e\x97\xae\xeb\xca\ \x78\x38\x18\x79\x9e\xa7\x52\x3f\x72\x5d\x97\xa6\xa7\xa7\xb9\x50\ \x28\x50\xb9\x5c\xa6\x91\x91\x11\x2e\x16\x8b\x73\x81\x7f\x59\x00\ \xaf\x64\x5e\x0a\x80\xf8\x5d\x2a\x9d\xf2\x86\xc7\x3a\xfa\x47\x07\ \x85\x30\x95\xa0\x04\xdb\xb5\x21\x72\xdc\xfb\x05\xa9\x44\x3c\x64\ \xdb\xbc\x55\x0c\xc0\x16\x6e\xdc\x07\x11\x3d\x0f\x70\xea\xcd\x53\ \xf0\x9b\x7e\xee\x21\xfc\xf1\x55\x5f\x08\x67\x3a\x26\x54\xff\xbd\ \x4a\xf9\x0c\x2b\x6f\xf1\x00\xcc\x2c\x2d\xcb\xd2\xc0\x0b\x21\x64\ \x3c\xaf\x99\xbf\xeb\xba\x8a\xf4\x49\x05\x7e\xbd\x5e\x27\x13\xfc\ \x52\xa9\x44\xef\x14\xf0\x81\x05\xf8\xf5\xf0\x13\x4f\x0d\xfc\x0a\ \x13\x1e\x04\x92\x71\xef\xcd\x19\x3f\x27\x14\xe0\x82\x42\x40\xee\ \x7e\xcc\x08\x42\x0f\x7e\xd0\x84\x17\x34\xe0\x05\x0d\xd4\xa7\xeb\ \xb9\xe7\xc3\x52\x8c\xc8\xf1\x75\x6f\x98\xe0\xe6\xb9\x7a\xb5\x2e\ \x1e\xec\x29\xd5\x00\x50\xc7\x71\x64\x4c\x01\x64\xec\x01\x64\x18\ \x86\xb2\x50\x28\x48\x45\xfa\xb2\xe0\xab\x3a\x7f\x06\xfc\x3c\xe2\ \x77\xd9\xc9\x7c\x14\xa0\xe5\x62\xea\xaf\xde\xf2\xab\x4a\x09\x28\ \x24\x0c\xbd\x32\x82\xe6\x8c\x37\xff\x6c\xa0\x45\x31\x00\x29\x43\ \x04\xa1\x87\x20\xf0\xd0\x68\xd4\xf5\x6f\xe9\x64\x85\xa4\xbb\x2f\ \x76\xfd\x52\x81\x6c\x12\x3f\x05\x38\x11\x49\xcb\xb2\xa4\x22\x7c\ \x14\x0d\xf8\x94\x8a\xf4\x29\xf0\xb3\x8c\xdf\xf7\x7d\x19\x97\x7b\ \xb5\xe5\x8f\x8f\x8f\x53\x0e\xf8\x79\x8c\xff\xb2\x93\xf9\x84\x00\ \x20\xf2\xe5\xa2\xaf\xaf\x4f\x00\x40\xad\x56\x13\x62\x6a\xf0\xf1\ \x52\xdf\xd9\x01\x61\xe1\x26\x26\xc6\xf4\xb9\x59\x74\xf4\x94\xa2\ \x3a\xc1\x05\x66\x00\x73\xde\x2a\x16\x71\x96\xc0\x68\x4c\x37\x31\ \x3d\x96\xef\x01\x68\xb6\xf2\xb7\xc1\xe4\x8a\x37\x28\x1a\x10\xaa\ \x7a\xec\x74\x9c\x37\x5d\x3e\x00\x56\x20\x4b\x29\xa5\x10\x42\x15\ \x81\xa4\xaa\xfe\x49\x29\x65\x10\x04\xd2\x71\x1c\x52\x85\xa0\xd9\ \xd9\xd9\xf3\xb9\xfd\xcb\x8e\xec\xb5\x93\x4b\x7a\x45\x4c\xb9\x5c\ \x66\xdf\xf7\x75\x60\x1f\x79\x71\xeb\xaf\xad\x7e\xcf\xeb\xc2\xb2\ \xf8\x63\x14\x12\x4e\x1d\x3a\x8b\xf5\xd7\xf7\xa1\x58\x31\x9f\xb4\ \x9a\x8b\x07\xb4\xa9\xff\x66\xc4\x7c\xa8\x23\x2b\xe1\xd4\x8a\x97\ \xd4\x18\x7e\xd5\x7b\x97\x8d\xf3\x8a\x10\x2a\x97\xaf\x72\x7c\x19\ \x8d\xf3\xa6\x30\x0c\xa5\xeb\xba\x2a\x0c\x10\x33\x93\x4a\xf7\x1a\ \x8d\x46\xae\xdb\x3f\x74\xe8\x90\x02\xbe\xcd\x05\x5d\x9e\x32\x5f\ \x0e\x90\xb2\x55\x95\xfb\xda\xb6\xcd\xde\xeb\xef\xf9\x35\x96\xe2\ \x4f\x81\x68\x34\xce\xd0\x2b\x23\x98\x3a\x5b\x8f\x73\xfb\xf3\xf1\ \x00\x24\x1f\xb3\xb8\x64\x84\x05\x22\xd2\xa3\x7b\x5b\x4e\x8a\x30\ \x13\x4e\xae\x3c\x4d\x11\xf3\x93\xca\xfd\x2b\xb7\x6f\x56\xf9\xcc\ \x14\x4f\xb9\xfb\x78\x39\x05\x7e\x10\x04\xd2\xf7\x7d\xe9\xfb\xbe\ \x2c\x97\xcb\xb2\x9d\xdb\xc7\x85\xfb\xb2\xcb\x4a\x2e\x25\x04\x60\ \x78\x78\x58\xf4\xf7\xf7\x8b\x20\x08\x44\x47\x47\x87\x00\x80\x7a\ \xbd\x2e\xc4\xd4\xc0\xb7\x9d\xea\xe8\x29\x61\xd3\xbf\x02\x80\xfa\ \x64\x13\x4e\xc1\xd6\x2f\x56\xba\x60\x69\xc9\x06\xa2\x99\xda\xd9\ \x99\xd4\xb3\xfc\xba\xb9\xb4\x0f\x06\xe7\xfa\xff\x5e\xb9\x7d\x95\ \xf3\x23\x0a\x05\x2a\xc7\x57\xe5\x5c\x5d\xd0\x51\x4a\x10\x33\xfd\ \x14\xf8\xae\xeb\x12\x11\xf1\xec\xec\xac\xee\xe8\x19\x1b\x1b\xe3\ \x52\xa9\x44\x3d\x3d\x3d\xb4\x7f\xff\x7e\x1e\x1e\x1e\xbe\xac\xaa\ \x7b\x17\x23\x97\xe2\x01\x00\x80\xcb\xe5\x32\xbb\xae\xab\x07\x3c\ \x28\x99\x7a\x75\xdb\x97\xc8\x77\xf4\xf0\xe7\xd1\xe3\x13\x98\x1e\ \xab\x5f\x58\x26\x90\x47\x1e\x0d\x0f\xd1\x8e\x00\x72\xe8\xbc\x6e\ \x5a\xbe\x22\x7d\x79\x4c\xdf\x8c\xfd\x26\xf8\x46\xc1\x47\xc6\xdd\ \xbd\xb2\xd1\x68\xe4\x5a\x7e\x1b\xb2\xf7\x8e\x01\x1f\xb8\xb4\x34\ \x50\x5f\x68\xa1\x50\xe0\xe1\xe1\x61\x1d\x06\x6a\xb5\x1a\x3b\x8e\ \xc3\x93\x07\xaf\xff\x32\x79\xce\x6f\xa8\x76\xa3\xc7\x27\x31\x3d\ \x36\x3b\x8f\x2c\x80\xe3\x57\xb2\x47\x1f\x35\xec\xbb\xe5\x84\xc8\ \x7e\x4b\x01\x1e\x13\xbf\x30\x1e\xdf\x2f\xb3\x4c\x3f\xab\x04\xca\ \xf2\x0b\x85\x82\x34\xc1\xcf\xcb\xf3\x7b\x7a\x7a\xc8\x88\xf9\xef\ \x48\xe0\x95\xcc\x37\x04\x28\x11\xc3\xc3\xc3\x62\x74\x74\x14\x7d\ \x7d\x7d\xa2\x56\xab\x89\x4a\xa5\x22\x88\x48\x34\x1a\x0d\x14\x8b\ \x45\x31\x33\xdc\xfb\x4a\x79\xe5\xc4\x29\xe1\x44\xe1\x60\xb6\xd6\ \x84\x5d\xb0\x51\x28\xb9\x6d\xb2\x80\x36\xf7\x31\xe6\x04\x60\x60\ \xfc\xf4\x54\x6e\x93\x70\xa6\xe7\x2f\xe5\x74\xcf\xe9\xf8\x48\x9a\ \xe8\x31\x33\xd9\xb6\xcd\x79\x4c\x1f\x80\x0e\x07\xf1\x53\xbe\xb9\ \xe0\x8f\x8d\x8d\x51\xb1\x58\xe4\x9e\x9e\x1e\x7a\x27\xa5\x79\xe7\ \x93\x4b\x7d\x55\x2c\x23\xfa\x69\x5f\xab\x50\x28\x70\xdc\x67\xce\ \x00\xc8\xf3\x3c\xcb\x71\x1c\x26\x22\x6e\x1e\xbd\xf9\x2b\xa5\x2d\ \xdf\x87\xe5\x86\xff\x0b\x00\xce\x9d\xac\x01\x8c\xf8\x0d\x5a\x6d\ \x8e\x9a\x59\xe0\xdc\x6d\x69\xa1\xa9\x15\x87\x62\x26\x0f\x55\x06\ \x76\x1c\x87\x85\x10\x7a\x34\x8f\x62\xfa\xaa\x63\x27\x0c\x43\x09\ \x80\x62\xb6\x2f\x7d\xdf\x97\xcc\x4c\x59\xf0\x5d\xd7\xbd\xe2\xc0\ \x07\x2e\xbd\x12\xa8\x6f\x82\xe2\x02\x23\x23\x23\x0c\x44\x99\x41\ \x3c\x30\x82\x9a\xcd\x26\xcd\xbe\xbe\xfd\xab\xd2\x77\x7e\x53\xed\ \x78\x6e\xa8\x86\x99\xf1\xd9\xf3\xc7\x7e\x36\x32\x03\x32\x47\x23\ \xb7\x4a\x38\xd3\x55\x73\x1c\x47\x3a\x8e\x23\x99\x39\x94\xb1\x30\ \x73\x68\xba\x7c\xc5\xf4\x55\x85\xcf\x64\xfb\xd9\xf2\xee\x95\x0c\ \x3e\x70\xe9\x21\x40\x89\x18\x1e\x1e\x46\x7f\x7f\xbf\x10\x42\x60\ \x7a\x7a\x1a\xd9\x50\xe0\x79\x1e\x30\xb5\xe1\xa0\xd3\x35\x76\x08\ \x0e\xed\x12\x02\xa5\xc6\x94\x07\xe9\x4b\x94\xba\x8a\xd1\x51\xda\ \x50\x2a\xf3\x2e\x07\xcd\x10\xf5\x89\x46\xf6\xfb\xc1\x24\x0e\x37\ \x47\x56\x7f\x35\xee\xf7\x97\xaa\xdf\x5e\x75\xee\x20\x76\xf5\xea\ \xe5\x0e\xf1\x94\x3c\xcf\x23\x00\xd4\x0e\xfc\x4a\xa5\x42\x9d\x9d\ \x9d\xef\xa8\xea\xde\xc5\xc8\x42\x29\x00\x03\x10\xa3\xa3\xa3\x29\ \x25\xe8\xea\xea\x02\x11\x89\x52\xa9\x24\x84\x10\xf0\x3c\x0f\x98\ \xd9\xf0\xa6\x28\x4f\xed\xb1\x0a\xc1\x47\x85\x40\x31\x68\x86\x08\ \x7d\x89\x52\x67\xa1\xed\x91\xcd\xb1\x04\xa1\x17\x62\xb6\xe6\xb5\ \xb6\x23\xeb\xa8\x9c\x58\xff\xb7\x0a\x64\xd5\x09\x24\x84\x90\x8a\ \x07\x58\x96\x25\x55\xbf\xbe\x2a\xef\x16\x8b\x45\xe9\x79\x1e\x95\ \xcb\x65\x39\x3b\x3b\x4b\xe5\x72\x99\x26\x27\x27\xa9\xd9\x6c\x72\ \xa5\x52\x21\xa3\xb4\x6b\x16\x7a\xae\x08\xf0\x81\x85\x53\x00\x2d\ \x79\x4a\xd0\x68\x34\x50\x2a\x95\x04\x33\x0b\xdf\xf7\x61\xcd\xae\ \x3d\x9b\x52\x02\x2f\x84\x0c\x08\xa5\x4a\xa1\xbd\xf5\xc7\xcb\x32\ \x20\x34\xa6\x72\x14\x80\x71\xca\x1f\x5b\xfb\x30\x33\xeb\xa1\xdb\ \x88\x40\x23\xc7\x71\xc8\x5c\x97\x19\xcd\x4b\xe5\x72\x59\xce\xcc\ \xcc\x50\xb1\x58\xd4\x69\x5e\xb9\x5c\xe6\x43\x87\x0e\x51\x26\xc7\ \xbf\x62\x80\x57\xb2\xd0\x0a\xc0\x40\x7b\x25\x28\x97\xcb\x50\x9e\ \x20\x4f\x09\xc2\x40\xa2\xd4\x59\x84\xea\x12\xe6\x9c\xdb\x2e\x7d\ \x89\xc6\x74\xab\x02\x70\xe8\xfe\xcd\xec\xc8\x8a\xe7\x39\x7a\xda\ \x57\x83\x1e\x04\x81\xb6\x7e\x65\xf5\x00\xf4\x78\xbe\x52\xa9\x44\ \x59\xf0\x33\xa5\xdd\x2b\x16\x7c\x60\x11\x3c\x00\x12\x25\xe0\x4d\ \x9b\x36\x41\x4a\xa9\x95\xc0\xf7\x7d\x6e\x36\x9b\x28\x95\x4a\x5a\ \x09\xac\x8e\xa9\x27\x2c\x37\xb8\x4b\x08\x94\x42\x4f\x42\x06\x12\ \xc5\x4a\x21\x39\x90\x72\x03\x86\x07\x68\xe6\x28\x00\x91\xfd\x3c\ \xd7\xd6\x3f\x63\xdb\x36\x2b\xd0\x11\x2b\x42\xdc\x8b\x47\xcc\x4c\ \xc5\x62\x51\x36\x9b\x4d\xdd\xa9\xc3\xcc\x54\xa9\x54\x28\x5b\xdd\ \xc3\x0f\x00\xf8\xc0\xe2\x28\x00\x10\xdf\xb0\xe1\xe1\x61\x1e\x1f\ \x1f\xc7\x86\x0d\x1b\x30\x3d\x3d\x8d\x9e\x9e\x1e\xd8\xb6\xcd\x9e\ \xe7\xa1\x52\xa9\xc0\xf7\x7d\x34\x46\xbb\x47\x4a\x5d\x8d\x6f\x8b\ \x82\xff\xd1\x44\x09\x28\x2a\x1b\xa7\x6e\x7d\xa4\x08\x32\x24\x34\ \x67\x72\x3a\x83\xa4\x78\xd6\x1b\x5d\xfd\x0c\x33\x73\xa1\x50\x90\ \xf1\xf7\x50\xfc\x0c\x00\xa9\x6c\x04\x00\x35\x9b\x4d\x29\x84\x90\ \xc5\x62\x91\x8a\xc5\x22\x5f\xa9\x39\xfe\x85\xc8\x62\x29\x80\x12\ \xed\x0d\xb6\x6c\xd9\x82\x5a\xad\x96\xf2\x06\x9e\xe7\xa1\xb3\xb3\ \x93\x67\xc7\xba\xcf\x16\x2b\xb3\x4f\x68\x25\xf0\x23\x4f\x50\x28\ \xbb\x2d\x30\x50\x28\x73\x15\x80\xc9\x7a\xb6\x3e\xbc\xe2\xe9\x78\ \x1c\x20\xab\x1e\x3c\xd7\x75\x29\x08\x02\x49\x44\x54\x2c\x16\x49\ \x11\xbd\x18\x78\x96\x52\x52\xb9\x5c\xe6\x2b\x99\xe9\xcf\x25\x8b\ \xad\x00\x40\x8e\x37\x68\x36\x9b\x5c\xaf\xd7\xb1\x72\xe5\x4a\x6e\ \x34\x1a\x08\xc3\x90\xa7\x47\x2a\x67\x0a\x5d\xf4\x88\x55\x6c\xde\ \x26\x04\xd6\x84\xbe\x84\x3f\x1b\x44\x3f\xca\xa0\x8e\x12\x87\x80\ \xbc\xee\x60\x62\xeb\x19\x9e\xdc\xf0\xb4\xe3\x38\xec\xfb\x7e\x9c\ \xfe\x47\xb1\x7f\x66\x66\x46\x8d\x03\x90\xe5\x72\x99\x26\x26\x26\ \x28\x08\x02\xea\xe8\xe8\xa0\xce\xce\x4e\xce\xe9\xd0\xb9\xe2\x81\ \x57\x72\xa9\xe3\x36\xe7\xfb\x9d\xd6\x2d\xb7\xdc\x62\x35\x1a\x0d\ \xe1\xfb\xbe\xe8\xe9\xe9\xb1\x01\xa0\xd1\x68\x58\x9d\x1b\xcf\x54\ \x4b\x7d\xe3\x8f\xab\x97\x29\x39\xae\x8d\xee\xd5\x95\xf8\x47\x19\ \x80\xc0\x0b\x31\x35\xda\x3a\x18\x24\x6c\x16\x7e\x6a\xea\xd5\x6b\ \x9f\x36\x5e\xd0\xa0\x9e\xe3\xe3\xec\x43\x1a\x6d\x9e\xd2\xf9\x81\ \x03\x1f\x78\x7b\x14\xc0\xfc\x6e\xa5\x0c\x42\x29\x43\xb3\xd9\xb4\ \xd6\x6c\x1b\xaf\x56\x56\xcf\x7e\x53\x29\x81\xed\xda\xe8\x5a\xd5\ \x01\xcb\x12\x08\xbc\x10\xd3\x63\xb3\x2d\x07\x0b\x9a\x85\x0f\x9f\ \x7b\x79\xd3\x53\xe6\x03\x99\xea\xb1\x2c\xf3\xe1\x8c\x39\x80\x07\ \x7e\xc0\xc0\x07\x16\xe1\xe7\xe3\x2f\x42\xd4\x8d\xa7\xbd\x7b\xf7\ \x02\x89\x42\xe0\xd4\x29\x8c\xde\xf2\x11\xbc\xbf\xd2\x8b\x6f\x09\ \x81\xed\x32\x90\x98\x1e\xab\xa3\x6b\x65\x47\xdb\xbe\x22\xd7\x91\ \x15\x29\xa5\xaf\x00\x8f\x8e\x73\x2a\x0f\xd8\xb9\xd6\xfd\xc0\xc9\ \xdb\xe9\x01\xce\x2b\xdb\xef\x44\xb5\xa7\x1b\x4f\x08\x81\x1d\x00\ \x60\x3b\x16\x2a\x2b\xca\x98\x3a\xdb\x1a\x02\x88\xf1\xd9\xa7\xfe\ \x0a\x9f\x59\xea\x73\x7c\xa7\xcb\x25\x0f\x0b\x5f\x4c\x79\xf9\x51\ \x4c\xc6\xef\xe2\xdf\x07\x44\x29\xe0\xcc\xb9\x56\xf7\xcf\x8c\x49\ \x29\xf1\xf5\x25\x3f\xc1\x2b\x40\x2e\x6b\x05\x00\x52\x4a\xb0\x07\ \x40\x6a\x30\x08\x33\x26\x89\xf1\xd9\xda\x14\x36\x2d\xe5\x2b\xd6\ \xaf\x24\xb9\xac\x43\x40\x56\xde\xf7\x09\xec\x16\x02\xf7\x00\xe7\ \xff\x4d\x9f\x65\xb9\x42\xe5\xf6\x4f\xe0\x53\xb7\x7f\x02\x9f\x7a\ \xbb\xcf\x63\x59\x96\x65\x59\x96\x65\x59\x96\x65\x59\x96\x65\x59\ \x96\x65\x59\x96\x65\x59\x96\xe5\x1d\x28\xff\x1f\xa3\xe7\x37\x1e\ \xe7\xe8\xe8\x91\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\ \ \x00\x00\x1a\x14\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x80\x00\x00\x00\x80\x08\x06\x00\x00\x00\xc3\x3e\x61\xcb\ \x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x89\x00\x00\x0b\x89\ \x01\x37\xc9\xcb\xad\x00\x00\x19\xc6\x49\x44\x41\x54\x78\x9c\xed\ \x9d\x7b\x9c\x1d\x65\x99\xe7\xbf\xef\xa5\xaa\xce\xe9\x4e\x77\x27\ \x9d\x6e\x12\x72\x23\x21\xc1\x98\x1b\x08\x86\xdb\xa0\x42\x10\xc5\ \x5d\x93\x31\xbb\xae\xf3\x99\x1d\xd8\x55\x87\xd9\x8f\x1f\x9c\x45\ \xc4\x8f\xe3\xc7\xcf\x20\x03\x88\xc8\x30\x8b\x23\xe8\x78\xd9\x6b\ \xc6\x55\x06\x1d\x56\x97\xa0\x71\x71\x60\x84\x75\x16\x0d\x2c\x3a\ \x6e\x9c\x05\x65\x21\x0c\x04\x72\xeb\x5c\xbb\xfb\xdc\xab\xea\xdd\ \x3f\xaa\xea\x74\x9d\xea\x3a\x97\x4e\x5f\x72\xba\x73\x7e\xf9\xbc\ \xa9\x53\x75\xce\xa9\x53\x55\xcf\xef\x7d\x9e\xe7\x7d\xde\xe7\x79\ \x1b\x3a\xe8\xa0\x83\x0e\x3a\x38\x43\x21\x9a\xbc\x6f\x01\x0a\x90\ \x33\x70\x2d\xa7\x02\x1f\x30\x80\x0b\x78\xa7\xf9\x5a\x66\x25\x1a\ \x11\xc0\x01\x7a\x80\xc5\x40\x96\x80\x08\xed\x06\x0f\x28\x02\x47\ \x80\x51\x20\x4f\x87\x08\x13\x82\xae\x73\x5c\x85\xad\xdb\x18\xf3\ \xab\x99\xb8\x10\x63\x4c\x4b\x5b\xdf\xf7\x01\x70\x5d\x97\x03\x07\ \x0e\xbc\x78\xe0\xc0\x81\x9f\xed\xda\xb5\x6b\xe7\xbd\xf7\xde\xfb\ \x73\x82\xfb\xc9\x03\x65\x02\xcd\xd0\x41\x13\xd4\xd3\x00\x0a\x58\ \x00\xac\x31\xc6\xfc\x6c\x26\x2e\xc4\xf7\x7d\x7c\xdf\xc7\xf3\xbc\ \xea\xeb\xb4\x63\xc6\x98\x9a\x63\xc6\x18\x6c\xdb\xe6\xc0\x81\x03\ \x4f\x7f\xf4\xa3\x1f\xbd\xfb\x99\x67\x9e\x79\x1e\x38\x4e\x40\x04\ \x77\x26\xae\x7d\x36\xa3\x9e\x6d\x17\x04\xf6\xbf\x6f\x06\xaf\xa5\ \x06\xc6\x98\xaa\xb0\xa3\xd7\xc9\xe6\xfb\x3e\xae\xeb\x32\x32\x32\ \xc2\x82\x05\x0b\xae\xf8\xde\xf7\xbe\xf7\xc8\x7d\xf7\xdd\xf7\x87\ \xc0\x2a\xa0\x97\xfa\x1a\xae\x83\x10\x8d\x9c\x3b\xd1\xe4\xfd\x69\ \x43\xa4\xee\xeb\xbd\x97\xa6\x1d\xf2\xf9\x3c\xa5\x52\xc9\xbe\xfe\ \xfa\xeb\xff\xe8\xf1\xc7\x1f\xff\x12\xb0\x9a\x0e\x09\x9a\xa2\x99\ \x80\x67\x9c\x00\xf5\x84\x5f\x4f\x03\xc4\x49\x70\xe2\xc4\x09\x00\ \x36\x6d\xda\xf4\x8e\xdd\xbb\x77\xef\x00\xd6\xd0\x21\x41\x43\xb4\ \xeb\xf0\xae\x06\x49\x52\xa4\x99\x87\x88\x04\xc7\x8f\x1f\x47\x6b\ \xcd\xca\x95\x2b\x37\xec\xde\xbd\xfb\xbf\xd0\x21\x41\x43\xb4\x1d\ \x01\x84\xa8\xf5\x4b\xd3\x34\x42\x9a\x16\x88\xda\xf0\xf0\x30\x96\ \x65\x75\x48\xd0\x22\xda\x8e\x00\x49\x24\x09\x11\x21\x22\x00\x50\ \x43\x80\x4a\xa5\x42\x6f\x6f\x6f\x87\x04\x2d\xa2\x6d\x08\x10\x17\ \x74\x3d\xa1\xa7\x21\xcd\x2f\x00\xd0\x5a\x77\x48\xd0\x02\xda\x86\ \x00\x50\x9f\x04\xad\x12\x22\xf2\x09\x00\x6c\xdb\xee\x90\xa0\x05\ \xb4\x15\x01\x00\xa4\x94\x55\x81\x4f\x86\x10\x5a\xeb\x0e\x09\x5a\ \x40\xdb\x10\x40\x08\x51\x6d\xd1\x3e\x34\x26\x44\xfc\xf3\x69\xe8\ \x90\xa0\x39\xda\x86\x00\x40\x8d\xa0\xd3\x08\xd1\xac\x49\x39\xfe\ \x76\x3a\x24\x68\x8c\xb6\x22\x00\x50\x23\xc8\x46\x44\x90\x52\x56\ \xb5\x83\x52\xaa\xa1\x46\xe8\x90\xa0\x3e\xda\x8a\x00\x8d\x7a\x76\ \xda\x7e\x9c\x04\xf1\x6d\x1a\x3a\x24\x48\x47\x5b\x11\x00\x5a\x53\ \xf5\x71\xe1\x2b\xa5\xc6\x6d\xeb\xa1\x43\x82\xf1\x68\x3b\x02\x00\ \xa9\x6a\x3d\xae\x05\x22\xe1\x27\x5b\x44\x82\x46\xe8\x90\xa0\x16\ \x6d\x47\x80\x66\xbd\x3e\x4d\x0b\x68\xad\x51\x4a\x55\x5b\x33\x74\ \x48\x30\x86\xb6\x23\x40\x84\xb8\x16\xa8\x67\xf3\xa3\x5e\x1f\x57\ \xff\xad\x10\x00\x3a\x24\x88\xd0\x96\x04\x88\xf7\xf2\x24\x09\x92\ \x84\x88\x84\x1f\x69\x01\xad\x5b\x97\x99\x52\x0a\x63\x4c\x1a\x09\ \xbe\xca\x19\x92\x4f\x50\x2f\x8a\xa2\x81\xb3\x80\x0b\x8d\x31\x3f\ \x98\xc1\xeb\xa9\x41\x7c\xbe\x3f\x9e\x16\xe6\xba\xee\xb8\xf7\x3c\ \xcf\xc3\x75\x5d\x2a\x95\x4a\x75\x1b\x1d\x73\x5d\xb7\xe6\x73\xf1\ \x90\x71\x44\xaa\xf9\xf3\xe7\x57\x9b\x31\x86\x87\x1e\x7a\xe8\xc1\ \x5b\x6e\xb9\xe5\x8b\xc0\x5e\xe0\x04\x73\x34\xc7\xb0\x9e\xbe\x94\ \x40\x37\x70\xf6\x1d\x77\xdc\xf1\x7b\x33\x78\x3d\x0d\x11\x17\x5a\ \xda\x7e\x1c\x69\xa1\xe3\xb8\xd6\x88\x6b\x16\xa5\x14\xae\xeb\x32\ \x3a\x3a\xca\xc9\x93\x27\xb1\x2c\x8b\x8d\x1b\x37\xbe\xf9\x85\x17\ \x5e\xd8\xff\xf2\xcb\x2f\xef\x03\x72\x40\x65\x7a\xef\xee\xf4\xa0\ \xad\x35\x00\x50\x93\xfb\x17\x9f\xf6\x4d\xee\x47\xc7\xe2\xbd\x3e\ \xd9\xfb\x93\xc9\xa4\x49\x2d\x10\x11\x42\x6b\x4d\x6f\x6f\x2f\xb9\ \x5c\xee\xb5\xcd\x9b\x37\x7f\x04\xf8\x25\x41\xea\xf9\x9c\x4b\x32\ \x6d\x4b\x1f\x20\x8e\xb8\x2f\x90\x8c\xfe\x25\x87\x81\x71\x3f\x20\ \xb2\xe9\x96\x65\x55\x5b\x7c\x3f\xfe\x99\x48\x23\x68\xad\xd1\x5a\ \x23\xa5\xa4\x50\x28\xd0\xdf\xdf\xbf\xe2\x8e\x3b\xee\x78\x3f\x30\ \x40\x50\x27\x31\xe7\x30\x2b\x1c\x9c\x78\x84\xcf\x18\xd3\x70\xac\ \xaf\xb5\x1e\x17\x3a\x8e\x8f\x18\x92\x1a\xa0\x9e\x16\x50\x4a\x91\ \xcb\xe5\xb8\xf2\xca\x2b\xaf\x04\xbe\x0b\x1c\x66\xac\x10\x65\xce\ \x60\xd6\x10\x20\xda\xb6\x3a\xcc\x8b\x20\xa5\xc4\xf3\x3c\x84\x10\ \xf8\xbe\x8f\x94\xb2\xa6\xc6\x00\x02\x52\x25\x7f\x23\x22\xcd\x9a\ \x35\x6b\xce\x03\x56\x02\xaf\x12\x08\x7f\x4e\x11\xa0\xed\x4d\x40\ \x84\xb4\xf0\x6f\xbd\xfd\xe8\x58\xa4\xe2\x93\x63\xfe\x66\x2d\x1e\ \x54\xf2\x3c\x8f\x1b\x6f\xbc\xf1\x1a\x02\x33\xb0\x80\xf6\x2c\x91\ \x3b\x65\xcc\x0a\x0d\x10\xa1\xd1\x64\x4f\xda\x67\xa3\xf4\xb0\xb4\ \xde\x9f\x74\x04\xe3\xdf\x8b\x93\xcd\xf7\x7d\x0e\x1f\x3e\x3c\x0f\ \x18\x24\x78\x5e\x36\x53\x57\x7f\x58\x20\x18\x61\xe4\xa6\xf0\x9c\ \x13\x42\xdb\x8f\x02\xd2\x90\x56\x13\x10\xdf\x8f\xbf\x1f\x4f\x1f\ \x4f\x3b\x96\x96\x75\x9c\x0c\x38\xed\xda\xb5\x6b\x64\xf5\xea\xd5\ \xa3\x17\x5c\x70\x41\xa5\xa7\xa7\xc7\x9f\xa8\x19\x8a\xc3\xf3\x3c\ \x0e\x1e\x3c\xb8\x7f\xef\xde\xbd\x2f\xdf\x76\xdb\x6d\x0f\xef\xde\ \xbd\x3b\x2a\x65\xcb\x71\x1a\x6a\x1a\x67\x25\x01\xa0\x3e\x09\xe2\ \xb5\x83\x49\x41\xa7\x09\xbf\x11\x01\x22\x12\x3c\xf5\xd4\x53\xac\ \x5d\xbb\x96\xb5\x6b\xd7\xd2\xdd\xdd\x5d\x13\x63\x88\xd7\x25\xa4\ \x91\x31\x8d\x7c\x9e\xe7\x61\x59\x16\xc5\x62\xb1\x3c\x32\x32\xf2\ \xe2\x75\xd7\x5d\x77\xfb\x9e\x3d\x7b\x7e\x05\x1c\x25\x20\x42\x69\ \xa6\x9e\xe3\xac\xf1\x01\x92\x68\x34\x25\x1c\x0d\x09\x93\xc7\x92\ \xc3\xbd\xc8\x27\x88\xdb\xfc\xe8\xfd\x78\xb0\xa8\x19\x1a\x95\xb2\ \x45\xef\x27\x33\x97\x0b\x85\x02\xae\xeb\xda\x5d\x5d\x5d\x1b\x7f\ \xf8\xc3\x1f\x3e\xb4\x73\xe7\xce\x2f\x03\x1b\x81\xa5\x04\x41\xb8\ \xd6\x53\xa3\x27\x81\x59\x4b\x00\xa8\x25\x41\x24\xf0\xa4\x23\x18\ \x9f\x2c\xaa\x37\x7d\x1c\x27\x44\xda\x79\x5a\x21\x41\x12\x8d\x0a\ \x5a\xe3\x5a\xaa\x5c\x2e\x33\x3a\x3a\x6a\x5f\x7a\xe9\xa5\xd7\x3e\ \xf7\xdc\x73\xdf\x5c\xb1\x62\xc5\x35\xc0\x72\xa0\x8b\x19\x20\xc1\ \xac\x26\x00\x34\xd6\x04\xf1\x6d\x72\xca\x38\x4d\x6b\xd4\x6b\x13\ \x45\x23\x8d\x90\x56\xfa\x5e\x2e\x97\x39\x79\xf2\x24\x2b\x56\xac\ \x58\xb1\x6b\xd7\xae\x3f\xdb\xba\x75\xeb\x76\x66\x88\x04\xb3\x9e\ \x00\x50\xeb\xb4\xc5\x05\x5d\xcf\x04\x34\x32\x1d\x53\x45\x82\x38\ \x1a\xd5\x32\xc6\x4b\xdc\x8d\x31\x2c\x5a\xb4\xa8\xef\x6b\x5f\xfb\ \xda\x9d\x37\xdf\x7c\xf3\x07\x99\x01\x12\xcc\xaa\x61\x60\x23\x44\ \x24\x88\x47\xf6\xe2\x41\xa0\xb8\x10\xa4\x94\xe3\x2a\x89\x60\x7c\ \xcf\x3d\x15\xd5\xdf\x0c\x49\x93\x10\x9f\xa3\xc8\xe5\x72\xf4\xf5\ \xf5\xe1\x38\x8e\xfd\xc9\x4f\x7e\xf2\x13\x00\x0f\x3c\xf0\xc0\x37\ \x80\x7d\x04\x0b\x5e\x4c\xf9\x08\x61\xce\x10\x20\x42\x24\xf8\xe8\ \x01\x0b\x21\xaa\x23\x82\x68\x3f\x2e\x80\xe8\xb3\xcd\xce\x39\x99\ \xf7\x93\xa8\xe7\x1f\x1c\x3f\x7e\x9c\x81\x81\x01\x80\x19\x23\xc1\ \x9c\x23\x00\xd4\x6a\x83\xb8\xd0\xe3\x44\x00\xc6\xbd\x3e\xd5\xdf\ \x8a\x87\x92\x27\x82\xb8\x16\x8a\x7c\x01\xdb\xb6\xab\xef\xcf\x04\ \x09\xe6\x24\x01\x22\xc4\xe3\xfb\xc9\xde\x9f\x9c\x0b\x88\x6f\xeb\ \x9d\x67\x22\xbf\xd7\x2a\xe2\xbf\xed\xfb\x7e\x0d\x01\x60\xfa\x49\ \x30\xa7\x09\x00\xe3\x49\x10\xd7\x0a\x30\xf6\xe0\x23\x9c\x8a\x1f\ \x50\x2f\xf9\xa4\xd5\x73\x24\xaf\xcb\x71\x6a\x67\x9e\xa7\x93\x04\ \x73\x9e\x00\x71\x24\x1d\xc5\x56\xfd\x80\x56\x49\x10\xcd\x1d\xc4\ \x49\x90\x24\x44\xfc\x58\xa3\x73\xcf\x14\x09\xce\x28\x02\x44\x48\ \x6a\x85\x08\x93\xf1\x03\x92\x02\x4e\x23\x44\xb4\x9f\xfc\x5c\xbc\ \xc5\x31\x13\x24\x68\x3b\x02\xac\xbc\x77\xfe\xe9\xbe\x84\x71\xb8\ \x6d\xe9\x7d\x4d\x3f\x93\x14\x62\x1a\x21\xea\xd5\x37\xa4\x09\x3f\ \xc2\x74\x93\xa0\xed\x08\x00\x70\xf9\x3b\x97\x9d\xee\x4b\xe0\xd7\ \x3f\xcd\x71\xbc\x70\x9c\xef\x7f\xf0\x49\x5e\x7c\x7a\x6f\x4b\xdf\ \x49\xf6\xfa\x7a\x9a\x21\x4a\x3a\x89\x62\x12\xcd\x02\x4e\xd3\x49\ \x82\xb6\x24\x00\xc0\xeb\xee\x01\x86\x5f\xa9\xb0\x38\xbb\x9c\xac\ \xec\xc2\x56\x19\x1c\x99\xc5\x91\x59\x6c\xe1\x90\x91\x59\x1c\x95\ \x25\x13\x1e\xcf\x58\x59\x32\x2a\x4b\x46\x67\x70\x74\x17\x19\x1d\ \xbc\xd6\x52\x23\xc4\xc4\x22\x79\x4f\xbd\xf4\x04\x3f\x2b\xfc\x25\ \xdf\xff\xe0\x93\x6c\x5a\x7c\x21\x2f\xd2\x9c\x00\xf5\x54\x7a\x92\ \x10\xc9\x39\x86\x56\x23\x8e\x69\x24\xb8\xe1\x86\x1b\x6e\x7c\xf8\ \xe1\x87\x5f\xdb\xbf\x7f\xff\x93\x9c\x22\x09\xda\x3a\x14\x7c\xf2\ \x70\x9e\x57\xf6\xbd\xc2\xf1\xe3\x23\x8c\x9c\xc8\x31\x3a\x92\x23\ \x37\x9a\x23\x5f\xc8\x93\x2f\xe5\x29\x94\xf3\x14\xcb\x45\x4a\x5e\ \x91\x62\xa5\x48\xd1\x2b\x52\x74\x4b\x94\xdd\x22\x65\xaf\x40\xc9\ \x2d\xe2\x19\x8f\x89\x98\xf6\xa7\x5e\x7a\x82\x6f\xfd\x62\x4c\xf8\ \x13\x41\x23\x12\x24\xf7\xd3\x66\x2c\x9b\xe5\x19\x38\x8e\x83\x6d\ \xdb\xd5\x19\xcc\xc5\x8b\x17\xf7\x3d\xf6\xd8\x63\xf7\x2c\x59\xb2\ \x64\x0b\xa7\x18\x36\x6e\x6b\x02\x00\x94\xfd\x32\x43\xb9\x43\x81\ \x70\x43\x21\x97\xdd\x12\x65\xb7\x14\x08\xde\x2b\x50\xf2\x0a\x55\ \x81\x07\xc7\x8a\x14\x2b\x25\x4a\x5e\x89\x52\xa5\x88\x6f\xdc\x96\ \x48\x30\x19\xe1\x47\x88\xd4\x7b\x5c\xf0\xc9\xaa\xa6\xb4\x19\xc9\ \x56\xcb\xda\xa6\x9a\x04\x6d\x4f\x00\x80\x7c\x65\x84\x43\xa3\x07\ \x02\x61\x57\x0a\x14\xbd\x02\x45\xaf\x48\x29\x14\x72\x44\x8c\x92\ \x5b\xa0\xe8\x06\x84\x28\x79\xc5\xb0\x95\x28\xba\x25\x7c\xd3\x38\ \xa5\x7f\xaa\x84\x5f\xaf\xf7\xa7\x91\x20\x2d\x07\xa1\x15\x4c\x25\ \x09\x66\x05\x01\x20\x20\xc1\xc9\xe2\xb1\xa0\x87\xbb\x81\xb0\x4b\ \x55\x42\x14\x29\x86\xc4\x28\x7b\x05\x4a\x95\x40\x33\xd4\x1c\x73\ \x4b\xf8\x7e\x7a\xda\xdd\x54\x08\x3f\x42\xdc\xc9\x4b\x53\xfb\xf1\ \xf7\xd3\x48\xd0\x2a\x5a\x24\x41\x53\xb4\xad\x13\x98\x86\x63\x85\ \x23\x00\xf4\x67\x06\x10\x08\x88\x9a\x10\x48\x04\x42\xc8\xd8\xf1\ \x31\x88\xea\xff\x82\x8c\xe5\x20\xc5\x58\x4f\x9b\x4a\xe1\x57\x7f\ \x2f\x26\xe4\x78\x1d\x43\xe4\xf5\x43\x10\x73\x88\xde\x8f\xb7\x3d\ \x7b\xf6\x54\xeb\x1b\xd3\x2a\x9b\xa2\x38\x42\x36\x9b\x25\x9b\xcd\ \xd2\xdd\xdd\x4d\x4f\x4f\x0f\x3d\x3d\x3d\x2c\x5e\xbc\xb8\x6f\xe7\ \xce\x9d\x77\x5e\x7c\xf1\xc5\x47\x08\x4a\xd9\x5e\xa7\x49\x7a\xd9\ \xac\x22\x00\x04\x24\xb0\x64\x2c\x5e\x2e\x22\xd1\xc6\x09\x11\x10\ \x41\x08\x51\xdd\x46\x34\x90\x80\x1d\x92\x60\x3a\x84\x0f\xb5\x33\ \x92\x49\x81\x47\xaf\xa3\xe3\x5a\xeb\x86\x73\x10\x71\xed\x11\xcf\ \x2b\xac\x54\x2a\x54\x2a\x15\x46\x46\x46\x18\x1a\x1a\xc2\xb2\x2c\ \x06\x07\x07\x59\xb6\x6c\xd9\xe0\x83\x0f\x3e\xf8\xa9\xeb\xae\xbb\ \xee\x8f\x08\x8a\x5a\x1b\x26\x9a\xce\x3a\x02\x00\x1c\xce\x1d\xa4\ \x2a\x79\xa8\xed\xf5\x55\x42\x8c\x41\xc6\x88\x20\x42\x8d\xf1\xb3\ \x7f\xfc\x5f\x3c\xf8\xf7\xdf\x98\x72\xe1\xc7\x11\x9f\x96\x8e\x13\ \x22\x19\x7d\xac\x67\xfb\x1b\x11\x20\xf9\x19\x80\xa3\x47\x8f\x52\ \x28\x14\xb8\xfa\xea\xab\x37\x7f\xf8\xc3\x1f\x7e\xf7\x8e\x1d\x3b\ \xa2\xc2\xd6\xba\xc5\x2c\xb3\x92\x00\x06\x9f\xc3\xb9\x03\x28\x21\ \x11\x76\x2c\x8a\x56\xbb\x89\x61\xfc\x91\xe9\x16\x7e\x3c\xfc\x0b\ \xe9\x25\x6d\x8d\xca\xdc\xea\xc5\x13\xe2\x66\x20\xfe\xd9\xc8\xa7\ \x70\x5d\x97\xa3\x47\x8f\x72\xd3\x4d\x37\xfd\xeb\x1d\x3b\x76\xec\ \x02\x86\x08\xcc\x40\xaa\x16\x68\x5b\x27\x50\xa8\x26\x33\x68\xf8\ \x0c\xe5\x0f\x51\x70\xf3\x94\xc2\xb1\x7f\x75\x18\x58\x89\xc7\x06\ \xc2\xe1\x62\x25\x70\x1a\x23\xc7\x10\xe0\x6b\xbb\xef\x9f\xde\x7b\ \x48\x8c\x02\x1a\x05\x81\xe2\xce\x60\xbc\xa2\xc9\xb2\xac\x71\x55\ \x4d\x91\xf3\xd7\xa8\x9a\xa9\xaf\xaf\x6f\xe9\x87\x3e\xf4\xa1\x2b\ \x09\x32\x8c\xeb\x0e\x2f\x5a\x22\x40\xbd\x0c\x96\xe9\x68\xd5\x87\ \x27\x9b\x8f\x62\x2a\x7e\x99\x43\xa3\x07\x28\xb8\xa3\x14\xc2\x91\ \x41\x30\x44\x1c\xf3\xfe\x8b\xe1\xd0\xb0\x98\x20\xc1\xad\xd7\xdc\ \xce\x0f\x7f\xb3\x93\x9b\x76\xde\x30\xa1\xeb\x3a\x15\xa4\xe5\x1d\ \x36\x2b\x67\x4b\x56\x35\x47\x42\x4f\x66\x30\xc7\x5b\x7c\x38\x59\ \x2a\x95\xd8\xb6\x6d\xdb\xfb\x80\xf9\x04\x7f\xfe\x27\xf5\x81\xb6\ \x64\x02\x26\xfb\x00\x4e\x05\xb2\xc5\xe2\x9b\x88\x04\x8b\xe6\x9d\ \x3d\xce\xf7\x8f\x7c\x03\x99\x72\xef\x19\xdd\xcd\x6d\xef\xba\x93\ \xbb\x1e\xbf\x1d\x80\x07\xb6\xfd\xc7\xc9\x5e\x72\x2a\x92\xa6\x00\ \xea\xab\x7e\x21\x82\x12\xb6\x78\x85\x73\xa4\x2d\x22\xd5\x9f\x1c\ \x39\xc4\xbf\x9b\xd4\x38\xe7\x9c\x73\xce\xb9\x04\x1a\xc0\xa2\x8e\ \x1f\xd0\xb6\x3e\x80\x6c\x62\x02\xe2\xa8\xf8\x65\x8e\x16\x86\x90\ \x5d\x2a\x9d\xe7\xd1\xb1\x70\x34\x20\xa5\x42\x09\x4d\x46\x65\xb8\ \xed\x5d\x9f\xe5\xae\xc7\xff\x04\x30\x3c\xb0\xed\x3f\x4d\xc1\x95\ \xa7\xfc\x7c\x8a\x3f\x90\xf6\x99\xb8\x6d\x8f\x04\x9a\xac\x69\x8c\ \xa7\xb5\xa5\x11\x20\x3e\x04\x5d\xb2\x64\xc9\x00\x41\x2d\x63\x5d\ \xb4\xb1\x06\x98\x58\x8e\x5d\xa1\x92\x67\x28\x7f\x90\xc1\xae\xb3\ \xa1\xfa\xf7\xae\xc6\x9f\x43\x22\x90\x62\xac\xd8\xa3\x86\x04\x06\ \xee\x9f\x66\x4d\x10\x09\x27\x7e\x3c\x4d\xf8\xd1\x04\x52\xb2\x8e\ \x20\x9a\x45\x8c\x64\x12\x7d\x2f\x22\x57\x52\x0b\x30\x7e\x50\x54\ \x83\xb6\x25\x40\x2b\x3e\x40\x12\x85\x4a\x9e\x23\xf9\x43\x0c\x76\ \x2d\x8a\x47\x05\xaa\x77\x2f\x91\x48\xa1\x02\x02\xc4\xbe\x57\xab\ \x09\xe0\x8b\x5b\xff\xc3\x24\xaf\x3e\x1d\x31\xa1\x20\x84\xa8\x06\ \x77\x92\x9f\x89\x8e\x45\x29\x62\xf1\x51\x40\x3d\xff\xa4\x5e\x42\ \x4a\x33\xb4\xad\x09\x10\xa7\x78\x65\xf9\xca\x28\x43\x79\x18\xec\ \x5a\x14\x1c\x08\x9f\x81\x14\x12\x25\xea\xd7\xfa\xc5\x49\x60\xf0\ \xb9\x7f\xeb\xf4\x99\x83\x46\x29\x68\x71\x41\x46\x02\x17\x42\xd4\ \xc4\x10\xe2\x79\x8c\x49\x33\x00\x63\xda\x60\xca\x08\x30\x1b\x4c\ \x40\x1c\xf9\xca\x28\x47\x0a\x82\x81\xae\x45\x04\x4e\xa0\xa4\x2c\ \x34\x72\x5c\x5e\x40\xed\x7d\x8d\xd3\x04\xef\x0d\xcc\xc1\x54\xdf\ \x7f\x9a\x63\x18\x1d\x8f\xab\xfe\x38\x09\x92\xad\x15\x12\x25\x73\ \x08\xd2\xd0\x12\x01\x92\x6a\x6a\x26\x20\x26\x59\x8e\x95\x2b\x8f\ \x60\x49\x0b\x99\x1d\x40\x79\x6a\x5c\x52\x48\x3d\x91\x06\x24\x18\ \x1b\x1d\x7c\xe1\x9f\xfc\xfb\x49\x5d\x47\x3d\xa4\xf5\xd6\xf8\x52\ \x36\xd1\x67\xd2\x22\x80\xcd\xea\x19\x92\x69\x69\x8d\xd0\xbe\x26\ \x60\x12\x1a\x20\xc2\x70\xe9\x24\x4a\x5a\x29\x3d\xbf\x31\x1c\xe5\ \xf0\x99\x77\xdd\xc9\xe7\x1e\xbf\x1d\xdf\x18\xb6\xb0\x75\xd2\xd7\ \x92\x86\x48\x40\x91\x63\x07\xd4\x08\x3f\x6e\x02\x92\x3e\x00\xd4\ \xaf\x67\x98\x72\x02\x9c\x0e\x13\x30\xd1\x45\x38\x44\x22\xa6\xa5\ \xa5\x44\x20\x19\x2e\x1e\x43\x00\x7d\x99\x05\x4d\x93\xa5\x4c\x75\ \xeb\x93\x51\xd9\x2a\x09\xf6\xaa\xbd\xdc\x7d\xee\xf4\x44\x0d\xe3\ \x9a\x20\xee\xbc\xc5\x6b\x1a\x93\xbe\x00\xd4\xfe\x81\xac\x66\xe7\ \x6e\x84\xb6\x25\x40\x23\x0d\x10\x78\xf1\x12\x25\x04\x42\x46\x13\ \x3c\xd1\xa4\x10\xc1\x1c\x81\x50\x18\x0c\x18\x28\xb8\x23\x58\x65\ \x8d\x72\x14\x65\x37\x1a\x01\x8c\x3f\x7f\x64\xe8\xa2\xfb\x8d\x93\ \xe0\x81\xe7\x3f\xcf\x57\xd7\x7e\x63\x6a\x6f\x32\x86\xa4\x36\x88\ \x46\x09\xc9\x8a\xa6\xb4\xc2\x96\x66\xe7\x6c\x84\x59\x63\x02\xa4\ \x50\x28\x21\x91\x32\x18\xc7\x07\x63\x79\x89\x62\x6c\x32\x48\x84\ \x41\x1e\x21\x44\xd8\x9d\x0d\x86\xe0\x21\x15\xbd\x1c\x96\xab\xd1\ \x96\xc6\x37\x2e\xae\x29\x53\xf6\x44\x95\x34\xb5\x18\x7b\xa8\x19\ \x95\xe5\x8f\xdf\x79\x3b\x9f\xff\xdb\x3b\xf9\xd4\xe3\x7f\xc8\x57\ \xb6\xff\xe5\x74\xdd\x72\x8d\x36\x88\x0b\x3e\x2d\xf8\xd3\xcc\x0f\ \x88\x9f\xaf\x11\xda\x56\x03\x48\x09\xce\x3c\x0b\x37\x67\xd0\x4a\ \x06\xc2\x17\x12\x25\x15\x96\xd6\x9c\x77\xc1\x22\x7a\x7a\x32\xbc\ \xf6\x9b\x63\x1c\x3b\x9c\x47\x08\xc6\x65\x00\x1b\x0c\xc6\x04\x5b\ \xdf\x37\x14\xdd\x1c\x96\xb2\xb0\x50\xf8\xc6\xc5\x37\x1a\xd7\x54\ \x10\x5e\xe2\x41\x25\x6e\xd7\x12\x0e\xb7\x5e\x73\x3b\x77\x3f\x71\ \x27\x1f\x7b\xf4\x0f\xf8\xf2\xfb\xfe\xf3\xb4\xde\x7b\x64\x0a\xe2\ \xbd\x3d\x3e\xfc\xab\x27\xfc\xe4\x90\x70\x56\x0f\x03\xb3\x3a\x43\ \x6f\x5f\x17\xb9\x72\x19\x25\x34\x5a\x06\x04\x70\x6c\xcd\xf9\x9b\ \x57\x60\x8c\xa1\xc7\xea\x62\xe3\xfa\x1e\x5e\xd1\x43\x1c\x3b\x92\ \x47\x89\x5a\xc7\xc1\xe0\xe3\x87\xd7\x6f\x64\xb0\x57\xf2\xf2\x58\ \xae\x42\xdb\x1a\x43\x05\xdf\x48\x7c\x23\xf0\x8d\xa4\xec\x95\x42\ \x7d\x60\x88\x58\x60\x00\x5f\xfa\x38\x3a\xcb\xad\xd7\xdc\xc1\xdd\ \x4f\xdc\x81\x10\xf0\xa5\xdf\x9e\x5e\x12\xc0\xf8\x0a\xa6\x89\xfa\ \x01\xb3\xda\x04\xf4\xca\x79\x64\xd5\x08\x9e\x12\x28\x29\xd1\x42\ \x61\xdb\x16\x9b\x2f\x3d\x97\x7d\xfb\x8f\xf2\xec\x33\xfb\x00\xb8\ \x7e\xfb\x65\x5c\xf8\xe6\x35\xbc\xf4\xd2\x61\x86\x8e\x9c\xac\x39\ \x87\x89\x99\x00\x63\x7c\x7c\x63\xf0\xf1\x28\x7a\x05\xb4\x6b\x61\ \x59\x3d\x18\xe3\xe1\x1b\x89\xe7\xbb\x08\x21\x70\xfd\xb1\x10\x72\ \xf5\xbb\xca\x03\x01\x8e\xca\x56\x35\x01\x9c\x1e\x12\x00\x24\xfd\ \x80\xe8\x58\xbd\xef\x36\x42\xdb\x4e\x07\xf7\xa9\x79\x64\x55\x06\ \x47\x59\x38\xda\xa1\x3b\x9b\xe5\xaa\xb7\x6d\x60\xe8\xd0\x28\xcf\ \x3e\xb3\x8f\xef\x7c\x60\x17\xef\x5e\xfd\x5e\xbe\xf5\xc8\x6e\x32\ \x6e\x86\x8b\xce\x5b\xcd\x39\x8b\xcf\x22\x63\x39\x61\xb3\x83\xad\ \xb6\xc3\xd7\x36\x8e\xb6\x71\x94\x43\x46\xd9\x94\xbc\x3c\x45\x2f\ \x8f\xc1\xc5\xc7\xc3\x18\x17\xdf\x78\xb8\xa6\x82\x67\x2a\x94\xfd\ \x20\xc7\xa0\xe8\x15\x28\xba\x63\x53\xc9\x42\x08\x6e\xbd\xe6\x76\ \xfe\xee\x1f\x7f\xcc\xcd\x8f\xfe\x41\x2b\x8f\x6f\xca\x90\x96\x55\ \x3c\xd9\xa5\x6d\xda\x97\x00\x7a\x1e\x59\x9d\xc1\xd6\x36\xf3\xb2\ \x59\xae\x7d\xfb\x5b\x38\x78\xe0\x24\x3f\xf9\xe9\x4b\x7c\xe7\x03\ \xbb\x58\x3f\x78\x3e\x5f\xb8\xf6\xeb\xbc\x67\xcd\x36\xfe\xe2\xbf\ \x3f\x86\xe3\xdb\x5c\xb2\x7a\x2d\xab\xce\x5a\x44\x46\x5b\x64\x94\ \x4d\x46\x59\xe1\x6b\x0b\x5b\xd9\x01\x19\xb4\x8d\xa3\x1d\x9c\x2a\ \x09\x0a\x18\xe3\xe3\xe1\x61\xfc\x4a\xe8\x20\x56\xf0\x7c\x97\x8a\ \x5f\xa1\xec\x96\xc2\x9c\x82\x38\x09\xe0\xc6\x2b\x3e\xc6\xb3\x6f\ \x3c\xcd\xa7\x1f\xfb\xd8\xa9\x4b\x74\x12\xa8\x57\x67\x30\xd1\x75\ \x8d\xda\x36\x23\xa8\x4f\x06\x1a\xa0\x27\xdb\xc5\xb6\x2b\x2f\xe6\ \xf5\x03\xc7\xf8\xd1\xdf\x3d\xcf\xb7\xff\xc5\x0f\x58\x3f\x78\x7e\ \xf5\x73\xff\xee\xdd\x5f\xe5\x3d\x6b\xb6\x71\xcf\x7f\xfb\x2e\x96\ \x67\x71\xd9\xaa\x75\x9c\x3b\xb8\x14\x47\x3b\x64\xb4\x83\xa3\x9c\ \xb1\xd7\xda\x0a\xb4\x40\x75\xeb\x50\x72\xf3\x94\xbc\x7c\x60\x0a\ \xf0\x30\x26\x20\x81\x67\x5c\x5c\xbf\x1c\x92\x20\x2c\x36\xa9\x26\ \x95\x14\xb1\xa4\xe2\x23\x97\xdd\xc4\x2f\xde\x78\x86\xcf\x3e\xf1\ \xe9\xd3\xf8\xa4\x02\xa4\xd5\x24\xcc\x6a\x13\xd0\x2b\x7a\xe8\xcb\ \x76\xf3\xfe\xab\x7f\x8b\x57\x5f\x1f\x62\xe7\x93\xbf\xac\x0a\x3f\ \xf9\x9d\x3f\x7b\xd7\x57\x78\xcf\x9a\x6d\xdc\xfa\xf0\x37\xb1\x3c\ \x9b\xb7\x9d\xb3\x81\x35\x03\xcb\xb0\xb5\x83\x63\x39\x38\x61\xcf\ \xcf\xa8\xa0\xe7\x3b\xca\x0e\x35\x83\xc6\xd1\x36\x65\x3f\x4f\xd9\ \x2b\x04\x24\xf0\x3d\x7c\xdf\xc5\x33\x95\xea\x70\xb1\x62\xca\x01\ \x09\xdc\x02\x25\xaf\x44\xc5\x77\x71\x8d\x8b\xa5\x35\x1f\xba\xe4\ \xdf\xb0\xe7\xd0\x2f\xb8\xef\x27\x77\x9d\xba\xf4\x4e\x23\xda\x96\ \x00\x3d\xa2\x9b\xad\x97\x5f\xcc\xde\x7d\x07\xf9\xeb\xbf\x7d\x96\ \xbf\x7a\xff\xf7\x59\x37\xb0\xa9\xee\xf7\xee\xbd\xe6\x2f\xb8\x76\ \xf5\x56\x6e\xfe\xeb\xaf\x63\xf9\x16\xef\x58\xb9\x89\xb5\x03\xcb\ \xc8\xa8\x50\xe5\x6b\x07\xdb\x1a\x23\x84\xa3\x6c\x6c\xe5\x84\xe6\ \xc1\xa2\xe4\xe7\x19\xad\x9c\xc4\xe0\x05\x7e\x41\xcc\x14\xb8\x7e\ \x85\x8a\x5f\xa6\xe2\x95\x70\xfd\x32\x9e\x57\xc1\xf3\x3d\x3c\xcf\ \xc5\x52\x16\xff\xf2\xc2\x7f\xc5\xf3\x87\xf7\xf0\x95\x9f\x7e\x61\ \xda\x04\x35\x5d\x68\x89\x00\xc9\xa4\x84\xe9\x6c\x11\x7a\xe8\xe6\ \xe7\xff\x77\x2f\xdf\xfc\x9b\xa7\x03\xe1\x2f\xdc\xd8\xf4\xbb\x7f\ \xfa\xce\x2f\x73\xed\xea\xad\xfc\xfe\xb7\xff\x1c\x5c\x8b\xb7\x2f\ \xbf\x90\x37\x2d\x3c\x07\x47\x39\xd8\xca\xaa\xf6\x7e\x5b\xdb\x58\ \x71\x93\xa0\x6c\x1c\x65\xe1\xe3\x92\xab\x9c\x0c\xb4\x40\xd5\x14\ \x54\xaa\x8e\xa1\x31\x06\xcf\xf8\xf8\xc6\xc3\x0b\xcd\x84\x6f\x5c\ \xb4\xd2\xfc\xf3\x4d\xbf\xc3\x8b\xc7\x5e\x60\xc7\x73\x5f\x9f\x36\ \x61\x4d\x07\xda\xd2\x07\x58\x90\xeb\xe7\xe9\x5f\xfe\x9a\x1d\x3f\ \xfa\x9f\x3c\xf8\xcf\x1e\x65\xdd\xc2\x8d\x2d\x7f\x37\x22\xc1\xf5\ \x0f\x7d\x8e\xb2\x2b\xb9\x7c\xd9\x45\x9c\xd7\x7f\x4e\x75\x64\x60\ \x2b\xbb\xea\x20\x5a\xda\xc6\x0a\x7d\x02\x5b\x59\x38\xd2\xc2\x33\ \x2e\xb9\xca\x09\x4c\x48\x02\xcf\xb8\x78\xbe\x0b\xc6\x54\xf3\x8c\ \x3c\xe3\x8f\xb5\x90\x7c\x5a\x69\xfe\xe9\xba\x6d\xbc\x7c\xec\x45\ \xbe\xb3\xe7\xbf\x4e\xdb\xb3\x99\x6a\xb4\x65\x20\xe8\xc7\xbf\xdc\ \x43\xb1\x08\x0f\x6e\x7f\x94\x75\x03\x1b\x27\xfc\xfb\xf7\x5c\xfd\ \x25\x00\x7e\xef\xaf\x6e\xe3\xdb\xd7\xdd\xc7\xa5\x4b\x37\xa3\xa5\ \xc5\xab\xc3\x6f\xa0\xa5\x17\xaa\x6f\x1f\x69\x2a\x78\x42\x52\x09\ \x53\xc4\x04\x12\x84\xa4\xe2\x57\xc8\x55\x86\xe9\xb6\x7a\x41\x0a\ \x84\xaf\x31\xd2\x44\x29\x85\x61\x7c\xc0\xc7\x37\x3e\xd5\x7f\xbe\ \x4f\xc6\x72\xb8\xe6\x4d\xd7\xf2\xbf\x5f\x7b\x86\x47\x5f\xf8\x2e\ \xbf\xbd\xee\xfd\x53\xff\x70\xa6\x18\x6d\xa9\x01\x8a\x45\xf8\xd6\ \xf6\x9d\xac\x1b\x6c\xbd\xe7\x27\x71\xcf\xd5\x5f\xe2\xda\xd5\x5b\ \xf9\xc4\xf7\xef\xa1\xec\x49\x2e\x59\x72\x09\xab\x17\xac\xaa\xda\ \x7e\xdb\x0a\xe2\x0b\x96\xb2\xb1\x95\x85\x25\x6d\x2c\xad\xb1\x94\ \xc6\x96\x16\x1e\x15\x86\x2b\xc7\x11\x18\x8c\x6f\xaa\xe5\x67\x21\ \x4d\xc2\x20\x53\xcc\x0f\xc1\xc7\xc7\xa0\xa5\xe2\x8a\x55\xef\x60\ \xff\xc8\x3e\x1e\x7f\xe9\x7f\x4c\xd9\x33\x99\x2e\xb4\xa5\x13\xf8\ \xcd\xf7\x3d\x52\xed\xf9\x93\x69\x9f\xdf\xf2\x00\x1b\x07\x2e\xe3\ \xe3\x3b\x3f\x4b\xd1\x95\xbc\x75\xf1\x25\xac\x9a\xbf\x2a\xb0\xfd\ \x2a\x30\x07\x8e\xb6\x70\x64\x48\x82\xf0\x98\x56\x1a\x5b\xda\x58\ \x42\x53\xa8\xe4\xc0\xf8\x08\x43\x30\x11\x25\x65\x50\x6a\x26\x04\ \xb1\x58\x63\x38\xf7\x14\x5c\xbf\xa5\x34\x17\x2f\xbf\x8c\xa1\xd1\ \x83\x3c\xfd\xea\x4f\xa6\x47\x72\x53\x84\xb6\x23\xc0\x73\x37\xbc\ \x34\x25\xc2\xaf\x25\xc1\xc5\x7c\xfc\xd1\xcf\x50\x74\x05\x17\x2e\ \xba\x9c\x95\xf3\x57\x61\x6b\x0b\x27\x14\xba\xa5\x35\xb6\xb6\xb0\ \xa5\x0e\x84\xaf\x6c\xb2\x56\x96\xac\xee\xc2\x51\x0e\xf9\xf2\x28\ \x00\x42\xc8\x6a\x56\xb1\xac\x56\x22\x8f\x65\x11\xc4\x61\x49\xcd\ \x05\x4b\xde\xc2\xf1\xfc\x11\xfe\x7e\xff\x73\x53\x29\xb3\x29\x45\ \xdb\x11\x60\x3a\xda\xdd\x57\xdd\xcf\x86\x85\x9b\xb9\x79\xe7\xa7\ \x29\xba\xf0\x96\xb3\x2e\x67\x65\xef\xb9\x01\x09\x64\x20\x70\x4b\ \x59\xe1\xbe\x45\x56\x67\xc8\xea\x2c\x59\xab\x8b\xac\xce\xa2\xd0\ \x14\xcb\x81\x26\x90\x52\x21\x55\x34\x0d\x2d\x63\xd3\xc9\xb5\xd9\ \xd7\x02\x50\xd2\xe2\xcd\x67\xad\x63\xa4\x34\xcc\x6f\x86\x9e\x9f\ \x7a\xe9\x4d\x01\xda\xd2\x07\x98\x0e\xdc\x7d\xd5\xfd\x6c\xe8\x7f\ \x2b\x1f\xdb\xf9\x49\x8a\x2e\x9c\x7f\xd6\xe5\x9c\xd3\x1b\x68\x82\ \xc8\xee\xdb\xd2\x22\x63\x65\x02\xc1\xab\x6c\x30\x17\xa1\xb3\x38\ \xd2\xc6\x92\x16\x95\x70\xb6\x30\x4a\x2d\xd7\x61\x4e\x42\xe4\x1d\ \x48\x11\xa6\xa0\x0a\x09\x61\x25\xb2\x92\x16\x2b\xfb\x57\x91\xaf\ \xe4\xd9\x77\xf2\xd5\xd3\xfd\x18\xc6\xe1\x8c\xd0\x00\x51\xfb\xdc\ \x55\x5f\x64\x7d\xff\x85\xdc\xf4\xc8\x2d\x14\x5d\xc3\xa6\xc1\xcb\ \x59\xd1\x7b\x2e\xb6\xd2\x58\x32\xa8\x14\xca\xaa\x60\xf5\x31\xc7\ \x0a\x5a\x46\x67\xd0\xc2\x0e\x56\x29\xd3\x19\x5c\xbf\x8c\x31\x1e\ \x32\xcc\x32\x8e\x9b\x83\xb1\xb5\x08\x6a\xd7\x27\xd0\x52\xb1\xb4\ \x77\x29\x65\xb7\xc4\x91\xdc\xd0\x8c\xdd\x6f\x87\x00\x69\x24\xb8\ \x32\x20\xc1\xbf\x7d\xe4\x66\x8a\xae\xcf\xa6\xc1\xcb\x58\xd1\x7b\ \x2e\x19\x9d\x21\x63\x8d\x2d\x3d\x97\x51\x19\x9c\x70\x6b\x0b\x1b\ \x47\x06\xfb\x8e\xca\xe0\x1b\x1f\x83\x87\x94\xaa\xaa\x05\x84\x94\ \xa1\x8f\x30\xe6\x27\x28\xc2\x89\x19\x24\x52\x2a\xfa\xbb\x06\x30\ \xc6\x27\x5f\xce\xb7\x24\x9c\x99\xc0\x19\x63\x02\xe2\x48\x92\xe0\ \xfc\x90\x04\x51\x2f\x77\x64\x6d\xd3\xd8\x58\xd2\x26\xa3\xb2\xc1\ \xc4\x92\xca\x60\x8c\x8f\xef\x07\x9a\x40\xa1\xaa\x79\x8a\x51\xaa\ \x9a\x40\x85\xdb\x20\x3f\x51\x22\xd1\x42\xd3\x6d\xcd\x43\xca\xfa\ \xf9\xfe\x1d\x0d\x30\x43\xed\xae\x77\xfc\x39\xeb\xfb\x2f\xe2\x13\ \x8f\x7e\x8a\xa2\x6b\xd8\x38\xb0\x99\xe5\x3d\x2b\x71\xa4\x8d\xa3\ \x33\x58\x2a\x83\x2d\x1d\x2c\xe5\x60\x09\x3b\xd0\x02\x3a\xd0\x00\ \xb6\xca\x90\x51\x59\x04\x32\x08\x05\x4b\x85\x24\xca\x59\x0c\x2a\ \x90\xa2\xa6\xc5\xd8\x7e\x90\xd2\xa6\xb1\xa5\x33\x23\xcf\xb5\x43\ \x80\x26\xed\xb3\x6f\xbf\x8f\x8d\x0b\xdf\xca\x67\x1e\xbb\x93\xb2\ \x6b\x58\xd7\x7f\x3e\x4b\x7a\x96\x63\xc9\x70\x7e\x20\xcc\x1b\x50\ \x04\x42\x0b\x8e\x67\xc9\x68\x07\x5b\x67\xc8\x68\x07\x25\x2c\x7c\ \xe3\xa3\xa5\x42\x0b\x0b\x25\x74\x90\xc2\x26\x54\xb5\x0a\x39\x20\ \x80\x46\x49\x3d\x2e\x6d\xed\x74\xe3\x8c\x34\x01\x71\xfc\xf1\x6f\ \x7d\x8e\xf5\xf3\xdf\xc2\xe7\x7f\xfc\x05\xca\x9e\xcf\xda\xfe\xf5\ \x2c\xe9\x5e\x82\x96\x0e\x5a\xd8\x68\xe1\xa0\xd0\x68\x61\xe1\x48\ \x07\x5b\x3b\x81\xa9\x50\xe1\x56\x3a\x68\x11\x2c\xf4\x14\xd4\x1f\ \xea\xb0\xb7\x6b\xb4\xd0\xa1\x89\x08\x49\xc0\xd8\x22\x51\x33\xd1\ \x5a\x41\xbd\x8c\x01\x4d\xf0\xb7\x72\x2f\x30\xc6\xb4\x7f\x3c\x73\ \x0a\x70\xdb\xae\x4f\xb1\x3f\xf7\x32\x1f\x7f\xdb\x47\xb0\x24\xbc\ \x7c\xfc\x15\x8e\xe6\x8f\x63\x8c\x62\xdf\xbe\xd7\xe9\x9b\xdf\xcf\ \xc2\xf9\x03\x38\x4e\x06\x25\x2c\xb4\xd0\x28\x69\xa1\x64\x10\x46\ \xd6\xd2\xc2\x51\x19\xba\xed\x1e\xb2\x2a\x5b\xf5\x27\x6c\x15\xf8\ \x0f\x4a\x69\xe4\x0c\xf7\x37\xcb\xb2\x10\x42\xbc\x0d\xf8\x07\x60\ \x98\x94\xd2\x98\x7a\x93\x41\x86\x60\x61\xa1\xa3\xdb\xb7\x6f\xff\ \x93\xe1\xe1\xe1\x85\xae\xeb\xd6\x5d\x66\xa4\x9d\x60\x8c\x51\xe5\ \x72\xb9\x7b\xde\xbc\x79\x4b\x2f\xbd\xf4\xd2\xab\x5a\xff\xa6\xe6\ \x55\xf7\x10\x9f\xde\x77\x17\xbf\xff\xd6\xdf\x41\x1a\x9f\xa1\xa3\ \x87\x39\x51\xca\x61\xdb\x61\x8f\xd7\x0e\x8e\x74\x50\xd2\x46\xca\ \x40\xd5\x07\xc2\x0f\xe2\x04\xb6\xca\x04\xbe\x80\x0c\x22\x8c\x5a\ \x6a\xb4\x0c\xcc\xc2\x4c\x0b\xbf\x55\xd4\x13\xa8\x24\x58\x69\x72\ \x31\xb0\x02\xe8\x27\x58\x66\xa4\xdd\x21\x08\x56\xc4\x18\x1c\x1c\ \x1c\xbc\xe8\x96\x5b\x6e\xf9\xdd\x89\x9e\xe0\x1f\xc4\xcf\x29\x67\ \x46\xf8\xdd\xf3\xdf\x8b\xc4\xb0\x7f\x74\x08\xcf\x52\x2c\x5c\x78\ \x16\x3d\xf3\xfa\x70\xb4\x83\x54\x3a\x34\x0f\x1a\x15\x0a\xdf\x52\ \x0e\xb6\x0c\x52\xcf\x6c\x95\x0d\x56\x2b\x57\x19\xb4\xb4\x5a\x4a\ \xcd\x9a\x0e\x38\x8e\x33\x29\x0d\x50\x24\x58\x62\xac\x08\x64\x68\ \xb2\xd2\x44\x9b\x40\x10\x10\x77\xd9\xaa\x55\xab\x96\x6f\xd9\xb2\ \x65\xc2\x27\xd8\xc2\x16\x9e\x3c\xf8\x23\x9e\x3d\xf6\x6b\xde\xb7\ \xfe\x6a\x56\xe8\x15\x0c\x95\x46\x70\xa5\xc4\xd6\x59\xb4\x0a\x55\ \xbf\xb0\xb0\xa4\x85\x16\x16\x96\x76\xb0\xa4\x83\x2d\x6d\x6c\x19\ \x6a\x0b\x69\xa3\x64\xf0\x78\x5b\xb5\xc7\xa7\x03\x8d\x08\xe0\x01\ \xa3\x04\x04\x68\x4f\xfd\x95\x8e\x6e\xc0\x1a\x1c\x1c\xcc\x6d\xd8\ \xb0\x81\x72\xb9\x3c\xe1\x13\x9c\x77\xde\x79\xfc\x68\xef\x0f\xf8\ \xf9\x91\xff\xc7\xb5\x6f\xba\x9c\x05\x7a\x80\xa1\xfc\x28\x45\x2f\ \x1c\xf7\x8b\x50\x03\x48\x1d\x0c\x13\xa5\x1d\xcc\x1e\xaa\x0c\x76\ \x38\x54\xb4\xa4\x5d\xa7\xec\xac\xbd\xd0\x28\x21\x24\x22\x41\xfa\ \x0a\xcb\xed\x09\x41\xb0\x26\x5e\x59\x6b\xed\xf5\xf4\xf4\x90\xcf\ \x9f\x5a\xd4\x6d\xfb\x86\x0f\xf0\xe4\x2b\x7f\xc3\xb3\x6f\xfc\x86\ \x2b\x56\x5e\xc0\xa2\x9e\x85\x1c\x2b\xe4\xa9\x54\x7c\xa4\x0c\x08\ \x60\x29\x0b\x1d\x09\x5f\x66\xb0\x95\x83\x23\x6d\xb4\x08\xac\x65\ \x3b\xf7\xfc\x08\xb3\xa9\x67\x4f\x08\x93\xfd\x7b\xbf\x00\x5b\x56\ \xbd\x9b\xa5\xf3\x56\xf1\x7f\xf6\xbf\x82\x31\x92\xfe\xee\x3e\xba\ \x9d\x6e\x2c\xe1\x04\x79\x03\xc2\x09\x85\x1f\xd8\x7f\x3b\x74\x08\ \xa1\x3d\x62\x27\xad\xa0\x6d\x4b\xc3\x26\x8b\xb4\x35\x74\x4e\x05\ \x97\x2c\xbb\x82\x5f\x1d\xfa\x05\x2f\x0f\x1d\x62\xcd\x59\xcb\xe9\ \xc9\xce\xa3\x54\xf2\x30\x46\x06\x59\x44\x91\xed\xd7\x81\x26\xc0\ \x54\xd3\x43\x66\x05\xe6\xac\x06\x98\x4a\x6c\x5a\x74\x11\x0b\xb3\ \x8b\x39\x78\xe2\x04\xc2\x57\x74\x39\x5d\x64\x74\x26\x08\x11\x4b\ \xbb\x1a\x2e\x6e\x7f\x1f\x79\x3c\xe6\xac\x06\x88\x30\x55\x76\xf8\ \xbc\xfe\xb5\xbc\x3e\xfc\x1a\xc3\xb9\x02\xfd\x3d\xf3\x83\x20\x8b\ \xa7\xaa\x31\x80\xa9\xfc\xad\x99\x44\x87\x00\x13\xc0\xd2\x9e\xe5\ \x1c\x2b\x1c\xa5\x5c\xf2\xe9\xce\x58\x68\x6d\xa1\xb1\x66\x9d\xda\ \x8f\xa3\x63\x02\x26\x88\xfe\xec\x42\xba\x74\x37\xc2\x93\xa8\x39\ \xd0\x7f\x66\xff\x1d\x34\xc1\x74\xa8\xe5\x8c\xce\x56\xd7\x1f\x9a\ \xad\x3d\x3f\x42\x87\x00\x93\x39\xf7\x2c\x17\x3e\xcc\x61\x13\x70\ \x3a\x16\xb7\x9c\x8d\x98\xf3\x1a\xa0\x43\x84\xc6\x98\xf3\x04\x98\ \x8d\x43\xb3\x99\xc4\x9c\x35\x01\x1d\xb4\x86\x8e\x06\x38\xc3\xd1\ \x21\xc0\x19\x8e\x8e\x09\x38\xc3\xd1\xd1\x00\x67\x38\xe6\x2c\x01\ \xa6\x6a\x3a\x78\xae\xa3\x63\x02\xce\x70\xcc\x59\x0d\x10\xa1\xa3\ \x01\x1a\xa3\x43\x80\x33\x1c\x1d\x13\x70\x86\xa3\xa3\x01\xce\x70\ \xcc\x55\x02\x54\xff\xe2\xc3\xd9\x67\x9f\x7d\x9a\x2f\xe5\xb4\xa3\ \x61\x0f\x98\x8b\x04\x30\x80\xb7\x67\xcf\x9e\x23\x77\xdd\x75\xd7\ \x63\x95\x4a\x65\x2e\xde\x63\x53\x58\x96\xe5\x2e\x58\xb0\x60\x98\ \xa0\xae\xa3\x2e\x09\x66\x5f\x1a\x6b\x63\x08\x82\x32\xb6\x25\xc0\ \x7a\x60\x29\xe0\x30\xf7\xee\xb3\x19\xa2\xe2\xde\x37\x80\xe7\x81\ \xfd\x04\x15\x5e\xe3\x88\x30\xd7\x1e\x4c\x54\x19\xd4\x07\x2c\x02\ \x7a\x09\xb4\xdc\x5c\xbb\xcf\x66\x30\x80\x4b\x50\x10\x7a\x08\x38\ \x49\x1d\x4d\x30\x17\x1f\x8c\x20\xa8\x64\xce\x84\xdb\xb9\x78\x8f\ \xad\xc0\x00\x15\x82\x9e\x5f\xa1\x8e\x19\x98\xab\x0f\x27\x5a\xd8\ \xbb\x83\xe0\xef\x61\x76\x86\x42\x1d\x74\xd0\x41\x0a\xfe\x3f\x32\ \x6b\x8b\xf8\x56\x76\x1c\x55\x00\x00\x00\x00\x49\x45\x4e\x44\xae\ \x42\x60\x82\ " qt_resource_name = b"\ \x00\x06\ \x07\x03\x7d\xc3\ \x00\x69\ \x00\x6d\x00\x61\x00\x67\x00\x65\x00\x73\ \x00\x0a\ \x08\xaa\x3c\x67\ \x00\x6c\ \x00\x6f\x00\x63\x00\x61\x00\x74\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\ \x00\x0d\ \x04\xf6\x3d\xa7\ \x00\x6d\ \x00\x6f\x00\x76\x00\x65\x00\x5f\x00\x63\x00\x65\x00\x6c\x00\x6c\x00\x2e\x00\x70\x00\x6e\x00\x67\ \x00\x12\ \x09\xfa\x25\xa7\ \x00\x63\ \x00\x72\x00\x65\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x61\x00\x6e\x00\x61\x00\x6c\x00\x6f\x00\x67\x00\x79\x00\x2e\x00\x70\x00\x6e\ \x00\x67\ \x00\x11\ \x0a\xfd\x03\xc7\ \x00\x61\ \x00\x70\x00\x70\x00\x6c\x00\x79\x00\x5f\x00\x61\x00\x6e\x00\x61\x00\x6c\x00\x6f\x00\x67\x00\x79\x00\x2e\x00\x70\x00\x6e\x00\x67\ \ \x00\x0a\ \x08\xab\xda\x07\ \x00\x75\ \x00\x70\x00\x64\x00\x61\x00\x74\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\ \x00\x0d\ \x00\xe0\xbd\xe7\ \x00\x63\ \x00\x6f\x00\x70\x00\x79\x00\x5f\x00\x63\x00\x65\x00\x6c\x00\x6c\x00\x2e\x00\x70\x00\x6e\x00\x67\ " qt_resource_struct = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x02\ \x00\x00\x00\xb8\x00\x00\x00\x00\x00\x01\x00\x00\xaa\x84\ \x00\x00\x00\x2c\x00\x00\x00\x00\x00\x01\x00\x00\x33\x7b\ \x00\x00\x00\x12\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ \x00\x00\x00\x9e\x00\x00\x00\x00\x00\x01\x00\x00\x7c\xef\ \x00\x00\x00\x4c\x00\x00\x00\x00\x00\x01\x00\x00\x4e\xca\ \x00\x00\x00\x76\x00\x00\x00\x00\x00\x01\x00\x00\x59\x53\ " def qInitResources(): QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) def qCleanupResources(): QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) qInitResources()
VisTrails/VisTrails
vistrails/packages/spreadsheet/cell_rc.py
Python
bsd-3-clause
211,544
0.000151
""" An exception is what occurs when you have a run time error in your program. what you can do is "try" a statement wether it is invalid or not if an error does occur withan that statement you can catch that error in the except clause and print out a corresponding message (or you can print out the error message). """ #made up imports will cause an imput error. try: import madeup except ImportError: print ImportError def main(): while True: #Similar to Try and catch, tries an error and catches it. try: x = int(raw_input("Please enter a number: ")) break except ValueError: print "Oops! That was no valid number. Try again..." #A lookup error in whon an a incorrect lookup happens in a dictionary, dict = {"string": "a word representation"} try: dict["ERROR"] except LookupError: print LookupError """ You can catch an exception and then use a finally clause to take care of your program A finally statement is executed no matter if an exception is thrown. """ try: a = 4 / 2 except Exception, e: raise e finally: print "finally clause raised" if __name__ == '__main__': main()
ajn123/Python_Tutorial
Python Version 2/Advanced/exceptions.py
Python
mit
1,154
0.034662
import hashlib import hmac import json import requests class GitHubResponse: """Wrapper for GET request response from GitHub""" def __init__(self, response): self.response = response @property def is_ok(self): """Check if request has been successful :return: if it was OK :rtype: bool """ return self.response.status_code < 300 @property def data(self): """Response data as dict/list :return: data of response :rtype: dict|list """ return self.response.json() @property def url(self): """URL of the request leading to this response :return: URL origin :rtype: str """ return self.response.url @property def links(self): """Response header links :return: URL origin :rtype: dict """ return self.response.links @property def is_first_page(self): """Check if this is the first page of data :return: if it is the first page of data :rtype: bool """ return 'first' not in self.links @property def is_last_page(self): """Check if this is the last page of data :return: if it is the last page of data :rtype: bool """ return 'last' not in self.links @property def is_only_page(self): """Check if this is the only page of data :return: if it is the only page page of data :rtype: bool """ return self.is_first_page and self.is_last_page @property def total_pages(self): """Number of pages :return: number of pages :rtype: int """ if 'last' not in self.links: return self.actual_page return self.parse_page_number(self.links['last']['url']) @property def actual_page(self): """Actual page number :return: actual page number :rtype: int """ return self.parse_page_number(self.url) @staticmethod def parse_page_number(url): """Parse page number from GitHub GET URL :param url: URL used for GET request :type url: str :return: page number :rtype: int """ if '?' not in url: return 1 params = url.split('?')[1].split('=') params = {k: v for k, v in zip(params[0::2], params[1::2])} if 'page' not in params: return 1 return int(params['page']) class GitHubAPI: """Simple GitHub API communication wrapper It provides simple way for getting the basic GitHub API resources and special methods for working with webhooks. .. todo:: handle if GitHub is out of service, custom errors, better abstraction, work with extensions """ #: URL to GitHub API API_URL = 'https://api.github.com' #: URL for OAuth request at GitHub AUTH_URL = 'https://github.com/login/oauth/authorize?scope={}&client_id={}' #: URL for OAuth token at GitHub TOKEN_URL = 'https://github.com/login/oauth/access_token' #: Scopes for OAuth request SCOPES = ['user', 'repo', 'admin:repo_hook'] #: Required webhooks to be registered WEBHOOKS = ['push', 'release', 'repository'] #: Controller for incoming webhook events WEBHOOK_CONTROLLER = 'webhooks.gh_webhook' #: URL for checking connections within GitHub CONNECTIONS_URL = 'https://github.com/settings/connections/applications/{}' def __init__(self, client_id, client_secret, webhooks_secret, session=None, token=None): self.client_id = client_id self.client_secret = client_secret self.webhooks_secret = webhooks_secret self.session = session or requests.Session() self.token = token self.scope = [] def _get_headers(self): """Prepare auth header fields (empty if no token provided) :return: Headers for the request :rtype: dict """ if self.token is None: return {} return { 'Authorization': 'token {}'.format(self.token), 'Accept': 'application/vnd.github.mercy-preview+json' } def get_auth_url(self): """Create OAuth request URL :return: OAuth request URL :rtype: str """ return self.AUTH_URL.format(' '.join(self.SCOPES), self.client_id) def login(self, session_code): """Authorize via OAuth with given session code :param session_code: The session code for OAuth :type session_code: str :return: If the auth procedure was successful :rtype: bool .. todo:: check granted scope vs GH_SCOPES """ response = self.session.post( self.TOKEN_URL, headers={ 'Accept': 'application/json' }, data={ 'client_id': self.client_id, 'client_secret': self.client_secret, 'code': session_code, } ) if response.status_code != 200: return False data = response.json() self.token = data['access_token'] self.scope = [x for x in data['scope'].split(',')] return True def get(self, what, page=0): """Perform GET request on GitHub API :param what: URI of requested resource :type what: str :param page: Number of requested page :type page: int :return: Response from the GitHub :rtype: ``repocribro.github.GitHubResponse`` """ uri = self.API_URL + what if page > 0: uri += '?page={}'.format(page) return GitHubResponse(self.session.get( uri, headers=self._get_headers() )) def webhook_get(self, full_name, hook_id): """Perform GET request for repo's webhook :param full_name: Full name of repository that contains the hook :type full_name: str :param hook_id: GitHub ID of hook to be get :type hook_id: int :return: Data of the webhook :rtype: ``repocribro.github.GitHubResponse`` """ return self.get('/repos/{}/hooks/{}'.format(full_name, hook_id)) def webhooks_get(self, full_name): """GET all webhooks of the repository :param full_name: Full name of repository :type full_name: str :return: List of returned webhooks :rtype: ``repocribro.github.GitHubResponse`` """ return self.get('/repos/{}/hooks'.format(full_name)) def webhook_create(self, full_name, hook_url, events=None): """Create new webhook for specified repository :param full_name: Full name of the repository :type full_name: str :param hook_url: URL where the webhook data will be sent :type hook_url: str :param events: List of requested events for that webhook :type events: list of str :return: The created webhook data :rtype: dict or None """ if events is None: events = self.WEBHOOKS data = { 'name': 'web', 'active': True, 'events': events, 'config': { 'url': hook_url, 'content_type': 'json', 'secret': self.webhooks_secret } } response = self.session.post( self.API_URL + '/repos/{}/hooks'.format(full_name), data=json.dumps(data), headers=self._get_headers() ) if response.status_code == 201: return response.json() return None def webhook_tests(self, full_name, hook_id): """Perform test request for repo's webhook :param full_name: Full name of repository that contains the hook :type full_name: str :param hook_id: GitHub ID of hook to be tested :type hook_id: int :return: If request was successful :rtype: bool """ response = self.session.delete( self.API_URL + '/repos/{}/hooks/{}/tests'.format( full_name, hook_id ), headers=self._get_headers() ) return response.status_code == 204 def webhook_delete(self, full_name, hook_id): """Perform DELETE request for repo's webhook :param full_name: Full name of repository that contains the hook :type full_name: str :param hook_id: GitHub ID of hook to be deleted :type hook_id: int :return: If request was successful :rtype: bool """ response = self.session.delete( self.API_URL + '/repos/{}/hooks/{}'.format( full_name, hook_id ), headers=self._get_headers() ) return response.status_code == 204 def webhook_verify_signature(self, data, signature): """Verify the content with signature :param data: Request data to be verified :param signature: The signature of data :type signature: str :return: If the content is verified :rtype: bool """ h = hmac.new( self.webhooks_secret.encode('utf-8'), data, hashlib.sha1 ) return hmac.compare_digest(h.hexdigest(), signature) @property def app_connections_link(self): return self.CONNECTIONS_URL.format(self.client_id)
MarekSuchanek/repocribro
repocribro/github.py
Python
mit
9,565
0
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # """ Filter rule to match persons with a particular citation. """ #------------------------------------------------------------------------- # # Standard Python modules # #------------------------------------------------------------------------- from ....const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext #------------------------------------------------------------------------- # # Gramps modules # #------------------------------------------------------------------------- from .._hascitationbase import HasCitationBase #------------------------------------------------------------------------- # # HasEvent # #------------------------------------------------------------------------- class HasCitation(HasCitationBase): """Rule that checks for a person with a particular value""" labels = [ _('Volume/Page:'), _('Date:'), _('Confidence level:')] name = _('People with the <citation>') description = _("Matches people with a citation of a particular " "value")
beernarrd/gramps
gramps/gen/filters/rules/person/_hascitation.py
Python
gpl-2.0
1,883
0.006373
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Peter Mounce <[email protected]> # # 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/>. # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} DOCUMENTATION = ''' --- module: win_webpicmd version_added: "2.0" short_description: Installs packages using Web Platform Installer command-line description: - Installs packages using Web Platform Installer command-line (http://www.iis.net/learn/install/web-platform-installer/web-platform-installer-v4-command-line-webpicmdexe-rtw-release). - Must be installed and present in PATH (see win_chocolatey module; 'webpicmd' is the package name, and you must install 'lessmsi' first too) - Install IIS first (see win_feature module) notes: - accepts EULAs and suppresses reboot - you will need to check manage reboots yourself (see win_reboot module) options: name: description: - Name of the package to be installed required: true author: Peter Mounce ''' EXAMPLES = ''' # Install URLRewrite2. win_webpicmd: name: URLRewrite2 '''
gundalow/ansible-modules-extras
windows/win_webpicmd.py
Python
gpl-3.0
1,852
0.00162
""" tests: this package contains all Scrapy unittests see http://doc.scrapy.org/en/latest/contributing.html#running-tests """ import os # ignore system-wide proxies for tests # which would send requests to a totally unsuspecting server # (e.g. because urllib does not fully understand the proxy spec) os.environ['http_proxy'] = '' os.environ['https_proxy'] = '' os.environ['ftp_proxy'] = '' # Absolutize paths to coverage config and output file because tests that # spawn subprocesses also changes current working directory. _sourceroot = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if 'COV_CORE_CONFIG' in os.environ: os.environ['COVERAGE_FILE'] = os.path.join(_sourceroot, '.coverage') os.environ['COV_CORE_CONFIG'] = os.path.join(_sourceroot, os.environ['COV_CORE_CONFIG']) try: import unittest.mock as mock except ImportError: import mock tests_datadir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'sample_data') def get_testdata(*paths): """Return test data""" path = os.path.join(tests_datadir, *paths) with open(path, 'rb') as f: return f.read()
rolando-contrib/scrapy
tests/__init__.py
Python
bsd-3-clause
1,205
0
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # # 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 # # $Id$ __all__ = ["LinkBox"] #------------------------------------------------------------------------- # # Standard python modules # #------------------------------------------------------------------------- import logging _LOG = logging.getLogger(".widgets.linkbox") #------------------------------------------------------------------------- # # GTK/Gnome modules # #------------------------------------------------------------------------- from gi.repository import GObject from gi.repository import Gtk #------------------------------------------------------------------------- # # LinkBox class # #------------------------------------------------------------------------- class LinkBox(Gtk.HBox): def __init__(self, link, button): GObject.GObject.__init__(self) self.set_spacing(6) self.pack_start(link, False, True, 0) if button: self.pack_start(button, False, True, 0) self.show()
Forage/Gramps
gramps/gui/widgets/linkbox.py
Python
gpl-2.0
1,754
0.005701
from datetime import datetime, timedelta import csv from cStringIO import StringIO from django.test import TestCase from django.contrib.auth.models import User from django.test import Client from django.http import HttpRequest, QueryDict, response from mock import patch, Mock from .models import Variable, Session, Visitor, SESSION_TIMEOUT, VISITOR_FIELDS from .views import AppLaunch import utils import urllib class ViewTests(TestCase): def setUp(self): self.user = User.objects.create(username='testuser', email='[email protected]') self.user.set_password('password') self.user.save() profile = self.user.userprofile profile_data = { 'country': 'USA', } for field in profile_data: setattr(profile, field, profile_data[field]) profile.save() self.visitor = Visitor.objects.create() self.session = Session.objects.create(visitor=self.visitor) def createRequest(self, user=None): self.request = Mock() if user is not None: self.request.user = user # sample request with mocked ip address self.request.META = { 'HTTP_X_FORWARDED_FOR': '192.168.255.182, 10.0.0.0,' + '127.0.0.1, 198.84.193.157, ' '177.139.233.139', 'HTTP_X_REAL_IP': '177.139.233.132', 'REMOTE_ADDR': '177.139.233.133', } self.request.method = 'GET' self.request.session = {} return self.request def test_get(self): # check that there are no logs for app_launch app_lauch_cnt = Variable.objects.filter(name='app_launch').count() self.assertEqual(app_lauch_cnt, 0) # create a mock request object r = self.createRequest(self.user) # build request 'GET' res_id = 'D7a7de92941a044049a7b8ad09f4c75bb' res_type = 'GenericResource' app_name = 'test' request_url = 'https://apps.hydroshare.org/apps/hydroshare-gis/' \ '?res_id=%s&res_type=%s' % (res_id, res_type) app_url = urllib.quote(request_url) href = 'url=%s;name=%s' % (app_url, app_name) r.GET = QueryDict(href) # invoke the app logging endpoint app_logging = AppLaunch() url_redirect = app_logging.get(r) # validate response self.assertTrue(type(url_redirect) == response.HttpResponseRedirect) self.assertTrue(url_redirect.url == request_url) # validate logged data app_lauch_cnt = Variable.objects.filter(name='app_launch').count() self.assertEqual(app_lauch_cnt, 1) data = list(Variable.objects.filter(name='app_launch')) values = dict(tuple(pair.split('=')) for pair in data[0].value.split('|')) self.assertTrue('res_type' in values.keys()) self.assertTrue('name' in values.keys()) self.assertTrue('user_email_domain' in values.keys()) self.assertTrue('user_type' in values.keys()) self.assertTrue('user_ip' in values.keys()) self.assertTrue('res_id' in values.keys()) self.assertTrue(values['res_type'] == res_type) self.assertTrue(values['name'] == app_name) self.assertTrue(values['user_email_domain'] == self.user.email[-3:]) self.assertTrue(values['user_type'] == 'Unspecified') self.assertTrue(values['user_ip'] == '198.84.193.157') self.assertTrue(values['res_id'] == res_id) class TrackingTests(TestCase): def setUp(self): self.user = User.objects.create(username='testuser', email='[email protected]') self.user.set_password('password') self.user.save() profile = self.user.userprofile profile_data = { 'country': 'USA', } for field in profile_data: setattr(profile, field, profile_data[field]) profile.save() self.visitor = Visitor.objects.create() self.session = Session.objects.create(visitor=self.visitor) def createRequest(self, user=None): request = Mock() if user is not None: request.user = user # sample request with mocked ip address request.META = { 'HTTP_X_FORWARDED_FOR': '192.168.255.182, 10.0.0.0, ' + '127.0.0.1, 198.84.193.157, ' '177.139.233.139', 'HTTP_X_REAL_IP': '177.139.233.132', 'REMOTE_ADDR': '177.139.233.133', } return request def test_record_variable(self): self.session.record('int', 42) self.session.record('float', 3.14) self.session.record('true', True) self.session.record('false', False) self.session.record('text', "Hello, World") self.assertEqual("42", self.session.variable_set.get(name='int').value) self.assertEqual("3.14", self.session.variable_set.get(name='float').value) self.assertEqual("true", self.session.variable_set.get(name='true').value) self.assertEqual("false", self.session.variable_set.get(name='false').value) self.assertEqual('Hello, World', self.session.variable_set.get(name='text').value) def test_record_bad_value(self): self.assertRaises(TypeError, self.session.record, 'bad', ['oh no i cannot handle arrays']) def test_get(self): self.assertEqual(42, Variable(name='var', value='42', type=0).get_value()) self.assertEqual(3.14, Variable(name='var', value='3.14', type=1).get_value()) self.assertEqual(True, Variable(name='var', value='true', type=3).get_value()) self.assertEqual(False, Variable(name='var', value='false', type=3).get_value()) self.assertEqual("X", Variable(name='var', value='X', type=2).get_value()) self.assertEqual(None, Variable(name='var', value='', type=4).get_value()) def test_for_request_new(self): request = self.createRequest(user=self.user) request.session = {} session = Session.objects.for_request(request) self.assertIn('hs_tracking_id', request.session) self.assertEqual(session.visitor.user.id, self.user.id) def test_for_request_existing(self): request = self.createRequest(user=self.user) request.session = {} session1 = Session.objects.for_request(request) session2 = Session.objects.for_request(request) self.assertEqual(session1.id, session2.id) def test_for_request_expired(self): request = self.createRequest(user=self.user) request.session = {} session1 = Session.objects.for_request(request) with patch('hs_tracking.models.datetime') as dt_mock: dt_mock.now.return_value = datetime.now() + timedelta(seconds=SESSION_TIMEOUT) session2 = Session.objects.for_request(request) self.assertNotEqual(session1.id, session2.id) self.assertEqual(session1.visitor.id, session2.visitor.id) def test_for_other_user(self): request = self.createRequest(user=self.user) request.session = {} session1 = Session.objects.for_request(request) user2 = User.objects.create(username='testuser2', email='[email protected]') request = self.createRequest(user=user2) request.session = {} session2 = Session.objects.for_request(request) self.assertNotEqual(session1.id, session2.id) self.assertNotEqual(session1.visitor.id, session2.visitor.id) def test_export_visitor_info(self): request = self.createRequest(user=self.user) request.session = {} session1 = Session.objects.for_request(request) info = session1.visitor.export_visitor_information() self.assertEqual(info['country'], 'USA') self.assertEqual(info['username'], 'testuser') def test_tracking_view(self): self.user.is_staff = True self.user.save() client = Client() client.login(username=self.user.username, password='password') response = client.get('/hydroshare/tracking/reports/profiles/') reader = csv.reader(StringIO(response.content)) rows = list(reader) self.assertEqual(response.status_code, 200) self.assertEqual(rows[0], VISITOR_FIELDS) i = VISITOR_FIELDS.index('username') # Row 1 is the original unauthenticated session created in setUp() self.assertEqual(rows[1][i], '') # Row 2 is the user we just authenticated self.assertEqual(rows[2][i], self.user.username) def test_history_empty(self): self.user.is_staff = True self.user.save() client = Client() response = client.get('/hydroshare/tracking/reports/history/') self.assertEqual(response.status_code, 200) reader = csv.reader(StringIO(response.content)) rows = list(reader) count = Variable.objects.all().count() self.assertEqual(len(rows), count + 1) # +1 to account for the session header def test_history_variables(self): self.user.is_staff = True self.user.save() client = Client() variable = self.session.record('testvar', "abcdef") self.assertEqual(variable.session.id, self.session.id) response = client.get('/hydroshare/tracking/reports/history/') self.assertEqual(response.status_code, 200) reader = csv.DictReader(StringIO(response.content)) rows = list(reader) data = rows[-1] self.assertEqual(int(data['session']), self.session.id) self.assertEqual(int(data['visitor']), self.visitor.id) self.assertEqual(data['variable'], "testvar") self.assertEqual(data['value'], "abcdef") def test_capture_logins_and_logouts(self): self.assertEqual(Variable.objects.count(), 0) client = Client() client.login(username=self.user.username, password='password') self.assertEqual(Variable.objects.count(), 2) var1, var2 = Variable.objects.all() kvp = dict(tuple(pair.split('=')) for pair in var1.value.split('|')) self.assertEqual(var1.name, 'begin_session') self.assertEqual(len(kvp.keys()), 3) kvp = dict(tuple(pair.split('=')) for pair in var2.value.split('|')) self.assertEqual(var2.name, 'login') self.assertEqual(len(kvp.keys()), 3) client.logout() self.assertEqual(Variable.objects.count(), 3) var = Variable.objects.latest('timestamp') kvp = dict(tuple(pair.split('=')) for pair in var.value.split('|')) self.assertEqual(var.name, 'logout') self.assertEqual(len(kvp.keys()), 3) def test_activity_parsing(self): client = Client() client.login(username=self.user.username, password='password') self.assertEqual(Variable.objects.count(), 2) var1, var2 = Variable.objects.all() kvp = dict(tuple(pair.split('=')) for pair in var1.value.split('|')) self.assertEqual(var1.name, 'begin_session') self.assertEqual(len(kvp.keys()), 3) client.logout() class UtilsTests(TestCase): def setUp(self): self.user = User.objects.create(username='testuser', email='[email protected]') self.user.set_password('password') self.user.save() self.visitor = Visitor.objects.create() self.session = Session.objects.create(visitor=self.visitor) # sample request with mocked ip address self.request = HttpRequest() self.request.META = { 'HTTP_X_FORWARDED_FOR': '192.168.255.182, 10.0.0.0, 127.0.0.1, 198.84.193.157, ' '177.139.233.139', 'HTTP_X_REAL_IP': '177.139.233.132', 'REMOTE_ADDR': '177.139.233.133', } def tearDown(self): self.user.delete def test_std_log_fields(self): log_fields = utils.get_std_log_fields(self.request, self.session) self.assertTrue(len(log_fields.keys()) == 3) self.assertTrue('user_ip' in log_fields) self.assertTrue('user_type' in log_fields) self.assertTrue('user_email_domain' in log_fields) def test_ishuman(self): useragents = [ ('Mozilla/5.0 (compatible; bingbot/2.0; ' '+http://www.bing.com/bingbot.htm)', False), ('Googlebot/2.1 (+http://www.googlebot.com/bot.html)', False), ('Mozilla/5.0 (compatible; Yahoo! Slurp; ' 'http://help.yahoo.com/help/us/ysearch/slurp)', False), ('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) ' 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36', True), ('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) ' 'AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27', True), ('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 ' 'Firefox/21.0', True), ('Mozilla/5.0 (Windows NT 10.0; Win64; x64) ' 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 ' 'Edge/13.10586', True) ] for useragent, ishuman in useragents: self.assertEqual(ishuman, utils.is_human(useragent)) def test_get_user_email(self): # list of common and unusual valid email address formats valid_emails = [ ('[email protected]', 'com'), ('[email protected]', 'com'), ('[email protected]', 'com'), ('"email"@example.com', 'com'), ('[email protected]', 'com'), ('[email protected]', 'com'), ('[email protected]', 'com'), ('[email protected]', 'co.uk'), ('[email protected]', 'com'), ('much."more\ unusual"@example.com', 'com'), ('very.unusual."@"[email protected]', 'com'), ('very."(),:;<>[]".VERY."very@\\ "very"[email protected]', 'example.com') ] # create session for each email and test email domain parsing for email, dom in valid_emails: user = User.objects.create(username='testuser1', email=email) visitor = Visitor.objects.create() visitor.user = user session = Session.objects.create(visitor=visitor) emaildom = utils.get_user_email_domain(session) self.assertTrue(emaildom == dom) user.delete() def test_client_ip(self): ip = utils.get_ip(self.request) self.assertEqual(ip, "198.84.193.157") def test_get_user_type(self): user_types = ['Faculty', 'Researcher', 'Test', None] for user_type in user_types: self.user.userprofile.user_type = user_type visitor = Visitor.objects.create() visitor.user = self.user session = Session.objects.create(visitor=visitor) usrtype = utils.get_user_type(session) self.assertTrue(user_type == usrtype) del self.user.userprofile.user_type visitor = Visitor.objects.create() visitor.user = self.user session = Session.objects.create(visitor=visitor) usrtype = utils.get_user_type(session) self.assertTrue(usrtype is None)
ResearchSoftwareInstitute/MyHPOM
hs_tracking/tests.py
Python
bsd-3-clause
15,515
0.001482
from .blueprint import bp from .submission import *
SpeedProg/eve-inc-waitlist
waitlist/blueprints/xup/__init__.py
Python
mit
52
0
#!/usr/bin/python # omega - python client # https://github.com/jfillmore/Omega-API-Engine # # Copyright 2011, Jonathon Fillmore # Licensed under the MIT license. See LICENSE file. # http://www.opensource.org/licenses/mit-license.php """Omega core library.""" __all__ = ['client', 'dbg', 'browser', 'box_factory', 'error', 'util', 'shell'] import dbg from util import * from error import Exception
jfillmore/Omega-API-Engine
clients/python/omega/__init__.py
Python
mit
402
0.002488
from cfme.utils.version import get_stream from collections import namedtuple from contextlib import contextmanager from cfme.test_framework.sprout.client import SproutClient from cfme.utils.conf import cfme_data, credentials from cfme.utils.log import logger import pytest from wait_for import wait_for from cfme.test_framework.sprout.client import SproutException from fixtures.appliance import temp_appliances TimedCommand = namedtuple('TimedCommand', ['command', 'timeout']) @pytest.yield_fixture(scope="function") def dedicated_db_appliance(app_creds, appliance): """'ap' launch appliance_console, '' clear info screen, '5/8' setup db, '1' Creates v2_key, '1' selects internal db, 'y' continue, '1' use partition, 'y' create dedicated db, 'pwd' db password, 'pwd' confirm db password + wait 360 secs and '' finish.""" if appliance.version > '5.7': with temp_appliances(count=1, preconfigured=False) as apps: pwd = app_creds['password'] opt = '5' if apps[0].version >= "5.8" else '8' command_set = ('ap', '', opt, '1', '1', 'y', '1', 'y', pwd, TimedCommand(pwd, 360), '') apps[0].appliance_console.run_commands(command_set) wait_for(lambda: apps[0].db.is_dedicated_active) yield apps[0] else: raise Exception("Can't setup dedicated db on appliance below 5.7 builds") """ The Following fixtures are for provisioning one preconfigured or unconfigured appliance for testing from an FQDN provider unless there are no provisions available""" @contextmanager def fqdn_appliance(appliance, preconfigured): sp = SproutClient.from_config() available_providers = set(sp.call_method('available_providers')) required_providers = set(cfme_data['fqdn_providers']) usable_providers = available_providers & required_providers version = appliance.version.vstring stream = get_stream(appliance.version) for provider in usable_providers: try: apps, pool_id = sp.provision_appliances( count=1, preconfigured=preconfigured, version=version, stream=stream, provider=provider ) break except Exception as e: logger.warning("Couldn't provision appliance with following error:") logger.warning("{}".format(e)) continue else: logger.error("Couldn't provision an appliance at all") raise SproutException('No provision available') yield apps[0] apps[0].ssh_client.close() sp.destroy_pool(pool_id) @pytest.yield_fixture() def unconfigured_appliance(appliance): with fqdn_appliance(appliance, preconfigured=False) as app: yield app @pytest.yield_fixture() def configured_appliance(appliance): with fqdn_appliance(appliance, preconfigured=True) as app: yield app @pytest.yield_fixture() def ipa_crud(configured_appliance, ipa_creds): configured_appliance.appliance_console_cli.configure_ipa(ipa_creds['ipaserver'], ipa_creds['username'], ipa_creds['password'], ipa_creds['domain'], ipa_creds['realm']) yield(configured_appliance) @pytest.fixture() def app_creds(): return { 'username': credentials['database']['username'], 'password': credentials['database']['password'], 'sshlogin': credentials['ssh']['username'], 'sshpass': credentials['ssh']['password'] } @pytest.fixture(scope="module") def app_creds_modscope(): return { 'username': credentials['database']['username'], 'password': credentials['database']['password'], 'sshlogin': credentials['ssh']['username'], 'sshpass': credentials['ssh']['password'] } @pytest.fixture() def ipa_creds(): fqdn = cfme_data['auth_modes']['ext_ipa']['ipaserver'].split('.', 1) creds_key = cfme_data['auth_modes']['ext_ipa']['credentials'] return{ 'hostname': fqdn[0], 'domain': fqdn[1], 'realm': cfme_data['auth_modes']['ext_ipa']['iparealm'], 'ipaserver': cfme_data['auth_modes']['ext_ipa']['ipaserver'], 'username': credentials[creds_key]['principal'], 'password': credentials[creds_key]['password'] }
jkandasa/integration_tests
cfme/fixtures/cli.py
Python
gpl-2.0
4,212
0.002374
import os import glob SOURCE_FILES = glob.glob(os.path.dirname(__file__) + "/*.py") __all__ = [os.path.basename(f)[: -3] for f in SOURCE_FILES] __doc__ = """\ Module for advanced plotting based on matplotlib """ from .popups import *
Repythory/Libraries
amolf/plotting/__init__.py
Python
bsd-2-clause
236
0.008475
#!/usr/bin/env python # encoding: utf-8 import unittest from ..test import TestCase, Spy from ..http.mocks.presence_subscription_mock import PresenceSubscriptionMock from ..http.mocks.subscription_mock import SubscriptionMock from . import * class TestSubscription(TestCase): def test_presence_decryption(self): sdk = self.get_sdk() sdk.get_context().get_mocks().add(PresenceSubscriptionMock()) aes_message = 'gkw8EU4G1SDVa2/hrlv6+0ViIxB7N1i1z5MU/Hu2xkIKzH6yQzhr3vIc27IAN558kTOkacqE5DkLpRdnN1orwtIBsUHm' + \ 'PMkMWTOLDzVr6eRk+2Gcj2Wft7ZKrCD+FCXlKYIoa98tUD2xvoYnRwxiE2QaNywl8UtjaqpTk1+WDImBrt6uabB1WICY' + \ '/qE0It3DqQ6vdUWISoTfjb+vT5h9kfZxWYUP4ykN2UtUW1biqCjj1Rb6GWGnTx6jPqF77ud0XgV1rk/Q6heSFZWV/GP2' + \ '3/iytDPK1HGJoJqXPx7ErQU=' s = sdk.get_subscription() spy = Spy() s.add_events(['/restapi/v1.0/account/~/extension/1/presence']) s.on(EVENTS['notification'], spy) s.register() s._get_pubnub().receive_message(aes_message) expected = { "timestamp": "2014-03-12T20:47:54.712+0000", "body": { "extensionId": 402853446008, "telephonyStatus": "OnHold" }, "event": "/restapi/v1.0/account/~/extension/402853446008/presence", "uuid": "db01e7de-5f3c-4ee5-ab72-f8bd3b77e308" } self.assertEqual(expected, spy.args[0]) s.destroy() def test_plain_subscription(self): sdk = self.get_sdk() sdk.get_context().get_mocks().add(SubscriptionMock()) s = sdk.get_subscription() spy = Spy() expected = { "timestamp": "2014-03-12T20:47:54.712+0000", "body": { "extensionId": 402853446008, "telephonyStatus": "OnHold" }, "event": "/restapi/v1.0/account/~/extension/402853446008/presence", "uuid": "db01e7de-5f3c-4ee5-ab72-f8bd3b77e308" } s.add_events(['/restapi/v1.0/account/~/extension/1/presence']) s.on(EVENTS['notification'], spy) s.register() s._get_pubnub().receive_message(expected) self.assertEqual(expected, spy.args[0]) s.destroy() def test_subscribe_with_events(self): sdk = self.get_sdk() sdk.get_context().get_mocks().add(SubscriptionMock()) s = sdk.get_subscription() res = s.register(events=['/restapi/v1.0/account/~/extension/1/presence']) self.assertEqual('/restapi/v1.0/account/~/extension/1/presence', res.get_json().eventFilters[0]) s.destroy() if __name__ == '__main__': unittest.main()
RingCentralVuk/ringcentral-python
ringcentral/subscription/__init__test.py
Python
mit
2,725
0.001835
#-*- coding: utf-8 -*- from django import forms from models import User from captcha.fields import CaptchaField class UserForm(forms.ModelForm): captcha = CaptchaField() cgu = forms.BooleanField() class Meta: model = User widgets = { 'pseudo': forms.TextInput(attrs={'class':'form-control'}), 'nom': forms.TextInput(attrs={'class':'form-control'}), 'email': forms.TextInput(attrs={'class':'form-control'}) }
remontees/EliteHebergPanel
home/forms.py
Python
lgpl-3.0
442
0.020362
from pycp2k.inputsection import InputSection from ._print55 import _print55 from ._interpolator10 import _interpolator10 class _nmr1(InputSection): def __init__(self): InputSection.__init__(self) self.Section_parameters = None self.Interpolate_shift = None self.Nics = None self.Nics_file_name = None self.Restart_nmr = None self.Shift_gapw_radius = None self.PRINT = _print55() self.INTERPOLATOR = _interpolator10() self._name = "NMR" self._keywords = {'Restart_nmr': 'RESTART_NMR', 'Nics': 'NICS', 'Nics_file_name': 'NICS_FILE_NAME', 'Interpolate_shift': 'INTERPOLATE_SHIFT', 'Shift_gapw_radius': 'SHIFT_GAPW_RADIUS'} self._subsections = {'INTERPOLATOR': 'INTERPOLATOR', 'PRINT': 'PRINT'} self._attributes = ['Section_parameters']
SINGROUP/pycp2k
pycp2k/classes/_nmr1.py
Python
lgpl-3.0
844
0.00237
### Interactively plot points ### to show the correlation between the x and y directions. ### By Rajeev Raizada, Jan.2011. ### Requires Python, with the Matplotlib and SciPy modules. ### You can download Python and those modules for free from ### http://www.python.org/download ### http://scipy.org ### http://matplotlib.sourceforge.net ### ### Please feel more than free to use this code for teaching. ### If you use it, I'd love to hear from you! ### If you have any questions, comments or feedback, ### please send them to me: rajeev dot raizada at dartmouth dot edu ### ### Some tutorial exercises which might be useful to try: ### 1. Click to make a few points in more or less a straight line. ### What is the correlation value? ### Now add a point far away from the line. ### What does adding that point do to the correlation value? ### Try deleting the point by clicking on it, then re-adding it, to compare. ### 2. Click outside the axes to reset the plot. ### Now put in about 10 points in a oval-ish cloud, ### deleting and adjusting them so that you get a correlation ### of around r=0.6. ### What is the size of the p-value associated with this correlation? ### (This p-value is the probability of observing this r-value ### if the population the points were sampled from actually had zero correlation). ### Now add another 10 points, so that there are 20 in all, ### while keeping the correlation value at r=0.6. ### What is the p-value now? ### 3. Click outside the axes to reset the plot. ### Now make in turn, approximately, each of the four plots ### shown in Anscombe's Quartet: ### http://en.wikipedia.org/wiki/Anscombe's_quartet ### What does this tell you how only knowing a correlation-value ### might give you a misleading picture of the data? ########################################### # First, we import the modules that we need import pylab import scipy import scipy.stats # We need this one for the norm.pdf function ##################################################### # Next, we define the functions that the program uses ### This function clears the figure and empties the points list def clear_the_figure_and_empty_points_list(): global coords_array global point_handles_array # Reset our variables to be empty coords_array = scipy.array([]) point_handles_array = scipy.array([]) handle_of_regression_line_plot = [] ### Clear the figure window pylab.clf() # clf means "clear the figure" ### In order to keep the boundaries of the figure fixed in place, ### we will draw a white box around the region that we want. pylab.plot(axis_range*scipy.array([-1, 1, 1, -1]), axis_range*scipy.array([-1, -1, 1, 1]),'w-') ### We want a long title, so we put a \n in the middle, to start a new line of title-text multiline_title_string = 'Click to add points, on old points to delete,' \ ' outside axes to reset.\n' \ ' The red line is the linear regression best-fit.' pylab.title(multiline_title_string) pylab.grid(True) # Add a grid on to the figure window pylab.axis('equal') # Make the tick-marks equally spaced on x- and y-axes pylab.axis(axis_range*scipy.array([-1, 1, -1, 1])) # This is the function which gets called when the mouse is clicked in the figure window def do_this_when_the_mouse_is_clicked(this_event): global coords_array global point_handles_array x = this_event.xdata y = this_event.ydata ### If the click is outside the range, then clear figure and points list if this_event.xdata is None: # This means we clicked outside the axis clear_the_figure_and_empty_points_list() else: # We clicked inside the axis number_of_points = scipy.shape(coords_array)[0] if number_of_points > 0: point_to_be_deleted = check_if_click_is_on_an_existing_point(x,y) if point_to_be_deleted != -1: # We delete a point # We will delete that row from coords_array. The rows are axis 0 coords_array = scipy.delete(coords_array,point_to_be_deleted,0) # We will also hide that point on the figure, by finding its handle handle_of_point_to_be_deleted = point_handles_array[point_to_be_deleted] pylab.setp(handle_of_point_to_be_deleted,visible=False) # Now that we have erased the point with that handle, # we can delete that handle from the handles list point_handles_array = scipy.delete(point_handles_array,point_to_be_deleted) else: # We make a new point coords_array = scipy.vstack((coords_array,[x,y])) new_point_handle = pylab.plot(x,y,'*',color='blue') point_handles_array = scipy.append(point_handles_array,new_point_handle) if number_of_points == 0: coords_array = scipy.array([[x,y]]) new_point_handle = pylab.plot(x,y,'*',color='blue') point_handles_array = scipy.append(point_handles_array,new_point_handle) ### Now plot the statistics that this program is demonstrating number_of_points = scipy.shape(coords_array)[0] # Recount how many points we have now if number_of_points > 1: plot_the_correlation() ### Finally, check to see whether we have fewer than two points ### as a result of any possible point-deletions above. ### If we do, then delete the stats info from the plot, ### as it isn't meaningful for just one data point number_of_points = scipy.shape(coords_array)[0] if number_of_points < 2: # We only show mean and std if there are two or more points pylab.setp(handle_of_regression_line_plot,visible=False) pylab.xlabel('') pylab.ylabel('') # Set the axis back to its original value, in case Python has changed it during plotting pylab.axis('equal') # Make the tick-marks equally spaced on x- and y-axes pylab.axis(axis_range*scipy.array([-1, 1, -1, 1])) # This is the function which calculates and plots the statistics def plot_the_correlation(): # First, delete any existing regression line plots from the figure global handle_of_regression_line_plot pylab.setp(handle_of_regression_line_plot,visible=False) #### Next, calculate and plot the stats number_of_points = scipy.shape(coords_array)[0] x_coords = coords_array[:,0] # Python starts counting from zero y_coords = coords_array[:,1] #### To get the best-fit line, we'll do a regression slope, y_intercept, r_from_regression, p_from_regression, std_err = ( scipy.stats.linregress(x_coords,y_coords) ) #### Plot the best-fit line in red handle_of_regression_line_plot = pylab.plot(axis_range*scipy.array([-1,1]), y_intercept + slope*axis_range*scipy.array([-1,1]),'r-') #### Uncomment the next two lines if you want to verify #### that the stats we get from regression and from correlation are the same. # r_from_corr,p_from_corr = scipy.stats.pearsonr(x_coords,y_coords) # print r_from_regression,r_from_corr,p_from_regression,p_from_corr #### In order to make the p-values format nicely #### even when they have a bunch of zeros at the start, we do this: p_value_string = "%1.2g" % p_from_regression pylab.xlabel(str(number_of_points) + ' points: ' + ' p-value of corr = ' + p_value_string + ' Correlation, r = ' + str(round(r_from_regression,2)) ) # The ',2' means show 2 decimal places # Set the axis back to its original value, in case Python has changed it during plotting pylab.axis('equal') # Make the tick-marks equally spaced on x- and y-axes pylab.axis(axis_range*scipy.array([-1, 1, -1, 1])) # This is the function which deletes existing points if you click on them def check_if_click_is_on_an_existing_point(mouse_x_coord,mouse_y_coord): # First, figure out how many points we have. # Each point is one row in the coords_array, # so we count the number of rows, which is dimension-0 for Python number_of_points = scipy.shape(coords_array)[0] this_coord = scipy.array([[ mouse_x_coord, mouse_y_coord ]]) # The double square brackets above give the this_coord array # an explicit structure of having rows and also columns if number_of_points > 0: # If there are some points, we want to calculate the distance # of the new mouse-click location from every existing point. # One way to do this is to make an array which is the same size # as coords_array, and which contains the mouse x,y-coords on every row. # Then we can subtract that xy_coord_matchng_matrix from coords_array ones_vec = scipy.ones((number_of_points,1)) xy_coord_matching_matrix = scipy.dot(ones_vec,this_coord) distances_from_existing_points = (coords_array - xy_coord_matching_matrix) squared_distances_from_existing_points = distances_from_existing_points**2 sum_sq_dists = scipy.sum(squared_distances_from_existing_points,axis=1) # The axis=1 means "sum over dimension 1", which is columns for Python euclidean_dists = scipy.sqrt(sum_sq_dists) distance_threshold = 0.5 within_threshold_points = scipy.nonzero(euclidean_dists < distance_threshold ) num_within_threshold_points = scipy.shape(within_threshold_points)[1] if num_within_threshold_points > 0: # We only want one matching point. # It's possible that more than one might be within threshold. # So, we take the unique smallest distance point_to_be_deleted = scipy.argmin(euclidean_dists) return point_to_be_deleted else: # If there are zero points, then we are not deleting any point_to_be_deleted = -1 return point_to_be_deleted if __name__ == '__main__': ####################################################################### # This is the main part of the program, which calls the above functions ####################################################################### # First, initialise some of our variables to be empty coords_array = scipy.array([]) point_handles_array = scipy.array([]) handle_of_regression_line_plot = [] ### Set up an initial space to click inside axis_range = 10 ### Make the figure window pylab.figure() ### Clear the figure window pylab.clf() # clf means "clear the figure" ### In order to keep the boundaries of the figure fixed in place, ### we will draw a white box around the region that we want. pylab.plot(axis_range*scipy.array([-1, 1, 1, -1]), axis_range*scipy.array([-1, -1, 1, 1]),'w-') pylab.axis('equal') # Make the tick-marks equally spaced on x- and y-axes pylab.axis(axis_range*scipy.array([-1, 1, -1, 1])) ### Python issues a warning when we try to calculate ### the correlation when there are just two points, ### as the p-value is zero. This next line hides that warning scipy.seterr(invalid="ignore") ### Tell Python to call a function every time ### when the mouse is pressed in this figure pylab.connect('button_press_event', do_this_when_the_mouse_is_clicked) clear_the_figure_and_empty_points_list() pylab.show() # This shows the figure window onscreen
sniemi/SamPy
plot/interactive_correlation_plot.py
Python
bsd-2-clause
11,714
0.015025
import logging import struct _LOGGER = logging.getLogger(__name__) typical_types = { 0x11: { "desc": "T11: ON/OFF Digital Output with Timer Option", "size": 1, "name": "Switch Timer", "state_desc": { 0x00: "off", 0x01: "on"} }, 0x12: {"desc": "T12: ON/OFF Digital Output with AUTO mode", "size": 1, "name": "Switch auto", "state_desc": { 0x00: "off", 0x01: "on", 0xF0: "on/auto", 0xF1: "off/auto" } }, 0x13: {"desc": "T13: Digital Input Value", "size": 1, "state_desc": { 0x00: "off", 0x01: "on"} }, 0x14: {"desc": "T14: Pulse Digital Output", "size": 1, "name": "Switch", "state_desc": { 0x00: "off", 0x01: "on"} }, 0x15: {"desc": "T15: RGB Light", "size": 2, "state_desc": { 0x00: "off", 0x01: "on"} }, 0x16: {"desc": "T16: RGB LED Strip", "size": 4, "state_desc": { 0x00: "on", 0x01: "on"} }, 0x18: {"desc": "T18: ON/OFF Digital Output (Step Relay)", "size": 1, "state_desc": { 0x00: "off", 0x01: "on"} }, 0x19: {"desc": "T19: Single Color LED Strip", "size": 2, "state_desc": { 0x00: "off", 0x01: "on"} }, 0x1A: {"desc": "T1A: Digital Input Pass Through", "size": 1, "state_desc": { 0x00: "off", 0x01: "on"} }, 0x1B: {"desc": "T1B: Position Constrained ON/OFF Digital Output", "size": 1}, 0x21: {"desc": "T21: Motorized devices with limit switches", "size": 1}, 0x22: {"desc": "T22: Motorized devices with limit switches and middle position", "size": 1}, 0x31: {"desc": "T31: Temperature control with cooling and heating mode", "size": 5}, 0x32: {"desc": "T32: Air Conditioner", "size": 2}, 0x41: {"desc": "T41: Anti-theft integration -Main-", "size": 1}, 0x42: {"desc": "T42: Anti-theft integration -Peer-", "size": 1}, 0x51: {"desc": "T51: Analog input, half-precision floating point", "size": 2, "units": "units"}, 0x52: {"desc": "T52: Temperature measure (-20, +50) C", "size": 2, "units": "C"}, 0x53: {"desc": "T53: Humidity measure (0, 100) ", "size": 2, "units": "%"}, 0x54: {"desc": "T54: Light Sensor (0, 40) kLux", "size": 2, "units": "kLux"}, 0x55: {"desc": "T55: Voltage (0, 400) V", "size": 2, "units": "V"}, 0x56: {"desc": "T56: Current (0, 25) A", "size": 2, "units": "A"}, 0x57: {"desc": "T57: Power (0, 6500) W", "size": 2, "units": "W"}, 0x58: {"desc": "T58: Pressure measure (0, 1500) hPa", "size": 2, "units": "hPa"}, 0x61: {"desc": "T61: Analog setpoint, half-precision floating point", "size": 2}, 0x62: {"desc": "T62: Temperature measure (-20, +50) C", "size": 2}, 0x63: {"desc": "T63: Humidity measure (0, 100) ", "size": 2}, 0x64: {"desc": "T64: Light Sensor (0, 40) kLux", "size": 2}, 0x65: {"desc": "T65: Voltage (0, 400) V", "size": 2}, 0x66: {"desc": "T66: Current (0, 25) A", "size": 2}, 0x67: {"desc": "T67: Power (0, 6500) W", "size": 2}, 0x68: {"desc": "T68: Pressure measure (0, 1500) hPa", "size": 2} } class Typical(object): def __init__(self, ttype): self.ttype = ttype self.description = typical_types[ttype]['desc'] self.size = typical_types[ttype]['size'] self.slot = -1 # undefined until assigned to a slot self.node = -1 # undefined until assigned to a slot # inital state. It will be overwritten with the first update self.state = b'\x00\x00\x00\x00\x00\x00\x00' self.listeners = [] def add_listener(self, callback): self.listeners.append(callback) @staticmethod def factory_type(ttype): if ttype in [0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1A, 0x1B]: return TypicalT1n(ttype) elif ttype in [0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58]: return TypicalT5n(ttype) else: return TypicalNotImplemented(ttype) def update(self, value): value = value[:self.size] if value != self.state: self.state = value self.state_description = value _LOGGER.info("Node %d: Typical %d - %s updated from %s to %s" % (self.index, self.description, ':'.join("{:02x}".format(c) for c in self.state[:self.size]), ':'.join("{:02x}".format(c) for c in value[:self.size]))) for listener in self.listeners: listener(self) """ if self.mqtt: # TODO: este self.... print("Publico mi nuevo estado %s" + self.state) self.mqttc.publish('souliss/%s/%s/state' % (self.device_class, self.name), self.state) """ """ def publish(self, mqttc): if self.mqtt: self.mqttc = mqttc self.device_class = typical_types[self.ttype]['mqtt'] mqttc.publish('souliss/%s/%s/config' % (self.device_class, self.name), '{"name" : "' + self.friendly_name + '", ' + '"payload_on": "01", ' + '"payload_off": "00", ' + '"optimistic": false, ' + '"retain": true, ' + '"command_topic": "souliss/%s/%s/set", "state_topic": "souliss/%s/%s/state"}' \ % (self.device_class, self.name, self.device_class, self.name)) #'{"name" : "once,", "payload_on": "0", "payload_off": "1", "optimistic": false, "retain": true, "state_topic": "souliss/switch/%s", "command_topic": "souliss/switch/%s/set"}' % (self.name, self.name)) #mqttc.subscribe("souliss/%s/%s/#" % (self.device_class, self.name)) #mqttc.subscribe("souliss/switch/%s" % self.name) else: print('WARNING: I do not know mqtt device for ' + self.description) """ def set_node_slot_index(self, node, slot, index): self.node = node self.slot = slot self.index = index def to_dict(self): return {'ddesc': self.description, 'slo': self.slot, 'typ': self.ttype} class TypicalT1n(Typical): def __init__(self, ttype): super(TypicalT1n,self).__init__(ttype) self.state_desc = typical_types[ttype]['state_desc'] def update(self, value): value = value[:self.size] if value != self.state: self.state = value if self.size > 1: # Raw description for Typicals T15, T16 and T19 self.state_description = ':'.join("{:02x}".format(c) for c in self.state) else: if ord(value) in self.state_desc.keys(): self.state_description = self.state_desc[ord(value)] else: _LOGGER.warning("Unknow value!") self.state_description = "Unknow value!" _LOGGER.info("Node %d: Typical %d - %s updated to %s" % (self.node, self.index, self.description, self.state_description)) for listener in self.listeners: listener(self) def send_command(self, command): # TODO: Handle different T1 behaviour if command == 0x01: # Toggle if self.state == chr(1): self.update(chr(0)) else: self.update(chr(1)) elif command == 0x02: # OnCmd self.update(chr(0)) elif command == 0x04: # OffCmd self.update(chr(1)) else: _LOGGER.debug('Command %x not implemented' % command) class TypicalT5n(Typical): def __init__(self, ttype): super(TypicalT5n,self).__init__(ttype) self.units= typical_types[ttype]['units'] def update(self, value): value = value[:self.size] if value != self.state: self.state_description = struct.unpack('e', value)[0] self.state = value _LOGGER.info("Node %d: Typical %d - %s updated to %s %s" % (self.node, self.index, self.description, self.state_description, self.units)) for listener in self.listeners: listener(self) class TypicalNotImplemented(Typical): def __init__(self, ttype): _LOGGER.warning('Typical %x not implemented' % ttype) super(TypicalNotImplemented,self).__init__(ttype)
maoterodapena/pysouliss
souliss/Typicals.py
Python
mit
9,295
0.00979
#!/usr/bin/env python2.7 import click from common import KGC_PORT from server import KgcRpcServer import privipk from privipk.keys import LongTermSecretKey @click.group() def cli(): """ Use this tool to spawn a KGC server and/or to generate a private key for a KGC server. """ pass @cli.command() @click.option('--port', '-p', required=False, metavar='PORT', default=KGC_PORT, help='TCP port for the KGC to listen on.') @click.argument('secret_key_path', required=True) @click.argument('group_params_path', required=False) def start(port, secret_key_path, group_params_path): """ Starts a KGC server. Loads the private key from the specified file. Setting the group parameters is not yet implemented """ params = privipk.parameters.default lts = LongTermSecretKey.unserialize(params, open(secret_key_path).read()) server = KgcRpcServer(lts, port) server.start() @cli.command() @click.argument('secret_key_path', required=True) def genkey(secret_key_path): """ Generates a private key and stores it in the specified file. Also stores the public key in the another file named by appending .pub to the first file. """ params = privipk.parameters.default lts = LongTermSecretKey(params) open(secret_key_path, 'w').write(lts.serialize()) ltp = lts.getPublicKey() open(secret_key_path + '.pub', 'w').write(ltp.serialize()) if __name__ == '__main__': cli()
PriviPK/privipk-sync-engine
kgc/kgc-service.py
Python
agpl-3.0
1,469
0.001361
# Copyright 2015: Hewlett-Packard Development Company, L.P. # 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. import mock from rally.plugins.openstack.scenarios.nova import keypairs from tests.unit import test class NovaKeypairTestCase(test.ScenarioTestCase): def test_create_and_list_keypairs(self): scenario = keypairs.NovaKeypair(self.context) scenario.generate_random_name = mock.MagicMock(return_value="name") scenario._create_keypair = mock.MagicMock(return_value="foo_keypair") scenario._list_keypairs = mock.MagicMock() scenario.create_and_list_keypairs(fakearg="fakearg") scenario._create_keypair.assert_called_once_with(fakearg="fakearg") scenario._list_keypairs.assert_called_once_with() def test_create_and_delete_keypair(self): scenario = keypairs.NovaKeypair(self.context) scenario.generate_random_name = mock.MagicMock(return_value="name") scenario._create_keypair = mock.MagicMock(return_value="foo_keypair") scenario._delete_keypair = mock.MagicMock() scenario.create_and_delete_keypair(fakearg="fakearg") scenario._create_keypair.assert_called_once_with(fakearg="fakearg") scenario._delete_keypair.assert_called_once_with("foo_keypair") def test_boot_and_delete_server_with_keypair(self): scenario = keypairs.NovaKeypair(self.context) scenario.generate_random_name = mock.MagicMock(return_value="name") scenario._create_keypair = mock.MagicMock(return_value="foo_keypair") scenario._boot_server = mock.MagicMock(return_value="foo_server") scenario._delete_server = mock.MagicMock() scenario._delete_keypair = mock.MagicMock() fake_server_args = { "foo": 1, "bar": 2, } scenario.boot_and_delete_server_with_keypair( "img", 1, server_kwargs=fake_server_args, fake_arg1="foo", fake_arg2="bar") scenario._create_keypair.assert_called_once_with( fake_arg1="foo", fake_arg2="bar") scenario._boot_server.assert_called_once_with( "img", 1, foo=1, bar=2, key_name="foo_keypair") scenario._delete_server.assert_called_once_with("foo_server") scenario._delete_keypair.assert_called_once_with("foo_keypair")
vishnu-kumar/PeformanceFramework
tests/unit/plugins/openstack/scenarios/nova/test_keypairs.py
Python
apache-2.0
2,878
0
def test_var_args(f_arg, *argv): print("normal:", f_arg) for arg in argv: print("another one:", arg) def greet_me(**kwargs): for key, value in kwargs.items(): print("{0} = {1}".format(key, value)) test_var_args('hello', 'there', 'general', 'Kenobi') greet_me(name="test", surname="me")
CajetanP/code-learning
Python/Learning/Tips/args_and_kwargs.py
Python
mit
319
0
# -*- coding: utf-8 -*- """ Created on Sat Feb 11 14:10:30 2017 @author: WİN7 """ # 4 basamaklı, basamakları tekrarsız sayıların (4lü karakter dizisi) # tümünü bir liste olarak (5040 tane) üretip döndürür. def sayilariUret(): S = [] for n in range(10000): ss = "%04d"%n if ss[0]==ss[1] or ss[0]==ss[2] or ss[0]==ss[3] or ss[1]==ss[2] or ss[1]==ss[3] or ss[2]==ss[3]: continue else: S.append(ss) return S # Verilen tahmin'i sayi ile karşılaştırıp kaç A (doğru yerinde) kaç B (yanlış yerde) doğru karakter var döndürür. def getMatches(sayi, tahmin): A, B = 0, 0 for i in range(len(tahmin)): if tahmin[i] in sayi: if tahmin[i] == sayi[i]: A += 1 else: B += 1 return A, B # Verilen S sayi listesi içinde, verilen tahmin'e verilen AB sonucunu veren bütün sayilari S1 listesi olarak döndürür. # Yani, tahmin ve alınan sonuçla uyumlu olan sayilari bulur, orijinal alternatif listesini filtrelemiş olur. def filt(S,tahmin,A,B): S1 = [] for ss in S: son1 = getMatches(ss,tahmin) if son1[0]==A and son1[1]==B: S1.append(ss) return S1 # Verilen S listesindeki her sayi için verilen tahmin'i dener. # Her alternatif sonuçtan (AB değeri) kaç tane alındığını kaydeder, hist sözlüğünde döndürür. # hist (sözlük) : {sonuç : kaç_defa} . Örn: {"00":70, "01":45, "30":5, "40":1} def getHist(S,tahmin): # try given guess for each code in S # count occurances of different results, return as hist hist = {} for ss in S: son = getMatches(ss,tahmin) a = str(son[0])+str(son[1]) if a in hist: hist[a] += 1 else: hist[a] = 1 return hist import math def getEntropies(S): E = [0]*10000 # try all possible guesses (n) and find entropy of results for each guess for n in range(10000): tahmin = "%04d"%n hist = getHist(S,tahmin) tot = 0 for a in hist: tot += hist[a] entr = 0 for a in hist: p = 1.0*hist[a]/tot entr -= p*math.log(p,2) E[n] = entr if entr > 3.5: print("%04d : %f"%(n,entr)) return E def getEntropiesDict(S,UNI,yaz=True,tr=1.9): EN = OrderedDict() # try all possible guesses (n) and find entropy of results for each guess for n in range(len(UNI)): #tahmin = "%04d"%n tahmin = UNI[n] hist = getHist(S,tahmin) tot = 0 for a in hist: tot += hist[a] entr = 0 for a in hist: p = 1.0*hist[a]/tot entr -= p*math.log(p,2) EN[tahmin] = entr if yaz and entr >= tr: print("%s : %f"%(tahmin,entr), end=", ") print(hist) if yaz and "40" in hist: print("Possible guess:%s : %f"%(tahmin,entr), end=", ") print(hist) return EN def ENInfo(EN): mt = max(EN, key=lambda t: EN[t]) cnt = 0 for t in EN: if (EN[t]==EN[mt]): cnt += 1 print("Max: %s -> %f. (%d times)" % (mt,EN[mt],cnt)) def ENSortInfo(EN,top=10): ENs = sorted(EN,key=lambda t: EN[t], reverse=True) for i in range(top): print("%d. %s -> %f"%(i,ENs[i],EN[ENs[i]])) from collections import OrderedDict def game(): tahs = OrderedDict() tahs["1234"] = (1,1) tahs["0235"] = (1,1) tahs["2637"] = (2,1) tahs["2738"] = (1,1) #tahs["9786"] = (0,1) S = sayilariUret() print("Starting with: %d"%len(S)) S0 = S cnt = 0 for t in tahs: res = tahs[t] S1 = filt(S0,t,res[0],res[1]) cnt += 1 S0 = S1 print("S%d : tahmin: %s, res: %d%d, len: %d"%(cnt,t,res[0],res[1],len(S1))) if len(S1) < 20: print("Listing remaining candidates:") for t in S1: print(t,end=" -> ") print(getHist(S1,t)) EN = getEntropiesDict(S1,S, False) return EN def game1(): history = OrderedDict() S = sayilariUret() print("Starting with: %d"%len(S)) S0 = S cnt = 1 tahmin = "1234" while tahmin != "": print("-"*20) restr = input( "%d. Result for %s? "%(cnt, tahmin) ) history[tahmin] = restr res = ( int(restr[0]), int(restr[1]) ) S1 = filt( S0, tahmin, res[0], res[1] ) cnt += 1 S0 = S1 print("tahmin: %s, res: %d%d, len: %d"%(tahmin,res[0],res[1],len(S1))) if len(S1) < 20: print("Listing remaining candidates:") for t in S1: print(t,end=" -> ") print(getHist(S1,t)) EN = getEntropiesDict(S1,S, False) ENInfo(EN) ENSortInfo(EN,15) tahmin = input("Next tahmin? ") print(history) return history def dene0(): S = sayilariUret() print(len(S)) S1 = filt(S,"1234",0,2) print(len(S1)) S2 = filt(S1,"5678",0,2) print(len(S2)) S3 = filt(S2,"7812",0,2) print(len(S3)) #E3 = getEntropies1(S3,S) S4 = filt(S3,"2370",0,3) print(len(S4)) #E4 = getEntropies1(S4,S) S5 = filt(S4,"9786",0,1) print(len(S5)) E5 = getEntropies1(S5,S) #EN = game() #ENInfo(EN) #ENSortInfo(EN,15) game1()
akpeker/sayi-tahmin-cozucu
py/sayitahminCozucu.py
Python
mit
5,341
0.02385
# -*- coding: utf-8 -*- from collections import defaultdict from functools import partial from itertools import count import json import networkx as nx from networkx.algorithms import weakly_connected_component_subgraphs from numpy import subtract from numpy.linalg import norm from typing import Any, DefaultDict, Dict, List, Optional, Tuple, Union from django.db import connection from django.http import JsonResponse from rest_framework.decorators import api_view from catmaid.models import UserRole from catmaid.control.authentication import requires_user_role from catmaid.control.common import (get_relation_to_id_map, get_request_bool, get_request_list) from catmaid.control.link import KNOWN_LINK_PAIRS, UNDIRECTED_LINK_TYPES from catmaid.control.tree_util import simplify from catmaid.control.synapseclustering import tree_max_density def make_new_synapse_count_array() -> List[int]: return [0, 0, 0, 0, 0] def basic_graph(project_id, skeleton_ids, relations=None, source_link:str="presynaptic_to", target_link:str="postsynaptic_to", allowed_connector_ids=None) -> Dict[str, Tuple]: if not skeleton_ids: raise ValueError("No skeleton IDs provided") cursor = connection.cursor() if not relations: relations = get_relation_to_id_map(project_id, (source_link, target_link), cursor) source_rel_id, target_rel_id = relations[source_link], relations[target_link] undirected_links = source_link in UNDIRECTED_LINK_TYPES and \ target_link in UNDIRECTED_LINK_TYPES # Find all links in the passed in set of skeletons. If a relation is # reciprocal, we need to avoid getting two result rows back for each # treenode-connector-treenode connection. To keep things simple, we will add # a "skeleton ID 1" < "skeleton ID 2" test for reciprocal links. cursor.execute(f""" SELECT t1.skeleton_id, t2.skeleton_id, LEAST(t1.confidence, t2.confidence) FROM treenode_connector t1, treenode_connector t2 WHERE t1.skeleton_id = ANY(%(skeleton_ids)s::bigint[]) AND t1.relation_id = %(source_rel)s AND t1.connector_id = t2.connector_id AND t2.skeleton_id = ANY(%(skeleton_ids)s::bigint[]) AND t2.relation_id = %(target_rel)s AND t1.id <> t2.id {'AND t1.skeleton_id < t2.skeleton_id' if undirected_links else ''} {'AND t1.connector_id = ANY(%(allowed_c_ids)s::bigint[])' if allowed_connector_ids else ''} """, { 'skeleton_ids': list(skeleton_ids), 'source_rel': source_rel_id, 'target_rel': target_rel_id, 'allowed_c_ids': allowed_connector_ids, }) edges:DefaultDict = defaultdict(partial(defaultdict, make_new_synapse_count_array)) for row in cursor.fetchall(): edges[row[0]][row[1]][row[2] - 1] += 1 return { 'edges': tuple((s, t, count) for s, edge in edges.items() for t, count in edge.items()) } def confidence_split_graph(project_id, skeleton_ids, confidence_threshold, relations=None, source_rel:str="presynaptic_to", target_rel:str="postsynaptic_to", allowed_connector_ids=None) -> Dict[str, Any]: """ Assumes 0 < confidence_threshold <= 5. """ if not skeleton_ids: raise ValueError("No skeleton IDs provided") # We need skeleton IDs as a list skeleton_ids = list(skeleton_ids) cursor = connection.cursor() if not relations: relations = get_relation_to_id_map(project_id, (source_rel, target_rel), cursor) source_rel_id, target_rel_id = relations[source_rel], relations[target_rel] # Fetch (valid) synapses of all skeletons cursor.execute(f''' SELECT skeleton_id, treenode_id, connector_id, relation_id, confidence FROM treenode_connector WHERE project_id = %(project_id)s AND skeleton_id = ANY(%(skids)s::bigint[]) AND relation_id IN (%(source_rel_id)s, %(target_rel_id)s) {'AND connector_id = ANY(%(allowed_c_ids)s::bigint[])' if allowed_connector_ids else ''} ''', { 'project_id': int(project_id), 'skids': skeleton_ids, 'source_rel_id': source_rel_id, 'target_rel_id': target_rel_id, 'allowed_c_ids': allowed_connector_ids, }) stc:DefaultDict[Any, List] = defaultdict(list) for row in cursor.fetchall(): stc[row[0]].append(row[1:]) # skeleton_id vs (treenode_id, connector_id, relation_id, confidence) # Fetch all treenodes of all skeletons cursor.execute(''' SELECT skeleton_id, id, parent_id, confidence FROM treenode WHERE project_id = %(project_id)s AND skeleton_id = ANY(%(skeleton_ids)s::bigint[]) ORDER BY skeleton_id ''', { 'project_id': project_id, 'skeleton_ids': skeleton_ids, }) # Dictionary of connector_id vs relation_id vs list of sub-skeleton ID connectors:DefaultDict = defaultdict(partial(defaultdict, list)) # All nodes of the graph nodeIDs:List = [] # Read out into memory only one skeleton at a time current_skid = None tree:Optional[nx.DiGraph] = None for row in cursor.fetchall(): if row[0] == current_skid: # Build the tree, breaking it at the low-confidence edges if row[2] and row[3] >= confidence_threshold: # mypy cannot prove this will be a DiGraph by here tree.add_edge(row[2], row[1]) # type: ignore continue if tree: nodeIDs.extend(split_by_confidence(current_skid, tree, stc[current_skid], connectors)) # Start the next tree current_skid = row[0] tree = nx.DiGraph() if row[2] and row[3] > confidence_threshold: tree.add_edge(row[2], row[1]) if tree: nodeIDs.extend(split_by_confidence(current_skid, tree, stc[current_skid], connectors)) # Create the edges of the graph from the connectors, which was populated as a side effect of 'split_by_confidence' edges:DefaultDict = defaultdict(partial(defaultdict, make_new_synapse_count_array)) # pre vs post vs count for c in connectors.values(): for pre in c[source_rel_id]: for post in c[target_rel_id]: edges[pre[0]][post[0]][min(pre[1], post[1]) - 1] += 1 return { 'nodes': nodeIDs, 'edges': [(s, t, count) for s, edge in edges.items() for t, count in edge.items()] } def dual_split_graph(project_id, skeleton_ids, confidence_threshold, bandwidth, expand, relations=None, source_link="presynaptic_to", target_link="postsynaptic_to", allowed_connector_ids=None) -> Dict[str, Any]: """ Assumes bandwidth > 0 and some skeleton_id in expand. """ cursor = connection.cursor() skeleton_ids = set(skeleton_ids) expand = set(expand) if not skeleton_ids: raise ValueError("No skeleton IDs provided") if not relations: relations = get_relation_to_id_map(project_id, (source_link, target_link), cursor) source_rel_id, target_rel_id = relations[source_link], relations[target_link] # Fetch synapses of all skeletons cursor.execute(f''' SELECT skeleton_id, treenode_id, connector_id, relation_id, confidence FROM treenode_connector WHERE project_id = %(project_id)s AND skeleton_id = ANY(%(skids)s::bigint[]) AND relation_id IN (%(source_rel_id)s, %(target_rel_id)s) {'AND connector_id = ANY(%(allowed_c_ids)s::bigint[])' if allowed_connector_ids else ''} ''', { 'project_id': int(project_id), 'skids': list(skeleton_ids), 'source_rel_id': source_rel_id, 'target_rel_id': target_rel_id, 'allowed_c_ids': allowed_connector_ids, }) stc:DefaultDict[Any, List] = defaultdict(list) for row in cursor.fetchall(): stc[row[0]].append(row[1:]) # skeleton_id vs (treenode_id, connector_id, relation_id) # Dictionary of connector_id vs relation_id vs list of sub-skeleton ID connectors:DefaultDict = defaultdict(partial(defaultdict, list)) # All nodes of the graph (with or without edges. Includes those representing synapse domains) nodeIDs:List = [] not_to_expand = skeleton_ids - expand if confidence_threshold > 0 and not_to_expand: # Now fetch all treenodes of only skeletons in skeleton_ids (the ones not to expand) cursor.execute(''' SELECT skeleton_id, id, parent_id, confidence FROM treenode WHERE project_id = %(project_id)s AND skeleton_id = ANY(%(skids)s::bigint[]) ORDER BY skeleton_id ''', { 'project_id': project_id, 'skids': list(not_to_expand), }) # Read out into memory only one skeleton at a time current_skid = None tree:Optional[nx.DiGraph] = None for row in cursor.fetchall(): if row[0] == current_skid: # Build the tree, breaking it at the low-confidence edges if row[2] and row[3] >= confidence_threshold: # mypy cannot prove this will be a nx.DiGraph by here tree.add_edge(row[2], row[1]) # type: ignore continue if tree: nodeIDs.extend(split_by_confidence(current_skid, tree, stc[current_skid], connectors)) # Start the next tree current_skid = row[0] tree = nx.DiGraph() if row[2] and row[3] > confidence_threshold: tree.add_edge(row[2], row[1]) if tree: nodeIDs.extend(split_by_confidence(current_skid, tree, stc[current_skid], connectors)) else: # No need to split. # Populate connectors from the connections among them for skid in not_to_expand: nodeIDs.append(skid) for c in stc[skid]: connectors[c[1]][c[2]].append((skid, c[3])) # Now fetch all treenodes of all skeletons to expand cursor.execute(''' SELECT skeleton_id, id, parent_id, confidence, location_x, location_y, location_z FROM treenode WHERE project_id = %(project_id)s AND skeleton_id = ANY(%(skids)s::bigint[]) ORDER BY skeleton_id ''', { 'project_id': project_id, 'skids': list(expand), }) # list of edges among synapse domains intraedges:List = [] # list of branch nodes, merely structural branch_nodeIDs:List = [] # reset current_skid = None tree = None locations:Optional[Dict] = None for row in cursor.fetchall(): if row[0] == current_skid: # Build the tree, breaking it at the low-confidence edges # mypy cannot prove this will have a value by here locations[row[1]] = row[4:] # type: ignore if row[2] and row[3] >= confidence_threshold: # mypy cannot prove this will have a value by here tree.add_edge(row[2], row[1]) # type: ignore continue if tree: ns, bs = split_by_both(current_skid, tree, locations, bandwidth, stc[current_skid], connectors, intraedges) nodeIDs.extend(ns) branch_nodeIDs.extend(bs) # Start the next tree current_skid = row[0] tree = nx.DiGraph() locations = {} locations[row[1]] = row[4:] if row[2] and row[3] > confidence_threshold: tree.add_edge(row[2], row[1]) if tree: ns, bs = split_by_both(current_skid, tree, locations, bandwidth, stc[current_skid], connectors, intraedges) nodeIDs.extend(ns) branch_nodeIDs.extend(bs) # Create the edges of the graph edges:DefaultDict = defaultdict(partial(defaultdict, make_new_synapse_count_array)) # pre vs post vs count for c in connectors.values(): for pre in c[source_rel_id]: for post in c[target_rel_id]: edges[pre[0]][post[0]][min(pre[1], post[1]) - 1] += 1 return { 'nodes': nodeIDs, 'edges': [(s, t, count) for s, edge in edges.items() for t, count in edge.items()], 'branch_nodes': branch_nodeIDs, 'intraedges': intraedges } def populate_connectors(chunkIDs, chunks, cs, connectors) -> None: # Build up edges via the connectors for c in cs: # c is (treenode_id, connector_id, relation_id, confidence) for chunkID, chunk in zip(chunkIDs, chunks): if c[0] in chunk: connectors[c[1]][c[2]].append((chunkID, c[3])) break def subgraphs(digraph, skeleton_id) -> Tuple[List, Tuple]: chunks = list(weakly_connected_component_subgraphs(digraph)) if 1 == len(chunks): chunkIDs:Tuple = (str(skeleton_id),) # Note: Here we're loosening the implicit type else: chunkIDs = tuple('%s_%s' % (skeleton_id, (i+1)) for i in range(len(chunks))) return chunks, chunkIDs def split_by_confidence(skeleton_id, digraph, cs, connectors) -> Tuple: """ Split by confidence threshold. Populates connectors (side effect). """ chunks, chunkIDs = subgraphs(digraph, skeleton_id) populate_connectors(chunkIDs, chunks, cs, connectors) return chunkIDs def split_by_both(skeleton_id, digraph, locations, bandwidth, cs, connectors, intraedges) -> Tuple[List, List]: """ Split by confidence and synapse domain. Populates connectors and intraedges (side effects). """ nodes = [] branch_nodes = [] chunks, chunkIDs = subgraphs(digraph, skeleton_id) for i, chunkID, chunk in zip(count(start=1), chunkIDs, chunks): # Populate edge properties with the weight for parent, child in chunk.edges_iter(): chunk[parent][child]['weight'] = norm(subtract(locations[child], locations[parent])) # Check if need to expand at all blob = tuple(c for c in cs if c[0] in chunk) if 0 == len(blob): # type: ignore nodes.append(chunkID) continue treenode_ids, connector_ids, relation_ids, confidences = list(zip(*blob)) # type: ignore if 0 == len(connector_ids): nodes.append(chunkID) continue # Invoke Casey's magic: split by synapse domain max_density = tree_max_density(chunk.to_undirected(), treenode_ids, connector_ids, relation_ids, [bandwidth]) # Get first element of max_density domains = next(iter(max_density.values())) # domains is a dictionary of index vs SynapseGroup instance if 1 == len(domains): for connector_id, relation_id, confidence in zip(connector_ids, relation_ids, confidences): connectors[connector_id][relation_id].append((chunkID, confidence)) nodes.append(chunkID) continue # Create edges between domains # Pick one treenode from each domain to act as anchor anchors = {d.node_ids[0]: (i+k, d) for k, d in domains.items()} # Create new Graph where the edges are the edges among synapse domains mini = simplify(chunk, anchors.keys()) # Many side effects: # * add internal edges to intraedges # * add each domain to nodes # * custom-apply populate_connectors with the known synapses of each domain # (rather than having to sift through all in cs) mini_nodes = {} for node in mini.nodes_iter(): nblob = anchors.get(node) if nblob: index, domain = nblob domainID = '%s_%s' % (chunkID, index) nodes.append(domainID) for connector_id, relation_id in zip(domain.connector_ids, domain.relations): confidence = confidences[connector_ids.index(connector_id)] connectors[connector_id][relation_id].append((domainID, confidence)) else: domainID = '%s_%s' % (chunkID, node) branch_nodes.append(domainID) mini_nodes[node] = domainID for a1, a2 in mini.edges_iter(): intraedges.append((mini_nodes[a1], mini_nodes[a2])) return nodes, branch_nodes def _skeleton_graph(project_id, skeleton_ids, confidence_threshold, bandwidth, expand, compute_risk, cable_spread, path_confluence, with_overall_counts=False, relation_map=None, link_types=None, allowed_connector_ids=None) -> Optional[Dict]: by_link_type = bool(link_types) if not by_link_type: link_types = ['synaptic-connector'] if not expand: # Prevent expensive operations that will do nothing bandwidth = 0 cursor = connection.cursor() relation_map = get_relation_to_id_map(project_id, cursor=cursor) result:Optional[Dict] = None for link_type in link_types: pair = KNOWN_LINK_PAIRS.get(link_type) if not pair: raise ValueError(f"Unknown link type: {link_type}") source_rel = pair['source'] target_rel = pair['target'] if 0 == bandwidth: if 0 == confidence_threshold: graph:Dict[str, Any] = basic_graph(project_id, skeleton_ids, relation_map, source_rel, target_rel, allowed_connector_ids) else: graph = confidence_split_graph(project_id, skeleton_ids, confidence_threshold, relation_map, source_rel, target_rel, allowed_connector_ids) else: graph = dual_split_graph(project_id, skeleton_ids, confidence_threshold, bandwidth, expand, relation_map) if with_overall_counts: source_rel_id = relation_map[source_rel] target_rel_id = relation_map[target_rel] cursor.execute(f''' SELECT tc1.skeleton_id, tc2.skeleton_id, tc1.relation_id, tc2.relation_id, LEAST(tc1.confidence, tc2.confidence) FROM treenode_connector tc1 JOIN UNNEST(%(skeleton_id)s::bigint[]) skeleton(id) ON tc1.skeleton_id = skeleton.id JOIN treenode_connector tc2 ON tc1.connector_id = tc2.connector_id WHERE tc1.id != tc2.id AND tc1.relation_id IN (%(source_rel_id)s, %(target_rel_id)s) AND tc2.relation_id IN (%(source_rel_id)s, %(target_rel_id)s) ''', { 'skeleton_ids': skeleton_ids, 'source_rel_id': source_rel_id, 'target_rel_id': target_rel_id, }) query_skeleton_ids = set(skeleton_ids) overall_counts:DefaultDict = defaultdict(partial(defaultdict, make_new_synapse_count_array)) # Iterate through each pre/post connection for skid1, skid2, rel1, rel2, conf in cursor.fetchall(): # Increment number of links to/from skid1 with relation rel1. overall_counts[skid1][rel1][conf - 1] += 1 # Attach counts and a map of relation names to their IDs. graph['overall_counts'] = overall_counts graph['relation_map'] = { source_rel: source_rel_id, target_rel: target_rel_id } if by_link_type: if not result: result = {} result[link_type] = graph else: result = graph return result @api_view(['POST']) @requires_user_role([UserRole.Annotate, UserRole.Browse]) def skeleton_graph(request, project_id=None): """Get a synaptic graph between skeletons compartmentalized by confidence. Given a set of skeletons, retrieve presynaptic-to-postsynaptic edges between them, annotated with count. If a confidence threshold is supplied, compartmentalize the skeletons at edges in the arbor below that threshold and report connectivity based on these compartments. When skeletons are split into compartments, nodes in the graph take an string ID like ``{skeleton_id}_{compartment #}``. --- parameters: - name: skeleton_ids[] description: IDs of the skeletons to graph required: true type: array items: type: integer paramType: form - name: confidence_threshold description: Confidence value below which to segregate compartments type: integer paramType: form - name: bandwidth description: Bandwidth in nanometers type: number - name: cable_spread description: Cable spread in nanometers type: number - name: expand[] description: IDs of the skeletons to expand type: array items: type: integer - name: link_types[] description: IDs of link types to respect type: array items: type: string - name: allowed_connector_ids[] description: (Optional) IDs of allowed conectors. All other connectors will be ignored. required: false type: array items: type: integer models: skeleton_graph_edge: id: skeleton_graph_edge properties: - description: ID of the presynaptic skeleton or compartment type: integer|string required: true - description: ID of the postsynaptic skeleton or compartment type: integer|string required: true - description: number of synapses constituting this edge $ref: skeleton_graph_edge_count required: true skeleton_graph_edge_count: id: skeleton_graph_edge_count properties: - description: Number of synapses with confidence 1 type: integer required: true - description: Number of synapses with confidence 2 type: integer required: true - description: Number of synapses with confidence 3 type: integer required: true - description: Number of synapses with confidence 4 type: integer required: true - description: Number of synapses with confidence 5 type: integer required: true skeleton_graph_intraedge: id: skeleton_graph_intraedge properties: - description: ID of the presynaptic skeleton or compartment type: integer|string required: true - description: ID of the postsynaptic skeleton or compartment type: integer|string required: true type: edges: type: array items: $ref: skeleton_graph_edge required: true nodes: type: array items: type: integer|string required: false intraedges: type: array items: $ref: skeleton_graph_intraedge required: false branch_nodes: type: array items: type: integer|string required: false """ compute_risk = 1 == int(request.POST.get('risk', 0)) if compute_risk: # TODO port the last bit: computing the synapse risk from graph import skeleton_graph as slow_graph return slow_graph(request, project_id) project_id = int(project_id) skeleton_ids = set(int(v) for k,v in request.POST.items() if k.startswith('skeleton_ids[')) confidence_threshold = min(int(request.POST.get('confidence_threshold', 0)), 5) bandwidth = float(request.POST.get('bandwidth', 0)) # in nanometers cable_spread = float(request.POST.get('cable_spread', 2500)) # in nanometers path_confluence = int(request.POST.get('path_confluence', 10)) # a count expand = set(int(v) for k,v in request.POST.items() if k.startswith('expand[')) with_overall_counts = get_request_bool(request.POST, 'with_overall_counts', False) expand = set(int(v) for k,v in request.POST.items() if k.startswith('expand[')) link_types = get_request_list(request.POST, 'link_types', None) allowed_connector_ids = get_request_list(request.POST, 'allowed_connector_ids', None) graph = _skeleton_graph(project_id, skeleton_ids, confidence_threshold, bandwidth, expand, compute_risk, cable_spread, path_confluence, with_overall_counts, link_types=link_types, allowed_connector_ids=allowed_connector_ids) if not graph: raise ValueError("Could not compute graph") return JsonResponse(graph)
tomka/CATMAID
django/applications/catmaid/control/graph2.py
Python
gpl-3.0
24,814
0.004796
## Package for various utility functions to execute build and shell commands # # @copyright (c) 2007 CSIRO # Australia Telescope National Facility (ATNF) # Commonwealth Scientific and Industrial Research Organisation (CSIRO) # PO Box 76, Epping NSW 1710, Australia # [email protected] # # This file is part of the ASKAP software distribution. # # The ASKAP software distribution 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 Malte Marquarding <[email protected]> # from __future__ import with_statement import os def create_init_file(name, env): ''' Create package initialization file. e.g. init_package_env.sh :param name: file name to be created. :type name: string :param env: the environment object. :type env: :class:`.Environment` :return: None ''' aroot = os.environ["ASKAP_ROOT"] inittxt= """# # ASKAP auto-generated file # ASKAP_ROOT=%s export ASKAP_ROOT """ % aroot vartxt = """if [ "${%(key)s}" != "" ] then %(key)s=%(value)s:${%(key)s} else %(key)s=%(value)s fi export %(key)s """ with open(name, 'w') as initfile: initfile.write(inittxt) for k, v in env.items(): if not v: continue if k == "LD_LIBRARY_PATH": k = env.ld_prefix+k v = v.replace(aroot, '${ASKAP_ROOT}') initfile.write(vartxt % { 'key': k, 'value': v } )
ATNF/askapsdp
Tools/Dev/rbuild/askapdev/rbuild/utils/create_init_file.py
Python
gpl-2.0
2,053
0.002923
""" Helper functions for creating Form classes from Django models and database field objects. """ from __future__ import unicode_literals from collections import OrderedDict from itertools import chain import warnings from django.core.exceptions import ( ImproperlyConfigured, ValidationError, NON_FIELD_ERRORS, FieldError) from django.forms.fields import Field, ChoiceField from django.forms.forms import DeclarativeFieldsMetaclass, BaseForm from django.forms.formsets import BaseFormSet, formset_factory from django.forms.utils import ErrorList from django.forms.widgets import (SelectMultiple, HiddenInput, MultipleHiddenInput) from django.utils import six from django.utils.deprecation import RemovedInDjango19Warning from django.utils.encoding import smart_text, force_text from django.utils.text import get_text_list, capfirst from django.utils.translation import ugettext_lazy as _, ugettext __all__ = ( 'ModelForm', 'BaseModelForm', 'model_to_dict', 'fields_for_model', 'save_instance', 'ModelChoiceField', 'ModelMultipleChoiceField', 'ALL_FIELDS', 'BaseModelFormSet', 'modelformset_factory', 'BaseInlineFormSet', 'inlineformset_factory', 'modelform_factory', ) ALL_FIELDS = '__all__' def construct_instance(form, instance, fields=None, exclude=None): """ Constructs and returns a model instance from the bound ``form``'s ``cleaned_data``, but does not save the returned instance to the database. """ from django.db import models opts = instance._meta cleaned_data = form.cleaned_data file_field_list = [] for f in opts.fields: if not f.editable or isinstance(f, models.AutoField) \ or f.name not in cleaned_data: continue if fields is not None and f.name not in fields: continue if exclude and f.name in exclude: continue # Defer saving file-type fields until after the other fields, so a # callable upload_to can use the values from other fields. if isinstance(f, models.FileField): file_field_list.append(f) else: f.save_form_data(instance, cleaned_data[f.name]) for f in file_field_list: f.save_form_data(instance, cleaned_data[f.name]) return instance def save_instance(form, instance, fields=None, fail_message='saved', commit=True, exclude=None, construct=True): """ Saves bound Form ``form``'s cleaned_data into model instance ``instance``. If commit=True, then the changes to ``instance`` will be saved to the database. Returns ``instance``. If construct=False, assume ``instance`` has already been constructed and just needs to be saved. """ if construct: instance = construct_instance(form, instance, fields, exclude) opts = instance._meta if form.errors: raise ValueError("The %s could not be %s because the data didn't" " validate." % (opts.object_name, fail_message)) # Wrap up the saving of m2m data as a function. def save_m2m(): cleaned_data = form.cleaned_data # Note that for historical reasons we want to include also # virtual_fields here. (GenericRelation was previously a fake # m2m field). for f in chain(opts.many_to_many, opts.virtual_fields): if not hasattr(f, 'save_form_data'): continue if fields and f.name not in fields: continue if exclude and f.name in exclude: continue if f.name in cleaned_data: f.save_form_data(instance, cleaned_data[f.name]) if commit: # If we are committing, save the instance and the m2m data immediately. instance.save() save_m2m() else: # We're not committing. Add a method to the form to allow deferred # saving of m2m data. form.save_m2m = save_m2m return instance # ModelForms ################################################################# def model_to_dict(instance, fields=None, exclude=None): """ Returns a dict containing the data in ``instance`` suitable for passing as a Form's ``initial`` keyword argument. ``fields`` is an optional list of field names. If provided, only the named fields will be included in the returned dict. ``exclude`` is an optional list of field names. If provided, the named fields will be excluded from the returned dict, even if they are listed in the ``fields`` argument. """ # avoid a circular import from django.db.models.fields.related import ManyToManyField opts = instance._meta data = {} for f in chain(opts.concrete_fields, opts.virtual_fields, opts.many_to_many): if not getattr(f, 'editable', False): continue if fields and f.name not in fields: continue if exclude and f.name in exclude: continue if isinstance(f, ManyToManyField): # If the object doesn't have a primary key yet, just use an empty # list for its m2m fields. Calling f.value_from_object will raise # an exception. if instance.pk is None: data[f.name] = [] else: # MultipleChoiceWidget needs a list of pks, not object instances. qs = f.value_from_object(instance) if qs._result_cache is not None: data[f.name] = [item.pk for item in qs] else: data[f.name] = list(qs.values_list('pk', flat=True)) else: data[f.name] = f.value_from_object(instance) return data def fields_for_model(model, fields=None, exclude=None, widgets=None, formfield_callback=None, localized_fields=None, labels=None, help_texts=None, error_messages=None): """ Returns a ``OrderedDict`` containing form fields for the given model. ``fields`` is an optional list of field names. If provided, only the named fields will be included in the returned fields. ``exclude`` is an optional list of field names. If provided, the named fields will be excluded from the returned fields, even if they are listed in the ``fields`` argument. ``widgets`` is a dictionary of model field names mapped to a widget. ``localized_fields`` is a list of names of fields which should be localized. ``labels`` is a dictionary of model field names mapped to a label. ``help_texts`` is a dictionary of model field names mapped to a help text. ``error_messages`` is a dictionary of model field names mapped to a dictionary of error messages. ``formfield_callback`` is a callable that takes a model field and returns a form field. """ field_list = [] ignored = [] opts = model._meta # Avoid circular import from django.db.models.fields import Field as ModelField sortable_virtual_fields = [f for f in opts.virtual_fields if isinstance(f, ModelField)] for f in sorted(chain(opts.concrete_fields, sortable_virtual_fields, opts.many_to_many)): if not getattr(f, 'editable', False): continue if fields is not None and f.name not in fields: continue if exclude and f.name in exclude: continue kwargs = {} if widgets and f.name in widgets: kwargs['widget'] = widgets[f.name] if localized_fields == ALL_FIELDS or (localized_fields and f.name in localized_fields): kwargs['localize'] = True if labels and f.name in labels: kwargs['label'] = labels[f.name] if help_texts and f.name in help_texts: kwargs['help_text'] = help_texts[f.name] if error_messages and f.name in error_messages: kwargs['error_messages'] = error_messages[f.name] if formfield_callback is None: formfield = f.formfield(**kwargs) elif not callable(formfield_callback): raise TypeError('formfield_callback must be a function or callable') else: formfield = formfield_callback(f, **kwargs) if formfield: field_list.append((f.name, formfield)) else: ignored.append(f.name) field_dict = OrderedDict(field_list) if fields: field_dict = OrderedDict( [(f, field_dict.get(f)) for f in fields if ((not exclude) or (exclude and f not in exclude)) and (f not in ignored)] ) return field_dict class ModelFormOptions(object): def __init__(self, options=None): self.model = getattr(options, 'model', None) self.fields = getattr(options, 'fields', None) self.exclude = getattr(options, 'exclude', None) self.widgets = getattr(options, 'widgets', None) self.localized_fields = getattr(options, 'localized_fields', None) self.labels = getattr(options, 'labels', None) self.help_texts = getattr(options, 'help_texts', None) self.error_messages = getattr(options, 'error_messages', None) class ModelFormMetaclass(DeclarativeFieldsMetaclass): def __new__(mcs, name, bases, attrs): formfield_callback = attrs.pop('formfield_callback', None) new_class = super(ModelFormMetaclass, mcs).__new__(mcs, name, bases, attrs) if bases == (BaseModelForm,): return new_class opts = new_class._meta = ModelFormOptions(getattr(new_class, 'Meta', None)) # We check if a string was passed to `fields` or `exclude`, # which is likely to be a mistake where the user typed ('foo') instead # of ('foo',) for opt in ['fields', 'exclude', 'localized_fields']: value = getattr(opts, opt) if isinstance(value, six.string_types) and value != ALL_FIELDS: msg = ("%(model)s.Meta.%(opt)s cannot be a string. " "Did you mean to type: ('%(value)s',)?" % { 'model': new_class.__name__, 'opt': opt, 'value': value, }) raise TypeError(msg) if opts.model: # If a model is defined, extract form fields from it. if opts.fields is None and opts.exclude is None: raise ImproperlyConfigured( "Creating a ModelForm without either the 'fields' attribute " "or the 'exclude' attribute is prohibited; form %s " "needs updating." % name ) if opts.fields == ALL_FIELDS: # Sentinel for fields_for_model to indicate "get the list of # fields from the model" opts.fields = None fields = fields_for_model(opts.model, opts.fields, opts.exclude, opts.widgets, formfield_callback, opts.localized_fields, opts.labels, opts.help_texts, opts.error_messages) # make sure opts.fields doesn't specify an invalid field none_model_fields = [k for k, v in six.iteritems(fields) if not v] missing_fields = (set(none_model_fields) - set(new_class.declared_fields.keys())) if missing_fields: message = 'Unknown field(s) (%s) specified for %s' message = message % (', '.join(missing_fields), opts.model.__name__) raise FieldError(message) # Override default model fields with any custom declared ones # (plus, include all the other declared fields). fields.update(new_class.declared_fields) else: fields = new_class.declared_fields new_class.base_fields = fields return new_class class BaseModelForm(BaseForm): def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, instance=None): opts = self._meta if opts.model is None: raise ValueError('ModelForm has no model class specified.') if instance is None: # if we didn't get an instance, instantiate a new one self.instance = opts.model() object_data = {} else: self.instance = instance object_data = model_to_dict(instance, opts.fields, opts.exclude) # if initial was provided, it should override the values from instance if initial is not None: object_data.update(initial) # self._validate_unique will be set to True by BaseModelForm.clean(). # It is False by default so overriding self.clean() and failing to call # super will stop validate_unique from being called. self._validate_unique = False super(BaseModelForm, self).__init__(data, files, auto_id, prefix, object_data, error_class, label_suffix, empty_permitted) # Apply ``limit_choices_to`` to each field. for field_name in self.fields: formfield = self.fields[field_name] if hasattr(formfield, 'queryset') and hasattr(formfield, 'get_limit_choices_to'): limit_choices_to = formfield.get_limit_choices_to() if limit_choices_to is not None: formfield.queryset = formfield.queryset.complex_filter(limit_choices_to) def _get_validation_exclusions(self): """ For backwards-compatibility, several types of fields need to be excluded from model validation. See the following tickets for details: #12507, #12521, #12553 """ exclude = [] # Build up a list of fields that should be excluded from model field # validation and unique checks. for f in self.instance._meta.fields: field = f.name # Exclude fields that aren't on the form. The developer may be # adding these values to the model after form validation. if field not in self.fields: exclude.append(f.name) # Don't perform model validation on fields that were defined # manually on the form and excluded via the ModelForm's Meta # class. See #12901. elif self._meta.fields and field not in self._meta.fields: exclude.append(f.name) elif self._meta.exclude and field in self._meta.exclude: exclude.append(f.name) # Exclude fields that failed form validation. There's no need for # the model fields to validate them as well. elif field in self._errors.keys(): exclude.append(f.name) # Exclude empty fields that are not required by the form, if the # underlying model field is required. This keeps the model field # from raising a required error. Note: don't exclude the field from # validation if the model field allows blanks. If it does, the blank # value may be included in a unique check, so cannot be excluded # from validation. else: form_field = self.fields[field] field_value = self.cleaned_data.get(field, None) if not f.blank and not form_field.required and field_value in form_field.empty_values: exclude.append(f.name) return exclude def clean(self): self._validate_unique = True return self.cleaned_data def _update_errors(self, errors): # Override any validation error messages defined at the model level # with those defined at the form level. opts = self._meta for field, messages in errors.error_dict.items(): if (field == NON_FIELD_ERRORS and opts.error_messages and NON_FIELD_ERRORS in opts.error_messages): error_messages = opts.error_messages[NON_FIELD_ERRORS] elif field in self.fields: error_messages = self.fields[field].error_messages else: continue for message in messages: if (isinstance(message, ValidationError) and message.code in error_messages): message.message = error_messages[message.code] self.add_error(None, errors) def _post_clean(self): opts = self._meta exclude = self._get_validation_exclusions() # a subset of `exclude` which won't have the InlineForeignKeyField # if we're adding a new object since that value doesn't exist # until after the new instance is saved to the database. construct_instance_exclude = list(exclude) # Foreign Keys being used to represent inline relationships # are excluded from basic field value validation. This is for two # reasons: firstly, the value may not be supplied (#12507; the # case of providing new values to the admin); secondly the # object being referred to may not yet fully exist (#12749). # However, these fields *must* be included in uniqueness checks, # so this can't be part of _get_validation_exclusions(). for name, field in self.fields.items(): if isinstance(field, InlineForeignKeyField): if self.cleaned_data.get(name) is not None and self.cleaned_data[name]._state.adding: construct_instance_exclude.append(name) exclude.append(name) # Update the model instance with self.cleaned_data. self.instance = construct_instance(self, self.instance, opts.fields, construct_instance_exclude) try: self.instance.full_clean(exclude=exclude, validate_unique=False) except ValidationError as e: self._update_errors(e) # Validate uniqueness if needed. if self._validate_unique: self.validate_unique() def validate_unique(self): """ Calls the instance's validate_unique() method and updates the form's validation errors if any were raised. """ exclude = self._get_validation_exclusions() try: self.instance.validate_unique(exclude=exclude) except ValidationError as e: self._update_errors(e) def save(self, commit=True): """ Saves this ``form``'s cleaned_data into model instance ``self.instance``. If commit=True, then the changes to ``instance`` will be saved to the database. Returns ``instance``. """ if self.instance.pk is None: fail_message = 'created' else: fail_message = 'changed' return save_instance(self, self.instance, self._meta.fields, fail_message, commit, self._meta.exclude, construct=False) save.alters_data = True class ModelForm(six.with_metaclass(ModelFormMetaclass, BaseModelForm)): pass def modelform_factory(model, form=ModelForm, fields=None, exclude=None, formfield_callback=None, widgets=None, localized_fields=None, labels=None, help_texts=None, error_messages=None): """ Returns a ModelForm containing form fields for the given model. ``fields`` is an optional list of field names. If provided, only the named fields will be included in the returned fields. If omitted or '__all__', all fields will be used. ``exclude`` is an optional list of field names. If provided, the named fields will be excluded from the returned fields, even if they are listed in the ``fields`` argument. ``widgets`` is a dictionary of model field names mapped to a widget. ``localized_fields`` is a list of names of fields which should be localized. ``formfield_callback`` is a callable that takes a model field and returns a form field. ``labels`` is a dictionary of model field names mapped to a label. ``help_texts`` is a dictionary of model field names mapped to a help text. ``error_messages`` is a dictionary of model field names mapped to a dictionary of error messages. """ # Create the inner Meta class. FIXME: ideally, we should be able to # construct a ModelForm without creating and passing in a temporary # inner class. # Build up a list of attributes that the Meta object will have. attrs = {'model': model} if fields is not None: attrs['fields'] = fields if exclude is not None: attrs['exclude'] = exclude if widgets is not None: attrs['widgets'] = widgets if localized_fields is not None: attrs['localized_fields'] = localized_fields if labels is not None: attrs['labels'] = labels if help_texts is not None: attrs['help_texts'] = help_texts if error_messages is not None: attrs['error_messages'] = error_messages # If parent form class already has an inner Meta, the Meta we're # creating needs to inherit from the parent's inner meta. parent = (object,) if hasattr(form, 'Meta'): parent = (form.Meta, object) Meta = type(str('Meta'), parent, attrs) # Give this new form class a reasonable name. class_name = model.__name__ + str('Form') # Class attributes for the new form class. form_class_attrs = { 'Meta': Meta, 'formfield_callback': formfield_callback } if (getattr(Meta, 'fields', None) is None and getattr(Meta, 'exclude', None) is None): raise ImproperlyConfigured( "Calling modelform_factory without defining 'fields' or " "'exclude' explicitly is prohibited." ) # Instatiate type(form) in order to use the same metaclass as form. return type(form)(class_name, (form,), form_class_attrs) # ModelFormSets ############################################################## class BaseModelFormSet(BaseFormSet): """ A ``FormSet`` for editing a queryset and/or adding new objects to it. """ model = None def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, queryset=None, **kwargs): self.queryset = queryset self.initial_extra = kwargs.pop('initial', None) defaults = {'data': data, 'files': files, 'auto_id': auto_id, 'prefix': prefix} defaults.update(kwargs) super(BaseModelFormSet, self).__init__(**defaults) def initial_form_count(self): """Returns the number of forms that are required in this FormSet.""" if not (self.data or self.files): return len(self.get_queryset()) return super(BaseModelFormSet, self).initial_form_count() def _existing_object(self, pk): if not hasattr(self, '_object_dict'): self._object_dict = {o.pk: o for o in self.get_queryset()} return self._object_dict.get(pk) def _get_to_python(self, field): """ If the field is a related field, fetch the concrete field's (that is, the ultimate pointed-to field's) to_python. """ while field.rel is not None: field = field.rel.get_related_field() return field.to_python def _construct_form(self, i, **kwargs): if self.is_bound and i < self.initial_form_count(): pk_key = "%s-%s" % (self.add_prefix(i), self.model._meta.pk.name) pk = self.data[pk_key] pk_field = self.model._meta.pk to_python = self._get_to_python(pk_field) pk = to_python(pk) kwargs['instance'] = self._existing_object(pk) if i < self.initial_form_count() and 'instance' not in kwargs: kwargs['instance'] = self.get_queryset()[i] if i >= self.initial_form_count() and self.initial_extra: # Set initial values for extra forms try: kwargs['initial'] = self.initial_extra[i - self.initial_form_count()] except IndexError: pass return super(BaseModelFormSet, self)._construct_form(i, **kwargs) def get_queryset(self): if not hasattr(self, '_queryset'): if self.queryset is not None: qs = self.queryset else: qs = self.model._default_manager.get_queryset() # If the queryset isn't already ordered we need to add an # artificial ordering here to make sure that all formsets # constructed from this queryset have the same form order. if not qs.ordered: qs = qs.order_by(self.model._meta.pk.name) # Removed queryset limiting here. As per discussion re: #13023 # on django-dev, max_num should not prevent existing # related objects/inlines from being displayed. self._queryset = qs return self._queryset def save_new(self, form, commit=True): """Saves and returns a new model instance for the given form.""" return form.save(commit=commit) def save_existing(self, form, instance, commit=True): """Saves and returns an existing model instance for the given form.""" return form.save(commit=commit) def save(self, commit=True): """Saves model instances for every form, adding and changing instances as necessary, and returns the list of instances. """ if not commit: self.saved_forms = [] def save_m2m(): for form in self.saved_forms: form.save_m2m() self.save_m2m = save_m2m return self.save_existing_objects(commit) + self.save_new_objects(commit) save.alters_data = True def clean(self): self.validate_unique() def validate_unique(self): # Collect unique_checks and date_checks to run from all the forms. all_unique_checks = set() all_date_checks = set() forms_to_delete = self.deleted_forms valid_forms = [form for form in self.forms if form.is_valid() and form not in forms_to_delete] for form in valid_forms: exclude = form._get_validation_exclusions() unique_checks, date_checks = form.instance._get_unique_checks(exclude=exclude) all_unique_checks = all_unique_checks.union(set(unique_checks)) all_date_checks = all_date_checks.union(set(date_checks)) errors = [] # Do each of the unique checks (unique and unique_together) for uclass, unique_check in all_unique_checks: seen_data = set() for form in valid_forms: # get data for each field of each of unique_check row_data = (form.cleaned_data[field] for field in unique_check if field in form.cleaned_data) # Reduce Model instances to their primary key values row_data = tuple(d._get_pk_val() if hasattr(d, '_get_pk_val') else d for d in row_data) if row_data and None not in row_data: # if we've already seen it then we have a uniqueness failure if row_data in seen_data: # poke error messages into the right places and mark # the form as invalid errors.append(self.get_unique_error_message(unique_check)) form._errors[NON_FIELD_ERRORS] = self.error_class([self.get_form_error()]) # remove the data from the cleaned_data dict since it was invalid for field in unique_check: if field in form.cleaned_data: del form.cleaned_data[field] # mark the data as seen seen_data.add(row_data) # iterate over each of the date checks now for date_check in all_date_checks: seen_data = set() uclass, lookup, field, unique_for = date_check for form in valid_forms: # see if we have data for both fields if (form.cleaned_data and form.cleaned_data[field] is not None and form.cleaned_data[unique_for] is not None): # if it's a date lookup we need to get the data for all the fields if lookup == 'date': date = form.cleaned_data[unique_for] date_data = (date.year, date.month, date.day) # otherwise it's just the attribute on the date/datetime # object else: date_data = (getattr(form.cleaned_data[unique_for], lookup),) data = (form.cleaned_data[field],) + date_data # if we've already seen it then we have a uniqueness failure if data in seen_data: # poke error messages into the right places and mark # the form as invalid errors.append(self.get_date_error_message(date_check)) form._errors[NON_FIELD_ERRORS] = self.error_class([self.get_form_error()]) # remove the data from the cleaned_data dict since it was invalid del form.cleaned_data[field] # mark the data as seen seen_data.add(data) if errors: raise ValidationError(errors) def get_unique_error_message(self, unique_check): if len(unique_check) == 1: return ugettext("Please correct the duplicate data for %(field)s.") % { "field": unique_check[0], } else: return ugettext("Please correct the duplicate data for %(field)s, " "which must be unique.") % { "field": get_text_list(unique_check, six.text_type(_("and"))), } def get_date_error_message(self, date_check): return ugettext("Please correct the duplicate data for %(field_name)s " "which must be unique for the %(lookup)s in %(date_field)s.") % { 'field_name': date_check[2], 'date_field': date_check[3], 'lookup': six.text_type(date_check[1]), } def get_form_error(self): return ugettext("Please correct the duplicate values below.") def save_existing_objects(self, commit=True): self.changed_objects = [] self.deleted_objects = [] if not self.initial_forms: return [] saved_instances = [] forms_to_delete = self.deleted_forms for form in self.initial_forms: obj = form.instance if form in forms_to_delete: # If the pk is None, it means that the object can't be # deleted again. Possible reason for this is that the # object was already deleted from the DB. Refs #14877. if obj.pk is None: continue self.deleted_objects.append(obj) if commit: obj.delete() elif form.has_changed(): self.changed_objects.append((obj, form.changed_data)) saved_instances.append(self.save_existing(form, obj, commit=commit)) if not commit: self.saved_forms.append(form) return saved_instances def save_new_objects(self, commit=True): self.new_objects = [] for form in self.extra_forms: if not form.has_changed(): continue # If someone has marked an add form for deletion, don't save the # object. if self.can_delete and self._should_delete_form(form): continue self.new_objects.append(self.save_new(form, commit=commit)) if not commit: self.saved_forms.append(form) return self.new_objects def add_fields(self, form, index): """Add a hidden field for the object's primary key.""" from django.db.models import AutoField, OneToOneField, ForeignKey self._pk_field = pk = self.model._meta.pk # If a pk isn't editable, then it won't be on the form, so we need to # add it here so we can tell which object is which when we get the # data back. Generally, pk.editable should be false, but for some # reason, auto_created pk fields and AutoField's editable attribute is # True, so check for that as well. def pk_is_not_editable(pk): return ((not pk.editable) or (pk.auto_created or isinstance(pk, AutoField)) or (pk.rel and pk.rel.parent_link and pk_is_not_editable(pk.rel.to._meta.pk))) if pk_is_not_editable(pk) or pk.name not in form.fields: if form.is_bound: pk_value = form.instance.pk else: try: if index is not None: pk_value = self.get_queryset()[index].pk else: pk_value = None except IndexError: pk_value = None if isinstance(pk, OneToOneField) or isinstance(pk, ForeignKey): qs = pk.rel.to._default_manager.get_queryset() else: qs = self.model._default_manager.get_queryset() qs = qs.using(form.instance._state.db) if form._meta.widgets: widget = form._meta.widgets.get(self._pk_field.name, HiddenInput) else: widget = HiddenInput form.fields[self._pk_field.name] = ModelChoiceField(qs, initial=pk_value, required=False, widget=widget) super(BaseModelFormSet, self).add_fields(form, index) def modelformset_factory(model, form=ModelForm, formfield_callback=None, formset=BaseModelFormSet, extra=1, can_delete=False, can_order=False, max_num=None, fields=None, exclude=None, widgets=None, validate_max=False, localized_fields=None, labels=None, help_texts=None, error_messages=None, min_num=None, validate_min=False): """ Returns a FormSet class for the given Django model class. """ meta = getattr(form, 'Meta', None) if meta is None: meta = type(str('Meta'), (object,), {}) if (getattr(meta, 'fields', fields) is None and getattr(meta, 'exclude', exclude) is None): raise ImproperlyConfigured( "Calling modelformset_factory without defining 'fields' or " "'exclude' explicitly is prohibited." ) form = modelform_factory(model, form=form, fields=fields, exclude=exclude, formfield_callback=formfield_callback, widgets=widgets, localized_fields=localized_fields, labels=labels, help_texts=help_texts, error_messages=error_messages) FormSet = formset_factory(form, formset, extra=extra, min_num=min_num, max_num=max_num, can_order=can_order, can_delete=can_delete, validate_min=validate_min, validate_max=validate_max) FormSet.model = model return FormSet # InlineFormSets ############################################################# class BaseInlineFormSet(BaseModelFormSet): """A formset for child objects related to a parent.""" def __init__(self, data=None, files=None, instance=None, save_as_new=False, prefix=None, queryset=None, **kwargs): if instance is None: self.instance = self.fk.rel.to() else: self.instance = instance self.save_as_new = save_as_new if queryset is None: queryset = self.model._default_manager if self.instance.pk is not None: qs = queryset.filter(**{self.fk.name: self.instance}) else: qs = queryset.none() super(BaseInlineFormSet, self).__init__(data, files, prefix=prefix, queryset=qs, **kwargs) def initial_form_count(self): if self.save_as_new: return 0 return super(BaseInlineFormSet, self).initial_form_count() def _construct_form(self, i, **kwargs): form = super(BaseInlineFormSet, self)._construct_form(i, **kwargs) if self.save_as_new: # Remove the primary key from the form's data, we are only # creating new instances form.data[form.add_prefix(self._pk_field.name)] = None # Remove the foreign key from the form's data form.data[form.add_prefix(self.fk.name)] = None # Set the fk value here so that the form can do its validation. fk_value = self.instance.pk if self.fk.rel.field_name != self.fk.rel.to._meta.pk.name: fk_value = getattr(self.instance, self.fk.rel.field_name) fk_value = getattr(fk_value, 'pk', fk_value) setattr(form.instance, self.fk.get_attname(), fk_value) return form @classmethod def get_default_prefix(cls): return cls.fk.rel.get_accessor_name(model=cls.model).replace('+', '') def save_new(self, form, commit=True): # Use commit=False so we can assign the parent key afterwards, then # save the object. obj = form.save(commit=False) pk_value = getattr(self.instance, self.fk.rel.field_name) setattr(obj, self.fk.get_attname(), getattr(pk_value, 'pk', pk_value)) if commit: obj.save() # form.save_m2m() can be called via the formset later on if commit=False if commit and hasattr(form, 'save_m2m'): form.save_m2m() return obj def add_fields(self, form, index): super(BaseInlineFormSet, self).add_fields(form, index) if self._pk_field == self.fk: name = self._pk_field.name kwargs = {'pk_field': True} else: # The foreign key field might not be on the form, so we poke at the # Model field to get the label, since we need that for error messages. name = self.fk.name kwargs = { 'label': getattr(form.fields.get(name), 'label', capfirst(self.fk.verbose_name)) } if self.fk.rel.field_name != self.fk.rel.to._meta.pk.name: kwargs['to_field'] = self.fk.rel.field_name form.fields[name] = InlineForeignKeyField(self.instance, **kwargs) # Add the generated field to form._meta.fields if it's defined to make # sure validation isn't skipped on that field. if form._meta.fields: if isinstance(form._meta.fields, tuple): form._meta.fields = list(form._meta.fields) form._meta.fields.append(self.fk.name) def get_unique_error_message(self, unique_check): unique_check = [field for field in unique_check if field != self.fk.name] return super(BaseInlineFormSet, self).get_unique_error_message(unique_check) def _get_foreign_key(parent_model, model, fk_name=None, can_fail=False): """ Finds and returns the ForeignKey from model to parent if there is one (returns None if can_fail is True and no such field exists). If fk_name is provided, assume it is the name of the ForeignKey field. Unless can_fail is True, an exception is raised if there is no ForeignKey from model to parent_model. """ # avoid circular import from django.db.models import ForeignKey opts = model._meta if fk_name: fks_to_parent = [f for f in opts.fields if f.name == fk_name] if len(fks_to_parent) == 1: fk = fks_to_parent[0] if not isinstance(fk, ForeignKey) or \ (fk.rel.to != parent_model and fk.rel.to not in parent_model._meta.get_parent_list()): raise ValueError( "fk_name '%s' is not a ForeignKey to '%s.%s'." % (fk_name, parent_model._meta.app_label, parent_model._meta.object_name)) elif len(fks_to_parent) == 0: raise ValueError( "'%s.%s' has no field named '%s'." % (model._meta.app_label, model._meta.object_name, fk_name)) else: # Try to discover what the ForeignKey from model to parent_model is fks_to_parent = [ f for f in opts.fields if isinstance(f, ForeignKey) and (f.rel.to == parent_model or f.rel.to in parent_model._meta.get_parent_list()) ] if len(fks_to_parent) == 1: fk = fks_to_parent[0] elif len(fks_to_parent) == 0: if can_fail: return raise ValueError( "'%s.%s' has no ForeignKey to '%s.%s'." % ( model._meta.app_label, model._meta.object_name, parent_model._meta.app_label, parent_model._meta.object_name, ) ) else: raise ValueError( "'%s.%s' has more than one ForeignKey to '%s.%s'." % ( model._meta.app_label, model._meta.object_name, parent_model._meta.app_label, parent_model._meta.object_name, ) ) return fk def inlineformset_factory(parent_model, model, form=ModelForm, formset=BaseInlineFormSet, fk_name=None, fields=None, exclude=None, extra=3, can_order=False, can_delete=True, max_num=None, formfield_callback=None, widgets=None, validate_max=False, localized_fields=None, labels=None, help_texts=None, error_messages=None, min_num=None, validate_min=False): """ Returns an ``InlineFormSet`` for the given kwargs. You must provide ``fk_name`` if ``model`` has more than one ``ForeignKey`` to ``parent_model``. """ fk = _get_foreign_key(parent_model, model, fk_name=fk_name) # enforce a max_num=1 when the foreign key to the parent model is unique. if fk.unique: max_num = 1 kwargs = { 'form': form, 'formfield_callback': formfield_callback, 'formset': formset, 'extra': extra, 'can_delete': can_delete, 'can_order': can_order, 'fields': fields, 'exclude': exclude, 'min_num': min_num, 'max_num': max_num, 'widgets': widgets, 'validate_min': validate_min, 'validate_max': validate_max, 'localized_fields': localized_fields, 'labels': labels, 'help_texts': help_texts, 'error_messages': error_messages, } FormSet = modelformset_factory(model, **kwargs) FormSet.fk = fk return FormSet # Fields ##################################################################### class InlineForeignKeyField(Field): """ A basic integer field that deals with validating the given value to a given parent instance in an inline. """ widget = HiddenInput default_error_messages = { 'invalid_choice': _('The inline foreign key did not match the parent instance primary key.'), } def __init__(self, parent_instance, *args, **kwargs): self.parent_instance = parent_instance self.pk_field = kwargs.pop("pk_field", False) self.to_field = kwargs.pop("to_field", None) if self.parent_instance is not None: if self.to_field: kwargs["initial"] = getattr(self.parent_instance, self.to_field) else: kwargs["initial"] = self.parent_instance.pk kwargs["required"] = False super(InlineForeignKeyField, self).__init__(*args, **kwargs) def clean(self, value): if value in self.empty_values: if self.pk_field: return None # if there is no value act as we did before. return self.parent_instance # ensure the we compare the values as equal types. if self.to_field: orig = getattr(self.parent_instance, self.to_field) else: orig = self.parent_instance.pk if force_text(value) != force_text(orig): raise ValidationError(self.error_messages['invalid_choice'], code='invalid_choice') return self.parent_instance def has_changed(self, initial, data): return False class ModelChoiceIterator(object): def __init__(self, field): self.field = field self.queryset = field.queryset def __iter__(self): if self.field.empty_label is not None: yield ("", self.field.empty_label) if self.field.cache_choices: if self.field.choice_cache is None: self.field.choice_cache = [ self.choice(obj) for obj in self.queryset.iterator() ] for choice in self.field.choice_cache: yield choice else: for obj in self.queryset.iterator(): yield self.choice(obj) def __len__(self): return (len(self.queryset) + (1 if self.field.empty_label is not None else 0)) def choice(self, obj): return (self.field.prepare_value(obj), self.field.label_from_instance(obj)) class ModelChoiceField(ChoiceField): """A ChoiceField whose choices are a model QuerySet.""" # This class is a subclass of ChoiceField for purity, but it doesn't # actually use any of ChoiceField's implementation. default_error_messages = { 'invalid_choice': _('Select a valid choice. That choice is not one of' ' the available choices.'), } def __init__(self, queryset, empty_label="---------", cache_choices=None, required=True, widget=None, label=None, initial=None, help_text='', to_field_name=None, limit_choices_to=None, *args, **kwargs): if required and (initial is not None): self.empty_label = None else: self.empty_label = empty_label if cache_choices is not None: warnings.warn("cache_choices has been deprecated and will be " "removed in Django 1.9.", RemovedInDjango19Warning, stacklevel=2) else: cache_choices = False self.cache_choices = cache_choices # Call Field instead of ChoiceField __init__() because we don't need # ChoiceField.__init__(). Field.__init__(self, required, widget, label, initial, help_text, *args, **kwargs) self.queryset = queryset self.limit_choices_to = limit_choices_to # limit the queryset later. self.choice_cache = None self.to_field_name = to_field_name def get_limit_choices_to(self): """ Returns ``limit_choices_to`` for this form field. If it is a callable, it will be invoked and the result will be returned. """ if callable(self.limit_choices_to): return self.limit_choices_to() return self.limit_choices_to def __deepcopy__(self, memo): result = super(ChoiceField, self).__deepcopy__(memo) # Need to force a new ModelChoiceIterator to be created, bug #11183 result.queryset = result.queryset return result def _get_queryset(self): return self._queryset def _set_queryset(self, queryset): self._queryset = queryset self.widget.choices = self.choices queryset = property(_get_queryset, _set_queryset) # this method will be used to create object labels by the QuerySetIterator. # Override it to customize the label. def label_from_instance(self, obj): """ This method is used to convert objects into strings; it's used to generate the labels for the choices presented by this object. Subclasses can override this method to customize the display of the choices. """ return smart_text(obj) def _get_choices(self): # If self._choices is set, then somebody must have manually set # the property self.choices. In this case, just return self._choices. if hasattr(self, '_choices'): return self._choices # Otherwise, execute the QuerySet in self.queryset to determine the # choices dynamically. Return a fresh ModelChoiceIterator that has not been # consumed. Note that we're instantiating a new ModelChoiceIterator *each* # time _get_choices() is called (and, thus, each time self.choices is # accessed) so that we can ensure the QuerySet has not been consumed. This # construct might look complicated but it allows for lazy evaluation of # the queryset. return ModelChoiceIterator(self) choices = property(_get_choices, ChoiceField._set_choices) def prepare_value(self, value): if hasattr(value, '_meta'): if self.to_field_name: return value.serializable_value(self.to_field_name) else: return value.pk return super(ModelChoiceField, self).prepare_value(value) def to_python(self, value): if value in self.empty_values: return None try: key = self.to_field_name or 'pk' value = self.queryset.get(**{key: value}) except (ValueError, TypeError, self.queryset.model.DoesNotExist): raise ValidationError(self.error_messages['invalid_choice'], code='invalid_choice') return value def validate(self, value): return Field.validate(self, value) def has_changed(self, initial, data): initial_value = initial if initial is not None else '' data_value = data if data is not None else '' return force_text(self.prepare_value(initial_value)) != force_text(data_value) class ModelMultipleChoiceField(ModelChoiceField): """A MultipleChoiceField whose choices are a model QuerySet.""" widget = SelectMultiple hidden_widget = MultipleHiddenInput default_error_messages = { 'list': _('Enter a list of values.'), 'invalid_choice': _('Select a valid choice. %(value)s is not one of the' ' available choices.'), 'invalid_pk_value': _('"%(pk)s" is not a valid value for a primary key.') } def __init__(self, queryset, cache_choices=None, required=True, widget=None, label=None, initial=None, help_text='', *args, **kwargs): super(ModelMultipleChoiceField, self).__init__(queryset, None, cache_choices, required, widget, label, initial, help_text, *args, **kwargs) def to_python(self, value): if not value: return [] return list(self._check_values(value)) def clean(self, value): if self.required and not value: raise ValidationError(self.error_messages['required'], code='required') elif not self.required and not value: return self.queryset.none() if not isinstance(value, (list, tuple)): raise ValidationError(self.error_messages['list'], code='list') qs = self._check_values(value) # Since this overrides the inherited ModelChoiceField.clean # we run custom validators here self.run_validators(value) return qs def _check_values(self, value): """ Given a list of possible PK values, returns a QuerySet of the corresponding objects. Raises a ValidationError if a given value is invalid (not a valid PK, not in the queryset, etc.) """ key = self.to_field_name or 'pk' # deduplicate given values to avoid creating many querysets or # requiring the database backend deduplicate efficiently. try: value = frozenset(value) except TypeError: # list of lists isn't hashable, for example raise ValidationError( self.error_messages['list'], code='list', ) for pk in value: try: self.queryset.filter(**{key: pk}) except (ValueError, TypeError): raise ValidationError( self.error_messages['invalid_pk_value'], code='invalid_pk_value', params={'pk': pk}, ) qs = self.queryset.filter(**{'%s__in' % key: value}) pks = set(force_text(getattr(o, key)) for o in qs) for val in value: if force_text(val) not in pks: raise ValidationError( self.error_messages['invalid_choice'], code='invalid_choice', params={'value': val}, ) return qs def prepare_value(self, value): if (hasattr(value, '__iter__') and not isinstance(value, six.text_type) and not hasattr(value, '_meta')): return [super(ModelMultipleChoiceField, self).prepare_value(v) for v in value] return super(ModelMultipleChoiceField, self).prepare_value(value) def has_changed(self, initial, data): if initial is None: initial = [] if data is None: data = [] if len(initial) != len(data): return True initial_set = set(force_text(value) for value in self.prepare_value(initial)) data_set = set(force_text(value) for value in data) return data_set != initial_set def modelform_defines_fields(form_class): return (form_class is not None and ( hasattr(form_class, '_meta') and (form_class._meta.fields is not None or form_class._meta.exclude is not None) ))
runekaagaard/django-contrib-locking
django/forms/models.py
Python
bsd-3-clause
54,740
0.00148