content
stringlengths 5
1.05M
|
|---|
"""Interface for drivers."""
import abc
from collections import namedtuple
from typing import Any
from mpf.core.platform import DriverConfig
PulseSettings = namedtuple("PulseSettings", ["power", "duration"])
HoldSettings = namedtuple("HoldSettings", ["power", "duration"])
# Python 3.7 supports a defaults arg in namedtuple, but 3.6 does not
HoldSettings.__new__.__defaults__ = (None, None)
class DriverPlatformInterface(metaclass=abc.ABCMeta):
"""Interface for drivers in hardware platforms.
DriverPlatformInterface is an abstract base class that should be overridden for all
driver interface classes on supported platforms. This class ensures the proper required
methods are implemented to support driver operations in MPF.
"""
__slots__ = ["number", "config"]
def __init__(self, config: DriverConfig, number: "Any") -> None:
"""Initialise driver."""
self.number = number # type: Any
self.config = config # type: DriverConfig
@abc.abstractmethod
def pulse(self, pulse_settings: PulseSettings):
"""Pulse a driver.
Pulse this driver for a pre-determined amount of time, after which
this driver is turned off automatically. Note that on most platforms,
pulse times are a max of 255ms. (Beyond that MPF will send separate
enable() and disable() commands.
"""
raise NotImplementedError
@abc.abstractmethod
def enable(self, pulse_settings: PulseSettings, hold_settings: HoldSettings):
"""Enable this driver, which means it's held "on" indefinitely until it's explicitly disabled."""
raise NotImplementedError
@abc.abstractmethod
def disable(self):
"""Disable the driver."""
raise NotImplementedError
@abc.abstractmethod
def timed_enable(self, pulse_settings: PulseSettings, hold_settings: HoldSettings):
"""Enable the driver for a pre-specified duration."""
raise NotImplementedError
@abc.abstractmethod
def get_board_name(self):
"""Return the name of the board of this driver."""
raise NotImplementedError
def __repr__(self):
"""Return board + number."""
return "<Driver {} {} (config: {})>".format(self.get_board_name(), self.number, self.config)
|
import os
import numpy as np
from functools import reduce
import random
DATASET_DIR='D:/dataset/cifar-10-batches-py'
TARGET_SAVE_DIR='D:/dataset/cifar-10-batches-py/prepDat'
TRAIN_TEST_RATIO=[0.8, 0.8, 0.5, 0.8, 0.5, 0.8, 0.8, 0.8, 0.8, 0.5]
CIFAR_MEAN=[125.3, 123.0, 113.9]
CIFAR_LABEL={0:"airplane", 1:"automobile", 2:"bird",3:"cat",4:"deer",
5:"dog",6:"frog",7:"horse",8:"ship",9:"truck"}
def unpickle(file):
import pickle
with open(file,'rb') as fil:
dic=pickle.load(fil,encoding='bytes')
return dic
def createDataAndLabel(imList,indexList):
imL=[np.stack([ imList[f] for f in fLabIn],axis=0) for fLabIn in indexList]
LabelL=[[ind]*val.shape[0] for ind,val in enumerate(imL)]
LabelL=reduce((lambda x,y:x+y),LabelL)
imL=np.concatenate(imL,axis=0)
LabelL=np.array(LabelL)
return imL,LabelL
trainDatasetFileL=['data_batch_1','data_batch_2','data_batch_3','data_batch_4','data_batch_5']
testDatasetFileL=['test_batch']
random.seed(0)
#load original data
imL,labelL=list(zip(*[[f2[b'data'],f2[b'labels']] for f2 in
[unpickle(os.path.join(DATASET_DIR,f)) for f in trainDatasetFileL]]))
imL=np.concatenate(imL,axis=0)
labelL=reduce((lambda x,y:x+y),labelL)
#image pre-processing
imMean=np.array(CIFAR_MEAN).reshape(1,3,1,1)
imL=imL.reshape(imL.shape[0],3,32,32)
imNormL=(imL.astype(np.float32)-imMean)/255
#random train/test dataset splitting
labelIndexL=[[ind for ind,val in enumerate(labelL) if val==fLab] for fLab in range(10)]
trainTestIndL=[]
for fInd,fLabIn in enumerate(labelIndexL):
sepPt=int(TRAIN_TEST_RATIO[fInd]*len(fLabIn))
random.shuffle(fLabIn)
trainTestIndL.append([fLabIn[:sepPt],fLabIn[sepPt:]])
trainIndL,testIndL=list(zip(*trainTestIndL))
trainIndL=trainIndL
#dataset preparation
trainImL,trainLabL=createDataAndLabel(imNormL,trainIndL)
testImL,testLabL=createDataAndLabel(imNormL,testIndL)
#save prepared dataset
np.save("%s/trainIm.npy"%(TARGET_SAVE_DIR),trainImL)
np.save("%s/trainLab.npy"%(TARGET_SAVE_DIR),trainLabL)
np.save("%s/testIm.npy"%(TARGET_SAVE_DIR),testImL)
np.save("%s/testLab.npy"%(TARGET_SAVE_DIR),testLabL)
|
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class EstimatePurgeDataSizeDetails(object):
"""
This is the input used to estimate the size of data that might be purged
"""
#: A constant which can be used with the data_type property of a EstimatePurgeDataSizeDetails.
#: This constant has a value of "LOG"
DATA_TYPE_LOG = "LOG"
#: A constant which can be used with the data_type property of a EstimatePurgeDataSizeDetails.
#: This constant has a value of "LOOKUP"
DATA_TYPE_LOOKUP = "LOOKUP"
def __init__(self, **kwargs):
"""
Initializes a new EstimatePurgeDataSizeDetails object with values from keyword arguments.
The following keyword arguments are supported (corresponding to the getters/setters of this class):
:param compartment_id:
The value to assign to the compartment_id property of this EstimatePurgeDataSizeDetails.
:type compartment_id: str
:param compartment_id_in_subtree:
The value to assign to the compartment_id_in_subtree property of this EstimatePurgeDataSizeDetails.
:type compartment_id_in_subtree: bool
:param time_data_ended:
The value to assign to the time_data_ended property of this EstimatePurgeDataSizeDetails.
:type time_data_ended: datetime
:param purge_query_string:
The value to assign to the purge_query_string property of this EstimatePurgeDataSizeDetails.
:type purge_query_string: str
:param data_type:
The value to assign to the data_type property of this EstimatePurgeDataSizeDetails.
Allowed values for this property are: "LOG", "LOOKUP"
:type data_type: str
"""
self.swagger_types = {
'compartment_id': 'str',
'compartment_id_in_subtree': 'bool',
'time_data_ended': 'datetime',
'purge_query_string': 'str',
'data_type': 'str'
}
self.attribute_map = {
'compartment_id': 'compartmentId',
'compartment_id_in_subtree': 'compartmentIdInSubtree',
'time_data_ended': 'timeDataEnded',
'purge_query_string': 'purgeQueryString',
'data_type': 'dataType'
}
self._compartment_id = None
self._compartment_id_in_subtree = None
self._time_data_ended = None
self._purge_query_string = None
self._data_type = None
@property
def compartment_id(self):
"""
**[Required]** Gets the compartment_id of this EstimatePurgeDataSizeDetails.
This is the compartment OCID under which the data will be purged
:return: The compartment_id of this EstimatePurgeDataSizeDetails.
:rtype: str
"""
return self._compartment_id
@compartment_id.setter
def compartment_id(self, compartment_id):
"""
Sets the compartment_id of this EstimatePurgeDataSizeDetails.
This is the compartment OCID under which the data will be purged
:param compartment_id: The compartment_id of this EstimatePurgeDataSizeDetails.
:type: str
"""
self._compartment_id = compartment_id
@property
def compartment_id_in_subtree(self):
"""
Gets the compartment_id_in_subtree of this EstimatePurgeDataSizeDetails.
If true, purge child compartments data
:return: The compartment_id_in_subtree of this EstimatePurgeDataSizeDetails.
:rtype: bool
"""
return self._compartment_id_in_subtree
@compartment_id_in_subtree.setter
def compartment_id_in_subtree(self, compartment_id_in_subtree):
"""
Sets the compartment_id_in_subtree of this EstimatePurgeDataSizeDetails.
If true, purge child compartments data
:param compartment_id_in_subtree: The compartment_id_in_subtree of this EstimatePurgeDataSizeDetails.
:type: bool
"""
self._compartment_id_in_subtree = compartment_id_in_subtree
@property
def time_data_ended(self):
"""
**[Required]** Gets the time_data_ended of this EstimatePurgeDataSizeDetails.
This is the time before which data will be purged
:return: The time_data_ended of this EstimatePurgeDataSizeDetails.
:rtype: datetime
"""
return self._time_data_ended
@time_data_ended.setter
def time_data_ended(self, time_data_ended):
"""
Sets the time_data_ended of this EstimatePurgeDataSizeDetails.
This is the time before which data will be purged
:param time_data_ended: The time_data_ended of this EstimatePurgeDataSizeDetails.
:type: datetime
"""
self._time_data_ended = time_data_ended
@property
def purge_query_string(self):
"""
Gets the purge_query_string of this EstimatePurgeDataSizeDetails.
This is the solr data filter query, '*' means all
:return: The purge_query_string of this EstimatePurgeDataSizeDetails.
:rtype: str
"""
return self._purge_query_string
@purge_query_string.setter
def purge_query_string(self, purge_query_string):
"""
Sets the purge_query_string of this EstimatePurgeDataSizeDetails.
This is the solr data filter query, '*' means all
:param purge_query_string: The purge_query_string of this EstimatePurgeDataSizeDetails.
:type: str
"""
self._purge_query_string = purge_query_string
@property
def data_type(self):
"""
Gets the data_type of this EstimatePurgeDataSizeDetails.
This is the type of the log data to be purged
Allowed values for this property are: "LOG", "LOOKUP"
:return: The data_type of this EstimatePurgeDataSizeDetails.
:rtype: str
"""
return self._data_type
@data_type.setter
def data_type(self, data_type):
"""
Sets the data_type of this EstimatePurgeDataSizeDetails.
This is the type of the log data to be purged
:param data_type: The data_type of this EstimatePurgeDataSizeDetails.
:type: str
"""
allowed_values = ["LOG", "LOOKUP"]
if not value_allowed_none_or_none_sentinel(data_type, allowed_values):
raise ValueError(
"Invalid value for `data_type`, must be None or one of {0}"
.format(allowed_values)
)
self._data_type = data_type
def __repr__(self):
return formatted_flat_dict(self)
def __eq__(self, other):
if other is None:
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
return not self == other
|
"""Unit test module for internationalization logic"""
from __future__ import unicode_literals # isort:skip
from flask import current_app
from flask_login import login_user
from portal.models.i18n import get_locale
from portal.models.user import User
from tests import TEST_USER_ID, TestCase
class TestI18n(TestCase):
"""I18n tests"""
def test_get_locale(self):
assert get_locale() == current_app.config.get("DEFAULT_LOCALE")
language = 'en_AU'
language_name = "Australian English"
test_user = User.query.get(TEST_USER_ID)
test_user.locale = (language, language_name)
login_user(test_user)
assert get_locale() == language
|
#!/usr/bin/env python
# coding: utf-8
#############################################
# File Name: setup.py
# Author: whzcorcd
# Mail: whzcorcd@gmail.com
# Created Time: 2020-06-08
#############################################
from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="sentry-wechat",
version='0.0.3',
author='whzcorcd',
author_email='whzcorcd@gmail.com',
url='https://github.com/corcd/sentry-wechat',
description='A sentry extension which share information to Wechat Work',
long_description=long_description,
long_description_content_type="text/markdown",
license='MIT',
keywords='sentry wechat',
include_package_data=True,
zip_safe=False,
package_dir={'': 'src'},
packages=find_packages('src'),
install_requires=[
'sentry>=9.0.0',
'requests',
],
entry_points={
'sentry.plugins': [
'sentry_wechat = sentry_wechat.plugin:WechatPlugin'
]
},
classifiers=[
'Programming Language :: Python :: 2.7',
"License :: OSI Approved :: MIT License",
]
)
|
# MODE = 'django'
#
# SOURCE_VOCAB_SIZE = 2490 # 2492 # 5980
# TARGET_VOCAB_SIZE = 2101 # 2110 # 4830 #
# RULE_NUM = 222 # 228
# NODE_NUM = 96
#
# NODE_EMBED_DIM = 256
# EMBED_DIM = 128
# RULE_EMBED_DIM = 256
# QUERY_DIM = 256
# LSTM_STATE_DIM = 256
# DECODER_ATT_HIDDEN_DIM = 50
# POINTER_NET_HIDDEN_DIM = 50
#
# MAX_QUERY_LENGTH = 70
# MAX_EXAMPLE_ACTION_NUM = 100
#
# DECODER_DROPOUT = 0.2
# WORD_DROPOUT = 0
#
# # encoder
# ENCODER_LSTM = 'bilstm'
#
# # decoder
# PARENT_HIDDEN_STATE_FEEDING = True
# PARENT_RULE_FEEDING = True
# NODE_TYPE_FEEDING = True
# TREE_ATTENTION = True
#
# # training
# TRAIN_PATIENCE = 10
# MAX_EPOCH = 50
# BATCH_SIZE = 10
# VALID_PER_MINIBATCH = 4000
# SAVE_PER_MINIBATCH = 4000
#
# # decoding
# BEAM_SIZE = 15
# DECODE_MAX_TIME_STEP = 100
config_info = None
|
from lxmert.lxmert.src.tasks import vqa_data
from lxmert.lxmert.src.modeling_frcnn import GeneralizedRCNN
import lxmert.lxmert.src.vqa_utils as utils
from lxmert.lxmert.src.processing_image import Preprocess
from transformers import LxmertTokenizer
from lxmert.lxmert.src.huggingface_lxmert import LxmertForQuestionAnswering
from lxmert.lxmert.src.lxmert_lrp import LxmertForQuestionAnswering as LxmertForQuestionAnsweringLRP
from tqdm import tqdm
from lxmert.lxmert.src.ExplanationGenerator import HeadPrune, LayerPrune
import random
from lxmert.lxmert.src.param import args
import torch
OBJ_URL = "https://raw.githubusercontent.com/airsplay/py-bottom-up-attention/master/demo/data/genome/1600-400-20/objects_vocab.txt"
ATTR_URL = "https://raw.githubusercontent.com/airsplay/py-bottom-up-attention/master/demo/data/genome/1600-400-20/attributes_vocab.txt"
VQA_URL = "https://raw.githubusercontent.com/airsplay/lxmert/master/data/vqa/trainval_label2ans.json"
class ModelPert:
def __init__(self, COCO_val_path, use_lrp=False):
self.COCO_VAL_PATH = COCO_val_path
self.vqa_answers = utils.get_data(VQA_URL)
# load models and model components
self.frcnn_cfg = utils.Config.from_pretrained("unc-nlp/frcnn-vg-finetuned")
self.frcnn_cfg.MODEL.DEVICE = "cuda"
self.frcnn = GeneralizedRCNN.from_pretrained("unc-nlp/frcnn-vg-finetuned", config=self.frcnn_cfg)
self.image_preprocess = Preprocess(self.frcnn_cfg)
self.lxmert_tokenizer = LxmertTokenizer.from_pretrained("unc-nlp/lxmert-base-uncased")
self.lxmert_vqa = LxmertForQuestionAnsweringLRP.from_pretrained("unc-nlp/lxmert-vqa-uncased").to("cuda")
self.lxmert_vqa_no_lrp = LxmertForQuestionAnswering.from_pretrained("unc-nlp/lxmert-vqa-uncased").to("cuda")
self.lxmert_vqa.eval()
self.lxmert_vqa_no_lrp.eval()
self.model = self.lxmert_vqa
self.vqa_dataset = vqa_data.VQADataset(splits="valid")
self.pert_steps = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
self.pert_acc = [0] * len(self.pert_steps)
def forward(self, item):
image_file_path = self.COCO_VAL_PATH + item['img_id'] + '.jpg'
self.image_file_path = image_file_path
self.image_id = item['img_id']
# run frcnn
images, sizes, scales_yx = self.image_preprocess(image_file_path)
output_dict = self.frcnn(
images,
sizes,
scales_yx=scales_yx,
padding="max_detections",
max_detections= self.frcnn_cfg.max_detections,
return_tensors="pt"
)
inputs = self.lxmert_tokenizer(
item['sent'],
truncation=True,
return_token_type_ids=True,
return_attention_mask=True,
add_special_tokens=True,
return_tensors="pt"
)
self.question_tokens = self.lxmert_tokenizer.convert_ids_to_tokens(inputs.input_ids.flatten())
self.text_len = len(self.question_tokens)
# Very important that the boxes are normalized
normalized_boxes = output_dict.get("normalized_boxes")
features = output_dict.get("roi_features")
self.image_boxes_len = features.shape[1]
self.bboxes = output_dict.get("boxes")
self.output = self.lxmert_vqa(
input_ids=inputs.input_ids.to("cuda"),
attention_mask=inputs.attention_mask.to("cuda"),
visual_feats=features.to("cuda"),
visual_pos=normalized_boxes.to("cuda"),
token_type_ids=inputs.token_type_ids.to("cuda"),
return_dict=True,
output_attentions=False,
)
return self.output
def perturbation(self, item, scores_text, scores_image, is_positive_pert=False, heads=True):
image_file_path = self.COCO_VAL_PATH + item['img_id'] + '.jpg'
# run frcnn
images, sizes, scales_yx = self.image_preprocess(image_file_path)
output_dict = self.frcnn(
images,
sizes,
scales_yx=scales_yx,
padding="max_detections",
max_detections=self.frcnn_cfg.max_detections,
return_tensors="pt"
)
inputs = self.lxmert_tokenizer(
item['sent'],
truncation=True,
return_token_type_ids=True,
return_attention_mask=True,
add_special_tokens=True,
return_tensors="pt"
)
# Very important that the boxes are normalized
normalized_boxes = output_dict.get("normalized_boxes")
features = output_dict.get("roi_features")
num_text_layers = len(scores_text)
num_image_layers = len(scores_image)
# create a 1D tensor of all scores
# the initial shape of the scores differs from heads to layers
if heads == True:
num_text_heads = scores_text[0].shape[0]
num_image_heads = scores_image[0].shape[0]
tot_num = num_text_layers * num_text_heads + num_image_layers * num_image_heads
scores_text = torch.stack(scores_text)
scores_image = torch.stack(scores_image)
joint_scores = torch.cat([scores_text, scores_image]).to("cuda")
else:
tot_num = num_text_layers + num_image_layers
joint_scores = torch.tensor(scores_text + scores_image) #In layers-pruning these are two lists so we use '+'
if is_positive_pert: # if positive pert then flip scores
joint_scores = joint_scores * (-1)
with torch.no_grad():
for step_idx, step in enumerate(self.pert_steps):
# find top step heads
curr_num = int((1 - step) * tot_num)
joint_scores = joint_scores.flatten()
_, top_heads = joint_scores.topk(k=curr_num, dim=-1)
heads_indicator = torch.zeros_like(joint_scores)
heads_indicator[top_heads] = 1
# reshape the binary vector, in layers num_image_heads is irrelevant so we use 1
if heads == True:
heads_indicator = heads_indicator.reshape(num_text_layers + num_image_layers, num_image_heads)
else:
heads_indicator = heads_indicator.reshape(num_text_layers + num_image_layers, 1)
# split binary vector to text heads and image heads
heads_indicator_text = heads_indicator[:num_text_layers, :]
heads_indicator_image = heads_indicator[num_text_layers:, :]
output = self.lxmert_vqa_no_lrp(
input_ids=inputs.input_ids.to("cuda"),
attention_mask=inputs.attention_mask.to("cuda"),
visual_feats=features.to("cuda"),
visual_pos=normalized_boxes.to("cuda"),
token_type_ids=inputs.token_type_ids.to("cuda"),
return_dict=True,
output_attentions=False,
text_head_prune=heads_indicator_text,
image_head_prune=heads_indicator_image,
)
answer = self.vqa_answers[output.question_answering_score.argmax()]
accuracy = item["label"].get(answer, 0)
self.pert_acc[step_idx] += accuracy
return self.pert_acc
def main(args):
model_pert = ModelPert(args.COCO_path, use_lrp=True)
if args.prune_type == "head": # is head pruning or layer pruning
gen = HeadPrune(model_pert)
else:
gen = LayerPrune(model_pert)
vqa_dataset = vqa_data.VQADataset(splits="valid")
method_name = args.method
items = vqa_dataset.data
random.seed(args.seed)
r = list(range(len(items)))
random.shuffle(r)
pert_samples_indices = r[:args.num_samples]
iterator = tqdm([vqa_dataset.data[i] for i in pert_samples_indices])
test_type = "positive" if args.is_positive_pert is True else "negative"
modality = "text" if args.is_text_pert else "image"
print("running {0} {1} prune pert test for {2} modality with method {3}".format(test_type, args.prune_type, modality, args.method))
for index, item in enumerate(iterator):
grad_scores_text, grad_scores_image, cam_scores_text, cam_scores_image = gen.generate_ours(item)
scores_text = grad_scores_text if method_name == "ours" else cam_scores_text
scores_image = grad_scores_image if method_name == "ours" else cam_scores_image
curr_pert_result = model_pert.perturbation(item, scores_text, scores_image, args.is_positive_pert, heads=(args.prune_type == "head"))
curr_pert_result = [round(res / (index + 1) * 100, 2) for res in curr_pert_result]
iterator.set_description("Acc: {}".format(curr_pert_result))
if __name__ == "__main__":
main(args)
|
import torch
import torchvision
import torch.nn as nn
import torchvision.transforms as transforms
from torch.utils.data import DataLoader, random_split
from torch.autograd import Variable
import numpy as np
class CustomDataset:
def __init__(self,args,graph,vec):
self.args = args
self.data = vec
self.to_tensor = transforms.ToTensor()
self.num= len(graph.nodes())
# Calculate len
self.data_len = len(self.data.index)
def __getitem__(self, index):
inp_as_np = np.asarray(self.data.iloc[index][0:self.num]).reshape(1,self.num)
fin_as_np = np.asarray(self.data.iloc[index][self.num:]).reshape(1,self.num)
# Transform to tensor
inp_as_tensor = torch.from_numpy(inp_as_np).type('torch.FloatTensor').squeeze()
fin_as_tensor = torch.from_numpy(fin_as_np).type('torch.FloatTensor').squeeze()
return (inp_as_tensor, fin_as_tensor)
def __len__(self):
return self.data_len
|
from django.http import HttpResponse
from django.core.mail import send_mail
from django.core.context_processors import csrf
from django.core.mail import send_mail
from django.conf import settings
from django.shortcuts import render_to_response, render
from django.template import loader,RequestContext
import xlab.settings
from django.contrib.auth.decorators import login_required
from slipstream.user.account import UserAccount
import logging
from string import letters, digits
import random
from random import choice
from grid_user.models import ChangeEmail, ChangePassword, User
log = logging.getLogger("[GRID_USER]: ")
@login_required
def user(request):
context = {}
context['SiteName'] = settings.SITE_NAME
context['SiteTitle'] = 'Account'
context['navbar'] = 'account_nav.html'
context['application'] = 'summary' #start with a summary
return render(request, "account.html", context)
@login_required
def change_password(request):
account_server = settings.ACCOUNT_SERVER_URL
#account_server = "http://127.0.0.1:8000"
from_address = settings.ACCOUNT_ADMIN_EMAIL
if request.POST:
data = request.POST
password = data.get('pass', None)
key = ''.join(choice(letters + digits) for i in range(64))
cuser_id = request.user.id
pwc = ChangePassword.objects.create_confirmation(password, key, cuser_id)
email = request.user.email
activate_link = '%s:%s' %(request.META['SERVER_NAME'], request.META['SERVER_PORT'])
send_mail('Xlab Account: Password change confirmation link', 'Please use the link to confirm the password change on your account: %s/account/change_password?key=%s'%(account_server, key), from_address, [email])
context = {}
context['SiteName'] = settings.SITE_NAME
context['SiteTitle'] = 'Xlab'
context['navbar'] = 'account_nav.html'
context['application'] = 'summary'
context['notify'] = 'Confirmation link has been sent to your registered email address'
return render(request, "account/change-password.html", context)
else:
errors = []
if not request.GET.get('key', ''):
errors.append('Missing "key"')
response = HttpResponse("Error: %s"% errors)
try:
key = request.GET.get('key', '')
cuser_id = request.GET.get('')
passwd = ChangePassword.objects.get(activation_key=key)
user = User.objects.get(id=passwd.user_id)
user.set_password(passwd.password)
user.save()
except:
return HttpResponse("No active task for %s. Please try again" % key)
return HttpResponse("Hey %s" % key)
@login_required
def change_email(request):
# Create temporary object as in temp user
# User will follow the link to get the change on the reqested address
pass
|
import argparse
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from os import listdir
from os.path import isfile, join
font = {'size' : 12}
matplotlib.rc('font', **font)
def get_args():
parser = argparse.ArgumentParser('python')
parser.add_argument('-mpi_input_dir',
required=False,
default='/home/nanmiao/Documents/plot_hpx/Jan_2022_data/Jan_06/Jan_06_mpi_others/',
help='')
parser.add_argument('-hpx_input_dir',
required=False,
default='/home/nanmiao/Documents/plot_hpx/Jan_2022_data/Jan_06/Jan_06_hpx_distributed_jemalloc_hpx_local_tcmalloc/',
help='')
parser.add_argument('-mpi_output_dir',
required=False,
default='/home/nanmiao/Documents/plot_hpx/Jan_2022_data/Jan_06/2022_0107_mpi_others_stencil_1d.csv',
help='')
parser.add_argument('-hpx_output_dir',
required=False,
default='/home/nanmiao/Documents/plot_hpx/Jan_2022_data/Jan_06/2022_0107_hpx_stencil_1d.csv',
help='')
return parser.parse_args()
##########################################################################
def parse_result(file_path, df, ncpu, framwork):
with open(file_path, 'r') as f:
lines = f.readlines()
lines = [line.strip() for line in lines]
temp = []
for i, line in enumerate(lines):
line = line.split(' ')
if line[0] == 'Elapsed' and line[1] == 'Time':
elapsed = float(line[2])
temp.append(elapsed)
elif line[0] == 'FLOP/s':
flops = float(line[1])
temp.append(flops)
elif line[0] == "using" and line[1] == "iter:":
iter = int(lines[i+1].strip(','))
temp.append(iter)
if len(temp) == 3:
temp = [framwork, ncpu] + temp
df.loc[len(df.index)] = temp
temp = []
###############################################################################
def plot_err_band_all_1node(charm, mpi_non, mpi_bulk, mpi_openmp, hpx_jemalloc,
hpx_local_tcmalloc, openmp):
dfs = pd.concat([charm, mpi_non, mpi_bulk, mpi_openmp, hpx_jemalloc,
hpx_local_tcmalloc, openmp], ignore_index = True)
ax=sns.lineplot(x='iter',y='flops', data=dfs, sort=False,
#markers=['d','o','s','X', '<'],
markers=True,
style='framework',hue='framework',ci=99,
dashes=True,
linewidth=3, markersize=10)
ax.set_xscale('log',base=2)
ax.set_xlim(1<<6, 1<<24)
ax.set_ylabel('FLOP/s')
ax.set_xlabel('Problem Size (Iterations)')
plt.title('Stencil Rostam 1 node')
ax.legend(fontsize = 12, loc = 'lower right', fancybox = False, framealpha = 1,
handlelength = 1.7, ncol = 1)
plt.show()
###############################################################################
def plot_err_band_all_2_node(charm, mpi_non, mpi_bulk, mpi_openmp, hpx_jemalloc):
dfs = pd.concat([charm, mpi_non, mpi_bulk, mpi_openmp, hpx_jemalloc], ignore_index = True)
ax=sns.lineplot(x='iter',y='flops', data=dfs, sort=False,
#markers=['d','o','s','X', '<'],
markers=True,
style='framework',hue='framework',ci=99,
dashes=True,
linewidth=3, markersize=10)
ax.set_xscale('log',base=2)
ax.set_xlim(1<<6, 1<<24)
ax.set_ylabel('FLOP/s')
ax.set_xlabel('Problem Size (Iterations)')
plt.title('Stencil Rostam 2 nodes')
ax.legend(fontsize = 12, loc = 'lower right', fancybox = False, framealpha = 1,
handlelength = 1.7, ncol = 1)
plt.show()
###############################################################################
def plot_err_band_all_4_node(charm, mpi_non, mpi_bulk, mpi_openmp, hpx_jemalloc):
dfs = pd.concat([charm, mpi_non, mpi_bulk, mpi_openmp, hpx_jemalloc], ignore_index = True)
ax=sns.lineplot(x='iter',y='flops', data=dfs, sort=False,
#markers=['d','o','s','X', '<'],
markers=True,
style='framework',hue='framework',ci=99,
dashes=True,
linewidth=3, markersize=10)
ax.set_xscale('log',base=2)
ax.set_xlim(1<<6, 1<<24)
ax.set_ylabel('FLOP/s')
ax.set_xlabel('Problem Size (Iterations)')
plt.title('Stencil Rostam 4 nodes')
ax.legend(fontsize = 12, loc = 'lower right', fancybox = False, framealpha = 1,
handlelength = 1.7, ncol = 1)
plt.show()
###############################################################################
def plot_err_band_all_8_node(charm, mpi_non, mpi_bulk, mpi_openmp, hpx_jemalloc):
dfs = pd.concat([charm, mpi_non, mpi_bulk, mpi_openmp, hpx_jemalloc], ignore_index = True)
ax=sns.lineplot(x='iter',y='flops', data=dfs, sort=False,
#markers=['d','o','s','X', '<'],
markers=True,
style='framework',hue='framework',ci=99,
dashes=True,
linewidth=3, markersize=10)
ax.set_xscale('log',base=2)
ax.set_xlim(1<<6, 1<<24)
ax.set_ylabel('FLOP/s')
ax.set_xlabel('Problem Size (Iterations)')
plt.title('Stencil Rostam 8 nodes')
ax.legend(fontsize = 12, loc = 'lower right', fancybox = False, framealpha = 1,
handlelength = 1.7, ncol = 1)
plt.show()
###############################################################################
if __name__ == '__main__':
args = get_args()
mpi_input_dir = args.mpi_input_dir
mpi_output_dir = args.mpi_output_dir
hpx_input_dir = args.hpx_input_dir
hpx_output_dir = args.hpx_output_dir
###################################################################################
# get charm++ data
df_charm = pd.read_csv('/home/nanmiao/Documents/plot_hpx/2021-10-22_stencil_1d.csv')
df_charm=df_charm.sort_values(by='NITER',ascending=False)
df_charm['Framework'] = 'Charm++'
df_charm.rename(columns={"NCPU": "ncpu", "NITER": "iter", "FLOPS": "flops", "Framework": "framework"}, inplace=True)
charm_1node = df_charm[df_charm['ncpu'] == 48]
charm_2node = df_charm[df_charm['ncpu'] == 96]
charm_4node = df_charm[df_charm['ncpu'] == 192]
charm_8node = df_charm[df_charm['ncpu'] == 384]
charm_1node['framework'] = 'Charm++ 1 node'
charm_2node['framework'] = 'Charm++ 2 node'
charm_4node['framework'] = 'Charm++ 4 node'
charm_8node['framework'] = 'Charm++ 8 node'
###################################################################################
# read all mpi and hpx
all_other_files = [f for f in listdir(mpi_input_dir) if isfile(join(mpi_input_dir, f))]
all_hpx_files = [f for f in listdir(hpx_input_dir) if isfile(join(hpx_input_dir, f))]
###################################################################################
# mpi, openmp, mpi_openmp
df = pd.DataFrame(columns=['framework', 'ncpu', 'iter', 'elapsed', 'flops'])
for f in sorted(all_other_files):
f_split = f.split("-")
n = len(f_split)
idx = n - 2
framework = f_split[0:idx]
framework = "-".join(framework)
ncpu = 48 * int(f_split[idx][0])
parse_result(join(mpi_input_dir, f), df, ncpu, framework)
df.to_csv(mpi_output_dir, index=False)
mpi_nonblock_1node = df[(df['framework']== 'mpi-non') & (df['ncpu'] == 48 * 1) ]
mpi_nonblock_2node = df[(df['framework']== 'mpi-non') & (df['ncpu'] == 48 * 2) ]
mpi_nonblock_4node = df[(df['framework']== 'mpi-non') & (df['ncpu'] == 48 * 4) ]
mpi_nonblock_8node = df[(df['framework']== 'mpi-non') & (df['ncpu'] == 48 * 8) ]
mpi_nonblock_1node['framework'] = 'MPI nonblock 1 node'
mpi_nonblock_2node['framework'] = 'MPI nonblock 2 nodes'
mpi_nonblock_4node['framework'] = 'MPI nonblock 4 nodes'
mpi_nonblock_8node['framework'] = 'MPI nonblock 8 nodes'
mpi_bulk_1node = df[(df['framework']== 'mpi-bulk') & (df['ncpu'] == 48 * 1) ]
mpi_bulk_2node = df[(df['framework']== 'mpi-bulk') & (df['ncpu'] == 48 * 2) ]
mpi_bulk_4node = df[(df['framework']== 'mpi-bulk') & (df['ncpu'] == 48 * 4) ]
mpi_bulk_8node = df[(df['framework']== 'mpi-bulk') & (df['ncpu'] == 48 * 8) ]
mpi_bulk_1node['framework'] = 'MPI bulk sync 1 node'
mpi_bulk_2node['framework'] = 'MPI bulk sync 2 nodes'
mpi_bulk_4node['framework'] = 'MPI bulk sync 4 nodes'
mpi_bulk_8node['framework'] = 'MPI bulk sync 8 nodes'
mpi_openmp_1node = df[(df['framework']== 'mpi-openmp') & (df['ncpu'] == 48 * 1) ]
mpi_openmp_2node = df[(df['framework']== 'mpi-openmp') & (df['ncpu'] == 48 * 2) ]
mpi_openmp_4node = df[(df['framework']== 'mpi-openmp') & (df['ncpu'] == 48 * 4) ]
mpi_openmp_8node = df[(df['framework']== 'mpi-openmp') & (df['ncpu'] == 48 * 8) ]
mpi_openmp_1node['framework'] = 'MPI-OpenMP 1 node'
mpi_openmp_2node['framework'] = 'MPI-OpenMP 2 nodes'
mpi_openmp_4node['framework'] = 'MPI-OpenMP 4 nodes'
mpi_openmp_8node['framework'] = 'MPI-OpenMP 8 nodes'
openmp = df[(df['framework']== 'openmp') & (df['ncpu'] == 48 * 1) ]
openmp['framework'] = 'OpenMP 1 node'
###################################################################################
# hpx distributed using jemalloc (plain MPI); hpx local using tcmalloc
df = pd.DataFrame(columns=['framework', 'ncpu', 'iter', 'elapsed', 'flops'])
for f in sorted(all_hpx_files):
f_split = f.split("-")
n = len(f_split)
idx = n - 2
framework = f_split[0:idx]
framework = "-".join(framework)
ncpu = 48 * int(f_split[idx][0])
parse_result(join(hpx_input_dir, f), df, ncpu, framework)
df.to_csv(hpx_output_dir, index=False)
hpx_jemalloc_1node = df[(df['framework']== 'hpx-plainmpi-join') & (df['ncpu'] == 48 * 1) ]
hpx_jemalloc_2node = df[(df['framework']== 'hpx-plainmpi-join') & (df['ncpu'] == 48 * 2) ]
hpx_jemalloc_4node = df[(df['framework']== 'hpx-plainmpi-join') & (df['ncpu'] == 48 * 4) ]
hpx_jemalloc_8node = df[(df['framework']== 'hpx-plainmpi-join') & (df['ncpu'] == 48 * 8) ]
hpx_jemalloc_1node['framework'] = 'HPX distributed 1 node'
hpx_jemalloc_2node['framework'] = 'HPX distributed 2 nodes'
hpx_jemalloc_4node['framework'] = 'HPX distributed 4 nodes'
hpx_jemalloc_8node['framework'] = 'HPX distributed 8 nodes'
hpx_local_tcmalloc_1node = df[(df['framework']== 'hpx-local-join') & (df['ncpu'] == 48 * 1) ]
hpx_local_tcmalloc_1node['framework'] = 'HPX local 1 node'
plot_err_band_all_1node(charm_1node, mpi_nonblock_1node, mpi_bulk_1node, mpi_openmp_1node, hpx_jemalloc_1node,
hpx_local_tcmalloc_1node, openmp)
plot_err_band_all_2_node(charm_2node, mpi_nonblock_2node, mpi_bulk_2node, mpi_openmp_2node, hpx_jemalloc_2node)
plot_err_band_all_4_node(charm_4node, mpi_nonblock_4node, mpi_bulk_4node, mpi_openmp_4node, hpx_jemalloc_4node)
plot_err_band_all_8_node(charm_8node, mpi_nonblock_8node, mpi_bulk_8node, mpi_openmp_8node, hpx_jemalloc_8node)
|
#<pycode_BC695(py_netnode)>
netnode.alt1st = netnode.altfirst
netnode.alt1st_idx8 = netnode.altfirst_idx8
netnode.altnxt = netnode.altnext
netnode.char1st = netnode.charfirst
netnode.char1st_idx8 = netnode.charfirst_idx8
netnode.charnxt = netnode.charnext
netnode.hash1st = netnode.hashfirst
netnode.hashnxt = netnode.hashnext
netnode.sup1st = netnode.supfirst
netnode.sup1st_idx8 = netnode.supfirst_idx8
netnode.supnxt = netnode.supnext
#</pycode_BC695(py_netnode)>
|
# -*- coding: utf-8 -*-
""" Module for interfacing decomp++ with cmf (Versions of late Oct. 2009) """
from __future__ import division, print_function, absolute_import, unicode_literals
import decomp
import numpy as np
class CmfConnector(object):
"""Class for creating decomp++ instances for each layer in a cmf cell
"""
def __init__(self, cmf_cell, T_avg, max_Corg_depth=1e308):
"""
Creates the interface for a cell from cmf
max_Corg_depth [m] can be used to limit the number of layers
owning decomp instances. Only layers whose upper boundary is
less than max_Corg_depth get decomp models
:param cmf_cell: A cmf cell with layers
:param T_avg: The yearly average temperature in deg C
:param max_Corg_depth: The lower boundary of Corg
"""
c = cmf_cell
self.cmf_cell = cmf_cell
self.__decomplayers = [decomp.SOM() for l in c.layers
if l.upper_boundary < max_Corg_depth]
self.T_profile = np.ones(c.layer_count()) * T_avg
self.T_depth = 2.0
self.pH = 7.0
def depose_litter(self, leave_mass, wood_mass):
"""Deposes leaves and wood at the first layer
leave_mass = Fallen leaves in g/m2
wood_mass = Fallen wood in g/m2
"""
self.__decomplayers[0] += leave_mass * decomp.leave_litter()
self.__decomplayers[0] += wood_mass * decomp.wood_litter()
def depose_root(self, root_mass):
for i in range(len(self.__decomplayers)):
self.__decomplayers[i] += root_mass[i] * decomp.root_litter()
def plow(self, plowdepth=0.3):
"""Homogenizes the Corg content in all layers where the upper boundary
is smaller than the plow depth
"""
plowlayers = [
l for l in self.cmf_cell.layers if l.upper_boundary < plowdepth - 0.01]
sumSOM = decomp.SOM()
for l in plowlayers:
sumSOM += self[l]
sumdepth = sum(l.thickness for l in plowlayers)
for l in plowlayers:
self[l] = sumSOM * (l.thickness / sumdepth)
def __getitem__(self, index):
if hasattr(index, "Position"):
return self.__decomplayers[index.Position]
else:
return self.__decomplayers[index]
def __setitem__(self, index, SOM):
if hasattr(index, "Position"):
self.__decomplayers[index.Position] = SOM
else:
self.__decomplayers[index] = SOM
def __iter__(self):
return iter(self.__decomplayers)
def __getCpool(self):
"""Returns the mass of carbon stored
"""
return [l.C for l in self.__decomplayers]
def __setCpool(self, value):
for i, l in enumerate(self.__decomplayers):
if (i < len(value)):
l[decomp.RC] = value[i]
l.N = value[i] / 20.
else:
l[decomp.RC] = 0.0
Cpool = property(__getCpool, __setCpool, "Mass of carbon per m²")
def run(self, T, dt=1 / 24):
"""Runs the decomp model for time step dt (a float in days)
"""
N, DOC = self.cmf_cell.project.solutes
for i, l in enumerate(self.cmf_cell.layers):
if i + 1 > len(self.__decomplayers):
break
# field capacity
fieldcapacity = l.soil.Wetness_pF([1.8])[0]
# set wetness of decomp layer
wetness = min(1, l.wetness / fieldcapacity)
# get T damping factor
fT = 365**(-l.upper_boundary / self.T_depth)
# set Temperature of layer
self.T_profile[i] = fT * T + (1 - fT) * self.T_profile[i]
# set DOC input
# DOC precipitation currently disabled
self.__decomplayers[i][decomp.DOC] = l[DOC].state
# Integrate the decomp
decomp_rate = self.__decomplayers[i].integrate(dt, self.T_profile[i], wetness, self.pH)
# Update cmf
l[N].source = decomp_rate.N
l[DOC].source = decomp_rate[decomp.DOC]
|
from kuri_edu import PowerMonitor
import threading
import mobile_base_driver.msg
import fakerospy
import maytest
class TestPowerMonitor(maytest.TestBase):
def setUp(self):
super(TestPowerMonitor, self).setUp()
self.patch("kuri_edu.power_monitor.rospy", fakerospy)
self.power_pub = fakerospy.Publisher(
"mobile_base/power",
mobile_base_driver.msg.Power
)
def test_ctor_event_hookups(self):
dock_changed = threading.Event()
charging_changed = threading.Event()
dut = PowerMonitor(
dock_changed_cb=lambda x: dock_changed.set(),
charging_changed_cb=lambda x: charging_changed.set()
)
self.addCleanup(dut.shutdown)
self.power_pub.publish(
mobile_base_driver.msg.Power(
dock_present=True
)
)
self.assertTrue(dock_changed.is_set())
self.assertFalse(charging_changed.is_set())
self.power_pub.publish(
mobile_base_driver.msg.Power(
dock_present=True,
is_charging=True,
)
)
self.assertTrue(dock_changed.is_set())
self.assertTrue(charging_changed.is_set())
|
import copy
import sys
sys.path.append("../URP")
from utils import *
from tqdm import tqdm
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from sklearn.svm import SVC
def parameter_count(model):
count=0
for p in model.parameters():
count+=np.prod(np.array(list(p.shape)))
print(f'Total Number of Parameters: {count}')
def vectorize_params(model):
param = []
for p in model.parameters():
param.append(p.data.view(-1).cpu().numpy())
return np.concatenate(param)
def print_param_shape(model):
for k,p in model.named_parameters():
print(k,p.shape)
def copy_params(model, model0):
for p in model.parameters():
p.data0 = p.data.clone()
for p in model0.parameters():
p.data0 = p.data.clone()
def get_pdf(p, num_classes, is_base_dist=False, alpha=3e-6):
var = copy.deepcopy(1./(p.grad2_acc+1e-8))
var = var.clamp(max=1e3)
if p.size(0) == num_classes:
var = var.clamp(max=1e2)
var = alpha * var
if p.ndim > 1:
var = var.mean(dim=1, keepdim=True).expand_as(p).clone()
if not is_base_dist:
mu = copy.deepcopy(p.data0.clone())
else:
mu = copy.deepcopy(p.data0.clone())
if p.size(0) == num_classes and num_to_forget is None:
mu[class_to_forget] = 0
var[class_to_forget] = 0.0001
if p.size(0) == num_classes:
# Last layer
var *= 10
elif p.ndim == 1:
# BatchNorm
var *= 10
# var*=1
return mu, var
def l2_distance(weights, weights_retrain):
l2 = np.sum(weights**2 - weights_retrain**2)
l2 = np.sqrt(l2)
return l2
def kl_divergence(mu0, var0, mu1, var1):
return ((mu1 - mu0).pow(2)/var0 + var1/var0 - torch.log(var1/var0) - 1).sum()
'''
def kl_divergence(p, q):
return np.sum(p[i] * np.log2(p[i]/q[i]) for i in range(len(p)))
'''
def get_variance(model1, model2, alpha):
delta_w_s = []
delta_w_m0 = []
for i, (k, p) in enumerate(model1.named_parameters()):
mu, var = get_pdf(p, False, alpha=alpha)
delta_w_s.append(var.view(-1))
for i, (k, p) in enumerate(model2.named_parameters()):
mu, var = get_pdf(p, False, alpha=alpha)
delta_w_m0.append(var.view(-1))
return torch.cat(delta_w_s), torch.cat(delta_w_m0)
def get_metrics(model,dataloader,criterion, lossfn='ce', dataset='cifar10', samples_correctness=False,use_bn=False,delta_w=None,scrub_act=False, device='cuda'):
activations=[]
predictions=[]
if use_bn:
model.train()
dataloader = torch.utils.data.DataLoader(retain_loader.dataset, batch_size=128, shuffle=True)
for i in range(10):
for batch_idx, (data, target) in enumerate(dataloader):
data, target = data.to(device), target.to(device)
output = model(data)
dataloader = torch.utils.data.DataLoader(dataloader.dataset, batch_size=1, shuffle=False)
model.eval()
metrics = AverageMeter()
mult = 0.5 if lossfn=='mse' else 1
for batch_idx, (data, target) in enumerate(dataloader):
data, target = data.to(device), target.to(device)
if lossfn=='mse':
target=(2*target-1)
target = target.type(torch.cuda.FloatTensor).unsqueeze(1)
if 'mnist' in dataset:
data=data.view(data.shape[0],-1)
output = model(data)
loss = mult*criterion(output, target)
if samples_correctness:
activations.append(torch.nn.functional.softmax(output,dim=1).cpu().detach().numpy().squeeze())
predictions.append(get_error(output,target))
metrics.update(n=data.size(0), loss=loss.item(), error=get_error(output, target))
if samples_correctness:
return metrics.avg, np.stack(activations), np.array(predictions)
else:
return metrics.avg
def get_error(output, target):
if output.shape[1]>1:
pred = output.argmax(dim=1, keepdim=True)
return 1. - pred.eq(target.view_as(pred)).float().mean().item()
else:
pred = output.clone()
pred[pred>0]=1
pred[pred<=0]=-1
return 1 - pred.eq(target.view_as(pred)).float().mean().item()
def save_dict(m0_name, log_dict):
np.save(f"logs/{m0_name.split('/')[1].split('.')[0]}.npy", log_dict)
def hessian(dataset, model, device='cuda'):
model.eval()
train_loader = torch.utils.data.DataLoader(dataset, batch_size=1, shuffle=False)
loss_fn = nn.CrossEntropyLoss()
for p in model.parameters():
p.grad_acc = 0
p.grad2_acc = 0
for data, orig_target in tqdm(train_loader):
data, orig_target = data.to(device), orig_target.to(device)
output = model(data)
prob = F.softmax(output, dim=-1).data
for y in range(output.shape[1]):
target = torch.empty_like(orig_target).fill_(y)
loss = loss_fn(output, target)
model.zero_grad()
loss.backward(retain_graph=True)
for p in model.parameters():
if p.requires_grad:
p.grad_acc += (orig_target == target).float() * p.grad.data
p.grad2_acc += prob[:, y] * p.grad.data.pow(2)
for p in model.parameters():
p.grad_acc /= len(train_loader)
p.grad2_acc /= len(train_loader)
'''
def delta_w_utils(model_init, dataloader, lossfn, dataset, num_classes, model, name='complete'):
model_init.eval()
dataloader = torch.utils.data.DataLoader(dataloader.dataset, batch_size=1, shuffle=False)
G_list = []
f0_minus_y = []
for idx, batch in enumerate(dataloader):#(tqdm(dataloader,leave=False)):
batch = [tensor.to(next(model_init.parameters()).device) for tensor in batch]
input, target = batch
if 'mnist' in dataset:
input = input.view(input.shape[0],-1)
target = target.cpu().detach().numpy()
output = model_init(input)
G_sample=[]
for cls in range(num_classes):
grads = torch.autograd.grad(output[0,cls],model_init.parameters(),retain_graph=True)
grads = np.concatenate([g.view(-1).cpu().numpy() for g in grads])
G_sample.append(grads)
G_list.append(grads)
if lossfn=='mse':
p = output.cpu().detach().numpy().transpose()
#loss_hess = np.eye(len(p))
target = 2*target-1
f0_y_update = p-target
elif lossfn=='ce':
p = torch.nn.functional.softmax(output,dim=1).cpu().detach().numpy().transpose()
p[target]-=1
f0_y_update = model.deepcopy(p)
f0_minus_y.append(f0_y_update)
return np.stack(G_list).transpose(), np.vstack(f0_minus_y)
'''
|
"""
Render slices through a volume, by uploading to a 2D texture.
Simple and ... slow.
"""
import imageio
from wgpu.gui.auto import WgpuCanvas, run
import pygfx as gfx
canvas = WgpuCanvas()
renderer = gfx.renderers.WgpuRenderer(canvas)
scene = gfx.Scene()
vol = imageio.volread("imageio:stent.npz").astype("float32") / 2000
nslices = vol.shape[0]
index = nslices // 2
im = vol[index].copy()
tex = gfx.Texture(im, dim=2)
geometry = gfx.plane_geometry(200, 200, 12, 12)
material = gfx.MeshBasicMaterial(map=tex.get_view(filter="linear"))
plane = gfx.Mesh(geometry, material)
scene.add(plane)
camera = gfx.OrthographicCamera(200, 200)
@renderer.add_event_handler("wheel")
def handle_event(event):
global index
index = index + int(event.dy / 90)
index = max(0, min(nslices - 1, index))
im = vol[index]
tex.data[:] = im
tex.update_range((0, 0, 0), tex.size)
canvas.request_draw()
if __name__ == "__main__":
canvas.request_draw(lambda: renderer.render(scene, camera))
run()
|
import unittest
from test_text_aug import TestTextAug
from test_time_parser import TestTimeParser
from test_location_parser import TestLocationParser
from test_idiom_solitaire import TestIdiomSolitaire
from test_money_parser import TestMoneyParser
from test_time_extractor import TestTimeExtractor
from test_money_extractor import TestMoneyExtractor
from test_remove_url import TestRemoveUrl
from test_remove_email import TestRemoveEmail
from test_remove_phone_number import TestRemovePhoneNumber
if __name__ == '__main__':
suite = unittest.TestSuite()
tests = [
TestTimeParser('test_time_parser'), # 测试 时间解析
TestLocationParser('test_location_parser'), # 测试 地址解析
TestTextAug('test_ReplaceEntity'), # 测试 实体替换增强
TestIdiomSolitaire('test_idiom_solitaire'), # 测试 成语接龙
TestMoneyParser('test_money_parser'), # 测试 金额抽取与规范化
TestTimeExtractor('test_time_extractor'), # 测试 时间实体抽取
TestMoneyExtractor('test_money_extractor'), # 测试 货币金额实体抽取
TestRemoveUrl('test_remove_url'), # 测试 清洗文本中的超链接
TestRemoveEmail('test_remove_email'), # 测试 清洗文本中的 email
TestRemovePhoneNumber('test_remove_phone_number') # 测试 清洗文本中的电话号码
]
suite.addTests(tests)
runner = unittest.TextTestRunner(verbosity=1)
runner.run(suite)
|
from flask.ext.wtf.recaptcha import fields
from flask.ext.wtf.recaptcha import validators
from flask.ext.wtf.recaptcha import widgets
__all__ = fields.__all__ + validators.__all__ + widgets.__all__
|
import argparse
import torch
import torch.nn
import torchaudio
import numpy
import preprocess
import utils
from test import inference_an_input
from pathlib import Path
from mir_eval.separation import bss_eval_sources
def evaluate(model_paths: list[str], in_dir: str, n_fft: int, win_length: int,
hop_length: int, sample_rate: int, n_frame_in_segment: int,
batch_size: int, resample: bool) -> None:
"""Using the same matircs as https://www.music-ir.org/mirex/wiki/2019:Singing_Voice_Separation
Args:
model_paths: use model_path[i] to separate ith channel
"""
models = [utils.load_model(model_path) for model_path in model_paths]
n_models = len(models)
accum_NSDR, accum_SIR, accum_SAR, n_files = numpy.zeros(n_models), numpy.zeros(n_models), numpy.zeros(n_models), 0
in_dir = Path(in_dir)
if not in_dir.exists():
raise FileNotFoundError(f'Not a correct directory path')
for f in in_dir.iterdir():
if not utils.is_extension_supported(f):
continue
ground_truth, orig_sample_rate = torchaudio.load(f)
if resample:
ground_truth = preprocess.resample_wav(ground_truth, orig_sample_rate, sample_rate)
n_channels = ground_truth.shape[0]
if n_channels != n_models:
continue
preds = [
inference_an_input(model,
f,
n_frame_in_segment,
n_fft,
win_length,
hop_length,
sample_rate,
batch_size,
resample,
save_file=False).squeeze(0).numpy() for model in models
]
mono_ground_truth = preprocess.mix_channels(ground_truth).squeeze(0).numpy()
ground_truth = ground_truth.numpy()
SDR, SIR, SAR, _ = bss_eval_sources(ground_truth, numpy.array(preds))
NSDR, _, _, _ = bss_eval_sources(ground_truth, numpy.array([mono_ground_truth, mono_ground_truth]))
NSDR = SDR - NSDR
accum_NSDR += NSDR
accum_SIR += SIR
accum_SAR += SAR
n_files += 1
GNSDR = accum_NSDR / n_files
GSIR = accum_SIR / n_files
GSAR = accum_SAR / n_files
for i in range(n_models):
print(f'Channel {i}:')
print(f'GNSDR: {GNSDR[i]:.4f}')
print(f'GSIR: {GSIR[i]:.4f}')
print(f'GSAR: {GSAR[i]:.4f}')
if __name__ == '__main__':
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--model-paths', type=str, required=True, nargs='+', help='paths of models used for the inference for each channel')
parser.add_argument('--in-dir', type=str, required=True, help='path of the input dir')
parser.add_argument('--n-fft', type=int, default=2048, help='number of fft (argument for stft)')
parser.add_argument('--win-length', type=int, default=2048, help='window length (argument for stft)')
parser.add_argument('--hop-length', type=int, default=512, help='hop length (argument for stft)')
parser.add_argument('--sample-rate', type=int, default=16000, help='sample rate to resample input wav file')
parser.add_argument('--n-frame-in-segment', type=int, default=15, help='number of frames of spectrogram of a 2D segment')
parser.add_argument('--batch-size', type=int, default=64, help='number of segments in a batch')
parser.add_argument('--resample', type=bool, default=True, help='to resample input or not')
args = vars(parser.parse_args())
evaluate(**args)
|
from django.db import connection
from django_elasticsearch_dsl import Index
class MultiTenantIndex(Index):
@property
def _name(self):
if connection.tenant.schema_name != 'public':
return '{}-{}'.format(connection.tenant.schema_name, self.__name)
return self.__name
@_name.setter
def _name(self, value):
if value and value.startswith(connection.tenant.schema_name):
value = value.replace(connection.tenant.schema_name + '-', '')
self.__name = value
|
import re
import pandas as pd
import matplotlib.pyplot as plt
from .auto_set_dtypes import auto_set_dtypes
# from auto_set_dtypes import auto_set_dtypes # local only
def load_dataset(name, **kws):
'''
maybe cache in the future https://github.com/mwaskom/seaborn/blob/master/seaborn/utils.py
'''
if name == 'titanic_raw':
filename = 'titanic'
else:
filename = name
full_path = f'https://raw.githubusercontent.com/tll549/TEF/master/data/{filename}.csv'
df = pd.read_csv(full_path, **kws)
if name == 'titanic':
df = auto_set_dtypes(df, set_object=['passenger_id'], verbose=0)
return df
def reorder_col(df, to_move, after=None, before=None):
assert after is not None or before is not None, 'need sth'
cols = df.columns.tolist()
assert to_move in cols, f'{to_move} not in column names'
cols = [x for x in cols if x != to_move] # remove to_move
# insert back
if after:
assert after in cols, f'{after} not in column names'
cols.insert(cols.index(after)+1, to_move)
elif before:
assert before in cols, f'{before} not in column names'
cols.insert(cols.index(before), to_move)
return df[cols]
def rename_cols_by_words(df, words=[], mapper={}, verbose=1):
'''replace white space as _, make sure words are separated by _, lower case all'''
df2 = df.copy()
no_change = []
if len(mapper) > 0:
df2 = df2.rename(columns=mapper)
for c in range(df2.shape[1]):
cn_original = df2.columns[c]
cn = cn_original.lower()
if cn not in list(mapper.keys()):
if ' ' in cn:
df2.rename(columns={cn_original: cn.replace(' ', '_')}, inplace=True)
for w in words:
if w in cn: # if abwcd, wabcd, abcdw, becomes ab_w_cd, w_abcd, abcd_w
if re.search('^'+w, cn):
if not re.search('^'+w+'_', cn): # wabcd, not w_abcd
cn = cn.replace(w, w+'_')
elif re.search(w+'$', cn):
if not re.search('_'+w+'$', cn): # abcdw, not abcd_w
cn = cn.replace(w, '_'+w)
else: # abwcd or ab_wcd or abw_cd
if re.search('_'+w, cn) and not re.search(w+'_', cn): # ab_wcd
cn = cn.replace(w, w+'_')
elif re.search(w+'_', cn) and not re.search('_'+w, cn): # abw_cd
cn = cn.replace(w, '_'+w)
elif not re.search(w+'_', cn) and not re.search('_'+w, cn): # abwcd
cn = cn.replace(w, '_'+w+'_')
df2.rename(columns={cn_original: cn}, inplace=True)
if verbose > 0:
if df.columns[c] != df2.columns[c]:
print(f'{c:<3}, {df.columns[c]:25} -> {df2.columns[c]:25}')
else:
no_change.append(c)
if verbose > 1:
if len(no_change) > 0:
print("didn't changed:", [df2.columns[c] for c in no_change])
return df2
def ct(s1, s2, style=True, col_name=None, sort=False, head=False):
'''
crosstab count and percentage
sort should be using the same name as col_name
it is always
row sums to 1, which is s1
total counts only on row
color background by columns
'''
# to avoid s1 or s2 is a condition
if s1.name is None:
s1.name = 's1'
if s2.name is None:
s2.name = 's2'
c1 = pd.crosstab(s1, s2, margins=True)
c2 = pd.crosstab(s1, s2, normalize='index')*100
if col_name is not None:
c1.columns = col_name + ['All']
c2.columns = col_name
o = pd.concat([c1, c2], axis=1, keys=['count', 'proportion'], sort=False)
o.index.name = s1.name
o = o[o.index != 'All'] # remove the sum from margins for row, in order to style and sort
o.columns.names = [None, None]
# add a highest column name for s2
o = pd.concat([o], keys=[s2.name], names=[None], axis=1)
if sort:
if sort == True:
sort = (s2.name, 'count', 'All')
o = o.sort_values(sort, ascending=False)
if head:
o = o.head(head)
if style:
o = o.style.format('{:.0f}').background_gradient(axis=0)
return o
def set_relation(s1, s2, plot=True):
sr = pd.Series()
sr['s1 orig len'] = len(s1)
sr['s2 orig len'] = len(s2)
s1 = s1[s1.notnull()]
s2 = s2[s2.notnull()]
sr['s1 notnull len'] = len(s1)
sr['s2 notnull len'] = len(s2)
sr['s1 nunique'] = s1.nunique()
sr['s2 nunique'] = s2.nunique()
sr['union'] = len(set(s1) | set(s2))
sr['intersection'] = len(set(s1) & set(s2))
sr['in s1 only'] = len(set(s1) - set(s2))
sr['in s2 only'] = len(set(s2) - set(s1))
if plot:
sr_color = []
for n in sr.index:
if 's1' in n:
sr_color.append('darkblue')
elif 's2' in n:
sr_color.append('crimson')
else:
sr_color.append('purple')
ax = sr.plot.bar(color=sr_color)
for label in ax.get_xticklabels():
label.set_rotation(20)
label.set_ha('right')
totals = sr.value_counts(dropna=False).values
for i in ax.patches:
ax.text(i.get_x(), i.get_height(), f'{i.get_height()}')
ax.set(title=f'set relation between {s1.name} & {s2.name}')
plt.show()
return sr
def correspondence(s1, s2, verbose=1, fillna=True):
'''
credit: Chandra Kuma
[1,2,3,4,5]
[1,2,3,4,5]
'1:1': 5
[1,2,3,4,5]
[2,3,4,5,6]
'None': 5
[1,2,3,4,5]
[6,6,6,6,6]
'm:1': 5
[6,6,6,6,6]
[1,2,3,4,5]
'1:m': 5
'''
# imput nan, because nan != nan
if fillna and isinstance(s1, pd.core.series.Series):
s1 = s1.fillna('nan_filled')
s2 = s2.fillna('nan_filled')
def scan(s1, s2):
d = {}
for e1, e2 in zip(s1, s2):
if e1 not in d:
d[e1] = {e2: 1}
else:
if e2 not in d[e1]:
d[e1][e2] = 1
else:
d[e1][e2] += 1
return d
d1 = scan(s1, s2)
d2 = scan(s2, s1)
to_one_k1 = [k for k, v in d1.items() if len(v.keys())==1]
# one_to_k2 = [k for k, v in d2.items() if len(v.keys())==1]
one_to_k1 = [list(v.keys())[0] for k, v in d2.items() if len(v.keys())==1]
one_to_one_k1 = set(to_one_k1) & set(one_to_k1)
one_to_many_k1 = set(one_to_k1) - set(to_one_k1)
many_to_one_k1 = set(to_one_k1) - set(one_to_k1)
many_to_many_k1 = d1.keys() - one_to_one_k1 - one_to_many_k1 - many_to_one_k1
if verbose:
print(f'1-1 {len(one_to_one_k1)} {len(one_to_one_k1) / len(set(d1.keys())) *100:.0f}%, 1-m {len(one_to_many_k1)} {len(one_to_many_k1) / len(set(d1.keys())) *100:.0f}%, m-1 {len(many_to_one_k1)} {len(many_to_one_k1) / len(set(d1.keys())) *100:.0f}%, m-m {len(many_to_many_k1)} {len(many_to_many_k1) / len(set(d1.keys())) *100:.0f}%, total {len(set(d1.keys()))}')
return {'count_k1': {'total': len(set(d1.keys())),
# 'total_k2': len(set(d2.keys())),
'1-1': len(one_to_one_k1),
'1-m': len(one_to_many_k1),
'm-1': len(many_to_one_k1),
'm-m': len(many_to_many_k1)},
'k1': {'1-1': one_to_one_k1,
'1-m': one_to_many_k1,
'm-1': many_to_one_k1,
'm-m': many_to_many_k1}}
|
"""Class implementation for the rotation_around_point interface.
"""
from typing import Any
from typing import Dict
from apysc._animation.animation_rotation_around_point_interface import \
AnimationRotationAroundPointInterface
from apysc._type.dictionary import Dictionary
from apysc._type.int import Int
from apysc._type.revert_interface import RevertInterface
class RotationAroundPointInterface(
AnimationRotationAroundPointInterface, RevertInterface):
_rotation_around_point: Dictionary[str, Int]
def _initialize_rotation_around_point_if_not_initialized(self) -> None:
"""
Initialize the `_rotation_around_point` attribute if it hasn't
been initialized yet.
"""
if hasattr(self, '_rotation_around_point'):
return
self._rotation_around_point = Dictionary({})
def get_rotation_around_point(self, x: Int, y: Int) -> Int:
"""
Get a rotation value around the given coordinates.
Parameters
----------
x : Int
X-coordinate.
y : Int
Y-coordinate.
Returns
-------
rotation : Int
Rotation value around the given coordinates.
References
----------
- GraphicsBase rotate_around_point interfaces document
- https://bit.ly/37TDwKs
"""
import apysc as ap
with ap.DebugInfo(
callable_=self.get_rotation_around_point, locals_=locals(),
module_name=__name__, class_=RotationAroundPointInterface):
from apysc._display import rotation_interface_helper
from apysc._type.expression_string import ExpressionString
from apysc._validation import number_validation
number_validation.validate_integer(integer=x)
number_validation.validate_integer(integer=y)
self._initialize_rotation_around_point_if_not_initialized()
default_val: ap.Int = ap.Int(0)
key_exp_str: ExpressionString = rotation_interface_helper.\
get_coordinates_key_for_expression(
x=int(x._value), y=int(y._value))
rotation: ap.Int = self._rotation_around_point.get(
key=key_exp_str, default=default_val)
return rotation
def set_rotation_around_point(
self, rotation: Int, x: Int, y: Int) -> None:
"""
Update a rotation value around the given coordinates.
Parameters
----------
rotation : Int
Rotation value to set.
x : Int
X-coordinate.
y : Int
Y-coordinate.
References
----------
- GraphicsBase rotate_around_point interfaces document
- https://bit.ly/37TDwKs
"""
import apysc as ap
with ap.DebugInfo(
callable_=self.set_rotation_around_point, locals_=locals(),
module_name=__name__, class_=RotationAroundPointInterface):
from apysc._display import rotation_interface_helper
from apysc._type.expression_string import ExpressionString
from apysc._validation import number_validation
number_validation.validate_integer(integer=rotation)
number_validation.validate_integer(integer=x)
number_validation.validate_integer(integer=y)
self._initialize_rotation_around_point_if_not_initialized()
key_exp_str: ExpressionString = rotation_interface_helper.\
get_coordinates_key_for_expression(
x=int(x._value), y=int(y._value))
self._rotation_around_point._value[key_exp_str.value] = rotation
self._append_rotation_around_point_update_expression(
rotation=rotation, x=x, y=y)
def _append_rotation_around_point_update_expression(
self, *, rotation: Int, x: Int, y: Int) -> None:
"""
Append a rotation value around the given coordinates
updating expression.
Parameters
----------
rotation : Int
Rotation value to set.
x : Int
X-coordinate.
y : Int
Y-coordinate.
"""
import apysc as ap
with ap.DebugInfo(
callable_=self._append_rotation_around_point_update_expression, # noqa
locals_=locals(),
module_name=__name__, class_=RotationAroundPointInterface):
expression: str = \
self._get_rotation_around_point_updating_expression(
rotation=rotation, x=x, y=y)
ap.append_js_expression(expression=expression)
def _get_rotation_around_point_updating_expression(
self, *, rotation: Int, x: Int, y: Int) -> str:
"""
Get a rotation value around the given coordinates updating
expression string.
Parameters
----------
rotation : Int
Rotation value to set.
x : Int
X-coordinate.
y : Int
Y-coordinate.
Returns
-------
expression : str
A rotation value around the given coordinates updating
expression string.
"""
from apysc._display import rotation_interface_helper
from apysc._expression import expression_variables_util
from apysc._expression import var_names
from apysc._type import value_util
from apysc._type.expression_string import ExpressionString
self._initialize_rotation_around_point_if_not_initialized()
before_value_str: str = expression_variables_util.\
get_next_variable_name(type_name=var_names.INT)
key_exp_str: ExpressionString = rotation_interface_helper.\
get_coordinates_key_for_expression(x=x, y=y)
after_value_str: str = value_util.get_value_str_for_expression(
value=rotation)
x_value_str: str = value_util.get_value_str_for_expression(
value=x)
y_value_str: str = value_util.get_value_str_for_expression(
value=y)
rotation_around_point_value_str: str = value_util.\
get_value_str_for_expression(
value=self._rotation_around_point)
expression: str = (
f'if ({key_exp_str.value} in '
f'{rotation_around_point_value_str}) {{'
f'\n var {before_value_str} = '
f'{rotation_around_point_value_str}[{key_exp_str.value}];'
'\n}else {'
f'\n {before_value_str} = 0;'
'\n}'
f'\n{self.variable_name}.rotate('
f'-{before_value_str}, {x_value_str}, {y_value_str});'
f'\n{self.variable_name}.rotate('
f'{after_value_str}, {x_value_str}, {y_value_str});'
f'\n{rotation_around_point_value_str}[{key_exp_str.value}] = '
f'{after_value_str};'
)
return expression
_rotation_around_point_snapshots: Dict[str, Dict[str, Any]]
def _make_snapshot(self, *, snapshot_name: str) -> None:
"""
Make a value's snapshot.
Parameters
----------
snapshot_name : str
Target snapshot name.
"""
self._initialize_rotation_around_point_if_not_initialized()
self._set_single_snapshot_val_to_dict(
dict_name='_rotation_around_point_snapshots',
value={**self._rotation_around_point._value},
snapshot_name=snapshot_name)
def _revert(self, *, snapshot_name: str) -> None:
"""
Revert a value if snapshot exists.
Parameters
----------
snapshot_name : str
Target snapshot name.
"""
if not self._snapshot_exists(snapshot_name=snapshot_name):
return
self._rotation_around_point._value = \
self._rotation_around_point_snapshots[snapshot_name]
|
from copy import deepcopy
import numpy as np
import operator
def find_keys(dictionary, sep="~", k=[]):
aux = {}
keys = dictionary.keys()
for key in keys:
k.append(key)
if isinstance(dictionary[key], dict):
aux.update(find_keys(dictionary[key], "~", k))
else:
if sep.join(k) not in aux:
aux.update({sep.join(k): deepcopy(k)})
del k[-1]
return (aux)
def pretty_numeric(x, dec=3):
if isinstance(x, list):
lst = x
elif isinstance(x, float) or isinstance(x, int):
lst = [x]
else:
lst = list(x)
if len(lst) > 1:
return [round(i, dec) if not np.isnan(i) and not np.isinf(i) else None for i in lst]
elif len(lst) == 1:
return round(lst[0], dec) if not np.isnan(lst[0]) and not np.isinf(lst[0]) else None
else:
None
def getFromDict(dataDict, mapList):
return reduce(operator.getitem, mapList, dataDict)
def setInDict(dataDict, mapList, value):
if isinstance(value,dict):
getFromDict(dataDict, mapList[:-1])[mapList[-1]].update(value)
else:
getFromDict(dataDict, mapList[:-1])[mapList[-1]] = value
def unique(seq, idfun=None):
if idfun is None:
def idfun(x): return x
seen = {}
result = []
for item in seq:
marker = idfun(item)
if str(marker) in seen: continue
seen[str(marker)] = 1
result.append(item)
return result
def ensure_list(obj):
if isinstance(obj,list):
return obj
else:
return [obj]
def set_dict_from_list(dic, keys, value):
for key in keys[:-1]:
dic = dic.setdefault(key, {})
dic[keys[-1]] = value
|
from api.app import create_app, db
from api.models import User,user_schema, users_schema
from flask import request,redirect,jsonify
app = create_app()
@app.route("/api/v1/add", methods=['GET','POST'])
def create():
name = request.json["name"]
email = request.json["email"]
password = request.json["password"]
try:
user = User(name=name,email=email,password=password)
db.session.add(user)
db.session.commit()
created_user = User.query.filter_by(email=email).first()
except Exception as e:
print(f"Error {e}")
return user_schema.dump(created_user)
@app.route("/api/v1/<int:id>",methods=['GET','POST'])
def RetrieveSingleUser(id):
user = User.query.filter_by(id=id).first()
return user_schema.dump(user)
@app.route("/api/v1/users", methods=['GET','POST'])
def RetrieveSingleUsers():
users = User.query.all()
all_users = users_schema.dump(users)
return jsonify(all_users)
@app.route("/api/v1/<int:id>/update", methods=['GET','POST'])
def update(id):
user=User.query.filter_by(id=id).first()
if user:
name = request.json["name"]
email = request.json["email"]
# password = request.json["password"]
user.name = name
user.email = email
db.session.commit()
return user_schema.dump(user)
@app.route("/api/v1/<int:id>/delete", methods=['GET','POST'])
def delete(id):
user=User.query.filter_by(id=id).first()
if request.method == "POST":
if user:
db.session.delete(user)
db.session.commit()
return jsonify("User has been deleted")
# if __name__ == "__main__":
# app.run(debug=True)
|
# -*- encoding=utf8 -*-
__author__ = "eeorunix"
import time
import random
from airtest.core.api import *
from airtest.aircv import *
from airtest.core.settings import Settings as ST
ST.CVSTRATEGY = ["tpl"]
ST.THRESHOLD = 0.8
ST.SAVE_IMAGE = False
ST.RESIZE_METHOD = None
DEBUG = 0
import logging
logger = logging.getLogger("airtest")
if not DEBUG:
logger.setLevel(logging.ERROR)
auto_setup(__file__)
# 全局当前图片坐标中心点位置
XY = None
screen = None
start = time.time()
cnt = 0
def g(a, b, c):
# (767, 498), (767, 531), (868, 531)
res = (
max(0, a[0] - 20),
max(0, a[1] - 20),
c[0] + 20,
b[1] + 20
)
return res
def click(pos):
x, y = pos
a = random.randint(0, 4) - 2
b = random.randint(0, 4) - 2
touch((x + a, y + b))
sleep(0.2)
def is_found(template, rect=None):
global XY
global screen
logger.debug(str(template))
if rect is not None:
new_screen = aircv.crop_image(screen, rect)
XY = template.match_in(new_screen)
if XY is not None:
XY = (XY[0] + rect[0], XY[1] + rect[1])
else:
XY = template.match_in(screen)
return XY is not None
def wait_to(template, rect=None):
global screen
while 1:
screen = G.DEVICE.snapshot()
if is_found(template, rect):
return
sleep(0.2)
assert 0
def detach():
'''检索当前图片,更新全局坐标点,返回图片策略序号'''
global XY
global screen
global cnt
global start
screen = G.DEVICE.snapshot()
if is_found(Template(r"tpl1644856635384.png", record_pos=(0.41, -0.223), resolution=(1024, 576)), g((925, 51), (925, 70), (940, 70))):
return 0
elif is_found(Template(r"tpl1644856716623.png", target_pos=4, record_pos=(-0.354, -0.255), resolution=(1024, 576)), g((57, 12), (57, 43), (242, 43))):
return 0
elif is_found(Template(r"tpl1647070771440.png", record_pos=(0.029, -0.055), resolution=(1024, 576)), g((430, 204), (430, 261), (655, 261))):
return 0
elif is_found(Template(r"tpl1644764815224.png", threshold=0.97, target_pos=5, record_pos=(-0.479, -0.009), resolution=(1024, 665))):
return 0
elif is_found(Template(r"tpl1644771271544.png", record_pos=(-0.409, -0.074), resolution=(1024, 576)), g((61, 198), (61, 226), (125, 226))):
return 0
elif is_found(Template(r"tpl1644766848271.png", rgb=False, record_pos=(0.081, 0.097), resolution=(1024, 665)), g((537, 377), (537, 416), (653, 416))):
return 0
elif is_found(Template(r"tpl1644771347927.png", record_pos=(0.209, 0.047), resolution=(1024, 576)), g((648, 298), (648, 375), (805, 375))):
return 0
elif is_found(Template(r"tpl1647025537096.png", record_pos=(-0.307, -0.196), resolution=(1024, 576)), g((141, 68), (141, 107), (255, 107))):
return 3
elif is_found(Template(r"tpl1647025901008.png", record_pos=(-0.283, -0.194), resolution=(1024, 576)), g((145, 73), (145, 105), (299, 105))):
return 3
elif is_found(Template(r"tpl1644771635172.png", record_pos=(0.297, 0.185), resolution=(1024, 576)), g((771, 466), (771, 489), (862, 489))):
return 0
elif is_found(Template(r"tpl1644771405564.png", record_pos=(-0.198, -0.237), resolution=(1024, 576)), g((261, 21), (261, 69), (357, 69))):
return 2
elif is_found(Template(r"tpl1644771706558.png", record_pos=(-0.151, -0.247), resolution=(1024, 576)), g((338, 6), (338, 65), (377, 65))) and is_found(Template(r"tpl1644771774441.png", record_pos=(0.386, 0.221), resolution=(1024, 576)), g((842, 500), (842, 529), (972, 529))):
return 4
elif is_found(Template(r"tpl1647063538393.png", record_pos=(-0.149, -0.234), resolution=(1024, 576)), g((341, 29), (341, 67), (378, 67))) and is_found(Template(r"tpl1647063577054.png", threshold=0.75, rgb=True, record_pos=(0.311, 0.241), resolution=(1024, 576)), g((797, 518), (797, 552), (863, 552))):
return 5
elif is_found(Template(r"tpl1647063538393.png", record_pos=(-0.149, -0.234), resolution=(1024, 576)), g((341, 29), (341, 67), (378, 67))) and is_found(Template(r"tpl1647450033644.png", record_pos=(0.311, 0.242), resolution=(1024, 576)), g((801, 517), (801, 555), (861, 555))) and is_found(Template(r"tpl1647066298630.png", record_pos=(-0.439, 0.179), resolution=(1024, 576)), g((2, 456), (2, 487), (122, 487))):
return 6
elif is_found(Template(r"tpl1647063538393.png", record_pos=(-0.149, -0.234), resolution=(1024, 576)), g((341, 29), (341, 67), (378, 67))) and is_found(Template(r"tpl1647144019805.png", record_pos=(0.311, 0.242), resolution=(1024, 576)), g((801, 517), (801, 555), (861, 555))):
return 7
elif is_found(Template(r"tpl1644773664247.png", record_pos=(-0.437, -0.248), resolution=(1024, 576)), g((31, 18), (31, 51), (100, 51))):
XY = (XY[0] + 100, XY[1])
return 0
elif is_found(Template(r"tpl1644775198955.png", record_pos=(-0.076, 0.223), resolution=(1024, 576)), g((408, 509), (408, 524), (461, 524))):
XY = (XY[0] + 100, XY[1])
for _ in range(4):
click(XY)
sleep(0.5)
return 0
elif is_found(Template(r"tpl1647069986280.png", record_pos=(-0.246, -0.121), resolution=(1024, 576)), g((194, 153), (194, 175), (327, 175))) and is_found(Template(r"tpl1647070154857.png", target_pos=8, record_pos=(-0.002, 0.046), resolution=(1024, 576)), g((443, 251), (443, 419), (578, 419))):
return 0
elif is_found(Template(r"tpl1647070306739.png", record_pos=(-0.2, -0.237), resolution=(1024, 576)), g((258, 20), (258, 71), (359, 71))) and is_found(Template(r"tpl1647070328462.png", record_pos=(-0.064, -0.126), resolution=(1024, 576)), g((427, 140), (427, 179), (465, 179))):
return 0
elif is_found(Template(r"tpl1647070542885.png", record_pos=(0.393, 0.199), resolution=(1024, 576)), g((884, 474), (884, 510), (944, 510))):
click(XY)
sleep(1.0)
click(XY)
sleep(1.0)
return 0
elif is_found(Template(r"tpl1644856432544.png", threshold=0.9500000000000002, record_pos=(-0.281, -0.102), resolution=(1024, 576)), g((193, 153), (193, 216), (256, 216))):
XY = (XY[0] - 100, XY[1])
return 0
elif is_found(Template(r"tpl1644779677165.png", record_pos=(-0.415, -0.241), resolution=(1024, 576))):
return 0
return -1
def attach():
'''根据当前策略号作相应策略'''
global XY
global cnt
global start
index = detach()
logger.debug("index============>" + str(index))
if index == 0:
click(XY)
elif index == 1:
logger.debug("============>" + str(XY))
elif index == 2:
click((75, 188)) # 作战任务
wait_to(Template(r"tpl1647447498252.png", record_pos=(0.427, -0.185), resolution=(1024, 576)), g((938, 87), (938, 112), (961, 112)))
swipe((200, 283), vector=[0.0, -0.4], steps=3, duration=0.2)
elif index == 3:
click(XY)
wait_to(Template(r"tpl1647447972805.png", record_pos=(-0.145, -0.052), resolution=(1024, 576)), g((343, 204), (343, 267), (386, 267)))
click((970, 153))
wait_to(Template(r"tpl1647447972805.png", record_pos=(-0.145, -0.052), resolution=(1024, 576)), g((343, 204), (343, 267), (386, 267)))
click((540, 237))
elif index == 4:
pinch(in_or_out='in', center=None, percent=0.5) # 缩放
sleep(1.0)
swipe((200, 283), vector=[1.0, 1.0], steps=50, duration=0.1) # 右下滑动
wait_to(Template(r"tpl1647448741476.png", record_pos=(-0.075, 0.19), resolution=(1024, 576)), g((402, 444), (402, 523), (469, 523)))
click((224, 118)) # 左上机场
wait_to(Template(r"tpl1647277864179.png", record_pos=(-0.302, 0.208), resolution=(1024, 576)), g((142, 489), (142, 514), (264, 514)))
click((932, 508)) # 第一梯队部署
wait_to(Template(r"tpl1647448741476.png", record_pos=(-0.075, 0.19), resolution=(1024, 576)), g((402, 444), (402, 523), (469, 523)))
click((178, 493)) # 左下机场
wait_to(Template(r"tpl1647277864179.png", record_pos=(-0.302, 0.208), resolution=(1024, 576)), g((142, 489), (142, 514), (264, 514)))
click((932, 508)) # 第二梯队部署
wait_to(Template(r"tpl1647448741476.png", record_pos=(-0.075, 0.19), resolution=(1024, 576)), g((402, 444), (402, 523), (469, 523)))
click((932, 508)) # 开始作战
click((932, 508)) # 开始作战
if time.time() - start > 2:
cnt += 1
start = time.time()
logger.error("无限脚本开始,当前进行第%d轮" % cnt)
sleep(1.5)
elif index == 5:
wait_to(Template(r"tpl1647449130009.png", record_pos=(-0.429, -0.168), resolution=(1024, 576)), g((56, 99), (56, 133), (90, 133)))
click((74, 116)) # 点击说明
wait_to(Template(r"tpl1647449181778.png", record_pos=(-0.428, -0.166), resolution=(1024, 576)), g((61, 102), (61, 135), (87, 135)))
click((74, 116)) # 点击说明
sleep(0.2)
wait_to(Template(r"tpl1647278147416.png", record_pos=(-0.44, 0.181), resolution=(1024, 576)), g((7, 460), (7, 486), (115, 486)))
click((224, 135)) # 左上机场
wait_to(Template(r"tpl1647278748100.png", record_pos=(0.424, -0.172), resolution=(1024, 576)), g((934, 99), (934, 126), (958, 126)))
click((60, 472)) # 计划模式
wait_to(Template(r"tpl1647278941881.png", record_pos=(-0.443, 0.181), resolution=(1024, 576)), g((5, 463), (5, 483), (112, 483)))
click((155, 243)) # 左上白点
wait_to(Template(r"tpl1647449520081.png", record_pos=(-0.351, -0.044), resolution=(1024, 576)), g((133, 222), (133, 265), (173, 265)))
click((178, 493)) # 左下机场
wait_to(Template(r"tpl1647449602282.png", record_pos=(-0.25, 0.198), resolution=(1024, 576)), g((213, 480), (213, 503), (300, 503)))
click((168, 493)) # 移动
wait_to(Template(r"tpl1647449673833.png", record_pos=(-0.341, 0.089), resolution=(1024, 576)), g((142, 358), (142, 401), (184, 401)))
click((900, 510)) # 执行计划
sleep(10.0)
elif index == 6:
click((183, 428)) # 左下机场
wait_to(Template(r"tpl1647277864179.png", record_pos=(-0.302, 0.208), resolution=(1024, 576)), g((142, 489), (142, 514), (264, 514)))
click((783, 509)) # 撤离
wait_to(Template(r"tpl1647450113336.png", record_pos=(0.081, 0.106), resolution=(1024, 576)), g((540, 379), (540, 415), (651, 415)))
click((594, 396)) # 确认撤离
wait_to(Template(r"tpl1647450191589.png", record_pos=(-0.326, 0.141), resolution=(1024, 576)), g((164, 418), (164, 446), (192, 446)))
click((183, 428)) # 左下机场
wait_to(Template(r"tpl1647277864179.png", record_pos=(-0.302, 0.208), resolution=(1024, 576)), g((142, 489), (142, 514), (264, 514)))
click((201, 502)) # 队伍编成
wait_to(Template(r"tpl1647450267553.png", record_pos=(-0.168, -0.245), resolution=(1024, 576)), g((265, 23), (265, 52), (415, 52)))
click((949, 544)) # 阵型编成
wait_to(Template(r"tpl1647450327595.png", record_pos=(0.341, -0.054), resolution=(1024, 576)), g((834, 206), (834, 260), (888, 260)))
click((861, 234)) # 梯队预设
wait_to(Template(r"tpl1647450393651.png", record_pos=(0.39, 0.138), resolution=(1024, 576)), g((831, 410), (831, 448), (992, 448)))
click((687, 159)) # 预设2
wait_to(Template(r"tpl1647450515144.png", record_pos=(0.008, -0.003), resolution=(1024, 576)), g((512, 240), (512, 329), (552, 329)))
click((906, 507)) # 套用预设
wait_to(Template(r"tpl1647450580716.png", record_pos=(-0.061, 0.051), resolution=(1024, 576)), g((432, 323), (432, 357), (468, 357)))
click((452, 340)) # 强制替换
wait_to(Template(r"tpl1647450629017.png", record_pos=(-0.06, 0.052), resolution=(1024, 576)), g((432, 323), (432, 357), (468, 357)))
click((657, 399)) # 确认
wait_to(Template(r"tpl1647450327595.png", record_pos=(0.341, -0.054), resolution=(1024, 576)), g((834, 206), (834, 260), (888, 260)))
click((928, 507)) # 确定
wait_to(Template(r"tpl1647450267553.png", record_pos=(-0.168, -0.245), resolution=(1024, 576)), g((265, 23), (265, 52), (415, 52)))
click((87, 42)) # 后退
wait_to(Template(r"tpl1647278147416.png", record_pos=(-0.44, 0.181), resolution=(1024, 576)), g((7, 460), (7, 486), (115, 486)))
click((183, 428)) # 左下机场
wait_to(Template(r"tpl1647277864179.png", record_pos=(-0.302, 0.208), resolution=(1024, 576)), g((142, 489), (142, 514), (264, 514)))
click((932, 508)) # 确认部署
wait_to(Template(r"tpl1647278147416.png", record_pos=(-0.44, 0.181), resolution=(1024, 576)), g((7, 460), (7, 486), (115, 486)))
sleep(0.2)
click((183, 428)) # 左下机场
wait_to(Template(r"tpl1647278748100.png", record_pos=(0.424, -0.172), resolution=(1024, 576)), g((934, 99), (934, 126), (958, 126)))
click((183, 428)) # 左下机场
wait_to(Template(r"tpl1647277864179.png", record_pos=(-0.302, 0.208), resolution=(1024, 576)), g((142, 489), (142, 514), (264, 514)))
click((932, 447)) # 补给
wait_to(Template(r"tpl1647278748100.png", record_pos=(0.424, -0.172), resolution=(1024, 576)), g((934, 99), (934, 126), (958, 126)))
click((183, 428)) # 左下机场
wait_to(Template(r"tpl1647277864179.png", record_pos=(-0.302, 0.208), resolution=(1024, 576)), g((142, 489), (142, 514), (264, 514)))
click((783, 509)) # 撤离
wait_to(Template(r"tpl1647450113336.png", record_pos=(0.081, 0.106), resolution=(1024, 576)), g((540, 379), (540, 415), (651, 415)))
click((594, 396)) # 确认撤离
wait_to(Template(r"tpl1647450191589.png", record_pos=(-0.326, 0.141), resolution=(1024, 576)), g((164, 418), (164, 446), (192, 446)))
click((183, 428)) # 左下机场
wait_to(Template(r"tpl1647277864179.png", record_pos=(-0.302, 0.208), resolution=(1024, 576)), g((142, 489), (142, 514), (264, 514)))
click((201, 502)) # 队伍编成
wait_to(Template(r"tpl1647450267553.png", record_pos=(-0.168, -0.245), resolution=(1024, 576)), g((265, 23), (265, 52), (415, 52)))
click((949, 544)) # 阵型编成
wait_to(Template(r"tpl1647450327595.png", record_pos=(0.341, -0.054), resolution=(1024, 576)), g((834, 206), (834, 260), (888, 260)))
click((861, 234)) # 梯队预设
wait_to(Template(r"tpl1647450393651.png", record_pos=(0.39, 0.138), resolution=(1024, 576)), g((831, 410), (831, 448), (992, 448)))
click((687, 89)) # 预设1
wait_to(Template(r"tpl1647450515144.png", record_pos=(0.008, -0.003), resolution=(1024, 576)), g((512, 240), (512, 329), (552, 329)))
click((906, 507)) # 套用预设
wait_to(Template(r"tpl1647450327595.png", record_pos=(0.341, -0.054), resolution=(1024, 576)), g((834, 206), (834, 260), (888, 260)))
click((928, 507)) # 确定
wait_to(Template(r"tpl1647450267553.png", record_pos=(-0.168, -0.245), resolution=(1024, 576)), g((265, 23), (265, 52), (415, 52)))
click((87, 42)) # 后退
elif index == 7:
click((253, 35)) # 终止作战
wait_to(Template(r"tpl1647451075150.png", record_pos=(-0.118, 0.1), resolution=(1024, 576)), g((324, 366), (324, 415), (458, 415)))
click((393, 394)) # 重新作战
if time.time() - start > 2:
logger.error("第%d轮结束,耗时%.2lfs" % (cnt, time.time() - start))
start = time.time()
sleep(1.0)
else:
logger.debug("============>" + str(XY))
sleep(1.0)
return
if DEBUG:
attach()
else:
while True:
attach()
|
# -*- coding: utf-8 -*-
"""
CALFEM Editor Example
Written by Karl Eriksson
"""
import calfem.editor as cfe
import calfem.geometry as cfg
import calfem.mesh as cfm
import calfem.vis_mpl as cfv
import calfem.utils as cfu
import calfem.core as cfc
import numpy as np
# --- Creating a square geometry with two markers
g = cfg.Geometry()
g.point([0.0, 0.0]) # point 0
g.point([100.0, 0.0]) # point 1
g.point([100, 100]) # point 2
g.point([0, 100]) # point 3
g.spline([0, 1]) # line 0
g.spline([1, 2]) # line 1
g.spline([2, 3]) # line 2
g.spline([3, 0]) # line 3
g.surface([0, 1, 2, 3]) # Connect lines to form surface
g.setCurveMarker(0, 10)
g.setCurveMarker(2, 20)
# --- Open the geometry to allow changes in the CALFEM Geometry Editor
new_geometry, marker_dict = cfe.edit_geometry(g)
print(marker_dict)
t = 0.2
v = 0.35
E = 2.1e9
ptype = 1
ep = [ptype,t]
D = cfc.hooke(ptype, E, v)
# --- Every border or point marked with 10 will recieve boundary
# --- condition value of 0
bcs_new = [[marker_dict[10], 0]]
# --- Every border or point marked with 20 will recieve load
# --- value of 10e5
loads_new = [[marker_dict[20], 10e5]]
# --- Every border or point marked with A will recieve boundary
# --- condition value of 0
bcs_old = [[10, 0]]
# --- Every border or point marked with B will recieve load
# --- value of 10e5
loads_old = [[20, 10e5]]
el_size_factor = 5
el_type = 3
dofs_per_node = 2
def calc(geometry, bcs, loads, text):
mesh = cfm.GmshMeshGenerator(geometry)
mesh.el_size_factor = el_size_factor # Factor that changes element sizes.
mesh.el_type = el_type
mesh.dofs_per_node = dofs_per_node
coords, edof, dofs, bdofs, elementmarkers = mesh.create()
# --- Calculate element coordinates
ex, ey = cfc.coordxtr(edof, coords, dofs)
# --- Assemble system matrix
nDofs = edof.max()
K = np.zeros([nDofs, nDofs])
for eltopo, elx, ely in zip(edof, ex, ey):
Ke = cfc.planqe(elx, ely, ep, D)
cfc.assem(eltopo, K, Ke)
# --- Solve equation system
f = np.zeros([nDofs, 1])
bcPrescr = np.array([], int)
bcVal = np.array([], float)
for bc in bcs:
bcPrescr, bcVal = cfu.applybc(bdofs, bcPrescr, bcVal, bc[0], bc[1])
for load in loads:
cfu.applyforcetotal(bdofs, f, load[0], load[1])
a, r = cfc.solveq(K, f, bcPrescr, bcVal)
# --- Calculate element forces
ed = cfc.extractEldisp(edof, a)
vonMises = []
# --- For each element:
for i in range(edof.shape[0]):
# --- Determine element stresses and strains in the element.
es, et = cfc.planqs(ex[i,:], ey[i,:], ep, D, ed[i,:])
# --- Calc and append effective stress to list.
vonMises.append(np.sqrt(np.power(es[0],2) - es[0]*es[1] + np.power(es[1],2) + 3*es[2] ) )
title = "Effective stress" + text
cfv.draw_element_values(vonMises, coords, edof, mesh.dofs_per_node, mesh.el_type, None, draw_elements=False, draw_undisplaced_mesh=False, title=title)
# --- Display results
cfv.clf()
calc(g, bcs_old, loads_old, " original")
cfv.figure()
calc(new_geometry, bcs_new, loads_new, " modified")
cfv.show_and_wait()
|
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import linregress
if __name__ == '__main__':
if __package__ is None:
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from scripts.data_handler import get_system
else:
from scripts.data_handler import get_system
if __name__ == '__main__':
try:
i = int(sys.argv[1])
system = get_system(number=i, ms=False)
# make_correlation_plot(system)
except IndexError, e:
print __file__, 'system_number'
sys.exit(1)
# system = get_system(number=1, ms=False)
t = system.time
res = linregress(t-t[0], system.vrad)
m, b = res.slope, res.intercept
print 'slope:', m, 'intercept (at t[0]):', b
max_rv = system.vrad.max()
time_max_rv = system.time[system.vrad.argmax()]
min_rv = system.vrad.min()
time_min_rv = system.time[system.vrad.argmin()]
max_slope = (max_rv - min_rv) / (time_max_rv - time_min_rv)
print 'max_slope', max_slope
min_slope = -max_slope # (min_rv - max_rv) / (time_max_rv - time_min_rv)
print 'min_slope', min_slope
system.do_plot_obs()
plt.plot(system.time, m*(t-t[0]) + b, '-r', lw=3)
# for _ in range(500):
# # mm = np.random.normal(loc=0, scale=m)
# mm = np.random.uniform(low=min_slope, high=max_slope)
# plt.plot(system.time, mm*(t-t[0]) + b, '-k', lw=1, alpha=0.3)
plt.show()
old_file = system.provenance.keys()[0]
old_path = os.path.dirname(old_file)
new_file = os.path.basename(old_file)[:-3] + 'noslope.rdb'
print 'Remove this linear trend from the data',
print 'and save it as %s ?' % new_file,
print '(y/n)',
yn = raw_input()
if yn == 'y':
line = m*(t-t[0]) + b
system.vrad -= line
system.do_plot_obs()
plt.show()
X = [system.time, system.vrad, system.error]
header = 'jdb\tvrad\tsvrad\n---\t----\t-----'
np.savetxt(os.path.join(old_path, new_file), zip(*X),
fmt=['%12.6f', '%8.5f', '%7.5f'], delimiter='\t', header=header, comments='')
else:
print 'Doing nothing. Bye!'
|
'''
@说明 :草动用户接口。
@时间 :2020/2/13 下午4:28:26
@作者 :任秋锴
@版本 :1.0
'''
from typing import List
from .base import base
class user(base):
def __init__(self, token):
super().__init__(token)
def list(self,
storeIdKey=None, companyId=None, mobile=None,
pageNum=1, pageSize=10,):
api_name = "manager/user/listemp"
data = {
"pageNum": pageNum,
"pageSize": pageSize,
"storeIdKey": storeIdKey,
"companyId": companyId,
"mobile": mobile,
}
return self.request(api_name, data)
def batch_update(self, data):
api_name = "manager/user/batch_update"
return self.request(api_name, data)
def batch_delete(self, idList: List, status=0):
"""
批量离职
"""
api_name = "manager/user/batch_update"
data = {
"idList": idList,
"status": status,
}
return self.request(api_name, data, method="POST")
|
from synapse.tests.common import *
import synapse.lib.scope as s_scope
class ScopeTest(SynTest):
def test_lib_scope(self):
syms = {'foo': 'woot', 'bar': 30, 'baz': [1, 2]}
scope = s_scope.Scope(**syms)
self.eq(scope.get('bar'), 30)
self.eq(scope.get('foo'), 'woot')
self.eq(tuple(scope.iter('baz')), (1, 2))
scope.update((('hehe', 1), ('haha', 'wow')))
self.eq(scope.get('hehe'), 1)
self.eq(scope.get('haha'), 'wow')
with scope:
scope.set('bar', 20)
scope.add('baz', 3, 4)
scope.update((('hehe', 2), ('haha', 'oh my')))
self.eq(scope.get('bar'), 20)
self.eq(scope.get('foo'), 'woot')
self.eq(tuple(scope.iter('baz')), (1, 2, 3, 4))
self.eq(scope.get('hehe'), 2)
self.eq(scope.get('haha'), 'oh my')
self.eq(scope.get('hehe'), 1)
self.eq(scope.get('haha'), 'wow')
self.eq(scope.get('bar'), 30)
self.eq(scope.get('foo'), 'woot')
self.eq(tuple(scope.iter('baz')), (1, 2))
self.eq(scope.pop('bar'), 30)
self.none(scope.get('bar'))
def test_lib_scope_thread(self):
s_scope.set('test:foo', 10)
self.eq(s_scope.get('test:foo'), 10)
self.eq(s_scope.pop('test:foo'), 10)
self.none(s_scope.get('test:foo'))
s_scope.update([('test:hehe', 1), ('test:haha', 'wow')])
self.eq(s_scope.get('test:hehe'), 1)
self.eq(s_scope.get('test:haha'), 'wow')
def test_lib_scope_enter(self):
with s_scope.enter({'woot': 10}):
self.eq(s_scope.get('woot'), 10)
self.none(s_scope.get('newp'))
self.none(s_scope.get('woot'))
self.none(s_scope.get('newp'))
def test_lib_scope_get_defval(self):
syms = {'foo': None, 'bar': 123}
scope = s_scope.Scope(**syms)
self.eq(scope.get('foo'), None)
self.eq(scope.get('foo', defval=None), None)
self.eq(scope.get('bar'), 123)
self.eq(scope.get('bar', defval=123), 123)
self.eq(scope.get('boo'), None)
self.eq(scope.get('boo', defval=None), None)
scope.enter({'bar': 321})
self.eq(scope.get('bar'), 321)
self.eq(scope.get('bar', defval=321), 321)
scope.leave()
|
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010 OpenStack Foundation
# 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.
"""
Test WSGI basics and provide some helper functions for other WSGI tests.
"""
from cinder import test
import routes
import webob
from cinder import wsgi
class Test(test.TestCase):
def test_debug(self):
class Application(wsgi.Application):
"""Dummy application to test debug."""
def __call__(self, environ, start_response):
start_response("200", [("X-Test", "checking")])
return ['Test result']
application = wsgi.Debug(Application())
result = webob.Request.blank('/').get_response(application)
self.assertEqual(result.body, "Test result")
def test_router(self):
class Application(wsgi.Application):
"""Test application to call from router."""
def __call__(self, environ, start_response):
start_response("200", [])
return ['Router result']
class Router(wsgi.Router):
"""Test router."""
def __init__(self):
mapper = routes.Mapper()
mapper.connect("/test", controller=Application())
super(Router, self).__init__(mapper)
result = webob.Request.blank('/test').get_response(Router())
self.assertEqual(result.body, "Router result")
result = webob.Request.blank('/bad').get_response(Router())
self.assertNotEqual(result.body, "Router result")
|
# coding=utf-8
"""
wecube_plugins_itsdangerous.common
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
本模块提供系统通用包
"""
|
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from . import views
urlpatterns = [
url(r'^$', views.page, name='index'),
url(r'^unlinked-pages/$', views.unlinked_pages, name='unlinked_pages'),
url(r'^schedule/$', views.schedule_view, name='schedule'),
url(r'^sessions/$', views.sessions_view, name='sessions'),
url(r'^sessions/(?P<session_type>talk|workshop|keynote|panel)s/(?P<slug>[\w-]+)/$', views.session_view, name='session'),
url(r'^speakers/$', views.speakers_view, name='speakers'),
url(r'^speakers/(?P<key>[\w-]+)/$', views.speaker_view, name='speaker'),
url(r'^sponsors/(?P<key>[\w-]+)/$', views.sponsor_view, name='sponsor'),
url(r'^(?P<key>.*?)/$', views.page, name='page'),
url(r'^static/(?P<path>.*)$', views.serve_static),
]
|
"""Slow-running tests for nightly continuous integration."""
from functools import partial # noqa: F401
import os
import ixmp
import message_ix
from message_ix.testing.nightly import (
download,
iter_scenarios,
)
import numpy as np # noqa: F401
import pytest
pytestmark = pytest.mark.skipif(
os.environ.get('TRAVIS_EVENT_TYPE', '') != 'cron'
or os.environ.get('TRAVIS_OS_NAME', '') == 'osx',
reason="Nightly scenario tests only run on Travis 'cron' events.")
# # For development/debugging, uncomment the following
# pytestmark = pytest.mark.skipif(
# 'TRAVIS_EVENT_TYPE' not in os.environ or
# os.environ.get('TRAVIS_OS_NAME', '') == 'osx',
# reason='Run on all Travis jobs, for debugging.')
# Information about nightly scenarios to run
ids, args = zip(*iter_scenarios())
@pytest.fixture(scope='module')
def downloaded_scenarios(tmp_path_factory):
path = tmp_path_factory.mktemp('nightly')
# Download scenarios database into the temporary path; install GAMS license
download(path)
# NB could `yield ixmp.Platform(...)` here, but Travis/macOS jobs fail due
# to excessive memory use in Java/ixmp_source. Instead, create multiple
# Platforms so that memory is released after each is destroyed.
yield dict(
# TODO repack the archive without a 'db' directory, and remove from the
# path here
backend='jdbc',
driver='hsqldb',
path=path / 'db' / 'scenarios',
)
@pytest.mark.parametrize('model,scenario,solve,solve_opts,cases',
args, ids=ids)
def test_scenario(downloaded_scenarios, model, scenario, solve, solve_opts,
cases):
mp = ixmp.Platform(**downloaded_scenarios)
scen = message_ix.Scenario(mp, model, scenario)
scen.solve(model=solve, solve_options=solve_opts)
for case in cases:
exp = eval(case['exp'])
obs = eval(case['obs'])
assert eval(case['test'])(exp, obs)
|
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from go_and_do_people_info.models import (Country, Event, Ministry, News,
Prayer, Ticket, UserProfile,
Volunteer)
from go_and_do_people_info.serializers import (MinistrySerializer,
UserProfileSerializer,
UserSerializer,
VolunteerSerializer,
CountrySerializer,
PrayerSerializer,
NewsSerializer,
EventSerializer,
TicketSerializer)
from rest_auth.registration.views import RegisterView
from rest_framework import viewsets
from rest_framework_swagger.views import get_swagger_view
User = get_user_model()
class CustomRegisterView(RegisterView):
queryset = User.objects.all()
class UserViewSet(viewsets.ModelViewSet):
"""
retrieve:
Return a user instance.
list:
Return all users, ordered by most recently joined.
create:
Create a new user.
delete:
Remove an existing user.
partial_update:
Update one or more fields on an existing user.
update:
Update a user.
"""
queryset = User.objects.all()
serializer_class = UserSerializer
class MinistryViewSet(viewsets.ModelViewSet):
"""
General API documentation (not wisible in the swagger view)
get:
GET-specific documentation!
Lorem ipsum
post:
POST-specific documentation!
Dolor **sit amet**
"""
queryset = Ministry.objects.all()
serializer_class = MinistrySerializer
class VolunteerViewSet(viewsets.ModelViewSet):
"""
General API documentation (not wisible in the swagger view)
get:
GET-specific documentation!
Lorem ipsum
post:
POST-specific documentation!
Dolor **sit amet**
"""
queryset = Volunteer.objects.all()
serializer_class = VolunteerSerializer
class UserProfileViewSet(viewsets.ModelViewSet):
"""
General API documentation (not wisible in the swagger view)
get:
GET-specific documentation!
Lorem ipsum
post:
POST-specific documentation!
Dolor **sit amet**
"""
queryset = UserProfile.objects.all()
serializer_class = UserProfileSerializer
class CountryViewSet(viewsets.ModelViewSet):
"""
General API documentation (not wisible in the swagger view)
get:
GET-specific documentation!
Lorem ipsum
post:
POST-specific documentation!
Dolor **sit amet**
"""
queryset = Country.objects.all()
serializer_class = CountrySerializer
class PrayerViewSet(viewsets.ModelViewSet):
"""
General API documentation (not wisible in the swagger view)
get:
GET-specific documentation!
Lorem ipsum
post:
POST-specific documentation!
Dolor **sit amet**
"""
queryset = Prayer.objects.all()
serializer_class = PrayerSerializer
class NewsViewSet(viewsets.ModelViewSet):
"""
General API documentation (not wisible in the swagger view)
get:
GET-specific documentation!
Lorem ipsum
post:
POST-specific documentation!
Dolor **sit amet**
"""
queryset = News.objects.all()
serializer_class = NewsSerializer
class EventViewSet(viewsets.ModelViewSet):
"""
General API documentation (not wisible in the swagger view)
get:
GET-specific documentation!
Lorem ipsum
post:
POST-specific documentation!
Dolor **sit amet**
"""
queryset = Event.objects.all()
serializer_class = EventSerializer
class TicketViewSet(viewsets.ModelViewSet):
"""
General API documentation (not wisible in the swagger view)
get:
GET-specific documentation!
Lorem ipsum
post:
POST-specific documentation!
Dolor **sit amet**
"""
queryset = Ticket.objects.all()
serializer_class = TicketSerializer
|
# Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
import collections
import os
from packaging import version as pkg_version
import sys
from openstack_requirements import requirement
PROJECT_REQUIREMENTS_FILES = ['requirements.txt']
QUALIFIER_CHARS = ['<', '>', '!', '=']
def _grab_args():
"""Grab and return arguments"""
parser = argparse.ArgumentParser(
description='Check if project requirements have changed')
parser.add_argument('env_dir', help='tox environment directory')
return parser.parse_args()
def _extract_reqs(file_name, blacklist=None):
blacklist = blacklist or {}
content = open(file_name, 'rt').read()
reqs = collections.defaultdict(tuple)
parsed = requirement.parse(content)
for name, entries in ((name, entries) for (name, entries) in parsed.items()
if (name and name not in blacklist)):
list_reqs = [r for (r, line) in entries]
# Strip the comments out before checking if there are duplicates
list_reqs_stripped = [r._replace(comment='') for r in list_reqs]
if len(list_reqs_stripped) != len(set(list_reqs_stripped)):
print('Requirements file %s has duplicate entries for package '
'"%s: %r' % (file_name, name, list_reqs))
reqs[name] = list_reqs
return reqs
def _extract_qualifier_version(specifier):
index = 1
# Find qualifier (one or two chars).
if specifier[0] in QUALIFIER_CHARS and specifier[1] in QUALIFIER_CHARS:
index = 2
qualifier = specifier[:index]
version = pkg_version.Version(specifier[index:])
return qualifier, version
def main():
args = _grab_args()
# Build a list of requirements from the global list in the
# openstack/requirements project so we can match them to the changes
env_dir = args.env_dir
req_dir = env_dir + '/src/os-requirements/'
global_reqs = _extract_reqs(req_dir + '/global-requirements.txt')
blacklist = _extract_reqs(req_dir + '/blacklist.txt')
# Build a list of project requirements.
failed = False
local_dir = os.getcwd()
for file_name in PROJECT_REQUIREMENTS_FILES:
print('Validating requirements file "%s"' % file_name)
proj_reqs = _extract_reqs(local_dir + '/' + file_name,
blacklist=blacklist)
for name, req in proj_reqs.items():
global_req = global_reqs.get(name)
if not global_req:
continue
global_req = global_req[0]
req = req[0]
if not global_req.specifiers:
continue
specifiers = global_req.specifiers.split(',')
for spec in specifiers:
_, req_version = _extract_qualifier_version(req.specifiers)
g_qualifier, g_version = _extract_qualifier_version(spec)
if g_qualifier == '!=' and g_version == req_version:
print('Package "%s" version %s is not compatible' %
(name, req_version))
failed = True
if g_qualifier == '>=' and g_version > req_version:
print('Package "%s" version %s outdated, minimum version '
'%s' % (name, req_version, g_version))
failed = True
if failed:
print('Incompatible requirement found!')
sys.exit(1)
print('Updated requirements match openstack/requirements')
if __name__ == '__main__':
main()
|
from mylib import RelationData
from pathlib import Path
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("input", type=Path)
parser.add_argument("--tex", action="store_true")
parser.add_argument("--all", action="store_true")
args = parser.parse_args()
def get_stat(data):
stat_ent = {}
stat_rel = {}
for dat in data.values():
for ent in dat["entity"].values():
label = ent["label"]
if not label in stat_ent:
stat_ent[label] = 0
stat_ent[label] += 1
for rel in dat["relation"].values():
label = rel["label"]
if not label in stat_rel:
stat_rel[label] = 0
stat_rel[label] += 1
std_ent = dict(sorted(stat_ent.items(), key=lambda x: x[1], reverse=True))
std_rel = dict(sorted(stat_rel.items(), key=lambda x: x[1], reverse=True))
return std_ent,std_rel
if args.all:
edics = {}
rdics = {}
modes= ['train','devel','test']
for m in modes:
d = args.input/m
if d.is_dir():
data = RelationData(d, pattern="*.ann")
e,r = get_stat(data)
e['all'] = sum(e.values())
edics[m]=e
r['all'] = sum(r.values())
rdics[m] = r
std_ent = []
std_rel = []
for k in edics['train'].keys():
lst = [k]
lst.extend([edics[m][k] if k in edics[m] else 0 for m in modes])
std_ent.append(lst)
for k in rdics['train'].keys():
lst = [k]
lst.extend([rdics[m][k] if k in rdics[m] else 0 for m in modes])
std_rel.append(lst)
else:
data = RelationData(args.input, pattern="*.ann")
std_ent,std_rel = get_stat(data)
if args.tex:
txt_ent = " \\\\ \n".join(map(lambda x: " & ".join(map(str, x)), std_ent))
txt_rel = "\\\\ \n".join(map(lambda x: " & ".join(map(str, x)), std_rel))
else:
txt_ent = "\n".join(map(lambda x: "\t".join(map(str, x)), std_ent))
txt_rel = "\n".join(map(lambda x: "\t".join(map(str, x)), std_rel))
print("Entity:")
print(txt_ent)
print()
print("Relation:")
print(txt_rel)
|
from pymongo import MongoClient
from pymongo.database import Database
import requests
import json
import schedule
import datetime
import os
from tweet import Tweet
from threading import Thread
now = datetime.datetime.now()
CUR_TIMESTAMP = int(datetime.datetime(year=now.year, month=now.month, day=now.day, hour=now.hour).timestamp())
TOTAL_TAGS = 0
TOTAL_HASHTAGS = 0
TOTAL_TWEETS = 0
TOTAL_RETWEETS = 0
DATA_TAGS = {}
DATA_HASHTAGS = {}
DB = 0
# Twitter API stuff
def create_url():
return "https://api.twitter.com/2/tweets/sample/stream"
def create_headers(bearer_token):
headers = {"Authorization": "Bearer {}".format(bearer_token)}
return headers
def connect_to_endpoint():
url = create_url()
headers = create_headers(os.environ['TWITTER_KEY'])
schedule.every(25).minutes.do(save)
schedule.every().second.do(updateTimestamp)
response = requests.request("GET", url, headers=headers, stream=True)
for response_line in response.iter_lines():
if response_line:
if b"data" in response_line:
json_response = json.loads(response_line)
handleTweet(json_response["data"]["text"])
schedule.run_pending()
if response.status_code != 200:
print(response.status_code)
raise Exception(
"Request returned an error: {} {}".format(
response.status_code, response.text
)
)
# Tweet handling
def clean(text, forbidden):
for x in forbidden:
text = text.replace(x, " ")
return text
def handleTweet(text: str):
global TOTAL_TWEETS, TOTAL_RETWEETS, TOTAL_HASHTAGS, TOTAL_TAGS, DATA_HASHTAGS, DATA_TAGS
try:
t = Tweet(
clean(text, ["\n", "\t", ".", ",", "(", ")", "{", "}", "-", "+", ":", "/", "\\", "'", "\"", "!", "?",
"=","…", "*", "&", "€", "$", ";", "・", "。", "...", "、", "⋮", " ", " ", "[", "]"]))
TOTAL_TWEETS += 1
if text.startswith("RT"):
TOTAL_RETWEETS += 1
TOTAL_TAGS += len(t.tags)
TOTAL_HASHTAGS += len(t.hashtags)
for tag in t.tags:
if tag in DATA_TAGS.keys():
DATA_TAGS[tag] += 1
else:
DATA_TAGS[tag] = 1
for hashtag in t.hashtags:
if hashtag in DATA_HASHTAGS.keys():
DATA_HASHTAGS[hashtag] += 1
else:
DATA_HASHTAGS[hashtag] = 1
except:
print("ERROR")
pass
def updateTimestamp():
global CUR_TIMESTAMP
old_timestamp = CUR_TIMESTAMP
now = datetime.datetime.now()
_CUR_TIMESTAMP = int(datetime.datetime(year=now.year, month=now.month, day=now.day, hour=now.hour).timestamp())
if old_timestamp != _CUR_TIMESTAMP and old_timestamp != 0:
save(True)
CUR_TIMESTAMP = _CUR_TIMESTAMP
calcTop(old_timestamp)
# Database handling
def save(join: bool = False):
global DATA_TAGS, DATA_HASHTAGS, DB
# To Avoid Random Thread Issues
_DATA_TAGS = DATA_TAGS
_DATA_HASHTAGS = DATA_HASHTAGS
DATA_TAGS = {}
DATA_HASHTAGS = {}
t = Thread(name="save", target=_save, args=(_DATA_TAGS, _DATA_HASHTAGS))
t.start()
if join:
t.join()
print("Save finished sync")
def _save(tags: dict, hashtags: dict):
start = datetime.datetime.now().timestamp()
print("Saving.")
col = DB["tags"]
uniqueTags = col.count()
print("Saving " + str(len(tags)) + " tags.")
for tag in tags.keys():
count = tags[tag]
if count >= 2:
_doc = col.find({"name": tag}).limit(1)
doc = {}
if _doc.count() == 0:
doc = {
"name": tag,
"timeline": []
}
else:
doc = _doc[0]
if len(doc["timeline"]) != 0 and doc["timeline"][0]["timestamp"] == CUR_TIMESTAMP:
doc["timeline"][0]["count"] += count
else:
doc["timeline"].insert(0, {
"timestamp": CUR_TIMESTAMP,
"count": count
})
col.update_one({"name": tag}, {"$set": doc}, upsert=True)
col = DB["hashtags"]
uniqueHashTags = col.count()
print("Saving " + str(len(hashtags)) + " hashtags.")
for hashtag in hashtags.keys():
count = hashtags[hashtag]
if count >= 2:
_doc = col.find({"name": hashtag}).limit(1)
doc = {}
if _doc.count() == 0:
doc = {
"name": hashtag,
"timeline": []
}
else:
doc = _doc[0]
if len(doc["timeline"]) != 0 and doc["timeline"][0]["timestamp"] == CUR_TIMESTAMP:
doc["timeline"][0]["count"] += count
else:
doc["timeline"].insert(0, {
"timestamp": CUR_TIMESTAMP,
"count": count
})
col.update_one({"name": hashtag}, {"$set": doc}, upsert=True)
col = DB["totals"]
col.update_one({"timestamp": CUR_TIMESTAMP}, {"$set": {
"timestamp": CUR_TIMESTAMP,
"count_retweets": TOTAL_RETWEETS,
"count_tweets": TOTAL_TWEETS,
"count_tags": TOTAL_TAGS,
"count_hashtags": TOTAL_HASHTAGS,
"unique_tags": uniqueTags,
"unique_hashtags": uniqueHashTags
}}, upsert=True)
print("Done. Took " + str(datetime.datetime.now().timestamp() - start) + " seconds.")
def loadTotals(db: Database):
global TOTAL_TWEETS, TOTAL_RETWEETS, TOTAL_HASHTAGS, TOTAL_TAGS
col = db["totals"]
raw = col.find().sort("timestamp", -1).limit(1)
raw = raw[0]
TOTAL_TWEETS = raw["count_tweets"]
TOTAL_RETWEETS = raw["count_retweets"]
TOTAL_TAGS = raw["count_tags"]
TOTAL_HASHTAGS = raw["count_hashtags"]
def calcTop(t: int):
print("Calculating tops")
col = DB["tags"]
top_tags = col.find({"timeline.0.timestamp": t}).sort("timeline.0.count", -1).limit(100)
_top_tags = []
for x in top_tags:
_top_tags.append(
{
"name": x["name"],
"count": x["timeline"][0]["count"]
}
)
col = DB["hashtags"]
top_hashtags = col.find({"timeline.0.timestamp": t}).sort("timeline.0.count", -1).limit(100)
_top_hashtags = []
for x in top_hashtags:
_top_hashtags.append(
{
"name": x["name"],
"count": x["timeline"][0]["count"]
}
)
col = DB["top"]
col.insert_one({
"timestamp": t,
"tags": _top_tags,
"hashtags": _top_hashtags
})
if __name__ == "__main__":
mongoClient = MongoClient(
os.environ["MONGODB_URI"])
DB = mongoClient["TwitterDB"]
loadTotals(DB)
save(True)
connect_to_endpoint()
|
import math
import sys
import xy
def load_paths(filename):
paths = []
with open(filename) as fp:
for line in fp:
points = filter(None, line.strip().split(';'))
if not points:
continue
path = [tuple(map(float, x.split(','))) for x in points]
paths.append(path)
return paths
def create_drawing(filename, x, y, w, h, p):
paths = load_paths(filename)
paths = xy.remove_duplicates(paths)
drawing = xy.Drawing(paths)
drawing = drawing.rotate_and_scale_to_fit(w - p, h - p, step=5)
drawing = drawing.move(x + w / 2, y + h / 2, 0.5, 0.5)
return drawing
def main(filenames, nx):
paths = []
w = h = 100
p = 10
for index, filename in enumerate(filenames):
i = index % nx
j = index / nx
x = i * w
y = j * h
drawing = create_drawing(filename, x, y, w, h, p)
paths.extend(drawing.paths)
drawing = xy.Drawing(paths)
drawing = xy.Drawing(paths).rotate_and_scale_to_fit(315, 380, step=90)
drawing = drawing.move(315 / 2.0, 380 / 2.0, 0.5, 0.5)
# drawing.paths = [x for x in drawing.paths if len(x) > 1]
# drawing = drawing.simplify_paths()
drawing = drawing.sort_paths_greedy()
drawing = drawing.join_paths()
# drawing = drawing.simplify_paths()
im = drawing.render()
im.write_to_png('grid.png')
# xy.draw(drawing)
if __name__ == '__main__':
main(sys.argv[1:], 4)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tiapp parser
#
import os, types, uuid , fnmatch
import codecs, time, sys
from xml.dom.minidom import parseString
from StringIO import StringIO
def getText(nodelist):
rc = ""
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc = rc + node.data
return rc
class TiWindow(object):
def __init__(self,properties):
self.properties = properties
def __repr__(self):
i = None
if self.properties.has_key('id'): i = self.properties['id']
return '<TiWindow:%s>' % self.properties
def get(self, key, defvalue=None):
if self.properties.has_key(key):
return self.properties[key]
return defvalue
def get_window_properties(node):
wp = None
for w in node.childNodes:
if w.nodeType == 1:
if wp == None: wp = {}
wp[w.nodeName]=getText(w.childNodes)
return wp
def touch_tiapp_xml(tiapp_xml):
print "[DEBUG] touching tiapp.xml to force rebuild next time: " + tiapp_xml
os.utime(tiapp_xml, None)
class TiAppXML(object):
def __init__(self, file, parse_only=False):
self.file = file
if isinstance(self.file, StringIO):
data = self.file
else:
data = codecs.open(self.file,'r','utf-8','replace')
self.dom = parseString(data.read().encode('utf-8'))
self.properties = {
'id':None,
'name':None,
'version':'1.0',
'copyright':'not specified',
'publisher':'not specified',
'description':'not specified',
'url':'not specified',
'icon':None,
'analytics':'true',
'fullscreen':'true',
'navbar-hidden':'false',
'statusbar-hidden':'false',
'modules' : [],
'plugins' : []
}
self.explicit_properties = []
self.app_properties = {}
self.android = {}
self.android_manifest = {}
self.iphone = {}
root = self.dom.documentElement
children = root.childNodes
self.windows = []
for child in children:
if child.nodeType == 1:
# single window at the root <window>
if child.nodeName == 'window':
print "[WARN] window in tiapp.xml no longer supported. this will be ignored"
# multiple windows rooted by <windows>
elif child.nodeName == 'windows':
print "[WARN] windows in tiapp.xml no longer supported. this will be ignored"
# handle modules
elif child.nodeName == 'modules':
for module in child.childNodes:
if module.nodeType == 1:
version = module.getAttribute('version')
platform = module.getAttribute('platform')
module_id = getText(module.childNodes)
self.properties['modules'].append({
'id': module_id,
'version': version,
'platform': platform
})
# handle plugins
elif child.nodeName == 'plugins':
for plugin in child.childNodes:
if plugin.nodeType == 1:
ver = plugin.getAttribute('version')
name = getText(plugin.childNodes)
self.properties['plugins'].append({'name':name,'version':ver})
elif child.nodeName == 'android':
self.parse_android(child)
elif child.nodeName == 'iphone':
self.parse_iphone(child)
elif child.nodeName == 'property':
name = child.getAttribute('name')
value = getText(child.childNodes)
print "[TRACE] app property, %s : %s" % (name, value)
self.app_properties[name] = value
# properties of the app
else:
self.properties[child.nodeName]=getText(child.childNodes)
self.explicit_properties.append(child.nodeName)
# ensure we create a guid if the project doesn't already have one
if not parse_only and not self.properties.has_key('guid'):
guid = uuid.uuid4().hex
self.properties['guid'] = guid
n = self.dom.createElement("guid")
n.appendChild(self.dom.createTextNode(guid))
root.appendChild(n)
root.appendChild(self.dom.createTextNode("\n"))
self.dom.writexml(codecs.open(self.file, 'w+','utf-8','replace'), encoding="UTF-8")
def parse_android(self, node):
def get_text(node): return getText(node.childNodes)
def lazy_init(name, value, map=self.android, set_name=False):
if not name in map: map[name] = value
if set_name: map[name]['name'] = name
return map[name]
def add_attrs(map, element, fn=None):
for attr in element.attributes.keys():
value = element.getAttribute(attr)
if fn != None: value = fn(value)
map[attr] = value
def parse_manifest(node):
# android:manifest XML gets copied to the AndroidManifest.xml under the top level <manifest>
# anything under <application> will also get copied into the manifest's <application>
for child in node.childNodes:
if child.nodeType != child.ELEMENT_NODE: continue
if child.nodeName == 'application':
if 'application' not in self.android_manifest:
self.android_manifest['application'] = []
application = self.android_manifest['application']
application.extend([n for n in child.childNodes if n.nodeType == n.ELEMENT_NODE])
self.android_manifest['application-attributes'] = child.attributes
continue
if 'manifest' not in self.android_manifest:
self.android_manifest['manifest'] = []
manifest = self.android_manifest['manifest']
manifest.append(child)
if node.attributes.length > 0:
self.android_manifest['manifest-attributes'] = node.attributes
def get_url_based_classname(url, appendage):
parts = url.split('/')
if len(parts) == 0: return None
start = 0
if parts[0] == "app:" and len(parts) >= 3:
start = 2
classname = '_'.join(parts[start:])
if classname.endswith('.js'):
classname = classname[:-3]
if len(classname) > 1:
classname = classname[0:1].upper() + classname[1:]
else: classname = classname.upper()
escape_chars = ['\\', '/', ' ', '.', '$', '&', '@']
for escape_char in escape_chars:
classname = classname.replace(escape_char, '_')
return classname+appendage
def get_activity_classname(url):
return get_url_based_classname(url, 'Activity')
def get_service_classname(url):
return get_url_based_classname(url, 'Service')
def parse_activities(node):
activities = lazy_init('activities', {})
for activity_el in node.getElementsByTagName('activity'):
if activity_el.hasAttribute('url'):
url = activity_el.getAttribute('url')
else:
url = get_text(activity_el)
activity = lazy_init(url, {}, activities)
activity['url'] = url
add_attrs(activity, activity_el)
activity['classname'] = get_activity_classname(url)
for child in activity_el.childNodes:
if child.nodeType != child.ELEMENT_NODE:
continue
if 'nodes' not in activity:
activity['nodes'] = []
nodes = activity['nodes']
nodes.append(child)
def parse_services(node):
services = lazy_init('services', {})
for service_el in node.getElementsByTagName('service'):
if service_el.hasAttribute('url'):
url = service_el.getAttribute('url')
else:
url = get_text(service_el)
service_type = 'standard'
if service_el.hasAttribute('type'):
service_type = service_el.getAttribute('type')
service = lazy_init(url, {}, services)
service['url'] = url
service['service_type'] = service_type
add_attrs(service, service_el)
service['classname'] = get_service_classname(url)
for child in service_el.childNodes:
if child.nodeType != child.ELEMENT_NODE:
continue
if 'nodes' not in service:
service['nodes'] = []
nodes = service['nodes']
nodes.append(child)
def parse_tool_api_level(node):
lazy_init('tool-api-level', get_text(node))
local_objects = locals()
parse_tags = ['services', 'activities', 'manifest', 'tool-api-level']
for child in node.childNodes:
if child.nodeName in parse_tags:
local_objects['parse_'+child.nodeName.replace('-', '_')](child)
def parse_iphone(self, node):
def translate_orientation(orientation):
info = orientation.split('.')
tokenMap = {'PORTRAIT':'UIInterfaceOrientationPortrait',
'UPSIDE_PORTRAIT':'UIInterfaceOrientationPortraitUpsideDown',
'LANDSCAPE_LEFT':'UIInterfaceOrientationLandscapeLeft',
'LANDSCAPE_RIGHT':'UIInterfaceOrientationLandscapeRight'}
for token in tokenMap:
if token in info:
return tokenMap[token]
return None
def parse_orientations(node):
device = node.getAttribute('device').lower()
orientations = []
if (device == None):
print "[WARN] Orientations for unspecified device; assuming iphone"
device = 'iphone'
if device != 'iphone' and device != 'ipad':
print "[WARN] Unrecognized device %s for iphone, ignoring" % device
return
for child in node.childNodes:
if (child.nodeName == 'orientation'):
orientation = translate_orientation(getText(child.childNodes))
if orientation == None:
print "[WARN] Unrecognized orientation %s: Ignoring" % getText(node.childNodes)
else:
orientations.append(orientation)
self.iphone['orientations_'+device] = orientations
def parse_backgroundModes(node):
valid_modes = ['audio', 'location', 'voip']
self.iphone['background'] = []
for child in node.childNodes:
if child.nodeName == 'mode':
mode = getText(child.childNodes)
if mode not in valid_modes:
print "[WARN] Invalid background mode %s: ignoring" % mode
continue
self.iphone['background'].append(mode)
def parse_requires(node):
# Note that some of these are meaningless right now, but are
# included for The Future.
valid_reqs = ['telephony', 'wifi', 'sms', 'still-camera',
'auto-focus-camera', 'front-facing-camera',
'camera-flash', 'video-camera', 'accelerometer',
'gyroscope', 'location-services', 'gps', 'magnetometer',
'gamekit', 'microphone', 'opengles-1', 'opengles-2',
'armv6', 'armv7', 'peer-peer']
self.iphone['requires'] = []
for child in node.childNodes:
if child.nodeName == 'feature':
feature = getText(child.childNodes)
if feature not in valid_reqs:
print "[WARN] Invalid feature %s: ignoring" % feature
continue
self.iphone['requires'].append(feature)
def parse_type(node):
valid_tags = ['name', 'icon', 'uti', 'owner']
type_info = { 'name':'', 'icon':'', 'uti':[], 'owner':False }
for child in node.childNodes:
if child.nodeName in valid_tags:
value = getText(child.childNodes)
if child.nodeName == 'uti':
value = value.split(',')
elif child.nodeName == 'owner':
value = self.to_bool(value)
type_info[child.nodeName] = value
self.iphone['types'].append(type_info)
def parse_fileTypes(node):
self.iphone['types'] = []
for child in node.childNodes:
if child.nodeName == 'type':
parse_type(child)
local_objects = locals()
parse_tags = ['orientations', 'backgroundModes', 'requires', 'fileTypes']
for child in node.childNodes:
if child.nodeName in parse_tags:
local_objects['parse_'+child.nodeName](child)
def has_app_property(self, property):
return property in self.app_properties
def get_app_property(self, property):
return self.app_properties[property]
def to_bool(self, value):
return value in ['true', 'True', 'TRUE', 'yes', 'Yes', 'YES', 'y', 't', '1']
def setDeployType(self, deploy_type):
found = False
children = self.dom.documentElement.childNodes
for child in children:
if child.nodeType == 1 and child.nodeName == 'property' :
if child.getAttributeNode('name').nodeValue == 'ti.deploytype' :
child.firstChild.nodeValue = deploy_type
found = True
break
if not found :
root = self.dom.documentElement
n = self.dom.createElement("property")
n.setAttribute('name','ti.deploytype')
n.appendChild(self.dom.createTextNode(deploy_type))
root.appendChild(n)
self.app_properties['ti.deploytype'] = deploy_type
self.dom.writexml(codecs.open(self.file, 'w+','utf-8','replace'), encoding="UTF-8")
def generate_infoplist(self,file,appid,family,project_dir,iphone_version):
icon = 'appicon.png'
if self.properties.has_key('icon'):
icon = self.properties['icon']
# we want the icon without the extension for the plist
iconname = os.path.splitext(icon)[0]
self.infoplist_properties = {}
for p in self.properties:
value = self.properties[p]
if p=='persistent-wifi' and value=='true':
self.infoplist_properties['UIRequiresPersistentWiFi']='<true/>'
if p=='prerendered-icon' and value=='true':
self.infoplist_properties['UIPrerenderedIcon']='<true/>'
if p=='statusbar-hidden' and value=='true':
self.infoplist_properties['UIStatusBarHidden']='<true/>'
if p=='statusbar-style':
if value == 'default' or value=='grey':
status_bar_style = '<string>UIStatusBarStyleDefault</string>'
elif value == 'opaque_black' or value == 'opaque' or value == 'black':
status_bar_style = '<string>UIStatusBarStyleBlackOpaque</string>'
elif value == 'translucent_black' or value == 'transparent' or value == 'translucent':
status_bar_style = '<string>UIStatusBarStyleBlackTranslucent</string>'
else:
status_bar_style = '<string>UIStatusBarStyleDefault</string>'
self.infoplist_properties['UIStatusBarStyle']=status_bar_style
for prop in self.iphone:
if prop == 'orientations_iphone' or prop == 'orientations_ipad':
propertyName = 'UISupportedInterfaceOrientations'
if prop == 'orientations_ipad':
propertyName += '~ipad'
propertyValue = '<array>\n'
for orientation in self.iphone[prop]:
propertyValue += " <string>%s</string>\n" % orientation
propertyValue += ' </array>'
self.infoplist_properties[propertyName]=propertyValue
if prop == 'background':
propertyName = 'UIBackgroundModes'
propertyValue = '<array>\n'
for mode in self.iphone[prop]:
propertyValue += " <string>%s</string>\n" % mode
propertyValue += ' </array>'
self.infoplist_properties[propertyName]=propertyValue
if prop == 'requires':
propertyName = 'UIRequiredDeviceCapabilities'
propertyValue = '<array>\n'
for feature in self.iphone[prop]:
propertyValue += " <string>%s</string>\n" % feature
propertyValue += ' </array>'
self.infoplist_properties[propertyName]=propertyValue
if prop == 'types':
propertyName = 'CFBundleDocumentTypes'
propertyValue = '<array>\n'
for type in self.iphone[prop]:
propertyValue += '<dict>\n'
propertyValue += "<key>CFBundleTypeName</key><string>%s</string>\n" % type['name']
propertyValue += "<key>CFBundleTypeIconFiles</key><array><string>%s</string></array>\n" % type['icon']
propertyValue += '<key>LSItemContentTypes</key><array>'
for uti in type['uti']:
propertyValue += "<string>%s</string>" % uti
propertyValue += '</array>\n'
owner = 'Owner' if type['owner'] else 'Alternate'
propertyValue += "<key>LSHandlerRank</key><string>%s</string>\n" % owner
propertyValue += '</dict>\n'
propertyValue += '</array>'
self.infoplist_properties[propertyName]=propertyValue
plist = codecs.open(file,'r','utf-8','replace').read()
plist = plist.replace('__APPICON__',iconname)
#Creating proper CFBundleIconFiles rather than hard coding the values in there
propertyName = 'CFBundleIconFiles'
propertyValue = '<array>\n'
iconsdir1 = os.path.join(project_dir,'Resources','iphone')
iconsdir2 = os.path.join(project_dir,'Resources')
tempiconslist = sorted(os.listdir(iconsdir1))
tempiconslist += sorted(os.listdir(iconsdir2))
iconslist = list(set(sorted(tempiconslist)))
iconorder = list([iconname+".png",iconname+"@2x.png",iconname+"-72.png",iconname+"-Small-50.png",iconname+"-Small.png",iconname+"-Small@2x.png"])
for type in iconorder:
for nexticon in iconslist:
if type == nexticon:
propertyValue += "\t<string>%s</string>\n" % nexticon
propertyValue += '</array>\n'
self.infoplist_properties[propertyName]=propertyValue
# replace the bundle id with the app id
# in case it's changed
i = plist.index('CFBundleIdentifier')
if i:
i = plist.index('<string>',i+1)
e = plist.index('</string>',i+1)
st = plist[0:i+8]
fn = plist[e:]
plist = st + appid + fn
# replace the version in case it's changed
i = plist.index('CFBundleVersion')
if i:
i = plist.index('<string>',i+1)
e = plist.index('</string>',i+1)
st = plist[0:i+8]
fn = plist[e:]
version = self.properties['version']
plist = st + version + fn
i = plist.rindex('</dict>')
if i:
before = plist[0:i]
after = plist[i:]
newcontent = ''
for p in self.infoplist_properties:
v = self.infoplist_properties[p]
newcontent += ' <key>%s</key>\n %s\n' %(p,v)
plist = before + newcontent + after
f = codecs.open(file,'w+','utf-8','replace')
f.write(plist)
f.close()
return icon
|
#!/usr/bin/env python3
# step 1: import the redis-py client package
import redis
# step 2: define our connection information for Redis
# Replaces with your configuration information
redis_host = "0.0.0.0"
redis_port = 6379
redis_password = ""
def hello_redis():
"""Example Hello Redis Program"""
# step 3: create the Redis Connection object
try:
# The decode_repsonses flag here directs the client to convert the responses from Redis into Python strings
# using the default encoding utf-8. This is client specific.
r = redis.StrictRedis(host=redis_host, port=redis_port, password=redis_password, decode_responses=True)
# step 4: Set the hello message in Redis
# Add code here to set the hello message
# step 5: Retrieve the hello message from Redis
# Change this code to get the hello message from Redis
msg = "Add code to get the message from Redis"
print(msg)
# step 6: increment our run counter
# Add code to track the number of times the program has been run in
# cnt =
# print("Hello Redis has run {} times".format(cnt))
except Exception as e:
print(e)
if __name__ == '__main__':
hello_redis()
|
import sys
import math
with open(sys.argv[1]) as file:
lines = []
for line in file:
lines.append(line)
cordinates = []
for x in range(0, 3):
nums = lines[x].split()
cordinates.append(nums[0])
cordinates.append(nums[1])
cord1X = int(cordinates[0])
cord1Y = int(cordinates[1])
cord2X = int(cordinates[2])
cord2Y = int(cordinates[3])
cord3X = int(cordinates[4])
cord3Y = int(cordinates[5])
if cord1X <= 1000000 and cord1X >= -1000000 and cord2X <= 1000000 and cord2X >= -1000000 and cord1Y <= 1000000 and cord1Y >= -1000000 and cord2Y <= 1000000 and cord2Y >= -1000000 and cord3Y <= 1000000 and cord3Y >= -1000000 and cord3X <= 1000000 and cord3X >= -1000000:
rise1 = (cord1Y * cord1Y) - (cord3Y * cord3Y)
rise2 = (cord2Y * cord2Y) - (cord3Y * cord3Y)
run1 = (cord1X * cord1X) - (cord3X * cord3X)
run2 = (cord2X * cord2X) - (cord3X * cord3X)
slope1 = math.sqrt(rise1 + run1)
slope2 = math.sqrt(rise2 + run2)
if slope1 > slope2:
print ("Callie")
elif slope1 <= slope2:
print ("Hailey")
|
"""
This is an Azure Function that responds at GET /api/greeting.
Using the built-in authentication and authorization capabilities (sometimes
referred to as "Easy Auth") of Azure Functions, offloads part of the authentication
and authorization process by ensuring that every request to this Azure Function has
an access token. That access token has had its signature, issuer (iss), expiry
dates (exp, nbf), and audience (aud) validated. This means all that is left to
perform is any per-function authorization related to your application.
"""
import jwt
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
"""
GET /api/greeting
Scope Required: Greeting.Read
"""
# Extract the access token from the Authorization header
# Authorization: Bearer <access_token>
access_token: str = req.headers["authorization"].split(" ")[1]
# Because Easy Auth has already validated the signature, the validation is not
# performed again, but instead the token is is being decoded only to get access
# to its contained scopes claim.
try:
scopes: str = jwt.decode(
access_token, options={"verify_signature": False, "require": ["scp"]}
)["scp"]
except jwt.PyJWTError:
return func.HttpResponse("Bearer token not valid.", status_code=403)
# This API endpoint requires the "Greeting.Read" scope to be present, if it is
# not, then reject the request with a 403.
if "Greeting.Read" not in scopes.split(" "):
return func.HttpResponse("Missing required scope.", status_code=403)
# Authentication is complete, process request.
return func.HttpResponse(
"Hello, world. You were able to access this because you provided a valid "
"access token with the Greeting.Read scope as a claim.",
status_code=200,
)
|
TOKEN = open("token.txt", "r").read()
|
from top2vec import Top2Vec
import re
from bs4 import BeautifulSoup
from nltk.stem.wordnet import WordNetLemmatizer
import nltk
from wordcloud import WordCloud
nltk.download('wordnet')
global wnl
wnl = WordNetLemmatizer()
# list of custom stopwords
stopwords= set(['br', 'the', 'i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves', 'you', "you're", "you've",\
"you'll", "you'd", 'your', 'yours', 'yourself', 'yourselves', 'he', 'him', 'his', 'himself', \
'she', "she's", 'her', 'hers', 'herself', 'it', "it's", 'its', 'itself', 'they', 'them', 'their',\
'theirs', 'themselves', 'what', 'which', 'who', 'whom', 'this', 'that', "that'll", 'these', 'those', \
'am', 'is', 'are', 'was', 'were', 'be', 'been', 'being', 'have', 'has', 'had', 'having', 'do', 'does', \
'did', 'doing', 'a', 'an', 'the', 'and', 'but', 'if', 'or', 'because', 'as', 'until', 'while', 'of', \
'at', 'by', 'for', 'with', 'about', 'against', 'between', 'into', 'through', 'during', 'before', 'after',\
'above', 'below', 'to', 'from', 'up', 'down', 'in', 'out', 'on', 'off', 'over', 'under', 'again', 'further',\
'then', 'once', 'here', 'there', 'when', 'where', 'why', 'how', 'all', 'any', 'both', 'each', 'few', 'more',\
'most', 'other', 'some', 'such', 'only', 'own', 'same', 'so', 'than', 'too', 'very', \
's', 't', 'can', 'will', 'just', 'don', "don't", 'should', "should've", 'now', 'd', 'll', 'm', 'o', 're', \
've', 'y', 'ain', 'aren', "aren't", 'couldn', "couldn't", 'didn', "didn't", 'doesn', "doesn't", 'hadn',\
"hadn't", 'hasn', "hasn't", 'haven', "haven't", 'isn', "isn't", 'ma', 'mightn', "mightn't", 'mustn',\
"mustn't", 'needn', "needn't", 'shan', "shan't", 'shouldn', "shouldn't", 'wasn', "wasn't", 'weren', "weren't", \
'won', "won't", 'wouldn', "wouldn't", 'hi', 'okay', 'ok', 'ohkay', 'bro', 'bye', 'thanks', 'thank', 'yeah', 'ya', \
'u', 'ur', ])
# https://stackoverflow.com/a/47091490/4084039
def decontracted(phrase):
# specific
phrase = re.sub(r"won't", "will not", phrase)
phrase = re.sub(r"can\'t", "can not", phrase)
# general
phrase = re.sub(r"n\'t", " not", phrase)
phrase = re.sub(r"\'re", " are", phrase)
phrase = re.sub(r"\'s", " is", phrase)
phrase = re.sub(r"\'d", " would", phrase)
phrase = re.sub(r"\'ll", " will", phrase)
phrase = re.sub(r"\'t", " not", phrase)
phrase = re.sub(r"\'ve", " have", phrase)
phrase = re.sub(r"\'m", " am", phrase)
return phrase
def preprocess_text(sentence:str):
#a. remove html and url tags from text
sentence = re.sub(r"http\S+", "", sentence)
sentence = BeautifulSoup(sentence, 'lxml').get_text()
#b.expand contracted terms
sentence = decontracted(sentence)
#c.remove non aplhabet characters
sentence = re.sub("\S*\d\S*", "", sentence).strip()
sentence = re.sub('[^A-Za-z]+', ' ', sentence)
#d. lemmatize each word in sentence
#e. and turn them into lower case
#list of stop words: https://gist.github.com/sebleier/554280
sentence = ' '.join(wnl.lemmatize(word.lower()) for word in sentence.
split() if word.lower() not in stopwords)
return sentence
def get_topics(df):
"""
Preprocesses conversations to prepare it for Topic modelling
Returns list of wordclouds of top two topics
"""
df = df[df.message != '<Media omitted>']
df = df[df.message != 'This message was deleted']
documents = df['message'].apply(preprocess_text)
model = Top2Vec(documents=documents.tolist(), speed="learn", workers=-1)
num_topics = model.get_num_topics()
if num_topics >= 2:
topic_words, word_scores, topic_nums = model.get_topics(2)
elif num_topics == 1:
topic_words, word_scores, topic_nums = model.get_topics(1)
else:
return []
clouds = []
for topic in topic_words[:2]:
wc = WordCloud(width=700, height=300, min_font_size=12, background_color='white')
wc = wc.generate(' '.join(topic))
clouds.append(wc)
del model
del documents
return clouds
|
"""Test cases for base order's interface."""
import pytest
from quantfinpy.instrument.instrument import Instrument
from quantfinpy.order.limit import LimitOrder
from quantfinpy.order.order import Order, OrderSide
from quantfinpy.order.stop_limit import StopLimitOrder
@pytest.mark.parametrize(
["quantity", "expected_order_side"], [(1.0, OrderSide.BUY), (-1.0, OrderSide.SELL)]
)
def test_stop_limit_order_ctor(
default_instrument: Instrument, quantity: float, expected_order_side: OrderSide
):
# Creating a stop limit order.
stop_price: float = 1.0
limit_price: float = stop_price + 1
stop_limit_order = StopLimitOrder(
default_instrument, quantity, stop_price, limit_price
)
# Checking built stop limit order.
assert isinstance(stop_limit_order, Order)
assert isinstance(stop_limit_order, StopLimitOrder)
assert stop_limit_order.instrument == default_instrument
assert stop_limit_order.quantity == quantity
assert stop_limit_order.side == expected_order_side
assert stop_limit_order.stop_price == stop_price
assert stop_limit_order.limit == limit_price
assert stop_limit_order.limit_order == LimitOrder(
default_instrument, quantity, limit_price
)
@pytest.mark.parametrize(
["market_price", "stop_price"], [(0.0, 0.0), (1.0, 0.0), (0.0, 1.0)]
)
@pytest.mark.parametrize("quantity", [-1.0, 1.0])
def test_stop_order_stop_reached(
default_instrument: Instrument,
market_price: float,
stop_price: float,
quantity: float,
):
# Creating the stop limit order whose limit_reached function is to be checked.
limit_price: float = stop_price + 1
stop_limit_order = StopLimitOrder(
default_instrument, quantity, stop_price, limit_price
)
# Check that StopLimitOrder.limit_reached works in the same way as OrderSide.limit_reached (already tested)
assert stop_limit_order.stop_price_reached(
market_price
) == stop_limit_order.side.limit_reached(market_price, stop_price)
|
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2015 Red Hat, 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.
#
"""Advertise DWH and Reports plugin."""
import gettext
from otopi import plugin
from otopi import util
from ovirt_engine_setup.engine import constants as oenginecons
from ovirt_engine_setup.engine_common import constants as oengcommcons
from ovirt_engine_setup.engine_common import database
from ovirt_engine_setup.engine_common import dwh_history_timekeeping
def _(m):
return gettext.dgettext(message=m, domain='ovirt-engine-setup')
@util.export
class Plugin(plugin.PluginBase):
"""Advertise DWH and Reports plugin."""
def __init__(self, context):
super(Plugin, self).__init__(context=context)
self._dwhHost = None
self._statement = None
@plugin.event(
stage=plugin.Stages.STAGE_MISC,
before=(
oengcommcons.Stages.DB_SCHEMA,
),
condition=lambda self: (
self.environment[oenginecons.CoreEnv.ENABLE] and
not self.environment[oenginecons.EngineDBEnv.NEW_DATABASE]
),
)
def _get_dwh_host(self):
self._statement = database.Statement(
dbenvkeys=oenginecons.Const.ENGINE_DB_ENV_KEYS,
environment=self.environment,
)
self._dwhHost = dwh_history_timekeeping.getValueFromTimekeeping(
statement=self._statement,
name=dwh_history_timekeeping.DB_KEY_HOSTNAME
)
self.logger.debug(
_(
'DWH host is {dwhHost}.'
).format(
dwhHost=self._dwhHost,
)
)
# vim: expandtab tabstop=4 shiftwidth=4
|
from optparse import OptionParser
class InputError(Exception):
"""Exception raised for errors in the input.
Attributes:
expression -- input expression in which the error occurred
message -- explanation of the error
"""
def __init__(self, message):
self.message = message
def add_args_to_dict(option, opt, value, parser):
my_dict = getattr(parser.values, option.dest)
split = value.split(':')
if len(split) != 2:
raise InputError(f'Got "-f {value}" as input value but expect -f filter_key:filter_value1,filter_value2')
my_dict[split[0]] = split[1].split(',')
def get_comma_separated_args(option, opt, value, parser):
setattr(parser.values, option.dest, value.split(','))
class Parser():
def __init__(self):
self.parser = OptionParser()
self.add_option = self.parser.add_option
def add_option_list(self, *args, **kwargs):
self.add_option(*args, type='string', action='callback', callback=get_comma_separated_args, dest=kwargs['dest'], default=list())
def add_filter(self):
self.add_option('-f', '--filter', type='string', action='callback', callback=add_args_to_dict, dest="filter_dict", default=dict())
def add_not_show(self):
self.add_option('-s', '--not_show', type='string', action='callback', callback=get_comma_separated_args, dest = 'not_show', default=list())
def add_dark_background(self):
self.add_option('--dark_background', action='store_true', dest = 'dark_background', default = False)
def get_options(self):
(options, args) = self.parser.parse_args()
return options
|
# Credit to:
# A. Hindle, N. Ernst, M. W. Godfrey, R. C. Holt, and J. Mylopoulos.
# Whats in a name? on the automated topic naming of software maintenance
# activities.
# https://github.com/ishepard/pydriller
# This program takes the names of repo directories as command line arguments
# and searches for commits related to NFRs
# Output for each repo is stored in a csv file
# Author: Aida Radu
# Last updated: August 26, 2019 by Sarah Nadi
from pydriller import GitRepository
from pydriller import RepositoryMining
import sys
import datetime
import pytz
def main():
# mine for non-functional fixes in commit messages -- stem words to catch more commits
# removed generic fix and #
search_terms = ["bug","error","secur","maint", \
"stab","portab","efficien","usab", "perf" \
"reliab", "testab", "changeab", "replac"\
"memory","resource", "runtime", "crash", "leak" \
"attack" , "authenticat", "authoriz", "cipher","crack", \
"decrypt","encrypt","vulnerab","minimize","optimize",\
"slow", "fast"]
# the program is run with command line arguments representing
# github repos
for repo in range(1,len(sys.argv)):
# NB: using the with keyword will close the file automatically
with open(sys.argv[repo].replace('../', '').replace('/','')+".csv","w") as new_file:
new_file.write('{:^40},{:^40}\n'.format('Commit ID:','Commit Message:'))
#doing a 15 day range to make it quick for the demo
for commit in RepositoryMining(sys.argv[repo],only_modifications_with_file_types=['.java','.py'], since=datetime.datetime(2019, 8, 14, tzinfo=pytz.UTC), to=datetime.datetime(2019, 8, 29, tzinfo=pytz.UTC)).traverse_commits():
# bool written avoids duplication if more than one word matches
written = False
msg = commit.msg.lower()
for term in search_terms:
if term.lower() in msg.lower() and filter(msg) and not written:
written = True
# print the commit ID and committer message
new_file.write('{:^40},"{:^40}"\n'.format(commit.hash,msg))
def filter(message):
# message is a string
# returns a boolean
filters = ["typo","npe","spelling"]
safe = True
for word in filters:
if word in message:
safe = False
break
return safe
main()
|
#!/usr/bin/python
# Base imports for all integrations, only remove these at your own risk!
import json
import sys
import os
import time
import pandas as pd
from collections import OrderedDict
import requests
from integration_core import Integration
from IPython.core.magic import (Magics, magics_class, line_magic, cell_magic, line_cell_magic)
from IPython.core.display import HTML
#import IPython.display
from IPython.display import display_html, display, Javascript, FileLink, FileLinks, Image
import ipywidgets as widgets
import jupyter_integrations_utility as jiu
# Put any additional imports specific to your integration here:
import pyodbc as po
@magics_class # Not sure about this, should pyodbc work by itself? Or should we
class Pyodbc(Integration):
# Static Variables
# The name of the integration
# The class name (Start) should be changed to match the name_str, but with the first letter upper cased.
name_str = "pyodbc"
instances = {}
# These are the ENV variables the integration will check when starting up. The integration_base prefix will be prepended in checking (that defaults to JUPYTER_)
# So the following two items will look for:
# JUPYTER_START_BASE_URL and put it into the opts dict as start_base_url
# JUPYTER_START_USER as put it in the opts dict as start_user
custom_evars = ["pyodbc_conn_default"]
# These are the variables in the opts dict that allowed to be set by the user. These are specific to this custom integration and are joined
# with the base_allowed_set_opts from the integration base
# The three examples here would be "start_base_url, start_ignore_ssl_warn, and start_verbose_errors
# Make sure these are defined in myopts!
custom_allowed_set_opts = ["pyodbc_conn_default"]
# These are the custom options for your integration
myopts = {}
myopts['pyodbc_max_rows'] = [1000, 'Max number of rows to return, will potentially add this to queries']
myopts['pyodbc_conn_default'] = ["default", 'Default instance name for connections']
# Class Init function - Obtain a reference to the get_ipython()
def __init__(self, shell, debug=False, *args, **kwargs):
super(Pyodbc, self).__init__(shell, debug=debug)
self.debug = debug
#Add local variables to opts dict
for k in self.myopts.keys():
self.opts[k] = self.myopts[k]
self.load_env(self.custom_evars)
self.parse_instances()
# We use a custom disconnect in pyodbc so we try to close the connection before nuking it
def customDisconnect(self, instance):
try:
self.instances[instance]['connection'].close()
except:
pass
self.instances[instance]['connection'] = None
self.instances[instance]['session'] = None
self.instances[instance]['connected'] = False
#self.instances[instance]['connect_pass'] = None # Should we clear the password when we disconnect? I am going to change this to no for now
def req_password(self, instance):
opts = None
retval = True
try:
opts = self.instances[instance]['options']
except:
print("Instance %s options not found" % instance)
try:
if opts['use_integrated_security'] == 1:
retval = False
except:
pass
return retval
def customAuth(self, instance):
result = -1
inst = None
int_sec = False
if instance not in self.instances.keys():
print("Instance %s not found in instances - Connection Failed" % instance)
result = -3
else:
inst = self.instances[instance]
if inst is not None:
try:
if inst['options']['use_integrated_security'] == 1:
int_sec = True
except:
pass
kar = [
["dsn", "DSN"], ["dbcname", "DBCNAME"], ["host", "Host"], ["port", "Port"], ["default_db", "Database"], ["authmech", "AuthMech"],
["usesasl", "UserSASL"], ["user", "UID"], ["enc_pass", "PWD"], ["usessl", "SSL"], ["allowselfsignedcert", "AllowSelfSignedServerCert"]
]
top_level = ["user", "host", "port", "enc_pass"]
var = []
conn_vars = []
for x in kar:
if x[0] in top_level:
if int_sec == True and x[0] in ["user", "enc_pass"]: # No need to put UID and PWD in connect string
pass
else:
try:
tval = inst[x[0]]
except:
tval = None
tkey = x[1]
if x[0] == "enc_pass":
tval = self.ret_dec_pass(tval)
inst['connect_pass'] = ""
else:
tval = self.checkvar(instance, x[0])
tkey = x[1]
if tval is not None:
conn_vars.append([tkey, tval])
conn_string = ""
for c in conn_vars:
conn_string += "%s=%s; " % (c[0], c[1])
conn_string = conn_string[0:-2]
#conn_string = "DSN=%s; Host=%s; Port=%s; Database=%s; AuthMech=%s; UseSASL=%s; UID=%s; PWD=%s; SSL=%s; AllowSelfSignedServerCert=%s" % (var[0], var[1], var[2], var[3], var[4], var[5], var[6], var[7], var[8], var[9])
try:
self.instances[instance]['connection'] = po.connect(conn_string, autocommit=True)
self.session = self.instances[instance]['connection'].cursor()
result = 0
except Exception as e:
str_err = str(e)
print("Unable to connect Error:\n%s" % str_err)
result = -2
# Here you can check if the authentication on connect is successful. If it's good, return 0, otherwise return something else and show an error
return result
def validateQuery(self, query, instance):
bRun = True
bReRun = False
if self.instances[instance]['last_query'] == query:
# If the validation allows rerun, that we are here:
bReRun = True
# Ok, we know if we are rerun or not, so let's now set the last_query (and last use if needed)
self.instances[instance]['last_query'] = query
if query.strip().find("use ") == 0:
self.instances[instance]['last_use'] = query
# Example Validation
# Warn only - Don't change bRun
# This one is looking for a ; in the query. We let it run, but we warn the user
# Basically, we print a warning but don't change the bRun variable and the bReRun doesn't matter
if query.find(";") >= 0:
print("WARNING - Do not type a trailing semi colon on queries, your query will fail (like it probably did here)")
# Warn and don't submit after first attempt - Second attempt go ahead and run
# If the query doesn't have a day query, then maybe we want to WARN the user and not run the query.
# However, if this is the second time in a row that the user has submitted the query, then they must want to run without day
# So if bReRun is True, we allow bRun to stay true. This ensures the user to submit after warnings
if query.lower().find("limit ") < 0:
print("WARNING - Queries shoud have a limit so you don't bonkers your DOM")
# Warn and do not allow submission
# There is no way for a user to submit this query
# if query.lower().find('limit ") < 0:
# print("ERROR - All queries must have a limit clause - Query will not submit without out")
# bRun = False
return bRun
def customQuery(self, query, instance):
mydf = None
status = ""
try:
self.session.execute(query)
mydf = self.as_pandas_DataFrame()
if mydf is not None:
status = "Success"
else:
status = "Success - No Results"
except Exception as e:
mydf = None
str_err = str(e)
if self.debug:
print("Error: %s" % str(e))
status = "Failure - query_error: " + str_err
return mydf, status
# Display Help can be customized
def customOldHelp(self):
self.displayIntegrationHelp()
self.displayQueryHelp("select * from mydatabase.mytable")
def retCustomDesc(self):
return "Jupyter integration for working with the PyODBC based data sources"
def customHelp(self, curout):
n = self.name_str
mn = self.magic_name
m = "%" + mn
mq = "%" + m
table_header = "| Magic | Description |\n"
table_header += "| -------- | ----- |\n"
out = curout
qexamples = []
qexamples.append(["myinstance", "select * from mydatabase.mytable", "Run a sql query against myinstance"])
qexamples.append(["", "select * from mydatabase.mytable", "Run a sql query against the default instance"])
out += self.retQueryHelp(qexamples)
return out
def as_pandas_DataFrame(self):
cursor = self.session
try:
names = [metadata[0] for metadata in cursor.description]
ret = pd.DataFrame([dict(zip(names, row)) for row in cursor], columns=names)
except:
ret = None
return ret
# This is the magic name.
@line_cell_magic
def pyodbc(self, line, cell=None):
if cell is None:
line = line.replace("\r", "")
line_handled = self.handleLine(line)
if self.debug:
print("line: %s" % line)
print("cell: %s" % cell)
if not line_handled: # We based on this we can do custom things for integrations.
if line.lower() == "testintwin":
print("You've found the custom testint winning line magic!")
else:
print("I am sorry, I don't know what you want to do with your line magic, try just %" + self.name_str + " for help options")
else: # This is run is the cell is not none, thus it's a cell to process - For us, that means a query
self.handleCell(cell, line)
|
import battlecode as bc
import random
import sys
import traceback
class IStructure:
"""This is the IStructure interface"""
def __init__(self, gameControl, unitControl, unit, missionControl):
self.gameControl = gameControl
self.unitControl = unitControl
self.missionControl = missionControl
self.unit = unit
self.mission = None
def UpdateMission(self):
"""Updates the Mission"""
if(self.unit.structure_is_built() and self.mission == None):
self.mission = self.missionControl.get_mission(self.unit.unitType)
self.mission_start_round = self.gameControl.round()
self.target_location = None
print("Structure with id {} obtaining new mission {}".format(\
self.unit.id, self.mission.action))
|
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from libcloud.common.google import GoogleOAuth2Credential
from libcloud.container.providers import Provider
from libcloud.container.drivers.kubernetes import KubernetesContainerDriver
from libcloud.common.google import GoogleResponse
from libcloud.common.google import GoogleBaseConnection
API_VERSION = 'v1'
class GKEResponse(GoogleResponse):
pass
class GKEConnection(GoogleBaseConnection):
"""
Connection class for the GKE driver.
GKEConnection extends :class:`google.GoogleBaseConnection` for 3 reasons:
1. modify request_path for GKE URI.
2. Implement gce_params functionality described below.
3. Add request_aggregated_items method for making aggregated API calls.
"""
host = 'container.googleapis.com'
responseCls = GKEResponse
def __init__(self, user_id, key, secure, auth_type=None,
credential_file=None, project=None, **kwargs):
super(GKEConnection, self).__init__(
user_id, key, secure=secure, auth_type=auth_type,
credential_file=credential_file, **kwargs)
self.request_path = '/%s/projects/%s' % (API_VERSION, project)
self.gke_params = None
def pre_connect_hook(self, params, headers):
"""
Update URL parameters with values from self.gke_params.
@inherits: :class:`GoogleBaseConnection.pre_connect_hook`
"""
params, headers = super(GKEConnection, self).pre_connect_hook(params,
headers)
if self.gke_params:
params.update(self.gke_params)
return params, headers
def request(self, *args, **kwargs):
"""
Perform request then do GKE-specific processing of URL params.
@inherits: :class:`GoogleBaseConnection.request`
"""
response = super(GKEConnection, self).request(*args, **kwargs)
# If gce_params has been set, then update the pageToken with the
# nextPageToken so it can be used in the next request.
if self.gke_params:
if 'nextPageToken' in response.object:
self.gke_params['pageToken'] = response.object['nextPageToken']
elif 'pageToken' in self.gke_params:
del self.gke_params['pageToken']
self.gke_params = None
return response
class GKEContainerDriver(KubernetesContainerDriver):
"""
GKE Container Driver class.
This is the primary driver for interacting with Google Container
Engine. It contains all of the standard libcloud methods,
plus additional ex_* methods for more features.
Note that many methods allow either objects or strings (or lists of
objects/strings). In most cases, passing strings instead of objects
will result in additional GKE API calls.
"""
connectionCls = GKEConnection
api_name = 'google'
name = "Google Container Engine"
type = Provider.GKE
website = 'https://container.googleapis.com'
supports_clusters = True
AUTH_URL = "https://container.googleapis.com/auth/"
def __init__(self, user_id, key=None, datacenter=None, project=None,
auth_type=None, scopes=None, credential_file=None,
host=None, port=443, **kwargs):
"""
:param user_id: The email address (for service accounts) or Client ID
(for installed apps) to be used for authentication.
:type user_id: ``str``
:param key: The RSA Key (for service accounts) or file path containing
key or Client Secret (for installed apps) to be used for
authentication.
:type key: ``str``
:keyword datacenter: The name of the datacenter (zone) used for
operations.
:type datacenter: ``str``
:keyword project: Your GKE project name. (required)
:type project: ``str``
:keyword auth_type: Accepted values are "SA" or "IA" or "GKE"
("Service Account" or "Installed Application" or
"GKE" if libcloud is being used on a GKE instance
with service account enabled).
If not supplied, auth_type will be guessed based
on value of user_id or if the code is being
executed in a GKE instance.
:type auth_type: ``str``
:keyword scopes: List of authorization URLs. Default is empty and
grants read/write to Compute, Storage, DNS.
:type scopes: ``list``
:keyword credential_file: Path to file for caching authentication
information used by GKEConnection.
:type credential_file: ``str``
"""
if not project:
raise ValueError('Project name must be specified using '
'"project" keyword.')
if host is None:
host = GKEContainerDriver.website
self.auth_type = auth_type
self.project = project
self.scopes = scopes
self.zone = None
if datacenter is not None:
self.zone = datacenter
self.credential_file = credential_file or \
GoogleOAuth2Credential.default_credential_file + '.' + self.project
super(GKEContainerDriver, self).__init__(user_id, key,
secure=True, host=None,
port=None, **kwargs)
self.base_path = '/%s/projects/%s' % (API_VERSION, self.project)
self.website = GKEContainerDriver.website
def _ex_connection_class_kwargs(self):
return {'auth_type': self.auth_type,
'project': self.project,
'scopes': self.scopes,
'credential_file': self.credential_file}
def list_clusters(self, ex_zone=None):
"""
Return a list of cluster information in the current zone or all zones.
:keyword ex_zone: Optional zone name or None
:type ex_zone: ``str`` or :class:`GCEZone` or
:class:`NodeLocation` or ``None``
"""
request = "/zones/%s/clusters" % (ex_zone)
if ex_zone is None:
request = "/zones/clusters"
response = self.connection.request(request, method='GET').object
return response
def get_server_config(self, ex_zone=None):
"""
Return configuration info about the Container Engine service.
:keyword ex_zone: Optional zone name or None
:type ex_zone: ``str`` or :class:`GCEZone` or
:class:`NodeLocation` or ``None``
"""
if ex_zone is None:
ex_zone = self.zone
request = "/zones/%s/serverconfig" % (ex_zone)
response = self.connection.request(request, method='GET').object
return response
|
def super_root(number):
maximum = 10
minimum = 1
temp = (maximum+minimum)/2
while abs(temp**temp-number) > 0.001:
if temp**temp > number:
maximum = temp
else:
minimum = temp
temp = (maximum+minimum)/2
print(temp)
return temp
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
def check_result(function, number):
result = function(number)
if not isinstance(result, (int, float)):
print("The result should be a float or an integer.")
return False
p = result ** result
if number - 0.001 < p < number + 0.001:
return True
return False
assert check_result(super_root, 4), "Square"
assert check_result(super_root, 9), "Cube"
assert check_result(super_root, 10**10), "Eighty one"
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: modules/drivers/canbus/proto/can_card_parameter.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='modules/drivers/canbus/proto/can_card_parameter.proto',
package='apollo.drivers.canbus',
syntax='proto2',
serialized_pb=_b('\n5modules/drivers/canbus/proto/can_card_parameter.proto\x12\x15\x61pollo.drivers.canbus\"\xbe\x04\n\x10\x43\x41NCardParameter\x12\x43\n\x05\x62rand\x18\x01 \x01(\x0e\x32\x34.apollo.drivers.canbus.CANCardParameter.CANCardBrand\x12\x41\n\x04type\x18\x02 \x01(\x0e\x32\x33.apollo.drivers.canbus.CANCardParameter.CANCardType\x12H\n\nchannel_id\x18\x03 \x01(\x0e\x32\x34.apollo.drivers.canbus.CANCardParameter.CANChannelId\x12G\n\tinterface\x18\x04 \x01(\x0e\x32\x34.apollo.drivers.canbus.CANCardParameter.CANInterface\"M\n\x0c\x43\x41NCardBrand\x12\x0c\n\x08\x46\x41KE_CAN\x10\x00\x12\x0b\n\x07\x45SD_CAN\x10\x01\x12\x12\n\x0eSOCKET_CAN_RAW\x10\x02\x12\x0e\n\nHERMES_CAN\x10\x03\")\n\x0b\x43\x41NCardType\x12\x0c\n\x08PCI_CARD\x10\x00\x12\x0c\n\x08USB_CARD\x10\x01\"a\n\x0c\x43\x41NChannelId\x12\x13\n\x0f\x43HANNEL_ID_ZERO\x10\x00\x12\x12\n\x0e\x43HANNEL_ID_ONE\x10\x01\x12\x12\n\x0e\x43HANNEL_ID_TWO\x10\x02\x12\x14\n\x10\x43HANNEL_ID_THREE\x10\x03\"2\n\x0c\x43\x41NInterface\x12\n\n\x06NATIVE\x10\x00\x12\x0b\n\x07VIRTUAL\x10\x01\x12\t\n\x05SLCAN\x10\x02')
)
_CANCARDPARAMETER_CANCARDBRAND = _descriptor.EnumDescriptor(
name='CANCardBrand',
full_name='apollo.drivers.canbus.CANCardParameter.CANCardBrand',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='FAKE_CAN', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='ESD_CAN', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SOCKET_CAN_RAW', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HERMES_CAN', index=3, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=384,
serialized_end=461,
)
_sym_db.RegisterEnumDescriptor(_CANCARDPARAMETER_CANCARDBRAND)
_CANCARDPARAMETER_CANCARDTYPE = _descriptor.EnumDescriptor(
name='CANCardType',
full_name='apollo.drivers.canbus.CANCardParameter.CANCardType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='PCI_CARD', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='USB_CARD', index=1, number=1,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=463,
serialized_end=504,
)
_sym_db.RegisterEnumDescriptor(_CANCARDPARAMETER_CANCARDTYPE)
_CANCARDPARAMETER_CANCHANNELID = _descriptor.EnumDescriptor(
name='CANChannelId',
full_name='apollo.drivers.canbus.CANCardParameter.CANChannelId',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='CHANNEL_ID_ZERO', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CHANNEL_ID_ONE', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CHANNEL_ID_TWO', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CHANNEL_ID_THREE', index=3, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=506,
serialized_end=603,
)
_sym_db.RegisterEnumDescriptor(_CANCARDPARAMETER_CANCHANNELID)
_CANCARDPARAMETER_CANINTERFACE = _descriptor.EnumDescriptor(
name='CANInterface',
full_name='apollo.drivers.canbus.CANCardParameter.CANInterface',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='NATIVE', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='VIRTUAL', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SLCAN', index=2, number=2,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=605,
serialized_end=655,
)
_sym_db.RegisterEnumDescriptor(_CANCARDPARAMETER_CANINTERFACE)
_CANCARDPARAMETER = _descriptor.Descriptor(
name='CANCardParameter',
full_name='apollo.drivers.canbus.CANCardParameter',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='brand', full_name='apollo.drivers.canbus.CANCardParameter.brand', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='type', full_name='apollo.drivers.canbus.CANCardParameter.type', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='channel_id', full_name='apollo.drivers.canbus.CANCardParameter.channel_id', index=2,
number=3, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='interface', full_name='apollo.drivers.canbus.CANCardParameter.interface', index=3,
number=4, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_CANCARDPARAMETER_CANCARDBRAND,
_CANCARDPARAMETER_CANCARDTYPE,
_CANCARDPARAMETER_CANCHANNELID,
_CANCARDPARAMETER_CANINTERFACE,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=81,
serialized_end=655,
)
_CANCARDPARAMETER.fields_by_name['brand'].enum_type = _CANCARDPARAMETER_CANCARDBRAND
_CANCARDPARAMETER.fields_by_name['type'].enum_type = _CANCARDPARAMETER_CANCARDTYPE
_CANCARDPARAMETER.fields_by_name['channel_id'].enum_type = _CANCARDPARAMETER_CANCHANNELID
_CANCARDPARAMETER.fields_by_name['interface'].enum_type = _CANCARDPARAMETER_CANINTERFACE
_CANCARDPARAMETER_CANCARDBRAND.containing_type = _CANCARDPARAMETER
_CANCARDPARAMETER_CANCARDTYPE.containing_type = _CANCARDPARAMETER
_CANCARDPARAMETER_CANCHANNELID.containing_type = _CANCARDPARAMETER
_CANCARDPARAMETER_CANINTERFACE.containing_type = _CANCARDPARAMETER
DESCRIPTOR.message_types_by_name['CANCardParameter'] = _CANCARDPARAMETER
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
CANCardParameter = _reflection.GeneratedProtocolMessageType('CANCardParameter', (_message.Message,), dict(
DESCRIPTOR = _CANCARDPARAMETER,
__module__ = 'modules.drivers.canbus.proto.can_card_parameter_pb2'
# @@protoc_insertion_point(class_scope:apollo.drivers.canbus.CANCardParameter)
))
_sym_db.RegisterMessage(CANCardParameter)
# @@protoc_insertion_point(module_scope)
|
import pandas
import json
def process_entries(args, entries):
df = pandas.DataFrame(entries)
for groupby in args.groupby:
print(df.groupby(groupby)[args.metrics].mean())
print()
def main(args):
fname = args.subgoal_result_file
with open(fname, 'r') as f:
data = json.load(f)
if 'successes' not in data:
raise ValueError("json file {} does not contain a field successes".format(fname))
if not isinstance(data['successes'], dict):
raise ValueError("json file {}'s success field is not a dict; make sure it was produced by eval_subtasks (not eval_tasks)".format(fname))
for partitions in [['successes'], ['failures'], ['successes', 'failures']]:
partition_name = '+'.join(partitions)
entries = [
log_entry
for partition in partitions
for entries in data[partition].values()
for log_entry in entries
]
print("-" * 40)
print("stats for {}".format(partition_name))
process_entries(args, entries)
print()
print("-" * 40)
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("subgoal_result_file")
parser.add_argument("--metrics", nargs="+", default=['subgoal_success_spl'])
parser.add_argument("--groupby", nargs="+", default=['subgoal_idx', 'subgoal_type'])
args = parser.parse_args()
main(args)
|
# *******************************************************************************
# Copyright 2017 Dell 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.
#
# @microservice: py-core-domain library
# @author: Tyler Cox, Dell
# @version: 1.0.0
# *******************************************************************************
from enum import Enum
class ActionType(Enum):
PROFILE = 1
DEVICE = 2
SERVICE = 3
MANAGER = 4
SCHEDULE = 5
SCHEDULEEVENT = 6
ADDRESSABLE = 7
VALUEDESCRIPTOR = 8
PROVISIONWATCHER = 9
|
checkpoint_config = dict(interval=1)
# yapf:disable
log_config = dict(
interval=50,
hooks=[
dict(type='TextLoggerHook'),
dict(type='TensorboardLoggerHook')
])
# yapf:enable
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = 'pretrain/cascade_rcnn_x101_32x4d_fpn_1x_coco_20200316.pth'
resume_from = 'work_dirs/cascade_rcnn_x101_32x4d_fpn_1x_coco/epoch_9.pth'
workflow = [('train', 1)]
|
import os
import time
from datetime import datetime
from os.path import join
from pathlib import Path
from shutil import copy
import yaml
class LogManager:
def __init__(
self,
filename=None,
prefix=None,
base_folder=None,
base_filename=None,
archive_folder=None
):
# if prefix == None use default
# if prefix == "" -> no preifx
# if prefix == anything else -> use that
with open("../conf.yaml", "r") as stream:
t = yaml.safe_load(stream)[filename]
prefix = prefix or t["prefix"]
if prefix == "None":
print("no prefix")
# for joining
prefix = ""
else:
print("prefix exist", prefix)
if not os.path.exists(prefix):
os.makedirs(prefix)
self.prefix = prefix
nme = filename.split("_")[0]
self.default_base_filename = base_filename or t[
f"default_{nme}_filename"]
self.default_base_folder = base_folder or join(prefix, t[
f"default_{nme}_folder"])
self.default_archive_folder = archive_folder or join(prefix, t[
f"default_archive_folder"])
Path(self.default_base_folder).mkdir(parents=True, exist_ok=True)
Path(self.default_archive_folder).mkdir(parents=True, exist_ok=True)
self.base_full_path = join(self.default_base_folder,
self.default_base_filename)
def _create_archive(self, num_of_rows):
if num_of_rows >= self.log_buffer:
print("archiving")
current_time = str(
datetime.fromtimestamp(time.time())).replace(" ", "_")
full_path = join(self.default_archive_folder, current_time + ".db")
open(full_path, "w+")
copy(self.base_full_path, full_path)
return True
return False
def __enter__(self):
return self
def _close(self):
raise NotImplementedError
def __exit__(self, exc_type, exc_value, exc_traceback):
self._close()
|
"""API documentation"""
from pathlib import Path
from typing import Dict
from yaml import load, SafeLoader
with open(Path(__file__).parent / 'resources' / 'openapi.yml', 'r') as apd_file:
api_docs = load(apd_file, Loader=SafeLoader)
def get_app_info() -> Dict[str, str]:
return {
k : v for k,v in api_docs['info'].items() if k in [
'title',
'version',
'description',
'contact',
'license',
'termsOfService',
]
}
# TODO use examples from openapi.yml to drive examples
|
postagliste_en= {
"CC":"coordinating conjunction",
"CD":"cardinal digit",
"DT":"determiner",
"EX":"existential there (like: 'there is' ... think of it like 'there exists')",
"FW":"foreign word",
"IN":"preposition/subordinating conjunction",
"JJ":"adjective 'big'",
"JJR":"adjective, comparative 'bigger'",
"JJS":"adjective, superlative 'biggest'",
"LS":"list marker 1)",
"MD":"modal could, will",
"NN":"noun, singular 'desk'",
"NNS":"noun plural 'desks'",
"NNP":"proper noun, singular 'Harrison'",
"NNPS":"proper noun, plural 'Americans'",
"PDT":"predeterminer 'all the kids'",
"POS":"possessive ending parent\'s",
"PRP":"personal pronoun I, he, she",
"PRP$":"possessive pronoun my, his, hers",
"RB":"adverb very, silently,",
"RBR":"adverb, comparative better",
"RBS":"adverb, superlative best",
"RP":"particle give up",
"SYM":"symbol",
"TO":"to go 'to' the store.",
"UH":"interjection errrrrrrrm",
"VB":"verb, base form take",
"VBD":"verb, past tense took",
"VBG":"verb, gerund/present participle taking",
"VBN":"verb, past participle taken",
"VBP":"verb, sing. present, non-3d take",
"VBZ":"verb, 3rd person sing. present takes",
"WDT":"wh-determiner which",
"WP":"wh-pronoun who, what",
"WP$":"possessive wh-pronoun whose",
"WRB":"wh-abverb where, when"
}
postagliste_fr={
"ADJ":"adjectif",
"ADJWH":"adjectif interrogatif",
"ADV":"adverbe",
"ADVWH":"adverbe interrogatif",
"CC":"conjonction de coordination",
"CL":"pronom clitique",
"CLO":"pronom clitique objet",
"CLR":"pronom clitique réfléchi",
"CLS":"pronom clitique sujet",
"CS":"conjonction de subordination",
"DET":"déterminant",
"DETWH":"déterminant interrogatif",
"ET":"mot tiré d'une langue étrangère",
"I":"interjection",
"N":"nom",
"NC":"nom commun",
"NPP":"nom propre",
"P":"préposition",
"P+D":"forme contractée préposition et déterminant",
"P+PRO":"forme contractée préposition et pronom",
"PUNC":"ponctuation",
"PREF":"préfixe",
"PRO":"pronom",
"PROREL":"pronom relatif",
"PROWH":"pronom interrogatif",
"V":"verbe",
"VIMP":"forme verbale à l'impératif",
"VINF":"forme verbale à l'infinitif",
"VPP":"participe passé",
"VPR":"participe présent",
"VS":"forme verbale au subjonctif"
}
|
#!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1RdyJt-k8cDntAuyBUwYa_MhwL9m4fwaoGcQ8nQPUPTc'
|
# Solution of;
# Project Euler Problem 430: Range flips
# https://projecteuler.net/problem=430
#
# N disks are placed in a row, indexed 1 to N from left to right. Each disk
# has a black side and white side. Initially all disks show their white side.
# At each turn, two, not necessarily distinct, integers A and B between 1 and
# N (inclusive) are chosen uniformly at random. All disks with an index from A
# to B (inclusive) are flipped. The following example shows the case N = 8. At
# the first turn A = 5 and B = 2, and at the second turn A = 4 and B = 6. Let
# E(N, M) be the expected number of disks that show their white side after M
# turns. We can verify that E(3, 1) = 10/9, E(3, 2) = 5/3, E(10, 4) ≈ 5. 157
# and E(100, 10) ≈ 51. 893. Find E(1010, 4000). Give your answer rounded to 2
# decimal places behind the decimal point.
#
# by lcsm29 http://github.com/lcsm29/project-euler
import timed
def dummy(n):
pass
if __name__ == '__main__':
n = 1000
i = 10000
prob_id = 430
timed.caller(dummy, n, i, prob_id)
|
# -*- coding: utf-8 -*-
from io import open
from os.path import dirname, join
from shutil import rmtree
from unittest import TestCase
from nose.tools import eq_, assert_in, assert_not_in
from sphinx.cmdline import main as sphinx_main
from sphinx.util.osutil import cd
class Tests(TestCase):
"""Tests which require our one big Sphinx tree to be built.
Yes, it's too coupled.
"""
@classmethod
def setup_class(cls):
cls.docs_dir = join(dirname(__file__), 'source', 'docs')
with cd(cls.docs_dir):
if sphinx_main(['dummy', '-b', 'text', '-E', '.', '_build']):
raise RuntimeError('Sphinx build exploded.')
def _file_contents(self, filename):
with open(join(self.docs_dir, '_build', '%s.txt' % filename),
encoding='utf8') as file:
return file.read()
def _file_contents_eq(self, filename, contents):
eq_(self._file_contents(filename), contents)
def test_autofunction_minimal(self):
"""Make sure we render correctly and pull the params out of the JS code
when only the function name is provided."""
self._file_contents_eq(
'autofunction_minimal',
'linkDensity(node)' + DESCRIPTION + FIELDS)
def test_autofunction_explicit(self):
"""Make sure any explicitly provided params override the ones from the
code, and make sure any explicit arbitrary RST content gets
preserved."""
self._file_contents_eq(
'autofunction_explicit',
'linkDensity(snorko, borko[, forko])' + DESCRIPTION + FIELDS + CONTENT)
def test_autofunction_short(self):
"""Make sure the ``:short-name:`` option works."""
self._file_contents_eq(
'autofunction_short',
'someMethod(hi)\n\n Here.\n')
def test_autofunction_long(self):
"""Make sure instance methods get converted to dotted notation which
indexes better in Sphinx."""
self._file_contents_eq(
'autofunction_long',
'ContainingClass.someMethod(hi)\n\n Here.\n')
def test_autofunction_typedef(self):
"""Make sure @typedef uses can be documented with autofunction."""
self._file_contents_eq(
'autofunction_typedef',
u'TypeDefinition()\n\n Arguments:\n * **width** (*Number*) – width in pixels\n')
def test_autofunction_callback(self):
"""Make sure @callback uses can be documented with autofunction."""
self._file_contents_eq(
'autofunction_callback',
u'requestCallback()\n\n Some global callback\n\n Arguments:\n * **responseCode** (*number*) –\n')
def test_autofunction_example(self):
"""Make sure @example tags can be documented with autofunction."""
self._file_contents_eq(
'autofunction_example',
u'exampleTag()\n\n'
' JSDoc example tag\n\n'
' **Examples:**\n\n'
' // This is the example.\n'
' exampleTag();\n')
def test_autoclass(self):
"""Make sure classes show their class comment and constructor
comment."""
contents = self._file_contents('autoclass')
assert_in('Class doc.', contents)
assert_in('Constructor doc.', contents)
def test_autoclass_members(self):
"""Make sure classes list their members if ``:members:`` is specified.
Make sure it shows both functions and attributes and shows getters and
setters as if they are attributes. Make sure it doesn't show private
members.
"""
self._file_contents_eq(
'autoclass_members',
u'class ContainingClass(ho)\n\n Class doc.\n\n Constructor doc.\n\n Arguments:\n * **ho** – A thing\n\n ContainingClass.anotherMethod()\n\n Another.\n\n ContainingClass.bar\n\n Setting this also frobs the frobnicator.\n\n ContainingClass.someMethod(hi)\n\n Here.\n\n ContainingClass.someVar\n\n A var\n\n ContainingClass.yetAnotherMethod()\n\n More.\n')
def test_autoclass_members_list(self):
"""Make sure including a list of names after ``members`` limits it to
those names and follows the order you specify."""
self._file_contents_eq(
'autoclass_members_list',
'class ClosedClass()\n\n Closed class.\n\n ClosedClass.publical3()\n\n Public thing 3.\n\n ClosedClass.publical()\n\n Public thing.\n')
def test_autoclass_members_list_star(self):
"""Make sure including ``*`` in a list of names after
``members`` includes the rest of the names in the normal order
at that point."""
self._file_contents_eq(
'autoclass_members_list_star',
u'class ContainingClass(ho)\n\n Class doc.\n\n Constructor doc.\n\n Arguments:\n * **ho** – A thing\n\n ContainingClass.bar\n\n Setting this also frobs the frobnicator.\n\n ContainingClass.anotherMethod()\n\n Another.\n\n ContainingClass.someVar\n\n A var\n\n ContainingClass.yetAnotherMethod()\n\n More.\n\n ContainingClass.someMethod(hi)\n\n Here.\n')
def test_autoclass_alphabetical(self):
"""Make sure members sort alphabetically when not otherwise specified."""
self._file_contents_eq(
'autoclass_alphabetical',
'class NonAlphabetical()\n\n Non-alphabetical class.\n\n NonAlphabetical.a()\n\n Fun a.\n\n NonAlphabetical.z()\n\n Fun z.\n')
def test_autoclass_private_members(self):
"""Make sure classes list their private members if
``:private-members:`` is specified."""
contents = self._file_contents('autoclass_private_members')
assert_in('secret()', contents)
def test_autoclass_exclude_members(self):
"""Make sure ``exclude-members`` option actually excludes listed
members."""
contents = self._file_contents('autoclass_exclude_members')
assert_in('publical()', contents)
assert_not_in('publical2', contents)
assert_not_in('publical3', contents)
def test_autoclass_example(self):
"""Make sure @example tags can be documented with autoclass."""
self._file_contents_eq(
'autoclass_example',
u'class ExampleClass()\n\n'
' JSDoc example tag for class\n\n'
' **Examples:**\n\n'
' // This is the example.\n'
' new ExampleClass();\n')
def test_autoattribute(self):
"""Make sure ``autoattribute`` works."""
self._file_contents_eq(
'autoattribute',
'ContainingClass.someVar\n\n A var\n')
def test_autoattribute_example(self):
"""Make sure @example tags can be documented with autoattribute."""
self._file_contents_eq(
'autoattribute_example',
u'ExampleAttribute\n\n'
' JSDoc example tag for attribute\n\n'
' **Examples:**\n\n'
' // This is the example.\n'
' console.log(ExampleAttribute);\n')
def test_getter_setter(self):
"""Make sure ES6-style getters and setters can be documented."""
self._file_contents_eq(
'getter_setter',
'ContainingClass.bar\n\n Setting this also frobs the frobnicator.\n')
def test_no_shadowing(self):
"""Make sure we can disambiguate objects of the same name."""
self._file_contents_eq(
'avoid_shadowing',
'more_code.shadow()\n\n Another thing named shadow, to threaten to shadow the one in\n code.js\n')
@classmethod
def teardown_class(cls):
rmtree(join(cls.docs_dir, '_build'))
DESCRIPTION = """
Return the ratio of the inline text length of the links in an
element to the inline text length of the entire element."""
FIELDS = u"""
Arguments:
* **node** (*Node*) – Something of a single type
Throws:
**PartyError|FartyError** – Something with multiple types and a
line that wraps
Returns:
**Number** – What a thing
"""
# Oddly enough, the text renderer renders these bullets with a blank line
# between, but the HTML renderer does make them a single list.
CONTENT = """
Things are "neat".
Off the beat.
* Sweet
* Fleet
"""
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
#Python的线程池实现
# https://blog.51cto.com/1238306/1742627
import queue
import threading
import sys
import time
import urllib
import subprocess
import os
#替我们工作的线程池中的线程
class MyThread(threading.Thread):
def __init__(self, workQueue, resultQueue, timeout=5, **kwargs):
threading.Thread.__init__(self, kwargs=kwargs)
#线程在结束前等待任务队列多长时间
self.timeout = timeout
self.setDaemon(True)
self.workQueue = workQueue
self.resultQueue = resultQueue
self.start()
def run(self):
while True:
try:
#从工作队列中获取一个任务
callable, args, kwargs = self.workQueue.get(timeout=self.timeout)
#我们要执行的任务
arg1 = self.workQueue.qsize()
res = callable(arg1, kwargs)
#报任务返回的结果放在结果队列中
self.resultQueue.put(self.getName() + " | " + str(self.ident) + " | " + str(res))
arg2 = self.resultQueue.qsize()
except queue.Empty: #任务队列空的时候结束此线程
break
except :
print(sys.exc_info())
raise
class ThreadPool:
def __init__(self, num_of_threads=10):
self.workQueue = queue.Queue()
self.resultQueue = queue.Queue()
self.threads = []
self.__createThreadPool(num_of_threads)
def __createThreadPool(self, num_of_threads):
for i in range( num_of_threads ):
thread = MyThread(self.workQueue, self.resultQueue)
print('*****************')
print(thread.workQueue)
print(thread.workQueue.qsize())
print('*****************')
self.threads.append(thread)
print(self.threads)
def wait_for_complete(self):
#等待所有线程完成。
while len(self.threads):
thread = self.threads.pop()
# print(threading.active_count())
# print(threading.enumerate())
#等待线程结束
if thread.isAlive():#判断线程是否还存活来决定是否调用join
thread.join()
def add_job(self, callable, *args, **kwargs):
self.workQueue.put((callable, args, kwargs))
def workerfun(arg1, arg2):
html = ""
try:
time.sleep(1)
# conn = urllib.urlopen('http://www.baidu.com/')
# html = conn.read(20)
html = arg1
processes = subprocess.Popen(
'echo ${PPID} "|" $$',
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
stdin=subprocess.PIPE,
universal_newlines=True,
cwd='/tmp'
)
line = processes.stdout.readline()
line = line.rstrip()
except:
print(sys.exc_info())
return line
def main():
print('start testing')
tp = ThreadPool(5)
for i in range(20):
time.sleep(0.2)
tp.add_job(workerfun, i)
print(tp)
tp.wait_for_complete()
#处理结果
print('result Queue\'s length == %d '% tp.resultQueue.qsize())
while tp.resultQueue.qsize():
print(tp.resultQueue.get())
print('end testing')
if __name__ == '__main__':
main()
|
import logging
import sigopt
from distilbert_run_and_hpo_configurations.distilbert_squad_run_parameters import OptimizationRunParameters
from squad_fine_tuning.optimize_squad_distillation import OptimizeSquadDistillation
class RunsOptimizeSquadDistillation(OptimizeSquadDistillation):
def __init__(self, args_dict):
super().__init__(args_dict)
def main(args_dict, config_dict, sigopt_experiment_id, suggestion_id):
logging.info("arguments passed to distillation training: {}".format(args_dict))
logging.info("configuration passed to distillation training: {}".format(config_dict))
runs_optimize_squad_distillation = RunsOptimizeSquadDistillation(args_dict=args_dict)
parameter_values, args_dict, run_training_squad_distillation, model = runs_optimize_squad_distillation.setup_run(
suggestion_id, args_dict, config_dict)
all_parameters = dict()
all_parameters.update(args_dict)
all_parameters.update(parameter_values)
with sigopt.create_run(name="Distillation Run_experiment_{}_suggestion_{}".format(sigopt_experiment_id,
suggestion_id),
project=args_dict[OptimizationRunParameters.PROJECT_NAME.value]) as run:
run.log_dataset("SQUAD 2.0")
run.log_model("DistilBert for question answering")
run.log_metadata("suggestion_id", suggestion_id)
run.log_metadata("experiment_id", sigopt_experiment_id)
failed, error_str, evaluated_values, results, model = runs_optimize_squad_distillation.try_distillation_tuning(
run_training_squad_distillation,
all_parameters,
model,
run)
if failed is True:
run.log_failure()
run.log_metadata(key="error_str", value=error_str)
else:
run.log_checkpoint(results)
for evaluated_metric in evaluated_values:
run.log_metric(evaluated_metric["name"], evaluated_metric["value"])
return model, evaluated_values, failed, error_str
|
from pbhhg_py.abstract_syntax import *
from pbhhg_py.utils import *
def build_tbl(proc_functional):
def _split(argv):
check_arity(argv, [1, 2])
argv = yield from map_strict(argv)
check_type(argv, String)
src, delimiter = (argv + [String('')])[:2]
if delimiter.value:
pieces = src.value.split(delimiter.value)
else:
pieces = src.value
return List(tuple(String(piece) for piece in pieces))
def _join(argv):
check_arity(argv, [1, 2])
argv = yield from map_strict(argv)
seq, delimiter = (argv + [String('')])[:2]
check_type(seq, List)
check_type(delimiter, String)
pieces = yield from map_strict(seq.value)
check_type(pieces, String)
return String(delimiter.value.join(piece.value for piece in pieces))
return {
'ㅂㄹ': _split, # 분리
'ㄱㅁ': _join, # 꿰매다
}
|
import re
import pytest
from mimesis import Science
from mimesis.data.int.scientific import SI_PREFIXES, SI_PREFIXES_SYM
from mimesis.enums import MeasureUnit, MetricPrefixSign
from mimesis.exceptions import NonEnumerableError
from . import patterns
class TestScience:
@pytest.fixture
def science(self):
return Science()
def test_str(self, science):
assert re.match(patterns.PROVIDER_STR_REGEX, str(science))
def test_rna_sequence(self, science):
result = science.rna_sequence(length=10)
assert isinstance(result, str)
assert len(result) == 10
def test_dna_sequence(self, science):
result = science.dna_sequence(length=10)
assert isinstance(result, str)
assert len(result) == 10
@pytest.mark.parametrize(
"name",
[
MeasureUnit.MASS,
MeasureUnit.INFORMATION,
MeasureUnit.THERMODYNAMIC_TEMPERATURE,
MeasureUnit.AMOUNT_OF_SUBSTANCE,
MeasureUnit.ANGLE,
MeasureUnit.SOLID_ANGLE,
MeasureUnit.FREQUENCY,
MeasureUnit.FORCE,
MeasureUnit.PRESSURE,
MeasureUnit.ENERGY,
MeasureUnit.POWER,
MeasureUnit.ELECTRIC_CHARGE,
MeasureUnit.VOLTAGE,
MeasureUnit.ELECTRIC_CAPACITANCE,
MeasureUnit.ELECTRIC_RESISTANCE,
MeasureUnit.ELECTRICAL_CONDUCTANCE,
MeasureUnit.MAGNETIC_FLUX,
MeasureUnit.MAGNETIC_FLUX_DENSITY,
MeasureUnit.INDUCTANCE,
MeasureUnit.TEMPERATURE,
MeasureUnit.RADIOACTIVITY,
],
)
def test_measure_unit(self, science, name):
result = science.measure_unit(name)
assert result in name.value
symbol = science.measure_unit(name, symbol=True)
assert symbol in name.value
@pytest.mark.parametrize(
"sign, symbol",
[
(MetricPrefixSign.POSITIVE, True),
(MetricPrefixSign.POSITIVE, False),
(MetricPrefixSign.NEGATIVE, True),
(MetricPrefixSign.NEGATIVE, False),
],
)
def test_prefix(self, science, sign, symbol):
prefix = science.metric_prefix(sign=sign, symbol=symbol)
prefixes = SI_PREFIXES_SYM if symbol else SI_PREFIXES
assert prefix in prefixes[sign.value]
with pytest.raises(NonEnumerableError):
science.metric_prefix(sign="nil")
class TestSeededScience:
@pytest.fixture
def s1(self, seed):
return Science(seed=seed)
@pytest.fixture
def s2(self, seed):
return Science(seed=seed)
def test_rna_sequence(self, s1, s2):
assert s1.rna_sequence() == s2.rna_sequence()
assert s1.rna_sequence(length=22) == s2.rna_sequence(length=22)
def test_dna_sequence(self, s1, s2):
assert s1.dna_sequence() == s2.dna_sequence()
assert s1.dna_sequence(length=10) == s2.dna_sequence(length=10)
|
# Generated by Django 2.2.16 on 2020-09-28 19:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tracker', '0010_merge_20200926_1759'),
('tracker', '0012_merge_20200928_1510'),
]
operations = [
]
|
import unittest
from server import FlaskTestServerList
class FlaskTestServerListTestCase(unittest.TestCase):
def test_initialization(self):
server_list = FlaskTestServerList()
self.assertEqual(server_list.len(), 2)
d = {
"AWS": "95.69.98.253",
"GCP": "43.56.87.99",
"Azure": "123.123.33.44",
}
server_list1 = FlaskTestServerList.specify_server_list(d)
self.assertEqual(len(d), server_list1.len())
def test_update_server_from_list(self):
server_list = FlaskTestServerList()
new_servers = ["127.0.0.1", "127.0.0.1", "147.120.147.120"]
server_list.update_server_list_using_list(new_servers)
server_list.print_all_servers()
def test_init_server_from_url(self):
server_list = FlaskTestServerList().init_server_list_from_url("http://127.0.0.1:5000/getserverlists")
self.assertEqual(server_list.len(), 3)
server_list.print_all_servers()
if __name__ == '__main__':
unittest.main()
|
# import threading
# from core.tools.DBTool import *
# from core.tools.RedisTool import *
# from core.const.Do import *
# from core.const.Protocol import *
# from runfunc.runGlobalVars import isCluster
# from runfunc.initial import *
# from allmodels.DubboInterface import DubboInterface
# from allmodels.DubboTestcase import DubboTestcase
#
#
#
# def typeRunServiceDataReport(dataDict,serviceList,taskQueueList):
# serviceFlag = False
# for serviceIndex in range(0, len(serviceList)):
# tmpServiceIndex = serviceList[serviceIndex]
# if dataDict[Do.KEY_RUN_SERVICE_IP] == tmpServiceIndex[Do.KEY_RUN_SERVICE_IP] and dataDict[
# Do.KEY_RUN_SERVICE_PORT] == tmpServiceIndex[Do.KEY_RUN_SERVICE_PORT]:
# serviceFlag = True
# if dataDict[Do.KEY_RUN_SERVICE_MAX_TASK_PROGRESS_NUM] != tmpServiceIndex[
# Do.KEY_RUN_SERVICE_MAX_TASK_PROGRESS_NUM] or dataDict[Do.KEY_RUN_SERVICE_MAX_CASE_PROGRESS_NUM] != \
# tmpServiceIndex[Do.KEY_RUN_SERVICE_MAX_CASE_PROGRESS_NUM]:
# # 执行机上的最大进程数与master不符,更新执行机数量
# tcpStr = '{"do":%s,"%s":%s,"%s":%s}' % (
# Do.TYPE_MASTER_SET_SERVICE_DATA, Do.KEY_RUN_SERVICE_MAX_TASK_PROGRESS_NUM,
# tmpServiceIndex[Do.KEY_RUN_SERVICE_MAX_TASK_PROGRESS_NUM], Do.KEY_RUN_SERVICE_MAX_CASE_PROGRESS_NUM,
# tmpServiceIndex[Do.KEY_RUN_SERVICE_MAX_CASE_PROGRESS_NUM])
# if sendTcp(dataDict[Do.KEY_RUN_SERVICE_IP], dataDict[Do.KEY_RUN_SERVICE_PORT], tcpStr):
# logging.info("执行机上的任务最大进程数与master不符,更新执行机数量成功")
# else:
# logging.error("执行机上的任务最大进程数与master不符,更新执行机数量失败")
# if dataDict[Do.KEY_RUN_SERVICE_PROTOCOL] != tmpServiceIndex[Do.KEY_RUN_SERVICE_PROTOCOL]:
# tmpServiceIndex[Do.KEY_RUN_SERVICE_PROTOCOL] = dataDict[Do.KEY_RUN_SERVICE_PROTOCOL]
# serviceList[serviceIndex] = tmpServiceIndex
#
# db = DBTool()
# db.initGlobalDBConf()
#
# # servicelist中没有这个服务器,判断表中是否有,如果表中没有,加入到servicelist表中记录
#
# sqlRes = db.execute_sql("select * from tb_run_server_conf where serviceIp = '%s' and servicePort = %s" % (
# dataDict[Do.KEY_RUN_SERVICE_IP], dataDict[Do.KEY_RUN_SERVICE_PORT]))
#
# if len(sqlRes) > 0:
# if not serviceFlag:
# tcpStr = '{"do":%s,"%s":%s,"%s":%s}' % (
# Do.TYPE_MASTER_SET_SERVICE_DATA,
# Do.KEY_RUN_SERVICE_MAX_TASK_PROGRESS_NUM,
# sqlRes[0]["maxTaskProgressNum"],
# Do.KEY_RUN_SERVICE_MAX_CASE_PROGRESS_NUM,
# sqlRes[0]["maxCaseProgressNum"])
# if sendTcp(dataDict[Do.KEY_RUN_SERVICE_IP], dataDict[Do.KEY_RUN_SERVICE_PORT],
# tcpStr):
# logging.info("执行机上的任务最大进程数与master不符,更新执行机数量成功")
# else:
# logging.error("执行机上的任务最大进程数与master不符,更新执行机数量失败")
# serviceData = {}
# serviceData[Do.KEY_RUN_SERVICE_IP] = sqlRes[0]["serviceIp"]
# serviceData[Do.KEY_RUN_SERVICE_PORT] = sqlRes[0]["servicePort"]
# serviceData[Do.KEY_RUN_SERVICE_MAX_TASK_PROGRESS_NUM] = sqlRes[0]["maxTaskProgressNum"]
# serviceData[Do.KEY_RUN_SERVICE_CURRENT_TASK_PROGRESS_NUM] = dataDict[
# Do.KEY_RUN_SERVICE_CURRENT_TASK_PROGRESS_NUM]
# serviceData[Do.KEY_RUN_SERVICE_CURRENT_TASK_LIST] = dataDict[Do.KEY_RUN_SERVICE_CURRENT_TASK_LIST]
# serviceData[Do.KEY_RUN_SERVICE_MAX_CASE_PROGRESS_NUM] = sqlRes[0]["maxCaseProgressNum"]
# serviceData[Do.KEY_RUN_SERVICE_CURRENT_CASE_PROGRESS_NUM] = dataDict[
# Do.KEY_RUN_SERVICE_CURRENT_CASE_PROGRESS_NUM]
# serviceData[Do.KEY_RUN_SERVICE_CURRENT_CASE_LIST] = dataDict[Do.KEY_RUN_SERVICE_CURRENT_CASE_LIST]
# serviceData[Do.KEY_RUN_SERVICE_PROTOCOL] = dataDict[Do.KEY_RUN_SERVICE_PROTOCOL]
#
# serviceData[Do.KEY_RUN_SERVICE_LAST_UPDATE_TIME] = datetime.datetime.now()
# serviceList.append(serviceData)
# res = db.execute_sql("UPDATE tb_run_server_conf SET STATUS = 1 WHERE serviceIp = '%s' AND servicePort = %s" % (
# dataDict[Do.KEY_RUN_SERVICE_IP], dataDict[Do.KEY_RUN_SERVICE_PORT]))
#
# if res == False:
# logging.error(
# "%s:%s 状态设为在线失败! %s" % (dataDict[Do.KEY_RUN_SERVICE_IP], dataDict[Do.KEY_RUN_SERVICE_PORT], res))
#
# else:
# logging.info(
# "%s:%s 状态设为在线! %s" % (dataDict[Do.KEY_RUN_SERVICE_IP], dataDict[Do.KEY_RUN_SERVICE_PORT], dataDict))
# db.release()
# else:
# currentTime = get_current_time()
# res = db.execute_sql(
# "insert into tb_run_server_conf (serviceName,serviceIp,servicePort,maxTaskProgressNum,maxCaseProgressNum,status,state,addBy,addTime,modTime) VALUES ('%s','%s',%s,%s,%s,1,1,'master','%s','%s');"
# % (dataDict[Do.KEY_RUN_SERVICE_IP], dataDict[Do.KEY_RUN_SERVICE_IP], dataDict[Do.KEY_RUN_SERVICE_PORT],
# dataDict[Do.KEY_RUN_SERVICE_MAX_TASK_PROGRESS_NUM], dataDict[Do.KEY_RUN_SERVICE_MAX_CASE_PROGRESS_NUM],
# currentTime, currentTime))
# db.release()
# if res == False:
# logging.error("数据插入失败!")
# else:
# logging.info("数据插入成功")
# service = {}
# service[Do.KEY_RUN_SERVICE_IP] = dataDict[Do.KEY_RUN_SERVICE_IP]
# service[Do.KEY_RUN_SERVICE_PORT] = dataDict[Do.KEY_RUN_SERVICE_PORT]
# service[Do.KEY_RUN_SERVICE_MAX_TASK_PROGRESS_NUM] = dataDict[Do.KEY_RUN_SERVICE_MAX_TASK_PROGRESS_NUM]
# service[Do.KEY_RUN_SERVICE_CURRENT_TASK_PROGRESS_NUM] = dataDict[
# Do.KEY_RUN_SERVICE_CURRENT_TASK_PROGRESS_NUM]
# service[Do.KEY_RUN_SERVICE_CURRENT_TASK_LIST] = dataDict[Do.KEY_RUN_SERVICE_CURRENT_TASK_LIST]
# service[Do.KEY_RUN_SERVICE_MAX_CASE_PROGRESS_NUM] = dataDict[Do.KEY_RUN_SERVICE_MAX_CASE_PROGRESS_NUM]
# service[Do.KEY_RUN_SERVICE_CURRENT_CASE_PROGRESS_NUM] = dataDict[
# Do.KEY_RUN_SERVICE_CURRENT_CASE_PROGRESS_NUM]
# service[Do.KEY_RUN_SERVICE_CURRENT_CASE_LIST] = dataDict[Do.KEY_RUN_SERVICE_CURRENT_CASE_LIST]
# service[Do.KEY_RUN_SERVICE_PROTOCOL] = dataDict[Do.KEY_RUN_SERVICE_PROTOCOL]
# service[Do.KEY_RUN_SERVICE_LAST_UPDATE_TIME] = datetime.datetime.now()
# serviceList.append(service)
# taskQueueIndex = 0
# while taskQueueIndex < len(taskQueueList):
# # for taskQueueIndex in range(0,len(taskQueueList)):
# # try:
# tmpTaskQueue = taskQueueList[taskQueueIndex]
# # except Exception:
# # break
# if "%s_%s" % (tmpTaskQueue[Do.TYPE_PROTOCOL], tmpTaskQueue[Do.KEY_TASK_EXECUTE_ID]) in dataDict.keys():
# tmpTaskQueue[isCluster] = int(
# dataDict["%s_%s" % (tmpTaskQueue[Do.TYPE_PROTOCOL], tmpTaskQueue[Do.KEY_TASK_EXECUTE_ID])])
# taskQueueList[taskQueueIndex] = tmpTaskQueue
# break
# taskQueueIndex += 1
#
# def typeTaskCancelDone(dataDict,serviceList,taskQueueList):
# taskQueueIndex = 0
# while taskQueueIndex < len(taskQueueList):
# # for taskQueueIndex in range(0,len(taskQueueList)):
# # try:
# taskQueueIndexDict = taskQueueList[taskQueueIndex]
# # except Exception:
# # break
# if taskQueueIndexDict[Do.KEY_TASK_EXECUTE_ID] == dataDict[Do.KEY_TASK_EXECUTE_ID]:
# taskQueueIndexDict[isCluster] = isClusterConf.cancelTaskDone
# taskQueueList[taskQueueIndex] = taskQueueIndexDict
# taskQueueIndex += 1
# for serviceIndex in range(0, len(serviceList)):
# tmpServiceIndex = serviceList[serviceIndex]
# if "%s_%s" % (dataDict[Do.TYPE_PROTOCOL], dataDict[Do.KEY_TASK_EXECUTE_ID]) in tmpServiceIndex[
# Do.KEY_RUN_SERVICE_CURRENT_TASK_LIST]:
# tmpServiceIndex[Do.KEY_RUN_SERVICE_CURRENT_TASK_LIST].remove(
# "%s_%s" % (dataDict[Do.TYPE_PROTOCOL], dataDict[Do.KEY_TASK_EXECUTE_ID]))
# tmpServiceIndex[Do.KEY_RUN_SERVICE_CURRENT_TASK_PROGRESS_NUM] -= 1
# serviceList[serviceIndex] = tmpServiceIndex
# if Do.KEY_TASK_SUITE_EXECUTE_ID in dataDict.keys() and int(dataDict[Do.KEY_TASK_SUITE_EXECUTE_ID]) != 0:
# try:
# redisCache = RedisTool()
# redisCache.initRedisConf()
# # taskSuiteExecuteData = json.loads(
# # redisCache.get_data("%s_taskSuiteExecuteId_%s" % (dataDict[Do.TYPE_PROTOCOL],dataDict[Do.KEY_TASK_SUITE_EXECUTE_ID])))
# # taskSuiteExecuteData["execStatus"] = ExecStatus.CANCELED
# # redisCache.set_data("%s_taskSuiteExecuteId_%s" % (dataDict[Do.TYPE_PROTOCOL],dataDict[Do.KEY_TASK_SUITE_EXECUTE_ID]),
# # json.dumps(taskSuiteExecuteData))
# redisCache.del_data("%s_taskSuiteExecuteId_%s" % (dataDict[Do.TYPE_PROTOCOL],dataDict[Do.KEY_TASK_SUITE_EXECUTE_ID]))
# cancelTaskSuite(dataDict)
#
# except Exception:
# print(traceback.format_exc())
# logging.error("任务取消时设置任务集状态失败")
# logging.info("taskExecuteDone: 任务取消完毕 %s " % dataDict)
#
# def typeTaskExecuteDone(dataDict,serviceList,taskQueueList):
# dataDict[isCluster] = isClusterConf.runTaskDone
# # print(1111111111111111)
# taskQueueIndex = 0
# while taskQueueIndex < len(taskQueueList):
# # for taskQueueIndex in range(0,len(taskQueueList)):
# # try:
# taskQueueIndexDict = taskQueueList[taskQueueIndex]
# # except Exception:
# # break
# if dataDict[Do.KEY_TASK_EXECUTE_ID] == taskQueueIndexDict[Do.KEY_TASK_EXECUTE_ID]:
# taskQueueIndexDict[isCluster] = isClusterConf.runTaskDone
# taskQueueList[taskQueueIndex] = taskQueueIndexDict
# break
# taskQueueIndex += 1
# # print(22222222222222)
# for serviceIndex in range(0, len(serviceList)):
# tmpServiceIndex = serviceList[serviceIndex]
# if "%s_%s" % (dataDict[Do.TYPE_PROTOCOL], dataDict[Do.KEY_TASK_EXECUTE_ID]) in tmpServiceIndex[
# Do.KEY_RUN_SERVICE_CURRENT_TASK_LIST]:
# tmpServiceIndex[Do.KEY_RUN_SERVICE_CURRENT_TASK_LIST].remove(
# "%s_%s" % (dataDict[Do.TYPE_PROTOCOL], dataDict[Do.KEY_TASK_EXECUTE_ID]))
# tmpServiceIndex[Do.KEY_RUN_SERVICE_CURRENT_TASK_PROGRESS_NUM] -= 1
# serviceList[serviceIndex] = tmpServiceIndex
# break
# # print(333333333333)
# if Do.KEY_TASK_SUITE_EXECUTE_ID in dataDict.keys() and int(dataDict[Do.KEY_TASK_SUITE_EXECUTE_ID]) != 0:
# taskSuiteExecuteId = dataDict[Do.KEY_TASK_SUITE_EXECUTE_ID]
# lastTaskExecuteId = dataDict[Do.KEY_TASK_EXECUTE_ID]
# redisCache = RedisTool()
# redisCache.initRedisConf()
# if dataDict[Do.TYPE_PROTOCOL] == Protocol.HTTP_PROTOCOL:
# # print(777777777777777)
# taskExecuteTableName = "tb_task_execute"
# taskSuiteExecuteTableName = "tb_task_suite_execute"
# elif dataDict[Do.TYPE_PROTOCOL] == Protocol.DUBBO_PROTOCOL:
# taskExecuteTableName = "tb2_dubbo_task_execute"
# taskSuiteExecuteTableName = "tb2_dubbo_task_suite_execute"
# else:
# return
# try:
# taskSuiteExecuteData = json.loads(redisCache.get_data("%s_taskSuiteExecuteId_%s" % (dataDict[Do.TYPE_PROTOCOL],taskSuiteExecuteId)))
# except:
# db = DBTool()
# db.initGlobalDBConf()
# try:
# taskSuiteExecuteData = {"taskExecuteIdList":db.execute_sql("select taskExecuteIdList from %s where id = %s" % (taskSuiteExecuteTableName, taskSuiteExecuteId))[0]["taskExecuteIdList"].split(",")}
# except:
# taskSuiteExecuteData = {"taskExecuteIdList":[]}
# finally:
# db.release()
# lastTask = True
# progressList = []
# testResultList = []
# # print(4444444444444)
# for taskIndex in taskSuiteExecuteData["taskExecuteIdList"]:
# try:
# taskExecStatus = json.loads(
# redisCache.get_data("%s_taskSuite_%s_task_%s" % (dataDict[Do.TYPE_PROTOCOL],taskSuiteExecuteId, taskIndex)))
# testResultList.append(taskExecStatus["testResult"])
# except:
# testResultList.append(db.execute_sql("select execStatus from %s where id=%s" % (taskExecuteTableName, taskIndex))[0]["execStatus"])
#
# if taskExecStatus["execStatus"] != ExecStatus.DONE and taskExecStatus[
# "execStatus"] != ExecStatus.EXCEPTION and \
# taskExecStatus["execStatus"] != ExecStatus.CANCELED:
# lastTask = False
# progressList.append(int(taskExecStatus["progress"]))
# # print(5555555555555555)
# if lastTask:
# # print(6666666666666666666666)
# try:
# db = DBTool()
# db.initGlobalDBConf()
#
# taskListTestResult = {}
# taskListTestResult["testResult"] = ""
# taskListTestResult["task"] = {}
# taskListTestResult["task"]["total"] = 0
# taskListTestResult["task"][ResultConst.PASS] = 0
# taskListTestResult["task"][ResultConst.FAIL] = 0
# taskListTestResult["task"][ResultConst.ERROR] = 0
# taskListTestResult["task"][ResultConst.EXCEPTION] = 0
# taskListTestResult["task"][ResultConst.CANCELED] = 0
# taskListTestResult["caseTotal"] = 0
# taskListTestResult["casePass"] = 0
# taskListTestResult["caseFail"] = 0
# taskListTestResult["caseError"] = 0
# taskListTestResult["caseNnotrun"] = 0
# taskListTestResult["casePerformanceTotal"] = 0
# taskListTestResult["casePerformancePass"] = 0
# taskListTestResult["casePerformanceFail"] = 0
# taskListTestResult["taskList"] = []
# # print(taskSuiteExecuteData)
#
# for taskIndex in taskSuiteExecuteData["taskExecuteIdList"]:
# redisCache.del_data("%s_taskSuite_%s_task_%s" % (dataDict[Do.TYPE_PROTOCOL],taskSuiteExecuteId, taskIndex))
#
# thisTask = db.execute_sql(
# "select id,title,taskId,testResult,testResultMsg,testReportUrl,httpConfKey from %s where id=%s" % (taskExecuteTableName,taskIndex))
#
# if thisTask[0]["testResult"] not in taskListTestResult["task"].keys():
# taskListTestResult["task"][thisTask[0]["testResult"]] = 0
#
# try:
# thisTaskResultMsg = json.loads(thisTask[0]["testResultMsg"])
# taskListTestResult["caseTotal"] += thisTaskResultMsg["totalExecuteSummary"]['total']
# taskListTestResult["casePass"] += thisTaskResultMsg["totalExecuteSummary"]['pass']
# taskListTestResult["caseFail"] += thisTaskResultMsg["totalExecuteSummary"]['fail']
# taskListTestResult["caseError"] += thisTaskResultMsg["totalExecuteSummary"]['error']
# taskListTestResult["caseNnotrun"] += thisTaskResultMsg["totalExecuteSummary"]['notrun']
# if dataDict[Do.TYPE_PROTOCOL] == Protocol.HTTP_PROTOCOL:
# taskListTestResult["casePerformanceTotal"] += thisTaskResultMsg["actualTotalPerformanceDict"][
# 'total']
# taskListTestResult["casePerformancePass"] += thisTaskResultMsg["actualTotalPerformanceDict"][
# 'pass']
# taskListTestResult["casePerformanceFail"] += thisTaskResultMsg["actualTotalPerformanceDict"][
# 'fail']
# actualTotalPerformanceDict = thisTaskResultMsg["actualTotalPerformanceDict"]
# else:
# actualTotalPerformanceDict = {}
#
# taskListTestResult["taskList"].append({"id": thisTask[0]["id"], "taskId": thisTask[0]["taskId"],
# "testResult": thisTask[0]["testResult"],
# "executeSummary": thisTaskResultMsg[
# "totalExecuteSummary"],
# "testReportUrl": thisTask[0]["testReportUrl"],
# "taskName": thisTask[0]["title"],
# "httpConfKey": thisTask[0]["httpConfKey"],
# "actualTotalPerformanceDict": actualTotalPerformanceDict})
# except Exception:
# print(traceback.format_exc())
# taskListTestResult["taskList"].append({"taskId": thisTask[0]["taskId"], "testResult": "CANCEL"})
# taskListTestResult["task"][thisTask[0]["testResult"]] += 1
# taskListTestResult["task"]["total"] += 1
# redisCache.del_data("%s_taskSuiteExecuteId_%s" % (dataDict[Do.TYPE_PROTOCOL],taskSuiteExecuteId))
# # print(testResultList)
# # print(taskSuiteExecuteTableName)
# # print(taskExecuteTableName)
# # taskSuiteResult = db.execute_sql(
# # "select * from tb_task_suite_execute where id = %s" % taskSuiteExecuteId)
# #
# # if taskSuiteResult:
# if ResultConst.CANCELED in testResultList:
# testResult = ResultConst.CANCELED
# elif ResultConst.ERROR in testResultList:
# testResult = ResultConst.ERROR
# elif ResultConst.EXCEPTION in testResultList:
# testResult = ResultConst.EXCEPTION
# elif ResultConst.FAIL in testResultList:
# testResult = ResultConst.FAIL
# elif ResultConst.WARNING in testResultList:
# testResult = ResultConst.WARNING
# else:
# testResult = ResultConst.PASS
# taskListTestResult["testResult"] = testResult
# taskSuiteResult = \
# db.execute_sql("select execTime from %s where id = %s" % (taskSuiteExecuteTableName,taskSuiteExecuteId))[0]
# # print(11111111111111111111111111111)
# lastTaskData = \
# db.execute_sql("select execFinishTime from %s where id=%s" % (taskExecuteTableName,lastTaskExecuteId))[0]
# execTakeTime = (lastTaskData["execFinishTime"] - taskSuiteResult["execTime"]).seconds
# # print(2222222222222222222222222222)
# db.execute_sql(
# "update %s set testResult = '%s',testResultMsg = '%s',execTakeTime = '%s',execFinishTime = '%s' where id = %s" % (
# taskSuiteExecuteTableName,testResult, json.dumps(taskListTestResult, ensure_ascii=False), execTakeTime,
# lastTaskData["execFinishTime"], taskSuiteExecuteId))
# # print(3333333333333333333333333333333)
# taskSuiteResult = \
# db.execute_sql("select * from %s where id = %s" % (taskSuiteExecuteTableName,taskSuiteExecuteId))[0]
# taskSuiteResult['testResultMsg'] = json.dumps(taskListTestResult, ensure_ascii=False)
# # 生成报告
# result, url = generateHttpReport(taskSuiteResult)
# # print(result)
# # print(url)
# # print(44444444444444444444)
# # print(url)
# if result:
# db.execute_sql(
# "update %s set execStatus = %s,testReportUrl = '%s' where id = %s" % (
# taskSuiteExecuteTableName,ExecStatus.DONE, url, taskSuiteExecuteId))
# else:
# db.execute_sql(
# "update %s set execStatus = %s,testReportUrl = '%s' where id = %s" % (
# taskSuiteExecuteTableName,url, ExecStatus.EXCEPTION, ""))
# # print(5555555555555555555555555555555)
# # 发送邮件
# if int(taskSuiteResult["isSendEmail"]) > 0 and taskSuiteResult["emailList"] != "" and len(taskListTestResult["taskList"]) > 0 :
# sendEmailToExecutor(taskSuiteResult)
#
# except Exception:
# print("任务集报告生成失败%s" % traceback.format_exc())
# db.execute_sql(
# "update %s set testResult = '%s',execStatus = %s where id = %s" % (
# taskSuiteExecuteTableName,ResultConst.ERROR, ExecStatus.EXCEPTION, taskSuiteExecuteId))
# finally:
# db.release()
#
# else:
# progressList.sort(reverse=True)
# taskSuiteExecuteData["progress"] = progressList[0]
# redisCache.set_data("%s_taskSuiteExecuteId_%s" % (dataDict[Do.TYPE_PROTOCOL],taskSuiteExecuteId), json.dumps(taskSuiteExecuteData))
#
# def typeTaskCancel(dataDict,taskQueueList,taskCancelQueueList):
# if dataDict not in taskCancelQueueList:
# taskQueueIndex = 0
# while taskQueueIndex < len(taskQueueList):
# # for taskQueueIndex in range(0,len(taskQueueList)):
# # try:
# taskQueueIndexDict = taskQueueList[taskQueueIndex]
# # except Exception:
# # break
# # taskQueueIndexDict = taskQueueList[taskQueueIndex]
# if taskQueueIndexDict[Do.KEY_TASK_EXECUTE_ID] == dataDict[Do.KEY_TASK_EXECUTE_ID]:
# if taskQueueIndexDict[isCluster] == isClusterConf.notRun:
# taskQueueIndexDict[isCluster] = isClusterConf.toCancel
# taskQueueList[taskQueueIndex] = taskQueueIndexDict
# break
# taskQueueIndex += 1
# taskCancelQueueList.append(dataDict)
# if Do.KEY_TASK_SUITE_EXECUTE_ID in dataDict.keys() and int(dataDict[Do.KEY_TASK_SUITE_EXECUTE_ID]) != 0:
# redisCache = RedisTool()
# redisCache.initRedisConf()
# try:
# taskSuiteExecuteData = json.loads(
# redisCache.get_data("%s_taskSuiteExecuteId_%s" % (dataDict[Do.TYPE_PROTOCOL],dataDict[Do.KEY_TASK_SUITE_EXECUTE_ID])))
# except:
# taskSuiteExecuteData = {"taskExecuteIdList": [], "execStatus": 1, "progress": 0}
# taskSuiteExecuteData["execStatus"] = ExecStatus.CANCELED
# redisCache.set_data("%s_taskSuiteExecuteId_%s" % (dataDict[Do.TYPE_PROTOCOL],dataDict[Do.KEY_TASK_SUITE_EXECUTE_ID]),
# json.dumps(taskSuiteExecuteData))
# cancelTaskSuite(dataDict)
# logging.debug("startServer: 任务取消加入taskCancelQueue!")
#
# def typeTaskInitDone(dataDict,taskQueueList):
# dataDict[isCluster] = isClusterConf.runTaskInitDone
# taskQueueIndex = 0
# while taskQueueIndex < len(taskQueueList):
# # for taskQueueIndex in range(0,len(taskQueueList)):
# # try:
# taskQueueIndexDict = taskQueueList[taskQueueIndex]
# # except Exception:
# # break
# if taskQueueIndexDict[Do.KEY_TASK_EXECUTE_ID] == dataDict[Do.KEY_TASK_EXECUTE_ID] and taskQueueIndexDict[
# Do.TYPE_PROTOCOL] == dataDict[Do.TYPE_PROTOCOL]:
# if taskQueueIndexDict[isCluster] == isClusterConf.runTcpSend:
# taskQueueIndexDict[isCluster] = isClusterConf.runTaskInitDone
# taskQueueList[taskQueueIndex] = taskQueueIndexDict
# logging.info("任务%s 初始化完成" % dataDict[Do.KEY_TASK_EXECUTE_ID])
# break
# taskQueueIndex += 1
#
# def typeDebugInterface(dataDict,debugQueueList):
# if dataDict[Do.TYPE_PROTOCOL] == Protocol.HTTP_PROTOCOL:
# httpInterface = HttpInterface(interfaceDebugId=dataDict[Do.KEY_INTERFACE_DEBUG_ID])
# httpInterface.generateByInterfaceDebugId()
# if httpInterface.execStatus != 1:
# logging.info("没有查到接口调试信息interfaceDebugId[%s]" % dataDict[Do.KEY_INTERFACE_DEBUG_ID])
# else:
# dataDict[isCluster] = isClusterConf.notRun
# debugQueueList.append(dataDict)
# elif dataDict[Do.TYPE_PROTOCOL] == Protocol.DUBBO_PROTOCOL:
# dubboInterface = DubboInterface(interfaceDebugId=dataDict[Do.KEY_INTERFACE_DEBUG_ID])
# dubboInterface.generateByInterfaceDebugId()
# if dubboInterface.execStatus != 1:
# logging.info("没有查到接口调试信息interfaceDebugId[%s]" % dataDict[Do.KEY_INTERFACE_DEBUG_ID])
# else:
# dataDict[isCluster] = isClusterConf.notRun
# debugQueueList.append(dataDict)
#
# def typeDebugInterfaceDone(dataDict,serviceList,debugQueueList):
# for debugIndex in range(0, len(debugQueueList)):
# tmpDebugIndex = debugQueueList[debugIndex]
# if Do.KEY_INTERFACE_DEBUG_ID in tmpDebugIndex.keys() and tmpDebugIndex[Do.KEY_INTERFACE_DEBUG_ID] == dataDict[
# Do.KEY_INTERFACE_DEBUG_ID] and tmpDebugIndex[Do.TYPE_PROTOCOL] == dataDict[Do.TYPE_PROTOCOL]:
# tmpDebugIndex[isCluster] = isClusterConf.runDebugDone
# debugQueueList[debugIndex] = tmpDebugIndex
# break
#
# for serviceIndex in range(0, len(serviceList)):
# tmpServiceIndex = serviceList[serviceIndex]
# if "%s_%s" % (dataDict[Do.TYPE_PROTOCOL], dataDict[Do.KEY_INTERFACE_DEBUG_ID]) in tmpServiceIndex[
# Do.KEY_RUN_SERVICE_CURRENT_CASE_LIST]:
# tmpServiceIndex[Do.KEY_RUN_SERVICE_CURRENT_CASE_LIST].remove(
# "%s_%s" % (dataDict[Do.TYPE_PROTOCOL], dataDict[Do.KEY_INTERFACE_DEBUG_ID]))
# tmpServiceIndex[Do.KEY_RUN_SERVICE_CURRENT_CASE_PROGRESS_NUM] -= 1
# serviceList[serviceIndex] = tmpServiceIndex
# break
#
# def typeDebugCase(dataDict,debugQueueList):
# if dataDict[Do.TYPE_PROTOCOL] == Protocol.HTTP_PROTOCOL:
# httpTestCase = HttpTestcase()
# httpTestCase.generateByCaseDebugIdAndCaseStepDebugIdList(dataDict[Do.KEY_CASE_DEBUG_ID],
# dataDict[Do.KEY_CASE_STEP_DEBUG_ID_LIST])
# if httpTestCase.execStatus != 1:
# logging.error("没有查到用例调试信息caseDebugId[%s]" % dataDict[Do.KEY_CASE_DEBUG_ID])
# # conn.send(bytes("没有查到用例调试信息caseDebugId[%s]" % dataDict[Do.KEY_CASE_DEBUG_ID], 'utf8'))
# elif len(httpTestCase.stepTestcaseList) == 0:
# logging.error("用例步骤数量为0 caseDebugId[%s]" % dataDict[Do.KEY_CASE_DEBUG_ID])
# # conn.send(bytes("用例步骤数量为0 caseDebugId[%s]" % dataDict[Do.KEY_CASE_DEBUG_ID], 'utf8'))
# else:
# dataDict[isCluster] = isClusterConf.notRun
# debugQueueList.append(dataDict)
# elif dataDict[Do.TYPE_PROTOCOL] == Protocol.DUBBO_PROTOCOL:
# dubboTestCase = DubboTestcase()
# dubboTestCase.generateByCaseDebugIdAndCaseStepDebugIdList(dataDict[Do.KEY_CASE_DEBUG_ID],
# dataDict[Do.KEY_CASE_STEP_DEBUG_ID_LIST])
# if dubboTestCase.execStatus != 1:
# logging.error("没有查到用例调试信息caseDebugId[%s]" % dataDict[Do.KEY_CASE_DEBUG_ID])
# # conn.send(bytes("没有查到用例调试信息caseDebugId[%s]" % dataDict[Do.KEY_CASE_DEBUG_ID], 'utf8'))
# elif len(dubboTestCase.stepTestcaseList) == 0:
# logging.error("用例步骤数量为0 caseDebugId[%s]" % dataDict[Do.KEY_CASE_DEBUG_ID])
# # conn.send(bytes("用例步骤数量为0 caseDebugId[%s]" % dataDict[Do.KEY_CASE_DEBUG_ID], 'utf8'))
# else:
# dataDict[isCluster] = isClusterConf.notRun
# debugQueueList.append(dataDict)
#
#
# def typeDebugCaseDone(dataDict,serviceList,debugQueueList):
# for debugIndex in range(0, len(debugQueueList)):
# tmpDebugIndex = debugQueueList[debugIndex]
# if Do.KEY_CASE_DEBUG_ID in tmpDebugIndex.keys() and tmpDebugIndex[Do.KEY_CASE_DEBUG_ID] == dataDict[
# Do.KEY_CASE_DEBUG_ID] and tmpDebugIndex[Do.TYPE_PROTOCOL] == dataDict[Do.TYPE_PROTOCOL]:
# tmpDebugIndex[isCluster] = isClusterConf.runDebugDone
# debugQueueList[debugIndex] = tmpDebugIndex
# break
#
# for serviceIndex in range(0, len(serviceList)):
# tmpServiceIndex = serviceList[serviceIndex]
# if "%s_%s" % (dataDict[Do.TYPE_PROTOCOL], dataDict[Do.KEY_CASE_DEBUG_ID]) in tmpServiceIndex[
# Do.KEY_RUN_SERVICE_CURRENT_CASE_LIST]:
# tmpServiceIndex[Do.KEY_RUN_SERVICE_CURRENT_CASE_LIST].remove(
# "%s_%s" % (dataDict[Do.TYPE_PROTOCOL], dataDict[Do.KEY_CASE_DEBUG_ID]))
# tmpServiceIndex[Do.KEY_RUN_SERVICE_CURRENT_CASE_PROGRESS_NUM] -= 1
# serviceList[serviceIndex] = tmpServiceIndex
# break
|
from datetime import datetime
from datetime import date
from django.db import models
from django.db.models import Avg
from django.db.models.fields.files import FileField
from itertools import chain
class User(models.Model):
username = models.CharField(max_length=255, unique=True, verbose_name="账号")
password = models.CharField(max_length=255, verbose_name="密码")
email = models.EmailField(verbose_name="邮箱")
created_time = models.DateTimeField(auto_now_add=True)
class Meta:
verbose_name_plural = "用户"
verbose_name = "用户"
def __str__(self):
return self.username
class Tags(models.Model):
name = models.CharField(max_length=255, verbose_name="标签", unique=True)
class Meta:
verbose_name = "标签"
verbose_name_plural = "标签"
def __str__(self):
return self.name
class UserTagPrefer(models.Model):
user = models.ForeignKey(
User, on_delete=models.CASCADE, blank=True, verbose_name="用户id",
)
tag = models.ForeignKey(Tags, on_delete=models.CASCADE, verbose_name='标签名')
score = models.FloatField(default=0)
class Meta:
verbose_name = "用户偏好"
verbose_name_plural = "偏好"
def __str__(self):
return self.user.username + str(self.score)
class Movie(models.Model):
tags = models.ManyToManyField(Tags, verbose_name='标签', blank=True)
collect = models.ManyToManyField(User, verbose_name="收藏者", blank=True)
name = models.CharField(verbose_name="电影名称", max_length=255, unique=True)
director = models.CharField(verbose_name="导演名称", max_length=255)
country = models.CharField(verbose_name="国家", max_length=255)
years = models.DateField(verbose_name='上映日期')
leader = models.CharField(verbose_name="主演", max_length=1024)
d_rate_nums = models.IntegerField(verbose_name="豆瓣评价数")
d_rate = models.CharField(verbose_name="豆瓣评分", max_length=255)
intro = models.TextField(verbose_name="描述")
num = models.IntegerField(verbose_name="浏览量", default=0)
origin_image_link = models.URLField(verbose_name='豆瓣图片地址', max_length=255, null=True)
image_link = models.FileField(verbose_name="封面图片", max_length=255, upload_to='movie_cover')
imdb_link = models.URLField(null=True)
@property
def movie_rate(self):
movie_rate = Rate.objects.filter(movie_id=self.id).aggregate(Avg('mark'))['mark__avg']
return movie_rate or '无'
class Meta:
verbose_name = "电影"
verbose_name_plural = "电影"
def __str__(self):
return self.name
def to_dict(self, fields=None, exclude=None):
opts = self._meta
data = {}
for f in chain(opts.concrete_fields, opts.private_fields, opts.many_to_many):
if exclude and f.name in exclude:
continue
if fields and f.name not in fields:
continue
value = f.value_from_object(self)
if isinstance(value, date):
value = value.strftime('%Y-%m-%d')
elif isinstance(f, FileField):
value = value.url if value else None
data[f.name] = value
return data
class Rate(models.Model):
movie = models.ForeignKey(
Movie, on_delete=models.CASCADE, blank=True, null=True, verbose_name="电影id"
)
user = models.ForeignKey(
User, on_delete=models.CASCADE, blank=True, null=True, verbose_name="用户id",
)
mark = models.FloatField(verbose_name="评分")
create_time = models.DateTimeField(verbose_name="发布时间", auto_now_add=True)
@property
def avg_mark(self):
average = Rate.objects.all().aggregate(Avg('mark'))['mark__avg']
return average
class Meta:
verbose_name = "评分信息"
verbose_name_plural = verbose_name
class Comment(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="用户")
content = models.CharField(max_length=255, verbose_name="内容")
create_time = models.DateTimeField(auto_now_add=True)
movie = models.ForeignKey(Movie, on_delete=models.CASCADE, verbose_name="电影")
class Meta:
verbose_name = "评论"
verbose_name_plural = verbose_name
class LikeComment(models.Model):
comment = models.ForeignKey(Comment, on_delete=models.CASCADE, verbose_name='评论')
user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='用户')
class Meta:
verbose_name = "评论点赞"
verbose_name_plural = verbose_name
|
import json
from typing import Optional, Type, Tuple
import pygments.formatters
import pygments.lexer
import pygments.lexers
import pygments.style
import pygments.styles
import pygments.token
from pygments.formatters.terminal import TerminalFormatter
from pygments.formatters.terminal256 import Terminal256Formatter
from pygments.lexer import Lexer
from pygments.lexers.data import JsonLexer
from pygments.lexers.special import TextLexer
from pygments.lexers.text import HttpLexer as PygmentsHttpLexer
from pygments.util import ClassNotFound
from ..lexers.json import EnhancedJsonLexer
from ..lexers.metadata import MetadataLexer
from ..ui.palette import SHADE_NAMES, get_color
from ...context import Environment
from ...plugins import FormatterPlugin
AUTO_STYLE = 'auto' # Follows terminal ANSI color styles
DEFAULT_STYLE = AUTO_STYLE
SOLARIZED_STYLE = 'solarized' # Bundled here
BUNDLED_STYLES = {
SOLARIZED_STYLE,
AUTO_STYLE
}
def get_available_styles():
return BUNDLED_STYLES | set(pygments.styles.get_all_styles())
class ColorFormatter(FormatterPlugin):
"""
Colorize using Pygments
This processor that applies syntax highlighting to the headers,
and also to the body if its content type is recognized.
"""
group_name = 'colors'
metadata_lexer = MetadataLexer()
def __init__(
self,
env: Environment,
explicit_json=False,
color_scheme=DEFAULT_STYLE,
**kwargs
):
super().__init__(**kwargs)
if not env.colors:
self.enabled = False
return
use_auto_style = color_scheme == AUTO_STYLE
has_256_colors = env.colors == 256
if use_auto_style or not has_256_colors:
http_lexer = PygmentsHttpLexer()
body_formatter = header_formatter = TerminalFormatter()
precise = False
else:
from ..lexers.http import SimplifiedHTTPLexer
header_formatter, body_formatter, precise = self.get_formatters(color_scheme)
http_lexer = SimplifiedHTTPLexer(precise=precise)
self.explicit_json = explicit_json # --json
self.header_formatter = header_formatter
self.body_formatter = body_formatter
self.http_lexer = http_lexer
self.metadata_lexer = MetadataLexer(precise=precise)
def format_headers(self, headers: str) -> str:
return pygments.highlight(
code=headers,
lexer=self.http_lexer,
formatter=self.header_formatter,
).strip()
def format_body(self, body: str, mime: str) -> str:
lexer = self.get_lexer_for_body(mime, body)
if lexer:
body = pygments.highlight(
code=body,
lexer=lexer,
formatter=self.body_formatter,
)
return body
def format_metadata(self, metadata: str) -> str:
return pygments.highlight(
code=metadata,
lexer=self.metadata_lexer,
formatter=self.header_formatter,
).strip()
def get_lexer_for_body(
self, mime: str,
body: str
) -> Optional[Type[Lexer]]:
return get_lexer(
mime=mime,
explicit_json=self.explicit_json,
body=body,
)
def get_formatters(self, color_scheme: str) -> Tuple[
pygments.formatter.Formatter,
pygments.formatter.Formatter,
bool
]:
if color_scheme in PIE_STYLES:
header_style, body_style = PIE_STYLES[color_scheme]
precise = True
else:
header_style = self.get_style_class(color_scheme)
body_style = header_style
precise = False
return (
Terminal256Formatter(style=header_style),
Terminal256Formatter(style=body_style),
precise
)
@staticmethod
def get_style_class(color_scheme: str) -> Type[pygments.style.Style]:
try:
return pygments.styles.get_style_by_name(color_scheme)
except ClassNotFound:
return Solarized256Style
def get_lexer(
mime: str,
explicit_json=False,
body=''
) -> Optional[Type[Lexer]]:
# Build candidate mime type and lexer names.
mime_types, lexer_names = [mime], []
type_, subtype = mime.split('/', 1)
if '+' not in subtype:
lexer_names.append(subtype)
else:
subtype_name, subtype_suffix = subtype.split('+', 1)
lexer_names.extend([subtype_name, subtype_suffix])
mime_types.extend([
f'{type_}/{subtype_name}',
f'{type_}/{subtype_suffix}',
])
# As a last resort, if no lexer feels responsible, and
# the subtype contains 'json', take the JSON lexer
if 'json' in subtype:
lexer_names.append('json')
# Try to resolve the right lexer.
lexer = None
for mime_type in mime_types:
try:
lexer = pygments.lexers.get_lexer_for_mimetype(mime_type)
break
except ClassNotFound:
pass
else:
for name in lexer_names:
try:
lexer = pygments.lexers.get_lexer_by_name(name)
except ClassNotFound:
pass
if explicit_json and body and (not lexer or isinstance(lexer, TextLexer)):
# JSON response with an incorrect Content-Type?
try:
json.loads(body) # FIXME: the body also gets parsed in json.py
except ValueError:
pass # Nope
else:
lexer = pygments.lexers.get_lexer_by_name('json')
# Use our own JSON lexer: it supports JSON bodies preceded by non-JSON data
# as well as legit JSON bodies.
if isinstance(lexer, JsonLexer):
lexer = EnhancedJsonLexer()
return lexer
class Solarized256Style(pygments.style.Style):
"""
solarized256
------------
A Pygments style inspired by Solarized's 256 color mode.
:copyright: (c) 2011 by Hank Gay, (c) 2012 by John Mastro.
:license: BSD, see LICENSE for more details.
"""
BASE03 = "#1c1c1c"
BASE02 = "#262626"
BASE01 = "#4e4e4e"
BASE00 = "#585858"
BASE0 = "#808080"
BASE1 = "#8a8a8a"
BASE2 = "#d7d7af"
BASE3 = "#ffffd7"
YELLOW = "#af8700"
ORANGE = "#d75f00"
RED = "#af0000"
MAGENTA = "#af005f"
VIOLET = "#5f5faf"
BLUE = "#0087ff"
CYAN = "#00afaf"
GREEN = "#5f8700"
background_color = BASE03
styles = {
pygments.token.Keyword: GREEN,
pygments.token.Keyword.Constant: ORANGE,
pygments.token.Keyword.Declaration: BLUE,
pygments.token.Keyword.Namespace: ORANGE,
pygments.token.Keyword.Reserved: BLUE,
pygments.token.Keyword.Type: RED,
pygments.token.Name.Attribute: BASE1,
pygments.token.Name.Builtin: BLUE,
pygments.token.Name.Builtin.Pseudo: BLUE,
pygments.token.Name.Class: BLUE,
pygments.token.Name.Constant: ORANGE,
pygments.token.Name.Decorator: BLUE,
pygments.token.Name.Entity: ORANGE,
pygments.token.Name.Exception: YELLOW,
pygments.token.Name.Function: BLUE,
pygments.token.Name.Tag: BLUE,
pygments.token.Name.Variable: BLUE,
pygments.token.String: CYAN,
pygments.token.String.Backtick: BASE01,
pygments.token.String.Char: CYAN,
pygments.token.String.Doc: CYAN,
pygments.token.String.Escape: RED,
pygments.token.String.Heredoc: CYAN,
pygments.token.String.Regex: RED,
pygments.token.Number: CYAN,
pygments.token.Operator: BASE1,
pygments.token.Operator.Word: GREEN,
pygments.token.Comment: BASE01,
pygments.token.Comment.Preproc: GREEN,
pygments.token.Comment.Special: GREEN,
pygments.token.Generic.Deleted: CYAN,
pygments.token.Generic.Emph: 'italic',
pygments.token.Generic.Error: RED,
pygments.token.Generic.Heading: ORANGE,
pygments.token.Generic.Inserted: GREEN,
pygments.token.Generic.Strong: 'bold',
pygments.token.Generic.Subheading: ORANGE,
pygments.token.Token: BASE1,
pygments.token.Token.Other: ORANGE,
}
PIE_HEADER_STYLE = {
# HTTP line / Headers / Etc.
pygments.token.Name.Namespace: 'bold primary',
pygments.token.Keyword.Reserved: 'bold grey',
pygments.token.Operator: 'bold grey',
pygments.token.Number: 'bold grey',
pygments.token.Name.Function.Magic: 'bold green',
pygments.token.Name.Exception: 'bold green',
pygments.token.Name.Attribute: 'blue',
pygments.token.String: 'primary',
# HTTP Methods
pygments.token.Name.Function: 'bold grey',
pygments.token.Name.Function.HTTP.GET: 'bold green',
pygments.token.Name.Function.HTTP.HEAD: 'bold green',
pygments.token.Name.Function.HTTP.POST: 'bold yellow',
pygments.token.Name.Function.HTTP.PUT: 'bold orange',
pygments.token.Name.Function.HTTP.PATCH: 'bold orange',
pygments.token.Name.Function.HTTP.DELETE: 'bold red',
# HTTP status codes
pygments.token.Number.HTTP.INFO: 'bold aqua',
pygments.token.Number.HTTP.OK: 'bold green',
pygments.token.Number.HTTP.REDIRECT: 'bold yellow',
pygments.token.Number.HTTP.CLIENT_ERR: 'bold orange',
pygments.token.Number.HTTP.SERVER_ERR: 'bold red',
# Metadata
pygments.token.Name.Decorator: 'grey',
pygments.token.Number.SPEED.FAST: 'bold green',
pygments.token.Number.SPEED.AVG: 'bold yellow',
pygments.token.Number.SPEED.SLOW: 'bold orange',
pygments.token.Number.SPEED.VERY_SLOW: 'bold red',
}
PIE_BODY_STYLE = {
# {}[]:
pygments.token.Punctuation: 'grey',
# Keys
pygments.token.Name.Tag: 'pink',
# Values
pygments.token.Literal.String: 'green',
pygments.token.Literal.String.Double: 'green',
pygments.token.Literal.Number: 'aqua',
pygments.token.Keyword: 'orange',
# Other stuff
pygments.token.Text: 'primary',
pygments.token.Name.Attribute: 'primary',
pygments.token.Name.Builtin: 'blue',
pygments.token.Name.Builtin.Pseudo: 'blue',
pygments.token.Name.Class: 'blue',
pygments.token.Name.Constant: 'orange',
pygments.token.Name.Decorator: 'blue',
pygments.token.Name.Entity: 'orange',
pygments.token.Name.Exception: 'yellow',
pygments.token.Name.Function: 'blue',
pygments.token.Name.Variable: 'blue',
pygments.token.String: 'aqua',
pygments.token.String.Backtick: 'secondary',
pygments.token.String.Char: 'aqua',
pygments.token.String.Doc: 'aqua',
pygments.token.String.Escape: 'red',
pygments.token.String.Heredoc: 'aqua',
pygments.token.String.Regex: 'red',
pygments.token.Number: 'aqua',
pygments.token.Operator: 'primary',
pygments.token.Operator.Word: 'green',
pygments.token.Comment: 'secondary',
pygments.token.Comment.Preproc: 'green',
pygments.token.Comment.Special: 'green',
pygments.token.Generic.Deleted: 'aqua',
pygments.token.Generic.Emph: 'italic',
pygments.token.Generic.Error: 'red',
pygments.token.Generic.Heading: 'orange',
pygments.token.Generic.Inserted: 'green',
pygments.token.Generic.Strong: 'bold',
pygments.token.Generic.Subheading: 'orange',
pygments.token.Token: 'primary',
pygments.token.Token.Other: 'orange',
}
def make_style(name, raw_styles, shade):
def format_value(value):
return ' '.join(
get_color(part, shade) or part
for part in value.split()
)
bases = (pygments.style.Style,)
data = {
'styles': {
key: format_value(value)
for key, value in raw_styles.items()
}
}
return type(name, bases, data)
def make_styles():
styles = {}
for shade, name in SHADE_NAMES.items():
styles[name] = [
make_style(name, style_map, shade)
for style_name, style_map in [
(f'Pie{name}HeaderStyle', PIE_HEADER_STYLE),
(f'Pie{name}BodyStyle', PIE_BODY_STYLE),
]
]
return styles
PIE_STYLES = make_styles()
BUNDLED_STYLES |= PIE_STYLES.keys()
|
# class : AI for Remote Sensing
# prof. : Dr. Jungho Im (ersgis@unist.ac.kr)
# date : 7, March, 2018
# TA : Daehyeon Han (dhan@unist.ac.kr)
# objectives:
# 1. To load Tensorflow and learn how to use it.
# 2. To run Random Forest with your own retely sensed data in Python.
# Import libraries
import tensorflow as tf
from tensorflow.contrib.tensor_forest.python import tensor_forest # Random forest in TF
from tensorflow.python.ops import resources
import numpy as np
import pandas as pd
# Ignore all GPUs, tf random forest does not benefit from it.
# It is possible to select which GPU will be used, which is much faster in neural nets.
import os
os.environ["CUDA_VISIBLE_DEVICES"] = ""
# Load wildfire data
work_path = '/Users/dhan/Dropbox/Archive/_coursework/2018_1st/AI_RS/week2/lab/Lab1' # Define your work path
cali_path = work_path + '/' + 'cali.csv'
vali_path = work_path + '/' + 'vali.csv'
cali = np.array(pd.read_csv(cali_path, dtype='float32'))
vali = np.array(pd.read_csv(vali_path, dtype='float32'))
cali.shape # You can check the shape of calibration dataset. [15707 samples, 19 variables, 1 label]
vali.shape # You can check the shape of validataion dataset. [4266 samples, 19 variables, 1 label]
# Split your data into X and Y. Here, the last column is the true value.
X_cali = cali[:,:-1]
Y_cali = cali[:,-1]
X_vali = vali[:,:-1]
Y_vali = vali[:,-1]
# Parameters
num_steps = 100 # Total steps to train
num_classes = 2 # The binary wildfire detection
num_features = 19 # Total 19 variables
num_trees = 100
max_nodes = 1000
# Input and Target data
X = tf.placeholder(tf.float32, shape=[None, num_features])
# For random forest, labels must be integers (the class id)
Y = tf.placeholder(tf.int32, shape=[None])
# Random Forest Parameters
hparams = tensor_forest.ForestHParams(num_classes=num_classes,
num_features=num_features,
num_trees=num_trees,
max_nodes=max_nodes).fill()
# Build the Random Forest
forest_graph = tensor_forest.RandomForestGraphs(hparams)
# Get training graph and loss
train_op = forest_graph.training_graph(X, Y)
loss_op = forest_graph.training_loss(X, Y)
# The the prediction.
infer_op= forest_graph.inference_graph(X)
# Compare prediction and true value
correct_prediction = tf.equal(tf.argmax(infer_op, 1), tf.cast(Y, tf.int64))
accuracy_op = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
# Initialize the variables (i.e. assign their default value) and forest resources
init_vars = tf.group(tf.global_variables_initializer(),
resources.initialize_resources(resources.shared_resources()))
# Start TensorFlow session
sess = tf.Session()
# Run the initializer
sess.run(init_vars)
# Training
for i in range(1, num_steps + 1):
# Prepare Data
_, l = sess.run([train_op, loss_op], feed_dict={X: X_cali, Y: Y_cali})
if i % 10 == 0 or i == 1:
acc = sess.run(accuracy_op, feed_dict={X: X_cali, Y: Y_cali})
print('Step %i, Loss: %f, Acc: %f' % (i, l, acc))
# Test Model
print("Test Accuracy:", sess.run(accuracy_op, feed_dict={X: X_vali, Y: Y_vali})) # vali accuracy
pred = sess.run(tf.argmax(infer_op,1), feed_dict={X: X_vali, Y: Y_vali}) # binary prediction results
Step 1, Loss: -0.000000, Acc: 0.886986
Step 10, Loss: -28.320000, Acc: 0.958551
Step 20, Loss: -217.600006, Acc: 0.980262
Step 30, Loss: -540.280029, Acc: 0.988985
Step 40, Loss: -928.460022, Acc: 0.992996
Step 50, Loss: -998.000000, Acc: 0.993506
Step 60, Loss: -998.000000, Acc: 0.993506
Step 70, Loss: -998.000000, Acc: 0.993506
Step 80, Loss: -998.000000, Acc: 0.993506
Step 90, Loss: -998.000000, Acc: 0.993506
Step 100, Loss: -998.000000, Acc: 0.993506
Validation Accuracy: 0.977726
|
# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
|
#!/usr/bin/env python3
################################################################
# Setup Kestrel Jupyter Kernel
#
# This module setups the Kestrel Jupyter kernel:
# 1. install the kernel to Jupyter environment (local env)
# 2. generate codemirror mode for Kestrel based on the
# installed kestrel Python package for syntax highlighting
# 3. install the codemirror mode into Jupyter
#
# Usage: `python3 -m kestrel_jupyter_kernel.setup`
#
################################################################
import os
import tempfile
import json
from jupyter_client.kernelspec import KernelSpecManager
from kestrel_jupyter_kernel.codemirror.setup import update_codemirror_mode
_KERNEL_SPEC = {
"argv": ["python3", "-m", "kestrel_jupyter_kernel", "-f", "{connection_file}"],
"display_name": "Kestrel",
"language": "kestrel",
}
def install_kernelspec():
with tempfile.TemporaryDirectory() as tmp_dirname:
kernel_dirname = os.path.join(tmp_dirname, "kestrel_kernel")
os.mkdir(kernel_dirname)
kernel_filename = os.path.join(kernel_dirname, "kernel.json")
with open(kernel_filename, "w") as kf:
json.dump(_KERNEL_SPEC, kf)
m = KernelSpecManager()
m.install_kernel_spec(kernel_dirname, "kestrel", user=True)
if __name__ == "__main__":
print("Setup Kestrel Jupyter Kernel")
print(" Install new Jupyter kernel ...", end=" ")
install_kernelspec()
print("done")
# generate and install kestrel codemirrmor mode
print(" Compute and install syntax highlighting ...", end=" ")
update_codemirror_mode()
print("done")
|
from loadmodels import loaddiffi, loadlogit, arraydif, arraylogit, loadtheta, arraytheta
from data.dataManipulation import transpose
from data.ReadFile import openfiletest, openfile
from data.CreateCsvFile import create_csv
class main:
data = openfiletest()
# traspose data for diff
diff_data = transpose(data)
# load diff model
loaddiffi(diff_data)
# load data to save to file
difficulty = arraydif(diff_data)
# load logits
loadlogit(data)
# load data to save to file
logs = arraylogit(data)
# create scv file for difficulty
print("Creating csv file for difficulties")
create_csv(difficulty)
# create csv file for logits
print("Creating csv file for logits")
create_csv(logs)
# predict theta
print("Path to file")
data_theta = openfile()
# load data
loadtheta(data_theta)
# load data to save to file
theta = arraytheta(data_theta)
# create scv file for theta
print("Creating csv file for theta")
create_csv(theta)
|
# MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2012, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
import sys, os
if sys.platform != "darwin":
print "GUI: your platform is probably not supported yet"
from guiCocoaCommon import *
from utils import *
import Traits
try:
app
except NameError: # only declare if not yet declared
app = None
def setupAppleMenu():
# http://www.cocoabuilder.com/archive/cocoa/192181-initializing-the-menubar-without-interface-builder.html
# By Robert Nikander
mainMenu = NSMenu.alloc().initWithTitle_("MainMenu")
mi = mainMenu.addItemWithTitle_action_keyEquivalent_("Apple", None, "")
m = NSMenu.alloc().initWithTitle_("Apple")
# strange hack
app.setAppleMenu_(m)
mainMenu.setSubmenu_forItem_(m, mi)
m.addItemWithTitle_action_keyEquivalent_('About MusicPlayer', 'about:', '')
m.addItemWithTitle_action_keyEquivalent_('Main window', 'openMainWindow:', '1')
m.addItemWithTitle_action_keyEquivalent_('Search window', 'openSearchWindow:', '2')
m.addItemWithTitle_action_keyEquivalent_('Minimize window', 'miniaturize:', 'm')
m.addItemWithTitle_action_keyEquivalent_('Close window', 'performClose:', 'w')
m.addItemWithTitle_action_keyEquivalent_('Quit', 'terminate:', 'q')
app.setMainMenu_(mainMenu)
return m
def setupAfterAppFinishedLaunching(delegate):
setupAppleMenu()
setupMainWindow()
app.updateWindows()
print "setupAfterAppFinishedLaunching ready"
class PyAppDelegate(NSObject):
__metaclass__ = ObjCClassAutorenamer
# Doc for AppDelegate protocol:
# https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSApplicationDelegate_Protocol/Reference/Reference.html
def applicationDidFinishLaunching_(self, notification):
print "AppDelegate didFinishLaunching"
try:
from State import modules
for m in modules: m.start()
setupAfterAppFinishedLaunching(self)
except:
sys.excepthook(*sys.exc_info())
def applicationShouldTerminate_(self, app):
print "AppDelegate quit"
from State import modules
# first set/send signals to all modules
for m in modules: m.stop(join=False)
try:
# in case there are any subprocesses, interrupt them
# maybe some modules are hanging and waiting for such
import sys, os, signal
os.kill(0, signal.SIGINT)
except: pass
# now join all
for m in modules: m.stop()
return NSTerminateNow
def applicationOpenUntitledFile_(self, app):
if not getWindow("mainWindow"):
setupMainWindow()
else:
app.activateIgnoringOtherApps_(True)
return True
def userNotificationCenter_shouldPresentNotification_(self, notifCenter, notif):
return True
def openMainWindow_(self, app):
setupMainWindow()
def openSearchWindow_(self, app):
setupSearchWindow()
def about_(self, app):
import webbrowser
webbrowser.open("http://albertz.github.com/music-player/")
def getWindow(name):
global windows
if windows.get(name, None):
return windows[name].nativeGuiObject.window()
return None
def quit():
app.terminate_(None)
def setup():
# Note: not needed when bundled...
mydir = os.path.dirname(__file__)
icon = NSImage.alloc().initWithContentsOfFile_(mydir + "/icon.icns")
if not icon:
print "icon.icns not found"
else:
app.setApplicationIconImage_(icon)
appDelegate = PyAppDelegate.alloc().init()
app.setDelegate_(appDelegate)
appDelegate.retain()
app.finishLaunching()
def buildControlAction(control):
button = NSButton.alloc().initWithFrame_(((0,0), (50.0, 25.0)))
button.setBezelStyle_(NSRoundedBezelStyle)
actionTarget = ButtonActionHandler.alloc().initWithArgs(control.attr, control.parent.subjectObject)
control.buttonActionHandler = actionTarget # keep ref here. button.target() is only a weakref
button.setTarget_(actionTarget)
button.setAction_("click")
def do_update(): button.setTitle_(control.attr.name.decode("utf-8"))
do_update()
button.sizeToFit() # to get height
#button.setFrameSize_((50, button.frame().size.height))
def update(ev, args, kwargs): do_in_mainthread(do_update, wait=False)
control.nativeGuiObject = button
control.updateContent = update
return control
def backgroundColor(control):
if any([(c.attr and c.attr.highlight) for c in control.allParents()]):
return NSColor.blueColor()
return None
def foregroundColor(control):
if any([(c.attr and c.attr.lowlight) for c in control.allParents()]):
return NSColor.disabledControlTextColor()
return NSColor.blackColor()
def buildControlOneLineText(control):
label = NSExtendedTextField.alloc().initWithFrame_(((0, 0), (30.0, 22.0)))
label.setBordered_(False)
if control.attr.withBorder:
label.setBezeled_(True)
label.setBezelStyle_(NSTextFieldRoundedBezel)
label.setDrawsBackground_(False)
label.setEditable_(False)
label.cell().setUsesSingleLineMode_(True)
label.cell().setLineBreakMode_(NSLineBreakByTruncatingTail)
control.nativeGuiObject = label
control.getTextObj = lambda: control.subjectObject
def getTextColor():
if any([(c.attr and c.attr.lowlight) for c in control.allParents()]):
return NSColor.disabledControlTextColor()
return NSColor.blackColor()
control.getTextColor = getTextColor
def update(ev, args, kwargs):
control.subjectObject = control.attr.__get__(control.parent.subjectObject)
s = "???"
try:
labelContent = control.getTextObj()
s = convertToUnicode(labelContent)
except Exception:
sys.excepthook(*sys.exc_info())
def do_update():
label.setStringValue_(s)
if backgroundColor(control):
label.setDrawsBackground_(True)
label.setBackgroundColor_(backgroundColor(control))
label.setTextColor_(foregroundColor(control))
if control.attr.autosizeWidth:
label.sizeToFit()
control.layoutLine()
if label.onMouseEntered or label.onMouseExited:
if getattr(label, "trackingRect", None):
label.removeTrackingRect_(label.trackingRect)
label.trackingRect = label.addTrackingRect_owner_userData_assumeInside_(label.bounds(), label, None, False)
do_in_mainthread(do_update, wait=False)
control.updateContent = update
return control
def buildControlClickableLabel(control):
buildControlOneLineText(control)
control.getTextObj = lambda: control.subjectObject(handleClick=False)
label = control.nativeGuiObject
def onMouseEntered(ev):
if label.backgroundColor() == NSColor.blueColor():
label.setTextColor_(NSColor.grayColor())
else:
label.setTextColor_(NSColor.blueColor())
label.onMouseEntered = onMouseEntered
label.onMouseExited = lambda ev: label.setTextColor_(foregroundColor(control))
def onMouseDown(ev):
try:
control.subjectObject(handleClick=True)
except Exception:
sys.excepthook(*sys.exc_info())
control.parent.updateContent(None,None,None)
label.onMouseDown = onMouseDown
return control
def buildControlEditableText(control):
label = NSExtendedTextField.alloc().initWithFrame_(((0, 0), (30.0, 22.0)))
if control.attr.searchLook:
label.setCell_(NSSearchFieldCell.alloc().init())
label.setBordered_(False)
label.setBezeled_(True)
label.setBezelStyle_(NSTextFieldRoundedBezel)
label.setDrawsBackground_(True)
label.setEditable_(True)
label.cell().setUsesSingleLineMode_(True)
#label.cell().setLineBreakMode_(NSLineBreakByTruncatingTail)
control.nativeGuiObject = label
control.getTextObj = lambda: control.subjectObject()
def update(ev, args, kwargs):
control.subjectObject = control.attr.__get__(control.parent.subjectObject)
s = "???"
try:
labelContent = control.getTextObj()
s = convertToUnicode(labelContent)
except Exception:
sys.excepthook(*sys.exc_info())
def do_update():
label.setStringValue_(s)
do_in_mainthread(do_update, wait=False)
control.updateContent = update
def onTextChange():
try:
control.subjectObject = control.attr.__get__(control.parent.subjectObject)
newText = unicode(label.stringValue())
control.subjectObject(updateText = newText)
except Exception:
sys.excepthook(*sys.exc_info())
label.onTextChange = onTextChange
return control
def buildControlList(control):
list = control.subjectObject
scrollview = NSScrollView.alloc().initWithFrame_(((0.0, 0.0), (80.0, 80.0)))
scrollview.setAutoresizingMask_(NSViewWidthSizable|NSViewHeightSizable)
scrollview.contentView().setAutoresizingMask_(NSViewWidthSizable|NSViewHeightSizable)
scrollview.setDocumentView_(NSFlippedView.alloc().initWithFrame_(((0,0),scrollview.contentSize())))
scrollview.documentView().setAutoresizingMask_(NSViewWidthSizable)
scrollview.setHasVerticalScroller_(True)
scrollview.setDrawsBackground_(False)
scrollview.setBorderType_(NSBezelBorder)
#scrollview.setBorderType_(NSGrooveBorder)
view = NSFlippedView.alloc().initWithFrame_(scrollview.frame())
view.setAutoresizingMask_(NSViewWidthSizable|NSViewHeightSizable)
view.addSubview_(scrollview)
view.control = control
control.nativeGuiObject = view
control.guiObjectList = [] # all access on this list is done in the main thread
control.OuterSpace = (0,0)
# Hm, why did i needed this again? This makes everything slow and because of
# the generic GuiControl.layout(), it also makes it wrong.
#control.childIter = lambda: control.guiObjectList
#control.childGuiObjectsInColumn = lambda: control.guiObjectList
class Updater:
def __init__(self):
from threading import Lock
self.lock = Lock()
self.outstandingUpdate = False
def doUpdate(self):
with self.lock:
if not self.outstandingUpdate: return
x,y = 0,0
for subCtr in control.guiObjectList:
w = scrollview.contentSize().width
h = subCtr.size[1]
subCtr.pos = (x,y)
subCtr.size = (w,h)
y += subCtr.size[1]
scrollview.documentView().setFrameSize_((scrollview.contentSize().width, y))
if control.attr.autoScrolldown:
scrollview.verticalScroller().setFloatValue_(1)
scrollview.contentView().scrollToPoint_(
(0, scrollview.documentView().frame().size.height -
scrollview.contentSize().height))
with self.lock:
self.outstandingUpdate = False
def update(self):
with self.lock:
if self.outstandingUpdate: return
self.outstandingUpdate = True
do_in_mainthread(self.doUpdate, wait=False)
updater = Updater()
class AttrWrapper(UserAttrib):
def __init__(self, index, value, parent):
UserAttrib.__init__(self)
self.index = index
self.value = value
def __get__(self, inst):
return self.value
def buildControlForIndex(index, value):
subCtr = CocoaGuiObject()
subCtr.subjectObject = value
subCtr.parent = control
subCtr.attr = AttrWrapper(index, value, control)
buildControlObject(subCtr)
scrollview.documentView().addSubview_(subCtr.nativeGuiObject)
subCtr.updateContent(None,None,None)
subCtr.autoresize = (False,False,True,False)
subCtr.size = (0,subCtr.size[1]) # so that there isn't any flickering
subCtr.nativeGuiObject.setDrawsBackground_(True)
return subCtr
control.select = None
if control.attr.canHaveFocus:
class SelectionHandling:
# for now, a single index. later maybe a range
index = None
def onInsert(self, index, value):
if index <= self.index: self.index += 1
def onRemove(self, index):
if index < self.index: self.index -= 1
elif index == self.index: self.deselect()
def onClear(self):
self.index = None
def deselect(self):
if self.index is not None:
control.guiObjectList[self.index].nativeGuiObject.setBackgroundColor_(NSColor.textBackgroundColor())
self.index = None
def select(self, index=None):
self.deselect()
if index is None:
if len(control.guiObjectList) == 0: return
index = 0
self.index = index
guiObj = control.guiObjectList[index].nativeGuiObject
guiObj.setBackgroundColor_(NSColor.selectedTextBackgroundColor())
def doScrollUpdate():
if not guiObj.window(): return # window closed or removed from window in the meantime
objFrame = guiObj.frame()
visibleFrame = scrollview.contentView().documentVisibleRect()
if objFrame.origin.y < visibleFrame.origin.y:
scrollview.contentView().scrollToPoint_((0, objFrame.origin.y))
elif objFrame.origin.y + objFrame.size.height > visibleFrame.origin.y + visibleFrame.size.height:
scrollview.contentView().scrollToPoint_((0, objFrame.origin.y + objFrame.size.height - scrollview.contentSize().height))
scrollview.reflectScrolledClipView_(scrollview.contentView())
do_in_mainthread(doScrollUpdate, wait=False)
def onFocus(self):
if self.index is None:
self.select()
view.setDrawsFocusRing(True)
def onLostFocus(self):
view.setDrawsFocusRing(False)
def onKeyDown(self, ev):
# see HIToolbox/Events.h for keycodes
if ev.keyCode() == 125: # down
if self.index is None:
self.select()
elif self.index < len(control.guiObjectList) - 1:
self.select(self.index + 1)
return True
elif ev.keyCode() == 126: # up
if self.index is None:
self.select()
elif self.index > 0:
self.select(self.index - 1)
return True
elif ev.keyCode() == 0x33: # delete
if self.index is not None:
index = self.index
if self.index > 0:
self.select(self.index - 1)
list.remove(index)
return True
elif ev.keyCode() == 0x75: # forward delete
if self.index is not None:
index = self.index
if self.index < len(control.guiObjectList) - 1:
self.select(self.index + 1)
list.remove(index)
return True
def onMouseDown(self, ev):
view.window().makeFirstResponder_(view)
mouseLoc = scrollview.documentView().convertPoint_toView_(ev.locationInWindow(), None)
for index,obj in enumerate(control.guiObjectList):
if NSPointInRect(mouseLoc, obj.nativeGuiObject.frame()):
self.select(index)
return True
def onInternalDrag(self, sourceControl, index, filenames):
if sourceControl.parent is control: # internal drag to myself
oldIndex = self.index
# check if the index is still correct
if control.guiObjectList[oldIndex] is sourceControl:
self.select(index)
list.remove(oldIndex)
control.select = SelectionHandling()
view.onBecomeFirstResponder = control.select.onFocus
view.onResignFirstResponder = control.select.onLostFocus
view.onKeyDown = control.select.onKeyDown
view.onMouseDown = control.select.onMouseDown
control.dragHandler = None
if control.attr.dragHandler:
view.registerForDraggedTypes_([NSFilenamesPboardType])
class DragHandler:
index = None
def __init__(self):
view = NSFlippedView.alloc().initWithFrame_(((0,0),(scrollview.contentSize().width,2)))
view.setAutoresizingMask_(NSViewWidthSizable)
view.setBackgroundColor_(NSColor.blackColor())
self.guiCursor = view
scrollview.documentView().addSubview_(view)
def onDraggingUpdated(self, sender):
self.guiCursor.setDrawsBackground_(True)
scrollview.documentView().addSubview_positioned_relativeTo_(self.guiCursor, NSWindowAbove, None)
dragLoc = scrollview.documentView().convertPoint_toView_(sender.draggingLocation(), None)
self.index = 0
y = 0
for index,obj in enumerate(control.guiObjectList):
frame = obj.nativeGuiObject.frame()
if dragLoc.y > frame.origin.y + frame.size.height / 2:
self.index = index + 1
y = frame.origin.y + frame.size.height
else:
break
self.guiCursor.setFrameOrigin_((0,y - 1))
visibleFrame = scrollview.contentView().documentVisibleRect()
mouseLoc = NSPoint(dragLoc.x - visibleFrame.origin.x, dragLoc.y - visibleFrame.origin.y)
ScrollLimit = 30
Limit = 15
y = None
if mouseLoc.y < Limit:
scrollBy = Limit - mouseLoc.y
y = visibleFrame.origin.y - scrollBy
y = max(y, -ScrollLimit)
elif mouseLoc.y > visibleFrame.size.height - Limit:
scrollBy = mouseLoc.y - visibleFrame.size.height + Limit
y = visibleFrame.origin.y + scrollBy
y = min(y, scrollview.documentView().frame().size.height - visibleFrame.size.height + ScrollLimit)
if y is not None:
scrollview.contentView().scrollToPoint_((0, y))
scrollview.reflectScrolledClipView_(scrollview.contentView())
def onDraggingExited(self, sender):
self.guiCursor.setDrawsBackground_(False)
self.index = None
def onPerformDragOperation(self, sender):
self.guiCursor.setDrawsBackground_(False)
import __builtin__
try:
filenames = __builtin__.list(sender.draggingPasteboard().propertyListForType_(NSFilenamesPboardType))
filenames = map(convertToUnicode, filenames)
index = self.index
internalDragCallback = getattr(sender.draggingSource(), "onInternalDrag", None)
def doDragHandler():
control.attr.dragHandler(
control.parent.subjectObject,
control.subjectObject,
index,
filenames)
if internalDragCallback:
do_in_mainthread(lambda:
internalDragCallback(
control,
index,
filenames),
wait=False)
from threading import Thread
t = Thread(target=doDragHandler, name="DragHandler")
t.daemon = True
t.start()
return True
except:
sys.excepthook(*sys.exc_info())
return False
def onInternalDrag(self, *args):
# Note: This doesn't work if we don't have attr.canHaveFocus. Should be fixed later...
control.select.onInternalDrag(*args)
control.dragHandler = DragHandler()
view.onDraggingUpdated = control.dragHandler.onDraggingUpdated
view.onDraggingExited = control.dragHandler.onDraggingExited
view.onPerformDragOperation = control.dragHandler.onPerformDragOperation
def doInitialFill():
with list.lock:
import __builtin__
listCopy = __builtin__.list(list)
control.guiObjectList = []
Step = 5
def doInitialAddSome(iStart):
for i in range(iStart, min(len(listCopy), iStart+Step)):
control.guiObjectList += [buildControlForIndex(i, listCopy[i])]
updater.update()
for i in xrange(0, len(listCopy), Step):
do_in_mainthread(lambda: doInitialAddSome(i), wait=True)
def list_onInsert(index, value):
control.guiObjectList.insert(index, buildControlForIndex(index, value))
updater.update()
def list_onRemove(index):
control.guiObjectList[index].nativeGuiObject.removeFromSuperview()
del control.guiObjectList[index]
updater.update()
def list_onClear():
for subCtr in control.guiObjectList:
subCtr.nativeGuiObject.removeFromSuperview()
del control.guiObjectList[:]
updater.update()
for ev in ["onInsert","onRemove","onClear"]:
f = locals()["list_" + ev]
def wrap(f=f, ev=ev):
def handler(*args):
if control.select: getattr(control.select, ev)(*args)
f(*args)
return lambda *args: do_in_mainthread(lambda: handler(*args), wait=False)
setattr(list, ev, wrap())
from threading import Thread
t = Thread(target=doInitialFill, name="List initial fill")
t.daemon = True
t.start()
return control
def buildControlTable(control):
scrollview = NSScrollView.alloc().initWithFrame_(((0.0, 0.0), (80.0, 80.0)))
scrollview.setAutoresizingMask_(NSViewWidthSizable|NSViewHeightSizable)
scrollview.contentView().setAutoresizingMask_(NSViewWidthSizable|NSViewHeightSizable)
scrollview.setHasVerticalScroller_(True)
scrollview.setDrawsBackground_(False)
scrollview.setBorderType_(NSBezelBorder)
view = NSFlippedView.alloc().initWithFrame_(scrollview.frame())
view.setAutoresizingMask_(NSViewWidthSizable|NSViewHeightSizable)
view.addSubview_(scrollview)
view.control = control
control.nativeGuiObject = view
table = NSTableView.alloc().initWithFrame_(((0,0),(80,80)))
scrollview.setDocumentView_(table)
scrollview.documentView().setAutoresizingMask_(NSViewWidthSizable)
#array = NSArrayController.alloc().init()
dataSource = TableViewDataSource.alloc().init()
dataSource.data = []
dataSource.formaters = control.attr.type.formaters
control.tableDataSource = dataSource # save ref here because table.dataSource() is only a weakref
table.setDataSource_(dataSource)
table.setColumnAutoresizingStyle_(NSTableViewUniformColumnAutoresizingStyle)
for key in control.attr.type.keys:
column = NSTableColumn.alloc().initWithIdentifier_(key)
column.headerCell().setStringValue_(convertToUnicode(key.capitalize())) # title
column.setEditable_(False)
column.setMinWidth_(30)
column.setSortDescriptorPrototype_(NSSortDescriptor.sortDescriptorWithKey_ascending_(key, True))
table.addTableColumn_(column)
table.setAllowsMultipleSelection_(True)
table.setAutosaveName_(control.name)
table.setAutosaveTableColumns_(True)
def update():
control.subjectObject = control.attr.__get__(control.parent.subjectObject)
value = control.subjectObject
dataSource.data = value
dataSource.resort(table) # initial sort
table.reloadData()
control.updateContent = lambda ev, args, kwargs: update
update() # initial fill
if control.attr.hasUpdateEvent():
control.attr.updateEvent(control.parent.subjectObject).register(update)
return control
def buildControlReal(control):
w,h = control.attr.width, control.attr.height
if not w: w = 70
if not h: h = 20
slider = NSExtendedSlider.alloc().initWithFrame_(((0.0, 0.0), (w, h)))
slider.setMinValue_(control.attr.type.min)
slider.setMaxValue_(control.attr.type.max)
slider.setNumberOfTickMarks_(3)
control.nativeGuiObject = slider
def update(ev, args, kwargs):
control.subjectObject = control.attr.__get__(control.parent.subjectObject)
value = control.subjectObject
do_in_mainthread(lambda: slider.setDoubleValue_(value), wait=False)
control.updateContent = update
def onValueChange(newValue):
control.attr.__set__(control.parent.subjectObject, newValue)
slider.onValueChange = onValueChange
return control
def buildControlObject(control):
subview = NSFlippedView.alloc().initWithFrame_(((10.0, 10.0), (80.0, 80.0)))
subview.control = control
control.nativeGuiObject = subview
control.OuterSpace = (0,0)
w,h = control.setupChilds()
control.size = (w,h)
if control.attr.canHaveFocus:
subview.setDrawsBackground_(True)
subview.onResignFirstResponder = lambda: subview.setBackgroundColor_(NSColor.textBackgroundColor())
subview.onBecomeFirstResponder = lambda: subview.setBackgroundColor_(NSColor.selectedTextBackgroundColor())
if backgroundColor(control):
subview.setDrawsBackground_(True)
subview.setBackgroundColor_(backgroundColor(control))
def onInternalDrag(target, listindex, filenames):
attrChain(target, "dragHandler", "onInternalDrag")(control, listindex, filenames)
def onMouseDragged(ev):
guiObj = control
subjectObj = guiObj.subjectObject
filename = getattr(subjectObj, "url", None)
if not filename: return False
filename = convertToUnicode(filename)
pboard = NSPasteboard.pasteboardWithName_(NSDragPboard)
pboard.declareTypes_owner_([NSFilenamesPboardType], None)
pboard.setPropertyList_forType_([filename], NSFilenamesPboardType)
dragImage = NSWorkspace.sharedWorkspace().iconForFile_(filename)
dragPosition = subview.convertPoint_toView_(ev.locationInWindow(), None)
dragPosition.x -= 16
dragPosition.y += 32
dragSource = DragSource.alloc().init()
dragSource.onInternalDrag = onInternalDrag
subview.dragImage_at_offset_event_pasteboard_source_slideBack_(
dragImage,
dragPosition,
NSZeroSize,
ev,
pboard,
dragSource,
False
)
return True
subview.onMouseDragged = onMouseDragged
return control
def SongDisplayView_MouseClickCallback(x):
from State import state
song = state.player.curSong
if not song: return
if not song.duration: return
if song.duration < 0: return
state.player.seekAbs(x * song.duration)
def buildControlSongDisplay(control):
userAttr = control.attr
inst = control.parent.subjectObject
try:
class SongDisplayView(NSBox):
def mouseDown_(self, event):
location = self.convertPoint_fromView_(event.locationInWindow(), None)
if NSPointInRect(location, self.bounds()):
x = float(location.x) / self.bounds().size.width
if x < 0 or x > 1: return
SongDisplayView_MouseClickCallback(x)
except:
SongDisplayView = objc.lookUpClass("SongDisplayView") # already defined earlier
subview = SongDisplayView.alloc().initWithFrame_(((10.0, 10.0), (80.0, 80.0)))
subview.setTitlePosition_(NSNoTitle)
#subview.setContentViewMargins_((0,0))
imgview = NSImageView.alloc().initWithFrame_(subview.contentView().bounds())
imgview.setImageScaling_(NSScaleToFit)
imgview2 = NSImageView.alloc().initWithFrame_(((0,0), (10, subview.contentView().bounds().size.height)))
imgview2.setImageScaling_(NSScaleToFit)
subview.contentView().addSubview_(imgview)
subview.contentView().addSubview_(imgview2)
imgview.setAutoresizingMask_(NSViewWidthSizable|NSViewHeightSizable)
imgview2.setAutoresizingMask_(NSViewHeightSizable|NSViewMinXMargin|NSViewMaxXMargin)
from threading import Lock
from State import state
class SongDisplay:
def __init__(self):
self.lock = Lock()
self.curSong = None
def initSongCursorImg(self):
img2 = NSImage.alloc().initWithSize_((5,1))
img2.lockFocus()
for i in range(5):
a = 100 - abs(i - 2) * 50
NSColor.colorWithDeviceRed_green_blue_alpha_(0.0,0.0,0.0,a).setFill()
NSBezierPath.fillRect_(((i,0),(1,1)))
img2.unlockFocus()
do_in_mainthread(lambda: imgview2.setImage_(img2))
def setSongBitmap(self, bmpData, wait=True):
with self.lock:
if state.player.curSong is not self.curSong: return None
data = NSData.alloc().initWithBytes_length_(bmpData, len(bmpData))
img = NSImage.alloc().initWithData_(data)
do_in_mainthread(lambda: imgview.setImage_(img), wait=wait)
def getBmpData(self):
better_exchook.install()
pool = NSAutoreleasePool.alloc().init() # for setSongBitmap
bmpData = None
with self.lock:
if state.player.curSong is not self.curSong: return None
if getattr(self.curSong, "bmpThumbnail", None):
bmpData = self.curSong.bmpThumbnail
else:
# create song copy for calcBitmapThumbnail
from Song import Song
song = Song(url=self.curSong.url)
if bmpData:
self.setSongBitmap(bmpData)
del pool
return
do_in_mainthread(lambda: imgview.setImage_(None), wait=False)
def doBmpCalc(queue):
try:
def calcBmpCallback(song, completion, duration, bmpData):
if subview.window() is None: return False # window was closed
with self.lock:
if song != self.curSong: return False
queue.put((duration, bmpData))
return True
song.openFile()
import ffmpeg
bmpThumbRet = ffmpeg.calcBitmapThumbnail(song, 600, 81, procCallback = calcBmpCallback)
if bmpThumbRet:
queue.put(bmpThumbRet)
except:
print "doBmpCalc raised exception"
sys.excepthook(*sys.exc_info())
queue.put(None)
queue = AsyncTask(func=doBmpCalc, name="doBmpCalc for Cocoa")
while True:
bmpThumbRet = queue.get()
if bmpThumbRet is None: break
duration, bmpData = bmpThumbRet
with self.lock:
self.curSong.duration = duration
self.curSong.bmpThumbnail = bmpData
self.setSongBitmap(bmpData, wait=False)
del pool
def playCursorUpdater(self):
better_exchook.install()
pool = NSAutoreleasePool.alloc().init()
def updateCursor():
with self.lock:
if self.curSong is None: return
if state.player.curSong is not self.curSong: return
w = imgview2.frame().size.width
h = imgview2.frame().size.height
x = subview.contentView().bounds().size.width * state.player.curSongPos / self.curSong.duration - w / 2
y = imgview2.frame().origin.y
imgview2.setFrame_(((x,y),(w,h)))
import time
i = 0
while True:
i += 1
time.sleep(0.1)
if subview.window() is None: return # window was closed
with self.lock:
if self.curSong is None: continue
if self.curSong is not state.player.curSong: continue
do_in_mainthread(updateCursor, wait=False)
# another hack: update time
control.parent.childs["curSongPos"].updateContent(None,None,None)
del pool
def update(self, ev, args, kwargs):
#if ev is PlayerEventCallbacks.onSongChange:
with self.lock:
if self.curSong is state.player.curSong: return # song not changed
self.curSong = state.player.curSong
if not self.curSong:
do_in_mainthread(lambda: imgview.setImage_(None), wait=False)
return
from threading import Thread
Thread(target=self.getBmpData, name="GUI song bitmap loader").start()
songDisplay = SongDisplay()
songDisplay.initSongCursorImg()
Thread(target=songDisplay.playCursorUpdater, name="GUI play cursor updater").start()
control.nativeGuiObject = subview
control.updateContent = songDisplay.update
return control
def buildControl(userAttr, parent):
control = CocoaGuiObject()
control.parent = parent
control.attr = userAttr
control.subjectObject = userAttr.__get__(parent.subjectObject)
typeName = userAttr.getTypeClass().__name__
assert userAttr.getTypeClass() is getattr(Traits, typeName)
buildFuncName = "buildControl" + typeName
buildFunc = globals().get(buildFuncName, None)
if buildFunc:
return buildFunc(control)
else:
raise NotImplementedError, "%r not handled yet" % userAttr.type
try:
windows
except NameError:
windows = {}
class CocoaGuiObject(object):
def __init__(self):
# Do that late because we cannot import gui globally here. (circular dep)
import gui
self.__class__.__bases__ = (gui.GuiObject, object)
nativeGuiObject = None
@property
def pos(self): return (self.nativeGuiObject.frame().origin.x, self.nativeGuiObject.frame().origin.y)
@pos.setter
def pos(self, value): self.nativeGuiObject.setFrameOrigin_(value)
@property
def size(self): return (self.nativeGuiObject.frame().size.width, self.nativeGuiObject.frame().size.height)
@size.setter
def size(self, value): self.nativeGuiObject.setFrameSize_(value)
@property
def innerSize(self): return (self.nativeGuiObject.bounds().size.width, self.nativeGuiObject.bounds().size.height)
@property
def autoresize(self):
flags = self.nativeGuiObject.autoresizingMask()
return (flags & NSViewMinXMargin, flags & NSViewMinYMargin, flags & NSViewWidthSizable, flags & NSViewHeightSizable)
@autoresize.setter
def autoresize(self, value):
flags = 0
if value[0]: flags |= NSViewMinXMargin
if value[1]: flags |= NSViewMinYMargin
if value[2]: flags |= NSViewWidthSizable
if value[3]: flags |= NSViewHeightSizable
self.nativeGuiObject.setAutoresizingMask_(flags)
def addChild(self, child):
self.nativeGuiObject.addSubview_(child.nativeGuiObject)
def setupWindow(subjectObject, windowName, title, isMainWindow=False):
# some example code: http://lists.apple.com/archives/cocoa-dev/2004/Jan/msg01389.html
# also, these might be helpful:
# https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ControlCell/ControlCell.html#//apple_ref/doc/uid/10000015i
# http://cocoadev.com/wiki/FlowLayoutView
assert NSThread.isMainThread()
if getWindow(windowName):
getWindow(windowName).makeKeyAndOrderFront_(None)
return
win = NSWindow.alloc()
win.initWithContentRect_styleMask_backing_defer_(
((200.0, 500.0), (400.0, 600.0)),
NSTitledWindowMask |
NSClosableWindowMask |
NSMiniaturizableWindowMask |
NSResizableWindowMask,
NSBackingStoreBuffered, False)
win.setContentView_(NSFlippedView.alloc().init())
win.contentView().setAutoresizingMask_(NSViewWidthSizable|NSViewHeightSizable)
win.setTitle_(title)
window = CocoaGuiObject()
window.subjectObject = subjectObject
window.nativeGuiObject = win.contentView()
w,h = window.setupChilds()
win.setContentMinSize_((w,h))
win.display()
win.orderFrontRegardless()
win.makeMainWindow()
win.makeKeyWindow()
win.setFrameUsingName_(windowName)
win.setFrameAutosaveName_(windowName)
app.activateIgnoringOtherApps_(True)
# see http://stackoverflow.com/questions/12292151/crash-in-class-getname-in-applicationopenuntitledfile
win.retain()
global windows
windows[windowName] = window
def setupMainWindow():
from State import state
import appinfo
setupWindow(state, windowName="mainWindow", title=appinfo.progname, isMainWindow=True)
def setupSearchWindow():
from Search import search
setupWindow(search, windowName="searchWindow", title="Search")
def locateFile(filename):
ws = NSWorkspace.sharedWorkspace()
ws.selectFile_inFileViewerRootedAtPath_(filename, None)
try:
isReload
except NameError:
isReload = False
else:
isReload = True
def reloadModuleHandling():
print "GUI module reload handler ..."
for w in app.windows():
w.close()
global windows
windows.clear()
appDelegate = PyAppDelegate.alloc().init()
app.setDelegate_(appDelegate)
appDelegate.retain()
try:
setupAfterAppFinishedLaunching(appDelegate)
except:
sys.excepthook(*sys.exc_info())
def guiMain():
pool = NSAutoreleasePool.alloc().init()
from State import state
for ev,args,kwargs in state.updates.read():
try:
global windows
for w in windows.values():
w.updateContent(ev,args,kwargs)
except:
sys.excepthook(*sys.exc_info())
del pool
def main():
""" This is called from main.py and will enter the NSApp main loop """
assert NSThread.isMainThread()
global app
app = NSApplication.sharedApplication()
setup()
print "entering GUI main loop"
app.run()
sys.exit()
if isReload:
do_in_mainthread(reloadModuleHandling)
|
from unittest import TestCase
class ActionModelTests(TestCase):
pass
|
#!/usr/bin/env python
#
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# 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 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 os, struct
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios
import wiredtiger, wttest
from wiredtiger import stat
# test_stat04.py
# Statistics key/value pair count
class test_stat04(wttest.WiredTigerTestCase, suite_subprocess):
uripfx = 'table:test_stat04.'
# Note: stats for fixed length bit fields (valuefmt='8t')
# do not include accurate counts for kv pairs.
keyfmt = [
('col', dict(keyfmt='r', valuefmt='S', storekind='col')),
('row', dict(keyfmt='S', valuefmt='S', storekind='row')),
]
nentries = [
('small', dict(nentries=100, valuesize=50)),
('medium', dict(nentries=10000, valuesize=20)),
('large', dict(nentries=100000, valuesize=1)),
('jumboval', dict(nentries=100, valuesize=4200000)),
]
scenarios = make_scenarios(keyfmt, nentries)
conn_config = 'statistics=(all)'
def init_test(self):
self.valuepfx = self.valuesize * 'X'
def genkey(self, n):
if self.keyfmt == 'S':
return 'SOMEKEY' + str(n)
else:
return n + 1
def genvalue(self, n):
if self.valuefmt == 'S':
return self.valuepfx + str(n)
else:
return n & 0xff
def checkcount(self, uri, expectpairs):
statcursor = self.session.open_cursor(
'statistics:' + uri, None, 'statistics=(all,clear)')
self.assertEqual(statcursor[stat.dsrc.btree_entries][2], expectpairs)
statcursor.close()
def test_stat_nentries(self):
"""
Test to make sure the number of key/value pairs is accurate.
"""
self.init_test()
uri = self.uripfx + self.storekind + '.' + str(self.nentries)
self.session.create(uri, 'key_format=' + self.keyfmt +
',value_format=' + self.valuefmt)
cursor = self.session.open_cursor(uri, None, None)
count = 0
# Insert entries, periodically checking that stats match.
for i in range(0, self.nentries):
if count % 50 == 0:
self.checkcount(uri, count)
cursor[self.genkey(i)] = self.genvalue(i)
count += 1
# Remove a number of entries, at each step checking that stats match.
for i in range(0, self.nentries / 37):
cursor.set_key(self.genkey(i*11 % self.nentries))
if cursor.remove() == 0:
count -= 1
self.checkcount(uri, count)
cursor.close()
# Confirm the count is correct after writing to the backing file,
# that tests the on-disk format as well as the in-memory format.
self.reopen_conn()
self.checkcount(uri, count)
if __name__ == '__main__':
wttest.run()
|
from Test import Test, Test as test
'''
Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string).
Examples:
solution('abc', 'bc') # returns true
solution('abc', 'd') # returns false
'''
def solution(string, ending):
return True if string[-len(ending):] == ending or len(ending) == 0 else False
# Top solution
def solution(string, ending):
return string.endswith(ending)
test.assert_equals(solution('abcde', 'cde'), True)
test.assert_equals(solution('abcde', 'abc'), False)
test.assert_equals(solution('abcde', ''), True)
|
#!/usr/bin/env python
from thrift_version import add_sys_path
add_sys_path(__file__)
import re
from interfaces import InterfacesService
from interfaces.ttypes import *
from interfaces.constants import *
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from thrift.server import TServer
class InterfaceServiceHandler:
def __init__(self):
self.interfaces = {}
# Interface Services
def V4InterfaceAdd(self, if_name, unit, v4_prefix, v4_prefix_len):
print ('V4InterfaceAdd', if_name, unit, v4_prefix, v4_prefix_len)
if not re.match(r'\w{2}-\d/\d/\d',if_name):
return RetStatus(-1, 'invalid interface', 'dummy')
if if_name in self.interfaces:
self.interfaces[if_name].append((unit, v4_prefix, v4_prefix_len))
else:
self.interfaces[if_name]=[(unit, v4_prefix, v4_prefix_len)]
return RetStatus(100, 'added', 'dummy')
def V4InterfaceDelete(self, if_name, unit, v4_prefix, v4_prefix_len):
print ('V4InterfaceDelete', if_name, unit, v4_prefix, v4_prefix_len)
if if_name in self.interfaces:
del self.interfaces[if_name]
return RetStatus(101, 'deleted', 'dummy')
else:
print 'Interface %s does not exists'%if_name
return RetStatus(-1, 'Interface does not exists', 'dummy')
def V4InterfaceEdit(self, if_name, unit, v4_prefix, v4_prefix_len):
print ('V4InterfaceEdit', if_name, unit, v4_prefix, v4_prefix_len)
if if_name in self.interfaces:
if (unit, v4_prefix, v4_prefix_len) in self.interfaces[if_name]:
print 'Same Interface already %s exists'%if_name
return True
else:
for i in self.interfaces[if_name]:
if i[0]==unit:
self.interfaces[if_name][self.interfaces[if_name].index(i)]=(unit, v4_prefix, v4_prefix_len)
print self.interfaces
return True
else:
print 'Interface %s does not exists'%if_name
raise InvalidInterfaceException('Interface %s does not exists'%if_name)
def InterfaceExists(self, if_name, data):
# to show case what happen when structure name is changed
print data, data.err_code, data.err_str, data.traceback
if if_name in self.interfaces:
print 'Interface %s exists'%if_name
else:
print 'Interface %s does not exists'%if_name
raise InvalidInterfaceException('Interface %s does not exists'%if_name)
handler = InterfaceServiceHandler()
processor = InterfacesService.Processor(handler)
transport = TSocket.TServerSocket(port=9090)
tfactory = TTransport.TBufferedTransportFactory()
pfactory = TBinaryProtocol.TBinaryProtocolFactory()
server = TServer.TSimpleServer(processor, transport, tfactory, pfactory)
print "Starting python server version 1.0.1..."
server.serve()
print "done!"
|
import logging
import azure.functions as func
from backlogapiprocessmodule import *
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('-------Python HTTP trigger function processed a request.')
configFilePath = '/home/site/wwwroot/BacklogApiTimerTrigger/config.yml'
loggingConfigFilePath = '/home/site/wwwroot/BacklogApiTimerTrigger/logging_debug.conf'
backlogapiprocess.run(configFilePath, loggingConfigFilePath)
name = req.params.get('name')
if not name:
try:
req_body = req.get_json()
except ValueError:
pass
else:
name = req_body.get('name')
if name:
return func.HttpResponse(f"Hello {name}!")
else:
return func.HttpResponse(
"Please pass a name on the query string or in the request body",
status_code=400
)
|
'''jpredDataset.py
This class downloads the dataset used to train the secondary structure predictor.
It can be used as a reference dataset for machine learning applications.
This dataset includes the ScopID, sequence, DSSP secondary structure assignment,
and a flag that indicates if data point was part of the training set.
References
----------
- `JPred4 <http://www.compbio.dundee.ac.uk/jpred/about_RETR_JNetv231_details.shtml>`_
'''
__author__ = "Mars (Shih-Cheng) Huang"
__maintainer__ = "Mars (Shih-Cheng) Huang"
__email__ = "marshuang80@gmail.com"
__version__ = "0.2.0"
__status__ = "Done"
import urllib.request
import tarfile
from pyspark.sql import Row
from pyspark import SparkContext
from mmtfPyspark.ml import pythonRDDToDataset
def get_dataset():
'''Gets JPred 4/JNet (v.2.3.1) secondary structure dataset.
Returns
-------
dataset
secondaryStructure dataset
'''
URL = "http://www.compbio.dundee.ac.uk/jpred/downloads/retr231.tar.gz"
instream = urllib.request.urlopen(URL)
secondaryStructures, sequences, trained = {}, {}, {}
scopIds = set()
res = []
with tarfile.open(fileobj=instream, mode="r:gz") as tf:
for entry in tf:
if entry.isdir():
continue
br = tf.extractfile(entry)
if ".dssp" in entry.name:
scopID = str(br.readline())[3:-3] # Remove newline and byte
secondaryStructure = str(br.readline())[2:-3] # Remove newline and byte
secondaryStructure = secondaryStructure.replace('-', 'C')
secondaryStructures[scopID] = secondaryStructure
if ".fasta" in entry.name:
scopID = str(br.readline())[3:-3] # Remove newline and byte
sequence = str(br.readline())[2:-3] # Remove newline and byte
scopIds.add(scopID)
sequences[scopID] = sequence
if "training/" in entry.name:
trained[scopID] = "true"
elif "blind/" in entry.name:
trained[scopID] = "false"
for scopId in scopIds:
row = Row(scopId, sequences[scopId],
secondaryStructures[scopId], trained[scopId])
res.append(row)
sc = SparkContext.getOrCreate()
data = sc.parallelize(res)
colNames = ["scopID", "sequence", "secondaryStructure", "trained"]
return pythonRDDToDataset.get_dataset(data, colNames)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
### BEGIN LICENSE
# Copyright (C) 2010 Mads Chr. Olesen <mchro@cs.aau.dk>
#This program is free software: you can redistribute it and/or modify it
#under the terms of the GNU General Public License version 3, as published
#by the Free Software Foundation.
#
#This program is distributed in the hope that it will be useful, but
#WITHOUT ANY WARRANTY; without even the implied warranties of
#MERCHANTABILITY, SATISFACTORY QUALITY, 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/>.
### END LICENSE
###################### DO NOT TOUCH THIS (HEAD TO THE SECOND PART) ######################
try:
import DistUtilsExtra.auto
except ImportError:
import sys
print >> sys.stderr, 'To build opaal you need https://launchpad.net/python-distutils-extra'
sys.exit(1)
assert DistUtilsExtra.auto.__version__ >= '2.10', 'needs DistUtilsExtra.auto >= 2.10'
import os
def update_data_path(prefix, oldvalue=None):
try:
fin = file('opaal/opaalconfig.py', 'r')
fout = file(fin.name + '.new', 'w')
for line in fin:
fields = line.split(' = ') # Separate variable from value
if fields[0] == '__opaal_data_directory__':
# update to prefix, store oldvalue
if not oldvalue:
oldvalue = fields[1]
line = "%s = '%s'\n" % (fields[0], prefix)
else: # restore oldvalue
line = "%s = %s" % (fields[0], oldvalue)
fout.write(line)
fout.flush()
fout.close()
fin.close()
os.rename(fout.name, fin.name)
except (OSError, IOError), e:
print ("ERROR: Can't find opaal/opaalconfig.py")
sys.exit(1)
return oldvalue
def update_desktop_file(datadir):
try:
fin = file('opaal.desktop.in', 'r')
fout = file(fin.name + '.new', 'w')
for line in fin:
if 'Icon=' in line:
line = "Icon=%s\n" % (datadir + 'media/icon.png')
fout.write(line)
fout.flush()
fout.close()
fin.close()
os.rename(fout.name, fin.name)
except (OSError, IOError), e:
print ("ERROR: Can't find opaal.desktop.in")
sys.exit(1)
class InstallAndUpdateDataDirectory(DistUtilsExtra.auto.install_auto):
def run(self):
if self.root or self.home:
print "WARNING: You don't use a standard --prefix installation, take care that you eventually " \
"need to update quickly/quicklyconfig.py file to adjust __quickly_data_directory__. You can " \
"ignore this warning if you are packaging and uses --prefix."
previous_value = update_data_path(self.prefix + '/share/opaal/')
update_desktop_file(self.prefix + '/share/opaal/')
DistUtilsExtra.auto.install_auto.run(self)
update_data_path(self.prefix, previous_value)
##################################################################################
###################### YOU SHOULD MODIFY ONLY WHAT IS BELOW ######################
##################################################################################
DistUtilsExtra.auto.setup(
name='opaal',
version='0.1',
license='GPL-3',
author='Mads Chr. Olesen',
author_email='mchro@cs.aau.dk',
description='distributed and parallel model checker',
#long_description='Here a longer description',
url='https://launchpad.net/opaal',
cmdclass={'install': InstallAndUpdateDataDirectory}
)
|
"""
Contains public website logic and assets.
"""
|
"""
PASSENGERS
"""
numPassengers = 22956
passenger_arriving = (
(4, 4, 4, 5, 5, 1, 2, 3, 0, 2, 1, 1, 0, 6, 10, 3, 7, 3, 8, 0, 4, 3, 2, 0, 0, 0), # 0
(6, 7, 9, 7, 5, 0, 2, 1, 2, 3, 1, 1, 0, 5, 8, 4, 2, 3, 4, 1, 3, 3, 2, 1, 1, 0), # 1
(10, 6, 11, 6, 6, 4, 5, 1, 3, 1, 2, 1, 0, 12, 3, 8, 2, 5, 3, 4, 3, 0, 2, 1, 0, 0), # 2
(5, 10, 9, 8, 4, 1, 1, 2, 2, 1, 2, 0, 0, 14, 7, 6, 4, 10, 3, 4, 1, 0, 2, 0, 1, 0), # 3
(12, 11, 4, 10, 8, 3, 3, 2, 5, 1, 1, 1, 0, 7, 6, 6, 4, 5, 8, 3, 2, 3, 3, 0, 2, 0), # 4
(7, 5, 1, 5, 6, 2, 2, 5, 1, 3, 1, 2, 0, 10, 5, 7, 6, 6, 3, 3, 2, 3, 1, 0, 0, 0), # 5
(9, 5, 8, 8, 4, 1, 11, 2, 6, 1, 1, 0, 0, 11, 8, 4, 5, 7, 6, 5, 4, 8, 1, 3, 0, 0), # 6
(3, 5, 6, 10, 5, 4, 2, 6, 4, 2, 2, 0, 0, 9, 9, 4, 3, 5, 2, 3, 2, 0, 2, 2, 1, 0), # 7
(8, 10, 7, 9, 10, 5, 4, 3, 4, 2, 1, 0, 0, 12, 10, 8, 4, 11, 2, 3, 1, 4, 2, 3, 3, 0), # 8
(5, 12, 8, 6, 9, 2, 6, 3, 4, 4, 2, 0, 0, 5, 4, 7, 5, 4, 5, 4, 1, 3, 5, 1, 4, 0), # 9
(10, 9, 13, 5, 7, 0, 5, 2, 3, 2, 3, 1, 0, 5, 11, 3, 8, 7, 5, 3, 3, 4, 2, 5, 2, 0), # 10
(9, 9, 8, 11, 7, 5, 2, 2, 3, 1, 0, 1, 0, 9, 5, 6, 7, 12, 6, 2, 2, 3, 5, 1, 0, 0), # 11
(13, 11, 13, 13, 9, 6, 4, 2, 2, 1, 2, 1, 0, 7, 7, 8, 4, 8, 4, 1, 3, 3, 2, 1, 1, 0), # 12
(12, 13, 6, 12, 10, 6, 6, 3, 1, 2, 0, 0, 0, 15, 11, 4, 8, 7, 6, 2, 3, 1, 2, 1, 1, 0), # 13
(11, 9, 15, 17, 7, 3, 4, 5, 1, 1, 5, 1, 0, 11, 8, 12, 4, 11, 6, 4, 2, 5, 2, 3, 1, 0), # 14
(11, 14, 15, 9, 8, 6, 9, 2, 6, 3, 1, 1, 0, 19, 15, 2, 5, 8, 4, 4, 2, 0, 7, 4, 0, 0), # 15
(12, 12, 10, 12, 9, 1, 8, 3, 6, 3, 0, 1, 0, 15, 9, 10, 6, 6, 6, 2, 1, 3, 3, 1, 0, 0), # 16
(11, 12, 9, 10, 10, 4, 3, 4, 6, 4, 0, 2, 0, 13, 11, 9, 4, 9, 7, 5, 7, 3, 3, 2, 2, 0), # 17
(10, 12, 9, 9, 5, 5, 4, 3, 4, 2, 4, 2, 0, 11, 12, 9, 6, 14, 7, 2, 6, 7, 1, 1, 1, 0), # 18
(9, 11, 10, 13, 11, 4, 5, 4, 7, 1, 0, 0, 0, 10, 12, 7, 10, 7, 6, 4, 2, 5, 1, 1, 1, 0), # 19
(20, 10, 11, 13, 8, 11, 3, 7, 5, 3, 1, 0, 0, 14, 7, 6, 8, 6, 8, 6, 3, 4, 4, 1, 2, 0), # 20
(12, 12, 4, 8, 10, 3, 5, 3, 2, 0, 0, 1, 0, 10, 8, 9, 10, 13, 3, 7, 4, 4, 6, 6, 2, 0), # 21
(14, 17, 9, 11, 8, 4, 8, 4, 3, 1, 2, 3, 0, 14, 12, 9, 10, 9, 8, 4, 2, 2, 3, 2, 1, 0), # 22
(11, 18, 9, 10, 4, 4, 6, 6, 6, 3, 1, 4, 0, 19, 9, 9, 10, 10, 5, 5, 0, 4, 9, 4, 1, 0), # 23
(10, 12, 9, 17, 7, 4, 6, 5, 1, 2, 0, 1, 0, 11, 14, 9, 5, 11, 7, 6, 3, 5, 2, 4, 2, 0), # 24
(10, 13, 14, 8, 7, 4, 5, 9, 8, 3, 0, 2, 0, 15, 16, 11, 5, 8, 5, 3, 3, 4, 5, 1, 0, 0), # 25
(13, 14, 9, 11, 10, 2, 2, 5, 7, 2, 4, 0, 0, 11, 13, 8, 7, 6, 5, 7, 3, 4, 2, 2, 2, 0), # 26
(18, 10, 10, 14, 8, 1, 11, 1, 6, 1, 3, 1, 0, 13, 20, 8, 8, 8, 7, 4, 1, 4, 5, 0, 3, 0), # 27
(12, 7, 8, 9, 13, 4, 8, 4, 7, 3, 2, 1, 0, 12, 10, 11, 8, 12, 8, 4, 2, 5, 2, 1, 1, 0), # 28
(12, 16, 9, 10, 9, 3, 8, 1, 3, 3, 2, 1, 0, 15, 9, 10, 9, 11, 5, 2, 3, 4, 5, 0, 3, 0), # 29
(11, 15, 8, 14, 10, 5, 7, 6, 6, 1, 3, 0, 0, 14, 8, 9, 6, 4, 8, 6, 3, 7, 7, 0, 0, 0), # 30
(20, 15, 10, 6, 5, 3, 4, 9, 5, 2, 6, 0, 0, 11, 16, 5, 6, 16, 8, 3, 2, 2, 4, 1, 1, 0), # 31
(14, 9, 14, 14, 4, 6, 5, 2, 10, 2, 1, 0, 0, 13, 12, 9, 10, 13, 4, 10, 2, 3, 6, 1, 0, 0), # 32
(15, 15, 13, 8, 7, 8, 9, 8, 1, 4, 2, 0, 0, 14, 13, 6, 6, 11, 5, 4, 3, 4, 3, 4, 2, 0), # 33
(14, 5, 9, 9, 7, 6, 5, 5, 3, 1, 2, 0, 0, 12, 12, 6, 8, 9, 2, 3, 4, 4, 5, 2, 0, 0), # 34
(10, 15, 9, 12, 12, 4, 7, 6, 5, 3, 4, 2, 0, 18, 9, 5, 6, 8, 5, 4, 2, 7, 3, 2, 0, 0), # 35
(15, 7, 13, 15, 6, 4, 3, 4, 4, 2, 4, 1, 0, 16, 11, 7, 2, 11, 11, 7, 1, 2, 1, 1, 1, 0), # 36
(17, 11, 18, 16, 3, 4, 5, 2, 2, 2, 2, 1, 0, 9, 8, 7, 8, 15, 4, 2, 1, 0, 9, 4, 1, 0), # 37
(18, 15, 10, 13, 9, 4, 4, 5, 7, 1, 2, 1, 0, 10, 7, 5, 6, 10, 9, 6, 4, 5, 7, 2, 1, 0), # 38
(12, 11, 15, 5, 6, 1, 4, 5, 2, 2, 3, 1, 0, 11, 10, 6, 7, 9, 10, 6, 5, 5, 3, 4, 3, 0), # 39
(18, 9, 10, 11, 10, 7, 3, 4, 6, 2, 2, 2, 0, 9, 11, 8, 6, 10, 5, 4, 8, 2, 3, 2, 0, 0), # 40
(14, 13, 5, 12, 8, 2, 2, 4, 4, 5, 1, 0, 0, 10, 12, 8, 2, 7, 6, 5, 3, 4, 2, 0, 2, 0), # 41
(7, 7, 7, 11, 10, 3, 4, 1, 6, 2, 3, 0, 0, 12, 9, 7, 5, 8, 2, 9, 4, 4, 2, 1, 1, 0), # 42
(16, 10, 10, 7, 9, 2, 6, 3, 4, 2, 0, 1, 0, 14, 9, 13, 6, 11, 12, 2, 1, 6, 3, 0, 1, 0), # 43
(10, 16, 10, 11, 8, 2, 3, 7, 7, 2, 3, 1, 0, 9, 15, 4, 10, 12, 8, 5, 3, 5, 4, 1, 2, 0), # 44
(14, 11, 12, 9, 10, 2, 3, 5, 4, 2, 3, 0, 0, 10, 11, 7, 5, 11, 9, 1, 4, 4, 4, 5, 1, 0), # 45
(13, 10, 7, 14, 3, 0, 7, 4, 2, 3, 2, 0, 0, 11, 16, 11, 7, 7, 5, 2, 8, 1, 4, 1, 4, 0), # 46
(8, 14, 6, 9, 7, 5, 3, 2, 3, 3, 1, 1, 0, 13, 11, 5, 10, 8, 7, 4, 7, 3, 1, 4, 2, 0), # 47
(13, 13, 9, 8, 15, 4, 6, 4, 4, 2, 1, 1, 0, 7, 9, 10, 8, 11, 8, 5, 5, 4, 4, 1, 0, 0), # 48
(20, 6, 14, 13, 8, 11, 4, 5, 6, 2, 3, 0, 0, 6, 11, 10, 7, 11, 8, 9, 3, 1, 2, 1, 1, 0), # 49
(18, 15, 14, 7, 10, 5, 4, 4, 5, 2, 0, 0, 0, 7, 10, 10, 8, 8, 8, 6, 4, 4, 5, 3, 0, 0), # 50
(16, 9, 11, 15, 5, 3, 7, 5, 6, 4, 1, 1, 0, 18, 12, 8, 5, 8, 4, 8, 4, 8, 3, 2, 1, 0), # 51
(14, 8, 12, 8, 8, 7, 3, 6, 4, 0, 2, 2, 0, 12, 10, 6, 4, 7, 9, 4, 6, 4, 1, 2, 0, 0), # 52
(13, 12, 7, 13, 10, 6, 7, 2, 3, 3, 1, 1, 0, 8, 13, 4, 9, 12, 3, 1, 4, 2, 3, 5, 1, 0), # 53
(11, 10, 13, 6, 9, 5, 3, 6, 4, 4, 2, 1, 0, 13, 12, 8, 4, 11, 4, 6, 4, 4, 7, 4, 0, 0), # 54
(9, 12, 8, 14, 8, 5, 1, 2, 9, 2, 0, 0, 0, 11, 16, 8, 7, 10, 10, 6, 4, 6, 7, 3, 0, 0), # 55
(11, 15, 16, 10, 9, 7, 3, 4, 5, 2, 1, 1, 0, 19, 10, 12, 7, 9, 2, 4, 9, 6, 3, 1, 0, 0), # 56
(10, 15, 14, 7, 9, 4, 2, 8, 2, 4, 1, 1, 0, 11, 15, 9, 8, 6, 5, 9, 3, 4, 5, 2, 1, 0), # 57
(8, 6, 11, 15, 9, 3, 5, 5, 8, 3, 1, 0, 0, 13, 15, 6, 4, 11, 0, 3, 4, 5, 4, 4, 1, 0), # 58
(8, 16, 12, 7, 5, 4, 3, 3, 5, 2, 2, 1, 0, 17, 7, 9, 9, 9, 5, 7, 1, 3, 5, 2, 0, 0), # 59
(12, 6, 14, 5, 8, 8, 6, 6, 4, 2, 2, 1, 0, 11, 9, 15, 11, 7, 8, 3, 4, 5, 5, 6, 1, 0), # 60
(10, 8, 11, 7, 12, 4, 3, 4, 4, 2, 3, 1, 0, 12, 6, 7, 6, 3, 2, 4, 1, 5, 4, 1, 0, 0), # 61
(13, 10, 8, 12, 10, 5, 6, 4, 3, 1, 1, 1, 0, 16, 7, 2, 12, 16, 4, 5, 2, 6, 7, 0, 0, 0), # 62
(12, 12, 11, 10, 5, 6, 2, 7, 1, 1, 3, 0, 0, 16, 7, 10, 7, 14, 8, 4, 6, 4, 5, 2, 1, 0), # 63
(16, 13, 8, 8, 10, 0, 4, 3, 6, 3, 1, 2, 0, 10, 9, 3, 9, 13, 8, 4, 1, 7, 3, 2, 0, 0), # 64
(12, 6, 9, 13, 6, 2, 1, 5, 2, 2, 3, 0, 0, 8, 4, 7, 6, 4, 3, 4, 2, 4, 1, 2, 0, 0), # 65
(4, 19, 10, 11, 14, 7, 1, 5, 5, 1, 2, 1, 0, 15, 8, 8, 8, 7, 4, 9, 1, 3, 4, 1, 1, 0), # 66
(13, 7, 11, 16, 5, 4, 5, 3, 6, 2, 0, 1, 0, 11, 14, 6, 4, 6, 7, 2, 2, 3, 3, 0, 1, 0), # 67
(10, 11, 8, 10, 4, 6, 1, 3, 3, 2, 0, 0, 0, 13, 10, 8, 6, 9, 7, 9, 2, 4, 3, 2, 0, 0), # 68
(15, 8, 14, 5, 14, 5, 5, 2, 6, 2, 3, 1, 0, 8, 14, 7, 7, 11, 7, 3, 0, 3, 4, 2, 0, 0), # 69
(14, 11, 11, 10, 5, 7, 4, 6, 3, 0, 4, 4, 0, 11, 6, 6, 7, 10, 4, 5, 2, 4, 5, 3, 1, 0), # 70
(9, 7, 7, 17, 13, 7, 6, 5, 4, 0, 1, 1, 0, 18, 14, 10, 8, 7, 5, 4, 1, 1, 2, 2, 0, 0), # 71
(10, 10, 14, 11, 14, 2, 6, 7, 5, 3, 3, 0, 0, 11, 5, 8, 2, 11, 4, 8, 1, 4, 7, 1, 0, 0), # 72
(7, 12, 7, 11, 7, 3, 3, 2, 8, 3, 3, 2, 0, 7, 10, 12, 5, 6, 7, 3, 5, 3, 8, 6, 0, 0), # 73
(12, 18, 8, 7, 8, 4, 3, 2, 8, 3, 0, 0, 0, 8, 8, 9, 6, 8, 9, 2, 3, 5, 9, 1, 1, 0), # 74
(10, 6, 8, 9, 13, 2, 4, 8, 2, 0, 1, 1, 0, 13, 7, 7, 3, 10, 6, 5, 3, 7, 4, 3, 0, 0), # 75
(17, 8, 11, 7, 8, 5, 5, 7, 5, 5, 1, 3, 0, 8, 11, 12, 3, 12, 1, 3, 4, 2, 5, 1, 1, 0), # 76
(5, 14, 11, 3, 4, 5, 7, 2, 6, 1, 2, 1, 0, 11, 6, 8, 1, 8, 2, 4, 3, 4, 4, 3, 0, 0), # 77
(15, 9, 7, 11, 9, 5, 3, 4, 4, 2, 0, 0, 0, 7, 8, 10, 8, 12, 4, 5, 2, 5, 2, 3, 0, 0), # 78
(13, 11, 3, 12, 7, 2, 5, 2, 6, 1, 2, 2, 0, 16, 9, 8, 5, 10, 7, 1, 1, 3, 3, 2, 0, 0), # 79
(14, 9, 10, 14, 12, 2, 4, 4, 4, 3, 1, 1, 0, 16, 8, 7, 3, 8, 3, 0, 1, 3, 1, 2, 2, 0), # 80
(8, 6, 12, 10, 3, 5, 2, 3, 4, 4, 0, 0, 0, 11, 12, 3, 3, 14, 1, 4, 2, 3, 4, 1, 3, 0), # 81
(10, 6, 11, 7, 6, 7, 6, 2, 2, 3, 1, 1, 0, 9, 13, 7, 7, 9, 5, 1, 4, 4, 1, 4, 1, 0), # 82
(13, 11, 9, 12, 10, 2, 3, 6, 6, 3, 1, 2, 0, 7, 9, 6, 11, 11, 5, 3, 2, 4, 4, 1, 0, 0), # 83
(13, 7, 13, 14, 5, 5, 5, 2, 2, 2, 3, 0, 0, 11, 10, 8, 4, 7, 7, 8, 3, 5, 2, 2, 2, 0), # 84
(9, 7, 12, 6, 4, 4, 5, 7, 3, 3, 3, 2, 0, 9, 5, 6, 4, 12, 5, 2, 2, 5, 5, 4, 1, 0), # 85
(11, 13, 5, 9, 4, 7, 5, 1, 6, 1, 1, 0, 0, 13, 8, 8, 4, 9, 7, 1, 7, 2, 4, 1, 1, 0), # 86
(11, 9, 10, 11, 9, 1, 2, 2, 11, 1, 3, 2, 0, 8, 12, 13, 2, 6, 4, 4, 2, 1, 3, 3, 1, 0), # 87
(12, 12, 14, 12, 12, 4, 2, 5, 6, 2, 4, 0, 0, 17, 6, 3, 6, 9, 3, 1, 6, 6, 4, 2, 0, 0), # 88
(9, 10, 11, 10, 12, 11, 2, 9, 5, 0, 2, 1, 0, 11, 10, 7, 3, 10, 6, 5, 3, 7, 5, 1, 1, 0), # 89
(10, 12, 8, 13, 6, 3, 4, 2, 6, 2, 1, 3, 0, 8, 6, 8, 6, 10, 8, 4, 5, 5, 4, 3, 1, 0), # 90
(6, 5, 8, 10, 4, 2, 6, 5, 6, 1, 4, 0, 0, 17, 14, 9, 5, 8, 4, 5, 4, 3, 4, 5, 1, 0), # 91
(11, 4, 9, 11, 6, 5, 4, 4, 3, 1, 0, 1, 0, 12, 7, 3, 6, 15, 7, 4, 5, 6, 5, 3, 0, 0), # 92
(7, 9, 9, 8, 9, 6, 3, 5, 1, 1, 0, 2, 0, 13, 13, 2, 8, 13, 1, 6, 4, 5, 2, 2, 1, 0), # 93
(14, 7, 9, 12, 7, 4, 3, 2, 8, 3, 2, 0, 0, 11, 6, 10, 5, 5, 4, 6, 5, 0, 4, 2, 3, 0), # 94
(21, 8, 8, 13, 9, 3, 5, 3, 1, 0, 0, 0, 0, 14, 7, 3, 3, 10, 4, 1, 0, 6, 3, 2, 0, 0), # 95
(17, 6, 8, 11, 5, 8, 2, 1, 6, 2, 3, 0, 0, 13, 9, 13, 4, 10, 4, 2, 0, 2, 2, 4, 1, 0), # 96
(12, 11, 11, 9, 10, 1, 2, 3, 10, 2, 1, 2, 0, 11, 11, 10, 10, 8, 5, 4, 3, 2, 5, 2, 0, 0), # 97
(11, 17, 13, 10, 5, 6, 6, 3, 4, 1, 3, 0, 0, 16, 11, 4, 7, 8, 11, 4, 4, 5, 3, 2, 1, 0), # 98
(10, 6, 7, 6, 11, 6, 7, 4, 6, 1, 0, 0, 0, 14, 11, 7, 8, 14, 8, 7, 6, 4, 3, 1, 0, 0), # 99
(12, 10, 9, 11, 11, 4, 3, 5, 2, 1, 1, 0, 0, 9, 8, 3, 4, 5, 4, 4, 3, 5, 6, 4, 0, 0), # 100
(12, 5, 6, 3, 12, 3, 6, 6, 2, 2, 0, 0, 0, 13, 12, 6, 11, 10, 6, 6, 4, 1, 1, 1, 2, 0), # 101
(9, 8, 12, 11, 8, 3, 6, 4, 7, 0, 1, 0, 0, 11, 8, 6, 5, 10, 4, 2, 4, 4, 3, 1, 0, 0), # 102
(9, 8, 6, 11, 5, 10, 5, 1, 5, 2, 1, 0, 0, 10, 11, 8, 9, 12, 3, 4, 3, 8, 1, 2, 1, 0), # 103
(12, 8, 9, 14, 6, 3, 7, 0, 7, 3, 0, 0, 0, 18, 13, 9, 7, 8, 5, 1, 4, 4, 5, 0, 0, 0), # 104
(14, 8, 9, 10, 11, 5, 4, 3, 2, 2, 2, 1, 0, 10, 7, 1, 5, 6, 4, 7, 3, 4, 4, 3, 0, 0), # 105
(10, 14, 9, 13, 7, 2, 4, 5, 3, 3, 1, 0, 0, 9, 9, 8, 6, 6, 2, 4, 0, 3, 3, 2, 0, 0), # 106
(9, 6, 9, 10, 12, 2, 4, 1, 8, 2, 1, 0, 0, 12, 5, 6, 10, 5, 4, 1, 3, 4, 2, 1, 2, 0), # 107
(12, 10, 9, 12, 9, 4, 6, 4, 2, 3, 0, 0, 0, 9, 12, 4, 5, 8, 8, 3, 0, 4, 2, 4, 1, 0), # 108
(15, 5, 6, 10, 7, 3, 4, 5, 5, 1, 1, 2, 0, 18, 11, 6, 6, 8, 1, 6, 2, 2, 2, 2, 1, 0), # 109
(4, 8, 11, 11, 13, 4, 5, 2, 5, 0, 0, 0, 0, 13, 8, 6, 4, 6, 7, 4, 2, 6, 4, 4, 0, 0), # 110
(11, 8, 11, 12, 11, 3, 2, 6, 5, 2, 2, 1, 0, 15, 9, 5, 6, 7, 5, 4, 1, 10, 3, 4, 2, 0), # 111
(9, 13, 6, 18, 8, 2, 2, 1, 4, 1, 0, 2, 0, 11, 6, 9, 3, 9, 3, 5, 1, 6, 3, 5, 0, 0), # 112
(13, 9, 8, 11, 4, 8, 3, 4, 5, 1, 1, 0, 0, 10, 10, 7, 2, 9, 5, 5, 0, 2, 8, 1, 0, 0), # 113
(17, 10, 10, 7, 8, 4, 4, 2, 4, 4, 2, 1, 0, 9, 13, 5, 2, 15, 1, 0, 5, 3, 1, 1, 2, 0), # 114
(13, 7, 7, 12, 9, 4, 4, 0, 3, 1, 0, 2, 0, 19, 6, 9, 5, 9, 2, 6, 1, 2, 2, 0, 1, 0), # 115
(5, 7, 17, 11, 7, 1, 2, 3, 6, 0, 0, 0, 0, 12, 8, 12, 4, 10, 4, 1, 0, 8, 4, 0, 1, 0), # 116
(9, 8, 12, 11, 12, 4, 2, 1, 6, 2, 1, 0, 0, 11, 7, 6, 5, 9, 7, 5, 3, 2, 3, 1, 0, 0), # 117
(9, 9, 14, 10, 8, 3, 7, 4, 2, 4, 1, 1, 0, 12, 5, 8, 5, 10, 4, 5, 5, 4, 2, 3, 0, 0), # 118
(11, 14, 8, 6, 11, 5, 4, 2, 4, 0, 0, 0, 0, 14, 5, 6, 2, 6, 2, 5, 3, 5, 2, 3, 2, 0), # 119
(12, 10, 4, 13, 9, 4, 3, 3, 5, 1, 1, 0, 0, 12, 12, 4, 2, 4, 3, 8, 1, 6, 3, 3, 1, 0), # 120
(11, 9, 9, 4, 10, 4, 6, 1, 8, 5, 2, 0, 0, 9, 7, 3, 7, 5, 6, 2, 2, 4, 1, 1, 0, 0), # 121
(17, 11, 6, 7, 4, 3, 6, 1, 3, 3, 0, 1, 0, 11, 8, 7, 5, 10, 3, 7, 1, 4, 2, 2, 1, 0), # 122
(10, 5, 6, 11, 7, 4, 6, 4, 3, 3, 2, 0, 0, 12, 8, 7, 5, 7, 4, 1, 2, 4, 7, 0, 2, 0), # 123
(9, 10, 6, 13, 9, 5, 4, 6, 10, 2, 0, 1, 0, 11, 4, 6, 5, 18, 2, 2, 6, 3, 1, 1, 1, 0), # 124
(8, 7, 7, 11, 11, 2, 3, 1, 6, 2, 1, 3, 0, 10, 10, 8, 2, 6, 3, 3, 3, 4, 2, 1, 0, 0), # 125
(11, 5, 8, 7, 12, 5, 4, 3, 3, 1, 1, 1, 0, 11, 8, 3, 6, 9, 5, 1, 4, 4, 12, 3, 0, 0), # 126
(10, 12, 6, 10, 12, 6, 1, 3, 4, 0, 2, 0, 0, 13, 6, 6, 3, 6, 3, 4, 2, 5, 3, 1, 2, 0), # 127
(8, 14, 8, 12, 10, 6, 2, 1, 8, 4, 2, 0, 0, 12, 8, 9, 3, 5, 6, 2, 4, 0, 2, 1, 1, 0), # 128
(13, 6, 9, 10, 8, 4, 4, 3, 2, 0, 1, 1, 0, 11, 8, 6, 6, 8, 5, 4, 4, 4, 1, 5, 0, 0), # 129
(10, 11, 7, 9, 11, 4, 2, 2, 2, 3, 1, 0, 0, 4, 9, 12, 5, 12, 3, 2, 0, 3, 6, 0, 0, 0), # 130
(14, 9, 11, 16, 8, 3, 2, 4, 4, 0, 0, 1, 0, 15, 8, 11, 6, 7, 5, 3, 2, 4, 2, 1, 1, 0), # 131
(8, 7, 8, 7, 7, 3, 2, 1, 8, 1, 0, 0, 0, 10, 13, 7, 6, 8, 9, 3, 2, 4, 0, 3, 0, 0), # 132
(9, 6, 6, 5, 10, 6, 3, 3, 2, 2, 1, 0, 0, 15, 11, 4, 8, 5, 4, 3, 1, 3, 4, 1, 1, 0), # 133
(10, 6, 15, 5, 3, 4, 5, 1, 10, 2, 2, 0, 0, 9, 10, 4, 6, 12, 4, 4, 3, 4, 3, 1, 3, 0), # 134
(10, 15, 11, 7, 11, 3, 4, 4, 2, 3, 1, 1, 0, 11, 12, 3, 9, 13, 5, 2, 2, 3, 0, 2, 0, 0), # 135
(15, 9, 13, 12, 6, 4, 1, 5, 9, 1, 0, 0, 0, 12, 11, 3, 10, 10, 3, 1, 3, 8, 3, 2, 1, 0), # 136
(18, 8, 12, 10, 7, 4, 2, 3, 4, 0, 2, 0, 0, 17, 10, 6, 6, 9, 4, 5, 2, 1, 3, 5, 0, 0), # 137
(8, 7, 10, 8, 14, 5, 1, 2, 5, 4, 1, 0, 0, 10, 10, 5, 7, 11, 1, 4, 3, 4, 2, 2, 0, 0), # 138
(8, 7, 12, 13, 7, 0, 1, 1, 5, 1, 1, 3, 0, 14, 11, 4, 6, 10, 5, 4, 2, 4, 4, 2, 2, 0), # 139
(8, 7, 8, 8, 7, 2, 3, 1, 1, 0, 1, 3, 0, 11, 13, 10, 1, 8, 2, 6, 3, 2, 3, 1, 0, 0), # 140
(16, 5, 9, 6, 5, 2, 4, 4, 3, 2, 1, 0, 0, 11, 7, 2, 4, 6, 2, 4, 7, 4, 3, 1, 1, 0), # 141
(10, 4, 4, 8, 10, 4, 4, 4, 4, 0, 1, 0, 0, 13, 7, 4, 5, 10, 7, 2, 5, 3, 2, 1, 0, 0), # 142
(5, 9, 7, 9, 9, 8, 3, 2, 3, 0, 0, 1, 0, 20, 9, 4, 5, 5, 10, 4, 3, 2, 3, 1, 0, 0), # 143
(14, 5, 6, 14, 5, 2, 6, 3, 3, 3, 0, 2, 0, 9, 7, 3, 3, 4, 3, 1, 4, 0, 6, 1, 0, 0), # 144
(15, 8, 11, 8, 8, 2, 2, 4, 3, 1, 1, 1, 0, 11, 11, 3, 3, 8, 4, 1, 3, 5, 1, 1, 0, 0), # 145
(13, 7, 10, 10, 10, 6, 3, 6, 1, 1, 2, 1, 0, 13, 11, 5, 2, 5, 6, 3, 3, 5, 2, 2, 1, 0), # 146
(6, 4, 9, 8, 9, 1, 3, 3, 4, 1, 0, 1, 0, 10, 14, 6, 1, 7, 5, 3, 3, 3, 5, 0, 0, 0), # 147
(9, 9, 11, 14, 12, 3, 3, 4, 3, 1, 1, 0, 0, 10, 12, 9, 3, 10, 1, 4, 4, 9, 5, 0, 1, 0), # 148
(10, 7, 13, 6, 9, 1, 7, 1, 4, 2, 1, 0, 0, 11, 10, 8, 3, 5, 3, 2, 0, 2, 1, 1, 0, 0), # 149
(9, 7, 7, 10, 5, 4, 4, 2, 1, 0, 0, 1, 0, 7, 7, 5, 4, 7, 5, 1, 4, 4, 4, 0, 0, 0), # 150
(3, 5, 7, 9, 10, 5, 1, 4, 6, 0, 2, 2, 0, 9, 8, 8, 7, 11, 5, 1, 3, 4, 1, 1, 0, 0), # 151
(14, 5, 16, 10, 6, 0, 3, 5, 2, 0, 1, 0, 0, 9, 6, 5, 4, 14, 1, 1, 5, 4, 3, 2, 0, 0), # 152
(10, 6, 9, 7, 7, 4, 2, 1, 3, 0, 0, 0, 0, 12, 8, 3, 6, 10, 3, 4, 3, 2, 3, 1, 0, 0), # 153
(8, 5, 6, 6, 8, 3, 2, 6, 4, 3, 2, 0, 0, 15, 9, 4, 3, 6, 2, 2, 7, 7, 4, 2, 0, 0), # 154
(15, 6, 8, 4, 5, 2, 4, 2, 9, 0, 2, 2, 0, 8, 9, 7, 2, 8, 4, 3, 3, 7, 4, 4, 1, 0), # 155
(7, 3, 16, 8, 3, 2, 3, 2, 3, 0, 0, 1, 0, 14, 6, 4, 3, 4, 4, 5, 4, 6, 4, 2, 1, 0), # 156
(13, 7, 8, 12, 7, 5, 0, 3, 2, 2, 2, 0, 0, 15, 6, 5, 2, 10, 3, 1, 1, 3, 6, 2, 2, 0), # 157
(8, 4, 8, 7, 7, 3, 1, 3, 3, 0, 1, 2, 0, 9, 9, 8, 3, 8, 4, 5, 1, 5, 4, 2, 2, 0), # 158
(7, 9, 8, 3, 9, 3, 0, 3, 2, 0, 0, 1, 0, 10, 8, 2, 5, 11, 3, 1, 0, 5, 4, 4, 2, 0), # 159
(9, 5, 8, 6, 9, 5, 1, 3, 5, 0, 2, 0, 0, 9, 14, 10, 3, 6, 4, 1, 3, 3, 3, 0, 0, 0), # 160
(7, 12, 13, 10, 7, 2, 5, 8, 4, 2, 5, 1, 0, 9, 8, 9, 4, 11, 2, 2, 1, 3, 3, 3, 1, 0), # 161
(10, 8, 4, 12, 5, 2, 3, 4, 1, 0, 1, 0, 0, 9, 9, 2, 4, 12, 3, 2, 2, 1, 4, 0, 0, 0), # 162
(8, 6, 9, 12, 7, 1, 2, 6, 1, 2, 3, 1, 0, 8, 4, 4, 3, 8, 3, 1, 3, 7, 0, 1, 0, 0), # 163
(8, 9, 14, 12, 4, 2, 2, 2, 3, 4, 4, 1, 0, 10, 7, 7, 4, 5, 2, 3, 2, 3, 2, 1, 0, 0), # 164
(6, 4, 9, 4, 6, 1, 4, 1, 4, 2, 3, 2, 0, 8, 5, 8, 6, 9, 3, 3, 3, 2, 3, 0, 1, 0), # 165
(6, 9, 3, 1, 12, 6, 2, 2, 2, 5, 1, 0, 0, 6, 5, 6, 5, 4, 4, 2, 4, 2, 4, 1, 0, 0), # 166
(5, 7, 4, 5, 9, 1, 1, 2, 7, 1, 1, 0, 0, 10, 8, 7, 10, 6, 4, 3, 1, 1, 1, 2, 0, 0), # 167
(8, 5, 6, 8, 6, 2, 4, 4, 2, 1, 2, 0, 0, 7, 6, 3, 9, 8, 3, 4, 1, 1, 3, 1, 1, 0), # 168
(6, 4, 11, 10, 6, 3, 2, 4, 4, 1, 1, 1, 0, 9, 9, 4, 1, 7, 3, 2, 3, 4, 4, 1, 0, 0), # 169
(6, 6, 6, 10, 6, 5, 3, 2, 3, 2, 0, 0, 0, 6, 11, 5, 6, 5, 2, 1, 2, 6, 3, 1, 1, 0), # 170
(5, 5, 4, 12, 10, 4, 4, 3, 1, 0, 2, 0, 0, 7, 10, 3, 3, 12, 1, 2, 4, 6, 3, 1, 0, 0), # 171
(4, 4, 7, 6, 5, 1, 2, 4, 2, 0, 1, 0, 0, 12, 2, 3, 5, 6, 5, 1, 1, 4, 1, 1, 0, 0), # 172
(8, 1, 3, 4, 10, 2, 2, 3, 4, 0, 1, 3, 0, 8, 3, 2, 2, 2, 3, 0, 1, 2, 2, 2, 0, 0), # 173
(10, 3, 3, 6, 7, 1, 1, 1, 2, 3, 0, 0, 0, 10, 7, 5, 2, 4, 1, 2, 3, 3, 2, 2, 0, 0), # 174
(8, 6, 3, 8, 7, 1, 0, 2, 2, 1, 2, 0, 0, 8, 4, 4, 2, 4, 1, 1, 3, 2, 4, 1, 0, 0), # 175
(3, 3, 7, 7, 1, 0, 3, 0, 2, 1, 1, 1, 0, 4, 5, 3, 2, 7, 1, 2, 1, 4, 3, 0, 0, 0), # 176
(6, 4, 7, 4, 5, 0, 2, 4, 2, 1, 2, 1, 0, 5, 3, 5, 4, 3, 4, 1, 4, 2, 2, 1, 1, 0), # 177
(3, 6, 1, 5, 1, 3, 2, 1, 2, 0, 1, 0, 0, 6, 2, 4, 1, 3, 2, 1, 0, 1, 0, 0, 2, 0), # 178
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # 179
)
station_arriving_intensity = (
(6.025038694046121, 6.630346271631799, 6.253539875535008, 7.457601328636119, 6.665622729131534, 3.766385918444806, 4.9752427384486975, 5.583811407575308, 7.308118874601608, 4.749618018626843, 5.046318196662723, 5.877498093967408, 6.100656255094035), # 0
(6.425192582423969, 7.06807283297371, 6.666415909596182, 7.950173103931939, 7.106988404969084, 4.015180300851067, 5.303362729516432, 5.951416467486849, 7.79069439159949, 5.062776830732579, 5.3797153631473575, 6.265459992977225, 6.503749976927826), # 1
(6.8240676107756775, 7.504062205069175, 7.077650742656896, 8.440785245597752, 7.546755568499692, 4.262982137414934, 5.630182209552845, 6.317550297485303, 8.271344168253059, 5.3746965300246545, 5.711787778531575, 6.651879182463666, 6.905237793851628), # 2
(7.220109351775874, 7.936584602323736, 7.485613043183825, 8.927491689038488, 7.983194011202282, 4.508808747102135, 5.954404369977547, 6.680761388993408, 8.74816219310531, 5.684139238111417, 6.041218094192859, 7.035222821916553, 7.30352736750507), # 3
(7.611763378099177, 8.363910239142928, 7.8886714796436435, 9.408346369659084, 8.41457352455579, 4.751677448878401, 6.27473240221015, 7.039598233433898, 9.219242454699248, 5.9898670766012145, 6.36668896150869, 7.413958070825716, 7.69702635952778), # 4
(7.9974752624202115, 8.784309329932306, 8.285194720503021, 9.881403222864472, 8.839163900039136, 4.990605561709457, 6.589869497670269, 7.392609322229511, 9.682678941577871, 6.290642167102395, 6.686883031856559, 7.786552088680978, 8.084142431559393), # 5
(8.375690577413598, 9.196052089097401, 8.673551434228639, 10.344716184059582, 9.255234929131252, 5.224610404561036, 6.898518847777515, 7.738343146802986, 10.136565642284177, 6.58522663122331, 7.000482956613939, 8.15147203497217, 8.463283245239527), # 6
(8.744854895753962, 9.597408731043757, 9.052110289287162, 10.796339188649354, 9.661056403311065, 5.452709296398865, 7.199383643951502, 8.075348198577062, 10.578996545361173, 6.872382590572303, 7.306171387158321, 8.507185069189115, 8.832856462207822), # 7
(9.103413790115921, 9.986649470176918, 9.419239954145274, 11.234326172038713, 10.054898114057503, 5.673919556188667, 7.491167077611837, 8.402172968974469, 11.008065639351846, 7.150872166757728, 7.602630974867185, 8.852158350821643, 9.1912697441039), # 8
(9.449812833174102, 10.362044520902426, 9.773309097269644, 11.656731069632603, 10.43502985284949, 5.88725850289618, 7.772572340178144, 8.717365949417955, 11.421866912799208, 7.419457481387929, 7.888544371118013, 9.184859039359576, 9.536930752567395), # 9
(9.782497597603118, 10.721864097625819, 10.11268638712695, 12.061607816835945, 10.79972141116596, 6.091743455487129, 8.042302623070025, 9.019475631330252, 11.818494354246257, 7.676900656071257, 8.162594227288288, 9.503754294292742, 9.868247149237932), # 10
(10.099913656077605, 11.064378414752648, 10.435740492183857, 12.447010349053675, 11.14724258048584, 6.286391732927242, 8.2990611177071, 9.307050506134097, 12.196041952235992, 7.921963812416062, 8.423463194755499, 9.807311275110973, 10.183626595755133), # 11
(10.400506581272174, 11.387857686688436, 10.740840080907047, 12.810992601690733, 11.475863152288053, 6.470220654182243, 8.541551015508974, 9.578639065252224, 12.552603695311413, 8.153409072030685, 8.669833924897121, 10.093997141304081, 10.48147675375864), # 12
(10.68272194586145, 11.690572127838744, 11.026353821763193, 13.151608510152052, 11.78385291805152, 6.642247538217868, 8.768475507895266, 9.832789800107378, 12.886273572015517, 8.369998556523484, 8.900389069090641, 10.362279052361904, 10.760205284888082), # 13
(10.945005322520059, 11.970791952609106, 11.290650383218976, 13.46691200984255, 12.069481669255188, 6.801489703999841, 8.978537786285592, 10.068051202122295, 13.195145570891304, 8.5704943875028, 9.113811278713541, 10.610624167774272, 11.018219850783076), # 14
(11.185802283922625, 12.22678737540506, 11.53209843374105, 13.754957036167182, 12.33101919737797, 6.946964470493895, 9.17044104209955, 10.282971762719706, 13.477313680481783, 8.753658686576989, 9.308783205143303, 10.837499647031004, 11.253928113083257), # 15
(11.40355840274376, 12.456828610632158, 11.749066641796109, 14.01379752453086, 12.5667352938988, 7.077689156665751, 9.34288846675677, 10.476099973322352, 13.730871889329944, 8.918253575354395, 9.483987499757415, 11.041372649621927, 11.465737733428254), # 16
(11.59671925165809, 12.659185872695934, 11.939923675850823, 14.241487410338534, 12.774899750296605, 7.192681081481142, 9.494583251676852, 10.64598432535298, 13.95391418597878, 9.06304117544336, 9.638106813933359, 11.220710335036866, 11.652056373457699), # 17
(11.763730403340244, 12.832129376001928, 12.103038204371856, 14.436080628995134, 12.953782358050306, 7.290957563905803, 9.62422858827942, 10.791173310234312, 14.144534558971316, 9.186783608452243, 9.76982379904861, 11.373979862765658, 11.811291694811214), # 18
(11.903037430464838, 12.973929334955693, 12.236778895825895, 14.595631115905576, 13.101652908638838, 7.37153592290545, 9.730527667984072, 10.910215419389093, 14.300826996850533, 9.288242995989393, 9.877821106480653, 11.499648392298115, 11.941851359128435), # 19
(12.013085905706498, 13.082855963962754, 12.339514418679602, 14.718192806474825, 13.216781193541133, 7.4334334774458215, 9.812183682210435, 11.00165914424006, 14.420885488159437, 9.36618145966315, 9.96078138760698, 11.59618308312407, 12.042143028048988), # 20
(12.09232140173984, 13.15717947742867, 12.409613441399662, 14.801819636107782, 13.297437004236105, 7.475667546492642, 9.86789982237811, 11.064052976209947, 14.502804021441024, 9.419361121081865, 10.01738729380507, 11.662051094733352, 12.110574363212494), # 21
(12.139189491239494, 13.195170089758973, 12.445444632452743, 14.844565540209402, 13.341890132202689, 7.497255449011639, 9.89637927990672, 11.095945406721498, 14.544676585238298, 9.44654410185389, 10.046321476452407, 11.695719586615787, 12.145553026258591), # 22
(12.156472036011166, 13.199668312757202, 12.449907818930042, 14.849916975308643, 13.353278467239116, 7.5, 9.899764802711205, 11.099392592592592, 14.54991148148148, 9.44975072702332, 10.049949644594088, 11.69987709190672, 12.15), # 23
(12.169214895640982, 13.197044444444446, 12.449177777777777, 14.849258333333335, 13.359729136337823, 7.5, 9.8979045751634, 11.0946, 14.549209999999999, 9.44778074074074, 10.049549494949495, 11.698903703703703, 12.15), # 24
(12.181688676253897, 13.191872427983538, 12.447736625514404, 14.84795524691358, 13.366037934713404, 7.5, 9.894238683127572, 11.085185185185185, 14.547824074074073, 9.443902606310013, 10.048756079311634, 11.696982167352537, 12.15), # 25
(12.19389242285764, 13.184231275720165, 12.445604115226338, 14.846022530864197, 13.372204642105325, 7.5, 9.888824061970466, 11.071325925925926, 14.54577148148148, 9.438180850480109, 10.047576580621024, 11.694138820301784, 12.15), # 26
(12.205825180459962, 13.174199999999997, 12.4428, 14.843474999999998, 13.378229038253057, 7.5, 9.881717647058824, 11.0532, 14.54307, 9.430679999999999, 10.046018181818182, 11.6904, 12.15), # 27
(12.217485994068602, 13.161857613168722, 12.439344032921811, 14.8403274691358, 13.384110902896081, 7.5, 9.87297637375938, 11.030985185185186, 14.539737407407406, 9.421464581618656, 10.04408806584362, 11.685792043895749, 12.15), # 28
(12.2288739086913, 13.147283127572017, 12.43525596707819, 14.83659475308642, 13.389850015773865, 7.5, 9.862657177438878, 11.004859259259257, 14.535791481481482, 9.410599122085047, 10.041793415637859, 11.680341289437584, 12.15), # 29
(12.239987969335797, 13.130555555555555, 12.430555555555555, 14.832291666666666, 13.395446156625884, 7.5, 9.850816993464052, 10.974999999999998, 14.53125, 9.398148148148149, 10.039141414141413, 11.674074074074072, 12.15), # 30
(12.25082722100983, 13.11175390946502, 12.42526255144033, 14.827433024691356, 13.400899105191609, 7.5, 9.837512757201647, 10.941585185185184, 14.52613074074074, 9.384176186556926, 10.0361392442948, 11.667016735253773, 12.15), # 31
(12.261390708721144, 13.09095720164609, 12.419396707818928, 14.822033641975308, 13.406208641210513, 7.5, 9.822801404018398, 10.904792592592594, 14.520451481481482, 9.368747764060357, 10.032794089038532, 11.659195610425241, 12.15), # 32
(12.271677477477477, 13.068244444444444, 12.412977777777778, 14.816108333333332, 13.411374544422076, 7.5, 9.806739869281046, 10.8648, 14.51423, 9.351927407407407, 10.02911313131313, 11.650637037037034, 12.15), # 33
(12.28168657228657, 13.04369465020576, 12.406025514403291, 14.809671913580246, 13.416396594565759, 7.5, 9.789385088356331, 10.821785185185183, 14.507484074074075, 9.33377964334705, 10.025103554059108, 11.641367352537722, 12.15), # 34
(12.291417038156167, 13.01738683127572, 12.398559670781895, 14.802739197530862, 13.421274571381044, 7.5, 9.77079399661099, 10.775925925925925, 14.500231481481482, 9.314368998628257, 10.020772540216983, 11.631412894375858, 12.15), # 35
(12.300867920094007, 12.989399999999998, 12.3906, 14.795324999999998, 13.426008254607403, 7.5, 9.751023529411764, 10.727400000000001, 14.492489999999998, 9.293759999999999, 10.016127272727273, 11.620800000000001, 12.15), # 36
(12.310038263107828, 12.95981316872428, 12.382166255144032, 14.787444135802469, 13.430597423984304, 7.5, 9.730130622125392, 10.676385185185184, 14.484277407407406, 9.272017174211248, 10.01117493453049, 11.609555006858711, 12.15), # 37
(12.31892711220537, 12.928705349794239, 12.37327818930041, 14.779111419753086, 13.435041859251228, 7.5, 9.708172210118615, 10.62305925925926, 14.475611481481481, 9.249205048010975, 10.005922708567153, 11.597704252400549, 12.15), # 38
(12.327533512394384, 12.896155555555554, 12.363955555555556, 14.770341666666667, 13.439341340147644, 7.5, 9.68520522875817, 10.567599999999999, 14.466510000000001, 9.225388148148149, 10.000377777777777, 11.585274074074073, 12.15), # 39
(12.335856508682596, 12.86224279835391, 12.354218106995884, 14.761149691358025, 13.443495646413021, 7.5, 9.661286613410796, 10.510185185185186, 14.456990740740741, 9.200631001371743, 9.99454732510288, 11.572290809327848, 12.15), # 40
(12.343895146077754, 12.82704609053498, 12.344085596707819, 14.751550308641974, 13.447504557786841, 7.5, 9.636473299443233, 10.450992592592593, 14.44707148148148, 9.174998134430727, 9.988438533482979, 11.558780795610424, 12.15), # 41
(12.3516484695876, 12.790644444444444, 12.333577777777778, 14.741558333333334, 13.45136785400857, 7.5, 9.610822222222222, 10.3902, 14.436770000000001, 9.148554074074074, 9.982058585858585, 11.54477037037037, 12.15), # 42
(12.35911552421987, 12.753116872427984, 12.322714403292181, 14.731188580246913, 13.455085314817683, 7.5, 9.584390317114499, 10.327985185185186, 14.426104074074072, 9.121363347050755, 9.97541466517022, 11.530285871056241, 12.15), # 43
(12.366295354982311, 12.714542386831276, 12.31151522633745, 14.72045586419753, 13.458656719953654, 7.5, 9.557234519486807, 10.264525925925927, 14.415091481481479, 9.09349048010974, 9.968513954358398, 11.515353635116599, 12.15), # 44
(12.37318700688266, 12.674999999999999, 12.299999999999999, 14.709375, 13.462081849155954, 7.5, 9.529411764705882, 10.2, 14.403749999999999, 9.065, 9.961363636363636, 11.499999999999998, 12.15), # 45
(12.379789524928656, 12.634568724279836, 12.288188477366253, 14.697960802469135, 13.465360482164058, 7.5, 9.500978988138465, 10.134585185185186, 14.392097407407405, 9.035956433470506, 9.953970894126448, 11.484251303155007, 12.15), # 46
(12.386101954128042, 12.59332757201646, 12.276100411522634, 14.686228086419751, 13.46849239871744, 7.5, 9.471993125151295, 10.068459259259258, 14.380151481481482, 9.006424307270233, 9.946342910587354, 11.468133882030179, 12.15), # 47
(12.392123339488554, 12.551355555555554, 12.263755555555555, 14.674191666666667, 13.471477378555573, 7.5, 9.442511111111111, 10.001800000000001, 14.367930000000001, 8.976468148148147, 9.938486868686867, 11.451674074074074, 12.15), # 48
(12.397852726017943, 12.508731687242797, 12.251173662551441, 14.661866358024692, 13.474315201417928, 7.5, 9.412589881384651, 9.934785185185184, 14.355450740740741, 8.946152482853224, 9.930409951365506, 11.434898216735254, 12.15), # 49
(12.403289158723938, 12.46553497942387, 12.23837448559671, 14.649266975308642, 13.477005647043978, 7.5, 9.38228637133866, 9.867592592592592, 14.342731481481481, 8.91554183813443, 9.922119341563786, 11.417832647462278, 12.15), # 50
(12.408431682614292, 12.421844444444444, 12.225377777777776, 14.636408333333332, 13.479548495173196, 7.5, 9.351657516339868, 9.8004, 14.329790000000001, 8.88470074074074, 9.913622222222223, 11.400503703703704, 12.15), # 51
(12.413279342696734, 12.377739094650208, 12.21220329218107, 14.62330524691358, 13.481943525545056, 7.5, 9.320760251755022, 9.733385185185183, 14.316644074074073, 8.853693717421125, 9.904925776281331, 11.382937722908094, 12.15), # 52
(12.417831183979011, 12.333297942386832, 12.198870781893005, 14.609972530864196, 13.484190517899036, 7.5, 9.28965151295086, 9.666725925925926, 14.303311481481483, 8.822585294924554, 9.89603718668163, 11.365161042524004, 12.15), # 53
(12.42208625146886, 12.2886, 12.185399999999998, 14.596425, 13.486289251974602, 7.5, 9.258388235294117, 9.600599999999998, 14.28981, 8.79144, 9.886963636363634, 11.347199999999999, 12.15), # 54
(12.426043590174027, 12.24372427983539, 12.171810699588478, 14.5826774691358, 13.488239507511228, 7.5, 9.227027354151536, 9.535185185185185, 14.276157407407407, 8.760322359396433, 9.877712308267864, 11.329080932784636, 12.15), # 55
(12.429702245102245, 12.198749794238683, 12.158122633744856, 14.568744753086419, 13.49004106424839, 7.5, 9.195625804889858, 9.470659259259259, 14.262371481481482, 8.729296899862826, 9.868290385334829, 11.310830178326475, 12.15), # 56
(12.433061261261258, 12.153755555555556, 12.144355555555556, 14.554641666666665, 13.49169370192556, 7.5, 9.164240522875817, 9.407200000000001, 14.24847, 8.698428148148148, 9.85870505050505, 11.292474074074073, 12.15), # 57
(12.436119683658815, 12.108820576131688, 12.130529218106995, 14.540383024691355, 13.493197200282209, 7.5, 9.132928443476155, 9.344985185185184, 14.23447074074074, 8.667780631001373, 9.848963486719043, 11.274038957475994, 12.15), # 58
(12.438876557302644, 12.064023868312757, 12.116663374485597, 14.525983641975307, 13.494551339057814, 7.5, 9.101746502057614, 9.284192592592593, 14.220391481481482, 8.637418875171468, 9.839072876917319, 11.255551165980796, 12.15), # 59
(12.441330927200491, 12.019444444444444, 12.102777777777776, 14.511458333333334, 13.495755897991843, 7.5, 9.070751633986927, 9.225, 14.20625, 8.607407407407408, 9.829040404040404, 11.237037037037037, 12.15), # 60
(12.443481838360098, 11.975161316872429, 12.08889218106996, 14.496821913580245, 13.496810656823774, 7.5, 9.040000774630839, 9.167585185185185, 14.192064074074073, 8.577810754458161, 9.818873251028807, 11.218522908093279, 12.15), # 61
(12.445328335789204, 11.931253497942386, 12.075026337448561, 14.482089197530865, 13.497715395293081, 7.5, 9.009550859356088, 9.112125925925925, 14.177851481481481, 8.548693443072702, 9.808578600823045, 11.20003511659808, 12.15), # 62
(12.44686946449555, 11.887799999999999, 12.0612, 14.467275, 13.498469893139227, 7.5, 8.979458823529411, 9.0588, 14.16363, 8.520119999999999, 9.798163636363636, 11.1816, 12.15), # 63
(12.448104269486876, 11.844879835390946, 12.047432921810698, 14.452394135802468, 13.499073930101698, 7.5, 8.94978160251755, 9.007785185185186, 14.149417407407407, 8.492154951989026, 9.787635540591094, 11.1632438957476, 12.15), # 64
(12.449031795770926, 11.802572016460903, 12.033744855967079, 14.437461419753085, 13.49952728591996, 7.5, 8.920576131687243, 8.959259259259259, 14.135231481481481, 8.464862825788751, 9.777001496445942, 11.144993141289435, 12.15), # 65
(12.449651088355436, 11.760955555555556, 12.020155555555556, 14.422491666666666, 13.499829740333487, 7.5, 8.891899346405228, 8.913400000000001, 14.12109, 8.438308148148147, 9.766268686868687, 11.126874074074076, 12.15), # 66
(12.44996119224815, 11.720109465020576, 12.00668477366255, 14.407499691358023, 13.499981073081754, 7.5, 8.863808182038246, 8.870385185185187, 14.10701074074074, 8.412555445816187, 9.755444294799851, 11.108913031550067, 12.15), # 67
(12.44974993737699, 11.679898367184387, 11.993287139917694, 14.392370088566828, 13.499853546356814, 7.49986081390032, 8.836218233795575, 8.830012620027434, 14.092905418381346, 8.3875445299766, 9.74434318624845, 11.09103602627969, 12.149850180041152), # 68
(12.447770048309177, 11.639094623655915, 11.979586111111109, 14.376340217391302, 13.498692810457515, 7.49876049382716, 8.808321817615935, 8.790118518518518, 14.078157407407408, 8.362567668845314, 9.731835406698563, 11.072662768031188, 12.148663194444444), # 69
(12.443862945070673, 11.597510951812026, 11.965522119341562, 14.35930454911433, 13.49639917695473, 7.496593507087334, 8.779992161473643, 8.75034293552812, 14.062683470507546, 8.33750342935528, 9.717778663831295, 11.05370731355137, 12.14631880144033), # 70
(12.438083592771514, 11.555172202309835, 11.951100102880657, 14.341288204508858, 13.493001694504963, 7.49339497027892, 8.751241991446784, 8.710699039780522, 14.046506652949246, 8.312352431211167, 9.702224844940634, 11.034183524655257, 12.142847865226338), # 71
(12.430486956521738, 11.51210322580645, 11.936324999999998, 14.322316304347826, 13.488529411764706, 7.4892, 8.722084033613445, 8.671199999999999, 14.02965, 8.287115294117646, 9.685225837320575, 11.014105263157894, 12.13828125), # 72
(12.421128001431383, 11.46832887295898, 11.921201748971193, 14.302413969404187, 13.48301137739046, 7.48404371284865, 8.69253101405171, 8.631858984910837, 14.012136556927299, 8.261792637779392, 9.666833528265105, 10.993486390874303, 12.132649819958848), # 73
(12.410061692610485, 11.423873994424532, 11.905735288065841, 14.281606320450885, 13.47647664003873, 7.477961225422954, 8.662595658839667, 8.59268916323731, 13.993989368998628, 8.236385081901073, 9.647099805068226, 10.972340769619521, 12.125984439300412), # 74
(12.397342995169081, 11.378763440860213, 11.889930555555553, 14.25991847826087, 13.468954248366014, 7.470987654320988, 8.6322906940554, 8.553703703703704, 13.97523148148148, 8.210893246187362, 9.626076555023921, 10.950682261208575, 12.118315972222222), # 75
(12.383026874217212, 11.33302206292314, 11.873792489711933, 14.237375563607086, 13.460473251028805, 7.463158116140832, 8.601628845776993, 8.514915775034293, 13.955885939643347, 8.185317750342934, 9.60381566542619, 10.928524727456498, 12.10967528292181), # 76
(12.367168294864912, 11.286674711270411, 11.857326028806582, 14.214002697262478, 13.451062696683609, 7.454507727480566, 8.570622840082535, 8.476338545953361, 13.935975788751714, 8.15965921407246, 9.580369023569023, 10.905882030178327, 12.10009323559671), # 77
(12.349822222222222, 11.23974623655914, 11.84053611111111, 14.189824999999999, 13.440751633986928, 7.445071604938271, 8.53928540305011, 8.437985185185186, 13.915524074074073, 8.133918257080609, 9.55578851674641, 10.882768031189086, 12.089600694444444), # 78
(12.331043621399177, 11.192261489446436, 11.823427674897118, 14.164867592592591, 13.429569111595256, 7.434884865112025, 8.5076292607578, 8.399868861454047, 13.894553840877913, 8.108095499072055, 9.530126032252346, 10.859196592303805, 12.07822852366255), # 79
(12.310887457505816, 11.144245320589407, 11.806005658436213, 14.139155595813206, 13.417544178165095, 7.423982624599908, 8.475667139283697, 8.362002743484226, 13.873088134430727, 8.082191559751472, 9.503433457380826, 10.835181575337522, 12.066007587448558), # 80
(12.289408695652174, 11.09572258064516, 11.788274999999999, 14.112714130434783, 13.40470588235294, 7.412399999999999, 8.443411764705882, 8.3244, 13.851149999999999, 8.05620705882353, 9.475762679425838, 10.810736842105262, 12.052968749999998), # 81
(12.26666230094829, 11.046718120270809, 11.770240637860082, 14.085568317230273, 13.391083272815298, 7.40017210791038, 8.410875863102444, 8.28707379972565, 13.828762482853223, 8.030142615992899, 9.447165585681375, 10.785876254422064, 12.039142875514404), # 82
(12.242703238504205, 10.997256790123457, 11.751907510288065, 14.057743276972623, 13.376705398208665, 7.387334064929126, 8.378072160551463, 8.250037311385459, 13.805948628257887, 8.003998850964253, 9.417694063441433, 10.760613674102954, 12.0245608281893), # 83
(12.21758647342995, 10.947363440860215, 11.733280555555554, 14.029264130434782, 13.361601307189543, 7.373920987654321, 8.345013383131029, 8.213303703703703, 13.78273148148148, 7.977776383442266, 9.3874, 10.734962962962962, 12.009253472222222), # 84
(12.191366970835569, 10.897062923138192, 11.714364711934154, 14.000155998389696, 13.345800048414427, 7.359967992684042, 8.311712256919229, 8.176886145404664, 13.759134087791493, 7.951475833131606, 9.356335282651072, 10.708937982817124, 11.9932516718107), # 85
(12.164099695831096, 10.846380087614497, 11.695164917695474, 13.970444001610307, 13.32933067053982, 7.34551019661637, 8.278181507994145, 8.14079780521262, 13.73517949245542, 7.925097819736949, 9.32455179868864, 10.682552595480471, 11.976586291152262), # 86
(12.135839613526569, 10.795339784946236, 11.67568611111111, 13.940153260869563, 13.312222222222223, 7.330582716049382, 8.244433862433862, 8.10505185185185, 13.710890740740743, 7.8986429629629615, 9.292101435406698, 10.655820662768031, 11.959288194444444), # 87
(12.106641689032028, 10.74396686579052, 11.655933230452675, 13.90930889694042, 13.29450375211813, 7.315220667581161, 8.210482046316468, 8.069661454046638, 13.686290877914953, 7.8721118825143215, 9.259036080099238, 10.628756046494837, 11.941388245884776), # 88
(12.076560887457505, 10.69228618080446, 11.63591121399177, 13.877936030595812, 13.276204308884047, 7.299459167809785, 8.176338785720048, 8.034639780521262, 13.661402949245542, 7.845505198095699, 9.225407620060253, 10.601372608475922, 11.922917309670781), # 89
(12.045652173913043, 10.640322580645162, 11.615625, 13.846059782608696, 13.257352941176471, 7.283333333333333, 8.142016806722689, 7.999999999999999, 13.636250000000002, 7.818823529411764, 9.191267942583732, 10.573684210526315, 11.90390625), # 90
(12.013970513508676, 10.588100915969731, 11.59507952674897, 13.813705273752015, 13.237978697651899, 7.266878280749885, 8.107528835402473, 7.965755281207133, 13.610855075445818, 7.79206749616719, 9.15666893496367, 10.54570471446105, 11.884385931069957), # 91
(11.981570871354446, 10.535646037435285, 11.574279732510288, 13.78089762479871, 13.218110626966835, 7.250129126657521, 8.07288759783749, 7.9319187928669415, 13.585241220850481, 7.7652377180666505, 9.121662484494063, 10.517447982095156, 11.864387217078187), # 92
(11.948508212560386, 10.482982795698925, 11.553230555555555, 13.74766195652174, 13.197777777777778, 7.2331209876543205, 8.03810582010582, 7.898503703703704, 13.55943148148148, 7.738334814814813, 9.0863004784689, 10.488927875243665, 11.84394097222222), # 93
(11.914837502236535, 10.43013604141776, 11.531936934156379, 13.714023389694042, 13.177009198741224, 7.215888980338362, 8.003196228285553, 7.865523182441701, 13.53344890260631, 7.7113594061163555, 9.050634804182172, 10.460158255721609, 11.823078060699588), # 94
(11.880613705492932, 10.377130625248904, 11.510403806584362, 13.680007045088566, 13.155833938513677, 7.198468221307727, 7.968171548454772, 7.832990397805213, 13.507316529492455, 7.684312111675945, 9.014717348927874, 10.431152985344015, 11.801829346707818), # 95
(11.845891787439614, 10.323991397849465, 11.488636111111111, 13.645638043478261, 13.134281045751633, 7.180893827160493, 7.933044506691564, 7.800918518518519, 13.481057407407405, 7.657193551198256, 8.9786, 10.401925925925926, 11.780225694444445), # 96
(11.810726713186616, 10.270743209876544, 11.466638786008229, 13.610941505636069, 13.112379569111596, 7.163200914494741, 7.897827829074016, 7.769320713305898, 13.454694581618655, 7.63000434438796, 8.942334644692538, 10.372490939282363, 11.758297968106996), # 97
(11.775173447843981, 10.217410911987256, 11.444416769547324, 13.575942552334944, 13.090158557250062, 7.145424599908551, 7.86253424168021, 7.738210150891632, 13.428251097393689, 7.602745110949729, 8.905973170299486, 10.342861887228358, 11.736077031893004), # 98
(11.739286956521738, 10.16401935483871, 11.421975, 13.540666304347825, 13.06764705882353, 7.1276, 7.827176470588236, 7.707599999999999, 13.40175, 7.575416470588234, 8.869567464114832, 10.313052631578946, 11.71359375), # 99
(11.703122204329933, 10.110593389088011, 11.39931841563786, 13.505137882447665, 13.044874122488501, 7.109762231367169, 7.791767241876174, 7.677503429355281, 13.375214334705076, 7.548019043008149, 8.833169413432572, 10.28307703414916, 11.690878986625515), # 100
(11.6667341563786, 10.057157865392274, 11.376451954732511, 13.469382407407409, 13.021868796901476, 7.091946410608139, 7.756319281622114, 7.647933607681755, 13.348667146776405, 7.5205534479141445, 8.796830905546694, 10.252948956754024, 11.667963605967076), # 101
(11.630177777777778, 10.003737634408603, 11.353380555555555, 13.433425, 12.998660130718955, 7.074187654320988, 7.720845315904139, 7.618903703703703, 13.32213148148148, 7.4930203050108934, 8.760603827751195, 10.222682261208577, 11.644878472222222), # 102
(11.593508033637502, 9.950357546794105, 11.3301091563786, 13.39729078099839, 12.975277172597435, 7.056521079103795, 7.685358070800336, 7.590426886145404, 13.295630384087792, 7.465420234003066, 8.724540067340067, 10.192290809327847, 11.621654449588474), # 103
(11.556779889067812, 9.897042453205893, 11.30664269547325, 13.361004871175522, 12.951748971193416, 7.03898180155464, 7.649870272388791, 7.562516323731138, 13.269186899862826, 7.437753854595336, 8.6886915116073, 10.161788462926864, 11.598322402263374), # 104
(11.520048309178742, 9.843817204301073, 11.28298611111111, 13.324592391304348, 12.928104575163397, 7.021604938271605, 7.614394646747589, 7.535185185185185, 13.242824074074074, 7.410021786492375, 8.653110047846889, 10.131189083820663, 11.574913194444443), # 105
(11.483368259080336, 9.790706650736759, 11.259144341563784, 13.288078462157811, 12.904373033163884, 7.004425605852766, 7.578943919954813, 7.508446639231824, 13.216564951989024, 7.382224649398854, 8.617847563352825, 10.100506533824273, 11.551457690329217), # 106
(11.446794703882626, 9.737735643170053, 11.235122325102882, 13.251488204508856, 12.880583393851365, 6.987478920896206, 7.543530818088553, 7.482313854595337, 13.190432578875171, 7.354363063019446, 8.582955945419101, 10.069754674752724, 11.527986754115226), # 107
(11.410382608695652, 9.684929032258065, 11.210925000000001, 13.214846739130435, 12.856764705882352, 6.9708, 7.508168067226889, 7.4568, 13.16445, 7.326437647058824, 8.548487081339712, 10.038947368421054, 11.504531250000001), # 108
(11.374186938629451, 9.632311668657906, 11.18655730452675, 13.178179186795488, 12.832946017913338, 6.954423959762231, 7.472868393447913, 7.431918244170096, 13.138640260631002, 7.298449021221656, 8.514492858408648, 10.008098476644285, 11.48112204218107), # 109
(11.338262658794058, 9.579908403026684, 11.162024176954734, 13.141510668276974, 12.809156378600823, 6.938385916780978, 7.437644522829707, 7.407681755829903, 13.113026406035663, 7.270397805212619, 8.4810251639199, 9.977221861237457, 11.457789994855966), # 110
(11.302664734299517, 9.527744086021507, 11.137330555555558, 13.104866304347826, 12.785424836601306, 6.922720987654322, 7.402509181450357, 7.384103703703703, 13.087631481481482, 7.242284618736383, 8.448135885167463, 9.946331384015595, 11.434565972222222), # 111
(11.26744813025586, 9.47584356829948, 11.112481378600824, 13.068271215780998, 12.76178044057129, 6.907464288980339, 7.367475095387949, 7.361197256515775, 13.062478532235938, 7.214110081497618, 8.41587690944533, 9.915440906793732, 11.411480838477365), # 112
(11.232605068443652, 9.424318342543142, 11.087541393902482, 13.031800658990448, 12.738210816208445, 6.892643723057416, 7.332631156388123, 7.339023082536727, 13.037655373510344, 7.185965683935275, 8.38430868738344, 9.884631523805313, 11.388532681011865), # 113
(11.197777077480078, 9.373676620230642, 11.062854810025941, 12.995747305532804, 12.71447202547959, 6.8782255302358815, 7.298421850092694, 7.317853511406144, 13.013542842855673, 7.158378201495339, 8.353493204535836, 9.85429460653557, 11.365530496992042), # 114
(11.162861883604794, 9.323936638419655, 11.038436319248781, 12.960101406218135, 12.69048921346632, 6.864172214998518, 7.264871580229873, 7.297683185134451, 12.990149974402547, 7.131390393585692, 8.323385413712511, 9.824445099070621, 11.342407957992451), # 115
(11.127815847885161, 9.275025937550042, 11.014238627980648, 12.924799380319685, 12.666226231660534, 6.8504506527445175, 7.231925781033471, 7.278456375478791, 12.967417607073395, 7.104952030139456, 8.293927117525778, 9.795027836984815, 11.319128711707068), # 116
(11.092595331388527, 9.226872058061664, 10.990214442631183, 12.889777647110693, 12.641646931554133, 6.837027718873069, 7.199529886737303, 7.260117354196302, 12.945286579790643, 7.079012881089755, 8.26506011858794, 9.7659876558525, 11.295656405829869), # 117
(11.057156695182252, 9.179402540394388, 10.96631646961004, 12.8549726258644, 12.61671516463901, 6.8238702887833655, 7.167629331575178, 7.2426103930441155, 12.923697731476722, 7.053522716369711, 8.236726219511308, 9.737269391248018, 11.271954688054828), # 118
(11.02145630033369, 9.132544924988075, 10.942497415326867, 12.820320735854047, 12.591394782407065, 6.810945237874599, 7.136169549780907, 7.225879763779374, 12.902591901054052, 7.028431305912446, 8.208867222908193, 9.708817878745721, 11.247987206075917), # 119
(10.985450507910194, 9.08622675228259, 10.918709986191313, 12.785758396352874, 12.565649636350196, 6.7982194415459585, 7.105095975588303, 7.209869738159211, 12.88190992744507, 7.003688419651087, 8.181424931390898, 9.680577953919956, 11.223717607587115), # 120
(10.949095678979122, 9.040375562717795, 10.894906888613024, 12.75122202663412, 12.539443577960302, 6.7856597751966365, 7.0743540432311764, 7.1945245879407675, 12.861592649572199, 6.979243827518755, 8.154341147571738, 9.652494452345065, 11.199109540282393), # 121
(10.912348174607825, 8.994918896733553, 10.871040829001652, 12.716648045971025, 12.512740458729281, 6.773233114225823, 7.043889186943341, 7.179788584881178, 12.841580906357867, 6.955047299448572, 8.127557674063022, 9.6245122095954, 11.174126651855724), # 122
(10.875164355863662, 8.949784294769728, 10.847064513766842, 12.681972873636832, 12.485504130149028, 6.76090633403271, 7.013646840958606, 7.16560600073758, 12.821815536724504, 6.931048605373665, 8.101016313477052, 9.596576061245305, 11.148732590001085), # 123
(10.837500583813984, 8.904899297266184, 10.822930649318243, 12.647132928904783, 12.457698443711445, 6.748646310016486, 6.983572439510783, 7.151921107267111, 12.802237379594539, 6.9071975152271525, 8.074658868426143, 9.56863084286913, 11.122891002412453), # 124
(10.79931321952615, 8.860191444662783, 10.798591942065508, 12.612064631048112, 12.429287250908427, 6.736419917576347, 6.953611416833687, 7.138678176226909, 12.78278727389039, 6.88344379894216, 8.048427141522602, 9.540621390041217, 11.096565536783794), # 125
(10.760558624067514, 8.815588277399392, 10.774001098418278, 12.576704399340064, 12.400234403231872, 6.724194032111481, 6.923709207161124, 7.12582147937411, 12.763406058534501, 6.859737226451811, 8.022262935378736, 9.51249253833592, 11.069719840809094), # 126
(10.721193158505432, 8.771017335915868, 10.749110824786205, 12.540988653053878, 12.370503752173677, 6.711935529021078, 6.893811244726913, 7.113295288465854, 12.744034572449289, 6.836027567689229, 7.9961080526068535, 9.484189123327578, 11.042317562182317), # 127
(10.681173183907255, 8.72640616065208, 10.72387382757894, 12.504853811462798, 12.340059149225747, 6.699611283704333, 6.863862963764858, 7.101043875259275, 12.72461365455718, 6.8122645925875345, 7.969904295819269, 9.455655980590546, 11.014322348597444), # 128
(10.640455061340337, 8.681682292047888, 10.698242813206127, 12.468236293840057, 12.308864445879973, 6.687188171560433, 6.833809798508775, 7.089011511511512, 12.705084143780608, 6.788398071079854, 7.943593467628284, 9.426837945699162, 10.985697847748446), # 129
(10.598995151872039, 8.63677327054316, 10.672170488077414, 12.431072519458903, 12.276883493628256, 6.6746330679885695, 6.803597183192475, 7.077142468979701, 12.685386879042001, 6.764377773099308, 7.9171173706462135, 9.397679854227782, 10.956407707329298), # 130
(10.556749816569713, 8.591606636577751, 10.645609558602457, 12.39329890759257, 12.244080143962494, 6.661912848387936, 6.773170552049771, 7.06538101942098, 12.665462699263783, 6.740153468579022, 7.890417807485361, 9.36812654175075, 10.926415575033973), # 131
(10.51367541650071, 8.546109930591532, 10.618512731190895, 12.354851877514305, 12.210418248374584, 6.648994388157723, 6.7424753393144705, 7.053671434592488, 12.645252443368385, 6.715674927452118, 7.863436580758037, 9.33812284384241, 10.89568509855645), # 132
(10.469728312732395, 8.500210693024362, 10.59083271225238, 12.315667848497341, 12.175861658356423, 6.63584456269712, 6.711456979220387, 7.041957986251359, 12.624696950278231, 6.690891919651718, 7.8361154930765515, 9.307613596077111, 10.864179925590703), # 133
(10.424864866332113, 8.453836464316106, 10.562522208196564, 12.275683239814922, 12.14037422539991, 6.622430247405318, 6.6800609060013345, 7.0301849461547326, 12.603737058915753, 6.665754215110948, 7.808396347053214, 9.2765436340292, 10.831863703830699), # 134
(10.379041438367224, 8.406914784906629, 10.53353392543309, 12.234834470740294, 12.103919800996945, 6.60871831768151, 6.648232553891121, 7.018296586059743, 12.582313608203375, 6.640211583762931, 7.78022094530033, 9.244857793273022, 10.798700080970423), # 135
(10.332214389905081, 8.35937319523579, 10.50382057037161, 12.193057960546687, 12.066462236639419, 6.594675648924887, 6.615917357123561, 7.0062371777235315, 12.560367437063528, 6.6142137955407865, 7.751531090430213, 9.212500909382928, 10.764652704703844), # 136
(10.28434008201304, 8.311139235743456, 10.473334849421772, 12.150290128507349, 12.027965383819241, 6.580269116534637, 6.583060749932466, 6.993950992903235, 12.537839384418639, 6.587710620377641, 7.722268585055167, 9.179417817933263, 10.729685222724932), # 137
(10.235374875758456, 8.26214044686949, 10.442029468993221, 12.106467393895516, 11.988393094028302, 6.565465595909957, 6.5496081665516455, 6.981382303355987, 12.514670289191137, 6.560651828206615, 7.692375231787501, 9.145553354498373, 10.693761282727667), # 138
(10.185275132208682, 8.212304369053752, 10.409857135495608, 12.06152617598443, 11.947709218758497, 6.550231962450032, 6.515505041214911, 6.968475380838929, 12.490800990303445, 6.532987188960836, 7.661792833239527, 9.110852354652607, 10.656844532406023), # 139
(10.133997212431076, 8.16155854273611, 10.376770555338585, 12.015402894047332, 11.905877609501735, 6.534535091554055, 6.480696808156076, 6.955174497109195, 12.466172326677999, 6.5046664725734225, 7.630463192023552, 9.07525965397031, 10.618898619453978), # 140
(10.081497477492995, 8.109830508356424, 10.342722434931792, 11.968033967357464, 11.862862117749904, 6.518341858621218, 6.445128901608954, 6.9414239239239235, 12.440725137237216, 6.4756394489775015, 7.598328110751885, 9.03872008802583, 10.579887191565495), # 141
(10.027732288461786, 8.057047806354559, 10.307665480684884, 11.919355815188064, 11.818626594994903, 6.501619139050712, 6.408746755807351, 6.927167933040253, 12.41440026090353, 6.445855888106193, 7.565329392036836, 9.001178492393512, 10.539773896434559), # 142
(9.972658006404808, 8.003137977170377, 10.27155239900751, 11.86930485681237, 11.773134892728635, 6.484333808241727, 6.371495804985082, 6.912350796215319, 12.387138536599375, 6.415265559892623, 7.531408838490711, 8.962579702647707, 10.49852238175514), # 143
(9.916230992389421, 7.948028561243743, 10.234335896309313, 11.817817511503627, 11.726350862442994, 6.466452741593456, 6.333321483375959, 6.896916785206259, 12.358880803247171, 6.383818234269912, 7.496508252725821, 8.922868554362758, 10.456096295221217), # 144
(9.858407607482972, 7.891647099014518, 10.195968678999947, 11.764830198535073, 11.67823835562988, 6.4479428145050885, 6.294169225213792, 6.880810171770211, 12.329567899769344, 6.351463681171185, 7.460569437354474, 8.881989883113016, 10.41245928452676), # 145
(9.79914421275282, 7.83392113092257, 10.156403453489059, 11.71027933717995, 11.62876122378119, 6.428770902375816, 6.253984464732396, 6.863975227664311, 12.299140665088327, 6.318151670529565, 7.423534194988978, 8.839888524472823, 10.367574997365741), # 146
(9.73839716926632, 7.774778197407756, 10.115592926186292, 11.654101346711496, 11.577883318388821, 6.4089038806048295, 6.212712636165577, 6.846356224645698, 12.267539938126548, 6.283831972278175, 7.385344328241643, 8.796509314016532, 10.321407081432142), # 147
(9.676122838090825, 7.714145838909944, 10.0734898035013, 11.596232646402955, 11.525568490944673, 6.38830862459132, 6.170299173747152, 6.827897434471509, 12.234706557806435, 6.248454356350137, 7.345941639724779, 8.751797087318483, 10.27391918441993), # 148
(9.612277580293695, 7.651951595868995, 10.030046791843732, 11.536609655527563, 11.471780592940645, 6.366952009734479, 6.126689511710929, 6.80854312889888, 12.200581363050405, 6.211968592678576, 7.3052679320506915, 8.705696679953029, 10.225074954023084), # 149
(9.546817756942277, 7.588123008724775, 9.985216597623232, 11.475168793358565, 11.416483475868631, 6.344800911433499, 6.08182908429072, 6.788237579684948, 12.165105192780901, 6.174324451196612, 7.2632650078316905, 8.658152927494514, 10.174838037935576), # 150
(9.47969972910393, 7.522587617917144, 9.93895192724945, 11.411846479169196, 11.359640991220532, 6.321822205087566, 6.03566332572034, 6.7669250585868514, 12.128218885920345, 6.135471701837373, 7.2198746696800855, 8.609110665517285, 10.123172083851381), # 151
(9.41087985784601, 7.455272963885967, 9.89120548713204, 11.346579132232701, 11.301216990488243, 6.297982766095876, 5.9881376702335976, 6.744549837361729, 12.089863281391164, 6.095360114533979, 7.175038720208185, 8.558514729595691, 10.070040739464476), # 152
(9.340314504235872, 7.386106587071107, 9.841929983680641, 11.279303171822319, 11.241175325163667, 6.273249469857618, 5.939197552064303, 6.721056187766714, 12.049979218115787, 6.053939459219555, 7.128698962028299, 8.506309955304076, 10.015407652468832), # 153
(9.267960029340873, 7.315016027912428, 9.79107812330491, 11.209955017211291, 11.179479846738696, 6.247589191771985, 5.888788405446274, 6.696388381558948, 12.008507535016639, 6.011159505827223, 7.080797197752734, 8.45244117821679, 9.959236470558428), # 154
(9.193772794228362, 7.241928826849794, 9.73860261241449, 11.138471087672853, 11.116094406705235, 6.220968807238165, 5.836855664613313, 6.670490690495563, 11.965389071016153, 5.966970024290105, 7.0312752299938, 8.396853233908178, 9.901490841427231), # 155
(9.117709159965697, 7.166772524323065, 9.684456157419032, 11.06478780248025, 11.050982856555176, 6.193355191655353, 5.7833447637992395, 6.643307386333702, 11.920564665036752, 5.921320784541327, 6.980074861363805, 8.339490957952586, 9.842134412769221), # 156
(9.039725487620235, 7.089474660772107, 9.628591464728181, 10.988841580906724, 10.984109047780422, 6.164715220422736, 5.728201137237862, 6.614782740830498, 11.873975156000865, 5.874161556514009, 6.927137894475059, 8.280299185924363, 9.781130832278372), # 157
(8.957617135686286, 7.008543744926709, 9.568310344682827, 10.907723497981491, 10.912417327045196, 6.133229371580532, 5.6701280651134285, 6.582956342819247, 11.821994509918916, 5.824039099549372, 6.870714903046731, 8.217119477033206, 9.715783031298415), # 158
(8.858744120374082, 6.915678383519373, 9.488085382083584, 10.804772590546143, 10.818229571737954, 6.088427577608523, 5.601855316062859, 6.536656239317259, 11.743712713466573, 5.762737192918494, 6.800900322742793, 8.13763502841973, 9.630513176304232), # 159
(8.741846513885172, 6.810116074248857, 9.386305149547066, 10.67829301249063, 10.699704157616154, 6.0292095552572205, 5.5226924980605405, 6.4747190274328155, 11.636910272674381, 5.689446782235472, 6.716711410331447, 8.040602338665416, 9.523704730672296), # 160
(8.607866465503152, 6.692545041696563, 9.26405636629237, 10.529487004508074, 10.558071749138534, 5.956292689884377, 5.433217735208252, 6.397920639731736, 11.50299572039882, 5.604789831805125, 6.618889985519648, 7.926920962689085, 9.396448853782916), # 161
(8.457746124511628, 6.563653510443886, 9.122425751538595, 10.359556807291591, 10.394563010763845, 5.870394366847746, 5.334009151607771, 6.307037008779842, 11.343377589496363, 5.509388305932277, 6.508177868014344, 7.797490455409552, 9.2498367050164), # 162
(8.292427640194196, 6.424129705072228, 8.962500024504841, 10.16970466153432, 10.210408606950825, 5.772231971505087, 5.22564487136088, 6.20284406714295, 11.159464412823487, 5.40386416892175, 6.38531687752249, 7.653210371745638, 9.084959443753055), # 163
(8.11285316183446, 6.2746618501629845, 8.785365904410211, 9.961132807929381, 10.006839202158226, 5.662522889214155, 5.108703018569359, 6.086117747386882, 10.952664723236667, 5.2888393850783615, 6.251048833751035, 7.494980266616163, 8.902908229373192), # 164
(7.9199648387160195, 6.115938170297558, 8.592110110473802, 9.735043487169902, 9.785085460844789, 5.541984505332703, 4.983761717334986, 5.957633982077455, 10.724387053592375, 5.164935918706936, 6.106115556406933, 7.323699694939943, 8.704774221257123), # 165
(7.714704820122476, 5.948646890057345, 8.383819361914712, 9.492638939949002, 9.546378047469256, 5.41133420521849, 4.851399091759543, 5.818168703780493, 10.476039936747087, 5.0327757341122945, 5.9512588651971345, 7.140268211635801, 8.491648578785155), # 166
(7.498015255337426, 5.773476234023744, 8.161580377952045, 9.235121406959811, 9.291947626490375, 5.27128937422927, 4.712193265944809, 5.668497845061811, 10.209031905557278, 4.892980795599256, 5.787220579828592, 6.94558537162255, 8.264622461337595), # 167
(7.2708382936444735, 5.591114426778154, 7.926479877804897, 8.963693128895455, 9.02302486236689, 5.122567397722799, 4.5667223639925645, 5.509397338487231, 9.924771492879426, 4.746173067472646, 5.614742520008257, 6.740550729819013, 8.024787028294753), # 168
(7.034116084327218, 5.402249692901975, 7.67960458069237, 8.67955634644906, 8.740840419557543, 4.965885661056833, 4.4155645100045895, 5.341643116622574, 9.624667231570005, 4.592974514037284, 5.434566505443081, 6.526063841144007, 7.773233439036942), # 169
(6.78879077666926, 5.207570256976605, 7.422041205833562, 8.383913300313743, 8.44662496252108, 4.8019615495891275, 4.259297828082663, 5.166011112033656, 9.310127654485486, 4.434007099597989, 5.247434355840019, 6.3030242605163505, 7.5110528529444665), # 170
(6.5358045199542, 5.007764343583441, 7.154876472447573, 8.077966231182643, 8.141609155716246, 4.631512448677438, 4.098500442328566, 4.983277257286299, 8.982561294482347, 4.269892788459586, 5.054087890906017, 6.072331542854863, 7.239336429397638), # 171
(6.276099463465638, 4.803520177303883, 6.879197099753504, 7.762917379748876, 7.827023663601784, 4.45525574367952, 3.9337504768440783, 4.794217484946325, 8.643376684417062, 4.101253544926895, 4.855268930348032, 5.834885243078365, 6.959175327776763), # 172
(6.010617756487176, 4.59552598271933, 6.596089806970453, 7.43996898670557, 7.504099150636442, 4.27390881995313, 3.7656260557309795, 4.599607727579548, 8.293982357146106, 3.9287113333047374, 4.651719293873013, 5.59158491610567, 6.671660707462155), # 173
(5.740301548302412, 4.384469984411181, 6.306641313317521, 7.110323292745848, 7.174066281278959, 4.088189062856022, 3.5947053030910503, 4.400223917751792, 7.935786845525956, 3.752888117897936, 4.444180801187913, 5.3433301168556016, 6.37788372783412), # 174
(5.466092988194946, 4.171040406960834, 6.01193833801381, 6.775182538562841, 6.838155719988083, 3.898813857745954, 3.421566343026069, 4.196841988028875, 7.570198682413086, 3.574405863011309, 4.233395271999683, 5.091020400246977, 6.078935548272969), # 175
(5.188934225448382, 3.9559254749496873, 5.713067600278413, 6.43574896484967, 6.497598131222556, 3.7065005899806795, 3.2467872996378175, 3.9902378709766184, 7.1986264006639695, 3.3938865329496806, 4.020104526015276, 4.835555321198615, 5.7759073281590085), # 176
(4.909767409346319, 3.7398134129591414, 5.411115819330436, 6.09322481229946, 6.1536241794411275, 3.511966644917956, 3.0709462970280748, 3.781187499160839, 6.822478533135084, 3.2119520920178695, 3.8050503829416424, 4.5778344346293345, 5.4698902268725496), # 177
(4.629534689172356, 3.5233924455705936, 5.107169714388976, 5.748812321605339, 5.807464529102536, 3.3159294079155393, 2.894621459298621, 3.5704668051473587, 6.443163612682903, 3.0292245045207, 3.588974662485735, 4.318757295457952, 5.161975403793902), # 178
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 179
)
passenger_arriving_acc = (
(4, 4, 4, 5, 5, 1, 2, 3, 0, 2, 1, 1, 0, 6, 10, 3, 7, 3, 8, 0, 4, 3, 2, 0, 0, 0), # 0
(10, 11, 13, 12, 10, 1, 4, 4, 2, 5, 2, 2, 0, 11, 18, 7, 9, 6, 12, 1, 7, 6, 4, 1, 1, 0), # 1
(20, 17, 24, 18, 16, 5, 9, 5, 5, 6, 4, 3, 0, 23, 21, 15, 11, 11, 15, 5, 10, 6, 6, 2, 1, 0), # 2
(25, 27, 33, 26, 20, 6, 10, 7, 7, 7, 6, 3, 0, 37, 28, 21, 15, 21, 18, 9, 11, 6, 8, 2, 2, 0), # 3
(37, 38, 37, 36, 28, 9, 13, 9, 12, 8, 7, 4, 0, 44, 34, 27, 19, 26, 26, 12, 13, 9, 11, 2, 4, 0), # 4
(44, 43, 38, 41, 34, 11, 15, 14, 13, 11, 8, 6, 0, 54, 39, 34, 25, 32, 29, 15, 15, 12, 12, 2, 4, 0), # 5
(53, 48, 46, 49, 38, 12, 26, 16, 19, 12, 9, 6, 0, 65, 47, 38, 30, 39, 35, 20, 19, 20, 13, 5, 4, 0), # 6
(56, 53, 52, 59, 43, 16, 28, 22, 23, 14, 11, 6, 0, 74, 56, 42, 33, 44, 37, 23, 21, 20, 15, 7, 5, 0), # 7
(64, 63, 59, 68, 53, 21, 32, 25, 27, 16, 12, 6, 0, 86, 66, 50, 37, 55, 39, 26, 22, 24, 17, 10, 8, 0), # 8
(69, 75, 67, 74, 62, 23, 38, 28, 31, 20, 14, 6, 0, 91, 70, 57, 42, 59, 44, 30, 23, 27, 22, 11, 12, 0), # 9
(79, 84, 80, 79, 69, 23, 43, 30, 34, 22, 17, 7, 0, 96, 81, 60, 50, 66, 49, 33, 26, 31, 24, 16, 14, 0), # 10
(88, 93, 88, 90, 76, 28, 45, 32, 37, 23, 17, 8, 0, 105, 86, 66, 57, 78, 55, 35, 28, 34, 29, 17, 14, 0), # 11
(101, 104, 101, 103, 85, 34, 49, 34, 39, 24, 19, 9, 0, 112, 93, 74, 61, 86, 59, 36, 31, 37, 31, 18, 15, 0), # 12
(113, 117, 107, 115, 95, 40, 55, 37, 40, 26, 19, 9, 0, 127, 104, 78, 69, 93, 65, 38, 34, 38, 33, 19, 16, 0), # 13
(124, 126, 122, 132, 102, 43, 59, 42, 41, 27, 24, 10, 0, 138, 112, 90, 73, 104, 71, 42, 36, 43, 35, 22, 17, 0), # 14
(135, 140, 137, 141, 110, 49, 68, 44, 47, 30, 25, 11, 0, 157, 127, 92, 78, 112, 75, 46, 38, 43, 42, 26, 17, 0), # 15
(147, 152, 147, 153, 119, 50, 76, 47, 53, 33, 25, 12, 0, 172, 136, 102, 84, 118, 81, 48, 39, 46, 45, 27, 17, 0), # 16
(158, 164, 156, 163, 129, 54, 79, 51, 59, 37, 25, 14, 0, 185, 147, 111, 88, 127, 88, 53, 46, 49, 48, 29, 19, 0), # 17
(168, 176, 165, 172, 134, 59, 83, 54, 63, 39, 29, 16, 0, 196, 159, 120, 94, 141, 95, 55, 52, 56, 49, 30, 20, 0), # 18
(177, 187, 175, 185, 145, 63, 88, 58, 70, 40, 29, 16, 0, 206, 171, 127, 104, 148, 101, 59, 54, 61, 50, 31, 21, 0), # 19
(197, 197, 186, 198, 153, 74, 91, 65, 75, 43, 30, 16, 0, 220, 178, 133, 112, 154, 109, 65, 57, 65, 54, 32, 23, 0), # 20
(209, 209, 190, 206, 163, 77, 96, 68, 77, 43, 30, 17, 0, 230, 186, 142, 122, 167, 112, 72, 61, 69, 60, 38, 25, 0), # 21
(223, 226, 199, 217, 171, 81, 104, 72, 80, 44, 32, 20, 0, 244, 198, 151, 132, 176, 120, 76, 63, 71, 63, 40, 26, 0), # 22
(234, 244, 208, 227, 175, 85, 110, 78, 86, 47, 33, 24, 0, 263, 207, 160, 142, 186, 125, 81, 63, 75, 72, 44, 27, 0), # 23
(244, 256, 217, 244, 182, 89, 116, 83, 87, 49, 33, 25, 0, 274, 221, 169, 147, 197, 132, 87, 66, 80, 74, 48, 29, 0), # 24
(254, 269, 231, 252, 189, 93, 121, 92, 95, 52, 33, 27, 0, 289, 237, 180, 152, 205, 137, 90, 69, 84, 79, 49, 29, 0), # 25
(267, 283, 240, 263, 199, 95, 123, 97, 102, 54, 37, 27, 0, 300, 250, 188, 159, 211, 142, 97, 72, 88, 81, 51, 31, 0), # 26
(285, 293, 250, 277, 207, 96, 134, 98, 108, 55, 40, 28, 0, 313, 270, 196, 167, 219, 149, 101, 73, 92, 86, 51, 34, 0), # 27
(297, 300, 258, 286, 220, 100, 142, 102, 115, 58, 42, 29, 0, 325, 280, 207, 175, 231, 157, 105, 75, 97, 88, 52, 35, 0), # 28
(309, 316, 267, 296, 229, 103, 150, 103, 118, 61, 44, 30, 0, 340, 289, 217, 184, 242, 162, 107, 78, 101, 93, 52, 38, 0), # 29
(320, 331, 275, 310, 239, 108, 157, 109, 124, 62, 47, 30, 0, 354, 297, 226, 190, 246, 170, 113, 81, 108, 100, 52, 38, 0), # 30
(340, 346, 285, 316, 244, 111, 161, 118, 129, 64, 53, 30, 0, 365, 313, 231, 196, 262, 178, 116, 83, 110, 104, 53, 39, 0), # 31
(354, 355, 299, 330, 248, 117, 166, 120, 139, 66, 54, 30, 0, 378, 325, 240, 206, 275, 182, 126, 85, 113, 110, 54, 39, 0), # 32
(369, 370, 312, 338, 255, 125, 175, 128, 140, 70, 56, 30, 0, 392, 338, 246, 212, 286, 187, 130, 88, 117, 113, 58, 41, 0), # 33
(383, 375, 321, 347, 262, 131, 180, 133, 143, 71, 58, 30, 0, 404, 350, 252, 220, 295, 189, 133, 92, 121, 118, 60, 41, 0), # 34
(393, 390, 330, 359, 274, 135, 187, 139, 148, 74, 62, 32, 0, 422, 359, 257, 226, 303, 194, 137, 94, 128, 121, 62, 41, 0), # 35
(408, 397, 343, 374, 280, 139, 190, 143, 152, 76, 66, 33, 0, 438, 370, 264, 228, 314, 205, 144, 95, 130, 122, 63, 42, 0), # 36
(425, 408, 361, 390, 283, 143, 195, 145, 154, 78, 68, 34, 0, 447, 378, 271, 236, 329, 209, 146, 96, 130, 131, 67, 43, 0), # 37
(443, 423, 371, 403, 292, 147, 199, 150, 161, 79, 70, 35, 0, 457, 385, 276, 242, 339, 218, 152, 100, 135, 138, 69, 44, 0), # 38
(455, 434, 386, 408, 298, 148, 203, 155, 163, 81, 73, 36, 0, 468, 395, 282, 249, 348, 228, 158, 105, 140, 141, 73, 47, 0), # 39
(473, 443, 396, 419, 308, 155, 206, 159, 169, 83, 75, 38, 0, 477, 406, 290, 255, 358, 233, 162, 113, 142, 144, 75, 47, 0), # 40
(487, 456, 401, 431, 316, 157, 208, 163, 173, 88, 76, 38, 0, 487, 418, 298, 257, 365, 239, 167, 116, 146, 146, 75, 49, 0), # 41
(494, 463, 408, 442, 326, 160, 212, 164, 179, 90, 79, 38, 0, 499, 427, 305, 262, 373, 241, 176, 120, 150, 148, 76, 50, 0), # 42
(510, 473, 418, 449, 335, 162, 218, 167, 183, 92, 79, 39, 0, 513, 436, 318, 268, 384, 253, 178, 121, 156, 151, 76, 51, 0), # 43
(520, 489, 428, 460, 343, 164, 221, 174, 190, 94, 82, 40, 0, 522, 451, 322, 278, 396, 261, 183, 124, 161, 155, 77, 53, 0), # 44
(534, 500, 440, 469, 353, 166, 224, 179, 194, 96, 85, 40, 0, 532, 462, 329, 283, 407, 270, 184, 128, 165, 159, 82, 54, 0), # 45
(547, 510, 447, 483, 356, 166, 231, 183, 196, 99, 87, 40, 0, 543, 478, 340, 290, 414, 275, 186, 136, 166, 163, 83, 58, 0), # 46
(555, 524, 453, 492, 363, 171, 234, 185, 199, 102, 88, 41, 0, 556, 489, 345, 300, 422, 282, 190, 143, 169, 164, 87, 60, 0), # 47
(568, 537, 462, 500, 378, 175, 240, 189, 203, 104, 89, 42, 0, 563, 498, 355, 308, 433, 290, 195, 148, 173, 168, 88, 60, 0), # 48
(588, 543, 476, 513, 386, 186, 244, 194, 209, 106, 92, 42, 0, 569, 509, 365, 315, 444, 298, 204, 151, 174, 170, 89, 61, 0), # 49
(606, 558, 490, 520, 396, 191, 248, 198, 214, 108, 92, 42, 0, 576, 519, 375, 323, 452, 306, 210, 155, 178, 175, 92, 61, 0), # 50
(622, 567, 501, 535, 401, 194, 255, 203, 220, 112, 93, 43, 0, 594, 531, 383, 328, 460, 310, 218, 159, 186, 178, 94, 62, 0), # 51
(636, 575, 513, 543, 409, 201, 258, 209, 224, 112, 95, 45, 0, 606, 541, 389, 332, 467, 319, 222, 165, 190, 179, 96, 62, 0), # 52
(649, 587, 520, 556, 419, 207, 265, 211, 227, 115, 96, 46, 0, 614, 554, 393, 341, 479, 322, 223, 169, 192, 182, 101, 63, 0), # 53
(660, 597, 533, 562, 428, 212, 268, 217, 231, 119, 98, 47, 0, 627, 566, 401, 345, 490, 326, 229, 173, 196, 189, 105, 63, 0), # 54
(669, 609, 541, 576, 436, 217, 269, 219, 240, 121, 98, 47, 0, 638, 582, 409, 352, 500, 336, 235, 177, 202, 196, 108, 63, 0), # 55
(680, 624, 557, 586, 445, 224, 272, 223, 245, 123, 99, 48, 0, 657, 592, 421, 359, 509, 338, 239, 186, 208, 199, 109, 63, 0), # 56
(690, 639, 571, 593, 454, 228, 274, 231, 247, 127, 100, 49, 0, 668, 607, 430, 367, 515, 343, 248, 189, 212, 204, 111, 64, 0), # 57
(698, 645, 582, 608, 463, 231, 279, 236, 255, 130, 101, 49, 0, 681, 622, 436, 371, 526, 343, 251, 193, 217, 208, 115, 65, 0), # 58
(706, 661, 594, 615, 468, 235, 282, 239, 260, 132, 103, 50, 0, 698, 629, 445, 380, 535, 348, 258, 194, 220, 213, 117, 65, 0), # 59
(718, 667, 608, 620, 476, 243, 288, 245, 264, 134, 105, 51, 0, 709, 638, 460, 391, 542, 356, 261, 198, 225, 218, 123, 66, 0), # 60
(728, 675, 619, 627, 488, 247, 291, 249, 268, 136, 108, 52, 0, 721, 644, 467, 397, 545, 358, 265, 199, 230, 222, 124, 66, 0), # 61
(741, 685, 627, 639, 498, 252, 297, 253, 271, 137, 109, 53, 0, 737, 651, 469, 409, 561, 362, 270, 201, 236, 229, 124, 66, 0), # 62
(753, 697, 638, 649, 503, 258, 299, 260, 272, 138, 112, 53, 0, 753, 658, 479, 416, 575, 370, 274, 207, 240, 234, 126, 67, 0), # 63
(769, 710, 646, 657, 513, 258, 303, 263, 278, 141, 113, 55, 0, 763, 667, 482, 425, 588, 378, 278, 208, 247, 237, 128, 67, 0), # 64
(781, 716, 655, 670, 519, 260, 304, 268, 280, 143, 116, 55, 0, 771, 671, 489, 431, 592, 381, 282, 210, 251, 238, 130, 67, 0), # 65
(785, 735, 665, 681, 533, 267, 305, 273, 285, 144, 118, 56, 0, 786, 679, 497, 439, 599, 385, 291, 211, 254, 242, 131, 68, 0), # 66
(798, 742, 676, 697, 538, 271, 310, 276, 291, 146, 118, 57, 0, 797, 693, 503, 443, 605, 392, 293, 213, 257, 245, 131, 69, 0), # 67
(808, 753, 684, 707, 542, 277, 311, 279, 294, 148, 118, 57, 0, 810, 703, 511, 449, 614, 399, 302, 215, 261, 248, 133, 69, 0), # 68
(823, 761, 698, 712, 556, 282, 316, 281, 300, 150, 121, 58, 0, 818, 717, 518, 456, 625, 406, 305, 215, 264, 252, 135, 69, 0), # 69
(837, 772, 709, 722, 561, 289, 320, 287, 303, 150, 125, 62, 0, 829, 723, 524, 463, 635, 410, 310, 217, 268, 257, 138, 70, 0), # 70
(846, 779, 716, 739, 574, 296, 326, 292, 307, 150, 126, 63, 0, 847, 737, 534, 471, 642, 415, 314, 218, 269, 259, 140, 70, 0), # 71
(856, 789, 730, 750, 588, 298, 332, 299, 312, 153, 129, 63, 0, 858, 742, 542, 473, 653, 419, 322, 219, 273, 266, 141, 70, 0), # 72
(863, 801, 737, 761, 595, 301, 335, 301, 320, 156, 132, 65, 0, 865, 752, 554, 478, 659, 426, 325, 224, 276, 274, 147, 70, 0), # 73
(875, 819, 745, 768, 603, 305, 338, 303, 328, 159, 132, 65, 0, 873, 760, 563, 484, 667, 435, 327, 227, 281, 283, 148, 71, 0), # 74
(885, 825, 753, 777, 616, 307, 342, 311, 330, 159, 133, 66, 0, 886, 767, 570, 487, 677, 441, 332, 230, 288, 287, 151, 71, 0), # 75
(902, 833, 764, 784, 624, 312, 347, 318, 335, 164, 134, 69, 0, 894, 778, 582, 490, 689, 442, 335, 234, 290, 292, 152, 72, 0), # 76
(907, 847, 775, 787, 628, 317, 354, 320, 341, 165, 136, 70, 0, 905, 784, 590, 491, 697, 444, 339, 237, 294, 296, 155, 72, 0), # 77
(922, 856, 782, 798, 637, 322, 357, 324, 345, 167, 136, 70, 0, 912, 792, 600, 499, 709, 448, 344, 239, 299, 298, 158, 72, 0), # 78
(935, 867, 785, 810, 644, 324, 362, 326, 351, 168, 138, 72, 0, 928, 801, 608, 504, 719, 455, 345, 240, 302, 301, 160, 72, 0), # 79
(949, 876, 795, 824, 656, 326, 366, 330, 355, 171, 139, 73, 0, 944, 809, 615, 507, 727, 458, 345, 241, 305, 302, 162, 74, 0), # 80
(957, 882, 807, 834, 659, 331, 368, 333, 359, 175, 139, 73, 0, 955, 821, 618, 510, 741, 459, 349, 243, 308, 306, 163, 77, 0), # 81
(967, 888, 818, 841, 665, 338, 374, 335, 361, 178, 140, 74, 0, 964, 834, 625, 517, 750, 464, 350, 247, 312, 307, 167, 78, 0), # 82
(980, 899, 827, 853, 675, 340, 377, 341, 367, 181, 141, 76, 0, 971, 843, 631, 528, 761, 469, 353, 249, 316, 311, 168, 78, 0), # 83
(993, 906, 840, 867, 680, 345, 382, 343, 369, 183, 144, 76, 0, 982, 853, 639, 532, 768, 476, 361, 252, 321, 313, 170, 80, 0), # 84
(1002, 913, 852, 873, 684, 349, 387, 350, 372, 186, 147, 78, 0, 991, 858, 645, 536, 780, 481, 363, 254, 326, 318, 174, 81, 0), # 85
(1013, 926, 857, 882, 688, 356, 392, 351, 378, 187, 148, 78, 0, 1004, 866, 653, 540, 789, 488, 364, 261, 328, 322, 175, 82, 0), # 86
(1024, 935, 867, 893, 697, 357, 394, 353, 389, 188, 151, 80, 0, 1012, 878, 666, 542, 795, 492, 368, 263, 329, 325, 178, 83, 0), # 87
(1036, 947, 881, 905, 709, 361, 396, 358, 395, 190, 155, 80, 0, 1029, 884, 669, 548, 804, 495, 369, 269, 335, 329, 180, 83, 0), # 88
(1045, 957, 892, 915, 721, 372, 398, 367, 400, 190, 157, 81, 0, 1040, 894, 676, 551, 814, 501, 374, 272, 342, 334, 181, 84, 0), # 89
(1055, 969, 900, 928, 727, 375, 402, 369, 406, 192, 158, 84, 0, 1048, 900, 684, 557, 824, 509, 378, 277, 347, 338, 184, 85, 0), # 90
(1061, 974, 908, 938, 731, 377, 408, 374, 412, 193, 162, 84, 0, 1065, 914, 693, 562, 832, 513, 383, 281, 350, 342, 189, 86, 0), # 91
(1072, 978, 917, 949, 737, 382, 412, 378, 415, 194, 162, 85, 0, 1077, 921, 696, 568, 847, 520, 387, 286, 356, 347, 192, 86, 0), # 92
(1079, 987, 926, 957, 746, 388, 415, 383, 416, 195, 162, 87, 0, 1090, 934, 698, 576, 860, 521, 393, 290, 361, 349, 194, 87, 0), # 93
(1093, 994, 935, 969, 753, 392, 418, 385, 424, 198, 164, 87, 0, 1101, 940, 708, 581, 865, 525, 399, 295, 361, 353, 196, 90, 0), # 94
(1114, 1002, 943, 982, 762, 395, 423, 388, 425, 198, 164, 87, 0, 1115, 947, 711, 584, 875, 529, 400, 295, 367, 356, 198, 90, 0), # 95
(1131, 1008, 951, 993, 767, 403, 425, 389, 431, 200, 167, 87, 0, 1128, 956, 724, 588, 885, 533, 402, 295, 369, 358, 202, 91, 0), # 96
(1143, 1019, 962, 1002, 777, 404, 427, 392, 441, 202, 168, 89, 0, 1139, 967, 734, 598, 893, 538, 406, 298, 371, 363, 204, 91, 0), # 97
(1154, 1036, 975, 1012, 782, 410, 433, 395, 445, 203, 171, 89, 0, 1155, 978, 738, 605, 901, 549, 410, 302, 376, 366, 206, 92, 0), # 98
(1164, 1042, 982, 1018, 793, 416, 440, 399, 451, 204, 171, 89, 0, 1169, 989, 745, 613, 915, 557, 417, 308, 380, 369, 207, 92, 0), # 99
(1176, 1052, 991, 1029, 804, 420, 443, 404, 453, 205, 172, 89, 0, 1178, 997, 748, 617, 920, 561, 421, 311, 385, 375, 211, 92, 0), # 100
(1188, 1057, 997, 1032, 816, 423, 449, 410, 455, 207, 172, 89, 0, 1191, 1009, 754, 628, 930, 567, 427, 315, 386, 376, 212, 94, 0), # 101
(1197, 1065, 1009, 1043, 824, 426, 455, 414, 462, 207, 173, 89, 0, 1202, 1017, 760, 633, 940, 571, 429, 319, 390, 379, 213, 94, 0), # 102
(1206, 1073, 1015, 1054, 829, 436, 460, 415, 467, 209, 174, 89, 0, 1212, 1028, 768, 642, 952, 574, 433, 322, 398, 380, 215, 95, 0), # 103
(1218, 1081, 1024, 1068, 835, 439, 467, 415, 474, 212, 174, 89, 0, 1230, 1041, 777, 649, 960, 579, 434, 326, 402, 385, 215, 95, 0), # 104
(1232, 1089, 1033, 1078, 846, 444, 471, 418, 476, 214, 176, 90, 0, 1240, 1048, 778, 654, 966, 583, 441, 329, 406, 389, 218, 95, 0), # 105
(1242, 1103, 1042, 1091, 853, 446, 475, 423, 479, 217, 177, 90, 0, 1249, 1057, 786, 660, 972, 585, 445, 329, 409, 392, 220, 95, 0), # 106
(1251, 1109, 1051, 1101, 865, 448, 479, 424, 487, 219, 178, 90, 0, 1261, 1062, 792, 670, 977, 589, 446, 332, 413, 394, 221, 97, 0), # 107
(1263, 1119, 1060, 1113, 874, 452, 485, 428, 489, 222, 178, 90, 0, 1270, 1074, 796, 675, 985, 597, 449, 332, 417, 396, 225, 98, 0), # 108
(1278, 1124, 1066, 1123, 881, 455, 489, 433, 494, 223, 179, 92, 0, 1288, 1085, 802, 681, 993, 598, 455, 334, 419, 398, 227, 99, 0), # 109
(1282, 1132, 1077, 1134, 894, 459, 494, 435, 499, 223, 179, 92, 0, 1301, 1093, 808, 685, 999, 605, 459, 336, 425, 402, 231, 99, 0), # 110
(1293, 1140, 1088, 1146, 905, 462, 496, 441, 504, 225, 181, 93, 0, 1316, 1102, 813, 691, 1006, 610, 463, 337, 435, 405, 235, 101, 0), # 111
(1302, 1153, 1094, 1164, 913, 464, 498, 442, 508, 226, 181, 95, 0, 1327, 1108, 822, 694, 1015, 613, 468, 338, 441, 408, 240, 101, 0), # 112
(1315, 1162, 1102, 1175, 917, 472, 501, 446, 513, 227, 182, 95, 0, 1337, 1118, 829, 696, 1024, 618, 473, 338, 443, 416, 241, 101, 0), # 113
(1332, 1172, 1112, 1182, 925, 476, 505, 448, 517, 231, 184, 96, 0, 1346, 1131, 834, 698, 1039, 619, 473, 343, 446, 417, 242, 103, 0), # 114
(1345, 1179, 1119, 1194, 934, 480, 509, 448, 520, 232, 184, 98, 0, 1365, 1137, 843, 703, 1048, 621, 479, 344, 448, 419, 242, 104, 0), # 115
(1350, 1186, 1136, 1205, 941, 481, 511, 451, 526, 232, 184, 98, 0, 1377, 1145, 855, 707, 1058, 625, 480, 344, 456, 423, 242, 105, 0), # 116
(1359, 1194, 1148, 1216, 953, 485, 513, 452, 532, 234, 185, 98, 0, 1388, 1152, 861, 712, 1067, 632, 485, 347, 458, 426, 243, 105, 0), # 117
(1368, 1203, 1162, 1226, 961, 488, 520, 456, 534, 238, 186, 99, 0, 1400, 1157, 869, 717, 1077, 636, 490, 352, 462, 428, 246, 105, 0), # 118
(1379, 1217, 1170, 1232, 972, 493, 524, 458, 538, 238, 186, 99, 0, 1414, 1162, 875, 719, 1083, 638, 495, 355, 467, 430, 249, 107, 0), # 119
(1391, 1227, 1174, 1245, 981, 497, 527, 461, 543, 239, 187, 99, 0, 1426, 1174, 879, 721, 1087, 641, 503, 356, 473, 433, 252, 108, 0), # 120
(1402, 1236, 1183, 1249, 991, 501, 533, 462, 551, 244, 189, 99, 0, 1435, 1181, 882, 728, 1092, 647, 505, 358, 477, 434, 253, 108, 0), # 121
(1419, 1247, 1189, 1256, 995, 504, 539, 463, 554, 247, 189, 100, 0, 1446, 1189, 889, 733, 1102, 650, 512, 359, 481, 436, 255, 109, 0), # 122
(1429, 1252, 1195, 1267, 1002, 508, 545, 467, 557, 250, 191, 100, 0, 1458, 1197, 896, 738, 1109, 654, 513, 361, 485, 443, 255, 111, 0), # 123
(1438, 1262, 1201, 1280, 1011, 513, 549, 473, 567, 252, 191, 101, 0, 1469, 1201, 902, 743, 1127, 656, 515, 367, 488, 444, 256, 112, 0), # 124
(1446, 1269, 1208, 1291, 1022, 515, 552, 474, 573, 254, 192, 104, 0, 1479, 1211, 910, 745, 1133, 659, 518, 370, 492, 446, 257, 112, 0), # 125
(1457, 1274, 1216, 1298, 1034, 520, 556, 477, 576, 255, 193, 105, 0, 1490, 1219, 913, 751, 1142, 664, 519, 374, 496, 458, 260, 112, 0), # 126
(1467, 1286, 1222, 1308, 1046, 526, 557, 480, 580, 255, 195, 105, 0, 1503, 1225, 919, 754, 1148, 667, 523, 376, 501, 461, 261, 114, 0), # 127
(1475, 1300, 1230, 1320, 1056, 532, 559, 481, 588, 259, 197, 105, 0, 1515, 1233, 928, 757, 1153, 673, 525, 380, 501, 463, 262, 115, 0), # 128
(1488, 1306, 1239, 1330, 1064, 536, 563, 484, 590, 259, 198, 106, 0, 1526, 1241, 934, 763, 1161, 678, 529, 384, 505, 464, 267, 115, 0), # 129
(1498, 1317, 1246, 1339, 1075, 540, 565, 486, 592, 262, 199, 106, 0, 1530, 1250, 946, 768, 1173, 681, 531, 384, 508, 470, 267, 115, 0), # 130
(1512, 1326, 1257, 1355, 1083, 543, 567, 490, 596, 262, 199, 107, 0, 1545, 1258, 957, 774, 1180, 686, 534, 386, 512, 472, 268, 116, 0), # 131
(1520, 1333, 1265, 1362, 1090, 546, 569, 491, 604, 263, 199, 107, 0, 1555, 1271, 964, 780, 1188, 695, 537, 388, 516, 472, 271, 116, 0), # 132
(1529, 1339, 1271, 1367, 1100, 552, 572, 494, 606, 265, 200, 107, 0, 1570, 1282, 968, 788, 1193, 699, 540, 389, 519, 476, 272, 117, 0), # 133
(1539, 1345, 1286, 1372, 1103, 556, 577, 495, 616, 267, 202, 107, 0, 1579, 1292, 972, 794, 1205, 703, 544, 392, 523, 479, 273, 120, 0), # 134
(1549, 1360, 1297, 1379, 1114, 559, 581, 499, 618, 270, 203, 108, 0, 1590, 1304, 975, 803, 1218, 708, 546, 394, 526, 479, 275, 120, 0), # 135
(1564, 1369, 1310, 1391, 1120, 563, 582, 504, 627, 271, 203, 108, 0, 1602, 1315, 978, 813, 1228, 711, 547, 397, 534, 482, 277, 121, 0), # 136
(1582, 1377, 1322, 1401, 1127, 567, 584, 507, 631, 271, 205, 108, 0, 1619, 1325, 984, 819, 1237, 715, 552, 399, 535, 485, 282, 121, 0), # 137
(1590, 1384, 1332, 1409, 1141, 572, 585, 509, 636, 275, 206, 108, 0, 1629, 1335, 989, 826, 1248, 716, 556, 402, 539, 487, 284, 121, 0), # 138
(1598, 1391, 1344, 1422, 1148, 572, 586, 510, 641, 276, 207, 111, 0, 1643, 1346, 993, 832, 1258, 721, 560, 404, 543, 491, 286, 123, 0), # 139
(1606, 1398, 1352, 1430, 1155, 574, 589, 511, 642, 276, 208, 114, 0, 1654, 1359, 1003, 833, 1266, 723, 566, 407, 545, 494, 287, 123, 0), # 140
(1622, 1403, 1361, 1436, 1160, 576, 593, 515, 645, 278, 209, 114, 0, 1665, 1366, 1005, 837, 1272, 725, 570, 414, 549, 497, 288, 124, 0), # 141
(1632, 1407, 1365, 1444, 1170, 580, 597, 519, 649, 278, 210, 114, 0, 1678, 1373, 1009, 842, 1282, 732, 572, 419, 552, 499, 289, 124, 0), # 142
(1637, 1416, 1372, 1453, 1179, 588, 600, 521, 652, 278, 210, 115, 0, 1698, 1382, 1013, 847, 1287, 742, 576, 422, 554, 502, 290, 124, 0), # 143
(1651, 1421, 1378, 1467, 1184, 590, 606, 524, 655, 281, 210, 117, 0, 1707, 1389, 1016, 850, 1291, 745, 577, 426, 554, 508, 291, 124, 0), # 144
(1666, 1429, 1389, 1475, 1192, 592, 608, 528, 658, 282, 211, 118, 0, 1718, 1400, 1019, 853, 1299, 749, 578, 429, 559, 509, 292, 124, 0), # 145
(1679, 1436, 1399, 1485, 1202, 598, 611, 534, 659, 283, 213, 119, 0, 1731, 1411, 1024, 855, 1304, 755, 581, 432, 564, 511, 294, 125, 0), # 146
(1685, 1440, 1408, 1493, 1211, 599, 614, 537, 663, 284, 213, 120, 0, 1741, 1425, 1030, 856, 1311, 760, 584, 435, 567, 516, 294, 125, 0), # 147
(1694, 1449, 1419, 1507, 1223, 602, 617, 541, 666, 285, 214, 120, 0, 1751, 1437, 1039, 859, 1321, 761, 588, 439, 576, 521, 294, 126, 0), # 148
(1704, 1456, 1432, 1513, 1232, 603, 624, 542, 670, 287, 215, 120, 0, 1762, 1447, 1047, 862, 1326, 764, 590, 439, 578, 522, 295, 126, 0), # 149
(1713, 1463, 1439, 1523, 1237, 607, 628, 544, 671, 287, 215, 121, 0, 1769, 1454, 1052, 866, 1333, 769, 591, 443, 582, 526, 295, 126, 0), # 150
(1716, 1468, 1446, 1532, 1247, 612, 629, 548, 677, 287, 217, 123, 0, 1778, 1462, 1060, 873, 1344, 774, 592, 446, 586, 527, 296, 126, 0), # 151
(1730, 1473, 1462, 1542, 1253, 612, 632, 553, 679, 287, 218, 123, 0, 1787, 1468, 1065, 877, 1358, 775, 593, 451, 590, 530, 298, 126, 0), # 152
(1740, 1479, 1471, 1549, 1260, 616, 634, 554, 682, 287, 218, 123, 0, 1799, 1476, 1068, 883, 1368, 778, 597, 454, 592, 533, 299, 126, 0), # 153
(1748, 1484, 1477, 1555, 1268, 619, 636, 560, 686, 290, 220, 123, 0, 1814, 1485, 1072, 886, 1374, 780, 599, 461, 599, 537, 301, 126, 0), # 154
(1763, 1490, 1485, 1559, 1273, 621, 640, 562, 695, 290, 222, 125, 0, 1822, 1494, 1079, 888, 1382, 784, 602, 464, 606, 541, 305, 127, 0), # 155
(1770, 1493, 1501, 1567, 1276, 623, 643, 564, 698, 290, 222, 126, 0, 1836, 1500, 1083, 891, 1386, 788, 607, 468, 612, 545, 307, 128, 0), # 156
(1783, 1500, 1509, 1579, 1283, 628, 643, 567, 700, 292, 224, 126, 0, 1851, 1506, 1088, 893, 1396, 791, 608, 469, 615, 551, 309, 130, 0), # 157
(1791, 1504, 1517, 1586, 1290, 631, 644, 570, 703, 292, 225, 128, 0, 1860, 1515, 1096, 896, 1404, 795, 613, 470, 620, 555, 311, 132, 0), # 158
(1798, 1513, 1525, 1589, 1299, 634, 644, 573, 705, 292, 225, 129, 0, 1870, 1523, 1098, 901, 1415, 798, 614, 470, 625, 559, 315, 134, 0), # 159
(1807, 1518, 1533, 1595, 1308, 639, 645, 576, 710, 292, 227, 129, 0, 1879, 1537, 1108, 904, 1421, 802, 615, 473, 628, 562, 315, 134, 0), # 160
(1814, 1530, 1546, 1605, 1315, 641, 650, 584, 714, 294, 232, 130, 0, 1888, 1545, 1117, 908, 1432, 804, 617, 474, 631, 565, 318, 135, 0), # 161
(1824, 1538, 1550, 1617, 1320, 643, 653, 588, 715, 294, 233, 130, 0, 1897, 1554, 1119, 912, 1444, 807, 619, 476, 632, 569, 318, 135, 0), # 162
(1832, 1544, 1559, 1629, 1327, 644, 655, 594, 716, 296, 236, 131, 0, 1905, 1558, 1123, 915, 1452, 810, 620, 479, 639, 569, 319, 135, 0), # 163
(1840, 1553, 1573, 1641, 1331, 646, 657, 596, 719, 300, 240, 132, 0, 1915, 1565, 1130, 919, 1457, 812, 623, 481, 642, 571, 320, 135, 0), # 164
(1846, 1557, 1582, 1645, 1337, 647, 661, 597, 723, 302, 243, 134, 0, 1923, 1570, 1138, 925, 1466, 815, 626, 484, 644, 574, 320, 136, 0), # 165
(1852, 1566, 1585, 1646, 1349, 653, 663, 599, 725, 307, 244, 134, 0, 1929, 1575, 1144, 930, 1470, 819, 628, 488, 646, 578, 321, 136, 0), # 166
(1857, 1573, 1589, 1651, 1358, 654, 664, 601, 732, 308, 245, 134, 0, 1939, 1583, 1151, 940, 1476, 823, 631, 489, 647, 579, 323, 136, 0), # 167
(1865, 1578, 1595, 1659, 1364, 656, 668, 605, 734, 309, 247, 134, 0, 1946, 1589, 1154, 949, 1484, 826, 635, 490, 648, 582, 324, 137, 0), # 168
(1871, 1582, 1606, 1669, 1370, 659, 670, 609, 738, 310, 248, 135, 0, 1955, 1598, 1158, 950, 1491, 829, 637, 493, 652, 586, 325, 137, 0), # 169
(1877, 1588, 1612, 1679, 1376, 664, 673, 611, 741, 312, 248, 135, 0, 1961, 1609, 1163, 956, 1496, 831, 638, 495, 658, 589, 326, 138, 0), # 170
(1882, 1593, 1616, 1691, 1386, 668, 677, 614, 742, 312, 250, 135, 0, 1968, 1619, 1166, 959, 1508, 832, 640, 499, 664, 592, 327, 138, 0), # 171
(1886, 1597, 1623, 1697, 1391, 669, 679, 618, 744, 312, 251, 135, 0, 1980, 1621, 1169, 964, 1514, 837, 641, 500, 668, 593, 328, 138, 0), # 172
(1894, 1598, 1626, 1701, 1401, 671, 681, 621, 748, 312, 252, 138, 0, 1988, 1624, 1171, 966, 1516, 840, 641, 501, 670, 595, 330, 138, 0), # 173
(1904, 1601, 1629, 1707, 1408, 672, 682, 622, 750, 315, 252, 138, 0, 1998, 1631, 1176, 968, 1520, 841, 643, 504, 673, 597, 332, 138, 0), # 174
(1912, 1607, 1632, 1715, 1415, 673, 682, 624, 752, 316, 254, 138, 0, 2006, 1635, 1180, 970, 1524, 842, 644, 507, 675, 601, 333, 138, 0), # 175
(1915, 1610, 1639, 1722, 1416, 673, 685, 624, 754, 317, 255, 139, 0, 2010, 1640, 1183, 972, 1531, 843, 646, 508, 679, 604, 333, 138, 0), # 176
(1921, 1614, 1646, 1726, 1421, 673, 687, 628, 756, 318, 257, 140, 0, 2015, 1643, 1188, 976, 1534, 847, 647, 512, 681, 606, 334, 139, 0), # 177
(1924, 1620, 1647, 1731, 1422, 676, 689, 629, 758, 318, 258, 140, 0, 2021, 1645, 1192, 977, 1537, 849, 648, 512, 682, 606, 334, 141, 0), # 178
(1924, 1620, 1647, 1731, 1422, 676, 689, 629, 758, 318, 258, 140, 0, 2021, 1645, 1192, 977, 1537, 849, 648, 512, 682, 606, 334, 141, 0), # 179
)
passenger_arriving_rate = (
(6.025038694046121, 6.077817415662483, 5.211283229612507, 5.593200996477089, 4.443748486087689, 2.197058452426137, 2.4876213692243487, 2.3265880864897115, 2.4360396248672025, 1.187404504656711, 0.8410530327771206, 0.4897915078306174, 0.0, 6.100656255094035, 5.38770658613679, 4.205265163885603, 3.562213513970132, 4.872079249734405, 3.257223321085596, 2.4876213692243487, 1.5693274660186693, 2.2218742430438443, 1.8644003321590301, 1.0422566459225016, 0.5525288559693167, 0.0), # 0
(6.425192582423969, 6.479066763559234, 5.555346591330152, 5.9626298279489545, 4.737992269979389, 2.342188508829789, 2.651681364758216, 2.479756861452854, 2.5968981305331633, 1.265694207683145, 0.8966192271912263, 0.5221216660814355, 0.0, 6.503749976927826, 5.743338326895789, 4.483096135956131, 3.7970826230494343, 5.193796261066327, 3.4716596060339957, 2.651681364758216, 1.6729917920212778, 2.3689961349896946, 1.9875432759829852, 1.1110693182660305, 0.589006069414476, 0.0), # 1
(6.8240676107756775, 6.878723687980077, 5.8980422855474135, 6.330588934198314, 5.031170378999795, 2.4867395801587113, 2.8150911047764224, 2.6323126239522097, 2.7571147227510195, 1.3436741325061639, 0.9519646297552626, 0.5543232652053055, 0.0, 6.905237793851628, 6.09755591725836, 4.759823148776313, 4.031022397518491, 5.514229445502039, 3.6852376735330936, 2.8150911047764224, 1.7762425572562224, 2.5155851894998973, 2.1101963113994384, 1.179608457109483, 0.625338517089098, 0.0), # 2
(7.220109351775874, 7.275202552130091, 6.238010869319854, 6.695618766778866, 5.322129340801521, 2.6301384358095787, 2.9772021849887733, 2.7836505787472534, 2.9160540643684367, 1.4210348095278544, 1.0068696823654766, 0.5862685684930461, 0.0, 7.30352736750507, 6.448954253423507, 5.0343484118273825, 4.263104428583563, 5.8321081287368735, 3.8971108102461547, 2.9772021849887733, 1.8786703112925562, 2.6610646704007603, 2.2318729222596225, 1.247602173863971, 0.6613820501936447, 0.0), # 3
(7.611763378099177, 7.666917719214351, 6.573892899703036, 7.056259777244312, 5.609715683037193, 2.7718118451790676, 3.137366201105075, 2.9331659305974576, 3.0730808182330827, 1.4974667691503039, 1.0611148269181152, 0.6178298392354764, 0.0, 7.69702635952778, 6.79612823159024, 5.305574134590575, 4.492400307450911, 6.146161636466165, 4.10643230283644, 3.137366201105075, 1.9798656036993338, 2.8048578415185963, 2.3520865924147714, 1.3147785799406073, 0.6969925199285775, 0.0), # 4
(7.9974752624202115, 8.052283552437947, 6.904328933752518, 7.411052417148355, 5.892775933359424, 2.9111865776638504, 3.2949347488351344, 3.080253884262296, 3.2275596471926233, 1.5726605417755992, 1.1144805053094267, 0.6488793407234149, 0.0, 8.084142431559393, 7.137672747957563, 5.572402526547132, 4.7179816253267965, 6.455119294385247, 4.312355437967215, 3.2949347488351344, 2.079418984045607, 2.946387966679712, 2.4703508057161185, 1.3808657867505036, 0.7320257774943589, 0.0), # 5
(8.375690577413598, 8.42971441500595, 7.227959528523866, 7.758537138044686, 6.170156619420834, 3.047689402660605, 3.4492594238887575, 3.2243096445012442, 3.3788552140947257, 1.6463066578058279, 1.1667471594356567, 0.6792893362476808, 0.0, 8.463283245239527, 7.472182698724488, 5.833735797178282, 4.938919973417482, 6.757710428189451, 4.514033502301742, 3.4492594238887575, 2.176921001900432, 3.085078309710417, 2.586179046014896, 1.4455919057047733, 0.7663376740914501, 0.0), # 6
(8.744854895753962, 8.797624670123444, 7.543425241072636, 8.097254391487015, 6.440704268874043, 3.1807470895660046, 3.599691821975751, 3.3647284160737763, 3.5263321817870574, 1.7180956476430762, 1.2176952311930538, 0.708932089099093, 0.0, 8.832856462207822, 7.798252980090021, 6.088476155965268, 5.154286942929227, 7.052664363574115, 4.7106197825032865, 3.599691821975751, 2.2719622068328604, 3.2203521344370216, 2.699084797162339, 1.508685048214527, 0.7997840609203132, 0.0), # 7
(9.103413790115921, 9.154428680995508, 7.849366628454395, 8.425744629029035, 6.703265409371668, 3.309786407776723, 3.7455835388059184, 3.5009054037393623, 3.669355213117282, 1.7877180416894325, 1.2671051624778642, 0.7376798625684703, 0.0, 9.1912697441039, 8.114478488253173, 6.335525812389321, 5.363154125068296, 7.338710426234564, 4.901267565235107, 3.7455835388059184, 2.3641331484119448, 3.351632704685834, 2.8085815430096788, 1.5698733256908792, 0.8322207891814098, 0.0), # 8
(9.449812833174102, 9.498540810827224, 8.144424247724704, 8.742548302224453, 6.956686568566327, 3.4342341266894385, 3.886286170089072, 3.6322358122574814, 3.8072889709330693, 1.8548643703469827, 1.3147573951863356, 0.7654049199466314, 0.0, 9.536930752567395, 8.419454119412945, 6.573786975931678, 5.564593111040947, 7.614577941866139, 5.0851301371604745, 3.886286170089072, 2.453024376206742, 3.4783432842831634, 2.914182767408151, 1.6288848495449408, 0.8635037100752023, 0.0), # 9
(9.782497597603118, 9.828375422823667, 8.427238655939124, 9.046205862626959, 7.19981427411064, 3.5535170157008253, 4.021151311535013, 3.7581148463876053, 3.9394981180820854, 1.9192251640178146, 1.3604323712147148, 0.7919795245243952, 0.0, 9.868247149237932, 8.711774769768347, 6.802161856073574, 5.757675492053442, 7.878996236164171, 5.261360784942648, 4.021151311535013, 2.5382264397863037, 3.59990713705532, 3.015401954208987, 1.685447731187825, 0.8934886748021517, 0.0), # 10
(10.099913656077605, 10.142346880189926, 8.696450410153215, 9.335257761790256, 7.431495053657226, 3.667061844207558, 4.14953055885355, 3.8779377108892072, 4.065347317411997, 1.980490953104016, 1.40391053245925, 0.8172759395925812, 0.0, 10.183626595755133, 8.99003533551839, 7.019552662296249, 5.9414728593120465, 8.130694634823994, 5.42911279524489, 4.14953055885355, 2.619329888719684, 3.715747526828613, 3.1117525872634197, 1.7392900820306432, 0.9220315345627208, 0.0), # 11
(10.400506581272174, 10.438869546131066, 8.95070006742254, 9.60824445126805, 7.650575434858702, 3.7742953816063087, 4.270775507754487, 3.99109961052176, 4.184201231770471, 2.0383522680076718, 1.444972320816187, 0.8411664284420068, 0.0, 10.48147675375864, 9.252830712862075, 7.224861604080934, 6.115056804023014, 8.368402463540942, 5.587539454730464, 4.270775507754487, 2.6959252725759346, 3.825287717429351, 3.2027481504226842, 1.790140013484508, 0.9489881405573698, 0.0), # 12
(10.68272194586145, 10.716357783852182, 9.188628184802662, 9.863706382614039, 7.85590194536768, 3.8746443972937565, 4.384237753947633, 4.096995750044741, 4.295424524005172, 2.0924996391308714, 1.4833981781817738, 0.8635232543634921, 0.0, 10.760205284888082, 9.498755797998411, 7.416990890908868, 6.277498917392613, 8.590849048010345, 5.735794050062637, 4.384237753947633, 2.7676031409241117, 3.92795097268384, 3.287902127538014, 1.8377256369605324, 0.974214343986562, 0.0), # 13
(10.945005322520059, 10.973225956558347, 9.408875319349146, 10.100184007381912, 8.046321112836791, 3.967535660666574, 4.489268893142796, 4.195021334217623, 4.398381856963768, 2.1426235968757004, 1.518968546452257, 0.8842186806478561, 0.0, 11.018219850783076, 9.726405487126415, 7.594842732261284, 6.4278707906271, 8.796763713927536, 5.873029867904672, 4.489268893142796, 2.833954043333267, 4.023160556418396, 3.3667280024606385, 1.8817750638698296, 0.997565996050759, 0.0), # 14
(11.185802283922625, 11.207888427454638, 9.610082028117542, 10.316217777125386, 8.220679464918646, 4.052395941121439, 4.585220521049775, 4.284571567799878, 4.4924378934939275, 2.1884146716442476, 1.551463867523884, 0.9031249705859171, 0.0, 11.253928113083257, 9.934374676445087, 7.757319337619419, 6.565244014932741, 8.984875786987855, 5.998400194919829, 4.585220521049775, 2.894568529372456, 4.110339732459323, 3.4387392590417964, 1.9220164056235085, 1.0188989479504218, 0.0), # 15
(11.40355840274376, 11.418759559746144, 9.790888868163425, 10.510348143398145, 8.377823529265866, 4.128652008055021, 4.671444233378385, 4.36504165555098, 4.5769572964433145, 2.2295633938385993, 1.5806645832929027, 0.920114387468494, 0.0, 11.465737733428254, 10.121258262153432, 7.9033229164645125, 6.688690181515796, 9.153914592886629, 6.111058317771373, 4.671444233378385, 2.9490371486107296, 4.188911764632933, 3.503449381132716, 1.958177773632685, 1.0380690508860133, 0.0), # 16
(11.59671925165809, 11.604253716637938, 9.949936396542352, 10.6811155577539, 8.51659983353107, 4.1957306308639994, 4.747291625838426, 4.435826802230409, 4.651304728659593, 2.2657602938608403, 1.60635113565556, 0.9350591945864056, 0.0, 11.652056373457699, 10.28565114045046, 8.031755678277799, 6.79728088158252, 9.302609457319186, 6.2101575231225725, 4.747291625838426, 2.9969504506171427, 4.258299916765535, 3.5603718525846344, 1.9899872793084707, 1.0549321560579947, 0.0), # 17
(11.763730403340244, 11.7627852613351, 10.08586517030988, 10.82706047174635, 8.63585490536687, 4.253058578945052, 4.81211429413971, 4.49632221259763, 4.7148448529904385, 2.2966959021130613, 1.6283039665081016, 0.9478316552304716, 0.0, 11.811291694811214, 10.426148207535187, 8.141519832540508, 6.890087706339182, 9.429689705980877, 6.294851097636682, 4.81211429413971, 3.0378989849607514, 4.317927452683435, 3.6090201572487843, 2.0171730340619765, 1.0693441146668274, 0.0), # 18
(11.903037430464838, 11.892768557042718, 10.197315746521578, 10.946723336929182, 8.734435272425891, 4.300062621694845, 4.865263833992036, 4.5459230914121225, 4.766942332283511, 2.3220607489973486, 1.6463035177467755, 0.9583040326915097, 0.0, 11.941851359128435, 10.541344359606605, 8.231517588733878, 6.9661822469920445, 9.533884664567022, 6.364292327976972, 4.865263833992036, 3.071473301210604, 4.367217636212946, 3.648907778976395, 2.039463149304316, 1.0811607779129746, 0.0), # 19
(12.013085905706498, 11.992617966965858, 10.282928682233003, 11.038644604856119, 8.811187462360754, 4.336169528510063, 4.9060918411052175, 4.5840246434333585, 4.806961829386479, 2.341545364915788, 1.66013023126783, 0.9663485902603393, 0.0, 12.042143028048988, 10.62983449286373, 8.30065115633915, 7.024636094747362, 9.613923658772958, 6.417634500806702, 4.9060918411052175, 3.097263948935759, 4.405593731180377, 3.679548201618707, 2.0565857364466007, 1.0902379969968963, 0.0), # 20
(12.09232140173984, 12.060747854309614, 10.341344534499719, 11.101364727080837, 8.86495800282407, 4.360806068787375, 4.933949911189055, 4.6100220734208115, 4.834268007147008, 2.3548402802704667, 1.669564548967512, 0.9718375912277795, 0.0, 12.110574363212494, 10.690213503505571, 8.34782274483756, 7.064520840811399, 9.668536014294016, 6.454030902789136, 4.933949911189055, 3.1148614777052677, 4.432479001412035, 3.7004549090269463, 2.068268906899944, 1.096431623119056, 0.0), # 21
(12.139189491239494, 12.095572582279058, 10.371203860377285, 11.133424155157051, 8.894593421468459, 4.373399011923457, 4.94818963995336, 4.623310586133957, 4.848225528412765, 2.361636025463473, 1.674386912742068, 0.9746432988846491, 0.0, 12.145553026258591, 10.721076287731139, 8.37193456371034, 7.084908076390418, 9.69645105682553, 6.47263482058754, 4.94818963995336, 3.1238564370881834, 4.447296710734229, 3.7111413850523514, 2.0742407720754574, 1.0995975074799145, 0.0), # 22
(12.156472036011166, 12.099695953360769, 10.374923182441702, 11.137437731481482, 8.902185644826076, 4.375, 4.949882401355603, 4.624746913580247, 4.8499704938271595, 2.3624376817558304, 1.6749916074323483, 0.9749897576588934, 0.0, 12.15, 10.724887334247827, 8.37495803716174, 7.087313045267489, 9.699940987654319, 6.474645679012346, 4.949882401355603, 3.125, 4.451092822413038, 3.7124792438271617, 2.0749846364883404, 1.0999723593964337, 0.0), # 23
(12.169214895640982, 12.09729074074074, 10.374314814814815, 11.13694375, 8.906486090891882, 4.375, 4.9489522875817, 4.62275, 4.849736666666666, 2.3619451851851854, 1.6749249158249162, 0.9749086419753087, 0.0, 12.15, 10.723995061728393, 8.37462457912458, 7.085835555555555, 9.699473333333332, 6.47185, 4.9489522875817, 3.125, 4.453243045445941, 3.7123145833333346, 2.074862962962963, 1.099753703703704, 0.0), # 24
(12.181688676253897, 12.092549725651576, 10.373113854595337, 11.135966435185185, 8.910691956475603, 4.375, 4.947119341563786, 4.618827160493828, 4.8492746913580245, 2.3609756515775038, 1.6747926798852726, 0.9747485139460449, 0.0, 12.15, 10.722233653406493, 8.373963399426362, 7.08292695473251, 9.698549382716049, 6.466358024691359, 4.947119341563786, 3.125, 4.455345978237801, 3.711988811728396, 2.0746227709190674, 1.0993227023319616, 0.0), # 25
(12.19389242285764, 12.085545336076818, 10.371336762688616, 11.134516898148147, 8.914803094736882, 4.375, 4.944412030985233, 4.613052469135803, 4.84859049382716, 2.3595452126200276, 1.674596096770171, 0.9745115683584822, 0.0, 12.15, 10.719627251943303, 8.372980483850855, 7.078635637860081, 9.69718098765432, 6.458273456790124, 4.944412030985233, 3.125, 4.457401547368441, 3.71150563271605, 2.0742673525377233, 1.0986859396433473, 0.0), # 26
(12.205825180459962, 12.076349999999996, 10.369, 11.132606249999998, 8.918819358835371, 4.375, 4.940858823529412, 4.6055, 4.84769, 2.35767, 1.674336363636364, 0.9742000000000002, 0.0, 12.15, 10.7162, 8.371681818181818, 7.073009999999999, 9.69538, 6.4477, 4.940858823529412, 3.125, 4.459409679417686, 3.7108687500000004, 2.0738000000000003, 1.09785, 0.0), # 27
(12.217485994068602, 12.065036145404662, 10.366120027434842, 11.13024560185185, 8.92274060193072, 4.375, 4.93648818687969, 4.596243827160494, 4.846579135802468, 2.3553661454046644, 1.6740146776406037, 0.9738160036579792, 0.0, 12.15, 10.711976040237769, 8.370073388203018, 7.066098436213991, 9.693158271604936, 6.434741358024692, 4.93648818687969, 3.125, 4.46137030096536, 3.710081867283951, 2.073224005486969, 1.0968214677640604, 0.0), # 28
(12.2288739086913, 12.051676200274349, 10.362713305898492, 11.127446064814816, 8.926566677182576, 4.375, 4.931328588719439, 4.585358024691358, 4.845263827160494, 2.3526497805212623, 1.6736322359396434, 0.9733617741197987, 0.0, 12.15, 10.706979515317785, 8.368161179698216, 7.057949341563786, 9.690527654320988, 6.419501234567901, 4.931328588719439, 3.125, 4.463283338591288, 3.709148688271606, 2.0725426611796984, 1.0956069272976683, 0.0), # 29
(12.239987969335797, 12.036342592592591, 10.358796296296296, 11.12421875, 8.930297437750589, 4.375, 4.925408496732026, 4.572916666666666, 4.84375, 2.3495370370370376, 1.6731902356902357, 0.9728395061728394, 0.0, 12.15, 10.701234567901233, 8.365951178451178, 7.048611111111112, 9.6875, 6.402083333333333, 4.925408496732026, 3.125, 4.4651487188752945, 3.7080729166666675, 2.0717592592592595, 1.094212962962963, 0.0), # 30
(12.25082722100983, 12.019107750342934, 10.354385459533608, 11.120574768518516, 8.933932736794405, 4.375, 4.918756378600824, 4.558993827160494, 4.842043580246913, 2.346044046639232, 1.6726898740491336, 0.9722513946044812, 0.0, 12.15, 10.694765340649292, 8.363449370245666, 7.038132139917694, 9.684087160493826, 6.382591358024691, 4.918756378600824, 3.125, 4.466966368397203, 3.70685825617284, 2.070877091906722, 1.0926461591220853, 0.0), # 31
(12.261390708721144, 12.000044101508914, 10.349497256515773, 11.11652523148148, 8.937472427473676, 4.375, 4.911400702009199, 4.543663580246914, 4.84015049382716, 2.3421869410150897, 1.672132348173089, 0.9715996342021036, 0.0, 12.15, 10.687595976223138, 8.360661740865444, 7.026560823045267, 9.68030098765432, 6.36112901234568, 4.911400702009199, 3.125, 4.468736213736838, 3.705508410493828, 2.069899451303155, 1.0909131001371744, 0.0), # 32
(12.271677477477477, 11.979224074074073, 10.344148148148149, 11.11208125, 8.94091636294805, 4.375, 4.903369934640523, 4.527, 4.838076666666666, 2.3379818518518523, 1.6715188552188551, 0.9708864197530863, 0.0, 12.15, 10.679750617283949, 8.357594276094275, 7.013945555555555, 9.676153333333332, 6.3378000000000005, 4.903369934640523, 3.125, 4.470458181474025, 3.704027083333334, 2.06882962962963, 1.0890203703703705, 0.0), # 33
(12.28168657228657, 11.956720096021947, 10.338354595336076, 11.107253935185184, 8.944264396377172, 4.375, 4.894692544178166, 4.509077160493827, 4.835828024691358, 2.333444910836763, 1.670850592343185, 0.9701139460448103, 0.0, 12.15, 10.671253406492912, 8.354252961715924, 7.000334732510288, 9.671656049382715, 6.312708024691357, 4.894692544178166, 3.125, 4.472132198188586, 3.7024179783950624, 2.0676709190672153, 1.0869745541838134, 0.0), # 34
(12.291417038156167, 11.932604595336077, 10.332133058984912, 11.102054398148146, 8.947516380920696, 4.375, 4.885396998305495, 4.489969135802469, 4.83341049382716, 2.328592249657065, 1.6701287567028307, 0.969284407864655, 0.0, 12.15, 10.662128486511202, 8.350643783514153, 6.985776748971193, 9.66682098765432, 6.285956790123457, 4.885396998305495, 3.125, 4.473758190460348, 3.7006847993827163, 2.0664266117969827, 1.0847822359396435, 0.0), # 35
(12.300867920094007, 11.906949999999998, 10.3255, 11.096493749999999, 8.950672169738269, 4.375, 4.875511764705882, 4.46975, 4.830829999999999, 2.32344, 1.6693545454545458, 0.9684000000000001, 0.0, 12.15, 10.6524, 8.346772727272727, 6.970319999999999, 9.661659999999998, 6.257650000000001, 4.875511764705882, 3.125, 4.475336084869134, 3.6988312500000005, 2.0651, 1.08245, 0.0), # 36
(12.310038263107828, 11.879828737997256, 10.318471879286694, 11.090583101851852, 8.953731615989536, 4.375, 4.865065311062696, 4.448493827160494, 4.828092469135802, 2.3180042935528125, 1.668529155755082, 0.9674629172382261, 0.0, 12.15, 10.642092089620485, 8.34264577877541, 6.954012880658436, 9.656184938271604, 6.227891358024691, 4.865065311062696, 3.125, 4.476865807994768, 3.696861033950618, 2.063694375857339, 1.0799844307270234, 0.0), # 37
(12.31892711220537, 11.851313237311386, 10.311065157750342, 11.084333564814814, 8.956694572834152, 4.375, 4.854086105059308, 4.426274691358025, 4.825203827160493, 2.312301262002744, 1.6676537847611925, 0.9664753543667125, 0.0, 12.15, 10.631228898033836, 8.33826892380596, 6.936903786008231, 9.650407654320986, 6.196784567901235, 4.854086105059308, 3.125, 4.478347286417076, 3.6947778549382724, 2.0622130315500686, 1.0773921124828534, 0.0), # 38
(12.327533512394384, 11.821475925925924, 10.303296296296297, 11.07775625, 8.959560893431762, 4.375, 4.842602614379085, 4.4031666666666665, 4.82217, 2.3063470370370376, 1.6667296296296297, 0.9654395061728396, 0.0, 12.15, 10.619834567901233, 8.333648148148148, 6.919041111111111, 9.64434, 6.164433333333333, 4.842602614379085, 3.125, 4.479780446715881, 3.6925854166666676, 2.0606592592592596, 1.0746796296296297, 0.0), # 39
(12.335856508682596, 11.790389231824417, 10.295181755829903, 11.070862268518518, 8.962330430942014, 4.375, 4.830643306705398, 4.3792438271604945, 4.818996913580246, 2.3001577503429362, 1.6657578875171468, 0.9643575674439875, 0.0, 12.15, 10.60793324188386, 8.328789437585733, 6.900473251028807, 9.637993827160493, 6.1309413580246925, 4.830643306705398, 3.125, 4.481165215471007, 3.690287422839507, 2.059036351165981, 1.0718535665294926, 0.0), # 40
(12.343895146077754, 11.758125582990397, 10.286737997256516, 11.06366273148148, 8.96500303852456, 4.375, 4.818236649721617, 4.354580246913581, 4.81569049382716, 2.293749533607682, 1.6647397555804966, 0.9632317329675355, 0.0, 12.15, 10.595549062642888, 8.323698777902482, 6.881248600823045, 9.63138098765432, 6.096412345679013, 4.818236649721617, 3.125, 4.48250151926228, 3.6878875771604944, 2.0573475994513033, 1.0689205075445818, 0.0), # 41
(12.3516484695876, 11.724757407407406, 10.277981481481483, 11.056168750000001, 8.967578569339047, 4.375, 4.805411111111111, 4.32925, 4.812256666666666, 2.287138518518519, 1.663676430976431, 0.9620641975308644, 0.0, 12.15, 10.582706172839506, 8.318382154882155, 6.861415555555555, 9.624513333333333, 6.06095, 4.805411111111111, 3.125, 4.483789284669523, 3.6853895833333343, 2.055596296296297, 1.0658870370370372, 0.0), # 42
(12.35911552421987, 11.690357133058985, 10.268928669410151, 11.048391435185184, 8.970056876545122, 4.375, 4.7921951585572495, 4.3033271604938275, 4.80870135802469, 2.280340836762689, 1.6625691108617036, 0.9608571559213536, 0.0, 12.15, 10.569428715134888, 8.312845554308517, 6.841022510288067, 9.61740271604938, 6.024658024691359, 4.7921951585572495, 3.125, 4.485028438272561, 3.682797145061729, 2.0537857338820307, 1.062759739368999, 0.0), # 43
(12.366295354982311, 11.65499718792867, 10.259596021947875, 11.040341898148148, 8.972437813302435, 4.375, 4.778617259743403, 4.2768858024691365, 4.805030493827159, 2.2733726200274353, 1.6614189923930665, 0.9596128029263833, 0.0, 12.15, 10.555740832190216, 8.307094961965332, 6.820117860082305, 9.610060987654318, 5.987640123456791, 4.778617259743403, 3.125, 4.486218906651217, 3.6801139660493836, 2.0519192043895753, 1.0595451989026066, 0.0), # 44
(12.37318700688266, 11.618749999999999, 10.25, 11.03203125, 8.974721232770635, 4.375, 4.764705882352941, 4.25, 4.80125, 2.2662500000000003, 1.6602272727272729, 0.9583333333333333, 0.0, 12.15, 10.541666666666664, 8.301136363636363, 6.79875, 9.6025, 5.95, 4.764705882352941, 3.125, 4.487360616385318, 3.677343750000001, 2.0500000000000003, 1.0562500000000001, 0.0), # 45
(12.379789524928656, 11.581687997256516, 10.240157064471878, 11.023470601851852, 8.976906988109372, 4.375, 4.750489494069233, 4.222743827160494, 4.797365802469135, 2.258989108367627, 1.6589951490210748, 0.9570209419295841, 0.0, 12.15, 10.527230361225422, 8.294975745105374, 6.77696732510288, 9.59473160493827, 5.9118413580246925, 4.750489494069233, 3.125, 4.488453494054686, 3.6744902006172846, 2.048031412894376, 1.0528807270233198, 0.0), # 46
(12.386101954128042, 11.543883607681755, 10.230083676268862, 11.014671064814813, 8.978994932478294, 4.375, 4.7359965625756475, 4.195191358024691, 4.793383827160493, 2.2516060768175588, 1.657723818431226, 0.955677823502515, 0.0, 12.15, 10.512456058527663, 8.288619092156129, 6.754818230452675, 9.586767654320987, 5.873267901234568, 4.7359965625756475, 3.125, 4.489497466239147, 3.6715570216049387, 2.046016735253773, 1.049443964334705, 0.0), # 47
(12.392123339488554, 11.505409259259258, 10.219796296296296, 11.00564375, 8.980984919037049, 4.375, 4.7212555555555555, 4.167416666666667, 4.78931, 2.244117037037037, 1.656414478114478, 0.9543061728395063, 0.0, 12.15, 10.497367901234567, 8.28207239057239, 6.73235111111111, 9.57862, 5.834383333333334, 4.7212555555555555, 3.125, 4.490492459518524, 3.6685479166666677, 2.0439592592592595, 1.0459462962962964, 0.0), # 48
(12.397852726017943, 11.466337379972563, 10.209311385459534, 10.996399768518518, 8.982876800945284, 4.375, 4.706294940692326, 4.139493827160494, 4.78515024691358, 2.2365381207133064, 1.6550683252275846, 0.9529081847279379, 0.0, 12.15, 10.481990032007316, 8.275341626137923, 6.709614362139918, 9.57030049382716, 5.795291358024691, 4.706294940692326, 3.125, 4.491438400472642, 3.665466589506174, 2.0418622770919073, 1.0423943072702333, 0.0), # 49
(12.403289158723938, 11.426740397805213, 10.198645404663925, 10.986950231481481, 8.984670431362652, 4.375, 4.69114318566933, 4.111496913580247, 4.78091049382716, 2.228885459533608, 1.6536865569272978, 0.9514860539551899, 0.0, 12.15, 10.466346593507089, 8.268432784636488, 6.686656378600823, 9.56182098765432, 5.756095679012346, 4.69114318566933, 3.125, 4.492335215681326, 3.6623167438271613, 2.0397290809327853, 1.038794581618656, 0.0), # 50
(12.408431682614292, 11.38669074074074, 10.187814814814814, 10.977306249999998, 8.986365663448797, 4.375, 4.675828758169934, 4.0835, 4.776596666666666, 2.2211751851851855, 1.6522703703703707, 0.9500419753086421, 0.0, 12.15, 10.450461728395062, 8.261351851851853, 6.663525555555555, 9.553193333333333, 5.7169, 4.675828758169934, 3.125, 4.493182831724399, 3.659102083333334, 2.037562962962963, 1.0351537037037037, 0.0), # 51
(12.413279342696734, 11.34626083676269, 10.176836076817558, 10.967478935185184, 8.98796235036337, 4.375, 4.660380125877511, 4.055577160493827, 4.772214691358024, 2.2134234293552817, 1.6508209627135553, 0.9485781435756746, 0.0, 12.15, 10.434359579332419, 8.254104813567777, 6.640270288065844, 9.544429382716048, 5.677808024691357, 4.660380125877511, 3.125, 4.493981175181685, 3.655826311728396, 2.035367215363512, 1.0314782578875175, 0.0), # 52
(12.417831183979011, 11.305523113854596, 10.165725651577505, 10.957479398148147, 8.989460345266023, 4.375, 4.64482575647543, 4.0278024691358025, 4.767770493827161, 2.205646323731139, 1.6493395311136052, 0.9470967535436672, 0.0, 12.15, 10.418064288980338, 8.246697655568026, 6.616938971193416, 9.535540987654322, 5.638923456790124, 4.64482575647543, 3.125, 4.4947301726330116, 3.65249313271605, 2.0331451303155013, 1.0277748285322361, 0.0), # 53
(12.42208625146886, 11.26455, 10.154499999999999, 10.94731875, 8.9908595013164, 4.375, 4.629194117647058, 4.000249999999999, 4.7632699999999994, 2.1978600000000004, 1.6478272727272725, 0.9456, 0.0, 12.15, 10.401599999999998, 8.239136363636362, 6.593579999999999, 9.526539999999999, 5.60035, 4.629194117647058, 3.125, 4.4954297506582, 3.649106250000001, 2.0309, 1.0240500000000001, 0.0), # 54
(12.426043590174027, 11.223413923182441, 10.143175582990398, 10.93700810185185, 8.992159671674152, 4.375, 4.613513677075768, 3.9729938271604937, 4.758719135802469, 2.1900805898491087, 1.6462853847113108, 0.9440900777320531, 0.0, 12.15, 10.384990855052584, 8.231426923556553, 6.570241769547325, 9.517438271604938, 5.562191358024691, 4.613513677075768, 3.125, 4.496079835837076, 3.645669367283951, 2.02863511659808, 1.0203103566529494, 0.0), # 55
(12.429702245102245, 11.182187311385459, 10.131768861454047, 10.926558564814814, 8.993360709498926, 4.375, 4.597812902444929, 3.946108024691358, 4.754123827160494, 2.182324224965707, 1.6447150642224717, 0.9425691815272064, 0.0, 12.15, 10.368260996799268, 8.223575321112358, 6.54697267489712, 9.508247654320988, 5.524551234567902, 4.597812902444929, 3.125, 4.496680354749463, 3.6421861882716056, 2.02635377229081, 1.0165624828532238, 0.0), # 56
(12.433061261261258, 11.140942592592593, 10.120296296296297, 10.915981249999998, 8.994462467950372, 4.375, 4.582120261437908, 3.9196666666666675, 4.74949, 2.1746070370370374, 1.6431175084175085, 0.9410395061728396, 0.0, 12.15, 10.351434567901233, 8.215587542087542, 6.523821111111111, 9.49898, 5.487533333333334, 4.582120261437908, 3.125, 4.497231233975186, 3.638660416666667, 2.0240592592592597, 1.0128129629629632, 0.0), # 57
(12.436119683658815, 11.09975219478738, 10.108774348422497, 10.905287268518517, 8.995464800188138, 4.375, 4.5664642217380775, 3.8937438271604936, 4.744823580246913, 2.1669451577503436, 1.641493914453174, 0.939503246456333, 0.0, 12.15, 10.334535711019662, 8.20746957226587, 6.50083547325103, 9.489647160493826, 5.451241358024691, 4.5664642217380775, 3.125, 4.497732400094069, 3.6350957561728396, 2.0217548696844996, 1.0090683813443075, 0.0), # 58
(12.438876557302644, 11.05868854595336, 10.097219478737998, 10.89448773148148, 8.996367559371876, 4.375, 4.550873251028807, 3.868413580246914, 4.74013049382716, 2.1593547187928674, 1.63984547948622, 0.9379625971650665, 0.0, 12.15, 10.31758856881573, 8.1992273974311, 6.478064156378601, 9.48026098765432, 5.41577901234568, 4.550873251028807, 3.125, 4.498183779685938, 3.6314959104938276, 2.0194438957476, 1.0053353223593966, 0.0), # 59
(12.441330927200491, 11.017824074074072, 10.085648148148147, 10.88359375, 8.997170598661228, 4.375, 4.535375816993463, 3.84375, 4.735416666666667, 2.1518518518518523, 1.6381734006734008, 0.9364197530864199, 0.0, 12.15, 10.300617283950617, 8.190867003367003, 6.455555555555556, 9.470833333333333, 5.3812500000000005, 4.535375816993463, 3.125, 4.498585299330614, 3.6278645833333343, 2.0171296296296295, 1.0016203703703705, 0.0), # 60
(12.443481838360098, 10.977231207133059, 10.0740768175583, 10.872616435185183, 8.997873771215849, 4.375, 4.520000387315419, 3.819827160493827, 4.730688024691357, 2.1444526886145407, 1.6364788751714678, 0.9348769090077733, 0.0, 12.15, 10.283645999085506, 8.182394375857339, 6.4333580658436205, 9.461376049382714, 5.347758024691358, 4.520000387315419, 3.125, 4.498936885607924, 3.624205478395062, 2.0148153635116604, 0.9979301097393691, 0.0), # 61
(12.445328335789204, 10.936982373113853, 10.062521947873801, 10.861566898148148, 8.998476930195388, 4.375, 4.504775429678044, 3.796719135802469, 4.72595049382716, 2.137173360768176, 1.6347631001371743, 0.9333362597165068, 0.0, 12.15, 10.266698856881574, 8.17381550068587, 6.411520082304527, 9.45190098765432, 5.315406790123457, 4.504775429678044, 3.125, 4.499238465097694, 3.620522299382717, 2.0125043895747603, 0.9942711248285323, 0.0), # 62
(12.44686946449555, 10.897149999999998, 10.051, 10.85045625, 8.998979928759484, 4.375, 4.4897294117647055, 3.7745, 4.721209999999999, 2.13003, 1.6330272727272728, 0.9318000000000001, 0.0, 12.15, 10.249799999999999, 8.165136363636364, 6.390089999999999, 9.442419999999998, 5.2843, 4.4897294117647055, 3.125, 4.499489964379742, 3.616818750000001, 2.0102, 0.99065, 0.0), # 63
(12.448104269486876, 10.857806515775033, 10.039527434842249, 10.839295601851852, 8.999382620067799, 4.375, 4.474890801258775, 3.7532438271604947, 4.716472469135802, 2.123038737997257, 1.6312725900985157, 0.9302703246456334, 0.0, 12.15, 10.232973571101967, 8.156362950492579, 6.369116213991769, 9.432944938271604, 5.254541358024692, 4.474890801258775, 3.125, 4.499691310033899, 3.613098533950618, 2.00790548696845, 0.9870733196159123, 0.0), # 64
(12.449031795770926, 10.819024348422495, 10.0281207133059, 10.828096064814813, 8.999684857279973, 4.375, 4.4602880658436215, 3.7330246913580245, 4.711743827160493, 2.1162157064471883, 1.6295002494076571, 0.9287494284407863, 0.0, 12.15, 10.216243712848648, 8.147501247038285, 6.348647119341564, 9.423487654320986, 5.226234567901234, 4.4602880658436215, 3.125, 4.499842428639987, 3.609365354938272, 2.0056241426611803, 0.9835476680384088, 0.0), # 65
(12.449651088355436, 10.780875925925926, 10.016796296296297, 10.81686875, 8.999886493555657, 4.375, 4.445949673202614, 3.7139166666666674, 4.70703, 2.1095770370370373, 1.6277114478114478, 0.9272395061728398, 0.0, 12.15, 10.199634567901235, 8.138557239057238, 6.328731111111111, 9.41406, 5.199483333333334, 4.445949673202614, 3.125, 4.499943246777828, 3.6056229166666673, 2.0033592592592595, 0.9800796296296298, 0.0), # 66
(12.44996119224815, 10.743433676268861, 10.005570644718793, 10.805624768518516, 8.999987382054503, 4.375, 4.431904091019123, 3.695993827160495, 4.702336913580247, 2.103138861454047, 1.625907382466642, 0.9257427526291724, 0.0, 12.15, 10.183170278920894, 8.12953691233321, 6.30941658436214, 9.404673827160494, 5.1743913580246925, 4.431904091019123, 3.125, 4.499993691027251, 3.6018749228395066, 2.0011141289437586, 0.9766757887517148, 0.0), # 67
(12.44974993737699, 10.706573503252354, 9.994405949931412, 10.794277566425121, 8.999902364237876, 4.37491880810852, 4.418109116897788, 3.6791719250114308, 4.6976351394604485, 2.0968861324941503, 1.624057197708075, 0.9242530021899743, 0.0, 12.149850180041152, 10.166783024089716, 8.120285988540376, 6.290658397482449, 9.395270278920897, 5.1508406950160035, 4.418109116897788, 3.1249420057918, 4.499951182118938, 3.598092522141708, 1.9988811899862826, 0.9733248639320324, 0.0), # 68
(12.447770048309177, 10.669170071684588, 9.982988425925925, 10.782255163043477, 8.999128540305009, 4.374276954732511, 4.404160908807968, 3.6625493827160494, 4.692719135802469, 2.090641917211329, 1.621972567783094, 0.9227218973359325, 0.0, 12.148663194444444, 10.149940870695255, 8.10986283891547, 6.271925751633985, 9.385438271604938, 5.127569135802469, 4.404160908807968, 3.1244835390946504, 4.499564270152504, 3.5940850543478264, 1.996597685185185, 0.9699245519713263, 0.0), # 69
(12.443862945070673, 10.63105170582769, 9.971268432784635, 10.769478411835749, 8.997599451303152, 4.373012879134278, 4.389996080736822, 3.645976223136717, 4.687561156835848, 2.0843758573388205, 1.619629777305216, 0.921142276129281, 0.0, 12.14631880144033, 10.13256503742209, 8.09814888652608, 6.25312757201646, 9.375122313671696, 5.104366712391404, 4.389996080736822, 3.123580627953056, 4.498799725651576, 3.5898261372785836, 1.9942536865569274, 0.9664592459843356, 0.0), # 70
(12.438083592771514, 10.592241185450682, 9.959250085733881, 10.755966153381644, 8.995334463003308, 4.371147065996037, 4.375620995723392, 3.629457933241884, 4.682168884316415, 2.078088107802792, 1.6170374741567726, 0.9195152937212715, 0.0, 12.142847865226338, 10.114668230933985, 8.085187370783862, 6.234264323408375, 9.36433776863283, 5.081241106538638, 4.375620995723392, 3.1222479042828835, 4.497667231501654, 3.5853220511272155, 1.9918500171467763, 0.962931016859153, 0.0), # 71
(12.430486956521738, 10.552761290322579, 9.946937499999999, 10.74173722826087, 8.99235294117647, 4.3687000000000005, 4.3610420168067225, 3.6129999999999995, 4.67655, 2.071778823529412, 1.614204306220096, 0.917842105263158, 0.0, 12.13828125, 10.096263157894736, 8.07102153110048, 6.215336470588234, 9.3531, 5.058199999999999, 4.3610420168067225, 3.1205000000000003, 4.496176470588235, 3.5805790760869574, 1.9893874999999999, 0.959341935483871, 0.0), # 72
(12.421128001431383, 10.512634800212398, 9.934334790809327, 10.72681047705314, 8.98867425159364, 4.36569216582838, 4.346265507025855, 3.5966079103795154, 4.670712185642433, 2.0654481594448484, 1.6111389213775176, 0.916123865906192, 0.0, 12.132649819958848, 10.07736252496811, 8.055694606887588, 6.196344478334543, 9.341424371284866, 5.035251074531322, 4.346265507025855, 3.118351547020271, 4.49433712579682, 3.5756034923510476, 1.9868669581618656, 0.9556940727465817, 0.0), # 73
(12.410061692610485, 10.471884494889155, 9.921446073388202, 10.711204740338164, 8.984317760025819, 4.3621440481633895, 4.331297829419833, 3.5802871513488794, 4.664663122999542, 2.0590962704752687, 1.607849967511371, 0.9143617308016269, 0.0, 12.125984439300412, 10.057979038817894, 8.039249837556856, 6.177288811425805, 9.329326245999084, 5.012402011888431, 4.331297829419833, 3.115817177259564, 4.4921588800129095, 3.5704015801127222, 1.9842892146776405, 0.9519894995353778, 0.0), # 74
(12.397342995169081, 10.430533154121862, 9.908275462962962, 10.694938858695652, 8.97930283224401, 4.358076131687243, 4.3161453470277, 3.5640432098765435, 4.6584104938271595, 2.052723311546841, 1.604346092503987, 0.9125568551007147, 0.0, 12.118315972222222, 10.038125406107861, 8.021730462519935, 6.158169934640522, 9.316820987654319, 4.989660493827161, 4.3161453470277, 3.112911522633745, 4.489651416122005, 3.5649796195652184, 1.9816550925925924, 0.9482302867383512, 0.0), # 75
(12.383026874217212, 10.388603557679545, 9.894827074759945, 10.678031672705314, 8.973648834019203, 4.353508901082153, 4.300814422888497, 3.5478815729309554, 4.651961979881115, 2.046329437585734, 1.6006359442376985, 0.9107103939547083, 0.0, 12.10967528292181, 10.01781433350179, 8.003179721188491, 6.138988312757201, 9.30392395976223, 4.967034202103338, 4.300814422888497, 3.1096492150586803, 4.486824417009601, 3.5593438909017725, 1.978965414951989, 0.9444185052435952, 0.0), # 76
(12.367168294864912, 10.34611848533121, 9.881105024005485, 10.660502022946858, 8.967375131122406, 4.34846284103033, 4.285311420041268, 3.531807727480567, 4.645325262917238, 2.0399148035181156, 1.5967281705948373, 0.9088235025148608, 0.0, 12.10009323559671, 9.997058527663466, 7.983640852974187, 6.119744410554345, 9.290650525834476, 4.944530818472794, 4.285311420041268, 3.106044886450236, 4.483687565561203, 3.5535006743156203, 1.9762210048010973, 0.9405562259392011, 0.0), # 77
(12.349822222222222, 10.30310071684588, 9.867113425925925, 10.64236875, 8.960501089324618, 4.3429584362139915, 4.269642701525055, 3.5158271604938274, 4.638508024691357, 2.0334795642701526, 1.5926314194577353, 0.9068973359324239, 0.0, 12.089600694444444, 9.975870695256662, 7.963157097288676, 6.100438692810457, 9.277016049382715, 4.922158024691359, 4.269642701525055, 3.1021131687242796, 4.480250544662309, 3.5474562500000006, 1.9734226851851853, 0.9366455197132618, 0.0), # 78
(12.331043621399177, 10.259573031992566, 9.8528563957476, 10.623650694444443, 8.953046074396838, 4.337016171315348, 4.2538146303789, 3.4999453589391867, 4.631517946959304, 2.0270238747680143, 1.5883543387087244, 0.9049330493586505, 0.0, 12.07822852366255, 9.954263542945155, 7.941771693543622, 6.081071624304041, 9.263035893918609, 4.899923502514861, 4.2538146303789, 3.097868693796677, 4.476523037198419, 3.5412168981481487, 1.97057127914952, 0.9326884574538697, 0.0), # 79
(12.310887457505816, 10.215558210540289, 9.838338048696844, 10.604366696859904, 8.945029452110063, 4.330656531016613, 4.2378335696418485, 3.4841678097850943, 4.624362711476909, 2.0205478899378684, 1.5839055762301377, 0.9029317979447936, 0.0, 12.066007587448558, 9.932249777392729, 7.919527881150689, 6.061643669813604, 9.248725422953818, 4.877834933699132, 4.2378335696418485, 3.093326093583295, 4.4725147260550315, 3.5347888989533023, 1.967667609739369, 0.9286871100491174, 0.0), # 80
(12.289408695652174, 10.171079032258064, 9.8235625, 10.584535597826088, 8.936470588235293, 4.3239, 4.221705882352941, 3.4685000000000006, 4.617049999999999, 2.014051764705883, 1.5792937799043065, 0.9008947368421053, 0.0, 12.052968749999998, 9.909842105263158, 7.8964688995215315, 6.042155294117647, 9.234099999999998, 4.855900000000001, 4.221705882352941, 3.0885, 4.468235294117647, 3.5281785326086967, 1.9647125, 0.9246435483870968, 0.0), # 81
(12.26666230094829, 10.126158276914907, 9.808533864883403, 10.564176237922705, 8.927388848543531, 4.316767062947722, 4.205437931551222, 3.4529474165523544, 4.6095874942844075, 2.007535653998225, 1.5745275976135626, 0.8988230212018388, 0.0, 12.039142875514404, 9.887053233220225, 7.8726379880678135, 6.022606961994674, 9.219174988568815, 4.834126383173296, 4.205437931551222, 3.0834050449626584, 4.4636944242717655, 3.521392079307569, 1.9617067729766806, 0.9205598433559008, 0.0), # 82
(12.242703238504205, 10.080818724279835, 9.793256258573388, 10.543307457729467, 8.917803598805776, 4.30927820454199, 4.189036080275732, 3.4375155464106077, 4.6019828760859625, 2.0009997127410637, 1.569615677240239, 0.8967178061752463, 0.0, 12.0245608281893, 9.863895867927708, 7.848078386201194, 6.00299913822319, 9.203965752171925, 4.812521764974851, 4.189036080275732, 3.078055860387136, 4.458901799402888, 3.5144358192431566, 1.9586512517146777, 0.9164380658436215, 0.0), # 83
(12.21758647342995, 10.035083154121864, 9.777733796296296, 10.521948097826087, 8.907734204793028, 4.301453909465021, 4.1725066915655145, 3.4222098765432096, 4.5942438271604935, 1.994444095860567, 1.5645666666666667, 0.8945802469135803, 0.0, 12.009253472222222, 9.840382716049382, 7.8228333333333335, 5.9833322875817, 9.188487654320987, 4.791093827160494, 4.1725066915655145, 3.0724670781893004, 4.453867102396514, 3.5073160326086965, 1.9555467592592592, 0.9122802867383514, 0.0), # 84
(12.191366970835569, 9.988974346210009, 9.761970593278463, 10.500116998792272, 8.897200032276285, 4.293314662399025, 4.1558561284596145, 3.4070358939186103, 4.58637802926383, 1.9878689582829019, 1.5593892137751788, 0.8924114985680938, 0.0, 11.9932516718107, 9.81652648424903, 7.796946068875894, 5.963606874848704, 9.17275605852766, 4.769850251486054, 4.1558561284596145, 3.0666533302850176, 4.448600016138142, 3.500038999597425, 1.9523941186556926, 0.9080885769281828, 0.0), # 85
(12.164099695831096, 9.942515080313289, 9.745970764746229, 10.477833001207731, 8.886220447026545, 4.284880948026216, 4.139090753997072, 3.391999085505258, 4.578393164151806, 1.9812744549342376, 1.5540919664481068, 0.8902127162900394, 0.0, 11.976586291152262, 9.792339879190433, 7.770459832240534, 5.943823364802712, 9.156786328303612, 4.748798719707362, 4.139090753997072, 3.0606292485901543, 4.443110223513273, 3.4926110004025777, 1.9491941529492458, 0.9038650073012082, 0.0), # 86
(12.135839613526569, 9.895728136200717, 9.729738425925925, 10.455114945652172, 8.874814814814815, 4.276173251028807, 4.122216931216931, 3.3771049382716045, 4.570296913580247, 1.9746607407407408, 1.5486835725677832, 0.8879850552306694, 0.0, 11.959288194444444, 9.76783560753736, 7.743417862838915, 5.923982222222222, 9.140593827160494, 4.727946913580246, 4.122216931216931, 3.054409465020576, 4.437407407407408, 3.4850383152173916, 1.9459476851851853, 0.8996116487455198, 0.0), # 87
(12.106641689032028, 9.84863629364131, 9.713277692043896, 10.431981672705316, 8.863002501412087, 4.2672120560890106, 4.105241023158234, 3.3623589391860995, 4.562096959304984, 1.9680279706285808, 1.5431726800165397, 0.8857296705412365, 0.0, 11.941388245884776, 9.743026375953601, 7.715863400082698, 5.904083911885741, 9.124193918609969, 4.707302514860539, 4.105241023158234, 3.0480086114921505, 4.431501250706043, 3.477327224235106, 1.9426555384087794, 0.8953305721492102, 0.0), # 88
(12.076560887457505, 9.801262332404088, 9.696592678326475, 10.40845202294686, 8.850802872589364, 4.258017847889041, 4.088169392860024, 3.3477665752171926, 4.553800983081847, 1.9613762995239252, 1.537567936676709, 0.8834477173729935, 0.0, 11.922917309670781, 9.717924891102928, 7.687839683383544, 5.884128898571774, 9.107601966163694, 4.68687320530407, 4.088169392860024, 3.041441319920744, 4.425401436294682, 3.469484007648954, 1.9393185356652953, 0.8910238484003719, 0.0), # 89
(12.045652173913043, 9.753629032258065, 9.6796875, 10.384544836956522, 8.838235294117647, 4.248611111111111, 4.071008403361344, 3.333333333333333, 4.545416666666667, 1.9547058823529415, 1.5318779904306221, 0.881140350877193, 0.0, 11.90390625, 9.692543859649122, 7.65938995215311, 5.864117647058823, 9.090833333333334, 4.666666666666666, 4.071008403361344, 3.0347222222222223, 4.419117647058823, 3.461514945652175, 1.9359375, 0.8866935483870969, 0.0), # 90
(12.013970513508676, 9.705759172972254, 9.662566272290809, 10.360278955314012, 8.825319131767932, 4.239012330437433, 4.053764417701236, 3.319064700502972, 4.536951691815272, 1.948016874041798, 1.526111489160612, 0.8788087262050875, 0.0, 11.884385931069957, 9.66689598825596, 7.630557445803059, 5.844050622125392, 9.073903383630544, 4.646690580704161, 4.053764417701236, 3.027865950312452, 4.412659565883966, 3.4534263184380047, 1.9325132544581618, 0.8823417429974777, 0.0), # 91
(11.981570871354446, 9.657675534315677, 9.64523311042524, 10.335673218599032, 8.812073751311223, 4.2292419905502205, 4.036443798918745, 3.304966163694559, 4.528413740283494, 1.941309429516663, 1.5202770807490107, 0.8764539985079298, 0.0, 11.864387217078187, 9.640993983587226, 7.601385403745053, 5.823928288549988, 9.056827480566987, 4.626952629172383, 4.036443798918745, 3.0208871361073006, 4.406036875655611, 3.4452244061996784, 1.9290466220850482, 0.8779705031196072, 0.0), # 92
(11.948508212560386, 9.609400896057348, 9.62769212962963, 10.310746467391306, 8.798518518518518, 4.219320576131687, 4.01905291005291, 3.2910432098765434, 4.51981049382716, 1.9345837037037037, 1.5143834130781502, 0.8740773229369722, 0.0, 11.84394097222222, 9.614850552306692, 7.57191706539075, 5.80375111111111, 9.03962098765432, 4.607460493827161, 4.01905291005291, 3.0138004115226336, 4.399259259259259, 3.436915489130436, 1.925538425925926, 0.8735818996415772, 0.0), # 93
(11.914837502236535, 9.56095803796628, 9.609947445130317, 10.285517542270531, 8.784672799160816, 4.209268571864045, 4.0015981141427766, 3.277301326017376, 4.511149634202103, 1.9278398515290893, 1.5084391340303622, 0.8716798546434675, 0.0, 11.823078060699588, 9.588478401078142, 7.54219567015181, 5.783519554587267, 9.022299268404206, 4.588221856424326, 4.0015981141427766, 3.0066204084743178, 4.392336399580408, 3.4285058474235113, 1.9219894890260634, 0.8691780034514802, 0.0), # 94
(11.880613705492932, 9.512369739811495, 9.592003172153635, 10.260005283816424, 8.770555959009117, 4.199106462429508, 3.984085774227386, 3.2637459990855056, 4.5024388431641515, 1.9210780279189867, 1.5024528914879791, 0.869262748778668, 0.0, 11.801829346707818, 9.561890236565347, 7.512264457439896, 5.763234083756959, 9.004877686328303, 4.569244398719708, 3.984085774227386, 2.9993617588782198, 4.385277979504559, 3.4200017612721423, 1.9184006344307272, 0.8647608854374088, 0.0), # 95
(11.845891787439614, 9.463658781362009, 9.573863425925927, 10.234228532608697, 8.756187363834421, 4.188854732510288, 3.966522253345782, 3.250382716049383, 4.493685802469135, 1.9142983877995645, 1.4964333333333335, 0.8668271604938274, 0.0, 11.780225694444445, 9.5350987654321, 7.482166666666667, 5.742895163398693, 8.98737160493827, 4.5505358024691365, 3.966522253345782, 2.9920390946502056, 4.3780936819172105, 3.411409510869566, 1.9147726851851854, 0.8603326164874555, 0.0), # 96
(11.810726713186616, 9.414847942386832, 9.555532321673525, 10.208206129227051, 8.74158637940773, 4.178533866788599, 3.948913914537008, 3.237216963877458, 4.484898193872885, 1.9075010860969905, 1.4903891074487565, 0.864374244940197, 0.0, 11.758297968106996, 9.508116694342165, 7.451945537243782, 5.7225032582909705, 8.96979638774577, 4.532103749428441, 3.948913914537008, 2.984667047706142, 4.370793189703865, 3.402735376409018, 1.911106464334705, 0.8558952674897121, 0.0), # 97
(11.775173447843981, 9.365960002654985, 9.53701397462277, 10.181956914251208, 8.72677237150004, 4.168164349946655, 3.931267120840105, 3.22425422953818, 4.476083699131229, 1.9006862777374327, 1.484328861716581, 0.8619051572690299, 0.0, 11.736077031893004, 9.480956729959328, 7.421644308582906, 5.702058833212297, 8.952167398262459, 4.513955921353452, 3.931267120840105, 2.9772602499618963, 4.36338618575002, 3.3939856380837368, 1.9074027949245542, 0.8514509093322715, 0.0), # 98
(11.739286956521738, 9.317017741935484, 9.5183125, 10.15549972826087, 8.711764705882352, 4.157766666666667, 3.913588235294118, 3.2115, 4.46725, 1.893854117647059, 1.4782612440191387, 0.859421052631579, 0.0, 11.71359375, 9.453631578947368, 7.391306220095694, 5.681562352941175, 8.9345, 4.4961, 3.913588235294118, 2.9698333333333333, 4.355882352941176, 3.385166576086957, 1.9036625000000003, 0.8470016129032258, 0.0), # 99
(11.703122204329933, 9.268043939997343, 9.49943201303155, 10.128853411835749, 8.696582748325667, 4.147361301630848, 3.895883620938087, 3.1989597622313672, 4.458404778235025, 1.8870047607520377, 1.4721949022387621, 0.8569230861790968, 0.0, 11.690878986625515, 9.426153947970063, 7.36097451119381, 5.661014282256112, 8.91680955647005, 4.4785436671239145, 3.895883620938087, 2.9624009297363205, 4.348291374162834, 3.376284470611917, 1.89988640260631, 0.8425494490906678, 0.0), # 100
(11.6667341563786, 9.219061376609584, 9.480376628943759, 10.102036805555556, 8.681245864600983, 4.136968739521414, 3.878159640811057, 3.1866390032007312, 4.449555715592135, 1.8801383619785366, 1.4661384842577825, 0.8544124130628354, 0.0, 11.667963605967076, 9.398536543691188, 7.330692421288911, 5.640415085935608, 8.89911143118427, 4.461294604481024, 3.878159640811057, 2.9549776710867244, 4.340622932300492, 3.367345601851853, 1.8960753257887522, 0.8380964887826896, 0.0), # 101
(11.630177777777778, 9.170092831541218, 9.461150462962962, 10.07506875, 8.665773420479303, 4.126609465020577, 3.8604226579520695, 3.174543209876543, 4.44071049382716, 1.8732550762527238, 1.4601006379585326, 0.8518901884340482, 0.0, 11.644878472222222, 9.37079207277453, 7.300503189792663, 5.61976522875817, 8.88142098765432, 4.44436049382716, 3.8604226579520695, 2.947578189300412, 4.332886710239651, 3.358356250000001, 1.8922300925925928, 0.8336448028673837, 0.0), # 102
(11.593508033637502, 9.121161084561264, 9.4417576303155, 10.047968085748792, 8.650184781731623, 4.116303962810547, 3.842679035400168, 3.162677869227252, 4.43187679469593, 1.8663550585007669, 1.4540900112233446, 0.8493575674439874, 0.0, 11.621654449588474, 9.342933241883859, 7.270450056116723, 5.599065175502299, 8.86375358939186, 4.427749016918153, 3.842679035400168, 2.940217116293248, 4.325092390865811, 3.3493226952495982, 1.8883515260631, 0.8291964622328422, 0.0), # 103
(11.556779889067812, 9.072288915438735, 9.422202246227709, 10.020753653381641, 8.634499314128943, 4.10607271757354, 3.8249351361943953, 3.151048468221308, 4.423062299954275, 1.8594384636488344, 1.44811525193455, 0.8468157052439055, 0.0, 11.598322402263374, 9.314972757682959, 7.24057625967275, 5.578315390946502, 8.84612459990855, 4.411467855509831, 3.8249351361943953, 2.9329090839811003, 4.317249657064472, 3.3402512177938815, 1.884440449245542, 0.8247535377671579, 0.0), # 104
(11.520048309178742, 9.023499103942651, 9.402488425925926, 9.99344429347826, 8.618736383442265, 4.09593621399177, 3.8071973233737944, 3.1396604938271606, 4.414274691358024, 1.8525054466230941, 1.4421850079744816, 0.8442657569850553, 0.0, 11.574913194444443, 9.286923326835607, 7.210925039872408, 5.557516339869281, 8.828549382716048, 4.395524691358025, 3.8071973233737944, 2.9256687242798356, 4.309368191721132, 3.331148097826088, 1.8804976851851853, 0.8203181003584229, 0.0), # 105
(11.483368259080336, 8.974814429842029, 9.382620284636488, 9.966058846618358, 8.602915355442589, 4.0859149367474465, 3.7894719599774067, 3.12851943301326, 4.405521650663008, 1.8455561623497139, 1.436307927225471, 0.8417088778186895, 0.0, 11.551457690329217, 9.258797656005584, 7.181539636127354, 5.53666848704914, 8.811043301326016, 4.379927206218564, 3.7894719599774067, 2.918510669105319, 4.301457677721294, 3.3220196155394537, 1.8765240569272976, 0.81589222089473, 0.0), # 106
(11.446794703882626, 8.926257672905882, 9.362601937585735, 9.938616153381641, 8.58705559590091, 4.076029370522787, 3.7717654090442765, 3.117630772748057, 4.396810859625057, 1.838590765754862, 1.4304926575698504, 0.8391462228960604, 0.0, 11.527986754115226, 9.230608451856664, 7.152463287849251, 5.515772297264585, 8.793621719250114, 4.36468308184728, 3.7717654090442765, 2.911449550373419, 4.293527797950455, 3.312872051127215, 1.8725203875171472, 0.8114779702641711, 0.0), # 107
(11.410382608695652, 8.877851612903227, 9.3424375, 9.911135054347826, 8.571176470588235, 4.0663, 3.7540840336134447, 3.107, 4.3881499999999996, 1.8316094117647064, 1.4247478468899522, 0.8365789473684213, 0.0, 11.504531250000001, 9.202368421052633, 7.12373923444976, 5.494828235294118, 8.776299999999999, 4.3498, 3.7540840336134447, 2.9045, 4.285588235294117, 3.3037116847826096, 1.8684875000000005, 0.8070774193548388, 0.0), # 108
(11.374186938629451, 8.82961902960308, 9.322131087105625, 9.883634390096615, 8.555297345275559, 4.056747309861302, 3.7364341967239567, 3.0966326017375403, 4.379546753543667, 1.8246122553054145, 1.4190821430681082, 0.8340082063870239, 0.0, 11.48112204218107, 9.174090270257262, 7.09541071534054, 5.473836765916242, 8.759093507087334, 4.335285642432557, 3.7364341967239567, 2.8976766499009297, 4.277648672637779, 3.294544796698873, 1.864426217421125, 0.8026926390548256, 0.0), # 109
(11.338262658794058, 8.78158270277446, 9.301686814128946, 9.85613300120773, 8.539437585733882, 4.047391784788904, 3.7188222614148536, 3.0865340649291264, 4.371008802011888, 1.8175994513031553, 1.4135041939866502, 0.8314351551031215, 0.0, 11.457789994855966, 9.145786706134334, 7.067520969933251, 5.452798353909465, 8.742017604023776, 4.321147690900777, 3.7188222614148536, 2.8909941319920742, 4.269718792866941, 3.2853776670692443, 1.8603373628257893, 0.7983257002522237, 0.0), # 110
(11.302664734299517, 8.733765412186381, 9.281108796296298, 9.82864972826087, 8.523616557734204, 4.038253909465022, 3.7012545907251786, 3.0767098765432097, 4.3625438271604935, 1.8105711546840961, 1.4080226475279107, 0.8288609486679663, 0.0, 11.434565972222222, 9.117470435347629, 7.040113237639553, 5.431713464052287, 8.725087654320987, 4.307393827160493, 3.7012545907251786, 2.8844670781893007, 4.261808278867102, 3.2762165760869575, 1.8562217592592598, 0.7939786738351257, 0.0), # 111
(11.26744813025586, 8.686189937607857, 9.26040114883402, 9.801203411835749, 8.507853627047526, 4.029354168571865, 3.6837375476939744, 3.0671655235482396, 4.354159510745312, 1.803527520374405, 1.402646151574222, 0.8262867422328111, 0.0, 11.411480838477365, 9.08915416456092, 7.013230757871109, 5.4105825611232135, 8.708319021490624, 4.294031732967535, 3.6837375476939744, 2.8781101204084747, 4.253926813523763, 3.2670678039452503, 1.8520802297668042, 0.7896536306916234, 0.0), # 112
(11.232605068443652, 8.638958480664547, 9.239617828252069, 9.773850494242836, 8.492140544138962, 4.02070883845016, 3.6663155781940615, 3.057926284390303, 4.3458851245034475, 1.7964914209838192, 1.3973847812305735, 0.8237192936504428, 0.0, 11.388532681011865, 9.06091223015487, 6.9869239061528665, 5.389474262951456, 8.691770249006895, 4.281096798146424, 3.6663155781940615, 2.8719348846072568, 4.246070272069481, 3.257950164747613, 1.8479235656504138, 0.7853598618785952, 0.0), # 113
(11.197777077480078, 8.592536901878088, 9.219045675021619, 9.746810479149604, 8.47631468365306, 4.012298225970931, 3.649210925046347, 3.04910562975256, 4.337847614285224, 1.7895945503738353, 1.3922488674226394, 0.8211912172112975, 0.0, 11.365530496992042, 9.033103389324271, 6.961244337113197, 5.368783651121505, 8.675695228570447, 4.268747881653584, 3.649210925046347, 2.8659273042649507, 4.23815734182653, 3.248936826383202, 1.8438091350043238, 0.7811397183525536, 0.0), # 114
(11.162861883604794, 8.546941918551349, 9.198696932707318, 9.7200760546636, 8.46032614231088, 4.004100458749136, 3.6324357901149367, 3.0407013271393546, 4.330049991467515, 1.7828475983964234, 1.3872309022854188, 0.8187037582558852, 0.0, 11.342407957992451, 9.005741340814735, 6.936154511427093, 5.348542795189269, 8.66009998293503, 4.256981857995097, 3.6324357901149367, 2.8600717562493823, 4.23016307115544, 3.2400253515545345, 1.8397393865414637, 0.7769947198683046, 0.0), # 115
(11.127815847885161, 8.502107109420871, 9.178532189983873, 9.693599535239764, 8.444150821107023, 3.9960962141009686, 3.6159628905167356, 3.0326901564494966, 4.322472535691132, 1.7762380075348645, 1.3823211862542963, 0.8162523197487347, 0.0, 11.319128711707068, 8.97877551723608, 6.911605931271482, 5.328714022604592, 8.644945071382264, 4.245766219029295, 3.6159628905167356, 2.854354438643549, 4.222075410553511, 3.231199845079922, 1.835706437996775, 0.7729188281291702, 0.0), # 116
(11.092595331388527, 8.457966053223192, 9.158512035525986, 9.66733323533302, 8.427764621036088, 3.988266169342624, 3.5997649433686516, 3.0250488975817924, 4.315095526596881, 1.769753220272439, 1.3775100197646568, 0.8138323046543751, 0.0, 11.295656405829869, 8.952155351198124, 6.887550098823283, 5.309259660817316, 8.630191053193762, 4.23506845661451, 3.5997649433686516, 2.8487615495304452, 4.213882310518044, 3.222444411777674, 1.8317024071051975, 0.768906004838472, 0.0), # 117
(11.057156695182252, 8.414452328694855, 9.138597058008367, 9.6412294693983, 8.411143443092673, 3.980591001790297, 3.583814665787589, 3.0177543304350483, 4.307899243825574, 1.7633806790924282, 1.3727877032518847, 0.811439115937335, 0.0, 11.271954688054828, 8.925830275310684, 6.863938516259424, 5.290142037277283, 8.615798487651148, 4.224856062609067, 3.583814665787589, 2.843279286993069, 4.205571721546336, 3.213743156466101, 1.8277194116016737, 0.7649502116995325, 0.0), # 118
(11.02145630033369, 8.3714995145724, 9.118747846105723, 9.615240551890535, 8.394263188271376, 3.973051388760183, 3.5680847748904534, 3.0107832349080725, 4.300863967018017, 1.757107826478112, 1.3681445371513656, 0.8090681565621435, 0.0, 11.247987206075917, 8.899749722183577, 6.840722685756828, 5.271323479434335, 8.601727934036035, 4.215096528871301, 3.5680847748904534, 2.8378938491144163, 4.197131594135688, 3.2050801839635126, 1.8237495692211447, 0.761045410415673, 0.0), # 119
(10.985450507910194, 8.329041189592374, 9.098924988492762, 9.589318797264655, 8.377099757566796, 3.965628007568476, 3.5525479877941515, 3.0041123908996714, 4.293969975815023, 1.7509221049127721, 1.3635708218984832, 0.8067148294933297, 0.0, 11.223717607587115, 8.873863124426626, 6.817854109492416, 5.252766314738315, 8.587939951630046, 4.20575734725954, 3.5525479877941515, 2.8325914339774827, 4.188549878783398, 3.1964395990882193, 1.8197849976985525, 0.7571855626902159, 0.0), # 120
(10.949095678979122, 8.287010932491311, 9.079089073844187, 9.56341651997559, 8.359629051973535, 3.9583015355313718, 3.5371770216155882, 2.9977185783086533, 4.2871975498573995, 1.7448109568796892, 1.3590568579286233, 0.8043745376954222, 0.0, 11.199109540282393, 8.848119914649644, 6.795284289643115, 5.234432870639067, 8.574395099714799, 4.196806009632114, 3.5371770216155882, 2.8273582396652652, 4.179814525986767, 3.1878055066585307, 1.8158178147688375, 0.753364630226483, 0.0), # 121
(10.912348174607825, 8.245342322005756, 9.059200690834711, 9.537486034478269, 8.341826972486187, 3.951052649965064, 3.5219445934716704, 2.9915785770338243, 4.2805269687859555, 1.7387618248621435, 1.3545929456771704, 0.8020426841329501, 0.0, 11.174126651855724, 8.82246952546245, 6.772964728385852, 5.216285474586429, 8.561053937571911, 4.1882100078473545, 3.5219445934716704, 2.8221804642607595, 4.170913486243093, 3.1791620114927572, 1.8118401381669422, 0.7495765747277962, 0.0), # 122
(10.875164355863662, 8.20396893687225, 9.039220428139036, 9.511479655227625, 8.323669420099352, 3.9438620281857477, 3.506823420479303, 2.9856691669739917, 4.273938512241501, 1.7327621513434166, 1.3501693855795087, 0.7997146717704421, 0.0, 11.148732590001085, 8.796861389474863, 6.750846927897544, 5.1982864540302485, 8.547877024483002, 4.1799368337635885, 3.506823420479303, 2.8170443058469625, 4.161834710049676, 3.170493218409209, 1.8078440856278073, 0.7458153578974774, 0.0), # 123
(10.837500583813984, 8.162824355827334, 9.01910887443187, 9.485349696678588, 8.30513229580763, 3.9367103475096172, 3.4917862197553915, 2.979967128027963, 4.267412459864846, 1.7267993788067886, 1.345776478071024, 0.7973859035724276, 0.0, 11.122891002412453, 8.771244939296702, 6.728882390355119, 5.180398136420364, 8.534824919729692, 4.171953979239149, 3.4917862197553915, 2.8119359625068694, 4.152566147903815, 3.1617832322261967, 1.803821774886374, 0.7420749414388487, 0.0), # 124
(10.79931321952615, 8.121842157607551, 8.998826618387923, 9.459048473286083, 8.286191500605618, 3.9295782852528696, 3.4768057084168436, 2.9744492400945455, 4.260929091296797, 1.7208609497355405, 1.3414045235871004, 0.7950517825034348, 0.0, 11.096565536783794, 8.745569607537782, 6.707022617935502, 5.16258284920662, 8.521858182593594, 4.164228936132364, 3.4768057084168436, 2.806841632323478, 4.143095750302809, 3.153016157762029, 1.799765323677585, 0.7383492870552321, 0.0), # 125
(10.760558624067514, 8.080955920949442, 8.978334248681898, 9.432528299505048, 8.266822935487914, 3.9224465187316975, 3.461854603580562, 2.969092283072546, 4.254468686178167, 1.7149343066129532, 1.3370438225631227, 0.7927077115279934, 0.0, 11.069719840809094, 8.719784826807926, 6.685219112815614, 5.144802919838858, 8.508937372356334, 4.156729196301565, 3.461854603580562, 2.801747513379784, 4.133411467743957, 3.144176099835017, 1.79566684973638, 0.7346323564499494, 0.0), # 126
(10.721193158505432, 8.040099224589545, 8.957592353988504, 9.405741489790408, 8.247002501449117, 3.915295725262296, 3.4469056223634564, 2.9638730368607726, 4.248011524149763, 1.7090068919223076, 1.3326846754344757, 0.7903490936106315, 0.0, 11.042317562182317, 8.693840029716947, 6.6634233771723785, 5.127020675766921, 8.496023048299525, 4.149422251605082, 3.4469056223634564, 2.7966398037587825, 4.1235012507245585, 3.1352471632634704, 1.7915184707977012, 0.7309181113263225, 0.0), # 127
(10.681173183907255, 7.999205647264407, 8.93656152298245, 9.3786403585971, 8.226706099483831, 3.908106582160861, 3.431931481882429, 2.958768281358031, 4.241537884852393, 1.703066148146884, 1.328317382636545, 0.7879713317158789, 0.0, 11.014322348597444, 8.667684648874667, 6.641586913182724, 5.109198444440651, 8.483075769704786, 4.1422755939012434, 3.431931481882429, 2.791504701543472, 4.1133530497419155, 3.1262134528657004, 1.7873123045964903, 0.7272005133876734, 0.0), # 128
(10.640455061340337, 7.958208767710564, 8.91520234433844, 9.351177220380043, 8.205909630586648, 3.9008597667435865, 3.4169048992543876, 2.95375479646313, 4.235028047926869, 1.697099517769964, 1.3239322446047141, 0.7855698288082636, 0.0, 10.985697847748446, 8.641268116890899, 6.619661223023571, 5.0912985533098905, 8.470056095853739, 4.135256715048382, 3.4169048992543876, 2.7863284048168473, 4.102954815293324, 3.117059073460015, 1.783040468867688, 0.7234735243373241, 0.0), # 129
(10.598995151872039, 7.917042164664562, 8.893475406731179, 9.323304389594178, 8.18458899575217, 3.893535956326666, 3.4017985915962377, 2.948809362074875, 4.228462293014, 1.6910944432748274, 1.3195195617743691, 0.7831399878523152, 0.0, 10.956407707329298, 8.614539866375466, 6.5975978088718445, 5.073283329824481, 8.456924586028, 4.128333106904826, 3.4017985915962377, 2.781097111661904, 4.092294497876085, 3.1077681298647266, 1.7786950813462359, 0.7197311058785967, 0.0), # 130
(10.556749816569713, 7.8756394168629384, 8.87134129883538, 9.294974180694428, 8.162720095974995, 3.886115828226296, 3.3865852760248853, 2.943908758092075, 4.221820899754594, 1.685038367144756, 1.3150696345808937, 0.7806772118125626, 0.0, 10.926415575033973, 8.587449329938186, 6.575348172904468, 5.055115101434266, 8.443641799509187, 4.121472261328905, 3.3865852760248853, 2.77579702016164, 4.081360047987498, 3.0983247268981433, 1.7742682597670765, 0.7159672197148127, 0.0), # 131
(10.51367541650071, 7.833934103042237, 8.848760609325746, 9.266138908135728, 8.140278832249722, 3.878580059758672, 3.3712376696572353, 2.9390297644135366, 4.215084147789462, 1.6789187318630299, 1.310572763459673, 0.7781769036535342, 0.0, 10.89568509855645, 8.559945940188875, 6.552863817298364, 5.0367561955890885, 8.430168295578923, 4.114641670178951, 3.3712376696572353, 2.770414328399051, 4.070139416124861, 3.088712969378577, 1.7697521218651495, 0.7121758275492944, 0.0), # 132
(10.469728312732395, 7.791859801938998, 8.825693926876983, 9.236750886373006, 8.117241105570947, 3.870909328239987, 3.3557284896101933, 2.934149160938066, 4.2082323167594105, 1.67272297991293, 1.306019248846092, 0.7756344663397593, 0.0, 10.864179925590703, 8.531979129737351, 6.53009624423046, 5.018168939738788, 8.416464633518821, 4.107808825313293, 3.3557284896101933, 2.764935234457133, 4.058620552785474, 3.078916962124336, 1.765138785375397, 0.7083508910853636, 0.0), # 133
(10.424864866332113, 7.749350092289764, 8.802101840163804, 9.206762429861191, 8.093582816933273, 3.863084310986436, 3.3400304530006673, 2.929243727564472, 4.201245686305251, 1.6664385537777375, 1.3013993911755357, 0.7730453028357667, 0.0, 10.831863703830699, 8.503498331193432, 6.506996955877678, 4.9993156613332115, 8.402491372610502, 4.100941218590261, 3.3400304530006673, 2.7593459364188826, 4.046791408466636, 3.0689208099537315, 1.7604203680327608, 0.7044863720263422, 0.0), # 134
(10.379041438367224, 7.706338552831077, 8.777944937860909, 9.17612585305522, 8.069279867331296, 3.8550856853142146, 3.3241162769455603, 2.92429024419156, 4.194104536067791, 1.6600528959407332, 1.2967034908833885, 0.7704048161060852, 0.0, 10.798700080970423, 8.474452977166937, 6.483517454416942, 4.980158687822199, 8.388209072135583, 4.094006341868184, 3.3241162769455603, 2.753632632367296, 4.034639933665648, 3.0587086176850744, 1.755588987572182, 0.7005762320755525, 0.0), # 135
(10.332214389905081, 7.6627587622994735, 8.753183808643008, 9.144793470410015, 8.044308157759612, 3.8468941285395175, 3.3079586785617807, 2.9192654907181383, 4.186789145687842, 1.653553448885197, 1.2919218484050357, 0.7677084091152441, 0.0, 10.764652704703844, 8.444792500267685, 6.459609242025177, 4.96066034665559, 8.373578291375685, 4.086971687005394, 3.3079586785617807, 2.7477815203853697, 4.022154078879806, 3.0482644901366727, 1.750636761728602, 0.6966144329363159, 0.0), # 136
(10.28434008201304, 7.618544299431501, 8.72777904118481, 9.112717596380511, 8.018643589212827, 3.838490317978539, 3.291530374966233, 2.9141462470430146, 4.179279794806213, 1.6469276550944107, 1.2870447641758613, 0.764951484827772, 0.0, 10.729685222724932, 8.41446633310549, 6.435223820879306, 4.940782965283231, 8.358559589612426, 4.079804745860221, 3.291530374966233, 2.741778798556099, 4.0093217946064135, 3.037572532126838, 1.7455558082369622, 0.6925949363119547, 0.0), # 137
(10.235374875758456, 7.573628742963698, 8.701691224161017, 9.079850545421637, 7.992262062685534, 3.8298549309474748, 3.2748040832758227, 2.908909293064995, 4.1715567630637125, 1.6401629570516543, 1.2820625386312503, 0.7621294462081979, 0.0, 10.693761282727667, 8.383423908290176, 6.410312693156252, 4.920488871154961, 8.343113526127425, 4.0724730102909925, 3.2748040832758227, 2.735610664962482, 3.996131031342767, 3.02661684847388, 1.7403382448322038, 0.6885117039057909, 0.0), # 138
(10.185275132208682, 7.527945671632606, 8.67488094624634, 9.046144631988323, 7.965139479172331, 3.8209686447625186, 3.2577525206074553, 2.903531408682887, 4.163600330101148, 1.6332467972402094, 1.276965472206588, 0.7592376962210506, 0.0, 10.656844532406023, 8.351614658431556, 6.38482736103294, 4.899740391720627, 8.327200660202296, 4.064943972156042, 3.2577525206074553, 2.729263317687513, 3.9825697395861654, 3.0153815439961082, 1.7349761892492683, 0.6843586974211461, 0.0), # 139
(10.133997212431076, 7.481428664174767, 8.647308796115487, 9.011552170535499, 7.937251739667823, 3.811812136739866, 3.240348404078038, 2.897989373795498, 4.155390775559333, 1.626166618143356, 1.2717438653372588, 0.7562716378308593, 0.0, 10.618898619453978, 8.31898801613945, 6.358719326686294, 4.878499854430067, 8.310781551118666, 4.0571851233136975, 3.240348404078038, 2.7227229548141896, 3.9686258698339114, 3.003850723511834, 1.7294617592230976, 0.6801298785613425, 0.0), # 140
(10.081497477492995, 7.4340112993267216, 8.61893536244316, 8.976025475518098, 7.908574745166602, 3.802366084195711, 3.222564450804477, 2.892259968301635, 4.146908379079072, 1.6189098622443758, 1.2663880184586478, 0.7532266740021526, 0.0, 10.579887191565495, 8.285493414023676, 6.331940092293238, 4.856729586733126, 8.293816758158144, 4.049163955622289, 3.222564450804477, 2.7159757744255075, 3.954287372583301, 2.9920084918393663, 1.7237870724886322, 0.675819209029702, 0.0), # 141
(10.027732288461786, 7.385627155825012, 8.58972123390407, 8.939516861391049, 7.879084396663268, 3.792611164446249, 3.2043733779036754, 2.8863199721001056, 4.138133420301177, 1.6114639720265487, 1.2608882320061394, 0.7500982076994595, 0.0, 10.539773896434559, 8.251080284694053, 6.304441160030697, 4.834391916079644, 8.276266840602354, 4.040847960940148, 3.2043733779036754, 2.7090079746044635, 3.939542198331634, 2.9798389537970165, 1.7179442467808141, 0.6714206505295467, 0.0), # 142
(9.972658006404808, 7.336209812406179, 8.559626999172925, 8.901978642609278, 7.848756595152423, 3.7825280548076745, 3.185747902492541, 2.880146165089716, 4.129046178866458, 1.6038163899731561, 1.2552348064151186, 0.746881641887309, 0.0, 10.49852238175514, 8.215698060760397, 6.276174032075593, 4.811449169919467, 8.258092357732917, 4.032204631125603, 3.185747902492541, 2.701805753434053, 3.9243782975762116, 2.967326214203093, 1.7119253998345851, 0.6669281647641981, 0.0), # 143
(9.916230992389421, 7.285692847806764, 8.528613246924428, 8.86336313362772, 7.817567241628662, 3.772097432596183, 3.1666607416879793, 2.8737153271692746, 4.119626934415724, 1.5959545585674784, 1.2494180421209704, 0.7435723795302299, 0.0, 10.456096295221217, 8.179296174832528, 6.247090210604851, 4.787863675702434, 8.239253868831447, 4.023201458036985, 3.1666607416879793, 2.6943553089972734, 3.908783620814331, 2.954454377875907, 1.7057226493848856, 0.6623357134369786, 0.0), # 144
(9.858407607482972, 7.234009840763308, 8.496640565833289, 8.823622648901305, 7.785492237086586, 3.7612999751279688, 3.147084612606896, 2.867004238237588, 4.109855966589781, 1.5878659202927967, 1.2434282395590792, 0.7401658235927514, 0.0, 10.41245928452676, 8.141824059520264, 6.217141197795395, 4.763597760878389, 8.219711933179562, 4.013805933532623, 3.147084612606896, 2.6866428393771202, 3.892746118543293, 2.9412075496337686, 1.699328113166658, 0.6576372582512099, 0.0), # 145
(9.79914421275282, 7.181094370012356, 8.463669544574216, 8.782709502884963, 7.752507482520793, 3.750116359719226, 3.126992232366198, 2.8599896781934633, 4.099713555029442, 1.5795379176323916, 1.2372556991648298, 0.7366573770394019, 0.0, 10.367574997365741, 8.103231147433421, 6.186278495824149, 4.738613752897173, 8.199427110058885, 4.0039855494708485, 3.126992232366198, 2.67865454265659, 3.8762537412603963, 2.927569834294988, 1.6927339089148434, 0.6528267609102142, 0.0), # 146
(9.73839716926632, 7.126880014290443, 8.42966077182191, 8.740576010033621, 7.71858887892588, 3.7385272636861506, 3.1063563180827884, 2.8526484269357075, 4.0891799793755155, 1.570957993069544, 1.2308907213736073, 0.7330424428347111, 0.0, 10.321407081432142, 8.06346687118182, 6.154453606868036, 4.712873979208631, 8.178359958751031, 3.9937077977099906, 3.1063563180827884, 2.670376616918679, 3.85929443946294, 2.9135253366778744, 1.6859321543643822, 0.6478981831173131, 0.0), # 147
(9.676122838090825, 7.071300352334116, 8.394574836251083, 8.697174484802217, 7.6837123272964485, 3.726513364344937, 3.085149586873576, 2.8449572643631287, 4.078235519268811, 1.5621135890875346, 1.2243236066207965, 0.729316423943207, 0.0, 10.27391918441993, 8.022480663375276, 6.1216180331039824, 4.686340767262602, 8.156471038537623, 3.9829401701083804, 3.085149586873576, 2.6617952602463837, 3.8418561636482242, 2.899058161600739, 1.6789149672502168, 0.6428454865758287, 0.0), # 148
(9.612277580293695, 7.014288962879912, 8.358372326536443, 8.652457241645672, 7.647853728627096, 3.71405533901178, 3.0633447558554643, 2.8368929703745334, 4.0668604543501345, 1.5529921481696445, 1.2175446553417821, 0.7254747233294191, 0.0, 10.225074954023084, 7.980221956623609, 6.08772327670891, 4.658976444508932, 8.133720908700269, 3.971650158524347, 3.0633447558554643, 2.6528966707226997, 3.823926864313548, 2.8841524138818913, 1.671674465307289, 0.637662632989083, 0.0), # 149
(9.546817756942277, 6.955779424664377, 8.321013831352694, 8.606376595018924, 7.610988983912421, 3.7011338650028747, 3.04091454214536, 2.828432324868728, 4.0550350642603, 1.5435811127991534, 1.2105441679719486, 0.7215127439578762, 0.0, 10.174838037935576, 7.936640183536638, 6.0527208398597425, 4.630743338397459, 8.1100701285206, 3.95980525481622, 3.04091454214536, 2.6436670464306244, 3.8054944919562104, 2.8687921983396416, 1.6642027662705388, 0.632343584060398, 0.0), # 150
(9.47969972910393, 6.895705316424048, 8.282459939374542, 8.558884859376896, 7.573093994147021, 3.6877296196344136, 3.01783166286017, 2.8195521077445216, 4.042739628640115, 1.5338679254593437, 1.203312444946681, 0.7174258887931072, 0.0, 10.123172083851381, 7.891684776724178, 6.016562224733405, 4.601603776378029, 8.08547925728023, 3.9473729508423303, 3.01783166286017, 2.6340925854531525, 3.7865469970735104, 2.8529616197922993, 1.6564919878749085, 0.6268823014930954, 0.0), # 151
(9.41087985784601, 6.83400021689547, 8.242671239276701, 8.509934349174525, 7.534144660325495, 3.6738232802225945, 2.9940688351167988, 2.8102290989007206, 4.029954427130388, 1.5238400286334952, 1.1958397867013644, 0.713209560799641, 0.0, 10.070040739464476, 7.84530516879605, 5.979198933506821, 4.5715200859004845, 8.059908854260776, 3.9343207384610093, 2.9940688351167988, 2.6241594858732817, 3.7670723301627476, 2.836644783058176, 1.6485342478553402, 0.6212727469904974, 0.0), # 152
(9.340314504235872, 6.770597704815181, 8.201608319733868, 8.459477378866739, 7.4941168834424445, 3.659395524083611, 2.9695987760321514, 2.800440078236131, 4.016659739371929, 1.513484864804889, 1.1881164936713833, 0.7088591629420063, 0.0, 10.015407652468832, 7.797450792362069, 5.940582468356916, 4.5404545944146655, 8.033319478743858, 3.9206161095305836, 2.9695987760321514, 2.6138539457740078, 3.7470584417212223, 2.81982579295558, 1.6403216639467737, 0.6155088822559257, 0.0), # 153
(9.267960029340873, 6.705431358919725, 8.159231769420758, 8.407466262908468, 7.4529865644924636, 3.644427028533658, 2.944394202723137, 2.7901618256495615, 4.002835845005546, 1.5027898764568062, 1.1801328662921224, 0.7043700981847325, 0.0, 9.959236470558428, 7.748071080032056, 5.900664331460612, 4.508369629370417, 8.005671690011091, 3.9062265559093863, 2.944394202723137, 2.603162163238327, 3.7264932822462318, 2.802488754302823, 1.631846353884152, 0.6095846689927024, 0.0), # 154
(9.193772794228362, 6.638434757945644, 8.115502177012075, 8.35385331575464, 7.4107296044701565, 3.62889847088893, 2.9184278323066564, 2.779371121039818, 3.988463023672051, 1.4917425060725265, 1.1718792049989668, 0.6997377694923482, 0.0, 9.901490841427231, 7.6971154644158295, 5.859396024994833, 4.4752275182175785, 7.976926047344102, 3.8911195694557454, 2.9184278323066564, 2.5920703363492357, 3.7053648022350782, 2.7846177719182137, 1.6231004354024152, 0.6034940689041496, 0.0), # 155
(9.117709159965697, 6.569541480629476, 8.070380131182526, 8.298590851860187, 7.367321904370117, 3.612790528465623, 2.8916723818996197, 2.7680447443057092, 3.9735215550122502, 1.480330196135332, 1.163345810227301, 0.6949575798293822, 0.0, 9.842134412769221, 7.644533378123204, 5.816729051136504, 4.440990588405995, 7.9470431100245005, 3.875262642027993, 2.8916723818996197, 2.5805646631897305, 3.6836609521850585, 2.766196950620063, 1.6140760262365055, 0.5972310436935888, 0.0), # 156
(9.039725487620235, 6.498685105707764, 8.023826220606818, 8.241631185680044, 7.322739365186948, 3.59608387857993, 2.864100568618931, 2.756159475346041, 3.957991718666955, 1.4685403891285025, 1.1545229824125098, 0.6900249321603636, 0.0, 9.781130832278372, 7.590274253763999, 5.772614912062549, 4.405621167385506, 7.91598343733391, 3.8586232654844577, 2.864100568618931, 2.568631341842807, 3.661369682593474, 2.7472103952266815, 1.6047652441213638, 0.5907895550643424, 0.0), # 157
(8.957617135686286, 6.424498432849483, 7.973591953902356, 8.180792623486118, 7.274944884696797, 3.5777171334219773, 2.8350640325567142, 2.742898476174686, 3.9406648366396384, 1.4560097748873433, 1.1451191505077887, 0.6847599564194339, 0.0, 9.715783031298415, 7.532359520613772, 5.7255957525389425, 4.368029324662029, 7.881329673279277, 3.840057866644561, 2.8350640325567142, 2.555512238158555, 3.6374724423483986, 2.7269308744953733, 1.5947183907804712, 0.5840453120772259, 0.0), # 158
(8.858744120374082, 6.3393718515594255, 7.906737818402987, 8.103579442909608, 7.212153047825302, 3.551582753604972, 2.8009276580314295, 2.7236067663821912, 3.9145709044888575, 1.4406842982296237, 1.133483387123799, 0.6781362523683109, 0.0, 9.630513176304232, 7.459498776051419, 5.667416935618994, 4.322052894688871, 7.829141808977715, 3.813049472935068, 2.8009276580314295, 2.5368448240035515, 3.606076523912651, 2.7011931476365363, 1.5813475636805976, 0.5763065319599479, 0.0), # 159
(8.741846513885172, 6.242606401394785, 7.821920957955889, 8.008719759367974, 7.133136105077435, 3.517038907233379, 2.7613462490302703, 2.6977995947636733, 3.8789700908914604, 1.4223616955588683, 1.119451901721908, 0.6700501948887847, 0.0, 9.523704730672296, 7.370552143776631, 5.59725950860954, 4.267085086676604, 7.757940181782921, 3.7769194326691427, 2.7613462490302703, 2.512170648023842, 3.5665680525387176, 2.669573253122658, 1.5643841915911778, 0.5675096728540715, 0.0), # 160
(8.607866465503152, 6.134832954888515, 7.7200469719103095, 7.897115253381055, 7.038714499425689, 3.4745040690992197, 2.716608867604126, 2.66580026655489, 3.8343319067996067, 1.4011974579512814, 1.1031483309199415, 0.6605767468907572, 0.0, 9.396448853782916, 7.266344215798328, 5.515741654599707, 4.203592373853843, 7.668663813599213, 3.7321203731768464, 2.716608867604126, 2.481788620785157, 3.5193572497128445, 2.632371751127019, 1.5440093943820619, 0.557712086808047, 0.0), # 161
(8.457746124511628, 6.016682384573562, 7.602021459615496, 7.769667605468694, 6.929708673842563, 3.424396713994519, 2.6670045758038854, 2.627932086991601, 3.781125863165454, 1.3773470764830695, 1.0846963113357242, 0.6497908712841294, 0.0, 9.2498367050164, 7.147699584125422, 5.42348155667862, 4.132041229449208, 7.562251726330908, 3.6791049217882414, 2.6670045758038854, 2.4459976528532277, 3.4648543369212814, 2.5898892018228983, 1.5204042919230993, 0.5469711258703239, 0.0), # 162
(8.292427640194196, 5.888785562982875, 7.468750020420702, 7.6272784961507405, 6.806939071300549, 3.367135316711301, 2.61282243568044, 2.5845183613095624, 3.719821470941162, 1.3509660422304377, 1.0642194795870819, 0.6377675309788032, 0.0, 9.084959443753055, 7.015442840766835, 5.321097397935408, 4.052898126691312, 7.439642941882324, 3.6183257058333878, 2.61282243568044, 2.405096654793786, 3.4034695356502747, 2.5424261653835805, 1.4937500040841403, 0.5353441420893524, 0.0), # 163
(8.11285316183446, 5.751773362649402, 7.321138253675176, 7.470849605947036, 6.67122613477215, 3.3031383520415907, 2.5543515092846794, 2.5358823947445344, 3.650888241078889, 1.3222098462695906, 1.0418414722918394, 0.6245816888846804, 0.0, 8.902908229373192, 6.870398577731482, 5.209207361459196, 3.966629538808771, 7.301776482157778, 3.550235352642348, 2.5543515092846794, 2.3593845371725646, 3.335613067386075, 2.4902832019823458, 1.4642276507350354, 0.5228884875135821, 0.0), # 164
(7.9199648387160195, 5.606276656106095, 7.160091758728169, 7.301282615377426, 6.5233903072298585, 3.2328242947774104, 2.491880858667493, 2.482347492532273, 3.5747956845307916, 1.2912339796767343, 1.0176859260678224, 0.610308307911662, 0.0, 8.704774221257123, 6.713391387028281, 5.088429630339111, 3.873701939030202, 7.149591369061583, 3.4752864895451823, 2.491880858667493, 2.309160210555293, 3.2616951536149292, 2.433760871792476, 1.432018351745634, 0.5096615141914632, 0.0), # 165
(7.714704820122476, 5.452926315885899, 6.9865161349289275, 7.119479204961751, 6.364252031646171, 3.156611619710786, 2.4256995458797714, 2.4242369599085385, 3.492013312249029, 1.2581939335280738, 0.9918764775328559, 0.5950223509696502, 0.0, 8.491648578785155, 6.545245860666151, 4.959382387664279, 3.7745818005842207, 6.984026624498058, 3.393931743871954, 2.4256995458797714, 2.254722585507704, 3.1821260158230853, 2.373159734987251, 1.3973032269857855, 0.4957205741714455, 0.0), # 166
(7.498015255337426, 5.292353214521765, 6.801316981626705, 6.926341055219858, 6.194631750993583, 3.074918801633741, 2.3560966329724047, 2.361874102109088, 3.403010635185759, 1.2232451988998143, 0.9645367633047655, 0.5787987809685459, 0.0, 8.264622461337595, 6.366786590654004, 4.822683816523827, 3.669735596699442, 6.806021270371518, 3.3066237429527234, 2.3560966329724047, 2.196370572595529, 3.0973158754967915, 2.308780351739953, 1.360263396325341, 0.4811230195019787, 0.0), # 167
(7.2708382936444735, 5.125188224546641, 6.605399898170748, 6.722769846671591, 6.015349908244593, 2.9881643153382993, 2.2833611819962822, 2.2955822243696797, 3.308257164293142, 1.1865432668681617, 0.9357904200013762, 0.5617125608182512, 0.0, 8.024787028294753, 6.178838169000762, 4.678952100006881, 3.559629800604484, 6.616514328586284, 3.2138151141175517, 2.2833611819962822, 2.1344030823844995, 3.0076749541222965, 2.2409232822238643, 1.3210799796341497, 0.46592620223151293, 0.0), # 168
(7.034116084327218, 4.952062218493477, 6.399670483910309, 6.509667259836794, 5.827226946371695, 2.8967666356164865, 2.2077822550022947, 2.2256846319260726, 3.2082224105233346, 1.1482436285093212, 0.9057610842405137, 0.5438386534286673, 0.0, 7.773233439036942, 5.982225187715339, 4.528805421202568, 3.444730885527963, 6.416444821046669, 3.1159584846965016, 2.2077822550022947, 2.0691190254403473, 2.9136134731858476, 2.1698890866122653, 1.2799340967820618, 0.450187474408498, 0.0), # 169
(6.78879077666926, 4.773606068895221, 6.185034338194635, 6.2879349752353075, 5.631083308347386, 2.8011442372603246, 2.1296489140413315, 2.1525046300140236, 3.103375884828495, 1.1085017748994974, 0.8745723926400033, 0.525252021709696, 0.0, 7.5110528529444665, 5.777772238806654, 4.372861963200016, 3.325505324698492, 6.20675176965699, 3.013506482019633, 2.1296489140413315, 2.0008173123288033, 2.815541654173693, 2.0959783250784363, 1.2370068676389272, 0.4339641880813838, 0.0), # 170
(6.5358045199542, 4.59045064828482, 5.962397060372978, 6.058474673386982, 5.427739437144163, 2.701715595061839, 2.049250221164283, 2.0763655238692915, 2.994187098160782, 1.0674731971148967, 0.8423479818176697, 0.5060276285712387, 0.0, 7.239336429397638, 5.566303914283624, 4.211739909088348, 3.2024195913446896, 5.988374196321564, 2.906911733417008, 2.049250221164283, 1.9297968536155994, 2.7138697185720817, 2.019491557795661, 1.1924794120745956, 0.4173136952986201, 0.0), # 171
(6.276099463465638, 4.403226829195226, 5.7326642497945866, 5.822188034811656, 5.218015775734522, 2.5988991838130535, 1.9668752384220392, 1.9975906187276353, 2.881125561472354, 1.025313386231724, 0.8092114883913387, 0.4862404369231972, 0.0, 6.959175327776763, 5.348644806155168, 4.046057441956694, 3.075940158695172, 5.762251122944708, 2.7966268662186895, 1.9668752384220392, 1.8563565598664666, 2.609007887867261, 1.9407293449372194, 1.1465328499589174, 0.40029334810865697, 0.0), # 172
(6.010617756487176, 4.212565484159386, 5.4967415058087115, 5.579976740029178, 5.002732767090961, 2.4931134783059927, 1.8828130278654898, 1.916503219824812, 2.7646607857153684, 0.9821778333261846, 0.7752865489788355, 0.4659654096754725, 0.0, 6.671660707462155, 5.125619506430197, 3.8764327448941778, 2.9465334999785533, 5.529321571430737, 2.6831045077547366, 1.8828130278654898, 1.7807953416471376, 2.5013663835454807, 1.859992246676393, 1.0993483011617424, 0.38296049855994424, 0.0), # 173
(5.740301548302412, 4.019097485710249, 5.2555344277646014, 5.332742469559387, 4.782710854185972, 2.3847769533326795, 1.7973526515455251, 1.8334266323965802, 2.645262281841985, 0.9382220294744842, 0.7406968001979856, 0.44527750973796687, 0.0, 6.37788372783412, 4.898052607117634, 3.7034840009899272, 2.814666088423452, 5.29052456368397, 2.5667972853552126, 1.7973526515455251, 1.7034121095233423, 2.391355427092986, 1.7775808231864625, 1.0511068855529204, 0.3653724987009318, 0.0), # 174
(5.466092988194946, 3.823453706380764, 5.009948615011508, 5.08138690392213, 4.558770479992055, 2.2743080836851397, 1.7107831715130346, 1.748684161678698, 2.5233995608043616, 0.8936014657528275, 0.7055658786666139, 0.4242517000205815, 0.0, 6.078935548272969, 4.666768700226395, 3.5278293933330693, 2.680804397258482, 5.046799121608723, 2.4481578263501773, 1.7107831715130346, 1.6245057740608142, 2.2793852399960275, 1.6937956346407106, 1.0019897230023018, 0.3475867005800695, 0.0), # 175
(5.188934225448382, 3.62626501870388, 4.760889666898678, 4.8268117236372525, 4.331732087481704, 2.1621253441553967, 1.6233936498189088, 1.6625991129069244, 2.3995421335546565, 0.8484716332374204, 0.670017421002546, 0.4029629434332179, 0.0, 5.7759073281590085, 4.432592377765396, 3.35008710501273, 2.5454148997122603, 4.799084267109313, 2.327638758069694, 1.6233936498189088, 1.5443752458252833, 2.165866043740852, 1.6089372412124179, 0.9521779333797357, 0.3296604562458073, 0.0), # 176
(4.909767409346319, 3.4281622952125463, 4.5092631827753635, 4.569918609224595, 4.102416119627418, 2.0486472095354746, 1.5354731485140374, 1.5754947913170163, 2.2741595110450277, 0.8029880230044676, 0.6341750638236071, 0.3814862028857779, 0.0, 5.4698902268725496, 4.196348231743556, 3.1708753191180357, 2.408964069013402, 4.548319022090055, 2.2056927078438227, 1.5354731485140374, 1.4633194353824817, 2.051208059813709, 1.5233062030748654, 0.9018526365550728, 0.31165111774659515, 0.0), # 177
(4.629534689172356, 3.2297764084397107, 4.255974761990814, 4.311609241204004, 3.8716430194016906, 1.9342921546173981, 1.4473107296493104, 1.4876945021447328, 2.147721204227634, 0.7573061261301752, 0.5981624437476226, 0.3598964412881627, 0.0, 5.161975403793902, 3.958860854169789, 2.9908122187381125, 2.271918378390525, 4.295442408455268, 2.082772303002626, 1.4473107296493104, 1.3816372532981414, 1.9358215097008453, 1.437203080401335, 0.8511949523981628, 0.29361603713088286, 0.0), # 178
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 179
)
passenger_allighting_rate = (
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 0
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 1
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 2
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 3
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 4
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 5
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 6
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 7
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 8
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 9
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 10
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 11
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 12
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 13
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 14
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 15
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 16
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 17
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 18
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 19
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 20
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 21
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 22
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 23
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 24
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 25
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 26
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 27
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 28
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 29
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 30
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 31
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 32
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 33
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 34
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 35
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 36
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 37
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 38
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 39
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 40
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 41
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 42
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 43
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 44
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 45
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 46
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 47
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 48
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 49
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 50
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 51
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 52
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 53
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 54
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 55
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 56
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 57
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 58
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 59
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 60
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 61
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 62
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 63
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 64
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 65
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 66
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 67
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 68
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 69
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 70
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 71
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 72
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 73
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 74
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 75
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 76
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 77
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 78
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 79
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 80
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 81
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 82
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 83
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 84
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 85
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 86
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 87
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 88
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 89
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 90
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 91
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 92
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 93
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 94
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 95
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 96
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 97
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 98
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 99
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 100
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 101
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 102
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 103
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 104
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 105
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 106
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 107
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 108
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 109
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 110
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 111
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 112
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 113
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 114
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 115
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 116
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 117
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 118
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 119
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 120
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 121
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 122
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 123
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 124
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 125
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 126
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 127
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 128
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 129
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 130
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 131
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 132
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 133
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 134
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 135
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 136
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 137
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 138
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 139
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 140
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 141
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 142
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 143
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 144
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 145
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 146
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 147
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 148
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 149
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 150
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 151
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 152
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 153
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 154
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 155
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 156
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 157
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 158
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 159
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 160
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 161
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 162
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 163
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 164
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 165
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 166
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 167
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 168
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 169
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 170
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 171
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 172
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 173
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 174
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 175
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 176
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 177
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 178
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 179
)
"""
parameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html
"""
#initial entropy
entropy = 8991598675325360468762009371570610170
#index for seed sequence child
child_seed_index = (
1, # 0
53, # 1
)
|
from sqlalchemy import Column, Integer, String, Sequence, Boolean, ForeignKey
from app.models.base import *
class Returns(Base):
__tablename__ = 'returns'
id = Column(Integer, primary_key=True)
returned = Column(Boolean)
date = Column(String(255))
tool_condition = Column(String(33000), nullable=False)
booking_id = Column(Integer, ForeignKey('booking.id'), nullable=False)
def __repr__(self):
return str(self.__dict__)
|
"""
Testing for the base all_in_bottom strategy class
"""
import pytest as pt
import pandas as pd
import lib.base_strategy as bs
from specific_strategies import all_in_bottom
from test_all_tests import get_test_data_path
def test_all_in_bottom_start_min():
"""
Test that having a min at the start returns expected results
"""
# Set default buy size to be 10k
starting_usd = 10000
# Seconds in a day
seconds_in_a_day = 60*60*24
# Number of days
days = 1
# Turns days into seconds
days = days*seconds_in_a_day
price_df = pd.read_csv(get_test_data_path('test_start_min_end_max'))
all_in_bottom_strategy = all_in_bottom.base_all_in_bottom(
starting_usd=starting_usd,
time_between_action=days,
price_period_name='test_start_min_end_max',
price_df=price_df,
save_results=False
)
all_in_bottom_strategy.run_logic()
# begin tests
# make sure we are at the end of the time period
assert all_in_bottom_strategy.current_time == all_in_bottom_strategy.price_df['timestamp'].values[-1]
assert all_in_bottom_strategy.current_index == all_in_bottom_strategy.price_df.index[-1]
# we should start with no USD left
assert all_in_bottom_strategy.returns_df['# of USD'].iloc[0] == 0
# we should always end up with no USD left
assert all_in_bottom_strategy.current_usd == 0
# make sure we end up with the expected amount of ETH
expected_eth = 297.6119
assert bs.unfrac(all_in_bottom_strategy.current_eth) == expected_eth
def test_all_in_bottom_end_max():
"""
Test that having a max at the end returns expected results
"""
# Set default buy size to be 10k
starting_usd = 10000
# Seconds in a day
seconds_in_a_day = 60*60*24
# Number of days
days = 1
# Turns days into seconds
days = days*seconds_in_a_day
price_df = pd.read_csv(get_test_data_path('test_start_max_end_min'))
all_in_bottom_strategy = all_in_bottom.base_all_in_bottom(
starting_usd=starting_usd,
time_between_action=days,
price_period_name='test_start_max_end_min',
price_df=price_df,
save_results=False
)
all_in_bottom_strategy.run_logic()
# begin tests
# make sure we are at the end of the time period
assert all_in_bottom_strategy.current_time == all_in_bottom_strategy.price_df['timestamp'].values[-1]
assert all_in_bottom_strategy.current_index == all_in_bottom_strategy.price_df.index[-1]
# we should always end up with no USD left
assert all_in_bottom_strategy.current_usd == 0
# make sure we end up with the expected amount of ETH
expected_eth = 297.6119
assert bs.unfrac(all_in_bottom_strategy.current_eth) == expected_eth
def test_all_in_bottom_middle_max():
"""
Test that having a max in the middle returns expected results
Uses test_month.csv as data.
"""
# Set default buy size to be 10k
starting_usd = 10000
# Seconds in a day
seconds_in_a_day = 60*60*24
# Number of days
days = .5
# Turns days into seconds
days = days*seconds_in_a_day
price_df = pd.read_csv(get_test_data_path('test_month'))
all_in_bottom_strategy = all_in_bottom.base_all_in_bottom(
starting_usd=starting_usd,
time_between_action=days,
price_period_name='test_month',
price_df=price_df,
save_results=False
)
all_in_bottom_strategy.run_logic()
# begin tests
# make sure we are at the end of the time period
assert all_in_bottom_strategy.current_time == all_in_bottom_strategy.price_df['timestamp'].values[-1]
assert all_in_bottom_strategy.current_index == all_in_bottom_strategy.price_df.index[-1]
# we should always end up with no USD left
assert all_in_bottom_strategy.current_usd == 0
# make sure we end up with the expected amount of ETH
expected_eth = 13.6629
assert bs.unfrac(all_in_bottom_strategy.current_eth) == expected_eth
if __name__ == "__main__":
pt.main(['tests/test_all_in_bottom.py'])
|
#!/usr/bin/env python
# Copyright 2017 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import sys
def main(argv):
with open(argv[2], 'w') as f:
f.write(argv[1])
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv))
|
import asyncio
import logging
import sys
from crawler.api import create_app
from crawler.config import Config
from structlog import get_logger
config = Config()
logging.basicConfig(
format="%(message)s", stream=sys.stdout, level=config.LOG_LEVEL.upper()
)
logger = get_logger()
logger.debug("config:", config=config)
loop = asyncio.get_event_loop()
app = create_app(config, loop)
|
import os
import re
from flaskr.models.file import createFile
from flaskr.models.word import createOrUpdateWord
class FileToDBService:
file_name = None
file_content = None
word_list = []
def setFileName(self, file_name):
self.file_name = file_name
def setFileContent(self, content):
self.file_content = content
def setWords(self):
if self.file_content is not None:
self.parseFileContent()
self.createDB()
def saveFromFile(self):
if self.file_name is not None:
self.readFile()
self.setWords()
self.removeFile()
def readFile(self):
file = open(self.file_name, "r")
self.file_content = file.read()
file.close()
def removeFile(self):
os.remove(self.file_name)
def parseFileContent(self):
self.word_list = re.sub(r'[^a-ząćęłńóśźżĄĆĘŁŃÓŚŹŻA-Z0-9\n ]', r'', self.file_content).split()
def createDB(self):
file = createFile(self.file_name)
for word in self.word_list:
if len(word) >= 2:
createOrUpdateWord(word=word, file=file)
|
import keras.applications as kapp
from keras.preprocessing.image import ImageDataGenerator
import os
import data_tools as dt
import numpy as np
import keras.utils
from keras.models import Model
from keras.layers.core import Dense
from keras.layers import GlobalAveragePooling2D
from keras_retinanet.preprocessing.csv_generator import CSVGenerator
from keras_retinanet.bin import train as kr_train
from keras_retinanet.callbacks import RedirectModel
from keras.callbacks import ModelCheckpoint
from keras.callbacks import TensorBoard
from keras.callbacks import ReduceLROnPlateau
from keras.models import load_model
import cv2
import pickle
class ModelConfig:
def __init__(self, model_type, input_shape, num_classes, weights, task='classification', backbone=None):
if task == 'classification':
self.model_struct = model_struct(model_type, input_shape, num_classes, weights)
elif task == 'detection':
if model_type == 'retinanet':
if backbone:
self.backbone = backbone
else:
print('No backbone given')
return
class TrainingConfig:
def __init__(self, model_type, ):
return
def model_param(model_type):
"""Returns compilation parameters for each model type"""
return {
'densenet121': (32,
'categorical_crossentropy',
'adam',
['accuracy']),
'densenet169': (32,
'categorical_crossentropy',
'adam',
['accuracy']),
'densenet201': (32,
'categorical_crossentropy',
'adam',
['accuracy']),
'mobilenet': (32,
'categorical_crossentropy',
'adam',
['accuracy']),
'mobilenetv2': (32,
'categorical_crossentropy',
'adam',
['accuracy']),
'nasnet': (32,
'categorical_crossentropy',
'adam',
['accuracy']),
'resnet50': (32,
'categorical_crossentropy',
'adam',
['accuracy']),
'vgg16': (32,
'categorical_crossentropy',
'adam',
['accuracy']),
'vgg19': (32,
'categorical_crossentropy',
'adam',
['accuracy']),
}[model_type]
def model_struct(model_type, input_shape, classes, weights=None, include_top=True):
"""
Initializes a model instance.
:param model_type:
:param input_shape:
:param classes: int Number of classes
:param weights: weights file for initialisation
:return: instance of /model_type/
"""
if model_type == 'densenet121':
return kapp.densenet.DenseNet121(include_top=include_top,
weights=weights,
input_tensor=None,
input_shape=input_shape,
pooling=None,
classes=classes)
elif model_type == 'densenet169':
return kapp.densenet.DenseNet169(include_top=include_top,
weights=weights,
input_tensor=None,
input_shape=input_shape,
pooling=None,
classes=classes)
elif model_type == 'densenet201':
return kapp.densenet.DenseNet201(include_top=include_top,
weights=weights,
input_tensor=None,
input_shape=input_shape,
pooling=None,
classes=classes)
elif model_type == 'mobilenet':
return kapp.mobilenet.MobileNet(include_top=include_top,
weights=weights,
input_tensor=None,
input_shape=input_shape,
pooling=None,
classes=classes)
elif model_type == 'mobilenetv2':
return kapp.mobilenet_v2.MobileNetV2(include_top=include_top,
weights=weights,
input_tensor=None,
input_shape=input_shape,
pooling=None,
classes=classes)
elif model_type == 'nasnet':
return kapp.nasnet.NASNetMobile(include_top=include_top,
weights=weights,
input_tensor=None,
input_shape=input_shape,
pooling=None,
classes=classes)
elif model_type == 'resnet50':
return kapp.resnet50.ResNet50(include_top=include_top,
weights=weights,
input_tensor=None,
input_shape=input_shape,
pooling=None,
classes=classes)
elif model_type == 'vgg16':
return kapp.vgg16.VGG16(include_top=include_top,
weights=weights,
input_tensor=None,
input_shape=input_shape,
pooling=None,
classes=classes)
elif model_type == 'vgg19':
return kapp.vgg19.VGG19(include_top=include_top,
weights=weights,
input_tensor=None,
input_shape=input_shape,
pooling=None,
classes=classes)
def load_imagenet_model(model_type):
"""
Loads an ImageNet model instance
:param model_type:
:return: Model instance and preprocess input function
"""
if model_type == 'densenet121':
return kapp.densenet.DenseNet121(), kapp.densenet.preprocess_input
elif model_type == 'densenet169':
return kapp.densenet.DenseNet169(), kapp.densenet.preprocess_input
elif model_type == 'densenet201':
return kapp.densenet.DenseNet201(), kapp.densenet.preprocess_input
elif model_type == 'mobilenet':
return kapp.mobilenet.MobileNet(), kapp.mobilenet.preprocess_input
elif model_type == 'mobilenetv2':
return kapp.mobilenet_v2.MobileNetV2(), kapp.mobilenet_v2.preprocess_input
elif model_type == 'nasnet':
return kapp.nasnet.NASNetMobile(), kapp.nasnet.preprocess_input
elif model_type == 'resnet50':
return kapp.resnet50.ResNet50(), kapp.resnet50.preprocess_input
elif model_type == 'vgg16':
return kapp.vgg16.VGG16(), kapp.vgg16.preprocess_input
elif model_type == 'vgg19':
return kapp.vgg19.VGG19(), kapp.vgg19.preprocess_input
# def format_data(train_data, test_data, num_classes):
# (x_train, y_train), (x_test, y_test) = train_data, test_data
# x_train = x_train.astype('float32')
# x_test = x_test.astype('float32')
# x_train /= 255
# x_test /= 255
# y_train = utils.to_categorical(y_train, num_classes)
# y_test = utils.to_categorical(y_test, num_classes)
# return (x_train, y_train), (x_test, y_test)
def train_and_save(model, epochs, data_augmentation, weight_file, train_data, val_data, batch_size, regression=False):
"""
Trains a model. Saves the best weights only cf. ModelCheckpoint callback.
:param model: Compiled model to train
:param epochs: int Number of epochs
:param data_augmentation: bool for real-time data augmentation
:param weight_file: name of the weight file
:param train_data:
:param val_data:
:param batch_size:
:param regression:
:return: None
"""
(x_train, y_train) = dt.format_data(train_data, 10)
(x_val, y_val) = dt.format_data(val_data, 10)
if regression:
# For regression
y_val = val_data[1]
y_train = train_data[1]
checkpoint = ModelCheckpoint(
weight_file,
monitor='val_acc',
verbose=0,
save_best_only=True,
save_weights_only=True,
mode='auto'
)
if not data_augmentation:
print('Not using data augmentation.')
model.fit(
x_train,
y_train,
batch_size=batch_size,
epochs=epochs,
validation_data=(x_val, y_val),
verbose=0,
shuffle=True,
callbacks=[checkpoint]
)
else:
print('Using real-time data augmentation.')
# This will do preprocessing and realtime data augmentation:
datagen = ImageDataGenerator(
featurewise_center=False, # set input mean to 0 over the dataset
samplewise_center=False, # set each sample mean to 0
featurewise_std_normalization=False, # divide inputs by dataset std
samplewise_std_normalization=False, # divide each input by its std
zca_whitening=False, # apply ZCA whitening
zca_epsilon=1e-06, # epsilon for ZCA whitening
rotation_range=0, # randomly rotate images in 0 to 180 degrees
width_shift_range=0.1, # randomly shift images horizontally
height_shift_range=0.1, # randomly shift images vertically
shear_range=0., # set range for random shear
zoom_range=0., # set range for random zoom
channel_shift_range=0., # set range for random channel shifts
# set mode for filling points outside the input boundaries
fill_mode='nearest',
cval=0., # value used for fill_mode = "constant"
horizontal_flip=True, # randomly flip images
vertical_flip=False, # randomly flip images
# set rescaling factor (applied before any other transformation)
rescale=None,
# set function that will be applied on each input
preprocessing_function=None,
# image data format, either "channels_first" or "channels_last"
data_format=None,
# fraction of images reserved for validation (strictly between 0 and 1)
validation_split=0.0)
# Compute quantities required for feature-wise normalization
# (std, mean, and principal components if ZCA whitening is applied).
datagen.fit(x_train)
# Fit the model on the batches generated by datagen.flow().
model.fit_generator(
datagen.flow(x_train, y_train, batch_size=batch_size),
epochs=epochs,
validation_data=(x_val, y_val),
workers=4,
verbose=0,
steps_per_epoch=(50000 / batch_size),
callbacks=[checkpoint]
)
# score = model.evaluate(x_val, y_val, verbose=0)
# print('Test loss:', score[0])
# print('Val accuracy:', score[1])
# model.save_weights(weight_file)
def weight_file_name(model_type, tag, epochs, data_augmentation, prefix='', suffix=''):
"""
Standard for weight file name
:param model_type:
:param tag:
:param epochs:
:param data_augmentation:
:param prefix:
:param suffix:
:return: Name of the weight file
"""
name = "_".join((model_type, tag, str(epochs)+'ep', 'wda' if data_augmentation else 'woda'))
if prefix:
name = prefix + "_" + name
if suffix:
name += "_" + suffix
print('###---> ' + name + ' <---###')
weight_file = name + '.h5'
return weight_file
def ft_weight_file_name(model_name, ft_data_augmentation, ft_epochs, nametag):
"""
Builds the model weight file's name according to parameters
:param model_name:
:param ft_data_augmentation: bool
:param ft_epochs: int Number of epochs
:param nametag: extra tag for version
:return: weight file's name
"""
if ft_data_augmentation is True:
# With DataAugmentation
ft_model_name = model_name + '_ftwda' + str(ft_epochs) + 'ep-' + nametag
else:
# WithOut DataAugmentation
ft_model_name = model_name + '_ftwoda' + str(ft_epochs) + 'ep-' + nametag
return ft_model_name
def load_by_name(model_name, input_shape, weight_file_path):
if model_state_exists(weight_file_path):
model_type = model_name.split('_')[0]
(m_batch_size, m_loss, m_optimizer, m_metric) = model_param(model_type)
model = model_struct(model_type, input_shape, 10)
model.load_weights(weight_file_path)
model.compile(loss=m_loss,
optimizer=m_optimizer,
metrics=m_metric)
return model
else:
raise IOError('File ' + weight_file_path + ' not found')
def model_state_exists(weight_file_path):
"""
Check for model version weights based on file name
:param weight_file_path: Name of the file
:return: bool True if the file exists
"""
return os.path.isfile(weight_file_path)
def train2(model_type, tr_data, val_data, epochs, data_augmentation, tag='', path='', weights_file=None):
"""
Instantiates and trains a model. First checks is it exists.
If weights is set, it loads the pre-trained state of the model (for fine tuning).
:param model_type:
:param tr_data: training data
:param val_data: validation data
:param epochs: number of training epochs
:param data_augmentation: bool for data_augmentation
:param tag: additional tag for the weight file's name
:param path: path for storing result weight file
:param weights_file: weights of previous model's state (for additional training)
:return: trained model instance and its weight file name without extension
"""
input_shape = tr_data[0].shape[1:]
if weights_file:
new_weights_file = weights_file.rstrip('.h5') + ('_ftwda' if data_augmentation else '_ftwoda') \
+ str(epochs) + 'ep-' + tag + '.h5'
else:
new_weights_file = weight_file_name(model_type, tag, epochs, data_augmentation)
model = model_struct(model_type, input_shape, 10)
(m_batch_size, m_loss, m_optimizer, m_metric) = model_param(model_type)
model.compile(loss=m_loss,
optimizer=m_optimizer,
metrics=m_metric)
print('*-> ' + path + new_weights_file)
if model_state_exists(path + new_weights_file):
model.load_weights(path + new_weights_file)
else:
if weights_file:
model.load_weights(path + weights_file)
train_and_save(model, epochs, data_augmentation, path + new_weights_file, tr_data, val_data, m_batch_size)
model.load_weights(path + new_weights_file) # Loading best state according to val_acc
# (x_val, y_val) = dt.format_data(val_data, 10)
# score = model.evaluate(x_val, y_val, verbose=0)
# print('Val loss:', score[0])
# print('Val acc:', score[1])
# model.summary()
return model, new_weights_file.rstrip('.h5')
def reg_from_(model, model_type):
"""
Builds a regression model from a classification model. Keeps the classification weights.
:param model: Classification model
:param model_type:
:return: a regression model pretrained with classification data.
"""
assert isinstance(model, Model)
input = model.input
model.layers.pop()
model.layers.pop()
x = GlobalAveragePooling2D()(model.layers[-1].output)
output = Dense(1, activation="linear")(x)
model = Model(input, output)
# model.summary()
(m_batch_size, m_loss, m_optimizer, m_metric) = model_param(model_type)
model.compile(loss=m_loss,
optimizer=m_optimizer,
metrics=m_metric)
return model
def train_reg(model, model_type, tr_data, val_data, tag, epochs, data_augmentation, path=''):
weight_file = weight_file_name(model_type, tag, epochs, data_augmentation, 'reg_')
input_shape = tr_data[0].shape[1:]
(m_batch_size, m_loss, m_optimizer, m_metric) = model_param(model_type)
model.compile(loss='mean_squared_error',
optimizer=m_optimizer,
metrics=m_metric)
print('*-> ' + path+weight_file)
if not os.path.isfile(path+weight_file):
# print('Start training')
train_and_save(model, epochs, data_augmentation, path + weight_file, tr_data, val_data, m_batch_size,
regression=True)
# print('Weight file found:' + path+weight_file + ', loading.')
model.load_weights(path + weight_file)
model.compile(loss='mean_squared_error',
optimizer=m_optimizer,
metrics=m_metric)
X_val, y_val = val_data
X_val = X_val.astype('float32')
X_val /= 255
score = model.evaluate(X_val, y_val, verbose=0)
# print('Test loss:', score[0])
print('Val accuracy:', score[1])
# model.summary()
return model, weight_file.strip('.h5')
def ft(model_filepath, ft_gen, val_gen, epochs, save_history=False, tag=''):
h5_path = '../res/h5/'
tb_path = '../res/logs/'
# finetune
model_file = model_filepath.split("/")[-1]
extension = model_filepath.split(".")[-1]
print("Fine-tuning " + model_file)
model = load_model(model_filepath)
model.compile('adam',
loss='categorical_crossentropy',
metrics=['accuracy'])
checkpoint = ModelCheckpoint(h5_path + model_file.rstrip('.' + extension)
+ '_' + tag + '_ft_ep{epoch:02d}_vl{val_loss:.2f}.hdf5',
monitor='val_acc',
verbose=0,
save_best_only=True,
save_weights_only=False,
mode='auto')
# Train model on selected dataset
ft_history = model.fit_generator(generator=ft_gen,
validation_data=val_gen,
verbose=1,
epochs=epochs,
use_multiprocessing=True,
workers=6,
callbacks=[checkpoint]
)
if save_history:
with open(tb_path + model_file.rstrip('.'+extension) + '_' + tag + '_ft_hist.pkl', 'w') as fd:
pickle.dump(ft_history, fd)
def create_generators(train_annotations, val_annotations, class_mapping, preprocess_image, batch_size,
data_augmentation=False, base_dir=None):
if data_augmentation:
transform_generator = kr_train.random_transform_generator(
min_rotation=-0.1,
max_rotation=0.1,
min_translation=(-0.1, -0.1),
max_translation=(0.1, 0.1),
min_shear=-0.1,
max_shear=0.1,
min_scaling=(0.9, 0.9),
max_scaling=(1.1, 1.1),
flip_x_chance=0.5,
flip_y_chance=0.5,
)
else:
transform_generator = kr_train.random_transform_generator(flip_x_chance=0.5)
# create the generators
train_generator = CSVGenerator(
train_annotations,
class_mapping,
transform_generator=transform_generator,
base_dir=base_dir,
preprocess_image=preprocess_image,
batch_size=batch_size
)
if val_annotations:
validation_generator = CSVGenerator(
val_annotations,
class_mapping,
base_dir=base_dir,
preprocess_image=preprocess_image,
batch_size=batch_size
)
else:
validation_generator = None
return train_generator, validation_generator
def create_callbacks(model, batch_size, weight_file=None, tensorboard_dir=None, snapshots_path=None,
backbone=None, dataset_type=None):
callbacks = []
if tensorboard_dir:
tensorboard_callback = TensorBoard(
log_dir=tensorboard_dir,
histogram_freq=0,
batch_size=batch_size,
write_graph=False,
write_grads=False,
write_images=False,
embeddings_freq=0,
embeddings_layer_names=None,
embeddings_metadata=None
)
callbacks.append(tensorboard_callback)
# save the model
if snapshots_path:
# ensure directory created first; otherwise h5py will error after epoch.
checkpoint = ModelCheckpoint(
os.path.join(
snapshots_path,
'{backbone}_{dataset_type}_{{epoch:02d}}.h5'.format(backbone=backbone,
dataset_type=dataset_type)
),
verbose=1,
# save_best_only=True,
# monitor="mAP",
# mode='max'
)
checkpoint = RedirectModel(checkpoint, model)
else:
if not weight_file:
weight_file = 'retinanet_unnamed.h5'
checkpoint = ModelCheckpoint(
weight_file,
monitor='val_acc',
verbose=1,
save_best_only=True,
save_weights_only=True,
mode='auto'
)
callbacks.append(checkpoint)
callbacks.append(ReduceLROnPlateau(
monitor='loss',
factor=0.1,
patience=2,
verbose=1,
mode='auto',
min_delta=0.0001,
cooldown=0,
min_lr=0
))
return callbacks
class DataGenerator(keras.utils.Sequence):
"""
Generates data for Keras'
"""
def __init__(self, list_ids, labels, batch_size=32, dim=(64,64,3), n_classes=10, shuffle=True):
# Initialization
self.dim = dim
self.batch_size = batch_size
self.labels = labels
self.list_ids = list_ids
self.n_classes = n_classes
self.shuffle = shuffle
self.on_epoch_end()
def __len__(self):
# Denotes the number of batches per epoch
return int(np.floor(len(self.list_ids) / self.batch_size))
def __getitem__(self, index):
# Generate one batch of data
# Generate indexes of the batch
indexes = self.indexes[index*self.batch_size:(index+1)*self.batch_size]
# Find list of IDs
list_ids_temp = [self.list_ids[k] for k in indexes]
# Generate data
X, y = self.__data_generation(list_ids_temp)
return X, y
def on_epoch_end(self):
# Updates indexes after each epoch
self.indexes = np.arange(len(self.list_ids))
if self.shuffle:
np.random.shuffle(self.indexes)
def __data_generation(self, list_ids_temp):
# Generates data containing batch_size samples # X : (n_samples, *dim, n_channels)
# Initialization
X = np.empty((self.batch_size, self.dim[0], self.dim[1], self.dim[2]))
y = np.empty(self.batch_size, dtype=int)
# Generate data
for i, id in enumerate(list_ids_temp):
# Store sample
# X[i, ] = np.load('data/' + id + '.npy')
X[i, ] = cv2.imread(id)
# Store class
y[i] = self.labels[id]
return X, keras.utils.to_categorical(y, num_classes=self.n_classes)
|
import unittest
from checkov.terraform.checks.resource.aws.KinesisStreamEncryptionType import check
from checkov.common.models.enums import CheckResult
class TestKinesisStreamEncryptionType(unittest.TestCase):
def test_failure(self):
resource_conf = {
'name': ["terraform-kinesis-test"],
'shard_count': [1],
'retention_period' : [48]
}
scan_result = check.scan_resource_conf(conf=resource_conf)
self.assertEqual(CheckResult.FAILED, scan_result)
def test_success(self):
resource_conf = {
'name': ["terraform-kinesis-test"],
'shard_count': [1],
'retention_period' : [48],
'encryption_type': ["KMS"]
}
scan_result = check.scan_resource_conf(conf=resource_conf)
self.assertEqual(CheckResult.PASSED, scan_result)
if __name__ == '__main__':
unittest.main()
|
import cv2 as cv
import os
import numpy
import numpy as np
import torch
# uv = torch.tensor([[[345, 240], # 0
# [300, 225],
# [255, 195],
# [210, 180],
# [180, 180],
# [195, 255], # 5
# [120, 255],
# [90, 255],
# [75, 255], # 8 食指指尖
# [210, 300],
# [135, 315],
# [90, 330],
# [45, 345],
# [225, 330],
# [165, 345],
# [120, 375],
# [90, 390],
# [240, 360],
# [210, 375],
# [180, 390],
# [150, 405]]], device='cuda:0')
# uv = uv[0].cpu().numpy()
# uv = numpy.flip(uv, -1)
def paint_hand(uv, img):
# img = np.ones((480, 480, 3), np.uint8)
# img[:] = [255, 255, 255]
# uv = uv[0].cpu().numpy()
# uv = numpy.flip(uv, -1)
for test in uv:
xy = (test[0], test[1])
cv.circle(img, xy, 4, (0, 0, 255), 1)
cv.line(img, uv[0], uv[1], (255, 0, 0), 2)
# print(uv[0:5])
# 颜色顺序为BGR
cv.polylines(img, [uv[0:5]], False, (0, 0, 255), 2) # 大拇指
cv.polylines(img, [uv[5:9]], False, (255, 0, 0), 2) # 食指
cv.polylines(img, [uv[9:13]], False, (255, 0, 0), 2) # 中指
cv.polylines(img, [uv[13:17]], False, (255, 0, 0), 2) # 无名指
cv.polylines(img, [uv[17:21]], False, (255, 0, 0), 2) # 小拇指
cv.line(img, uv[0], uv[5], (255, 0, 0), 2)
cv.line(img, uv[0], uv[9], (255, 0, 0), 2)
cv.line(img, uv[0], uv[13], (255, 0, 0), 2)
cv.line(img, uv[0], uv[17], (255, 0, 0), 2)
return img
def get_included_angle(coords1, coords2, coords3):
# 通过斜率计算夹角
# k1 = (coords2[1] - coords1[1]) / (coords2[0] - coords1[0])
# k2 = (coords2[1] - coords3[1]) / (coords2[0] - coords3[0])
#
# x = np.array([1, k1])
# y = np.array([1, k2])
# Lx = np.sqrt(x.dot(x))
# Ly = np.sqrt(y.dot(y))
# Cobb = int((np.arccos(x.dot(y) / (float(Lx * Ly))) * 180 / np.pi) + 0.5)
# 向量计算夹角
arr_0 = np.array([(coords2[0] - coords1[0]), (coords2[1] - coords1[1])])
arr_1 = np.array([(coords3[0] - coords2[0]), (coords3[1] - coords2[1])])
cos_value = (float(arr_0.dot(arr_1)) / (np.sqrt(arr_0.dot(arr_0)) * np.sqrt(arr_1.dot(arr_1))))
# cos_value = format((float(arr_0.dot(arr_1)) / (np.sqrt(arr_0.dot(arr_0)) * np.sqrt(arr_1.dot(arr_1)))), '.9f')
if cos_value > 1:
cos_value = 1
Cobb = np.arccos(cos_value) * (180 / np.pi)
return Cobb
def judge_posture(uv):
# uv = uv[0].cpu().numpy()
# uv = numpy.flip(uv, -1)
flag_thumb = 0
flag_forefinger = 0
flag_medius = 0
flag_ring_finger = 0
flag_little_finger = 0
flag_judge = 0
# 拇指弯曲角度
angle0_1_2 = get_included_angle(uv[0], uv[1], uv[2])
angle1_2_3 = get_included_angle(uv[1], uv[2], uv[3])
angle2_3_4 = get_included_angle(uv[2], uv[3], uv[4])
angle3_0_4 = get_included_angle(uv[3], uv[0], uv[4])
# 食指弯曲角度
angle0_5_6 = get_included_angle(uv[0], uv[5], uv[6])
angle5_6_7 = get_included_angle(uv[5], uv[6], uv[7])
angle6_7_8 = get_included_angle(uv[6], uv[7], uv[8])
angle7_0_8 = get_included_angle(uv[7], uv[0], uv[8])
# 中指弯曲角度
angle0_9_10 = get_included_angle(uv[0], uv[9], uv[10])
angle9_10_11 = get_included_angle(uv[9], uv[10], uv[11])
angle10_11_12 = get_included_angle(uv[10], uv[11], uv[12])
angle11_0_12 = get_included_angle(uv[11], uv[0], uv[12])
# 无名指指弯曲角度
angle0_13_14 = get_included_angle(uv[0], uv[13], uv[14])
angle13_14_15 = get_included_angle(uv[13], uv[14], uv[15])
angle14_15_16 = get_included_angle(uv[14], uv[15], uv[16])
angle15_0_16 = get_included_angle(uv[15], uv[0], uv[16])
# 小拇指弯曲角度
angle0_17_18 = get_included_angle(uv[0], uv[17], uv[18])
angle17_18_19 = get_included_angle(uv[17], uv[18], uv[19])
angle18_19_20 = get_included_angle(uv[18], uv[19], uv[20])
angle19_0_20 = get_included_angle(uv[19], uv[0], uv[20])
if angle0_1_2 < 20 and angle1_2_3 < 20 and angle2_3_4 < 20 and angle3_0_4 > 175:
flag_thumb = 1
if angle0_5_6 < 20 and angle5_6_7 < 20 and angle6_7_8 < 20 and angle7_0_8 > 175:
flag_forefinger = 1
if angle0_9_10 < 20 and angle9_10_11 < 20 and angle10_11_12 < 20 and angle11_0_12 > 175:
flag_medius = 1
if angle0_13_14 < 25 and angle13_14_15 < 20 and angle14_15_16 < 20 and angle15_0_16 > 175:
flag_ring_finger = 1
if angle0_17_18 < 25 and angle17_18_19 < 20 and angle18_19_20 < 20 and angle19_0_20 > 175:
flag_little_finger = 1
if flag_thumb == 1 and flag_forefinger == 1 and flag_medius == 1 and flag_ring_finger == 1 and flag_little_finger == 1:
flag_judge = 1
# if flag_judge == 1:
# print("识别成功\n")
return flag_judge
# 失败的拖尾效果QAQ
def show_special_effects(uv, img):
height = 30
width = 10
# uv = uv[0].cpu().numpy()
# uv = numpy.flip(uv, -1)
tail = cv.imread('./tail.png')
tail = cv.resize(tail, (width, height))
x = uv[8][1]
y = uv[8][0]
if x - height >= 0 and y - (width // 2) >= 0 and y + (width // 2) <= img.shape[0]:
img[x - height:x, y - (width // 2):y + (width // 2)] = tail
return img
def show_switch_effects(img):
pass
# 手指进入四角方块的互动
def click_box(uv, img, flag_ul, flag_ur, flag_ll, flag_lr):
x = uv[8][1]
y = uv[8][0]
length = 80
if flag_ul == 0:
img[0:length, 0:length] = [0, 0, 0]
if flag_ur == 0:
img[0:length, 480 - length:480] = [80, 80, 80]
if flag_ll == 0:
img[480 - length:480, 0:length] = [160, 160, 160]
if flag_lr == 0:
img[480 - length:480, 480 - length:480] = [255, 255, 255]
if x <= length:
if y <= length:
flag_ul = 1
elif y >= 480 - length:
flag_ur = 1
elif x >= 480 - length:
if y <= length:
flag_ll = 1
elif y >= 480 - length:
flag_lr = 1
return img, flag_ul, flag_ur, flag_ll, flag_lr
# # 测试函数功能
# img = np.zeros((480, 480, 3), np.uint8)
# img[:] = [200, 200, 200]
# paint_hand(uv, img)
# click_box(uv, img)
# # show_special_effects(uv, img)
# cv.imshow('img', img)
# cv.waitKey(0)
# judge_posture(uv)
# cv.destroyAllWindows()
# cv.imshow('img', img)
# cv.waitKey(0)
# cv.destroyAllWindows()
# a = np.random.randint(1, 10, size=15).reshape((3, 5))
# print(a)
# print(a.shape)
# print(np.flip(a, -1))
# print(np.flip(a, 0))
# print(np.flip(a, 1))
# 读取图像
# print(os.getcwd())
# img = cv.imread('./materials/demo2.jpeg')
# cv.imshow('image', img)
# cv.waitKey(0)
# cv.destroyAllWindows()
# 读取视频
# cap = cv.VideoCapture(0)
# if not cap.isOpened():
# print("Cannot open camera")
# exit()
# while True:
# # 逐帧捕获
# ret, frame = cap.read()
# # 如果正确读取帧,ret为True
# if not ret:
# print("Can't receive frame (stream end?). Exiting ...")
# break
# # 我们在框架上的操作到这里
# gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
# # 显示结果帧e
# cv.imshow('frame', gray)
# if cv.waitKey(1) == ord('q'):
# break
# # 完成所有操作后,释放捕获器
# cap.release()
# cv.destroyAllWindows()
|
import numpy as np
from advopt.target.search import cached
def test_compare():
from scipy.optimize import root_scalar
methods = ['bisect', 'brentq', 'brenth', 'ridder', 'toms748']
errors = dict([ (name, list()) for name in methods ])
n_iters = dict([(name, list()) for name in methods])
for _ in range(100):
w = 10 ** np.random.uniform(1, 2)
c = np.random.uniform(0.1, np.log(2))
f0 = 1e-3
solution = -np.log(f0 / c) / w
f = lambda x: c * np.exp(-w * x) - f0
x1 = 100
while f(x1) > -f0 / 2:
x1 *= 10
for method in methods:
f_c = cached(f)
sol = root_scalar(f_c, bracket=(0, x1), method=method, maxiter=100, xtol=10)
errors[method].append(np.abs(sol.root - solution))
n_iters[method].append(np.sum(list(f_c.cache.keys())))
for method in methods:
print(
'%s: %.3lf +- %.3lf [%.1lf +- %.1lf]' % (
method.ljust(10),
np.mean(errors[method]), np.std(errors[method]),
np.mean(n_iters[method]), np.std(n_iters[method]),
)
)
assert False
|
from pyarrow import feather
import numpy as np
""" Safe Drugs Data Retrieval Library """
class file_connector:
"""
read data from filesystem
args:
datafile: path to feather-formatted file
"""
def __init__(self, datafile):
self.datafile = datafile
self.data = feather.read_feather(source=datafile, nthreads=16)
def unique_values(self, column):
uniq_vals = self.data[column].unique()
uniq_vals = uniq_vals[np.argsort(uniq_vals)]
return uniq_vals
def count(self, query):
return self.data.query(query).count().values[0]
def counts_by_feature(self, feature, query=""):
"""
return outcomes data counts for a given feature, e.g. report_year, age_category, drug_category.
if "query" is provided, will first filter the dataset on that query string.
inputs:
feature: column name you'd like to group on, e.g. "gender_code", "report_year"
query (optional): optional query string to filter the dataset, e.g. 'gender_code == "F"'
returns:
struct of this format: {series: array, x: array, y: array, y_norm:array}
example:
foo = counts_by_feature("report_year", 'gender_code == "M"')
"""
ds = self.data.query(query) if query else self.data
series = (ds.groupby([feature])
.apply(lambda x : x.shape[0]))
x = series.index.tolist()
y = series.values
y_norm = np.round((y / series.sum()) * 100,0)
return {
'series': series,
'x': x,
'y': y,
'y_norm': y_norm
}
|
# Copyright (c) 2021, NVIDIA CORPORATION. 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.
#
# Copyright 2018-2019, Mingkun Huang
#
# 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 math
from typing import Optional
import torch
from numba import cuda
from warprnnt_numba.rnnt_loss.utils import global_constants
threshold = global_constants.THRESHOLD
@cuda.jit(device=True, inline=True)
def log_sum_exp(a: float, b: float):
if a == global_constants.FP32_NEG_INF:
return b
if b == global_constants.FP32_NEG_INF:
return a
if a > b:
return math.log1p(math.exp(b - a)) + a
else:
return math.log1p(math.exp(a - b)) + b
@cuda.jit(device=True, inline=True)
def div_up(x: int, y: int):
return (x + y - 1) // y
@cuda.jit(device=True)
def maximum(x, y):
if x < y:
return y
else:
return x
@cuda.jit(device=True)
def add(x, y):
return x + y
@cuda.jit(device=True)
def identity(x):
return x
@cuda.jit(device=True)
def negate(x):
return -x
@cuda.jit(device=True)
def exponential(x):
return math.exp(x)
@cuda.jit(device=True)
def log_plus(p1: float, p2: float):
if p1 == global_constants.FP32_NEG_INF:
return p2
if p2 == global_constants.FP32_NEG_INF:
return p1
result = math.log1p(math.exp(-math.fabs(p1 - p2))) + maximum(p1, p2)
return result
@cuda.jit(device=True, inline=True)
def copy_data_1d(source: torch.Tensor, dest: torch.Tensor, idx: int):
dest[idx] = source[idx]
@cuda.jit()
def compute_costs_data(source: torch.Tensor, dest: torch.Tensor, fastemit_lambda: float):
block = cuda.blockIdx.x
tid = cuda.threadIdx.x
idx = block * cuda.blockDim.x + tid
length = source.shape[0]
if idx < length:
copy_data_1d(source, dest, idx)
dest[idx] *= -1.0
dest[idx] *= 1.0 + fastemit_lambda
def get_workspace_size(
maxT: int, maxU: int, minibatch: int, gpu: bool
) -> (Optional[int], global_constants.RNNTStatus):
if minibatch <= 0 or maxT <= 0 or maxU <= 0:
return (None, global_constants.RNNTStatus.RNNT_STATUS_INVALID_VALUE)
# per minibatch memory
per_minibatch_size = 0
# alphas & betas
per_minibatch_size += maxT * maxU * 2
if not gpu:
# // blank & label log probability cache
per_minibatch_size += maxT * maxU * 2
else:
# // softmax denominator
per_minibatch_size += maxT * maxU
# // forward - backward loglikelihood
per_minibatch_size += 2
size = per_minibatch_size * minibatch
return (size, global_constants.RNNTStatus.RNNT_STATUS_SUCCESS)
def flatten_tensor(x: torch.Tensor):
original_shape = x.shape
x = x.view([-1])
return x, original_shape
|
from flask import request, make_response, render_template
from flask import current_app as app, Response
from sqlalchemy import exc, func
from .models import db, \
SdStatement, \
Property, \
association_table
from flask_babel import _
import json
@app.route('/v1/sdstatement/create', methods=['GET'])
def create_sd_statement():
"""Create a sd_statement via query string parameters."""
sd_name = request.args.get('sdName')
requires = request.args.getlist('requires')
if sd_name and requires != []:
properties = Property.query.all()
statement_properties = []
properties_not_in_db = []
for prop in requires:
is_in_database = False
for p in properties:
if p.name == prop:
statement_properties.append(p)
is_in_database = True
if not is_in_database:
properties_not_in_db.append(prop)
if properties_not_in_db != []:
return Response(status=400)
new_statement = SdStatement(
name=sd_name,
properties=statement_properties
)
db.session.add(new_statement)
try:
db.session.commit()
except exc.SQLAlchemyError as error:
if error.__str__().__contains__("UNIQUE constraint failed"):
db.session.rollback()
return Response(status=409)
else:
return Response(status=500)
res = json.dumps(new_statement.asdict(),
sort_keys=False,
indent=2)
return res, 201
else:
return Response(status=400)
@app.route('/v1/sdstatement/read', methods=['GET'])
def read_sd_statement():
"""Read a sd_statement via query string parameters."""
sd_name = request.args.get('sdName')
if sd_name:
existing_sd_statement = SdStatement.query.filter(
SdStatement.name == sd_name
).first()
if existing_sd_statement:
res = json.dumps(existing_sd_statement.asdict(),
sort_keys=False,
indent=2)
return Response(res, content_type='application/json', status=200)
else:
return Response(status=404)
else:
return Response(status=404)
def read_sd_statement_by_id(statement_id):
"""Read a sd_statement via id."""
existing_sd_statement = SdStatement.query.filter(
SdStatement.id == statement_id
).first()
if existing_sd_statement:
return existing_sd_statement.asdict()
else:
return make_response(_("Sd Statement with id {statement_id} doesn't exist").format(statement_id=str(statement_id)))
@app.route('/v1/sdstatement/update', methods=['GET'])
def update_sd_statement():
"""Update a sd_statement via query string parameters."""
sd_name = request.args.get('sdName')
requires = request.args.getlist('requires')
if sd_name:
existing_sd_statement = SdStatement.query.filter(
SdStatement.name == sd_name
).first()
if existing_sd_statement:
properties_not_in_db = []
for prop in requires:
is_in_database = False
for p in existing_sd_statement.properties:
if p.name == prop:
is_in_database = True
if not is_in_database:
properties_not_in_db.append(prop)
if properties_not_in_db != []:
return Response(status=400)
if update_sd_statement_by_id(existing_sd_statement.name, requires, existing_sd_statement.id):
return Response(status=200)
else:
return Response(status=400)
else:
return Response(status=400)
def update_sd_statement_by_id(statement_name, requires, statement_id):
"""Update a sd_statement via id."""
existing_sd_statement = SdStatement.query.filter(
SdStatement.id == statement_id
).first()
print(existing_sd_statement)
if existing_sd_statement:
existing_sd_statement.name = statement_name
existing_sd_statement.properties = []
for r in requires:
if r == "All":
pass
else:
existing_property = Property.query.filter(
Property.name == r
).first()
existing_sd_statement.properties.append(existing_property)
db.session.commit()
return True
else:
return False
@app.route('/v1/sdstatement/delete', methods=['GET'])
def delete_sd_statement():
"""Delete a sd_statement via query string parameters."""
sd_name = request.args.get('sdName')
if sd_name:
existing_sd_statement = SdStatement.query.filter(
SdStatement.name == sd_name
).first()
if existing_sd_statement:
db.session.delete(existing_sd_statement)
db.session.commit()
return Response(status=200)
else:
return Response(status=400)
else:
return Response(status=400)
def delete_sd_statement_by_id(statement_id):
"""Delete a sd_statement via id."""
existing_sd_statement = SdStatement.query.filter(
SdStatement.id == statement_id
).first()
if existing_sd_statement:
db.session.delete(existing_sd_statement)
db.session.commit()
return make_response(_("Sd Statement with id {statement_id} deleted").format(statement_id=str(statement_id)))
else:
return make_response(_("Sd Statement with id {statement_id} doesn't exist").format(statement_id=str(statement_id)))
@app.route('/v1/sdstatement/search', methods=['GET'])
def search_sd_statement():
"""Search a sd_statement via query string parameters."""
statements = []
sd_name = request.args.get('sd_name')
require_str = request.args.get('requires')
if sd_name and require_str:
all_statements = SdStatement.query.all()
for statement in all_statements:
if statement.name == sd_name:
properties = Property.query.join(association_table).join(SdStatement).filter(
association_table.c.sd_statement_id == statement.id
).all()
for prop in properties:
if require_str in prop.name:
statements.append(statement.asdict())
elif sd_name:
existing_statements = SdStatement.query.filter(
SdStatement.name == sd_name
).all()
for statement in existing_statements:
statements.append(statement.asdict())
elif require_str:
all_statements = SdStatement.query.all()
for statement in all_statements:
properties = Property.query.join(association_table).join(SdStatement).filter(
association_table.c.sd_statement_id == statement.id
).all()
for prop in properties:
if require_str in prop.name:
statements.append(statement.asdict())
else:
return Response(status=400)
if len(statements) == 0:
return Response(status=204)
res = json.dumps(statements,
sort_keys=False,
indent=2)
return Response(res, content_type='application/json', status=200)
def search_sd_statement_by_arg(search_str):
"""Search a sd_statement via arguments"""
statements = []
all_statements = SdStatement.query.all()
for statement in all_statements:
to_append = False
statement_str = get_all_sd_statement_str(statement)
for item in statement_str:
lower_search_str = search_str.lower()
lower_item = item.lower()
if lower_search_str in lower_item:
to_append = True
if to_append:
statements.append(statement)
return statements
def get_sd_statement_id(sd_name):
"""Get a sd_statement id from the sd name."""
sd_statement = SdStatement.query.filter(
SdStatement.name == sd_name
).first()
if sd_statement:
return sd_statement.id
else:
return -1
def get_sd_statement(sd_name):
"""Get a sd_statement from the sd name."""
sd_statement = SdStatement.query.filter(
SdStatement.name == sd_name
).first()
if sd_statement:
return sd_statement
else:
return None
def get_all_sd_statement_str(sd_statement):
statement_str = []
statement_str.append(sd_statement.name)
properties = Property.query.join(association_table).join(SdStatement).filter(
association_table.c.sd_statement_id == sd_statement.id
).all()
for prop in properties:
statement_str.append(prop.name)
return statement_str
|
from django.apps import AppConfig
class Djangox2Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'djangox2'
|
# Copyright 2020 Pulser Development Team
#
# 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.
"""Contains the ParamObj and auxiliary classes for object parametrization."""
from __future__ import annotations
import inspect
import operator
import warnings
from collections.abc import Callable
from itertools import chain
from typing import TYPE_CHECKING, Any, Union, cast
import numpy as np
from pulser.json.utils import obj_to_dict
from pulser.parametrized import Parametrized
if TYPE_CHECKING:
from pulser.parametrized import Variable # pragma: no cover
class OpSupport:
"""Methods for supporting operators on parametrized objects."""
# Unary operators
def __neg__(self) -> ParamObj:
return ParamObj(operator.neg, self)
def __abs__(self) -> ParamObj:
return ParamObj(operator.abs, self)
def __ceil__(self) -> ParamObj:
return ParamObj(np.ceil, self)
def __floor__(self) -> ParamObj:
return ParamObj(np.floor, self)
def __round__(self, n: int = 0) -> ParamObj:
return cast(ParamObj, (self * 10**n).rint() / 10**n)
def rint(self) -> ParamObj:
"""Rounds the value to the nearest int."""
# Defined because np.round looks for 'rint'
return ParamObj(np.round, self)
def sqrt(self) -> ParamObj:
"""Calculates the square root of the object."""
return ParamObj(np.sqrt, self)
def exp(self) -> ParamObj:
"""Calculates the exponential of the object."""
return ParamObj(np.exp, self)
def log2(self) -> ParamObj:
"""Calculates the base-2 logarithm of the object."""
return ParamObj(np.log2, self)
def log(self) -> ParamObj:
"""Calculates the natural logarithm of the object."""
return ParamObj(np.log, self)
def sin(self) -> ParamObj:
"""Calculates the trigonometric sine of the object."""
return ParamObj(np.sin, self)
def cos(self) -> ParamObj:
"""Calculates the trigonometric cosine of the object."""
return ParamObj(np.cos, self)
def tan(self) -> ParamObj:
"""Calculates the trigonometric tangent of the object."""
return ParamObj(np.tan, self)
# Binary operators
def __add__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.add, self, other)
def __radd__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.add, other, self)
def __sub__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.sub, self, other)
def __rsub__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.sub, other, self)
def __mul__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.mul, self, other)
def __rmul__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.mul, other, self)
def __truediv__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.truediv, self, other)
def __rtruediv__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.truediv, other, self)
def __floordiv__(self, other: Union[int, float]) -> ParamObj:
return (self / other).__floor__()
def __rfloordiv__(self, other: Union[int, float]) -> ParamObj:
return (other / self).__floor__()
def __pow__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.pow, self, other)
def __rpow__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.pow, other, self)
def __mod__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.mod, self, other)
def __rmod__(self, other: Union[int, float]) -> ParamObj:
return ParamObj(operator.mod, other, self)
class ParamObj(Parametrized, OpSupport):
"""Holds a call to a given class.
When called, a ParamObj instance returns `cls(*args, **kwargs)`.
Args:
cls (callable): The object to call. Usually it's a class that's
instantiated when called.
args: The args for calling `cls`.
kwargs: The kwargs for calling `cls`.
"""
def __init__(self, cls: Callable, *args: Any, **kwargs: Any) -> None:
"""Initializes a new ParamObj."""
self.cls = cls
self._variables: dict[str, Variable] = {}
if isinstance(self.cls, Parametrized):
self._variables.update(self.cls.variables)
for x in chain(args, kwargs.values()):
if isinstance(x, Parametrized):
self._variables.update(x.variables)
self.args = args
self.kwargs = kwargs
self._instance = None
self._vars_state: dict[str, int] = {}
@property
def variables(self) -> dict[str, Variable]:
"""Returns all involved variables."""
return self._variables
def build(self) -> Any:
"""Builds the object with its variables last assigned values."""
vars_state = {key: var._count for key, var in self._variables.items()}
if vars_state != self._vars_state:
self._vars_state = vars_state
# Builds all Parametrized arguments before feeding them to cls
args_ = [
arg.build() if isinstance(arg, Parametrized) else arg
for arg in self.args
]
kwargs_ = {
key: val.build() if isinstance(val, Parametrized) else val
for key, val in self.kwargs.items()
}
if isinstance(self.cls, ParamObj):
obj = self.cls.build()
else:
obj = self.cls
self._instance = obj(*args_, **kwargs_)
return self._instance
def _to_dict(self) -> dict[str, Any]:
def class_to_dict(cls: Callable) -> dict[str, Any]:
module = "numpy" if isinstance(cls, np.ufunc) else cls.__module__
return obj_to_dict(
self, _build=False, _name=cls.__name__, _module=module
)
args = list(self.args)
if isinstance(self.cls, Parametrized):
raise ValueError(
"Serialization of calls to parametrized objects is not "
"supported."
)
elif hasattr(args[0], self.cls.__name__) and inspect.isfunction(
self.cls
):
# Check for parametrized methods
if inspect.isclass(self.args[0]):
# classmethod
cls_dict = obj_to_dict(
self,
_build=False,
_name=self.cls.__name__,
_module=self.args[0].__module__,
_submodule=self.args[0].__name__,
)
args[0] = class_to_dict(self.args[0])
else:
raise NotImplementedError(
"Instance or static method "
"serialization is not supported."
)
else:
cls_dict = class_to_dict(self.cls)
return obj_to_dict(self, cls_dict, *args, **self.kwargs)
def __call__(self, *args: Any, **kwargs: Any) -> ParamObj:
"""Returns a new ParamObj storing a call to the current ParamObj."""
obj = ParamObj(self, *args, **kwargs)
warnings.warn(
"Calls to methods of parametrized objects are only "
"executed if they serve as arguments of other "
"parametrized objects that are themselves built. If this"
f" is not the case, the call to {obj} will not be "
"executed upon sequence building.",
stacklevel=2,
)
return obj
def __getattr__(self, name: str) -> ParamObj:
if hasattr(self.cls, name):
warnings.warn(
"Serialization of 'getattr' calls to parametrized "
"objects is not supported, so this object can't be serialied.",
stacklevel=2,
)
return ParamObj(getattr, self, name)
else:
raise AttributeError(f"No attribute named '{name}' in {self}.")
def __str__(self) -> str:
args = [str(a) for a in self.args]
kwargs = [f"{key}={str(value)}" for key, value in self.kwargs.items()]
if isinstance(self.cls, Parametrized):
name = str(self.cls)
elif (
hasattr(self.args[0], self.cls.__name__)
and inspect.isfunction(self.cls)
and inspect.isclass(self.args[0])
):
name = f"{self.args[0].__name__}.{self.cls.__name__}"
args = args[1:]
else:
name = self.cls.__name__
return f"{name}({', '.join(args+kwargs)})"
|
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 28 11:23:26 2017
@author: rickdberg
Create maps
"""
import numpy as np
import matplotlib.pyplot as plt
import rasterio
import cartopy.crs as ccrs
import cartopy
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
from user_parameters import (std_grids_path, ml_inputs_path)
# Get template
f = rasterio.open(ml_inputs_path + "Martin - porosity productivity distances\grl53425-sup-0002-supinfo.grd"
)
newaff = f.transform
top_left = f.transform * (0,0)
bottom_right = f.transform * (f.width, f.height)
lat_interval = (bottom_right[1]-top_left[1])/f.height
lon_interval = (bottom_right[0] - top_left[0])/f.width
lat = f.xy(0,0)[1] + np.arange(f.height)*lat_interval
lon = f.xy(0,0)[0] + np.arange(f.width)*lon_interval
lon[lon > 180] -= 360
# Load gridded data
# Load WOA bw temp grid
fluxes = np.loadtxt(std_grids_path + "woa_temp_std.txt"
, delimiter='\t')
woat = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woat.write(fluxes, 1)
src = woat
woat.close()
title = '$Bottom\ water\ temperature\ (^\circ C)$'
# Load WOA bw salinity grid
fluxes = np.loadtxt(std_grids_path + "woa_salinity_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Bottom\ water\ salinity\ (psu)$'
# Load etopo1_depth grid
fluxes = np.loadtxt(std_grids_path + "etopo1_depth_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Water\ depth\ (mbsl)$'
# Load 'surface_productivity', grid
fluxes = np.loadtxt(std_grids_path + "surface_productivity_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Surface\ productivity$'
# Load 'toc_wood' grid
fluxes = np.loadtxt(std_grids_path + "toc_wood_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Total\ organic\ carbon$'
# Load 'woa_o2' grid
fluxes = np.loadtxt(std_grids_path + "woa_o2_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Bottom\ water\ oxygen$'
# Load 'surface_porosity' grid
fluxes = np.loadtxt(std_grids_path + "surface_porosity_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Surface\ porosity$'
# Load 'coast_distance' grid
fluxes = np.loadtxt(std_grids_path + "coast_distance_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Distance\ to\ coast$'
# Load 'ridge_distance' grid
fluxes = np.loadtxt(std_grids_path + "ridge_distance_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Distance\ to\ ridge$'
# Load 'seamount', grid
fluxes = np.loadtxt(std_grids_path + "seamount_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Nearby\ seamounts$'
# Load 'opal', grid
fluxes = np.loadtxt(std_grids_path + "opal_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Opal\ concentration$'
# Load 'caco3', grid
fluxes = np.loadtxt(std_grids_path + "caco3_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$CaCO3\ concentration$'
# Load 'crustal_age', grid
fluxes = np.loadtxt(std_grids_path + "crustal_age_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Crustal\ age$'
# Load 'sed_thickness', grid
fluxes = np.loadtxt(std_grids_path + "sed_thickness_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Sediment\ thickness$'
# Load 'acc_rate_archer', grid
fluxes = np.loadtxt(std_grids_path + "acc_rate_archer_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$CaCO3\ accumulation\ rate$'
# Load 'caco3_archer', grid
fluxes = np.loadtxt(std_grids_path + "caco3_archer_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$CaCO3$'
# Load 'sed_rate_combined', grid
fluxes = np.loadtxt(std_grids_path + "sed_rate_combined_std.txt"
, delimiter='\t')
woas = rasterio.open('rf.nc', 'w', driver='GMT',
height=f.shape[0], width=f.shape[1],
count=1, dtype=fluxes.dtype,
crs='+proj=latlong', transform=f.transform)
woas.write(fluxes, 1)
src = woas
woas.close()
title = '$Sedimentation\ Rate$'
# Read image into ndarray
im = src.read()
# transpose the array from (band, row, col) to (row, col, band)
im = np.transpose(im, [1,2,0])
im = im[:,:,0]
xmin = src.transform[2]
xmax = src.transform[2] + src.transform[0]*src.width
ymin = src.transform[5] + src.transform[4]*src.height
ymax = src.transform[5]
#ax.set_global()
# define cartopy crs for the raster, based on rasterio metadata
crs = ccrs.PlateCarree()
# create figure
ax = plt.axes(projection=crs)
plt.title(title, fontsize=20)
ax.set_xmargin(0.05)
ax.set_ymargin(0.10)
# ax.stock_img()
# plot raster
plt.imshow(im, origin='upper', extent=[xmin, xmax, ymin, ymax], transform=crs)
# ax.coastlines(resolution='10m', color='k', linewidth=0.2)
# plt.colorbar(shrink=0.5)
ax.add_feature(cartopy.feature.LAND)
# ax.add_feature(cartopy.feature.OCEAN)
ax.add_feature(cartopy.feature.COASTLINE, linewidth=0.3)
# ax.add_feature(cartopy.feature.BORDERS, linestyle=':')
#ax.add_feature(cartopy.feature.LAKES, alpha=0.5)
ax.add_feature(cartopy.feature.RIVERS)
# ax.add_feature(cartopy.feature.LAND, zorder=50, edgecolor='k')
gl = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True,
color='gray', alpha=0.1, linestyle='--', )
gl.xlabels_top = False
gl.ylabels_right = False
gl.xformatter = LONGITUDE_FORMATTER
gl.yformatter = LATITUDE_FORMATTER
plt.show()
# eof
|
# -*- coding: utf-8 -*-
# Model_deployment.py
# Alessio Burrello <alessio.burrello@unibo.it>
#
# Copyright (C) 2019-2020 University of Bologna
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
from tiling import Tiling
import template as template
import os
import pandas as pd
from mako.template import Template
from collections import OrderedDict
import logging
class Model_deployment():
"""
Used to manage the PULP graph. By now, supported Convolutions, Pooling, Linear Layers and Relu.
"""
def __init__(self, platform, chip):
self.platform = platform
self.chip = chip
def copy_files(self, optional, layer_mixed_list,version):
## copy backend and necessary files in the application folder
os.system('rm -rf application')
os.system('mkdir application')
os.system('mkdir application/DORY_network')
os.system('mkdir application/DORY_network/inc')
os.system('mkdir application/DORY_network/src')
os.system('cp ../templates/dory.h ./application/DORY_network/inc/')
os.system('cp ../templates/mem_controller.c ./application/DORY_network/src/')
os.system('cp ../templates/mem_controller.h ./application/DORY_network/inc/')
tk = OrderedDict([])
tk['platform'] = self.platform
root = '/'.join(os.getcwd().split('/')[:-1])
tmpl = Template(filename=root + "/templates/mchan_test.h")
s = tmpl.render(**tk)
save_string = './application/DORY_network/inc/mchan_test.h'
with open(save_string, "w") as f:
f.write(s)
tk = OrderedDict([])
tk['platform'] = self.platform
tk['chip'] = self.chip
root = '/'.join(os.getcwd().split('/')[:-1])
tmpl = Template(filename= root + "/templates/dory.c")
s = tmpl.render(**tk)
save_string = './application/DORY_network/src/dory.c'
with open(save_string, "w") as f:
f.write(s)
os.system('cp ../templates/test_template.c ./application/DORY_network/src/')
os.system('cp ../templates/network.h ./application/DORY_network/inc/')
os.system('cp ../pulp-nn/8bit/' + version +'/include/* ./application/DORY_network/inc/')
os.system('cp ../pulp-nn/8bit/' + version +'/src/* ./application/DORY_network/src/')
def copy_backend(self, optional, BitIn, BitW, BitOut, BitActivation):
layer_mixed_list = []
####################################################################################
###### SECTION 1: BACKEND FILE SELECTING. SELECTING CORRECT KERNELS TO IMPORT ######
####################################################################################
if optional == 'mixed':
for i, nodes_to_deploy in enumerate(PULP_Nodes_Graph[:number_of_deployed_layers]):
BitIn = BitOut
if nodes_to_deploy.outshift != 'empty':
BitOut = 32 - int(nodes_to_deploy.outshift)
BitW = 8
if BitOut != 2 and BitOut!= 4 and BitOut!= 8:
BitOut = 8
if nodes_to_deploy.groups > 1:
layer_mixed_list.append(f'pulp_nn_dw_u{BitIn}_u{BitOut}_i{BitW}.c')
else:
layer_mixed_list.append(f'pulp_nn_conv_u{BitIn}_u{BitOut}_i{BitW}.c')
layer_mixed_list.append(f'pulp_nn_matmul_u{BitOut}_i{BitW}.c')
layer_mixed_list.append('pulp_nn_add_u8_u8.c')
layer_mixed_list.append('pulp_nn_avgpool_u8.c')
layer_mixed_list.append('pulp_nn_maxpool_u8.c')
version = str(BitActivation) + 'bit'
self.copy_files(optional, layer_mixed_list, version)
def create_weights_files(self, PULP_Nodes_Graph, number_of_deployed_layers, BitActivation):
####################################################################################
###### SECTION 2: WEIGHTS FILES CREATION. CREATING .HEX FILES FOR EACH LAYER ######
####################################################################################
file_list_w = []
# Fetching weights,biases, k, and lambda for each node_iterating
# 32 bits and 64 bits for Bn and Relu weights are used
weights_to_write = []
for i, nodes_to_deploy in enumerate(PULP_Nodes_Graph[:number_of_deployed_layers]):
if str(nodes_to_deploy.weights) != 'empty':
nodes_to_deploy.weights = nodes_to_deploy.weights.flatten().tolist()
for i_w, _ in enumerate(nodes_to_deploy.weights):
nodes_to_deploy.weights[i_w] = np.uint8(nodes_to_deploy.weights[i_w])
weights = nodes_to_deploy.weights
if str(nodes_to_deploy.k) != 'empty':
if str(nodes_to_deploy.outmul) != 'empty':
out_mult = np.int32(nodes_to_deploy.outmul)
k_byte = []
for i_k, _ in enumerate(nodes_to_deploy.k.flatten()):
if BitActivation == 64:
val = np.int64(nodes_to_deploy.k.flatten()[i_k])*out_mult
else:
val = np.int32(nodes_to_deploy.k.flatten()[i_k])*out_mult
if BitActivation == 32:
k_byte.append(np.uint8(val & 0x000000FF))
k_byte.append(np.uint8((val >> 8) & 0x000000FF))
k_byte.append(np.uint8((val >> 16) & 0x000000FF))
k_byte.append(np.uint8((val >> 24) & 0x000000FF))
if BitActivation == 64:
k_byte.append(np.uint8(val & 0x00000000000000FF))
k_byte.append(np.uint8((val >> 8) & 0x00000000000000FF))
k_byte.append(np.uint8((val >> 16) & 0x00000000000000FF))
k_byte.append(np.uint8((val >> 24) & 0x00000000000000FF))
k_byte.append(np.uint8((val >> 32) & 0x00000000000000FF))
k_byte.append(np.uint8((val >> 40) & 0x00000000000000FF))
k_byte.append(np.uint8((val >> 48) & 0x00000000000000FF))
k_byte.append(np.uint8((val >> 56) & 0x00000000000000FF))
nodes_to_deploy.k = k_byte
weights = np.concatenate((weights, nodes_to_deploy.k))
if str(nodes_to_deploy.lambd) != 'empty':
lambd = np.float64(nodes_to_deploy.lambd.flatten()) * out_mult
lambd_byte = []
for i_l, _ in enumerate(nodes_to_deploy.lambd.flatten()):
if BitActivation == 64:
val = np.int64(lambd[i_l])
else:
val = np.int32(lambd[i_l])
if BitActivation == 32:
lambd_byte.append(np.uint8(val & 0x000000FF))
lambd_byte.append(np.uint8((val >> 8) & 0x000000FF))
lambd_byte.append(np.uint8((val >> 16) & 0x000000FF))
lambd_byte.append(np.uint8((val >> 24) & 0x000000FF))
if BitActivation == 64:
lambd_byte.append(np.uint8(val & 0x00000000000000FF))
lambd_byte.append(np.uint8((val >> 8) & 0x00000000000000FF))
lambd_byte.append(np.uint8((val >> 16) & 0x00000000000000FF))
lambd_byte.append(np.uint8((val >> 24) & 0x00000000000000FF))
lambd_byte.append(np.uint8((val >> 32) & 0x00000000000000FF))
lambd_byte.append(np.uint8((val >> 40) & 0x00000000000000FF))
lambd_byte.append(np.uint8((val >> 48) & 0x00000000000000FF))
lambd_byte.append(np.uint8((val >> 56) & 0x00000000000000FF))
nodes_to_deploy.lambd = lambd_byte
weights = np.concatenate((weights, nodes_to_deploy.lambd))
if str(nodes_to_deploy.outmul) != 'empty':
PULP_Nodes_Graph[i].outmul = 1
if str(nodes_to_deploy.weights) != 'empty':
while len(weights) % 4 != 0:
weights = np.concatenate((weights, np.asarray([0])))
weights = np.asarray(weights)
weights_to_write.append(weights)
string_layer = nodes_to_deploy.name + str(i) + "_weights.hex"
file_list_w.append(string_layer)
save_s = './application/DORY_network/' + string_layer
with open(save_s, 'wb') as f:
for l in weights.astype('uint8').flatten():
f.write(bytes((l,)))
return PULP_Nodes_Graph, file_list_w, weights_to_write
def create_layers_tiling(self, PULP_Nodes_Graph,
number_of_deployed_layers,
L1_dimension,
l2_buffer_size,
BitActivation,
optional,
performance_single_layer,
BitIn,
BitW,
BitOut):
####################################################################################
###### SECTION 3: PARSING OF EACH LAYER INDEPENDENT. TILING + LAYER CREATION ######
####################################################################################
name_list = []
layer_list = []
stringa_features = []
name_layer_list = []
name_layer_list_internal = []
MAC_total = 0
BitOut = 8
Layers_L3_input_act = 0
Layers_L3_output_act = 0
Layers_L3_weights = 0
L2_memory_occupation = 0
for i, nodes_to_deploy in enumerate(PULP_Nodes_Graph[:number_of_deployed_layers]):
if 'Conv' in nodes_to_deploy.name or 'Gemm' in nodes_to_deploy.name or 'MatMul' in nodes_to_deploy.name:
layer = 'Conv'
if 'Pool' in nodes_to_deploy.name:
layer = 'Pool'
if 'Add' in nodes_to_deploy.name:
layer = 'Add'
name_layer = "layer" + nodes_to_deploy.name + str(i)
######################## NEED A FIX ####################################################
#### OTHERWISE ONLY WEIGHT < L2/2 GO in L2 --> much more L3 tiling not needed############
#########################################################################################
if (i < len(PULP_Nodes_Graph)-1) and ('Conv' in PULP_Nodes_Graph[i+1].name or 'Gemm' in PULP_Nodes_Graph[i+1].name or 'MatMul' in PULP_Nodes_Graph[i+1].name):
if PULP_Nodes_Graph[i+1].input_channels*PULP_Nodes_Graph[i+1].output_channels*PULP_Nodes_Graph[i+1].filter_size_h*PULP_Nodes_Graph[i+1].filter_size_w > int(l2_buffer_size/2):
weight_overhead = int(l2_buffer_size/2)
else:
weight_overhead = PULP_Nodes_Graph[i+1].input_channels*PULP_Nodes_Graph[i+1].output_channels*PULP_Nodes_Graph[i+1].filter_size_h*PULP_Nodes_Graph[i+1].filter_size_w +int(PULP_Nodes_Graph[i+1].output_channels*BitActivation/8*2)
else:
weight_overhead = 0
if optional != '8bit':
BitIn = BitOut
if nodes_to_deploy.outshift != 'empty':
BitOut = 32 - int(nodes_to_deploy.outshift)
BitW = 8
if BitOut != 2 and BitOut!= 4 and BitOut!= 8:
BitOut = 8
if i == len(PULP_Nodes_Graph)-1:
name_layer = name_layer + '_last'
BitOut = 32
if performance_single_layer == 'Yes':
test_location = 'L3+performance'
else:
test_location = 'L3'
tile_gen = Tiling(layer,
nodes_to_deploy.output_channels,
[nodes_to_deploy.filter_size_h, nodes_to_deploy.filter_size_w],
nodes_to_deploy.stride,
[nodes_to_deploy.padding_top,nodes_to_deploy.padding_left,nodes_to_deploy.padding_bottom,nodes_to_deploy.padding_right],
nodes_to_deploy.groups,
[nodes_to_deploy.input_channels * nodes_to_deploy.groups,
nodes_to_deploy.input_h, nodes_to_deploy.input_w],
L1_dimension,
l2_buffer_size-weight_overhead,
self.platform,
self.chip,
test_location=test_location,
BitIn=BitIn,
BitW=BitW,
BitOut=BitOut,
BitActivation = BitActivation,
optional_type=optional)
str_l = 'ch_in' + str(nodes_to_deploy.input_channels) + 'ch_out' + str(nodes_to_deploy.output_channels) + 'groups' + str(
nodes_to_deploy.groups) + 'dim_image' + str(nodes_to_deploy.input_h,) + 'stride' + str(nodes_to_deploy.stride)
name = nodes_to_deploy.name
for scan_i, _ in enumerate(stringa_features):
if str_l == stringa_features[scan_i] and str(layer) == str(layer_list[scan_i]):
name_layer = name_layer_list[scan_i]
name = name_layer_list_internal[scan_i]
stringa_features.append(str_l)
layer_list.append(layer)
name_layer_list.append(name_layer)
name_layer_list_internal.append(name)
relu = 0
BN = 0
DW = 0
input_dim_constraint = 0
output_weights_dim_constraint = 0
if i == 0:
weight_constraint = 0
if i == 0:
input_L3 = 0
elif factor_h_out > 1:
input_L3 = 1
input_dim_constraint = out_dim2
output_weights_dim_constraint = l2_buffer_size - weight_overhead - out_dim2_old
else:
input_L3 = 0
if 'Relu' in nodes_to_deploy.name:
relu = 1
if 'BN' in nodes_to_deploy.name:
BN = 1
if 'DW' in nodes_to_deploy.name:
DW = 1
if 'Gemm' in nodes_to_deploy.name or 'Conv' in nodes_to_deploy.name or 'MatMul' in nodes_to_deploy.name:
in_dim2, out_dim2, weights_dim, l1_dim2, L3_tiling, factor_ch_out, factor_h_out, factor_h_in = tile_gen.get_tiling(X=0, Y=0, W=0,
relu=relu, BN=BN, DW=DW,
has_bias=0,
out_mul=nodes_to_deploy.outmul,
out_shift=nodes_to_deploy.outshift,
name=name_layer,
input_L3 = input_L3,
input_dim_constraint = input_dim_constraint,
output_weights_dim_constraint = output_weights_dim_constraint,
weight_constraint = weight_constraint)
if factor_ch_out > 1:
PULP_Nodes_Graph[i].L3_allocation = 1
else:
PULP_Nodes_Graph[i].L3_allocation = 0
Layers_L3_input_act += int(factor_h_in > 1)
Layers_L3_output_act += int(factor_h_out > 1)
Layers_L3_weights += int(factor_ch_out > 1)
if i == 0:
out_dim2_old = in_dim2
if factor_h_out > 1:
out_dim2 = l2_buffer_size - weight_overhead - out_dim2_old - weights_dim
out_dim2_old = out_dim2
elif 'Pool' in nodes_to_deploy.name:
in_dim2, out_dim2, l1_dim2 = tile_gen.get_tiling(X=0, Y=0, W=0,
relu=relu,
out_mul=nodes_to_deploy.outmul,
out_shift=nodes_to_deploy.outshift,
name=name_layer,
type=name)
L3_tiling = 0
elif 'Add' in nodes_to_deploy.name:
in_dim2, out_dim2, l1_dim2 = tile_gen.get_tiling(X=0, Y=0, W=0,
relu=relu,
out_mul1=nodes_to_deploy.inmul1,
out_mul2=nodes_to_deploy.inmul2,
out_shift=nodes_to_deploy.outshift,
name=name_layer,
type=name)
L3_tiling = 0
if weight_overhead == int(l2_buffer_size/2):
weight_constraint = int(l2_buffer_size/2)
else:
weight_constraint = 0
if L3_tiling == 1:
name_layer = name_layer + 'L3'
name_list.append(name_layer)
if 'Gemm' in nodes_to_deploy.name or 'Conv' in nodes_to_deploy.name or 'MatMul' in nodes_to_deploy.name:
if i > 0:
PULP_Nodes_Graph[i].weights_dimension = PULP_Nodes_Graph[i-1].weights_dimension + weights_dim
else:
PULP_Nodes_Graph[i].weights_dimension = weights_dim
else:
PULP_Nodes_Graph[i].weights_dimension = PULP_Nodes_Graph[i-1].weights_dimension
if 'Gemm' in nodes_to_deploy.name or 'Conv' in nodes_to_deploy.name or 'MatMul' in nodes_to_deploy.name:
if factor_ch_out == 1:
if i > 0:
PULP_Nodes_Graph[i].weights_dimension_L3 = PULP_Nodes_Graph[i-1].weights_dimension_L3 + weights_dim
else:
PULP_Nodes_Graph[i].weights_dimension_L3 = weights_dim
else:
if i > 0:
PULP_Nodes_Graph[i].weights_dimension_L3 = PULP_Nodes_Graph[i-1].weights_dimension_L3 + int(weights_dim*factor_ch_out/2)
else:
PULP_Nodes_Graph[i].weights_dimension_L3 = int(weights_dim*factor_ch_out/2)
else:
PULP_Nodes_Graph[i].weights_dimension_L3 = PULP_Nodes_Graph[i-1].weights_dimension_L3
PULP_Nodes_Graph[i].input_activation_dimensions = int(in_dim2*BitIn/8)
PULP_Nodes_Graph[i].output_activation_dimensions = int(out_dim2*BitOut/8)
if i > 0:
if PULP_Nodes_Graph[i].input_activation_dimensions != PULP_Nodes_Graph[i-1].output_activation_dimensions:
PULP_Nodes_Graph[i].input_activation_dimensions = PULP_Nodes_Graph[i-1].output_activation_dimensions
PULP_Nodes_Graph[i].l1_dimensions = l1_dim2
MAC_total += nodes_to_deploy.MACs
return PULP_Nodes_Graph, Layers_L3_input_act, Layers_L3_output_act, Layers_L3_weights, name_layer_list, name_list, MAC_total
def generate_intermediate_activations(self, PULP_Nodes_Graph,
load_dir,
number_of_deployed_layers,
check_layer,
weights_to_write,
BitIn,
BitW,
BitOut,
optional):
######################################################################################
###### SECTION 4: GENERATE CHECKSUM BY USING WEIGHT AND OUT_LAYER{i}.TXT FILES ######
######################################################################################
x_in = None
x_in = pd.read_csv(load_dir + 'input.txt')
x_in = x_in.values[:, 0].astype(int)
for i, _ in enumerate(x_in):
x_in[i] = np.uint8(x_in[i])
BitOut = 8
PULP_Nodes_Graph[0].check_sum_in = sum(x_in)
string_layer = "inputs.hex"
save_s = './application/DORY_network/' + string_layer
with open(save_s, 'wb') as f:
for i in x_in.astype('uint8').flatten():
f.write(bytes((i,)))
f_w = 0
for f, nodes_to_deploy in enumerate(PULP_Nodes_Graph[:number_of_deployed_layers]):
X_in = pd.read_csv(load_dir + 'out_layer' + str(f) + '.txt')
X_in = X_in.values[:, 0].astype(int)
if f == len(PULP_Nodes_Graph[:number_of_deployed_layers]) - 1:
class_out = np.where(X_in == np.max(X_in))[0][0]
for i, _ in enumerate(X_in):
X_in[i] = np.uint8(X_in[i])
if optional != '8bit':
BitIn = BitOut
if nodes_to_deploy.outshift != 'empty':
BitOut = 32 - int(nodes_to_deploy.outshift)
BitW = 8
if BitOut != 2 and BitOut!= 4 and BitOut!= 8:
BitOut = 8
Input_compressed = []
z = 0
import copy
Loop_over = copy.deepcopy(X_in)
for _, i_x in enumerate(Loop_over):
if (z % int(8 / BitOut)) == 0:
Input_compressed.append(int(i_x.item()))
else:
Input_compressed[-1] += int(i_x.item()) << (BitOut * (z % int(8 / BitOut)))
z += 1
if check_layer == f:
act_compare = Input_compressed
PULP_Nodes_Graph[f].check_sum_out = sum(Input_compressed)
if f == len(PULP_Nodes_Graph) - 1:
ww = np.asarray(nodes_to_deploy.weights).reshape(nodes_to_deploy.output_channels,nodes_to_deploy.input_channels ).astype(np.int8).astype(int)
X_in = pd.read_csv(load_dir + 'out_layer' + str(f-1) + '.txt')
X_out = pd.read_csv(load_dir + 'out_layer' + str(f) + '.txt')
X_in = X_in.values[:, 0].astype(int).reshape(X_in.shape[0],1)
try:
PULP_Nodes_Graph[f].check_sum_out = sum(sum(np.matmul(ww,X_in)))
except:
PULP_Nodes_Graph[f].check_sum_out = 0
if f != len(PULP_Nodes_Graph[:number_of_deployed_layers]) - 1:
PULP_Nodes_Graph[f + 1].check_sum_in = sum(Input_compressed)
if 'Gemm' in nodes_to_deploy.name or 'Conv' in nodes_to_deploy.name or 'MatMul' in nodes_to_deploy.name:
PULP_Nodes_Graph[f].check_sum_w = sum(weights_to_write[f_w])
f_w += 1
return PULP_Nodes_Graph, class_out
def print_model_network(self, PULP_Nodes_Graph,
number_of_deployed_layers=29,
load_dir='./mnistNet/',
check_layer=0,
verbose_level='None',
performance_single_layer='Yes',
L1_dimension = 35000,
master_stack = 4096,
slave_stack = 3072,
l2_buffer_size = 400000,
fc_frequency = 100000000,
cl_frequency = 100000000,
BitIn=8,
BitW=8,
BitOut=8,
BitActivation = 32,
optional='8bit'):
# Function used to create all the files for the application
# copy backend is used to copy all the files of the backend
self.copy_backend(optional, BitIn, BitW, BitOut, BitActivation)
# create L3 files for weights. These files are .hex which are copied in hyperflash then
PULP_Nodes_Graph, weights_files_list, weights_to_write = self.create_weights_files(PULP_Nodes_Graph, number_of_deployed_layers, BitActivation)
fileh = logging.FileHandler('Tiling_profiling.log', 'a')
formatter = logging.Formatter('%(asctime)s - %(message)s')
fileh.setFormatter(formatter)
fileh.setLevel(logging.DEBUG)
log = logging.getLogger()
for hdlr in log.handlers[:]:
log.removeHandler(hdlr)
log.addHandler(fileh)
print("Creating tiling profiling in Tiling_profling.log")
# tiling of all the layers. Both tiling and layer generation
PULP_Nodes_Graph, num_L3_input_tile, num_L3_output_tile, num_L3_weight_tile, name_layer_list, name_list, MAC_total = self.create_layers_tiling(PULP_Nodes_Graph,
number_of_deployed_layers,
L1_dimension,
l2_buffer_size,
BitActivation,
optional,
performance_single_layer,
BitIn,
BitW,
BitOut)
logging.debug(" ")
logging.debug(" Layers with L3 input activation: " + str(num_L3_input_tile))
logging.debug(" Layers with L3 output activation: " + str(num_L3_output_tile))
logging.debug(" Layers with L3 weights: " + str(num_L3_weight_tile))
name_layer_list_unique = list(set(name_layer_list))
for i, _ in enumerate(name_layer_list_unique):
name_layer_list_unique[i] = name_layer_list_unique[i] + ".c"
for i, nodes_to_deploy in enumerate(PULP_Nodes_Graph[:number_of_deployed_layers]):
if nodes_to_deploy.L3_allocation == 1:
name_layer_list_unique.append(name_layer_list[i] + "L3" + ".c")
# compute the checksums for intermediate activations checking
if 'Check' in verbose_level or 'Last' in verbose_level:
PULP_Nodes_Graph, class_out = self.generate_intermediate_activations(PULP_Nodes_Graph,
load_dir,
number_of_deployed_layers,
check_layer,
weights_to_write,
BitIn,
BitW,
BitOut,
optional)
else:
x_in = np.random.randint(2**9, size=(1, PULP_Nodes_Graph[0].input_channels, PULP_Nodes_Graph[0].input_h, PULP_Nodes_Graph[0].input_w))
x_in[x_in > (2**8 - 1)] = 0
x_in = x_in.flatten().astype(int)
for i, _ in enumerate(x_in):
x_in[i] = np.uint8(x_in[i])
BitOut = 8
class_out = 0
PULP_Nodes_Graph[0].check_sum_in = sum(x_in)
string_layer = "inputs.hex"
save_s = './application/DORY_network/' + string_layer
with open(save_s, 'wb') as f:
for i in x_in.astype('uint8').flatten():
f.write(bytes((i,)))
if check_layer == 100:
act_compare = np.asarray([0, 0])
act_size = [0, 0, 0]
else:
act_size = [PULP_Nodes_Graph[check_layer].output_h, PULP_Nodes_Graph[check_layer].output_w, PULP_Nodes_Graph[check_layer].output_channels]
## printf the network file. It calls all the layer functions
template.print_template_network(
weights_files_list,
PULP_Nodes_Graph[:number_of_deployed_layers],
'char',
name=name_list,
test=True,
has_bias=True,
verbose_level=verbose_level,
check_layer=check_layer,
act_compare=act_compare,
act_size=act_size,
class_out=class_out,
l1_buffer=L1_dimension,
master_stack = master_stack,
slave_stack = slave_stack,
l2_buffer_size = l2_buffer_size,
fc_frequency = fc_frequency,
cl_frequency = cl_frequency,
MACs=MAC_total,
platform=self.platform,
BitIn=BitIn,
BitW=BitW,
BitOut=BitOut)
# create the Makefile for the application
template.print_template_Makefile(weights_files_list, self.platform)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.