hexsha
stringlengths
40
40
size
int64
5
2.06M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
248
max_stars_repo_name
stringlengths
5
125
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
248
max_issues_repo_name
stringlengths
5
125
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
248
max_forks_repo_name
stringlengths
5
125
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
5
2.06M
avg_line_length
float64
1
1.02M
max_line_length
int64
3
1.03M
alphanum_fraction
float64
0
1
count_classes
int64
0
1.6M
score_classes
float64
0
1
count_generators
int64
0
651k
score_generators
float64
0
1
count_decorators
int64
0
990k
score_decorators
float64
0
1
count_async_functions
int64
0
235k
score_async_functions
float64
0
1
count_documentation
int64
0
1.04M
score_documentation
float64
0
1
fa3cbfd8b261691f0db27a183a13227b321d7c35
1,782
py
Python
neopixel/main.py
morgulbrut/wemos-mupy
fbe425c6a383c9c28f36f48a23c70aae98bf62cd
[ "MIT" ]
null
null
null
neopixel/main.py
morgulbrut/wemos-mupy
fbe425c6a383c9c28f36f48a23c70aae98bf62cd
[ "MIT" ]
null
null
null
neopixel/main.py
morgulbrut/wemos-mupy
fbe425c6a383c9c28f36f48a23c70aae98bf62cd
[ "MIT" ]
null
null
null
from machine import Pin import neopixel import time class NeoMatrix: def __init__(self, x, y): self.colors = [] for i in range(x): for j in range(x): colors[i][j] = Color(0,0,0) self.np = neopixel.NeoPixel(Pin(4, Pin.OUT),x*y) self.np.write() def set_pixel(self,x,y,r=0,g=0,b=0): self.colors[x][y] = Color(r,g,b) self.np.write() class Color: def __init__(self,r,g,b): self.r = r self.g = g self.b = b # def clear(np): # set(np) # def cycle(np,r=0,g=0,b=0,delay=25,cycles=1,invert=False): # for i in range(cycles): # bounce(np,r,g,b,delay,1,invert) # def bounce(np,r=0,g=0,b=0,delay=25,cycles=2,invert=False): # for i in range(cycles * np.n): # if invert: # for j in range(np.n): # np[j] = (r, g, b) # if (i // np.n) % 2 == 0: # np[i % np.n] = (0, 0, 0) # else: # np[np.n - 1 - (i % np.n)] = (0, 0, 0) # else: # for j in range(np.n): # np[j] = (0, 0, 0) # if (i // np.n) % 2 == 0: # np[i % np.n] = (r, g, b) # else: # np[np.n - 1 - (i % np.n)] = (r, g, b) # np.write() # time.sleep_ms(delay) # clear(np) # def fade_in(np,r=0,g=0,b=0,delay=25,cycles=1): # for i in range(0,256,8): # rn = my_map(r,in_max=i,out_max=r) # gn = my_map(g,in_max=i,out_max=g) # bn = my_map(b,in_max=i,out_max=b) # set(np,rn,gn,bn) # print(rn) # def my_map(val,in_min=0,in_max=255,out_min=0,out_max=255): # try: # return int((val - in_min) * (out_max - out_min) / (in_max - in_min) + out_min) # except ZeroDivisionError: # return 0 # def demo(np): # n = np.n # # fade in/out # for i in range(0, 4 * 256, 8): # for j in range(n): # if (i // 256) % 2 == 0: # val = i & 0xff # else: # val = 255 - (i & 0xff) # np[j] = (val, 0, 0) # np.write() # # clear # clear(np)
20.964706
82
0.537037
381
0.213805
0
0
0
0
0
0
1,285
0.7211
fa3d7b7b58127ec40c852f915a22ddc033b65684
377
py
Python
tests/unit/request/request_builders/recurring_get_schedule_builder_test.py
Zhenay/python-sdk
53161cc591fe2ec54ecfefad4fc4d5625a97afd9
[ "MIT" ]
3
2018-06-08T12:21:28.000Z
2020-04-07T12:54:04.000Z
tests/unit/request/request_builders/recurring_get_schedule_builder_test.py
Zhenay/python-sdk
53161cc591fe2ec54ecfefad4fc4d5625a97afd9
[ "MIT" ]
2
2017-09-21T15:43:46.000Z
2019-07-22T08:20:50.000Z
tests/unit/request/request_builders/recurring_get_schedule_builder_test.py
Zhenay/python-sdk
53161cc591fe2ec54ecfefad4fc4d5625a97afd9
[ "MIT" ]
4
2020-09-21T07:11:22.000Z
2022-03-21T09:42:51.000Z
import unittest from platron.request.request_builders.recurring_get_schedule_builder import RecurringGetScheduleBuilder class RecurringGetScheduleBuilderTest(unittest.TestCase): def test_get_params(self): builder = RecurringGetScheduleBuilder('12345') params = builder.get_params() self.assertEquals('12345', params.get('pg_recurring_profile'))
31.416667
103
0.787798
254
0.67374
0
0
0
0
0
0
36
0.095491
fa401c88954339276304ae936fc6f58c6bc88be6
2,372
py
Python
malleus/api/domain/protos/timings_pb2.py
joelgerard/malleus
763850ef270a449829b89a998cdce8febf5020ef
[ "Apache-2.0" ]
null
null
null
malleus/api/domain/protos/timings_pb2.py
joelgerard/malleus
763850ef270a449829b89a998cdce8febf5020ef
[ "Apache-2.0" ]
2
2021-02-08T20:22:50.000Z
2021-06-01T22:07:40.000Z
malleus/api/domain/protos/timings_pb2.py
joelgerard/malleus
763850ef270a449829b89a998cdce8febf5020ef
[ "Apache-2.0" ]
null
null
null
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: malleus/api/domain/protos/timings.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from malleus.api.domain.protos import timing_pb2 as malleus_dot_api_dot_domain_dot_protos_dot_timing__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='malleus/api/domain/protos/timings.proto', package='malleus.api.domain', syntax='proto3', serialized_pb=_b('\n\'malleus/api/domain/protos/timings.proto\x12\x12malleus.api.domain\x1a&malleus/api/domain/protos/timing.proto\"6\n\x07Timings\x12+\n\x07timings\x18\x01 \x03(\x0b\x32\x1a.malleus.api.domain.Timingb\x06proto3') , dependencies=[malleus_dot_api_dot_domain_dot_protos_dot_timing__pb2.DESCRIPTOR,]) _TIMINGS = _descriptor.Descriptor( name='Timings', full_name='malleus.api.domain.Timings', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='timings', full_name='malleus.api.domain.Timings.timings', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=103, serialized_end=157, ) _TIMINGS.fields_by_name['timings'].message_type = malleus_dot_api_dot_domain_dot_protos_dot_timing__pb2._TIMING DESCRIPTOR.message_types_by_name['Timings'] = _TIMINGS _sym_db.RegisterFileDescriptor(DESCRIPTOR) Timings = _reflection.GeneratedProtocolMessageType('Timings', (_message.Message,), dict( DESCRIPTOR = _TIMINGS, __module__ = 'malleus.api.domain.protos.timings_pb2' # @@protoc_insertion_point(class_scope:malleus.api.domain.Timings) )) _sym_db.RegisterMessage(Timings) # @@protoc_insertion_point(module_scope)
32.493151
231
0.778246
0
0
0
0
0
0
0
0
692
0.291737
fa404fc0c53d88f5afc112d22c40c258e0d8ffc9
2,191
py
Python
basic_newsletter/utils.py
CIGIHub/newsletter_generator
2af3e183ffedce55ad26bf998c488282f94d477e
[ "MIT" ]
null
null
null
basic_newsletter/utils.py
CIGIHub/newsletter_generator
2af3e183ffedce55ad26bf998c488282f94d477e
[ "MIT" ]
null
null
null
basic_newsletter/utils.py
CIGIHub/newsletter_generator
2af3e183ffedce55ad26bf998c488282f94d477e
[ "MIT" ]
null
null
null
from __future__ import unicode_literals import os.path from django.core.files.storage import default_storage as storage from django.core.files.uploadedfile import SimpleUploadedFile from django.utils.six import StringIO from django.utils.encoding import smart_text try: import Image except ImportError: try: from PIL import Image except ImportError: raise ImportError('Cannot import Python Image Library') class ImageManipulator(): def __init__(self, format="JPEG", extension="jpg", quality=75): self.format = format self.extension = extension self.quality = quality # define the path for the resized image def resized_path(self, path, size, method): directory, name = os.path.split(path) image_name, ext = name.rsplit('.', 1) return os.path.join(directory, smart_text('{}_{}_{}.{}').format(image_name, method, size, self.extension)) # take an image, create a copy and scale the copied image def scale(self, image_field, size): image_path = self.resized_path(image_field.name, size, 'scale') image_dir, image_filename = os.path.split(image_path) if not storage.exists(image_path): f = storage.open(image_field.name, 'r') image = Image.open(f) if image.mode != 'RGB': image = image.convert('RGB') width, height = [int(i) for i in size.split('x')] image.thumbnail((width, height), Image.ANTIALIAS) f_scale = StringIO() image.save(f_scale, self.format, quality=self.quality) f_scale.seek(0) suf = SimpleUploadedFile(os.path.split(image_path)[-1].split('.')[0], f_scale.read(), content_type='image/{}'.format( self.format.lower())) return image_filename, suf return image_filename, None
33.19697
81
0.554998
1,751
0.799178
0
0
0
0
0
0
195
0.089
fa4086e519738ecfec5f5446255b7086204a17f6
872
py
Python
Virtual-Air-Painting-master/Virtual-Air-Painting-master/app.py
NikisCodes/Machine-Learning
649b5edcacd9063e6c37f596c8f930d578c84838
[ "MIT" ]
2
2021-08-30T08:04:04.000Z
2021-09-27T06:01:05.000Z
Virtual-Air-Painting-master/Virtual-Air-Painting-master/app.py
NikisCodes/Machine-Learning
649b5edcacd9063e6c37f596c8f930d578c84838
[ "MIT" ]
1
2022-02-08T00:01:16.000Z
2022-02-08T00:01:16.000Z
Virtual-Air-Painting-master/Virtual-Air-Painting-master/app.py
NikisCodes/Machine-Learning
649b5edcacd9063e6c37f596c8f930d578c84838
[ "MIT" ]
2
2021-10-02T01:10:57.000Z
2021-10-02T11:06:32.000Z
from flask import Flask, render_template, Response import cam import os import cv2 app = Flask(__name__,template_folder='templates') overlay_image=[] header_img = "Images" header_img_list = os.listdir(header_img) for i in header_img_list: image = cv2.imread(f'{header_img}/{i}') overlay_image.append(image) @app.route('/') def index(): return render_template('index.html') def gen(): cam1 = cam.VideoCamera(overlay_image= overlay_image) while True: frame = cam1.get_frame(overlay_image=overlay_image) yield (b'--frame\r\n' b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n\r\n') @app.route('/video_feed') def video_feed(): return Response(gen(), mimetype='multipart/x-mixed-replace; boundary=frame') if __name__ == '__main__': app.run(host='0.0.0.0', debug=False) #192.168.0.105
26.424242
73
0.668578
0
0
248
0.284404
213
0.244266
0
0
202
0.231651
fa41338567fef89f70ecebac376ac6af788cc919
3,159
py
Python
src/kolibree-changelog/commit_parser.py
kolibree-git/gitchangelog
267c29104b68db2b6665a8e6414876f7fe73d5dc
[ "BSD-3-Clause" ]
2
2021-01-12T15:10:37.000Z
2021-09-15T03:41:45.000Z
src/kolibree-changelog/commit_parser.py
kolibree-git/gitchangelog
267c29104b68db2b6665a8e6414876f7fe73d5dc
[ "BSD-3-Clause" ]
5
2021-01-13T11:14:43.000Z
2021-04-22T08:06:47.000Z
src/kolibree-changelog/commit_parser.py
kolibree-git/gitchangelog
267c29104b68db2b6665a8e6414876f7fe73d5dc
[ "BSD-3-Clause" ]
null
null
null
import os import re from pathlib import Path from urllib.parse import urlparse from github import Github class CommitParser(object): github_access_token: str repository: str jira_project: str jira_server: str def __init__(self, repository, jira_project, jira_server, github_access_token): self.repository = repository self.jira_project = jira_project self.jira_server = jira_server self.github_access_token = github_access_token @property def jira_regex_format(self) -> str: return f"({self.jira_project}-[0-9]*)" def jira_tickets(self, start_tag, end_tag) -> [str]: commits = self._get_commits(start_tag, end_tag) jira_tickets, github_prs = self._process_commits(commits, self.jira_regex_format) jira_tickets += self._get_jira_tickets_from_github(github_prs, self.jira_regex_format) return jira_tickets def _get_commits(self, start, end) -> [str]: return os.popen("git log --pretty=%s " + start + "..." + end) def _process_commits(self, commits: [str], regex_format: str) -> ([str], [str]): jira_ticket_regex = re.compile(regex_format) # Github adds pull request number (#XXXX) at the end of its title. github_pr_regex = re.compile("(\\(#[0-9]*\\))") jira_tickets: [str] = [] github_prs: [str] = [] for commit in commits: jira_search = jira_ticket_regex.search(commit) if jira_search is not None: jira_tickets.append(jira_search.group()) elif github_pr_regex.findall(commit): pr_number_text = github_pr_regex.findall(commit)[-1] # Keep only the PR number and remove (#). pr_number = pr_number_text.translate({ord(i): None for i in "()#"}) github_prs.append(pr_number) return (jira_tickets, github_prs) def _get_jira_tickets_from_github(self, github_prs: [str], regex_format: str): github = Github(self.github_access_token) repo = github.get_repo(self.repository) # Include the serve in the url. server_netloc = urlparse(self.jira_server).netloc url_regex = re.compile(f"https?:\\/\\/{server_netloc}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*{regex_format})") jira_ticket_regex = re.compile(regex_format) jira_tickets = [] for pr_number in github_prs: pr = repo.get_pull(int(pr_number)) url_match = url_regex.search(pr.body) if url_match is None: # If no url is found the PR will be skipped. continue jira_ticket_match = jira_ticket_regex.search(url_match.group()) url_path = Path(urlparse(url_match.group()).path) # In case the ticket ends with 1XXXX, the regex match will not contain the XXXX. # The match will be PROJECT-1, which is wrong. # This check is to exclude this results. if jira_ticket_match is not None and jira_ticket_match.group() == url_path.name: jira_tickets.append(jira_ticket_match.group()) return jira_tickets
40.5
110
0.639443
3,050
0.965495
0
0
96
0.030389
0
0
506
0.160177
fa41ceb73f01b6ed99614aa176053160f3a545b8
95
py
Python
flask_api/celery_tasks/sms/constants.py
FanLgchen/Celery-
409a609f476a84c421f718b9f1266c822bef1366
[ "MIT" ]
2
2020-06-18T09:39:13.000Z
2020-10-05T03:11:33.000Z
flask_api/celery_tasks/sms/constants.py
FanLgchen/Celery-
409a609f476a84c421f718b9f1266c822bef1366
[ "MIT" ]
null
null
null
flask_api/celery_tasks/sms/constants.py
FanLgchen/Celery-
409a609f476a84c421f718b9f1266c822bef1366
[ "MIT" ]
null
null
null
# 短信签名 SMS_SIGN = 'demo' # 短信验证码模板ID SMS_VERIFICATION_CODE_TEMPLATE_ID = 'SMS_151231777'
15.833333
52
0.747368
0
0
0
0
0
0
0
0
62
0.529915
fa42531a7368418d99794fa9d35b9936dd54e1ab
1,548
py
Python
intepreter_DM.py
arkasarius/python-IMDB-TFG
b375861f414b5402d150060479f33bc7391075d8
[ "MIT" ]
1
2021-12-20T16:41:47.000Z
2021-12-20T16:41:47.000Z
intepreter_DM.py
arkasarius/python-IMDB-TFG
b375861f414b5402d150060479f33bc7391075d8
[ "MIT" ]
13
2020-01-28T22:14:38.000Z
2022-03-11T23:58:02.000Z
intepreter_DM.py
arkasarius/python-IMDB-TFG
b375861f414b5402d150060479f33bc7391075d8
[ "MIT" ]
null
null
null
import calculos as c import os import matplotlib.pyplot as plt import numpy as np movie="Men in black" m="moviesdata" g="actordata" s='/' apidata=os.listdir(m+s+movie) actordata=os.listdir(g+s+movie) print(movie) print(apidata) print(actordata) DM=0.0 # 0.0 distancia minima posible AM=0 # 1.0 angle maxim posible x=[] y=[] while DM<2: DM=DM+0.01 # DM=1.2 x.append(DM) for unkownactor in apidata: act=c.extraerSublistaArchivo(m+s+movie+s+unkownactor) # print("\n") # print('{} subcaras para el actor {}'.format(len(act),unkownactor.strip('.txt'))) for subactor in actordata: currentactor=c.extraerSublistaArchivo(g+s+movie+s+subactor) count=0 for subcara in act: for caratest in currentactor: if(c.similitudCoseno(caratest,subcara)>AM): if(c.distanciaEuclidea(caratest,subcara)<DM): count=count+1 if(count>0): print('{} true per {}, {} vegades amb DM: {}'.format(subactor.strip('.txt'),unkownactor.strip('.txt'),count,DM)) y.append(count) else: y.append(0) # pass # print("no hi han cares valides per els coeficients AM : {} i DM: {} per l'actor {}".format(AM,DM,subactor.strip('.txt'))) # DM=50 # plt.style.use('bmh') plt.plot(x,y) plt.title(actordata[0].strip(".txt")) plt.xlabel("Coeficiente DM") plt.ylabel("Verdaderos positivos") plt.grid() plt.show()
28.145455
139
0.584625
0
0
0
0
0
0
0
0
460
0.297158
fa4355bb0816a184b890c91eceeef6ab585e1c75
6,972
py
Python
treqs/main.py
doctorgaby/treqs
3b29d6dcb4e6a8b25682d0e8da936f30d4848f09
[ "MIT" ]
1
2019-05-20T16:52:41.000Z
2019-05-20T16:52:41.000Z
treqs/main.py
doctorgaby/treqs
3b29d6dcb4e6a8b25682d0e8da936f30d4848f09
[ "MIT" ]
5
2019-05-14T18:27:25.000Z
2019-05-29T10:51:52.000Z
treqs/main.py
doctorgaby/treqs
3b29d6dcb4e6a8b25682d0e8da936f30d4848f09
[ "MIT" ]
null
null
null
#!/usr/bin/env python import getopt, sys, datetime, os from treqs import mUSProcessor, mSysReqProcessor, mTCProcessor def main(argv): #Default paths for respective files (user stories, test cases, system requirements). Can be provided as function arguments. usDir = 'requirements' tcDir = 'tests' sysReqDir = 'requirements' #Default patterns for respective filenames (user stories, test cases, system requirements). Can be provided as function arguments. usPattern = 'US_.*?\.md' tcPattern = 'TC_.*?(\.py|\.md)$' sysReqPattern = 'SR_.*?\.md' recursive = False quiet = False # argument options for this script. try: opts, args = getopt.getopt(argv[1:], "hu:s:t:r:q", ["help","usdir=","sysreqdir=","tcdir=","uspattern=","srpattern=","tcpattern="]) except getopt.GetoptError: print('Usage: ' + argv[0] + ' [-u <user story directory>] [-s <system requirements directory>] [-t <test case directory>] [-r] [-q]') sys.exit(2) for opt, arg in opts: if opt in ("-u", "--usdir"): usDir = os.path.normpath(arg) elif opt in ("-s", "--sysreqdir"): sysReqDir = os.path.normpath(arg) elif opt in ("-t", "--tcdir"): tcDir = os.path.normpath(arg) elif opt in ("--uspattern"): usPattern = os.path.normpath(arg) elif opt in ("--srpattern"): sysReqPattern = os.path.normpath(arg) elif opt in ("--tcpattern"): tcPattern = os.path.normpath(arg) elif opt in ("-r"): recursive = True elif opt in ("-q"): quiet = True elif opt in ("-h", "--help"): print('Usage: ' + argv[0] + ' -u <user story directory> -s <system requirements directory> -t <test case directory> [-r]') sys.exit(2) try: os.makedirs('logs') except OSError: if not os.path.isdir('logs'): raise #Do all the data processing here reqProcessor = mSysReqProcessor.SysReqsProcessor() success = reqProcessor.processAllLines(sysReqDir, recursive, sysReqPattern) usProcessor = mUSProcessor.USProcessor() success = usProcessor.processAllUS(usDir, recursive, usPattern) and success tcProcessor = mTCProcessor.TCProcessor() success = tcProcessor.processAllTC(tcDir, recursive, tcPattern) and success #Get all the user stories and traces to them existingStories = usProcessor.storySet tracedStoriesFromReqs = reqProcessor.storySet tracedStoriesFromTests = tcProcessor.storySet #Calculate which story IDs are not traced to diffUSReq = existingStories.difference(tracedStoriesFromReqs) diffUSTests = existingStories.difference(tracedStoriesFromTests) #Calculate whether there are any traces to non-existing stories nonExistingUSReqs = tracedStoriesFromReqs.difference(existingStories) nonExistingUSTests = tracedStoriesFromTests.difference(existingStories) #Get all the requirements and traces to them existingReqs = reqProcessor.reqIDSet tracedReqsFromTests = tcProcessor.reqSet #Calculate which Req IDs are not traced to diffReqTests = existingReqs.difference(tracedReqsFromTests) #Calculate which Req IDs are traced to but do not exist nonExistingReqTC = tracedReqsFromTests.difference(existingReqs) #Get all duplicate IDs duplicateUS = usProcessor.duplicateStorySet duplicateTC = tcProcessor.duplicateIDSet duplicateReq = reqProcessor.duplicateIDSet #Get all IDs of artifacts missing traces reqsWithoutUSTraces = reqProcessor.noUSTracingSet testsWithoutUSTraces = tcProcessor.noUSTracingSet testsWithoutReqTraces = tcProcessor.noReqTracingSet if success and (len(nonExistingUSReqs)>0 or len(nonExistingUSTests)>0 or len(nonExistingReqTC)>0): success = False filename = 'logs/Summary_log_'+datetime.datetime.now().strftime("%Y%m%d%H%M%S")+'.md' log = open(filename,"w") log.write('# T-Reqs commit report #\n\n') log.write('### Duplicate IDs ###\n') log.write('The following duplicate User Story IDs exist:\n\n') for currentID in duplicateUS: log.write('* User Story ' + currentID + '\n') log.write('\n') log.write('The following duplicate System Requirement IDs exist:\n\n') for currentID in duplicateReq: log.write('* System Requirement ' + currentID + '\n') log.write('\n') log.write('The following duplicate Test Case IDs exist:\n\n') for currentID in duplicateTC: log.write('* Test Case ' + currentID + '\n') log.write('\n') log.write('### Items without traces ###\n') log.write('The following System Requirements lack traces to user stories:\n\n') for currentID in reqsWithoutUSTraces: log.write('* System Requirement ' + currentID + '\n') log.write('\n') log.write('The following Test Cases lack traces to user stories:\n\n') for currentID in testsWithoutUSTraces: log.write('* Test Case ' + currentID + '\n') log.write('\n') log.write('The following Test Cases lack traces to system requirements:\n\n') for currentID in testsWithoutReqTraces: log.write('* Test Case ' + currentID + '\n') log.write('\n') log.write('### Missing traces ###\n') log.write('The following user stories are not referenced by any system requirement:\n\n') for currentID in diffUSReq: log.write('* User Story ' + currentID + '\n') log.write('\n') log.write('The following user stories are not referenced by any test case:\n\n') for currentID in diffUSTests: log.write('* User Story ' + currentID + '\n') log.write('\n') log.write('The following system requirements are not referenced by any test case:\n\n') for currentID in diffReqTests: log.write('* System Requirement ' + currentID + '\n') log.write('\n') log.write('### Missing items ###\n') log.write('The following user stories are referenced by requirements, but do not exist:\n\n') for currentID in nonExistingUSReqs: log.write('* User Story ' + currentID + '\n') log.write('\n') log.write('The following user stories are referenced by test cases, but do not exist:\n\n') for currentID in nonExistingUSTests: log.write('* User Story ' + currentID + '\n') log.write('\n') log.write('The following requirements are referenced by test cases, but do not exist:\n\n') for currentID in nonExistingReqTC: log.write('* Requirement ' + currentID + '\n') log.close() #Return -1 if the validation has failed, and print the log to the console if not success and not quiet: print('Validation failed with the following output:\n') with open(filename, 'r') as f: print(f.read()) return -1 if __name__ == '__main__': main(sys.argv)
39.84
141
0.65218
0
0
0
0
0
0
0
0
2,611
0.374498
fa43b597655c8ece381492f9839c331ed4d476a7
1,836
py
Python
nudging/model/xregressor.py
UtrechtUniversity/nudging
9eb1b77749f36059d0c03e60338308ed2e1ebe3d
[ "MIT" ]
1
2021-11-08T15:14:07.000Z
2021-11-08T15:14:07.000Z
nudging/model/xregressor.py
UtrechtUniversity/nudging
9eb1b77749f36059d0c03e60338308ed2e1ebe3d
[ "MIT" ]
6
2021-12-07T11:05:19.000Z
2022-03-21T09:05:52.000Z
nudging/model/xregressor.py
UtrechtUniversity/nudging
9eb1b77749f36059d0c03e60338308ed2e1ebe3d
[ "MIT" ]
null
null
null
import numpy as np from sklearn.base import clone from nudging.model.base import BaseModel from nudging.model.biregressor import BiRegressor class XRegressor(BaseModel): """Class for X-learner regression See https://www.pnas.org/cgi/doi/10.1073/pnas.1804597116. It trains two BiRegressors (T-learners) and then uses a crossover mechanism. """ def __init__(self, model, predictors=None, **kwargs): super().__init__(model, predictors, **kwargs) self.biregressor = BiRegressor(model, predictors=predictors) self.nudge_control_model = clone(model) self.control_nudge_model = clone(model) def _fit(self, X, nudge, outcome): self.biregressor._fit(X, nudge, outcome) nudge_idx = np.where(nudge == 1)[0] control_idx = np.where(nudge == 0)[0] self.nudge_propensity = len(nudge_idx)/(len(nudge_idx) + len(control_idx)) imputed_treatment_control = outcome[nudge_idx] - self.biregressor._predict( X[nudge_idx], 1-nudge[nudge_idx]) imputed_treatment_nudge = self.biregressor._predict( X[control_idx], 1-nudge[control_idx]) - outcome[control_idx] self.nudge_control_model.fit(X[nudge_idx], imputed_treatment_control) self.control_nudge_model.fit(X[control_idx], imputed_treatment_nudge) def train(self, data): self._fit(*self._X_nudge_outcome(data)) def _predict(self, X, nudge): control_cate = self.control_nudge_model.predict(X) nudge_cate = self.nudge_control_model.predict(X) cate = (1-self.nudge_propensity)*control_cate + self.nudge_propensity*nudge_cate base_pred = self.biregressor._predict(X, np.zeros_like(nudge)) return base_pred + cate*nudge def predict_outcome(self, data): return self._predict(*self._X_nudge(data))
41.727273
88
0.70098
1,691
0.921024
0
0
0
0
0
0
185
0.100763
fa44f06aa862871b09d8f10126a6cb038bef569f
47
py
Python
manabi/apps/manabi_auth/tests.py
aehlke/manabi
1dfdd4ecb9c1214b6a70268be0dcfeda9da8754b
[ "MIT" ]
14
2015-10-03T07:34:28.000Z
2021-09-20T07:10:29.000Z
manabi/apps/manabi_auth/tests.py
aehlke/manabi
1dfdd4ecb9c1214b6a70268be0dcfeda9da8754b
[ "MIT" ]
23
2019-10-25T08:47:23.000Z
2022-01-30T02:00:45.000Z
manabi/apps/manabi_auth/tests.py
aehlke/manabi
1dfdd4ecb9c1214b6a70268be0dcfeda9da8754b
[ "MIT" ]
7
2016-10-04T08:10:36.000Z
2021-09-20T07:10:33.000Z
from manabi.test_helpers import ManabiTestCase
23.5
46
0.893617
0
0
0
0
0
0
0
0
0
0
fa45ee2b30c21b649c70d296ce4c04a107be0de7
437
py
Python
v1/convert.py
jelson/aqi
96e3d9646130a8128aba9c190dcb85d7a7efba50
[ "MIT" ]
7
2021-08-25T08:00:22.000Z
2022-01-10T19:04:08.000Z
v1/convert.py
jelson/aqi
96e3d9646130a8128aba9c190dcb85d7a7efba50
[ "MIT" ]
null
null
null
v1/convert.py
jelson/aqi
96e3d9646130a8128aba9c190dcb85d7a7efba50
[ "MIT" ]
1
2021-11-03T04:20:05.000Z
2021-11-03T04:20:05.000Z
#!/usr/bin/env python3 # One-time use script to convert previous log file format into JSON import json out = {} for line in open("old-airq").readlines(): fields = line.split() if 'PM 1.0' in line: date = " ".join(fields[0:3]) out['pm1.0'] = fields[6] if 'PM 2.5' in line: out['pm2.5'] = fields[6] if 'PM 10.0' in line: out['pm10'] = fields[6] print(f"{date} {json.dumps(out)}")
24.277778
67
0.558352
0
0
0
0
0
0
0
0
174
0.398169
fa4698576c49e303d27410cd349021ad4c704508
1,796
py
Python
src/vocab.py
janoschhaber/textstyletransfer
0960e695437910b420abbe5cf76dc680b8af7643
[ "Apache-2.0" ]
null
null
null
src/vocab.py
janoschhaber/textstyletransfer
0960e695437910b420abbe5cf76dc680b8af7643
[ "Apache-2.0" ]
null
null
null
src/vocab.py
janoschhaber/textstyletransfer
0960e695437910b420abbe5cf76dc680b8af7643
[ "Apache-2.0" ]
null
null
null
import numpy as np from numpy import linalg as LA import pickle from collections import Counter import csv class Vocabulary(object): def __init__(self, vocab_file, emb_file='', dim_emb=0): with open(vocab_file, 'rb') as f: self.size, self.word2id, self.id2word = pickle.load(f) self.dim_emb = dim_emb self.embedding = np.random.random_sample( (self.size, self.dim_emb)) - 0.5 if emb_file: with open(emb_file) as f: for line in f: parts = line.split() word = parts[0] vec = np.array([float(x) for x in parts[1:]]) if word in self.word2id: self.embedding[self.word2id[word]] = vec for i in range(self.size): self.embedding[i] /= LA.norm(self.embedding[i]) def build_vocab(data, vocab_path, vocab_metadata_path, min_occur=5): word2id = {'<pad>':0, '<go>':1, '<eos>':2, '<unk>':3} id2word = ['<pad>', '<go>', '<eos>', '<unk>'] words = [word for sent in data for word in sent] cnt = Counter(words) for word in cnt: if cnt[word] >= min_occur: word2id[word] = len(word2id) id2word.append(word) vocab_size = len(word2id) with open(vocab_path, 'wb') as f: pickle.dump((vocab_size, word2id, id2word), f, pickle.HIGHEST_PROTOCOL) """Writes metadata file for Tensorboard word embedding visualizer as described here: https://www.tensorflow.org/get_started/embedding_viz """ print("Writing word embedding metadata file to %s" % (vocab_metadata_path)) with open(vocab_metadata_path, "w") as f: fieldnames = ['word'] writer = csv.DictWriter(f, delimiter="\t", fieldnames=fieldnames) for w in id2word: writer.writerow({"word": w})
35.92
88
0.611359
698
0.388641
0
0
0
0
0
0
278
0.154788
fa47150e782b7ef30a60052a4f1b959b3b1766a3
432
py
Python
model/algorithms/__init__.py
nertsam/DAGsched
dcd431384fe1dd3f0f55a9287fc980f2b445beaf
[ "MIT" ]
null
null
null
model/algorithms/__init__.py
nertsam/DAGsched
dcd431384fe1dd3f0f55a9287fc980f2b445beaf
[ "MIT" ]
null
null
null
model/algorithms/__init__.py
nertsam/DAGsched
dcd431384fe1dd3f0f55a9287fc980f2b445beaf
[ "MIT" ]
null
null
null
def required_model(name: object, kwargs: object) -> object: required_fields = kwargs['required_fields'] if 'required_fields' in kwargs else [] task_f = kwargs['required_task_fields'] if 'required_task_fields' in kwargs else [] proc_f = kwargs['required_proc_fields'] if 'required_proc_fields' in kwargs else [] display_name = kwargs['display_name'] if 'display_name' in kwargs else name def f(klass): return klass return f
43.2
84
0.761574
0
0
0
0
0
0
0
0
150
0.347222
fa47561e4fca5e7d0a34320e88d5fab9b997b427
4,929
py
Python
tests/test_ERC721_Pausable.py
georgercarder/cairo-contracts
b661e1b65686820fa020c47c3c29a4951bb04547
[ "MIT" ]
null
null
null
tests/test_ERC721_Pausable.py
georgercarder/cairo-contracts
b661e1b65686820fa020c47c3c29a4951bb04547
[ "MIT" ]
null
null
null
tests/test_ERC721_Pausable.py
georgercarder/cairo-contracts
b661e1b65686820fa020c47c3c29a4951bb04547
[ "MIT" ]
null
null
null
import pytest import asyncio from starkware.starknet.testing.starknet import Starknet from utils import Signer, str_to_felt, assert_revert signer = Signer(123456789987654321) # bools (for readability) false = 0 true = 1 # random uint256 tokenIDs first_token_id = (5042, 0) second_token_id = (7921, 1) third_token_id = (0, 13) # random data (mimicking bytes in Solidity) data = [str_to_felt('0x42'), str_to_felt('0x89'), str_to_felt('0x55')] @pytest.fixture(scope='module') def event_loop(): return asyncio.new_event_loop() @pytest.fixture(scope='function') async def erc721_factory(): starknet = await Starknet.empty() owner = await starknet.deploy( "contracts/Account.cairo", constructor_calldata=[signer.public_key] ) other = await starknet.deploy( "contracts/Account.cairo", constructor_calldata=[signer.public_key] ) erc721 = await starknet.deploy( "contracts/token/ERC721_Pausable.cairo", constructor_calldata=[ str_to_felt("Non Fungible Token"), # name str_to_felt("NFT"), # ticker owner.contract_address # owner ] ) erc721_holder = await starknet.deploy("contracts/token/utils/ERC721_Holder.cairo") # mint tokens to owner tokens = [first_token_id, second_token_id] for token in tokens: await signer.send_transaction( owner, erc721.contract_address, 'mint', [ owner.contract_address, *token] ) return starknet, erc721, owner, other, erc721_holder @pytest.mark.asyncio async def test_pause(erc721_factory): _, erc721, owner, other, erc721_holder = erc721_factory # pause await signer.send_transaction(owner, erc721.contract_address, 'pause', []) execution_info = await erc721.paused().call() assert execution_info.result.paused == 1 await assert_revert(signer.send_transaction( owner, erc721.contract_address, 'approve', [ other.contract_address, *first_token_id ]) ) await assert_revert(signer.send_transaction( owner, erc721.contract_address, 'setApprovalForAll', [ other.contract_address, true ]) ) await assert_revert(signer.send_transaction( owner, erc721.contract_address, 'transferFrom', [ owner.contract_address, other.contract_address, *first_token_id ]) ) await assert_revert(signer.send_transaction( owner, erc721.contract_address, 'safeTransferFrom', [ owner.contract_address, erc721_holder.contract_address, *first_token_id, len(data), *data ]) ) await assert_revert(signer.send_transaction( owner, erc721.contract_address, 'mint', [ other.contract_address, *third_token_id ]) ) @pytest.mark.asyncio async def test_unpause(erc721_factory): _, erc721, owner, other, erc721_holder = erc721_factory # pause await signer.send_transaction(owner, erc721.contract_address, 'pause', []) # unpause await signer.send_transaction(owner, erc721.contract_address, 'unpause', []) execution_info = await erc721.paused().call() assert execution_info.result.paused == 0 await signer.send_transaction( owner, erc721.contract_address, 'approve', [ other.contract_address, *first_token_id ] ) await signer.send_transaction( owner, erc721.contract_address, 'setApprovalForAll', [ other.contract_address, true ] ) await signer.send_transaction( owner, erc721.contract_address, 'transferFrom', [ owner.contract_address, other.contract_address, *first_token_id ] ) await signer.send_transaction( other, erc721.contract_address, 'safeTransferFrom', [ owner.contract_address, erc721_holder.contract_address, *second_token_id, len(data), *data ] ) await signer.send_transaction( owner, erc721.contract_address, 'mint', [ other.contract_address, *third_token_id ] ) @pytest.mark.asyncio async def test_only_owner(erc721_factory): _, erc721, owner, other, _ = erc721_factory # not-owner pause should revert await assert_revert(signer.send_transaction( other, erc721.contract_address, 'pause', [])) # owner pause await signer.send_transaction(owner, erc721.contract_address, 'pause', []) # not-owner unpause should revert await assert_revert(signer.send_transaction( other, erc721.contract_address, 'unpause', [])) # owner unpause await signer.send_transaction(owner, erc721.contract_address, 'unpause', [])
27.082418
86
0.64435
0
0
0
0
4,468
0.906472
4,286
0.869548
637
0.129235
fa483b3f10489cad64a57007f1b02b4ab7eddb87
445
py
Python
python_scripts/countries_dates.py
tuxskar/elpythonista
ac0cd45e97dffcf6a40d1566fdee5b01380f535a
[ "MIT" ]
2
2021-09-13T16:26:26.000Z
2021-10-04T04:40:11.000Z
python_scripts/countries_dates.py
tuxskar/elpythonista
ac0cd45e97dffcf6a40d1566fdee5b01380f535a
[ "MIT" ]
null
null
null
python_scripts/countries_dates.py
tuxskar/elpythonista
ac0cd45e97dffcf6a40d1566fdee5b01380f535a
[ "MIT" ]
null
null
null
from datetime import datetime import pytz if __name__ == '__main__': places_tz = ['Asia/Tokyo', 'Europe/Madrid', 'America/Argentina/Buenos_Aires', 'US/eastern', 'US/Pacific', 'UTC'] cities_name = ['Tokyo', 'Madrid', 'Buenos Aires', 'New York', 'California', 'UTC'] for place_tz, city_name in zip(places_tz, cities_name): city_time = datetime.now(pytz.timezone(place_tz)) print(f'Fecha en {city_name} - {city_time}')
44.5
116
0.678652
0
0
0
0
0
0
0
0
191
0.429213
fa48f487c0f61d98b503010843e5e1dd19fce9a8
5,871
py
Python
algebra_utilities/structures/semigroup.py
computational-group-the-golden-ticket/AlgebraUtilities
d5c7c2806b6bd394564ae4146a2c5164f4ebe882
[ "MIT" ]
null
null
null
algebra_utilities/structures/semigroup.py
computational-group-the-golden-ticket/AlgebraUtilities
d5c7c2806b6bd394564ae4146a2c5164f4ebe882
[ "MIT" ]
null
null
null
algebra_utilities/structures/semigroup.py
computational-group-the-golden-ticket/AlgebraUtilities
d5c7c2806b6bd394564ae4146a2c5164f4ebe882
[ "MIT" ]
null
null
null
from algebra_utilities.objects.baseobjects import * from algebra_utilities.structures.baseobjects import Printable from algebra_utilities.utils.errors import UnexpectedTypeError from algebra_utilities.utils.errors import NonAssociativeSetError from algebra_utilities.utils.errors import ElementsOverflow class SemiGroup(Printable): """ Esta clase representa un semigrupo, un semigrupo es un conjunto no vacio S con una operacion binaria multiplicacion (*): S x S -> S que es asociativa Atributos --------- generators: lista con los elementos generadores del semigrupo name: nombre del semigrupo """ def __init__(self, generators, name='G'): super(SemiGroup, self).__init__() # nombre del semigrupo self.name = name # todos los generadores deben heredar de SemiAlgebraicObject o de # AlgebraicObject, para asegurar la definicion de operaciones basicas for generator in generators: if not isinstance(generator, SemiAlgebraicObject) and \ not isinstance(generator, AlgebraicObject): raise UnexpectedTypeError('The objects has an invalid type in SemiGroup initialization') # lista de los generadores del semigrupo, esta podria coincidir con la # lista de todos los elementos del semigrupo self.generators = generators # TODO: discutir si se guardan los elementos en un "list" o en un "set" self.elements = self.generate_elements(generators) # un semigrupo es un conjunto con una operacion binaria que ademas es # asociativa if not self.check_associativity(): raise NonAssociativeSetError('The operation defined is not associative') def __len__(self): return len(self.elements) def generate_orbit(self, element): """ Este metodo genera (de forma iterativa) todas las potencias (bajo la operacion) de un elemento dado hasta llegar a la identidad """ orbit = [] pow_element = element while pow_element not in orbit: orbit.append(pow_element) # potencias pow_element *= element return orbit def remove_repeating_elements(self, elements): """ Este metodo elimina elementos repetidos en la lista pasada como argumento """ dummy = [] for element in elements: if element not in dummy: dummy.append(element) return dummy def all_posible_multiplication(self, elements, limit=-1): """ Este metodo realiza todas las posibles multiplicaciones entre los elementos pasados como argumentos y aquellos que se van generando """ old_length = -1 current_length = len(elements) # la longitud de la lista cambia siempre que aparezcan nuevos elementos while old_length != current_length: # TODO: this is a bottle and must be reimplemented for i in range(current_length): for j in range(current_length): # no siempre el producto es conmutativo left_multiplication = elements[i] * elements[j] right_multiplication = elements[j] * elements[i] if left_multiplication not in elements: elements.append(left_multiplication) if right_multiplication not in elements: elements.append(right_multiplication) # se actualiza el valor de la longitud current_length, old_length = len(elements), current_length if limit > 0 and current_length > limit: raise ElementsOverflow('Limit of allowed elements exceeded in the generation of elements') return elements def generate_elements(self, generators): """ Este metodo genera todos los elementos del grupo """ elements = [] # se generan las orbitas de cada generador for generator in generators: elements.extend(self.generate_orbit(generator)) # se eliminan elementos repetidos y se realizan todas las posibles # multiplicaciones elements = self.remove_repeating_elements(elements) elements = self.all_posible_multiplication(elements) return elements def add_element(self, element): """ Este metodo agrega un nuevo generador al grupo y genera los nuevos elementos """ # chequeo de tipo if not isinstance(generator, SemiAlgebraicObject) and \ not isinstance(generator, AlgebraicObject): raise UnexpectedTypeError('The objects has an invalid type in element aggregation') if element not in self.elements: self.elements.extend(self.generate_orbit(element)) self.elements = self.all_posible_multiplication(self.elements) def check_associativity(self): # TODO: buscar un algoritmo de orden menor a n^3 for a in self.elements: for b in self.elements: for c in self.elements: if a * (b * c) != (a * b) * c: return False return True def get_cayley_table(self, a=None, b=None): """ Este metodo muestra todas las posibles multiplicaciones """ if a is None: a = self.elements if b is None: b = self.elements for i in range(len(a)): for j in range(len(b)): c = a[i] * b[j] print('%s * %s = %s' % (a[i], b[j], c))
35.79878
107
0.607392
5,554
0.946006
0
0
0
0
0
0
2,092
0.356328
fa49a5157a06abdd46d0a0ba0bf6a84c8195c2b0
254
py
Python
output/models/nist_data/atomic/duration/schema_instance/nistschema_sv_iv_atomic_duration_pattern_1_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
1
2021-08-14T17:59:21.000Z
2021-08-14T17:59:21.000Z
output/models/nist_data/atomic/duration/schema_instance/nistschema_sv_iv_atomic_duration_pattern_1_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
4
2020-02-12T21:30:44.000Z
2020-04-15T20:06:46.000Z
output/models/nist_data/atomic/duration/schema_instance/nistschema_sv_iv_atomic_duration_pattern_1_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
null
null
null
from output.models.nist_data.atomic.duration.schema_instance.nistschema_sv_iv_atomic_duration_pattern_1_xsd.nistschema_sv_iv_atomic_duration_pattern_1 import NistschemaSvIvAtomicDurationPattern1 __all__ = [ "NistschemaSvIvAtomicDurationPattern1", ]
42.333333
194
0.893701
0
0
0
0
0
0
0
0
38
0.149606
fa4a9590535f2f2f51967fa4d5315e7a3e030581
1,590
py
Python
venv/lib/python3.7/site-packages/tigeropen/common/consts/service_types.py
CatTiger/vnpy
7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b
[ "MIT" ]
null
null
null
venv/lib/python3.7/site-packages/tigeropen/common/consts/service_types.py
CatTiger/vnpy
7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b
[ "MIT" ]
1
2020-04-21T02:42:32.000Z
2020-04-21T02:42:32.000Z
venv/lib/python3.7/site-packages/tigeropen/common/consts/service_types.py
CatTiger/vnpy
7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on 2018/9/20 @author: gaoan """ ORDER_NO = "order_no" PREVIEW_ORDER = "preview_order" PLACE_ORDER = "place_order" CANCEL_ORDER = "cancel_order" MODIFY_ORDER = "modify_order" """ 账户/资产 """ ACCOUNTS = "accounts" ASSETS = "assets" POSITIONS = "positions" ORDERS = "orders" ACTIVE_ORDERS = "active_orders" # 待成交订单 INACTIVE_ORDERS = "inactive_orders" # 已撤销订单 FILLED_ORDERS = "filled_orders" # 已成交订单 """ 合约 """ CONTRACT = "contract" CONTRACTS = "contracts" """ 行情 """ MARKET_STATE = "market_state" ALL_SYMBOLS = "all_symbols" ALL_SYMBOL_NAMES = "all_symbol_names" BRIEF = "brief" STOCK_DETAIL = "stock_detail" TIMELINE = "timeline" KLINE = "kline" TRADE_TICK = "trade_tick" QUOTE_REAL_TIME = "quote_real_time" QUOTE_SHORTABLE_STOCKS = "quote_shortable_stocks" QUOTE_STOCK_TRADE = "quote_stock_trade" # 期权行情 OPTION_EXPIRATION = "option_expiration" OPTION_CHAIN = "option_chain" OPTION_BRIEF = "option_brief" OPTION_KLINE = "option_kline" OPTION_TRADE_TICK = "option_trade_tick" # 期货行情 FUTURE_EXCHANGE = "future_exchange" FUTURE_CONTRACT_BY_CONTRACT_CODE = "future_contract_by_contract_code" FUTURE_CONTRACT_BY_EXCHANGE_CODE = "future_contract_by_exchange_code" FUTURE_CONTINUOUS_CONTRACTS = "future_continuous_contracts" FUTURE_CURRENT_CONTRACT = "future_current_contract" FUTURE_KLINE = "future_kline" FUTURE_REAL_TIME_QUOTE = "future_real_time_quote" FUTURE_TICK = "future_tick" FUTURE_TRADING_DATE = "future_trading_date" # 公司行动, 财务数据 FINANCIAL_DAILY = 'financial_daily' FINANCIAL_REPORT = 'financial_report' CORPORATE_ACTION = 'corporate_action'
23.382353
69
0.784906
0
0
0
0
0
0
0
0
893
0.535372
fa4b58e784df0a2ddab274bac344bf702ab449fb
540
py
Python
setup.py
ianhalpern/python-payment-processor
64fb785373082da19a572097b738da4dd71bd985
[ "MIT" ]
12
2016-11-11T10:31:25.000Z
2022-03-25T12:51:22.000Z
setup.py
ianhalpern/python-payment-processor
64fb785373082da19a572097b738da4dd71bd985
[ "MIT" ]
null
null
null
setup.py
ianhalpern/python-payment-processor
64fb785373082da19a572097b738da4dd71bd985
[ "MIT" ]
3
2017-09-06T15:06:29.000Z
2019-03-22T14:20:31.000Z
#!/usr/bin/python from distutils.core import setup setup( name = 'payment_processor', version = '0.2.0', description = 'A simple payment gateway api wrapper', author = 'Ian Halpern', author_email = 'ian@ian-halpern.com', url = 'https://launchpad.net/python-payment', download_url = 'https://launchpad.net/python-payment/+download', packages = ( 'payment_processor', 'payment_processor.gateways', 'payment_processor.methods', 'payment_processor.exceptions', 'payment_processor.utils' ) )
27
65
0.681481
0
0
0
0
0
0
0
0
330
0.611111
fa4b934831124cd9b5f4a62ff35dd46a0ab12e15
6,513
py
Python
src/ranking_utils/lightning/datasets.py
fknauf/ranking-utils
ce1a0be4e560d5f156a76cb5c0e3751793c67648
[ "MIT" ]
null
null
null
src/ranking_utils/lightning/datasets.py
fknauf/ranking-utils
ce1a0be4e560d5f156a76cb5c0e3751793c67648
[ "MIT" ]
null
null
null
src/ranking_utils/lightning/datasets.py
fknauf/ranking-utils
ce1a0be4e560d5f156a76cb5c0e3751793c67648
[ "MIT" ]
null
null
null
from pathlib import Path from typing import Any, Tuple import abc import h5py from torch.utils.data import Dataset # inputs vary for each model, hence we use Any here Input = Any PairwiseTrainingInput = Tuple[Input, Input] PointwiseTrainingInput = Tuple[Input, int] ValTestInput = Tuple[int, int, Input, int] class PointwiseTrainDatasetBase(Dataset, abc.ABC): """Abstract base class for pointwise training datasets. Methods to be implemented: * get_single_input * collate_fn (optional) Args: data_file (Path): Data file containing queries and documents train_file (Path): Trainingset file """ def __init__(self, data_file: Path, train_file: Path): self.data_file = data_file self.train_file = train_file with h5py.File(train_file, "r") as fp: self.length = len(fp["q_ids"]) @abc.abstractmethod def get_single_input(self, query: str, doc: str) -> Input: """Create a single model input from a query and a document. Args: query (str): The query doc (str): The document Returns: Input: The model input """ pass def __getitem__(self, index: int) -> PointwiseTrainingInput: """Return inputs and label for pointwise training. Args: index (int): Item index Returns: PointwiseTrainingInput: Inputs and label for pointwise training """ with h5py.File(self.train_file, "r") as fp: q_id = fp["q_ids"][index] doc_id = fp["doc_ids"][index] label = fp["labels"][index] with h5py.File(self.data_file, "r") as fp: query = fp["queries"].asstr()[q_id] doc = fp["docs"].asstr()[doc_id] return self.get_single_input(query, doc), label def __len__(self) -> int: """Number of training instances. Returns: int: The dataset length """ return self.length class PairwiseTrainDatasetBase(Dataset, abc.ABC): """Abstract base class for pairwise training datasets. Methods to be implemented: * get_single_input * collate_fn (optional) Args: data_file (Path): Data file containing queries and documents train_file (Path): Trainingset file """ def __init__(self, data_file: Path, train_file: Path): self.data_file = data_file self.train_file = train_file with h5py.File(train_file, "r") as fp: self.length = len(fp["q_ids"]) @abc.abstractmethod def get_single_input(self, query: str, doc: str) -> Input: """Create a single model input from a query and a document. Args: query (str): The query doc (str): The document Returns: Input: The model input """ pass def __getitem__(self, index: int) -> PairwiseTrainingInput: """Return a pair of positive and negative inputs for pairwise training. Args: index (int): Item index Returns: PairwiseTrainingInput: Positive and negative inputs for pairwise training """ with h5py.File(self.train_file, "r") as fp: q_id = fp["q_ids"][index] pos_doc_id = fp["pos_doc_ids"][index] neg_doc_id = fp["neg_doc_ids"][index] with h5py.File(self.data_file, "r") as fp: query = fp["queries"].asstr()[q_id] pos_doc = fp["docs"].asstr()[pos_doc_id] neg_doc = fp["docs"].asstr()[neg_doc_id] return ( self.get_single_input(query, pos_doc), self.get_single_input(query, neg_doc), ) def __len__(self) -> int: """Number of training instances. Returns: int: The dataset length """ return self.length class ValTestDatasetBase(Dataset, abc.ABC): """Abstract base class for validation/testing datasets. Methods to be implemented: * get_single_input * collate_fn (optional) The datasets yields internal integer IDs that can be held by tensors. The original IDs can be recovered using `get_original_query_id` and `get_original_document_id`. Args: data_file (Path): Data file containing queries and documents val_test_file (Path): Validation-/testset file """ def __init__(self, data_file: Path, val_test_file: Path): self.data_file = data_file self.val_test_file = val_test_file with h5py.File(val_test_file, "r") as fp: self.length = len(fp["q_ids"]) def get_original_query_id(self, q_id: int) -> str: """Return the original (string) query ID for a given internal ID. Args: q_id (int): Internal query ID Returns: str: Original query ID """ with h5py.File(self.data_file, "r") as fp: return fp["orig_q_ids"].asstr()[q_id] def get_original_document_id(self, doc_id: int) -> str: """Return the original (string) document ID for a given internal ID. Args: doc_id (int): Internal document ID Returns: str: Original document ID """ with h5py.File(self.data_file, "r") as fp: return fp["orig_doc_ids"].asstr()[doc_id] @abc.abstractmethod def get_single_input(self, query: str, doc: str) -> Input: """Create a single model input from a query and a document. Args: query (str): The query doc (str): The document Returns: Input: The model input """ pass def __getitem__(self, index: int) -> ValTestInput: """Return an item. Args: index (int): Item index Returns: ValTestInput: Query ID, input and label """ with h5py.File(self.val_test_file, "r") as fp: q_id = fp["q_ids"][index] doc_id = fp["doc_ids"][index] label = fp["labels"][index] with h5py.File(self.data_file, "r") as fp: query = fp["queries"].asstr()[q_id] doc = fp["docs"].asstr()[doc_id] # return the internal query and document IDs here return q_id, doc_id, self.get_single_input(query, doc), label def __len__(self) -> int: """Number of validation/testing instances. Returns: int: The dataset length """ return self.length
29.206278
99
0.594043
6,192
0.950714
0
0
942
0.144634
0
0
3,231
0.496085
fa4c5e2c67d5f8e3cdc1d31a4e00b2fd7c6a269b
6,301
py
Python
tests/unit/lib/logs/test_formatter.py
OscarVanL/aws-sam-cli
13e02ae53ac3a4484acd74c944123921e27823f3
[ "Apache-2.0" ]
null
null
null
tests/unit/lib/logs/test_formatter.py
OscarVanL/aws-sam-cli
13e02ae53ac3a4484acd74c944123921e27823f3
[ "Apache-2.0" ]
null
null
null
tests/unit/lib/logs/test_formatter.py
OscarVanL/aws-sam-cli
13e02ae53ac3a4484acd74c944123921e27823f3
[ "Apache-2.0" ]
null
null
null
import json from unittest import TestCase from mock import Mock, patch, call from nose_parameterized import parameterized from samcli.lib.logs.formatter import LogsFormatter, LambdaLogMsgFormatters, KeywordHighlighter, JSONMsgFormatter from samcli.lib.logs.event import LogEvent class TestLogsFormatter_pretty_print_event(TestCase): def setUp(self): self.colored_mock = Mock() self.group_name = "group name" self.stream_name = "stream name" self.message = "message" self.event_dict = {"timestamp": 1, "message": self.message, "logStreamName": self.stream_name} def test_must_serialize_event(self): colored_timestamp = "colored timestamp" colored_stream_name = "colored stream name" self.colored_mock.yellow.return_value = colored_timestamp self.colored_mock.cyan.return_value = colored_stream_name event = LogEvent(self.group_name, self.event_dict) expected = " ".join([colored_stream_name, colored_timestamp, self.message]) result = LogsFormatter._pretty_print_event(event, self.colored_mock) self.assertEquals(expected, result) self.colored_mock.yellow.has_calls() self.colored_mock.cyan.assert_called_with(self.stream_name) def _passthru_formatter(event, colored): return event class TestLogsFormatter_do_format(TestCase): def setUp(self): self.colored_mock = Mock() # Set formatter chain method to return the input unaltered. self.chain_method1 = Mock(wraps=_passthru_formatter) self.chain_method2 = Mock(wraps=_passthru_formatter) self.chain_method3 = Mock(wraps=_passthru_formatter) self.formatter_chain = [self.chain_method1, self.chain_method2, self.chain_method3] @patch.object(LogsFormatter, "_pretty_print_event", wraps=_passthru_formatter) def test_must_map_formatters_sequentially(self, pretty_print_mock): events_iterable = [1, 2, 3] expected_result = [1, 2, 3] expected_call_order = [ call(1, colored=self.colored_mock), call(2, colored=self.colored_mock), call(3, colored=self.colored_mock), ] formatter = LogsFormatter(self.colored_mock, self.formatter_chain) result_iterable = formatter.do_format(events_iterable) self.assertEquals(list(result_iterable), expected_result) self.chain_method1.assert_has_calls(expected_call_order) self.chain_method2.assert_has_calls(expected_call_order) self.chain_method3.assert_has_calls(expected_call_order) pretty_print_mock.assert_has_calls(expected_call_order) # Pretty Printer must always be called @patch.object(LogsFormatter, "_pretty_print_event", wraps=_passthru_formatter) def test_must_work_without_formatter_chain(self, pretty_print_mock): events_iterable = [1, 2, 3] expected_result = [1, 2, 3] expected_call_order = [ call(1, colored=self.colored_mock), call(2, colored=self.colored_mock), call(3, colored=self.colored_mock), ] # No formatter chain. formatter = LogsFormatter(self.colored_mock) result_iterable = formatter.do_format(events_iterable) self.assertEquals(list(result_iterable), expected_result) # Pretty Print is always called, even if there are no other formatters in the chain. pretty_print_mock.assert_has_calls(expected_call_order) self.chain_method1.assert_not_called() self.chain_method2.assert_not_called() self.chain_method3.assert_not_called() class TestLambdaLogMsgFormatters_colorize_crashes(TestCase): @parameterized.expand( [ "Task timed out", "Something happened. Task timed out. Something else happend", "Process exited before completing request", ] ) def test_must_color_crash_messages(self, input_msg): color_result = "colored messaage" colored = Mock() colored.red.return_value = color_result event = LogEvent("group_name", {"message": input_msg}) result = LambdaLogMsgFormatters.colorize_errors(event, colored) self.assertEquals(result.message, color_result) colored.red.assert_called_with(input_msg) def test_must_ignore_other_messages(self): colored = Mock() event = LogEvent("group_name", {"message": "some msg"}) result = LambdaLogMsgFormatters.colorize_errors(event, colored) self.assertEquals(result.message, "some msg") colored.red.assert_not_called() class TestKeywordHighlight_highlight_keyword(TestCase): def test_must_highlight_all_keywords(self): input_msg = "this keyword some keyword other keyword" keyword = "keyword" color_result = "colored" expected_msg = "this colored some colored other colored" colored = Mock() colored.underline.return_value = color_result event = LogEvent("group_name", {"message": input_msg}) result = KeywordHighlighter(keyword).highlight_keywords(event, colored) self.assertEquals(result.message, expected_msg) colored.underline.assert_called_with(keyword) def test_must_ignore_if_keyword_is_absent(self): colored = Mock() input_msg = "this keyword some keyword other keyword" event = LogEvent("group_name", {"message": input_msg}) result = KeywordHighlighter().highlight_keywords(event, colored) self.assertEquals(result.message, input_msg) colored.underline.assert_not_called() class TestJSONMsgFormatter_format_json(TestCase): def test_must_pretty_print_json(self): data = {"a": "b"} input_msg = '{"a": "b"}' expected_msg = json.dumps(data, indent=2) event = LogEvent("group_name", {"message": input_msg}) result = JSONMsgFormatter.format_json(event, None) self.assertEquals(result.message, expected_msg) @parameterized.expand(["this is not json", '{"not a valid json"}']) def test_ignore_non_json(self, input_msg): event = LogEvent("group_name", {"message": input_msg}) result = JSONMsgFormatter.format_json(event, None) self.assertEquals(result.message, input_msg)
38.187879
113
0.702746
5,945
0.943501
0
0
2,751
0.436597
0
0
837
0.132836
fa4c6f431c760c50f8930890bae505b1e114beff
3,921
py
Python
openconnect-cli.py
tcpipuk/OpenConnect-FE
d7d213cedb16b5eb30c7e100848e7e3b53467dd3
[ "Apache-2.0" ]
null
null
null
openconnect-cli.py
tcpipuk/OpenConnect-FE
d7d213cedb16b5eb30c7e100848e7e3b53467dd3
[ "Apache-2.0" ]
null
null
null
openconnect-cli.py
tcpipuk/OpenConnect-FE
d7d213cedb16b5eb30c7e100848e7e3b53467dd3
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 import argparse, pexpect from getpass import getpass from time import sleep # Set up argument parser parser = argparse.ArgumentParser(prog='openconnect-cli', description='Automate logins to the OpenConnect SSL VPN client') # Type of VPN to initiate parser_type = parser.add_mutually_exclusive_group(required=False) parser_type.add_argument('--anyconnect', action='store_true', default=False, help='Cisco AnyConnect SSL VPN') parser_type.add_argument('--fortinet', action='store_true', default=False, help='Fortinet FortiClient SSL VPN') parser_type.add_argument('--pulsesecure', action='store_true', default=False, help='Juniper Network Connect / Pulse Secure SSL VPN') parser_type.add_argument('--paloalto', action='store_true', default=False, help='Palo Alto Networks (PAN) GlobalProtect SSL VPN') # VPN server details parser_dst = parser.add_argument_group('VPN Server Details', 'Any missing fields will be prompted on launch') parser_dst.add_argument('--host', type=str, default=False, help='DNS hostname of SSL VPN server') parser_dst.add_argument('--user', type=str, default=False, help='Username for SSL VPN account') parser_dst.add_argument('--pw', type=str, default=False, help='Password for SSL VPN account') # Import options, output help if none provided args = vars(parser.parse_args()) #args = vars(parser.parse_args(args=None if sys.argv[1:] else ['--help'])) def vpnTypePrompt(): try: print('Please enter one of the following and press enter:') print('1 for Cisco AnyConnect') print('2 for Fortinet FortiClient') print('3 for Pulse Secure or Juniper Network Connect') print('4 for Palo Alto Networks GlobalProtect') protocol = int(input('SSL VPN Type: ')) if protocol == 1: return 'anyconnect' elif protocol == 2: return 'fortinet' elif protocol == 3: return 'nc' elif protocol == 4: return 'gp' else: return False except: return False if 'anyconnect' in args and args['anyconnect']: args['protocol'] = 'anyconnect' elif 'fortinet' in args and args['fortinet']: args['protocol'] = 'fortinet' elif 'pulsesecure' in args and args['pulsesecure']: args['protocol'] = 'nc' elif 'paloalto' in args and args['paloalto']: args['protocol'] = 'gp' else: args['protocol'] = False while args['protocol'] == False: args['protocol'] = vpnTypePrompt() # Fields to prompt for when False prompt_for = { 'host': 'DNS hostname of SSL VPN server: ', 'user': 'Username for SSL VPN account: ', 'pw': 'Password for SSL VPN account: ' } # Interate through fields and prompt for missing ones if 'help' not in args: for field,prompt in prompt_for.items(): if str(field) not in args or not args[field]: while args[field] == False: try: if field == 'pw' and args['protocol'] != 'gp': args[field] = 'N/A' elif field == 'pw': args[field] = getpass(prompt) else: args[field] = input(prompt) except: pass # Collate arguments for command command = [ 'sudo openconnect', '--interface=vpn0', '--script=/usr/share/vpnc-scripts/vpnc-script', '--protocol="' + args['protocol'] + '"', '--user="' + args['user'] + '"', args['host'] ] # Compile command command = ' '.join(command) # Start process process = pexpect.spawnu('/bin/bash', ['-c', command]) # Automate login process for Palo Alto GlobalProtect if args['protocol'] == 'gp': process.expect('Password: ') process.sendline(args['pw']) process.expect('GATEWAY: ') process.sendline('Primary GP') process.expect('anything else to view:') process.sendline('yes') process.expect('Password: ') process.sendline(args['pw']) # Clear remaining private data args = None command = None # Hand over input to user, wait for process to end if interactive mode ends process.interact() while process.isalive(): sleep(5)
33.228814
132
0.683499
0
0
0
0
0
0
0
0
1,843
0.470033
fa4c79eb3a2bcc3c5bb9874b8d41fc99facf7f36
1,047
py
Python
unittestdemo/unittestdemo01.py
caoyp2/PyProject01
1a7d022894908b400fa24da1bb74b47a87ec04e4
[ "Apache-2.0" ]
null
null
null
unittestdemo/unittestdemo01.py
caoyp2/PyProject01
1a7d022894908b400fa24da1bb74b47a87ec04e4
[ "Apache-2.0" ]
null
null
null
unittestdemo/unittestdemo01.py
caoyp2/PyProject01
1a7d022894908b400fa24da1bb74b47a87ec04e4
[ "Apache-2.0" ]
null
null
null
import unittest #4.定义测试类,父类为unittest.TestCase。 #可继承unittest.TestCase的方法,如setUp和tearDown方法,不过此方法可以在子类重写,覆盖父类方法。 #可继承unittest.TestCase的各种断言方法。 class Test(unittest.TestCase): #5.定义setUp()方法用于测试用例执行前的初始化工作。 #注意,所有类中方法的入参为self,定义方法的变量也要“self.变量” def setUp(self): print("开始。。。。。。。。") self.number = 10 #6.定义测试用例,以“test_”开头命名的方法 #注意,方法的入参为self #可使用unittest.TestCase类下面的各种断言方法用于对测试结果的判断 #可定义多个测试用例 #最重要的就是该部分 def test_case1(self): self.assertEqual(10,10) def test_case2(self): # self.number为期望值,20为实际值 self.assertEqual(self.number,20,msg="your input is not 20") @unittest.skip('暂时跳过用例3的测试') def test_case3(self): self.assertEqual(self.number,30,msg='Your input is not 30') #7.定义tearDown()方法用于测试用例执行之后的善后工作。 #注意,方法的入参为self def tearDown(self): print("结束。。。。。。。。") #8如果直接运行该文件(__name__值为__main__),则执行以下语句,常用于测试脚本是否能够正常运行 if __name__=='__main__': #8.1执行测试用例方案一如下: #unittest.main()方法会搜索该模块下所有以test开头的测试用例方法,并自动执行它们。 #执行顺序是命名顺序:先执行test_case1,再执行test_case2 unittest.main()
26.175
67
0.726839
1,058
0.621987
0
0
140
0.082305
0
0
1,263
0.742504
fa4d864c5607687ad1cc9e70a90a7da7550acda4
351
py
Python
pytools/unit.py
ry-shika/Geister-cpp-lib
d8630185e19fe06c5b2bf63ee0f37d665d7f357b
[ "BSL-1.0" ]
8
2021-03-12T00:06:44.000Z
2022-01-15T20:09:51.000Z
pytools/unit.py
ry-shika/Geister-cpp-lib
d8630185e19fe06c5b2bf63ee0f37d665d7f357b
[ "BSL-1.0" ]
40
2019-06-19T04:54:55.000Z
2020-10-25T17:58:31.000Z
pytools/unit.py
ry-shika/Geister-cpp-lib
d8630185e19fe06c5b2bf63ee0f37d665d7f357b
[ "BSL-1.0" ]
3
2021-05-25T08:26:26.000Z
2021-06-22T08:26:39.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- class Unit: def __init__(self, x, y, color, name): self.x = x self.y = y self.color = color self.name = name self.taken = False class OpUnit(Unit): def __init__(self, x, y, color, name): super().__init__(x, y, color, name) self.blue = 0.0
21.9375
43
0.532764
301
0.85755
0
0
0
0
0
0
44
0.125356
fa4e2e368a0acbcb5f65a50b8b60acca846de6d5
1,752
py
Python
pull_scp/config.py
FNNDSC/pl-pull_scp
99b310e5ad88f1afdb1114f14d8cf10bb9b3657d
[ "MIT" ]
null
null
null
pull_scp/config.py
FNNDSC/pl-pull_scp
99b310e5ad88f1afdb1114f14d8cf10bb9b3657d
[ "MIT" ]
null
null
null
pull_scp/config.py
FNNDSC/pl-pull_scp
99b310e5ad88f1afdb1114f14d8cf10bb9b3657d
[ "MIT" ]
null
null
null
"""Remote host configuration.""" from os import getenv, path from dotenv import load_dotenv from .log import LOGGER import pudb # Load environment variables from .env # Originally set to the "installation" directory of the app... BASE_DIR = path.abspath(path.dirname(__file__)) # But using /tmp might just be easier. BASE_DIR = '/tmp' load_dotenv(path.join(BASE_DIR, ".env")) # SSH Connection Variables ENVIRONMENT = getenv("ENVIRONMENT") SSH_REMOTE_HOST = getenv("SSH_REMOTE_HOST") SSH_USERNAME = getenv("SSH_USERNAME") SSH_PASSWORD = getenv("SSH_PASSWORD") SSH_KEY_FILEPATH = getenv("SSH_KEY_FILEPATH") SCP_DESTINATION_FOLDER = getenv("SCP_DESTINATION_FOLDER") SSH_CONFIG_VALUES = [ {"host": SSH_REMOTE_HOST}, {"user": SSH_USERNAME}, {"password": SSH_PASSWORD}, {"ssh": SSH_KEY_FILEPATH}, {"path": SCP_DESTINATION_FOLDER}, ] # Kerberos KERBEROS_USER = getenv("KERBEROS_USER") # Database config DATABASE_HOSTS = [ {"hdprod": getenv("DATABASE_HDPROD_URI")}, {"sdprod": getenv("DATABASE_SDPROD_URI")}, {"gamedata": getenv("DATABASE_GAMEDATA_URI")}, {"gameentry": getenv("DATABASE_GAMEENTRY_URI")}, {"boxfile": getenv("DATABASE_BOXFILE_URI")}, ] # EC2 instances in a devstack DEVSTACK_BOXES = ["web", "api", "app", "state", ""] # Verify all config values are present for config in SSH_CONFIG_VALUES + SSH_CONFIG_VALUES: if None in config.values(): LOGGER.warning(f"Config value not set: {config.popitem()}") raise Exception("Please set your environment variables via a `.env` file.") # Local file directory (no trailing slashes) LOCAL_FILE_DIRECTORY = f"{BASE_DIR}"
31.854545
83
0.67637
0
0
0
0
0
0
0
0
789
0.450342
fa4f4c3b14304e975b24084156700a6ef4675a21
7,468
py
Python
meltingpot/python/human_players/play_level_test.py
yunfanjiang/meltingpot
d1b93f9af805fc88498fa31617a375a1ca6f8dbd
[ "Apache-2.0" ]
null
null
null
meltingpot/python/human_players/play_level_test.py
yunfanjiang/meltingpot
d1b93f9af805fc88498fa31617a375a1ca6f8dbd
[ "Apache-2.0" ]
null
null
null
meltingpot/python/human_players/play_level_test.py
yunfanjiang/meltingpot
d1b93f9af805fc88498fa31617a375a1ca6f8dbd
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 DeepMind Technologies Limited. # # 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. """Tests of the human_players levels.""" import collections from unittest import mock from absl.testing import absltest from absl.testing import parameterized from dm_env import specs import numpy as np import pygame import dmlab2d from meltingpot.python.configs.substrates import ( allelopathic_harvest as mp_allelopathic_harvest, ) from meltingpot.python.configs.substrates import ( arena_running_with_scissors_in_the_matrix as mp_arena_running_with_scissors_itm, ) from meltingpot.python.configs.substrates import ( bach_or_stravinsky_in_the_matrix as mp_bach_or_stravinsky_itm, ) from meltingpot.python.configs.substrates import capture_the_flag as mp_capture_the_flag from meltingpot.python.configs.substrates import ( chemistry_metabolic_cycles as mp_chemistry_metabolic_cycles, ) from meltingpot.python.configs.substrates import chicken_in_the_matrix as mp_chicken_itm from meltingpot.python.configs.substrates import clean_up as mp_clean_up from meltingpot.python.configs.substrates import ( collaborative_cooking_passable as mp_collaborative_cooking_passable, ) from meltingpot.python.configs.substrates import ( commons_harvest_closed as mp_commons_harvest_closed, ) from meltingpot.python.configs.substrates import king_of_the_hill as mp_king_of_the_hill from meltingpot.python.configs.substrates import ( prisoners_dilemma_in_the_matrix as mp_prisoners_dilemma_itm, ) from meltingpot.python.configs.substrates import ( pure_coordination_in_the_matrix as mp_pure_coordination_itm, ) from meltingpot.python.configs.substrates import ( rationalizable_coordination_in_the_matrix as mp_rationalizable_coordination_itm, ) from meltingpot.python.configs.substrates import ( running_with_scissors_in_the_matrix as mp_running_with_scissors_itm, ) from meltingpot.python.configs.substrates import ( stag_hunt_in_the_matrix as mp_stag_hunt_itm, ) from meltingpot.python.configs.substrates import territory_rooms as mp_territory_rooms from meltingpot.python.human_players import level_playing_utils from meltingpot.python.human_players import play_allelopathic_harvest from meltingpot.python.human_players import play_any_paintball_game from meltingpot.python.human_players import play_anything_in_the_matrix from meltingpot.python.human_players import play_clean_up from meltingpot.python.human_players import play_collaborative_cooking from meltingpot.python.human_players import play_commons_harvest from meltingpot.python.human_players import play_grid_land from meltingpot.python.human_players import play_territory class HumanActionReaderTest(parameterized.TestCase): @parameterized.parameters( ( { # Capture the following key events, "move": level_playing_utils.get_direction_pressed, }, # given this action name, key pressed, for this player index; and pygame.K_w, 0, # Expecting this action list out. {"1.move": 1, "2.move": 0, "3.move": 0}, ), ( { # Capture the following key events, "move": level_playing_utils.get_direction_pressed, }, # given this action name, key pressed, for this player index; and pygame.K_s, 2, # Expecting this action list out. {"1.move": 0, "2.move": 0, "3.move": 3}, ), ( { # Capture the following key events, "move": level_playing_utils.get_direction_pressed, }, # given this action name, key pressed, for this player index; and pygame.K_s, 0, # Expecting this action list out. {"1.move": 3, "2.move": 0, "3.move": 0}, ), ( { # Capture the following key events, "move": level_playing_utils.get_direction_pressed, }, # given action name, irrelevant key pressed, for player 0; and pygame.K_x, 0, # Expecting this action list out. {"1.move": 0, "2.move": 0, "3.move": 0}, ), ( { # Capture the following key events (don't need to make sense), "move": level_playing_utils.get_space_key_pressed, }, # given action name, irrelevant key pressed, for player 0; and pygame.K_SPACE, 0, # Expecting this action list out. {"1.move": 1, "2.move": 0, "3.move": 0}, ), ) @mock.patch.object(pygame, "key") def test_human_action( self, action_map, key_pressed, player_index, expected_action, mock_key ): retval = collections.defaultdict(bool) retval[key_pressed] = True mock_key.get_pressed.return_value = retval move_array = specs.BoundedArray( shape=tuple(), dtype=np.intc, minimum=0, maximum=4, name="move" ) action_spec = { "1.move": move_array, "2.move": move_array, "3.move": move_array, } with mock.patch.object(dmlab2d, "Lab2d") as env: env.action_spec.return_value = action_spec har = level_playing_utils.ActionReader(env, action_map) np.testing.assert_array_equal(har.step(player_index), expected_action) class PlayLevelTest(parameterized.TestCase): @parameterized.parameters( (mp_allelopathic_harvest, play_allelopathic_harvest), (mp_arena_running_with_scissors_itm, play_anything_in_the_matrix), (mp_bach_or_stravinsky_itm, play_anything_in_the_matrix), (mp_capture_the_flag, play_any_paintball_game), (mp_chemistry_metabolic_cycles, play_grid_land), (mp_chicken_itm, play_anything_in_the_matrix), (mp_clean_up, play_clean_up), (mp_collaborative_cooking_passable, play_collaborative_cooking), (mp_commons_harvest_closed, play_commons_harvest), (mp_king_of_the_hill, play_any_paintball_game), (mp_prisoners_dilemma_itm, play_anything_in_the_matrix), (mp_pure_coordination_itm, play_anything_in_the_matrix), (mp_rationalizable_coordination_itm, play_anything_in_the_matrix), (mp_running_with_scissors_itm, play_anything_in_the_matrix), (mp_stag_hunt_itm, play_anything_in_the_matrix), (mp_territory_rooms, play_territory), ) @mock.patch.object(pygame, "key") @mock.patch.object(pygame, "display") @mock.patch.object(pygame, "event") @mock.patch.object(pygame, "time") def test_run_level( self, config_module, play_module, unused_k, unused_d, unused_e, unused_t ): full_config = config_module.get_config() full_config["lab2d_settings"]["episodeLengthFrames"] = 10 level_playing_utils.run_episode("RGB", {}, play_module._ACTION_MAP, full_config) if __name__ == "__main__": absltest.main()
41.955056
88
0.713042
4,250
0.569095
0
0
4,144
0.554901
0
0
1,579
0.211435
fa5091c977e174a89ee327dd53969b51dbce3e17
3,436
py
Python
Development/NASTRAN TRANSLATOR.py
toni-lv/AeroComBAT2
6633ebd586570ea53d130748dcdf16f31840f84a
[ "MIT" ]
2
2020-05-19T08:41:20.000Z
2021-04-05T13:17:34.000Z
Development/NASTRAN TRANSLATOR.py
toni-lv/AeroComBAT2
6633ebd586570ea53d130748dcdf16f31840f84a
[ "MIT" ]
null
null
null
Development/NASTRAN TRANSLATOR.py
toni-lv/AeroComBAT2
6633ebd586570ea53d130748dcdf16f31840f84a
[ "MIT" ]
1
2022-03-25T12:39:58.000Z
2022-03-25T12:39:58.000Z
from pyNastran.bdf.bdf import BDF model = BDF() model.is_nx = True section = 5 #filename = r'D:\SNC IAS\01 - FAST Program\05 - Modified Sections\01 - AeroComBAT Files\section_{}.dat'.format(section) filename = r'C:\Users\benna\Desktop\Work Temp\SNC\FAST\SIMPLE_SECTIONS\CTRIA6_1_100.dat' model.read_bdf(filename, xref=True) #Create Export File f = open(filename[:-4]+'_AeroComBAT.dat','w') f.write('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n') f.write('$$$$$$$$$$$$$ AEROCOMBAT INPUT FILE $$$$$$$$$$$$\n') f.write('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n') for NID, node in model.nodes.items(): node_pos = node.get_position() #Write node line f.write('XNODE,{},{},{}\n'.format(NID,node_pos[1],node_pos[2])) # TEMP LINE FOR MAT PROPERTY f.write('MAT_ISO,1,Lower Upper Aeroshell,8781151.,0.232915,0.0004144,0.0083\n') f.write('MAT_ISO,2,Ring Frame Flange,7627582.,0.201668,0.0004144,0.0083\n') f.write('MAT_ISO,3,Cabin Skin,8473671.,0.259765,0.0004144,0.0083\n') f.write('MAT_ISO,4,Hat Stiffeners,9283126.,0.206558,0.0004144,0.0083\n') f.write('MAT_ISO,5,Lower Outer Aeroshell,6544552.,0.428299,0.0004144,0.0083\n') f.write('MAT_ISO,6,Upper Cabin,8196235.,0.284012,0.0004144,0.0083\n') f.write('MAT_ISO,7,Titanium,16000000.,0.31,0.0004144,0.0083\n') f.write('MAT_ISO,8,Quasi Iso,7944519.,0.306626,0.000144,0.0083\n') f.write('MAT_ISO,9,Outer Aeroshell,7505270,0.344368,0.000144,0.0083\n') f.write('MAT_ISO,10,Aluminum,10300000.,0.33,0.0002615,0.0083\n') EIDs = [] for EID, elem in model.elements.items(): if elem.pid==7000003: tmp_MID=1 elif elem.pid == 7000004: tmp_MID=2 elif elem.pid == 7000005: tmp_MID=3 elif elem.pid == 7000006: tmp_MID=4 elif elem.pid == 7000007: tmp_MID=5 elif elem.pid == 7000008: tmp_MID=6 elif elem.pid == 7000000: tmp_MID=7 elif elem.pid == 7000001: tmp_MID=8 elif elem.pid == 7000002: tmp_MID=9 elif elem.pid == 7000009: tmp_MID=10 else: raise ValueError('Encountered an unexpected Material Prop {}',elem.pid) EIDs += [EID] node_ids = elem.node_ids if elem.type=='CQUAD8': n1 = node_ids[0] n2 = node_ids[4] n3 = node_ids[1] n4 = node_ids[5] n5 = node_ids[2] n6 = node_ids[6] n7 = node_ids[3] n8 = node_ids[7] f.write('XQUAD8,{},{},{},{},{},{},{},{},{},{}\n'.format(EID,\ n1,n2,n3,n4,n5,n6,n7,n8,tmp_MID)) elif elem.type=='CQUAD4': n1 = node_ids[0] n2 = node_ids[1] n3 = node_ids[2] n4 = node_ids[3] f.write('XQUAD4,{},{},{},{},{},{}\n'.format(EID,\ n1,n2,n3,n4,tmp_MID)) elif elem.type=='CTRIA3': n1 = node_ids[0] n2 = node_ids[1] n3 = node_ids[2] f.write('XTRIA3,{},{},{},{},{}\n'.format(EID,\ n1,n2,n3,tmp_MID)) elif elem.type=='CTRIA6': n1 = node_ids[0] n2 = node_ids[1] n3 = node_ids[2] n4 = node_ids[3] n5 = node_ids[4] n6 = node_ids[5] f.write('XTRIA6,{},{},{},{},{},{},{},{}\n'.format(EID,\ n1,n2,n3,n4,n5,n6,tmp_MID)) f.write('SECTIONG,{},{}\n'.format(section,section)) #EIDs = list(model.elements.keys()) f.write('LIST,{},INT,'.format(section)+str(EIDs)[1:-1]+'\n') f.close()
34.707071
119
0.563155
0
0
0
0
0
0
0
0
1,403
0.408324
fa50b1c117a73b73cdb56047b0035eccafe1e85c
343
py
Python
project-a/labels.py
achon22/cs231nLung
37a1d46a36f737a8d8461f7ef9237f818a74493f
[ "MIT" ]
2
2018-05-06T12:45:03.000Z
2019-03-31T07:01:41.000Z
project-a/labels.py
achon22/cs231nLung
37a1d46a36f737a8d8461f7ef9237f818a74493f
[ "MIT" ]
null
null
null
project-a/labels.py
achon22/cs231nLung
37a1d46a36f737a8d8461f7ef9237f818a74493f
[ "MIT" ]
1
2018-05-06T12:56:05.000Z
2018-05-06T12:56:05.000Z
#!/usr/bin/env python def main(): f = open('stage1_solution.csv') ones = 0 zeros = 0 total = 0 for line in f: if line[:3] == 'id,': continue line = line.strip().split(',') label = int(line[1]) if label == 1: ones += 1 total += 1 zeros = total-ones print float(zeros)/total f.close() if __name__ == '__main__': main()
16.333333
32
0.586006
0
0
0
0
0
0
0
0
60
0.174927
fa518d531da2342c26be802a278f2c4aacb9c1db
242
py
Python
03/code/Node.py
libchaos/algorithm-python
9d5635e19c58c75bf1f14a3fba9d7340f77df863
[ "MIT" ]
2
2018-03-14T21:57:10.000Z
2019-07-18T08:47:28.000Z
03/code/Node.py
libchaos/algorithm-python
9d5635e19c58c75bf1f14a3fba9d7340f77df863
[ "MIT" ]
null
null
null
03/code/Node.py
libchaos/algorithm-python
9d5635e19c58c75bf1f14a3fba9d7340f77df863
[ "MIT" ]
2
2018-06-20T14:56:31.000Z
2022-02-15T05:27:11.000Z
#!/usr/bin/env python #coding: utf-8 class Node: def __init__(self, elem=None, next=None): self.elem = elem self.next = next if __name__ == "__main__": n1 = Node(1, None) n2 = Node(2, None) n1.next = n2
14.235294
45
0.566116
108
0.446281
0
0
0
0
0
0
46
0.190083
fa53434fce13f8d24606feb5ccc693b179203f59
8,493
py
Python
mc/history/History.py
zy-sunshine/falkon-pyqt5
bc2b60aa21c9b136439bd57a11f391d68c736f99
[ "MIT" ]
1
2021-04-29T05:36:44.000Z
2021-04-29T05:36:44.000Z
mc/history/History.py
zy-sunshine/falkon-pyqt5
bc2b60aa21c9b136439bd57a11f391d68c736f99
[ "MIT" ]
1
2020-03-28T17:43:18.000Z
2020-03-28T17:43:18.000Z
mc/history/History.py
zy-sunshine/falkon-pyqt5
bc2b60aa21c9b136439bd57a11f391d68c736f99
[ "MIT" ]
1
2021-01-15T20:09:24.000Z
2021-01-15T20:09:24.000Z
from PyQt5.Qt import QObject from PyQt5.Qt import QDateTime from PyQt5.Qt import QUrl from PyQt5.Qt import pyqtSignal from mc.app.Settings import Settings from calendar import month_name from .HistoryModel import HistoryModel from mc.common.models import HistoryDbModel from mc.common.models import IconsDbModel from mc.common.globalvars import gVar class History(QObject): class HistoryEntry: def __init__(self): self.id = 0 self.count = 0 self.date = QDateTime() self.url = QUrl() self.urlString = '' self.title = '' def fillDbobj(self, dbobj): for field in ('id', 'count', 'urlString', 'title'): setattr(dbobj, field, getattr(self, field)) dbobj.date = self.date.toMSecsSinceEpoch() dbobj.url = self.url.toString() @classmethod def CreateFromDbobj(cls, dbobj): entry = cls() entry.id = dbobj.id entry.count = dbobj.id entry.date = QDateTime.fromMSecsSinceEpoch(dbobj.date) entry.url = QUrl(dbobj.url) entry.urlString = entry.url.toEncoded().data().decode() entry.title = dbobj.title return entry def __init__(self, parent): super().__init__(parent) self._isSaving = False self._model = None # HistoryModel self.loadSettings() @classmethod def titleCaseLocalizedMonth(cls, month): index = month - 1 if index < len(month_name): return month_name[index] else: print('warning: Month number(%s) out of range!' % month) return '' def model(self): ''' @return: HistoryModel ''' if not self._model: self._model = HistoryModel(self) return self._model def addHistoryEntryByView(self, view): ''' @param: view WebView ''' if not self._isSaving: return url = view.url() title = view.title() self.addHistoryEntryByUrlAndTitle(url, title) def addHistoryEntryByUrlAndTitle(self, url, title): ''' @param: url QUrl @param: title QString ''' if not self._isSaving: return schemes = ['http', 'https', 'ftp', 'file'] if url.scheme() not in schemes: return if not title: title = _('Empty Page') def addEntryFunc(): dbobj = HistoryDbModel.select().where(HistoryDbModel.url == url.toString()).first() if dbobj: # update before = self.HistoryEntry() before.id = dbobj.id before.count = dbobj.count before.date = QDateTime.fromMSecsSinceEpoch(dbobj.date) before.url = url before.urlString = before.url.toEncoded().data().decode() before.title = dbobj.title after = self.HistoryEntry() after.id = dbobj.id after.count = dbobj.count + 1 after.date = QDateTime.currentDateTime() after.url = url after.urlString = after.url.toEncoded().data().decode() after.title = title after.fillDbobj(dbobj) dbobj.save() self.historyEntryEdited.emit(before, after) else: # insert dbobj = HistoryDbModel.create(**{ 'count': 1, 'date': QDateTime.currentMSecsSinceEpoch(), 'url': url.toString(), 'title': title, }) entry = self.HistoryEntry.CreateFromDbobj(dbobj) self.historyEntryAdded.emit(entry) gVar.executor.submit(addEntryFunc) def deleteHistoryEntry(self, indexOrList): ''' @param: indexOrList int/list/tuple ''' if not isinstance(indexOrList, (list, tuple)): list_ = [] list_.append(indexOrList) else: list_ = indexOrList self._deleteHistoryEntryByIndexList(list_) def _deleteHistoryEntryByIndexList(self, list_): ''' @param: list_ QList<int> ''' dbobjs = list(HistoryDbModel.select().where(HistoryDbModel.id.in_(list_))) HistoryDbModel.delete().where(HistoryDbModel.id.in_(list_)).execute() urls = [ QUrl(obj.url).toEncoded(QUrl.RemoveFragment) for obj in dbobjs ] IconsDbModel.delete().where(IconsDbModel.url.in_(urls)).execute() for dbobj in dbobjs: entry = self.HistoryEntry.CreateFromDbobj(dbobj) self.historyEntryDeleted.emit(entry) def deleteHistoryEntryByUrl(self, url): ''' @param: url QUrl ''' items = HistoryDbModel.select(columns=['id']).where(HistoryDbModel.url == url).dicts() import ipdb; ipdb.set_trace() ids = [ item['id'] for item in dicts ] self._deleteHistoryEntryByIndexList(ids) def deleteHistoryEntryByUrlAndTitle(self, url, title): ''' @param: url QUrl @param: title QString ''' items = HistoryDbModel.select(columns=['id']).where(HistoryDbModel.url == url, HistoryDbModel.title == title).dicts() import ipdb; ipdb.set_trace() ids = [ item['id'] for item in dicts ] self._deleteHistoryEntryByIndexList(ids) def indexesFromTimeRange(self, start, end): ''' @param: start qint64 @param: end qint64 @return: QList<int> ''' list_ = [] # QList<int> if start < 0 or end < 0: return list_ ids = HistoryDbModel.select(HistoryDbModel.id, ).where(HistoryDbModel.date.between(end, start)) list_ = [ item for item in ids ] return list_ def mostVisited(self, count): ''' @param: count int @return: QVector<HistoryEntry> ''' result = [] for dbobj in HistoryDbModel.select().order_by(HistoryDbModel.count.desc()).limit(count): entry = self.HistoryEntry() entry.count = dbobj.count entry.date = QDateTime.fromMSecsSinceEpoch(dbobj.date) entry.id = dbobj.id entry.title = dbobj.title entry.url = QUrl(dbobj.url) result.append(entry) return result def clearHistory(self): HistoryDbModel.delete().execute() HistoryDbModel.raw('VACUUM').execute() gVar.app.webProfile().clearAllVisitedLinks() self.resetHistory.emit() def isSaving(self): ''' @return: bool ''' return self._isSaving def setSaving(self, state): ''' @param: state bool ''' self._isSaving = state def loadSettings(self): settings = Settings() settings.beginGroup('Web-Browser-Settings') self._isSaving = settings.value('allowHistory', True, type=bool) settings.endGroup() def searchHistoryEntry(self, text): ''' @param: text QString ''' list_ = [] # QList<HistoryEntry> qs = HistoryDbModel.select().where(HistoryDbModel.title.contains(text) | HistoryDbModel.url.contains(text)).limit(50) for item in qs: entry = self.HistoryEntry() entry.count = item.count entry.date = QDateTime.fromMSecsSinceEpoch(item.date) entry.id = item.id entry.title = item.title entry.url = QUrl(item.url) list_.append(entry) return list_ def getHistoryEntry(self, text): ''' @param: text QString ''' dbobj = HistoryDbModel.select().where(HistoryDbModel.url == text).first() entry = self.HistoryEntry() if dbobj: entry.count = dbobj.count entry.date = QDateTime.fromMSecsSinceEpoch(entry.date) entry.id = dbobj.id entry.title = dbobj.title entry.url = QUrl(dbobj.url) return entry # Q_SIGNALS historyEntryAdded = pyqtSignal(HistoryEntry) # entry historyEntryDeleted = pyqtSignal(HistoryEntry) # entry historyEntryEdited = pyqtSignal(HistoryEntry, HistoryEntry) # before, after resetHistory = pyqtSignal() HistoryEntry = History.HistoryEntry
31.690299
103
0.566231
8,104
0.954198
0
0
645
0.075945
0
0
1,021
0.120217
fa5457d3656080bf562008a41abeb2ddba3062a6
1,184
py
Python
pkg/iface/__init__.py
ToraNova/rapidflask
f42354b296659dac5be904d7bb68076b9458f79a
[ "MIT" ]
null
null
null
pkg/iface/__init__.py
ToraNova/rapidflask
f42354b296659dac5be904d7bb68076b9458f79a
[ "MIT" ]
null
null
null
pkg/iface/__init__.py
ToraNova/rapidflask
f42354b296659dac5be904d7bb68076b9458f79a
[ "MIT" ]
null
null
null
from flask_socketio import send, emit from pkg.system.servlog import srvlog #---------------------------------------------------------------------------------------- # External calls # introduced u7 # The livelog functions allows other functions which are not registered with # socketio to emit a message. # Generalization (u8) 31/05/2019 # Now this can be called anywhere. just create listener sockets on the namespaces # for it to work! # # @author ToraNova # @mailto chia_jason96@live.com #---------------------------------------------------------------------------------------- def sockemit( enamespace, ename, emsg, eroom=None): from pkg.source import out as socketio # use carefully to prevent circular imports try: #live logins - update7 if(eroom is None): socketio.emit( ename, emsg, namespace= enamespace) else: socketio.emit( ename, emsg, room = eroom, namespace= enamespace) # emit may also contain namespaces to emit to other classes except Exception as e: print("[EX]",__name__," : ","Exception has occurred",str(e)) srvlog["oper"].info("Exception ocurred in sockemit :"+str(e))
39.466667
89
0.588682
0
0
0
0
0
0
0
0
693
0.585304
fa5755c213e58345d8c0de7794177a485cfa6195
5,322
py
Python
Co-Simulation/Sumo/run_tracis_synchronization.py
uruzahe/carla
940c2ab23cce1eda1ef66de35f66b42d40865fb1
[ "MIT" ]
null
null
null
Co-Simulation/Sumo/run_tracis_synchronization.py
uruzahe/carla
940c2ab23cce1eda1ef66de35f66b42d40865fb1
[ "MIT" ]
null
null
null
Co-Simulation/Sumo/run_tracis_synchronization.py
uruzahe/carla
940c2ab23cce1eda1ef66de35f66b42d40865fb1
[ "MIT" ]
null
null
null
# coding: utf-8 import argparse import logging import os import sys from util.func import ( data_from_json, ) if 'SUMO_HOME' in os.environ: sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) import traci else: sys.exit("Please declare environment variable 'SUMO_HOME'") # ----- GLOBAL_VARS ----- CTRL_C_PRESSED_MESSAGE = "ctrl-c is pressed." # ----- Class ----- class TracisSyncronizer: def __init__(self, main_sumo_host_port, other_sumo_host_ports, order): self.main_traci = traci.connect(host=main_sumo_host_port.split(":")[0], port=int(main_sumo_host_port.split(":")[1])) self.other_tracis = [traci.connect(host=o_host_port.split(":")[0], port=int(o_host_port.split(":")[1])) for o_host_port in other_sumo_host_ports] # ----- set order ----- self.tracis = [self.main_traci] + self.other_tracis for tmp_traci in self.tracis: tmp_traci.setOrder(order) def start(self): while self.check_sumo_finish is not False: self.main_traci.simulationStep() for o_traci in self.other_tracis: self.sync_tracis(self.main_traci, o_traci) o_traci.simulationStep() def check_sumo_finish(self): try: for tmp_traci in self.tracis: if traci.simulation.getMinExpectedNumber() <= 0: return True else: continue return False except Exception as e: logging.log(e) return True def close_tracis(self): try: if 0 < len(self.tracis): self.tracis[0].close() self.tracis.pop(0) return self.close_tracis() return self.tracis except Exception as e: logging.error(e) logging.error(f"{len(self.tracis)} tracis are remained.") return self.tracis def simulationStep(self): for tmp_traci in self.tracis: tmp_traci.simulationStep() def sync_tracis(self, m_traci, o_traci): # ----- add departed vehicle ----- diff_add_vehicle_ids = set(m_traci.vehicle.getIDList()) - set(o_traci.vehicle.getIDList()) for dav_id in diff_add_vehicle_ids: new_route_id = str(m_traci.vehicle.getIDCount() + 1) try: o_traci.route.add( routeID=new_route_id, edges=m_traci.vehicle.getRoute(dav_id) ) o_traci.vehicle.add( vehID=dav_id, routeID=new_route_id ) except Exception as e: logging.error(e) continue # ----- remove vehicles ----- diff_remove_vehicle_ids = set(o_traci.vehicle.getIDList()) - set(m_traci.vehicle.getIDList()) for drv_id in diff_remove_vehicle_ids: try: o_traci.vehicle.remove(drv_id) except Exception as e: logging.error(e) continue # ----- sync vehicle positions ----- for m_veh_id in m_traci.vehicle.getIDList(): try: o_traci.vehicle.moveToXY( vehID=m_veh_id, edgeID=m_traci.lane.getEdgeID(m_traci.vehicle.getLaneID(m_veh_id)), lane=int(str(m_traci.vehicle.getLaneID(m_veh_id)).split('_')[1]), x=m_traci.vehicle.getPosition(m_veh_id)[0], y=m_traci.vehicle.getPosition(m_veh_id)[1], angle=m_traci.vehicle.getAngle(m_veh_id) ) except Exception as e: logging.error(e) continue # ----- function ----- def start_tracis_syncronizer(main_sumo_host_port, other_sumo_host_ports, order): tracis_syncronizer = TracisSyncronizer(main_sumo_host_port, other_sumo_host_ports, order) try: tracis_syncronizer.start() tracis_syncronizer.close_tracis() except KeyboardInterrupt: logging.info(CTRL_C_PRESSED_MESSAGE) tracis_syncronizer.close_tracis() except Exception as e: logging.error(e) tracis_syncronizer.close_tracis() # ----- main ----- if __name__ == "__main__": env = data_from_json("./env.json") # ----- get args ----- parser = argparse.ArgumentParser(description='This script is a middleware for tracis synchronization.') parser.add_argument('--main_sumo_host_port', default=f"127.0.0.1:{env['carla_sumo_port']}") parser.add_argument('--other_sumo_host_ports', nargs='*', default=f"{env['vagrant_ip']}:{env['veins_sumo_port']}") parser.add_argument('--sumo_order', type=int, default=1) parser.add_argument('--log_file_path', default="./log/tracis_logger.log") args = parser.parse_args() # ----- set logging ----- logging.basicConfig( handlers=[logging.FileHandler(filename=args.log_file_path), logging.StreamHandler(sys.stdout)], format='[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s: %(message)s', level=logging.DEBUG ) start_tracis_syncronizer( main_sumo_host_port=args.main_sumo_host_port, other_sumo_host_ports=args.other_sumo_host_ports, order=args.sumo_order )
34.335484
153
0.599211
3,361
0.63153
0
0
0
0
0
0
761
0.142991
fa57681709017fbba645c042551e1a13aa15f233
2,977
py
Python
web/flask.py
ponyatov/metaLpy
96149313e8083536ade1c331825242f6996f05b3
[ "MIT" ]
null
null
null
web/flask.py
ponyatov/metaLpy
96149313e8083536ade1c331825242f6996f05b3
[ "MIT" ]
null
null
null
web/flask.py
ponyatov/metaLpy
96149313e8083536ade1c331825242f6996f05b3
[ "MIT" ]
null
null
null
## @file ## @defgroup flask flask ## @brief minimized Flask-based backend ## @ingroup web import config from core.env import * from core.io import Dir from .web import Web from core.meta import Module from core.time import * from gen.js import jsFile from gen.s import S from web.html import htmlFile import os, re import flask from flask_socketio import SocketIO, emit env['static'] = Dir('static') env['templates'] = Dir('templates') ## web application ## @ingroup flask class App(Web, Module): ## @param[in] V string | File in form of `web.App(__file__)`` def __init__(self, V): Module.__init__(self, V) env << self env >> self # self['static'] = Dir(self) env.static // self.static self['js'] = jsFile(self) self.static // self['js'] # self['templates'] = Dir(self) env.templates // self.templates self['html'] = htmlFile(self) self.templates // self['html'] # self.flask = flask self.app = flask.Flask(self.value) self.app.config['SECRET_KEY'] = config.SECRET_KEY self.watch() self.router() # self.sio = SocketIO(self.app) self.socketio() ## configure SocketIO event processors def socketio(self): @self.sio.on('connect') def connect(): self.sio.emit('localtime', LocalTime().json()) @self.sio.on('localtime') def localtime(): self.sio.emit('localtime', LocalTime().json()) ## put application name in page/window title def title(self): return self.head(test=True) ## configure file watch list def watch(self): self.extra_files = [ 'config.py', f'{self.value}.py', 'web/flask.py', 'core/object.py'] ## lookup in global `env` ## @param[in] path slashed path to the needed element def lookup(self, path): assert isinstance(path, str) ret = env if not path: return ret for i in path.split('/'): if re.match(r'^\d+$', i): i = int(i) ret = ret[i] return ret ## configure routes statically def router(self): @self.app.route('/') def index(): return flask.redirect(f'/{self.value}') @self.app.route('/dump/<path:path>') @self.app.route('/dump/') @self.app.route('/dump') def dump(path=''): item = self.lookup(path) return flask.render_template('dump.html', env=env, app=self, item=item) @self.app.route(f'/{self.value}') @self.app.route('/app') def app(): return flask.render_template(f'{self.value}/index.html', env=env, app=self) ## run application as web backend def run(self): print(env) self.sio.run(self.app, host=config.HOST, port=config.PORT, debug=True, extra_files=self.extra_files)
27.311927
87
0.570037
2,496
0.838428
0
0
706
0.237151
0
0
752
0.252603
fa585adced0045c21720dece6bf4df472dd95491
2,038
py
Python
setup.py
iamsrp/pyfestival
0c750d1874f9d065e6099ec69fd241e03f199fec
[ "BSD-2-Clause" ]
8
2016-02-13T20:23:11.000Z
2021-11-24T02:09:29.000Z
setup.py
iamsrp/pyfestival
0c750d1874f9d065e6099ec69fd241e03f199fec
[ "BSD-2-Clause" ]
11
2016-08-05T07:06:37.000Z
2021-08-29T17:06:07.000Z
setup.py
iamsrp/pyfestival
0c750d1874f9d065e6099ec69fd241e03f199fec
[ "BSD-2-Clause" ]
21
2015-03-29T02:19:40.000Z
2021-11-24T02:09:32.000Z
#!/usr/bin/env python from distutils.core import setup, Extension from distutils.util import get_platform import os festival_include = os.environ.get("FESTIVAL_INCLUDE", '/usr/include/festival') speech_tools_include = os.environ.get("SPECCH_INCLUDE", '/usr/include/speech_tools') festival_lib = os.environ.get("FESTIVAL_LIB", '/usr/lib') festival_classifiers = [ "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Topic :: Software Development :: Libraries", "Topic :: Utilities", "Topic :: Multimedia :: Sound/Audio :: Sound Synthesis", "Topic :: Multimedia :: Sound/Audio :: Speech" ] long_description = """A Python wrapper around the Festival Speech Synthesis System: http://www.cstr.ed.ac.uk/projects/festival/ pyfestival creates a C module built on top of the festival source code, making it a self-contained Python library (there is no need to run festival-server alongside). pyfestival supports (and is tested on) Python 2.7+ including Python 3 """ libraries = ['Festival', 'estools', 'estbase', 'eststring'] if get_platform().startswith('macosx-'): macos_frameworks = ['CoreAudio', 'AudioToolbox', 'Carbon'] libraries.append('ncurses') else: macos_frameworks = [] setup( name='pyfestival', description='Python Festival module', long_description=long_description, url="https://github.com/techiaith/pyfestival", author="Patrick Robertson", author_email="techiaith@bangor.ac.uk", license="BSD", py_modules=['festival'], ext_modules=[ Extension( '_festival', ['_festival.cpp'], include_dirs=[festival_include, speech_tools_include], library_dirs=[festival_lib], libraries=libraries, extra_link_args=[x for name in macos_frameworks for x in ('-framework', name)], ), ], platforms=["*nix"], bugtrack_url="https://github.com/techiaith/pyfestival/issues", version="0.5", )
33.409836
113
0.695289
0
0
0
0
0
0
0
0
1,114
0.546614
fa59234ee5465427ecc4262b967741db7cd1ff69
838
py
Python
main.py
jhkloss/libg3n_parsing_notebook
e7afef1cc0baf777df334350e967a5d1873998e2
[ "Unlicense" ]
null
null
null
main.py
jhkloss/libg3n_parsing_notebook
e7afef1cc0baf777df334350e967a5d1873998e2
[ "Unlicense" ]
null
null
null
main.py
jhkloss/libg3n_parsing_notebook
e7afef1cc0baf777df334350e967a5d1873998e2
[ "Unlicense" ]
null
null
null
from parse_manual.parser import parse as parse_manual from parse_pyparsing.parser import parse as parse_pyparsing from parse_yaml.parser import parse as parse_yaml from parse_xml.parser import parse as parse_xml from timer.PerformanceTimer import PerformanceTimer # Manual Parsing manual_timer = PerformanceTimer('Manual Parsing') manual_timer.measure_function(parse_manual, 'sample.gen') manual_timer.print() # Pyparsing pyparsing_timer = PerformanceTimer('Pyparsing') pyparsing_timer.measure_function(parse_pyparsing, 'sample.gen') pyparsing_timer.print() #YAML yaml_timer = PerformanceTimer('YAML Parsing') yaml_timer.measure_function(parse_yaml, './parse_yaml/sample.yaml') yaml_timer.print() #XML xml_timer = PerformanceTimer('XML Parsing', 10) xml_timer.measure_function(parse_xml, './parse_xml/sample.xml') xml_timer.print()
29.928571
67
0.826969
0
0
0
0
0
0
0
0
164
0.195704
fa5eb07c8e71475d3547c240435a4985faf8004b
3,152
py
Python
src/test/python/apache/aurora/client/test_base.py
wfarner/aurora
68447b3852d47e8e5f97b8a8df873ca13ab716e0
[ "Apache-2.0" ]
null
null
null
src/test/python/apache/aurora/client/test_base.py
wfarner/aurora
68447b3852d47e8e5f97b8a8df873ca13ab716e0
[ "Apache-2.0" ]
null
null
null
src/test/python/apache/aurora/client/test_base.py
wfarner/aurora
68447b3852d47e8e5f97b8a8df873ca13ab716e0
[ "Apache-2.0" ]
null
null
null
# # 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 unittest from apache.aurora.client import base from gen.apache.aurora.api.ttypes import ( PopulateJobResult, Response, ResponseCode, ResponseDetail, Result, TaskConfig ) class TestBase(unittest.TestCase): def test_format_response_with_message(self): resp = Response(responseCode=ResponseCode.ERROR, details=[ResponseDetail(message='Error')]) formatted = base.format_response(resp) assert formatted == 'Response from scheduler: ERROR (message: Error)' def test_format_response_with_details(self): resp = Response(responseCode=ResponseCode.ERROR, details=[ResponseDetail(message='Error')]) formatted = base.format_response(resp) assert formatted == 'Response from scheduler: ERROR (message: Error)' def test_combine_messages(self): resp = Response(responseCode=ResponseCode.ERROR) assert base.combine_messages(resp) == '' resp = Response(responseCode=ResponseCode.ERROR, details=[]) assert base.combine_messages(resp) == '' resp = Response(responseCode=ResponseCode.ERROR, details=[ResponseDetail(message='Error')]) assert base.combine_messages(resp) == 'Error' resp = Response(responseCode=ResponseCode.ERROR, details=[ResponseDetail()]) assert base.combine_messages(resp) == 'Unknown error' resp = Response( responseCode=ResponseCode.ERROR, details=[ResponseDetail(message='Error1'), ResponseDetail(message='Error2')]) assert base.combine_messages(resp) == 'Error1, Error2' def test_get_populated_task_config_set(self): config = TaskConfig() resp = Response(responseCode=ResponseCode.OK, result=Result(populateJobResult=PopulateJobResult( taskConfig=config))) assert config == resp.result.populateJobResult.taskConfig def test_synthesize_url(self): base_url = 'http://example.com' role = 'some-role' environment = 'some-environment' job = 'some-job' update_id = 'some-update-id' assert (('%s/scheduler/%s/%s/%s/update/%s' % (base_url, role, environment, job, update_id)) == base.synthesize_url(base_url, role, environment, job, update_id=update_id)) assert (('%s/scheduler/%s/%s/%s' % (base_url, role, environment, job)) == base.synthesize_url(base_url, role, environment, job)) assert (('%s/scheduler/%s/%s' % (base_url, role, environment)) == base.synthesize_url(base_url, role, environment)) assert (('%s/scheduler/%s' % (base_url, role)) == base.synthesize_url(base_url, role)) assert (('%s/scheduler/%s' % (base_url, role)) == base.synthesize_url(base_url, role))
38.91358
100
0.716688
2,398
0.760787
0
0
0
0
0
0
897
0.284581
fa5edf57ae9919a788f538f6d462693bbb54ecba
23,204
py
Python
ms_deisotope/data_source/_vendor/AgilentD.py
mobiusklein/ms_deisotope
5b05b40b3f75ace38d03b823499ea3ebc74efad4
[ "Apache-2.0" ]
18
2017-09-01T12:26:12.000Z
2022-02-23T02:31:29.000Z
ms_deisotope/data_source/_vendor/AgilentD.py
mobiusklein/ms_deisotope
5b05b40b3f75ace38d03b823499ea3ebc74efad4
[ "Apache-2.0" ]
19
2017-03-12T20:40:36.000Z
2022-03-31T22:50:47.000Z
ms_deisotope/data_source/_vendor/AgilentD.py
mobiusklein/ms_deisotope
5b05b40b3f75ace38d03b823499ea3ebc74efad4
[ "Apache-2.0" ]
14
2016-05-06T02:25:30.000Z
2022-03-31T14:40:06.000Z
import os import glob import warnings import logging from collections import deque from six import string_types as basestring from lxml import etree try: log = logging.getLogger(os.path.basename(__file__)) except Exception: log = None from collections import OrderedDict, defaultdict from weakref import WeakValueDictionary try: WindowsError except NameError: raise ImportError("Platform Not Supported") try: import comtypes from comtypes.client import GetModule, CreateObject except (ImportError, NameError) as e: raise ImportError("Could not import comtypes") import numpy as np from ms_deisotope.data_source.common import ( ScanDataSource, RandomAccessScanSource, Scan, ScanBunch, PrecursorInformation, ActivationInformation, IsolationWindow, InstrumentInformation, ComponentGroup, component, FileInformation, SourceFile, ScanAcquisitionInformation, ScanEventInformation, ScanWindow) try: # Load previously built COM wrapper from comtypes.gen import ( MassSpecDataReader, BaseCommon, BaseDataAccess) DLL_IS_LOADED = True except (ImportError, TypeError): DLL_IS_LOADED = False _default_paths = [] def _register_dll_dir(search_paths=None): from ms_deisotope.config import get_config if search_paths is None: search_paths = [] global DLL_IS_LOADED if DLL_IS_LOADED: return True search_paths = list(search_paths) search_paths.extend(_default_paths) search_paths.extend(get_config().get('vendor_readers', {}).get('agilent-com', [])) for dll_dir in search_paths: try: GetModule(os.path.join(dll_dir, 'MassSpecDataReader.tlb')) GetModule(os.path.join(dll_dir, 'BaseCommon.tlb')) GetModule(os.path.join(dll_dir, 'BaseDataAccess.tlb')) DLL_IS_LOADED = True return True except Exception: continue else: return False def register_dll_dir(search_paths=None): if search_paths is None: search_paths = [] if isinstance(search_paths, basestring): search_paths = [search_paths] loaded = _register_dll_dir(search_paths) if not loaded: log.debug("Could not resolve Agilent-related DLL") search_paths.extend(_default_paths) msg = ''' 1) The MassSpecDataReader, BaseCommon, BaseDataAccess DLLs/TLBs may not be installed and therefore not registered to the COM server. 2) The MassSpecDataReader, BaseCommon, BaseDataAccess DLLs/TLBs may not be on these paths: %s ''' % ('\n'.join(search_paths)) raise ImportError(msg) class CaseInsensitiveDict(dict): def __init__(self, template=None): if isinstance(template, dict): template = {k.lower(): v for k, v in template.items()} dict.__init__(self, template) def __getitem__(self, key): key = key.lower() return dict.__getitem__(self, key) def __delitem__(self, key): return super(CaseInsensitiveDict, self).__delitem__(key.lower()) def __setitem__(self, key, value): key = key.lower() return dict.__setitem__(self, key, value) def __contains__(self, key): return super(CaseInsensitiveDict, self).__contains__(key.lower()) device_to_component_group_map = CaseInsensitiveDict({ "QTOF": [ ComponentGroup("analyzer", [component("quadrupole")], 2), ComponentGroup("analyzer", [component("quadrupole")], 3), ComponentGroup("analyzer", [component("time-of-flight")], 4) ], "Quadrupole": [ ComponentGroup("analyzer", [component("quadrupole")], 2), ], "TandemQuadrupole": [ ComponentGroup("analyzer", [component("quadrupole")], 2), ComponentGroup("analyzer", [component("quadrupole")], 3), ComponentGroup("analyzer", [component("quadrupole")], 4) ], "IonTrap": [ ComponentGroup("analyzer", [component("iontrap")], 2) ], "TOF": [ ComponentGroup("analyzer", [component("time-of-flight")], 2) ] }) polarity_map = { 1: -1, 0: 1, 3: 0, 2: None } ion_mode_map = { 0: 'Unspecified', 1: 'Mixed', 2: 'EI', 4: 'CI', 8: 'Maldi', 16: 'Appi', 32: 'Apci', 64: 'ESI', 128: 'NanoEsi', 512: 'MsChip', 1024: 'ICP', 2048: 'Jetstream' } ionization_map = CaseInsensitiveDict({ "EI": component("electron ionization"), "CI": component("chemical ionization"), "ESI": component("electrospray ionization"), "NanoEsi": component("nanoelectrospray"), "Appi": component('atmospheric pressure photoionization'), "Apci": component("atmospheric pressure chemical ionization"), "Maldi": component("matrix assisted laser desorption ionization"), "MsChip": component("nanoelectrospray"), "ICP": component("plasma desorption ionization"), "Jetstream": component("nanoelectrospray") }) inlet_map = CaseInsensitiveDict({ "EI": component("direct inlet"), "CI": component("direct inlet"), "Maldi": component("particle beam"), "Appi": component("direct inlet"), "Apci": component("direct inlet"), "Esi": component("electrospray inlet"), "NanoEsi": component("nanospray inlet"), "MsChip": component("nanospray inlet"), "ICP": component("component(inductively coupled plasma"), "JetStream": component("nanospray inlet"), }) peak_mode_map = { 'profile': 0, 'centroid': 1, 'profilepreferred': 2, 'centroidpreferred': 3 } device_type_map = { 0: 'Unknown', 1: 'Mixed', 2: 'Quadrupole', 3: 'IsocraticPump', 4: 'TOF', 5: 'TandemQuadrupole', 6: 'QTOF', 10: 'FlourescenceDetector', 11: 'ThermalConductivityDetector', 12: 'RefractiveIndexDetector', 13: 'MultiWavelengthDetector', 14: 'ElectronCaptureDetector', 15: 'VariableWavelengthDetector', 16: 'AnalogDigitalConverter', 17: 'EvaporativeLightScatteringDetector', 18: 'GCDetector', 19: 'FlameIonizationDetector', 20: 'ALS', 21: 'WellPlateSampler', 22: 'MicroWellPlateSampler', 23: 'DiodeArrayDetector', 31: 'CANValves', 32: 'QuaternaryPump', 33: 'ChipCube', 34: 'Nanopump', 40: 'ThermostattedColumnCompartment', 41: 'CTC', 42: 'CapillaryPump', 50: 'IonTrap' } scan_type_map = CaseInsensitiveDict({ "Unspecified": 0, "All": 7951, "AllMS": 15, "AllMSN": 7936, "Scan": 1, "SelectedIon": 2, "HighResolutionScan": 4, "TotalIon": 8, "MultipleReaction": 256, "ProductIon": 512, "PrecursorIon": 1024, "NeutralLoss": 2048, "NeutralGain": 4096 }) PEAK_MODE = 0 def make_scan_id_string(scan_id): return "scanId=%s" % (scan_id,) class AgilentDScanPtr(object): def __init__(self, index): self.index = index def __repr__(self): return "AgilentDScanPtr(%d)" % (self.index,) class AgilentDDataInterface(ScanDataSource): def _get_spectrum_obj(self, scan, peak_mode=PEAK_MODE): index = scan.index spectrum = self.source.GetSpectrum_8(rowNumber=index, storageType=peak_mode) return spectrum def _get_scan_record(self, scan): index = scan.index record = self.source.GetScanRecord(index) return record def _scan_index(self, scan): return scan.index def _scan_id(self, scan): record = self._get_scan_record(scan) return make_scan_id_string(record.ScanId) def _scan_title(self, scan): return self._scan_id(scan) def _scan_arrays(self, scan): spectrum = self._get_spectrum_obj(scan) return (np.array(spectrum.XArray, dtype=float), np.array(spectrum.YArray, dtype=float)) def _polarity(self, scan): record = self._get_scan_record(scan) polarity_enum = record.IonPolarity polarity = polarity_map.get(polarity_enum) if polarity in (0, None): warnings.warn("Unknown Scan Polarity: %r" % (polarity,)) return polarity def _scan_time(self, scan): record = self._get_scan_record(scan) return record.retentionTime def _is_profile(self, scan): spectrum_obj = self._get_spectrum_obj(scan) mode = spectrum_obj.MSStorageMode return mode in (0, 2, 3) def _ms_level(self, scan): record = self._get_scan_record(scan) return record.MSLevel def _precursor_information(self, scan): if self._ms_level(scan) < 2: return None spectrum_obj = self._get_spectrum_obj(scan) precursor_scan_id = make_scan_id_string(spectrum_obj.ParentScanId) n, ions = spectrum_obj.GetPrecursorIon() if n < 1: return None mz = ions[0] charge, _ = spectrum_obj.GetPrecursorCharge() intensity, _ = spectrum_obj.GetPrecursorIntensity() return PrecursorInformation(mz, intensity, charge, precursor_scan_id, self) def _acquisition_information(self, scan): spectrum_obj = self._get_spectrum_obj(scan) try: low = spectrum_obj.MeasuredMassRange.Start high = spectrum_obj.MeasuredMassRange.End except Exception: arrays = self._scan_arrays(scan) mz_array = arrays[0] if len(mz_array) != 0: low = mz_array.min() high = mz_array.max() else: low = high = 0 window = ScanWindow(low, high) event = ScanEventInformation( self._scan_time(scan), window_list=[window]) return ScanAcquisitionInformation("no combination", [event]) def _activation(self, scan): record = self._get_scan_record(scan) return ActivationInformation('cid', record.CollisionEnergy) def _isolation_window(self, scan): if self._ms_level(scan) < 2: return None spectrum_obj = self._get_spectrum_obj(scan) n, ions = spectrum_obj.GetPrecursorIon() if n < 1: return None return IsolationWindow(0, ions[0], 0) def _instrument_configuration(self, scan): return self._instrument_config[1] class _AgilentDDirectory(object): @staticmethod def create_com_object(): if not DLL_IS_LOADED: raise WindowsError("Could not locate Agilent DLLs") reader = CreateObject('Agilent.MassSpectrometry.DataAnalysis.MassSpecDataReader') return reader @staticmethod def create_com_object_filter(): if not DLL_IS_LOADED: raise WindowsError("Could not locate Agilent DLLs") no_filter = CreateObject('Agilent.MassSpectrometry.DataAnalysis.MsdrPeakFilter') return no_filter @staticmethod def is_valid(path): if os.path.exists(path): if os.path.isdir(path): return os.path.exists(os.path.join(path, "AcqData", "Contents.xml")) return False class _AgilentMethod(object): def __init__(self, method_parameters): self.parameters = list(method_parameters) def __getitem__(self, i): return self.parameters[i] def __len__(self): return len(self.parameters) def __iter__(self): return iter(self.parameters) def __repr__(self): return "_AgilentMethod(%d)" % (len(self),) def search_by_name(self, name): for param in self: try: if param['Name'].lower() == name.lower(): return param except (AttributeError, KeyError): continue class _AgilentDMetadataLoader(object): def _has_ms1_scans(self): return bool(self._scan_types_flags & scan_type_map['Scan']) def _has_msn_scans(self): return bool(self._scan_types_flags & scan_type_map['ProductIon']) def has_msn_scans(self): return self._has_msn_scans() def has_ms1_scans(self): return self._has_ms1_scans() def file_description(self): fi = FileInformation(contents={}, source_files=[]) if self._has_ms1_scans(): fi.add_content("MS1 spectrum") if self._has_msn_scans(): fi.add_content("MSn spectrum") basename = os.path.basename dirname = os.path.dirname file_queue = deque() file_queue.extend(glob.glob(os.path.join(self.dirpath, "AcqData", "*"))) # for source_file in file_queue: while file_queue: source_file = file_queue.popleft() if os.path.isdir(source_file): file_queue.extendleft(glob.glob(os.path.join(source_file, "*"))) else: sf = SourceFile( basename(source_file), dirname(source_file), None, *("Agilent MassHunter nativeID format", "Agilent MassHunter format")) sf.add_checksum("sha1") fi.add_file(sf, check=False) return fi def _get_instrument_info(self): ion_modes_flags = self.source.MSScanFileInformation.IonModes ionization = [] for bit, label in ion_mode_map.items(): if ion_modes_flags & bit: ionization.append(label) configs = [] i = 1 for ionizer in ionization: groups = [ComponentGroup("source", [ionization_map[ionizer], inlet_map[ionizer]], 1)] groups.extend(device_to_component_group_map[self.device]) config = InstrumentInformation(i, groups) i += 1 configs.append(config) self._instrument_config = { c.id: c for c in configs } return configs def instrument_configuration(self): return sorted(self._instrument_config.values(), key=lambda x: x.id) def data_processing(self): return [] def _acquisition_method_xml_path(self): return os.path.join(self.dirpath, "AcqData", "AcqMethod.xml") def _parse_method_xml(self): try: path = self._acquisition_method_xml_path() tree = etree.parse(path) nsmap = {"ns": "http://tempuri.org/DataFileReport.xsd"} elt = tree.find(".//ns:SCICDevicesXml", namespaces=nsmap) method_xml = etree.fromstring(elt.text) except (IOError, OSError, ValueError, TypeError) as e: print(e) self._method = [] return self._method method = list() for section in method_xml.iterfind(".//SectionInfo"): section_dict = {} for child in section: name = child.tag value = child.text section_dict[name] = value method.append(section_dict) method = _AgilentMethod(method) self._method = method return method _ADM = _AgilentDMetadataLoader _ADD = _AgilentDDirectory class AgilentDLoader(AgilentDDataInterface, _ADD, RandomAccessScanSource, _ADM): def __init__(self, dirpath, **kwargs): self.dirpath = dirpath self.dirpath = os.path.abspath(self.dirpath) self.dirpath = os.path.normpath(self.dirpath) self.source = self.create_com_object() self.filter = self.create_com_object_filter() try: self.source.OpenDataFile(self.dirpath) except comtypes.COMError as err: raise IOError(str(err)) self._TIC = self.source.GetTIC() self.device = self._TIC.DeviceName self._n_spectra = self._TIC.TotalDataPoints self._scan_types_flags = self.source.MSScanFileInformation.ScanTypes self._producer = self._scan_group_iterator() self.initialize_scan_cache() self._index = self._pack_index() self._get_instrument_info() def __reduce__(self): return self.__class__, (self.dirpath,) @property def index(self): return self._index def __len__(self): return len(self.index) def __repr__(self): return "AgilentDLoader(%r)" % (self.dirpath) def reset(self): self.make_iterator(None) self.initialize_scan_cache() def close(self): # seems to make attempting to re-open the same datafile cause a segfault # self.source.CloseDataFile() self._dispose() def _pack_index(self): index = OrderedDict() for sn in range(self._n_spectra): rec = self._get_scan_record(AgilentDScanPtr(sn)) index[make_scan_id_string(rec.ScanId)] = sn return index def _make_pointer_iterator(self, start_index=None, start_time=None): iterator = self._make_scan_index_producer(start_index, start_time) for i in iterator: yield AgilentDScanPtr(i) def _make_default_iterator(self): return self._make_pointer_iterator() def _make_scan_index_producer(self, start_index=None, start_time=None): if start_index is not None: return range(start_index, self._n_spectra) elif start_time is not None: start_index = self._source.ScanNumFromRT(start_time) while start_index != 0: scan = self.get_scan_by_index(start_index) if scan.ms_level > 1: start_index -= 1 else: break return range(start_index, self._n_spectra) else: return range(0, self._n_spectra) def get_scan_by_id(self, scan_id): """Retrieve the scan object for the specified scan id. If the scan object is still bound and in memory somewhere, a reference to that same object will be returned. Otherwise, a new object will be created. Parameters ---------- scan_id : str The unique scan id value to be retrieved Returns ------- Scan """ index = self._index[scan_id] return self.get_scan_by_index(index) def get_scan_by_index(self, index): """Retrieve the scan object for the specified scan index. This internally calls :meth:`get_scan_by_id` which will use its cache. Parameters ---------- index: int The index to get the scan for Returns ------- Scan """ scan_number = int(index) try: return self._scan_cache[scan_number] except KeyError: package = AgilentDScanPtr(scan_number) scan = Scan(package, self) self._cache_scan(scan) return scan def get_scan_by_time(self, time): time_array = self._TIC.XArray lo = 0 hi = self._n_spectra if time == float('inf'): return self.get_scan_by_index(len(self) - 1) best_match = None best_error = float('inf') while hi != lo: mid = (hi + lo) // 2 scan_time = time_array[mid] err = abs(scan_time - time) if err < best_error: best_error = err best_match = mid if scan_time == time: return self.get_scan_by_index(mid) elif (hi - lo) == 1: return self.get_scan_by_index(best_match) elif scan_time > time: hi = mid else: lo = mid def start_from_scan(self, scan_id=None, rt=None, index=None, require_ms1=True, grouped=True): '''Reconstruct an iterator which will start from the scan matching one of ``scan_id``, ``rt``, or ``index``. Only one may be provided. After invoking this method, the iterator this object wraps will be changed to begin yielding scan bunchs (or single scans if ``grouped`` is ``False``). Arguments --------- scan_id: str, optional Start from the scan with the specified id. rt: float, optional Start from the scan nearest to specified time (in minutes) in the run. If no exact match is found, the nearest scan time will be found, rounded up. index: int, optional Start from the scan with the specified index. require_ms1: bool, optional Whether the iterator must start from an MS1 scan. True by default. grouped: bool, optional whether the iterator should yield scan bunches or single scans. True by default. ''' if scan_id is not None: scan_number = self.get_scan_by_id(scan_id).index elif index is not None: scan_number = int(index) elif rt is not None: scan_number = self.get_scan_by_time(rt).index if require_ms1: start_index = scan_number while start_index != 0: scan = self.get_scan_by_index(start_index) if scan.ms_level > 1: start_index -= 1 else: break scan_number = start_index iterator = self._make_scan_index_producer(start_index=scan_number) if grouped: self._producer = self._scan_group_iterator(iterator) else: self._producer = self._single_scan_iterator(iterator) return self def _make_cache_key(self, scan): return scan._data.index def _single_scan_iterator(self, iterator=None, mode=None): if iterator is None: iterator = self._make_scan_index_producer() for ix in iterator: packed = self.get_scan_by_index(ix) self._cache_scan(packed) yield packed def _scan_group_iterator(self, iterator=None, mode=None): if iterator is None: iterator = self._make_scan_index_producer() precursor_scan = None product_scans = [] current_level = 1 for ix in iterator: packed = self.get_scan_by_index(ix) self._cache_scan(packed) if packed.ms_level > 1: # inceasing ms level if current_level < packed.ms_level: current_level = packed.ms_level # decreasing ms level elif current_level > packed.ms_level: current_level = packed.ms_level product_scans.append(packed) elif packed.ms_level == 1: if current_level > 1 and precursor_scan is not None: precursor_scan.product_scans = list(product_scans) yield ScanBunch(precursor_scan, product_scans) else: if precursor_scan is not None: precursor_scan.product_scans = list(product_scans) yield ScanBunch(precursor_scan, product_scans) precursor_scan = packed product_scans = [] else: raise Exception("This object is not able to handle MS levels higher than 2") if precursor_scan is not None: yield ScanBunch(precursor_scan, product_scans) def next(self): return next(self._producer)
31.146309
98
0.616704
16,977
0.731641
1,944
0.083779
774
0.033356
0
0
4,610
0.198673
fa5f942835d516a7601b80f50c40625787b25076
12,080
py
Python
prospector/client/cli/prospector_client.py
pombredanne/vulnerability-assessment-kb
3a32e3eea5413b7acd6ac70a6cba46ccc84e83d2
[ "Apache-2.0" ]
41
2019-02-21T03:27:21.000Z
2020-06-04T13:39:52.000Z
prospector/client/cli/prospector_client.py
pombredanne/vulnerability-assessment-kb
3a32e3eea5413b7acd6ac70a6cba46ccc84e83d2
[ "Apache-2.0" ]
3
2019-02-28T19:07:34.000Z
2020-05-18T19:34:28.000Z
prospector/client/cli/prospector_client.py
pombredanne/vulnerability-assessment-kb
3a32e3eea5413b7acd6ac70a6cba46ccc84e83d2
[ "Apache-2.0" ]
32
2019-02-26T16:09:35.000Z
2020-05-30T13:47:40.000Z
import logging import sys from datetime import datetime import requests from tqdm import tqdm import log from datamodel.advisory import AdvisoryRecord from datamodel.commit import Commit from filtering.filter import filter_commits from git.git import GIT_CACHE, Git from git.version_to_tag import get_tag_for_version from log.util import init_local_logger # from processing.commit.feature_extractor import extract_features from processing.commit.preprocessor import preprocess_commit from ranking.rank import rank from ranking.rules import apply_rules # from util.profile import profile from stats.execution import Counter, ExecutionTimer, execution_statistics _logger = init_local_logger() SECS_PER_DAY = 86400 TIME_LIMIT_BEFORE = 3 * 365 * SECS_PER_DAY TIME_LIMIT_AFTER = 180 * SECS_PER_DAY MAX_CANDIDATES = 1000 core_statistics = execution_statistics.sub_collection("core") # @profile def prospector( # noqa: C901 vulnerability_id: str, repository_url: str, publication_date: str = "", vuln_descr: str = "", tag_interval: str = "", version_interval: str = "", modified_files: "list[str]" = [], code_tokens: "list[str]" = [], time_limit_before: int = TIME_LIMIT_BEFORE, time_limit_after: int = TIME_LIMIT_AFTER, use_nvd: bool = False, nvd_rest_endpoint: str = "", backend_address: str = "", git_cache: str = GIT_CACHE, limit_candidates: int = MAX_CANDIDATES, active_rules: "list[str]" = ["ALL"], model_name: str = "", ) -> "list[Commit]": _logger.info("begin main commit and CVE processing") # ------------------------------------------------------------------------- # advisory record extraction # ------------------------------------------------------------------------- advisory_record = AdvisoryRecord( vulnerability_id=vulnerability_id, repository_url=repository_url, description=vuln_descr, from_nvd=use_nvd, nvd_rest_endpoint=nvd_rest_endpoint, ) _logger.pretty_log(advisory_record) advisory_record.analyze(use_nvd=use_nvd) _logger.info(f"{advisory_record.code_tokens=}") if publication_date != "": advisory_record.published_timestamp = int( datetime.strptime(publication_date, r"%Y-%m-%dT%H:%M%z").timestamp() ) if len(code_tokens) > 0: advisory_record.code_tokens += tuple(code_tokens) # drop duplicates advisory_record.code_tokens = list(set(advisory_record.code_tokens)) # FIXME this should be handled better (or '' should not end up in the modified_files in # the first place) if modified_files != [""]: advisory_record.paths += modified_files _logger.info(f"{advisory_record.code_tokens=}") # print(advisory_record.paths) # ------------------------------------------------------------------------- # retrieval of commit candidates # ------------------------------------------------------------------------- with ExecutionTimer( core_statistics.sub_collection(name="retrieval of commit candidates") ): _logger.info( "Downloading repository {} in {}..".format(repository_url, git_cache) ) repository = Git(repository_url, git_cache) repository.clone() tags = repository.get_tags() _logger.debug(f"Found tags: {tags}") _logger.info("Done retrieving %s" % repository_url) prev_tag = None following_tag = None if tag_interval != "": prev_tag, following_tag = tag_interval.split(":") elif version_interval != "": vuln_version, fixed_version = version_interval.split(":") prev_tag = get_tag_for_version(tags, vuln_version)[0] following_tag = get_tag_for_version(tags, fixed_version)[0] since = None until = None if advisory_record.published_timestamp: since = advisory_record.published_timestamp - time_limit_before until = advisory_record.published_timestamp + time_limit_after candidates = repository.get_commits( since=since, until=until, ancestors_of=following_tag, exclude_ancestors_of=prev_tag, filter_files="*.java", ) _logger.info("Found %d candidates" % len(candidates)) # if some code_tokens were found in the advisory text, require # that candidate commits touch some file whose path contains those tokens # NOTE: this works quite well for Java, not sure how general this criterion is # ------------------------------------------------------------------------- # commit filtering # # Here we apply additional criteria to discard commits from the initial # set extracted from the repository # # ------------------------------------------------------------------------- # if advisory_record.code_tokens != []: # _logger.info( # "Detected tokens in advisory text, searching for files whose path contains those tokens" # ) # _logger.info(advisory_record.code_tokens) # if modified_files == [""]: # modified_files = advisory_record.code_tokens # else: # modified_files.extend(advisory_record.code_tokens) # candidates = filter_by_changed_files(candidates, modified_files, repository) with ExecutionTimer(core_statistics.sub_collection(name="commit filtering")): candidates = filter_commits(candidates) _logger.debug(f"Collected {len(candidates)} candidates") if len(candidates) > limit_candidates: _logger.error( "Number of candidates exceeds %d, aborting." % limit_candidates ) _logger.error( "Possible cause: the backend might be unreachable or otherwise unable to provide details about the advisory." ) sys.exit(-1) # ------------------------------------------------------------------------- # commit preprocessing # ------------------------------------------------------------------------- with ExecutionTimer( core_statistics.sub_collection(name="commit preprocessing") ) as timer: raw_commit_data = dict() missing = [] try: # Exploit the preprocessed commits already stored in the backend # and only process those that are missing. Note: the endpoint # does not exist (yet) r = requests.get( backend_address + "/commits/" + repository_url + "?commit_id=" + ",".join(candidates) ) _logger.info("The backend returned status '%d'" % r.status_code) if r.status_code != 200: _logger.error("This is weird...Continuing anyway.") missing = candidates else: raw_commit_data = r.json() _logger.info( "Found {} preprocessed commits".format(len(raw_commit_data)) ) except requests.exceptions.ConnectionError: _logger.error( "Could not reach backend, is it running? The result of commit pre-processing will not be saved.", exc_info=log.config.level < logging.WARNING, ) missing = candidates preprocessed_commits: "list[Commit]" = [] for idx, commit in enumerate(raw_commit_data): if ( commit ): # None results are not in the DB, collect them to missing list, they need local preprocessing preprocessed_commits.append(Commit.parse_obj(commit)) else: missing.append(candidates[idx]) _logger.info("Preprocessing commits...") first_missing = len(preprocessed_commits) pbar = tqdm(missing) with Counter( timer.collection.sub_collection(name="commit preprocessing") ) as counter: counter.initialize("preprocessed commits", unit="commit") for commit_id in pbar: counter.increment("preprocessed commits") preprocessed_commits.append( preprocess_commit(repository.get_commit(commit_id)) ) _logger.pretty_log(advisory_record) _logger.debug(f"preprocessed {len(preprocessed_commits)} commits") payload = [c.__dict__ for c in preprocessed_commits[first_missing:]] # ------------------------------------------------------------------------- # save preprocessed commits to backend # ------------------------------------------------------------------------- with ExecutionTimer( core_statistics.sub_collection(name="save preprocessed commits to backend") ): _logger.info("Sending preprocessing commits to backend...") try: r = requests.post(backend_address + "/commits/", json=payload) _logger.info( "Saving to backend completed (status code: %d)" % r.status_code ) except requests.exceptions.ConnectionError: _logger.error( "Could not reach backend, is it running?" "The result of commit pre-processing will not be saved." "Continuing anyway.....", exc_info=log.config.level < logging.WARNING, ) # TODO compute actual rank # This can be done by a POST request that creates a "search" job # whose inputs are the AdvisoryRecord, and the repository URL # The API returns immediately indicating a job id. From this # id, a URL can be constructed to poll the results asynchronously. # ranked_results = [repository.get_commit(c) for c in preprocessed_commits] # ------------------------------------------------------------------------- # analyze candidates by applying rules and ML predictor # ------------------------------------------------------------------------- with ExecutionTimer( core_statistics.sub_collection(name="analyze candidates") ) as timer: _logger.info("Extracting features from commits...") # annotated_candidates = [] # with Counter(timer.collection.sub_collection("commit analysing")) as counter: # counter.initialize("analyzed commits", unit="commit") # # TODO remove "proactive" invocation of feature extraction # for commit in tqdm(preprocessed_commits): # counter.increment("analyzed commits") # annotated_candidates.append(extract_features(commit, advisory_record)) annotated_candidates = apply_rules( preprocessed_commits, advisory_record, active_rules=active_rules ) annotated_candidates = rank(annotated_candidates, model_name=model_name) return annotated_candidates, advisory_record # def filter_by_changed_files( # candidates: "list[str]", modified_files: "list[str]", git_repository: Git # ) -> list: # """ # Takes a list of commit ids in input and returns in output the list # of ids of the commits that modify at least one path that contains one of the strings # in "modified_files" # """ # modified_files = [f.lower() for f in modified_files if f != ""] # if len(modified_files) == 0: # return candidates # filtered_candidates = [] # if len(modified_files) != 0: # for commit_id in candidates: # commit_obj = git_repository.get_commit(commit_id) # commit_changed_files = commit_obj.get_changed_files() # for ccf in commit_changed_files: # for f in modified_files: # ccf = ccf.lower() # if f in ccf: # # if f in [e.lower() for e in ccf]: # # print(f, commit_obj.get_id()) # filtered_candidates.append(commit_obj.get_id()) # return list(set(filtered_candidates))
38.842444
125
0.59048
0
0
0
0
0
0
0
0
5,494
0.454801
fa5fa0507088e412dac0381129f186b5aaf9c2d7
34
py
Python
masteronly.py
mbs5mz/cs3240-labdemo
bc6f04f136686394248e6629aeba0cd3bed7770f
[ "MIT" ]
null
null
null
masteronly.py
mbs5mz/cs3240-labdemo
bc6f04f136686394248e6629aeba0cd3bed7770f
[ "MIT" ]
null
null
null
masteronly.py
mbs5mz/cs3240-labdemo
bc6f04f136686394248e6629aeba0cd3bed7770f
[ "MIT" ]
null
null
null
print("This is the master branch")
34
34
0.764706
0
0
0
0
0
0
0
0
27
0.794118
fa601fe1d2a43b58da3a5908f30d4dd1e67e4207
2,507
py
Python
pyethereum/config.py
CJentzsch/pyethereum
35c67e28ea1279b63ac40f3a987a741d6d994022
[ "MIT" ]
null
null
null
pyethereum/config.py
CJentzsch/pyethereum
35c67e28ea1279b63ac40f3a987a741d6d994022
[ "MIT" ]
null
null
null
pyethereum/config.py
CJentzsch/pyethereum
35c67e28ea1279b63ac40f3a987a741d6d994022
[ "MIT" ]
2
2020-09-09T20:01:12.000Z
2021-09-01T15:47:10.000Z
import os import uuid import StringIO import ConfigParser from pyethereum.utils import data_dir from pyethereum.packeter import Packeter from pyethereum.utils import sha3 def default_data_dir(): data_dir._set_default() return data_dir.path def default_config_path(): return os.path.join(default_data_dir(), 'config.txt') def default_client_version(): return Packeter.CLIENT_VERSION # FIXME def default_node_id(): return sha3(str(uuid.uuid1())).encode('hex') config_template = \ """ # NETWORK OPTIONS ########### [network] # Connect to remote host/port # poc-6.ethdev.com:30300 remote_host = 207.12.89.101 remote_port = 30303 # Listen on the given host/port for incoming connections listen_host = 0.0.0.0 listen_port = 30303 # Number of peer to connections to establish num_peers = 10 # unique id of this node node_id = {0} # API OPTIONS ########### [api] # Serve the restful json api on the given host/port listen_host = 0.0.0.0 listen_port = 30203 # path to server the api at api_path = /api/v02a # MISC OIPTIONS ######### [misc] # Load database from path data_dir = {1} # percent cpu devoted to mining 0=off mining = 30 # how verbose should the client be (1-3) verbosity = 3 # set log level and filters (WARM, INFO, DEBUG) # examples: # get every log message from every module # :DEBUG # get every warning from every module # :WARN # get every message from module chainmanager and all warnings # pyethereum.chainmanager:DEBUG,:WARN logging = pyethereum.chainmanager:DEBUG,pyethereum.synchronizer:DEBUG,:INFO # WALLET OPTIONS ################## [wallet] # Set the coinbase (mining payout) address coinbase = 6c386a4b26f73c802f34673f7248bb118f97424a """.format(default_node_id(), default_data_dir()) def get_default_config(): f = StringIO.StringIO() f.write(config_template) f.seek(0) config = ConfigParser.ConfigParser() config.readfp(f) config.set('network', 'client_version', default_client_version()) return config def read_config(cfg_path = default_config_path()): # create default if not existent if not os.path.exists(cfg_path): open(cfg_path, 'w').write(config_template) # extend on the default config config = get_default_config() config.read(cfg_path) return config def dump_config(config): r = [''] for section in config.sections(): for a,v in config.items(section): r.append('[%s] %s = %r' %( section, a, v)) return '\n'.join(r)
21.991228
75
0.70004
0
0
0
0
0
0
0
0
1,352
0.53929
fa60dfbb5a27f65a90d0edd2f3424a73f6bf1539
290
py
Python
sb_backend/app/service/setup/service_noseriesline.py
DmitriyGrigoriev/sb-fastapi
1aef3db6ce26ea054e048e5927552d48c2eccbfb
[ "MIT" ]
null
null
null
sb_backend/app/service/setup/service_noseriesline.py
DmitriyGrigoriev/sb-fastapi
1aef3db6ce26ea054e048e5927552d48c2eccbfb
[ "MIT" ]
null
null
null
sb_backend/app/service/setup/service_noseriesline.py
DmitriyGrigoriev/sb-fastapi
1aef3db6ce26ea054e048e5927552d48c2eccbfb
[ "MIT" ]
null
null
null
from sqlmodel import SQLModel from sb_backend.app.service.base.base_service import ServiceBase from sb_backend.app.crud.setup.crud_noseriesline import CRUDBase, noseriesline class ServiceBase(ServiceBase[CRUDBase, SQLModel, SQLModel]): pass noseriesline_s = ServiceBase(noseriesline)
32.222222
78
0.841379
70
0.241379
0
0
0
0
0
0
0
0
fa610e2a204d0b2414477f21c38684441a0652cb
543
py
Python
AllSpiders/00_Spider/29_js2.py
GongkunJiang/MySpider
8c088f696679b13568843af521279f9f25f40314
[ "MIT" ]
null
null
null
AllSpiders/00_Spider/29_js2.py
GongkunJiang/MySpider
8c088f696679b13568843af521279f9f25f40314
[ "MIT" ]
null
null
null
AllSpiders/00_Spider/29_js2.py
GongkunJiang/MySpider
8c088f696679b13568843af521279f9f25f40314
[ "MIT" ]
null
null
null
# coding=utf-8 from selenium import webdriver import time driver = webdriver.PhantomJS(executable_path=r'E:\Documents\Apps\phantomjs-2.1.1-windows\bin\phantomjs.exe') driver.get("https://movie.douban.com/typerank?type_name=剧情&type=11&interval_id=100:90&action=") # 向下滚动10000像素 js = "document.body.scrollTop=10000" #js="var q=document.documentElement.scrollTop=10000" time.sleep(3) #查看页面快照 driver.save_screenshot("29_js2a.png") # 执行JS语句 driver.execute_script(js) time.sleep(10) #查看页面快照 driver.save_screenshot("29_js2b.png") driver.quit()
22.625
108
0.782689
0
0
0
0
0
0
0
0
351
0.593909
fa6414e49146863505731712674d2bc44a0b263b
113
py
Python
pony/orm/tests/test_f_strings.py
luckydonald/pony
e733f14ef4e21514b49248b7b72aae0728029852
[ "Apache-2.0" ]
2,628
2015-01-02T17:55:28.000Z
2022-03-31T10:36:42.000Z
pony/orm/tests/test_f_strings.py
luckydonald/pony
e733f14ef4e21514b49248b7b72aae0728029852
[ "Apache-2.0" ]
525
2015-01-03T20:30:08.000Z
2022-03-23T12:30:01.000Z
pony/orm/tests/test_f_strings.py
luckydonald/pony
e733f14ef4e21514b49248b7b72aae0728029852
[ "Apache-2.0" ]
256
2015-01-02T17:55:31.000Z
2022-03-20T17:01:37.000Z
from sys import version_info if version_info[:2] >= (3, 6): from pony.orm.tests.py36_test_f_strings import *
28.25
52
0.734513
0
0
0
0
0
0
0
0
0
0
fa64885ad634e2c117f27b9037fa2f92f06d7384
1,042
py
Python
setup.py
hoosiki/notion-as-db
cd7ef9b26b4eb86e1e7fcb7b48053cb361cb9710
[ "BSD-2-Clause" ]
null
null
null
setup.py
hoosiki/notion-as-db
cd7ef9b26b4eb86e1e7fcb7b48053cb361cb9710
[ "BSD-2-Clause" ]
null
null
null
setup.py
hoosiki/notion-as-db
cd7ef9b26b4eb86e1e7fcb7b48053cb361cb9710
[ "BSD-2-Clause" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup with open('README.md') as readme_file: readme = readme_file.read() install_requireent = [] setup_requires = [ 'pandas', 'config2', 'notion' ] install_requires = [ 'pandas', 'config2', 'notion' ] setup( name='notion-as-db', author='Junsang Park', author_email='publichey@gmail.com', url='https://github.com/hoosiki/notion-as-db.git', version='0.0.1', long_description=readme, long_description_content_type="text/markdown", description='Package for convenient Notion usage. Once you set default.yaml file, You don\'t need to find v2token.', packages=find_packages(), license='BSD', include_package_date=False, setup_requires=setup_requires, install_requires=install_requires, download_url='https://github.com/hoosiki/notion-as-db/blob/master/dist/notion-as-db-0.0.1.tar.gz' )
23.681818
120
0.675624
0
0
0
0
0
0
0
0
413
0.396353
fa65b4e9e09e4d5ff6693e3667dc5ce68e121420
435
py
Python
python/alejo/hackerrank_contact_list.py
alejodeveloper/algorithms-practices
55c2f388c9b37f0f48bcc946045d4a6d75589e6f
[ "MIT" ]
null
null
null
python/alejo/hackerrank_contact_list.py
alejodeveloper/algorithms-practices
55c2f388c9b37f0f48bcc946045d4a6d75589e6f
[ "MIT" ]
1
2020-04-29T19:33:15.000Z
2020-04-29T19:33:15.000Z
python/alejo/hackerrank_contact_list.py
alejodeveloper/algorithms-practices
55c2f388c9b37f0f48bcc946045d4a6d75589e6f
[ "MIT" ]
null
null
null
import sys from collections import defaultdict sys.stdin.readline() my_results = defaultdict(int) def add_contact(contact): for index, _ in enumerate(contact): my_contact = contact[0:index] my_results[my_contact] +=1 for line in sys.stdin.readlines(): operation, contact = line.strip().split(' ') if operation == 'add': map(add_contact, contact) else: print(my_results[contact])
18.913043
48
0.666667
0
0
0
0
0
0
0
0
8
0.018391
fa66baebed871b04ea5017870ffe52df882a7abb
10,658
py
Python
stacker_blueprints/asg.py
aengelas/stacker_blueprints
70131511714a5a3595ee56b7d6ea569ff41aa3b6
[ "BSD-2-Clause" ]
43
2015-12-30T13:47:57.000Z
2020-12-05T00:36:57.000Z
stacker_blueprints/asg.py
aengelas/stacker_blueprints
70131511714a5a3595ee56b7d6ea569ff41aa3b6
[ "BSD-2-Clause" ]
87
2015-12-22T23:00:43.000Z
2019-07-25T15:27:11.000Z
stacker_blueprints/asg.py
aengelas/stacker_blueprints
70131511714a5a3595ee56b7d6ea569ff41aa3b6
[ "BSD-2-Clause" ]
40
2016-01-25T12:27:38.000Z
2020-12-28T14:48:22.000Z
import copy from troposphere import ( Ref, FindInMap, Not, Equals, And, Condition, Join, ec2, autoscaling, If, GetAtt, Output ) from troposphere import elasticloadbalancing as elb from troposphere.autoscaling import Tag as ASTag from troposphere.route53 import RecordSetType from stacker.blueprints.base import Blueprint from stacker.blueprints.variables.types import TroposphereType from stacker.blueprints.variables.types import ( CFNCommaDelimitedList, CFNNumber, CFNString, EC2VPCId, EC2KeyPairKeyName, EC2SecurityGroupId, EC2SubnetIdList, ) CLUSTER_SG_NAME = "%sSG" ELB_SG_NAME = "%sElbSG" ELB_NAME = "%sLoadBalancer" class AutoscalingGroup(Blueprint): VARIABLES = { 'VpcId': {'type': EC2VPCId, 'description': 'Vpc Id'}, 'DefaultSG': {'type': EC2SecurityGroupId, 'description': 'Top level security group.'}, 'BaseDomain': { 'type': CFNString, 'default': '', 'description': 'Base domain for the stack.'}, 'PrivateSubnets': {'type': EC2SubnetIdList, 'description': 'Subnets to deploy private ' 'instances in.'}, 'PublicSubnets': {'type': EC2SubnetIdList, 'description': 'Subnets to deploy public (elb) ' 'instances in.'}, 'AvailabilityZones': {'type': CFNCommaDelimitedList, 'description': 'Availability Zones to deploy ' 'instances in.'}, 'InstanceType': {'type': CFNString, 'description': 'EC2 Instance Type', 'default': 'm3.medium'}, 'MinSize': {'type': CFNNumber, 'description': 'Minimum # of instances.', 'default': '1'}, 'MaxSize': {'type': CFNNumber, 'description': 'Maximum # of instances.', 'default': '5'}, 'SshKeyName': {'type': EC2KeyPairKeyName}, 'ImageName': { 'type': CFNString, 'description': 'The image name to use from the AMIMap (usually ' 'found in the config file.)'}, 'ELBHostName': { 'type': CFNString, 'description': 'A hostname to give to the ELB. If not given ' 'no ELB will be created.', 'default': ''}, 'ELBCertName': { 'type': CFNString, 'description': 'The SSL certificate name to use on the ELB.', 'default': ''}, 'ELBCertType': { 'type': CFNString, 'description': 'The SSL certificate type to use on the ELB.', 'default': ''}, } def create_conditions(self): self.template.add_condition( "CreateELB", Not(Equals(Ref("ELBHostName"), ""))) self.template.add_condition( "SetupDNS", Not(Equals(Ref("BaseDomain"), ""))) self.template.add_condition( "UseSSL", Not(Equals(Ref("ELBCertName"), ""))) self.template.add_condition( "CreateSSLELB", And(Condition("CreateELB"), Condition("UseSSL"))) self.template.add_condition( "SetupELBDNS", And(Condition("CreateELB"), Condition("SetupDNS"))) self.template.add_condition( "UseIAMCert", Not(Equals(Ref("ELBCertType"), "acm"))) def create_security_groups(self): t = self.template asg_sg = CLUSTER_SG_NAME % self.name elb_sg = ELB_SG_NAME % self.name t.add_resource(ec2.SecurityGroup( asg_sg, GroupDescription=asg_sg, VpcId=Ref("VpcId"))) # ELB Security group, if ELB is used t.add_resource( ec2.SecurityGroup( elb_sg, GroupDescription=elb_sg, VpcId=Ref("VpcId"), Condition="CreateELB")) # Add SG rules here # Allow ELB to connect to ASG on port 80 t.add_resource(ec2.SecurityGroupIngress( "%sElbToASGPort80" % self.name, IpProtocol="tcp", FromPort="80", ToPort="80", SourceSecurityGroupId=Ref(elb_sg), GroupId=Ref(asg_sg), Condition="CreateELB")) # Allow Internet to connect to ELB on port 80 t.add_resource(ec2.SecurityGroupIngress( "InternetTo%sElbPort80" % self.name, IpProtocol="tcp", FromPort="80", ToPort="80", CidrIp="0.0.0.0/0", GroupId=Ref(elb_sg), Condition="CreateELB")) t.add_resource(ec2.SecurityGroupIngress( "InternetTo%sElbPort443" % self.name, IpProtocol="tcp", FromPort="443", ToPort="443", CidrIp="0.0.0.0/0", GroupId=Ref(elb_sg), Condition="CreateSSLELB")) def setup_listeners(self): no_ssl = [elb.Listener( LoadBalancerPort=80, Protocol='HTTP', InstancePort=80, InstanceProtocol='HTTP' )] # Choose proper certificate source acm_cert = Join("", [ "arn:aws:acm:", Ref("AWS::Region"), ":", Ref("AWS::AccountId"), ":certificate/", Ref("ELBCertName")]) iam_cert = Join("", [ "arn:aws:iam::", Ref("AWS::AccountId"), ":server-certificate/", Ref("ELBCertName")]) cert_id = If("UseIAMCert", iam_cert, acm_cert) with_ssl = copy.deepcopy(no_ssl) with_ssl.append(elb.Listener( LoadBalancerPort=443, InstancePort=80, Protocol='HTTPS', InstanceProtocol="HTTP", SSLCertificateId=cert_id)) listeners = If("UseSSL", with_ssl, no_ssl) return listeners def create_load_balancer(self): t = self.template elb_name = ELB_NAME % self.name elb_sg = ELB_SG_NAME % self.name t.add_resource(elb.LoadBalancer( elb_name, HealthCheck=elb.HealthCheck( Target='HTTP:80/', HealthyThreshold=3, UnhealthyThreshold=3, Interval=5, Timeout=3), Listeners=self.setup_listeners(), SecurityGroups=[Ref(elb_sg), ], Subnets=Ref("PublicSubnets"), Condition="CreateELB")) # Setup ELB DNS t.add_resource( RecordSetType( '%sDnsRecord' % elb_name, # Appends a '.' to the end of the domain HostedZoneName=Join("", [Ref("BaseDomain"), "."]), Comment='Router ELB DNS', Name=Join('.', [Ref("ELBHostName"), Ref("BaseDomain")]), Type='CNAME', TTL='120', ResourceRecords=[ GetAtt(elb_name, 'DNSName')], Condition="SetupELBDNS")) def get_launch_configuration_parameters(self): return { 'ImageId': FindInMap('AmiMap', Ref("AWS::Region"), Ref('ImageName')), 'InstanceType': Ref("InstanceType"), 'KeyName': Ref("SshKeyName"), 'SecurityGroups': self.get_launch_configuration_security_groups(), } def get_autoscaling_group_parameters(self, launch_config_name, elb_name): return { 'AvailabilityZones': Ref("AvailabilityZones"), 'LaunchConfigurationName': Ref(launch_config_name), 'MinSize': Ref("MinSize"), 'MaxSize': Ref("MaxSize"), 'VPCZoneIdentifier': Ref("PrivateSubnets"), 'LoadBalancerNames': If("CreateELB", [Ref(elb_name), ], []), 'Tags': [ASTag('Name', self.name, True)], } def get_launch_configuration_security_groups(self): sg_name = CLUSTER_SG_NAME % self.name return [Ref("DefaultSG"), Ref(sg_name)] def create_autoscaling_group(self): name = "%sASG" % self.name launch_config = "%sLaunchConfig" % name elb_name = ELB_NAME % self.name t = self.template t.add_resource(autoscaling.LaunchConfiguration( launch_config, **self.get_launch_configuration_parameters() )) t.add_resource(autoscaling.AutoScalingGroup( name, **self.get_autoscaling_group_parameters(launch_config, elb_name) )) def create_template(self): self.create_conditions() self.create_security_groups() self.create_load_balancer() self.create_autoscaling_group() class FlexibleAutoScalingGroup(Blueprint): """ A more flexible AutoscalingGroup Blueprint. Uses TroposphereTypes to make creating AutoscalingGroups and their associated LaunchConfiguration more flexible. This comes at the price of doing less for you. """ VARIABLES = { "LaunchConfiguration": { "type": TroposphereType(autoscaling.LaunchConfiguration), "description": "The LaunchConfiguration for the autoscaling " "group.", }, "AutoScalingGroup": { "type": TroposphereType(autoscaling.AutoScalingGroup), "description": "The Autoscaling definition. Do not provide a " "LaunchConfiguration parameter, that will be " "automatically added from the LaunchConfiguration " "Variable.", }, } def create_launch_configuration(self): t = self.template variables = self.get_variables() self.launch_config = t.add_resource(variables["LaunchConfiguration"]) t.add_output( Output("LaunchConfiguration", Value=self.launch_config.Ref()) ) def add_launch_config_variable(self, asg): if getattr(asg, "LaunchConfigurationName", False): raise ValueError("Do not provide a LaunchConfigurationName " "variable for the AutoScalingGroup config.") asg.LaunchConfigurationName = self.launch_config.Ref() return asg def create_autoscaling_group(self): t = self.template variables = self.get_variables() asg = variables["AutoScalingGroup"] asg = self.add_launch_config_variable(asg) t.add_resource(asg) t.add_output(Output("AutoScalingGroup", Value=asg.Ref())) def create_template(self): self.create_launch_configuration() self.create_autoscaling_group()
37.396491
78
0.561644
9,990
0.937324
0
0
0
0
0
0
2,993
0.280822
fa6881de69c9929008a699b6ce522f86648d2221
403
py
Python
input/migrations/0016_auto_20190524_0055.py
JianaXu/productivity
f7478ce2f154538185f071d58a0e4a2cc0b17ee8
[ "bzip2-1.0.6" ]
null
null
null
input/migrations/0016_auto_20190524_0055.py
JianaXu/productivity
f7478ce2f154538185f071d58a0e4a2cc0b17ee8
[ "bzip2-1.0.6" ]
10
2019-05-15T06:25:36.000Z
2022-02-10T08:46:38.000Z
input/migrations/0016_auto_20190524_0055.py
JianaXu/productivity
f7478ce2f154538185f071d58a0e4a2cc0b17ee8
[ "bzip2-1.0.6" ]
1
2019-05-21T03:01:48.000Z
2019-05-21T03:01:48.000Z
# Generated by Django 2.1.1 on 2019-05-24 00:55 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('input', '0015_auto_20190524_0052'), ] operations = [ migrations.AlterField( model_name='post', name='ctime', field=models.DateTimeField(auto_now=True), ), ]
21.210526
55
0.57072
304
0.754342
0
0
0
0
0
0
93
0.230769
fa6b5b623f434c261ce5c85dbe3b4296800991aa
3,038
py
Python
tools/decompiler/basicblock.py
miniupnp/sundog
eb48447d1791e8bbd9ce4afe872a541dc67fcca1
[ "MIT" ]
54
2017-01-31T08:14:04.000Z
2022-03-18T23:26:35.000Z
tools/decompiler/basicblock.py
miniupnp/sundog
eb48447d1791e8bbd9ce4afe872a541dc67fcca1
[ "MIT" ]
9
2018-02-25T15:28:55.000Z
2021-10-15T14:29:44.000Z
tools/decompiler/basicblock.py
miniupnp/sundog
eb48447d1791e8bbd9ce4afe872a541dc67fcca1
[ "MIT" ]
13
2017-01-29T12:38:26.000Z
2021-12-22T23:57:35.000Z
# Copyright (c) 2017 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import opcodes ####### Basic blocks ######## class BasicBlock: '''Basic block of instructions''' def __init__(self, addr): self.addr = addr # Starting address self.instructions = [] # Instructions in basic block self.pred = [] # Predecessors self.succ = [] # Successors # Filled in by dataflow analysis: # self.ins # self.outs def __repr__(self): return 'bb@0x%04x' % self.addr class BasicBlocks: '''Container for basic blocks''' def __init__(self, root, blocks): self.root = root # Entry block self.blocks = blocks # Array of blocks, in code order class BBPassInfo: ''' Metadata for pass 1 ''' def __init__(self): self.incoming = [] # jump target: first of basic block self.bbend = False # last instruction in basic block self.bb = None # back-reference to bb def find_basic_blocks(proc, dseg, proclist, debug=False): ''' Perform control flow analysis on a procedure to find basic blocks. ''' if proc.is_native: # Cannot do native code return seg = dseg.info # create mapping from address to index inst_by_addr = {inst.addr:inst for inst in proc.instructions} # Add temporary information to instructions for inst in proc.instructions: inst.data = BBPassInfo() # pass 1: mark jump targets and ends of basic blocks for inst in proc.instructions: op = opcodes.OPCODES[inst.opcode] if inst.opcode == opcodes.RPU: inst.data.bbend = True break # full stop elif op[2] & opcodes.CFLOW: for tgt in inst.get_flow_targets(dseg): inst_by_addr[tgt].data.incoming.append(inst) inst.data.bbend = True # create list of basic blocks blocks = [] block = None prev = None for inst in proc.instructions: if block is None or inst.data.incoming or (prev is not None and prev.data.bbend): if prev is not None and not prev.data.bbend: # Last instruction was not a bb-ending instruction, add an incoming edge # from previous instruciton. inst.data.incoming.append(prev) # Start new basic block block = BasicBlock(inst.addr) blocks.append(block) block.instructions.append(inst) prev = inst # pass 2: cross-reference basic blocks for bb in blocks: for inst in bb.instructions: inst.data.bb = bb # set successors and predecessors for bb in blocks: for src in bb.instructions[0].data.incoming: bb.pred.append(src.data.bb) src.data.bb.succ.append(bb) # clean up for inst in proc.instructions: del inst.data return BasicBlocks(blocks[0], blocks)
31.645833
89
0.618828
858
0.282423
0
0
0
0
0
0
1,064
0.35023
fa6e2940900591d9470ba01c2dd2e48f3b5615c8
1,136
py
Python
data-pipeline/src/data_pipeline/datasets/exac/exac_regional_missense_constraint.py
broadinstitute/gnomadjs
00da72cdc2cb0753f822c51456ec15147c024a1d
[ "MIT" ]
38
2018-02-24T02:33:52.000Z
2020-03-03T23:17:04.000Z
data-pipeline/src/data_pipeline/datasets/exac/exac_regional_missense_constraint.py
broadinstitute/gnomadjs
00da72cdc2cb0753f822c51456ec15147c024a1d
[ "MIT" ]
385
2018-02-21T16:53:13.000Z
2020-03-04T00:52:40.000Z
data-pipeline/src/data_pipeline/datasets/exac/exac_regional_missense_constraint.py
broadinstitute/gnomadjs
00da72cdc2cb0753f822c51456ec15147c024a1d
[ "MIT" ]
13
2020-05-01T13:03:54.000Z
2022-02-28T13:12:57.000Z
import hail as hl def prepare_exac_regional_missense_constraint(path): ds = hl.import_table( path, missing="", types={ "transcript": hl.tstr, "gene": hl.tstr, "chr": hl.tstr, "amino_acids": hl.tstr, "genomic_start": hl.tint, "genomic_end": hl.tint, "obs_mis": hl.tfloat, "exp_mis": hl.tfloat, "obs_exp": hl.tfloat, "chisq_diff_null": hl.tfloat, "region_name": hl.tstr, }, ) ds = ds.annotate(obs_mis=hl.int(ds.obs_mis)) ds = ds.annotate(start=hl.min(ds.genomic_start, ds.genomic_end), stop=hl.max(ds.genomic_start, ds.genomic_end)) ds = ds.drop("amino_acids", "chr", "gene", "genomic_start", "genomic_end", "region_name") ds = ds.transmute(transcript_id=ds.transcript.split("\\.")[0]) ds = ds.group_by("transcript_id").aggregate(regions=hl.agg.collect(ds.row_value)) ds = ds.annotate(regions=hl.sorted(ds.regions, lambda region: region.start)) ds = ds.select(exac_regional_missense_constraint_regions=ds.regions) return ds
29.894737
115
0.601232
0
0
0
0
0
0
0
0
208
0.183099
fa6ed198a2d394bfc16d45930d5a58eda8c180fc
2,426
py
Python
smokey/ranger/ranger.py
godatadriven/hdp-smokey
b60c6941d77b66b4f84747d5fe10c972db88f7f7
[ "Apache-2.0" ]
1
2018-02-11T14:05:06.000Z
2018-02-11T14:05:06.000Z
smokey/ranger/ranger.py
godatadriven/hdp-smokey
b60c6941d77b66b4f84747d5fe10c972db88f7f7
[ "Apache-2.0" ]
null
null
null
smokey/ranger/ranger.py
godatadriven/hdp-smokey
b60c6941d77b66b4f84747d5fe10c972db88f7f7
[ "Apache-2.0" ]
1
2021-01-29T18:08:53.000Z
2021-01-29T18:08:53.000Z
import os import logging import requests import ambari.api as api from utils.utils import logmethodcall class RangerRequestError(Exception): pass class Ranger: def __init__(self, request_timeout=10): self.timeout = request_timeout self.ranger_schema = os.environ.get('RANGER_SCHEMA', 'http') self.ranger_host = os.environ.get('RANGER_HOST', 'sandbox.hortonworks.com') self.ranger_port = os.environ.get('RANGER_PORT', 6080) logging.basicConfig(level=logging.DEBUG, format='{asctime} ({levelname}) {funcName}(): {message}', style="{", filename='ranger.log') self.logger = logging.getLogger(__name__) @logmethodcall def get_ranger_url(self): return '{0}://{1}:{2}/'.format(self.ranger_schema, self.ranger_host, self.ranger_port) @logmethodcall def is_ranger_online(self): try: requests.get(self.get_ranger_url(), timeout=self.timeout) return True except: return False @logmethodcall def stop_ranger_admin(self): ambari = api.Api(logger=self.logger) ranger_admin_ambari_info = ambari.get_component_info('RANGER', 'RANGER_ADMIN') rnd_ranger_host, rnd_ranger_component = ambari.get_random_host_and_component_path(ranger_admin_ambari_info) self.logger.info("Selected random Ranger admin host for stopping: {0}, {1}" .format(rnd_ranger_host, rnd_ranger_component)) ambari.change_host_component_state_and_wait(rnd_ranger_component, state='INSTALLED') @logmethodcall def check_ranger_status(self): ranger_url = '{0}://{1}:{2}/'.format(self.ranger_schema, self.ranger_host, self.ranger_port) self.logger.debug(ranger_url) response = requests.get(ranger_url, timeout=self.timeout) self.verify_ranger_response(response) @logmethodcall def verify_ranger_response(self, response): if response.status_code != 200: self.logger.error( "RangerResponse returned with error status [{0}], response was: {1}".format(response.status_code, response.text)) raise RangerRequestError("RangerResponse returned with error status [{0}]".format(response.status_code))
38.507937
116
0.640148
2,314
0.953833
0
0
1,650
0.680132
0
0
376
0.154988
fa6fa5a701f70f4832c2cbf824364381684d1511
4,567
py
Python
tests/player_state_test.py
the-gigi/dominion
2bccad2e51a574c881372d32819e2e3049d93e78
[ "MIT" ]
2
2020-04-16T03:21:25.000Z
2022-01-15T18:24:08.000Z
tests/player_state_test.py
the-gigi/dominion
2bccad2e51a574c881372d32819e2e3049d93e78
[ "MIT" ]
36
2020-07-03T04:42:50.000Z
2020-07-05T18:30:57.000Z
tests/player_state_test.py
the-gigi/dominion
2bccad2e51a574c881372d32819e2e3049d93e78
[ "MIT" ]
null
null
null
import unittest from dominion_game_engine.card_util import * from dominion_game_engine.cards import * from dominion_game_engine.player_state import PlayerState class TestPlayerState(unittest.TestCase): def setUp(self): card_types = get_card_types().values() piles = setup_piles(card_types, 4) self.player_state = PlayerState('tester1', piles) def test_initialize_draw_deck(self): """ √ Create new player state √ Check if the player has exactly 7 coppers and 3 estates in their Draw Deck """ self.player_state.draw_deck.cards += self.player_state.hand self.player_state.hand = [] num_coppers = sum(1 if type(c) == Copper else 0 for c in self.player_state.draw_deck.cards) num_estates = sum(1 if type(c) == Estate else 0 for c in self.player_state.draw_deck.cards) self.assertEqual(num_coppers, 7) self.assertEqual(num_estates, 3) def test_draw_cards(self): """ draw 0 cards draw 1 card with no cards in deck or discard draw multiple cards with no cards in deck or discard draw 1 card with no cards in deck and 1 card in discard draw multiple cards with no cards in deck and 1 card in discard draw 1 card with 1 card in deck and multiple cards in discard draw multiple cards with 1 card in deck and multiple cards in discard draw 1 card with multiple cards in deck draw multiple cards with multiple cards in deck """ # draw 0 cards copper = Copper() silver = Silver() gold = Gold() estate = Estate() self.player_state.hand = [copper] self.player_state.draw_deck.cards = [silver] self.player_state.discard_pile.cards = [] self.player_state.draw_cards(0) expected = [copper] self.assertEqual(self.player_state.hand, expected) self.assertEqual(self.player_state.draw_deck.cards, [silver]) # draw 1 card with no cards in deck or discard self.player_state.hand = [copper] self.player_state.draw_deck.cards = [] expected = [copper] self.player_state.draw_cards(1) self.assertEqual(self.player_state.hand, expected) expected = [copper] self.player_state.draw_cards(3) self.assertEqual(self.player_state.hand, expected) # draw 1 card with no cards in deck and 1 card in discard self.player_state.hand = [copper] self.player_state.draw_deck.cards = [] self.player_state.discard_pile.cards = [silver] self.player_state.draw_cards(1) expected = [copper, silver] self.assertEqual(self.player_state.hand, expected) # draw multiple cards with no cards in deck and 1 card in discard self.player_state.hand = [copper] self.player_state.draw_deck.cards = [] self.player_state.discard_pile.cards = [silver] expected = [copper, silver] self.player_state.draw_cards(3) self.assertEqual(self.player_state.hand, expected) # draw 1 card with 1 card in deck and multiple cards in discard self.player_state.hand = [copper] self.player_state.draw_deck.cards = [silver] self.player_state.discard_pile.cards = [gold, estate] self.player_state.draw_cards(1) expected = [copper, silver] self.assertEqual(self.player_state.hand, expected) # draw multiple cards with 1 card in deck and multiple cards in discard self.player_state.hand = [copper] self.player_state.draw_deck.cards = [silver] self.player_state.draw_cards(3) expected = as_dict([copper, silver, gold, estate]) self.assertEqual(as_dict(self.player_state.hand), expected) # draw 1 card with multiple cards in deck self.player_state.hand = [copper] self.player_state.draw_deck.cards = [silver, gold, estate] self.player_state.discard_pile.cards = [] self.player_state.draw_cards(1) expected = [copper, silver] self.assertEqual(self.player_state.hand, expected) # draw multiple cards with multiple cards in deck self.player_state.hand = [copper] self.player_state.draw_deck.cards = [silver, gold, estate] self.player_state.discard_pile.cards = [] self.player_state.draw_cards(3) expected = [copper, silver, gold, estate] self.assertEqual(self.player_state.hand, expected) if __name__ == '__main__': unittest.main()
38.378151
99
0.662798
4,358
0.953402
0
0
0
0
0
0
1,104
0.241523
fa7021d6098d58c035a0d3dad7302d599a66813a
923
py
Python
setup.py
hyong/mercury-python
b93806926253497e5af3a9578078f523a7b1eb8e
[ "Apache-2.0" ]
null
null
null
setup.py
hyong/mercury-python
b93806926253497e5af3a9578078f523a7b1eb8e
[ "Apache-2.0" ]
null
null
null
setup.py
hyong/mercury-python
b93806926253497e5af3a9578078f523a7b1eb8e
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup(name='mercury', version='1.12.9', description='Python Language pack for Mercury', author='Eric Law', author_email='eric.law@accenture.com', url='https://github.com/Accenture/mercury-python', project_urls={ 'Parent': 'https://github.com/Accenture/mercury' }, packages=['mercury', 'mercury.system', 'mercury.resources'], license='Apache 2.0', python_requires='>=3.6.7', install_requires=['aiohttp', 'msgpack-python'], classifiers=[ 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License' ] )
32.964286
66
0.588299
0
0
0
0
0
0
0
0
549
0.5948
fa71facc34b7918ebfa76bd5b5238004818e6414
926
py
Python
nailgun/nailgun/notifier.py
Zipfer/fuel-web
c6c4032eb6e29474e2be0318349265bdb566454c
[ "Apache-2.0" ]
1
2021-04-06T16:13:35.000Z
2021-04-06T16:13:35.000Z
nailgun/nailgun/notifier.py
Zipfer/fuel-web
c6c4032eb6e29474e2be0318349265bdb566454c
[ "Apache-2.0" ]
null
null
null
nailgun/nailgun/notifier.py
Zipfer/fuel-web
c6c4032eb6e29474e2be0318349265bdb566454c
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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. from nailgun import objects def notify(topic, message, cluster_id=None, node_id=None, task_uuid=None): objects.Notification.create({ "topic": topic, "message": message, "cluster_id": cluster_id, "node_id": node_id, "task_uuid": task_uuid })
33.071429
78
0.684665
0
0
0
0
0
0
0
0
667
0.720302
fa7209a12d727d51c6c0d529030ddf8254ae67ef
316,484
py
Python
mxfold2/param_turner2004.py
proterabio/mxfold2
571ba83a9caa562f3fef4701648602469fde8ebe
[ "MIT" ]
46
2020-09-17T04:50:22.000Z
2022-03-22T08:14:15.000Z
mxfold2/param_turner2004.py
proterabio/mxfold2
571ba83a9caa562f3fef4701648602469fde8ebe
[ "MIT" ]
7
2021-02-09T10:09:03.000Z
2022-01-14T21:19:02.000Z
mxfold2/param_turner2004.py
proterabio/mxfold2
571ba83a9caa562f3fef4701648602469fde8ebe
[ "MIT" ]
20
2020-10-15T09:03:59.000Z
2022-03-09T07:16:20.000Z
import numpy as np score_stack = np.array([ [ 0, 0, 0, 0, 0, 0, 0, 0, ], [ 0, -240, -330, -210, -140, -210, -210, -140, ], [ 0, -330, -340, -250, -150, -220, -240, -150, ], [ 0, -210, -250, 130, -50, -140, -130, 130, ], [ 0, -140, -150, -50, 30, -60, -100, 30, ], [ 0, -210, -220, -140, -60, -110, -90, -60, ], [ 0, -210, -240, -130, -100, -90, -130, -90, ], [ 0, -140, -150, 130, 30, -60, -90, 130, ], ], dtype=np.float32) / -100. score_mismatch_hairpin = np.array([ [ [ 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, ], ], [ [ -80, -100, -110, -100, -80, ], [ -140, -150, -150, -140, -150, ], [ -80, -100, -110, -100, -80, ], [ -150, -230, -150, -240, -150, ], [ -100, -100, -140, -100, -210, ], ], [ [ -50, -110, -70, -110, -50, ], [ -110, -110, -150, -130, -150, ], [ -50, -110, -70, -110, -50, ], [ -150, -250, -150, -220, -150, ], [ -100, -110, -100, -110, -160, ], ], [ [ 20, 20, -20, -10, -20, ], [ 20, 20, -50, -30, -50, ], [ -10, -10, -20, -10, -20, ], [ -50, -100, -50, -110, -50, ], [ -10, -10, -30, -10, -100, ], ], [ [ 0, -20, -10, -20, 0, ], [ -30, -50, -30, -60, -30, ], [ 0, -20, -10, -20, 0, ], [ -30, -90, -30, -110, -30, ], [ -10, -20, -10, -20, -90, ], ], [ [ -10, -10, -20, -10, -20, ], [ -30, -30, -50, -30, -50, ], [ -10, -10, -20, -10, -20, ], [ -50, -120, -50, -110, -50, ], [ -10, -10, -30, -10, -120, ], ], [ [ 0, -20, -10, -20, 0, ], [ -30, -50, -30, -50, -30, ], [ 0, -20, -10, -20, 0, ], [ -30, -150, -30, -150, -30, ], [ -10, -20, -10, -20, -90, ], ], [ [ 20, 20, -10, -10, 0, ], [ 20, 20, -30, -30, -30, ], [ 0, -10, -10, -10, 0, ], [ -30, -90, -30, -110, -30, ], [ -10, -10, -10, -10, -90, ], ], ], dtype=np.float32) / -100. score_mismatch_internal = np.array([ [ [ 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, -80, 0, ], [ 0, 0, 0, 0, 0, ], [ 0, -100, 0, -100, 0, ], [ 0, 0, 0, 0, -60, ], ], [ [ 0, 0, 0, 0, 0, ], [ 0, 0, 0, -80, 0, ], [ 0, 0, 0, 0, 0, ], [ 0, -100, 0, -100, 0, ], [ 0, 0, 0, 0, -60, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, -10, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, -30, 70, -30, 70, ], [ 70, 70, 70, 70, 10, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, -10, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, -30, 70, -30, 70, ], [ 70, 70, 70, 70, 10, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, -10, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, -30, 70, -30, 70, ], [ 70, 70, 70, 70, 10, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, -10, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, -30, 70, -30, 70, ], [ 70, 70, 70, 70, 10, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, -10, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, -30, 70, -30, 70, ], [ 70, 70, 70, 70, 10, ], ], ], dtype=np.float32) / -100. score_mismatch_internal_1n = np.array([ [ [ 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, 0, 0, 0, ], [ 0, 0, 0, 0, 0, ], [ 0, 0, 0, 0, 0, ], [ 0, 0, 0, 0, 0, ], [ 0, 0, 0, 0, 0, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], ], ], dtype=np.float32) / -100. score_mismatch_internal_23 = np.array([ [ [ 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, -50, 0, ], [ 0, 0, 0, 0, 0, ], [ 0, -110, 0, -70, 0, ], [ 0, 0, 0, 0, -30, ], ], [ [ 0, 0, 0, 0, 0, ], [ 0, 0, 0, 0, 0, ], [ 0, 0, 0, 0, 0, ], [ 0, -120, 0, -70, 0, ], [ 0, 0, 0, 0, -30, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, -40, 70, 0, 70, ], [ 70, 70, 70, 70, 40, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 20, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, -40, 70, 0, 70, ], [ 70, 70, 70, 70, 40, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, -40, 70, 0, 70, ], [ 70, 70, 70, 70, 40, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 20, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, -40, 70, 0, 70, ], [ 70, 70, 70, 70, 40, ], ], [ [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, 70, 70, 70, 70, ], [ 70, -40, 70, 0, 70, ], [ 70, 70, 70, 70, 40, ], ], ], dtype=np.float32) / -100. score_mismatch_multi = np.array([ [ [ 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, ], ], [ [ -50, -110, -50, -140, -70, ], [ -110, -110, -110, -160, -110, ], [ -70, -150, -70, -150, -100, ], [ -110, -130, -110, -140, -110, ], [ -50, -150, -50, -150, -70, ], ], [ [ -80, -140, -80, -140, -100, ], [ -100, -150, -100, -140, -100, ], [ -110, -150, -110, -150, -140, ], [ -100, -140, -100, -160, -100, ], [ -80, -150, -80, -150, -120, ], ], [ [ -50, -80, -50, -50, -50, ], [ -50, -100, -70, -50, -70, ], [ -60, -80, -60, -80, -60, ], [ -70, -110, -70, -80, -70, ], [ -50, -80, -50, -80, -50, ], ], [ [ -30, -30, -60, -60, -60, ], [ -30, -30, -60, -60, -60, ], [ -70, -100, -70, -100, -80, ], [ -60, -80, -60, -80, -60, ], [ -60, -100, -70, -100, -60, ], ], [ [ -50, -80, -50, -80, -50, ], [ -70, -100, -70, -110, -70, ], [ -60, -80, -60, -80, -60, ], [ -70, -110, -70, -120, -70, ], [ -50, -80, -50, -80, -50, ], ], [ [ -60, -80, -60, -80, -60, ], [ -60, -80, -60, -80, -60, ], [ -70, -100, -70, -100, -80, ], [ -60, -80, -60, -80, -60, ], [ -70, -100, -70, -100, -80, ], ], [ [ -30, -30, -50, -50, -50, ], [ -30, -30, -60, -50, -60, ], [ -60, -80, -60, -80, -60, ], [ -60, -80, -60, -80, -60, ], [ -50, -80, -50, -80, -50, ], ], ], dtype=np.float32) / -100. score_mismatch_external = np.array([ [ [ 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, ], ], [ [ -50, -110, -50, -140, -70, ], [ -110, -110, -110, -160, -110, ], [ -70, -150, -70, -150, -100, ], [ -110, -130, -110, -140, -110, ], [ -50, -150, -50, -150, -70, ], ], [ [ -80, -140, -80, -140, -100, ], [ -100, -150, -100, -140, -100, ], [ -110, -150, -110, -150, -140, ], [ -100, -140, -100, -160, -100, ], [ -80, -150, -80, -150, -120, ], ], [ [ -50, -80, -50, -50, -50, ], [ -50, -100, -70, -50, -70, ], [ -60, -80, -60, -80, -60, ], [ -70, -110, -70, -80, -70, ], [ -50, -80, -50, -80, -50, ], ], [ [ -30, -30, -60, -60, -60, ], [ -30, -30, -60, -60, -60, ], [ -70, -100, -70, -100, -80, ], [ -60, -80, -60, -80, -60, ], [ -60, -100, -70, -100, -60, ], ], [ [ -50, -80, -50, -80, -50, ], [ -70, -100, -70, -110, -70, ], [ -60, -80, -60, -80, -60, ], [ -70, -110, -70, -120, -70, ], [ -50, -80, -50, -80, -50, ], ], [ [ -60, -80, -60, -80, -60, ], [ -60, -80, -60, -80, -60, ], [ -70, -100, -70, -100, -80, ], [ -60, -80, -60, -80, -60, ], [ -70, -100, -70, -100, -80, ], ], [ [ -30, -30, -50, -50, -50, ], [ -30, -30, -60, -50, -60, ], [ -60, -80, -60, -80, -60, ], [ -60, -80, -60, -80, -60, ], [ -50, -80, -50, -80, -50, ], ], ], dtype=np.float32) / -100. score_dangle5 = np.array([ [0, 0, 0, 0, 0, ], [-10, -50, -30, -20, -10, ], [0, -20, -30, 0, 0, ], [-20, -30, -30, -40, -20, ], [-10, -30, -10, -20, -20, ], [-20, -30, -30, -40, -20, ], [-10, -30, -10, -20, -20, ], [0, -20, -10, 0, 0, ], ], dtype=np.float32) / -100. score_dangle3 = np.array([ [0, 0, 0, 0, 0, ], [-40, -110, -40, -130, -60, ], [-80, -170, -80, -170, -120, ], [-10, -70, -10, -70, -10, ], [-50, -80, -50, -80, -60, ], [-10, -70, -10, -70, -10, ], [-50, -80, -50, -80, -60, ], [-10, -70, -10, -70, -10, ], ], dtype=np.float32) / -100. score_int11 = np.array([ [ [ [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, 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, 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, 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, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], ], [ [90, 90, 50, 50, 50, ], [90, 90, 50, 50, 50, ], [50, 50, 50, 50, 50, ], [50, 50, 50, -140, 50, ], [50, 50, 50, 50, 40, ], ], [ [90, 90, 50, 50, 60, ], [90, 90, -40, 50, 50, ], [60, 30, 50, 50, 60, ], [50, -10, 50, -220, 50, ], [50, 50, 0, 50, -10, ], ], [ [120, 120, 120, 120, 120, ], [120, 60, 50, 120, 120, ], [120, 120, 120, 120, 120, ], [120, -20, 120, -140, 120, ], [120, 120, 100, 120, 110, ], ], [ [220, 220, 170, 120, 120, ], [220, 220, 130, 120, 120, ], [170, 120, 170, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 110, ], ], [ [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 80, ], ], [ [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 120, ], ], [ [220, 220, 170, 120, 120, ], [220, 220, 130, 120, 120, ], [170, 120, 170, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 120, ], ], ], [ [ [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, ], ], [ [90, 90, 60, 50, 50, ], [90, 90, 30, -10, 50, ], [50, -40, 50, 50, 0, ], [50, 50, 50, -220, 50, ], [60, 50, 60, 50, -10, ], ], [ [80, 80, 50, 50, 50, ], [80, 80, 50, 50, 50, ], [50, 50, 50, 50, 50, ], [50, 50, 50, -230, 50, ], [50, 50, 50, 50, -60, ], ], [ [190, 190, 120, 150, 150, ], [190, 190, 120, 150, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, -140, 120, ], [150, 120, 120, 120, 150, ], ], [ [160, 160, 120, 120, 120, ], [160, 160, 120, 100, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 70, ], ], [ [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 80, ], ], [ [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 120, ], ], [ [190, 190, 120, 150, 150, ], [190, 190, 120, 150, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, -140, 120, ], [150, 120, 120, 120, 150, ], ], ], [ [ [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, ], ], [ [120, 120, 120, 120, 120, ], [120, 60, 120, -20, 120, ], [120, 50, 120, 120, 100, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 110, ], ], [ [190, 190, 120, 120, 150, ], [190, 190, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [150, 150, 120, -140, 120, ], [150, 120, 120, 120, 150, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 120, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 160, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 120, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 160, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 160, ], ], ], [ [ [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, ], ], [ [220, 220, 170, 120, 120, ], [220, 220, 120, 120, 120, ], [170, 130, 170, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 110, ], ], [ [160, 160, 120, 120, 120, ], [160, 160, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 100, 120, -140, 120, ], [120, 120, 120, 120, 70, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 160, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 190, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 160, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 190, ], ], [ [220, 220, 190, 190, 190, ], [220, 220, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 190, ], ], ], [ [ [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, ], ], [ [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 80, ], ], [ [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 80, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 120, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 160, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 120, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 150, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 160, ], ], ], [ [ [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, ], ], [ [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 120, ], ], [ [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 120, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 160, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 190, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 150, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 170, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 190, ], ], ], [ [ [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, ], ], [ [220, 220, 170, 120, 120, ], [220, 220, 120, 120, 120, ], [170, 130, 170, 120, 120, ], [120, 120, 120, -140, 120, ], [120, 120, 120, 120, 120, ], ], [ [190, 190, 120, 120, 150, ], [190, 190, 120, 120, 120, ], [120, 120, 120, 120, 120, ], [150, 150, 120, -140, 120, ], [150, 120, 120, 120, 150, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 160, ], ], [ [220, 220, 190, 190, 190, ], [220, 220, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 190, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 160, ], ], [ [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 190, ], ], [ [220, 220, 190, 190, 190, ], [220, 220, 190, 190, 190, ], [190, 190, 190, 190, 190, ], [190, 190, 190, -70, 190, ], [190, 190, 190, 190, 190, ], ], ], ], dtype=np.float32) / -100. score_int21 = np.array([ [ [ [ [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, ], ], ], [ [ [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], ], [ [230, 230, 230, 110, 230, ], [230, 230, 230, 110, 230, ], [230, 230, 230, 110, 230, ], [110, 110, 110, 110, 110, ], [230, 230, 230, 110, 230, ], ], [ [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], ], [ [230, 110, 230, 110, 230, ], [110, 110, 110, 110, 110, ], [230, 110, 230, 110, 230, ], [110, 110, 110, 110, 110, ], [230, 110, 230, 110, 230, ], ], [ [230, 230, 230, 230, 150, ], [230, 230, 230, 230, 150, ], [230, 230, 230, 230, 150, ], [230, 230, 230, 230, 150, ], [150, 150, 150, 150, 150, ], ], ], [ [ [250, 250, 250, 230, 230, ], [250, 250, 230, 230, 230, ], [250, 230, 250, 230, 230, ], [230, 230, 230, 230, 230, ], [250, 250, 230, 230, 230, ], ], [ [250, 250, 230, 110, 230, ], [250, 250, 230, 110, 230, ], [230, 230, 170, 110, 230, ], [110, 80, 110, 110, 110, ], [230, 230, 230, 110, 230, ], ], [ [250, 250, 250, 230, 230, ], [230, 230, 230, 230, 230, ], [250, 230, 250, 230, 230, ], [230, 230, 230, 230, 230, ], [250, 250, 230, 230, 230, ], ], [ [230, 170, 230, 110, 230, ], [230, 170, 230, 80, 230, ], [230, 110, 230, 110, 230, ], [120, 120, 110, 110, 110, ], [230, 110, 230, 110, 230, ], ], [ [230, 230, 230, 230, 150, ], [230, 230, 230, 230, 150, ], [230, 230, 220, 230, 150, ], [230, 230, 230, 230, 150, ], [170, 150, 170, 150, 140, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 190, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 190, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 190, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 190, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 190, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], ], [ [ [ [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, 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, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], ], ], [ [ [250, 250, 230, 230, 230, ], [250, 250, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], ], [ [250, 250, 230, 230, 230, ], [250, 250, 230, 210, 230, ], [230, 230, 230, 230, 230, ], [120, 120, 110, 110, 110, ], [230, 230, 230, 230, 230, ], ], [ [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 190, 230, 230, ], ], [ [230, 110, 230, 110, 230, ], [110, 110, 110, 110, 110, ], [230, 110, 230, 110, 230, ], [110, 110, 110, 110, 110, ], [230, 110, 230, 110, 230, ], ], [ [230, 230, 230, 230, 150, ], [230, 230, 230, 230, 150, ], [230, 230, 230, 230, 150, ], [230, 230, 230, 230, 150, ], [150, 150, 150, 150, 150, ], ], ], [ [ [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], ], [ [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [110, 110, 110, 110, 110, ], [230, 230, 230, 230, 230, ], ], [ [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], [230, 230, 230, 230, 230, ], ], [ [230, 110, 230, 110, 230, ], [230, 110, 230, 110, 230, ], [230, 110, 230, 110, 230, ], [110, 110, 110, 110, 110, ], [230, 110, 230, 110, 230, ], ], [ [230, 230, 230, 230, 150, ], [230, 230, 230, 230, 150, ], [230, 230, 230, 230, 150, ], [230, 230, 230, 230, 150, ], [150, 150, 150, 150, 150, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 250, 300, 210, 300, ], [300, 300, 300, 300, 300, ], [190, 120, 190, 190, 190, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 190, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], ], [ [ [ [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, 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, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 250, 300, 210, 300, ], [300, 300, 300, 300, 300, ], [190, 120, 190, 190, 190, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 190, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 250, 370, 210, 370, ], [370, 370, 370, 370, 370, ], [260, 120, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 190, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], ], [ [ [ [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, 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, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 190, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 190, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 260, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 260, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 260, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 260, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 260, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], ], [ [ [ [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, 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, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], ], [ [ [ [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, 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, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 190, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [300, 300, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 190, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 260, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 260, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 260, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 260, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [370, 370, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 260, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], ], [ [ [ [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, 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, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], [0, 0, 0, 0, 0, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [190, 190, 190, 190, 190, ], [300, 300, 300, 300, 300, ], ], [ [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], [300, 300, 300, 300, 300, ], ], [ [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [300, 190, 300, 190, 300, ], [190, 190, 190, 190, 190, ], [300, 190, 300, 190, 300, ], ], [ [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [300, 300, 300, 300, 220, ], [220, 220, 220, 220, 220, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], [ [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [260, 260, 260, 260, 260, ], [370, 370, 370, 370, 370, ], ], [ [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], [370, 370, 370, 370, 370, ], ], [ [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [370, 260, 370, 260, 370, ], [260, 260, 260, 260, 260, ], [370, 260, 370, 260, 370, ], ], [ [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [370, 370, 370, 370, 300, ], [300, 300, 300, 300, 300, ], ], ], ], ], dtype=np.float32) / -100. score_int22 = np.array([ [ [ [ [ [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], ], [ [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], ], [ [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], ], [ [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 0, 0, ], ], [ [0, 0, 0, 0, 0, ], [0, 120, 160, 20, 160, ], [0, 110, 150, 20, 150, ], [0, 20, 60, -70, 60, ], [0, 110, 150, 20, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 200, 60, 200, ], [0, 140, 180, 110, 180, ], [0, 160, 200, 60, 200, ], [0, 130, 170, 90, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 20, 60, -70, 60, ], [0, 110, 150, 20, 150, ], [0, -30, 10, 0, 10, ], [0, 110, 150, 20, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 200, 60, 200, ], [0, 130, 170, 90, 170, ], [0, 160, 200, 60, 200, ], [0, 100, 80, -50, 80, ], ], ], [ [ [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, 110, 140, 110, 130, ], [0, 110, 140, 110, 120, ], [0, 20, 110, 20, 90, ], [0, 110, 140, 110, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 180, 150, 170, ], [0, 140, 170, 140, 150, ], [0, 150, 180, 150, 170, ], [0, 120, 150, 120, 140, ], ], [ [0, 0, 0, 0, 0, ], [0, 20, 110, 20, 90, ], [0, 110, 140, 110, 120, ], [0, -40, -10, -40, -20, ], [0, 110, 140, 110, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 180, 150, 170, ], [0, 120, 150, 120, 140, ], [0, 150, 180, 150, 170, ], [0, 30, 60, 30, 50, ], ], ], [ [ [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, 20, 160, -30, 160, ], [0, 20, 150, -40, 150, ], [0, -70, 60, 0, 60, ], [0, 20, 150, -40, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 60, 200, 10, 200, ], [0, 110, 180, -10, 180, ], [0, 60, 200, 10, 200, ], [0, 90, 170, -20, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, -70, 60, 0, 60, ], [0, 20, 150, -40, 150, ], [0, 0, 10, 80, 10, ], [0, 20, 150, -40, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 60, 200, 10, 200, ], [0, 90, 170, -20, 170, ], [0, 60, 200, 10, 200, ], [0, -50, 80, 20, 80, ], ], ], [ [ [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, 110, 130, 110, 100, ], [0, 110, 120, 110, 30, ], [0, 20, 90, 20, -50, ], [0, 110, 120, 110, 30, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 170, 150, 80, ], [0, 140, 150, 140, 60, ], [0, 150, 170, 150, 80, ], [0, 120, 140, 120, 50, ], ], [ [0, 0, 0, 0, 0, ], [0, 20, 90, 20, -50, ], [0, 110, 120, 110, 30, ], [0, -40, -20, -40, 20, ], [0, 110, 120, 110, 30, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 170, 150, 80, ], [0, 120, 140, 120, 50, ], [0, 150, 170, 150, 80, ], [0, 30, 50, 30, -40, ], ], ], ], [ [ [ [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, 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, 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, 130, 60, 0, 170, ], [0, 110, 150, -70, 150, ], [0, -30, 10, -160, -30, ], [0, 110, 150, 10, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 50, -100, 140, ], [0, 110, 150, -60, 150, ], [0, 100, 140, 10, 140, ], [0, 110, 150, 70, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 40, 30, -70, 30, ], [0, 110, 150, 10, 150, ], [0, -30, -30, 0, 10, ], [0, 110, 150, 10, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 140, 10, 140, ], [0, 110, 150, 80, 150, ], [0, 100, 140, 10, 140, ], [0, 150, 0, 90, 70, ], ], ], [ [ [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, 130, 220, 130, 140, ], [0, 100, 130, 100, 120, ], [0, -70, 70, -70, 0, ], [0, 100, 130, 100, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, 110, 190, 100, 110, ], [0, 100, 130, 100, 120, ], [0, 100, 130, 100, 110, ], [0, 100, 130, 100, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 70, 70, -10, 60, ], [0, 100, 130, 100, 120, ], [0, -40, -10, -40, 20, ], [0, 100, 130, 100, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 130, 100, 110, ], [0, 110, 140, 110, 120, ], [0, 100, 130, 100, 110, ], [0, -20, -10, 30, 20, ], ], ], [ [ [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, -20, 170, -10, 170, ], [0, -40, 150, -40, 150, ], [0, -170, -30, -90, -30, ], [0, 10, 150, -40, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 70, 140, -50, 140, ], [0, 70, 150, -40, 150, ], [0, 10, 140, -50, 140, ], [0, 70, 150, 20, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, -50, 30, -30, 30, ], [0, 10, 150, -40, 150, ], [0, -30, 10, 80, 10, ], [0, 10, 150, -40, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 10, 140, -50, 140, ], [0, 80, 150, -50, 150, ], [0, 10, 140, -50, 140, ], [0, 90, 70, 140, 70, ], ], ], [ [ [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, 130, 140, 130, 140, ], [0, 100, 120, 100, 30, ], [0, -70, 0, -70, 50, ], [0, 100, 120, 100, 30, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 110, 100, 30, ], [0, 100, 120, 100, 30, ], [0, 100, 110, 100, 20, ], [0, 100, 120, 100, 30, ], ], [ [0, 0, 0, 0, 0, ], [0, -10, 50, -10, 140, ], [0, 100, 120, 100, 30, ], [0, -40, -60, -40, 70, ], [0, 100, 120, 100, 30, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 110, 100, 20, ], [0, 110, 120, 110, 30, ], [0, 100, 110, 100, 20, ], [0, 30, 40, 30, -60, ], ], ], ], [ [ [ [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, 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, 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, 270, 300, 170, 300, ], [0, 230, 270, 130, 270, ], [0, 150, 190, 50, 190, ], [0, 230, 270, 130, 270, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 270, 130, 270, ], [0, 230, 270, 190, 270, ], [0, 230, 270, 130, 270, ], [0, 230, 270, 190, 270, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 230, 90, 230, ], [0, 230, 270, 130, 270, ], [0, 100, 140, 130, 140, ], [0, 230, 270, 130, 270, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 270, 130, 270, ], [0, 230, 270, 190, 270, ], [0, 230, 270, 130, 270, ], [0, 290, 270, 130, 270, ], ], ], [ [ [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, 260, 290, 260, 270, ], [0, 220, 250, 220, 240, ], [0, 140, 230, 140, 220, ], [0, 220, 250, 220, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 250, 220, 240, ], [0, 220, 250, 220, 240, ], [0, 220, 250, 220, 240, ], [0, 220, 250, 220, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 270, 180, 260, ], [0, 220, 250, 220, 240, ], [0, 90, 120, 90, 110, ], [0, 220, 250, 220, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 250, 220, 240, ], [0, 220, 250, 220, 240, ], [0, 220, 250, 220, 240, ], [0, 220, 250, 220, 240, ], ], ], [ [ [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, 170, 300, 110, 300, ], [0, 130, 270, 80, 270, ], [0, 50, 190, 130, 190, ], [0, 130, 270, 80, 270, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 270, 80, 270, ], [0, 190, 270, 80, 270, ], [0, 130, 270, 80, 270, ], [0, 190, 270, 80, 270, ], ], [ [0, 0, 0, 0, 0, ], [0, 90, 230, 170, 230, ], [0, 130, 270, 80, 270, ], [0, 130, 140, 210, 140, ], [0, 130, 270, 80, 270, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 270, 80, 270, ], [0, 190, 270, 80, 270, ], [0, 130, 270, 80, 270, ], [0, 130, 270, 210, 270, ], ], ], [ [ [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, 260, 270, 260, 240, ], [0, 220, 240, 220, 150, ], [0, 140, 220, 140, 70, ], [0, 220, 240, 220, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 240, 220, 150, ], [0, 220, 240, 220, 150, ], [0, 220, 240, 220, 150, ], [0, 220, 240, 220, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 260, 180, 110, ], [0, 220, 240, 220, 150, ], [0, 90, 110, 90, 150, ], [0, 220, 240, 220, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 240, 220, 150, ], [0, 220, 240, 220, 150, ], [0, 220, 240, 220, 150, ], [0, 220, 240, 220, 150, ], ], ], ], [ [ [ [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, 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, 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, 160, 200, 70, 200, ], [0, 200, 240, 100, 240, ], [0, 60, 100, -30, 100, ], [0, 200, 240, 100, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 240, 100, 240, ], [0, 200, 240, 160, 240, ], [0, 200, 240, 100, 240, ], [0, 200, 240, 160, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 270, 130, 270, ], [0, 200, 240, 100, 240, ], [0, 70, 110, 100, 110, ], [0, 200, 240, 100, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 240, 100, 240, ], [0, 200, 240, 160, 240, ], [0, 200, 240, 100, 240, ], [0, 260, 240, 100, 240, ], ], ], [ [ [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, 160, 190, 160, 170, ], [0, 190, 220, 190, 210, ], [0, 60, 150, 60, 130, ], [0, 190, 220, 190, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 220, 190, 210, ], [0, 190, 220, 190, 210, ], [0, 190, 220, 190, 210, ], [0, 190, 220, 190, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 310, 220, 300, ], [0, 190, 220, 190, 210, ], [0, 60, 90, 60, 80, ], [0, 190, 220, 190, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 220, 190, 210, ], [0, 190, 220, 190, 210, ], [0, 190, 220, 190, 210, ], [0, 190, 220, 190, 210, ], ], ], [ [ [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, 70, 200, 10, 200, ], [0, 100, 240, 50, 240, ], [0, -30, 100, 40, 100, ], [0, 100, 240, 50, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 240, 50, 240, ], [0, 160, 240, 50, 240, ], [0, 100, 240, 50, 240, ], [0, 160, 240, 50, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 270, 210, 270, ], [0, 100, 240, 50, 240, ], [0, 100, 110, 180, 110, ], [0, 100, 240, 50, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 240, 50, 240, ], [0, 160, 240, 50, 240, ], [0, 100, 240, 50, 240, ], [0, 100, 240, 180, 240, ], ], ], [ [ [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, 160, 170, 160, 140, ], [0, 190, 210, 190, 120, ], [0, 60, 130, 60, -10, ], [0, 190, 210, 190, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 210, 190, 120, ], [0, 190, 210, 190, 120, ], [0, 190, 210, 190, 120, ], [0, 190, 210, 190, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 300, 220, 150, ], [0, 190, 210, 190, 120, ], [0, 60, 80, 60, 120, ], [0, 190, 210, 190, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 210, 190, 120, ], [0, 190, 210, 190, 120, ], [0, 190, 210, 190, 120, ], [0, 190, 210, 190, 120, ], ], ], ], [ [ [ [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, 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, 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, 200, 240, 100, 240, ], [0, 170, 210, 80, 210, ], [0, 70, 110, -20, 110, ], [0, 170, 210, 80, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 220, 90, 220, ], [0, 180, 220, 140, 220, ], [0, 180, 220, 90, 220, ], [0, 180, 220, 140, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 180, 50, 180, ], [0, 170, 210, 80, 210, ], [0, 20, 60, 60, 60, ], [0, 170, 210, 80, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 220, 90, 220, ], [0, 180, 220, 140, 220, ], [0, 180, 220, 90, 220, ], [0, 150, 130, 0, 130, ], ], ], [ [ [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, 190, 220, 190, 210, ], [0, 170, 200, 170, 180, ], [0, 70, 160, 70, 140, ], [0, 170, 200, 170, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 210, 180, 190, ], [0, 170, 200, 170, 190, ], [0, 180, 210, 180, 190, ], [0, 170, 200, 170, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 230, 140, 210, ], [0, 170, 200, 170, 180, ], [0, 20, 50, 20, 30, ], [0, 170, 200, 170, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 210, 180, 190, ], [0, 170, 200, 170, 190, ], [0, 180, 210, 180, 190, ], [0, 80, 110, 80, 100, ], ], ], [ [ [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, 100, 240, 50, 240, ], [0, 80, 210, 20, 210, ], [0, -20, 110, 50, 110, ], [0, 80, 210, 20, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 90, 220, 30, 220, ], [0, 140, 220, 30, 220, ], [0, 90, 220, 30, 220, ], [0, 140, 220, 30, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 50, 180, 120, 180, ], [0, 80, 210, 20, 210, ], [0, 60, 60, 130, 60, ], [0, 80, 210, 20, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 90, 220, 30, 220, ], [0, 140, 220, 30, 220, ], [0, 90, 220, 30, 220, ], [0, 0, 130, 70, 130, ], ], ], [ [ [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, 190, 210, 190, 180, ], [0, 170, 180, 170, 90, ], [0, 70, 140, 70, 0, ], [0, 170, 180, 170, 90, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 190, 180, 100, ], [0, 170, 190, 170, 100, ], [0, 180, 190, 180, 100, ], [0, 170, 190, 170, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 210, 140, 60, ], [0, 170, 180, 170, 90, ], [0, 20, 30, 20, 70, ], [0, 170, 180, 170, 90, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 190, 180, 100, ], [0, 170, 190, 170, 100, ], [0, 180, 190, 180, 100, ], [0, 80, 100, 80, 10, ], ], ], ], [ [ [ [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, 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, 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, 200, 240, 100, 240, ], [0, 150, 190, 60, 190, ], [0, 90, 130, 0, 130, ], [0, 150, 190, 60, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 240, 100, 240, ], [0, 200, 240, 160, 240, ], [0, 200, 240, 100, 240, ], [0, 200, 240, 160, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 140, 10, 140, ], [0, 150, 190, 60, 190, ], [0, 40, 80, 80, 80, ], [0, 150, 190, 60, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 240, 100, 240, ], [0, 170, 210, 130, 210, ], [0, 200, 240, 100, 240, ], [0, 170, 150, 20, 150, ], ], ], [ [ [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, 190, 220, 190, 210, ], [0, 150, 180, 150, 160, ], [0, 90, 180, 90, 160, ], [0, 150, 180, 150, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 220, 190, 210, ], [0, 190, 220, 190, 210, ], [0, 190, 220, 190, 210, ], [0, 190, 220, 190, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 190, 100, 170, ], [0, 150, 180, 150, 160, ], [0, 40, 70, 40, 50, ], [0, 150, 180, 150, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 220, 190, 210, ], [0, 160, 190, 160, 180, ], [0, 190, 220, 190, 210, ], [0, 110, 140, 110, 120, ], ], ], [ [ [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, 100, 240, 50, 240, ], [0, 60, 190, 0, 190, ], [0, 0, 130, 70, 130, ], [0, 60, 190, 0, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 240, 50, 240, ], [0, 160, 240, 50, 240, ], [0, 100, 240, 50, 240, ], [0, 160, 240, 50, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 10, 140, 80, 140, ], [0, 60, 190, 0, 190, ], [0, 80, 80, 150, 80, ], [0, 60, 190, 0, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 240, 50, 240, ], [0, 130, 210, 20, 210, ], [0, 100, 240, 50, 240, ], [0, 20, 150, 90, 150, ], ], ], [ [ [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, 190, 210, 190, 180, ], [0, 150, 160, 150, 70, ], [0, 90, 160, 90, 10, ], [0, 150, 160, 150, 70, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 210, 190, 120, ], [0, 190, 210, 190, 120, ], [0, 190, 210, 190, 120, ], [0, 190, 210, 190, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 170, 100, 20, ], [0, 150, 160, 150, 70, ], [0, 40, 50, 40, 90, ], [0, 150, 160, 150, 70, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 210, 190, 120, ], [0, 160, 180, 160, 90, ], [0, 190, 210, 190, 120, ], [0, 110, 120, 110, 30, ], ], ], ], ], [ [ [ [ [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [0, 130, 100, 40, 100, ], [0, 130, 110, 70, 100, ], [0, -20, 70, -50, 10, ], [0, 130, 100, -10, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, 60, 50, 30, 140, ], [0, 220, 190, 70, 130, ], [0, 170, 140, 30, 140, ], [0, 140, 110, 50, 110, ], ], [ [0, 0, 0, 0, 0, ], [0, 0, -100, -70, 10, ], [0, 130, 100, -10, 100, ], [0, -10, -50, -30, -50, ], [0, 130, 100, -10, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 140, 30, 140, ], [0, 140, 110, 60, 110, ], [0, 170, 140, 30, 140, ], [0, 140, 30, 140, 20, ], ], ], [ [ [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, 110, 110, 110, 110, ], [0, 100, 100, 100, 110, ], [0, -40, 70, 10, 80, ], [0, 100, 100, 100, 110, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 150, 150, 150, ], [0, 130, 130, 130, 140, ], [0, 150, 150, 150, 150, ], [0, 120, 120, 120, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, -70, -60, 10, 80, ], [0, 100, 100, 100, 110, ], [0, -40, -40, -40, -50, ], [0, 100, 100, 100, 110, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 150, 150, 150, ], [0, 120, 120, 120, 120, ], [0, 150, 150, 150, 150, ], [0, 30, 30, 30, 30, ], ], ], [ [ [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, -30, 100, -30, 100, ], [0, -70, 100, -40, 100, ], [0, -170, 10, -30, 10, ], [0, -70, 100, -40, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, 10, 140, -30, 140, ], [0, 70, 130, -10, 130, ], [0, -30, 140, 10, 140, ], [0, 0, 110, -60, 110, ], ], [ [0, 0, 0, 0, 0, ], [0, -160, 10, 0, 10, ], [0, -70, 100, -40, 100, ], [0, -90, -50, 80, -50, ], [0, -70, 100, -40, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, -30, 140, 10, 140, ], [0, 0, 110, 20, 110, ], [0, -30, 140, 10, 140, ], [0, 50, 20, 70, 20, ], ], ], [ [ [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, 110, 110, 110, 150, ], [0, 100, 100, 100, -20, ], [0, 10, 70, 10, 90, ], [0, 100, 100, 100, 30, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 150, 150, 0, ], [0, 130, 130, 130, -10, ], [0, 150, 150, 150, 70, ], [0, 120, 120, 120, 40, ], ], [ [0, 0, 0, 0, 0, ], [0, 10, 70, 10, 90, ], [0, 100, 100, 100, 30, ], [0, -40, 20, -40, 140, ], [0, 100, 100, 100, 30, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 150, 150, 70, ], [0, 120, 170, 120, 20, ], [0, 150, 150, 150, 70, ], [0, 30, 30, 30, -60, ], ], ], ], [ [ [ [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, 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, 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, 150, 120, 10, 120, ], [0, 120, 90, -10, 90, ], [0, -50, -80, -190, -80, ], [0, 120, 90, -10, 90, ], ], [ [0, 0, 0, 0, 0, ], [0, 120, 90, -20, 90, ], [0, 120, 90, 50, 90, ], [0, 120, 90, -20, 90, ], [0, 120, 90, 50, 90, ], ], [ [0, 0, 0, 0, 0, ], [0, 10, -20, -130, -20, ], [0, 120, 90, -10, 90, ], [0, -20, -50, -20, -50, ], [0, 120, 90, -10, 90, ], ], [ [0, 0, 0, 0, 0, ], [0, 120, 90, -20, 90, ], [0, 130, 100, 50, 100, ], [0, 120, 90, -20, 90, ], [0, 110, 20, -90, 20, ], ], ], [ [ [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, 120, 120, 120, 130, ], [0, 100, 100, 100, 100, ], [0, -80, -20, -80, -10, ], [0, 100, 100, 100, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, 90, 90, 90, 100, ], [0, 100, 100, 100, 100, ], [0, 90, 90, 90, 100, ], [0, 100, 100, 100, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, -10, 50, -10, 50, ], [0, 100, 100, 100, 100, ], [0, -40, -40, -40, -40, ], [0, 100, 100, 100, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, 90, 90, 90, 100, ], [0, 100, 100, 100, 110, ], [0, 90, 90, 90, 100, ], [0, 20, 20, 20, 30, ], ], ], [ [ [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, -50, 120, -20, 120, ], [0, -80, 90, -40, 90, ], [0, -260, -80, -90, -80, ], [0, -80, 90, -40, 90, ], ], [ [0, 0, 0, 0, 0, ], [0, -80, 90, -50, 90, ], [0, -20, 90, -40, 90, ], [0, -80, 90, -50, 90, ], [0, -20, 90, -40, 90, ], ], [ [0, 0, 0, 0, 0, ], [0, -190, -20, -20, -20, ], [0, -80, 90, -40, 90, ], [0, -90, -50, 80, -50, ], [0, -80, 90, -40, 90, ], ], [ [0, 0, 0, 0, 0, ], [0, -80, 90, -50, 90, ], [0, -10, 100, -40, 100, ], [0, -80, 90, -50, 90, ], [0, -150, 20, 10, 20, ], ], ], [ [ [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, 120, 120, 120, 110, ], [0, 100, 100, 100, 20, ], [0, -80, -20, -80, -150, ], [0, 100, 100, 100, 20, ], ], [ [0, 0, 0, 0, 0, ], [0, 90, 90, 90, 20, ], [0, 100, 100, 100, 20, ], [0, 90, 90, 90, 20, ], [0, 100, 100, 100, 20, ], ], [ [0, 0, 0, 0, 0, ], [0, -10, 50, -10, -90, ], [0, 100, 100, 100, 20, ], [0, -40, -40, -40, 10, ], [0, 100, 100, 100, 20, ], ], [ [0, 0, 0, 0, 0, ], [0, 90, 90, 90, 20, ], [0, 100, 100, 100, 30, ], [0, 90, 90, 90, 20, ], [0, 20, 20, 20, -50, ], ], ], ], [ [ [ [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, 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, 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, 280, 250, 140, 250, ], [0, 240, 210, 100, 210, ], [0, 160, 130, 20, 130, ], [0, 240, 210, 100, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 210, 100, 210, ], [0, 240, 210, 160, 210, ], [0, 240, 210, 100, 210, ], [0, 240, 210, 160, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 170, 60, 170, ], [0, 240, 210, 100, 210, ], [0, 110, 80, 100, 80, ], [0, 240, 210, 100, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 210, 100, 210, ], [0, 240, 210, 160, 210, ], [0, 240, 210, 100, 210, ], [0, 300, 210, 100, 210, ], ], ], [ [ [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, 250, 250, 250, 260, ], [0, 220, 220, 220, 220, ], [0, 140, 200, 140, 200, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 220, 220, 220, ], [0, 220, 220, 220, 220, ], [0, 220, 220, 220, 220, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 240, 180, 240, ], [0, 220, 220, 220, 220, ], [0, 90, 90, 90, 90, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 220, 220, 220, ], [0, 220, 220, 220, 220, ], [0, 220, 220, 220, 220, ], [0, 220, 220, 220, 220, ], ], ], [ [ [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, 70, 250, 110, 250, ], [0, 40, 210, 80, 210, ], [0, -40, 130, 130, 130, ], [0, 40, 210, 80, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 40, 210, 80, 210, ], [0, 100, 210, 80, 210, ], [0, 40, 210, 80, 210, ], [0, 100, 210, 80, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 0, 170, 170, 170, ], [0, 40, 210, 80, 210, ], [0, 40, 80, 210, 80, ], [0, 40, 210, 80, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 40, 210, 80, 210, ], [0, 100, 210, 80, 210, ], [0, 40, 210, 80, 210, ], [0, 40, 210, 210, 210, ], ], ], [ [ [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, 250, 250, 250, 240, ], [0, 220, 220, 220, 140, ], [0, 140, 200, 140, 60, ], [0, 220, 220, 220, 140, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 220, 220, 140, ], [0, 220, 220, 220, 140, ], [0, 220, 220, 220, 140, ], [0, 220, 220, 220, 140, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 240, 180, 100, ], [0, 220, 220, 220, 140, ], [0, 90, 90, 90, 140, ], [0, 220, 220, 220, 140, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 220, 220, 140, ], [0, 220, 220, 220, 140, ], [0, 220, 220, 220, 140, ], [0, 220, 220, 220, 140, ], ], ], ], [ [ [ [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, 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, 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, 190, 150, 40, 150, ], [0, 210, 180, 70, 180, ], [0, 80, 50, -60, 50, ], [0, 210, 180, 70, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 180, 70, 180, ], [0, 210, 180, 130, 180, ], [0, 210, 180, 70, 180, ], [0, 210, 180, 130, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 210, 100, 210, ], [0, 210, 180, 70, 180, ], [0, 80, 50, 70, 50, ], [0, 210, 180, 70, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 180, 70, 180, ], [0, 210, 180, 130, 180, ], [0, 210, 180, 70, 180, ], [0, 270, 180, 70, 180, ], ], ], [ [ [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, 150, 150, 150, 160, ], [0, 190, 190, 190, 190, ], [0, 50, 110, 50, 120, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 190, 190, 190, ], [0, 190, 190, 190, 190, ], [0, 190, 190, 190, 190, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 280, 220, 280, ], [0, 190, 190, 190, 190, ], [0, 60, 60, 60, 60, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 190, 190, 190, ], [0, 190, 190, 190, 190, ], [0, 190, 190, 190, 190, ], [0, 190, 190, 190, 190, ], ], ], [ [ [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, -20, 150, 10, 150, ], [0, 10, 180, 50, 180, ], [0, -120, 50, 40, 50, ], [0, 10, 180, 50, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 10, 180, 50, 180, ], [0, 70, 180, 50, 180, ], [0, 10, 180, 50, 180, ], [0, 70, 180, 50, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 40, 210, 210, 210, ], [0, 10, 180, 50, 180, ], [0, 10, 50, 180, 50, ], [0, 10, 180, 50, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 10, 180, 50, 180, ], [0, 70, 180, 50, 180, ], [0, 10, 180, 50, 180, ], [0, 10, 180, 180, 180, ], ], ], [ [ [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, 150, 150, 150, 140, ], [0, 190, 190, 190, 110, ], [0, 50, 110, 50, -20, ], [0, 190, 190, 190, 110, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 190, 190, 110, ], [0, 190, 190, 190, 110, ], [0, 190, 190, 190, 110, ], [0, 190, 190, 190, 110, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 280, 220, 140, ], [0, 190, 190, 190, 110, ], [0, 60, 60, 60, 110, ], [0, 190, 190, 190, 110, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 190, 190, 110, ], [0, 190, 190, 190, 110, ], [0, 190, 190, 190, 110, ], [0, 190, 190, 190, 110, ], ], ], ], [ [ [ [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, 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, 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, 210, 180, 70, 180, ], [0, 190, 160, 50, 160, ], [0, 90, 60, -50, 60, ], [0, 190, 160, 50, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 170, 60, 170, ], [0, 190, 160, 110, 160, ], [0, 200, 170, 60, 170, ], [0, 190, 160, 110, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 130, 20, 130, ], [0, 190, 160, 50, 160, ], [0, 40, 10, 30, 10, ], [0, 190, 160, 50, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 170, 60, 170, ], [0, 190, 160, 110, 160, ], [0, 200, 170, 60, 170, ], [0, 160, 70, -30, 70, ], ], ], [ [ [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, 190, 190, 190, 190, ], [0, 160, 160, 160, 170, ], [0, 60, 120, 60, 130, ], [0, 160, 160, 160, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 170, 170, 180, ], [0, 170, 170, 170, 170, ], [0, 170, 170, 170, 180, ], [0, 170, 170, 170, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 190, 130, 200, ], [0, 160, 160, 160, 170, ], [0, 10, 10, 10, 20, ], [0, 160, 160, 160, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 170, 170, 180, ], [0, 170, 170, 170, 170, ], [0, 170, 170, 170, 180, ], [0, 80, 80, 80, 80, ], ], ], [ [ [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, 10, 180, 50, 180, ], [0, -10, 160, 20, 160, ], [0, -110, 60, 50, 60, ], [0, -10, 160, 20, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 0, 170, 30, 170, ], [0, 50, 160, 30, 160, ], [0, 0, 170, 30, 170, ], [0, 50, 160, 30, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, -40, 130, 120, 130, ], [0, -10, 160, 20, 160, ], [0, -30, 10, 130, 10, ], [0, -10, 160, 20, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 0, 170, 30, 170, ], [0, 50, 160, 30, 160, ], [0, 0, 170, 30, 170, ], [0, -100, 70, 70, 70, ], ], ], [ [ [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, 190, 190, 190, 170, ], [0, 160, 160, 160, 90, ], [0, 60, 120, 60, -10, ], [0, 160, 160, 160, 90, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 170, 170, 100, ], [0, 170, 170, 170, 90, ], [0, 170, 170, 170, 100, ], [0, 170, 170, 170, 90, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 190, 130, 60, ], [0, 160, 160, 160, 90, ], [0, 10, 10, 10, 70, ], [0, 160, 160, 160, 90, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 170, 170, 100, ], [0, 170, 170, 170, 90, ], [0, 170, 170, 170, 100, ], [0, 80, 80, 80, 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, 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, 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, ], [0, 210, 180, 70, 180, ], [0, 170, 140, 30, 140, ], [0, 110, 80, -30, 80, ], [0, 170, 140, 30, 140, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 180, 70, 180, ], [0, 210, 180, 130, 180, ], [0, 210, 180, 70, 180, ], [0, 210, 180, 130, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 120, 90, -20, 90, ], [0, 170, 140, 30, 140, ], [0, 60, 30, 50, 30, ], [0, 170, 140, 30, 140, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 180, 70, 180, ], [0, 180, 150, 100, 150, ], [0, 210, 180, 70, 180, ], [0, 190, 100, -10, 100, ], ], ], [ [ [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, 190, 190, 190, 190, ], [0, 140, 140, 140, 150, ], [0, 80, 140, 80, 150, ], [0, 140, 140, 140, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 190, 190, 190, ], [0, 190, 190, 190, 190, ], [0, 190, 190, 190, 190, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 90, 150, 90, 160, ], [0, 140, 140, 140, 150, ], [0, 30, 30, 30, 40, ], [0, 140, 140, 140, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 190, 190, 190, ], [0, 160, 160, 160, 160, ], [0, 190, 190, 190, 190, ], [0, 100, 100, 100, 110, ], ], ], [ [ [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, 10, 180, 50, 180, ], [0, -30, 140, 0, 140, ], [0, -90, 80, 70, 80, ], [0, -30, 140, 0, 140, ], ], [ [0, 0, 0, 0, 0, ], [0, 10, 180, 50, 180, ], [0, 70, 180, 50, 180, ], [0, 10, 180, 50, 180, ], [0, 70, 180, 50, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, -80, 90, 80, 90, ], [0, -30, 140, 0, 140, ], [0, -10, 30, 150, 30, ], [0, -30, 140, 0, 140, ], ], [ [0, 0, 0, 0, 0, ], [0, 10, 180, 50, 180, ], [0, 40, 150, 20, 150, ], [0, 10, 180, 50, 180, ], [0, -70, 100, 90, 100, ], ], ], [ [ [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, 190, 190, 190, 170, ], [0, 140, 140, 140, 70, ], [0, 80, 140, 80, 10, ], [0, 140, 140, 140, 70, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 190, 190, 110, ], [0, 190, 190, 190, 110, ], [0, 190, 190, 190, 110, ], [0, 190, 190, 190, 110, ], ], [ [0, 0, 0, 0, 0, ], [0, 90, 150, 90, 20, ], [0, 140, 140, 140, 70, ], [0, 30, 30, 30, 90, ], [0, 140, 140, 140, 70, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 190, 190, 110, ], [0, 160, 160, 160, 80, ], [0, 190, 190, 190, 110, ], [0, 100, 100, 100, 30, ], ], ], ], ], [ [ [ [ [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [0, 270, 230, 190, 230, ], [0, 260, 220, 180, 220, ], [0, 170, 130, 90, 130, ], [0, 260, 220, 180, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 300, 270, 230, 270, ], [0, 290, 250, 270, 250, ], [0, 300, 270, 230, 270, ], [0, 270, 240, 260, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 130, 90, 130, ], [0, 260, 220, 180, 220, ], [0, 110, 80, 170, 80, ], [0, 260, 220, 180, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 300, 270, 230, 270, ], [0, 270, 240, 260, 240, ], [0, 300, 270, 230, 270, ], [0, 240, 150, 110, 150, ], ], ], [ [ [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, 230, 230, 230, 230, ], [0, 220, 220, 220, 220, ], [0, 130, 190, 130, 190, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 270, 270, 270, 270, ], [0, 250, 250, 250, 250, ], [0, 270, 270, 270, 270, ], [0, 240, 240, 240, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 190, 130, 190, ], [0, 220, 220, 220, 220, ], [0, 80, 80, 80, 80, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 270, 270, 270, 270, ], [0, 240, 240, 240, 240, ], [0, 270, 270, 270, 270, ], [0, 150, 150, 150, 150, ], ], ], [ [ [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, 150, 230, 100, 230, ], [0, 140, 220, 90, 220, ], [0, 50, 130, 130, 130, ], [0, 140, 220, 90, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 270, 140, 270, ], [0, 230, 250, 120, 250, ], [0, 190, 270, 140, 270, ], [0, 220, 240, 110, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 50, 130, 130, 130, ], [0, 140, 220, 90, 220, ], [0, 130, 80, 210, 80, ], [0, 140, 220, 90, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 270, 140, 270, ], [0, 220, 240, 110, 240, ], [0, 190, 270, 140, 270, ], [0, 70, 150, 150, 150, ], ], ], [ [ [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, 230, 230, 230, 290, ], [0, 220, 220, 220, 220, ], [0, 130, 190, 130, 130, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 270, 270, 270, 270, ], [0, 250, 250, 250, 250, ], [0, 270, 270, 270, 270, ], [0, 240, 240, 240, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 190, 130, 130, ], [0, 220, 220, 220, 220, ], [0, 80, 80, 80, 210, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 270, 270, 270, 270, ], [0, 240, 240, 240, 240, ], [0, 270, 270, 270, 270, ], [0, 150, 150, 150, 150, ], ], ], ], [ [ [ [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, 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, 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, 280, 240, 200, 240, ], [0, 250, 220, 180, 220, ], [0, 70, 40, 0, 40, ], [0, 250, 220, 180, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 210, 170, 210, ], [0, 250, 220, 240, 220, ], [0, 250, 210, 170, 210, ], [0, 250, 220, 240, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 100, 60, 100, ], [0, 250, 220, 180, 220, ], [0, 110, 80, 170, 80, ], [0, 250, 220, 180, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 210, 170, 210, ], [0, 260, 220, 240, 220, ], [0, 250, 210, 170, 210, ], [0, 240, 140, 100, 140, ], ], ], [ [ [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, 240, 240, 240, 240, ], [0, 220, 220, 220, 220, ], [0, 40, 100, 40, 100, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 210, 210, 210, ], [0, 220, 220, 220, 220, ], [0, 210, 210, 210, 210, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 160, 100, 160, ], [0, 220, 220, 220, 220, ], [0, 80, 80, 80, 80, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 210, 210, 210, ], [0, 220, 220, 220, 220, ], [0, 210, 210, 210, 210, ], [0, 140, 140, 140, 140, ], ], ], [ [ [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, 160, 240, 110, 240, ], [0, 140, 220, 90, 220, ], [0, -40, 40, 40, 40, ], [0, 140, 220, 90, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 210, 80, 210, ], [0, 200, 220, 90, 220, ], [0, 130, 210, 80, 210, ], [0, 200, 220, 90, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 20, 100, 100, 100, ], [0, 140, 220, 90, 220, ], [0, 130, 80, 210, 80, ], [0, 140, 220, 90, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 210, 80, 210, ], [0, 200, 220, 90, 220, ], [0, 130, 210, 80, 210, ], [0, 60, 140, 140, 140, ], ], ], [ [ [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, 240, 240, 240, 300, ], [0, 220, 220, 220, 220, ], [0, 40, 100, 40, 40, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 210, 210, 210, ], [0, 220, 220, 220, 220, ], [0, 210, 210, 210, 210, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 160, 100, 100, ], [0, 220, 220, 220, 220, ], [0, 80, 80, 80, 210, ], [0, 220, 220, 220, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 210, 210, 210, ], [0, 220, 220, 220, 220, ], [0, 210, 210, 210, 210, ], [0, 140, 140, 140, 140, ], ], ], ], [ [ [ [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, 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, 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, 410, 370, 330, 370, ], [0, 370, 340, 300, 340, ], [0, 290, 260, 220, 260, ], [0, 370, 340, 300, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 370, 340, 300, 340, ], [0, 370, 340, 360, 340, ], [0, 370, 340, 300, 340, ], [0, 370, 340, 360, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 330, 300, 260, 300, ], [0, 370, 340, 300, 340, ], [0, 240, 210, 300, 210, ], [0, 370, 340, 300, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 370, 340, 300, 340, ], [0, 370, 340, 360, 340, ], [0, 370, 340, 300, 340, ], [0, 430, 340, 300, 340, ], ], ], [ [ [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, 370, 370, 370, 370, ], [0, 340, 340, 340, 340, ], [0, 260, 320, 260, 320, ], [0, 340, 340, 340, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 300, 360, 300, 360, ], [0, 340, 340, 340, 340, ], [0, 210, 210, 210, 210, ], [0, 340, 340, 340, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], ], ], [ [ [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, 290, 370, 240, 370, ], [0, 260, 340, 210, 340, ], [0, 180, 260, 260, 260, ], [0, 260, 340, 210, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 340, 210, 340, ], [0, 320, 340, 210, 340, ], [0, 260, 340, 210, 340, ], [0, 320, 340, 210, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 300, 300, 300, ], [0, 260, 340, 210, 340, ], [0, 260, 210, 340, 210, ], [0, 260, 340, 210, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 340, 210, 340, ], [0, 320, 340, 210, 340, ], [0, 260, 340, 210, 340, ], [0, 260, 340, 340, 340, ], ], ], [ [ [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, 370, 370, 370, 430, ], [0, 340, 340, 340, 340, ], [0, 260, 320, 260, 260, ], [0, 340, 340, 340, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 300, 360, 300, 300, ], [0, 340, 340, 340, 340, ], [0, 210, 210, 210, 340, ], [0, 340, 340, 340, 340, ], ], [ [0, 0, 0, 0, 0, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], [0, 340, 340, 340, 340, ], ], ], ], [ [ [ [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, 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, 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, 360, 270, 360, 270, ], [0, 340, 310, 270, 310, ], [0, 220, 170, 130, 170, ], [0, 340, 310, 270, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 340, 310, 270, 310, ], [0, 340, 310, 330, 310, ], [0, 340, 310, 270, 310, ], [0, 340, 310, 330, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 370, 340, 300, 340, ], [0, 340, 310, 270, 310, ], [0, 210, 180, 270, 180, ], [0, 340, 310, 270, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 340, 310, 270, 310, ], [0, 340, 310, 330, 310, ], [0, 340, 310, 270, 310, ], [0, 400, 310, 270, 310, ], ], ], [ [ [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, 270, 270, 270, 270, ], [0, 310, 310, 310, 310, ], [0, 170, 230, 170, 230, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 340, 400, 340, 400, ], [0, 310, 310, 310, 310, ], [0, 180, 180, 180, 180, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], ], ], [ [ [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, 190, 270, 140, 270, ], [0, 230, 310, 180, 310, ], [0, 20, 170, 170, 170, ], [0, 230, 310, 180, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 310, 180, 310, ], [0, 290, 310, 180, 310, ], [0, 230, 310, 180, 310, ], [0, 290, 310, 180, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 340, 340, 340, ], [0, 230, 310, 180, 310, ], [0, 230, 180, 310, 180, ], [0, 230, 310, 180, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 310, 180, 310, ], [0, 290, 310, 180, 310, ], [0, 230, 310, 180, 310, ], [0, 230, 310, 310, 310, ], ], ], [ [ [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, 270, 270, 270, 330, ], [0, 310, 310, 310, 310, ], [0, 170, 230, 170, 170, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 340, 400, 340, 340, ], [0, 310, 310, 310, 310, ], [0, 180, 180, 180, 310, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], ], ], ], [ [ [ [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, 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, 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, 340, 310, 270, 310, ], [0, 320, 280, 240, 280, ], [0, 220, 180, 140, 180, ], [0, 320, 280, 240, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 330, 290, 250, 290, ], [0, 320, 290, 310, 290, ], [0, 330, 290, 250, 290, ], [0, 320, 290, 310, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 290, 250, 210, 250, ], [0, 320, 280, 240, 280, ], [0, 170, 130, 220, 130, ], [0, 320, 280, 240, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 330, 290, 250, 290, ], [0, 320, 290, 310, 290, ], [0, 330, 290, 250, 290, ], [0, 290, 200, 160, 200, ], ], ], [ [ [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, 310, 310, 310, 310, ], [0, 280, 280, 280, 280, ], [0, 180, 240, 180, 240, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 290, 290, 290, 290, ], [0, 290, 290, 290, 290, ], [0, 290, 290, 290, 290, ], [0, 290, 290, 290, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 310, 250, 310, ], [0, 280, 280, 280, 280, ], [0, 130, 130, 130, 130, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 290, 290, 290, 290, ], [0, 290, 290, 290, 290, ], [0, 290, 290, 290, 290, ], [0, 200, 200, 200, 200, ], ], ], [ [ [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, 230, 310, 180, 310, ], [0, 200, 280, 150, 280, ], [0, 100, 180, 180, 180, ], [0, 200, 280, 150, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 290, 160, 290, ], [0, 270, 290, 160, 290, ], [0, 210, 290, 160, 290, ], [0, 270, 290, 160, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 250, 250, 250, ], [0, 200, 280, 150, 280, ], [0, 180, 130, 260, 130, ], [0, 200, 280, 150, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 290, 160, 290, ], [0, 270, 290, 160, 290, ], [0, 210, 290, 160, 290, ], [0, 120, 200, 200, 200, ], ], ], [ [ [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, 310, 310, 310, 370, ], [0, 280, 280, 280, 280, ], [0, 180, 240, 180, 180, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 290, 290, 290, 290, ], [0, 290, 290, 290, 290, ], [0, 290, 290, 290, 290, ], [0, 290, 290, 290, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 310, 250, 250, ], [0, 280, 280, 280, 280, ], [0, 130, 130, 130, 260, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 290, 290, 290, 290, ], [0, 290, 290, 290, 290, ], [0, 290, 290, 290, 290, ], [0, 200, 200, 200, 200, ], ], ], ], [ [ [ [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, 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, 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, 340, 310, 270, 310, ], [0, 300, 260, 220, 260, ], [0, 240, 200, 160, 200, ], [0, 300, 260, 220, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 340, 310, 270, 310, ], [0, 340, 310, 330, 310, ], [0, 340, 310, 270, 310, ], [0, 340, 310, 330, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 210, 170, 210, ], [0, 300, 260, 220, 260, ], [0, 190, 150, 240, 150, ], [0, 300, 260, 220, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 340, 310, 270, 310, ], [0, 310, 280, 300, 280, ], [0, 340, 310, 270, 310, ], [0, 320, 220, 180, 220, ], ], ], [ [ [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, 310, 310, 310, 310, ], [0, 260, 260, 260, 260, ], [0, 200, 260, 200, 260, ], [0, 260, 260, 260, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 270, 210, 270, ], [0, 260, 260, 260, 260, ], [0, 150, 150, 150, 150, ], [0, 260, 260, 260, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 280, 280, 280, 280, ], [0, 310, 310, 310, 310, ], [0, 220, 220, 220, 220, ], ], ], [ [ [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, 230, 310, 180, 310, ], [0, 180, 260, 130, 260, ], [0, 120, 200, 200, 200, ], [0, 180, 260, 130, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 310, 180, 310, ], [0, 290, 310, 180, 310, ], [0, 230, 310, 180, 310, ], [0, 290, 310, 180, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 210, 210, 210, ], [0, 180, 260, 130, 260, ], [0, 200, 150, 280, 150, ], [0, 180, 260, 130, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 310, 180, 310, ], [0, 260, 280, 150, 280, ], [0, 230, 310, 180, 310, ], [0, 140, 220, 220, 220, ], ], ], [ [ [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, 310, 310, 310, 370, ], [0, 260, 260, 260, 260, ], [0, 200, 260, 200, 200, ], [0, 260, 260, 260, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 270, 210, 210, ], [0, 260, 260, 260, 260, ], [0, 150, 150, 150, 280, ], [0, 260, 260, 260, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 280, 280, 280, 280, ], [0, 310, 310, 310, 310, ], [0, 220, 220, 220, 220, ], ], ], ], ], [ [ [ [ [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [0, 160, 200, 230, 200, ], [0, 160, 190, 220, 190, ], [0, 70, 100, 130, 100, ], [0, 160, 190, 220, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 240, 270, 240, ], [0, 190, 220, 310, 220, ], [0, 200, 240, 270, 240, ], [0, 170, 210, 300, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 70, 100, 130, 100, ], [0, 160, 190, 220, 190, ], [0, 10, 50, 210, 50, ], [0, 160, 190, 220, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 240, 270, 240, ], [0, 170, 210, 300, 210, ], [0, 200, 240, 270, 240, ], [0, 140, 120, 150, 120, ], ], ], [ [ [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, 200, 200, 200, 200, ], [0, 190, 190, 190, 190, ], [0, 100, 160, 100, 160, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 240, 240, 240, ], [0, 220, 220, 220, 220, ], [0, 240, 240, 240, 240, ], [0, 210, 210, 210, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 160, 100, 160, ], [0, 190, 190, 190, 190, ], [0, 50, 50, 50, 50, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 240, 240, 240, ], [0, 210, 210, 210, 210, ], [0, 240, 240, 240, 240, ], [0, 120, 120, 120, 120, ], ], ], [ [ [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, 60, 200, 70, 200, ], [0, 60, 190, 60, 190, ], [0, -30, 100, 100, 100, ], [0, 60, 190, 60, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 240, 110, 240, ], [0, 150, 220, 90, 220, ], [0, 100, 240, 110, 240, ], [0, 130, 210, 80, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, -30, 100, 100, 100, ], [0, 60, 190, 60, 190, ], [0, 40, 50, 180, 50, ], [0, 60, 190, 60, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 240, 110, 240, ], [0, 130, 210, 80, 210, ], [0, 100, 240, 110, 240, ], [0, -10, 120, 120, 120, ], ], ], [ [ [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, 200, 200, 200, 260, ], [0, 190, 190, 190, 190, ], [0, 100, 160, 100, 100, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 240, 240, 240, ], [0, 220, 220, 220, 220, ], [0, 240, 240, 240, 240, ], [0, 210, 210, 210, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 160, 100, 100, ], [0, 190, 190, 190, 190, ], [0, 50, 50, 50, 180, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 240, 240, 240, ], [0, 210, 210, 210, 210, ], [0, 240, 240, 240, 240, ], [0, 120, 120, 120, 120, ], ], ], ], [ [ [ [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, 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, 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, 190, 210, 240, 210, ], [0, 150, 190, 220, 190, ], [0, -20, 10, 40, 10, ], [0, 150, 190, 220, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 180, 210, 180, ], [0, 150, 190, 280, 190, ], [0, 150, 180, 210, 180, ], [0, 150, 190, 280, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 40, 70, 100, 70, ], [0, 150, 190, 220, 190, ], [0, 10, 50, 210, 50, ], [0, 150, 190, 220, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 180, 210, 180, ], [0, 160, 190, 280, 190, ], [0, 150, 180, 210, 180, ], [0, 140, 110, 140, 110, ], ], ], [ [ [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, 210, 210, 210, 210, ], [0, 190, 190, 190, 190, ], [0, 10, 70, 10, 70, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 180, 180, 180, ], [0, 190, 190, 190, 190, ], [0, 180, 180, 180, 180, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 70, 130, 70, 130, ], [0, 190, 190, 190, 190, ], [0, 50, 50, 50, 50, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 180, 180, 180, ], [0, 190, 190, 190, 190, ], [0, 180, 180, 180, 180, ], [0, 110, 110, 110, 110, ], ], ], [ [ [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, 80, 210, 80, 210, ], [0, 50, 190, 60, 190, ], [0, -120, 10, 10, 10, ], [0, 50, 190, 60, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 50, 180, 50, 180, ], [0, 110, 190, 60, 190, ], [0, 50, 180, 50, 180, ], [0, 110, 190, 60, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, -60, 70, 70, 70, ], [0, 50, 190, 60, 190, ], [0, 40, 50, 180, 50, ], [0, 50, 190, 60, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 50, 180, 50, 180, ], [0, 120, 190, 60, 190, ], [0, 50, 180, 50, 180, ], [0, -20, 110, 110, 110, ], ], ], [ [ [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, 210, 210, 210, 270, ], [0, 190, 190, 190, 190, ], [0, 10, 70, 10, 10, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 180, 180, 180, ], [0, 190, 190, 190, 190, ], [0, 180, 180, 180, 180, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 70, 130, 70, 70, ], [0, 190, 190, 190, 190, ], [0, 50, 50, 50, 180, ], [0, 190, 190, 190, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 180, 180, 180, ], [0, 190, 190, 190, 190, ], [0, 180, 180, 180, 180, ], [0, 110, 110, 110, 110, ], ], ], ], [ [ [ [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, 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, 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, 360, 340, 370, 340, ], [0, 270, 310, 340, 310, ], [0, 190, 230, 260, 230, ], [0, 270, 310, 340, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 270, 310, 340, 310, ], [0, 270, 310, 400, 310, ], [0, 270, 310, 340, 310, ], [0, 270, 310, 400, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 360, 270, 300, 270, ], [0, 270, 310, 340, 310, ], [0, 140, 180, 340, 180, ], [0, 270, 310, 340, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 270, 310, 340, 310, ], [0, 270, 310, 400, 310, ], [0, 270, 310, 340, 310, ], [0, 330, 310, 340, 310, ], ], ], [ [ [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, 340, 340, 340, 340, ], [0, 310, 310, 310, 310, ], [0, 230, 290, 230, 290, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 270, 330, 270, 330, ], [0, 310, 310, 310, 310, ], [0, 180, 180, 180, 180, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], ], ], [ [ [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, 220, 340, 210, 340, ], [0, 170, 310, 180, 310, ], [0, 20, 230, 230, 230, ], [0, 170, 310, 180, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 310, 180, 310, ], [0, 230, 310, 180, 310, ], [0, 170, 310, 180, 310, ], [0, 230, 310, 180, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 270, 270, 270, ], [0, 170, 310, 180, 310, ], [0, 170, 180, 310, 180, ], [0, 170, 310, 180, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 310, 180, 310, ], [0, 230, 310, 180, 310, ], [0, 170, 310, 180, 310, ], [0, 170, 310, 310, 310, ], ], ], [ [ [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, 340, 340, 340, 400, ], [0, 310, 310, 310, 310, ], [0, 230, 290, 230, 230, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 270, 330, 270, 270, ], [0, 310, 310, 310, 310, ], [0, 180, 180, 180, 310, ], [0, 310, 310, 310, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], [0, 310, 310, 310, 310, ], ], ], ], [ [ [ [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, 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, 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, 210, 240, 270, 240, ], [0, 240, 280, 310, 280, ], [0, 110, 140, 170, 140, ], [0, 240, 280, 310, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 280, 310, 280, ], [0, 240, 280, 370, 280, ], [0, 240, 280, 310, 280, ], [0, 240, 280, 370, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 270, 310, 340, 310, ], [0, 240, 280, 310, 280, ], [0, 110, 150, 310, 150, ], [0, 240, 280, 310, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 280, 310, 280, ], [0, 240, 280, 370, 280, ], [0, 240, 280, 310, 280, ], [0, 300, 280, 310, 280, ], ], ], [ [ [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, 240, 240, 240, 240, ], [0, 280, 280, 280, 280, ], [0, 140, 200, 140, 200, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 370, 310, 370, ], [0, 280, 280, 280, 280, ], [0, 150, 150, 150, 150, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], ], ], [ [ [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, 110, 240, 110, 240, ], [0, 140, 280, 150, 280, ], [0, 10, 140, 140, 140, ], [0, 140, 280, 150, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 280, 150, 280, ], [0, 200, 280, 150, 280, ], [0, 140, 280, 150, 280, ], [0, 200, 280, 150, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 310, 310, 310, ], [0, 140, 280, 150, 280, ], [0, 140, 150, 280, 150, ], [0, 140, 280, 150, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 280, 150, 280, ], [0, 200, 280, 150, 280, ], [0, 140, 280, 150, 280, ], [0, 140, 280, 280, 280, ], ], ], [ [ [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, 240, 240, 240, 300, ], [0, 280, 280, 280, 280, ], [0, 140, 200, 140, 140, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 370, 310, 310, ], [0, 280, 280, 280, 280, ], [0, 150, 150, 150, 280, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], ], ], ], [ [ [ [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, 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, 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, 240, 280, 310, 280, ], [0, 220, 250, 280, 250, ], [0, 120, 150, 180, 150, ], [0, 220, 250, 280, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 260, 290, 260, ], [0, 220, 260, 350, 260, ], [0, 230, 260, 290, 260, ], [0, 220, 260, 350, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 220, 250, 220, ], [0, 220, 250, 280, 250, ], [0, 70, 100, 260, 100, ], [0, 220, 250, 280, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 260, 290, 260, ], [0, 220, 260, 350, 260, ], [0, 230, 260, 290, 260, ], [0, 190, 170, 200, 170, ], ], ], [ [ [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, 280, 280, 280, 280, ], [0, 250, 250, 250, 250, ], [0, 150, 210, 150, 210, ], [0, 250, 250, 250, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 260, 260, 260, ], [0, 260, 260, 260, 260, ], [0, 260, 260, 260, 260, ], [0, 260, 260, 260, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 280, 220, 280, ], [0, 250, 250, 250, 250, ], [0, 100, 100, 100, 100, ], [0, 250, 250, 250, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 260, 260, 260, ], [0, 260, 260, 260, 260, ], [0, 260, 260, 260, 260, ], [0, 170, 170, 170, 170, ], ], ], [ [ [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, 140, 280, 150, 280, ], [0, 120, 250, 120, 250, ], [0, 20, 150, 150, 150, ], [0, 120, 250, 120, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 260, 130, 260, ], [0, 180, 260, 130, 260, ], [0, 130, 260, 130, 260, ], [0, 180, 260, 130, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 90, 220, 220, 220, ], [0, 120, 250, 120, 250, ], [0, 100, 100, 230, 100, ], [0, 120, 250, 120, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 260, 130, 260, ], [0, 180, 260, 130, 260, ], [0, 130, 260, 130, 260, ], [0, 30, 170, 170, 170, ], ], ], [ [ [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, 280, 280, 280, 340, ], [0, 250, 250, 250, 250, ], [0, 150, 210, 150, 150, ], [0, 250, 250, 250, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 260, 260, 260, ], [0, 260, 260, 260, 260, ], [0, 260, 260, 260, 260, ], [0, 260, 260, 260, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 280, 220, 220, ], [0, 250, 250, 250, 250, ], [0, 100, 100, 100, 230, ], [0, 250, 250, 250, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 260, 260, 260, ], [0, 260, 260, 260, 260, ], [0, 260, 260, 260, 260, ], [0, 170, 170, 170, 170, ], ], ], ], [ [ [ [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, 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, 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, 240, 280, 310, 280, ], [0, 200, 230, 260, 230, ], [0, 140, 170, 200, 170, ], [0, 200, 230, 260, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 280, 310, 280, ], [0, 240, 280, 370, 280, ], [0, 240, 280, 310, 280, ], [0, 240, 280, 370, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 180, 210, 180, ], [0, 200, 230, 260, 230, ], [0, 90, 120, 280, 120, ], [0, 200, 230, 260, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 280, 310, 280, ], [0, 210, 250, 340, 250, ], [0, 240, 280, 310, 280, ], [0, 220, 190, 220, 190, ], ], ], [ [ [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, 280, 280, 280, 280, ], [0, 230, 230, 230, 230, ], [0, 170, 230, 170, 230, ], [0, 230, 230, 230, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 240, 180, 240, ], [0, 230, 230, 230, 230, ], [0, 120, 120, 120, 120, ], [0, 230, 230, 230, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 280, 280, ], [0, 250, 250, 250, 250, ], [0, 280, 280, 280, 280, ], [0, 190, 190, 190, 190, ], ], ], [ [ [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, 140, 280, 150, 280, ], [0, 100, 230, 100, 230, ], [0, 40, 170, 170, 170, ], [0, 100, 230, 100, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 280, 150, 280, ], [0, 200, 280, 150, 280, ], [0, 140, 280, 150, 280, ], [0, 200, 280, 150, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 50, 180, 180, 180, ], [0, 100, 230, 100, 230, ], [0, 120, 120, 250, 120, ], [0, 100, 230, 100, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 280, 150, 280, ], [0, 170, 250, 120, 250, ], [0, 140, 280, 150, 280, ], [0, 60, 190, 190, 190, ], ], ], [ [ [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, 280, 280, 280, 340, ], [0, 230, 230, 230, 230, ], [0, 170, 230, 170, 170, ], [0, 230, 230, 230, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], [0, 280, 280, 280, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 240, 180, 180, ], [0, 230, 230, 230, 230, ], [0, 120, 120, 120, 250, ], [0, 230, 230, 230, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 280, 280, ], [0, 250, 250, 250, 250, ], [0, 280, 280, 280, 280, ], [0, 190, 190, 190, 190, ], ], ], ], ], [ [ [ [ [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [0, 200, 180, 140, 180, ], [0, 190, 180, 140, 180, ], [0, 100, 90, 50, 90, ], [0, 190, 180, 140, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 220, 180, 220, ], [0, 220, 210, 230, 210, ], [0, 240, 220, 180, 220, ], [0, 210, 190, 210, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 90, 50, 90, ], [0, 190, 180, 140, 180, ], [0, 50, 30, 120, 30, ], [0, 190, 180, 140, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 220, 180, 220, ], [0, 210, 190, 210, 190, ], [0, 240, 220, 180, 220, ], [0, 180, 100, 60, 100, ], ], ], [ [ [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, 170, 180, 170, 180, ], [0, 170, 170, 170, 170, ], [0, 80, 140, 80, 140, ], [0, 170, 170, 170, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 220, 210, 220, ], [0, 200, 200, 200, 200, ], [0, 210, 220, 210, 220, ], [0, 180, 190, 180, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 80, 140, 80, 140, ], [0, 170, 170, 170, 170, ], [0, 20, 30, 20, 30, ], [0, 170, 170, 170, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 220, 210, 220, ], [0, 180, 190, 180, 190, ], [0, 210, 220, 210, 220, ], [0, 90, 100, 90, 100, ], ], ], [ [ [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, 70, 180, 20, 180, ], [0, 70, 180, 20, 180, ], [0, -20, 90, 60, 90, ], [0, 70, 180, 20, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 110, 220, 60, 220, ], [0, 160, 210, 50, 210, ], [0, 110, 220, 60, 220, ], [0, 140, 190, 30, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, -20, 90, 60, 90, ], [0, 70, 180, 20, 180, ], [0, 50, 30, 130, 30, ], [0, 70, 180, 20, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 110, 220, 60, 220, ], [0, 140, 190, 30, 190, ], [0, 110, 220, 60, 220, ], [0, 0, 100, 70, 100, ], ], ], [ [ [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, 170, 180, 170, 150, ], [0, 170, 170, 170, 80, ], [0, 80, 140, 80, 0, ], [0, 170, 170, 170, 80, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 220, 210, 130, ], [0, 200, 200, 200, 110, ], [0, 210, 220, 210, 130, ], [0, 180, 190, 180, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, 80, 140, 80, 0, ], [0, 170, 170, 170, 80, ], [0, 20, 30, 20, 70, ], [0, 170, 170, 170, 80, ], ], [ [0, 0, 0, 0, 0, ], [0, 210, 220, 210, 130, ], [0, 180, 190, 180, 100, ], [0, 210, 220, 210, 130, ], [0, 90, 100, 90, 10, ], ], ], ], [ [ [ [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, 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, 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, 210, 200, 160, 200, ], [0, 190, 170, 130, 170, ], [0, 10, 0, -40, 0, ], [0, 190, 170, 130, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 170, 130, 170, ], [0, 190, 170, 190, 170, ], [0, 180, 170, 130, 170, ], [0, 190, 170, 190, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 70, 60, 20, 60, ], [0, 190, 170, 130, 170, ], [0, 50, 30, 120, 30, ], [0, 190, 170, 130, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 170, 130, 170, ], [0, 190, 180, 200, 180, ], [0, 180, 170, 130, 170, ], [0, 170, 100, 60, 100, ], ], ], [ [ [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, 190, 190, 190, 190, ], [0, 160, 170, 160, 170, ], [0, -10, 50, -10, 50, ], [0, 160, 170, 160, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 160, 160, 160, ], [0, 160, 170, 160, 170, ], [0, 160, 160, 160, 160, ], [0, 160, 170, 160, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 50, 110, 50, 110, ], [0, 160, 170, 160, 170, ], [0, 20, 30, 20, 30, ], [0, 160, 170, 160, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 160, 160, 160, ], [0, 170, 170, 170, 170, ], [0, 160, 160, 160, 160, ], [0, 90, 90, 90, 90, ], ], ], [ [ [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, 90, 200, 40, 200, ], [0, 60, 170, 10, 170, ], [0, -110, 0, -30, 0, ], [0, 60, 170, 10, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 60, 170, 10, 170, ], [0, 120, 170, 10, 170, ], [0, 60, 170, 10, 170, ], [0, 120, 170, 10, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, -50, 60, 30, 60, ], [0, 60, 170, 10, 170, ], [0, 50, 30, 130, 30, ], [0, 60, 170, 10, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 60, 170, 10, 170, ], [0, 130, 180, 20, 180, ], [0, 60, 170, 10, 170, ], [0, -10, 100, 70, 100, ], ], ], [ [ [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, 190, 190, 190, 160, ], [0, 160, 170, 160, 80, ], [0, -10, 50, -10, -100, ], [0, 160, 170, 160, 80, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 160, 160, 70, ], [0, 160, 170, 160, 80, ], [0, 160, 160, 160, 70, ], [0, 160, 170, 160, 80, ], ], [ [0, 0, 0, 0, 0, ], [0, 50, 110, 50, -30, ], [0, 160, 170, 160, 80, ], [0, 20, 30, 20, 70, ], [0, 160, 170, 160, 80, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 160, 160, 70, ], [0, 170, 170, 170, 80, ], [0, 160, 160, 160, 70, ], [0, 90, 90, 90, 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, 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, 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, ], [0, 340, 330, 290, 330, ], [0, 310, 290, 250, 290, ], [0, 230, 210, 170, 210, ], [0, 310, 290, 250, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 290, 250, 290, ], [0, 310, 290, 310, 290, ], [0, 310, 290, 250, 290, ], [0, 310, 290, 310, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 270, 250, 210, 250, ], [0, 310, 290, 250, 290, ], [0, 180, 160, 250, 160, ], [0, 310, 290, 250, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 290, 250, 290, ], [0, 310, 290, 310, 290, ], [0, 310, 290, 250, 290, ], [0, 370, 290, 250, 290, ], ], ], [ [ [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, 320, 320, 320, 320, ], [0, 280, 290, 280, 290, ], [0, 200, 270, 200, 270, ], [0, 280, 290, 280, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 290, 280, 290, ], [0, 280, 290, 280, 290, ], [0, 280, 290, 280, 290, ], [0, 280, 290, 280, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 310, 240, 310, ], [0, 280, 290, 280, 290, ], [0, 150, 160, 150, 160, ], [0, 280, 290, 280, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 290, 280, 290, ], [0, 280, 290, 280, 290, ], [0, 280, 290, 280, 290, ], [0, 280, 290, 280, 290, ], ], ], [ [ [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, 220, 330, 170, 330, ], [0, 180, 290, 130, 290, ], [0, 100, 210, 180, 210, ], [0, 180, 290, 130, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 290, 130, 290, ], [0, 240, 290, 130, 290, ], [0, 180, 290, 130, 290, ], [0, 240, 290, 130, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 250, 220, 250, ], [0, 180, 290, 130, 290, ], [0, 180, 160, 260, 160, ], [0, 180, 290, 130, 290, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 290, 130, 290, ], [0, 240, 290, 130, 290, ], [0, 180, 290, 130, 290, ], [0, 180, 290, 260, 290, ], ], ], [ [ [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, 320, 320, 320, 290, ], [0, 280, 290, 280, 200, ], [0, 200, 270, 200, 120, ], [0, 280, 290, 280, 200, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 290, 280, 200, ], [0, 280, 290, 280, 200, ], [0, 280, 290, 280, 200, ], [0, 280, 290, 280, 200, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 310, 240, 160, ], [0, 280, 290, 280, 200, ], [0, 150, 160, 150, 200, ], [0, 280, 290, 280, 200, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 290, 280, 200, ], [0, 280, 290, 280, 200, ], [0, 280, 290, 280, 200, ], [0, 280, 290, 280, 200, ], ], ], ], [ [ [ [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, 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, 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, 240, 230, 190, 230, ], [0, 280, 260, 220, 260, ], [0, 140, 130, 90, 130, ], [0, 280, 260, 220, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 260, 220, 260, ], [0, 280, 260, 280, 260, ], [0, 280, 260, 220, 260, ], [0, 280, 260, 280, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 290, 250, 290, ], [0, 280, 260, 220, 260, ], [0, 150, 130, 220, 130, ], [0, 280, 260, 220, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 260, 220, 260, ], [0, 280, 260, 280, 260, ], [0, 280, 260, 220, 260, ], [0, 340, 260, 220, 260, ], ], ], [ [ [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, 220, 220, 220, 220, ], [0, 250, 260, 250, 260, ], [0, 120, 180, 120, 180, ], [0, 250, 260, 250, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 260, 250, 260, ], [0, 250, 260, 250, 260, ], [0, 250, 260, 250, 260, ], [0, 250, 260, 250, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 350, 280, 350, ], [0, 250, 260, 250, 260, ], [0, 120, 130, 120, 130, ], [0, 250, 260, 250, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 260, 250, 260, ], [0, 250, 260, 250, 260, ], [0, 250, 260, 250, 260, ], [0, 250, 260, 250, 260, ], ], ], [ [ [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, 120, 230, 70, 230, ], [0, 150, 260, 100, 260, ], [0, 20, 130, 100, 130, ], [0, 150, 260, 100, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 260, 100, 260, ], [0, 210, 260, 100, 260, ], [0, 150, 260, 100, 260, ], [0, 210, 260, 100, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 290, 260, 290, ], [0, 150, 260, 100, 260, ], [0, 150, 130, 230, 130, ], [0, 150, 260, 100, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 260, 100, 260, ], [0, 210, 260, 100, 260, ], [0, 150, 260, 100, 260, ], [0, 150, 260, 230, 260, ], ], ], [ [ [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, 220, 220, 220, 190, ], [0, 250, 260, 250, 170, ], [0, 120, 180, 120, 30, ], [0, 250, 260, 250, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 260, 250, 170, ], [0, 250, 260, 250, 170, ], [0, 250, 260, 250, 170, ], [0, 250, 260, 250, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 350, 280, 200, ], [0, 250, 260, 250, 170, ], [0, 120, 130, 120, 170, ], [0, 250, 260, 250, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 260, 250, 170, ], [0, 250, 260, 250, 170, ], [0, 250, 260, 250, 170, ], [0, 250, 260, 250, 170, ], ], ], ], [ [ [ [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, 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, 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, 280, 260, 220, 260, ], [0, 250, 240, 200, 240, ], [0, 150, 140, 100, 140, ], [0, 250, 240, 200, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 250, 210, 250, ], [0, 260, 240, 260, 240, ], [0, 260, 250, 210, 250, ], [0, 260, 240, 260, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 210, 170, 210, ], [0, 250, 240, 200, 240, ], [0, 100, 90, 180, 90, ], [0, 250, 240, 200, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 250, 210, 250, ], [0, 260, 240, 260, 240, ], [0, 260, 250, 210, 250, ], [0, 230, 150, 110, 150, ], ], ], [ [ [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, 250, 260, 250, 260, ], [0, 230, 230, 230, 230, ], [0, 130, 190, 130, 190, ], [0, 230, 230, 230, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 240, 240, 240, ], [0, 230, 240, 230, 240, ], [0, 240, 240, 240, 240, ], [0, 230, 240, 230, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 260, 200, 260, ], [0, 230, 230, 230, 230, ], [0, 80, 80, 80, 80, ], [0, 230, 230, 230, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 240, 240, 240, ], [0, 230, 240, 230, 240, ], [0, 240, 240, 240, 240, ], [0, 140, 150, 140, 150, ], ], ], [ [ [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, 150, 260, 100, 260, ], [0, 130, 240, 80, 240, ], [0, 30, 140, 110, 140, ], [0, 130, 240, 80, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 250, 90, 250, ], [0, 190, 240, 80, 240, ], [0, 140, 250, 90, 250, ], [0, 190, 240, 80, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 210, 180, 210, ], [0, 130, 240, 80, 240, ], [0, 110, 90, 190, 90, ], [0, 130, 240, 80, 240, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 250, 90, 250, ], [0, 190, 240, 80, 240, ], [0, 140, 250, 90, 250, ], [0, 40, 150, 120, 150, ], ], ], [ [ [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, 250, 260, 250, 230, ], [0, 230, 230, 230, 140, ], [0, 130, 190, 130, 40, ], [0, 230, 230, 230, 140, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 240, 240, 150, ], [0, 230, 240, 230, 150, ], [0, 240, 240, 240, 150, ], [0, 230, 240, 230, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 260, 200, 110, ], [0, 230, 230, 230, 140, ], [0, 80, 80, 80, 120, ], [0, 230, 230, 230, 140, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 240, 240, 150, ], [0, 230, 240, 230, 150, ], [0, 240, 240, 240, 150, ], [0, 140, 150, 140, 60, ], ], ], ], [ [ [ [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, 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, 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, 280, 260, 220, 260, ], [0, 230, 220, 180, 220, ], [0, 170, 160, 120, 160, ], [0, 230, 220, 180, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 260, 220, 260, ], [0, 280, 260, 280, 260, ], [0, 280, 260, 220, 260, ], [0, 280, 260, 280, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 170, 130, 170, ], [0, 230, 220, 180, 220, ], [0, 120, 110, 200, 110, ], [0, 230, 220, 180, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 260, 220, 260, ], [0, 250, 230, 250, 230, ], [0, 280, 260, 220, 260, ], [0, 250, 180, 140, 180, ], ], ], [ [ [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, 250, 260, 250, 260, ], [0, 210, 210, 210, 210, ], [0, 150, 210, 150, 210, ], [0, 210, 210, 210, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 260, 250, 260, ], [0, 250, 260, 250, 260, ], [0, 250, 260, 250, 260, ], [0, 250, 260, 250, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 220, 160, 220, ], [0, 210, 210, 210, 210, ], [0, 100, 100, 100, 100, ], [0, 210, 210, 210, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 260, 250, 260, ], [0, 220, 230, 220, 230, ], [0, 250, 260, 250, 260, ], [0, 170, 170, 170, 170, ], ], ], [ [ [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, 150, 260, 100, 260, ], [0, 110, 220, 60, 220, ], [0, 50, 160, 130, 160, ], [0, 110, 220, 60, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 260, 100, 260, ], [0, 210, 260, 100, 260, ], [0, 150, 260, 100, 260, ], [0, 210, 260, 100, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 60, 170, 140, 170, ], [0, 110, 220, 60, 220, ], [0, 130, 110, 210, 110, ], [0, 110, 220, 60, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 150, 260, 100, 260, ], [0, 180, 230, 70, 230, ], [0, 150, 260, 100, 260, ], [0, 70, 180, 150, 180, ], ], ], [ [ [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, 250, 260, 250, 230, ], [0, 210, 210, 210, 120, ], [0, 150, 210, 150, 60, ], [0, 210, 210, 210, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 260, 250, 170, ], [0, 250, 260, 250, 170, ], [0, 250, 260, 250, 170, ], [0, 250, 260, 250, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 220, 160, 70, ], [0, 210, 210, 210, 120, ], [0, 100, 100, 100, 140, ], [0, 210, 210, 210, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, 250, 260, 250, 170, ], [0, 220, 230, 220, 140, ], [0, 250, 260, 250, 170, ], [0, 170, 170, 170, 80, ], ], ], ], ], [ [ [ [ [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [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, 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, 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, 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, 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, ], [0, 200, 200, 100, 200, ], [0, 190, 190, 100, 190, ], [0, 100, 100, 10, 100, ], [0, 190, 190, 100, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 240, 140, 240, ], [0, 220, 220, 190, 220, ], [0, 240, 240, 140, 240, ], [0, 210, 210, 170, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 100, 100, 10, 100, ], [0, 190, 190, 100, 190, ], [0, 50, 50, 80, 50, ], [0, 190, 190, 100, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 240, 240, 140, 240, ], [0, 210, 210, 170, 210, ], [0, 240, 240, 140, 240, ], [0, 180, 120, 20, 120, ], ], ], [ [ [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, 150, 200, 150, 170, ], [0, 150, 190, 150, 160, ], [0, 60, 160, 60, 130, ], [0, 150, 190, 150, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 240, 190, 210, ], [0, 180, 220, 180, 190, ], [0, 190, 240, 190, 210, ], [0, 160, 210, 160, 180, ], ], [ [0, 0, 0, 0, 0, ], [0, 60, 160, 60, 130, ], [0, 150, 190, 150, 160, ], [0, 0, 50, 0, 20, ], [0, 150, 190, 150, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 240, 190, 210, ], [0, 160, 210, 160, 180, ], [0, 190, 240, 190, 210, ], [0, 70, 120, 70, 90, ], ], ], [ [ [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, 90, 200, 40, 200, ], [0, 90, 190, 40, 190, ], [0, 0, 100, 80, 100, ], [0, 90, 190, 40, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 240, 80, 240, ], [0, 180, 220, 70, 220, ], [0, 130, 240, 80, 240, ], [0, 160, 210, 50, 210, ], ], [ [0, 0, 0, 0, 0, ], [0, 0, 100, 80, 100, ], [0, 90, 190, 40, 190, ], [0, 70, 50, 150, 50, ], [0, 90, 190, 40, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 130, 240, 80, 240, ], [0, 160, 210, 50, 210, ], [0, 130, 240, 80, 240, ], [0, 10, 120, 90, 120, ], ], ], [ [ [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, 150, 200, 150, 170, ], [0, 150, 190, 150, 110, ], [0, 60, 160, 60, 20, ], [0, 150, 190, 150, 110, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 240, 190, 150, ], [0, 180, 220, 180, 140, ], [0, 190, 240, 190, 150, ], [0, 160, 210, 160, 120, ], ], [ [0, 0, 0, 0, 0, ], [0, 60, 160, 60, 20, ], [0, 150, 190, 150, 110, ], [0, 0, 50, 0, 90, ], [0, 150, 190, 150, 110, ], ], [ [0, 0, 0, 0, 0, ], [0, 190, 240, 190, 150, ], [0, 160, 210, 160, 120, ], [0, 190, 240, 190, 150, ], [0, 70, 120, 70, 30, ], ], ], ], [ [ [ [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, 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, 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, 210, 210, 120, 210, ], [0, 190, 190, 90, 190, ], [0, 10, 10, -80, 10, ], [0, 190, 190, 90, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 180, 90, 180, ], [0, 190, 190, 150, 190, ], [0, 180, 180, 90, 180, ], [0, 190, 190, 150, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 70, 70, -20, 70, ], [0, 190, 190, 90, 190, ], [0, 50, 50, 80, 50, ], [0, 190, 190, 90, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 180, 90, 180, ], [0, 190, 190, 160, 190, ], [0, 180, 180, 90, 180, ], [0, 170, 110, 20, 110, ], ], ], [ [ [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, 170, 210, 170, 180, ], [0, 140, 190, 140, 160, ], [0, -30, 70, -30, 40, ], [0, 140, 190, 140, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 180, 140, 150, ], [0, 140, 190, 140, 160, ], [0, 140, 180, 140, 150, ], [0, 140, 190, 140, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 30, 130, 30, 100, ], [0, 140, 190, 140, 160, ], [0, 0, 50, 0, 20, ], [0, 140, 190, 140, 160, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 180, 140, 150, ], [0, 150, 190, 150, 160, ], [0, 140, 180, 140, 150, ], [0, 70, 110, 70, 80, ], ], ], [ [ [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, 110, 210, 60, 210, ], [0, 80, 190, 30, 190, ], [0, -90, 10, -10, 10, ], [0, 80, 190, 30, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 80, 180, 30, 180, ], [0, 140, 190, 30, 190, ], [0, 80, 180, 30, 180, ], [0, 140, 190, 30, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, -30, 70, 50, 70, ], [0, 80, 190, 30, 190, ], [0, 70, 50, 150, 50, ], [0, 80, 190, 30, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 80, 180, 30, 180, ], [0, 150, 190, 40, 190, ], [0, 80, 180, 30, 180, ], [0, 10, 110, 90, 110, ], ], ], [ [ [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, 170, 210, 170, 190, ], [0, 140, 190, 140, 100, ], [0, -30, 70, -30, -70, ], [0, 140, 190, 140, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 180, 140, 100, ], [0, 140, 190, 140, 100, ], [0, 140, 180, 140, 100, ], [0, 140, 190, 140, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, 30, 130, 30, -10, ], [0, 140, 190, 140, 100, ], [0, 0, 50, 0, 90, ], [0, 140, 190, 140, 100, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 180, 140, 100, ], [0, 150, 190, 150, 110, ], [0, 140, 180, 140, 100, ], [0, 70, 110, 70, 30, ], ], ], ], [ [ [ [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, 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, 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, 340, 340, 250, 340, ], [0, 310, 310, 210, 310, ], [0, 230, 230, 130, 230, ], [0, 310, 310, 210, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 210, 310, ], [0, 310, 310, 270, 310, ], [0, 310, 310, 210, 310, ], [0, 310, 310, 270, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 270, 270, 170, 270, ], [0, 310, 310, 210, 310, ], [0, 180, 180, 210, 180, ], [0, 310, 310, 210, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 210, 310, ], [0, 310, 310, 270, 310, ], [0, 310, 310, 210, 310, ], [0, 370, 310, 210, 310, ], ], ], [ [ [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, 300, 340, 300, 310, ], [0, 260, 310, 260, 280, ], [0, 180, 290, 180, 260, ], [0, 260, 310, 260, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 310, 260, 280, ], [0, 260, 310, 260, 280, ], [0, 260, 310, 260, 280, ], [0, 260, 310, 260, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 330, 220, 300, ], [0, 260, 310, 260, 280, ], [0, 130, 180, 130, 150, ], [0, 260, 310, 260, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 310, 260, 280, ], [0, 260, 310, 260, 280, ], [0, 260, 310, 260, 280, ], [0, 260, 310, 260, 280, ], ], ], [ [ [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, 240, 340, 190, 340, ], [0, 200, 310, 150, 310, ], [0, 120, 230, 200, 230, ], [0, 200, 310, 150, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 310, 150, 310, ], [0, 260, 310, 150, 310, ], [0, 200, 310, 150, 310, ], [0, 260, 310, 150, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 270, 240, 270, ], [0, 200, 310, 150, 310, ], [0, 200, 180, 280, 180, ], [0, 200, 310, 150, 310, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 310, 150, 310, ], [0, 260, 310, 150, 310, ], [0, 200, 310, 150, 310, ], [0, 200, 310, 280, 310, ], ], ], [ [ [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, 300, 340, 300, 320, ], [0, 260, 310, 260, 220, ], [0, 180, 290, 180, 140, ], [0, 260, 310, 260, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 310, 260, 220, ], [0, 260, 310, 260, 220, ], [0, 260, 310, 260, 220, ], [0, 260, 310, 260, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 330, 220, 180, ], [0, 260, 310, 260, 220, ], [0, 130, 180, 130, 220, ], [0, 260, 310, 260, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 310, 260, 220, ], [0, 260, 310, 260, 220, ], [0, 260, 310, 260, 220, ], [0, 260, 310, 260, 220, ], ], ], ], [ [ [ [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, 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, 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, 240, 240, 150, 240, ], [0, 280, 280, 180, 280, ], [0, 140, 140, 50, 140, ], [0, 280, 280, 180, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 180, 280, ], [0, 280, 280, 240, 280, ], [0, 280, 280, 180, 280, ], [0, 280, 280, 240, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 310, 310, 210, 310, ], [0, 280, 280, 180, 280, ], [0, 150, 150, 180, 150, ], [0, 280, 280, 180, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 180, 280, ], [0, 280, 280, 240, 280, ], [0, 280, 280, 180, 280, ], [0, 340, 280, 180, 280, ], ], ], [ [ [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, 200, 240, 200, 210, ], [0, 230, 280, 230, 250, ], [0, 100, 200, 100, 170, ], [0, 230, 280, 230, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 280, 230, 250, ], [0, 230, 280, 230, 250, ], [0, 230, 280, 230, 250, ], [0, 230, 280, 230, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 370, 260, 340, ], [0, 230, 280, 230, 250, ], [0, 100, 150, 100, 120, ], [0, 230, 280, 230, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 280, 230, 250, ], [0, 230, 280, 230, 250, ], [0, 230, 280, 230, 250, ], [0, 230, 280, 230, 250, ], ], ], [ [ [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, 140, 240, 90, 240, ], [0, 170, 280, 120, 280, ], [0, 40, 140, 120, 140, ], [0, 170, 280, 120, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 280, 120, 280, ], [0, 230, 280, 120, 280, ], [0, 170, 280, 120, 280, ], [0, 230, 280, 120, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 200, 310, 280, 310, ], [0, 170, 280, 120, 280, ], [0, 170, 150, 250, 150, ], [0, 170, 280, 120, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 280, 120, 280, ], [0, 230, 280, 120, 280, ], [0, 170, 280, 120, 280, ], [0, 170, 280, 250, 280, ], ], ], [ [ [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, 200, 240, 200, 220, ], [0, 230, 280, 230, 190, ], [0, 100, 200, 100, 60, ], [0, 230, 280, 230, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 280, 230, 190, ], [0, 230, 280, 230, 190, ], [0, 230, 280, 230, 190, ], [0, 230, 280, 230, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 370, 260, 220, ], [0, 230, 280, 230, 190, ], [0, 100, 150, 100, 190, ], [0, 230, 280, 230, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 280, 230, 190, ], [0, 230, 280, 230, 190, ], [0, 230, 280, 230, 190, ], [0, 230, 280, 230, 190, ], ], ], ], [ [ [ [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, 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, 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, 280, 280, 180, 280, ], [0, 250, 250, 160, 250, ], [0, 150, 150, 60, 150, ], [0, 250, 250, 160, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 260, 170, 260, ], [0, 260, 260, 220, 260, ], [0, 260, 260, 170, 260, ], [0, 260, 260, 220, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 220, 130, 220, ], [0, 250, 250, 160, 250, ], [0, 100, 100, 140, 100, ], [0, 250, 250, 160, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 260, 260, 170, 260, ], [0, 260, 260, 220, 260, ], [0, 260, 260, 170, 260, ], [0, 230, 170, 70, 170, ], ], ], [ [ [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, 230, 280, 230, 250, ], [0, 210, 250, 210, 220, ], [0, 110, 210, 110, 180, ], [0, 210, 250, 210, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 260, 220, 230, ], [0, 210, 260, 210, 230, ], [0, 220, 260, 220, 230, ], [0, 210, 260, 210, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 280, 180, 250, ], [0, 210, 250, 210, 220, ], [0, 60, 100, 60, 70, ], [0, 210, 250, 210, 220, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 260, 220, 230, ], [0, 210, 260, 210, 230, ], [0, 220, 260, 220, 230, ], [0, 120, 170, 120, 140, ], ], ], [ [ [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, 170, 280, 120, 280, ], [0, 150, 250, 100, 250, ], [0, 50, 150, 130, 150, ], [0, 150, 250, 100, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 260, 110, 260, ], [0, 210, 260, 100, 260, ], [0, 160, 260, 110, 260, ], [0, 210, 260, 100, 260, ], ], [ [0, 0, 0, 0, 0, ], [0, 120, 220, 200, 220, ], [0, 150, 250, 100, 250, ], [0, 130, 100, 210, 100, ], [0, 150, 250, 100, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 160, 260, 110, 260, ], [0, 210, 260, 100, 260, ], [0, 160, 260, 110, 260, ], [0, 60, 170, 140, 170, ], ], ], [ [ [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, 230, 280, 230, 250, ], [0, 210, 250, 210, 170, ], [0, 110, 210, 110, 70, ], [0, 210, 250, 210, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 260, 220, 180, ], [0, 210, 260, 210, 170, ], [0, 220, 260, 220, 180, ], [0, 210, 260, 210, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 280, 180, 140, ], [0, 210, 250, 210, 170, ], [0, 60, 100, 60, 150, ], [0, 210, 250, 210, 170, ], ], [ [0, 0, 0, 0, 0, ], [0, 220, 260, 220, 180, ], [0, 210, 260, 210, 170, ], [0, 220, 260, 220, 180, ], [0, 120, 170, 120, 80, ], ], ], ], [ [ [ [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, 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, 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, 280, 280, 180, 280, ], [0, 230, 230, 140, 230, ], [0, 170, 170, 80, 170, ], [0, 230, 230, 140, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 180, 280, ], [0, 280, 280, 240, 280, ], [0, 280, 280, 180, 280, ], [0, 280, 280, 240, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 180, 180, 90, 180, ], [0, 230, 230, 140, 230, ], [0, 120, 120, 160, 120, ], [0, 230, 230, 140, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 280, 280, 180, 280, ], [0, 250, 250, 210, 250, ], [0, 280, 280, 180, 280, ], [0, 250, 190, 100, 190, ], ], ], [ [ [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, 230, 280, 230, 250, ], [0, 190, 230, 190, 200, ], [0, 130, 230, 130, 200, ], [0, 190, 230, 190, 200, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 280, 230, 250, ], [0, 230, 280, 230, 250, ], [0, 230, 280, 230, 250, ], [0, 230, 280, 230, 250, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 240, 140, 210, ], [0, 190, 230, 190, 200, ], [0, 80, 120, 80, 90, ], [0, 190, 230, 190, 200, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 280, 230, 250, ], [0, 200, 250, 200, 220, ], [0, 230, 280, 230, 250, ], [0, 150, 190, 150, 160, ], ], ], [ [ [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, 170, 280, 120, 280, ], [0, 130, 230, 80, 230, ], [0, 70, 170, 150, 170, ], [0, 130, 230, 80, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 280, 120, 280, ], [0, 230, 280, 120, 280, ], [0, 170, 280, 120, 280, ], [0, 230, 280, 120, 280, ], ], [ [0, 0, 0, 0, 0, ], [0, 80, 180, 160, 180, ], [0, 130, 230, 80, 230, ], [0, 150, 120, 230, 120, ], [0, 130, 230, 80, 230, ], ], [ [0, 0, 0, 0, 0, ], [0, 170, 280, 120, 280, ], [0, 200, 250, 90, 250, ], [0, 170, 280, 120, 280, ], [0, 90, 190, 170, 190, ], ], ], [ [ [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, 230, 280, 230, 250, ], [0, 190, 230, 190, 150, ], [0, 130, 230, 130, 90, ], [0, 190, 230, 190, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 280, 230, 190, ], [0, 230, 280, 230, 190, ], [0, 230, 280, 230, 190, ], [0, 230, 280, 230, 190, ], ], [ [0, 0, 0, 0, 0, ], [0, 140, 240, 140, 100, ], [0, 190, 230, 190, 150, ], [0, 80, 120, 80, 170, ], [0, 190, 230, 190, 150, ], ], [ [0, 0, 0, 0, 0, ], [0, 230, 280, 230, 190, ], [0, 200, 250, 200, 160, ], [0, 230, 280, 230, 190, ], [0, 150, 190, 150, 110, ], ], ], ], ], ], dtype=np.float32) / -100. score_hairpin = np.array([np.inf, np.inf, np.inf, 540, 560, 570, 540, 600, 550, 640, 650, 660, 670, 680, 690, 690, 700, 710, 710, 720, 720, 730, 730, 740, 740, 750, 750, 750, 760, 760, 770, ], dtype=np.float32) / -100. score_bulge = np.array([np.inf, 380, 280, 320, 360, 400, 440, 460, 470, 480, 490, 500, 510, 520, 530, 540, 540, 550, 550, 560, 570, 570, 580, 580, 580, 590, 590, 600, 600, 600, 610, ], dtype=np.float32) / -100. score_internal = np.array([np.inf, np.inf, 100, 100, 110, 200, 200, 210, 230, 240, 250, 260, 270, 280, 290, 290, 300, 310, 310, 320, 330, 330, 340, 340, 350, 350, 350, 360, 360, 370, 370, ], dtype=np.float32) / -100. score_ml_base = np.array([0], dtype=np.float32) / -100. score_ml_closing = np.array([930], dtype=np.float32) / -100. score_ml_intern = np.array([-90], dtype=np.float32) / -100. score_ninio = np.array([60], dtype=np.float32) / -100. score_max_ninio = np.array([300], dtype=np.float32) / -100. score_duplex_init = np.array([410], dtype=np.float32) / -100. score_terminalAU = np.array([50], dtype=np.float32) / -100. score_lxc = np.array([107.856], dtype=np.float32) / -100.
25.451066
218
0.238603
0
0
0
0
0
0
0
0
0
0
fa720fd284632ca043a6e9fbc3f2ae675f312343
1,687
py
Python
tests/ansible/lib/callback/nice_stdout.py
jrosser/mitogen
898c06f1b9f1417b9f7c18465bee78eda7df2ec0
[ "BSD-3-Clause" ]
null
null
null
tests/ansible/lib/callback/nice_stdout.py
jrosser/mitogen
898c06f1b9f1417b9f7c18465bee78eda7df2ec0
[ "BSD-3-Clause" ]
null
null
null
tests/ansible/lib/callback/nice_stdout.py
jrosser/mitogen
898c06f1b9f1417b9f7c18465bee78eda7df2ec0
[ "BSD-3-Clause" ]
null
null
null
from __future__ import unicode_literals import io from ansible.module_utils import six try: from ansible.plugins import callback_loader except ImportError: from ansible.plugins.loader import callback_loader def printi(tio, obj, key=None, indent=0): def write(s, *args): if args: s %= args tio.write(' ' * indent) if key is not None: tio.write('%s: ' % (key,)) tio.write(s) tio.write('\n') if isinstance(obj, (list, tuple)): write('[') for i, obj2 in enumerate(obj): printi(tio, obj2, key=i, indent=indent+1) key = None write(']') elif isinstance(obj, dict): write('{') for key2, obj2 in sorted(six.iteritems(obj)): if not (key2.startswith('_ansible_') or key2.endswith('_lines')): printi(tio, obj2, key=key2, indent=indent+1) key = None write('}') elif isinstance(obj, six.text_type): for line in obj.splitlines(): write('%s', line.rstrip('\r\n')) elif isinstance(obj, six.binary_type): obj = obj.decode('utf-8', 'replace') for line in obj.splitlines(): write('%s', line.rstrip('\r\n')) else: write('%r', obj) DefaultModule = callback_loader.get('default', class_only=True) class CallbackModule(DefaultModule): def _dump_results(self, result, *args, **kwargs): try: tio = io.StringIO() printi(tio, result) return tio.getvalue() #.encode('ascii', 'replace') except: import traceback traceback.print_exc() raise
28.59322
63
0.55898
327
0.193835
0
0
0
0
0
0
122
0.072318
3af82b0bc4790111d93fd0095599d158eeba1d2c
13,386
py
Python
dialRL/rl_train/callback.py
PawelMlyniec/Dail-a-ride
2b8954f9041b7635bcf8fa44e9129f2cd391f457
[ "MIT" ]
1
2020-12-24T22:08:52.000Z
2020-12-24T22:08:52.000Z
dialRL/rl_train/callback.py
Thibaud-Ardoin/Dial-a-Ride
7d9b3cd904d3194dccad31fec2533e2cf58cad0c
[ "MIT" ]
null
null
null
dialRL/rl_train/callback.py
Thibaud-Ardoin/Dial-a-Ride
7d9b3cd904d3194dccad31fec2533e2cf58cad0c
[ "MIT" ]
null
null
null
import os import numpy as np import csv import matplotlib.pyplot as plt from moviepy.editor import * from matplotlib.image import imsave import matplotlib matplotlib.use('Agg') # import tensorflow as tf # from stable_baselines.common.callbacks import BaseCallback, EvalCallback # from stable_baselines.common.vec_env import DummyVecEnv class MonitorCallback(EvalCallback): """ Callback for saving a model (the check is done every ``check_freq`` steps) based on the training reward (in practice, we recommend using ``EvalCallback``). :param check_freq: (int) :param log_dir: (str) Path to the folder where the model will be saved. It must contains the file created by the ``Monitor`` wrapper. :param verbose: (int) """ def __init__(self, eval_env, check_freq: int, save_example_freq: int, log_dir: str,sacred=None, n_eval_episodes=5, render=False, verbose=1): super(MonitorCallback, self).__init__(verbose=verbose, eval_env=eval_env, best_model_save_path=log_dir, log_path=log_dir, eval_freq=check_freq, n_eval_episodes=n_eval_episodes, deterministic=False, render=render) self.render = render self.verbose = verbose self.env = eval_env self.check_freq = check_freq self.save_example_freq = save_example_freq self.log_dir = log_dir self.save_path = os.path.join(log_dir, 'best_model') self.best_mean_reward = -np.inf self.sacred = sacred self.sequence = False if self.env.__class__.__name__ in ['DarSeqEnv','DummyVecEnv'] : self.sequence = True self.statistics = { 'step_reward': [], 'reward': [], 'std_reward': [], 'duration': [], 'GAP': [], 'GAP*': [], 'fit_solution': [], 'delivered': [] # 'policy_loss': [], # 'value_loss': [], # 'policy_entropy': [] } def _init_callback(self) -> None: # Create folder if needed if self.log_dir is not None: os.makedirs(self.log_dir, exist_ok=True) def _on_training_start(self) -> None: """ This method is called before the first rollout starts. """ pass def _on_training_end(self) -> None: """ This event is triggered before exiting the `learn()` method. """ pass def plot_statistics(self, show=False): # Print them if self.verbose: print('\t ->[Epoch %d]<- mean episodic reward: %.3f' % (self.num_timesteps + 1, self.statistics['reward'][-1])) print('\t * Mean duration : %0.3f' % (self.statistics['duration'][-1])) print('\t * Mean std_reward : %0.3f' % (self.statistics['std_reward'][-1])) print('\t * Mean step_reward : %0.3f' % (self.statistics['step_reward'][-1])) # print('\t ** policy_loss : %0.3f' % (self.statistics['policy_loss'][-1])) # print('\t ** value_loss : %0.3f' % (self.statistics['value_loss'][-1])) # print('\t ** policy_entropy : %0.3f' % (self.statistics['policy_entropy'][-1])) # Create plot of the statiscs, saved in folder colors = [plt.cm.tab20(0),plt.cm.tab20(1),plt.cm.tab20c(2), plt.cm.tab20c(3), plt.cm.tab20c(4), plt.cm.tab20c(5),plt.cm.tab20c(6),plt.cm.tab20c(7)] fig, (axis) = plt.subplots(1, len(self.statistics), figsize=(20, 10)) fig.suptitle(' - PPO Training: ' + self.log_dir) for i, key in enumerate(self.statistics): # Sacred (The one thing to keep here) if self.sacred : self.sacred.get_logger().report_scalar(title='Train stats', series=key, value=self.statistics[key][-1], iteration=self.num_timesteps) # self.sacred.log_scalar(key, self.statistics[key][-1], len(self.statistics[key])) axis[i].plot(self.statistics[key], color=colors[i]) axis[i].set_title(' Plot of ' + key) if show : fig.show() fig.savefig(self.log_dir + '/result_figure.jpg') fig.clf() plt.close(fig) # Save the statistics as CSV file if not self.sacred: try: with open(self.log_dir + '/statistics.csv', 'w') as csvfile: writer = csv.DictWriter(csvfile, fieldnames=self.statistics.keys()) writer.writeheader() # for key in statistics writer.writerow(self.statistics) except IOError: print("I/O error") def save_image_batch(self, images, rewards, txt='test'): ''' Saving some examples of input -> output to see how the model behave ''' print(' - Saving some examples - ') number_i = min(len(images), 50) plt.figure() fig, axis = plt.subplots(number_i, 2, figsize=(10, 50)) #2 rows for input, output fig.tight_layout() fig.suptitle(' - examples of network - ') for i in range(min(self.batch_size, number_i)): input_map = indices2image(data[0][i], self.image_size) axis[i, 0].imshow(input_map) im = indice_map2image(outputs[i], self.image_size).cpu().numpy() normalized = (im - im.min() ) / (im.max() - im.min()) axis[i, 1].imshow(normalized) img_name = self.path_name + '/example_' + str(self.num_timesteps) + '.png' plt.savefig(img_name) plt.close() if self.sacred : self.sacred.add_artifact(img_name, content_type='image') def save_example(self, observations, rewards, number): noms = [] dir = self.log_dir + '/example/' + str(self.num_timesteps) + '/ex_number' + str(number) if dir is not None: os.makedirs(dir, exist_ok=True) for i, obs in enumerate(observations): save_name = dir + '/' + str(i) + '_r=' + str(rewards[i]) + '.png' #[np.array(img) for i, img in enumerate(images) if self.env.__class__.__name__ == 'DummyVecEnv': image = self.norm_image(obs[0], scale=1) else : image = self.norm_image(obs, scale=1) # print('SHae after image', np.shape(image)) imsave(save_name, image) noms.append(save_name) # Save the imges as video video_name = dir + 'r=' + str(np.sum(rewards)) + '.mp4' clips = [ImageClip(m).set_duration(0.2) for m in noms] concat_clip = concatenate_videoclips(clips, method="compose") concat_clip.write_videofile(video_name, fps=24, verbose=None, logger=None) if self.sacred : self.sacred.get_logger().report_media('video', 'Res_' + str(number) + '_Rwd=' + str(np.sum(rewards)), iteration=self.num_timesteps // self.check_freq, local_path=video_name) del concat_clip del clips def norm_image(self, image, type=None, scale=10): image = np.kron(image, np.ones((scale, scale))) if type=='rgb': ret = np.empty((image.shape[0], image.shape[0], 3), dtype=np.uint8) ret[:, :, 0] = image.copy() ret[:, :, 1] = image.copy() ret[:, :, 2] = image.copy() image = ret.copy() return (255 * (image - np.min(image)) / (np.max(image) - np.min(image))).astype(np.uint8) def save_gif(self, observations, rewards): # print(observations) # print(rewards) # length = min(len(observations), 10) # observations = 255 * ((np.array(observations) + 1) / (np.max(observations) + 1)).astype(np.uint8) save_name = self.log_dir + '/example' + str(self.num_timesteps) + '.gif' images = [self.norm_image(observations[i]) for i in range(len(observations)) if rewards[i] >= 0] #[np.array(img) for i, img in enumerate(images)] # imageio.mimsave(save_name, images, fps=1) if self.sacred : self.sacred.get_logger().report_media('GIF', 'isgif', iteration=self.num_timesteps, local_path=save_name) def save_video(self, observations, rewards): save_name = self.log_dir + '/example' + str(self.num_timesteps) + '.mp4' images = [self.norm_image(observations[i], type='rgb') for i in range(len(observations)) if rewards[i] >= 0] #[np.array(img) for i, img in enumerate(images) clips = [ImageClip(m).set_duration(2) for m in images] concat_clip = concatenate_videoclips(clips, method="compose").resize(100) concat_clip.write_videofile(save_name, fps=24, verbose=False) if self.sacred : self.sacred.get_logger().report_media('video', 'results', iteration=self.num_timesteps, local_path=save_name) def _on_step(self) -> bool: """ In addition to EvalCallback we needs Examples of eviroonment elements -> Save them as gif for exemple Statistics to save -> save as plot and in database -> reward, length, loss, additional metrics (accuraccy, best move ?) """ # super(MonitorCallback, self)._on_step() if self.num_timesteps % self.check_freq == 0 : episode_rewards, episode_lengths = [], [] gap, fit_solution, delivered = [], [], [] wrapped_env = DummyVecEnv([lambda: self.env]) for i in range(self.n_eval_episodes): obs = wrapped_env.reset() done, state = False, None last_time = 0 if self.sequence : if self.env.__class__.__name__ == 'DummyVecEnv': observations = [self.env.env_method('get_image_representation')] else : observations = [self.env.get_image_representation()] else : observations = [obs.copy()] episode_reward = [0.0] episode_lengths.append(0) while not done: # Run of simulation action, state = self.model.predict(obs, state=state, deterministic=False) new_obs, reward, done, info = wrapped_env.step(action) obs = new_obs # Save observation only if time step evolved if self.sequence: if self.env.__class__.__name__ == 'DummyVecEnv': if self.env.get_attr('time_step')[0] > last_time : last_time = self.env.get_attr('time_step')[0] observations.append(self.env.env_method('get_image_representation')) else : if self.env.time_step > last_time : last_time = self.env.time_step observations.append(self.env.get_image_representation()) else : observations.append(obs.copy()) episode_reward.append(reward) episode_lengths[-1] += 1 if self.render: self.env.render() info = info[0] gap.append(info['GAP']) delivered.append(info['delivered']) fit_solution.append(info['fit_solution']) episode_rewards.append(np.sum(episode_reward)) # self.save_gif(observations, episode_reward) if self.num_timesteps % self.save_example_freq == 0 : self.save_example(observations, episode_reward,number=i) del observations self.statistics['GAP'].append(np.mean(gap)) self.statistics['GAP*'].append(np.min(gap)) self.statistics['fit_solution'].append(np.mean(fit_solution)) self.statistics['delivered'].append(np.mean(delivered)) self.statistics['reward'].append(np.mean(episode_rewards)) self.statistics['std_reward'].append(np.std(episode_rewards)) self.statistics['step_reward'].append(np.mean([episode_rewards[i]/episode_lengths[i] for i in range(len(episode_lengths))])) self.statistics['duration'].append(np.mean(episode_lengths)) # self.statistics['policy_loss'].append(self.model.pg_loss.numpy()) # self.statistics['value_loss'].append(self.model.vf_loss.numpy()) # self.statistics['policy_entropy'].append(self.model.entropy.numpy()) self.plot_statistics() # Save best model if self.statistics['reward'][-1] == np.max(self.statistics['reward']): save_path = self.log_dir + '/best_model' if self.verbose > 0: print("Saving new best model to {}".format(save_path)) self.model.save(save_path) return True
45.686007
165
0.554983
13,047
0.974675
0
0
0
0
0
0
3,322
0.24817
3af87716a5a3d2e4d00d68925f64456996df98b4
8,196
py
Python
train.py
tna-hub/text2sql
15b0d3392be03c5f794a38bcaf336b60916dc4d1
[ "BSD-3-Clause" ]
null
null
null
train.py
tna-hub/text2sql
15b0d3392be03c5f794a38bcaf336b60916dc4d1
[ "BSD-3-Clause" ]
null
null
null
train.py
tna-hub/text2sql
15b0d3392be03c5f794a38bcaf336b60916dc4d1
[ "BSD-3-Clause" ]
null
null
null
import json import torch from sqlnet.utils import * from sqlnet.model.seq2sql import Seq2SQL from sqlnet.model.sqlnet import SQLNet import numpy as np import datetime #import mxnet as mx #from bert_embedding import BertEmbedding import argparse if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--toy', action='store_true', help='If set, use small data; used for fast debugging.') parser.add_argument('--suffix', type=str, default='', help='The suffix at the end of saved model name.') parser.add_argument('--ca', action='store_true', help='Use conditional attention.') parser.add_argument('--dataset', type=int, default=0, help='0: original dataset, 1: re-split dataset') parser.add_argument('--rl', action='store_true', help='Use RL for Seq2SQL(requires pretrained model).') parser.add_argument('--baseline', action='store_true', help='If set, then train Seq2SQL model; default is SQLNet model.') parser.add_argument('--train_emb', action='store_true', help='Train word embedding for SQLNet(requires pretrained model).') args = parser.parse_args() N_word=300 B_word=42 if args.toy: USE_SMALL=True GPU=False BATCH_SIZE=15 else: USE_SMALL=False GPU=False BATCH_SIZE=64 TRAIN_ENTRY=(True, True, True) # (AGG, SEL, COND) TRAIN_AGG, TRAIN_SEL, TRAIN_COND = TRAIN_ENTRY learning_rate = 1e-4 if args.rl else 1e-3 sql_data, table_data, val_sql_data, val_table_data, \ test_sql_data, test_table_data, \ TRAIN_DB, DEV_DB, TEST_DB = load_dataset( args.dataset, use_small=USE_SMALL) word_emb = load_word_emb('glove/glove.%dB.%dd.txt'%(B_word,N_word), \ load_used=args.train_emb, use_small=USE_SMALL) if args.baseline: model = Seq2SQL(word_emb, N_word=N_word, gpu=GPU, trainable_emb = args.train_emb) assert not args.train_emb, "Seq2SQL can\'t train embedding." else: model = SQLNet(word_emb, N_word=N_word, use_ca=args.ca, gpu=GPU, trainable_emb = args.train_emb) assert not args.rl, "SQLNet can\'t do reinforcement learning." optimizer = torch.optim.Adam(model.parameters(), lr=learning_rate, weight_decay = 0) if args.train_emb: agg_m, sel_m, cond_m, agg_e, sel_e, cond_e = best_model_name(args) else: agg_m, sel_m, cond_m = best_model_name(args) if args.rl or args.train_emb: # Load pretrained model. agg_lm, sel_lm, cond_lm = best_model_name(args, for_load=True) print("Loading from {}".format(agg_lm)) model.agg_pred.load_state_dict(torch.load(agg_lm)) print("Loading from {}".format(sel_lm)) model.sel_pred.load_state_dict(torch.load(sel_lm)) print("Loading from {}".format(cond_lm)) model.cond_pred.load_state_dict(torch.load(cond_lm)) if args.rl: best_acc = 0.0 best_idx = -1 print("Init dev acc_qm: \n breakdown on (agg, sel, where): {}".format( \ epoch_acc(model, BATCH_SIZE, val_sql_data,\ val_table_data, TRAIN_ENTRY))) print("Init dev acc_ex: {}".formatepoch_exec_acc( model, BATCH_SIZE, val_sql_data, val_table_data, DEV_DB)) torch.save(model.cond_pred.state_dict(), cond_m) for i in range(100): print('Epoch {} @ {}'.format((i+1, datetime.datetime.now()))) print(' Avg reward = {}'.format(epoch_reinforce_train( \ model, optimizer, BATCH_SIZE, sql_data, table_data, TRAIN_DB))) print(' dev acc_qm: \n breakdown result: {}'.format(epoch_acc(\ model, BATCH_SIZE, val_sql_data, val_table_data, TRAIN_ENTRY))) exec_acc = epoch_exec_acc( model, BATCH_SIZE, val_sql_data, val_table_data, DEV_DB) print(' dev acc_ex: {}'.format(exec_acc)) if exec_acc[0] > best_acc: best_acc = exec_acc[0] best_idx = i+1 torch.save(model.cond_pred.state_dict(), 'saved_model/epoch%d.cond_model%s'%(i+1, args.suffix)) torch.save(model.cond_pred.state_dict(), cond_m) print(' Best exec acc = {}, on epoch {}'.format((best_acc, best_idx))) else: init_acc = epoch_acc(model, BATCH_SIZE, val_sql_data, val_table_data, TRAIN_ENTRY) best_agg_acc = init_acc[1][0] best_agg_idx = 0 best_sel_acc = init_acc[1][1] best_sel_idx = 0 best_cond_acc = init_acc[1][2] best_cond_idx = 0 #print('Init dev acc_qm: {}\n breakdown on (agg, sel, where): {}'.format(\ # init_acc)) if TRAIN_AGG: torch.save(model.agg_pred.state_dict(), agg_m) if args.train_emb: torch.save(model.agg_embed_layer.state_dict(), agg_e) if TRAIN_SEL: torch.save(model.sel_pred.state_dict(), sel_m) if args.train_emb: torch.save(model.sel_embed_layer.state_dict(), sel_e) if TRAIN_COND: torch.save(model.cond_pred.state_dict(), cond_m) if args.train_emb: torch.save(model.cond_embed_layer.state_dict(), cond_e) for i in range(100): print('Epoch {} @ {}'.format(i+1, datetime.datetime.now())) print('Loss = {}'.format(epoch_train( \ model, optimizer, BATCH_SIZE, sql_data, table_data, TRAIN_ENTRY))) print(' Train acc_qm: \n breakdown result: {}'.format(epoch_acc( model, BATCH_SIZE, sql_data, table_data, TRAIN_ENTRY))) #val_acc = epoch_token_acc(model, BATCH_SIZE, val_sql_data, val_table_data, TRAIN_ENTRY) val_acc = epoch_acc(model, BATCH_SIZE, val_sql_data, val_table_data, TRAIN_ENTRY) print(' Dev acc_qm: \n breakdown result: {}'.format(val_acc)) if TRAIN_AGG: if val_acc[1][0] > best_agg_acc: best_agg_acc = val_acc[1][0] best_agg_idx = i+1 torch.save(model.agg_pred.state_dict(), 'saved_model/epoch%d.agg_model%s'%(i+1, args.suffix)) torch.save(model.agg_pred.state_dict(), agg_m) if args.train_emb: torch.save(model.agg_embed_layer.state_dict(), 'saved_model/epoch%d.agg_embed%s'%(i+1, args.suffix)) torch.save(model.agg_embed_layer.state_dict(), agg_e) if TRAIN_SEL: if val_acc[1][1] > best_sel_acc: best_sel_acc = val_acc[1][1] best_sel_idx = i+1 torch.save(model.sel_pred.state_dict(), 'saved_model/epoch%d.sel_model%s'%(i+1, args.suffix)) torch.save(model.sel_pred.state_dict(), sel_m) if args.train_emb: torch.save(model.sel_embed_layer.state_dict(), 'saved_model/epoch%d.sel_embed%s'%(i+1, args.suffix)) torch.save(model.sel_embed_layer.state_dict(), sel_e) if TRAIN_COND: if val_acc[1][2] > best_cond_acc: best_cond_acc = val_acc[1][2] best_cond_idx = i+1 torch.save(model.cond_pred.state_dict(), 'saved_model/epoch%d.cond_model%s'%(i+1, args.suffix)) torch.save(model.cond_pred.state_dict(), cond_m) if args.train_emb: torch.save(model.cond_embed_layer.state_dict(), 'saved_model/epoch%d.cond_embed%s'%(i+1, args.suffix)) torch.save(model.cond_embed_layer.state_dict(), cond_e) print(' Best val acc = {}, on epoch {} individually'.format( (best_agg_acc, best_sel_acc, best_cond_acc), (best_agg_idx, best_sel_idx, best_cond_idx)))
48.211765
134
0.587726
0
0
0
0
0
0
0
0
1,495
0.182406
3af8f1e275cd19adaa5bb2394843a71b553551e5
758
py
Python
py/py_0685_inverse_digit_sum_ii.py
lcsm29/project-euler
fab794ece5aa7a11fc7c2177f26250f40a5b1447
[ "MIT" ]
null
null
null
py/py_0685_inverse_digit_sum_ii.py
lcsm29/project-euler
fab794ece5aa7a11fc7c2177f26250f40a5b1447
[ "MIT" ]
null
null
null
py/py_0685_inverse_digit_sum_ii.py
lcsm29/project-euler
fab794ece5aa7a11fc7c2177f26250f40a5b1447
[ "MIT" ]
null
null
null
# Solution of; # Project Euler Problem 685: Inverse Digit Sum II # https://projecteuler.net/problem=685 # # Writing down the numbers which have a digit sum of 10 in ascending order, we # get:$19, 28, 37, 46,55,64,73,82,91,109, 118,\dots$Let $f(n,m)$ be the # $m^{\text{th}}$ occurrence of the digit sum $n$. For example, $f(10,1)=19$, # $f(10,10)=109$ and $f(10,100)=1423$. Let $\displaystyle S(k)=\sum_{n=1}^k # f(n^3,n^4)$. For example $S(3)=7128$ and $S(10)\equiv 32287064 \mod # 1\,000\,000\,007$. Find $S(10\,000)$ modulo $1\,000\,000\,007$. # # by lcsm29 http://github.com/lcsm29/project-euler import timed def dummy(n): pass if __name__ == '__main__': n = 1000 i = 10000 prob_id = 685 timed.caller(dummy, n, i, prob_id)
30.32
79
0.633245
0
0
0
0
0
0
0
0
605
0.798153
3af9c8ef389a9995607211ee0514625e68a7c702
189
py
Python
{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/apps/profiles/choices.py
powerdefy/cookiecutter-django-rest
8841d7c959e588f34f260405af167206eaf47376
[ "MIT" ]
null
null
null
{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/apps/profiles/choices.py
powerdefy/cookiecutter-django-rest
8841d7c959e588f34f260405af167206eaf47376
[ "MIT" ]
null
null
null
{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/apps/profiles/choices.py
powerdefy/cookiecutter-django-rest
8841d7c959e588f34f260405af167206eaf47376
[ "MIT" ]
null
null
null
from django.db import models class Role(models.IntegerChoices): ADMIN = 0, 'Admin' GENERAL = 1, 'General' GUEST = 2, 'Guest' ACCOUNTING = 3, 'Accounting' IT = 4, 'IT'
18.9
34
0.613757
157
0.830688
0
0
0
0
0
0
39
0.206349
3afa222274ac5c4cc6f82d844f11e23c6709df36
2,196
py
Python
test_scripts/json_over_tcp.py
luozh05/Doc
3471a9c8578d6530abf5c3ee3100488b0dc1e447
[ "Apache-2.0" ]
null
null
null
test_scripts/json_over_tcp.py
luozh05/Doc
3471a9c8578d6530abf5c3ee3100488b0dc1e447
[ "Apache-2.0" ]
null
null
null
test_scripts/json_over_tcp.py
luozh05/Doc
3471a9c8578d6530abf5c3ee3100488b0dc1e447
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python import socket import sys import json #HOST="localhost" HOST="172.20.1.11" PORT=37568 def send_and_receive_msg(msg): # Create a socket (SOCK_STREAM means a TCP socket) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Connect host:port sock.connect((HOST, PORT)) # Connect to server and send data sock.send(msg) # Receive data from the server and shut down recv_message = [] time = 100 while time > 0: time = time - 1 d = sock.recv(1024) if d: recv_message.append(d) else: break sock.close() print "\n" print "Sent: {}".format(msg) print "Received: {}".format(recv_message) json_recv = json.loads(recv_message[0]) for key, value in json_recv.items(): if cmp(json_recv[key], "succeed") == 0 : return True elif cmp(json_recv[key], "failed") == 0: return False if __name__ == '__main__': #test get cases:right input, case 0 cmd = {} cmd["cmd-set-parameters"] = {} cmd["cmd-set-parameters"]["evt-version"] = "evt-version-2.0" cmd["cmd-set-parameters"]["camera-name"] = "remote-camera-avm-synthesis" cmd_string = json.dumps(cmd) result = send_and_receive_msg(cmd_string) if result == False: print "case 0 failed!" exit() print "case 0 succeed!" #test get cases:right input, case 1 cmd = {} cmd["cmd-get-parameters"] = {} cmd["cmd-get-parameters"]["camera-name"]="remote-camera-avm-synthesis" cmd_string = json.dumps(cmd) result = send_and_receive_msg(cmd_string) if result == False: print "case 1 failed!" exit() print "case 1 succeed!" #test get cases:right input, case 2 cmd = {} cmd["cmd-set-parameters"]={} cmd["cmd-set-parameters"]["preview-format"]="preview-format-h264" cmd["cmd-set-parameters"]["preview-size"]="1280x800" cmd["cmd-set-parameters"]["preview-fps-values"]="30" cmd_string = json.dumps(cmd) result = send_and_receive_msg(cmd_string) if result == False: print "case 2 failed!" exit() print "case 2 succeed!"
26.780488
76
0.607013
0
0
0
0
0
0
0
0
839
0.382058
3afc9808039be0c4906a8ad82c7a46e1f069e435
5,628
py
Python
test_api.py
atifar/mini-key-value
0efe621260aa0a1aaa22ed721d05b4173b4171dd
[ "MIT" ]
null
null
null
test_api.py
atifar/mini-key-value
0efe621260aa0a1aaa22ed721d05b4173b4171dd
[ "MIT" ]
null
null
null
test_api.py
atifar/mini-key-value
0efe621260aa0a1aaa22ed721d05b4173b4171dd
[ "MIT" ]
null
null
null
def test_check_sanity(client): resp = client.get('/sanity') assert resp.status_code == 200 assert 'Sanity check passed.' == resp.data.decode() # 'list collections' tests def test_get_api_root(client): resp = client.get('/', content_type='application/json') assert resp.status_code == 200 resp_data = resp.get_json() assert 'keys_url' in resp_data assert len(resp_data) == 1 assert resp_data['keys_url'][-5:] == '/keys' def test_delete_api_root_not_allowed(client): resp = client.delete('/', content_type='application/json') assert resp.status_code == 405 # 'list keys' tests def test_get_empty_keys_list(client): resp = client.get('/keys', content_type='application/json') assert resp.status_code == 200 resp_data = resp.get_json() assert len(resp_data) == 0 def test_get_nonempty_keys_list(client, keys, add_to_keys): add_to_keys({'key': 'babboon', 'value': 'Larry'}) add_to_keys({'key': 'bees', 'value': ['Ann', 'Joe', 'Dee']}) resp = client.get('/keys', content_type='application/json') assert resp.status_code == 200 resp_data = resp.get_json() assert isinstance(resp_data, list) assert len(resp_data) == 2 for doc_idx in (0, 1): for k in ('key', 'http_url'): assert k in resp_data[doc_idx] if resp_data[doc_idx]['key'] == 'babboon': assert resp_data[doc_idx]['http_url'][-13:] == '/keys/babboon' else: assert resp_data[doc_idx]['http_url'][-10:] == '/keys/bees' def test_delete_on_keys_not_allowed(client): resp = client.delete('/keys', content_type='application/json') assert resp.status_code == 405 # 'get a key' tests def test_get_existing_key(client, keys, add_to_keys): add_to_keys({'key': 'babboon', 'value': 'Larry'}) add_to_keys({'key': 'bees', 'value': ['Ann', 'Joe', 'Dee']}) resp = client.get('/keys/bees', content_type='application/json') assert resp.status_code == 200 resp_data = resp.get_json() assert isinstance(resp_data, dict) for k in ('key', 'http_url', 'value'): assert k in resp_data assert resp_data['key'] == 'bees' assert resp_data['http_url'][-10:] == '/keys/bees' assert resp_data['value'] == ['Ann', 'Joe', 'Dee'] def test_get_nonexisting_key(client, keys): resp = client.get('/keys/bees', content_type='application/json') assert resp.status_code == 404 def test_post_on_a_key_not_allowed(client): resp = client.post('/keys/bees', content_type='application/json') assert resp.status_code == 405 # 'create a key' tests def test_create_new_key(client, keys): new_doc = {'key': 'oscillator', 'value': 'Colpitts'} resp = client.post( '/keys', json=new_doc, content_type='application/json' ) assert resp.status_code == 201 resp_data = resp.get_json() assert isinstance(resp_data, dict) for k in ('key', 'http_url', 'value'): assert k in resp_data assert resp_data['key'] == new_doc['key'] assert resp_data['value'] == new_doc['value'] assert resp_data['http_url'][-16:] == '/keys/oscillator' def test_create_duplicate_key(client, keys, add_to_keys): new_doc = {'key': 'oscillator', 'value': 'Colpitts'} add_to_keys(new_doc.copy()) resp = client.post( '/keys', json=new_doc, content_type='application/json' ) assert resp.status_code == 400 resp_data = resp.get_json() assert 'error' in resp_data assert resp_data['error'] == "Can't create duplicate key (oscillator)." def test_create_new_key_missing_key(client, keys): new_doc = {'value': 'Colpitts'} resp = client.post( '/keys', json=new_doc, content_type='application/json' ) assert resp.status_code == 400 resp_data = resp.get_json() assert 'error' in resp_data assert resp_data['error'] == 'Please provide the missing "key" parameter!' def test_create_new_key_missing_value(client, keys): new_doc = {'key': 'oscillator'} resp = client.post( '/keys', json=new_doc, content_type='application/json' ) assert resp.status_code == 400 resp_data = resp.get_json() assert 'error' in resp_data assert resp_data['error'] == 'Please provide the missing "value" ' \ 'parameter!' # 'update a key' tests def test_update_a_key_existing(client, keys, add_to_keys): add_to_keys({'key': 'oscillator', 'value': 'Colpitts'}) update_value = {'value': ['Pierce', 'Hartley']} resp = client.put( '/keys/oscillator', json=update_value, content_type='application/json' ) assert resp.status_code == 204 def test_update_a_key_nonexisting(client, keys, add_to_keys): add_to_keys({'key': 'oscillator', 'value': 'Colpitts'}) update_value = {'value': ['Pierce', 'Hartley']} resp = client.put( '/keys/gadget', json=update_value, content_type='application/json' ) assert resp.status_code == 400 resp_data = resp.get_json() assert 'error' in resp_data assert resp_data['error'] == 'Update failed.' # 'delete a key' tests def test_delete_a_key_existing(client, keys, add_to_keys): add_to_keys({'key': 'oscillator', 'value': 'Colpitts'}) resp = client.delete( '/keys/oscillator', content_type='application/json' ) assert resp.status_code == 204 def test_delete_a_key_nonexisting(client, keys): resp = client.delete( '/keys/oscillator', content_type='application/json' ) assert resp.status_code == 404
31.266667
78
0.643923
0
0
0
0
0
0
0
0
1,444
0.256574
3afca77e1d303804e80011de9994eebd4cd184b7
31
py
Python
demo.py
TOMMYWHY/acnet_mobilenet
6ebd21510cb6cca84f498d86daa081321a585b08
[ "MIT" ]
null
null
null
demo.py
TOMMYWHY/acnet_mobilenet
6ebd21510cb6cca84f498d86daa081321a585b08
[ "MIT" ]
null
null
null
demo.py
TOMMYWHY/acnet_mobilenet
6ebd21510cb6cca84f498d86daa081321a585b08
[ "MIT" ]
null
null
null
p = touch.autograd.Variable()
10.333333
29
0.709677
0
0
0
0
0
0
0
0
0
0
3afcf96dc2192ab7589903691b5438ff0a9e7099
3,251
py
Python
cosmoscope/server.py
cosmoscope/cosmo-server
a51e0f77bbf07d731eece176fffc2c14d311a90b
[ "MIT" ]
null
null
null
cosmoscope/server.py
cosmoscope/cosmo-server
a51e0f77bbf07d731eece176fffc2c14d311a90b
[ "MIT" ]
85
2018-05-24T17:41:45.000Z
2019-02-05T18:55:38.000Z
cosmoscope/server.py
cosmoscope/cosmoscope
a51e0f77bbf07d731eece176fffc2c14d311a90b
[ "MIT" ]
null
null
null
import logging import signal import gevent import msgpack from zerorpc import Publisher, Puller, Pusher, Server import numpy as np import jsonpickle from .store import store from .data import Data from .operations.operation import Operation from .utils.singleton import Singleton __all__ = ['ServerAPI'] class ServerAPI(Server, metaclass=Singleton): """ RPC server class. """ def __init__(self, publisher=None, *args, **kwargs): super(ServerAPI, self).__init__(*args, **kwargs) self.publisher = publisher def undo(self): """ Undo an operation popping from the stack and calling its `undo` method. """ Operation.pop().undo() def redo(self): """ Call the `redo` method on the latest operation to be added to stack. """ Operation.redo() def register(self, msg): pass # self.publisher.testing("This is a test on client.") def load_data(self, path, format): """ Load a data file given path and format. """ import astropy.units as u # data = Data.read(path, format=format) data = Data(np.random.sample(100) * u.Jy, spectral_axis=np.linspace(1100, 1200, 100) * u.AA) self.publisher.data_loaded(data.identifier) def create_data(self, *args, **kwargs): data = Data(*args, **kwargs) self.publisher.data_created(data.identifier) return data.identifier def query_loader_formats(self): """ Returns a list of available data loader formats. """ from specutils import Spectrum1D from astropy.io import registry as io_registry all_formats = io_registry.get_formats(Spectrum1D)['Format'] return all_formats def query_data(self, identifier): data = store[identifier] data_dict = { 'name': data.name, 'identifier': data.identifier, 'spectral_axis': data.spectral_axis.value.tolist(), 'spectral_axis_unit': data.spectral_axis.unit.to_string(), 'flux': data.flux.value.tolist(), 'unit': data.flux.unit.to_string() } return data_dict def query_data_attribute(self, identifier, name): data = store[identifier] data_attr = getattr(data, name) packed_data_attr = data.encode(data_attr) return packed_data_attr def launch(server_address=None, publisher_address=None, block=True): server_address = server_address or "tcp://127.0.0.1:4242" publisher_address = publisher_address or "tcp://127.0.0.1:4243" # Establish the publisher service. This will send events to any # subscribed services along the designated address. publisher = Publisher() publisher.connect(publisher_address) # Setup the server service. This will be the api that clients # will send events to. server = ServerAPI(publisher) server.bind(server_address) logging.info( "Server is now listening on %s and sending on %s.", server_address, publisher_address) # Allow for stopping the server via ctrl-c gevent.signal(signal.SIGINT, server.stop) server.run() if block else gevent.spawn(server.run)
28.025862
100
0.649339
2,114
0.650261
0
0
0
0
0
0
864
0.265764
3afde623e923bb16765921cd6884a6f3f7f37e8e
3,612
py
Python
cexapi/cexapi.py
codarrenvelvindron/cex.io-api-python
5e54ca7d4d98e509e18d1ecda311da544649ea60
[ "MIT" ]
1
2021-11-09T18:47:44.000Z
2021-11-09T18:47:44.000Z
cexapi/cexapi.py
codarrenvelvindron/cex.io-api-python
5e54ca7d4d98e509e18d1ecda311da544649ea60
[ "MIT" ]
null
null
null
cexapi/cexapi.py
codarrenvelvindron/cex.io-api-python
5e54ca7d4d98e509e18d1ecda311da544649ea60
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Author: t0pep0 # e-mail: t0pep0.gentoo@gmail.com # Jabber: t0pep0@jabber.ru # BTC : 1ipEA2fcVyjiUnBqUx7PVy5efktz2hucb # donate free =) # Forked and modified by Codarren Velvindron # Compatible Python3 import hmac import hashlib import time import urllib.request, urllib.parse, urllib.error import json class Api(object): __username = '' __api_key = '' __api_secret = '' __nonce_v = '' # Init class def __init__(self, username, api_key, api_secret): self.__username = username self.__api_key = api_key self.__api_secret = api_secret # get timestamp as nonce def __nonce(self): self.__nonce_v = '{:.10f}'.format(time.time() * 1000).split('.')[0] # generate signature def __signature(self): byte_secret = bytes(self.__api_secret, "ascii") string = self.__nonce_v + self.__username + self.__api_key # create string encode_string = string.encode ('utf-8') signature = hmac.new(byte_secret, encode_string, digestmod=hashlib.sha256).hexdigest().upper() # create signature return signature def __post(self, url, param): # Post Request (Low Level API call) post_url = url header = { 'User-agent': 'bot-cex.io-' } params = urllib.parse.urlencode(param) post_data = params.encode( "ascii") req = urllib.request.Request(url = post_url, data = post_data, headers = header) page = urllib.request.urlopen(req).read() return page def api_call(self, method, param={}, private=0, couple=''): # api call (Middle level) url = 'https://cex.io/api/' + method + '/' # generate url if couple != '': url = url + couple + '/' # set couple if needed if private == 1: # add auth-data if needed self.__nonce() param.update({ 'key': self.__api_key, 'signature': self.__signature(), 'nonce': self.__nonce_v}) answer = self.__post(url, param) # Post Request a = answer.decode("utf-8") #return json.loads(answer) # generate dict and return return a # generates a valid json output def ticker(self, couple='MHC/BTC'): return self.api_call('ticker', {}, 0, couple) def tickers(self, couple='USD'): return self.api_call('tickers', {}, 0, couple) def ohlcv(self, end_date, couple='BTC/USD'): return self.api_call('ohlcv/hd/'+str(end_date), {}, 0, couple) def order_book(self, couple='MHC/BTC'): return self.api_call('order_book', {}, 0, couple) def trade_history(self, since=1, couple='MHC/BTC'): return self.api_call('trade_history', {"since": str(since)}, 0, couple) def balance(self): return self.api_call('balance', {}, 1) def current_orders(self, couple='MHC/BTC'): return self.api_call('open_orders', {}, 1, couple) def cancel_order(self, order_id): return self.api_call('cancel_order', {"id": order_id}, 1) def place_order(self, ptype='buy', amount=1, price=1, couple='MHC/BTC'): return self.api_call('place_order', {"type": ptype, "amount": str(amount), "price": str(price)}, 1, couple) def archived_orders(self, couple='XLM/USD'): return self.api_call('archived_orders', {}, 1, couple) def price_stats(self, last_hours, max_resp_arr_size, couple='MHC/BTC'): return self.api_call( 'price_stats', {"lastHours": last_hours, "maxRespArrSize": max_resp_arr_size}, 0, couple)
36.484848
122
0.614341
3,278
0.90753
0
0
0
0
0
0
932
0.258029
3afe20d5d7e69d6cf6f226fe42a4f3f4119240fa
1,125
py
Python
Fourier/FourierType.py
SymmetricChaos/FiniteFields
65258e06b7f04ce15223c1bc0c2384ef5e9cec1a
[ "MIT" ]
1
2021-08-22T15:03:59.000Z
2021-08-22T15:03:59.000Z
Fourier/FourierType.py
SymmetricChaos/NumberTheory
65258e06b7f04ce15223c1bc0c2384ef5e9cec1a
[ "MIT" ]
null
null
null
Fourier/FourierType.py
SymmetricChaos/NumberTheory
65258e06b7f04ce15223c1bc0c2384ef5e9cec1a
[ "MIT" ]
null
null
null
import numpy as np from GeneralUtils import list_to_sum class Fourier: def __init__(self,amp=[1],freq=[1],ph=[0]): self.amp = amp self.freq = freq self.ph = ph def __str__(self): out = [] for i in range(len(self.amp)): if self.amp[i] != 1: a = f"{self.amp[i]}*" else: a = "" if self.freq[i] != 1: f = f"*{self.freq[i]}" else: f = "" if self.ph[i] != 0: p = f"+{self.ph[i]}" else: p = "" out.append(f"{a}sin(x{f}{p})") return list_to_sum(out) def __add__(self,other): a = self.amp + other.amp f = self.freq + other.freq p = self.ph + other.ph return Fourier(a,f,p) def evaluate_series(F,x): out = np.zeros_like(x) for i in range(len(F.amp)): a = F.amp[i] f = F.freq[i] p = F.ph[i] out += a*np.sin(x*f+p) return out
22.959184
47
0.396444
862
0.766222
0
0
0
0
0
0
75
0.066667
3afe29425779a97835f8aa292d16b97d3ebe99af
13,194
py
Python
src/glados/es/ws2es/mappings_skeletons/es_chembl_tissue_mapping.py
chembl/GLaDOS
044ed5f927b45dd5033c9383085ad5922c61f331
[ "Apache-2.0" ]
33
2017-09-21T11:38:44.000Z
2022-03-19T06:41:47.000Z
src/glados/es/ws2es/mappings_skeletons/es_chembl_tissue_mapping.py
chembl/GLaDOS
044ed5f927b45dd5033c9383085ad5922c61f331
[ "Apache-2.0" ]
739
2016-08-22T09:32:17.000Z
2022-03-22T09:29:32.000Z
src/glados/es/ws2es/mappings_skeletons/es_chembl_tissue_mapping.py
chembl/GLaDOS
044ed5f927b45dd5033c9383085ad5922c61f331
[ "Apache-2.0" ]
5
2020-06-12T01:51:41.000Z
2021-09-17T10:32:53.000Z
# Elastic search mapping definition for the Molecule entity from glados.es.ws2es.es_util import DefaultMappings # Shards size - can be overridden from the default calculated value here # shards = 3, replicas = 1 analysis = DefaultMappings.COMMON_ANALYSIS mappings = \ { 'properties': { '_metadata': { 'properties': { 'es_completion': 'TEXT', # EXAMPLES: # '{'weight': 100, 'input': 'Retina/plasma'}' , '{'weight': 10, 'input': 'CHEMBL3987832'}' , '{'weig # ht': 10, 'input': 'UBERON:0001066'}' , '{'weight': 100, 'input': 'Intraorbital lacrimal gland'}' , # '{'weight': 10, 'input': 'CHEMBL3833873'}' , '{'weight': 10, 'input': 'CHEMBL3987959'}' , '{'weig # ht': 10, 'input': 'CHEMBL3988202'}' , '{'weight': 10, 'input': 'BTO:0001442'}' , '{'weight': 10, ' # input': 'UBERON:0000200'}' , '{'weight': 100, 'input': 'Aortic valve'}' 'organism_taxonomy': { 'properties': { 'l1': 'TEXT', # EXAMPLES: # 'Eukaryotes' , 'Eukaryotes' , 'Eukaryotes' , 'Eukaryotes' , 'Eukaryotes' , 'Eukaryotes' , # 'Eukaryotes' , 'Eukaryotes' , 'Bacteria' , 'Bacteria' 'l2': 'TEXT', # EXAMPLES: # 'Mammalia' , 'Mammalia' , 'Mammalia' , 'Mammalia' , 'Mammalia' , 'Mammalia' , 'Mammalia' , # 'Mammalia' , 'Gram-Positive' , 'Gram-Positive' 'l3': 'TEXT', # EXAMPLES: # 'Rodentia' , 'Primates' , 'Rodentia' , 'Rodentia' , 'Primates' , 'Lagomorpha' , 'Rodentia' # , 'Rodentia' , 'Streptococcus' , 'Staphylococcus' 'oc_id': 'NUMERIC', # EXAMPLES: # '42' , '7' , '42' , '42' , '60' , '69' , '42' , '42' , '590' , '561' 'tax_id': 'NUMERIC', # EXAMPLES: # '10116' , '9606' , '10116' , '10116' , '9544' , '9986' , '10116' , '10116' , '1313' , '128 # 0' } }, 'related_activities': { 'properties': { 'all_chembl_ids': 'TEXT', # EXAMPLES: # '' , '' , '' , '' , '' , '' , '' , '' , '' , '' 'count': 'NUMERIC', # EXAMPLES: # '5' , '1' , '4' , '1' , '63' , '15' , '1' , '2' , '110' , '31' } }, 'related_assays': { 'properties': { 'all_chembl_ids': 'TEXT', # EXAMPLES: # 'CHEMBL3271354 CHEMBL3271351 CHEMBL3271352 CHEMBL3271353 CHEMBL3749611' , 'CHEMBL3266981' # , 'CHEMBL3231741 CHEMBL3232032 CHEMBL3232142 CHEMBL3232050' , 'CHEMBL2212114' , 'CHEMBL102 # 2344 CHEMBL1275020 CHEMBL1274863 CHEMBL1274891 CHEMBL1274030 CHEMBL1022341 CHEMBL1011798 C # HEMBL1019674 CHEMBL1274912 CHEMBL1274662 CHEMBL1017034 CHEMBL1274842 CHEMBL1274933 CHEMBL1 # 275069 CHEMBL1274558 CHEMBL1274898 CHEMBL1017033 CHEMBL1274849 CHEMBL1274565 CHEMBL1274593 # CHEMBL1274683 CHEMBL4000834 CHEMBL1011797 CHEMBL1274856 CHEMBL1274572 CHEMBL964747 CHEMBL # 1275027 CHEMBL1274037 CHEMBL1274551 CHEMBL964745 CHEMBL1274926 CHEMBL1274919 CHEMBL1274690 # CHEMBL1275034 CHEMBL1274877 CHEMBL1274669 CHEMBL1275048 CHEMBL1274884 CHEMBL1017010 CHEMB # L1017032 CHEMBL1022342 CHEMBL1022346 CHEMBL1017035 CHEMBL1275076 CHEMBL1275090 CHEMBL10170 # 09 CHEMBL1275062 CHEMBL1274579 CHEMBL1274905 CHEMBL1274676 CHEMBL1019675 CHEMBL1274586 CHE # MBL964744 CHEMBL1274655 CHEMBL1022345 CHEMBL1275055 CHEMBL1011799 CHEMBL1275041 CHEMBL1275 # 083 CHEMBL1022343 CHEMBL964746 CHEMBL1274870 CHEMBL1274544' , 'CHEMBL3862853 CHEMBL3862825 # CHEMBL3862826' , 'CHEMBL3373694' , 'CHEMBL4054773 CHEMBL4054770' , 'CHEMBL1827722 CHEMBL3 # 583725 CHEMBL3389745 CHEMBL935349 CHEMBL3091242 CHEMBL3583724 CHEMBL3091255 CHEMBL3583723 # CHEMBL940282 CHEMBL3738486 CHEMBL1926063 CHEMBL1055389 CHEMBL1924493 CHEMBL3736923 CHEMBL3 # 736913 CHEMBL3583729 CHEMBL1924492 CHEMBL3738482 CHEMBL3737062 CHEMBL1924491 CHEMBL3389206 # CHEMBL1260643 CHEMBL935348 CHEMBL3389742 CHEMBL3389743 CHEMBL936043 CHEMBL3583728 CHEMBL1 # 805837 CHEMBL3606187 CHEMBL3389744 CHEMBL3736767 CHEMBL948103 CHEMBL1924490 CHEMBL940281 C # HEMBL935351 CHEMBL3362796 CHEMBL935350 CHEMBL3606186 CHEMBL3389205 CHEMBL3583726 CHEMBL373 # 6765 CHEMBL1273661 CHEMBL1055388 CHEMBL1273660 CHEMBL1067241 CHEMBL1924489 CHEMBL935352 CH # EMBL2214928 CHEMBL1067242' , 'CHEMBL994370 CHEMBL1218348 CHEMBL994358 CHEMBL994366 CHEMBL9 # 94362 CHEMBL994369 CHEMBL1218345 CHEMBL994359 CHEMBL1657220 CHEMBL1657221 CHEMBL1653373 CH # EMBL1655162 CHEMBL994372 CHEMBL1218462 CHEMBL1654323 CHEMBL994371 CHEMBL1654028 CHEMBL1654 # 324 CHEMBL994368 CHEMBL1218349 CHEMBL1218341 CHEMBL994367 CHEMBL994363 CHEMBL1654322 CHEMB # L994365 CHEMBL1654030 CHEMBL1654029' 'count': 'NUMERIC', # EXAMPLES: # '5' , '1' , '4' , '1' , '63' , '3' , '1' , '2' , '49' , '27' } }, 'related_cell_lines': { 'properties': { 'all_chembl_ids': 'TEXT', # EXAMPLES: # 'CHEMBL3833683' , 'CHEMBL3307768' , 'CHEMBL3307627' , 'CHEMBL3307355' , 'CHEMBL3307965' , # 'CHEMBL3307651' , 'CHEMBL3307762' , 'CHEMBL3307627' , 'CHEMBL3308019 CHEMBL3307570 CHEMBL3 # 307965 CHEMBL3307564' , 'CHEMBL3307383' 'count': 'NUMERIC', # EXAMPLES: # '1' , '1' , '1' , '1' , '1' , '1' , '1' , '1' , '4' , '1' } }, 'related_compounds': { 'properties': { 'all_chembl_ids': 'TEXT', # EXAMPLES: # 'CHEMBL2420629 CHEMBL3746776 CHEMBL3260358' , 'CHEMBL3260771' , 'CHEMBL3229240 CHEMBL32292 # 38' , 'CHEMBL2203701' , 'CHEMBL395998 CHEMBL2017983 CHEMBL1270517' , 'CHEMBL2403888 CHEMBL # 3922006 CHEMBL3895075 CHEMBL3948952 CHEMBL3905199 CHEMBL3933212 CHEMBL3906900 CHEMBL210573 # 5 CHEMBL3921126' , 'CHEMBL3358920' , 'CHEMBL4074669' , 'CHEMBL3604813 CHEMBL188635 CHEMBL1 # 922318 CHEMBL1922327 CHEMBL2441068 CHEMBL1922489 CHEMBL510944 CHEMBL1922481 CHEMBL2206420 # CHEMBL3086523 CHEMBL1922499 CHEMBL1922323 CHEMBL1922328 CHEMBL1923420 CHEMBL1922486 CHEMBL # 1922494 CHEMBL3580908 CHEMBL3580926 CHEMBL1922490 CHEMBL1922336 CHEMBL3735824 CHEMBL497 CH # EMBL1922480 CHEMBL1922337 CHEMBL1922326 CHEMBL1922482 CHEMBL1258462 CHEMBL581906 CHEMBL192 # 2333 CHEMBL1922315 CHEMBL1922496 CHEMBL1922477 CHEMBL1272278 CHEMBL1922321 CHEMBL1922316 C # HEMBL1822871 CHEMBL1922484 CHEMBL1922487 CHEMBL1272227 CHEMBL1922332 CHEMBL1922330 CHEMBL4 # 5 CHEMBL286615 CHEMBL1922479 CHEMBL411440 CHEMBL1922478 CHEMBL1922322 CHEMBL161 CHEMBL3876 # 75 CHEMBL1922500 CHEMBL1922335 CHEMBL1922324 CHEMBL1922497 CHEMBL551359 CHEMBL3580919 CHEM # BL1922491 CHEMBL1922317 CHEMBL1922325 CHEMBL1922493 CHEMBL1922331 CHEMBL1922319 CHEMBL1922 # 483 CHEMBL75267 CHEMBL465372 CHEMBL1922488 CHEMBL1922498 CHEMBL1922329 CHEMBL1922334 CHEMB # L1800922 CHEMBL3580916 CHEMBL502 CHEMBL1922492 CHEMBL1922320 CHEMBL1922495 CHEMBL1922485 C # HEMBL2206412' , 'CHEMBL262777 CHEMBL520642 CHEMBL501122 CHEMBL32 CHEMBL126 CHEMBL387675' 'count': 'NUMERIC', # EXAMPLES: # '3' , '1' , '2' , '1' , '3' , '9' , '1' , '1' , '76' , '6' } }, 'related_documents': { 'properties': { 'all_chembl_ids': 'TEXT', # EXAMPLES: # 'CHEMBL3745705 CHEMBL3259558' , 'CHEMBL3259671' , 'CHEMBL3227952' , 'CHEMBL2203285' , 'CHE # MBL1151757 CHEMBL1268908 CHEMBL4000173' , 'CHEMBL3861981' , 'CHEMBL3352115' , 'CHEMBL40526 # 43' , 'CHEMBL3603820 CHEMBL1921774 CHEMBL3734674 CHEMBL1143818 CHEMBL3085641 CHEMBL1156916 # CHEMBL3351484 CHEMBL1151477 CHEMBL1255186 CHEMBL3352025 CHEMBL1149049 CHEMBL1821588 CHEMB # L3580567 CHEMBL1142351 CHEMBL2203249 CHEMBL1921784 CHEMBL1800034 CHEMBL1269010' , 'CHEMBL1 # 155768 CHEMBL1649142 CHEMBL1649273 CHEMBL1212779' 'count': 'NUMERIC', # EXAMPLES: # '2' , '1' , '1' , '1' , '3' , '1' , '1' , '1' , '18' , '4' } }, 'related_targets': { 'properties': { 'all_chembl_ids': 'TEXT', # EXAMPLES: # 'CHEMBL612558 CHEMBL345' , 'CHEMBL1836' , 'CHEMBL612558' , 'CHEMBL612558' , 'CHEMBL612545 # CHEMBL612558' , 'CHEMBL612546' , 'CHEMBL376' , 'CHEMBL612545' , 'CHEMBL2574 CHEMBL375 CHEM # BL612545 CHEMBL612546 CHEMBL612670 CHEMBL376 CHEMBL612558 CHEMBL613631 CHEMBL347' , 'CHEMB # L352 CHEMBL374 CHEMBL362' 'count': 'NUMERIC', # EXAMPLES: # '2' , '1' , '1' , '1' , '2' , '1' , '1' , '1' , '9' , '3' } } } }, 'bto_id': 'TEXT', # EXAMPLES: # 'BTO:0001442' , 'BTO:0001279' , 'BTO:0000156' , 'BTO:0001388' , 'BTO:0000928' , 'BTO:0000573' , 'BTO:00010 # 67' , 'BTO:0000493' , 'BTO:0004345' , 'BTO:0001063' 'caloha_id': 'TEXT', # EXAMPLES: # 'TS-0953' , 'TS-0099' , 'TS-1060' , 'TS-1307' , 'TS-0054' , 'TS-0394' , 'TS-0309' , 'TS-0813' , 'TS-1047' # , 'TS-0469' 'efo_id': 'TEXT', # EXAMPLES: # 'EFO:0001914' , 'UBERON:0002240' , 'UBERON:0001348' , 'UBERON:0003126' , 'UBERON:0001637' , 'UBERON:000211 # 0' , 'UBERON:0002728' , 'UBERON:0000970' , 'UBERON:0001851' , 'UBERON:0000988' 'pref_name': 'TEXT', # EXAMPLES: # 'Retina/plasma' , 'Meningeal artery' , 'Intervertebral disk' , 'Intraorbital lacrimal gland' , 'Occipital # lobe' , 'Sinoatrial node' , 'Ankle/Knee' , 'Brain ventricle' , 'Gyrus' , 'Aortic valve' 'tissue_chembl_id': 'TEXT', # EXAMPLES: # 'CHEMBL4296362' , 'CHEMBL3987832' , 'CHEMBL3987785' , 'CHEMBL3987787' , 'CHEMBL3833873' , 'CHEMBL3987959' # , 'CHEMBL3988202' , 'CHEMBL4296347' , 'CHEMBL3987758' , 'CHEMBL3987638' 'uberon_id': 'TEXT', # EXAMPLES: # 'UBERON:0003474' , 'UBERON:0001066' , 'UBERON:0019324' , 'UBERON:0002021' , 'UBERON:0002351' , 'UBERON:000 # 4086' , 'UBERON:0000200' , 'UBERON:0002137' , 'UBERON:0001881' , 'UBERON:0002240' } }
66.301508
120
0.488176
0
0
0
0
0
0
0
0
8,350
0.632863
d70045662563ef27515bc31c292104985de68053
2,733
py
Python
top_book/book/views.py
mfarjami/DRF-top
914ed9068ed73d7d8a692c8ed2e77cba96cee5b1
[ "MIT" ]
null
null
null
top_book/book/views.py
mfarjami/DRF-top
914ed9068ed73d7d8a692c8ed2e77cba96cee5b1
[ "MIT" ]
null
null
null
top_book/book/views.py
mfarjami/DRF-top
914ed9068ed73d7d8a692c8ed2e77cba96cee5b1
[ "MIT" ]
null
null
null
from rest_framework.decorators import api_view from rest_framework.views import APIView from rest_framework import status from rest_framework.response import Response from .models import Book from .serializers import BookSerializer # Create your views here. class GetAllData(APIView): def get(self, request): query = Book.objects.all().order_by('-create_at') serializers = BookSerializer(query , many=True) return Response(serializers.data, status=status.HTTP_200_OK) @api_view(['GET']) def allApi(request): if request.method == 'GET': query = Book.objects.all().order_by('-create_at') serializer = BookSerializer(query, many=True) return Response(serializer.data, status=status.HTTP_200_OK) @api_view(['POST']) def SetData(request): if request.method == 'POST': serializer = BookSerializer(data=request.data) if serializer.is_valid(): serializer.save() return Response(serializer.data, status=status.HTTP_201_CREATE) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) class GetFavData(APIView): def get(self,request): query = Book.objects.filter(fav=True) serializer = BookSerializer(query, many=True) return Response(serializer.data, status=status.HTTP_200_OK) class UpdateFavData(APIView): def get(self, request, pk): query = Book.objects.get(pk=pk) serializer = BookSerializer(query) return Response(serializer.data, status=status.HTTP_200_OK) def put(self, request, pk): query = Book.objects.get(pk=pk) serializer = BookSerializer(query, data=request.data) if serializer.is_valid(): serializer.save() return Response(serializer.data, status=status.HTTP_201_CREATED) else: return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) class PostModelData(APIView): def post(self, request): serializer = BookSerializer(data=request.data) if serializer.is_valid(): serializer.save() return Response(serializer.data, status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) class SearchData(APIView): def get(self, request): search = request.GET['name'] query = Book.objects.filter(store_name__contains=search) serializer= BookSerializer(query, many=True) return Response(serializer.data, status=status.HTTP_200_OK) class DeleteData(APIView): def delete(self, request, pk): query = Book.objects.get(pk=pk) query.delete() return Response(status=status.HTTP_204_NO_CONTENT)
35.960526
82
0.691914
1,848
0.67618
0
0
599
0.219173
0
0
77
0.028174
d700ee43fe0eef5ccc9227c82691c00f27054812
1,463
py
Python
mysite/urls.py
mnithya/cs3240-s15-team06-test
58f5d152f43f87c46e12252b2e52da98dcb443fb
[ "MIT" ]
null
null
null
mysite/urls.py
mnithya/cs3240-s15-team06-test
58f5d152f43f87c46e12252b2e52da98dcb443fb
[ "MIT" ]
null
null
null
mysite/urls.py
mnithya/cs3240-s15-team06-test
58f5d152f43f87c46e12252b2e52da98dcb443fb
[ "MIT" ]
null
null
null
from django.conf.urls import include, url from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns urlpatterns = [ # Examples: # url(r'^$', 'mysite.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^$', 'polls.views.home', name='home'), url(r'^admin/', include(admin.site.urls)), # user auth urls url(r'^accounts/login/$', 'polls.views.login'), url(r'^accounts/auth/$', 'polls.views.auth_view'), url(r'^accounts/logout/$', 'polls.views.logout'), url(r'^accounts/loggedin/$', 'polls.views.loggedin'), url(r'^accounts/invalid/$', 'polls.views.invalid_login'), url(r'^accounts/register/$', 'polls.views.register_user'), url(r'^accounts/register_success/$', 'polls.views.register_success'), # report url(r'^reports/new/$', 'polls.views.new_report'), url(r'^reports/list/$', 'polls.views.user_report'), url(r'^reports/detail/(?P<id>\d+)/$', 'polls.views.report_details'), url(r'^reports/delete/(?P<id>\d+)/$','polls.views.delete'), url(r'^reports/all/$','polls.views.report_all'), url(r'^reports/edit/(?P<id>\d+)/$', 'polls.views.edit_report'), # folder url(r'^folder/new/$', 'polls.views.new_folder'), #search url(r'^search-form/$', 'polls.views.search_form'), url(r'^search/$', 'polls.views.search'), ]
36.575
73
0.598086
0
0
0
0
0
0
0
0
908
0.620643
d701a6651f142786ed830a72df90c9d0bacf6951
4,338
py
Python
source/cf/defaults/lambdas/libs/videostream/videostream/__init__.py
vteremasov/aws-iot-kickstart
de6313b02cd35519febbf43ae56aa7a01513cbc1
[ "Apache-2.0" ]
8
2019-08-14T06:36:32.000Z
2021-08-08T05:59:40.000Z
source/cf/defaults/lambdas/libs/videostream/videostream/__init__.py
vteremasov/aws-iot-kickstart
de6313b02cd35519febbf43ae56aa7a01513cbc1
[ "Apache-2.0" ]
null
null
null
source/cf/defaults/lambdas/libs/videostream/videostream/__init__.py
vteremasov/aws-iot-kickstart
de6313b02cd35519febbf43ae56aa7a01513cbc1
[ "Apache-2.0" ]
4
2019-11-25T06:14:08.000Z
2021-03-21T14:56:10.000Z
''' Module camera provides the VideoStream class which offers a threaded interface to multiple types of cameras. ''' from threading import Thread import io import os import platform import numpy as np # pylint: disable=import-error class VideoStream: ''' Instantiate the VideoStream class. Use the method read() to get the frame. ''' def __init__(self, camera_type="video0", path_to_camera="/dev/video0", width="1920", height="1080"): ''' Constructor. Chooses a camera to read from. ''' print("VideoStream: {}, {}, {}, {}".format(camera_type, path_to_camera, width, height)) self.camera_type = camera_type self.path_to_camera = path_to_camera self.width = width self.height = height if self.camera_type == "Darwin": print("VideoStream: Opening webcam") self.path_to_camera = "Webcam" import cv2 # pylint: disable=import-error self.stream = cv2.VideoCapture(0) self.stream.set(3, self.width) self.stream.set(4, self.height) elif self.camera_type == "video0": print("VideoStream: Opening {}".format(self.path_to_camera)) import cv2 # pylint: disable=import-error self.stream = cv2.VideoCapture(self.path_to_camera) print("VideoStream: Stream opened = {}".format(self.stream.isOpened())) elif self.camera_type == "awscam": print("VideoStream: Opening awscam") import awscam # pylint: disable=import-error self.stream = awscam self.stream.read = self.stream.getLastFrame print("VideoStream: awscam opened") elif self.camera_type == "picamera": print("VideoStream: Opening picamera") import picamera # pylint: disable=import-error def piCameraCapture(self): _stream = io.BytesIO() # time.sleep(2) PICAMERA.capture(_stream, format='jpeg') # Construct a numpy array from the _stream data = np.fromstring(_stream.getvalue(), dtype=np.uint8) # "Decode" the image from the array, preserving colour return True, cv2.imdecode(data, 1) picamera.PiCamera.read = piCameraCapture PICAMERA = self.stream = picamera.PiCamera() self.stream.resolution = (self.width, self.height) self.stream.start_preview() print("VideoStream: picamera opened") else: self.path_to_camera = "GStreamer" HD_2K = False if HD_2K: self.width = 2592 # 648 self.height = 1944 # 486 else: self.width = 1296 # 324 self.height = 972 # 243 gst_str = ("nvcamerasrc ! " "video/x-raw(memory:NVMM), width=(int)2592, height=(int)1944," "format=(string)I420, framerate=(fraction)30/1 ! " "nvvidconv ! video/x-raw, width=(int){}, height=(int){}, " "format=(string)BGRx ! videoconvert ! appsink").format(self.width, self.height) self.stream = cv2.VideoCapture(gst_str, cv2.CAP_GSTREAMER) self.stopped = False self.ret, self.frame = self.stream.read() print("Videostream init done.") def get_height(self): return self.height def get_width(self): return self.width def get_white_frame(self): return 255*np.ones([self.width, self.height, 3]) def start(self): '''start() starts the thread''' thread = Thread(target=self.update, args=()) thread.daemon = True thread.start() return self def update(self): '''update() constantly read the camera stream''' print("VideoStream: udpate: starting the camera reads") while not self.stopped: self.ret, self.frame = self.stream.read() def read(self): '''read() return the last frame captured''' return self.ret, self.frame # def read(self): # '''read() return the last frame captured''' # return self.stream.read() def stop(self): '''stop() set a flag to stop the update loop''' self.stopped = True
35.557377
104
0.581374
4,103
0.945828
0
0
0
0
0
0
1,438
0.331489
d70221e578207ce862200803a43004bc9a1ee74c
23,838
py
Python
JaxCQL/model.py
yisu0005/JaxCQL
6cb404c34dc02c99ac9a2ea551c28f867f78f9f7
[ "MIT" ]
null
null
null
JaxCQL/model.py
yisu0005/JaxCQL
6cb404c34dc02c99ac9a2ea551c28f867f78f9f7
[ "MIT" ]
null
null
null
JaxCQL/model.py
yisu0005/JaxCQL
6cb404c34dc02c99ac9a2ea551c28f867f78f9f7
[ "MIT" ]
null
null
null
from functools import partial from matplotlib.pyplot import xcorr import numpy as np import jax import jax.numpy as jnp import flax from flax import linen as nn import distrax from .jax_utils import batch_to_jax, extend_and_repeat, next_rng def update_target_network(main_params, target_params, tau): return jax.tree_multimap( lambda x, y: tau * x + (1.0 - tau) * y, main_params, target_params ) # def multiple_action_q_function(forward): # # Forward the q function with multiple actions on each state, to be used as a decorator # def wrapped(self, observations, actions, **kwargs): # multiple_actions = False # batch_size = observations.shape[0] # if actions.ndim == 3 and observations.ndim == 2: # multiple_actions = True # observations = extend_and_repeat(observations, 1, actions.shape[1]).reshape(-1, observations.shape[-1]) # actions = actions.reshape(-1, actions.shape[-1]) # q_values = forward(self, observations, actions, **kwargs) # if multiple_actions: # q_values = q_values.reshape(batch_size, -1) # return q_values # return wrapped def multiple_action_q_function(forward): # Forward the q function with multiple actions on each state, to be used as a decorator def wrapped(self, observations, actions, **kwargs): multiple_actions = False batch_size = observations.shape[0] if actions.ndim == 3 and observations.ndim == 2: multiple_actions = True observations = extend_and_repeat(observations, 1, actions.shape[1]).reshape(-1, observations.shape[-1]) actions = actions.reshape(-1, actions.shape[-1]) q_last_layer, q_values = forward(self, observations, actions, **kwargs) if multiple_actions: q_last_layer = q_last_layer.reshape(batch_size, -1) q_values = q_values.reshape(batch_size, -1) return q_last_layer, q_values return wrapped def multiple_action_encode_function(forward): # Forward the rep function with multiple actions on each state, to be used as a decorator def wrapped(self, rng, observations, actions, **kwargs): multiple_actions = False batch_size = observations.shape[0] if actions.ndim == 3 and observations.ndim == 2: repeat = actions.shape[1] multiple_actions = True observations = extend_and_repeat(observations, 1, actions.shape[1]).reshape(-1, observations.shape[-1]) actions = actions.reshape(-1, actions.shape[-1]) samples, log_probs = forward(self, rng, observations, actions, **kwargs) if multiple_actions: samples = samples.reshape(batch_size, repeat, -1) log_probs = log_probs.reshape(batch_size, repeat, -1) return samples, log_probs return wrapped def multiple_action_decode_function(forward): # Forward the rep function with multiple actions on each state, to be used as a decorator def wrapped(self, observations, actions, **kwargs): multiple_actions = False batch_size = observations.shape[0] if actions.ndim == 3 and observations.ndim == 2: repeat = actions.shape[1] multiple_actions = True observations = extend_and_repeat(observations, 1, actions.shape[1]).reshape(-1, observations.shape[-1]) actions = actions.reshape(-1, actions.shape[-1]) q_values = forward(self, observations, actions, **kwargs) if multiple_actions: q_values = q_values.reshape(batch_size, repeat, -1) return q_values return wrapped class Scalar(nn.Module): init_value: float def setup(self): self.value = self.param('value', lambda x:self.init_value) def __call__(self): return self.value class FullyConnectedNetwork(nn.Module): output_dim: int arch: str = '256-256' orthogonal_init: bool = False # batch_norm: bool = False @nn.compact def __call__(self, input_tensor): x = input_tensor hidden_sizes = [int(h) for h in self.arch.split('-')] for h in hidden_sizes: if self.orthogonal_init: x = nn.Dense( h, kernel_init=jax.nn.initializers.orthogonal(jnp.sqrt(2.0)), bias_init=jax.nn.initializers.zeros )(x) else: x = nn.Dense(h)(x) # if self.batch_norm: # x = nn.BatchNorm(use_running_average=not train_mode, momentum=0.9, # epsilon=1e-5, # dtype=jnp.float32)(x) x = nn.relu(x) if self.orthogonal_init: output = nn.Dense( self.output_dim, kernel_init=jax.nn.initializers.orthogonal(1e-2), bias_init=jax.nn.initializers.zeros )(x) else: output = nn.Dense( self.output_dim, kernel_init=jax.nn.initializers.variance_scaling( 1e-2, 'fan_in', 'uniform' ), bias_init=jax.nn.initializers.zeros )(x) return output class FullyConnectedNetworkWithLastLayer(nn.Module): output_dim: int arch: str = '256-256' orthogonal_init: bool = False @nn.compact def __call__(self, input_tensor): x = input_tensor batch, _ = jnp.shape(x) hidden_sizes = [int(h) for h in self.arch.split('-')] for h in hidden_sizes: if self.orthogonal_init: x = nn.Dense( h, kernel_init=jax.nn.initializers.orthogonal(jnp.sqrt(2.0)), bias_init=jax.nn.initializers.zeros )(x) else: x = nn.Dense(h)(x) # x = nn.LayerNorm()(x) x = nn.relu(x) normalized = jnp.reshape(jnp.sqrt(jnp.sum(x**2, axis=-1) + 1e-6), (batch,1)) x = x / normalized # x = x / (jnp.sqrt(jnp.sum(x**2, axis=-1) + 1e-6)) if self.orthogonal_init: output = nn.Dense( self.output_dim, kernel_init=jax.nn.initializers.orthogonal(1e-2), bias_init=jax.nn.initializers.zeros )(x) else: output = nn.Dense( self.output_dim, kernel_init=jax.nn.initializers.variance_scaling( 1e-2, 'fan_in', 'uniform' ), bias_init=jax.nn.initializers.zeros )(x) return x, output class FullyConnectedQFunction(nn.Module): observation_dim: int action_dim: int arch: str = '256-256' orthogonal_init: bool = False @nn.compact @multiple_action_q_function def __call__(self, observations, actions): x = jnp.concatenate([observations, actions], axis=-1) # x = FullyConnectedNetwork(output_dim=1, arch=self.arch, orthogonal_init=self.orthogonal_init)(x) last_layer_x, x = FullyConnectedNetworkWithLastLayer(output_dim=1, arch=self.arch, orthogonal_init=self.orthogonal_init)(x) return last_layer_x, jnp.squeeze(x, -1) class FullyConnectedActionQFunction(nn.Module): observation_dim: int action_dim: int output_dim: int = 1 arch: str = '256-256' orthogonal_init: bool = False normalize: bool = False @nn.compact @multiple_action_q_function def __call__(self, observations, actions): x = jnp.concatenate([observations, actions], axis=-1) batch, _ = jnp.shape(x) hidden_sizes = [int(h) for h in self.arch.split('-')] for h in hidden_sizes: if self.orthogonal_init: x = nn.Dense( h, kernel_init=jax.nn.initializers.orthogonal(jnp.sqrt(2.0)), bias_init=jax.nn.initializers.zeros )(x) else: x = nn.Dense(h)(jnp.concatenate([x, actions], axis=-1)) x = nn.relu(x) if self.normalize: normalized = jnp.reshape(jnp.sqrt(jnp.sum(x**2, axis=-1) + 1e-6), (batch,1)) x = x / normalized if self.orthogonal_init: output = nn.Dense( self.output_dim, kernel_init=jax.nn.initializers.orthogonal(1e-2), bias_init=jax.nn.initializers.zeros )(jnp.concatenate([x, actions], axis=-1)) else: output = nn.Dense( self.output_dim, kernel_init=jax.nn.initializers.variance_scaling( 1e-2, 'fan_in', 'uniform' ), bias_init=jax.nn.initializers.zeros )(jnp.concatenate([x, actions], axis=-1)) return x, jnp.squeeze(output, -1) class TanhGaussianPolicy(nn.Module): observation_dim: int action_dim: int arch: str = '256-256' orthogonal_init: bool = False log_std_multiplier: float = 1.0 log_std_offset: float = -1.0 action_scale: float = 1.0 def setup(self): self.base_network = FullyConnectedNetwork( output_dim=2 * self.action_dim, arch=self.arch, orthogonal_init=self.orthogonal_init ) self.log_std_multiplier_module = Scalar(self.log_std_multiplier) self.log_std_offset_module = Scalar(self.log_std_offset) def log_prob(self, observations, actions): if actions.ndim == 3: observations = extend_and_repeat(observations, 1, actions.shape[1]) base_network_output = self.base_network(observations) mean, log_std = jnp.split(base_network_output, 2, axis=-1) log_std = self.log_std_multiplier_module() * log_std + self.log_std_offset_module() log_std = jnp.clip(log_std, -20.0, 2.0) action_distribution = distrax.Transformed( distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)), distrax.Block(distrax.Tanh(), ndims=1) ) return action_distribution.log_prob(actions / self.action_scale) def __call__(self, rng, observations, deterministic=False, repeat=None): if repeat is not None: observations = extend_and_repeat(observations, 1, repeat) base_network_output = self.base_network(observations) mean, log_std = jnp.split(base_network_output, 2, axis=-1) log_std = self.log_std_multiplier_module() * log_std + self.log_std_offset_module() log_std = jnp.clip(log_std, -20.0, 2.0) action_distribution = distrax.Transformed( distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)), distrax.Block(distrax.Tanh(), ndims=1) ) if deterministic: mean = jnp.clip(mean, -6, 6) samples = jnp.tanh(mean) log_prob = action_distribution.log_prob(samples) else: samples, log_prob = action_distribution.sample_and_log_prob(seed=rng) samples = samples * self.action_scale return samples, log_prob class ActionRepresentationPolicy(nn.Module): observation_dim: int action_dim: int latent_action_dim: int arch: str = '256-256' orthogonal_init: bool = False no_tanh: bool = False log_std_multiplier: float = 1.0 log_std_offset: float = -1.0 # batch_norm: bool = True def setup(self): self.base_network = FullyConnectedNetwork( output_dim=2 * self.latent_action_dim, arch=self.arch, orthogonal_init=self.orthogonal_init ) self.log_std_multiplier_module = Scalar(self.log_std_multiplier) self.log_std_offset_module = Scalar(self.log_std_offset) def log_prob(self, observations, actions, latent_actions): if actions.ndim == 3: observations = extend_and_repeat(observations, 1, actions.shape[1]) x = jnp.concatenate([observations, actions], axis=-1) base_network_output = self.base_network(x) mean, log_std = jnp.split(base_network_output, 2, axis=-1) log_std = self.log_std_multiplier_module() * log_std + self.log_std_offset_module() log_std = jnp.clip(log_std, -20.0, 2.0) if self.no_tanh: action_distribution = distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)) else: action_distribution = distrax.Transformed( distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)), distrax.Block(distrax.Tanh(), ndims=1) ) return action_distribution.log_prob(latent_actions) @nn.compact @multiple_action_encode_function def __call__(self, rng, observations, actions, deterministic=False, repeat=None): if repeat is not None: observations = extend_and_repeat(observations, 1, repeat) x = jnp.concatenate([observations, actions], axis=-1) base_network_output = self.base_network(x) mean, log_std = jnp.split(base_network_output, 2, axis=-1) log_std = self.log_std_multiplier_module() * log_std + self.log_std_offset_module() log_std = jnp.clip(log_std, -20.0, 2.0) if self.no_tanh: action_distribution = distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)) else: action_distribution = distrax.Transformed( distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)), distrax.Block(distrax.Tanh(), ndims=1) ) if deterministic: samples = jnp.tanh(mean) log_prob = action_distribution.log_prob(samples) else: samples, log_prob = action_distribution.sample_and_log_prob(seed=rng) return samples, log_prob def get_statistics(self, rng, observations, actions, deterministic=False, repeat=None): if repeat is not None: observations = extend_and_repeat(observations, 1, repeat) x = jnp.concatenate([observations, actions], axis=-1) base_network_output = self.base_network(x) mean, log_std = jnp.split(base_network_output, 2, axis=-1) log_std = self.log_std_multiplier_module() * log_std + self.log_std_offset_module() log_std = jnp.clip(log_std, -20.0, 2.0) if self.no_tanh: action_distribution = distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)) else: action_distribution = distrax.Transformed( distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)), distrax.Block(distrax.Tanh(), ndims=1) ) if deterministic: samples = jnp.tanh(mean) log_prob = action_distribution.log_prob(samples) else: samples, log_prob = action_distribution.sample_and_log_prob(seed=rng) return samples, mean, log_std class ActionOnlyRepresentationPolicy(nn.Module): action_dim: int latent_action_dim: int arch: str = '256-256' orthogonal_init: bool = False no_tanh: bool = False log_std_multiplier: float = 1.0 log_std_offset: float = -1.0 def setup(self): self.base_network = FullyConnectedNetwork( output_dim=2 * self.latent_action_dim, arch=self.arch, orthogonal_init=self.orthogonal_init ) self.log_std_multiplier_module = Scalar(self.log_std_multiplier) self.log_std_offset_module = Scalar(self.log_std_offset) def log_prob(self, actions, latent_actions): if actions.ndim == 3: observations = extend_and_repeat(observations, 1, actions.shape[1]) base_network_output = self.base_network(actions) mean, log_std = jnp.split(base_network_output, 2, axis=-1) log_std = self.log_std_multiplier_module() * log_std + self.log_std_offset_module() log_std = jnp.clip(log_std, -20.0, 2.0) if self.no_tanh: action_distribution = distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)) else: action_distribution = distrax.Transformed( distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)), distrax.Block(distrax.Tanh(), ndims=1) ) return action_distribution.log_prob(latent_actions) @nn.compact def __call__(self, rng, actions, deterministic=False, repeat=None): if repeat is not None: observations = extend_and_repeat(observations, 1, repeat) base_network_output = self.base_network(actions) mean, log_std = jnp.split(base_network_output, 2, axis=-1) log_std = self.log_std_multiplier_module() * log_std + self.log_std_offset_module() log_std = jnp.clip(log_std, -20.0, 2.0) if self.no_tanh: action_distribution = distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)) else: action_distribution = distrax.Transformed( distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)), distrax.Block(distrax.Tanh(), ndims=1) ) if deterministic: samples = jnp.tanh(mean) log_prob = action_distribution.log_prob(samples) else: samples, log_prob = action_distribution.sample_and_log_prob(seed=rng) return samples, log_prob def get_statistics(self, rng, actions, deterministic=False, repeat=None): if repeat is not None: observations = extend_and_repeat(observations, 1, repeat) base_network_output = self.base_network(actions) mean, log_std = jnp.split(base_network_output, 2, axis=-1) log_std = self.log_std_multiplier_module() * log_std + self.log_std_offset_module() log_std = jnp.clip(log_std, -20.0, 2.0) if self.no_tanh: action_distribution = distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)) else: action_distribution = distrax.Transformed( distrax.MultivariateNormalDiag(mean, jnp.exp(log_std)), distrax.Block(distrax.Tanh(), ndims=1) ) if deterministic: samples = jnp.tanh(mean) log_prob = action_distribution.log_prob(samples) else: samples, log_prob = action_distribution.sample_and_log_prob(seed=rng) return samples, mean, log_std class ActionDecoder(nn.Module): observation_dim: int latent_action_dim: int action_dim: int arch: str = '256-256' orthogonal_init: bool = False @nn.compact @multiple_action_decode_function def __call__(self, observations, latent_actions): x = jnp.concatenate([observations, latent_actions], axis=-1) hidden_sizes = [int(h) for h in self.arch.split('-')] for h in hidden_sizes: if self.orthogonal_init: x = nn.Dense( h, kernel_init=jax.nn.initializers.orthogonal(jnp.sqrt(2.0)), bias_init=jax.nn.initializers.zeros )(x) else: x = nn.Dense(h)(x) x = nn.relu(x) if self.orthogonal_init: x = nn.Dense( self.action_dim, kernel_init=jax.nn.initializers.orthogonal(1e-2), bias_init=jax.nn.initializers.zeros )(x) else: x = nn.Dense( self.action_dim, kernel_init=jax.nn.initializers.variance_scaling( 1e-2, 'fan_in', 'uniform' ), bias_init=jax.nn.initializers.zeros )(x) output = nn.tanh(x) return output class ActionSeperatedDecoder(nn.Module): observation_dim: int latent_action_dim: int action_dim: int arch: str = '256-256' orthogonal_init: bool = False # batch_norm: bool = True @nn.compact @multiple_action_decode_function def __call__(self, observations, latent_actions): x = observations hidden_sizes = [int(h) for h in self.arch.split('-')] for h in hidden_sizes: if self.orthogonal_init: x = nn.Dense( h, kernel_init=jax.nn.initializers.orthogonal(jnp.sqrt(2.0)), bias_init=jax.nn.initializers.zeros )(jnp.concatenate([x, latent_actions], axis=-1)) else: x = nn.Dense(h)(jnp.concatenate([x, latent_actions], axis=-1)) # if self.batch_norm: # x = nn.BatchNorm(use_running_average=not train_mode, momentum=0.9, # epsilon=1e-5, # dtype=jnp.float32)(x) x = nn.relu(x) if self.orthogonal_init: x = nn.Dense( self.action_dim, kernel_init=jax.nn.initializers.orthogonal(1e-2), bias_init=jax.nn.initializers.zeros )(jnp.concatenate([x, latent_actions], axis=-1)) else: x = nn.Dense( self.action_dim, kernel_init=jax.nn.initializers.variance_scaling( 1e-2, 'fan_in', 'uniform' ), bias_init=jax.nn.initializers.zeros )(jnp.concatenate([x, latent_actions], axis=-1)) output = nn.tanh(x) return output class Discriminator(nn.Module): observation_dim: int latent_action_dim: int arch: str = '512-256' dropout: bool = True @nn.compact def __call__(self, observations, latent_actions, train=False): x = jnp.concatenate([observations, latent_actions], axis=-1) hidden_sizes = [int(h) for h in self.arch.split('-')] for h in hidden_sizes: x = nn.Dense(h)(x) # dropout # layer norm x = nn.leaky_relu(x, 0.2) if self.dropout: x = nn.Dropout(0.1)(x, deterministic=not train) output = nn.Dense(1)(x) return output class SamplerPolicy(object): def __init__(self, policy, params): self.policy = policy self.params = params def update_params(self, params): self.params = params return self @partial(jax.jit, static_argnames=('self', 'deterministic')) def act(self, params, rng, observations, deterministic): return self.policy.apply(params, rng, observations, deterministic, repeat=None) def __call__(self, observations, deterministic=False): actions, _ = self.act(self.params, next_rng(), observations, deterministic=deterministic) assert jnp.all(jnp.isfinite(actions)) return jax.device_get(actions) class SamplerDecoder(object): def __init__(self, decoder, params): self.decoder = decoder self.params = params def update_params(self, params): self.params = params return self @partial(jax.jit, static_argnames=('self')) def act(self, params, observations, actions_rep): return self.decoder.apply(params, observations, actions_rep) def __call__(self, observations, actions_rep): actions = self.act(self.params, observations, actions_rep) assert jnp.all(jnp.isfinite(actions)) return jax.device_get(actions) class SamplerEncoder(object): def __init__(self, encoder, params): self.encoder = encoder self.params = params def update_params(self, params): self.params = params return self @partial(jax.jit, static_argnames=('self')) def act(self, params, rng, observations, actions): return self.encoder.apply(params, rng, observations, actions)[0] def __call__(self, rng, observations, actions): actions = self.act(self.params, rng, observations, actions) assert jnp.all(jnp.isfinite(actions)) return jax.device_get(actions)
37.958599
131
0.615068
20,127
0.844324
0
0
10,212
0.428392
0
0
1,820
0.076349
d7051e18592cfcaabdc61f04c12bac4c5a8c6910
423
py
Python
prophet-gpl/tools/return_counter.py
jyi/ITSP
0553f683f99403efb5ef440af826c1d229a52376
[ "MIT" ]
18
2017-06-14T07:55:45.000Z
2022-03-24T09:32:43.000Z
prophet-gpl/tools/return_counter.py
jyi/ITSP
0553f683f99403efb5ef440af826c1d229a52376
[ "MIT" ]
2
2017-07-25T13:44:39.000Z
2018-03-16T06:43:40.000Z
prophet-gpl/tools/return_counter.py
jyi/ITSP
0553f683f99403efb5ef440af826c1d229a52376
[ "MIT" ]
5
2017-07-29T19:09:37.000Z
2021-04-10T16:39:48.000Z
#!/usr/bin/env python f = open("repair.log", "r"); lines = f.readlines(); cnt = 0; for line in lines: tokens = line.strip().split(); if (len(tokens) > 3): if (tokens[0] == "Total") and (tokens[1] == "return"): cnt += int(tokens[3]); if (tokens[0] == "Total") and (tokens[2] == "different") and (tokens[3] == "repair"): cnt += int(tokens[1]); print "Total size: " + str(cnt);
32.538462
93
0.520095
0
0
0
0
0
0
0
0
91
0.21513
d705f14bd1a2d796545981606b203d6d8aee15de
4,968
py
Python
pytorch_toolkit/instance_segmentation/segmentoly/rcnn/openvino_net.py
morkovka1337/openvino_training_extensions
846db45c264d6b061505213f51763520b9432ba9
[ "Apache-2.0" ]
3
2020-12-29T02:47:32.000Z
2021-11-12T08:12:51.000Z
pytorch_toolkit/instance_segmentation/segmentoly/rcnn/openvino_net.py
morkovka1337/openvino_training_extensions
846db45c264d6b061505213f51763520b9432ba9
[ "Apache-2.0" ]
28
2020-09-25T22:40:36.000Z
2022-03-12T00:37:36.000Z
pytorch_toolkit/instance_segmentation/segmentoly/rcnn/openvino_net.py
morkovka1337/openvino_training_extensions
846db45c264d6b061505213f51763520b9432ba9
[ "Apache-2.0" ]
1
2021-04-02T07:51:01.000Z
2021-04-02T07:51:01.000Z
""" 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. """ import logging import numpy as np from ..utils.blob import to_numpy from ..utils.profile import PerformanceCounters class OpenVINONet(object): def __init__(self, xml_file_path, bin_file_path, device='CPU', plugin_dir=None, cpu_extension_lib_path=None, collect_perf_counters=False): from openvino.inference_engine import IENetwork, IEPlugin logging.info('Creating {} plugin...'.format(device)) self.plugin = IEPlugin(device=device, plugin_dirs=plugin_dir) if cpu_extension_lib_path and 'CPU' in device: logging.info('Adding CPU extensions...') self.plugin.add_cpu_extension(cpu_extension_lib_path) # Read IR logging.info('Reading network from IR...') self.net = IENetwork(model=xml_file_path, weights=bin_file_path) if self.plugin.device == 'CPU': logging.info('Check that all layers are supported...') supported_layers = self.plugin.get_supported_layers(self.net) not_supported_layers = [l for l in self.net.layers.keys() if l not in supported_layers] if len(not_supported_layers) != 0: unsupported_info = '\n\t'.join('{} ({} with params {})'.format(layer_id, self.net.layers[layer_id].type, str(self.net.layers[layer_id].params)) for layer_id in not_supported_layers) logging.warning('Following layers are not supported ' 'by the plugin for specified device {}:' '\n\t{}'.format(self.plugin.device, unsupported_info)) logging.warning('Please try to specify cpu extensions library path.') raise ValueError('Some of the layers are not supported.') logging.info('Loading network to plugin...') self.exec_net = self.plugin.load(network=self.net, num_requests=1) self.perf_counters = None if collect_perf_counters: self.perf_counters = PerformanceCounters() def __call__(self, inputs): outputs = self.exec_net.infer(inputs) if self.perf_counters: perf_counters = self.exec_net.requests[0].get_perf_counts() self.perf_counters.update(perf_counters) return outputs def print_performance_counters(self): if self.perf_counters: self.perf_counters.print() def __del__(self): del self.net del self.exec_net del self.plugin class MaskRCNNOpenVINO(OpenVINONet): def __init__(self, *args, **kwargs): super(MaskRCNNOpenVINO, self).__init__(*args, **kwargs) required_input_keys = {'im_data', 'im_info'} assert required_input_keys == set(self.net.inputs.keys()) required_output_keys = {'boxes', 'scores', 'classes', 'raw_masks'} assert required_output_keys.issubset(self.net.outputs.keys()) self.n, self.c, self.h, self.w = self.net.inputs['im_data'].shape assert self.n == 1, 'Only batch 1 is supported.' def __call__(self, im_data, im_info, **kwargs): im_data = to_numpy(im_data[0]) im_info = to_numpy(im_info[0]) if (self.h - im_data.shape[1] < 0) or (self.w - im_data.shape[2] < 0): raise ValueError('Input image should resolution of {}x{} or less, ' 'got {}x{}.'.format(self.w, self.h, im_data.shape[2], im_data.shape[1])) im_data = np.pad(im_data, ((0, 0), (0, self.h - im_data.shape[1]), (0, self.w - im_data.shape[2])), mode='constant', constant_values=0).reshape(1, self.c, self.h, self.w) im_info = im_info.reshape(1, *im_info.shape) output = super().__call__(dict(im_data=im_data, im_info=im_info)) classes = output['classes'] valid_detections_mask = classes > 0 classes = classes[valid_detections_mask] boxes = output['boxes'][valid_detections_mask] scores = output['scores'][valid_detections_mask] masks = output['raw_masks'][valid_detections_mask] return boxes, classes, scores, np.full(len(classes), 0, dtype=np.int32), masks
44.357143
117
0.618357
4,262
0.85789
0
0
0
0
0
0
1,154
0.232287
d707022831c9689c8fc33323a8b72036d852d9e5
96
py
Python
scuole/cohorts/apps.py
texastribune/scuole
8ab316ee50ef0d8e71b94b50dc889d10c6e83412
[ "MIT" ]
1
2019-03-12T04:30:02.000Z
2019-03-12T04:30:02.000Z
scuole/cohorts/apps.py
texastribune/scuole
8ab316ee50ef0d8e71b94b50dc889d10c6e83412
[ "MIT" ]
616
2017-08-18T21:15:39.000Z
2022-03-25T11:17:10.000Z
scuole/cohorts/apps.py
texastribune/scuole
8ab316ee50ef0d8e71b94b50dc889d10c6e83412
[ "MIT" ]
null
null
null
from django.apps import AppConfig class CohortsConfig(AppConfig): name = 'scuole.cohorts'
16
33
0.760417
59
0.614583
0
0
0
0
0
0
16
0.166667
d7075ae50fe80531ab2a8eb41c4eb490a0897696
297
py
Python
conftest.py
gousteris/git-diff-conditional-buildkite-plugin
517442ca9ebe21021e1078debf88c231ba8e8dff
[ "MIT" ]
19
2020-03-27T11:53:11.000Z
2021-04-14T23:11:27.000Z
conftest.py
segmentio/git-diff-conditional-buildkite-plugin
62a276000149da0bbf4e152634211c75966a8558
[ "MIT" ]
7
2020-03-27T11:59:51.000Z
2021-08-06T14:01:42.000Z
conftest.py
segmentio/git-diff-conditional-buildkite-plugin
62a276000149da0bbf4e152634211c75966a8558
[ "MIT" ]
6
2020-03-28T20:49:49.000Z
2022-01-19T17:48:02.000Z
"""Place fixtures in this file for use across all test files""" import pytest @pytest.fixture(scope="function") def logger(caplog): caplog.set_level("DEBUG") return caplog @pytest.fixture def log_and_exit_mock(mocker): return mocker.patch("scripts.generate_pipeline.log_and_exit")
21.214286
65
0.754209
0
0
0
0
213
0.717172
0
0
120
0.40404
d709950f1405568464eefb85068efdc744532b55
3,763
py
Python
subthalamic.py
ModelDBRepository/256624
9b9b0ca38baa34f8e34e822ffd366f56f5cfd979
[ "MIT" ]
null
null
null
subthalamic.py
ModelDBRepository/256624
9b9b0ca38baa34f8e34e822ffd366f56f5cfd979
[ "MIT" ]
null
null
null
subthalamic.py
ModelDBRepository/256624
9b9b0ca38baa34f8e34e822ffd366f56f5cfd979
[ "MIT" ]
null
null
null
import numpy as np import moch import soch import os import sys import scipy.io import thorns def main(parseID): parseIn = parseID + 'In.mat' parseOut = parseID + 'Out.mat' parse = scipy.io.loadmat(parseIn) os.remove(parseIn) lagSpace = 1. * parse['lagSpace'] / 1000 parsStruct = parse['pars'][0, 0] # Parametres est = {'duration' : 1. * parsStruct['est'][0,0]['dur'][0][0] / 1000, 'loudness' : 1. * parsStruct['est'][0,0]['loud'][0][0], 'intv' : 1. * parsStruct['est'][0,0]['interval'][0] / 1000, 'onset' : 1. * parsStruct['est'][0,0]['onset' ][0][0] / 1000, 'tail' : 1. * parsStruct['est'][0,0]['tail'][0][0] / 1000, 'maskN' : parsStruct['est'][0,0]['maskNoise'][0][0], 'filename' : parsStruct['est'][0,0]['filename'][0], 'bandpass' : parsStruct['est'][0,0]['bandpass'][0], 'save' : parsStruct['est'][0,0]['save'][0] } if est['filename'] == -1: est['type'] = parsStruct['est'][0,0]['type'][0] est['freq'] = parsStruct['est'][0,0]['f'][0][0] est['harms'] = parsStruct['est'][0,0]['harms'][0] est['harmFact'] = parsStruct['est'][0,0]['harmFact'][0][0] est['shift'] = parsStruct['est'][0,0]['shift'][0][0] est['nOfIts'] = parsStruct['est'][0,0]['nOfIts'][0][0] est['notes'] = parsStruct['est'][0,0]['notes'][0] est['tuning'] = parsStruct['est'][0,0]['tuning'][0] est['noiseOff'] = 1. * parsStruct['est'][0,0]['noiseOff'][0][0] / 1000 else: est['type'] = 'external' par = {'periphFs' : 100000, 'cochChanns' : (125, 10000, 30), 'SACFTau' : 1. * parsStruct['tauSACF'][0,0] / 1000, 'subCortTau' : 1. * parsStruct['tauSubthal'][0,0] / 1000, 'solvOnset' : 1. * parsStruct['solvOnset'][0] / 1000, 'subCortFs' : 100000, 'subCortAff' : parsStruct['subCortAff'][0,0], 'regularise' : parsStruct['regularise'][0,0], 'mu0' : parsStruct['mu0'][0,0], 'SACFGround' : parsStruct['SACFGround'][0,0], 'cortFs' : parsStruct['cortFs'][0,0], 'subDelay' : 1. * parsStruct['subDelay'][0,0] / 1000, 'subDelayDy' : 1. * parsStruct['subDelayDy'][0,0] / 1000, } if ('chord' in est['type']) and (est['notes'][0] != est['notes'][1]): est['onset'] += par['subDelayDy'] par['mu0'] = 2 * par['mu0'] else: est['onset'] += par['subDelay'] [A, n, b] = thalamicInput(lagSpace, par, est) duration = 1.* len(A) / par['cortFs'] dti = 1./par['cortFs'] timeSpace = np.arange(start = dti, stop = duration + dti, step = dti) if 'off' in est.keys(): timeSpace = timeSpace - est['off'] scipy.io.savemat(parseOut, {'A':A, 'n':n, 'b':b, 'timeSpace': timeSpace}) def thalamicInput(lagSpace, par, est, raster = False): fs = par['periphFs'] # Subcortical processing sound = soch.createStimulus(est, par['periphFs']) prob = moch.peripheral(sound, par) [A, n, b] = moch.subcortical(prob, lagSpace, par) for i in range(1, par['subCortAff']): sound = soch.createStimulus(est, par['periphFs']) prob = moch.peripheral(sound, par) [A0, n0, b0] = moch.subcortical(prob, lagSpace, par) A = A + A0 n = n + n0 b = b + b0 A = (1. / par['subCortAff']) * A n = (1. / par['subCortAff']) * n b = (1. / par['subCortAff']) * b if raster: anfTrains = moch.peripheralSpikes(sound, par, fs = -1) thorns.plot_raster(anfTrains) thorns.show() return [A, n, b] main(sys.argv[1])
32.162393
78
0.513952
0
0
0
0
0
0
0
0
900
0.239171
d70aa5b75b6b2e9f5fff4f2b801da5ec7145cca9
8,911
py
Python
env/lib/python3.5/site-packages/cartopy/tests/test_img_tiles.py
project-pantheon/pantheon_glob_planner
c0d50a53b36c4678192ec75ad7a4cd68c570daef
[ "BSD-3-Clause" ]
null
null
null
env/lib/python3.5/site-packages/cartopy/tests/test_img_tiles.py
project-pantheon/pantheon_glob_planner
c0d50a53b36c4678192ec75ad7a4cd68c570daef
[ "BSD-3-Clause" ]
null
null
null
env/lib/python3.5/site-packages/cartopy/tests/test_img_tiles.py
project-pantheon/pantheon_glob_planner
c0d50a53b36c4678192ec75ad7a4cd68c570daef
[ "BSD-3-Clause" ]
null
null
null
# (C) British Crown Copyright 2011 - 2018, Met Office # # This file is part of cartopy. # # cartopy is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # cartopy is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with cartopy. If not, see <https://www.gnu.org/licenses/>. from __future__ import (absolute_import, division, print_function) import types import numpy as np from numpy.testing import assert_array_almost_equal as assert_arr_almost import pytest import shapely.geometry as sgeom import cartopy.crs as ccrs import cartopy.io.img_tiles as cimgt #: Maps Google tile coordinates to native mercator coordinates as defined #: by https://goo.gl/pgJi. KNOWN_EXTENTS = {(0, 0, 0): (-20037508.342789244, 20037508.342789244, -20037508.342789244, 20037508.342789244), (2, 0, 2): (0., 10018754.17139462, 10018754.17139462, 20037508.342789244), (0, 2, 2): (-20037508.342789244, -10018754.171394622, -10018754.171394622, 0), (2, 2, 2): (0, 10018754.17139462, -10018754.171394622, 0), (8, 9, 4): (0, 2504688.542848654, -5009377.085697312, -2504688.542848654), } if ccrs.PROJ4_VERSION == (5, 0, 0): KNOWN_EXTENTS = { (0, 0, 0): (-20037508.342789244, 20037508.342789244, -19994827.892149, 19994827.892149), (2, 0, 2): (0, 10018754.171395, 9997413.946075, 19994827.892149), (0, 2, 2): (-20037508.342789244, -10018754.171394622, -9997413.946075, 0), (2, 2, 2): (0, 10018754.171395, -9997413.946075, 0), (8, 9, 4): (0, 2504688.542849, -4998706.973037, -2499353.486519), } def GOOGLE_IMAGE_URL_REPLACEMENT(self, tile): url = ('https://chart.googleapis.com/chart?chst=d_text_outline&' 'chs=256x256&chf=bg,s,00000055&chld=FFFFFF|16|h|000000|b||||' 'Google:%20%20(' + str(tile[0]) + ',' + str(tile[1]) + ')' '|Zoom%20' + str(tile[2]) + '||||||______________________' '______') return url def test_google_tile_styles(): """ Tests that setting the Google Maps tile style works as expected. This is essentially just assures information is properly propagated through the class structure. """ reference_url = ("https://mts0.google.com/vt/lyrs={style}@177000000&hl=en" "&src=api&x=1&y=2&z=3&s=G") tile = ["1", "2", "3"] # Default is street. gt = cimgt.GoogleTiles() url = gt._image_url(tile) assert reference_url.format(style="m") == url # Street gt = cimgt.GoogleTiles(style="street") url = gt._image_url(tile) assert reference_url.format(style="m") == url # Satellite gt = cimgt.GoogleTiles(style="satellite") url = gt._image_url(tile) assert reference_url.format(style="s") == url # Terrain gt = cimgt.GoogleTiles(style="terrain") url = gt._image_url(tile) assert reference_url.format(style="t") == url # Streets only gt = cimgt.GoogleTiles(style="only_streets") url = gt._image_url(tile) assert reference_url.format(style="h") == url # Exception is raised if unknown style is passed. with pytest.raises(ValueError): cimgt.GoogleTiles(style="random_style") def test_google_wts(): gt = cimgt.GoogleTiles() ll_target_domain = sgeom.box(-15, 50, 0, 60) multi_poly = gt.crs.project_geometry(ll_target_domain, ccrs.PlateCarree()) target_domain = multi_poly.geoms[0] with pytest.raises(AssertionError): list(gt.find_images(target_domain, -1)) assert (tuple(gt.find_images(target_domain, 0)) == ((0, 0, 0),)) assert (tuple(gt.find_images(target_domain, 2)) == ((1, 1, 2), (2, 1, 2))) assert (list(gt.subtiles((0, 0, 0))) == [(0, 0, 1), (0, 1, 1), (1, 0, 1), (1, 1, 1)]) assert (list(gt.subtiles((1, 0, 1))) == [(2, 0, 2), (2, 1, 2), (3, 0, 2), (3, 1, 2)]) with pytest.raises(AssertionError): gt.tileextent((0, 1, 0)) assert_arr_almost(gt.tileextent((0, 0, 0)), KNOWN_EXTENTS[(0, 0, 0)]) assert_arr_almost(gt.tileextent((2, 0, 2)), KNOWN_EXTENTS[(2, 0, 2)]) assert_arr_almost(gt.tileextent((0, 2, 2)), KNOWN_EXTENTS[(0, 2, 2)]) assert_arr_almost(gt.tileextent((2, 2, 2)), KNOWN_EXTENTS[(2, 2, 2)]) assert_arr_almost(gt.tileextent((8, 9, 4)), KNOWN_EXTENTS[(8, 9, 4)]) def test_tile_bbox_y0_at_south_pole(): tms = cimgt.MapQuestOpenAerial() # Check the y0_at_north_pole keywords returns the appropriate bounds. assert_arr_almost(tms.tile_bbox(8, 6, 4, y0_at_north_pole=False), np.array(KNOWN_EXTENTS[(8, 9, 4)]).reshape([2, 2])) def test_tile_find_images(): gt = cimgt.GoogleTiles() # Test the find_images method on a GoogleTiles instance. ll_target_domain = sgeom.box(-10, 50, 10, 60) multi_poly = gt.crs.project_geometry(ll_target_domain, ccrs.PlateCarree()) target_domain = multi_poly.geoms[0] assert (list(gt.find_images(target_domain, 4)) == [(7, 4, 4), (7, 5, 4), (8, 4, 4), (8, 5, 4)]) @pytest.mark.network def test_image_for_domain(): gt = cimgt.GoogleTiles() gt._image_url = types.MethodType(GOOGLE_IMAGE_URL_REPLACEMENT, gt) ll_target_domain = sgeom.box(-10, 50, 10, 60) multi_poly = gt.crs.project_geometry(ll_target_domain, ccrs.PlateCarree()) target_domain = multi_poly.geoms[0] _, extent, _ = gt.image_for_domain(target_domain, 6) ll_extent = ccrs.Geodetic().transform_points(gt.crs, np.array(extent[:2]), np.array(extent[2:])) if ccrs.PROJ4_VERSION == (5, 0, 0): assert_arr_almost(ll_extent[:, :2], [[-11.25, 49.033955], [11.25, 61.687101]]) else: assert_arr_almost(ll_extent[:, :2], [[-11.25, 48.92249926], [11.25, 61.60639637]]) def test_quadtree_wts(): qt = cimgt.QuadtreeTiles() ll_target_domain = sgeom.box(-15, 50, 0, 60) multi_poly = qt.crs.project_geometry(ll_target_domain, ccrs.PlateCarree()) target_domain = multi_poly.geoms[0] with pytest.raises(ValueError): list(qt.find_images(target_domain, 0)) assert qt.tms_to_quadkey((1, 1, 1)) == '1' assert qt.quadkey_to_tms('1') == (1, 1, 1) assert qt.tms_to_quadkey((8, 9, 4)) == '1220' assert qt.quadkey_to_tms('1220') == (8, 9, 4) assert tuple(qt.find_images(target_domain, 1)) == ('0', '1') assert tuple(qt.find_images(target_domain, 2)) == ('03', '12') assert list(qt.subtiles('0')) == ['00', '01', '02', '03'] assert list(qt.subtiles('11')) == ['110', '111', '112', '113'] with pytest.raises(ValueError): qt.tileextent('4') assert_arr_almost(qt.tileextent(''), KNOWN_EXTENTS[(0, 0, 0)]) assert_arr_almost(qt.tileextent(qt.tms_to_quadkey((2, 0, 2), google=True)), KNOWN_EXTENTS[(2, 0, 2)]) assert_arr_almost(qt.tileextent(qt.tms_to_quadkey((0, 2, 2), google=True)), KNOWN_EXTENTS[(0, 2, 2)]) assert_arr_almost(qt.tileextent(qt.tms_to_quadkey((2, 0, 2), google=True)), KNOWN_EXTENTS[(2, 0, 2)]) assert_arr_almost(qt.tileextent(qt.tms_to_quadkey((2, 2, 2), google=True)), KNOWN_EXTENTS[(2, 2, 2)]) assert_arr_almost(qt.tileextent(qt.tms_to_quadkey((8, 9, 4), google=True)), KNOWN_EXTENTS[(8, 9, 4)]) def test_mapbox_tiles_api_url(): token = 'foo' map_name = 'bar' tile = [0, 1, 2] exp_url = ('https://api.mapbox.com/v4/mapbox.bar' '/2/0/1.png?access_token=foo') mapbox_sample = cimgt.MapboxTiles(token, map_name) url_str = mapbox_sample._image_url(tile) assert url_str == exp_url def test_mapbox_style_tiles_api_url(): token = 'foo' username = 'baz' map_id = 'bar' tile = [0, 1, 2] exp_url = ('https://api.mapbox.com/styles/v1/' 'baz/bar/tiles/256/2/0/1' '?access_token=foo') mapbox_sample = cimgt.MapboxStyleTiles(token, username, map_id) url_str = mapbox_sample._image_url(tile) assert url_str == exp_url
36.670782
79
0.606778
0
0
0
0
911
0.102233
0
0
1,838
0.206262
d70ba27847eddad0f8d65da93714b0825a9609bc
8,310
py
Python
utils/process_data.py
JiatianWu/tf-monodepth2
8f8ade9ac1268ec2c80db41386df47d26074eaf8
[ "MIT" ]
null
null
null
utils/process_data.py
JiatianWu/tf-monodepth2
8f8ade9ac1268ec2c80db41386df47d26074eaf8
[ "MIT" ]
null
null
null
utils/process_data.py
JiatianWu/tf-monodepth2
8f8ade9ac1268ec2c80db41386df47d26074eaf8
[ "MIT" ]
null
null
null
import os import pdb import h5py import pickle import numpy as np from scipy.io import loadmat import cv2 import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from PIL import Image from PIL import ImageFont from PIL import ImageDraw import csv import bisect import matplotlib as mpl import matplotlib.cm as cm import tensorflow as tf # from bilateral_filter import bilateral_filter from tools import * def resave_imu_data(): dataset = '/freezer/nyudepthV2_raw' seqs = os.listdir(dataset) for seq in seqs: seq_dir = dataset + '/' + seq for data in os.listdir(seq_dir): if data[0] == 'a': imu_data_path = seq_dir + '/' + data resave_imu_data_path = seq_dir + '/' + data[:-4] + '.txt' call_resave_imu(imu_data_path, resave_imu_data_path) def call_resave_imu(orig_path, resave_path): command = './resave_imu ' + orig_path + ' ' + resave_path os.system(command) def collect_acc_data(folder): data_list = [] for file in os.listdir(folder): if file[0] == 'a' and file[-1] == 't': data_list.append(folder + '/' + file) return sorted(data_list) def get_acc_timestamp(path): return float(path.split('-')[1]) def read_acc_data(file_path): timestamp = get_acc_timestamp(file_path) file = open(file_path, 'r') data = file.read().split(',') for i in range(len(data)): data[i] = float(data[i]) data.insert(0, timestamp) return data def plot_acc_data(folder): acc_path = collect_acc_data(folder) x = [] y = [] z = [] for path in acc_path: data = read_acc_data(path) x.append(data[1]) y.append(data[2]) z.append(data[3]) plt.plot(x) plt.plot(y) plt.plot(z) plt.show() def compute_acc_vel_pos(acc_data_1, acc_data_2, v_1, p_1): t1 = acc_data_1[0] t2 = acc_data_2[0] t_delta = t2 - t1 acc_xyz_1 = np.array(acc_data_1[1:4]) acc_xyz_2 = np.array(acc_data_2[1:4]) a_avg = (acc_xyz_1 + acc_xyz_2) / 2. v_2 = v_1 + a_avg * t_delta p_2 = p_1 + v_1 * t_delta + a_avg * t_delta * t_delta / 2. # pdb.set_trace() return v_2, p_2 def plot_imu_traj(folder): acc_path = collect_acc_data(folder) p_x = [] p_y = [] p_z = [] v_cur = np.array([0., 0., 0.]) p_cur = np.array([0., 0., 0.]) N = len(acc_path) for idx in range(N-1): p_x.append(p_cur[0]) p_y.append(p_cur[1]) p_z.append(p_cur[2]) acc_1 = read_acc_data(acc_path[idx]) acc_2 = read_acc_data(acc_path[idx + 1]) v_cur, p_cur = compute_acc_vel_pos(acc_1, acc_2, v_cur, p_cur) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') #ax.scatter(p_x[:], p_y[:], p_z[:0]) ax.plot(p_x[:-1], p_y[:-1], p_z[:-1]) ax.set_xlabel('X Label') ax.set_ylabel('Y Label') ax.set_zlabel('Z Label') plt.show() # plt.plot(p_x) # plt.plot(p_y) # plt.plot(p_z) # plt.show() def plot_trajectory(data_file_name): data = open(data_file_name,"rb") poses_log = pickle.load(data) poses_mat_log = [] import torch for i in range(len(poses_log.keys())): pose = poses_log[i] pose = np.expand_dims(pose, axis=0) pose = np.expand_dims(pose, axis=0) pose_mat = transformation_from_parameters(torch.tensor(pose[:, :, :3]).float(), torch.tensor(pose[:, :, 3:]).float(), False) poses_mat_log.append(pose_mat.numpy()) xyzs = np.array(dump_xyz(poses_mat_log)) xs = [] ys = [] zs = [] for i in range(xyzs.shape[0]): xs.append(xyzs[i][0]) ys.append(xyzs[i][1]) zs.append(xyzs[i][2]) plt.plot(xs, ys) plt.savefig( '/home/jiatian/dataset/rs_eval/pose/' + str(i).zfill(6) + '.jpg') def delete_folder(folder, num): dirlist = sorted(os.listdir(folder)) num_total = len(dirlist) for idx in range(num): datapath = folder + '/' + dirlist[idx] os.remove(datapath) for idx in range(num_total - num, num_total): datapath = folder + '/' + dirlist[idx] os.remove(datapath) def vis_rgb_pose_image(folder_1, folder_2): dirlist_1 = sorted(os.listdir(folder_1)) dirlist_2 = sorted(os.listdir(folder_2)) for idx in range(len(dirlist_1)): data_1 = Image.open(folder_1 + '/' + dirlist_1[idx]).convert('RGB') data_2 = Image.open(folder_2 + '/' + dirlist_2[idx]).convert('RGB') image_show = np.hstack((np.array(data_1), np.array(data_2))) img = Image.fromarray(image_show) img.save('/home/jiatian/dataset/rs_eval/comp/' + dirlist_2[idx]) def read_csv(path, folder): dict_gt = {} ts = [] with open(path, mode='r') as csv_file: csv_reader = csv.DictReader(csv_file) line_count = 0 for row in csv_reader: if line_count == 0: print(f'Column names are {", ".join(row)}') line_count += 1 line_count += 1 dict_gt[row['#timestamp']] = row ts.append(row['#timestamp']) print(f'Processed {line_count} lines.') dict_img = {} dirlist = sorted(os.listdir(folder)) match = 0 unmatch = 0 ts_valid = [] for img_path in dirlist: key = img_path[:-4] ts_valid.append(key) try: print(dict_gt[key]) match += 1 dict_img[key] = dict_gt[key] except: unmatch += 1 idx = bisect.bisect_left(ts, key) if idx == len(ts): idx -= 1 dict_img[key] = dict_gt[ts[idx]] print('ERROR', key) print('UNMATCH', unmatch) # plot_xyz(ts_valid, dict_img) calAxisAngle(ts_valid, dict_img) def calAxisAngle(ts_valid, dict_img): nums = len(ts_valid) dict_pose = {} for i in range(nums-2): ts_cur = ts_valid[i] ts_next = ts_valid[i+2] data_cur = dict_img[ts_cur] data_next = dict_img[ts_next] diff_tx = float(data_next[' p_RS_R_x [m]']) - float(data_cur[' p_RS_R_x [m]']) diff_ty = float(data_next[' p_RS_R_y [m]']) - float(data_cur[' p_RS_R_y [m]']) diff_tz = float(data_next[' p_RS_R_z [m]']) - float(data_cur[' p_RS_R_z [m]']) diff_qw = float(data_next[' q_RS_w []']) - float(data_cur[' q_RS_w []']) diff_qx = float(data_next[' q_RS_x []']) - float(data_cur[' q_RS_x []']) diff_qy = float(data_next[' q_RS_y []']) - float(data_cur[' q_RS_y []']) diff_qz = float(data_next[' q_RS_z []']) - float(data_cur[' q_RS_z []']) diff_norm = np.linalg.norm([diff_qw, diff_qx, diff_qy, diff_qz]) diff_qw = diff_qw / (diff_norm + 1e-7) diff_qx = diff_qx / (diff_norm + 1e-7) diff_qy = diff_qy / (diff_norm + 1e-7) diff_qz = diff_qz / (diff_norm + 1e-7) angle = 2 * np.arccos(diff_qw) rx = diff_qx * angle / np.sqrt(1 - diff_qw * diff_qw) ry = diff_qy * angle / np.sqrt(1 - diff_qw * diff_qw) rz = diff_qz * angle / np.sqrt(1 - diff_qw * diff_qw) dict_pose[ts_cur] = [rx, ry, rz, diff_tx, diff_ty, diff_tz] dict_file_name = '/home/jiatian/dataset/euroc/V1_01_easy/mav0/cam0_pose.pkl' f = open(dict_file_name, "wb") pickle.dump(dict_pose, f) f.close() def plot_xyz(ts, dict): xs = [] ys = [] zs = [] nums = len(ts) for i in range(nums): time = ts[i] xs.append(float(dict[time][' p_RS_R_x [m]'])) ys.append(float(dict[time][' p_RS_R_y [m]'])) zs.append(float(dict[time][' p_RS_R_z [m]'])) # ' q_RS_w []' ' q_RS_x []' ' q_RS_y []' ' q_RS_z []' plt.plot(xs, ys) plt.savefig( '/home/jiatian/dataset/euroc/V1_01_easy/mav0/cam0/traj' + str(i).zfill(6) + '.jpg') if __name__ == "__main__": read_csv('/home/jiatian/dataset/euroc/V1_01_easy/mav0/state_groundtruth_estimate0/data.csv', '/home/jiatian/dataset/euroc/V1_01_easy/mav0/cam0/data') # vis_rgb_pose_image('/home/jiatian/dataset/recordvi/402-000-undistort', '/home/jiatian/dataset/rs_eval/pose') # plot_trajectory('/home/jiatian/dataset/rs_eval/pose/poses_log.pickle') # delete_folder('/home/jiatian/dataset/realsense/recordvi-4-02-00/402-004-undistort', 300)
31.123596
153
0.59651
0
0
0
0
0
0
0
0
1,341
0.161372
d70bfa071ce979b042b3019dc6f0957d42a9409f
808
py
Python
src/genome/visibles/sphere_gene.py
stu-smith/blender-evolution
644b92d4dc30e82708b2e78da4f274c9ab142704
[ "MIT" ]
null
null
null
src/genome/visibles/sphere_gene.py
stu-smith/blender-evolution
644b92d4dc30e82708b2e78da4f274c9ab142704
[ "MIT" ]
null
null
null
src/genome/visibles/sphere_gene.py
stu-smith/blender-evolution
644b92d4dc30e82708b2e78da4f274c9ab142704
[ "MIT" ]
null
null
null
from ..gene import Gene from ..scalar_gene_property import ScalarGeneProperty from ..color_gene_property import ColorGeneProperty from ...visible_objects.sphere import Sphere class SphereGene(Gene): def __init__(self): self._size_property = ScalarGeneProperty(min=0.1, max=20, value=2) self._color_property = ColorGeneProperty(hsv=[0.0, 0.0, 1.0]) def all_properties(self): return [ self._size_property, self._color_property ] def express(self, genome_expression): location = [0, 0, 0] # TODO genome_expression stack position size = self._size_property.value hsv = self._color_property.value sphere = Sphere(location=location, size=size, hsv=hsv) genome_expression.add_visible_object(sphere)
29.925926
74
0.689356
629
0.778465
0
0
0
0
0
0
39
0.048267
d70e4ccae007401a0990ed92fad1c07898cb2c3c
4,092
py
Python
thrift/test/testset/generator.py
danobi/fbthrift
46cb6c481e34a6569929314cff432333689f3a5b
[ "Apache-2.0" ]
null
null
null
thrift/test/testset/generator.py
danobi/fbthrift
46cb6c481e34a6569929314cff432333689f3a5b
[ "Apache-2.0" ]
null
null
null
thrift/test/testset/generator.py
danobi/fbthrift
46cb6c481e34a6569929314cff432333689f3a5b
[ "Apache-2.0" ]
null
null
null
# Copyright (c) Facebook, Inc. and its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import argparse import doctest import os from subprocess import check_output from typing import Dict, List, TextIO THRIFT_HEADER = """ # This file is generated by `fbcode/thrift/test/testset:generator` # {'@' + 'generated'} namespace cpp2 apache.thrift.test.testset """ FIELD_COUNT = 2 # Number of fields per structs def format_dict( d: Dict[str, str], key_format: str, value_format: str ) -> Dict[str, str]: """Format key/value of dict >>> result = format_dict({"foo_k": "foo_v", "bar_k": "bar_v"}, 'prefix_{}', "{}_suffix") >>> result == {'prefix_foo_k': 'foo_v_suffix', 'prefix_bar_k': 'bar_v_suffix'} True """ return {key_format.format(k): value_format.format(d[k]) for k in d} PRIMITIVE_TYPES = [ "bool", "byte", "i16", "i32", "i64", "float", "double", "binary", "string", ] def generate_union_names_to_types() -> Dict[str, str]: """ Generate display name to thrift type mapping in union. Display name will be used in file name, rule name, etc """ ret = {t: t for t in PRIMITIVE_TYPES} ret.update(format_dict(ret, "set_{}", "set<{}>")) ret.update(format_dict(ret, "map_string_{}", "map<string, {}>")) ret.update(format_dict(ret, "{}_cpp_ref", "{} (cpp.ref = 'true')")) return ret def generate_struct_names_to_types() -> Dict[str, str]: """ Similar to thrift types in union. Difference is that unions cannot contain qualified fields. """ ret = generate_union_names_to_types() ret.update( **format_dict(ret, "optional_{}", "optional {}"), **format_dict(ret, "required_{}", "required {}"), ) return ret def generate_class(class_type: str, name: str, types: List[str]) -> str: """Generate thrift struct from types >>> print(generate_class("struct", "Foo", ["i64", "optional string", "set<i32> (cpp.ref = 'true')"])) struct Foo { 1: i64 field_1; 2: optional string field_2; 3: set<i32> (cpp.ref = 'true') field_3; } """ lines = [f"{class_type} {name} {{"] for i, t in enumerate(types): lines.append(" {0}: {1} field_{0};".format(i + 1, t)) lines.append(f'}} (any_type.name="facebook.com/thrift/test/testset/{name}")') return "\n".join(lines) def print_thrift_class( file: TextIO, class_type: str, names_to_types: Dict[str, str] ) -> None: name = "empty_" + class_type print(generate_class(class_type, name, []), file=file) classes = [name] for display_name, type in names_to_types.items(): class_name = class_type + "_" + display_name classes.append(class_name) print(generate_class(class_type, class_name, [type] * FIELD_COUNT), file=file) # Thrift class that contains all other generated classes with same-type print(generate_class(class_type, class_type + "_all", classes), file=file) def gen_struct_all(path: str) -> None: with open(path, "w") as file: print(THRIFT_HEADER, file=file) print_thrift_class(file, "struct", generate_struct_names_to_types()) print_thrift_class(file, "union", generate_union_names_to_types()) def main() -> None: doctest.testmod() os.chdir(check_output(["buck", "root"]).strip()) parser = argparse.ArgumentParser() parser.add_argument("--install_dir", required=True) parser.add_argument("--filename", required=True) args = parser.parse_args() gen_struct_all(os.path.join(args.install_dir, args.filename)) if __name__ == "__main__": main()
32.736
121
0.663978
0
0
0
0
0
0
0
0
1,929
0.471408
d7107b0e3157b6073b0e042c74159c3a2d63cd03
540
py
Python
test/test_runner.py
antsankov/cufcq-new
93899232a281aee59840746c0131af5d56eae272
[ "MIT" ]
null
null
null
test/test_runner.py
antsankov/cufcq-new
93899232a281aee59840746c0131af5d56eae272
[ "MIT" ]
null
null
null
test/test_runner.py
antsankov/cufcq-new
93899232a281aee59840746c0131af5d56eae272
[ "MIT" ]
null
null
null
from tornado.testing import AsyncHTTPTestCase import unittest def run_tests(application): BaseAsyncTest.application = application BaseAsyncTest.database_name = application.settings['database_name'] BaseAsyncTest.conn = application.settings['conn'] testsuite = unittest.TestLoader().discover('test') return unittest.TextTestRunner(verbosity=2).run(testsuite) class BaseAsyncTest(AsyncHTTPTestCase): application = None conn = None database_name = '' def get_app(self): return self.application
27
71
0.751852
157
0.290741
0
0
0
0
0
0
29
0.053704
d7108aaef549127c37482205d3e95284067ddf78
189
py
Python
uber/views.py
sami-mai/Carpool-R-Us
306c60788e3dc123c3ac85e0c40ac5a291590709
[ "MIT" ]
null
null
null
uber/views.py
sami-mai/Carpool-R-Us
306c60788e3dc123c3ac85e0c40ac5a291590709
[ "MIT" ]
5
2020-02-12T00:43:34.000Z
2021-06-10T20:18:42.000Z
uber/views.py
sami-mai/Carpool-R-Us
306c60788e3dc123c3ac85e0c40ac5a291590709
[ "MIT" ]
null
null
null
from django.shortcuts import render # Create your views here. def landing(request): title = "Home" context = {"title": title} return render(request, 'landing.html', context)
18.9
51
0.687831
0
0
0
0
0
0
0
0
52
0.275132
d710c8f60cb9024bad5b455bf64fd5e34f00636a
736
py
Python
PIP/Class Program/ClassQuestion5.py
ankitrajbiswal/SEM_5
db716e242e77149a4091e0e564356ddc724aeff0
[ "Apache-2.0" ]
10
2021-04-24T11:46:48.000Z
2022-01-17T05:14:37.000Z
PIP/Class Program/ClassQuestion5.py
ankitrajbiswal/SEM_5
db716e242e77149a4091e0e564356ddc724aeff0
[ "Apache-2.0" ]
2
2021-06-28T11:51:50.000Z
2021-11-01T08:21:53.000Z
PIP/Class Program/ClassQuestion5.py
ankitrajbiswal/SEM_5
db716e242e77149a4091e0e564356ddc724aeff0
[ "Apache-2.0" ]
16
2021-04-24T11:46:58.000Z
2022-03-02T05:08:19.000Z
'''def operations(a,b,c): if(c=='+'): return a+b elif(c=='-'): return a-b elif(c=='*'): return a*b elif(c=='/'): return a/b elif(c=='%'): return a%b elif(c=='**'): return a**b elif(c=='//'): return a//b else: print("Non specfied soperation") print(operations(10,5,'+')) print(operations(10,5,'-')) print(operations(10,5,'*')) print(operations(10,5,'/')) print(operations(10,5,'%')) print(operations(10,2,'**')) print(operations(10,3,'//')) print(operations((int(input("Enter a "))),int(input("Enter b ")),input("Enter c ")))''' def evaluate(): print(eval(input("Enter an arithmetic expression: "))) evaluate()
26.285714
88
0.509511
0
0
0
0
0
0
0
0
681
0.925272
d71227084c2c9e3c8560447c816cdd1517d2990e
1,491
py
Python
flaskr/data/data_loader.py
bathlarajat/chartjsExamples
2b65e7933b5abb63069f14be5c21400ae0339402
[ "MIT" ]
3
2021-01-04T20:38:42.000Z
2022-03-21T22:37:22.000Z
flaskr/data/data_loader.py
datahappy1/flask_chartjs_drilldown_example_project
48013697bc5eb71950cc923bc053488ff7b1a706
[ "MIT" ]
null
null
null
flaskr/data/data_loader.py
datahappy1/flask_chartjs_drilldown_example_project
48013697bc5eb71950cc923bc053488ff7b1a706
[ "MIT" ]
null
null
null
import os import csv import itertools from datetime import datetime class DataLoader: def __init__(self): self.file_name = os.path.join(os.getcwd(), 'data', 'covid_19_data.csv') self.data_set_full = [] self.data_set_grouped = [] def prepare_data_set_full(self): """ prepare the full dataset function :return: """ reader = csv.DictReader(open(self.file_name, 'r', newline='\n')) for line in reader: _line = {k: v for k, v in line.items()} _line['ObservationDate'] = datetime.strptime(line['ObservationDate'], '%m/%d/%Y').strftime('%m-%d-%Y') self.data_set_full.append(_line) self.data_set_full = sorted(self.data_set_full, key=lambda x: x['ObservationDate']) return self.data_set_full def prepare_data_set_grouped(self): """ prepare the grouped by date dataset function :return: """ for key, group in itertools.groupby(self.data_set_full, key=lambda x: x['ObservationDate']): _group = list(group) self.data_set_grouped.append((key, sum([float(r.get('Confirmed')) for r in _group]), sum([float(r.get('Deaths')) for r in _group]), sum([float(r.get('Recovered')) for r in _group]) )) return self.data_set_grouped
36.365854
114
0.550637
1,420
0.952381
0
0
0
0
0
0
309
0.207243
d712411aa65ad60106f946dcc651e825873ac55d
1,430
py
Python
plugins/dnspark.py
mmannerm/ddupdate
4822689898def7200a90ca5c4a98dcb8f316c078
[ "MIT" ]
34
2018-02-08T16:25:49.000Z
2022-03-17T00:38:54.000Z
plugins/dnspark.py
mmannerm/ddupdate
4822689898def7200a90ca5c4a98dcb8f316c078
[ "MIT" ]
56
2017-12-30T10:05:17.000Z
2022-03-30T15:53:38.000Z
plugins/dnspark.py
mmannerm/ddupdate
4822689898def7200a90ca5c4a98dcb8f316c078
[ "MIT" ]
25
2019-01-09T01:39:14.000Z
2022-03-29T21:45:59.000Z
""" ddupdate plugin updating data on dnspark.com. See: ddupdate(8) See: https://dnspark.zendesk.com/hc/en-us/articles/ 216322723-Dynamic-DNS-API-Documentation """ from ddupdate.ddplugin import ServicePlugin, ServiceError from ddupdate.ddplugin import http_basic_auth_setup, get_response class DnsparkPlugin(ServicePlugin): """ Update a dns entry on dnspark.com. Supports most address plugins including default-web-ip, default-if and ip-disabled. ipv6 is not supported. You need to own a domain and delegate it to dnspark to use the service, nothing like myhost.dnspark.net is supported. Note that the dynamic dns user and password is a separate set of credentials created in the web interface. netrc: Use a line like machine control.dnspark.com login <username> password <password> Options: none """ _name = 'dnspark.com' _oneliner = 'Updates on https://dnspark.com/' _url = "https://control.dnspark.com/api/dynamic/update.php?hostname={0}" def register(self, log, hostname, ip, options): """Implement ServicePlugin.register().""" url = self._url.format(hostname) if ip and ip.v4: url += "&ip=" + ip.v4 http_basic_auth_setup(url) reply = get_response(log, url).strip() if reply not in ['ok', 'nochange']: raise ServiceError("Unexpected update reply: " + reply)
30.425532
76
0.678322
1,129
0.78951
0
0
0
0
0
0
909
0.635664
d712e45f32f1e75fade001b57a11c6b19a4548c1
714
py
Python
userbot/modules/__helpme.py
sekret666/codeaz
141d9a656326f4a5a6c149d3433e39cf7396a8d2
[ "MIT" ]
null
null
null
userbot/modules/__helpme.py
sekret666/codeaz
141d9a656326f4a5a6c149d3433e39cf7396a8d2
[ "MIT" ]
null
null
null
userbot/modules/__helpme.py
sekret666/codeaz
141d9a656326f4a5a6c149d3433e39cf7396a8d2
[ "MIT" ]
1
2021-12-15T06:27:45.000Z
2021-12-15T06:27:45.000Z
# C O D E A Z/ Samil from userbot import BOT_USERNAME from userbot.events import register # ██████ LANGUAGE CONSTANTS ██████ # from userbot.language import get_value LANG = get_value("__helpme") # ████████████████████████████████ # @register(outgoing=True, pattern="^.yard[iı]m|^.help") async def yardim(event): tgbotusername = BOT_USERNAME if tgbotusername is not None: results = await event.client.inline_query( tgbotusername, "@Codeaz" ) await results[0].click( event.chat_id, reply_to=event.reply_to_msg_id, hide_via=True ) await event.delete() else: await event.edit(LANG["NO_BOT"])
23.8
54
0.584034
0
0
0
0
476
0.592777
420
0.523039
228
0.283935
d7141ae014ac95863434646bbd6943b07b157f83
216
py
Python
Ex-15.py
gilmartins83/Guanabara-Python
43128c35fcd601db1f72c80a9c76f4b4f4085c7f
[ "MIT" ]
null
null
null
Ex-15.py
gilmartins83/Guanabara-Python
43128c35fcd601db1f72c80a9c76f4b4f4085c7f
[ "MIT" ]
null
null
null
Ex-15.py
gilmartins83/Guanabara-Python
43128c35fcd601db1f72c80a9c76f4b4f4085c7f
[ "MIT" ]
null
null
null
dias = int(input("quantos dias voce deseja alugar o carro? ")) km = float(input("Quantos kilometros você andou? ")) pago = dias * 60 + (km * 0.15) print("o valor do aluguel do carro foi de R$ {:.2f}" .format(pago))
36
67
0.662037
0
0
0
0
0
0
0
0
123
0.56682
d714611ff086011342bf685f42497f2e7b46e1e3
9,010
py
Python
cirq/contrib/quimb/density_matrix.py
lilies/Cirq
519b8b70ba4d2d92d1c034c398161ebdbd23e2e7
[ "Apache-2.0" ]
3
2020-09-26T03:56:28.000Z
2020-09-27T13:21:04.000Z
cirq/contrib/quimb/density_matrix.py
lilies/Cirq
519b8b70ba4d2d92d1c034c398161ebdbd23e2e7
[ "Apache-2.0" ]
null
null
null
cirq/contrib/quimb/density_matrix.py
lilies/Cirq
519b8b70ba4d2d92d1c034c398161ebdbd23e2e7
[ "Apache-2.0" ]
1
2020-04-14T15:29:29.000Z
2020-04-14T15:29:29.000Z
from functools import lru_cache from typing import Sequence, Dict, Union, Tuple, List, Optional, cast, Iterable import numpy as np import quimb import quimb.tensor as qtn import cirq @lru_cache() def _qpos_tag(qubits: Union[cirq.LineQubit, Tuple[cirq.LineQubit]]): """Given a qubit or qubits, return a "position tag" (used for drawing). For multiple qubits, the tag is for the first qubit. """ if isinstance(qubits, cirq.LineQubit): return _qpos_tag((qubits,)) x = min(q.x for q in qubits) return f'q{x}' @lru_cache() def _qpos_y(qubits: Union[cirq.LineQubit, Tuple[cirq.LineQubit]], tot_n_qubits: int): """Given a qubit or qubits, return the position y value (used for drawing). For multiple qubits, the position is the mean of the qubit indices. This "flips" the coordinate so qubit 0 is at the maximal y position. Args: qubits: The qubits involved in the tensor. tot_n_qubits: The total number of qubits in the circuit, allowing us to position the zero'th qubit at the top. """ if isinstance(qubits, cirq.LineQubit): return _qpos_y((qubits,), tot_n_qubits) x = np.mean([q.x for q in qubits]).item() return tot_n_qubits - x - 1 def _add_to_positions(positions: Dict[Tuple[str, str], Tuple[float, float]], mi: int, qubits: Union[cirq.LineQubit, Tuple[cirq.LineQubit]], *, tot_n_qubits: int, x_scale, y_scale, x_nudge, yb_offset): """Helper function to update the `positions` dictionary. Args: positions: The dictionary to update. Quimb will consume this for drawing mi: Moment index (used for x-positioning) qubits: The qubits (used for y-positioning) tot_n_qubits: The total number of qubits in the circuit, allowing us to position the zero'th qubit at the top. x_scale: Stretch coordinates in the x direction y_scale: Stretch coordinates in the y direction x_nudge: Kraus operators will have vertical lines connecting the "forward" and "backward" circuits, so the x position of each tensor is nudged (according to its y position) to help see all the lines. yb_offset: Offset the "backwards" circuit by this much. """ qy = _qpos_y(qubits, tot_n_qubits) positions[(f'i{mi}f', _qpos_tag(qubits))] = \ (mi * x_scale + qy * x_nudge, y_scale * qy) positions[(f'i{mi}b', _qpos_tag(qubits))] = \ (mi * x_scale, y_scale * qy + yb_offset) def circuit_to_density_matrix_tensors( circuit: cirq.Circuit, qubits: Optional[Sequence[cirq.LineQubit]] = None ) -> Tuple[List[qtn.Tensor], Dict['cirq.Qid', int], Dict[Tuple[str, str], Tuple[float, float]]]: """Given a circuit with mixtures or channels, construct a tensor network representation of the density matrix. This assumes you start in the |0..0><0..0| state. Indices are named "nf{i}_q{x}" and "nb{i}_q{x}" where i is a time index and x is a qubit index. nf- and nb- refer to the "forwards" and "backwards" copies of the circuit. Kraus indices are named "k{j}" where j is an independent "kraus" internal index which you probably never need to access. Args: circuit: The circuit containing operations that support the cirq.unitary() or cirq.channel() protocols. qubits: The qubits in the circuit. Returns: tensors: A list of Quimb Tensor objects qubit_frontier: A mapping from qubit to time index at the end of the circuit. This can be used to deduce the names of the free tensor indices. positions: A positions dictionary suitable for passing to tn.graph()'s `fix` argument to draw the resulting tensor network similar to a quantum circuit. """ if qubits is None: # coverage: ignore qubits = sorted(cast(Iterable[cirq.LineQubit], circuit.all_qubits())) qubit_frontier: Dict[cirq.Qid, int] = {q: 0 for q in qubits} kraus_frontier = 0 positions: Dict[Tuple[str, str], Tuple[float, float]] = {} tensors: List[qtn.Tensor] = [] x_scale = 2 y_scale = 3 x_nudge = 0.3 n_qubits = len(qubits) yb_offset = (n_qubits + 0.5) * y_scale def _positions(mi, qubits): return _add_to_positions(positions, mi, qubits, tot_n_qubits=n_qubits, x_scale=x_scale, y_scale=y_scale, x_nudge=x_nudge, yb_offset=yb_offset) # Initialize forwards and backwards qubits into the 0 state, i.e. prepare # rho_0 = |0><0|. for q in qubits: tensors += [ qtn.Tensor(data=quimb.up().squeeze(), inds=(f'nf0_q{q.x}',), tags={'Q0', 'i0f', _qpos_tag(q)}), qtn.Tensor(data=quimb.up().squeeze(), inds=(f'nb0_q{q.x}',), tags={'Q0', 'i0b', _qpos_tag(q)}) ] _positions(0, q) for mi, moment in enumerate(circuit.moments): for op in moment.operations: start_inds_f = [f'nf{qubit_frontier[q]}_q{q.x}' for q in op.qubits] start_inds_b = [f'nb{qubit_frontier[q]}_q{q.x}' for q in op.qubits] for q in op.qubits: qubit_frontier[q] += 1 end_inds_f = [f'nf{qubit_frontier[q]}_q{q.x}' for q in op.qubits] end_inds_b = [f'nb{qubit_frontier[q]}_q{q.x}' for q in op.qubits] if cirq.has_unitary(op): U = cirq.unitary(op).reshape( (2,) * 2 * len(op.qubits)).astype(np.complex128) tensors.append( qtn.Tensor(data=U, inds=end_inds_f + start_inds_f, tags={ f'Q{len(op.qubits)}', f'i{mi + 1}f', _qpos_tag(op.qubits) })) tensors.append( qtn.Tensor(data=np.conj(U), inds=end_inds_b + start_inds_b, tags={ f'Q{len(op.qubits)}', f'i{mi + 1}b', _qpos_tag(op.qubits) })) elif cirq.has_channel(op): K = np.asarray(cirq.channel(op), dtype=np.complex128) kraus_inds = [f'k{kraus_frontier}'] tensors.append( qtn.Tensor(data=K, inds=kraus_inds + end_inds_f + start_inds_f, tags={ f'kQ{len(op.qubits)}', f'i{mi + 1}f', _qpos_tag(op.qubits) })) tensors.append( qtn.Tensor(data=np.conj(K), inds=kraus_inds + end_inds_b + start_inds_b, tags={ f'kQ{len(op.qubits)}', f'i{mi + 1}b', _qpos_tag(op.qubits) })) kraus_frontier += 1 else: raise ValueError(repr(op)) # coverage: ignore _positions(mi + 1, op.qubits) return tensors, qubit_frontier, positions def tensor_density_matrix(circuit: cirq.Circuit, qubits: Optional[List[cirq.LineQubit]] = None ) -> np.ndarray: """Given a circuit with mixtures or channels, contract a tensor network representing the resultant density matrix. Note: If the circuit contains 6 qubits or fewer, we use a bespoke contraction ordering that corresponds to the "normal" in-time contraction ordering. Otherwise, the contraction order determination could take longer than doing the contraction. Your mileage may vary and benchmarking is encouraged for your particular problem if performance is important. """ if qubits is None: qubits = sorted(cast(Iterable[cirq.LineQubit], circuit.all_qubits())) tensors, qubit_frontier, _ = circuit_to_density_matrix_tensors( circuit=circuit, qubits=qubits) tn = qtn.TensorNetwork(tensors) f_inds = tuple(f'nf{qubit_frontier[q]}_q{q.x}' for q in qubits) b_inds = tuple(f'nb{qubit_frontier[q]}_q{q.x}' for q in qubits) if len(qubits) <= 6: # Heuristic: don't try to determine best order for low qubit number # Just contract in time. tags_seq = [(f'i{i}b', f'i{i}f') for i in range(len(circuit) + 1)] tn.contract_cumulative(tags_seq, inplace=True) else: tn.contract(inplace=True) return tn.to_dense(f_inds, b_inds)
42.300469
80
0.56515
0
0
0
0
1,060
0.117647
0
0
3,605
0.400111
d7168d63372783b7232cd178045b15c0e30dc43a
9,150
py
Python
plugins/mgba_bridge/script_disassembler/script_disassembler.py
notyourav/the-little-hat
f52b38b18b762e704b36cef06c07656348ea6995
[ "MIT" ]
null
null
null
plugins/mgba_bridge/script_disassembler/script_disassembler.py
notyourav/the-little-hat
f52b38b18b762e704b36cef06c07656348ea6995
[ "MIT" ]
null
null
null
plugins/mgba_bridge/script_disassembler/script_disassembler.py
notyourav/the-little-hat
f52b38b18b762e704b36cef06c07656348ea6995
[ "MIT" ]
2
2021-10-05T20:40:12.000Z
2022-01-05T00:17:36.000Z
from dataclasses import dataclass import struct from typing import Tuple from plugins.mgba_bridge.script_disassembler.utils import barray_to_u16_hex, u16_to_hex from plugins.mgba_bridge.script_disassembler.definitions import get_pointer, commands, parameters, get_script_label, used_labels # Disassembler for tmc scripts # Input 'macros' to generate the macros for the script commands # Input the script bytes as hex to disassemble the script # Build macros: echo "macros" | python script_disassembler.py > ~/git/tmc/github/asm/macros/scripts.inc @dataclass class Context: ptr: int data: bytes script_addr: int # Remove the ScriptCommand_ prefix for the asm macros def build_script_command(name: str): name = name.replace("ScriptCommand_", "") if name[0].isdigit(): # asm macros cannot start with an _ return f'_{name}' return name def print_rest_bytes(ctx): print('\n'.join(['.byte ' + hex(x) for x in ctx.data[ctx.ptr:]])) @dataclass class Instruction: addr: int text: str def disassemble_command(ctx: Context, add_all_annotations=False) -> Tuple[int, Instruction]: global used_labels # if (add_all_annotations or ctx.script_addr + ctx.ptr in used_labels) and ctx.ptr != 0: # print offsets to debug when manually inserting labels #print(f'{get_script_label(ctx.script_addr + ctx.ptr)}:') cmd = struct.unpack('H', ctx.data[ctx.ptr:ctx.ptr + 2])[0] if cmd == 0: # this does not need to be the end of the script #print('\t.2byte 0x0000') ctx.ptr += 2 return (1, Instruction(ctx.ptr-2, '0000')) if cmd == 0xffff: ctx.ptr += 2 # print('SCRIPT_END') if ctx.ptr >= len(ctx.data) - 1: # This is already the end return (2, Instruction(ctx.ptr-2, 'SCRIPT_END')) cmd = struct.unpack('H', ctx.data[ctx.ptr:ctx.ptr + 2])[0] if cmd == 0x0000: # This is actually the end of the script #print('\t.2byte 0x0000') ctx.ptr += 2 return (2, Instruction(ctx.ptr-4, 'SCRIPT_END')) # There is a SCRIPT_END without 0x0000 afterwards, but still split into a new file, please return (3, Instruction(ctx.ptr-2, 'SCRIPT_END')) commandStartAddress = ctx.ptr commandSize = cmd >> 0xA if commandSize == 0: raise Exception(f'Zero commandSize not allowed') commandId = cmd & 0x3FF if commandId >= len(commands): raise Exception( f'Invalid commandId {commandId} / {len(commands)} {cmd}') command = commands[commandId] param_length = commandSize - 1 if commandSize > 1: if ctx.ptr + 2 * commandSize > len(ctx.data): raise Exception(f'Not enough data to fetch {commandSize-1} params') # Handle parameters if not 'params' in command: raise Exception( f'Parameters not defined for {command["fun"]}. Should be of length {str(param_length)}') params = None suffix = '' # When there are multiple variants of parameters, choose the one with the correct count for this if isinstance(command['params'], list): for i, param in enumerate(command['params']): if not param in parameters: raise Exception(f'Parameter configuration {param} not defined') candidate = parameters[param] if candidate['length'] == commandSize - 1: params = candidate if i != 0: # We need to add a suffix to distinguish the correct parameter variant suffix = f'_{params["length"]}' break if params is None: raise Exception( f'No suitable parameter configuration with length {commandSize-1} found for {command["fun"]}') else: if not command['params'] in parameters: raise Exception( f'Parameter configuration {command["params"]} not defined') params = parameters[command['params']] command_name = f'{command["fun"]}{suffix}' if params['length'] == -1: # variable parameter length # print(f'\t.2byte {u16_to_hex(cmd)} @ {build_script_command(command_name)} with {commandSize-1} parameters') # if commandSize > 1: # print('\n'.join(['\t.2byte ' + x for x in barray_to_u16_hex(ctx.data[ctx.ptr + 2:ctx.ptr + commandSize * 2])])) # print(f'@ End of parameters') ctx.ptr += commandSize * 2 return (1, Instruction(commandStartAddress, 'TODO')) elif params['length'] == -2: # point and var # print(f'\t.2byte {u16_to_hex(cmd)} @ {build_script_command(command_name)} with {commandSize-3} parameters') # print('\t.4byte ' + get_pointer(ctx.data[ctx.ptr + 2:ctx.ptr + 6])) # if commandSize > 3: # print('\n'.join(['\t.2byte ' + x for x in barray_to_u16_hex(ctx.data[ctx.ptr + 6:ctx.ptr + commandSize * 2])])) # print(f'@ End of parameters') ctx.ptr += commandSize * 2 return (1, Instruction(commandStartAddress, 'TODO')) if commandSize-1 != params['length']: raise Exception( f'Call {command_name} with {commandSize-1} length, while length of {params["length"]} defined') # print(f'\t{build_script_command(command_name)} {params["read"](ctx)}') # Execute script ctx.ptr += commandSize * 2 return (1, Instruction(commandStartAddress, 'TODO')) def disassemble_script(input_bytes, script_addr, add_all_annotations=False) -> Tuple[int, list[Instruction]]: ctx = Context(0, input_bytes, script_addr) foundEnd = False instructions: list[Instruction] = [] while True: # End of file (there need to be at least two bytes remaining for the next operation id) if ctx.ptr >= len(ctx.data) - 1: break #print('remaining', len(ctx.data)-ctx.ptr) (res, instruction) = disassemble_command(ctx, add_all_annotations) # print(instruction.addr) instructions.append(instruction) if res == 0: break elif res == 2: foundEnd = True break elif res == 3: # End in the middle of the script, please create a new file return (ctx.ptr, instructions) # Print rest (did not manage to get there) if ctx.ptr < len(ctx.data): if (len(ctx.data) - ctx.ptr) % 2 != 0: print_rest_bytes(ctx) raise Exception( f'There is extra data at the end {ctx.ptr} / {len(ctx.data)}') print( '\n'.join(['.2byte ' + x for x in barray_to_u16_hex(ctx.data[ctx.ptr:])])) raise Exception( f'There is extra data at the end {ctx.ptr} / {len(ctx.data)}') if not foundEnd: # Sadly, there are script files without and end? return (0, instructions) #print('\033[93mNo end found\033[0m') return (0, instructions) def generate_macros(): print('@ All the macro functions for scripts') print('@ Generated by disassemble_script.py') print('.macro SCRIPT_START name') print(' .globl \\name') print(' .section .text') print('\\name:') print('.endm') print('.macro SCRIPT_END') print(' .2byte 0xffff') print('.endm') print('') for num, command in enumerate(commands): if not 'params' in command: raise Exception(f'Parameters not defined for {command["fun"]}') def emit_macro(command_name, id, params): print(f'.macro {command_name} {params["param"]}') print(f' .2byte {u16_to_hex(id)}') if params['expr'] != '': print(params['expr']) print('.endm') print('') if isinstance(command['params'], list): # emit macros for all variants for i, variant in enumerate(command['params']): if not variant in parameters: raise Exception( f'Parameter configuration {variant} not defined') params = parameters[variant] id = ((params['length'] + 1) << 0xA) + num suffix = '' if i != 0: suffix = f'_{params["length"]}' emit_macro( f'{build_script_command(command["fun"])}{suffix}', id, params) else: if not command['params'] in parameters: raise Exception( f'Parameter configuration {command["params"]} not defined') params = parameters[command['params']] id = ((params['length'] + 1) << 0xA) + num if params['length'] < 0: # Don't emit anything for variable parameters continue emit_macro(build_script_command(command['fun']), id, params) print('') def main(): # Read input input_data = input() if input_data.strip() == 'macros': generate_macros() return disassemble_script(bytearray.fromhex(input_data)) if __name__ == '__main__': main()
37.044534
132
0.594317
110
0.012022
0
0
132
0.014426
0
0
3,736
0.408306
d717ca185441b7405138c795fdcfae7c8f70ce12
3,366
py
Python
gcloud/apigw/views/query_task_count.py
ZhuoZhuoCrayon/bk-sops
d1475d53c19729915727ce7adc24e3226f15e332
[ "Apache-2.0" ]
1
2020-08-16T09:21:58.000Z
2020-08-16T09:21:58.000Z
gcloud/apigw/views/query_task_count.py
ZhuoZhuoCrayon/bk-sops
d1475d53c19729915727ce7adc24e3226f15e332
[ "Apache-2.0" ]
null
null
null
gcloud/apigw/views/query_task_count.py
ZhuoZhuoCrayon/bk-sops
d1475d53c19729915727ce7adc24e3226f15e332
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://opensource.org/licenses/MIT 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 ujson as json from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from blueapps.account.decorators import login_exempt from gcloud import err_code from gcloud.apigw.decorators import api_verify_proj_perms from gcloud.apigw.decorators import mark_request_whether_is_trust from gcloud.apigw.decorators import project_inject from gcloud.contrib.analysis.analyse_items import task_flow_instance from gcloud.core.permissions import project_resource from gcloud.apigw.views.utils import logger try: from bkoauth.decorators import apigw_required except ImportError: from packages.bkoauth.decorators import apigw_required @login_exempt @csrf_exempt @require_POST @apigw_required @mark_request_whether_is_trust @project_inject @api_verify_proj_perms([project_resource.actions.view]) def query_task_count(request, project_id): """ @summary: 按照不同维度统计业务任务总数 @param request: @param project_id: @return: """ try: params = json.loads(request.body) except Exception: return JsonResponse( { "result": False, "message": "invalid json format", "code": err_code.REQUEST_PARAM_INVALID.code, } ) project = request.project conditions = params.get("conditions", {}) group_by = params.get("group_by") if not isinstance(conditions, dict): message = ( "[API] query_task_list params conditions[%s] are invalid dict data" % conditions ) logger.error(message) return JsonResponse( { "result": False, "message": message, "code": err_code.REQUEST_PARAM_INVALID.code, } ) if group_by not in ["category", "create_method", "flow_type", "status"]: message = "[API] query_task_list params group_by[%s] is invalid" % group_by logger.error(message) return JsonResponse( { "result": False, "message": message, "code": err_code.REQUEST_PARAM_INVALID.code, } ) filters = {"project_id": project.id, "is_deleted": False} filters.update(conditions) success, content = task_flow_instance.dispatch(group_by, filters) if not success: return JsonResponse( {"result": False, "message": content, "code": err_code.UNKNOWN_ERROR.code} ) return JsonResponse( {"result": True, "data": content, "code": err_code.SUCCESS.code} )
35.0625
115
0.686275
0
0
0
0
1,934
0.566823
0
0
1,216
0.356389
d71a3783efcdfcf37cb4cd953c69e007c41c2a7b
28,222
py
Python
applications/MultilevelMonteCarloApplication/python_scripts/statistical_variable_utilities.py
lkusch/Kratos
e8072d8e24ab6f312765185b19d439f01ab7b27b
[ "BSD-4-Clause" ]
778
2017-01-27T16:29:17.000Z
2022-03-30T03:01:51.000Z
applications/MultilevelMonteCarloApplication/python_scripts/statistical_variable_utilities.py
lkusch/Kratos
e8072d8e24ab6f312765185b19d439f01ab7b27b
[ "BSD-4-Clause" ]
6,634
2017-01-15T22:56:13.000Z
2022-03-31T15:03:36.000Z
applications/MultilevelMonteCarloApplication/python_scripts/statistical_variable_utilities.py
lkusch/Kratos
e8072d8e24ab6f312765185b19d439f01ab7b27b
[ "BSD-4-Clause" ]
224
2017-02-07T14:12:49.000Z
2022-03-06T23:09:34.000Z
# Import Python libraries import numpy as np # Import distributed framework from exaqute import * try: init() except: pass try: computing_units_auxiliar_utilities = int(os.environ["computing_units_auxiliar_utilities"]) except: computing_units_auxiliar_utilities = 1 """ auxiliary function of UpdateOnePassCentralMoments of the StatisticalVariable class input: sample: new value that will update the statistics old_mean : old mean old_central_moment_1 : old first central moment compute_M1 : boolean setting if computation is needed old_central_moment_2 : old second central moment compute_M2 : boolean setting if computation is needed old_central_moment_3 : old third central moment compute_M3 : boolean setting if computation is needed old_central_moment_1 : old fourth central moment compute_M4 : boolean settings if computation is needed nsamples : old number of samples computed, starts from 1 output: new_mean : updated mean new_sample_variance : updated sample variance new_central_moment_1 : updated central_moment_1 new_central_moment_2 : updated central_moment_2 new_central_moment_3 : updated central_moment_3 new_central_moment_4 : updated central_moment_4 nsamples : updated number of samples """ @constraint(computing_units=computing_units_auxiliar_utilities) @task(keep=True,returns=7,priority=True) def UpdateOnePassCentralMomentsAux_Task(sample,old_mean,old_central_moment_1,compute_M1,old_central_moment_2,compute_M2,old_central_moment_3,compute_M3,old_central_moment_4,compute_M4,nsamples): old_M1 = old_central_moment_1 * nsamples old_M2 = old_central_moment_2 * nsamples old_M3 = old_central_moment_3 * nsamples old_M4 = old_central_moment_4 * nsamples nsamples = nsamples + 1 if nsamples == 1: new_mean = sample new_M1 = 0.0 new_M2 = 0.0 new_sample_variance = 0.0 new_M3 = 0.0 new_M4 = 0.0 else: delta = np.subtract(sample,old_mean) new_mean = old_mean + np.divide(delta,nsamples) if (compute_M1): new_M1 = old_M1 # we are not updating, first central moment = 0.0 else: new_M1 = old_M1 # we are not updating, first central moment = 0.0 if (compute_M2): new_M2 = old_M2 + delta*np.subtract(sample,new_mean) else: raise Exception ("Not computing StatisticalVariable.central_moment_2, set StatisticalVariable.central_moment_2_to_compute to True") new_sample_variance = np.divide(new_M2,np.subtract(nsamples,1)) if (compute_M3): new_M3 = old_M3 - 3.0*old_M2*np.divide(delta,nsamples) + np.divide(np.multiply((nsamples-1)*(nsamples-2),(delta**3)),(nsamples**2)) else: new_M3 = old_M3 # we are not updating if (compute_M4): new_M4 = old_M4 - 4.0*old_M3*np.divide(delta,nsamples) + 6.0*old_M2*np.divide(delta,nsamples)**2 + np.multiply((nsamples-1)*(nsamples**2-3*nsamples+3),np.divide(delta**4,nsamples**3)) else: new_M4 = old_M4 # we are not updating new_central_moment_1 = new_M1 / nsamples new_central_moment_2 = new_M2 / nsamples new_central_moment_3 = new_M3 / nsamples new_central_moment_4 = new_M4 / nsamples return new_mean,new_sample_variance,new_central_moment_1,new_central_moment_2,new_central_moment_3,new_central_moment_4,nsamples """ auxiliary function of UpdateOnePassPowerSums of the StatisticalVariable class input: sample : new value that will update the statistics old_S1 : old first power sum old_S2 : old second power sum old_S3 : old third power sum old_S4 : old fourth power sum nsamples : number of samples, it has already been updated in UpdateOnePassCentralMomentsAux_Task output: new_S1 : updated first power sum new_s2 : updated second power sum new_S3 : updated third power sum new_S4 : updated fourth power sum """ @constraint(computing_units=computing_units_auxiliar_utilities) @task(keep=True,returns=5,priority=True) def UpdateOnePassPowerSumsAux_Task(sample,old_S1,old_S2,old_S3,old_S4,nsamples): nsamples = nsamples + 1 if nsamples == 1: new_S1 = sample new_S2 = sample**2 new_S3 = sample**3 new_S4 = sample**4 else: new_S1 = old_S1 + sample new_S2 = old_S2 + sample**2 new_S3 = old_S3 + sample**3 new_S4 = old_S4 + sample**4 return new_S1,new_S2,new_S3,new_S4,nsamples """ auxiliary function of UpdateGlobalPowerSums of the StatisticalVariable class input: old_S1 : old first power sum old_S2 : old second power sum old_S3 : old third power sum old_S4 : old fourth power sum number_samples_level : number of samples, it has already been updated in UpdateOnePassCentralMomentsAux_Task add_S1 : power sum order one to add add_S2 : power sum order two to add add_S3 : power sum order three to add add_S4 : power sum order four to add add_number_samples_level : number of samples to add output: new_S1 : updated first power sum new_s2 : updated second power sum new_S3 : updated third power sum new_S4 : updated fourth power sum number_samples_level : number of samples of current level """ @constraint(computing_units=computing_units_auxiliar_utilities) @task(keep=True,returns=5,priority=True) def UpdateGlobalPowerSumsAux_Task(old_S1,old_S2,old_S3,old_S4,number_samples_level,add_S1,add_S2,add_S3,add_S4,add_number_samples_level): new_S1 = old_S1 + add_S1 new_S2 = old_S2 + add_S2 new_S3 = old_S3 + add_S3 new_S4 = old_S4 + add_S4 number_samples_level = number_samples_level + add_number_samples_level return new_S1,new_S2,new_S3,new_S4,number_samples_level """ function unfolding values from a list, needed by PyCOMPSs for list of lists input: sample : the list of lists output: sample[*] : list position * of the list of lists """ @constraint(computing_units=computing_units_auxiliar_utilities) @task(keep=True,returns=4, priority=True) def UnfoldValuesAux_Task(sample): return sample[0], sample[1], sample[2], sample[3] """ auxiliary function of UpdateBatchesPassPowerSums input: samples : list of samples output: return the sum, done in mini_batch_size batches, of the samples components """ @constraint(computing_units=computing_units_auxiliar_utilities) @task(keep=True,returns=1,priority=True) def UpdateBatchesPassPowerSumsAux_Task(*samples): samples_list = np.array(list(samples)) return np.sum(samples_list, axis = 0) """ if nsamples == 0: new_S1 = samples[0] new_S2 = samples[0]**2 new_S3 = samples[0]**3 new_S4 = samples[0]**4 old_S1 = new_S1 old_S2 = new_S2 old_S3 = new_S3 old_S4 = new_S4 nsamples = 1 samples=samples[1:] for sample in samples: nsamples = nsamples + 1 new_S1 = old_S1 + sample new_S2 = old_S2 + sample**2 new_S3 = old_S3 + sample**3 new_S4 = old_S4 + sample**4 old_S1 = new_S1 old_S2 = new_S2 old_S3 = new_S3 old_S4 = new_S4 return new_S1,new_S2,new_S3,new_S4,nsamples """ """ auxiliary function of UpdateHStatistics of the StatisticalVariable class input: S1_level : first power sum at defined level S2_level : second power sum at defined level S3_level : third power sum at defined level S4_level : fourth power sum at defined level number_samples_level : number of samples (already update) for defined level output: h1_level : first h statistics for defined level h2_level : second h statistics for defined level h3_level : third h statistics for defined level h4_level : fourth h statistics for defined level """ @constraint(computing_units=computing_units_auxiliar_utilities) @task(keep=True,returns=4,priority=True) def ComputeHStatisticsAux_Task(S1_level,S2_level,S3_level,S4_level,number_samples_level): h1_level = S1_level / number_samples_level h2_level = (number_samples_level*S2_level-S1_level**2) / ((number_samples_level-1)*number_samples_level) h3_level = (number_samples_level**2*S3_level-3*number_samples_level*S2_level*S1_level+2*S1_level**3) / \ ((number_samples_level-2)*(number_samples_level-1)*number_samples_level) h4_level = ((-4*number_samples_level**2+8*number_samples_level-12)*S3_level*S1_level+ \ (number_samples_level**3-2*number_samples_level**2+3*number_samples_level)*S4_level+ \ 6*number_samples_level*S2_level*S1_level**2+(9-6*number_samples_level)*S2_level**2-3*S1_level**4) / \ ((number_samples_level-3)*(number_samples_level-2)*(number_samples_level-1)*number_samples_level) return h1_level,h2_level,h3_level,h4_level """ auxiliary function of ComputeSkewnessKurtosis of the StatisticalVariable class input: h2_level : second h statistics for defined level h3_level : third h statistics for defined level h4_level : fourth h statistics for defined level output: skewness_level : skewness for defined level kurtosis_level : kurtosis for defined level """ @constraint(computing_units=computing_units_auxiliar_utilities) @task(keep=True,returns=2,priority=True) def ComputeSkewnessKurtosisAux_Task(h2_level,h3_level,h4_level): skewness_level = h3_level / (np.sqrt(h2_level**3)) kurtosis_level = h4_level / (h2_level**2) return skewness_level,kurtosis_level """ auxiliary function of ComputeSampleCentralMomentsFromScratch of the StatisticalVariable class input: sample: new value that will update the statistics number_samples_level : number of samples for defined level central_moment_from_scratch_1_to_compute : boolean setting if computation is needed central_moment_from_scratch_2_to_compute : boolean setting if computation is needed central_moment_from_scratch_3_to_compute : boolean setting if computation is needed central_moment_from_scratch_3_absolute_to_compute : boolean setting if computation is needed central_moment_from_scratch_4_to_compute : boolean setting if computation is needed central_moment_from_scratch_1 : old first central moment central_moment_from_scratch_2 : old second central moment central_moment_from_scratch_3 : old third central moment central_moment_from_scratch_3_absolute : old third central moment absolute value central_moment_from_scratch_4 : old fourth central moment output: central_moment_from_scratch_1 : updated first central moment central_moment_from_scratch_2 : updated second central moment central_moment_from_scratch_3 : updated third central moment central_moment_from_scratch_3_absolute : updated third central moment absolute value central_moment_from_scratch_4 : update fourth central moment """ @constraint(computing_units=computing_units_auxiliar_utilities) @task(keep=True,returns=5,priority=True) def ComputeSampleCentralMomentsFromScratchAux_Task(number_samples_level,central_moment_from_scratch_1_to_compute,central_moment_from_scratch_2_to_compute, \ central_moment_from_scratch_3_to_compute,central_moment_from_scratch_3_absolute_to_compute,central_moment_from_scratch_4_to_compute, \ central_moment_from_scratch_1,central_moment_from_scratch_2,central_moment_from_scratch_3,central_moment_from_scratch_3_absolute,central_moment_from_scratch_4, \ samples): # generate a single list from a list of lists samples = [item for sublist in samples for item in sublist] # compute the mean auxiliary_mean = 0.0 for sample in samples: auxiliary_mean = auxiliary_mean + sample curr_mean = auxiliary_mean / number_samples_level for sample in samples: if (central_moment_from_scratch_1_to_compute): central_moment_from_scratch_1 = central_moment_from_scratch_1 + ((sample - curr_mean)**1) / number_samples_level if (central_moment_from_scratch_2_to_compute): central_moment_from_scratch_2 = central_moment_from_scratch_2 + ((sample - curr_mean)**2) / number_samples_level if (central_moment_from_scratch_3_to_compute): central_moment_from_scratch_3 = central_moment_from_scratch_3 + ((sample - curr_mean)**3) / number_samples_level if (central_moment_from_scratch_3_absolute_to_compute): central_moment_from_scratch_3_absolute = central_moment_from_scratch_3_absolute + (np.abs(sample - curr_mean)**3) / number_samples_level if (central_moment_from_scratch_4_to_compute): central_moment_from_scratch_4 = central_moment_from_scratch_4 + ((sample - curr_mean)**4) / number_samples_level return central_moment_from_scratch_1,central_moment_from_scratch_2,central_moment_from_scratch_3,central_moment_from_scratch_3_absolute,central_moment_from_scratch_4 class StatisticalVariable(object): """The base class for statistical variables""" def __init__(self): """constructor of the class Keyword arguments: self : an instance of a class """ # values of the variable, organized per level self.values = [] # mean of the variable per each level self.raw_moment_1 = [] # sample variance of the variable per each level self.unbiased_central_moment_2 = [] # moments of the variable per each level M_p = n * mu_p # mu_p = p-th central moment # n = number of values self.central_moment_1 = [] self.central_moment_2 = [] self.central_moment_3 = [] self.central_moment_4 = [] # set which central moments will be computed (moment_2 is mandatory to be computed because it is exploited in the mean evaluation) self.central_moment_1_to_compute = True self.central_moment_2_to_compute = True self.central_moment_3_to_compute = True self.central_moment_4_to_compute = True # bias error of the variable self.bias_error = None # statistical error of the variable self.statistical_error = None # type of variable: scalar or field self.type = None # number of samples of the variable self.number_samples = None self.batches_number_samples = [] # global power sums # S_p = \sum_{i=1}^{n} Q(sample_i)**p, organized per level self.power_sum_1 = [] self.power_sum_2 = [] self.power_sum_3 = [] self.power_sum_4 = [] # power sums batches self.power_sum_batches_1 = [] self.power_sum_batches_2 = [] self.power_sum_batches_3 = [] self.power_sum_batches_4 = [] # sample central moments \mu_p = \sum_{i=1}^{n} (Q(sample_i)-mean_n)**p / n, organized per level self.central_moment_from_scratch_1 = [] self.central_moment_from_scratch_2 = [] self.central_moment_from_scratch_3 = [] self.central_moment_from_scratch_3_absolute = [] # \mu_p = \sum_{i=1}^{n} abs((Q(sample_i)-mean_n)**p) / n self.central_moment_from_scratch_4 = [] self.central_moment_from_scratch_1_to_compute = False self.central_moment_from_scratch_2_to_compute = False self.central_moment_from_scratch_3_to_compute = False self.central_moment_from_scratch_3_absolute_to_compute = False self.central_moment_from_scratch_4_to_compute = False # h-statistics h_p, the unbiased central moment estimator with minimal variance, organized per level self.h_statistics_1 = [] self.h_statistics_2 = [] self.h_statistics_3 = [] self.h_statistics_4 = [] self.h_statistics_computed = False # skewness of the variable per each level self.skewness = [] # kurtosis of the variable per each level self.kurtosis = [] # convergence criteria of the algorithm self.convergence_criteria = None """ function initializing variables of the Statistical Variable class in lists given number of levels input: self : an instance of the class number_levels : number of levels considered number_initial_batches : number of batches of iteration zero """ def InitializeLists(self,number_levels,number_initial_batches): self.number_samples = [0 for _ in range (number_levels)] self.values = [[[] for _ in range (number_levels)] for _ in range (number_initial_batches)] self.raw_moment_1 = [[] for _ in range (number_levels)] self.central_moment_1 = [[] for _ in range (number_levels)] self.central_moment_2 = [[] for _ in range (number_levels)] self.central_moment_3 = [[] for _ in range (number_levels)] self.central_moment_4 = [[] for _ in range (number_levels)] self.unbiased_central_moment_2 = [[] for _ in range (number_levels)] self.power_sum_1 = [0 for _ in range (number_levels)] self.power_sum_2 = [0 for _ in range (number_levels)] self.power_sum_3 = [0 for _ in range (number_levels)] self.power_sum_4 = [0 for _ in range (number_levels)] self.power_sum_batches_1 = [[[] for _ in range (number_levels)] for _ in range (number_initial_batches)] self.power_sum_batches_2 = [[[] for _ in range (number_levels)] for _ in range (number_initial_batches)] self.power_sum_batches_3 = [[[] for _ in range (number_levels)] for _ in range (number_initial_batches)] self.power_sum_batches_4 = [[[] for _ in range (number_levels)] for _ in range (number_initial_batches)] self.h_statistics_1 = [[] for _ in range (number_levels)] self.h_statistics_2 = [[] for _ in range (number_levels)] self.h_statistics_3 = [[] for _ in range (number_levels)] self.h_statistics_4 = [[] for _ in range (number_levels)] self.skewness = [[] for _ in range (number_levels)] self.kurtosis = [[] for _ in range (number_levels)] self.central_moment_from_scratch_1 = [[] for _ in range (number_levels)] self.central_moment_from_scratch_2 = [[] for _ in range (number_levels)] self.central_moment_from_scratch_3 = [[] for _ in range (number_levels)] self.central_moment_from_scratch_3_absolute = [[] for _ in range (number_levels)] self.central_moment_from_scratch_4 = [[] for _ in range (number_levels)] self.batches_number_samples = [[0 for _ in range (number_levels)] for _ in range (number_initial_batches)] """ function updating statistic moments and number of samples input: self : an instance of the class level : defined level i_sample : defined sample in level """ def UpdateOnePassCentralMoments(self,level,i_sample): number_samples_level = self.number_samples[level] sample = self.values[level][i_sample] old_mean = self.raw_moment_1[level] # old_M1 = self.central_moment_1[level] * number_samples_level old_central_moment_1 = self.central_moment_1[level] compute_M1 = self.central_moment_1_to_compute # old_M2 = self.central_moment_2[level] * number_samples_level old_central_moment_2 = self.central_moment_2[level] compute_M2 = self.central_moment_2_to_compute # old_M3 = self.central_moment_3[level] * number_samples_level old_central_moment_3 = self.central_moment_3[level] compute_M3 = self.central_moment_3_to_compute # old_M4 = self.central_moment_4[level] * number_samples_level old_central_moment_4 = self.central_moment_4[level] compute_M4 = self.central_moment_4_to_compute new_mean,new_sample_variance,new_central_moment_1,new_central_moment_2,new_central_moment_3,new_central_moment_4,number_samples_level \ = UpdateOnePassCentralMomentsAux_Task(sample,old_mean,old_central_moment_1,compute_M1,old_central_moment_2,compute_M2,old_central_moment_3,compute_M3,old_central_moment_4,compute_M4,number_samples_level) self.raw_moment_1[level] = new_mean self.unbiased_central_moment_2[level] = new_sample_variance self.central_moment_1[level] = new_central_moment_1 self.central_moment_2[level] = new_central_moment_2 self.central_moment_3[level] = new_central_moment_3 self.central_moment_4[level] = new_central_moment_4 self.number_samples[level] = number_samples_level """ function updating the power sums S_p input: self : an instance of the class level : defined level i_sample : defined sample in level """ def UpdateOnePassPowerSums(self,level,i_sample): sample = self.values[level][i_sample] old_S1 = self.power_sum_1[level] old_S2 = self.power_sum_2[level] old_S3 = self.power_sum_3[level] old_S4 = self.power_sum_4[level] number_samples_level = self.number_samples[level] new_S1,new_S2,new_S3,new_S4,number_samples_level = UpdateOnePassPowerSumsAux_Task(sample,old_S1,old_S2,old_S3,old_S4,number_samples_level) self.power_sum_1[level] = new_S1 self.power_sum_2[level] = new_S2 self.power_sum_3[level] = new_S3 self.power_sum_4[level] = new_S4 self.number_samples[level] = number_samples_level """ function updating the global power sums input: self : an instance of the class level : current level batch_counter : current batch """ def UpdateGlobalPowerSums(self,level,batch_counter): old_S1 = self.power_sum_1[level] old_S2 = self.power_sum_2[level] old_S3 = self.power_sum_3[level] old_S4 = self.power_sum_4[level] number_samples_level = self.number_samples[level] add_S1 = self.power_sum_batches_1[batch_counter][level] add_S2 = self.power_sum_batches_2[batch_counter][level] add_S3 = self.power_sum_batches_3[batch_counter][level] add_S4 = self.power_sum_batches_4[batch_counter][level] add_number_samples_level = self.batches_number_samples[batch_counter][level] new_S1,new_S2,new_S3,new_S4,number_samples_level = UpdateGlobalPowerSumsAux_Task(old_S1,old_S2,old_S3,old_S4,number_samples_level,add_S1,add_S2,add_S3,add_S4,add_number_samples_level) self.power_sum_1[level] = new_S1 self.power_sum_2[level] = new_S2 self.power_sum_3[level] = new_S3 self.power_sum_4[level] = new_S4 self.number_samples[level] = number_samples_level """ function updating the in-batch power sums input: self : an instance of the class level : current level batch_counter : current batch mini_batch : size such that we update the in-batch power sums with mini_batch samples """ def UpdateBatchesPassPowerSum(self,level,batch_counter,mini_batch=50): samples = self.values[batch_counter][level] #for mini_batch in range (0,len(samples)): while len(samples) > 1: mini_batches_samples = samples[:mini_batch] samples = samples[mini_batch:] new_power_sums = UpdateBatchesPassPowerSumsAux_Task(*mini_batches_samples) samples.append(new_power_sums) new_S1, new_S2, new_S3, new_S4 = UnfoldValuesAux_Task(samples[0]) self.power_sum_batches_1[batch_counter][level] = new_S1 self.power_sum_batches_2[batch_counter][level] = new_S2 self.power_sum_batches_3[batch_counter][level] = new_S3 self.power_sum_batches_4[batch_counter][level] = new_S4 """ function computing the h statistics h_p from the power sums input: self : an instance of the class level : defined level """ def ComputeHStatistics(self,level): number_samples_level = self.number_samples[level] S1_level = self.power_sum_1[level] S2_level = self.power_sum_2[level] S3_level = self.power_sum_3[level] S4_level = self.power_sum_4[level] self.h_statistics_computed = True h1_level,h2_level,h3_level,h4_level = ComputeHStatisticsAux_Task(S1_level,S2_level,S3_level,S4_level,number_samples_level) self.h_statistics_1[level] = h1_level self.h_statistics_2[level] = h2_level self.h_statistics_3[level] = h3_level self.h_statistics_4[level] = h4_level """ function computing from scratch the central moments and the absolute third central moment input: self : an instance of the class level : defined level """ def ComputeSampleCentralMomentsFromScratch(self,level,number_samples_level): # initialize central moments central_moment_from_scratch_1 = 0.0 central_moment_from_scratch_2 = 0.0 central_moment_from_scratch_3 = 0.0 central_moment_from_scratch_3_absolute = 0.0 central_moment_from_scratch_4 = 0.0 central_moment_from_scratch_1_to_compute = self.central_moment_from_scratch_1_to_compute central_moment_from_scratch_2_to_compute = self.central_moment_from_scratch_2_to_compute central_moment_from_scratch_3_to_compute = self.central_moment_from_scratch_3_to_compute central_moment_from_scratch_3_absolute_to_compute = self.central_moment_from_scratch_3_absolute_to_compute central_moment_from_scratch_4_to_compute = self.central_moment_from_scratch_4_to_compute samples = [] for batch in range (len(self.values)): for mini_batch_samples in self.values[batch][level]: samples.append(mini_batch_samples) central_moment_from_scratch_1,central_moment_from_scratch_2,central_moment_from_scratch_3,central_moment_from_scratch_3_absolute,central_moment_from_scratch_4 = \ ComputeSampleCentralMomentsFromScratchAux_Task(number_samples_level,central_moment_from_scratch_1_to_compute, \ central_moment_from_scratch_2_to_compute,central_moment_from_scratch_3_to_compute,central_moment_from_scratch_3_absolute_to_compute,central_moment_from_scratch_4_to_compute, \ central_moment_from_scratch_1,central_moment_from_scratch_2,central_moment_from_scratch_3,central_moment_from_scratch_3_absolute,central_moment_from_scratch_4, samples) self.central_moment_from_scratch_1[level] = central_moment_from_scratch_1 self.central_moment_from_scratch_2[level] = central_moment_from_scratch_2 self.central_moment_from_scratch_3[level] = central_moment_from_scratch_3 self.central_moment_from_scratch_3_absolute[level] = central_moment_from_scratch_3_absolute self.central_moment_from_scratch_4[level] = central_moment_from_scratch_4 """ function computing the skewness and the kurtosis from the h statistics skewness = \mu_3 / \sqrt(\mu_2^3) kurtosis = \mu_4 / \mu_2^2 input: self : an instance of the class level : defined level """ def ComputeSkewnessKurtosis(self,level): if (self.h_statistics_computed): h2_level = self.h_statistics_2[level] h3_level = self.h_statistics_3[level] h4_level = self.h_statistics_4[level] skewness_level,kurtosis_level =ComputeSkewnessKurtosisAux_Task(h2_level,h3_level,h4_level) self.skewness[level] = skewness_level self.kurtosis[level] = kurtosis_level
51.59415
215
0.704734
14,632
0.518461
0
0
7,545
0.267345
0
0
10,056
0.356318
d71aa4de2d66c237cc707eb9393bb1bbbb06c886
75
py
Python
test/test_maximum_average_subarray_i.py
spencercjh/sync-leetcode-today-problem-python3-example
4957e5eadb697334741df0fc297bec2edaa9e2ab
[ "Apache-2.0" ]
null
null
null
test/test_maximum_average_subarray_i.py
spencercjh/sync-leetcode-today-problem-python3-example
4957e5eadb697334741df0fc297bec2edaa9e2ab
[ "Apache-2.0" ]
null
null
null
test/test_maximum_average_subarray_i.py
spencercjh/sync-leetcode-today-problem-python3-example
4957e5eadb697334741df0fc297bec2edaa9e2ab
[ "Apache-2.0" ]
null
null
null
solution = MaximumAverageSubarrayI() assert X == solution.findMaxAverage( )
37.5
38
0.8
0
0
0
0
0
0
0
0
0
0
d71b31a775449f37fd1fbb33703f6b57df4d8967
6,310
py
Python
test/test_http.py
mikiec84/gaffer
8c5d5b5e2ff3fcb1f7cc7c8fbfc623f97dd0da8d
[ "MIT", "Unlicense" ]
null
null
null
test/test_http.py
mikiec84/gaffer
8c5d5b5e2ff3fcb1f7cc7c8fbfc623f97dd0da8d
[ "MIT", "Unlicense" ]
null
null
null
test/test_http.py
mikiec84/gaffer
8c5d5b5e2ff3fcb1f7cc7c8fbfc623f97dd0da8d
[ "MIT", "Unlicense" ]
1
2018-10-28T00:59:17.000Z
2018-10-28T00:59:17.000Z
# -*- coding: utf-8 - # # This file is part of gaffer. See the NOTICE for more information. import os import time import pytest import pyuv from gaffer import __version__ from gaffer.manager import Manager from gaffer.http_handler import HttpEndpoint, HttpHandler from gaffer.httpclient import (Server, Process, ProcessId, GafferNotFound, GafferConflict) from test_manager import dummy_cmd TEST_HOST = '127.0.0.1' TEST_PORT = (os.getpid() % 31000) + 1024 TEST_PORT2 = (os.getpid() % 31000) + 1023 def start_manager(): http_endpoint = HttpEndpoint(uri="%s:%s" % (TEST_HOST, TEST_PORT)) http_handler = HttpHandler(endpoints=[http_endpoint]) m = Manager() m.start(apps=[http_handler]) time.sleep(0.2) return m def get_server(loop): return Server("http://%s:%s" % (TEST_HOST, TEST_PORT), loop=loop) def init(): m = start_manager() s = get_server(m.loop) return (m, s) def test_basic(): m = start_manager() s = get_server(m.loop) assert s.version == __version__ m.stop() m.run() def test_multiple_handers(): http_endpoint = HttpEndpoint(uri="%s:%s" % (TEST_HOST, TEST_PORT)) http_endpoint2 = HttpEndpoint(uri="%s:%s" % (TEST_HOST, TEST_PORT2)) http_handler = HttpHandler(endpoints=[http_endpoint, http_endpoint2]) m = Manager() m.start(apps=[http_handler]) time.sleep(0.2) s = Server("http://%s:%s" % (TEST_HOST, TEST_PORT), loop=m.loop) s2 = Server("http://%s:%s" % (TEST_HOST, TEST_PORT2), loop=m.loop) assert TEST_PORT != TEST_PORT2 assert s.version == __version__ assert s2.version == __version__ m.stop() m.run() def test_processes(): m, s = init() assert s.processes() == [] testfile, cmd, args, wdir = dummy_cmd() m.add_process("dummy", cmd, args=args, cwd=wdir, start=False) time.sleep(0.2) assert len(m.processes) == 1 assert len(s.processes()) == 1 assert s.processes()[0] == "dummy" m.stop() m.run() def test_process_create(): m, s = init() testfile, cmd, args, wdir = dummy_cmd() s.add_process("dummy", cmd, args=args, cwd=wdir, start=False) time.sleep(0.2) assert len(m.processes) == 1 assert len(s.processes()) == 1 assert s.processes()[0] == "dummy" assert "dummy" in m.processes assert len(m.running) == 0 with pytest.raises(GafferConflict): s.add_process("dummy", cmd, args=args, cwd=wdir, start=False) p = s.get_process("dummy") assert isinstance(p, Process) m.stop() m.run() def test_process_remove(): m, s = init() testfile, cmd, args, wdir = dummy_cmd() s.add_process("dummy", cmd, args=args, cwd=wdir, start=False) assert s.processes()[0] == "dummy" s.remove_process("dummy") assert len(s.processes()) == 0 assert len(m.processes) == 0 m.stop() m.run() def test_notfound(): m, s = init() with pytest.raises(GafferNotFound): s.get_process("dummy") m.stop() m.run() def test_process_start_stop(): m, s = init() testfile, cmd, args, wdir = dummy_cmd() p = s.add_process("dummy", cmd, args=args, cwd=wdir, start=False) assert isinstance(p, Process) p.start() time.sleep(0.2) assert len(m.running) == 1 status = p.status() assert status['running'] == 1 assert status['active'] == True assert status['max_processes'] == 1 p.stop() time.sleep(0.2) assert len(m.running) == 0 assert p.active == False s.remove_process("dummy") assert len(s.processes()) == 0 p = s.add_process("dummy", cmd, args=args, cwd=wdir, start=True) time.sleep(0.2) assert len(m.running) == 1 assert p.active == True p.restart() time.sleep(0.4) assert len(m.running) == 1 assert p.active == True m.stop() m.run() def test_process_add_sub(): m, s = init() testfile, cmd, args, wdir = dummy_cmd() p = s.add_process("dummy", cmd, args=args, cwd=wdir) time.sleep(0.2) assert isinstance(p, Process) assert p.active == True assert p.numprocesses == 1 p.add(3) time.sleep(0.2) assert p.numprocesses == 4 assert p.running == 4 p.sub(3) time.sleep(0.2) assert p.numprocesses == 1 assert p.running == 1 m.stop() m.run() def test_running(): m, s = init() testfile, cmd, args, wdir = dummy_cmd() s.add_process("dummy", cmd, args=args, cwd=wdir) time.sleep(0.2) assert len(m.running) == 1 assert len(s.running()) == 1 assert 1 in m.running assert s.running()[0] == 1 m.stop() m.run() def test_pids(): m, s = init() testfile, cmd, args, wdir = dummy_cmd() p = s.add_process("dummy", cmd, args=args, cwd=wdir) time.sleep(0.2) p = s.get_process("dummy") assert isinstance(p, Process) == True pid = s.get_process(1) assert isinstance(pid, ProcessId) == True assert pid.pid == 1 assert pid.process.get('name') == "dummy" assert p.pids == [1] pid.stop() assert 1 not in m.running time.sleep(0.2) assert p.pids == [2] m.stop() m.run() def test_groups(): m, s = init() started = [] stopped = [] def cb(evtype, info): if evtype == "start": started.append(info['name']) elif evtype == "stop": stopped.append(info['name']) m.subscribe('start', cb) m.subscribe('stop', cb) testfile, cmd, args, wdir = dummy_cmd() m.add_process("ga:a", cmd, args=args, cwd=wdir, start=False) m.add_process("ga:b", cmd, args=args, cwd=wdir, start=False) m.add_process("gb:a", cmd, args=args, cwd=wdir, start=False) groups = sorted(s.groups()) ga1 = s.get_group('ga') gb1 = s.get_group('gb') s.start_group("ga") s.stop_group("ga") time.sleep(0.2) m.remove_process("ga:a") time.sleep(0.2) ga2 = s.get_group('ga') m.stop_group("gb") def stop(handle): m.unsubscribe("start", cb) m.unsubscribe("stop", cb) m.stop() t = pyuv.Timer(m.loop) t.start(stop, 0.4, 0.0) m.run() assert groups == ['ga', 'gb'] assert ga1 == ['ga:a', 'ga:b'] assert gb1 == ['gb:a'] assert started == ['ga:a', 'ga:b'] assert stopped == ['ga:a', 'ga:b', 'gb:a'] assert ga2 == ['ga:b']
22.862319
73
0.601426
0
0
0
0
0
0
0
0
495
0.078447
d71c193d332979ad562f8d1039609bbf9888baf0
1,366
py
Python
tmi/api/io.py
fish2000/TMI
e849545644b99c132ecde24427531edd45213614
[ "BSD-3-Clause" ]
null
null
null
tmi/api/io.py
fish2000/TMI
e849545644b99c132ecde24427531edd45213614
[ "BSD-3-Clause" ]
null
null
null
tmi/api/io.py
fish2000/TMI
e849545644b99c132ecde24427531edd45213614
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import print_function from enum import unique import sys from clu.enums import AliasingEnum, alias from clu.exporting import Exporter exporter = Exporter(path=__file__) export = exporter.decorator() @unique class Status(AliasingEnum): DISCARD = 200 REPLACE_TEXT = 201 REPLACE_DOCUMENT = 202 INSERT_TEXT = 203 INSERT_SNIPPET = 204 SHOW_HTML = 205 SHOW_TOOLTIP = 206 NEW_DOCUMENT = 207 INSERT_SNIPPET_NOINDENT = 208 NOP = alias(DISCARD) CREATE_NEW_DOCUMENT = alias(NEW_DOCUMENT) @property def code(self): return int(self.value) def exit(self, output): sys.stdout.write(output) sys.stdout.flush() sys.exit(self.code) # Assign the modules’ `__all__` and `__dir__` using the exporter: __all__, __dir__ = exporter.all_and_dir() def test(): # from clu.testing.utils import inline # @inline def test_one(): pass # INSERT TESTING CODE HERE, pt. I #@inline def test_two(): pass # INSERT TESTING CODE HERE, pt. II #@inline.diagnostic def show_me_some_values(): pass # INSERT DIAGNOSTIC CODE HERE # return inline.test(100) if __name__ == '__main__': sys.exit(test())
22.393443
65
0.614934
584
0.426901
0
0
592
0.432749
0
0
295
0.215643
d71cffea04fc4afe67a3b3abc9d1b2f6ae38f8e9
4,256
py
Python
Numpy/Num.py
shreejitverma/Data-Scientist
03c06936e957f93182bb18362b01383e5775ffb1
[ "MIT" ]
2
2022-03-12T04:53:03.000Z
2022-03-27T12:39:21.000Z
Numpy/Num.py
shivaniverma1/Data-Scientist
f82939a411484311171465591455880c8e354750
[ "MIT" ]
null
null
null
Numpy/Num.py
shivaniverma1/Data-Scientist
f82939a411484311171465591455880c8e354750
[ "MIT" ]
2
2022-03-12T04:52:21.000Z
2022-03-27T12:45:32.000Z
# Create list baseball import numpy as np baseball = [180, 215, 210, 210, 188, 176, 209, 200] # Import the numpy package as np # Create a numpy array from baseball: np_baseball np_baseball = np.array(baseball) # Print out type of np_baseball print(type(np_baseball)) # height is available as a regular list # Import numpy # Create a numpy array from height_in: np_height_in np_height_in = np.array(height_in) # Print out np_height_in print(np_height_in) # Convert np_height_in to m: np_height_m np_height_m = np_height_in * 0.0254 # Print np_height_m print(np_height_m) # height and weight are available as regular lists # Import numpy # Create array from height_in with metric units: np_height_m np_height_m = np.array(height_in) * 0.0254 # Create array from weight_lb with metric units: np_weight_kg np_weight_kg = np.array(weight_lb)*0.453592 # Calculate the BMI: bmi bmi = np_weight_kg/(np_height_m**2) # height and weight are available as a regular lists # Import numpy # Calculate the BMI: bmi np_height_m = np.array(height_in) * 0.0254 np_weight_kg = np.array(weight_lb) * 0.453592 bmi = np_weight_kg / np_height_m ** 2 # Create the light array light = bmi < 21 # Print out light print(light) # height and weight are available as a regular lists # Import numpy # Store weight and height lists as numpy arrays np_weight_lb = np.array(weight_lb) np_height_in = np.array(height_in) # Print out the weight at index 50 print(np_weight_lb[50]) # Print out sub-array of np_height_in: index 100 up to and including index 110 print(np_height_in[100:111]) # Create baseball, a list of lists baseball = [[180, 78.4], [215, 102.7], [210, 98.5], [188, 75.2]] # Import numpy # Create a 2D numpy array from baseball: np_baseball np_baseball = np.array(baseball) # Print out the type of np_baseball print(type(np_baseball)) # baseball is available as a regular list of lists # Import numpy package # Create a 2D numpy array from baseball: np_baseball np_baseball = np.array(baseball) # Print out the shape of np_baseball print(np_baseball.shape) # baseball is available as a regular list of lists # Import numpy package # Create np_baseball (2 cols) np_baseball = np.array(baseball) # Print out the 50th row of np_baseball print(np_baseball[49, :]) # Select the entire second column of np_baseball: np_weight_lb np_weight_lb = np_baseball[:, 1] # Print out height of 124th player # baseball is available as a regular list of lists # updated is available as 2D numpy array # Import numpy package # Create np_baseball (3 cols) np_baseball = np.array(baseball) # Print out addition of np_baseball and updated print(np_baseball+updated) # Create numpy array: conversion conversion = np.array([0.0254, 0.453592, 1]) # np_baseball is available # Import numpy # Create np_height_in from np_baseball np_height_in = np_baseball[:, 0] # Print out the mean of np_height_in print(np_height_in.mean()) # Print out the median of np_height_in print(np.median(np_height_in)) # np_baseball is available # Import numpy # Print mean height (first column) avg = np.mean(np_baseball[:, 0]) print("Average: " + str(avg)) # Print median height. Replace 'None' med = np.median(np_baseball[:, 0]) print("Median: " + str(med)) # Print out the standard deviation on height. Replace 'None' stddev = np.std(np_baseball[:, 0]) print("Standard Deviation: " + str(stddev)) # Print out correlation between first and second column. Replace 'None' corr = np.corrcoef(np_baseball[:, 0], np_baseball[:, 1]) print("Correlation: " + str(corr)) # heights and positions are available as lists # Import numpy # Convert positions and heights to numpy arrays: np_positions, np_heights np_positions = np.array(positions) np_heights = np.array(heights) # Heights of the goalkeepers: gk_heights gk_heights = np_heights[np_positions == 'GK'] # Heights of the other players: other_heights other_heights = np_heights[np_positions != 'GK'] # Print out the median height of goalkeepers. Replace 'None' print("Median height of goalkeepers: " + str(np.median(gk_heights))) # Print out the median height of other players. Replace 'None' print("Median height of other players: " + str(np.median(other_heights)))
22.638298
78
0.743186
0
0
0
0
0
0
0
0
2,503
0.588111
d71d1bf7f27ba4c1c44e668d8bb681ca4183dc5f
3,469
py
Python
REMARKs/SolvingMicroDSOPs/Calibration/SetupSCFdata.py
ngkratts/REMARK
92c057a93a7d10a890696db55f874d5fde394b91
[ "Apache-2.0" ]
18
2019-01-28T13:17:39.000Z
2021-09-10T16:29:55.000Z
REMARKs/SolvingMicroDSOPs/Calibration/SetupSCFdata.py
ngkratts/REMARK
92c057a93a7d10a890696db55f874d5fde394b91
[ "Apache-2.0" ]
89
2019-01-06T19:32:34.000Z
2021-08-30T13:30:48.000Z
REMARKs/SolvingMicroDSOPs/Calibration/SetupSCFdata.py
ngkratts/REMARK
92c057a93a7d10a890696db55f874d5fde394b91
[ "Apache-2.0" ]
50
2018-08-01T16:33:06.000Z
2021-10-05T20:20:26.000Z
''' Sets up the SCF data for use in the SolvingMicroDSOPs estimation. ''' from __future__ import division # Use new division function from __future__ import print_function from __future__ import absolute_import from builtins import zip from builtins import str from builtins import range import os, sys # Find pathname to this file: my_file_path = os.path.dirname(os.path.abspath(__file__)) # Pathnames to the other files: calibration_dir = os.path.join(my_file_path, "../Calibration/") # Relative directory for primitive parameter files tables_dir = os.path.join(my_file_path, "../Tables/") # Relative directory for primitive parameter files figures_dir = os.path.join(my_file_path, "../Figures/") # Relative directory for primitive parameter files code_dir = os.path.join(my_file_path, "../Code/") # Relative directory for primitive parameter files # Need to rely on the manual insertion of pathnames to all files in do_all.py # NOTE sys.path.insert(0, os.path.abspath(tables_dir)), etc. may need to be # copied from do_all.py to here # Import files first: from EstimationParameters import initial_age, empirical_cohort_age_groups # The following libraries are part of the standard python distribution import numpy as np # Numerical Python import csv # Comma-separated variable reader # Set the path to the empirical data: scf_data_path = data_location = os.path.dirname(os.path.abspath(__file__)) # os.path.abspath('./') #'./' # Open the file handle and create a reader object and a csv header infile = open(scf_data_path + '/SCFdata.csv', 'r') csv_reader = csv.reader(infile) data_csv_header = next(csv_reader) # Pull the column index from the data_csv_header data_column_index = data_csv_header.index('wealth_income_ratio') # scf_w_col age_group_column_index = data_csv_header.index('age_group') # scf_ages_col data_weight_column_index = data_csv_header.index('weight') # scf_weights_col # Initialize empty lists for the data w_to_y_data = [] # Ratio of wealth to permanent income empirical_weights = [] # Weighting for this observation empirical_groups = [] # Which age group this observation belongs to (1-7) # Read in the data from the datafile by looping over each record (row) in the file. for record in csv_reader: w_to_y_data.append(np.float64(record[data_column_index])) empirical_groups.append(np.float64(record[age_group_column_index])) empirical_weights.append(np.float64(record[data_weight_column_index])) # Generate a single array of SCF data, useful for resampling for bootstrap scf_data_array = np.array([w_to_y_data,empirical_groups,empirical_weights]).T # Convert SCF data to numpy's array format for easier math w_to_y_data = np.array(w_to_y_data) empirical_groups = np.array(empirical_groups) empirical_weights = np.array(empirical_weights) # Close the data file infile.close() # Generate a mapping between the real ages in the groups and the indices of simulated data simulation_map_cohorts_to_age_indices = [] for ages in empirical_cohort_age_groups: simulation_map_cohorts_to_age_indices.append(np.array(ages) - initial_age) if __name__ == '__main__': print("Sorry, SetupSCFdata doesn't actually do anything on its own.") print("This module is imported by StructEstimation, providing data for") print("the example estimation. Please see that module if you want more") print("interesting output.")
41.795181
114
0.763909
0
0
0
0
0
0
0
0
1,725
0.497261
d71d1d8702943a9a53fdd7509061a707d77261fd
31,436
py
Python
build/lib/app/routes.py
Dialjini/BarsCrm_backend
490894b676f27de846c33af9dd67a7ad8677818c
[ "Apache-2.0" ]
null
null
null
build/lib/app/routes.py
Dialjini/BarsCrm_backend
490894b676f27de846c33af9dd67a7ad8677818c
[ "Apache-2.0" ]
null
null
null
build/lib/app/routes.py
Dialjini/BarsCrm_backend
490894b676f27de846c33af9dd67a7ad8677818c
[ "Apache-2.0" ]
null
null
null
from app import app from flask import render_template, redirect, session, request, send_from_directory from app import models, db, reqs from flask_socketio import SocketIO, emit import json from xhtml2pdf import pisa import os from datetime import datetime socketio = SocketIO(app) if __name__ == '__main__': socketio.run(app) usernames = {} class Inside_date: def __init__(self, d, m, y): months = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'] self.d = d self.m = months[m - 1] self.y = y @socketio.on('connection') def user_connected(): print("user connect") @socketio.on('add user') def add_user(data): global usernames print("add user") print(data) session['username'] = data usernames[data] = session['username'] emit('user joined', {'username': session['username']}, broadcast= True) def sendTasks(): tasks = [] Tasks = models.Tasks.query.all() if models.User.query.filter_by(login=session['username']).first(): user = models.User.query.filter_by(login=session['username']).first() else: user = models.User.query.filter_by(email=session['username']).first() for i in Tasks: try: if 'all' in json.loads(i.Visibility): tasks.append(json.loads(table_to_json([i]))[0]) elif str(user.id) in json.loads(i.Visibility): tasks.append(json.loads(table_to_json([i]))[0]) except Exception as er: print(er) emit('showTasks', json.dumps(tasks)) @socketio.on('addTask') def addTask(message): task = models.Tasks() task.Visibility = json.dumps(message['data']['task_whom']) task.User_id = int(message['data']['task_who']) task.Type = message['data']['task_type'] task.Date = message['data']['task_date'] task.Time = message['data']['task_time'] task.Comment = message['data']['task_comment'] db.session.add(task) db.session.commit() emit('refreshTasks', broadcast=True) @socketio.on('showTasks') def showTasks(): sendTasks() def table_to_json(query): result = [] for i in query: subres = i.__dict__ if '_sa_instance_state' in subres: subres.pop('_sa_instance_state', None) if 'Date' in subres: if subres['Date'] != None: try: subres['Date'] = subres['Date'].strftime("%d.%m.%Y") except Exception: print(subres['Date']) result.append(subres) return json.dumps(result) def to_PDF(owner, name, delivery): document = models.Document() if name == "Договор": name = "Dogovor" document.Type = 'Dogovor' else: name = "Zayavka" document.Type = 'Zayavka' f = open(os.path.dirname(__file__) + '/upload/{}.pdf'.format(owner.__tablename__ + str(owner.id)), "w+b") info = reqs.getINNinfo(owner.UHH)['suggestions'][0] date = Inside_date(d=str(datetime.now().day), m=int(datetime.now().month), y=str(datetime.now().year)) document.Client_name = info['value'] document.UHH = owner.UHH document.Date = str(datetime.now().month) + '/' + str(datetime.now().year) document.Client_contact_name = info['data']['management']['name'] document.Bik = owner.Bik document.KPP = info['data']['kpp'] document.rc = owner.rc document.kc = owner.kc document.Owner_id = owner.id document.MonthNum = document.getMonthNum() document.OGRN = info['data']['ogrn'] if delivery != '': Client = models.Client.query.filter_by(Name=delivery.Client).first() Delivery_client_info = {'Name': Client.Name, 'Address': Client.Adress} else: Delivery_client_info = '' db.session.add(document) db.session.commit() html = render_template('{}.html'.format(name), document=document, date=date, owner=owner, path=os.path.dirname(__file__), delivery=delivery, Delivery_client_info=Delivery_client_info) pisa.CreatePDF(html, dest=f, encoding='utf-8') f.close() dir_u = os.path.abspath(os.path.dirname(__file__) + '/upload') return send_from_directory(directory=dir_u, filename='{}.pdf'.format(owner.__tablename__ + str(owner.id))) @app.route('/') @app.route('/index') def index(): try: print(session['username']) except Exception: print("Not logged in") if 'username' in session: return render_template('index.html') else: return render_template('login.html') @app.route('/getAllTasks') def getAllTasks(): return table_to_json(models.Tasks.query.all()) @app.route('/auth', methods=['GET']) def auth(): if 'login' in request.args: login = request.args['login'] else: return 'ERROR 400 BAD REQUEST' if 'password' in request.args: password = request.args['password'] else: return 'ERROR 400 BAD REQUEST' if models.User.query.filter_by(login=login).first(): user = models.User.query.filter_by(login=login).first() if user.password == password: session['username'] = login # join_room('all') return redirect('/', code=302) return json.dumps({'message': 'Неверный пароль', 'success': False}) elif models.User.query.filter_by(email=login).first(): user = models.User.query.filter_by(email=login).first() if user.password == password: session['username'] = login return redirect('/', code=302) return json.dumps({'message': 'Неверный пароль', 'success': False}) return json.dumps({'message': 'Неверный логин/email', 'success': False}) @app.route('/logout', methods=['GET']) def logout(): if 'username' in session: session.pop('username', None) return redirect('/', code=302) @app.route('/addAccountPaymentHistory', methods=['GET']) def addAccountPaymentHistory(): table = models.Account.query.filter_by(id=request.args['account_id']).first() table.Payment_history = request.args['account_payment_history'] db.session.commit() return 'OK' @app.route('/getTemplates', methods=['GET']) def getTemplates(): if 'username' in session: return table_to_json(models.Template.query.all()) else: return redirect('/', code=302) @app.route('/downloadDoc', methods=['GET']) def downloadDoc(): if request.args['name'] == 'Заявка': delivery = models.Delivery.query.filter_by(id=request.args['delivery_id']) else: delivery = '' if 'username' in session: if request.args['category'] == 'client': owner = models.Client.query.filter_by(id=request.args['card_id']).first() elif request.args['category'] == 'provider': owner = models.Provider.query.filter_by(id=request.args['card_id']).first() elif request.args['category'] == 'carrier': owner = models.Carrier.query.filter_by(id=request.args['card_id']).first() else: return 'Error 400' return to_PDF(owner, request.args['name'], delivery) else: return redirect('/', code=302) @app.route('/getClients', methods=['GET']) def getClients(): if 'username' in session: return table_to_json(models.Client.query.all()) else: return redirect('/', code=302) @app.route('/deleteMember', methods=['GET']) def deleteMember(): user = models.User.query.filter_by(id=request.args['id']).first() db.session.delete(user) db.session.commit() return 'OK' @app.route('/stockTransit', methods=['GET']) def stockTransit(): Item = models.Item.query.filter_by(Item_id=request.args['id_product']).first() Stock = models.Stock.query.filter_by(Name=request.args['stock_select']).first() for i in Stock.Items: if i.Name == Item.Name: Item.Volume = str(int(Item.Volume) - int(request.args['product_volume'])) i.Volume = str(int(i.Volume) + int(request.args['product_volume'])) db.session.commit() return 'OK' item = models.Item() item.Weight = Item.Weight item.Packing = Item.Packing item.Fraction = Item.Fraction item.Creator = Item.Creator item.Name = Item.Name item.Cost = Item.Cost Item.Volume = str(int(Item.Volume) - int(request.args['product_volume'])) item.Volume = str(request.args['product_volume']) item.NDS = Item.NDS item.Group_id = Item.Group_id item.Prefix = Item.Prefix item.Group_name = Item.Group_name Stock.Items.append(item) db.session.commit() return 'OK' @app.route('/findContacts', methods=['GET']) def findContacts(): if 'username' in session: result = [] data = request.args['data'] Contacts = models.Contacts.query.all() Deliveryies = models.Delivery.query.all() Users = models.User.query.all() for i in Deliveryies: if i['Contact_End'] == data or i['Contact_Number'] == data: result.append(json.loads(table_to_json([i]))[0]) for i in Contacts: if i.Number == data or i.Email == data: result.append(json.loads(table_to_json([i]))[0]) for i in Users: if i.email == data: subres = json.loads(table_to_json([i]))[0] subres.pop('password', None) result.append(subres) return json.dumps(result) else: return redirect('/', code=302) @app.route('/getMessages', methods=['GET']) def getMessages(): if 'username' in session: if request.args['category'] == 'client': client = request.args['id'] Client = models.Client.query.filter_by(id=client).first() return table_to_json(models.Notes.query.filter_by(Author=Client).all()) elif request.args['category'] == 'provider': provider = request.args['id'] Provider = models.Provider.query.filter_by(id=provider).first() return table_to_json(models.Notes.query.filter_by(Provider=Provider).all()) elif request.args['category'] == 'carrier': carrier = request.args['id'] Carrier = models.Provider.query.filter_by(id=carrier).first() return table_to_json(models.Notes.query.filter_by(Carrier=Carrier).all()) else: return 'ERROR 400 BAD REQUEST' else: return redirect('/', code=302) @app.route('/addMessages', methods=['GET']) def addMessages(): if 'username' in session: if request.args['category'] == 'client': Owner = models.Client.query.filter_by(id=request.args['id']).first() elif request.args['category'] == 'provider': Owner = models.Provider.query.filter_by(id=request.args['id']).first() else: Owner = models.Carrier.query.filter_by(id=request.args['id']).first() i = json.loads(request.args['comments']) Message = models.Notes() Message.Date = i['comment_date'] Message.Manager = i['comment_role'] Message.Note = i['comment_content'] if request.args['category'] == 'client': Message.Client_id = request.args['id'] elif request.args['category'] == 'provider': Message.Provider_id = request.args['id'] elif request.args['category'] == 'carrier': Message.Carrier_id = request.args['id'] Owner.Notes.append(Message) db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/getDeliveries', methods=['GET']) def getDeliveries(): if 'username' in session: deliveries = models.Delivery.query.all() result = [] carriers = models.Carrier.query.all() for delivery in deliveries: if delivery.Carrier_id: print(len(carriers)) carrier = carriers[delivery.Carrier_id - 1] result.append({'carrier': json.loads(table_to_json([carrier]))[0], 'delivery': json.loads(table_to_json([delivery]))[0]}) else: result.append({'carrier': None, 'delivery': json.loads(table_to_json([delivery]))[0]}) return json.dumps(result) else: return redirect('/', code=302) @app.route('/addDelivery', methods=['GET']) def addDelivery(): if 'username' in session: data = request.args print(data['delivery_id']) if data['delivery_id'] == 'new': table = models.Delivery() else: table = models.Delivery.query.filter_by(id=data['delivery_id']).first() table.Name = data['delivery_name'] table.Date = data['delivery_date'] table.Price = data['delivery_price'] table.Contact_Number = data['delivery_contact_number'] table.Contact_Name = data['delivery_contact_name'] if data['delivery_carrier_id']: table.Carrier_id = data['delivery_carrier_id'] if data['delivery_account_id']: table.Account_id = data['delivery_account_id'] table.Comment = data['delivery_comment'] table.Client = data['delivery_client'] table.NDS = data['delivery_vat'] table.Contact_End = data['delivery_contact_end'] table.Customer = data['delivery_customer'] table.End_date = data['delivery_end_date'] table.Load_type = data['delivery_load_type'] table.Payment_date = data['delivery_payment_date'] table.Prefix = data['delivery_prefix'] table.Start_date = data['delivery_start_date'] table.Stock = data['delivery_stock'] table.Type = data['delivery_type'] table.Item_ids = data['delivery_item_ids'] table.Amounts = data['delivery_amounts'] table.Auto = data['delivery_car'] table.Passport_data = data['delivery_passport'] if 'payment_list' in data: table.Payment_list = data['payment_list'] else: table.Payment_list = None if data['delivery_id'] == 'new': db.session.add(table) db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/getContacts', methods=['GET']) def getContacts(): if 'username' in session: if request.args['category'] == 'client': client = request.args['id'] Client = models.Client.query.filter_by(id=client).first() return table_to_json(models.Contacts.query.filter_by(Owner=Client).all()) elif request.args['category'] == 'provider': provider = request.args['id'] Provider = models.Provider.query.filter_by(id=provider).first() return table_to_json(models.Contacts.query.filter_by(Provider=Provider).all()) elif request.args['category'] == 'carrier': carrier = request.args['id'] Carrier = models.Provider.query.filter_by(id=carrier).first() return table_to_json(models.Contacts.query.filter_by(Carrier=Carrier).all()) else: return 'ERROR 400 BAD REQUEST' else: return redirect('/', code=302) @app.route('/addStock', methods=['GET']) def addStock(): if 'username' in session: name = request.args['stock_name'] stock = models.Stock() stock.Name = name db.session.add(stock) db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/getStockTable', methods=['GET']) def getStockTable(): if 'username' in session: result = [] Stocks = models.Stock.query.all() for stock in Stocks: subres = {'items': json.loads(table_to_json(stock.Items))} subres['stock_address'] = stock.Name result.append(subres) return json.dumps(result) else: return redirect('/', code=302) @app.route('/getStockItems', methods=['GET']) def getStockItems(): if 'username' in session: data = request.args Stocks = models.Stock.query.filter_by(id=data['stock_id']).all() if len(Stocks): Stock = Stocks[0] else: return 'Bad Stock' return table_to_json(Stock.Items) else: return redirect('/', code=302) @app.route('/addItemGroup', methods=['GET']) def addItemGroup(): if 'username' in session: group = models.Item_groups() group.Group = request.args['group_name'] db.session.add(group) db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/getItemGroup', methods=['GET']) def getItemGroup(): if 'username' in session: return table_to_json(models.Item_groups.query.all()) else: return redirect('/', code=302) @app.route('/getAllItems', methods=['GET']) def getAllItems(): if 'username' in session: return table_to_json(models.Item.query.all()) else: return redirect('/', code=302) @app.route('/getAccounts', methods=['GET']) def getAccounts(): if 'username' in session: result = [] Items = models.Item.query.all() for i in models.Account.query.all(): items = [] for j in json.loads(i.Item_ids): print(j) item = Items[int(j['id']) - 1] subres = json.loads(table_to_json([item]))[0] subres['Transferred_volume'] = j['volume'] items.append(subres) account = json.loads(table_to_json([i]))[0] subres = {'items': items, 'account': account} result.append(subres) return json.dumps(result) else: return redirect('/', code=302) @app.route('/addUser', methods=['GET']) def addUser(): if 'username' in session: data = request.args if data['id'] == 'new': user = models.User() else: user = models.User.query.filter_by(id=data['id']).first() user.login = data['create_login'] user.email = data['create_email'] user.second_name = data['create_last_name'] user.name = data['create_first_name'] user.third_name = data['create_patronymic'] user.role = data['create_role'] user.password = data['create_password'] if data['id'] == 'new': db.session.add(user) db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/addAccount', methods=['GET']) def addAccount(): if 'username' in session: data = request.args table = models.Account() table.Name = data['name'] table.Status = data['status'] table.Date = data['date'] table.Hello = data['hello'] table.Sale = data['sale'] table.Shipping = data['shipping'] table.Sum = data['sum'] table.Item_ids = data['item_ids'] db.session.add(table) db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/addItemToStock', methods=['GET']) def addItemToStock(): if 'username' in session: data = request.args Stocks = models.Stock.query.filter_by(id=data['stock_id']).all() if len(Stocks): Stock = Stocks[0] else: return 'Bad Stock' item = models.Item() item.Weight = data['item_weight'] item.Packing = data['item_packing'] item.Fraction = data['item_fraction'] item.Creator = data['item_creator'] item.Name = data['item_product'] item.Cost = data['item_price'] item.Volume = data['item_volume'] item.NDS = data['item_vat'] item.Group_id = data['group_id'] item.Prefix = data['item_prefix'] item.Group_name = models.Item_groups.query.filter_by(id=data['group_id']).first().Group Stock.Items.append(item) db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/getStocks', methods=['GET']) def getStocks(): if 'username' in session: return table_to_json(models.Stock.query.all()) else: return redirect('/', code=302) @app.route('/addContacts', methods=['GET']) def addContacts(): if 'username' in session: if request.args['category'] == 'client': Owner = models.Client.query.filter_by(id=request.args['id']).first() elif request.args['category'] == 'provider': Owner = models.Provider.query.filter_by(id=request.args['id']).first() else: Owner = models.Carrier.query.filter_by(id=request.args['id']).first() Contacts = [] args = json.loads(request.args['contacts']) for i in args: Contact = models.Contacts() Contact.Name = i['first_name'] Contact.Last_name = i['last_name'] Contact.Number = i['phone'] Contact.Email = i['email'] Contact.Position = i['role'] Contact.Visible = i['visible'] if request.args['category'] == 'client': Contact.Client_id = request.args['id'] elif request.args['category'] == 'provider': Contact.Provider_id = request.args['id'] elif request.args['category'] == 'carrier': Contact.Carrier_id = request.args['id'] Contacts.append(Contact) Owner.Contacts = Contacts db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/addManagerToCard', methods=['GET']) def addManagerToCard(): if 'username' in session: if request.args['category'] == 'client': Owner = models.Client.query.filter_by(id=request.args['card_id']).first() elif request.args['category'] == 'provider': Owner = models.Provider.query.filter_by(id=request.args['card_id']).first() else: return '400 BAD REQUEST' Owner.Manager_active = True Owner.Manager_id = request.args['manager_id'] db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/deleteManagerFromCard', methods=['GET']) def deleteManagerFromCard(): if 'username' in session: if request.args['category'] == 'client': Owner = models.Client.query.filter_by(id=request.args['card_id']).first() elif request.args['category'] == 'provider': Owner = models.Provider.query.filter_by(id=request.args['card_id']).first() else: return '400 BAD REQUEST' Owner.Manager_active = False Owner.Manager_date = request.args['date'] db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/getThisUser', methods=['GET']) def getThisUser(): if 'username' in session: if models.User.query.filter_by(login=session['username']).first(): user = models.User.query.filter_by(login=session['username']).first() else: user = models.User.query.filter_by(email=session['username']).first() result = json.loads(table_to_json([user]))[0] result.pop('password', None) return json.dumps(result) else: return redirect('/', code=302) @app.route('/addItems', methods=['GET']) def addItems(): if 'username' in session: if request.args['category'] == 'client': isClient = True Owner = models.Client.query.filter_by(id=request.args['id']).first() elif request.args['category'] == 'provider': isClient = False Owner = models.Provider.query.filter_by(id=request.args['id']).first() else: return '400 BAD REQUEST' Items = [] args = json.loads(request.args['item']) for i in args: if i['item_product']: Item = models.Junk_item() if isClient: Item.Volume = i['item_volume'] Item.Creator = i['item_creator'] Item.Client_id = request.args['id'] else: Item.NDS = i['item_vat'] Item.Fraction = i['item_fraction'] Item.Packing = i['item_packing'] Item.Weight = i['item_weight'] Item.Provider_id = request.args['id'] Item.Name = i['item_product'] Item.Cost = i['item_price'] Items.append(Item) Owner.Junk_items = Items db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/getItems', methods=['GET']) def getItems(): if 'username' in session: if request.args['category'] == 'client': client = request.args['id'] Client = models.Client.query.filter_by(id=client).first() return table_to_json(models.Junk_item.query.filter_by(Client=Client).all()) elif request.args['category'] == 'provider': provider = request.args['id'] Provider = models.Provider.query.filter_by(id=provider).first() return table_to_json(models.Junk_item.query.filter_by(Provider=Provider).all()) elif request.args['category'] == 'carrier': carrier = request.args['id'] Carrier = models.Provider.query.filter_by(id=carrier).first() return table_to_json(models.Junk_item.query.filter_by(Carrier=Carrier).all()) else: return 'ERROR 400 BAD REQUEST' else: return redirect('/', code=302) @app.route('/getProviders', methods=['GET']) def getProviders(): if 'username' in session: return table_to_json(models.Provider.query.all()) else: return redirect('/', code=302) @app.route('/getTasks', methods=['GET']) def getTasks(login): if 'username' in session: user = models.User.query.filter_by(login=login).first() return user.get_task_by_login() else: return redirect('/', code=302) @app.route('/getUsers', methods=['GET']) def getUsers(): if 'username' in session: return table_to_json(models.User.query.all()) else: return redirect('/', code=302) @app.route('/getCarriers', methods=['GET']) def getCarriers(): if 'username' in session: return table_to_json(models.Carrier.query.all()) else: return redirect('/', code=302) @app.route('/addProvider', methods=['GET']) def addProvider(): if 'username' in session: data = request.args if data['provider_data'] != 'new': new = False else: new = True if not new: Provider = models.Provider.query.filter_by(id=data['provider_data']).first() else: Provider = models.Provider() Provider.Name = data['provider_name'] Provider.Rayon = data['provider_area'] Provider.Category = data['provider_category'] Provider.Distance = data['provider_distance'] Provider.UHH = data['provider_inn'] Provider.Price = data['provider_price'] Provider.Oblast = data['provider_region'] Provider.Train = data['provider_station'] Provider.Tag = data['provider_tag'] Provider.Adress = data['provider_address'] Provider.NDS = data['provider_vat'] Provider.Merc = data['provider_merc'] Provider.Volume = data['provider_volume'] Provider.Holding = data['provider_holding'] if new: db.session.add(Provider) db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/addComment', methods=['GET']) def addComment(): if 'username' in session: if request.args['category'] == 'client': Owner = models.Client.query.filter_by(id=request.args['id']).first() elif request.args['category'] == 'provider': Owner = models.Provider.query.filter_by(id=request.args['id']).first() elif request.args['category'] == 'carrier': Owner = models.Carrier.query.filter_by(id=request.args['id']).first() else: return '400 BAD REQUEST' Owner.Comment = request['comment'] db.session.commit() else: return redirect('/', code=302) @app.route('/getComment', methods=['GET']) def getComment(): if 'username' in session: if request.args['category'] == 'client': Owner = models.Client.query.filter_by(id=request.args['id']).first() elif request.args['category'] == 'provider': Owner = models.Provider.query.filter_by(id=request.args['id']).first() elif request.args['category'] == 'carrier': Owner = models.Carrier.query.filter_by(id=request.args['id']).first() else: return '400 BAD REQUEST' return Owner.Comment else: return redirect('/', code=302) @app.route('/addCarrier', methods=['GET']) def addCarier(): if 'username' in session: data = request.args if data['carrier_data'] != 'new': new = False else: new = True if not new: Carrier = models.Carrier.query.filter_by(id=data['carrier_data']).first() else: Carrier = models.Carrier() Carrier.Name = data['carrier_name'] Carrier.Address = data['carrier_address'] Carrier.Area = data['carrier_area'] Carrier.Capacity = data['carrier_capacity'] Carrier.UHH = data['carrier_inn'] Carrier.Region = data['carrier_region'] Carrier.View = data['carrier_view'] if new: db.session.add(Carrier) db.session.commit() return 'OK' else: return redirect('/', code=302) @app.route('/addClient', methods=['GET']) def addClient(): if 'username' in session: data = request.args if data['client_data'] != 'new': new = False else: new = True if not new: Client = models.Client.query.filter_by(id=data['client_data']).first() else: Client = models.Client() Client.Name = data['client_name'] Client.Rayon = data['client_area'] Client.Category = data['client_category'] Client.Distance = data['client_distance'] Client.Segment = data['client_industry'] Client.UHH = data['client_inn'] Client.Price = data['client_price'] Client.Oblast = data['client_region'] Client.Station = data['client_station'] Client.Tag = data['client_tag'] Client.Adress = data['client_address'] Client.Holding = data['client_holding'] Client.Site = data['client_site'] Client.Demand_item = data['demand_product'] Client.Demand_volume = data['demand_volume'] Client.Livestock_all = data['livestock_general'] Client.Livestock_milking = data['livestock_milking'] Client.Livestock_milkyield = data['livestock_milkyield'] if new: db.session.add(Client) db.session.commit() return 'OK' else: return redirect('/', code=302)
32.677755
110
0.594637
344
0.0109
0
0
27,834
0.881939
0
0
5,709
0.180894
d71dbac43bd9efda4e60dfd4b71b2414be991d39
790
py
Python
ch2Perceptron/example2.py
junseokpark/deepLearningFromScratch
07c225a86502a16f4475a3a6a346fd6203bf9f40
[ "MIT" ]
null
null
null
ch2Perceptron/example2.py
junseokpark/deepLearningFromScratch
07c225a86502a16f4475a3a6a346fd6203bf9f40
[ "MIT" ]
null
null
null
ch2Perceptron/example2.py
junseokpark/deepLearningFromScratch
07c225a86502a16f4475a3a6a346fd6203bf9f40
[ "MIT" ]
null
null
null
import numpy as np x = np.array([0,1]) w = np.array([0.5,0.5]) b = -0.7 print(w*x) print(np.sum(w*x)) print(np.sum(w*x)+b) def AND(x1,x2): x = np.array([x1,x2]) w = np.array([0.5,0.5]) b = -0.7 tmp = np.sum(w*x)+b if tmp <= 0: return 0 else: return 1 def NAND(x1,x2): x = np.array([x1,x2]) w = np.array([-0.5,-0.5]) b = 0.7 tmp = np.sum(w * x) + b if tmp <= 0: return 0 else: return 1 def OR(x1,x2): x = np.array([x1,x2]) w = np.array([0.5,0.5]) b = -0.2 tmp = np.sum(w*x)+b if tmp <= 0: return 0 else: return 1 def XOR(x1,x2): s1 = NAND(x1,x2) s2 = OR(x1,x2) y = AND(s1,s2) return y print(XOR(0,0)) print(XOR(1,0)) print(XOR(0,1)) print(XOR(1,1))
15.8
29
0.46962
0
0
0
0
0
0
0
0
0
0
d71ede6a1c08ec38b1d5adae7fd269d6b1aa94ed
2,413
py
Python
model/custom_resnet.py
gkdivya/torch-cv-wrapper
fe30c32e0a6293c1301521ce45a72a9d63354942
[ "MIT" ]
2
2021-08-03T12:16:32.000Z
2021-09-04T07:36:31.000Z
model/custom_resnet.py
gkdivya/torch-cv-wrapper
fe30c32e0a6293c1301521ce45a72a9d63354942
[ "MIT" ]
null
null
null
model/custom_resnet.py
gkdivya/torch-cv-wrapper
fe30c32e0a6293c1301521ce45a72a9d63354942
[ "MIT" ]
3
2021-07-03T15:04:14.000Z
2021-08-05T11:08:09.000Z
import torch import torch.nn as nn import torch.nn.functional as F class BasicBlock(nn.Module): def __init__(self, in_planes, planes, stride=1): super(BasicBlock, self).__init__() self.conv1 = nn.Conv2d( in_planes, planes, kernel_size=3, stride=stride, padding=1, bias=False) self.bn1 = nn.BatchNorm2d(planes) self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=1, padding=1, bias=False) self.bn2 = nn.BatchNorm2d(planes) self.relu = nn.ReLU() def forward(self, x): out = self.relu(self.bn1(self.conv1(x))) out = self.relu(self.bn2(self.conv2(out))) return out class ResNet(nn.Module): def __init__(self, block, num_classes=10): super(ResNet, self).__init__() self.prep_layer = nn.Sequential( nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=1, bias=False), nn.BatchNorm2d(64), nn.ReLU(), ) self.layer1 = nn.Sequential( nn.Conv2d(64, 128, kernel_size=3, stride=1, padding=1, bias=False), nn.MaxPool2d(2,2), nn.BatchNorm2d(128), nn.ReLU() ) self.resblock1 = block(128, 128, stride=1) self.layer2 = nn.Sequential( nn.Conv2d(128, 256, kernel_size=3, stride=1, padding=1, bias=False), nn.MaxPool2d(2,2), nn.BatchNorm2d(256), nn.ReLU() ) self.layer3 = nn.Sequential( nn.Conv2d(256, 512, kernel_size=3, stride=1, padding=1, bias=False), nn.MaxPool2d(2,2), nn.BatchNorm2d(512), nn.ReLU() ) self.resblock2 = block(512, 512, stride=1) self.pool = nn.MaxPool2d(4, 4) self.linear = nn.Linear(512, 10,bias=False) def forward(self, x): # Prep Layer out = self.prep_layer(x) out = self.layer1(out) res1 = self.resblock1(out) out = out + res1 out = self.layer2(out) out = self.layer3(out) res2 = self.resblock2(out) out = out + res2 out = self.pool(out) out = out.view(out.size(0), -1) out = self.linear(out) return out def CustomResNet(): return ResNet(BasicBlock)
29.072289
83
0.528802
2,282
0.945711
0
0
0
0
0
0
12
0.004973
d720aec2d84e6036038a117411622fba835ee1b0
12,810
py
Python
playground/test_condconv_weights/test_routing_weights.py
harry11162/detectron2
d5d41e23cd5317b9d80d5f9e4886771ba53c1a3a
[ "Apache-2.0" ]
null
null
null
playground/test_condconv_weights/test_routing_weights.py
harry11162/detectron2
d5d41e23cd5317b9d80d5f9e4886771ba53c1a3a
[ "Apache-2.0" ]
null
null
null
playground/test_condconv_weights/test_routing_weights.py
harry11162/detectron2
d5d41e23cd5317b9d80d5f9e4886771ba53c1a3a
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. """ Detectron2 training script with a plain training loop. This script reads a given config file and runs the training or evaluation. It is an entry point that is able to train standard models in detectron2. In order to let one script support training of many models, this script contains logic that are specific to these built-in models and therefore may not be suitable for your own project. For example, your research project perhaps only needs a single "evaluator". Therefore, we recommend you to use detectron2 as a library and take this file as an example of how to use the library. You may want to write your own script with your datasets and other customizations. Compared to "train_net.py", this script supports fewer default features. It also includes fewer abstraction, therefore is easier to add custom logic. """ import logging import os import time import datetime from collections import OrderedDict import torch import torch.nn as nn from torch.nn.parallel import DistributedDataParallel import detectron2.utils.comm as comm from detectron2.utils.comm import get_world_size from detectron2.utils.logger import log_every_n_seconds from detectron2.checkpoint import DetectionCheckpointer, PeriodicCheckpointer from detectron2.config import get_cfg from detectron2.data import ( MetadataCatalog, build_detection_test_loader, build_detection_train_loader, ) from detectron2.data.common import DatasetFromList from detectron2.data.datasets import register_coco_instances from detectron2.engine import default_argument_parser, default_setup, launch from detectron2.evaluation import ( CityscapesInstanceEvaluator, CityscapesSemSegEvaluator, COCOEvaluator, COCOPanopticEvaluator, DatasetEvaluators, LVISEvaluator, PascalVOCDetectionEvaluator, SemSegEvaluator, # inference_on_dataset, print_csv_format, inference_context, ) from detectron2.modeling import build_model from detectron2.layers import route_func from detectron2.solver import build_lr_scheduler, build_optimizer from detectron2.utils.events import ( CommonMetricPrinter, EventStorage, JSONWriter, TensorboardXWriter, ) from network import MyNetwork logger = logging.getLogger("detectron2") def get_evaluator(cfg, dataset_name, output_folder=None): """ Create evaluator(s) for a given dataset. This uses the special metadata "evaluator_type" associated with each builtin dataset. For your own dataset, you can simply create an evaluator manually in your script and do not have to worry about the hacky if-else logic here. """ if output_folder is None: output_folder = os.path.join(cfg.OUTPUT_DIR, "inference") evaluator_list = [] evaluator_type = MetadataCatalog.get(dataset_name).evaluator_type if evaluator_type in ["sem_seg", "coco_panoptic_seg"]: evaluator_list.append( SemSegEvaluator( dataset_name, distributed=True, output_dir=output_folder, ) ) if evaluator_type in ["coco", "coco_panoptic_seg"]: evaluator_list.append(COCOEvaluator(dataset_name, output_dir=output_folder)) if evaluator_type == "coco_panoptic_seg": evaluator_list.append(COCOPanopticEvaluator(dataset_name, output_folder)) if evaluator_type == "cityscapes_instance": assert ( torch.cuda.device_count() >= comm.get_rank() ), "CityscapesEvaluator currently do not work with multiple machines." return CityscapesInstanceEvaluator(dataset_name) if evaluator_type == "cityscapes_sem_seg": assert ( torch.cuda.device_count() >= comm.get_rank() ), "CityscapesEvaluator currently do not work with multiple machines." return CityscapesSemSegEvaluator(dataset_name) if evaluator_type == "pascal_voc": return PascalVOCDetectionEvaluator(dataset_name) if evaluator_type == "lvis": return LVISEvaluator(dataset_name, cfg, True, output_folder) if len(evaluator_list) == 0: raise NotImplementedError( "no Evaluator for the dataset {} with the type {}".format(dataset_name, evaluator_type) ) if len(evaluator_list) == 1: return evaluator_list[0] return DatasetEvaluators(evaluator_list) def inference_on_dataset(model, data_loader, evaluator): """ Run model on the data_loader and evaluate the metrics with evaluator. Also benchmark the inference speed of `model.forward` accurately. The model will be used in eval mode. Args: model (nn.Module): a module which accepts an object from `data_loader` and returns some outputs. It will be temporarily set to `eval` mode. If you wish to evaluate a model in `training` mode instead, you can wrap the given model and override its behavior of `.eval()` and `.train()`. data_loader: an iterable object with a length. The elements it generates will be the inputs to the model. evaluator (DatasetEvaluator): the evaluator to run. Use `None` if you only want to benchmark, but don't want to do any evaluation. Returns: The return value of `evaluator.evaluate()` """ num_devices = get_world_size() logger = logging.getLogger(__name__) logger.info("Start inference on {} images".format(len(data_loader))) total = len(data_loader) # inference data loader must have a fixed length if evaluator is None: # create a no-op evaluator evaluator = DatasetEvaluators([]) evaluator.reset() num_warmup = min(5, total - 1) start_time = time.perf_counter() total_compute_time = 0 routing_weights = torch.load("routing_weights.pth") with inference_context(model), torch.no_grad(): for idx, inputs in enumerate(data_loader): if idx == num_warmup: start_time = time.perf_counter() total_compute_time = 0 start_compute_time = time.perf_counter() routing_weight = routing_weights[idx].unsqueeze(0) routing_weight = [routing_weight[:, :8], routing_weight[:, 8:16], routing_weight[:, 16:]] outputs = model(inputs, routing_weight) if torch.cuda.is_available(): torch.cuda.synchronize() total_compute_time += time.perf_counter() - start_compute_time evaluator.process(inputs, outputs) iters_after_start = idx + 1 - num_warmup * int(idx >= num_warmup) seconds_per_img = total_compute_time / iters_after_start if idx >= num_warmup * 2 or seconds_per_img > 5: total_seconds_per_img = (time.perf_counter() - start_time) / iters_after_start eta = datetime.timedelta(seconds=int(total_seconds_per_img * (total - idx - 1))) log_every_n_seconds( logging.INFO, "Inference done {}/{}. {:.4f} s / img. ETA={}".format( idx + 1, total, seconds_per_img, str(eta) ), n=5, ) # Measure the time only for this worker (before the synchronization barrier) total_time = time.perf_counter() - start_time total_time_str = str(datetime.timedelta(seconds=total_time)) # NOTE this format is parsed by grep logger.info( "Total inference time: {} ({:.6f} s / img per device, on {} devices)".format( total_time_str, total_time / (total - num_warmup), num_devices ) ) total_compute_time_str = str(datetime.timedelta(seconds=int(total_compute_time))) logger.info( "Total inference pure compute time: {} ({:.6f} s / img per device, on {} devices)".format( total_compute_time_str, total_compute_time / (total - num_warmup), num_devices ) ) results = evaluator.evaluate() # An evaluator may return None when not in main process. # Replace it by an empty dict instead to make it easier for downstream code to handle if results is None: results = {} return results def do_test(cfg, model): results = OrderedDict() for dataset_name in cfg.DATASETS.TEST: data_loader = build_detection_test_loader(cfg, dataset_name) evaluator = get_evaluator( cfg, dataset_name, os.path.join(cfg.OUTPUT_DIR, "inference", dataset_name) ) results_i = inference_on_dataset(model, data_loader, evaluator) results[dataset_name] = results_i if comm.is_main_process(): logger.info("Evaluation results for {} in csv format:".format(dataset_name)) print_csv_format(results_i) if len(results) == 1: results = list(results.values())[0] return results def do_train(cfg, model, resume=False): model.train() model_weights = torch.load(cfg.MODEL.WEIGHTS) if "model" in model_weights: model_weights = model_weights["model"] model.load_state_dict(model_weights, strict=False) # should better set True for once to see if it's loaded right assert cfg.SOLVER.IMS_PER_BATCH == 1, f"should set batchsize=1" sampler = torch.utils.data.sampler.SequentialSampler(range(1725)) data_loader = build_detection_train_loader(cfg, sampler=sampler, aspect_ratio_grouping=False) num_images = 1725 params = [] for m in model.modules(): if isinstance(m, route_func): print("found") params = params + list(m.parameters()) optimizer = torch.optim.SGD(params, lr=cfg.SOLVER.BASE_LR, momentum=cfg.SOLVER.MOMENTUM, weight_decay=0) logger.info("Starting solving optimized routing weights") all_routing_weights = [] with EventStorage(start_iter=0) as storage: for data, iteration in zip(data_loader, range(num_images)): storage.iter = iteration print(iteration) for _ in range(1): loss_dict, routing_weights = model(data) losses = sum(loss_dict.values()) assert torch.isfinite(losses).all(), loss_dict loss_dict_reduced = {k: v.item() for k, v in comm.reduce_dict(loss_dict).items()} losses_reduced = sum(loss for loss in loss_dict_reduced.values()) if comm.is_main_process(): storage.put_scalars(total_loss=losses_reduced, **loss_dict_reduced) optimizer.zero_grad() losses.backward() # optimizer.step() print(losses.item()) all_routing_weights.append(routing_weights) print(routing_weights.shape) routing_weights = torch.cat(all_routing_weights).cpu() torch.save(routing_weights, "routing_weights.pth") return routing_weights def setup(args): """ Create configs and perform basic setups. """ register_coco_instances("domain", {}, "domain/annotations.json", "domain") register_coco_instances("domain_train", {}, "domain/train_annotations.json", "domain") register_coco_instances("domain_test", {}, "domain/test_annotations.json", "domain") register_coco_instances("routine_train", {}, "domain/train_routine_5fc766.json", "domain") register_coco_instances("routine_test", {}, "domain/test_routine_5fc877.json", "domain") cfg = get_cfg() assert args.config_file == "", f"This code automatically uses the config file in this directory" args.config_file = "configs.yaml" cfg.merge_from_file(args.config_file) cfg.merge_from_list(args.opts) cfg.freeze() default_setup( cfg, args ) # if you don't like any of the default setup, write your own setup code return cfg def main(args): cfg = setup(args) model = MyNetwork(cfg) model.to(torch.device(cfg.MODEL.DEVICE)) logger.info("Model:\n{}".format(model)) if args.eval_only: DetectionCheckpointer(model, save_dir=cfg.OUTPUT_DIR).resume_or_load( cfg.MODEL.WEIGHTS, resume=args.resume ) return do_test(cfg, model) distributed = comm.get_world_size() > 1 if distributed: model = DistributedDataParallel( model, device_ids=[comm.get_local_rank()], broadcast_buffers=False ) return do_train(cfg, model, resume=args.resume) if __name__ == "__main__": args = default_argument_parser().parse_args() print("Command Line Args:", args) launch( main, args.num_gpus, num_machines=args.num_machines, machine_rank=args.machine_rank, dist_url=args.dist_url, args=(args,), )
39.294479
117
0.676581
0
0
0
0
0
0
0
0
3,760
0.293521