index
int64
0
1,000k
blob_id
stringlengths
40
40
code
stringlengths
7
10.4M
991,300
a376bd4c51f14aa15a5c54c3dd345defdfddd19c
from sensible_raw.loaders import loader from world_viewer.cns_world import CNSWorld from world_viewer.glasses import Glasses import pandas as pd import matplotlib.pyplot as plt import numpy as np import networkx as nx from matplotlib.colors import LogNorm from sklearn.utils import shuffle folder = "tmp/Shuffled/" # load data cns = CNSWorld() cns.load_world(opinions = ['fitness'], read_cached = True, stop=False, write_pickle = False, continous_op=False) cns.d_ij = None cns_glasses = Glasses(cns) #time restriction start_spring = "2014-01-15" end_spring = "2014-04-30" cns.time = cns.time.loc[(cns.time.time >= start_spring) & (cns.time.time <= end_spring)] cns.op_nodes = cns.op_nodes.loc[(cns.op_nodes.time >= start_spring) & (cns.op_nodes.time <= end_spring)] cns.a_ij = cns.a_ij.loc[(cns.a_ij.time >= start_spring) & (cns.a_ij.time <= end_spring)] # shuffle trait for run in range(15,30): cns.op_nodes.set_index("time",inplace=True) cns.op_nodes.sort_index(inplace=True) cns.op_nodes["op_fitness"] = cns.op_nodes.groupby("time").op_fitness.apply(shuffle)\ .reset_index().set_index("time").op_fitness cns.op_nodes.reset_index(inplace=True) cns.op_nodes.to_pickle(folder + f"op_nodes_fitness_shuffled_op_fitness_{run}.pkl") exposure = cns_glasses.calc_exposure("expo_frac", "op_fitness", exposure_time = 7) exposure.to_pickle(folder + f"exposure_fitness_7_1_shuffled_op_fitness_{run}.pkl")
991,301
f36e4d14294158bcf9552917f7e2e915c8ece6a6
"""try: numero1 = 5 numero2 = 3 div = numero1 / numero2 print(div) except ZeroDivisionError: print("No puedes dividir por cero") except: print("Ha ocurrido un error") else: print("La division funciono correctamente") # cuando funciona finally: print("Estamos aprendiendo excepctiones") # siempre se muestra""" # ejercicio """ crear la fn "operacion" que dados 3 num, divida el primer numero entre la resta de los otros dos numeros utilizar la fn creado con los nmeros 5,4,2 utilizar la fn creada con los numeros 6,3,3 """ def operacion(num1, num2, num3): try: operacion_matematica = num1 / (num2 - num3) print(operacion_matematica) except: print("Hubo un error, revise si esta ingresando los dos ultimos dos numeros con el mismo valor y/o esta dividiendo en cero :/ ") else: print("Operacion realizada con exito") finally: print("La operacion ha terminado") operacion(5,4,4)
991,302
566f45891887730a86a75384232bd8e69c1cc479
import socket, time, persistqueue, os, shutil, collections, threading quit = False def delete (q): # время жизни сообщений(высчитываю не совсем корректно но это бетка) try: time.sleep(0.2) # чтобы меньше лагало clock = time.strftime("%d%M%S", time.localtime()) # время сейчас clock = int(clock) i = q.qsize() size = i while (i > 0): dat, dr, pr, vrem = q.get() a = int(clock) - int(vrem) # разница времени сообщения и время сейчас if (a > 10): # если больше n секунд, сам тут в ифе выбираешь, то сообщение удаляется из персистентноц очереди q.get() else: # тут мы пытаемся вернуть сообщение, которое мы попнули в строке 12, приходится проходить всю очередь с начала до конца k = q.qsize() q.put((dat, dr, pr, vrem)) while (k > 0): dat, dr, pr, vrem = q.get() q.put((dat, dr, pr, vrem)) k = k - 1 i = 0 i = i - 1 l = q.qsize() if ((size - l) > 0): # если удалилось хоть одно сообщение, то нарушился мой "приоритет", т.е. число, которое показывает какое сообщение по порядку; и этот порядок надо восстановаить k = q.qsize() count = 1 while (k > 0): data, adr, pr, vr = q.get() q.put((data,adr, count, vr)) count = count + 1 k = k - 1 return 0 except: return 0 def remove(q, priority): print(priority) # это серверу, сделал для себя code = 1 # новый "приоритет" size = q.qsize() size = size - 1 i = priority # место удаляемого сообщения i = int(i) i = i - 1 while (i > 0): # проходим по очереди, удаляя первый элемент и вставляя его в конец, меняя его приоритет data, ad, pr, vr = q.get() q.put((data,ad,code,vr)) i = i - 1 size = size - 1 code = code + 1 q.get() # дошли до удаляемого элемента и просто попнули его while (size > 0): # продолжаем удалять элементы начала и вставлять их в конец, чтобы восстановилась изначальная очередь без удаляемого элемента data, ad, pr, vr = q.get() q.put((data,ad,code,vr)) code = code + 1 size = size - 1 def resend(q, priority): # также как в удалении, только мы возвращаем нужный нам элемент, оставив его в очереди print(priority) code = 1 size = q.qsize() size = size - 1 i = priority i = int(i) i = i - 1 while (i > 0): data, ad, pr, vr = q.get() q.put((data,ad,code,vr)) i = i - 1 size = size - 1 code = code + 1 da, get, mr, gh = q.get() q.put((da, get, mr, gh)) while (size > 0): data, ad, pr, vr = q.get() q.put((data,ad,code,vr)) code = code + 1 size = size - 1 return da path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'mypah') # настраиваем путь на папку, где хранится персистентная очередь, чтобы можно было удалять эту папку командой q = persistqueue.SQLiteQueue('mypah', auto_commit=True) # настройка персистентной очереди( в папке он будет хранить все данные даже после конца работы сервера) p = collections.deque() # дек, он используется для вывода истории сообщений, потому что мы используем очередь и когда запрашиваем вывод всей очереди с поомщью get(pop) он удаляет очередь и в деке будет хранится вся информация host = socket.gethostbyname(socket.gethostname()) # в клиенте port = 9090 clients = [] # список клиентов, нужен для того,чтобы сообщения не приходили клиенту, который отправил их s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) s.bind((host,port)) print("[ Server Started ]") while not quit: try: data, addr= s.recvfrom(1024) # всегда пытаемся что-то получить от клиента (data - сообщение, addr - уникальный номер клиента, который генерируется сам) delete(q) # если лагает прога, тогда закомменть эту строку, она всегда пытается удалить сообщения(время жизни сообщений)(точнее не всегда, а когда какое-то сообщение приходит на сервер) if addr not in clients: # если клиента нет в списке клиентов, то добавим его clients.append(addr) if ((data.decode("utf-8") != "/his") and (data.decode("utf-8") != "/del") and (data.decode("utf-8") != "/rs")): # обычное сообшение priority = q.qsize() + 1 # приоритет, который я делаю не так видимо clock = time.strftime("%d%M%S", time.localtime()) # для времени жизни сообщений q.put((data, addr, priority, clock)) # помещаем сообщение в персистентную очередь if (data.decode("utf-8")) == "/his": for client in clients: # проходим по клиентам и находим только нашего if addr == client: s.sendto(("''''''''''''''''''''''''''''''''''''").encode("utf-8"), client) # для красоты i = q.qsize() k = i while ((i > 0)): his, code, pr, clock = q.get() # забираем первое сообщение из очереди p.appendleft((his, code, pr, clock)) # вставляем его в дек print(his, pr) # принтим серверу mb = str(pr) # переводим инт в строку для кодирвоания strok = (his.decode("utf-8") + " " + mb) # нужная строка для отправки, тут я уже походу перемудрил(крч не оч красиво вышло( и мб это и не надо было)) s.sendto(strok.encode("utf-8"), client) # отправляем клиенту сообщение i = i - 1 while ((k > 0)): # тут возвращаем из дека в персистентную очередь his, code, pr, clock = p.pop() q.put((his, code, pr, clock)) k = k - 1 p.clear() # очищаем на всякий)) s.sendto(("''''''''''''''''''''''''''''''''''''").encode("utf-8"), client) # для красоты!! continue if (data.decode("utf-8")) == "/clear": shutil.rmtree(path) # удаляем папку с периситентной очередью i = q.qsize() while (i > 0): # очищаем нашу очередь q.get() i = i - 1 if (data.decode("utf-8")) == "/del": mes, ad = s.recvfrom(1024) # получаем номер нужного нам сообщения remove(q,mes.decode("utf-8")) # удаляем if (data.decode("utf-8")) == "/rs": # тут как в удалении mes, ad = s.recvfrom(1024) pd = resend(q,mes.decode("utf-8")) for client in clients: s.sendto("Resended:".encode("utf-8"),client) s.sendto(pd,client) s.sendto("______________________________________".encode("utf-8"),client) itsatime = time.strftime("%Y-%m-%d-%H.%M.%S", time.localtime()) # берем время для того чтобы на сервере отображалось время отправки сообщения print("["+addr[0]+"]=["+str(addr[1])+"]=["+itsatime+"]/",end="") # принтим сообщение и время серверу print(data.decode("utf-8")) for client in clients: # тут отправка всем клиентам кроме того, кто отправил сообщения(тут надо добавить еще в ифы историю удаление и т.д., чтобы у других не отображалось) if ((addr != client) and (data.decode("utf-8") != "/rs")): s.sendto(data,client) except: # конец серевра(конец работы программы) quit = True print("\n[ Server Stopped ]") s.close()
991,303
e3905813c7065f41e7ebfd67f3d74686198e84b8
import re from selenium import webdriver from selenium.webdriver.chrome.options import Options import csv import time options = Options() options.add_argument("--headless") options.add_argument('--disable-gpu') options.add_argument('--no-sandbox') options.add_argument("start-maximized") options.add_argument("disable-infobars") options.add_argument("--disable-extensions") options.add_argument('--ignore-certificate-errors') options.add_argument("--test-type") chrome_driver_path = r'C:\Users\Xarvis-PC\Desktop\chromedriver_win32\chromedriver.exe' driver = webdriver.Chrome(options=options, executable_path=chrome_driver_path) try: URL = "https://www.american-securities.com/en/team/helen-chiang" driver.get(URL) e = driver.find_elements_by_css_selector("div.markdown > p") for _ in e: print(_.text) finally: driver.quit()
991,304
4418a09c9b54546615419d64e10c23a4eafe4156
"""This is a module of utils.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function
991,305
901a4bcf1d6c0ebab5018b7a30d7d43b8c84db3f
""" Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For example, with A = "abcd" and B = "cdabcdab". Return 3, because by repeating A three times (“abcdabcdabcd”), B is a substring of it; and B is not a substring of A repeated two times ("abcdabcd"). Note: The length of A and B will be between 1 and 10000. """ import math class Solution: def repeatedStringMatch(self, A: str, B: str) -> int: if not set(B).issubset(set(A)): return -1 base = math.ceil(len(B) / len(A)) for i in range(2): if B in A * (base + i): return base + i return -1 if __name__ == '__main__': A = 'abcd' B = 'cdabcdab' s = Solution() print(s.repeatedStringMatch(A, B))
991,306
18bfe9b908b234df31b7fb5af163fdb15bde8901
#SConstruct SConscript('SConscript',variant_dir='build',src='.',duplicate=0)
991,307
78385938cc460a43098676071d24b41b37d61d1e
# Main driver for the Aperture cli. # docopt uses the below docstring to describe the Aperture interface ''' Aperture Usage: aperture <input>... [options] Options: -o <opath>, --outpath <opath> Output location for the processed images. -q <qual>, --quality <qual> Quality level applied to each image. [default = 75] -r <res>, --resolutions <res> List of resolutions applied to each image. -m <depth>, --max-depth <depth> Maximum recursion depth for directory traversal. [default = 10] -w <wmimg>, --wmark-img <wmimg> Location of a watermark image. -t <wmtxt>, --wmark-txt <wmtxt> Text to be added on top of input images. -l --log Create a log file in the current working directory. -v --verbose Output real-time processing statistics. Examples: aperture . aperture . -o . aperture images/ -o out/ -q 80 aperture images/ -o out/ -r 400x400 aperture images/ -o out/ -r 400x400 -w watermarkdir/ aperture images/ -o out/ -r 400x400 -t "Company Name" aperture images/ -o out/ -r "800x800 400x400 200x200" -q 60 -v Help: <input> Can be file(s) or a directory containing files. Images must be: .jpg .jpeg .png ''' from docopt import docopt, DocoptExit from aperture.options import deserialize_options import aperture.config_file as conf import aperture.errors as errors from aperture.util.output import apt_logger as logger import sys, os # Aperture imports # How this version was chosen - https://packaging.python.org/tutorials/distributing-packages/#choosing-a-versioning-scheme __version__ = '1.0.0' import aperture.commands def main(): try: options = docopt(__doc__, version=__version__) except DocoptExit: # Always print entire docopt if you enter just 'aperture', instead of just showing usage patterns. print(__doc__) return 0 else: config = conf.read_config() options_ds = deserialize_options(options, config) ap = aperture.commands.Aperture(options_ds) ap.run() return 0 def run_main(): '''Main driver for aperture.''' try: sys.exit(main()) except errors.ApertureError as e: logger.log('aperture: {}'.format(str(e)), 'error') sys.exit(1) if __name__ == '__main__': run_main()
991,308
6dc286d31e6e540ae7827820fe76e7bf9148e59f
# encoding: utf8 import re def parse_oss_url(url): pattern = re.compile(r'(http|https)://([a-zA-Z0-9_-]+)\.(.*?)\/(.*)') match = pattern.match(url) if match: return match.groups() else: raise Exception('Invalid OSS url')
991,309
22375c1f5d596b6547a12a59596d984168afc5a3
# Generated by Django 2.0.3 on 2020-07-21 20:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('stocks', '0003_auto_20200721_1547'), ] operations = [ migrations.AddField( model_name='saved_stock', name='ticker', field=models.CharField(default='', max_length=20, null=True), ), ]
991,310
e06800cf168048529e759c18590c3c0f03f9cd54
class Current: def constant_current(self): print("Enter the magnitude of current ") self.current= float(input()) if not isinstance(self.current,float): raise TypeError("NOT A NUMBER") else: return self.current def step_current(t): print("Enter the magnitude of current") self.current=float(input()) if not isinstance(self.current,float): raise TypeError("NOT A NUMBER") else: return self.current def time_step(self): print("Enter the time step") self.time_step = input() return self.time_step def Step_current(t): current = np.zeros(len(T)) current_length = len(current) window_size = self.time_step number_of_windows = current_length/window_size updated_current = current number_list = np.arange(1,number_of_windows,2) for i in number_list: for j in range(1,window_size): temp = int(((i*window_size)+j)) updated_current[temp] = 10 return updated_current def main(): current = Current() input_current = 0 time_step = 0 print(""" ======CURRENT MENU======= 1. Constant Current 2. Step Current """) choice=int(input("Enter Choice:")) if choice==1: input_current = current.constant_current() elif choice==2: input_current = current.step_current() time_step = current.time_step() else: print("ERROR:INVALID CURRENT") sys.exit() print(input_current) print(time_step) main()
991,311
12ae65e17cae5e608a067b8379b47822502791c9
#!/usr/bin/python #encoding=utf8 import requests,re,datetime,time import sys reload(sys) sys.setdefaultencoding('utf8') #备份当前的策略 一天前 bakuptime = 1 #删除策略 三天前 deletetime = 3 def Find_indexs(url): res = requests.get(url).text indexs_list = [i.split()[2] for i in res.split("\n") if i] #print(indexs_list) #找出匹配符合的索引 can_indexs = [] for i in indexs_list: if re.compile(r"(.*-[0-9].*-[0-9].*-[0-9].*)").findall(i): can_indexs.append(i) now_time = datetime.datetime.now().strptime(datetime.datetime.now().strftime("%Y.%m.%d"),"%Y.%m.%d") #找出索引对应的时间 先备份 并找出需要删除的索引列表 初始化 backup_list = [] delete_list = [] for i in can_indexs: ii = "-".join(i.split("-")[-3:]) find_index_time = datetime.datetime.strptime(ii, "%Y-%m-%d") Ca = (now_time - find_index_time) #print(Ca) try: if int(str(Ca).split()[0]) == bakuptime: ######### 备份逻辑 backup_list.append(i) if int(str(Ca).split()[0]) > deletetime: delete_list.append(i) #except Exception as e: except: pass #print("%s is %s" %(Ca,i)) return (backup_list,delete_list) def Start_bak(ues_snapshot,backup_list=None): for i in backup_list: put_url = "http://10.42.71.37:9200/_snapshot/"+ues_snapshot params = { "type": "ufile", "settings": { "endpoint": "aha-log.ufile.cn-north-04.ucloud.cn", "public_key": "TOKEN_5445258c-3808-40dc-8389-d107b28a42c0", "private_key": "2429aafd-c676-47f3-a632-474ed799744a", "bucket": "aha-log", "compress": True, "chunk_size": "50mb", "base_path": "prodlog-" + time.strftime("%Y-%m-%d") + "/" + i, "max_snapshot_bytes_per_sec": "40mb", "max_restore_bytes_per_sec": "40mb" } } res = requests.put(put_url, json=params) print(res.content) ########## 开始备份索引 put_index_name = put_url + "/"+ i + "?wait_for_completion" params = { "indices": i } print(put_index_name) res = requests.put(put_index_name, json=params) print(res.content) def Delete_index(delete_list=None): if delete_list: for i in delete_list: delete_url = 'http://10.42.71.37:9200/' + i result = requests.delete(delete_url) print(result.content) if __name__ == '__main__': Args = Find_indexs("http://10.42.71.37:9200/_cat/indices") Args_backup_list, Args_delete_list = Args Start_bak("ues_snapshot",Args_backup_list) Delete_index(Args_delete_list)
991,312
e5a8251c158971aa3f33aeacda635d222ddd7b2a
# _*_ coding:utf-8 _*_ import pymysql conn = pymysql.Connect(host="127.0.0.1", port=3306, user="hujiaming", passwd="123456", db="xgyw_cc", charset="utf8") cur = conn.cursor() start_url = "http://www.xgyw.cc" little_item_sql = "insert into little_item values" def combine_insert_sql(table_name, id, name, url): insert_big_sql = "insert into {0} values".format(table_name) for i in range(0, len(id)): url[i] = start_url + url[i] insert_big_sql += '({0},"{1}","{2}"),'.format(id[i], name[i], url[i]) print(insert_big_sql) # cur.execute(insert_big_sql[:-1]) def get_one_little_item(id, p_id, name, url): global little_item_sql little_item_sql += "({0},{1},'{2}','{3}'),".format(id, p_id, name, url) print(little_item_sql) def print_little_item_sql(): print(little_item_sql) def save(): conn.commit()
991,313
7db8cc8ef1ee16142a4afc1570c974b3ff2fc98f
# Reading and writing files # we will use functions to make a simple text editor from sys import argv script, filename = argv print "We're going to erase %r" % filename print "If you don't want that, press ctrl + c(^C)" print "If you want that, press return" raw_input("?") print "Opening the file..." target = open(filename, "w") # used a w with open for writing # use r for reading, a for append, and others print "Truncating the file" print "Now, I am going to ask you for 3 lines" line1 = raw_input() line2 = raw_input() line3 = raw_input() print "Going to write these into the file" target.write(line1) target.write("\n") target.write(line2) target.write("\n") target.write(line3) target.write("\n") print "And finally, we close it" target.close()
991,314
86527daa40310becf11261ecd57e7b0a6d04dcd3
from conans import ConanFile, CMake, tools import os package_version = "1.2.1" channel = os.getenv("CONAN_CHANNEL", "testing") username = os.getenv("CONAN_USERNAME", "marcokoch") class LibunwindTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" requires = "libunwind/%s@%s/%s" % (package_version, username, channel) generators = "cmake" def build(self): cmake = CMake(self) # Current dir is "test_package/build/<build_id>" and CMakeLists.txt is in "test_package" self.output.info("Configuring test application") cmake.configure(source_dir=self.conanfile_directory, build_dir="./") self.output.info("Building test application") cmake.build() def test(self): if not tools.cross_building(self.settings): cmake = CMake(self) self.output.info("Running tests") cmake.test() else: self.output.info("Skipping tests due to cross-build")
991,315
4faf40030ca73a5f357334cbb5d4a6bd0d96398a
#Django from django.urls import path #Django rest framework from rest_framework.urlpatterns import format_suffix_patterns #Views from users_manage_api import views as user_views """In order to handle urls management better, the "views" name has been changed""" urlpatterns = [ path('login/', user_views.UserAPIView.as_view()), path('logon/', user_views.CreateUser.as_view()), ] urlpatterns = format_suffix_patterns(urlpatterns)
991,316
78a7dc7c4ef3bd3564f3134afd4e539c98c55636
from flask_jwt_extended import get_jwt_identity from core.kube import models class DeploymentCreatorFilter: @classmethod def as_filter(self, *args, **kwargs): user = get_jwt_identity() return user and models.Deployment.creator_id == user['id']
991,317
5c19f017ea1a8d483aeb0ce1fead98ba153222ed
#Charles Fee #I pledge my honor that I have abided by the Stevens Honor System # nim template DNaumann (2018), for assignment nim_hw11.txt # Global variables used by several functions piles = [] # list containing the current pile amounts num_piles = 0 # number of piles, which should equal len(pile) def play_nim(): """ plays game of nim between user and computer; computer plays optimally """ init_piles() display_piles() while True: user_plays() display_piles() if sum(piles) == 0: print("I let you win this time...") break computer_plays() display_piles() if sum(piles) == 0: print("HAHAHAHAHA Lemons like you can never defeat me!!!") break def init_piles(): """ Assign initial values to the global variables 'num_piles' and 'piles' User chooses number of piles and initial size of each pile. Keep prompting until they enter valid values.""" global piles global num_piles print("How many piles do you want to play with?") num_piles = int(input()) piles = [] while len(piles) != num_piles: piles.append(0) piles[len(piles)-1] = int(input("How many in pile "+str((len(piles)-1))+"? ")) def display_piles(): """ display current amount in each pile """ global piles global num_piles y = 0 for x in piles: print('pile '+str(y)+' = '+str(x)) y+=1; def user_plays(): """ get user's choices and update chosen pile """ global piles print("Your turn ...") p = get_pile() amt = get_number(p) piles[p] = piles[p] - amt def get_pile(): """ return user's choice of pile Keep prompting until the choice is valid, i.e., in the range 0 to num_piles - 1. """ global piles global num_piles while True: userInput = int(input("Which pile? ")) if userInput >= 0 and userInput <= num_piles-1: return userInput break def get_number(pnum): """ return user's choice of how many to remove from pile 'pnum' Keep prompting until the amount is valid, i.e., at least 1 and at most the amount in the pile.""" global piles while True: userInput = int(input("How many? ")) if userInput >= 1 and userInput <= piles[pnum]: return userInput break def game_nim_sum(): """ return the nim-sum of the piles """ global piles global num_piles nim_sum = 0 for x in piles: nim_sum = nim_sum^x return nim_sum def opt_play(): """ Return (p,n) where p is the pile number and n is the amt to remove, if there is an optimal play. Otherwise, (p,1) where is the pile number of a non-zero pile. Implement this using game_nim_sum() and following instructions in the homework text.""" global piles global num_piles nim_sum = game_nim_sum() pile_sum = list(piles) for x in range(len(piles)): pile_sum[x] = nim_sum^piles[x] for y in range(len(piles)): if pile_sum[y] < piles[y]: return (y, piles[y]-pile_sum[y]) for z in range(len(piles)): if piles[z] != 0: return (z,1) def computer_plays(): """ compute optimal play, update chosen pile, and tell user what was played Implement this using opt_play(). """ global piles global num_piles print('Your move was MEDIOCRE at best MY TURN!!!!') opt = opt_play() print('I shall remove '+str(opt[1])+' from pile '+str(opt[0])) piles[opt[0]] -= opt[1] # start playing automatically if __name__ == "__main__" : play_nim()
991,318
77464686c0e31285780d0194580066a0dc0c9bc8
from datetime import date from clld.tests.util import TestWithEnv, XmlResponse class OaiPmhResponse(XmlResponse): ns = 'http://www.openarchives.org/OAI/2.0/' @property def error(self): e = self.findall('error') if e: return e[0].get('code') def test_ResumptionToken(): from clld.web.views.olac import ResumptionToken assert ResumptionToken(from_=date.today(), until=date.today()).__unicode__() class Tests(TestWithEnv): def with_params(self, **kw): from clld.web.views.olac import olac self.set_request_properties(params=kw) return OaiPmhResponse(olac(self.env['request'])) def test_olac_no_verb(self): self.assertEqual(self.with_params().error, 'badVerb') def test_olac_listsets(self): self.assertNotEqual(self.with_params(verb='ListSets').error, None) def test_olac_identify_and_additional_arg(self): self.assertEqual( self.with_params(verb='Identify', other='arg').error, 'badArgument') def test_olac_identify(self): assert self.with_params(verb='Identify').findall('Identify') def test_olac_listMetadataFormats(self): self.with_params( verb='ListMetadataFormats').findone('metadataPrefix').text == 'olac' assert self.with_params(verb='ListMetadataFormats', other='x').error def test_olac_list(self): from clld.web.views.olac import OlacConfig assert self.with_params( verb='ListIdentifiers', metadataPrefix='olac').findall('header') OlacConfig() id_ = self.with_params(verb='Identify').findone( '{http://www.openarchives.org/OAI/2.0/oai-identifier}sampleIdentifier').text assert self.with_params( verb='GetRecord', metadataPrefix='olac', identifier=id_).findone('record') assert self.with_params(verb='GetRecord', metadataPrefix='olac').error assert self.with_params( verb='GetRecord', metadataPrefix='ol', identifier=id_).error assert self.with_params( verb='GetRecord', metadataPrefix='olac', identifier=id_ + '123').error assert self.with_params( verb='ListIdentifiers', resumptionToken='tr', metadataPrefix='olac').error assert self.with_params( verb='ListIdentifiers', resumptionToken='tr', o='x').error assert self.with_params(verb='ListIdentifiers').error assert self.with_params( verb='ListIdentifiers', metadataPrefix='olac', set='x').error assert self.with_params(verb='ListIdentifiers', resumptionToken='tr').error assert not self.with_params( verb='ListIdentifiers', resumptionToken='0f2000-01-01u2222-01-01').error assert not self.with_params(verb='ListIdentifiers', resumptionToken='100').error assert self.with_params(verb='ListIdentifiers', resumptionToken='200').error assert self.with_params( verb='ListIdentifiers', resumptionToken='100f2000-01-01u2000-01-01').error
991,319
650725dd6cfc5e53884ac3a1ee649d0f0674bb6b
# coding: utf-8 from girlfriend.tools.code_template.workflow_template import PluginCodeMeta all_meta = { # csv series "read_csv": PluginCodeMeta( plugin_name="read_csv", args_template="""[ CSVR( path="filepath", record_handler=None, record_filter=None, result_wrapper=TableWrapper( "table_name", titles=[] ), dialect="excel", variable=None ), ]""", auto_imports=[ "from girlfriend.plugin.csv import CSVR", "from girlfriend.data.table import TableWrapper" ] ), "write_csv": PluginCodeMeta( plugin_name="write_csv", args_template="""[ CSVW( path="memory:", object=None, record_handler=None, record_filter=None, dialect="excel" ), ]""", auto_imports=[ "from girlfriend.plugin.csv import CSVW", ] ), # excel series "read_excel": PluginCodeMeta( plugin_name="read_excel", args_template="""[ "filepath", SheetR( sheetname="", record_handler=None, record_filter=None, result_wrapper=TableWrapper( "table_name", titles=[] ), skip_first_row=False, variable=None ), ]""", auto_imports=[ "from girlfriend.plugin.excel import SheetR", "from girlfriend.data.table import TableWrapper" ] ), "write_excel": PluginCodeMeta( plugin_name="write_excel", args_template="""{ "filepath": "filepath", "sheets": ( SheetW( table=None, sheet_name=None, style=None, sheet_handler=None ), ), "workbook_handler": None }""", auto_imports=[ "from girlfriend.plugin.excel import SheetW" ] ), # json series "read_json": PluginCodeMeta( plugin_name="read_json", args_template="""[ JSONR( path="http address or filepath", style="block or line or array", record_handler=None, record_filter=None, result_wrapper=TableWrapper( "table_name", titles=[] ), variable=None ), ]""", auto_imports=[ "from girlfriend.plugin.json import JSONR", "from girlfriend.data.table import TableWrapper" ] ), "write_json": PluginCodeMeta( plugin_name="write_json", args_template="""[ JSONW( path="http address or filepath", style="object or line or array", object=None, record_handler=None, record_filter=None, http_method="post", http_field=None, variable=None ), ]""", auto_imports=[ "from girlfriend.plugin.json import JSONW", ] ), # mail series "send_mail": PluginCodeMeta( plugin_name="send_mail", args_template="""{ "server": "smtp_server", "receivers": [], "sender": "", "subject": "", "content": "", "encoding": "utf-8", "attachments": [] }""", auto_imports=[ "from girlfriend.plugin.mail import Attachment, Mail", ] ), # orm series "orm_query": PluginCodeMeta( plugin_name="orm_query", args_template="""[ Query( engine_name="", variable_name="", query_items="", query=None, order_by=None, group_by=None, params=None, row_handler=None, result_wrapper=TableWrapper( "table_name", titles=[] ) ), SQL( engine_name="", variable_name="", sql="", params=None, row_handler=None, result_wrapper=TableWrapper( "table_name", titles=[] ) ), ]""", auto_imports=[ "from girlfriend.plugin.orm import Query, SQL", "from girlfriend.data.table import TableWrapper" ] ), # table series "table_adapter": PluginCodeMeta( plugin_name="table_adapter", args_template="""[ TableMeta( from_variable="", to_variable="", name="table name", titles=[], table_type=None ), ]""", auto_imports=[ "from girlfriend.plugin.table import TableMeta", ] ), "column2title": PluginCodeMeta( plugin_name="column2title", args_template="""{ "from_table": "", "to_table": "", "title_column": "", "value_column": "", "title_generator": Title, "new_title_sort": sorted, "new_table_name": None, "default": None, "sum_title": None, "avg_title": None }""", auto_imports=[ "from girlfriend.data.table import Title", ] ), "print_table": PluginCodeMeta( plugin_name="print_table", args_template="""[ "$table1", "$table2", ]""", auto_imports=[] ), "html_table": PluginCodeMeta( plugin_name="html_table", args_template="""[ HTMLTable( table="context variable or table object", variable=None, property={ "table": "", "title-row": "", "title-cell": "", "data-row": "", "data-cell": "", } ), ]""", auto_imports=[ "from girlfriend.plugin.table import HTMLTable", ] ), "concat_table": PluginCodeMeta( plugin_name="concat_table", args_template="""{ "tables": [ ("table_variable", "concat fields"), ], "name": "new table name", "titles": 0, "variable": None }""", auto_imports=[] ), "join_table": PluginCodeMeta( plugin_name="join_table", args_template="""{ "way": "inner or left or right", "left": "left table", "right": "right table", "on": "left_column=right_column;left_column=right_column", "fields": ["l.id", "r.name"], "name": "new table name", "titles": None, "variable": None }""", auto_imports=[] ), "split_table": PluginCodeMeta( plugin_name="split_table", args_template="""{ "table": "$table_var", "split_condition": lambda row: None, "new table name", "variable": None }""", auto_imports=[] ), # text series "read_text": PluginCodeMeta( plugin_name="read_text", args_template="""[ TextR( filepath=None, record_matcher="line", record_handler=None, record_filter=None, pointer=None, change_file_logic=None, max_line=None, result_wrapper=None, variable=None ) ]""", auto_imports=["from girlfriend.plugin.text import TextR"] ), }
991,320
e03df16c8ee2f5bf8e8b5cb038c3144a5663d8dd
from parapy.core import * from parapy.geom import * class RudderEx(Base): @Attribute def pts1(self): return [Point(1, 1), Point(1, -1), Point(-1, -1), Point(-1, 1), Point(1, 1)] @Part def quad1(self): return PolygonalFace(self.pts1) @Attribute def pts2(self): return [Point(2, 2), Point(2, -2), Point(-2, -2), Point(-2, 2), Point(2, 2)] @Part def quad2(self): return PolygonalFace(self.pts2) @Attribute def pts3(self): return [Point(), Point(0, 1), Point(1, 1), Point(1, 0), Point()] @Part def quad3(self): return PolygonalFace(self.pts3) @Part def int(self): return Subtracted(shape_in=self.quad2, tool=self.quad1) @Part def prova1(self): return IntersectedShapes(shape_in=self.quad2, tool=self.quad1) @Part def prova2(self): return IntersectedShapes(shape_in=self.quad2, tool=self.quad3) @Part def prova3(self): return IntersectedShapes(shape_in=self.quad1, tool=self.quad4) @Attribute def prova(self): if self.int.faces == []: return 13 else: return self.int.faces[0].area @Attribute def pointsRudder1(self): """ List of points representing the vertical tail rudder :Unit: [] :rtype: Points """ return [Point(0, self.vertPos, self.longPos + (1-self.rcr)*self.chordRoot), Point(0, self.vertPos + self.span, self.longPos + self.span * tan(radians(self.sweepLE)) + (1-self.rcr)*self.chordTip), Point(0, self.vertPos + self.span, self.longPos + self.span * tan(radians(self.sweepLE)) + self.chordTip), Point(0, self.vertPos, self.longPos + self.chordRoot), Point(0, self.vertPos, self.longPos + (1-self.rcr)*self.chordRoot)] @Part def cube1(self): return Cube(2) @Part def cube2(self): return Cube(1) @Part def cube3(self): return TranslatedShape(shape_in=self.cube2, displacement=Vector(0, 0, 1.75)) @Part def cube4(self): return TranslatedShape(shape_in=self.cube2, displacement=Vector(0, 0, 3)) @Part def intersi(self): return IntersectedShapes(shape_in=self.cube1, tool=self.cube3) @Part def interno(self): return IntersectedShapes(shape_in=self.cube1, tool=self.cube4) @Part def fused1(self): return FusedSolid(shape_in=self.cube1, tool=self.cube2) @Part def fused2(self): return Fused(shape_in=self.cube1, tool=self.cube3) @Part def sottrazione(self): return Subtracted(shape_in=self.cube1, tool=self.cube2) if __name__ == '__main__': from parapy.gui import display obj = RudderEx() display(obj)
991,321
4a3d29f3b48fc0228e6c4df48e36993070f98fb5
import datetime import xlrd import pymssql from tables_results import TableCollection class nstr: def __init__(self, data): self.data = str(data) def __str__(self): return self.data class datetime_str: def __init__(self, data): if isinstance(data, float): self.data = xlrd.xldate_as_datetime(data, 0).date() else: self.data = datetime.date(*map(int, data.split('/'))) def __str__(self): return str(self.data) class SqlServer: def __init__(self, database=None, auto_commit=None, host='localhost', user='SA', password='<xX123456>'): self.db = None self.database = database self.host = host self.user = user self.password = password self.auto_commit = auto_commit def __enter__(self): self.close() self.db = pymssql.connect(self.host, self.user, self.password, self.database) if self.auto_commit is not None: self.db.autocommit(self.auto_commit) return self def __exit__(self, exc_type, exc_val, exc_tb): self.close() def show_database_cursor(self): return self.query_cursor("""select Name from sys.databases;""") def show_database(self) -> TableCollection.Sys.Database: cursor = self.show_database_cursor() results = [TableCollection.Sys.Database(name=row[0]) for row in cursor.fetchall()] self.return_cursor(cursor) return results def get_database_id(self, database_name): res = self.query("""select database_id from sys.databases where name = '%s'""" % (database_name, )) if len(res) != 0: return res[0][0] return None @staticmethod def return_cursor(cursor): return cursor.close() def just_exec(self, stmt): print(stmt) self.db.cursor().execute(stmt) self.db.commit() return self def query_cursor(self, stmt): cursor = self.db.cursor() cursor.execute(stmt) return cursor def query(self, stmt): cursor = self.query_cursor(stmt) results = cursor.fetchall() self.return_cursor(cursor) return results def use_database(self, db_name): return self.just_exec("use " + db_name) def dump_table(self, table): return self.just_exec("insert into " + table.Table + "(" + ','.join(table.Columns) + ")" + " values" + ','.join(["(" + ','.join(["N'" + str(column) + "'" if isinstance(column, nstr) else "'" + column + "'" if isinstance(column, str) else "'" + str(column) + "'" if isinstance(column, datetime_str) else "'" + str(column) + "'" if isinstance(column, datetime.date) else str(column) for column in row]) + ")" for row in table])) def drop(self, table): return self.just_exec(""" if exists(select name from sys.tables where name='%s') drop table %s; """ % (table.Table, table.Table)) def drop_procedure(self, procedure_name): return self.just_exec("""drop proc if exists %s""" % (procedure_name)) def drop_trigger(self, trigger_name): return self.just_exec("""drop trigger if exists %s""" % (trigger_name)) def drop_database(self, database_name): return self.just_exec(""" if exists(select name from sys.databases where name='%s') drop database %s; """ % (database_name, database_name)) def drop_foreign_key(self, table, foreign_key): return self.just_exec(""" if exists(select constraint_name from information_schema.key_column_usage where constraint_name='%s') alter table %s drop constraint %s """ % (foreign_key, table, foreign_key)) def create(self, table): return self.just_exec(table.CreateStatement) def select(self, table): return self.query("select * from " + table.Table) def close(self): if self.db is not None: self.db.close() self.db = None if __name__ == '__main__': server = SqlServer() print(server.show_database()) server.close()
991,322
30828dca5ae041bb4d41deef96a0aaa238bbba4b
import requests from bs4 import BeautifulSoup import pymysql from re import sub # b5647ade0475c5 # 40d209f8 # us-cdbr-east-02.cleardb.com # heroku_56d2d16ef2b2e35 # db = pymysql.connect("us-cdbr-east-02.cleardb.com","badaadfc741319","fd67aae8","heroku_64a98996a6e263e", charset='utf8') db = pymysql.connect("localhost","root","xu.61i6u;6","heroku_56d2d16ef2b2e35") cursor = db.cursor() Ccursor=db.cursor() Moneychange=db.cursor() def getData(url): requests.packages.urllib3.disable_warnings() resources = requests.get(url,verify=False) soup = BeautifulSoup(resources.text, 'html.parser') result= list() for house in soup.select('.search_result_item'): house_image = house.select_one('img')['src'] house_name = house.find("span", class_="item_title").string address = house.find(class_="num num-text").string url = f'''https://www.sinyi.com.tw/rent/{house.select_one('a')['href']}''' price_tag = house.find("div", class_="price_new") price = price_tag.find("span", class_="num").string money = int(sub(r'[^\d.]', '', price))#轉換資料型態 house_info=house.find("div",class_="detail_line2") house_info2=house_info.find_all('span',class_="num") house_info3=[] for x in house_info2: house_info3.append(str(x.string)) if house_info3[0]=='土地': continue result.append({ 'images': house_image, 'house_name': house_name, 'address': address, 'url': url, 'house_money':money, 'house_type':house_info3[0], 'pattern':house_info3[2]+'房'+house_info3[3]+'廳'+house_info3[4]+'衛'+house_info3[5]+'室', 'square_meters':float(house_info3[1]), 'floor':house_info3[6] }) for i, data in enumerate(result): print(f'#{i}: ') print(data['images']) print(data['house_name']) print(data['address']) print(data['url']) print(data['house_money']) print(data['house_type']) print(data['pattern']) print(data['square_meters']) print(data['floor']) print() checker=f"""SELECT COUNT(*) FROM page_data WHERE `Link`='{data['url']}'""" Ccursor.execute(checker) count=Ccursor.fetchone() try: Msg="" if count[0]==0: sqlinsert = ("INSERT INTO page_data(WebName,images,adress,house,Link,money,house_type,pattern,square_meters,floor)" "VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)") val = ['信義房屋',data['images'],data['address'],data['house_name'],data['url'],data['house_money'],data['house_type'],data['pattern'],data['square_meters'],data['floor']] cursor.execute(sqlinsert,val) sqlinsert_moneychange = ("INSERT INTO money_change(Link,money)" "VALUES(%s,%s)") change = [data['url'],data['house_money']] cursor.execute(sqlinsert_moneychange,change) db.commit() Msg='新增完成!' else: sqlUpdate=(f"UPDATE page_data SET Images=%s,adress=%s,house=%s,money=%s,house_type=%s,pattern=%s,square_meters=%s,floor=%s WHERE Link =%s") val=[data['images'],data['address'],data['house_name'],data['house_money'],data['house_type'],data['pattern'],data['square_meters'],data['floor'],data['url']] cursor.execute(sqlUpdate,val) select_moneychange=f"""SELECT `money` FROM `money_change` WHERE `Link`='{data['url']}' LIMIT 0 , 1""" Moneychange.execute(select_moneychange) Money=Moneychange.fetchone() if Money[0]!=data['house_money']: sqlinsert_moneychange = ("INSERT INTO money_change(Link,money)" "VALUES(%s,%s)") change = [data['url'],data['house_money']] cursor.execute(sqlinsert_moneychange,change) import PyEmail PyEmail.Email(data['url']) Msg+="(價格有異動!)" db.commit() Msg+="已更新!" print(Msg) except: print('寫入失敗') print(f'Total: {len(result)}') count=1#頁數156 while count<=20: pageURL="https://www.sinyi.com.tw/rent/list/"+str(count)+".html" print(pageURL) pageURL=getData(pageURL) print(f'=================第{count}頁==================') count+=1 db.close()
991,323
69d1cbd3391f0df19a35c18a9face9e5ee15305f
ghana_geometry = """{ "country": { "name": "Ghana", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-0.553262, 5.365266], [-0.6399, 5.32782], [-0.726983, 5.298418], [-0.727129, 5.285019], [-0.747849, 5.274265], [-0.759556, 5.25427], [-0.77782, 5.246271], [-0.798118, 5.223165], [-0.840899, 5.209639], [-1.015388, 5.201373], [-1.090997, 5.194277], [-1.119663, 5.173044], [-1.14853, 5.164266], [-1.166362, 5.145375], [-1.198445, 5.132962], [-1.21181, 5.117897], [-1.24644, 5.100638], [-1.321749, 5.09684], [-1.345879, 5.089759], [-1.35394, 5.079843], [-1.504474, 5.042992], [-1.580235, 5.033195], [-1.62237, 5.021055], [-1.643201, 4.971341], [-1.674125, 4.965485], [-1.7028, 4.955194], [-1.706188, 4.933716], [-1.741968, 4.91635], [-1.748369, 4.895044], [-1.733159, 4.888214], [-1.735042, 4.881586], [-1.7674, 4.874979], [-1.807307, 4.873578], [-1.830236, 4.862024], [-1.838091, 4.848697], [-1.871192, 4.843414], [-1.8905, 4.826493], [-1.912556, 4.825838], [-1.917107, 4.813606], [-1.936696, 4.80687], [-1.939964, 4.795324], [-1.972227, 4.769344], [-1.97407, 4.758979], [-2.03886, 4.755314], [-2.054479, 4.739862], [-2.079605, 4.748697], [-2.092137, 4.73883], [-2.093961, 4.74908], [-2.111725, 4.754625], [-2.105154, 4.775612], [-2.110406, 4.782399], [-2.148392, 4.797169], [-2.16881, 4.791168], [-2.169589, 4.807531], [-2.181262, 4.815618], [-2.203555, 4.822008], [-2.210892, 4.838625], [-2.247471, 4.85535], [-2.241771, 4.862509], [-2.247743, 4.88038], [-2.269425, 4.892352], [-2.269993, 4.899672], [-2.38358, 4.943515], [-2.559901, 4.987028], [-2.564347, 4.975847], [-2.635004, 4.982313], [-2.671256, 4.999399], [-3.108606, 5.090259], [-3.109056, 5.116005], [-3.072413, 5.113135], [-3.063435, 5.122011], [-3.051915, 5.116008], [-3.021485, 5.119487], [-2.976245, 5.087139], [-2.949103, 5.084109], [-2.929573, 5.096751], [-2.943151, 5.114372], [-2.939876, 5.125267], [-2.891743, 5.119526], [-2.890646, 5.126808], [-2.876857, 5.128111], [-2.844436, 5.107383], [-2.832208, 5.121491], [-2.817566, 5.105657], [-2.813525, 5.113462], [-2.810223, 5.106322], [-2.806132, 5.111662], [-2.790628, 5.107065], [-2.785717, 5.117644], [-2.785445, 5.109071], [-2.772532, 5.111514], [-2.757273, 5.10079], [-2.754103, 5.11664], [-2.742202, 5.113555], [-2.723777, 5.140981], [-2.741587, 5.155754], [-2.735765, 5.162311], [-2.745587, 5.166995], [-2.747634, 5.202123], [-2.757131, 5.200584], [-2.764825, 5.216967], [-2.756967, 5.218405], [-2.760954, 5.229756], [-2.755361, 5.233043], [-2.765832, 5.236398], [-2.76239, 5.245739], [-2.754739, 5.242213], [-2.760779, 5.249883], [-2.754929, 5.246227], [-2.754581, 5.253274], [-2.778896, 5.263641], [-2.769275, 5.268293], [-2.785267, 5.285649], [-2.781199, 5.294715], [-2.769555, 5.294632], [-2.766448, 5.305278], [-2.776739, 5.346477], [-2.76839, 5.357048], [-2.755687, 5.34382], [-2.7206, 5.345969], [-2.724197, 5.387819], [-2.74782, 5.437947], [-2.768276, 5.554425], [-2.761362, 5.59937], [-2.778912, 5.605848], [-2.775346, 5.615151], [-2.785042, 5.614297], [-2.786294, 5.624866], [-2.807134, 5.618344], [-2.808719, 5.627352], [-2.822197, 5.626442], [-2.858361, 5.657137], [-2.886052, 5.634788], [-2.934478, 5.619817], [-2.947567, 5.636677], [-2.966658, 5.640667], [-2.961028, 5.669704], [-2.953338, 5.673886], [-2.952739, 5.716037], [-3.026084, 5.70978], [-3.020522, 5.857146], [-3.072823, 5.982591], [-3.102292, 6.151989], [-3.130946, 6.208124], [-3.154817, 6.252279], [-3.174303, 6.251623], [-3.170742, 6.294262], [-3.176964, 6.312942], [-3.185762, 6.326016], [-3.236648, 6.538785], [-3.234153, 6.596525], [-3.262065, 6.617663], [-3.256671, 6.643909], [-3.235268, 6.667723], [-3.227831, 6.69131], [-3.232172, 6.700638], [-3.222308, 6.705268], [-3.209011, 6.731677], [-3.217843, 6.7489], [-3.211913, 6.75535], [-3.231305, 6.776702], [-3.231851, 6.82119], [-3.226199, 6.824613], [-3.116563, 7.00592], [-3.074949, 7.062909], [-3.032066, 7.07177], [-3.029149, 7.096677], [-3.023629, 7.142534], [-2.953363, 7.239228], [-2.978189, 7.272115], [-2.947263, 7.45653], [-2.937076, 7.480369], [-2.923468, 7.608614], [-2.850623, 7.761909], [-2.848625, 7.780295], [-2.826113, 7.805781], [-2.830361, 7.82058], [-2.825124, 7.824446], [-2.8329, 7.848627], [-2.803683, 7.972459], [-2.771742, 7.997178], [-2.631443, 8.053214], [-2.636181, 8.067117], [-2.629888, 8.115141], [-2.608482, 8.151947], [-2.555454, 8.146969], [-2.544786, 8.175779], [-2.494896, 8.205227], [-2.504456, 8.334058], [-2.590986, 8.785029], [-2.629015, 8.794516], [-2.596336, 8.830789], [-2.622913, 8.877929], [-2.618162, 8.92213], [-2.651277, 8.944061], [-2.65411, 9.007485], [-2.672188, 9.020281], [-2.701789, 9.015395], [-2.705673, 9.020929], [-2.720013, 9.0121], [-2.716569, 9.025386], [-2.76053, 9.025652], [-2.782535, 9.054065], [-2.765561, 9.08794], [-2.768628, 9.120465], [-2.779065, 9.137359], [-2.736876, 9.159556], [-2.722639, 9.186562], [-2.72496, 9.198972], [-2.720392, 9.195051], [-2.71156, 9.210224], [-2.66193, 9.240158], [-2.656591, 9.255619], [-2.684939, 9.287043], [-2.710611, 9.291227], [-2.72126, 9.312937], [-2.719549, 9.334774], [-2.703139, 9.339323], [-2.681112, 9.361389], [-2.673637, 9.387467], [-2.688587, 9.432523], [-2.684686, 9.487441], [-2.713808, 9.523926], [-2.755414, 9.549947], [-2.771073, 9.575168], [-2.771138, 9.601364], [-2.745244, 9.641576], [-2.758516, 9.680752], [-2.783985, 9.689309], [-2.787359, 9.697205], [-2.783303, 9.72505], [-2.79054, 9.746412], [-2.758561, 9.800582], [-2.732504, 9.815012], [-2.726805, 9.828983], [-2.76256, 9.884926], [-2.764269, 9.912945], [-2.743187, 9.959158], [-2.750096, 9.981675], [-2.782282, 10.027012], [-2.790764, 10.069699], [-2.794012, 10.126492], [-2.78773, 10.140063], [-2.794113, 10.175753], [-2.795933, 10.197731], [-2.757648, 10.2324], [-2.759028, 10.257817], [-2.834161, 10.296742], [-2.849971, 10.324979], [-2.831418, 10.388094], [-2.779802, 10.408611], [-2.774761, 10.424993], [-2.833682, 10.437246], [-2.853831, 10.450779], [-2.8675, 10.46186], [-2.874642, 10.491125], [-2.899089, 10.522845], [-2.901801, 10.551157], [-2.941114, 10.616842], [-2.94061, 10.636685], [-2.915673, 10.663593], [-2.905471, 10.688267], [-2.910859, 10.69989], [-2.939997, 10.709313], [-2.937854, 10.72226], [-2.896259, 10.762676], [-2.879098, 10.831973], [-2.86355, 10.857773], [-2.865577, 10.88418], [-2.837084, 10.893511], [-2.817528, 10.923816], [-2.81975, 10.942622], [-2.840644, 10.967588], [-2.834006, 11.004132], [-2.768318, 11.004842], [-2.757519, 11.019087], [-2.619313, 11.020081], [-2.452319, 11.023364], [-2.360171, 11.008188], [-2.22017, 11.020706], [-2.057971, 11.017525], [-2.006314, 11.004056], [-1.743398, 11.00815], [-1.744535, 11.038], [-1.545822, 11.040274], [-1.544113, 11.010193], [-1.428545, 11.01111], [-1.422833, 11.020305], [-1.396135, 10.990651], [-1.377213, 10.986143], [-1.181666, 10.989267], [-1.153865, 10.988188], [-1.114613, 10.985883], [-1.114796, 11.003956], [-1.000294, 11.007928], [-1.000129, 10.997878], [-0.916561, 11.002288], [-0.91666, 10.980349], [-0.911067, 10.980501], [-0.889115, 10.980985], [-0.892606, 10.962871], [-0.870024, 10.966774], [-0.855053, 10.998359], [-0.80758, 11.005874], [-0.80754, 10.998082], [-0.684077, 10.998684], [-0.680925, 10.982987], [-0.672453, 10.990478], [-0.653683, 10.987607], [-0.655426, 10.976133], [-0.671685, 10.96121], [-0.661476, 10.956408], [-0.653619, 10.963805], [-0.648271, 10.950118], [-0.626415, 10.93924], [-0.618738, 10.910359], [-0.593212, 10.923734], [-0.586102, 10.960926], [-0.568821, 10.991399], [-0.552948, 10.990717], [-0.544693, 10.975045], [-0.529633, 11.000598], [-0.511266, 10.988962], [-0.501422, 11.002203], [-0.501764, 11.016727], [-0.480326, 11.022941], [-0.475692, 11.035302], [-0.46112, 11.028056], [-0.437923, 11.030448], [-0.439805, 11.064992], [-0.428125, 11.114288], [-0.401204, 11.126924], [-0.37257, 11.123096], [-0.375892, 11.106095], [-0.361431, 11.069553], [-0.353404, 11.084682], [-0.338746, 11.090869], [-0.336734, 11.106765], [-0.322566, 11.114416], [-0.273422, 11.12358], [-0.271753, 11.137512], [-0.289716, 11.147747], [-0.276745, 11.174496], [-0.217987, 11.160217], [-0.136504, 11.13989], [-0.143663, 11.106631], [-0.12477, 11.104914], [-0.094879, 11.085897], [-0.054666, 11.086108], [-0.032246, 11.109685], [-0.019463, 11.114484], [-0.005976, 11.108492], [0.003967, 11.082731], [0.02429, 11.062979], [0.026095, 11.03559], [0.032797, 10.987771], [0.024804, 10.972563], [-0.006126, 10.962633], [-0.012365, 10.938066], [-0.007632, 10.914612], [-0.029865, 10.855921], [-0.02226, 10.819702], [-0.07301, 10.770027], [-0.073026, 10.71996], [-0.090412, 10.711945], [-0.059309, 10.632399], [0.041236, 10.601602], [0.056223, 10.583589], [0.060426, 10.561674], [0.143538, 10.5257], [0.159176, 10.47364], [0.154487, 10.465345], [0.172046, 10.4511], [0.169582, 10.429358], [0.188435, 10.41847], [0.194051, 10.402718], [0.209387, 10.405428], [0.205137, 10.418349], [0.217153, 10.42659], [0.233765, 10.413476], [0.259554, 10.407831], [0.284404, 10.42199], [0.300156, 10.402824], [0.290114, 10.376538], [0.307593, 10.371173], [0.3153, 10.337838], [0.328108, 10.339532], [0.337793, 10.325091], [0.31702, 10.309913], [0.396013, 10.314221], [0.39685, 10.3045], [0.369212, 10.284786], [0.381622, 10.273965], [0.361114, 10.258598], [0.350141, 10.168076], [0.363077, 10.137923], [0.352123, 10.102162], [0.360776, 10.087265], [0.395168, 10.080993], [0.417401, 10.058008], [0.410385, 10.021753], [0.360973, 10.031449], [0.359026, 9.987158], [0.386369, 9.949222], [0.385936, 9.937339], [0.365681, 9.932211], [0.356635, 9.925674], [0.351367, 9.904208], [0.358127, 9.84855], [0.331454, 9.798838], [0.335426, 9.778645], [0.325341, 9.773613], [0.329841, 9.75883], [0.318642, 9.727781], [0.345834, 9.714511], [0.350561, 9.675909], [0.363178, 9.673477], [0.369124, 9.652251], [0.382013, 9.644966], [0.37264, 9.608196], [0.382872, 9.591655], [0.351802, 9.572708], [0.334417, 9.579276], [0.289529, 9.577144], [0.265712, 9.567394], [0.23955, 9.574469], [0.23456, 9.548105], [0.242977, 9.524053], [0.255148, 9.518856], [0.290033, 9.52367], [0.310566, 9.506541], [0.267024, 9.478986], [0.228965, 9.48726], [0.228673, 9.463136], [0.246926, 9.438312], [0.275879, 9.42744], [0.331451, 9.448358], [0.346948, 9.47402], [0.343681, 9.488296], [0.359612, 9.499227], [0.389438, 9.491636], [0.415635, 9.50253], [0.445943, 9.50154], [0.50305, 9.475309], [0.503957, 9.458022], [0.495072, 9.451902], [0.500626, 9.437474], [0.519549, 9.43978], [0.524475, 9.431597], [0.5533, 9.423802], [0.566575, 9.405645], [0.563111, 9.354533], [0.552743, 9.345703], [0.562977, 9.324502], [0.559762, 9.305785], [0.539667, 9.30636], [0.507936, 9.254637], [0.518879, 9.229328], [0.539039, 9.213586], [0.503033, 9.153939], [0.476903, 9.144357], [0.485889, 9.098707], [0.478467, 9.099264], [0.45936, 9.072464], [0.462568, 9.055312], [0.456274, 9.055185], [0.455452, 9.035644], [0.463104, 9.034127], [0.494147, 8.957335], [0.514689, 8.935493], [0.512245, 8.902629], [0.527492, 8.878698], [0.517162, 8.864208], [0.520661, 8.854696], [0.508856, 8.855506], [0.496201, 8.840192], [0.500206, 8.814331], [0.490407, 8.800112], [0.47236, 8.799708], [0.468665, 8.792163], [0.458637, 8.810631], [0.447799, 8.810881], [0.430184, 8.796159], [0.439865, 8.785615], [0.425621, 8.779979], [0.421189, 8.79137], [0.381736, 8.793453], [0.378859, 8.771823], [0.401278, 8.757912], [0.374208, 8.754658], [0.383491, 8.740669], [0.471687, 8.599742], [0.491763, 8.597547], [0.499615, 8.57424], [0.514029, 8.565228], [0.529635, 8.570082], [0.560103, 8.549966], [0.571715, 8.526006], [0.584293, 8.528619], [0.590993, 8.516746], [0.621228, 8.512195], [0.629591, 8.507834], [0.629835, 8.496554], [0.6453, 8.493867], [0.644998, 8.475395], [0.655795, 8.455477], [0.651806, 8.422012], [0.69611, 8.404373], [0.693242, 8.394975], [0.705506, 8.394548], [0.698876, 8.388862], [0.712127, 8.376793], [0.710038, 8.351991], [0.729411, 8.341105], [0.726374, 8.28156], [0.682841, 8.279687], [0.673483, 8.259057], [0.638919, 8.260632], [0.638259, 8.245112], [0.624577, 8.235883], [0.61905, 8.215183], [0.59002, 8.207797], [0.58982, 8.195097], [0.613839, 8.180146], [0.60695, 8.172301], [0.606891, 8.138803], [0.592058, 8.139084], [0.591843, 8.10321], [0.585022, 8.093358], [0.598747, 8.05832], [0.598624, 8.027051], [0.60954, 8.027124], [0.622106, 8.014535], [0.622461, 8.007882], [0.612566, 8.005763], [0.617116, 7.965359], [0.62367, 7.962501], [0.62115, 7.936716], [0.63228, 7.91465], [0.627154, 7.901713], [0.62606, 7.901468], [0.619743, 7.900515], [0.627407, 7.868253], [0.617077, 7.796259], [0.629441, 7.794512], [0.630973, 7.768689], [0.611424, 7.752879], [0.630066, 7.706275], [0.619572, 7.703247], [0.608778, 7.710962], [0.590687, 7.703046], [0.582817, 7.656952], [0.585939, 7.623978], [0.518357, 7.592312], [0.529034, 7.584268], [0.521343, 7.520193], [0.529862, 7.481154], [0.518883, 7.460868], [0.521103, 7.454737], [0.53212, 7.457226], [0.535866, 7.426352], [0.553075, 7.405232], [0.573111, 7.394791], [0.619577, 7.41338], [0.644642, 7.397978], [0.643215, 7.375015], [0.658886, 7.316699], [0.643218, 7.279788], [0.644173, 7.263031], [0.631257, 7.19648], [0.624854, 7.182851], [0.617158, 7.182525], [0.616873, 7.161691], [0.605563, 7.157571], [0.592057, 7.113741], [0.611814, 7.105986], [0.614668, 7.095209], [0.597065, 7.060061], [0.602666, 7.023295], [0.595198, 7.00248], [0.548532, 6.993538], [0.522859, 6.973419], [0.525926, 6.941646], [0.54772, 6.937681], [0.566125, 6.920852], [0.557156, 6.88699], [0.53444, 6.877496], [0.543158, 6.864767], [0.531763, 6.856796], [0.531855, 6.82748], [0.53344, 6.827182], [0.535122, 6.826972], [0.547286, 6.834445], [0.579787, 6.807393], [0.575881, 6.798273], [0.567356, 6.802667], [0.566379, 6.782924], [0.581667, 6.761572], [0.608368, 6.747254], [0.618744, 6.754542], [0.650394, 6.737684], [0.636377, 6.629999], [0.640259, 6.631375], [0.656397, 6.60865], [0.666932, 6.605286], [0.672753, 6.613715], [0.697846, 6.588496], [0.742429, 6.589093], [0.748841, 6.563148], [0.717368, 6.52752], [0.732141, 6.484865], [0.746501, 6.483997], [0.749208, 6.448241], [0.781937, 6.43453], [0.787505, 6.413447], [0.826078, 6.404165], [0.861878, 6.379213], [0.892621, 6.335558], [0.963982, 6.335004], [1.004336, 6.334789], [1.01779, 6.269736], [1.036502, 6.238329], [1.054819, 6.233382], [1.066296, 6.219076], [1.079119, 6.171226], [1.200198, 6.167678], [1.199465, 6.112754], [1.126102, 6.077391], [1.081824, 6.046569], [1.031353, 5.982762], [0.995606, 5.926534], [0.993638, 5.878782], [0.981979, 5.842729], [0.936016, 5.792411], [0.816505, 5.76969], [0.708103, 5.767998], [0.715233, 5.773149], [0.694086, 5.765645], [0.680146, 5.770837], [0.458264, 5.788858], [0.32078, 5.782027], [0.252758, 5.766376], [0.219147, 5.746419], [0.184811, 5.743445], [0.140788, 5.723686], [0.125731, 5.707459], [0.067262, 5.693145], [0.032515, 5.656484], [0.004138, 5.624461], [-0.055086, 5.608302], [-0.073583, 5.590092], [-0.13388, 5.563363], [-0.174108, 5.549869], [-0.204946, 5.541097], [-0.208453, 5.532853], [-0.27231, 5.518929], [-0.358418, 5.497695], [-0.405403, 5.470501], [-0.420593, 5.452065], [-0.46525, 5.42942], [-0.462861, 5.418531], [-0.473843, 5.40666], [-0.499027, 5.37789], [-0.553262, 5.365266] ] ] ] } }, "regions": [ { "name": "Western North", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-2.558407, 5.978719], [-2.538482, 5.978536], [-2.534707, 5.965388], [-2.515076, 5.967002], [-2.516463, 5.954429], [-2.507574, 5.95009], [-2.505684, 5.923209], [-2.497181, 5.917213], [-2.509837, 5.914586], [-2.510288, 5.899185], [-2.498089, 5.896076], [-2.487145, 5.869968], [-2.499795, 5.873089], [-2.504072, 5.863123], [-2.513043, 5.865259], [-2.520603, 5.835435], [-2.512158, 5.834726], [-2.517724, 5.82488], [-2.486016, 5.825741], [-2.482737, 5.802073], [-2.494499, 5.800712], [-2.501484, 5.810066], [-2.497769, 5.785101], [-2.508818, 5.777331], [-2.529579, 5.785779], [-2.525104, 5.795292], [-2.556553, 5.794242], [-2.568413, 5.810912], [-2.582047, 5.807862], [-2.58123, 5.79526], [-2.571771, 5.791933], [-2.57849, 5.785183], [-2.571212, 5.769439], [-2.607365, 5.736974], [-2.597998, 5.733057], [-2.592701, 5.742971], [-2.581287, 5.740893], [-2.551053, 5.689738], [-2.558888, 5.68492], [-2.572017, 5.690486], [-2.574549, 5.678325], [-2.563521, 5.676706], [-2.580289, 5.664955], [-2.576362, 5.657795], [-2.558497, 5.660534], [-2.553139, 5.646716], [-2.557768, 5.641476], [-2.573372, 5.648016], [-2.57326, 5.627717], [-2.58208, 5.6233], [-2.568989, 5.608651], [-2.565592, 5.59691], [-2.571573, 5.590985], [-2.55889, 5.581726], [-2.566751, 5.581191], [-2.569044, 5.559179], [-2.576903, 5.562466], [-2.569212, 5.554954], [-2.572222, 5.541973], [-2.591251, 5.546436], [-2.595968, 5.525423], [-2.604362, 5.526532], [-2.598622, 5.512375], [-2.591739, 5.51856], [-2.578787, 5.513761], [-2.584774, 5.498939], [-2.579454, 5.486367], [-2.597543, 5.486177], [-2.600069, 5.470408], [-2.590654, 5.464855], [-2.604072, 5.465559], [-2.601061, 5.454183], [-2.610387, 5.448673], [-2.617823, 5.412531], [-2.686801, 5.348376], [-2.7206, 5.345969], [-2.724197, 5.387819], [-2.74782, 5.437947], [-2.768276, 5.554425], [-2.761362, 5.59937], [-2.778912, 5.605848], [-2.775346, 5.615151], [-2.785042, 5.614297], [-2.786294, 5.624866], [-2.807134, 5.618344], [-2.808719, 5.627352], [-2.822197, 5.626442], [-2.858361, 5.657137], [-2.886052, 5.634788], [-2.934478, 5.619817], [-2.947567, 5.636677], [-2.966658, 5.640667], [-2.961028, 5.669704], [-2.953338, 5.673886], [-2.952739, 5.716037], [-3.026084, 5.70978], [-3.020522, 5.857146], [-3.072823, 5.982591], [-3.102292, 6.151989], [-3.130946, 6.208124], [-3.154817, 6.252279], [-3.174303, 6.251623], [-3.170742, 6.294262], [-3.176964, 6.312942], [-3.185762, 6.326016], [-3.236648, 6.538785], [-3.234153, 6.596525], [-3.262065, 6.617663], [-3.256671, 6.643909], [-3.235268, 6.667723], [-3.227831, 6.69131], [-3.232172, 6.700638], [-3.222308, 6.705268], [-3.209011, 6.731677], [-3.217843, 6.7489], [-3.211913, 6.75535], [-3.231305, 6.776702], [-3.231851, 6.82119], [-3.226199, 6.824613], [-3.116563, 7.00592], [-3.075592, 6.971923], [-3.072785, 6.943727], [-3.045637, 6.938291], [-3.03388, 6.927503], [-2.988698, 6.946487], [-2.969034, 6.937096], [-2.938604, 6.941447], [-2.864815, 6.851682], [-2.85413, 6.831646], [-2.858033, 6.819764], [-2.848721, 6.816094], [-2.842804, 6.806472], [-2.84889, 6.799763], [-2.837547, 6.788725], [-2.849845, 6.772859], [-2.841313, 6.750369], [-2.865919, 6.718741], [-2.848075, 6.669085], [-2.877508, 6.653082], [-2.866381, 6.649813], [-2.869424, 6.638283], [-2.851714, 6.643062], [-2.832039, 6.630482], [-2.788775, 6.601442], [-2.779796, 6.575819], [-2.727323, 6.588867], [-2.701858, 6.585317], [-2.681136, 6.572066], [-2.672714, 6.509812], [-2.656416, 6.529458], [-2.606145, 6.519679], [-2.585236, 6.489794], [-2.543377, 6.463886], [-2.527389, 6.4621], [-2.52684, 6.454961], [-2.558944, 6.429766], [-2.54689, 6.400569], [-2.50648, 6.415036], [-2.485864, 6.408653], [-2.468845, 6.391613], [-2.468564, 6.380579], [-2.430552, 6.355223], [-2.420655, 6.347432], [-2.397483, 6.351653], [-2.399565, 6.341741], [-2.389832, 6.334313], [-2.389922, 6.346523], [-2.378259, 6.349364], [-2.35114, 6.395188], [-2.344032, 6.433745], [-2.35517, 6.447549], [-2.348977, 6.455434], [-2.360011, 6.477266], [-2.343645, 6.482423], [-2.337392, 6.493322], [-2.304143, 6.483584], [-2.29356, 6.49167], [-2.262643, 6.491183], [-2.239948, 6.472205], [-2.21542, 6.363817], [-2.22713, 6.320026], [-2.200068, 6.354553], [-2.172694, 6.364933], [-2.124657, 6.336818], [-2.124088, 6.301267], [-2.099372, 6.309325], [-2.074265, 6.294526], [-2.098648, 6.239961], [-2.126598, 6.250339], [-2.131398, 6.258989], [-2.175556, 6.214382], [-2.205935, 6.198023], [-2.18901, 6.147232], [-2.214565, 6.141818], [-2.215834, 6.141414], [-2.217306, 6.141912], [-2.217609, 6.143149], [-2.217411, 6.144086], [-2.21811, 6.144228], [-2.219074, 6.144481], [-2.221221, 6.144768], [-2.224252, 6.145135], [-2.225182, 6.14525], [-2.225596, 6.14556], [-2.225952, 6.146101], [-2.227101, 6.148234], [-2.227376, 6.148743], [-2.227893, 6.149616], [-2.228306, 6.150099], [-2.229007, 6.150363], [-2.229477, 6.150352], [-2.229994, 6.150225], [-2.230602, 6.149903], [-2.231372, 6.149294], [-2.232577, 6.148283], [-2.233289, 6.147702], [-2.234001, 6.147122], [-2.235723, 6.145788], [-2.236526, 6.145122], [-2.237008, 6.144524], [-2.237261, 6.144346], [-2.237513, 6.144168], [-2.238397, 6.143674], [-2.239603, 6.142903], [-2.240567, 6.142168], [-2.241313, 6.141432], [-2.241899, 6.140823], [-2.242519, 6.140524], [-2.244264, 6.14011], [-2.245216, 6.139834], [-2.245871, 6.139581], [-2.246261, 6.139317], [-2.246651, 6.139052], [-2.247306, 6.138616], [-2.247857, 6.138443], [-2.248385, 6.138466], [-2.248959, 6.138581], [-2.249788, 6.138658], [-2.250457, 6.138782], [-2.251455, 6.138491], [-2.253176, 6.137773], [-2.25381, 6.137355], [-2.255228, 6.13642], [-2.255721, 6.136016], [-2.256017, 6.135314], [-2.256176, 6.134853], [-2.256256, 6.134554], [-2.256346, 6.134209], [-2.256357, 6.134099], [-2.256369, 6.13399], [-2.25623, 6.133726], [-2.255756, 6.133072], [-2.25481, 6.132691], [-2.255224, 6.131948], [-2.255177, 6.128061], [-2.255267, 6.127808], [-2.255404, 6.127336], [-2.255827, 6.126863], [-2.256343, 6.12647], [-2.256847, 6.126193], [-2.257214, 6.1258], [-2.257476, 6.12527], [-2.25737, 6.124501], [-2.257196, 6.12388], [-2.257009, 6.123007], [-2.2568, 6.12226], [-2.256636, 6.121525], [-2.256496, 6.120905], [-2.256506, 6.120456], [-2.256872, 6.119949], [-2.257458, 6.119981], [-2.25832, 6.120243], [-2.258631, 6.120253], [-2.258941, 6.120264], [-2.259389, 6.12017], [-2.259882, 6.119973], [-2.260065, 6.119789], [-2.260698, 6.12008], [-2.26117, 6.120318], [-2.261388, 6.120329], [-2.26156, 6.120293], [-2.26179, 6.120245], [-2.262077, 6.120175], [-2.26222, 6.120145], [-2.267506, 6.120349], [-2.26833, 6.120769], [-2.26878, 6.121123], [-2.26923, 6.121476], [-2.269622, 6.121738], [-2.270118, 6.122023], [-2.270342, 6.122125], [-2.271165, 6.122373], [-2.272144, 6.12174], [-2.273887, 6.116504], [-2.274252, 6.116065], [-2.274618, 6.115821], [-2.275168, 6.115588], [-2.275741, 6.115354], [-2.276393, 6.114971], [-2.276816, 6.114566], [-2.279727, 6.107419], [-2.283474, 6.102288], [-2.283619, 6.102241], [-2.284668, 6.101904], [-2.285001, 6.102041], [-2.285139, 6.102156], [-2.285623, 6.102396], [-2.286753, 6.103362], [-2.288039, 6.103675], [-2.288982, 6.103867], [-2.289155, 6.103901], [-2.289456, 6.103911], [-2.289798, 6.103922], [-2.290578, 6.103793], [-2.291499, 6.103559], [-2.291772, 6.103489], [-2.291967, 6.103397], [-2.292781, 6.102911], [-2.29293, 6.102773], [-2.293491, 6.102391], [-2.294328, 6.101767], [-2.294465, 6.101652], [-2.295095, 6.101075], [-2.295255, 6.100948], [-2.295771, 6.100452], [-2.295919, 6.100325], [-2.296721, 6.099678], [-2.296882, 6.099562], [-2.297375, 6.09925], [-2.297547, 6.099169], [-2.298028, 6.09896], [-2.298287, 6.098885], [-2.303436, 6.096564], [-2.304034, 6.096653], [-2.304723, 6.096695], [-2.305092, 6.096819], [-2.305345, 6.096967], [-2.305623, 6.097207], [-2.305992, 6.097458], [-2.306556, 6.097708], [-2.307016, 6.097809], [-2.30751, 6.097794], [-2.307831, 6.097735], [-2.308141, 6.097676], [-2.308739, 6.097741], [-2.309039, 6.0979], [-2.309706, 6.098069], [-2.310108, 6.098021], [-2.310269, 6.097974], [-2.310486, 6.097926], [-2.310807, 6.09781], [-2.311083, 6.09775], [-2.311451, 6.097771], [-2.311807, 6.097804], [-2.312106, 6.097802], [-2.312358, 6.097651], [-2.312735, 6.097304], [-2.313134, 6.096888], [-2.31533, 6.096087], [-2.315623, 6.096126], [-2.316209, 6.096065], [-2.316542, 6.09604], [-2.316945, 6.096199], [-2.31725, 6.096266], [-2.318761, 6.096349], [-2.319095, 6.096508], [-2.319556, 6.096666], [-2.319775, 6.096872], [-2.320006, 6.097135], [-2.320296, 6.097525], [-2.320596, 6.097718], [-2.320889, 6.097865], [-2.322158, 6.099573], [-2.323303, 6.100469], [-2.323719, 6.101005], [-2.324169, 6.101175], [-2.325024, 6.101173], [-2.325997, 6.101442], [-2.326757, 6.101211], [-2.327142, 6.101446], [-2.327805, 6.101252], [-2.328445, 6.100822], [-2.329323, 6.101034], [-2.329667, 6.100943], [-2.330114, 6.100989], [-2.330691, 6.100731], [-2.33122, 6.101164], [-2.331451, 6.101335], [-2.331877, 6.101402], [-2.332554, 6.101317], [-2.332979, 6.101384], [-2.333325, 6.101554], [-2.333624, 6.101691], [-2.334027, 6.101838], [-2.334407, 6.102008], [-2.334947, 6.101901], [-2.335314, 6.101795], [-2.335727, 6.101759], [-2.335981, 6.101849], [-2.336292, 6.102054], [-2.33658, 6.102237], [-2.33703, 6.102441], [-2.337306, 6.102485], [-2.337582, 6.10253], [-2.3378, 6.102517], [-2.33818, 6.102618], [-2.338617, 6.102857], [-2.339274, 6.103118], [-2.339561, 6.103116], [-2.340055, 6.103044], [-2.340595, 6.103133], [-2.34124, 6.103394], [-2.342022, 6.103516], [-2.342412, 6.103468], [-2.342504, 6.103444], [-2.342596, 6.103421], [-2.342894, 6.103269], [-2.343226, 6.103106], [-2.343651, 6.103046], [-2.343973, 6.103113], [-2.34433, 6.103192], [-2.344743, 6.103166], [-2.345203, 6.103233], [-2.345536, 6.103288], [-2.345812, 6.103218], [-2.346098, 6.103055], [-2.346569, 6.103064], [-2.347063, 6.103049], [-2.347316, 6.103036], [-2.347593, 6.103299], [-2.34787, 6.103562], [-2.34802, 6.103653], [-2.348701, 6.104167], [-2.3493, 6.104439], [-2.349553, 6.104426], [-2.349725, 6.104356], [-2.349891, 6.104292], [-2.349965, 6.104263], [-2.350127, 6.104308], [-2.350231, 6.10456], [-2.350393, 6.10464], [-2.350611, 6.104615], [-2.350783, 6.104603], [-2.351782, 6.104551], [-2.352542, 6.104708], [-2.35284, 6.104775], [-2.353014, 6.104923], [-2.353199, 6.105106], [-2.353372, 6.105312], [-2.353511, 6.105403], [-2.353682, 6.105311], [-2.353798, 6.105448], [-2.354017, 6.105562], [-2.354073, 6.105377], [-2.354223, 6.105457], [-2.354348, 6.105456], [-2.35443, 6.105456], [-2.354579, 6.105363], [-2.35482, 6.105315], [-2.355245, 6.105278], [-2.355509, 6.105219], [-2.355691, 6.104942], [-2.35577, 6.104677], [-2.355889, 6.104481], [-2.356009, 6.104285], [-2.356238, 6.104191], [-2.356422, 6.104156], [-2.356605, 6.104063], [-2.356742, 6.103843], [-2.356769, 6.103671], [-2.356797, 6.103498], [-2.356876, 6.103187], [-2.356944, 6.103026], [-2.357092, 6.102841], [-2.357274, 6.102564], [-2.357365, 6.102425], [-2.357594, 6.102263], [-2.358007, 6.102192], [-2.358145, 6.102168], [-2.358282, 6.102144], [-2.35842, 6.102051], [-2.358533, 6.101855], [-2.358728, 6.101773], [-2.358935, 6.101784], [-2.359199, 6.101748], [-2.359336, 6.101643], [-2.359439, 6.101424], [-2.359495, 6.10124], [-2.359644, 6.101135], [-2.359828, 6.101134], [-2.36, 6.101133], [-2.360137, 6.10104], [-2.360194, 6.100879], [-2.360342, 6.100614], [-2.360525, 6.100475], [-2.360569, 6.100302], [-2.360741, 6.100209], [-2.36096, 6.100369], [-2.361087, 6.100495], [-2.361272, 6.100551], [-2.361478, 6.100527], [-2.361602, 6.100539], [-2.362134, 6.100592], [-2.376907, 6.082648], [-2.411979, 6.087959], [-2.433843, 6.107045], [-2.43343, 6.115865], [-2.445182, 6.115093], [-2.451682, 6.099727], [-2.470949, 6.109623], [-2.5068, 6.083082], [-2.506001, 6.072552], [-2.489324, 6.064654], [-2.504277, 6.054366], [-2.558407, 5.978719] ] ] ] } }, { "name": "Western", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-1.7674, 4.874979], [-1.807307, 4.873578], [-1.830236, 4.862024], [-1.838091, 4.848697], [-1.871192, 4.843414], [-1.8905, 4.826493], [-1.912556, 4.825838], [-1.917107, 4.813606], [-1.936696, 4.80687], [-1.939964, 4.795324], [-1.972227, 4.769344], [-1.97407, 4.758979], [-2.03886, 4.755314], [-2.054479, 4.739862], [-2.079605, 4.748697], [-2.092137, 4.73883], [-2.093961, 4.74908], [-2.111725, 4.754625], [-2.105154, 4.775612], [-2.110406, 4.782399], [-2.148392, 4.797169], [-2.16881, 4.791168], [-2.169589, 4.807531], [-2.181262, 4.815618], [-2.203555, 4.822008], [-2.210892, 4.838625], [-2.247471, 4.85535], [-2.241771, 4.862509], [-2.247743, 4.88038], [-2.269425, 4.892352], [-2.269993, 4.899672], [-2.38358, 4.943515], [-2.559901, 4.987028], [-2.564347, 4.975847], [-2.635004, 4.982313], [-2.671256, 4.999399], [-3.108606, 5.090259], [-3.109056, 5.116005], [-3.072413, 5.113135], [-3.063435, 5.122011], [-3.051915, 5.116008], [-3.021485, 5.119487], [-2.976245, 5.087139], [-2.949103, 5.084109], [-2.929573, 5.096751], [-2.943151, 5.114372], [-2.939876, 5.125267], [-2.891743, 5.119526], [-2.890646, 5.126808], [-2.876857, 5.128111], [-2.844436, 5.107383], [-2.832208, 5.121491], [-2.817566, 5.105657], [-2.813525, 5.113462], [-2.810223, 5.106322], [-2.806132, 5.111662], [-2.790628, 5.107065], [-2.785717, 5.117644], [-2.785445, 5.109071], [-2.772532, 5.111514], [-2.757273, 5.10079], [-2.754103, 5.11664], [-2.742202, 5.113555], [-2.723777, 5.140981], [-2.741587, 5.155754], [-2.735765, 5.162311], [-2.745587, 5.166995], [-2.747634, 5.202123], [-2.757131, 5.200584], [-2.764825, 5.216967], [-2.756967, 5.218405], [-2.760954, 5.229756], [-2.755361, 5.233043], [-2.765832, 5.236398], [-2.76239, 5.245739], [-2.754739, 5.242213], [-2.760779, 5.249883], [-2.754929, 5.246227], [-2.754581, 5.253274], [-2.778896, 5.263641], [-2.769275, 5.268293], [-2.785267, 5.285649], [-2.781199, 5.294715], [-2.769555, 5.294632], [-2.766448, 5.305278], [-2.776739, 5.346477], [-2.76839, 5.357048], [-2.755687, 5.34382], [-2.7206, 5.345969], [-2.686801, 5.348376], [-2.617823, 5.412531], [-2.610387, 5.448673], [-2.601061, 5.454183], [-2.604072, 5.465559], [-2.590654, 5.464855], [-2.600069, 5.470408], [-2.597543, 5.486177], [-2.579454, 5.486367], [-2.584774, 5.498939], [-2.578787, 5.513761], [-2.591739, 5.51856], [-2.598622, 5.512375], [-2.604362, 5.526532], [-2.595968, 5.525423], [-2.591251, 5.546436], [-2.572222, 5.541973], [-2.569212, 5.554954], [-2.576903, 5.562466], [-2.569044, 5.559179], [-2.566751, 5.581191], [-2.55889, 5.581726], [-2.571573, 5.590985], [-2.565592, 5.59691], [-2.568989, 5.608651], [-2.58208, 5.6233], [-2.57326, 5.627717], [-2.573372, 5.648016], [-2.557768, 5.641476], [-2.553139, 5.646716], [-2.558497, 5.660534], [-2.576362, 5.657795], [-2.580289, 5.664955], [-2.563521, 5.676706], [-2.574549, 5.678325], [-2.572017, 5.690486], [-2.558888, 5.68492], [-2.551053, 5.689738], [-2.581287, 5.740893], [-2.592701, 5.742971], [-2.597998, 5.733057], [-2.607365, 5.736974], [-2.571212, 5.769439], [-2.57849, 5.785183], [-2.571771, 5.791933], [-2.58123, 5.79526], [-2.582047, 5.807862], [-2.568413, 5.810912], [-2.556553, 5.794242], [-2.525104, 5.795292], [-2.529579, 5.785779], [-2.508818, 5.777331], [-2.497769, 5.785101], [-2.501484, 5.810066], [-2.494499, 5.800712], [-2.482737, 5.802073], [-2.486016, 5.825741], [-2.517724, 5.82488], [-2.512158, 5.834726], [-2.520603, 5.835435], [-2.513043, 5.865259], [-2.504072, 5.863123], [-2.499795, 5.873089], [-2.487145, 5.869968], [-2.498089, 5.896076], [-2.510288, 5.899185], [-2.509837, 5.914586], [-2.497181, 5.917213], [-2.505684, 5.923209], [-2.507574, 5.95009], [-2.516463, 5.954429], [-2.515076, 5.967002], [-2.534707, 5.965388], [-2.538482, 5.978536], [-2.558407, 5.978719], [-2.504277, 6.054366], [-2.489324, 6.064654], [-2.506001, 6.072552], [-2.5068, 6.083082], [-2.470949, 6.109623], [-2.451682, 6.099727], [-2.445182, 6.115093], [-2.43343, 6.115865], [-2.433843, 6.107045], [-2.411979, 6.087959], [-2.376907, 6.082648], [-2.362134, 6.100592], [-2.361602, 6.100539], [-2.361478, 6.100527], [-2.361272, 6.100551], [-2.361087, 6.100495], [-2.36096, 6.100369], [-2.360741, 6.100209], [-2.360569, 6.100302], [-2.360525, 6.100475], [-2.360342, 6.100614], [-2.360194, 6.100879], [-2.360137, 6.10104], [-2.36, 6.101133], [-2.359828, 6.101134], [-2.359644, 6.101135], [-2.359495, 6.10124], [-2.359439, 6.101424], [-2.359336, 6.101643], [-2.359199, 6.101748], [-2.358935, 6.101784], [-2.358728, 6.101773], [-2.358533, 6.101855], [-2.35842, 6.102051], [-2.358282, 6.102144], [-2.358145, 6.102168], [-2.358007, 6.102192], [-2.357594, 6.102263], [-2.357365, 6.102425], [-2.357274, 6.102564], [-2.357092, 6.102841], [-2.356944, 6.103026], [-2.356876, 6.103187], [-2.356797, 6.103498], [-2.356769, 6.103671], [-2.356742, 6.103843], [-2.356605, 6.104063], [-2.356422, 6.104156], [-2.356238, 6.104191], [-2.356009, 6.104285], [-2.355889, 6.104481], [-2.35577, 6.104677], [-2.355691, 6.104942], [-2.355509, 6.105219], [-2.355245, 6.105278], [-2.35482, 6.105315], [-2.354579, 6.105363], [-2.35443, 6.105456], [-2.354348, 6.105456], [-2.354223, 6.105457], [-2.354073, 6.105377], [-2.354017, 6.105562], [-2.353798, 6.105448], [-2.353682, 6.105311], [-2.353511, 6.105403], [-2.353372, 6.105312], [-2.353199, 6.105106], [-2.353014, 6.104923], [-2.35284, 6.104775], [-2.352542, 6.104708], [-2.351782, 6.104551], [-2.350783, 6.104603], [-2.350611, 6.104615], [-2.350393, 6.10464], [-2.350231, 6.10456], [-2.350127, 6.104308], [-2.349965, 6.104263], [-2.349891, 6.104292], [-2.349725, 6.104356], [-2.349553, 6.104426], [-2.3493, 6.104439], [-2.348701, 6.104167], [-2.34802, 6.103653], [-2.34787, 6.103562], [-2.347593, 6.103299], [-2.347316, 6.103036], [-2.347063, 6.103049], [-2.346569, 6.103064], [-2.346098, 6.103055], [-2.345812, 6.103218], [-2.345536, 6.103288], [-2.345203, 6.103233], [-2.344743, 6.103166], [-2.34433, 6.103192], [-2.343973, 6.103113], [-2.343651, 6.103046], [-2.343226, 6.103106], [-2.342894, 6.103269], [-2.342596, 6.103421], [-2.342504, 6.103444], [-2.342412, 6.103468], [-2.342022, 6.103516], [-2.34124, 6.103394], [-2.340595, 6.103133], [-2.340055, 6.103044], [-2.339561, 6.103116], [-2.339274, 6.103118], [-2.338617, 6.102857], [-2.33818, 6.102618], [-2.3378, 6.102517], [-2.337582, 6.10253], [-2.337306, 6.102485], [-2.33703, 6.102441], [-2.33658, 6.102237], [-2.336292, 6.102054], [-2.335981, 6.101849], [-2.335727, 6.101759], [-2.335314, 6.101795], [-2.334947, 6.101901], [-2.334407, 6.102008], [-2.334027, 6.101838], [-2.333624, 6.101691], [-2.333325, 6.101554], [-2.332979, 6.101384], [-2.332554, 6.101317], [-2.331877, 6.101402], [-2.331451, 6.101335], [-2.33122, 6.101164], [-2.330691, 6.100731], [-2.330114, 6.100989], [-2.329667, 6.100943], [-2.329323, 6.101034], [-2.328445, 6.100822], [-2.327805, 6.101252], [-2.327142, 6.101446], [-2.326757, 6.101211], [-2.325997, 6.101442], [-2.325024, 6.101173], [-2.324169, 6.101175], [-2.323719, 6.101005], [-2.323303, 6.100469], [-2.322158, 6.099573], [-2.320889, 6.097865], [-2.320596, 6.097718], [-2.320296, 6.097525], [-2.320006, 6.097135], [-2.319775, 6.096872], [-2.319556, 6.096666], [-2.319095, 6.096508], [-2.318761, 6.096349], [-2.31725, 6.096266], [-2.316945, 6.096199], [-2.316542, 6.09604], [-2.316209, 6.096065], [-2.315623, 6.096126], [-2.31533, 6.096087], [-2.313134, 6.096888], [-2.312735, 6.097304], [-2.312358, 6.097651], [-2.312106, 6.097802], [-2.311807, 6.097804], [-2.311451, 6.097771], [-2.311083, 6.09775], [-2.310807, 6.09781], [-2.310486, 6.097926], [-2.310269, 6.097974], [-2.310108, 6.098021], [-2.309706, 6.098069], [-2.309039, 6.0979], [-2.308739, 6.097741], [-2.308141, 6.097676], [-2.307831, 6.097735], [-2.30751, 6.097794], [-2.307016, 6.097809], [-2.306556, 6.097708], [-2.305992, 6.097458], [-2.305623, 6.097207], [-2.305345, 6.096967], [-2.305092, 6.096819], [-2.304723, 6.096695], [-2.304034, 6.096653], [-2.303436, 6.096564], [-2.298287, 6.098885], [-2.298028, 6.09896], [-2.297547, 6.099169], [-2.297375, 6.09925], [-2.296882, 6.099562], [-2.296721, 6.099678], [-2.295919, 6.100325], [-2.295771, 6.100452], [-2.295255, 6.100948], [-2.295095, 6.101075], [-2.294465, 6.101652], [-2.294328, 6.101767], [-2.293491, 6.102391], [-2.29293, 6.102773], [-2.292781, 6.102911], [-2.291967, 6.103397], [-2.291772, 6.103489], [-2.291499, 6.103559], [-2.290578, 6.103793], [-2.289798, 6.103922], [-2.289456, 6.103911], [-2.289155, 6.103901], [-2.288982, 6.103867], [-2.288039, 6.103675], [-2.286753, 6.103362], [-2.285623, 6.102396], [-2.285139, 6.102156], [-2.285001, 6.102041], [-2.284668, 6.101904], [-2.283619, 6.102241], [-2.283474, 6.102288], [-2.279727, 6.107419], [-2.276816, 6.114566], [-2.276393, 6.114971], [-2.275741, 6.115354], [-2.275168, 6.115588], [-2.274618, 6.115821], [-2.274252, 6.116065], [-2.273887, 6.116504], [-2.272144, 6.12174], [-2.271165, 6.122373], [-2.270342, 6.122125], [-2.270118, 6.122023], [-2.269622, 6.121738], [-2.26923, 6.121476], [-2.26878, 6.121123], [-2.26833, 6.120769], [-2.267506, 6.120349], [-2.26222, 6.120145], [-2.262077, 6.120175], [-2.26179, 6.120245], [-2.26156, 6.120293], [-2.261388, 6.120329], [-2.26117, 6.120318], [-2.260698, 6.12008], [-2.260065, 6.119789], [-2.259882, 6.119973], [-2.259389, 6.12017], [-2.258941, 6.120264], [-2.258631, 6.120253], [-2.25832, 6.120243], [-2.257458, 6.119981], [-2.256872, 6.119949], [-2.256506, 6.120456], [-2.256496, 6.120905], [-2.256636, 6.121525], [-2.2568, 6.12226], [-2.257009, 6.123007], [-2.257196, 6.12388], [-2.25737, 6.124501], [-2.257476, 6.12527], [-2.257214, 6.1258], [-2.256847, 6.126193], [-2.256343, 6.12647], [-2.255827, 6.126863], [-2.255404, 6.127336], [-2.255267, 6.127808], [-2.255177, 6.128061], [-2.255224, 6.131948], [-2.25481, 6.132691], [-2.255756, 6.133072], [-2.25623, 6.133726], [-2.256369, 6.13399], [-2.256357, 6.134099], [-2.256346, 6.134209], [-2.256256, 6.134554], [-2.256176, 6.134853], [-2.256017, 6.135314], [-2.255721, 6.136016], [-2.255228, 6.13642], [-2.25381, 6.137355], [-2.253176, 6.137773], [-2.251455, 6.138491], [-2.250457, 6.138782], [-2.249788, 6.138658], [-2.248959, 6.138581], [-2.248385, 6.138466], [-2.247857, 6.138443], [-2.247306, 6.138616], [-2.246651, 6.139052], [-2.246261, 6.139317], [-2.245871, 6.139581], [-2.245216, 6.139834], [-2.244264, 6.14011], [-2.242519, 6.140524], [-2.241899, 6.140823], [-2.241313, 6.141432], [-2.240567, 6.142168], [-2.239603, 6.142903], [-2.238397, 6.143674], [-2.237513, 6.144168], [-2.237261, 6.144346], [-2.237008, 6.144524], [-2.236526, 6.145122], [-2.235723, 6.145788], [-2.234001, 6.147122], [-2.233289, 6.147702], [-2.232577, 6.148283], [-2.231372, 6.149294], [-2.230602, 6.149903], [-2.229994, 6.150225], [-2.229477, 6.150352], [-2.229007, 6.150363], [-2.228306, 6.150099], [-2.227893, 6.149616], [-2.227376, 6.148743], [-2.227101, 6.148234], [-2.225952, 6.146101], [-2.225596, 6.14556], [-2.225182, 6.14525], [-2.224252, 6.145135], [-2.221221, 6.144768], [-2.219074, 6.144481], [-2.21811, 6.144228], [-2.217411, 6.144086], [-2.217609, 6.143149], [-2.217306, 6.141912], [-2.215834, 6.141414], [-2.214565, 6.141818], [-2.18901, 6.147232], [-2.181754, 6.121049], [-2.162378, 6.119866], [-2.140277, 6.09124], [-2.058687, 6.071587], [-2.047617, 6.059275], [-2.05152, 6.050058], [-1.98531, 6.016524], [-1.953818, 5.984364], [-1.944365, 5.983529], [-1.933366, 5.947929], [-1.90903, 5.937231], [-1.903157, 5.917464], [-1.894874, 5.917264], [-1.887951, 5.897389], [-1.869627, 5.88391], [-1.841806, 5.901731], [-1.814942, 5.889249], [-1.813732, 5.867877], [-1.844669, 5.805017], [-1.82881, 5.786533], [-1.850735, 5.767637], [-1.801003, 5.751003], [-1.816647, 5.724882], [-1.784501, 5.729798], [-1.791833, 5.695606], [-1.808242, 5.680999], [-1.818049, 5.674711], [-1.832191, 5.592489], [-1.824466, 5.593252], [-1.75059, 5.626943], [-1.737731, 5.623653], [-1.685711, 5.642321], [-1.676383, 5.625173], [-1.684964, 5.625433], [-1.685925, 5.602089], [-1.658011, 5.61828], [-1.642913, 5.616919], [-1.621404, 5.599363], [-1.607573, 5.563582], [-1.591939, 5.563364], [-1.594013, 5.529939], [-1.608131, 5.531956], [-1.615376, 5.515792], [-1.612709, 5.46583], [-1.601684, 5.450665], [-1.622501, 5.440154], [-1.628859, 5.422043], [-1.609101, 5.423417], [-1.596517, 5.410793], [-1.562998, 5.415401], [-1.513874, 5.392734], [-1.502391, 5.401403], [-1.489351, 5.399293], [-1.474816, 5.377788], [-1.462097, 5.381936], [-1.456633, 5.348074], [-1.404112, 5.306002], [-1.399803, 5.298057], [-1.427714, 5.2891], [-1.435519, 5.267604], [-1.444102, 5.267866], [-1.447421, 5.222317], [-1.446334, 5.21019], [-1.509913, 5.208328], [-1.522771, 5.199695], [-1.525075, 5.17072], [-1.533033, 5.173777], [-1.53835, 5.163448], [-1.581462, 5.154986], [-1.580235, 5.033195], [-1.62237, 5.021055], [-1.643201, 4.971341], [-1.674125, 4.965485], [-1.7028, 4.955194], [-1.706188, 4.933716], [-1.741968, 4.91635], [-1.748369, 4.895044], [-1.733159, 4.888214], [-1.735042, 4.881586], [-1.7674, 4.874979] ] ] ] } }, { "name": "Bono East", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-0.447262, 8.158532], [-0.384706, 8.152823], [-0.294892, 8.117376], [-0.248848, 8.07708], [-0.240596, 8.049652], [-0.214685, 8.030984], [-0.173185, 8.024696], [-0.155092, 8.030666], [-0.141547, 8.017907], [-0.144167, 8.0055], [-0.173839, 7.95746], [-0.141152, 7.958428], [-0.134947, 7.948588], [-0.145417, 7.903095], [-0.126463, 7.788235], [-0.100095, 7.750424], [-0.014521, 7.756958], [0.004112, 7.742433], [0.002498, 7.717612], [-0.015208, 7.684035], [-0.014305, 7.626107], [0.00943, 7.57847], [0.077091, 7.482111], [0.090952, 7.429324], [0.124054, 7.406485], [0.178905, 7.381002], [0.208353, 7.350928], [0.214976, 7.310054], [0.182331, 7.179696], [0.081071, 7.181707], [0.050508, 7.172056], [0.004396, 7.194039], [-0.052708, 7.196452], [-0.084879, 7.179294], [-0.10713, 7.195112], [-0.148651, 7.199951], [-0.158927, 7.194455], [-0.180045, 7.197861], [-0.181056, 7.203797], [-0.215545, 7.199698], [-0.220814, 7.212838], [-0.238718, 7.202353], [-0.242494, 7.222036], [-0.256652, 7.228333], [-0.261806, 7.266811], [-0.288849, 7.284389], [-0.30224, 7.277728], [-0.31099, 7.285705], [-0.324436, 7.281094], [-0.329865, 7.29094], [-0.354228, 7.297647], [-0.355032, 7.308798], [-0.381889, 7.31286], [-0.540942, 7.354552], [-0.598681, 7.348628], [-0.654182, 7.430788], [-0.650042, 7.502031], [-0.67693, 7.529034], [-0.683587, 7.524904], [-0.689133, 7.541495], [-0.720945, 7.519886], [-0.732137, 7.522472], [-0.747675, 7.509304], [-0.77678, 7.506099], [-0.795762, 7.498897], [-0.807665, 7.502597], [-0.808858, 7.511019], [-0.820403, 7.499539], [-0.828353, 7.512259], [-0.843682, 7.509756], [-0.84506, 7.518391], [-0.863956, 7.5147], [-0.867158, 7.520714], [-0.889943, 7.516582], [-0.89317, 7.504294], [-0.925223, 7.503765], [-0.953188, 7.523524], [-0.972122, 7.519677], [-0.983499, 7.534707], [-1.002301, 7.528205], [-1.014846, 7.534862], [-1.040813, 7.527553], [-1.052599, 7.508629], [-1.068447, 7.501641], [-1.070154, 7.49106], [-1.083796, 7.487733], [-1.104862, 7.464884], [-1.126019, 7.477082], [-1.145002, 7.470059], [-1.155513, 7.469036], [-1.157092, 7.47976], [-1.181307, 7.481452], [-1.202901, 7.495455], [-1.23946, 7.489329], [-1.249916, 7.496205], [-1.266441, 7.521543], [-1.290431, 7.535196], [-1.299528, 7.571231], [-1.313566, 7.580673], [-1.317195, 7.610658], [-1.309718, 7.618407], [-1.316188, 7.624742], [-1.343902, 7.619401], [-1.353366, 7.609166], [-1.386071, 7.605147], [-1.424837, 7.58188], [-1.472449, 7.49661], [-1.520243, 7.450079], [-1.509614, 7.42918], [-1.51555, 7.390943], [-1.526142, 7.399034], [-1.57661, 7.40288], [-1.625132, 7.339156], [-1.640968, 7.336116], [-1.640921, 7.325163], [-1.654163, 7.313588], [-1.678746, 7.324815], [-1.710966, 7.324308], [-1.728491, 7.311823], [-1.739725, 7.320704], [-1.761463, 7.322028], [-1.779353, 7.35099], [-1.807235, 7.348533], [-1.839935, 7.425105], [-1.836011, 7.471019], [-1.856428, 7.46125], [-1.863479, 7.476967], [-1.897957, 7.430497], [-1.927076, 7.442609], [-1.964465, 7.408111], [-2.018473, 7.421501], [-2.038008, 7.457093], [-2.074578, 7.455178], [-2.109671, 7.463647], [-2.113874, 7.495054], [-2.121904, 7.515035], [-2.137717, 7.52581], [-2.108896, 7.553257], [-2.11179, 7.572231], [-2.088243, 7.609915], [-2.089668, 7.630835], [-2.077212, 7.64387], [-2.047968, 7.675826], [-2.073048, 7.713557], [-2.071279, 7.748302], [-2.082252, 7.765068], [-2.076403, 7.778631], [-2.023123, 7.780386], [-1.970745, 7.805923], [-1.944325, 7.799281], [-1.922301, 7.806366], [-1.902945, 7.831178], [-1.914109, 7.877381], [-1.985049, 7.966226], [-2.019946, 7.955447], [-2.041178, 7.964418], [-2.043971, 7.973559], [-2.026006, 7.996183], [-2.025354, 8.023977], [-2.057495, 8.052074], [-2.064875, 8.089046], [-2.079728, 8.098907], [-2.101754, 8.135811], [-2.117042, 8.135438], [-2.121639, 8.149763], [-2.117284, 8.157175], [-2.064677, 8.146135], [-2.030926, 8.152769], [-1.959396, 8.170496], [-1.895127, 8.261698], [-1.83708, 8.250559], [-1.799695, 8.226239], [-1.772832, 8.231596], [-1.747407, 8.2621], [-1.747975, 8.279274], [-1.769913, 8.322761], [-1.802944, 8.339462], [-1.845637, 8.329346], [-1.870932, 8.334035], [-1.908086, 8.397696], [-1.909845, 8.438521], [-1.886457, 8.464541], [-1.883124, 8.480211], [-1.896842, 8.552828], [-1.871814, 8.634752], [-1.856994, 8.651612], [-1.840871, 8.661235], [-1.813244, 8.661548], [-1.755186, 8.630118], [-1.733402, 8.626412], [-1.69325, 8.64386], [-1.679357, 8.683951], [-1.658373, 8.695446], [-1.611905, 8.677061], [-1.531515, 8.681035], [-1.510797, 8.691789], [-1.499348, 8.738424], [-1.484568, 8.759765], [-1.410276, 8.774374], [-1.355972, 8.759105], [-1.309326, 8.721798], [-1.28805, 8.720304], [-1.264613, 8.691637], [-1.229658, 8.674701], [-1.209496, 8.667995], [-1.185869, 8.678252], [-1.144481, 8.6774], [-1.150537, 8.633321], [-1.141491, 8.576549], [-1.154814, 8.542504], [-1.172077, 8.535367], [-1.164387, 8.512502], [-1.173246, 8.507492], [-1.179336, 8.517885], [-1.182522, 8.510634], [-1.195944, 8.511553], [-1.194567, 8.494094], [-1.218295, 8.491267], [-1.221452, 8.477438], [-1.244758, 8.470193], [-1.258552, 8.454897], [-1.263018, 8.434526], [-1.253704, 8.424087], [-1.260016, 8.407471], [-1.252736, 8.379288], [-1.26206, 8.368327], [-1.25859, 8.352592], [-1.277753, 8.323444], [-1.274461, 8.289679], [-1.266473, 8.257342], [-1.237127, 8.223749], [-1.156553, 8.088658], [-1.166049, 8.060245], [-1.162029, 8.009236], [-1.154566, 7.997935], [-1.107013, 7.992415], [-1.081447, 8.017284], [-1.047467, 8.030134], [-1.029851, 8.017031], [-1.016471, 8.017616], [-1.033696, 8.054774], [-1.048142, 8.062539], [-1.043297, 8.093942], [-1.068743, 8.129247], [-1.040502, 8.166027], [-1.03971, 8.243108], [-1.019193, 8.261187], [-1.010227, 8.247946], [-0.989949, 8.245657], [-0.97898, 8.227293], [-0.959094, 8.25111], [-0.948672, 8.246522], [-0.878311, 8.263823], [-0.86198, 8.272429], [-0.8527, 8.314242], [-0.857848, 8.328594], [-0.801449, 8.339679], [-0.74077, 8.335595], [-0.639476, 8.26951], [-0.54247, 8.187687], [-0.503024, 8.180916], [-0.447262, 8.158532] ] ] ] } }, { "name": "Volta", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [0.209526, 6.401265], [0.177963, 6.424229], [0.189191, 6.475378], [0.178894, 6.48668], [0.177789, 6.511453], [0.199745, 6.54852], [0.194553, 6.563946], [0.151807, 6.57783], [0.104418, 6.566915], [0.123164, 6.666035], [0.161477, 6.683253], [0.203647, 6.703342], [0.208204, 6.757557], [0.192509, 6.789323], [0.133159, 6.829078], [0.12415, 6.843329], [0.122912, 6.889483], [0.14781, 6.921536], [0.206168, 6.942544], [0.227417, 6.974024], [0.196673, 7.067555], [0.224474, 7.099402], [0.315789, 7.095981], [0.328487, 7.089254], [0.33856, 7.130635], [0.357458, 7.131696], [0.371192, 7.154279], [0.391585, 7.226634], [0.415475, 7.266147], [0.435325, 7.284601], [0.448342, 7.277145], [0.448549, 7.29778], [0.465161, 7.289728], [0.47942, 7.292374], [0.534161, 7.305163], [0.54049, 7.295573], [0.541675, 7.271492], [0.533545, 7.247382], [0.517075, 7.239729], [0.519319, 7.22052], [0.542696, 7.225146], [0.540897, 7.233217], [0.562839, 7.268245], [0.571674, 7.267619], [0.574087, 7.287824], [0.606308, 7.266524], [0.644173, 7.263031], [0.631257, 7.19648], [0.624854, 7.182851], [0.617158, 7.182525], [0.616873, 7.161691], [0.605563, 7.157571], [0.592057, 7.113741], [0.611814, 7.105986], [0.614668, 7.095209], [0.597065, 7.060061], [0.602666, 7.023295], [0.595198, 7.00248], [0.548532, 6.993538], [0.522859, 6.973419], [0.525926, 6.941646], [0.54772, 6.937681], [0.566125, 6.920852], [0.557156, 6.88699], [0.53444, 6.877496], [0.543158, 6.864767], [0.531763, 6.856796], [0.531855, 6.82748], [0.53344, 6.827182], [0.535122, 6.826972], [0.547286, 6.834445], [0.579787, 6.807393], [0.575881, 6.798273], [0.567356, 6.802667], [0.566379, 6.782924], [0.581667, 6.761572], [0.608368, 6.747254], [0.618744, 6.754542], [0.650394, 6.737684], [0.636377, 6.629999], [0.640259, 6.631375], [0.656397, 6.60865], [0.666932, 6.605286], [0.672753, 6.613715], [0.697846, 6.588496], [0.742429, 6.589093], [0.748841, 6.563148], [0.717368, 6.52752], [0.732141, 6.484865], [0.746501, 6.483997], [0.749208, 6.448241], [0.781937, 6.43453], [0.787505, 6.413447], [0.826078, 6.404165], [0.861878, 6.379213], [0.892621, 6.335558], [0.963982, 6.335004], [1.004336, 6.334789], [1.01779, 6.269736], [1.036502, 6.238329], [1.054819, 6.233382], [1.066296, 6.219076], [1.079119, 6.171226], [1.200198, 6.167678], [1.199465, 6.112754], [1.126102, 6.077391], [1.081824, 6.046569], [1.031353, 5.982762], [0.995606, 5.926534], [0.993638, 5.878782], [0.981979, 5.842729], [0.936016, 5.792411], [0.816505, 5.76969], [0.708103, 5.767998], [0.715233, 5.773149], [0.694086, 5.765645], [0.680146, 5.770837], [0.67593, 5.77727], [0.687959, 5.777824], [0.677681, 5.795227], [0.651851, 5.80527], [0.654565, 5.827303], [0.642874, 5.841023], [0.620279, 5.834309], [0.619725, 5.854009], [0.631502, 5.866839], [0.614975, 5.864636], [0.612412, 5.872894], [0.619058, 5.875812], [0.574554, 5.899907], [0.587335, 5.913463], [0.58206, 5.927335], [0.56101, 5.940151], [0.550986, 5.920348], [0.541701, 5.949758], [0.524022, 5.954941], [0.525354, 5.97888], [0.515004, 5.982933], [0.498986, 5.99109], [0.490462, 5.995344], [0.491961, 5.979706], [0.484732, 5.975536], [0.483696, 5.992538], [0.450054, 6.001632], [0.4343, 5.97403], [0.343867, 5.953965], [0.353326, 5.986655], [0.329703, 5.99669], [0.339811, 6.019202], [0.348645, 6.022215], [0.331752, 6.033965], [0.337835, 6.04724], [0.295456, 6.057345], [0.284768, 6.080806], [0.247736, 6.105735], [0.228922, 6.110117], [0.189342, 6.096879], [0.146815, 6.109169], [0.097936, 6.147834], [0.09109, 6.160404], [0.127748, 6.255218], [0.159463, 6.300275], [0.175724, 6.302747], [0.168195, 6.313524], [0.174331, 6.330186], [0.20473, 6.357302], [0.199993, 6.370738], [0.21652, 6.384451], [0.209526, 6.401265] ] ] ] } }, { "name": "Ahafo", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-2.415019, 6.658897], [-2.412845, 6.650798], [-2.395295, 6.648231], [-2.40294, 6.634936], [-2.392347, 6.624392], [-2.394727, 6.612037], [-2.383494, 6.610762], [-2.383911, 6.598069], [-2.371149, 6.592207], [-2.385604, 6.568045], [-2.374867, 6.538856], [-2.386156, 6.523211], [-2.397278, 6.521361], [-2.397247, 6.503005], [-2.403794, 6.508153], [-2.414007, 6.490098], [-2.423663, 6.492436], [-2.42146, 6.473262], [-2.43077, 6.473303], [-2.431397, 6.464106], [-2.442436, 6.457693], [-2.446124, 6.443109], [-2.438673, 6.43929], [-2.451421, 6.431602], [-2.439149, 6.428209], [-2.440636, 6.417049], [-2.428813, 6.417146], [-2.420727, 6.40468], [-2.430552, 6.355223], [-2.468564, 6.380579], [-2.468845, 6.391613], [-2.485864, 6.408653], [-2.50648, 6.415036], [-2.54689, 6.400569], [-2.558944, 6.429766], [-2.52684, 6.454961], [-2.527389, 6.4621], [-2.543377, 6.463886], [-2.585236, 6.489794], [-2.606145, 6.519679], [-2.656416, 6.529458], [-2.672714, 6.509812], [-2.681136, 6.572066], [-2.701858, 6.585317], [-2.727323, 6.588867], [-2.779796, 6.575819], [-2.788775, 6.601442], [-2.832039, 6.630482], [-2.851714, 6.643062], [-2.869424, 6.638283], [-2.866381, 6.649813], [-2.877508, 6.653082], [-2.848075, 6.669085], [-2.865919, 6.718741], [-2.841313, 6.750369], [-2.849845, 6.772859], [-2.837547, 6.788725], [-2.84889, 6.799763], [-2.842804, 6.806472], [-2.848721, 6.816094], [-2.858033, 6.819764], [-2.85413, 6.831646], [-2.864815, 6.851682], [-2.849322, 6.886854], [-2.856282, 6.911704], [-2.848917, 6.951718], [-2.820768, 6.964004], [-2.792515, 7.009901], [-2.777398, 7.020171], [-2.770663, 7.021788], [-2.761488, 7.035223], [-2.755203, 7.075881], [-2.728994, 7.098679], [-2.69925, 7.106549], [-2.691143, 7.114797], [-2.690449, 7.13229], [-2.682667, 7.140632], [-2.651385, 7.14155], [-2.607181, 7.180408], [-2.581229, 7.180596], [-2.580561, 7.208863], [-2.5559, 7.230507], [-2.516789, 7.230829], [-2.49507, 7.226445], [-2.492263, 7.219419], [-2.493723, 7.13347], [-2.447606, 7.140653], [-2.400526, 7.111898], [-2.4385, 7.088893], [-2.372482, 7.102159], [-2.350133, 7.129129], [-2.32422, 7.122888], [-2.329739, 7.105936], [-2.298399, 7.098351], [-2.295268, 7.113055], [-2.303354, 7.120851], [-2.288368, 7.140952], [-2.350064, 7.187037], [-2.340689, 7.217893], [-2.324958, 7.237176], [-2.285108, 7.226749], [-2.278504, 7.233789], [-2.281485, 7.247065], [-2.273419, 7.237274], [-2.272491, 7.245777], [-2.265187, 7.245557], [-2.268668, 7.274355], [-2.245662, 7.279686], [-2.240479, 7.292273], [-2.2184, 7.301005], [-2.219231, 7.312166], [-2.209953, 7.314383], [-2.159944, 7.329664], [-2.147559, 7.365791], [-2.135539, 7.373842], [-2.135567, 7.395534], [-2.0763, 7.323203], [-2.064946, 7.319556], [-2.046985, 7.305604], [-2.001452, 7.316992], [-1.98842, 7.298118], [-1.962121, 7.293487], [-1.949882, 7.261533], [-1.927253, 7.264845], [-1.912212, 7.25351], [-1.859679, 7.278161], [-1.843458, 7.27508], [-1.835657, 7.259604], [-1.827211, 7.258516], [-1.868949, 7.203249], [-1.932954, 7.176627], [-1.932514, 7.130131], [-1.953618, 7.085284], [-1.967047, 7.089937], [-1.995006, 7.079236], [-2.038354, 7.040205], [-2.061927, 7.039118], [-2.081316, 7.027646], [-2.097296, 7.007236], [-2.121025, 7.002178], [-2.137676, 7.020488], [-2.135278, 7.0283], [-2.139935, 7.041617], [-2.150263, 7.039632], [-2.182419, 7.016806], [-2.185685, 7.025435], [-2.178841, 7.032691], [-2.185334, 7.036282], [-2.226944, 7.007529], [-2.289035, 6.945703], [-2.331537, 6.928828], [-2.339109, 6.908784], [-2.376476, 6.885871], [-2.374706, 6.878977], [-2.388741, 6.867942], [-2.386812, 6.855669], [-2.398378, 6.854313], [-2.3983, 6.839206], [-2.4086, 6.841639], [-2.416583, 6.831627], [-2.417816, 6.823474], [-2.400929, 6.819285], [-2.375908, 6.839159], [-2.34528, 6.844156], [-2.333709, 6.830752], [-2.345084, 6.815989], [-2.334626, 6.803926], [-2.3197, 6.801237], [-2.305304, 6.811668], [-2.297225, 6.797224], [-2.26608, 6.798716], [-2.258029, 6.790715], [-2.264463, 6.778158], [-2.278233, 6.729547], [-2.289268, 6.715846], [-2.285992, 6.70694], [-2.293106, 6.704274], [-2.306407, 6.687164], [-2.346766, 6.699376], [-2.363847, 6.688617], [-2.372276, 6.67163], [-2.415019, 6.658897] ] ] ] } }, { "name": "Oti", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [0.521343, 7.520193], [0.529862, 7.481154], [0.518883, 7.460868], [0.521103, 7.454737], [0.53212, 7.457226], [0.535866, 7.426352], [0.553075, 7.405232], [0.573111, 7.394791], [0.619577, 7.41338], [0.644642, 7.397978], [0.643215, 7.375015], [0.658886, 7.316699], [0.643218, 7.279788], [0.644173, 7.263031], [0.606308, 7.266524], [0.574087, 7.287824], [0.571674, 7.267619], [0.562839, 7.268245], [0.540897, 7.233217], [0.542696, 7.225146], [0.519319, 7.22052], [0.517075, 7.239729], [0.533545, 7.247382], [0.541675, 7.271492], [0.54049, 7.295573], [0.534161, 7.305163], [0.47942, 7.292374], [0.465161, 7.289728], [0.448549, 7.29778], [0.448342, 7.277145], [0.435325, 7.284601], [0.415475, 7.266147], [0.391585, 7.226634], [0.371192, 7.154279], [0.357458, 7.131696], [0.33856, 7.130635], [0.328487, 7.089254], [0.315789, 7.095981], [0.224474, 7.099402], [0.242643, 7.127043], [0.235242, 7.167058], [0.182331, 7.179696], [0.214976, 7.310054], [0.208353, 7.350928], [0.178905, 7.381002], [0.124054, 7.406485], [0.090952, 7.429324], [0.077091, 7.482111], [0.00943, 7.57847], [-0.014305, 7.626107], [-0.015208, 7.684035], [0.002498, 7.717612], [0.004112, 7.742433], [-0.014521, 7.756958], [-0.100095, 7.750424], [-0.126463, 7.788235], [-0.145417, 7.903095], [-0.134947, 7.948588], [-0.141152, 7.958428], [-0.173839, 7.95746], [-0.144167, 8.0055], [-0.141547, 8.017907], [-0.155092, 8.030666], [-0.173185, 8.024696], [-0.214685, 8.030984], [-0.240596, 8.049652], [-0.248848, 8.07708], [-0.294892, 8.117376], [-0.384706, 8.152823], [-0.354162, 8.166203], [-0.358626, 8.185724], [-0.348646, 8.201704], [-0.38494, 8.195043], [-0.387522, 8.224105], [-0.369491, 8.230902], [-0.319308, 8.226815], [-0.280701, 8.24559], [-0.259458, 8.216323], [-0.224308, 8.212895], [-0.198615, 8.219347], [-0.188522, 8.23179], [-0.173108, 8.228958], [-0.165536, 8.238211], [-0.169405, 8.253542], [-0.145729, 8.272349], [-0.124217, 8.273038], [-0.110279, 8.335961], [-0.087417, 8.332478], [-0.067734, 8.339887], [-0.058521, 8.352495], [-0.040348, 8.349676], [-0.036749, 8.33324], [-0.002604, 8.320577], [0.010565, 8.297683], [0.07887, 8.281773], [0.10436, 8.239082], [0.078601, 8.22316], [0.1152, 8.229193], [0.116667, 8.217767], [0.129882, 8.214628], [0.123209, 8.232486], [0.19385, 8.253331], [0.198005, 8.291519], [0.185751, 8.326429], [0.203449, 8.341346], [0.22752, 8.34224], [0.242736, 8.35415], [0.244315, 8.386503], [0.222964, 8.407162], [0.207464, 8.410151], [0.124807, 8.382871], [0.086474, 8.403287], [0.092866, 8.427505], [0.08157, 8.460831], [0.120787, 8.485433], [0.093877, 8.501704], [0.082824, 8.525883], [0.111968, 8.596869], [0.128111, 8.605082], [0.147983, 8.588592], [0.170925, 8.596077], [0.169851, 8.61589], [0.146894, 8.629679], [0.135868, 8.653574], [0.138934, 8.669214], [0.181275, 8.712834], [0.165354, 8.756185], [0.168398, 8.774512], [0.17468, 8.770642], [0.170925, 8.764734], [0.180894, 8.761872], [0.185576, 8.740805], [0.18699, 8.747185], [0.199601, 8.744349], [0.214276, 8.755087], [0.231601, 8.753481], [0.244011, 8.740808], [0.258708, 8.746985], [0.281832, 8.724077], [0.297897, 8.742504], [0.300704, 8.726225], [0.314596, 8.734513], [0.358147, 8.718598], [0.346325, 8.740982], [0.374244, 8.735698], [0.383491, 8.740669], [0.471687, 8.599742], [0.491763, 8.597547], [0.499615, 8.57424], [0.514029, 8.565228], [0.529635, 8.570082], [0.560103, 8.549966], [0.571715, 8.526006], [0.584293, 8.528619], [0.590993, 8.516746], [0.621228, 8.512195], [0.629591, 8.507834], [0.629835, 8.496554], [0.6453, 8.493867], [0.644998, 8.475395], [0.655795, 8.455477], [0.651806, 8.422012], [0.69611, 8.404373], [0.693242, 8.394975], [0.705506, 8.394548], [0.698876, 8.388862], [0.712127, 8.376793], [0.710038, 8.351991], [0.729411, 8.341105], [0.726374, 8.28156], [0.682841, 8.279687], [0.673483, 8.259057], [0.638919, 8.260632], [0.638259, 8.245112], [0.624577, 8.235883], [0.61905, 8.215183], [0.59002, 8.207797], [0.58982, 8.195097], [0.613839, 8.180146], [0.60695, 8.172301], [0.606891, 8.138803], [0.592058, 8.139084], [0.591843, 8.10321], [0.585022, 8.093358], [0.598747, 8.05832], [0.598624, 8.027051], [0.60954, 8.027124], [0.622106, 8.014535], [0.622461, 8.007882], [0.612566, 8.005763], [0.617116, 7.965359], [0.62367, 7.962501], [0.62115, 7.936716], [0.63228, 7.91465], [0.627154, 7.901713], [0.62606, 7.901468], [0.619743, 7.900515], [0.627407, 7.868253], [0.617077, 7.796259], [0.629441, 7.794512], [0.630973, 7.768689], [0.611424, 7.752879], [0.630066, 7.706275], [0.619572, 7.703247], [0.608778, 7.710962], [0.590687, 7.703046], [0.582817, 7.656952], [0.585939, 7.623978], [0.518357, 7.592312], [0.529034, 7.584268], [0.521343, 7.520193] ] ] ] } }, { "name": "Upper West", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-2.486962, 9.752992], [-2.508897, 9.745877], [-2.514921, 9.693895], [-2.53842, 9.677991], [-2.680476, 9.631638], [-2.719263, 9.632329], [-2.731845, 9.643511], [-2.745244, 9.641576], [-2.758516, 9.680752], [-2.783985, 9.689309], [-2.787359, 9.697205], [-2.783303, 9.72505], [-2.79054, 9.746412], [-2.758561, 9.800582], [-2.732504, 9.815012], [-2.726805, 9.828983], [-2.76256, 9.884926], [-2.764269, 9.912945], [-2.743187, 9.959158], [-2.750096, 9.981675], [-2.782282, 10.027012], [-2.790764, 10.069699], [-2.794012, 10.126492], [-2.78773, 10.140063], [-2.794113, 10.175753], [-2.795933, 10.197731], [-2.757648, 10.2324], [-2.759028, 10.257817], [-2.834161, 10.296742], [-2.849971, 10.324979], [-2.831418, 10.388094], [-2.779802, 10.408611], [-2.774761, 10.424993], [-2.833682, 10.437246], [-2.853831, 10.450779], [-2.8675, 10.46186], [-2.874642, 10.491125], [-2.899089, 10.522845], [-2.901801, 10.551157], [-2.941114, 10.616842], [-2.94061, 10.636685], [-2.915673, 10.663593], [-2.905471, 10.688267], [-2.910859, 10.69989], [-2.939997, 10.709313], [-2.937854, 10.72226], [-2.896259, 10.762676], [-2.879098, 10.831973], [-2.86355, 10.857773], [-2.865577, 10.88418], [-2.837084, 10.893511], [-2.817528, 10.923816], [-2.81975, 10.942622], [-2.840644, 10.967588], [-2.834006, 11.004132], [-2.768318, 11.004842], [-2.757519, 11.019087], [-2.619313, 11.020081], [-2.452319, 11.023364], [-2.360171, 11.008188], [-2.22017, 11.020706], [-2.057971, 11.017525], [-2.006314, 11.004056], [-1.743398, 11.00815], [-1.744535, 11.038], [-1.545822, 11.040274], [-1.544113, 11.010193], [-1.428545, 11.01111], [-1.428227, 10.998095], [-1.438367, 10.990675], [-1.447903, 10.964106], [-1.444087, 10.950419], [-1.456171, 10.91168], [-1.45844, 10.849083], [-1.473079, 10.844022], [-1.478638, 10.830866], [-1.491773, 10.833997], [-1.500465, 10.814431], [-1.491488, 10.806329], [-1.496089, 10.786601], [-1.52311, 10.777371], [-1.526237, 10.760318], [-1.533631, 10.74808], [-1.556847, 10.746931], [-1.568244, 10.723451], [-1.573474, 10.667939], [-1.566457, 10.599522], [-1.553942, 10.586346], [-1.526603, 10.588363], [-1.51599, 10.576783], [-1.518272, 10.562127], [-1.489918, 10.550095], [-1.485869, 10.538368], [-1.457113, 10.533337], [-1.448466, 10.516972], [-1.462772, 10.509199], [-1.45934, 10.498744], [-1.466861, 10.486828], [-1.449788, 10.479031], [-1.446595, 10.469158], [-1.434023, 10.467766], [-1.517836, 10.405867], [-1.570261, 10.355467], [-1.662976, 10.187449], [-1.663566, 10.17373], [-1.635541, 10.15438], [-1.621559, 10.133253], [-1.600722, 10.133049], [-1.595266, 10.106748], [-1.586461, 10.100543], [-1.587687, 10.077903], [-1.613108, 10.069105], [-1.626398, 10.079118], [-1.655013, 10.074608], [-1.629075, 10.052929], [-1.634889, 10.042654], [-1.64603, 10.038068], [-1.667255, 10.04513], [-1.673635, 10.025334], [-1.686026, 10.038707], [-1.701724, 10.013883], [-1.714762, 10.012284], [-1.718625, 9.998307], [-1.706712, 9.945872], [-1.716132, 9.940059], [-1.704635, 9.923607], [-1.707077, 9.899907], [-1.696337, 9.887286], [-1.709787, 9.822423], [-1.986856, 9.825161], [-2.003388, 9.822258], [-2.024789, 9.786005], [-2.04224, 9.779771], [-2.08644, 9.78551], [-2.096886, 9.813767], [-2.42109, 9.77247], [-2.486962, 9.752992] ] ] ] } }, { "name": "North East", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [0.194051, 10.402718], [0.209387, 10.405428], [0.205137, 10.418349], [0.217153, 10.42659], [0.233765, 10.413476], [0.259554, 10.407831], [0.284404, 10.42199], [0.300156, 10.402824], [0.290114, 10.376538], [0.307593, 10.371173], [0.3153, 10.337838], [0.328108, 10.339532], [0.337793, 10.325091], [0.31702, 10.309913], [0.396013, 10.314221], [0.39685, 10.3045], [0.369212, 10.284786], [0.381622, 10.273965], [0.361114, 10.258598], [0.350141, 10.168076], [0.363077, 10.137923], [0.352123, 10.102162], [0.360776, 10.087265], [0.395168, 10.080993], [0.417401, 10.058008], [0.410385, 10.021753], [0.360973, 10.031449], [0.359026, 9.987158], [0.386369, 9.949222], [0.385936, 9.937339], [0.365681, 9.932211], [0.353392, 9.947693], [0.346921, 9.938538], [0.325023, 9.944061], [0.324475, 9.963147], [0.310956, 9.959961], [0.303835, 9.977198], [0.276476, 9.974097], [0.263003, 9.959011], [0.259063, 9.963857], [0.233533, 9.956312], [0.189725, 9.966539], [0.183746, 9.979656], [0.155428, 9.986147], [0.130048, 9.95676], [0.127076, 9.971758], [0.071648, 9.966399], [0.063697, 9.999699], [0.109475, 10.005105], [0.124416, 10.038886], [0.105875, 10.118711], [0.11131, 10.131053], [0.060893, 10.180166], [0.066022, 10.200951], [0.085311, 10.21419], [0.076321, 10.228352], [0.090998, 10.243519], [0.077402, 10.288413], [0.073711, 10.295157], [0.058051, 10.293968], [0.056223, 10.307263], [0.048954, 10.342733], [-0.006766, 10.330571], [-0.019012, 10.32863], [-0.027786, 10.316274], [-0.024809, 10.271265], [-0.072119, 10.295112], [-0.088235, 10.295075], [-0.094035, 10.269461], [-0.131129, 10.292046], [-0.152055, 10.294744], [-0.166152, 10.281097], [-0.195347, 10.276703], [-0.203016, 10.265852], [-0.238312, 10.287894], [-0.269447, 10.276269], [-0.295553, 10.291435], [-0.315726, 10.290812], [-0.354625, 10.273928], [-0.359496, 10.261743], [-0.385911, 10.297971], [-0.45536, 10.301713], [-0.483972, 10.327499], [-0.50446, 10.317972], [-0.50573, 10.307893], [-0.497724, 10.271417], [-0.505164, 10.270712], [-0.501278, 10.259033], [-0.510741, 10.252719], [-0.499011, 10.237463], [-0.509636, 10.236712], [-0.514004, 10.248281], [-0.521948, 10.234023], [-0.534315, 10.267168], [-0.546688, 10.247995], [-0.541114, 10.225767], [-0.54761, 10.210545], [-0.599125, 10.160252], [-0.625634, 10.165545], [-0.624535, 10.172969], [-0.643523, 10.190187], [-0.652762, 10.180707], [-0.652057, 10.191726], [-0.657869, 10.192005], [-0.666744, 10.179663], [-0.667345, 10.179563], [-0.667726, 10.179603], [-0.668157, 10.179562], [-0.668608, 10.179714], [-0.668805, 10.179963], [-0.668874, 10.180052], [-0.669486, 10.180286], [-0.669681, 10.180379], [-0.670165, 10.180612], [-0.671183, 10.180866], [-0.671383, 10.180916], [-0.671536, 10.181013], [-0.672459, 10.181598], [-0.672796, 10.181852], [-0.673496, 10.182238], [-0.673583, 10.182286], [-0.674247, 10.182468], [-0.675265, 10.182569], [-0.676047, 10.182498], [-0.676436, 10.182456], [-0.677394, 10.182224], [-0.677849, 10.181981], [-0.678622, 10.181568], [-0.678752, 10.181498], [-0.679184, 10.181239], [-0.679428, 10.181084], [-0.679588, 10.180982], [-0.679967, 10.18058], [-0.680287, 10.180567], [-0.680501, 10.180608], [-0.680888, 10.180696], [-0.681085, 10.180741], [-0.681413, 10.180923], [-0.681646, 10.181238], [-0.681883, 10.181442], [-0.682127, 10.181847], [-0.68226, 10.182426], [-0.682259, 10.183342], [-0.682198, 10.183725], [-0.681941, 10.184295], [-0.681826, 10.185017], [-0.681868, 10.185565], [-0.68197, 10.186164], [-0.681953, 10.186685], [-0.68195, 10.186765], [-0.68204, 10.188683], [-0.682212, 10.189108], [-0.682467, 10.18951], [-0.682821, 10.189736], [-0.682898, 10.189786], [-0.683154, 10.189787], [-0.683564, 10.189573], [-0.683728, 10.189401], [-0.68416, 10.188611], [-0.684313, 10.188203], [-0.684498, 10.187605], [-0.685264, 10.185856], [-0.685352, 10.184979], [-0.685524, 10.184524], [-0.685914, 10.184037], [-0.686304, 10.183709], [-0.686683, 10.183346], [-0.686982, 10.18314], [-0.687446, 10.182821], [-0.688962, 10.182209], [-0.689216, 10.18218], [-0.689472, 10.182149], [-0.689964, 10.182222], [-0.690568, 10.182454], [-0.691243, 10.182953], [-0.691911, 10.183704], [-0.692647, 10.184468], [-0.692811, 10.184826], [-0.692849, 10.185116], [-0.692861, 10.185201], [-0.692799, 10.185413], [-0.692367, 10.186105], [-0.692225, 10.186529], [-0.692224, 10.187036], [-0.69209, 10.187637], [-0.69216, 10.188031], [-0.692251, 10.188388], [-0.692713, 10.188641], [-0.69302, 10.188641], [-0.693328, 10.188641], [-0.693984, 10.188581], [-0.694236, 10.188531], [-0.694488, 10.18848], [-0.695154, 10.187772], [-0.695554, 10.186837], [-0.695636, 10.186645], [-0.69577, 10.186025], [-0.696066, 10.185279], [-0.696332, 10.184256], [-0.69659, 10.183603], [-0.696973, 10.182507], [-0.697279, 10.181826], [-0.697608, 10.181308], [-0.697934, 10.180873], [-0.698274, 10.180487], [-0.698585, 10.180283], [-0.698694, 10.180212], [-0.699393, 10.179857], [-0.700222, 10.179585], [-0.70064, 10.179417], [-0.701193, 10.179324], [-0.701778, 10.179041], [-0.702908, 10.178717], [-0.703859, 10.178505], [-0.704671, 10.178282], [-0.705866, 10.17781], [-0.706779, 10.177538], [-0.70727, 10.177443], [-0.707363, 10.177425], [-0.708173, 10.177214], [-0.708827, 10.177165], [-0.709236, 10.177184], [-0.709532, 10.177294], [-0.710262, 10.177394], [-0.710354, 10.177409], [-0.710604, 10.177537], [-0.710752, 10.177613], [-0.710926, 10.17786], [-0.710988, 10.177947], [-0.711376, 10.179369], [-0.711632, 10.180056], [-0.711631, 10.18037], [-0.711745, 10.180737], [-0.711867, 10.181456], [-0.711855, 10.182093], [-0.711784, 10.182346], [-0.711713, 10.1826], [-0.711456, 10.183087], [-0.711331, 10.183432], [-0.710941, 10.183914], [-0.71081, 10.184046], [-0.710732, 10.18421], [-0.711071, 10.184462], [-0.711532, 10.184229], [-0.711647, 10.184171], [-0.712151, 10.184094], [-0.712382, 10.184001], [-0.712616, 10.183808], [-0.712906, 10.183483], [-0.713137, 10.183351], [-0.713735, 10.183178], [-0.7142, 10.182872], [-0.714356, 10.182643], [-0.714406, 10.182495], [-0.714802, 10.182002], [-0.714935, 10.181916], [-0.715489, 10.18133], [-0.71596, 10.180633], [-0.716191, 10.180443], [-0.716425, 10.180308], [-0.717046, 10.18011], [-0.717449, 10.179813], [-0.717758, 10.179488], [-0.71799, 10.179314], [-0.718255, 10.178965], [-0.718617, 10.178313], [-0.71877, 10.177973], [-0.718847, 10.177216], [-0.718631, 10.176634], [-0.718311, 10.176403], [-0.71797, 10.176155], [-0.717168, 10.175928], [-0.716824, 10.175587], [-0.715907, 10.175435], [-0.715525, 10.175472], [-0.715258, 10.175888], [-0.71457, 10.17619], [-0.713768, 10.176379], [-0.713042, 10.176], [-0.712355, 10.174977], [-0.712701, 10.172556], [-0.712855, 10.172064], [-0.713505, 10.171421], [-0.713925, 10.171497], [-0.714154, 10.171838], [-0.714817, 10.172182], [-0.715261, 10.172104], [-0.715367, 10.171433], [-0.715224, 10.170666], [-0.714575, 10.169908], [-0.713812, 10.169037], [-0.713279, 10.167864], [-0.713127, 10.166577], [-0.712814, 10.165476], [-0.712632, 10.164836], [-0.711983, 10.16423], [-0.711525, 10.16404], [-0.711296, 10.163699], [-0.711622, 10.162972], [-0.711967, 10.163259], [-0.71215, 10.163124], [-0.712473, 10.163276], [-0.712581, 10.163352], [-0.71269, 10.163428], [-0.712856, 10.163687], [-0.713196, 10.164037], [-0.713565, 10.164297], [-0.714024, 10.164419], [-0.714501, 10.164489], [-0.715284, 10.164604], [-0.715629, 10.164771], [-0.715974, 10.164938], [-0.716192, 10.165132], [-0.716422, 10.165336], [-0.716775, 10.165807], [-0.71708, 10.166114], [-0.717433, 10.16629], [-0.717839, 10.166457], [-0.718246, 10.166624], [-0.718408, 10.166778], [-0.718571, 10.166931], [-0.719107, 10.167493], [-0.719268, 10.167623], [-0.71943, 10.167753], [-0.719966, 10.168012], [-0.720075, 10.168127], [-0.720183, 10.168241], [-0.720464, 10.168458], [-0.720873, 10.168774], [-0.721227, 10.168882], [-0.721597, 10.16887], [-0.722178, 10.168947], [-0.72238, 10.168974], [-0.722947, 10.169035], [-0.723409, 10.169187], [-0.723854, 10.169173], [-0.724085, 10.169083], [-0.724316, 10.168992], [-0.724578, 10.168679], [-0.72484, 10.168367], [-0.725224, 10.168155], [-0.725485, 10.168155], [-0.725838, 10.168276], [-0.726738, 10.168646], [-0.726987, 10.168749], [-0.727133, 10.168785], [-0.72789, 10.168973], [-0.728403, 10.1691], [-0.728763, 10.169238], [-0.729123, 10.169376], [-0.729337, 10.169509], [-0.730074, 10.169939], [-0.730967, 10.170381], [-0.731512, 10.170516], [-0.731888, 10.170611], [-0.732564, 10.170702], [-0.732856, 10.170687], [-0.733148, 10.170672], [-0.73344, 10.170506], [-0.733732, 10.170339], [-0.734208, 10.17002], [-0.734793, 10.16967], [-0.735362, 10.169122], [-0.735932, 10.168574], [-0.736328, 10.168416], [-0.736725, 10.168258], [-0.73687, 10.168043], [-0.737193, 10.16728], [-0.737071, 10.16661], [-0.736857, 10.16632], [-0.736457, 10.165876], [-0.736059, 10.165617], [-0.735667, 10.165258], [-0.735275, 10.164899], [-0.734911, 10.164468], [-0.734644, 10.164152], [-0.734277, 10.163802], [-0.73403, 10.163636], [-0.733599, 10.163528], [-0.733184, 10.16339], [-0.732756, 10.163131], [-0.732447, 10.163039], [-0.732179, 10.162826], [-0.731911, 10.162612], [-0.73168, 10.162217], [-0.73165, 10.16208], [-0.731789, 10.161669], [-0.732174, 10.160862], [-0.732528, 10.16033], [-0.73282, 10.160085], [-0.733127, 10.160025], [-0.733435, 10.159964], [-0.733941, 10.160042], [-0.734556, 10.160301], [-0.734929, 10.160523], [-0.735323, 10.160757], [-0.735608, 10.160986], [-0.735893, 10.161215], [-0.736246, 10.161565], [-0.73646, 10.1621], [-0.73683, 10.162434], [-0.737105, 10.162861], [-0.737458, 10.163121], [-0.737763, 10.163257], [-0.738412, 10.163455], [-0.738984, 10.163566], [-0.739483, 10.163662], [-0.739931, 10.163922], [-0.740437, 10.164168], [-0.741021, 10.164548], [-0.74141, 10.164983], [-0.741513, 10.165097], [-0.741971, 10.165478], [-0.742233, 10.16563], [-0.74237, 10.165747], [-0.742968, 10.166259], [-0.743339, 10.166576], [-0.74374, 10.166745], [-0.744193, 10.167041], [-0.744646, 10.167338], [-0.744969, 10.167369], [-0.745379, 10.167241], [-0.74632, 10.166949], [-0.746569, 10.166838], [-0.74671, 10.166675], [-0.747065, 10.166265], [-0.74733, 10.166051], [-0.747766, 10.165699], [-0.747989, 10.165519], [-0.748112, 10.164987], [-0.748112, 10.164529], [-0.748066, 10.1643], [-0.748021, 10.164072], [-0.747746, 10.163462], [-0.747315, 10.162685], [-0.747224, 10.162108], [-0.747277, 10.161849], [-0.74733, 10.16159], [-0.747615, 10.161187], [-0.747901, 10.160783], [-0.748346, 10.160478], [-0.748623, 10.160326], [-0.7489, 10.160175], [-0.749471, 10.159809], [-0.74976, 10.159568], [-0.750092, 10.159366], [-0.752903, 10.160464], [-0.753342, 10.160532], [-0.753858, 10.16057], [-0.754554, 10.160686], [-0.755222, 10.160687], [-0.756184, 10.160354], [-0.756659, 10.160323], [-0.757033, 10.160299], [-0.757915, 10.160419], [-0.758145, 10.160496], [-0.75861, 10.160822], [-0.759035, 10.161263], [-0.759499, 10.161646], [-0.75973, 10.161762], [-0.759963, 10.161838], [-0.760195, 10.161914], [-0.760426, 10.161953], [-0.760773, 10.161953], [-0.760947, 10.161992], [-0.761121, 10.162031], [-0.761242, 10.16207], [-0.761469, 10.162144], [-0.761586, 10.162241], [-0.761816, 10.162356], [-0.762231, 10.162925], [-0.76228, 10.163313], [-0.762356, 10.163756], [-0.762524, 10.164212], [-0.762658, 10.164372], [-0.762791, 10.164532], [-0.763359, 10.16497], [-0.763765, 10.165153], [-0.763881, 10.165162], [-0.763998, 10.165172], [-0.764282, 10.164974], [-0.764566, 10.164776], [-0.764761, 10.164486], [-0.765058, 10.164164], [-0.765354, 10.163842], [-0.765722, 10.163255], [-0.76585, 10.163051], [-0.766067, 10.162704], [-0.76612, 10.162487], [-0.766283, 10.161166], [-0.766335, 10.161009], [-0.766347, 10.160593], [-0.766358, 10.160177], [-0.766436, 10.159967], [-0.766473, 10.159736], [-0.766629, 10.159391], [-0.766927, 10.159017], [-0.767325, 10.158686], [-0.768485, 10.157921], [-0.769064, 10.157557], [-0.769506, 10.157311], [-0.769947, 10.157065], [-0.770206, 10.156869], [-0.771008, 10.156265], [-0.771367, 10.155994], [-0.771592, 10.155825], [-0.772459, 10.155381], [-0.773326, 10.154936], [-0.773582, 10.154768], [-0.773838, 10.1546], [-0.774096, 10.154354], [-0.774787, 10.153694], [-0.775018, 10.153617], [-0.775482, 10.153637], [-0.775713, 10.153714], [-0.775925, 10.15383], [-0.776253, 10.154098], [-0.776428, 10.154288], [-0.776477, 10.154404], [-0.776525, 10.15452], [-0.776628, 10.155027], [-0.777006, 10.155609], [-0.7772, 10.155782], [-0.777334, 10.156011], [-0.777701, 10.156453], [-0.777778, 10.156508], [-0.778184, 10.156797], [-0.778387, 10.156807], [-0.778816, 10.156783], [-0.779427, 10.156748], [-0.779748, 10.156721], [-0.779982, 10.15657], [-0.780127, 10.156407], [-0.780271, 10.156245], [-0.780608, 10.155818], [-0.780639, 10.155708], [-0.780804, 10.155507], [-0.780987, 10.155212], [-0.780977, 10.15501], [-0.780968, 10.154809], [-0.780851, 10.154578], [-0.780679, 10.154004], [-0.780514, 10.153906], [-0.78054, 10.153751], [-0.780098, 10.153659], [-0.780039, 10.153527], [-0.780003, 10.153295], [-0.779991, 10.152923], [-0.779965, 10.15214], [-0.779946, 10.151592], [-0.779902, 10.151465], [-0.779846, 10.15105], [-0.779791, 10.150635], [-0.779807, 10.149364], [-0.779812, 10.148951], [-0.77987, 10.148616], [-0.779929, 10.148282], [-0.780091, 10.147725], [-0.780316, 10.146216], [-0.780348, 10.146002], [-0.780399, 10.145774], [-0.780451, 10.145545], [-0.780627, 10.145104], [-0.780685, 10.144875], [-0.780838, 10.144531], [-0.780994, 10.144319], [-0.781109, 10.14409], [-0.781173, 10.1439], [-0.781237, 10.14371], [-0.78171, 10.143095], [-0.781824, 10.142864], [-0.782298, 10.142192], [-0.782612, 10.142089], [-0.782927, 10.141985], [-0.783391, 10.141909], [-0.783622, 10.141909], [-0.783796, 10.141938], [-0.78397, 10.141967], [-0.784203, 10.142044], [-0.784395, 10.142196], [-0.784493, 10.142408], [-0.784531, 10.142637], [-0.784703, 10.14321], [-0.78509, 10.144131], [-0.785437, 10.144782], [-0.785648, 10.144953], [-0.786329, 10.145678], [-0.786507, 10.145797], [-0.786766, 10.146307], [-0.78669, 10.146563], [-0.786584, 10.146792], [-0.786479, 10.147021], [-0.786286, 10.147233], [-0.786053, 10.147384], [-0.785705, 10.147558], [-0.785589, 10.147567], [-0.785474, 10.147577], [-0.785243, 10.147654], [-0.785001, 10.147811], [-0.784747, 10.148133], [-0.784494, 10.148456], [-0.784443, 10.148744], [-0.784392, 10.149032], [-0.78435, 10.149266], [-0.784299, 10.149569], [-0.784699, 10.150065], [-0.784908, 10.150262], [-0.785124, 10.150465], [-0.785472, 10.150755], [-0.785819, 10.150984], [-0.786228, 10.151325], [-0.786637, 10.151665], [-0.78694, 10.151864], [-0.787291, 10.151952], [-0.787866, 10.152096], [-0.788562, 10.152097], [-0.788793, 10.152], [-0.789141, 10.151752], [-0.789335, 10.151521], [-0.789566, 10.151331], [-0.789824, 10.151076], [-0.790081, 10.150821], [-0.790223, 10.150681], [-0.790978, 10.150184], [-0.791732, 10.149687], [-0.791849, 10.149648], [-0.792234, 10.149394], [-0.79262, 10.149139], [-0.792824, 10.148767], [-0.793029, 10.148395], [-0.793056, 10.14811], [-0.793124, 10.147389], [-0.793064, 10.146335], [-0.793047, 10.146049], [-0.793067, 10.145936], [-0.793135, 10.145821], [-0.793203, 10.145705], [-0.793376, 10.145592], [-0.793665, 10.145554], [-0.793863, 10.145566], [-0.794113, 10.145581], [-0.794659, 10.145691], [-0.795205, 10.145801], [-0.795501, 10.145861], [-0.795732, 10.145993], [-0.796873, 10.147043], [-0.797244, 10.147566], [-0.797659, 10.147856], [-0.797962, 10.148224], [-0.798184, 10.148886], [-0.798262, 10.148982], [-0.798398, 10.149327], [-0.798417, 10.149556], [-0.798359, 10.149672], [-0.798164, 10.149633], [-0.798089, 10.149575], [-0.797972, 10.149346], [-0.797836, 10.149211], [-0.797722, 10.149662], [-0.797721, 10.150074], [-0.797768, 10.150236], [-0.797816, 10.150399], [-0.798221, 10.151069], [-0.798455, 10.151758], [-0.798454, 10.152122], [-0.798454, 10.152486], [-0.798579, 10.153474], [-0.798606, 10.15369], [-0.798684, 10.153919], [-0.798684, 10.154035], [-0.798742, 10.154151], [-0.798867, 10.154581], [-0.798896, 10.154678], [-0.798992, 10.155278], [-0.799089, 10.15551], [-0.799156, 10.155615], [-0.799547, 10.156057], [-0.799814, 10.156319], [-0.80019, 10.156544], [-0.800304, 10.156583], [-0.80055, 10.156582], [-0.800769, 10.156659], [-0.801, 10.156735], [-0.801117, 10.156706], [-0.801234, 10.156677], [-0.801388, 10.156573], [-0.801493, 10.156432], [-0.801662, 10.15621], [-0.801752, 10.156112], [-0.801966, 10.155969], [-0.802199, 10.155856], [-0.802778, 10.155644], [-0.802894, 10.155627], [-0.803384, 10.155573], [-0.803489, 10.155573], [-0.803863, 10.155331], [-0.804053, 10.155281], [-0.804748, 10.154824], [-0.80518, 10.154359], [-0.805264, 10.15401], [-0.805379, 10.153533], [-0.805481, 10.153108], [-0.805849, 10.15238], [-0.806116, 10.151396], [-0.806263, 10.151156], [-0.806665, 10.150498], [-0.806714, 10.150384], [-0.806763, 10.150269], [-0.806952, 10.149509], [-0.807093, 10.148986], [-0.807234, 10.148464], [-0.807323, 10.14826], [-0.807362, 10.148031], [-0.807535, 10.147687], [-0.807691, 10.147475], [-0.807986, 10.146877], [-0.808078, 10.146786], [-0.808377, 10.145791], [-0.808426, 10.145695], [-0.808716, 10.144661], [-0.808852, 10.144452], [-0.809045, 10.143879], [-0.809103, 10.143763], [-0.80919, 10.143658], [-0.809276, 10.143554], [-0.809451, 10.143209], [-0.809596, 10.142989], [-0.809741, 10.142768], [-0.809858, 10.142424], [-0.809992, 10.142289], [-0.810031, 10.142118], [-0.810109, 10.142002], [-0.810187, 10.141887], [-0.810351, 10.141793], [-0.810994, 10.140801], [-0.811335, 10.140464], [-0.811663, 10.140139], [-0.812024, 10.139782], [-0.812216, 10.139495], [-0.812408, 10.139209], [-0.81261, 10.138714], [-0.812825, 10.138188], [-0.813049, 10.137641], [-0.813105, 10.137296], [-0.813443, 10.136321], [-0.813609, 10.135841], [-0.813801, 10.135516], [-0.813879, 10.135287], [-0.813996, 10.135114], [-0.814074, 10.135152], [-0.814043, 10.135009], [-0.814479, 10.134295], [-0.814915, 10.133582], [-0.815525, 10.132524], [-0.815819, 10.132065], [-0.816007, 10.131773], [-0.816393, 10.131171], [-0.81653, 10.130846], [-0.816683, 10.130272], [-0.8168, 10.130063], [-0.817012, 10.129552], [-0.817226, 10.129033], [-0.817296, 10.128864], [-0.817321, 10.128741], [-0.817438, 10.128167], [-0.817542, 10.1279], [-0.817583, 10.127649], [-0.817544, 10.127373], [-0.817504, 10.127098], [-0.817425, 10.126546], [-0.817455, 10.126288], [-0.81747, 10.126159], [-0.817484, 10.126029], [-0.81755, 10.125912], [-0.817754, 10.125542], [-0.817838, 10.125392], [-0.818049, 10.125218], [-0.818314, 10.125171], [-0.818585, 10.125363], [-0.818822, 10.125544], [-0.819014, 10.125773], [-0.819362, 10.126004], [-0.819479, 10.126043], [-0.820174, 10.126043], [-0.820522, 10.126099], [-0.820753, 10.126063], [-0.820986, 10.125889], [-0.821295, 10.125584], [-0.821526, 10.125449], [-0.821723, 10.125192], [-0.821919, 10.124936], [-0.82196, 10.124702], [-0.82203, 10.124213], [-0.822108, 10.123671], [-0.822183, 10.123146], [-0.822165, 10.122963], [-0.822223, 10.122751], [-0.822128, 10.122311], [-0.822032, 10.121871], [-0.821954, 10.12164], [-0.821886, 10.121535], [-0.821818, 10.12143], [-0.821721, 10.121201], [-0.821509, 10.120923], [-0.821298, 10.120644], [-0.821065, 10.120512], [-0.820486, 10.120415], [-0.820255, 10.12028], [-0.82008, 10.120051], [-0.820022, 10.119937], [-0.819963, 10.119822], [-0.819947, 10.119591], [-0.820061, 10.119133], [-0.820236, 10.11894], [-0.820918, 10.118403], [-0.821089, 10.118318], [-0.82126, 10.118232], [-0.822187, 10.117927], [-0.822437, 10.117889], [-0.822671, 10.117908], [-0.823152, 10.11812], [-0.823443, 10.118216], [-0.823733, 10.118311], [-0.824815, 10.118432], [-0.825124, 10.118466], [-0.825914, 10.118599], [-0.826148, 10.118599], [-0.826863, 10.11885], [-0.827305, 10.119137], [-0.827519, 10.119308], [-0.828019, 10.119826], [-0.828194, 10.120055], [-0.828349, 10.120218], [-0.828503, 10.120381], [-0.828734, 10.120574], [-0.829062, 10.120919], [-0.829159, 10.120954], [-0.82939, 10.121128], [-0.829737, 10.121301], [-0.830085, 10.121473], [-0.830319, 10.12155], [-0.83055, 10.121702], [-0.831639, 10.122191], [-0.83196, 10.122298], [-0.832655, 10.122469], [-0.833233, 10.122566], [-0.833815, 10.122566], [-0.834143, 10.122451], [-0.834378, 10.122343], [-0.835643, 10.12176], [-0.835804, 10.121685], [-0.836037, 10.121648], [-0.836269, 10.121611], [-0.836519, 10.121647], [-0.836964, 10.121802], [-0.837043, 10.121852], [-0.83744, 10.122221], [-0.837679, 10.122491], [-0.83809, 10.123103], [-0.838473, 10.124247], [-0.838496, 10.12514], [-0.838506, 10.125515], [-0.838448, 10.125728], [-0.838448, 10.12586], [-0.838333, 10.126166], [-0.838197, 10.126397], [-0.838005, 10.126587], [-0.837677, 10.126741], [-0.83727, 10.127009], [-0.837152, 10.127148], [-0.836864, 10.127485], [-0.836728, 10.127697], [-0.836641, 10.127929], [-0.836485, 10.128158], [-0.836409, 10.128388], [-0.836332, 10.128618], [-0.836312, 10.129288], [-0.836332, 10.129518], [-0.836351, 10.129748], [-0.836341, 10.130159], [-0.836331, 10.130569], [-0.83639, 10.131007], [-0.836406, 10.131126], [-0.836503, 10.131355], [-0.836687, 10.131605], [-0.83687, 10.131854], [-0.837101, 10.132025], [-0.837195, 10.132055], [-0.837855, 10.13191], [-0.838144, 10.131929], [-0.838378, 10.132026], [-0.838725, 10.132084], [-0.838841, 10.132074], [-0.838956, 10.132065], [-0.839266, 10.132013], [-0.839625, 10.131953], [-0.839849, 10.131916], [-0.840051, 10.13195], [-0.841004, 10.132107], [-0.84144, 10.132107], [-0.842381, 10.132108], [-0.842814, 10.132096], [-0.842904, 10.132061], [-0.843023, 10.132014], [-0.84336, 10.132028], [-0.843891, 10.13197], [-0.844423, 10.131913], [-0.844656, 10.131913], [-0.844887, 10.131839], [-0.845231, 10.131778], [-0.845574, 10.131718], [-0.846032, 10.131386], [-0.84649, 10.131054], [-0.846724, 10.130958], [-0.847535, 10.130805], [-0.848346, 10.130652], [-0.848924, 10.130575], [-0.849157, 10.1305], [-0.849389, 10.130424], [-0.84962, 10.130289], [-0.850079, 10.130094], [-0.850538, 10.129898], [-0.850627, 10.12981], [-0.851089, 10.129581], [-0.851245, 10.129581], [-0.851651, 10.129353], [-0.85197, 10.129219], [-0.852288, 10.129086], [-0.852568, 10.128941], [-0.852847, 10.128797], [-0.853321, 10.1286], [-0.853446, 10.128549], [-0.853793, 10.128472], [-0.854386, 10.12818], [-0.854611, 10.127984], [-0.854926, 10.127687], [-0.855313, 10.127149], [-0.855399, 10.127054], [-0.855485, 10.126959], [-0.855573, 10.126787], [-0.855661, 10.126615], [-0.855795, 10.126155], [-0.855892, 10.125945], [-0.855921, 10.125831], [-0.856048, 10.124854], [-0.855912, 10.124451], [-0.855643, 10.123916], [-0.855576, 10.123715], [-0.854986, 10.123001], [-0.854572, 10.122133], [-0.854324, 10.121803], [-0.854166, 10.121593], [-0.853844, 10.121165], [-0.853495, 10.121049], [-0.853363, 10.121005], [-0.853064, 10.120995], [-0.852765, 10.120985], [-0.852649, 10.121004], [-0.852534, 10.121024], [-0.852437, 10.121004], [-0.852264, 10.121062], [-0.852108, 10.121033], [-0.851953, 10.121004], [-0.851574, 10.12091], [-0.851272, 10.120736], [-0.85079, 10.120458], [-0.849984, 10.11953], [-0.849734, 10.119242], [-0.849155, 10.118439], [-0.848929, 10.118028], [-0.848808, 10.117808], [-0.848769, 10.117576], [-0.848672, 10.117367], [-0.848633, 10.117138], [-0.848643, 10.117022], [-0.848653, 10.116907], [-0.84875, 10.116678], [-0.848805, 10.116276], [-0.848861, 10.115874], [-0.848912, 10.115504], [-0.848987, 10.115202], [-0.849062, 10.1149], [-0.849113, 10.114819], [-0.849261, 10.114543], [-0.849668, 10.114202], [-0.85016, 10.113961], [-0.850392, 10.113884], [-0.850509, 10.113807], [-0.850662, 10.113757], [-0.851657, 10.113584], [-0.852131, 10.113501], [-0.852596, 10.113367], [-0.852827, 10.113234], [-0.853338, 10.113149], [-0.853522, 10.113119], [-0.854101, 10.112929], [-0.854276, 10.112929], [-0.854768, 10.112776], [-0.855378, 10.112585], [-0.855609, 10.112469], [-0.855792, 10.112348], [-0.856188, 10.112086], [-0.856535, 10.111781], [-0.856807, 10.111489], [-0.857079, 10.111197], [-0.857231, 10.111034], [-0.857618, 10.11067], [-0.858005, 10.110307], [-0.85818, 10.110097], [-0.858314, 10.109869], [-0.858646, 10.109491], [-0.858979, 10.109114], [-0.859048, 10.10891], [-0.859164, 10.108737], [-0.859279, 10.108565], [-0.859396, 10.108108], [-0.859554, 10.107681], [-0.859711, 10.107253], [-0.859552, 10.106968], [-0.859556, 10.106827], [-0.859488, 10.106743], [-0.859359, 10.10662], [-0.859162, 10.106536], [-0.858995, 10.106536], [-0.858682, 10.106536], [-0.858237, 10.106671], [-0.858006, 10.106647], [-0.857775, 10.106574], [-0.857698, 10.106489], [-0.85762, 10.106404], [-0.857537, 10.105803], [-0.857644, 10.105358], [-0.857776, 10.104813], [-0.85791, 10.10472], [-0.857796, 10.104584], [-0.857825, 10.104354], [-0.857854, 10.104124], [-0.85793, 10.103895], [-0.858409, 10.103293], [-0.858453, 10.103207], [-0.858684, 10.103052], [-0.85908, 10.102938], [-0.859477, 10.102824], [-0.860325, 10.102684], [-0.86082, 10.102444], [-0.861156, 10.102282], [-0.861814, 10.101965], [-0.861911, 10.101859], [-0.862008, 10.101753], [-0.862337, 10.101505], [-0.862693, 10.101281], [-0.863341, 10.100874], [-0.863708, 10.10051], [-0.863891, 10.100404], [-0.863978, 10.100317], [-0.864209, 10.100243], [-0.864385, 10.10007], [-0.865776, 10.099037], [-0.866585, 10.098502], [-0.8668, 10.098271], [-0.866915, 10.098205], [-0.867031, 10.098138], [-0.867479, 10.097753], [-0.867854, 10.096887], [-0.868339, 10.096165], [-0.868481, 10.095747], [-0.868481, 10.09517], [-0.868384, 10.094713], [-0.868327, 10.094607], [-0.86827, 10.094501], [-0.868056, 10.09431], [-0.866782, 10.093505], [-0.866435, 10.093218], [-0.866257, 10.093102], [-0.865603, 10.092529], [-0.86448, 10.091718], [-0.864388, 10.091685], [-0.86411, 10.091503], [-0.862792, 10.09096], [-0.86265, 10.090901], [-0.861078, 10.089913], [-0.860926, 10.089791], [-0.86035, 10.089329], [-0.860081, 10.089062], [-0.859811, 10.088794], [-0.859288, 10.088163], [-0.859155, 10.087931], [-0.858866, 10.087562], [-0.858479, 10.086859], [-0.858171, 10.085941], [-0.857957, 10.08548], [-0.857938, 10.085252], [-0.858094, 10.084791], [-0.858172, 10.084717], [-0.858172, 10.084582], [-0.858286, 10.084353], [-0.858653, 10.083816], [-0.85878, 10.08375], [-0.858906, 10.083684], [-0.859446, 10.083665], [-0.859657, 10.083587], [-0.859755, 10.08351], [-0.859911, 10.083301], [-0.860005, 10.083069], [-0.860181, 10.082841], [-0.861474, 10.08213], [-0.861738, 10.082026], [-0.862673, 10.081657], [-0.862846, 10.081522], [-0.863079, 10.081444], [-0.863775, 10.0811], [-0.864924, 10.080321], [-0.865873, 10.079844], [-0.866151, 10.079704], [-0.867518, 10.07895], [-0.867851, 10.078767], [-0.868023, 10.078709], [-0.868187, 10.078575], [-0.868535, 10.078288], [-0.868919, 10.077814], [-0.869256, 10.077279], [-0.869385, 10.076943], [-0.869687, 10.07616], [-0.869698, 10.075693], [-0.869724, 10.074537], [-0.869777, 10.073757], [-0.869841, 10.073696], [-0.869822, 10.073323], [-0.869803, 10.072949], [-0.869683, 10.072624], [-0.869602, 10.072402], [-0.869417, 10.071896], [-0.86925, 10.071648], [-0.868057, 10.070333], [-0.867718, 10.069828], [-0.867625, 10.069627], [-0.867293, 10.06891], [-0.867238, 10.068575], [-0.867218, 10.06845], [-0.867218, 10.067761], [-0.867276, 10.067288], [-0.867458, 10.065802], [-0.867514, 10.065352], [-0.867511, 10.065234], [-0.867504, 10.064929], [-0.867489, 10.064316], [-0.867528, 10.064181], [-0.867548, 10.063836], [-0.867606, 10.063742], [-0.867623, 10.063263], [-0.867607, 10.062918], [-0.867643, 10.062554], [-0.86755, 10.062511], [-0.867282, 10.062385], [-0.86705, 10.062159], [-0.866798, 10.0621], [-0.866612, 10.062131], [-0.866086, 10.062232], [-0.865885, 10.062258], [-0.865635, 10.062209], [-0.865468, 10.061943], [-0.865381, 10.0619], [-0.865028, 10.061935], [-0.864631, 10.061958], [-0.863947, 10.061996], [-0.863783, 10.061941], [-0.863705, 10.061864], [-0.863647, 10.061691], [-0.863589, 10.061519], [-0.863466, 10.060791], [-0.863436, 10.060408], [-0.863436, 10.059355], [-0.863711, 10.058247], [-0.863801, 10.057884], [-0.86403, 10.057487], [-0.864133, 10.056886], [-0.864247, 10.056541], [-0.864364, 10.056313], [-0.864695, 10.055786], [-0.865051, 10.05561], [-0.865407, 10.055434], [-0.865966, 10.055203], [-0.866235, 10.055167], [-0.866475, 10.055196], [-0.866681, 10.055241], [-0.867561, 10.05536], [-0.867821, 10.055338], [-0.868053, 10.0553], [-0.868286, 10.055261], [-0.869356, 10.05505], [-0.869534, 10.054995], [-0.869916, 10.054928], [-0.870739, 10.054785], [-0.870833, 10.054786], [-0.871067, 10.05486], [-0.871359, 10.054897], [-0.871651, 10.054935], [-0.872457, 10.055398], [-0.872688, 10.055475], [-0.873153, 10.055743], [-0.873383, 10.055933], [-0.87352, 10.055972], [-0.874065, 10.056333], [-0.874573, 10.056783], [-0.874904, 10.057053], [-0.875535, 10.057513], [-0.875825, 10.057831], [-0.876205, 10.05825], [-0.876597, 10.05884], [-0.877089, 10.059193], [-0.877234, 10.05941], [-0.877511, 10.059659], [-0.877979, 10.060078], [-0.87821, 10.060174], [-0.878442, 10.060155], [-0.878674, 10.060136], [-0.879331, 10.060136], [-0.879995, 10.059971], [-0.880529, 10.060059], [-0.880991, 10.060059], [-0.881225, 10.060021], [-0.881519, 10.059867], [-0.881823, 10.059707], [-0.882065, 10.05934], [-0.882053, 10.058739], [-0.882046, 10.058362], [-0.881824, 10.057882], [-0.881729, 10.057571], [-0.881418, 10.055696], [-0.881496, 10.055352], [-0.881616, 10.055073], [-0.881727, 10.054814], [-0.881922, 10.054547], [-0.882134, 10.054032], [-0.882345, 10.053707], [-0.882565, 10.05294], [-0.882627, 10.052014], [-0.882521, 10.051639], [-0.882521, 10.051408], [-0.882473, 10.051121], [-0.882424, 10.050834], [-0.882335, 10.050567], [-0.881924, 10.049955], [-0.881612, 10.049646], [-0.881468, 10.049321], [-0.881323, 10.048996], [-0.881362, 10.048767], [-0.881421, 10.048651], [-0.881652, 10.048519], [-0.881999, 10.048461], [-0.882695, 10.048461], [-0.883042, 10.048576], [-0.88339, 10.04869], [-0.883682, 10.048883], [-0.884319, 10.04917], [-0.884627, 10.049379], [-0.884936, 10.049587], [-0.885748, 10.050069], [-0.885901, 10.050301], [-0.886237, 10.050932], [-0.887135, 10.051784], [-0.887755, 10.052099], [-0.888114, 10.052223], [-0.888467, 10.052113], [-0.888737, 10.051883], [-0.889007, 10.051653], [-0.889414, 10.051158], [-0.889647, 10.050876], [-0.889955, 10.050338], [-0.890168, 10.049831], [-0.890381, 10.049324], [-0.890573, 10.048651], [-0.890621, 10.048484], [-0.890664, 10.048331], [-0.890728, 10.048109], [-0.890913, 10.047458], [-0.890968, 10.046789], [-0.890997, 10.046427], [-0.891081, 10.045396], [-0.891022, 10.044921], [-0.890964, 10.044445], [-0.890847, 10.044214], [-0.890789, 10.043985], [-0.890731, 10.043908], [-0.890578, 10.043448], [-0.890422, 10.043103], [-0.890242, 10.042565], [-0.890114, 10.042185], [-0.890036, 10.041725], [-0.889942, 10.041515], [-0.889883, 10.041286], [-0.889405, 10.04036], [-0.888841, 10.039525], [-0.888455, 10.039084], [-0.888221, 10.038874], [-0.88801, 10.038739], [-0.887172, 10.037853], [-0.886876, 10.037539], [-0.886617, 10.037111], [-0.886359, 10.036682], [-0.886156, 10.036078], [-0.886123, 10.035776], [-0.886089, 10.035475], [-0.886137, 10.035331], [-0.886529, 10.034802], [-0.88703, 10.034472], [-0.887608, 10.034433], [-0.888173, 10.034365], [-0.888737, 10.034296], [-0.889074, 10.034185], [-0.889463, 10.034056], [-0.889676, 10.034048], [-0.889889, 10.03404], [-0.890261, 10.034205], [-0.890837, 10.03439], [-0.891159, 10.034644], [-0.891275, 10.034758], [-0.89139, 10.034873], [-0.891635, 10.035406], [-0.891678, 10.0355], [-0.891824, 10.035742], [-0.891971, 10.035984], [-0.892079, 10.036024], [-0.892214, 10.036073], [-0.892363, 10.036086], [-0.892661, 10.036232], [-0.892903, 10.036216], [-0.893348, 10.036031], [-0.893851, 10.035422], [-0.894341, 10.034771], [-0.894411, 10.034678], [-0.894668, 10.034336], [-0.894983, 10.033918], [-0.895301, 10.033267], [-0.895376, 10.032752], [-0.89564, 10.032253], [-0.895727, 10.031977], [-0.896008, 10.031087], [-0.896105, 10.030778], [-0.896278, 10.029745], [-0.896355, 10.029038], [-0.896431, 10.028331], [-0.896521, 10.027788], [-0.89654, 10.027308], [-0.896465, 10.026222], [-0.896504, 10.025697], [-0.896514, 10.025553], [-0.896541, 10.025189], [-0.896633, 10.024433], [-0.896683, 10.022727], [-0.896662, 10.02247], [-0.896631, 10.022103], [-0.896598, 10.021707], [-0.896527, 10.021344], [-0.896456, 10.02098], [-0.896339, 10.020748], [-0.896146, 10.020481], [-0.895953, 10.020213], [-0.895839, 10.020136], [-0.895511, 10.019811], [-0.895428, 10.019527], [-0.895521, 10.019397], [-0.895614, 10.019268], [-0.896304, 10.019232], [-0.896707, 10.019428], [-0.897402, 10.019582], [-0.897993, 10.019747], [-0.899537, 10.020178], [-0.899768, 10.020242], [-0.900102, 10.020421], [-0.901192, 10.021006], [-0.901784, 10.021497], [-0.902209, 10.021938], [-0.902346, 10.022128], [-0.902537, 10.022321], [-0.902693, 10.02255], [-0.902904, 10.022743], [-0.903157, 10.023088], [-0.903252, 10.023162], [-0.903738, 10.023807], [-0.903961, 10.024466], [-0.904063, 10.024618], [-0.904353, 10.024811], [-0.904583, 10.024962], [-0.90495, 10.025117], [-0.905395, 10.025117], [-0.905743, 10.02502], [-0.905974, 10.025001], [-0.906669, 10.024773], [-0.906903, 10.024773], [-0.907617, 10.024541], [-0.907706, 10.02452], [-0.907926, 10.024467], [-0.908157, 10.02439], [-0.908274, 10.02439], [-0.908735, 10.024236], [-0.9092, 10.024025], [-0.909664, 10.023814], [-0.909895, 10.02374], [-0.910126, 10.023586], [-0.910552, 10.023142], [-0.91074, 10.022646], [-0.910805, 10.022475], [-0.910958, 10.022266], [-0.911036, 10.022037], [-0.911325, 10.02148], [-0.911441, 10.021136], [-0.911556, 10.020791], [-0.911517, 10.020678], [-0.91159, 10.020354], [-0.911704, 10.019851], [-0.911732, 10.019088], [-0.911819, 10.018135], [-0.911905, 10.017194], [-0.912002, 10.016963], [-0.912041, 10.016734], [-0.9121, 10.016657], [-0.912128, 10.016531], [-0.912253, 10.015968], [-0.912208, 10.01583], [-0.912253, 10.015279], [-0.912264, 10.014109], [-0.912269, 10.013539], [-0.912273, 10.013079], [-0.91212, 10.012464], [-0.911927, 10.012044], [-0.911734, 10.011624], [-0.91152, 10.01145], [-0.910941, 10.011163], [-0.910826, 10.011124], [-0.910708, 10.011111], [-0.910477, 10.011086], [-0.910303, 10.011153], [-0.910129, 10.011221], [-0.90986, 10.0114], [-0.909537, 10.011666], [-0.909242, 10.01191], [-0.908991, 10.012068], [-0.908677, 10.012266], [-0.908573, 10.012332], [-0.908469, 10.012398], [-0.908235, 10.012546], [-0.908001, 10.012694], [-0.907852, 10.012788], [-0.907533, 10.013034], [-0.907156, 10.013326], [-0.906904, 10.01343], [-0.906653, 10.013535], [-0.906422, 10.013516], [-0.906344, 10.013477], [-0.90625, 10.013364], [-0.906133, 10.013152], [-0.906094, 10.012923], [-0.906152, 10.012827], [-0.906431, 10.012551], [-0.906863, 10.011969], [-0.907296, 10.011388], [-0.907621, 10.011066], [-0.907852, 10.010991], [-0.908625, 10.01057], [-0.909621, 10.01025], [-0.909804, 10.010172], [-0.909987, 10.010094], [-0.910093, 10.010049], [-0.910501, 10.009968], [-0.910942, 10.009881], [-0.911715, 10.009633], [-0.912111, 10.009574], [-0.912507, 10.009515], [-0.913917, 10.009728], [-0.914379, 10.009766], [-0.91496, 10.009767], [-0.915538, 10.009902], [-0.915769, 10.009998], [-0.916222, 10.010321], [-0.916331, 10.010398], [-0.916464, 10.01063], [-0.916734, 10.010936], [-0.916812, 10.011165], [-0.916812, 10.011393], [-0.916748, 10.011486], [-0.916684, 10.011578], [-0.916571, 10.011741], [-0.916185, 10.0123], [-0.916619, 10.012945], [-0.91685, 10.013174], [-0.917295, 10.01348], [-0.917695, 10.013601], [-0.917968, 10.013579], [-0.91824, 10.013557], [-0.918588, 10.0135], [-0.919167, 10.013329], [-0.919459, 10.013136], [-0.919748, 10.012563], [-0.919844, 10.012276], [-0.91994, 10.011989], [-0.920603, 10.010705], [-0.920703, 10.010511], [-0.920869, 10.01019], [-0.920905, 10.009903], [-0.92126, 10.009305], [-0.921373, 10.009173], [-0.921448, 10.008831], [-0.921467, 10.008602], [-0.921545, 10.008371], [-0.92157, 10.007655], [-0.921584, 10.007224], [-0.921757, 10.006516], [-0.921757, 10.006075], [-0.921757, 10.005634], [-0.921816, 10.004487], [-0.921808, 10.004173], [-0.921797, 10.003682], [-0.921758, 10.003453], [-0.921688, 10.003234], [-0.921586, 10.002575], [-0.921552, 10.002409], [-0.921391, 10.002037], [-0.92135, 10.001551], [-0.921308, 10.001047], [-0.921472, 10.00046], [-0.921512, 10.000366], [-0.921553, 10.000273], [-0.921928, 10.00038], [-0.922347, 10.000568], [-0.922765, 10.000755], [-0.92306, 10.000915], [-0.923438, 10.001183], [-0.9243, 10.001423], [-0.924501, 10.001543], [-0.924703, 10.001662], [-0.925, 10.001878], [-0.925217, 10.001958], [-0.925648, 10.002437], [-0.926144, 10.002741], [-0.926238, 10.00282], [-0.926468, 10.003184], [-0.926566, 10.003262], [-0.926624, 10.003376], [-0.926695, 10.003482], [-0.927222, 10.004276], [-0.927436, 10.004488], [-0.927621, 10.00484], [-0.927694, 10.004979], [-0.928134, 10.005758], [-0.928275, 10.006009], [-0.928439, 10.006247], [-0.928534, 10.006311], [-0.929529, 10.007722], [-0.929601, 10.00777], [-0.929674, 10.007819], [-0.929751, 10.007934], [-0.930081, 10.008472], [-0.930291, 10.008814], [-0.93036, 10.008913], [-0.931025, 10.010076], [-0.931567, 10.010614], [-0.932262, 10.011072], [-0.932493, 10.011168], [-0.932739, 10.011309], [-0.932985, 10.011449], [-0.933641, 10.011623], [-0.934103, 10.011689], [-0.935156, 10.011838], [-0.935785, 10.011782], [-0.936264, 10.01174], [-0.936858, 10.011687], [-0.93779, 10.011555], [-0.938239, 10.011346], [-0.938633, 10.011164], [-0.939292, 10.010728], [-0.939753, 10.010271], [-0.94016, 10.009695], [-0.940257, 10.009466], [-0.940257, 10.009237], [-0.940418, 10.008355], [-0.940296, 10.007515], [-0.940316, 10.007283], [-0.940209, 10.006843], [-0.940102, 10.006404], [-0.939978, 10.006037], [-0.939754, 10.00537], [-0.939485, 10.004835], [-0.938982, 10.003705], [-0.938848, 10.003493], [-0.939157, 10.001583], [-0.93983, 10.000728], [-0.940275, 10.000341], [-0.94072, 9.999954], [-0.941151, 9.999499], [-0.94153, 9.99934], [-0.941905, 9.999284], [-0.942134, 9.999151], [-0.942364, 9.999017], [-0.942742, 9.998697], [-0.942903, 9.99835], [-0.942984, 9.99803], [-0.94297, 9.997751], [-0.942956, 9.997471], [-0.942715, 9.997016], [-0.942392, 9.996534], [-0.942147, 9.996109], [-0.941692, 9.995412], [-0.941366, 9.995252], [-0.941019, 9.994825], [-0.940479, 9.994317], [-0.940237, 9.993997], [-0.939912, 9.993435], [-0.939779, 9.993303], [-0.93967, 9.992848], [-0.939537, 9.992636], [-0.939429, 9.992129], [-0.939443, 9.991648], [-0.939457, 9.991167], [-0.939968, 9.990467], [-0.940156, 9.990241], [-0.940344, 9.990015], [-0.940803, 9.989747], [-0.941287, 9.989612], [-0.941987, 9.989612], [-0.943172, 9.98996], [-0.944467, 9.990442], [-0.944923, 9.99063], [-0.945438, 9.99095], [-0.946055, 9.991297], [-0.946378, 9.991562], [-0.946621, 9.991697], [-0.946864, 9.991832], [-0.947512, 9.992152], [-0.947915, 9.992312], [-0.948455, 9.992499], [-0.950204, 9.992792], [-0.950851, 9.992792], [-0.951416, 9.992687], [-0.952144, 9.992792], [-0.952712, 9.992927], [-0.953401, 9.99298], [-0.954317, 9.992914], [-0.955234, 9.992848], [-0.956313, 9.992713], [-0.957107, 9.992535], [-0.957984, 9.992338], [-0.958871, 9.992074], [-0.959922, 9.991699], [-0.960837, 9.991407], [-0.961387, 9.99106], [-0.962008, 9.990845], [-0.962304, 9.990631], [-0.963462, 9.989456], [-0.963812, 9.988976], [-0.963974, 9.988494], [-0.964175, 9.98804], [-0.964377, 9.987587], [-0.964405, 9.986465], [-0.964538, 9.985663], [-0.96474, 9.984591], [-0.964836, 9.983918], [-0.965025, 9.983116], [-0.96512, 9.982555], [-0.965215, 9.981994], [-0.965457, 9.98122], [-0.96586, 9.980288], [-0.966238, 9.978524], [-0.966041, 9.977604], [-0.96623, 9.977171], [-0.966642, 9.976735], [-0.966964, 9.975908], [-0.967234, 9.975478], [-0.967854, 9.974999], [-0.969066, 9.973472], [-0.969687, 9.972777], [-0.97017, 9.972083], [-0.970576, 9.971443], [-0.971141, 9.969787], [-0.971169, 9.969222], [-0.971277, 9.968635], [-0.971304, 9.968354], [-0.970997, 9.967996], [-0.971572, 9.967565], [-0.97187, 9.966738], [-0.972192, 9.965936], [-0.972354, 9.965629], [-0.972515, 9.965322], [-0.972623, 9.964899], [-0.972651, 9.964787], [-0.972813, 9.963933], [-0.972926, 9.963024], [-0.972946, 9.96286], [-0.97284, 9.962461], [-0.97276, 9.961978], [-0.972388, 9.961395], [-0.972301, 9.961259], [-0.971412, 9.960029], [-0.970953, 9.959495], [-0.970469, 9.959123], [-0.970035, 9.95833], [-0.969958, 9.958188], [-0.970147, 9.957221], [-0.97027, 9.956821], [-0.970405, 9.95638], [-0.970899, 9.956578], [-0.971357, 9.956173], [-0.972015, 9.956115], [-0.972444, 9.956353], [-0.973105, 9.95672], [-0.973433, 9.956766], [-0.973808, 9.956926], [-0.974401, 9.957221], [-0.974754, 9.957488], [-0.975182, 9.957728], [-0.975452, 9.957836], [-0.975966, 9.958263], [-0.976316, 9.958423], [-0.976611, 9.958638], [-0.97676, 9.95881], [-0.976908, 9.958982], [-0.977259, 9.959437], [-0.977754, 9.959454], [-0.977849, 9.959563], [-0.977945, 9.959672], [-0.978129, 9.959881], [-0.97856, 9.960441], [-0.978568, 9.961042], [-0.979233, 9.961375], [-0.979349, 9.962028], [-0.980106, 9.962588], [-0.98067, 9.962935], [-0.981479, 9.96315], [-0.982205, 9.963258], [-0.982636, 9.963123], [-0.983364, 9.962588], [-0.983632, 9.962277], [-0.984307, 9.961494], [-0.984791, 9.960719], [-0.985008, 9.960025], [-0.985008, 9.959225], [-0.985037, 9.959074], [-0.985116, 9.958663], [-0.985035, 9.958024], [-0.985035, 9.957249], [-0.984846, 9.956447], [-0.984738, 9.95586], [-0.984685, 9.955245], [-0.984712, 9.954804], [-0.984738, 9.954363], [-0.984872, 9.953616], [-0.98498, 9.953057], [-0.98525, 9.952307], [-0.985189, 9.95169], [-0.984811, 9.951538], [-0.984702, 9.951003], [-0.984649, 9.950524], [-0.98446, 9.950016], [-0.984838, 9.949686], [-0.984513, 9.949231], [-0.984318, 9.94908], [-0.983747, 9.949256], [-0.983465, 9.948974], [-0.983168, 9.948735], [-0.982926, 9.948227], [-0.982764, 9.9478], [-0.982414, 9.947321], [-0.982227, 9.946963], [-0.982118, 9.946755], [-0.982036, 9.946598], [-0.981915, 9.946291], [-0.981796, 9.945988], [-0.981673, 9.945621], [-0.981552, 9.945259], [-0.981472, 9.945153], [-0.98096, 9.944484], [-0.992137, 9.943512], [-1.002188, 9.96508], [-0.987092, 9.985155], [-0.988276, 10.002225], [-1.002318, 10.010461], [-1.02619, 10.060124], [-1.024075, 10.074576], [-1.010858, 10.078336], [-1.012057, 10.092917], [-1.021075, 10.100714], [-1.070077, 10.105902], [-1.062149, 10.121139], [-1.092761, 10.127126], [-1.086257, 10.152335], [-1.057943, 10.15763], [-1.07223, 10.173436], [-1.110718, 10.187136], [-1.131264, 10.141252], [-1.122108, 10.130258], [-1.126191, 10.115402], [-1.13987, 10.119341], [-1.210242, 10.088479], [-1.24066, 10.037152], [-1.240426, 10.026157], [-1.256213, 10.035554], [-1.287683, 10.035524], [-1.310161, 10.066082], [-1.355041, 10.07976], [-1.369643, 10.094637], [-1.411909, 10.089124], [-1.436763, 10.103442], [-1.467413, 10.103688], [-1.546338, 10.07057], [-1.557378, 10.097838], [-1.558627, 10.09143], [-1.579372, 10.089459], [-1.587687, 10.077903], [-1.586461, 10.100543], [-1.595266, 10.106748], [-1.600722, 10.133049], [-1.621559, 10.133253], [-1.635541, 10.15438], [-1.663566, 10.17373], [-1.662976, 10.187449], [-1.570261, 10.355467], [-1.517836, 10.405867], [-1.434023, 10.467766], [-1.418122, 10.466055], [-1.402355, 10.484694], [-1.377455, 10.466719], [-1.373239, 10.459633], [-1.380071, 10.456017], [-1.362387, 10.435076], [-1.372775, 10.427476], [-1.363873, 10.422283], [-1.366686, 10.413934], [-1.384873, 10.405371], [-1.381749, 10.390959], [-1.350409, 10.373148], [-1.34329, 10.352528], [-1.348192, 10.347297], [-1.324925, 10.340151], [-1.326372, 10.332103], [-1.285228, 10.322092], [-1.268975, 10.325532], [-1.271769, 10.314563], [-1.256192, 10.303327], [-1.24826, 10.27466], [-1.238979, 10.286717], [-1.228247, 10.286943], [-1.231953, 10.292673], [-1.222918, 10.295224], [-1.211093, 10.324104], [-1.214027, 10.344319], [-1.232123, 10.367062], [-1.232042, 10.387033], [-1.165606, 10.412604], [-1.13333, 10.458208], [-1.097565, 10.483263], [-1.071766, 10.490472], [-1.066035, 10.497302], [-1.053807, 10.499493], [-1.032131, 10.52821], [-1.008375, 10.538043], [-0.980719, 10.532255], [-0.965371, 10.536898], [-0.959186, 10.528843], [-0.948194, 10.533814], [-0.936015, 10.52652], [-0.91525, 10.528448], [-0.90891, 10.522248], [-0.934851, 10.486463], [-0.926787, 10.480439], [-0.890629, 10.518568], [-0.909231, 10.575913], [-0.874606, 10.595307], [-0.84329, 10.574676], [-0.837858, 10.601288], [-0.823653, 10.600977], [-0.795933, 10.621778], [-0.797015, 10.645799], [-0.789629, 10.652618], [-0.755586, 10.640312], [-0.724422, 10.651645], [-0.712227, 10.641629], [-0.706204, 10.620591], [-0.717971, 10.615381], [-0.718206, 10.605666], [-0.693823, 10.588924], [-0.685752, 10.567674], [-0.715704, 10.529453], [-0.704869, 10.523676], [-0.689883, 10.542574], [-0.681476, 10.526682], [-0.667591, 10.527017], [-0.640742, 10.555634], [-0.593601, 10.546164], [-0.578739, 10.549327], [-0.553967, 10.57179], [-0.52024, 10.558794], [-0.508298, 10.567216], [-0.499771, 10.623316], [-0.468183, 10.618062], [-0.443592, 10.599744], [-0.396186, 10.608273], [-0.365702, 10.62517], [-0.342905, 10.620386], [-0.314054, 10.621138], [-0.281818, 10.639421], [-0.262102, 10.631578], [-0.244339, 10.643759], [-0.23003, 10.655593], [-0.20491, 10.657673], [-0.182832, 10.670139], [-0.15355, 10.671572], [-0.090412, 10.711945], [-0.059309, 10.632399], [0.041236, 10.601602], [0.056223, 10.583589], [0.060426, 10.561674], [0.143538, 10.5257], [0.159176, 10.47364], [0.154487, 10.465345], [0.172046, 10.4511], [0.169582, 10.429358], [0.188435, 10.41847], [0.194051, 10.402718] ] ] ] } }, { "name": "Savannah", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-0.9362, 9.29631], [-0.885126, 9.310434], [-0.879734, 9.299974], [-0.859697, 9.30647], [-0.849158, 9.304305], [-0.848412, 9.296744], [-0.832823, 9.297348], [-0.805913, 9.31895], [-0.764445, 9.296037], [-0.708456, 9.287163], [-0.694032, 9.278251], [-0.714345, 9.295933], [-0.714523, 9.326288], [-0.689059, 9.310184], [-0.684103, 9.32552], [-0.654167, 9.315253], [-0.635121, 9.318833], [-0.636437, 9.310433], [-0.627041, 9.307053], [-0.61015, 9.311394], [-0.594431, 9.328766], [-0.562274, 9.28632], [-0.543675, 9.275139], [-0.51952, 9.282246], [-0.507086, 9.258645], [-0.426331, 9.222751], [-0.390837, 9.235446], [-0.324312, 9.209487], [-0.309355, 9.193459], [-0.308089, 9.18111], [-0.294313, 9.176616], [-0.282057, 9.137828], [-0.250117, 9.129308], [-0.237194, 9.11791], [-0.223601, 9.121269], [-0.218262, 9.108559], [-0.202642, 9.108917], [-0.21303, 9.078985], [-0.20397, 9.062885], [-0.21842, 9.032847], [-0.208833, 9.02724], [-0.21239, 9.012003], [-0.195485, 8.975214], [-0.200505, 8.947538], [-0.222024, 8.935799], [-0.236498, 8.940115], [-0.242096, 8.930874], [-0.237512, 8.920313], [-0.24863, 8.917482], [-0.243881, 8.90862], [-0.255906, 8.900918], [-0.280992, 8.901298], [-0.291056, 8.885499], [-0.302034, 8.885723], [-0.295093, 8.865749], [-0.299675, 8.86086], [-0.330491, 8.858981], [-0.33879, 8.867392], [-0.344048, 8.862586], [-0.338879, 8.861056], [-0.342888, 8.846421], [-0.322685, 8.834176], [-0.321107, 8.819317], [-0.299385, 8.819324], [-0.295358, 8.810771], [-0.306556, 8.795635], [-0.314555, 8.750777], [-0.329448, 8.742162], [-0.33967, 8.75592], [-0.353753, 8.754442], [-0.372858, 8.743295], [-0.365927, 8.73487], [-0.368842, 8.722593], [-0.383795, 8.724081], [-0.381023, 8.711414], [-0.387416, 8.708825], [-0.396592, 8.713042], [-0.40573, 8.707111], [-0.407576, 8.715541], [-0.412405, 8.708175], [-0.412218, 8.733936], [-0.431661, 8.728401], [-0.430751, 8.716544], [-0.448114, 8.729517], [-0.457717, 8.721451], [-0.472393, 8.734479], [-0.487906, 8.7226], [-0.485124, 8.682536], [-0.475903, 8.683126], [-0.469954, 8.671816], [-0.453705, 8.675622], [-0.447101, 8.662454], [-0.432744, 8.658874], [-0.434849, 8.644293], [-0.417792, 8.646012], [-0.411073, 8.599041], [-0.402407, 8.604484], [-0.396274, 8.593078], [-0.382968, 8.592318], [-0.373398, 8.598085], [-0.371494, 8.587007], [-0.358177, 8.599477], [-0.3578, 8.590263], [-0.363674, 8.581513], [-0.34366, 8.568591], [-0.3498, 8.56], [-0.336051, 8.531216], [-0.317438, 8.535602], [-0.312458, 8.52749], [-0.310452, 8.539038], [-0.304747, 8.534822], [-0.294022, 8.504647], [-0.323617, 8.499612], [-0.373287, 8.511924], [-0.451837, 8.461414], [-0.479983, 8.451636], [-0.472139, 8.427232], [-0.449971, 8.409241], [-0.436906, 8.354696], [-0.458563, 8.339463], [-0.4688, 8.301348], [-0.499744, 8.308867], [-0.531769, 8.288019], [-0.521472, 8.211369], [-0.503024, 8.180916], [-0.54247, 8.187687], [-0.639476, 8.26951], [-0.74077, 8.335595], [-0.801449, 8.339679], [-0.857848, 8.328594], [-0.8527, 8.314242], [-0.86198, 8.272429], [-0.878311, 8.263823], [-0.948672, 8.246522], [-0.959094, 8.25111], [-0.97898, 8.227293], [-0.989949, 8.245657], [-1.010227, 8.247946], [-1.019193, 8.261187], [-1.03971, 8.243108], [-1.040502, 8.166027], [-1.068743, 8.129247], [-1.043297, 8.093942], [-1.048142, 8.062539], [-1.033696, 8.054774], [-1.016471, 8.017616], [-1.029851, 8.017031], [-1.047467, 8.030134], [-1.081447, 8.017284], [-1.107013, 7.992415], [-1.154566, 7.997935], [-1.162029, 8.009236], [-1.166049, 8.060245], [-1.156553, 8.088658], [-1.237127, 8.223749], [-1.266473, 8.257342], [-1.274461, 8.289679], [-1.277753, 8.323444], [-1.25859, 8.352592], [-1.26206, 8.368327], [-1.252736, 8.379288], [-1.260016, 8.407471], [-1.253704, 8.424087], [-1.263018, 8.434526], [-1.258552, 8.454897], [-1.244758, 8.470193], [-1.221452, 8.477438], [-1.218295, 8.491267], [-1.194567, 8.494094], [-1.195944, 8.511553], [-1.182522, 8.510634], [-1.179336, 8.517885], [-1.173246, 8.507492], [-1.164387, 8.512502], [-1.172077, 8.535367], [-1.154814, 8.542504], [-1.141491, 8.576549], [-1.150537, 8.633321], [-1.144481, 8.6774], [-1.185869, 8.678252], [-1.209496, 8.667995], [-1.229658, 8.674701], [-1.264613, 8.691637], [-1.28805, 8.720304], [-1.309326, 8.721798], [-1.355972, 8.759105], [-1.410276, 8.774374], [-1.484568, 8.759765], [-1.499348, 8.738424], [-1.510797, 8.691789], [-1.531515, 8.681035], [-1.611905, 8.677061], [-1.658373, 8.695446], [-1.679357, 8.683951], [-1.69325, 8.64386], [-1.733402, 8.626412], [-1.755186, 8.630118], [-1.813244, 8.661548], [-1.840871, 8.661235], [-1.856994, 8.651612], [-1.871814, 8.634752], [-1.896842, 8.552828], [-1.883124, 8.480211], [-1.886457, 8.464541], [-1.909845, 8.438521], [-1.908086, 8.397696], [-1.870932, 8.334035], [-1.845637, 8.329346], [-1.802944, 8.339462], [-1.769913, 8.322761], [-1.747975, 8.279274], [-1.747407, 8.2621], [-1.772832, 8.231596], [-1.799695, 8.226239], [-1.83708, 8.250559], [-1.895127, 8.261698], [-1.959396, 8.170496], [-2.030926, 8.152769], [-2.064677, 8.146135], [-2.117284, 8.157175], [-2.121639, 8.149763], [-2.135672, 8.151857], [-2.162102, 8.173649], [-2.168331, 8.212098], [-2.205086, 8.231833], [-2.211788, 8.254947], [-2.229744, 8.263444], [-2.239723, 8.281234], [-2.252518, 8.276878], [-2.288475, 8.296948], [-2.285621, 8.319347], [-2.304996, 8.354863], [-2.299416, 8.384887], [-2.32528, 8.417423], [-2.337098, 8.454298], [-2.352312, 8.461496], [-2.369303, 8.485595], [-2.370784, 8.500396], [-2.357918, 8.520758], [-2.367022, 8.539907], [-2.410171, 8.567095], [-2.417346, 8.611985], [-2.464624, 8.652223], [-2.4883, 8.685847], [-2.500666, 8.719903], [-2.535621, 8.739328], [-2.543044, 8.761565], [-2.590986, 8.785029], [-2.629015, 8.794516], [-2.596336, 8.830789], [-2.622913, 8.877929], [-2.618162, 8.92213], [-2.651277, 8.944061], [-2.65411, 9.007485], [-2.672188, 9.020281], [-2.701789, 9.015395], [-2.705673, 9.020929], [-2.720013, 9.0121], [-2.716569, 9.025386], [-2.76053, 9.025652], [-2.782535, 9.054065], [-2.765561, 9.08794], [-2.768628, 9.120465], [-2.779065, 9.137359], [-2.736876, 9.159556], [-2.722639, 9.186562], [-2.72496, 9.198972], [-2.720392, 9.195051], [-2.71156, 9.210224], [-2.66193, 9.240158], [-2.656591, 9.255619], [-2.684939, 9.287043], [-2.710611, 9.291227], [-2.72126, 9.312937], [-2.719549, 9.334774], [-2.703139, 9.339323], [-2.681112, 9.361389], [-2.673637, 9.387467], [-2.688587, 9.432523], [-2.684686, 9.487441], [-2.713808, 9.523926], [-2.755414, 9.549947], [-2.771073, 9.575168], [-2.771138, 9.601364], [-2.745244, 9.641576], [-2.731845, 9.643511], [-2.719263, 9.632329], [-2.680476, 9.631638], [-2.53842, 9.677991], [-2.514921, 9.693895], [-2.508897, 9.745877], [-2.486962, 9.752992], [-2.42109, 9.77247], [-2.096886, 9.813767], [-2.08644, 9.78551], [-2.04224, 9.779771], [-2.024789, 9.786005], [-2.003388, 9.822258], [-1.986856, 9.825161], [-1.709787, 9.822423], [-1.696337, 9.887286], [-1.707077, 9.899907], [-1.704635, 9.923607], [-1.716132, 9.940059], [-1.706712, 9.945872], [-1.718625, 9.998307], [-1.714762, 10.012284], [-1.701724, 10.013883], [-1.686026, 10.038707], [-1.673635, 10.025334], [-1.667255, 10.04513], [-1.64603, 10.038068], [-1.634889, 10.042654], [-1.629075, 10.052929], [-1.655013, 10.074608], [-1.626398, 10.079118], [-1.613108, 10.069105], [-1.587687, 10.077903], [-1.579372, 10.089459], [-1.558627, 10.09143], [-1.557378, 10.097838], [-1.546338, 10.07057], [-1.467413, 10.103688], [-1.436763, 10.103442], [-1.411909, 10.089124], [-1.369643, 10.094637], [-1.355041, 10.07976], [-1.310161, 10.066082], [-1.287683, 10.035524], [-1.256213, 10.035554], [-1.240426, 10.026157], [-1.227049, 10.008005], [-1.208572, 10.005473], [-1.156414, 9.977334], [-1.14207, 9.980047], [-1.107657, 9.927337], [-1.126702, 9.929565], [-1.162581, 9.952256], [-1.178475, 9.949694], [-1.182201, 9.898026], [-1.160067, 9.856563], [-1.172608, 9.824527], [-1.174324, 9.789829], [-1.186705, 9.800358], [-1.2148, 9.7995], [-1.218127, 9.812453], [-1.238319, 9.828504], [-1.263191, 9.824331], [-1.273575, 9.802027], [-1.305058, 9.811259], [-1.307612, 9.82307], [-1.314218, 9.816304], [-1.308723, 9.801123], [-1.341379, 9.80814], [-1.35155, 9.794416], [-1.345374, 9.748943], [-1.350025, 9.729567], [-1.338751, 9.706091], [-1.325297, 9.698045], [-1.319066, 9.667156], [-1.325121, 9.656107], [-1.314621, 9.653381], [-1.330226, 9.643965], [-1.329399, 9.633889], [-1.373519, 9.608684], [-1.281301, 9.509932], [-1.243079, 9.419405], [-1.254607, 9.352906], [-1.264851, 9.342068], [-1.260777, 9.331486], [-1.26908, 9.330772], [-1.242524, 9.284802], [-1.172113, 9.321206], [-1.12045, 9.318399], [-1.0995, 9.309208], [-1.07706, 9.326333], [-1.057773, 9.327963], [-1.040741, 9.344811], [-1.013579, 9.32978], [-1.019634, 9.313394], [-0.976478, 9.336606], [-0.962614, 9.334302], [-0.959782, 9.303615], [-0.9362, 9.29631] ] ] ] } }, { "name": "Eastern", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-0.8802, 5.758555], [-0.878777, 5.749353], [-0.879989, 5.741779], [-0.953326, 5.738371], [-0.971577, 5.754234], [-0.99071, 5.748375], [-0.994781, 5.739209], [-0.997616, 5.746501], [-1.034759, 5.737473], [-1.044573, 5.752435], [-1.07719, 5.749181], [-1.091137, 5.742634], [-1.099819, 5.700823], [-1.120973, 5.720533], [-1.134393, 5.721314], [-1.135676, 5.704462], [-1.1439, 5.704138], [-1.151041, 5.725087], [-1.161381, 5.721095], [-1.167978, 5.7853], [-1.157827, 5.819556], [-1.169192, 5.839753], [-1.159574, 5.851772], [-1.169018, 5.865682], [-1.163031, 5.89725], [-1.169251, 5.910169], [-1.198455, 5.916663], [-1.224692, 5.935485], [-1.21885, 5.94241], [-1.224714, 5.945917], [-1.221831, 5.973904], [-1.246869, 5.990978], [-1.242085, 6.010041], [-1.227414, 6.018733], [-1.231253, 6.03878], [-1.208266, 6.05274], [-1.214628, 6.067807], [-1.198343, 6.082578], [-1.204822, 6.091001], [-1.18757, 6.096377], [-1.190139, 6.109787], [-1.205839, 6.115797], [-1.192489, 6.123135], [-1.201378, 6.133617], [-1.179579, 6.147941], [-1.186059, 6.167647], [-1.178944, 6.179967], [-1.188725, 6.184103], [-1.192208, 6.199272], [-1.164249, 6.206503], [-1.153804, 6.198543], [-1.131126, 6.199873], [-1.12027, 6.20945], [-1.120524, 6.228193], [-1.125374, 6.243981], [-1.116333, 6.268763], [-1.127989, 6.271265], [-1.126909, 6.286209], [-1.138655, 6.296383], [-1.127779, 6.302017], [-1.131182, 6.316057], [-1.112207, 6.320637], [-1.119948, 6.325986], [-1.110527, 6.343307], [-1.114291, 6.352822], [-1.066986, 6.390251], [-1.041859, 6.400521], [-1.035634, 6.413072], [-1.023626, 6.408345], [-1.010316, 6.415011], [-1.01802, 6.436104], [-1.005745, 6.442831], [-1.012285, 6.468325], [-1.005957, 6.487031], [-0.966213, 6.539974], [-0.956554, 6.559429], [-0.911451, 6.598913], [-0.910183, 6.610493], [-0.923611, 6.6409], [-0.945468, 6.639115], [-0.94509, 6.627022], [-0.974865, 6.613242], [-0.972531, 6.64565], [-0.973645, 6.680601], [-0.956782, 6.699062], [-0.947821, 6.7188], [-0.950207, 6.735201], [-0.979487, 6.739613], [-0.98596, 6.74329], [-0.982063, 6.749064], [-0.960917, 6.746226], [-0.956487, 6.75397], [-0.93251, 6.756299], [-0.901232, 6.788369], [-0.882728, 6.778484], [-0.852759, 6.777972], [-0.833687, 6.793454], [-0.792792, 6.789879], [-0.757236, 6.844896], [-0.755427, 6.866928], [-0.755719, 6.915645], [-0.753255, 6.938118], [-0.741967, 6.948934], [-0.722781, 6.952355], [-0.65229, 6.92953], [-0.65756, 6.947238], [-0.585315, 6.950921], [-0.574133, 6.963308], [-0.564716, 7.01869], [-0.591008, 7.044483], [-0.635406, 7.173942], [-0.609566, 7.153651], [-0.582842, 7.150601], [-0.561246, 7.137514], [-0.541845, 7.139028], [-0.494683, 7.124843], [-0.461406, 7.128405], [-0.387811, 7.117927], [-0.321774, 7.144141], [-0.300277, 7.17208], [-0.306414, 7.178258], [-0.2881, 7.184184], [-0.28717, 7.194743], [-0.26016, 7.189558], [-0.238718, 7.202353], [-0.220814, 7.212838], [-0.215545, 7.199698], [-0.181056, 7.203797], [-0.180045, 7.197861], [-0.158927, 7.194455], [-0.148651, 7.199951], [-0.10713, 7.195112], [-0.084879, 7.179294], [-0.052708, 7.196452], [0.004396, 7.194039], [0.050508, 7.172056], [0.081071, 7.181707], [0.182331, 7.179696], [0.235242, 7.167058], [0.242643, 7.127043], [0.224474, 7.099402], [0.196673, 7.067555], [0.227417, 6.974024], [0.206168, 6.942544], [0.14781, 6.921536], [0.122912, 6.889483], [0.12415, 6.843329], [0.133159, 6.829078], [0.192509, 6.789323], [0.208204, 6.757557], [0.203647, 6.703342], [0.161477, 6.683253], [0.123164, 6.666035], [0.104418, 6.566915], [0.151807, 6.57783], [0.194553, 6.563946], [0.199745, 6.54852], [0.177789, 6.511453], [0.178894, 6.48668], [0.189191, 6.475378], [0.177963, 6.424229], [0.209526, 6.401265], [0.21652, 6.384451], [0.199993, 6.370738], [0.20473, 6.357302], [0.174331, 6.330186], [0.168195, 6.313524], [0.175724, 6.302747], [0.159463, 6.300275], [0.127748, 6.255218], [0.09109, 6.160404], [0.097936, 6.147834], [0.146815, 6.109169], [0.143636, 6.100878], [0.089163, 6.062671], [0.040358, 6.047899], [0.019003, 6.061875], [0.018178, 6.038867], [0.00577, 6.012052], [-0.009607, 6.01038], [-0.014812, 5.997209], [-0.004641, 5.985662], [-0.006305, 5.97117], [-0.122171, 5.880222], [-0.129884, 5.852877], [-0.143928, 5.854919], [-0.164709, 5.839423], [-0.150889, 5.838339], [-0.155039, 5.814731], [-0.172329, 5.814012], [-0.185772, 5.79136], [-0.202556, 5.781952], [-0.201941, 5.763148], [-0.225056, 5.740066], [-0.22978, 5.75321], [-0.243687, 5.757697], [-0.233384, 5.784398], [-0.256521, 5.777912], [-0.269864, 5.807248], [-0.305098, 5.792758], [-0.327431, 5.772542], [-0.342365, 5.777684], [-0.362298, 5.763055], [-0.384752, 5.776375], [-0.390098, 5.757962], [-0.413373, 5.772491], [-0.424321, 5.793531], [-0.437446, 5.800861], [-0.447928, 5.789932], [-0.44395, 5.777489], [-0.492565, 5.748481], [-0.510344, 5.736234], [-0.568167, 5.740371], [-0.622978, 5.721179], [-0.652027, 5.737256], [-0.685787, 5.73958], [-0.694171, 5.732316], [-0.695154, 5.715322], [-0.75866, 5.709919], [-0.778553, 5.713695], [-0.783769, 5.706168], [-0.789332, 5.726254], [-0.814005, 5.730236], [-0.8123, 5.744353], [-0.843984, 5.756431], [-0.8802, 5.758555] ] ] ] } }, { "name": "Northern", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [0.082824, 8.525883], [0.093877, 8.501704], [0.120787, 8.485433], [0.08157, 8.460831], [0.092866, 8.427505], [0.086474, 8.403287], [0.124807, 8.382871], [0.207464, 8.410151], [0.222964, 8.407162], [0.244315, 8.386503], [0.242736, 8.35415], [0.22752, 8.34224], [0.203449, 8.341346], [0.185751, 8.326429], [0.198005, 8.291519], [0.19385, 8.253331], [0.123209, 8.232486], [0.129882, 8.214628], [0.116667, 8.217767], [0.1152, 8.229193], [0.078601, 8.22316], [0.10436, 8.239082], [0.07887, 8.281773], [0.010565, 8.297683], [-0.002604, 8.320577], [-0.036749, 8.33324], [-0.040348, 8.349676], [-0.058521, 8.352495], [-0.067734, 8.339887], [-0.087417, 8.332478], [-0.110279, 8.335961], [-0.124217, 8.273038], [-0.145729, 8.272349], [-0.169405, 8.253542], [-0.165536, 8.238211], [-0.173108, 8.228958], [-0.188522, 8.23179], [-0.198615, 8.219347], [-0.224308, 8.212895], [-0.259458, 8.216323], [-0.280701, 8.24559], [-0.319308, 8.226815], [-0.369491, 8.230902], [-0.387522, 8.224105], [-0.38494, 8.195043], [-0.348646, 8.201704], [-0.358626, 8.185724], [-0.354162, 8.166203], [-0.384706, 8.152823], [-0.447262, 8.158532], [-0.503024, 8.180916], [-0.521472, 8.211369], [-0.531769, 8.288019], [-0.499744, 8.308867], [-0.4688, 8.301348], [-0.458563, 8.339463], [-0.436906, 8.354696], [-0.449971, 8.409241], [-0.472139, 8.427232], [-0.479983, 8.451636], [-0.451837, 8.461414], [-0.373287, 8.511924], [-0.323617, 8.499612], [-0.294022, 8.504647], [-0.304747, 8.534822], [-0.310452, 8.539038], [-0.312458, 8.52749], [-0.317438, 8.535602], [-0.336051, 8.531216], [-0.3498, 8.56], [-0.34366, 8.568591], [-0.363674, 8.581513], [-0.3578, 8.590263], [-0.358177, 8.599477], [-0.371494, 8.587007], [-0.373398, 8.598085], [-0.382968, 8.592318], [-0.396274, 8.593078], [-0.402407, 8.604484], [-0.411073, 8.599041], [-0.417792, 8.646012], [-0.434849, 8.644293], [-0.432744, 8.658874], [-0.447101, 8.662454], [-0.453705, 8.675622], [-0.469954, 8.671816], [-0.475903, 8.683126], [-0.485124, 8.682536], [-0.487906, 8.7226], [-0.472393, 8.734479], [-0.457717, 8.721451], [-0.448114, 8.729517], [-0.430751, 8.716544], [-0.431661, 8.728401], [-0.412218, 8.733936], [-0.412405, 8.708175], [-0.407576, 8.715541], [-0.40573, 8.707111], [-0.396592, 8.713042], [-0.387416, 8.708825], [-0.381023, 8.711414], [-0.383795, 8.724081], [-0.368842, 8.722593], [-0.365927, 8.73487], [-0.372858, 8.743295], [-0.353753, 8.754442], [-0.33967, 8.75592], [-0.329448, 8.742162], [-0.314555, 8.750777], [-0.306556, 8.795635], [-0.295358, 8.810771], [-0.299385, 8.819324], [-0.321107, 8.819317], [-0.322685, 8.834176], [-0.342888, 8.846421], [-0.338879, 8.861056], [-0.344048, 8.862586], [-0.33879, 8.867392], [-0.330491, 8.858981], [-0.299675, 8.86086], [-0.295093, 8.865749], [-0.302034, 8.885723], [-0.291056, 8.885499], [-0.280992, 8.901298], [-0.255906, 8.900918], [-0.243881, 8.90862], [-0.24863, 8.917482], [-0.237512, 8.920313], [-0.242096, 8.930874], [-0.236498, 8.940115], [-0.222024, 8.935799], [-0.200505, 8.947538], [-0.195485, 8.975214], [-0.21239, 9.012003], [-0.208833, 9.02724], [-0.21842, 9.032847], [-0.20397, 9.062885], [-0.21303, 9.078985], [-0.202642, 9.108917], [-0.218262, 9.108559], [-0.223601, 9.121269], [-0.237194, 9.11791], [-0.250117, 9.129308], [-0.282057, 9.137828], [-0.294313, 9.176616], [-0.308089, 9.18111], [-0.309355, 9.193459], [-0.324312, 9.209487], [-0.390837, 9.235446], [-0.426331, 9.222751], [-0.507086, 9.258645], [-0.51952, 9.282246], [-0.543675, 9.275139], [-0.562274, 9.28632], [-0.594431, 9.328766], [-0.61015, 9.311394], [-0.627041, 9.307053], [-0.636437, 9.310433], [-0.635121, 9.318833], [-0.654167, 9.315253], [-0.684103, 9.32552], [-0.689059, 9.310184], [-0.714523, 9.326288], [-0.714345, 9.295933], [-0.694032, 9.278251], [-0.708456, 9.287163], [-0.764445, 9.296037], [-0.805913, 9.31895], [-0.832823, 9.297348], [-0.848412, 9.296744], [-0.849158, 9.304305], [-0.859697, 9.30647], [-0.879734, 9.299974], [-0.885126, 9.310434], [-0.9362, 9.29631], [-0.959782, 9.303615], [-0.962614, 9.334302], [-0.976478, 9.336606], [-1.019634, 9.313394], [-1.013579, 9.32978], [-1.040741, 9.344811], [-1.057773, 9.327963], [-1.07706, 9.326333], [-1.0995, 9.309208], [-1.12045, 9.318399], [-1.172113, 9.321206], [-1.242524, 9.284802], [-1.26908, 9.330772], [-1.260777, 9.331486], [-1.264851, 9.342068], [-1.254607, 9.352906], [-1.243079, 9.419405], [-1.281301, 9.509932], [-1.373519, 9.608684], [-1.329399, 9.633889], [-1.330226, 9.643965], [-1.314621, 9.653381], [-1.325121, 9.656107], [-1.319066, 9.667156], [-1.325297, 9.698045], [-1.338751, 9.706091], [-1.350025, 9.729567], [-1.345374, 9.748943], [-1.35155, 9.794416], [-1.341379, 9.80814], [-1.308723, 9.801123], [-1.314218, 9.816304], [-1.307612, 9.82307], [-1.305058, 9.811259], [-1.273575, 9.802027], [-1.263191, 9.824331], [-1.238319, 9.828504], [-1.218127, 9.812453], [-1.2148, 9.7995], [-1.186705, 9.800358], [-1.174324, 9.789829], [-1.172608, 9.824527], [-1.160067, 9.856563], [-1.182201, 9.898026], [-1.178475, 9.949694], [-1.162581, 9.952256], [-1.126702, 9.929565], [-1.107657, 9.927337], [-1.14207, 9.980047], [-1.156414, 9.977334], [-1.208572, 10.005473], [-1.227049, 10.008005], [-1.240426, 10.026157], [-1.24066, 10.037152], [-1.210242, 10.088479], [-1.13987, 10.119341], [-1.126191, 10.115402], [-1.122108, 10.130258], [-1.131264, 10.141252], [-1.110718, 10.187136], [-1.07223, 10.173436], [-1.057943, 10.15763], [-1.086257, 10.152335], [-1.092761, 10.127126], [-1.062149, 10.121139], [-1.070077, 10.105902], [-1.021075, 10.100714], [-1.012057, 10.092917], [-1.010858, 10.078336], [-1.024075, 10.074576], [-1.02619, 10.060124], [-1.002318, 10.010461], [-0.988276, 10.002225], [-0.987092, 9.985155], [-1.002188, 9.96508], [-0.992137, 9.943512], [-0.98096, 9.944484], [-0.981472, 9.945153], [-0.981552, 9.945259], [-0.981673, 9.945621], [-0.981796, 9.945988], [-0.981915, 9.946291], [-0.982036, 9.946598], [-0.982118, 9.946755], [-0.982227, 9.946963], [-0.982414, 9.947321], [-0.982764, 9.9478], [-0.982926, 9.948227], [-0.983168, 9.948735], [-0.983465, 9.948974], [-0.983747, 9.949256], [-0.984318, 9.94908], [-0.984513, 9.949231], [-0.984838, 9.949686], [-0.98446, 9.950016], [-0.984649, 9.950524], [-0.984702, 9.951003], [-0.984811, 9.951538], [-0.985189, 9.95169], [-0.98525, 9.952307], [-0.98498, 9.953057], [-0.984872, 9.953616], [-0.984738, 9.954363], [-0.984712, 9.954804], [-0.984685, 9.955245], [-0.984738, 9.95586], [-0.984846, 9.956447], [-0.985035, 9.957249], [-0.985035, 9.958024], [-0.985116, 9.958663], [-0.985037, 9.959074], [-0.985008, 9.959225], [-0.985008, 9.960025], [-0.984791, 9.960719], [-0.984307, 9.961494], [-0.983632, 9.962277], [-0.983364, 9.962588], [-0.982636, 9.963123], [-0.982205, 9.963258], [-0.981479, 9.96315], [-0.98067, 9.962935], [-0.980106, 9.962588], [-0.979349, 9.962028], [-0.979233, 9.961375], [-0.978568, 9.961042], [-0.97856, 9.960441], [-0.978129, 9.959881], [-0.977945, 9.959672], [-0.977849, 9.959563], [-0.977754, 9.959454], [-0.977259, 9.959437], [-0.976908, 9.958982], [-0.97676, 9.95881], [-0.976611, 9.958638], [-0.976316, 9.958423], [-0.975966, 9.958263], [-0.975452, 9.957836], [-0.975182, 9.957728], [-0.974754, 9.957488], [-0.974401, 9.957221], [-0.973808, 9.956926], [-0.973433, 9.956766], [-0.973105, 9.95672], [-0.972444, 9.956353], [-0.972015, 9.956115], [-0.971357, 9.956173], [-0.970899, 9.956578], [-0.970405, 9.95638], [-0.97027, 9.956821], [-0.970147, 9.957221], [-0.969958, 9.958188], [-0.970035, 9.95833], [-0.970469, 9.959123], [-0.970953, 9.959495], [-0.971412, 9.960029], [-0.972301, 9.961259], [-0.972388, 9.961395], [-0.97276, 9.961978], [-0.97284, 9.962461], [-0.972946, 9.96286], [-0.972926, 9.963024], [-0.972813, 9.963933], [-0.972651, 9.964787], [-0.972623, 9.964899], [-0.972515, 9.965322], [-0.972354, 9.965629], [-0.972192, 9.965936], [-0.97187, 9.966738], [-0.971572, 9.967565], [-0.970997, 9.967996], [-0.971304, 9.968354], [-0.971277, 9.968635], [-0.971169, 9.969222], [-0.971141, 9.969787], [-0.970576, 9.971443], [-0.97017, 9.972083], [-0.969687, 9.972777], [-0.969066, 9.973472], [-0.967854, 9.974999], [-0.967234, 9.975478], [-0.966964, 9.975908], [-0.966642, 9.976735], [-0.96623, 9.977171], [-0.966041, 9.977604], [-0.966238, 9.978524], [-0.96586, 9.980288], [-0.965457, 9.98122], [-0.965215, 9.981994], [-0.96512, 9.982555], [-0.965025, 9.983116], [-0.964836, 9.983918], [-0.96474, 9.984591], [-0.964538, 9.985663], [-0.964405, 9.986465], [-0.964377, 9.987587], [-0.964175, 9.98804], [-0.963974, 9.988494], [-0.963812, 9.988976], [-0.963462, 9.989456], [-0.962304, 9.990631], [-0.962008, 9.990845], [-0.961387, 9.99106], [-0.960837, 9.991407], [-0.959922, 9.991699], [-0.958871, 9.992074], [-0.957984, 9.992338], [-0.957107, 9.992535], [-0.956313, 9.992713], [-0.955234, 9.992848], [-0.954317, 9.992914], [-0.953401, 9.99298], [-0.952712, 9.992927], [-0.952144, 9.992792], [-0.951416, 9.992687], [-0.950851, 9.992792], [-0.950204, 9.992792], [-0.948455, 9.992499], [-0.947915, 9.992312], [-0.947512, 9.992152], [-0.946864, 9.991832], [-0.946621, 9.991697], [-0.946378, 9.991562], [-0.946055, 9.991297], [-0.945438, 9.99095], [-0.944923, 9.99063], [-0.944467, 9.990442], [-0.943172, 9.98996], [-0.941987, 9.989612], [-0.941287, 9.989612], [-0.940803, 9.989747], [-0.940344, 9.990015], [-0.940156, 9.990241], [-0.939968, 9.990467], [-0.939457, 9.991167], [-0.939443, 9.991648], [-0.939429, 9.992129], [-0.939537, 9.992636], [-0.93967, 9.992848], [-0.939779, 9.993303], [-0.939912, 9.993435], [-0.940237, 9.993997], [-0.940479, 9.994317], [-0.941019, 9.994825], [-0.941366, 9.995252], [-0.941692, 9.995412], [-0.942147, 9.996109], [-0.942392, 9.996534], [-0.942715, 9.997016], [-0.942956, 9.997471], [-0.94297, 9.997751], [-0.942984, 9.99803], [-0.942903, 9.99835], [-0.942742, 9.998697], [-0.942364, 9.999017], [-0.942134, 9.999151], [-0.941905, 9.999284], [-0.94153, 9.99934], [-0.941151, 9.999499], [-0.94072, 9.999954], [-0.940275, 10.000341], [-0.93983, 10.000728], [-0.939157, 10.001583], [-0.938848, 10.003493], [-0.938982, 10.003705], [-0.939485, 10.004835], [-0.939754, 10.00537], [-0.939978, 10.006037], [-0.940102, 10.006404], [-0.940209, 10.006843], [-0.940316, 10.007283], [-0.940296, 10.007515], [-0.940418, 10.008355], [-0.940257, 10.009237], [-0.940257, 10.009466], [-0.94016, 10.009695], [-0.939753, 10.010271], [-0.939292, 10.010728], [-0.938633, 10.011164], [-0.938239, 10.011346], [-0.93779, 10.011555], [-0.936858, 10.011687], [-0.936264, 10.01174], [-0.935785, 10.011782], [-0.935156, 10.011838], [-0.934103, 10.011689], [-0.933641, 10.011623], [-0.932985, 10.011449], [-0.932739, 10.011309], [-0.932493, 10.011168], [-0.932262, 10.011072], [-0.931567, 10.010614], [-0.931025, 10.010076], [-0.93036, 10.008913], [-0.930291, 10.008814], [-0.930081, 10.008472], [-0.929751, 10.007934], [-0.929674, 10.007819], [-0.929601, 10.00777], [-0.929529, 10.007722], [-0.928534, 10.006311], [-0.928439, 10.006247], [-0.928275, 10.006009], [-0.928134, 10.005758], [-0.927694, 10.004979], [-0.927621, 10.00484], [-0.927436, 10.004488], [-0.927222, 10.004276], [-0.926695, 10.003482], [-0.926624, 10.003376], [-0.926566, 10.003262], [-0.926468, 10.003184], [-0.926238, 10.00282], [-0.926144, 10.002741], [-0.925648, 10.002437], [-0.925217, 10.001958], [-0.925, 10.001878], [-0.924703, 10.001662], [-0.924501, 10.001543], [-0.9243, 10.001423], [-0.923438, 10.001183], [-0.92306, 10.000915], [-0.922765, 10.000755], [-0.922347, 10.000568], [-0.921928, 10.00038], [-0.921553, 10.000273], [-0.921512, 10.000366], [-0.921472, 10.00046], [-0.921308, 10.001047], [-0.92135, 10.001551], [-0.921391, 10.002037], [-0.921552, 10.002409], [-0.921586, 10.002575], [-0.921688, 10.003234], [-0.921758, 10.003453], [-0.921797, 10.003682], [-0.921808, 10.004173], [-0.921816, 10.004487], [-0.921757, 10.005634], [-0.921757, 10.006075], [-0.921757, 10.006516], [-0.921584, 10.007224], [-0.92157, 10.007655], [-0.921545, 10.008371], [-0.921467, 10.008602], [-0.921448, 10.008831], [-0.921373, 10.009173], [-0.92126, 10.009305], [-0.920905, 10.009903], [-0.920869, 10.01019], [-0.920703, 10.010511], [-0.920603, 10.010705], [-0.91994, 10.011989], [-0.919844, 10.012276], [-0.919748, 10.012563], [-0.919459, 10.013136], [-0.919167, 10.013329], [-0.918588, 10.0135], [-0.91824, 10.013557], [-0.917968, 10.013579], [-0.917695, 10.013601], [-0.917295, 10.01348], [-0.91685, 10.013174], [-0.916619, 10.012945], [-0.916185, 10.0123], [-0.916571, 10.011741], [-0.916684, 10.011578], [-0.916748, 10.011486], [-0.916812, 10.011393], [-0.916812, 10.011165], [-0.916734, 10.010936], [-0.916464, 10.01063], [-0.916331, 10.010398], [-0.916222, 10.010321], [-0.915769, 10.009998], [-0.915538, 10.009902], [-0.91496, 10.009767], [-0.914379, 10.009766], [-0.913917, 10.009728], [-0.912507, 10.009515], [-0.912111, 10.009574], [-0.911715, 10.009633], [-0.910942, 10.009881], [-0.910501, 10.009968], [-0.910093, 10.010049], [-0.909987, 10.010094], [-0.909804, 10.010172], [-0.909621, 10.01025], [-0.908625, 10.01057], [-0.907852, 10.010991], [-0.907621, 10.011066], [-0.907296, 10.011388], [-0.906863, 10.011969], [-0.906431, 10.012551], [-0.906152, 10.012827], [-0.906094, 10.012923], [-0.906133, 10.013152], [-0.90625, 10.013364], [-0.906344, 10.013477], [-0.906422, 10.013516], [-0.906653, 10.013535], [-0.906904, 10.01343], [-0.907156, 10.013326], [-0.907533, 10.013034], [-0.907852, 10.012788], [-0.908001, 10.012694], [-0.908235, 10.012546], [-0.908469, 10.012398], [-0.908573, 10.012332], [-0.908677, 10.012266], [-0.908991, 10.012068], [-0.909242, 10.01191], [-0.909537, 10.011666], [-0.90986, 10.0114], [-0.910129, 10.011221], [-0.910303, 10.011153], [-0.910477, 10.011086], [-0.910708, 10.011111], [-0.910826, 10.011124], [-0.910941, 10.011163], [-0.91152, 10.01145], [-0.911734, 10.011624], [-0.911927, 10.012044], [-0.91212, 10.012464], [-0.912273, 10.013079], [-0.912269, 10.013539], [-0.912264, 10.014109], [-0.912253, 10.015279], [-0.912208, 10.01583], [-0.912253, 10.015968], [-0.912128, 10.016531], [-0.9121, 10.016657], [-0.912041, 10.016734], [-0.912002, 10.016963], [-0.911905, 10.017194], [-0.911819, 10.018135], [-0.911732, 10.019088], [-0.911704, 10.019851], [-0.91159, 10.020354], [-0.911517, 10.020678], [-0.911556, 10.020791], [-0.911441, 10.021136], [-0.911325, 10.02148], [-0.911036, 10.022037], [-0.910958, 10.022266], [-0.910805, 10.022475], [-0.91074, 10.022646], [-0.910552, 10.023142], [-0.910126, 10.023586], [-0.909895, 10.02374], [-0.909664, 10.023814], [-0.9092, 10.024025], [-0.908735, 10.024236], [-0.908274, 10.02439], [-0.908157, 10.02439], [-0.907926, 10.024467], [-0.907706, 10.02452], [-0.907617, 10.024541], [-0.906903, 10.024773], [-0.906669, 10.024773], [-0.905974, 10.025001], [-0.905743, 10.02502], [-0.905395, 10.025117], [-0.90495, 10.025117], [-0.904583, 10.024962], [-0.904353, 10.024811], [-0.904063, 10.024618], [-0.903961, 10.024466], [-0.903738, 10.023807], [-0.903252, 10.023162], [-0.903157, 10.023088], [-0.902904, 10.022743], [-0.902693, 10.02255], [-0.902537, 10.022321], [-0.902346, 10.022128], [-0.902209, 10.021938], [-0.901784, 10.021497], [-0.901192, 10.021006], [-0.900102, 10.020421], [-0.899768, 10.020242], [-0.899537, 10.020178], [-0.897993, 10.019747], [-0.897402, 10.019582], [-0.896707, 10.019428], [-0.896304, 10.019232], [-0.895614, 10.019268], [-0.895521, 10.019397], [-0.895428, 10.019527], [-0.895511, 10.019811], [-0.895839, 10.020136], [-0.895953, 10.020213], [-0.896146, 10.020481], [-0.896339, 10.020748], [-0.896456, 10.02098], [-0.896527, 10.021344], [-0.896598, 10.021707], [-0.896631, 10.022103], [-0.896662, 10.02247], [-0.896683, 10.022727], [-0.896633, 10.024433], [-0.896541, 10.025189], [-0.896514, 10.025553], [-0.896504, 10.025697], [-0.896465, 10.026222], [-0.89654, 10.027308], [-0.896521, 10.027788], [-0.896431, 10.028331], [-0.896355, 10.029038], [-0.896278, 10.029745], [-0.896105, 10.030778], [-0.896008, 10.031087], [-0.895727, 10.031977], [-0.89564, 10.032253], [-0.895376, 10.032752], [-0.895301, 10.033267], [-0.894983, 10.033918], [-0.894668, 10.034336], [-0.894411, 10.034678], [-0.894341, 10.034771], [-0.893851, 10.035422], [-0.893348, 10.036031], [-0.892903, 10.036216], [-0.892661, 10.036232], [-0.892363, 10.036086], [-0.892214, 10.036073], [-0.892079, 10.036024], [-0.891971, 10.035984], [-0.891824, 10.035742], [-0.891678, 10.0355], [-0.891635, 10.035406], [-0.89139, 10.034873], [-0.891275, 10.034758], [-0.891159, 10.034644], [-0.890837, 10.03439], [-0.890261, 10.034205], [-0.889889, 10.03404], [-0.889676, 10.034048], [-0.889463, 10.034056], [-0.889074, 10.034185], [-0.888737, 10.034296], [-0.888173, 10.034365], [-0.887608, 10.034433], [-0.88703, 10.034472], [-0.886529, 10.034802], [-0.886137, 10.035331], [-0.886089, 10.035475], [-0.886123, 10.035776], [-0.886156, 10.036078], [-0.886359, 10.036682], [-0.886617, 10.037111], [-0.886876, 10.037539], [-0.887172, 10.037853], [-0.88801, 10.038739], [-0.888221, 10.038874], [-0.888455, 10.039084], [-0.888841, 10.039525], [-0.889405, 10.04036], [-0.889883, 10.041286], [-0.889942, 10.041515], [-0.890036, 10.041725], [-0.890114, 10.042185], [-0.890242, 10.042565], [-0.890422, 10.043103], [-0.890578, 10.043448], [-0.890731, 10.043908], [-0.890789, 10.043985], [-0.890847, 10.044214], [-0.890964, 10.044445], [-0.891022, 10.044921], [-0.891081, 10.045396], [-0.890997, 10.046427], [-0.890968, 10.046789], [-0.890913, 10.047458], [-0.890728, 10.048109], [-0.890664, 10.048331], [-0.890621, 10.048484], [-0.890573, 10.048651], [-0.890381, 10.049324], [-0.890168, 10.049831], [-0.889955, 10.050338], [-0.889647, 10.050876], [-0.889414, 10.051158], [-0.889007, 10.051653], [-0.888737, 10.051883], [-0.888467, 10.052113], [-0.888114, 10.052223], [-0.887755, 10.052099], [-0.887135, 10.051784], [-0.886237, 10.050932], [-0.885901, 10.050301], [-0.885748, 10.050069], [-0.884936, 10.049587], [-0.884627, 10.049379], [-0.884319, 10.04917], [-0.883682, 10.048883], [-0.88339, 10.04869], [-0.883042, 10.048576], [-0.882695, 10.048461], [-0.881999, 10.048461], [-0.881652, 10.048519], [-0.881421, 10.048651], [-0.881362, 10.048767], [-0.881323, 10.048996], [-0.881468, 10.049321], [-0.881612, 10.049646], [-0.881924, 10.049955], [-0.882335, 10.050567], [-0.882424, 10.050834], [-0.882473, 10.051121], [-0.882521, 10.051408], [-0.882521, 10.051639], [-0.882627, 10.052014], [-0.882565, 10.05294], [-0.882345, 10.053707], [-0.882134, 10.054032], [-0.881922, 10.054547], [-0.881727, 10.054814], [-0.881616, 10.055073], [-0.881496, 10.055352], [-0.881418, 10.055696], [-0.881729, 10.057571], [-0.881824, 10.057882], [-0.882046, 10.058362], [-0.882053, 10.058739], [-0.882065, 10.05934], [-0.881823, 10.059707], [-0.881519, 10.059867], [-0.881225, 10.060021], [-0.880991, 10.060059], [-0.880529, 10.060059], [-0.879995, 10.059971], [-0.879331, 10.060136], [-0.878674, 10.060136], [-0.878442, 10.060155], [-0.87821, 10.060174], [-0.877979, 10.060078], [-0.877511, 10.059659], [-0.877234, 10.05941], [-0.877089, 10.059193], [-0.876597, 10.05884], [-0.876205, 10.05825], [-0.875825, 10.057831], [-0.875535, 10.057513], [-0.874904, 10.057053], [-0.874573, 10.056783], [-0.874065, 10.056333], [-0.87352, 10.055972], [-0.873383, 10.055933], [-0.873153, 10.055743], [-0.872688, 10.055475], [-0.872457, 10.055398], [-0.871651, 10.054935], [-0.871359, 10.054897], [-0.871067, 10.05486], [-0.870833, 10.054786], [-0.870739, 10.054785], [-0.869916, 10.054928], [-0.869534, 10.054995], [-0.869356, 10.05505], [-0.868286, 10.055261], [-0.868053, 10.0553], [-0.867821, 10.055338], [-0.867561, 10.05536], [-0.866681, 10.055241], [-0.866475, 10.055196], [-0.866235, 10.055167], [-0.865966, 10.055203], [-0.865407, 10.055434], [-0.865051, 10.05561], [-0.864695, 10.055786], [-0.864364, 10.056313], [-0.864247, 10.056541], [-0.864133, 10.056886], [-0.86403, 10.057487], [-0.863801, 10.057884], [-0.863711, 10.058247], [-0.863436, 10.059355], [-0.863436, 10.060408], [-0.863466, 10.060791], [-0.863589, 10.061519], [-0.863647, 10.061691], [-0.863705, 10.061864], [-0.863783, 10.061941], [-0.863947, 10.061996], [-0.864631, 10.061958], [-0.865028, 10.061935], [-0.865381, 10.0619], [-0.865468, 10.061943], [-0.865635, 10.062209], [-0.865885, 10.062258], [-0.866086, 10.062232], [-0.866612, 10.062131], [-0.866798, 10.0621], [-0.86705, 10.062159], [-0.867282, 10.062385], [-0.86755, 10.062511], [-0.867643, 10.062554], [-0.867607, 10.062918], [-0.867623, 10.063263], [-0.867606, 10.063742], [-0.867548, 10.063836], [-0.867528, 10.064181], [-0.867489, 10.064316], [-0.867504, 10.064929], [-0.867511, 10.065234], [-0.867514, 10.065352], [-0.867458, 10.065802], [-0.867276, 10.067288], [-0.867218, 10.067761], [-0.867218, 10.06845], [-0.867238, 10.068575], [-0.867293, 10.06891], [-0.867625, 10.069627], [-0.867718, 10.069828], [-0.868057, 10.070333], [-0.86925, 10.071648], [-0.869417, 10.071896], [-0.869602, 10.072402], [-0.869683, 10.072624], [-0.869803, 10.072949], [-0.869822, 10.073323], [-0.869841, 10.073696], [-0.869777, 10.073757], [-0.869724, 10.074537], [-0.869698, 10.075693], [-0.869687, 10.07616], [-0.869385, 10.076943], [-0.869256, 10.077279], [-0.868919, 10.077814], [-0.868535, 10.078288], [-0.868187, 10.078575], [-0.868023, 10.078709], [-0.867851, 10.078767], [-0.867518, 10.07895], [-0.866151, 10.079704], [-0.865873, 10.079844], [-0.864924, 10.080321], [-0.863775, 10.0811], [-0.863079, 10.081444], [-0.862846, 10.081522], [-0.862673, 10.081657], [-0.861738, 10.082026], [-0.861474, 10.08213], [-0.860181, 10.082841], [-0.860005, 10.083069], [-0.859911, 10.083301], [-0.859755, 10.08351], [-0.859657, 10.083587], [-0.859446, 10.083665], [-0.858906, 10.083684], [-0.85878, 10.08375], [-0.858653, 10.083816], [-0.858286, 10.084353], [-0.858172, 10.084582], [-0.858172, 10.084717], [-0.858094, 10.084791], [-0.857938, 10.085252], [-0.857957, 10.08548], [-0.858171, 10.085941], [-0.858479, 10.086859], [-0.858866, 10.087562], [-0.859155, 10.087931], [-0.859288, 10.088163], [-0.859811, 10.088794], [-0.860081, 10.089062], [-0.86035, 10.089329], [-0.860926, 10.089791], [-0.861078, 10.089913], [-0.86265, 10.090901], [-0.862792, 10.09096], [-0.86411, 10.091503], [-0.864388, 10.091685], [-0.86448, 10.091718], [-0.865603, 10.092529], [-0.866257, 10.093102], [-0.866435, 10.093218], [-0.866782, 10.093505], [-0.868056, 10.09431], [-0.86827, 10.094501], [-0.868327, 10.094607], [-0.868384, 10.094713], [-0.868481, 10.09517], [-0.868481, 10.095747], [-0.868339, 10.096165], [-0.867854, 10.096887], [-0.867479, 10.097753], [-0.867031, 10.098138], [-0.866915, 10.098205], [-0.8668, 10.098271], [-0.866585, 10.098502], [-0.865776, 10.099037], [-0.864385, 10.10007], [-0.864209, 10.100243], [-0.863978, 10.100317], [-0.863891, 10.100404], [-0.863708, 10.10051], [-0.863341, 10.100874], [-0.862693, 10.101281], [-0.862337, 10.101505], [-0.862008, 10.101753], [-0.861911, 10.101859], [-0.861814, 10.101965], [-0.861156, 10.102282], [-0.86082, 10.102444], [-0.860325, 10.102684], [-0.859477, 10.102824], [-0.85908, 10.102938], [-0.858684, 10.103052], [-0.858453, 10.103207], [-0.858409, 10.103293], [-0.85793, 10.103895], [-0.857854, 10.104124], [-0.857825, 10.104354], [-0.857796, 10.104584], [-0.85791, 10.10472], [-0.857776, 10.104813], [-0.857644, 10.105358], [-0.857537, 10.105803], [-0.85762, 10.106404], [-0.857698, 10.106489], [-0.857775, 10.106574], [-0.858006, 10.106647], [-0.858237, 10.106671], [-0.858682, 10.106536], [-0.858995, 10.106536], [-0.859162, 10.106536], [-0.859359, 10.10662], [-0.859488, 10.106743], [-0.859556, 10.106827], [-0.859552, 10.106968], [-0.859711, 10.107253], [-0.859554, 10.107681], [-0.859396, 10.108108], [-0.859279, 10.108565], [-0.859164, 10.108737], [-0.859048, 10.10891], [-0.858979, 10.109114], [-0.858646, 10.109491], [-0.858314, 10.109869], [-0.85818, 10.110097], [-0.858005, 10.110307], [-0.857618, 10.11067], [-0.857231, 10.111034], [-0.857079, 10.111197], [-0.856807, 10.111489], [-0.856535, 10.111781], [-0.856188, 10.112086], [-0.855792, 10.112348], [-0.855609, 10.112469], [-0.855378, 10.112585], [-0.854768, 10.112776], [-0.854276, 10.112929], [-0.854101, 10.112929], [-0.853522, 10.113119], [-0.853338, 10.113149], [-0.852827, 10.113234], [-0.852596, 10.113367], [-0.852131, 10.113501], [-0.851657, 10.113584], [-0.850662, 10.113757], [-0.850509, 10.113807], [-0.850392, 10.113884], [-0.85016, 10.113961], [-0.849668, 10.114202], [-0.849261, 10.114543], [-0.849113, 10.114819], [-0.849062, 10.1149], [-0.848987, 10.115202], [-0.848912, 10.115504], [-0.848861, 10.115874], [-0.848805, 10.116276], [-0.84875, 10.116678], [-0.848653, 10.116907], [-0.848643, 10.117022], [-0.848633, 10.117138], [-0.848672, 10.117367], [-0.848769, 10.117576], [-0.848808, 10.117808], [-0.848929, 10.118028], [-0.849155, 10.118439], [-0.849734, 10.119242], [-0.849984, 10.11953], [-0.85079, 10.120458], [-0.851272, 10.120736], [-0.851574, 10.12091], [-0.851953, 10.121004], [-0.852108, 10.121033], [-0.852264, 10.121062], [-0.852437, 10.121004], [-0.852534, 10.121024], [-0.852649, 10.121004], [-0.852765, 10.120985], [-0.853064, 10.120995], [-0.853363, 10.121005], [-0.853495, 10.121049], [-0.853844, 10.121165], [-0.854166, 10.121593], [-0.854324, 10.121803], [-0.854572, 10.122133], [-0.854986, 10.123001], [-0.855576, 10.123715], [-0.855643, 10.123916], [-0.855912, 10.124451], [-0.856048, 10.124854], [-0.855921, 10.125831], [-0.855892, 10.125945], [-0.855795, 10.126155], [-0.855661, 10.126615], [-0.855573, 10.126787], [-0.855485, 10.126959], [-0.855399, 10.127054], [-0.855313, 10.127149], [-0.854926, 10.127687], [-0.854611, 10.127984], [-0.854386, 10.12818], [-0.853793, 10.128472], [-0.853446, 10.128549], [-0.853321, 10.1286], [-0.852847, 10.128797], [-0.852568, 10.128941], [-0.852288, 10.129086], [-0.85197, 10.129219], [-0.851651, 10.129353], [-0.851245, 10.129581], [-0.851089, 10.129581], [-0.850627, 10.12981], [-0.850538, 10.129898], [-0.850079, 10.130094], [-0.84962, 10.130289], [-0.849389, 10.130424], [-0.849157, 10.1305], [-0.848924, 10.130575], [-0.848346, 10.130652], [-0.847535, 10.130805], [-0.846724, 10.130958], [-0.84649, 10.131054], [-0.846032, 10.131386], [-0.845574, 10.131718], [-0.845231, 10.131778], [-0.844887, 10.131839], [-0.844656, 10.131913], [-0.844423, 10.131913], [-0.843891, 10.13197], [-0.84336, 10.132028], [-0.843023, 10.132014], [-0.842904, 10.132061], [-0.842814, 10.132096], [-0.842381, 10.132108], [-0.84144, 10.132107], [-0.841004, 10.132107], [-0.840051, 10.13195], [-0.839849, 10.131916], [-0.839625, 10.131953], [-0.839266, 10.132013], [-0.838956, 10.132065], [-0.838841, 10.132074], [-0.838725, 10.132084], [-0.838378, 10.132026], [-0.838144, 10.131929], [-0.837855, 10.13191], [-0.837195, 10.132055], [-0.837101, 10.132025], [-0.83687, 10.131854], [-0.836687, 10.131605], [-0.836503, 10.131355], [-0.836406, 10.131126], [-0.83639, 10.131007], [-0.836331, 10.130569], [-0.836341, 10.130159], [-0.836351, 10.129748], [-0.836332, 10.129518], [-0.836312, 10.129288], [-0.836332, 10.128618], [-0.836409, 10.128388], [-0.836485, 10.128158], [-0.836641, 10.127929], [-0.836728, 10.127697], [-0.836864, 10.127485], [-0.837152, 10.127148], [-0.83727, 10.127009], [-0.837677, 10.126741], [-0.838005, 10.126587], [-0.838197, 10.126397], [-0.838333, 10.126166], [-0.838448, 10.12586], [-0.838448, 10.125728], [-0.838506, 10.125515], [-0.838496, 10.12514], [-0.838473, 10.124247], [-0.83809, 10.123103], [-0.837679, 10.122491], [-0.83744, 10.122221], [-0.837043, 10.121852], [-0.836964, 10.121802], [-0.836519, 10.121647], [-0.836269, 10.121611], [-0.836037, 10.121648], [-0.835804, 10.121685], [-0.835643, 10.12176], [-0.834378, 10.122343], [-0.834143, 10.122451], [-0.833815, 10.122566], [-0.833233, 10.122566], [-0.832655, 10.122469], [-0.83196, 10.122298], [-0.831639, 10.122191], [-0.83055, 10.121702], [-0.830319, 10.12155], [-0.830085, 10.121473], [-0.829737, 10.121301], [-0.82939, 10.121128], [-0.829159, 10.120954], [-0.829062, 10.120919], [-0.828734, 10.120574], [-0.828503, 10.120381], [-0.828349, 10.120218], [-0.828194, 10.120055], [-0.828019, 10.119826], [-0.827519, 10.119308], [-0.827305, 10.119137], [-0.826863, 10.11885], [-0.826148, 10.118599], [-0.825914, 10.118599], [-0.825124, 10.118466], [-0.824815, 10.118432], [-0.823733, 10.118311], [-0.823443, 10.118216], [-0.823152, 10.11812], [-0.822671, 10.117908], [-0.822437, 10.117889], [-0.822187, 10.117927], [-0.82126, 10.118232], [-0.821089, 10.118318], [-0.820918, 10.118403], [-0.820236, 10.11894], [-0.820061, 10.119133], [-0.819947, 10.119591], [-0.819963, 10.119822], [-0.820022, 10.119937], [-0.82008, 10.120051], [-0.820255, 10.12028], [-0.820486, 10.120415], [-0.821065, 10.120512], [-0.821298, 10.120644], [-0.821509, 10.120923], [-0.821721, 10.121201], [-0.821818, 10.12143], [-0.821886, 10.121535], [-0.821954, 10.12164], [-0.822032, 10.121871], [-0.822128, 10.122311], [-0.822223, 10.122751], [-0.822165, 10.122963], [-0.822183, 10.123146], [-0.822108, 10.123671], [-0.82203, 10.124213], [-0.82196, 10.124702], [-0.821919, 10.124936], [-0.821723, 10.125192], [-0.821526, 10.125449], [-0.821295, 10.125584], [-0.820986, 10.125889], [-0.820753, 10.126063], [-0.820522, 10.126099], [-0.820174, 10.126043], [-0.819479, 10.126043], [-0.819362, 10.126004], [-0.819014, 10.125773], [-0.818822, 10.125544], [-0.818585, 10.125363], [-0.818314, 10.125171], [-0.818049, 10.125218], [-0.817838, 10.125392], [-0.817754, 10.125542], [-0.81755, 10.125912], [-0.817484, 10.126029], [-0.81747, 10.126159], [-0.817455, 10.126288], [-0.817425, 10.126546], [-0.817504, 10.127098], [-0.817544, 10.127373], [-0.817583, 10.127649], [-0.817542, 10.1279], [-0.817438, 10.128167], [-0.817321, 10.128741], [-0.817296, 10.128864], [-0.817226, 10.129033], [-0.817012, 10.129552], [-0.8168, 10.130063], [-0.816683, 10.130272], [-0.81653, 10.130846], [-0.816393, 10.131171], [-0.816007, 10.131773], [-0.815819, 10.132065], [-0.815525, 10.132524], [-0.814915, 10.133582], [-0.814479, 10.134295], [-0.814043, 10.135009], [-0.814074, 10.135152], [-0.813996, 10.135114], [-0.813879, 10.135287], [-0.813801, 10.135516], [-0.813609, 10.135841], [-0.813443, 10.136321], [-0.813105, 10.137296], [-0.813049, 10.137641], [-0.812825, 10.138188], [-0.81261, 10.138714], [-0.812408, 10.139209], [-0.812216, 10.139495], [-0.812024, 10.139782], [-0.811663, 10.140139], [-0.811335, 10.140464], [-0.810994, 10.140801], [-0.810351, 10.141793], [-0.810187, 10.141887], [-0.810109, 10.142002], [-0.810031, 10.142118], [-0.809992, 10.142289], [-0.809858, 10.142424], [-0.809741, 10.142768], [-0.809596, 10.142989], [-0.809451, 10.143209], [-0.809276, 10.143554], [-0.80919, 10.143658], [-0.809103, 10.143763], [-0.809045, 10.143879], [-0.808852, 10.144452], [-0.808716, 10.144661], [-0.808426, 10.145695], [-0.808377, 10.145791], [-0.808078, 10.146786], [-0.807986, 10.146877], [-0.807691, 10.147475], [-0.807535, 10.147687], [-0.807362, 10.148031], [-0.807323, 10.14826], [-0.807234, 10.148464], [-0.807093, 10.148986], [-0.806952, 10.149509], [-0.806763, 10.150269], [-0.806714, 10.150384], [-0.806665, 10.150498], [-0.806263, 10.151156], [-0.806116, 10.151396], [-0.805849, 10.15238], [-0.805481, 10.153108], [-0.805379, 10.153533], [-0.805264, 10.15401], [-0.80518, 10.154359], [-0.804748, 10.154824], [-0.804053, 10.155281], [-0.803863, 10.155331], [-0.803489, 10.155573], [-0.803384, 10.155573], [-0.802894, 10.155627], [-0.802778, 10.155644], [-0.802199, 10.155856], [-0.801966, 10.155969], [-0.801752, 10.156112], [-0.801662, 10.15621], [-0.801493, 10.156432], [-0.801388, 10.156573], [-0.801234, 10.156677], [-0.801117, 10.156706], [-0.801, 10.156735], [-0.800769, 10.156659], [-0.80055, 10.156582], [-0.800304, 10.156583], [-0.80019, 10.156544], [-0.799814, 10.156319], [-0.799547, 10.156057], [-0.799156, 10.155615], [-0.799089, 10.15551], [-0.798992, 10.155278], [-0.798896, 10.154678], [-0.798867, 10.154581], [-0.798742, 10.154151], [-0.798684, 10.154035], [-0.798684, 10.153919], [-0.798606, 10.15369], [-0.798579, 10.153474], [-0.798454, 10.152486], [-0.798454, 10.152122], [-0.798455, 10.151758], [-0.798221, 10.151069], [-0.797816, 10.150399], [-0.797768, 10.150236], [-0.797721, 10.150074], [-0.797722, 10.149662], [-0.797836, 10.149211], [-0.797972, 10.149346], [-0.798089, 10.149575], [-0.798164, 10.149633], [-0.798359, 10.149672], [-0.798417, 10.149556], [-0.798398, 10.149327], [-0.798262, 10.148982], [-0.798184, 10.148886], [-0.797962, 10.148224], [-0.797659, 10.147856], [-0.797244, 10.147566], [-0.796873, 10.147043], [-0.795732, 10.145993], [-0.795501, 10.145861], [-0.795205, 10.145801], [-0.794659, 10.145691], [-0.794113, 10.145581], [-0.793863, 10.145566], [-0.793665, 10.145554], [-0.793376, 10.145592], [-0.793203, 10.145705], [-0.793135, 10.145821], [-0.793067, 10.145936], [-0.793047, 10.146049], [-0.793064, 10.146335], [-0.793124, 10.147389], [-0.793056, 10.14811], [-0.793029, 10.148395], [-0.792824, 10.148767], [-0.79262, 10.149139], [-0.792234, 10.149394], [-0.791849, 10.149648], [-0.791732, 10.149687], [-0.790978, 10.150184], [-0.790223, 10.150681], [-0.790081, 10.150821], [-0.789824, 10.151076], [-0.789566, 10.151331], [-0.789335, 10.151521], [-0.789141, 10.151752], [-0.788793, 10.152], [-0.788562, 10.152097], [-0.787866, 10.152096], [-0.787291, 10.151952], [-0.78694, 10.151864], [-0.786637, 10.151665], [-0.786228, 10.151325], [-0.785819, 10.150984], [-0.785472, 10.150755], [-0.785124, 10.150465], [-0.784908, 10.150262], [-0.784699, 10.150065], [-0.784299, 10.149569], [-0.78435, 10.149266], [-0.784392, 10.149032], [-0.784443, 10.148744], [-0.784494, 10.148456], [-0.784747, 10.148133], [-0.785001, 10.147811], [-0.785243, 10.147654], [-0.785474, 10.147577], [-0.785589, 10.147567], [-0.785705, 10.147558], [-0.786053, 10.147384], [-0.786286, 10.147233], [-0.786479, 10.147021], [-0.786584, 10.146792], [-0.78669, 10.146563], [-0.786766, 10.146307], [-0.786507, 10.145797], [-0.786329, 10.145678], [-0.785648, 10.144953], [-0.785437, 10.144782], [-0.78509, 10.144131], [-0.784703, 10.14321], [-0.784531, 10.142637], [-0.784493, 10.142408], [-0.784395, 10.142196], [-0.784203, 10.142044], [-0.78397, 10.141967], [-0.783796, 10.141938], [-0.783622, 10.141909], [-0.783391, 10.141909], [-0.782927, 10.141985], [-0.782612, 10.142089], [-0.782298, 10.142192], [-0.781824, 10.142864], [-0.78171, 10.143095], [-0.781237, 10.14371], [-0.781173, 10.1439], [-0.781109, 10.14409], [-0.780994, 10.144319], [-0.780838, 10.144531], [-0.780685, 10.144875], [-0.780627, 10.145104], [-0.780451, 10.145545], [-0.780399, 10.145774], [-0.780348, 10.146002], [-0.780316, 10.146216], [-0.780091, 10.147725], [-0.779929, 10.148282], [-0.77987, 10.148616], [-0.779812, 10.148951], [-0.779807, 10.149364], [-0.779791, 10.150635], [-0.779846, 10.15105], [-0.779902, 10.151465], [-0.779946, 10.151592], [-0.779965, 10.15214], [-0.779991, 10.152923], [-0.780003, 10.153295], [-0.780039, 10.153527], [-0.780098, 10.153659], [-0.78054, 10.153751], [-0.780514, 10.153906], [-0.780679, 10.154004], [-0.780851, 10.154578], [-0.780968, 10.154809], [-0.780977, 10.15501], [-0.780987, 10.155212], [-0.780804, 10.155507], [-0.780639, 10.155708], [-0.780608, 10.155818], [-0.780271, 10.156245], [-0.780127, 10.156407], [-0.779982, 10.15657], [-0.779748, 10.156721], [-0.779427, 10.156748], [-0.778816, 10.156783], [-0.778387, 10.156807], [-0.778184, 10.156797], [-0.777778, 10.156508], [-0.777701, 10.156453], [-0.777334, 10.156011], [-0.7772, 10.155782], [-0.777006, 10.155609], [-0.776628, 10.155027], [-0.776525, 10.15452], [-0.776477, 10.154404], [-0.776428, 10.154288], [-0.776253, 10.154098], [-0.775925, 10.15383], [-0.775713, 10.153714], [-0.775482, 10.153637], [-0.775018, 10.153617], [-0.774787, 10.153694], [-0.774096, 10.154354], [-0.773838, 10.1546], [-0.773582, 10.154768], [-0.773326, 10.154936], [-0.772459, 10.155381], [-0.771592, 10.155825], [-0.771367, 10.155994], [-0.771008, 10.156265], [-0.770206, 10.156869], [-0.769947, 10.157065], [-0.769506, 10.157311], [-0.769064, 10.157557], [-0.768485, 10.157921], [-0.767325, 10.158686], [-0.766927, 10.159017], [-0.766629, 10.159391], [-0.766473, 10.159736], [-0.766436, 10.159967], [-0.766358, 10.160177], [-0.766347, 10.160593], [-0.766335, 10.161009], [-0.766283, 10.161166], [-0.76612, 10.162487], [-0.766067, 10.162704], [-0.76585, 10.163051], [-0.765722, 10.163255], [-0.765354, 10.163842], [-0.765058, 10.164164], [-0.764761, 10.164486], [-0.764566, 10.164776], [-0.764282, 10.164974], [-0.763998, 10.165172], [-0.763881, 10.165162], [-0.763765, 10.165153], [-0.763359, 10.16497], [-0.762791, 10.164532], [-0.762658, 10.164372], [-0.762524, 10.164212], [-0.762356, 10.163756], [-0.76228, 10.163313], [-0.762231, 10.162925], [-0.761816, 10.162356], [-0.761586, 10.162241], [-0.761469, 10.162144], [-0.761242, 10.16207], [-0.761121, 10.162031], [-0.760947, 10.161992], [-0.760773, 10.161953], [-0.760426, 10.161953], [-0.760195, 10.161914], [-0.759963, 10.161838], [-0.75973, 10.161762], [-0.759499, 10.161646], [-0.759035, 10.161263], [-0.75861, 10.160822], [-0.758145, 10.160496], [-0.757915, 10.160419], [-0.757033, 10.160299], [-0.756659, 10.160323], [-0.756184, 10.160354], [-0.755222, 10.160687], [-0.754554, 10.160686], [-0.753858, 10.16057], [-0.753342, 10.160532], [-0.752903, 10.160464], [-0.750092, 10.159366], [-0.74976, 10.159568], [-0.749471, 10.159809], [-0.7489, 10.160175], [-0.748623, 10.160326], [-0.748346, 10.160478], [-0.747901, 10.160783], [-0.747615, 10.161187], [-0.74733, 10.16159], [-0.747277, 10.161849], [-0.747224, 10.162108], [-0.747315, 10.162685], [-0.747746, 10.163462], [-0.748021, 10.164072], [-0.748066, 10.1643], [-0.748112, 10.164529], [-0.748112, 10.164987], [-0.747989, 10.165519], [-0.747766, 10.165699], [-0.74733, 10.166051], [-0.747065, 10.166265], [-0.74671, 10.166675], [-0.746569, 10.166838], [-0.74632, 10.166949], [-0.745379, 10.167241], [-0.744969, 10.167369], [-0.744646, 10.167338], [-0.744193, 10.167041], [-0.74374, 10.166745], [-0.743339, 10.166576], [-0.742968, 10.166259], [-0.74237, 10.165747], [-0.742233, 10.16563], [-0.741971, 10.165478], [-0.741513, 10.165097], [-0.74141, 10.164983], [-0.741021, 10.164548], [-0.740437, 10.164168], [-0.739931, 10.163922], [-0.739483, 10.163662], [-0.738984, 10.163566], [-0.738412, 10.163455], [-0.737763, 10.163257], [-0.737458, 10.163121], [-0.737105, 10.162861], [-0.73683, 10.162434], [-0.73646, 10.1621], [-0.736246, 10.161565], [-0.735893, 10.161215], [-0.735608, 10.160986], [-0.735323, 10.160757], [-0.734929, 10.160523], [-0.734556, 10.160301], [-0.733941, 10.160042], [-0.733435, 10.159964], [-0.733127, 10.160025], [-0.73282, 10.160085], [-0.732528, 10.16033], [-0.732174, 10.160862], [-0.731789, 10.161669], [-0.73165, 10.16208], [-0.73168, 10.162217], [-0.731911, 10.162612], [-0.732179, 10.162826], [-0.732447, 10.163039], [-0.732756, 10.163131], [-0.733184, 10.16339], [-0.733599, 10.163528], [-0.73403, 10.163636], [-0.734277, 10.163802], [-0.734644, 10.164152], [-0.734911, 10.164468], [-0.735275, 10.164899], [-0.735667, 10.165258], [-0.736059, 10.165617], [-0.736457, 10.165876], [-0.736857, 10.16632], [-0.737071, 10.16661], [-0.737193, 10.16728], [-0.73687, 10.168043], [-0.736725, 10.168258], [-0.736328, 10.168416], [-0.735932, 10.168574], [-0.735362, 10.169122], [-0.734793, 10.16967], [-0.734208, 10.17002], [-0.733732, 10.170339], [-0.73344, 10.170506], [-0.733148, 10.170672], [-0.732856, 10.170687], [-0.732564, 10.170702], [-0.731888, 10.170611], [-0.731512, 10.170516], [-0.730967, 10.170381], [-0.730074, 10.169939], [-0.729337, 10.169509], [-0.729123, 10.169376], [-0.728763, 10.169238], [-0.728403, 10.1691], [-0.72789, 10.168973], [-0.727133, 10.168785], [-0.726987, 10.168749], [-0.726738, 10.168646], [-0.725838, 10.168276], [-0.725485, 10.168155], [-0.725224, 10.168155], [-0.72484, 10.168367], [-0.724578, 10.168679], [-0.724316, 10.168992], [-0.724085, 10.169083], [-0.723854, 10.169173], [-0.723409, 10.169187], [-0.722947, 10.169035], [-0.72238, 10.168974], [-0.722178, 10.168947], [-0.721597, 10.16887], [-0.721227, 10.168882], [-0.720873, 10.168774], [-0.720464, 10.168458], [-0.720183, 10.168241], [-0.720075, 10.168127], [-0.719966, 10.168012], [-0.71943, 10.167753], [-0.719268, 10.167623], [-0.719107, 10.167493], [-0.718571, 10.166931], [-0.718408, 10.166778], [-0.718246, 10.166624], [-0.717839, 10.166457], [-0.717433, 10.16629], [-0.71708, 10.166114], [-0.716775, 10.165807], [-0.716422, 10.165336], [-0.716192, 10.165132], [-0.715974, 10.164938], [-0.715629, 10.164771], [-0.715284, 10.164604], [-0.714501, 10.164489], [-0.714024, 10.164419], [-0.713565, 10.164297], [-0.713196, 10.164037], [-0.712856, 10.163687], [-0.71269, 10.163428], [-0.712581, 10.163352], [-0.712473, 10.163276], [-0.71215, 10.163124], [-0.711967, 10.163259], [-0.711622, 10.162972], [-0.711296, 10.163699], [-0.711525, 10.16404], [-0.711983, 10.16423], [-0.712632, 10.164836], [-0.712814, 10.165476], [-0.713127, 10.166577], [-0.713279, 10.167864], [-0.713812, 10.169037], [-0.714575, 10.169908], [-0.715224, 10.170666], [-0.715367, 10.171433], [-0.715261, 10.172104], [-0.714817, 10.172182], [-0.714154, 10.171838], [-0.713925, 10.171497], [-0.713505, 10.171421], [-0.712855, 10.172064], [-0.712701, 10.172556], [-0.712355, 10.174977], [-0.713042, 10.176], [-0.713768, 10.176379], [-0.71457, 10.17619], [-0.715258, 10.175888], [-0.715525, 10.175472], [-0.715907, 10.175435], [-0.716824, 10.175587], [-0.717168, 10.175928], [-0.71797, 10.176155], [-0.718311, 10.176403], [-0.718631, 10.176634], [-0.718847, 10.177216], [-0.71877, 10.177973], [-0.718617, 10.178313], [-0.718255, 10.178965], [-0.71799, 10.179314], [-0.717758, 10.179488], [-0.717449, 10.179813], [-0.717046, 10.18011], [-0.716425, 10.180308], [-0.716191, 10.180443], [-0.71596, 10.180633], [-0.715489, 10.18133], [-0.714935, 10.181916], [-0.714802, 10.182002], [-0.714406, 10.182495], [-0.714356, 10.182643], [-0.7142, 10.182872], [-0.713735, 10.183178], [-0.713137, 10.183351], [-0.712906, 10.183483], [-0.712616, 10.183808], [-0.712382, 10.184001], [-0.712151, 10.184094], [-0.711647, 10.184171], [-0.711532, 10.184229], [-0.711071, 10.184462], [-0.710732, 10.18421], [-0.71081, 10.184046], [-0.710941, 10.183914], [-0.711331, 10.183432], [-0.711456, 10.183087], [-0.711713, 10.1826], [-0.711784, 10.182346], [-0.711855, 10.182093], [-0.711867, 10.181456], [-0.711745, 10.180737], [-0.711631, 10.18037], [-0.711632, 10.180056], [-0.711376, 10.179369], [-0.710988, 10.177947], [-0.710926, 10.17786], [-0.710752, 10.177613], [-0.710604, 10.177537], [-0.710354, 10.177409], [-0.710262, 10.177394], [-0.709532, 10.177294], [-0.709236, 10.177184], [-0.708827, 10.177165], [-0.708173, 10.177214], [-0.707363, 10.177425], [-0.70727, 10.177443], [-0.706779, 10.177538], [-0.705866, 10.17781], [-0.704671, 10.178282], [-0.703859, 10.178505], [-0.702908, 10.178717], [-0.701778, 10.179041], [-0.701193, 10.179324], [-0.70064, 10.179417], [-0.700222, 10.179585], [-0.699393, 10.179857], [-0.698694, 10.180212], [-0.698585, 10.180283], [-0.698274, 10.180487], [-0.697934, 10.180873], [-0.697608, 10.181308], [-0.697279, 10.181826], [-0.696973, 10.182507], [-0.69659, 10.183603], [-0.696332, 10.184256], [-0.696066, 10.185279], [-0.69577, 10.186025], [-0.695636, 10.186645], [-0.695554, 10.186837], [-0.695154, 10.187772], [-0.694488, 10.18848], [-0.694236, 10.188531], [-0.693984, 10.188581], [-0.693328, 10.188641], [-0.69302, 10.188641], [-0.692713, 10.188641], [-0.692251, 10.188388], [-0.69216, 10.188031], [-0.69209, 10.187637], [-0.692224, 10.187036], [-0.692225, 10.186529], [-0.692367, 10.186105], [-0.692799, 10.185413], [-0.692861, 10.185201], [-0.692849, 10.185116], [-0.692811, 10.184826], [-0.692647, 10.184468], [-0.691911, 10.183704], [-0.691243, 10.182953], [-0.690568, 10.182454], [-0.689964, 10.182222], [-0.689472, 10.182149], [-0.689216, 10.18218], [-0.688962, 10.182209], [-0.687446, 10.182821], [-0.686982, 10.18314], [-0.686683, 10.183346], [-0.686304, 10.183709], [-0.685914, 10.184037], [-0.685524, 10.184524], [-0.685352, 10.184979], [-0.685264, 10.185856], [-0.684498, 10.187605], [-0.684313, 10.188203], [-0.68416, 10.188611], [-0.683728, 10.189401], [-0.683564, 10.189573], [-0.683154, 10.189787], [-0.682898, 10.189786], [-0.682821, 10.189736], [-0.682467, 10.18951], [-0.682212, 10.189108], [-0.68204, 10.188683], [-0.68195, 10.186765], [-0.681953, 10.186685], [-0.68197, 10.186164], [-0.681868, 10.185565], [-0.681826, 10.185017], [-0.681941, 10.184295], [-0.682198, 10.183725], [-0.682259, 10.183342], [-0.68226, 10.182426], [-0.682127, 10.181847], [-0.681883, 10.181442], [-0.681646, 10.181238], [-0.681413, 10.180923], [-0.681085, 10.180741], [-0.680888, 10.180696], [-0.680501, 10.180608], [-0.680287, 10.180567], [-0.679967, 10.18058], [-0.679588, 10.180982], [-0.679428, 10.181084], [-0.679184, 10.181239], [-0.678752, 10.181498], [-0.678622, 10.181568], [-0.677849, 10.181981], [-0.677394, 10.182224], [-0.676436, 10.182456], [-0.676047, 10.182498], [-0.675265, 10.182569], [-0.674247, 10.182468], [-0.673583, 10.182286], [-0.673496, 10.182238], [-0.672796, 10.181852], [-0.672459, 10.181598], [-0.671536, 10.181013], [-0.671383, 10.180916], [-0.671183, 10.180866], [-0.670165, 10.180612], [-0.669681, 10.180379], [-0.669486, 10.180286], [-0.668874, 10.180052], [-0.668805, 10.179963], [-0.668608, 10.179714], [-0.668157, 10.179562], [-0.667726, 10.179603], [-0.667345, 10.179563], [-0.666744, 10.179663], [-0.657869, 10.192005], [-0.652057, 10.191726], [-0.652762, 10.180707], [-0.643523, 10.190187], [-0.624535, 10.172969], [-0.625634, 10.165545], [-0.599125, 10.160252], [-0.54761, 10.210545], [-0.541114, 10.225767], [-0.546688, 10.247995], [-0.534315, 10.267168], [-0.521948, 10.234023], [-0.514004, 10.248281], [-0.509636, 10.236712], [-0.499011, 10.237463], [-0.510741, 10.252719], [-0.501278, 10.259033], [-0.505164, 10.270712], [-0.497724, 10.271417], [-0.50573, 10.307893], [-0.50446, 10.317972], [-0.483972, 10.327499], [-0.45536, 10.301713], [-0.385911, 10.297971], [-0.359496, 10.261743], [-0.354625, 10.273928], [-0.315726, 10.290812], [-0.295553, 10.291435], [-0.269447, 10.276269], [-0.238312, 10.287894], [-0.203016, 10.265852], [-0.195347, 10.276703], [-0.166152, 10.281097], [-0.152055, 10.294744], [-0.131129, 10.292046], [-0.094035, 10.269461], [-0.088235, 10.295075], [-0.072119, 10.295112], [-0.024809, 10.271265], [-0.027786, 10.316274], [-0.019012, 10.32863], [-0.006766, 10.330571], [0.048954, 10.342733], [0.056223, 10.307263], [0.058051, 10.293968], [0.073711, 10.295157], [0.077402, 10.288413], [0.090998, 10.243519], [0.076321, 10.228352], [0.085311, 10.21419], [0.066022, 10.200951], [0.060893, 10.180166], [0.11131, 10.131053], [0.105875, 10.118711], [0.124416, 10.038886], [0.109475, 10.005105], [0.063697, 9.999699], [0.071648, 9.966399], [0.127076, 9.971758], [0.130048, 9.95676], [0.155428, 9.986147], [0.183746, 9.979656], [0.189725, 9.966539], [0.233533, 9.956312], [0.259063, 9.963857], [0.263003, 9.959011], [0.276476, 9.974097], [0.303835, 9.977198], [0.310956, 9.959961], [0.324475, 9.963147], [0.325023, 9.944061], [0.346921, 9.938538], [0.353392, 9.947693], [0.365681, 9.932211], [0.356635, 9.925674], [0.351367, 9.904208], [0.358127, 9.84855], [0.331454, 9.798838], [0.335426, 9.778645], [0.325341, 9.773613], [0.329841, 9.75883], [0.318642, 9.727781], [0.345834, 9.714511], [0.350561, 9.675909], [0.363178, 9.673477], [0.369124, 9.652251], [0.382013, 9.644966], [0.37264, 9.608196], [0.382872, 9.591655], [0.351802, 9.572708], [0.334417, 9.579276], [0.289529, 9.577144], [0.265712, 9.567394], [0.23955, 9.574469], [0.23456, 9.548105], [0.242977, 9.524053], [0.255148, 9.518856], [0.290033, 9.52367], [0.310566, 9.506541], [0.267024, 9.478986], [0.228965, 9.48726], [0.228673, 9.463136], [0.246926, 9.438312], [0.275879, 9.42744], [0.331451, 9.448358], [0.346948, 9.47402], [0.343681, 9.488296], [0.359612, 9.499227], [0.389438, 9.491636], [0.415635, 9.50253], [0.445943, 9.50154], [0.50305, 9.475309], [0.503957, 9.458022], [0.495072, 9.451902], [0.500626, 9.437474], [0.519549, 9.43978], [0.524475, 9.431597], [0.5533, 9.423802], [0.566575, 9.405645], [0.563111, 9.354533], [0.552743, 9.345703], [0.562977, 9.324502], [0.559762, 9.305785], [0.539667, 9.30636], [0.507936, 9.254637], [0.518879, 9.229328], [0.539039, 9.213586], [0.503033, 9.153939], [0.476903, 9.144357], [0.485889, 9.098707], [0.478467, 9.099264], [0.45936, 9.072464], [0.462568, 9.055312], [0.456274, 9.055185], [0.455452, 9.035644], [0.463104, 9.034127], [0.494147, 8.957335], [0.514689, 8.935493], [0.512245, 8.902629], [0.527492, 8.878698], [0.517162, 8.864208], [0.520661, 8.854696], [0.508856, 8.855506], [0.496201, 8.840192], [0.500206, 8.814331], [0.490407, 8.800112], [0.47236, 8.799708], [0.468665, 8.792163], [0.458637, 8.810631], [0.447799, 8.810881], [0.430184, 8.796159], [0.439865, 8.785615], [0.425621, 8.779979], [0.421189, 8.79137], [0.381736, 8.793453], [0.378859, 8.771823], [0.401278, 8.757912], [0.374208, 8.754658], [0.383491, 8.740669], [0.374244, 8.735698], [0.346325, 8.740982], [0.358147, 8.718598], [0.314596, 8.734513], [0.300704, 8.726225], [0.297897, 8.742504], [0.281832, 8.724077], [0.258708, 8.746985], [0.244011, 8.740808], [0.231601, 8.753481], [0.214276, 8.755087], [0.199601, 8.744349], [0.18699, 8.747185], [0.185576, 8.740805], [0.180894, 8.761872], [0.170925, 8.764734], [0.17468, 8.770642], [0.168398, 8.774512], [0.165354, 8.756185], [0.181275, 8.712834], [0.138934, 8.669214], [0.135868, 8.653574], [0.146894, 8.629679], [0.169851, 8.61589], [0.170925, 8.596077], [0.147983, 8.588592], [0.128111, 8.605082], [0.111968, 8.596869], [0.082824, 8.525883] ] ] ] } }, { "name": "Ashanti", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-1.205839, 6.115797], [-1.190139, 6.109787], [-1.18757, 6.096377], [-1.204822, 6.091001], [-1.198343, 6.082578], [-1.214628, 6.067807], [-1.208266, 6.05274], [-1.231253, 6.03878], [-1.227414, 6.018733], [-1.242085, 6.010041], [-1.246869, 5.990978], [-1.221831, 5.973904], [-1.224714, 5.945917], [-1.21885, 5.94241], [-1.224692, 5.935485], [-1.242622, 5.932101], [-1.244197, 5.913646], [-1.260892, 5.915411], [-1.262443, 5.890881], [-1.275177, 5.902976], [-1.298047, 5.885703], [-1.308434, 5.890081], [-1.308939, 5.926477], [-1.323034, 5.914217], [-1.342522, 5.910897], [-1.335651, 5.926588], [-1.347404, 5.91938], [-1.353911, 5.934205], [-1.377017, 5.934595], [-1.380259, 5.916387], [-1.418745, 5.921487], [-1.421452, 5.903408], [-1.428725, 5.909876], [-1.437085, 5.901392], [-1.45069, 5.906382], [-1.456434, 5.893679], [-1.466954, 5.904287], [-1.459156, 5.886642], [-1.461735, 5.862288], [-1.475885, 5.855117], [-1.482854, 5.867076], [-1.501031, 5.868212], [-1.500678, 5.877032], [-1.521765, 5.875182], [-1.516584, 5.890062], [-1.498019, 5.891499], [-1.505458, 5.89512], [-1.500495, 5.905507], [-1.516364, 5.914025], [-1.520695, 5.928462], [-1.530854, 5.923194], [-1.528775, 5.937807], [-1.546023, 5.939171], [-1.53965, 5.931139], [-1.556572, 5.92639], [-1.567786, 5.925845], [-1.571889, 5.933134], [-1.581059, 5.917681], [-1.589966, 5.935002], [-1.59571, 5.923999], [-1.638957, 5.933727], [-1.672469, 5.915377], [-1.693421, 5.933694], [-1.692712, 5.943412], [-1.70725, 5.929315], [-1.713249, 5.957244], [-1.724838, 5.952929], [-1.739168, 5.970552], [-1.749619, 5.968982], [-1.748694, 5.959962], [-1.76407, 5.969768], [-1.77044, 5.960963], [-1.774362, 5.979774], [-1.792509, 5.990295], [-1.797872, 5.999784], [-1.802886, 5.992805], [-1.813096, 6.011397], [-1.804074, 6.029296], [-1.823604, 6.029928], [-1.821718, 6.03929], [-1.838226, 6.035816], [-1.848154, 6.029229], [-1.851377, 6.01414], [-1.861237, 6.016651], [-1.867411, 6.009456], [-1.883063, 6.033766], [-1.892042, 6.015051], [-1.913011, 6.011198], [-1.924813, 6.035323], [-1.934347, 6.036878], [-1.949869, 6.05709], [-1.952515, 6.049127], [-1.960743, 6.058545], [-1.968128, 6.052448], [-1.975461, 6.091844], [-1.988083, 6.104728], [-1.97903, 6.116167], [-1.990438, 6.124851], [-1.997437, 6.116194], [-2.007172, 6.117529], [-2.00689, 6.110997], [-2.014342, 6.113302], [-2.025907, 6.140971], [-2.01942, 6.152425], [-2.022608, 6.173295], [-2.040409, 6.197933], [-2.021506, 6.223835], [-2.023368, 6.255373], [-2.009525, 6.291673], [-2.045212, 6.28449], [-2.074265, 6.294526], [-2.099372, 6.309325], [-2.124088, 6.301267], [-2.124657, 6.336818], [-2.172694, 6.364933], [-2.200068, 6.354553], [-2.22713, 6.320026], [-2.21542, 6.363817], [-2.239948, 6.472205], [-2.262643, 6.491183], [-2.29356, 6.49167], [-2.304143, 6.483584], [-2.337392, 6.493322], [-2.343645, 6.482423], [-2.360011, 6.477266], [-2.348977, 6.455434], [-2.35517, 6.447549], [-2.344032, 6.433745], [-2.35114, 6.395188], [-2.378259, 6.349364], [-2.389922, 6.346523], [-2.389832, 6.334313], [-2.399565, 6.341741], [-2.397483, 6.351653], [-2.420655, 6.347432], [-2.430552, 6.355223], [-2.420727, 6.40468], [-2.428813, 6.417146], [-2.440636, 6.417049], [-2.439149, 6.428209], [-2.451421, 6.431602], [-2.438673, 6.43929], [-2.446124, 6.443109], [-2.442436, 6.457693], [-2.431397, 6.464106], [-2.43077, 6.473303], [-2.42146, 6.473262], [-2.423663, 6.492436], [-2.414007, 6.490098], [-2.403794, 6.508153], [-2.397247, 6.503005], [-2.397278, 6.521361], [-2.386156, 6.523211], [-2.374867, 6.538856], [-2.385604, 6.568045], [-2.371149, 6.592207], [-2.383911, 6.598069], [-2.383494, 6.610762], [-2.394727, 6.612037], [-2.392347, 6.624392], [-2.40294, 6.634936], [-2.395295, 6.648231], [-2.412845, 6.650798], [-2.415019, 6.658897], [-2.372276, 6.67163], [-2.363847, 6.688617], [-2.346766, 6.699376], [-2.306407, 6.687164], [-2.293106, 6.704274], [-2.285992, 6.70694], [-2.289268, 6.715846], [-2.278233, 6.729547], [-2.264463, 6.778158], [-2.258029, 6.790715], [-2.26608, 6.798716], [-2.297225, 6.797224], [-2.305304, 6.811668], [-2.3197, 6.801237], [-2.334626, 6.803926], [-2.345084, 6.815989], [-2.333709, 6.830752], [-2.34528, 6.844156], [-2.375908, 6.839159], [-2.400929, 6.819285], [-2.417816, 6.823474], [-2.416583, 6.831627], [-2.4086, 6.841639], [-2.3983, 6.839206], [-2.398378, 6.854313], [-2.386812, 6.855669], [-2.388741, 6.867942], [-2.374706, 6.878977], [-2.376476, 6.885871], [-2.339109, 6.908784], [-2.331537, 6.928828], [-2.289035, 6.945703], [-2.226944, 7.007529], [-2.185334, 7.036282], [-2.178841, 7.032691], [-2.185685, 7.025435], [-2.182419, 7.016806], [-2.150263, 7.039632], [-2.139935, 7.041617], [-2.135278, 7.0283], [-2.137676, 7.020488], [-2.121025, 7.002178], [-2.097296, 7.007236], [-2.081316, 7.027646], [-2.061927, 7.039118], [-2.038354, 7.040205], [-1.995006, 7.079236], [-1.967047, 7.089937], [-1.953618, 7.085284], [-1.932514, 7.130131], [-1.932954, 7.176627], [-1.868949, 7.203249], [-1.827211, 7.258516], [-1.835657, 7.259604], [-1.843458, 7.27508], [-1.859679, 7.278161], [-1.912212, 7.25351], [-1.927253, 7.264845], [-1.949882, 7.261533], [-1.962121, 7.293487], [-1.98842, 7.298118], [-2.001452, 7.316992], [-2.046985, 7.305604], [-2.064946, 7.319556], [-2.0763, 7.323203], [-2.135567, 7.395534], [-2.14085, 7.409149], [-2.126807, 7.419107], [-2.127823, 7.431811], [-2.114133, 7.442479], [-2.109671, 7.463647], [-2.074578, 7.455178], [-2.038008, 7.457093], [-2.018473, 7.421501], [-1.964465, 7.408111], [-1.927076, 7.442609], [-1.897957, 7.430497], [-1.863479, 7.476967], [-1.856428, 7.46125], [-1.836011, 7.471019], [-1.839935, 7.425105], [-1.807235, 7.348533], [-1.779353, 7.35099], [-1.761463, 7.322028], [-1.739725, 7.320704], [-1.728491, 7.311823], [-1.710966, 7.324308], [-1.678746, 7.324815], [-1.654163, 7.313588], [-1.640921, 7.325163], [-1.640968, 7.336116], [-1.625132, 7.339156], [-1.57661, 7.40288], [-1.526142, 7.399034], [-1.51555, 7.390943], [-1.509614, 7.42918], [-1.520243, 7.450079], [-1.472449, 7.49661], [-1.424837, 7.58188], [-1.386071, 7.605147], [-1.353366, 7.609166], [-1.343902, 7.619401], [-1.316188, 7.624742], [-1.309718, 7.618407], [-1.317195, 7.610658], [-1.313566, 7.580673], [-1.299528, 7.571231], [-1.290431, 7.535196], [-1.266441, 7.521543], [-1.249916, 7.496205], [-1.23946, 7.489329], [-1.202901, 7.495455], [-1.181307, 7.481452], [-1.157092, 7.47976], [-1.155513, 7.469036], [-1.145002, 7.470059], [-1.126019, 7.477082], [-1.104862, 7.464884], [-1.083796, 7.487733], [-1.070154, 7.49106], [-1.068447, 7.501641], [-1.052599, 7.508629], [-1.040813, 7.527553], [-1.014846, 7.534862], [-1.002301, 7.528205], [-0.983499, 7.534707], [-0.972122, 7.519677], [-0.953188, 7.523524], [-0.925223, 7.503765], [-0.89317, 7.504294], [-0.889943, 7.516582], [-0.867158, 7.520714], [-0.863956, 7.5147], [-0.84506, 7.518391], [-0.843682, 7.509756], [-0.828353, 7.512259], [-0.820403, 7.499539], [-0.808858, 7.511019], [-0.807665, 7.502597], [-0.795762, 7.498897], [-0.77678, 7.506099], [-0.747675, 7.509304], [-0.732137, 7.522472], [-0.720945, 7.519886], [-0.689133, 7.541495], [-0.683587, 7.524904], [-0.67693, 7.529034], [-0.650042, 7.502031], [-0.654182, 7.430788], [-0.598681, 7.348628], [-0.540942, 7.354552], [-0.381889, 7.31286], [-0.355032, 7.308798], [-0.354228, 7.297647], [-0.329865, 7.29094], [-0.324436, 7.281094], [-0.31099, 7.285705], [-0.30224, 7.277728], [-0.288849, 7.284389], [-0.261806, 7.266811], [-0.256652, 7.228333], [-0.242494, 7.222036], [-0.238718, 7.202353], [-0.26016, 7.189558], [-0.28717, 7.194743], [-0.2881, 7.184184], [-0.306414, 7.178258], [-0.300277, 7.17208], [-0.321774, 7.144141], [-0.387811, 7.117927], [-0.461406, 7.128405], [-0.494683, 7.124843], [-0.541845, 7.139028], [-0.561246, 7.137514], [-0.582842, 7.150601], [-0.609566, 7.153651], [-0.635406, 7.173942], [-0.591008, 7.044483], [-0.564716, 7.01869], [-0.574133, 6.963308], [-0.585315, 6.950921], [-0.65756, 6.947238], [-0.65229, 6.92953], [-0.722781, 6.952355], [-0.741967, 6.948934], [-0.753255, 6.938118], [-0.755719, 6.915645], [-0.755427, 6.866928], [-0.757236, 6.844896], [-0.792792, 6.789879], [-0.833687, 6.793454], [-0.852759, 6.777972], [-0.882728, 6.778484], [-0.901232, 6.788369], [-0.93251, 6.756299], [-0.956487, 6.75397], [-0.960917, 6.746226], [-0.982063, 6.749064], [-0.98596, 6.74329], [-0.979487, 6.739613], [-0.950207, 6.735201], [-0.947821, 6.7188], [-0.956782, 6.699062], [-0.973645, 6.680601], [-0.972531, 6.64565], [-0.974865, 6.613242], [-0.94509, 6.627022], [-0.945468, 6.639115], [-0.923611, 6.6409], [-0.910183, 6.610493], [-0.911451, 6.598913], [-0.956554, 6.559429], [-0.966213, 6.539974], [-1.005957, 6.487031], [-1.012285, 6.468325], [-1.005745, 6.442831], [-1.01802, 6.436104], [-1.010316, 6.415011], [-1.023626, 6.408345], [-1.035634, 6.413072], [-1.041859, 6.400521], [-1.066986, 6.390251], [-1.114291, 6.352822], [-1.110527, 6.343307], [-1.119948, 6.325986], [-1.112207, 6.320637], [-1.131182, 6.316057], [-1.127779, 6.302017], [-1.138655, 6.296383], [-1.126909, 6.286209], [-1.127989, 6.271265], [-1.116333, 6.268763], [-1.125374, 6.243981], [-1.120524, 6.228193], [-1.12027, 6.20945], [-1.131126, 6.199873], [-1.153804, 6.198543], [-1.164249, 6.206503], [-1.192208, 6.199272], [-1.188725, 6.184103], [-1.178944, 6.179967], [-1.186059, 6.167647], [-1.179579, 6.147941], [-1.201378, 6.133617], [-1.192489, 6.123135], [-1.205839, 6.115797] ] ] ] } }, { "name": "Upper East", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-1.066035, 10.497302], [-1.071766, 10.490472], [-1.097565, 10.483263], [-1.13333, 10.458208], [-1.165606, 10.412604], [-1.232042, 10.387033], [-1.232123, 10.367062], [-1.214027, 10.344319], [-1.211093, 10.324104], [-1.222918, 10.295224], [-1.231953, 10.292673], [-1.228247, 10.286943], [-1.238979, 10.286717], [-1.24826, 10.27466], [-1.256192, 10.303327], [-1.271769, 10.314563], [-1.268975, 10.325532], [-1.285228, 10.322092], [-1.326372, 10.332103], [-1.324925, 10.340151], [-1.348192, 10.347297], [-1.34329, 10.352528], [-1.350409, 10.373148], [-1.381749, 10.390959], [-1.384873, 10.405371], [-1.366686, 10.413934], [-1.363873, 10.422283], [-1.372775, 10.427476], [-1.362387, 10.435076], [-1.380071, 10.456017], [-1.373239, 10.459633], [-1.377455, 10.466719], [-1.402355, 10.484694], [-1.418122, 10.466055], [-1.434023, 10.467766], [-1.446595, 10.469158], [-1.449788, 10.479031], [-1.466861, 10.486828], [-1.45934, 10.498744], [-1.462772, 10.509199], [-1.448466, 10.516972], [-1.457113, 10.533337], [-1.485869, 10.538368], [-1.489918, 10.550095], [-1.518272, 10.562127], [-1.51599, 10.576783], [-1.526603, 10.588363], [-1.553942, 10.586346], [-1.566457, 10.599522], [-1.573474, 10.667939], [-1.568244, 10.723451], [-1.556847, 10.746931], [-1.533631, 10.74808], [-1.526237, 10.760318], [-1.52311, 10.777371], [-1.496089, 10.786601], [-1.491488, 10.806329], [-1.500465, 10.814431], [-1.491773, 10.833997], [-1.478638, 10.830866], [-1.473079, 10.844022], [-1.45844, 10.849083], [-1.456171, 10.91168], [-1.444087, 10.950419], [-1.447903, 10.964106], [-1.438367, 10.990675], [-1.428227, 10.998095], [-1.428545, 11.01111], [-1.422833, 11.020305], [-1.396135, 10.990651], [-1.377213, 10.986143], [-1.181666, 10.989267], [-1.153865, 10.988188], [-1.114613, 10.985883], [-1.114796, 11.003956], [-1.000294, 11.007928], [-1.000129, 10.997878], [-0.916561, 11.002288], [-0.91666, 10.980349], [-0.911067, 10.980501], [-0.889115, 10.980985], [-0.892606, 10.962871], [-0.870024, 10.966774], [-0.855053, 10.998359], [-0.80758, 11.005874], [-0.80754, 10.998082], [-0.684077, 10.998684], [-0.680925, 10.982987], [-0.672453, 10.990478], [-0.653683, 10.987607], [-0.655426, 10.976133], [-0.671685, 10.96121], [-0.661476, 10.956408], [-0.653619, 10.963805], [-0.648271, 10.950118], [-0.626415, 10.93924], [-0.618738, 10.910359], [-0.593212, 10.923734], [-0.586102, 10.960926], [-0.568821, 10.991399], [-0.552948, 10.990717], [-0.544693, 10.975045], [-0.529633, 11.000598], [-0.511266, 10.988962], [-0.501422, 11.002203], [-0.501764, 11.016727], [-0.480326, 11.022941], [-0.475692, 11.035302], [-0.46112, 11.028056], [-0.437923, 11.030448], [-0.439805, 11.064992], [-0.428125, 11.114288], [-0.401204, 11.126924], [-0.37257, 11.123096], [-0.375892, 11.106095], [-0.361431, 11.069553], [-0.353404, 11.084682], [-0.338746, 11.090869], [-0.336734, 11.106765], [-0.322566, 11.114416], [-0.273422, 11.12358], [-0.271753, 11.137512], [-0.289716, 11.147747], [-0.276745, 11.174496], [-0.217987, 11.160217], [-0.136504, 11.13989], [-0.143663, 11.106631], [-0.12477, 11.104914], [-0.094879, 11.085897], [-0.054666, 11.086108], [-0.032246, 11.109685], [-0.019463, 11.114484], [-0.005976, 11.108492], [0.003967, 11.082731], [0.02429, 11.062979], [0.026095, 11.03559], [0.032797, 10.987771], [0.024804, 10.972563], [-0.006126, 10.962633], [-0.012365, 10.938066], [-0.007632, 10.914612], [-0.029865, 10.855921], [-0.02226, 10.819702], [-0.07301, 10.770027], [-0.073026, 10.71996], [-0.090412, 10.711945], [-0.15355, 10.671572], [-0.182832, 10.670139], [-0.20491, 10.657673], [-0.23003, 10.655593], [-0.244339, 10.643759], [-0.262102, 10.631578], [-0.281818, 10.639421], [-0.314054, 10.621138], [-0.342905, 10.620386], [-0.365702, 10.62517], [-0.396186, 10.608273], [-0.443592, 10.599744], [-0.468183, 10.618062], [-0.499771, 10.623316], [-0.508298, 10.567216], [-0.52024, 10.558794], [-0.553967, 10.57179], [-0.578739, 10.549327], [-0.593601, 10.546164], [-0.640742, 10.555634], [-0.667591, 10.527017], [-0.681476, 10.526682], [-0.689883, 10.542574], [-0.704869, 10.523676], [-0.715704, 10.529453], [-0.685752, 10.567674], [-0.693823, 10.588924], [-0.718206, 10.605666], [-0.717971, 10.615381], [-0.706204, 10.620591], [-0.712227, 10.641629], [-0.724422, 10.651645], [-0.755586, 10.640312], [-0.789629, 10.652618], [-0.797015, 10.645799], [-0.795933, 10.621778], [-0.823653, 10.600977], [-0.837858, 10.601288], [-0.84329, 10.574676], [-0.874606, 10.595307], [-0.909231, 10.575913], [-0.890629, 10.518568], [-0.926787, 10.480439], [-0.934851, 10.486463], [-0.90891, 10.522248], [-0.91525, 10.528448], [-0.936015, 10.52652], [-0.948194, 10.533814], [-0.959186, 10.528843], [-0.965371, 10.536898], [-0.980719, 10.532255], [-1.008375, 10.538043], [-1.032131, 10.52821], [-1.053807, 10.499493], [-1.066035, 10.497302] ] ] ] } }, { "name": "Greater Accra", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-0.13388, 5.563363], [-0.174108, 5.549869], [-0.204946, 5.541097], [-0.208453, 5.532853], [-0.27231, 5.518929], [-0.358418, 5.497695], [-0.405403, 5.470501], [-0.403618, 5.509005], [-0.414299, 5.530757], [-0.410838, 5.555397], [-0.399924, 5.565707], [-0.436317, 5.622354], [-0.479607, 5.64655], [-0.497146, 5.64668], [-0.495254, 5.659639], [-0.520069, 5.695871], [-0.519963, 5.705389], [-0.508292, 5.713701], [-0.510344, 5.736234], [-0.492565, 5.748481], [-0.44395, 5.777489], [-0.447928, 5.789932], [-0.437446, 5.800861], [-0.424321, 5.793531], [-0.413373, 5.772491], [-0.390098, 5.757962], [-0.384752, 5.776375], [-0.362298, 5.763055], [-0.342365, 5.777684], [-0.327431, 5.772542], [-0.305098, 5.792758], [-0.269864, 5.807248], [-0.256521, 5.777912], [-0.233384, 5.784398], [-0.243687, 5.757697], [-0.22978, 5.75321], [-0.225056, 5.740066], [-0.201941, 5.763148], [-0.202556, 5.781952], [-0.185772, 5.79136], [-0.172329, 5.814012], [-0.155039, 5.814731], [-0.150889, 5.838339], [-0.164709, 5.839423], [-0.143928, 5.854919], [-0.129884, 5.852877], [-0.122171, 5.880222], [-0.006305, 5.97117], [-0.004641, 5.985662], [-0.014812, 5.997209], [-0.009607, 6.01038], [0.00577, 6.012052], [0.018178, 6.038867], [0.019003, 6.061875], [0.040358, 6.047899], [0.089163, 6.062671], [0.143636, 6.100878], [0.146815, 6.109169], [0.189342, 6.096879], [0.228922, 6.110117], [0.247736, 6.105735], [0.284768, 6.080806], [0.295456, 6.057345], [0.337835, 6.04724], [0.331752, 6.033965], [0.348645, 6.022215], [0.339811, 6.019202], [0.329703, 5.99669], [0.353326, 5.986655], [0.343867, 5.953965], [0.4343, 5.97403], [0.450054, 6.001632], [0.483696, 5.992538], [0.484732, 5.975536], [0.491961, 5.979706], [0.490462, 5.995344], [0.498986, 5.99109], [0.515004, 5.982933], [0.525354, 5.97888], [0.524022, 5.954941], [0.541701, 5.949758], [0.550986, 5.920348], [0.56101, 5.940151], [0.58206, 5.927335], [0.587335, 5.913463], [0.574554, 5.899907], [0.619058, 5.875812], [0.612412, 5.872894], [0.614975, 5.864636], [0.631502, 5.866839], [0.619725, 5.854009], [0.620279, 5.834309], [0.642874, 5.841023], [0.654565, 5.827303], [0.651851, 5.80527], [0.677681, 5.795227], [0.687959, 5.777824], [0.67593, 5.77727], [0.680146, 5.770837], [0.458264, 5.788858], [0.32078, 5.782027], [0.252758, 5.766376], [0.219147, 5.746419], [0.184811, 5.743445], [0.140788, 5.723686], [0.125731, 5.707459], [0.067262, 5.693145], [0.032515, 5.656484], [0.004138, 5.624461], [-0.055086, 5.608302], [-0.073583, 5.590092], [-0.13388, 5.563363] ] ] ] } }, { "name": "Central", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-1.321749, 5.09684], [-1.345879, 5.089759], [-1.35394, 5.079843], [-1.504474, 5.042992], [-1.580235, 5.033195], [-1.581462, 5.154986], [-1.53835, 5.163448], [-1.533033, 5.173777], [-1.525075, 5.17072], [-1.522771, 5.199695], [-1.509913, 5.208328], [-1.446334, 5.21019], [-1.447421, 5.222317], [-1.444102, 5.267866], [-1.435519, 5.267604], [-1.427714, 5.2891], [-1.399803, 5.298057], [-1.404112, 5.306002], [-1.456633, 5.348074], [-1.462097, 5.381936], [-1.474816, 5.377788], [-1.489351, 5.399293], [-1.502391, 5.401403], [-1.513874, 5.392734], [-1.562998, 5.415401], [-1.596517, 5.410793], [-1.609101, 5.423417], [-1.628859, 5.422043], [-1.622501, 5.440154], [-1.601684, 5.450665], [-1.612709, 5.46583], [-1.615376, 5.515792], [-1.608131, 5.531956], [-1.594013, 5.529939], [-1.591939, 5.563364], [-1.607573, 5.563582], [-1.621404, 5.599363], [-1.642913, 5.616919], [-1.658011, 5.61828], [-1.685925, 5.602089], [-1.684964, 5.625433], [-1.676383, 5.625173], [-1.685711, 5.642321], [-1.737731, 5.623653], [-1.75059, 5.626943], [-1.824466, 5.593252], [-1.832191, 5.592489], [-1.818049, 5.674711], [-1.808242, 5.680999], [-1.791833, 5.695606], [-1.784501, 5.729798], [-1.816647, 5.724882], [-1.801003, 5.751003], [-1.850735, 5.767637], [-1.82881, 5.786533], [-1.844669, 5.805017], [-1.813732, 5.867877], [-1.814942, 5.889249], [-1.841806, 5.901731], [-1.869627, 5.88391], [-1.887951, 5.897389], [-1.894874, 5.917264], [-1.903157, 5.917464], [-1.90903, 5.937231], [-1.933366, 5.947929], [-1.944365, 5.983529], [-1.953818, 5.984364], [-1.98531, 6.016524], [-2.05152, 6.050058], [-2.047617, 6.059275], [-2.058687, 6.071587], [-2.140277, 6.09124], [-2.162378, 6.119866], [-2.181754, 6.121049], [-2.18901, 6.147232], [-2.205935, 6.198023], [-2.175556, 6.214382], [-2.131398, 6.258989], [-2.126598, 6.250339], [-2.098648, 6.239961], [-2.074265, 6.294526], [-2.045212, 6.28449], [-2.009525, 6.291673], [-2.023368, 6.255373], [-2.021506, 6.223835], [-2.040409, 6.197933], [-2.022608, 6.173295], [-2.01942, 6.152425], [-2.025907, 6.140971], [-2.014342, 6.113302], [-2.00689, 6.110997], [-2.007172, 6.117529], [-1.997437, 6.116194], [-1.990438, 6.124851], [-1.97903, 6.116167], [-1.988083, 6.104728], [-1.975461, 6.091844], [-1.968128, 6.052448], [-1.960743, 6.058545], [-1.952515, 6.049127], [-1.949869, 6.05709], [-1.934347, 6.036878], [-1.924813, 6.035323], [-1.913011, 6.011198], [-1.892042, 6.015051], [-1.883063, 6.033766], [-1.867411, 6.009456], [-1.861237, 6.016651], [-1.851377, 6.01414], [-1.848154, 6.029229], [-1.838226, 6.035816], [-1.821718, 6.03929], [-1.823604, 6.029928], [-1.804074, 6.029296], [-1.813096, 6.011397], [-1.802886, 5.992805], [-1.797872, 5.999784], [-1.792509, 5.990295], [-1.774362, 5.979774], [-1.77044, 5.960963], [-1.76407, 5.969768], [-1.748694, 5.959962], [-1.749619, 5.968982], [-1.739168, 5.970552], [-1.724838, 5.952929], [-1.713249, 5.957244], [-1.70725, 5.929315], [-1.692712, 5.943412], [-1.693421, 5.933694], [-1.672469, 5.915377], [-1.638957, 5.933727], [-1.59571, 5.923999], [-1.589966, 5.935002], [-1.581059, 5.917681], [-1.571889, 5.933134], [-1.567786, 5.925845], [-1.556572, 5.92639], [-1.53965, 5.931139], [-1.546023, 5.939171], [-1.528775, 5.937807], [-1.530854, 5.923194], [-1.520695, 5.928462], [-1.516364, 5.914025], [-1.500495, 5.905507], [-1.505458, 5.89512], [-1.498019, 5.891499], [-1.516584, 5.890062], [-1.521765, 5.875182], [-1.500678, 5.877032], [-1.501031, 5.868212], [-1.482854, 5.867076], [-1.475885, 5.855117], [-1.461735, 5.862288], [-1.459156, 5.886642], [-1.466954, 5.904287], [-1.456434, 5.893679], [-1.45069, 5.906382], [-1.437085, 5.901392], [-1.428725, 5.909876], [-1.421452, 5.903408], [-1.418745, 5.921487], [-1.380259, 5.916387], [-1.377017, 5.934595], [-1.353911, 5.934205], [-1.347404, 5.91938], [-1.335651, 5.926588], [-1.342522, 5.910897], [-1.323034, 5.914217], [-1.308939, 5.926477], [-1.308434, 5.890081], [-1.298047, 5.885703], [-1.275177, 5.902976], [-1.262443, 5.890881], [-1.260892, 5.915411], [-1.244197, 5.913646], [-1.242622, 5.932101], [-1.224692, 5.935485], [-1.198455, 5.916663], [-1.169251, 5.910169], [-1.163031, 5.89725], [-1.169018, 5.865682], [-1.159574, 5.851772], [-1.169192, 5.839753], [-1.157827, 5.819556], [-1.167978, 5.7853], [-1.161381, 5.721095], [-1.151041, 5.725087], [-1.1439, 5.704138], [-1.135676, 5.704462], [-1.134393, 5.721314], [-1.120973, 5.720533], [-1.099819, 5.700823], [-1.091137, 5.742634], [-1.07719, 5.749181], [-1.044573, 5.752435], [-1.034759, 5.737473], [-0.997616, 5.746501], [-0.994781, 5.739209], [-0.99071, 5.748375], [-0.971577, 5.754234], [-0.953326, 5.738371], [-0.879989, 5.741779], [-0.878777, 5.749353], [-0.8802, 5.758555], [-0.843984, 5.756431], [-0.8123, 5.744353], [-0.814005, 5.730236], [-0.789332, 5.726254], [-0.783769, 5.706168], [-0.778553, 5.713695], [-0.75866, 5.709919], [-0.695154, 5.715322], [-0.694171, 5.732316], [-0.685787, 5.73958], [-0.652027, 5.737256], [-0.622978, 5.721179], [-0.568167, 5.740371], [-0.510344, 5.736234], [-0.508292, 5.713701], [-0.519963, 5.705389], [-0.520069, 5.695871], [-0.495254, 5.659639], [-0.497146, 5.64668], [-0.479607, 5.64655], [-0.436317, 5.622354], [-0.399924, 5.565707], [-0.410838, 5.555397], [-0.414299, 5.530757], [-0.403618, 5.509005], [-0.405403, 5.470501], [-0.420593, 5.452065], [-0.46525, 5.42942], [-0.462861, 5.418531], [-0.473843, 5.40666], [-0.499027, 5.37789], [-0.553262, 5.365266], [-0.6399, 5.32782], [-0.726983, 5.298418], [-0.727129, 5.285019], [-0.747849, 5.274265], [-0.759556, 5.25427], [-0.77782, 5.246271], [-0.798118, 5.223165], [-0.840899, 5.209639], [-1.015388, 5.201373], [-1.090997, 5.194277], [-1.119663, 5.173044], [-1.14853, 5.164266], [-1.166362, 5.145375], [-1.198445, 5.132962], [-1.21181, 5.117897], [-1.24644, 5.100638], [-1.321749, 5.09684] ] ] ] } }, { "name": "Bono", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [-2.777398, 7.020171], [-2.792515, 7.009901], [-2.820768, 6.964004], [-2.848917, 6.951718], [-2.856282, 6.911704], [-2.849322, 6.886854], [-2.864815, 6.851682], [-2.938604, 6.941447], [-2.969034, 6.937096], [-2.988698, 6.946487], [-3.03388, 6.927503], [-3.045637, 6.938291], [-3.072785, 6.943727], [-3.075592, 6.971923], [-3.116563, 7.00592], [-3.074949, 7.062909], [-3.032066, 7.07177], [-3.029149, 7.096677], [-3.023629, 7.142534], [-2.953363, 7.239228], [-2.978189, 7.272115], [-2.947263, 7.45653], [-2.937076, 7.480369], [-2.923468, 7.608614], [-2.850623, 7.761909], [-2.848625, 7.780295], [-2.826113, 7.805781], [-2.830361, 7.82058], [-2.825124, 7.824446], [-2.8329, 7.848627], [-2.803683, 7.972459], [-2.771742, 7.997178], [-2.631443, 8.053214], [-2.636181, 8.067117], [-2.629888, 8.115141], [-2.608482, 8.151947], [-2.555454, 8.146969], [-2.544786, 8.175779], [-2.494896, 8.205227], [-2.504456, 8.334058], [-2.590986, 8.785029], [-2.543044, 8.761565], [-2.535621, 8.739328], [-2.500666, 8.719903], [-2.4883, 8.685847], [-2.464624, 8.652223], [-2.417346, 8.611985], [-2.410171, 8.567095], [-2.367022, 8.539907], [-2.357918, 8.520758], [-2.370784, 8.500396], [-2.369303, 8.485595], [-2.352312, 8.461496], [-2.337098, 8.454298], [-2.32528, 8.417423], [-2.299416, 8.384887], [-2.304996, 8.354863], [-2.285621, 8.319347], [-2.288475, 8.296948], [-2.252518, 8.276878], [-2.239723, 8.281234], [-2.229744, 8.263444], [-2.211788, 8.254947], [-2.205086, 8.231833], [-2.168331, 8.212098], [-2.162102, 8.173649], [-2.135672, 8.151857], [-2.121639, 8.149763], [-2.117042, 8.135438], [-2.101754, 8.135811], [-2.079728, 8.098907], [-2.064875, 8.089046], [-2.057495, 8.052074], [-2.025354, 8.023977], [-2.026006, 7.996183], [-2.043971, 7.973559], [-2.041178, 7.964418], [-2.019946, 7.955447], [-1.985049, 7.966226], [-1.914109, 7.877381], [-1.902945, 7.831178], [-1.922301, 7.806366], [-1.944325, 7.799281], [-1.970745, 7.805923], [-2.023123, 7.780386], [-2.076403, 7.778631], [-2.082252, 7.765068], [-2.071279, 7.748302], [-2.073048, 7.713557], [-2.047968, 7.675826], [-2.077212, 7.64387], [-2.089668, 7.630835], [-2.088243, 7.609915], [-2.11179, 7.572231], [-2.108896, 7.553257], [-2.137717, 7.52581], [-2.121904, 7.515035], [-2.113874, 7.495054], [-2.109671, 7.463647], [-2.114133, 7.442479], [-2.127823, 7.431811], [-2.126807, 7.419107], [-2.14085, 7.409149], [-2.135567, 7.395534], [-2.135539, 7.373842], [-2.147559, 7.365791], [-2.159944, 7.329664], [-2.209953, 7.314383], [-2.219231, 7.312166], [-2.2184, 7.301005], [-2.240479, 7.292273], [-2.245662, 7.279686], [-2.268668, 7.274355], [-2.265187, 7.245557], [-2.272491, 7.245777], [-2.273419, 7.237274], [-2.281485, 7.247065], [-2.278504, 7.233789], [-2.285108, 7.226749], [-2.324958, 7.237176], [-2.340689, 7.217893], [-2.350064, 7.187037], [-2.288368, 7.140952], [-2.303354, 7.120851], [-2.295268, 7.113055], [-2.298399, 7.098351], [-2.329739, 7.105936], [-2.32422, 7.122888], [-2.350133, 7.129129], [-2.372482, 7.102159], [-2.4385, 7.088893], [-2.400526, 7.111898], [-2.447606, 7.140653], [-2.493723, 7.13347], [-2.492263, 7.219419], [-2.49507, 7.226445], [-2.516789, 7.230829], [-2.5559, 7.230507], [-2.580561, 7.208863], [-2.581229, 7.180596], [-2.607181, 7.180408], [-2.651385, 7.14155], [-2.682667, 7.140632], [-2.690449, 7.13229], [-2.691143, 7.114797], [-2.69925, 7.106549], [-2.728994, 7.098679], [-2.755203, 7.075881], [-2.761488, 7.035223], [-2.770663, 7.021788], [-2.777398, 7.020171] ] ] ] } } ] } """
991,324
f37b149c735023347a5bea770bbf12f4e8f1901f
#!/mcms/python/bin/python # For list of profiles look at RunTest.sh #*PROCESSES_PROFILE_FOR_SCRIPT=Profile_1 #*export MPL_SIM_FILE="VersionCfg/MPL_SIM_1_WITHOUT_RTM.XML" from McmsConnection import * from ContentFunctions import * from HotSwapUtils import * import string #------------------------------------------------------------------------------ def test_if_Alert_exist(self,ProcessName,expected_fault,expected_fault_retries_num,need_delay=0): print "<<< test_if_Alert_exis : "+ ProcessName +"("+str(expected_fault_retries_num) +")." SM_fail = 0 fault_elm_list=0 if need_delay == 1: sleep (20) # self.SendXmlFile("Scripts/GetFaults.xml") self.SendXmlFile("Scripts/GetActiveAlarms.xml") fault_elm_list = self.xmlResponse.getElementsByTagName("LOG_FAULT_ELEMENT") num_of_faults = len(fault_elm_list) for index in range(len(fault_elm_list)): fault_desc = fault_elm_list[index].getElementsByTagName("DESCRIPTION")[0].firstChild.data print fault_desc if fault_desc == expected_fault: SM_fail = SM_fail+1 print "SM_fail" + str(SM_fail) if SM_fail <> expected_fault_retries_num : print "Test failed, "+expected_fault+" not found in Faults" # sys.exit(1) def RunCommand(commandToRun): print "----- run " + commandToRun os.system(commandToRun) def num_of_running_cards_tasks(card_task_name,num_of_task): temp_str= str("Bin/McuCmd @tasks cards > tasts.tmp") os.system(temp_str) command = "cat tasts.tmp | grep MfaTask | wc -l > tests1.tmp" RunCommand(command) command = "cat tests1.tmp" RunCommand(command) output = open("tests1.tmp") num_of_Tasks = output.readline() output.close() num_of_Tasks_i = int(num_of_Tasks) print "num_of_Tasks"+str(num_of_Tasks_i) if (num_of_Tasks_i<>num_of_task): print "wrong card_tasks_number" exit (1) #------------------------------------------------------------------------------ def TestSimInsertCard(connection): HSUtil = HotSwapUtils() IsCardExist = False IsCardExist = HSUtil.IsCardExistInHW_List(1, 1, 'normal') num_of_running_cards_tasks("MfaTask",2) if IsCardExist == True: print ">>> Sim Insert Card" HSUtil.SimInsertCard(1, 1) num_of_running_cards_tasks("MfaTask",2) IsCardExist = HSUtil.IsCardExistInHW_List(1, 1, 'normal') test_if_Alert_exist(connection,"Resource","INSUFFICIENT_RESOURCES",1) return ## ---------------------- Test -------------------------- c = McmsConnection() c.Connect() TestSimInsertCard(c) #c.Disconnect() #------------------------------------------------------------------------------
991,325
2555c7d46f635f12162185b86539ca92114e9645
var1=100 if var1: print("something") print(var1) var2=13 if var2: print("your") print(var2) print("good bye")
991,326
55855258c7023721cf17dfd714796c89ac2cca1a
from .models import * from rest_framework import viewsets from django.shortcuts import render from .serializers import ProdutoSerializers from django.core import paginator from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage class ProdutoViewSet(viewsets.ModelViewSet): queryset = product.objects.all() serializer_class = ProdutoSerializers def home(request, template_name="home.html"): query = request.GET.get("busca", '') ordenar = request.GET.get("ordenar", '') page = request.GET.get('page', '') if query: produto = product.objects.filter(name__icontains=query) else: try: if ordenar: produto = product.objects.all().order_by(ordenar) else: produto = product.objects.all() produto = Paginator(produto, 8) produto = produto.page(page) except PageNotAnInteger: produto = produto.page(1) except EmptyPage: produto = paginator.page(paginator.num_pages) produtos = {'lista': produto} return render(request, template_name, produtos) def contact(request): return render(request, 'contact.html') def login(request): return render(request, 'login.html') def forgotLogin(request): return render(request, 'forgotLogin.html')
991,327
f20d26b1168b29f5b1ff621bd7c93eeb90a0a38f
""" Project.x Author: Michael Redmond """ from __future__ import print_function, absolute_import from ._actions import Actions, Commands
991,328
3b8ec3081e80996d4d74c8778099918a944803de
# -*- coding:utf-8 -*- import requests import time import random from multiprocessing import Pool from bs4 import BeautifulSoup import codecs #中文分词工具结巴 #import jieba def LoadUserAgent(uafile): uas = [] with open(uafile, 'rb') as uaf: for ua in uaf.readlines(): if ua: uas.append(ua.strip()[1:-1]) random.shuffle(uas) return uas uas = LoadUserAgent("txt_file/user_agents.txt") def LoadProxies(uafile): ips = [] with open(uafile, 'r') as proxies: for ip in proxies.readlines(): if ip: ips.append(ip.strip()) random.shuffle(ips) return ips ips = LoadProxies("txt_file/proxies.txt") def getHtmlInfo(url): ua = random.choice(uas) headers = { 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,ja;q=0.7', 'Connection': 'keep-alive', 'Host': 'www.bilibili.com', 'Origin': 'https://www.bilibili.com', 'User-Agent': ua } try: video_info_list = [] response = requests.get(url, headers=headers, timeout=1) html = response.text soup = BeautifulSoup(html, 'lxml') #视频的av号 aid = url.rpartition('av')[2] #视频标题 #tag = soup.find(id='viewbox_report') #title=tag.h1.get_text() #print(title) #结巴分词 #seg_list=jieba.cut_for_search(title) #print(' '.join(seg_list)) #video_info_list.append(tag.h1.get_text()) #视频标签 labels = soup.find_all(class_='tag') for label in labels: video_info_list.append(label.get_text()) print(video_info_list) filename='labels/av'+aid+'.txt' file=codecs.open(filename,'w','utf-8') for str in video_info_list: file.write(str+' ') time.sleep(0.1) except: print("error") time.sleep(0.1) def label_spider(): av_list = [] filename = 'txt_file/guichuAV.txt' with open(filename) as file: for line in file: av_list.append(line.split('\n')[0]) print(av_list) pool = Pool() urls = ['https://www.bilibili.com/video/av{}'.format(i) for i in av_list] print(urls) pool.map(getHtmlInfo, urls) pool.close() pool.join() if __name__ == '__main__': label_spider()
991,329
edf1e0c7e302aa361638b815a0c18e131c83e757
from collections import deque import numpy as np import random from gym_minigrid.minigrid import * from gym_minigrid.envs.grid_rooms import GridRooms from gym_minigrid.register import register MOVE_VEC = [ np.array([-1, 0]), np.array([0, -1]), np.array([1, 0]), np.array([0, 1]), ] def connect_rooms(crt_rooms, goal_room, max_room, rnd=None, checked_rooms=[]): rnd = np.random if rnd is None else rnd # moves = rnd.choice(MOVE_VEC, len(MOVE_VEC)).tolist() moves = rnd.permutation(MOVE_VEC) for im, move in enumerate(moves): lx, ly = crt_rooms[-1] new_x, new_y = lx + move[0], ly + move[1] if 0 <= new_x < max_room and 0 <= new_y < max_room: vroom = tuple([new_x, new_y]) if vroom not in crt_rooms and vroom not in checked_rooms: crt_rooms.append(vroom) checked_rooms.append(vroom) if vroom == goal_room: return True, crt_rooms else: reached, new_rooms = connect_rooms(crt_rooms, goal_room, max_room, rnd=rnd, checked_rooms=checked_rooms) if reached: return True, new_rooms crt_rooms.pop() return False, list() def get_room_neighbour(rix, x, y): # Door positions, order is right, down, left, up # Indexing is (column, row) nx, ny = x, y if rix == 0: ny += 1 elif rix == 1: nx += 1 elif rix == 2: ny -= 1 else: nx -= 1 return tuple([nx, ny]) class GridMaze(GridRooms): def __init__(self, grid_size=6, goal_center_room=True, close_doors_trials=0.2, same_maze=True, seed=None, level_seed=None, proc_id=None, **kwargs ): self._grid_size = grid_size num_rows = num_cols = grid_size assert num_rows == num_cols, "Square only now" self.close_doors_trials_fraction = close_doors_trials self.close_doors_trials = int(num_rows * num_rows * 4 * close_doors_trials) self._level_seed = level_seed self._proc = proc_id self._max_seed = 999999999 self._random_seed_number = 0 super().__init__(num_rows=num_rows, num_cols=num_cols, goal_center_room=goal_center_room, **kwargs) def change_grid_size(self, new_grid_size): self._grid_size = new_grid_size self.close_doors_trials = int(new_grid_size * new_grid_size * 4 * self.close_doors_trials_fraction) self.num_rows = new_grid_size self.num_cols = new_grid_size self.height = (self.room_size - 1) * self.num_rows + 1 self.width = (self.room_size - 1) * self.num_cols + 1 def _gen_grid(self, width, height): seed = self._rand_int(0, self._max_seed) if self._level_seed is None else self._level_seed % self._max_seed self.np_random, _ = seeding.np_random(seed) self._random_seed_number = seed super()._gen_grid(width, height) rnd = np.random.RandomState(seed) room_size = self.room_size - 1 max_rooms = self.num_rows ag_pos = self.agent_pos close_doors_trials = self.close_doors_trials ag_start_room = ag_pos // room_size goal_room = tuple(self.goal_crt_pos // room_size) checked_rooms = [tuple(ag_start_room)] tried_rooms = [] if goal_room[0] == ag_start_room[0] and goal_room[1] == ag_start_room[1]: reached, rooms = True, checked_rooms else: reached, rooms = connect_rooms(checked_rooms, goal_room, max_rooms, rnd=rnd, checked_rooms=tried_rooms) for i in range(close_doors_trials): # Pick random room. Try to close random door but not the one connecting ag to goal x, y = rnd.randint(0, max_rooms, (2,)) room = self.room_grid[x][y] doors_i = [i for i in range(len(room.door_pos)) if room.door_pos[i] is not None] if len(doors_i) == 0: continue select_door = rnd.choice(doors_i, 1)[0] door_neigh_room = get_room_neighbour(select_door, x, y) can_remove_door = True # Door positions, order is right, down, left, up room_coord = tuple([x, y]) if room_coord in rooms: # Check if door connects to closeby rooms rpos = rooms.index(room_coord) if rpos > 0 and rooms[rpos - 1] == door_neigh_room: can_remove_door = False if rpos < len(rooms) - 1 and rooms[rpos + 1] == door_neigh_room: can_remove_door = False if can_remove_door: dy, dx = room.door_pos[select_door] if dx != ag_pos[0] or dy != ag_pos[1]: # dx, dy = room.door_pos[select_door] self.grid.set(dx, dy, Wall()) room.door_pos[select_door] = None class SpecialMaze(GridRooms): def __init__(self, grid_size=7, goal_center_room=True, close_doors_trials=0.0, same_maze=True, seed=None, level_seed=None, proc_id=None, room_size=7, start_ag_pos=None, default_room_sets=None, **kwargs ): self._grid_size = grid_size num_rows = num_cols = grid_size assert num_rows == num_cols, "Square only now" assert grid_size % 2 == 1, "Must be odd number of grid size" assert close_doors_trials == 0, "Must be no doors" self.close_doors_trials = int(num_rows * num_rows * 4 * close_doors_trials) self._level_seed = level_seed self._proc = proc_id fsize = (room_size - 1) * grid_size if start_ag_pos is None: agent_pos = (fsize // 2, fsize // 2) else: agent_pos = start_ag_pos self._c_pos = (fsize // 2, fsize // 2) if default_room_sets is None: room_sets = [] for ix in range(room_size // 2, (room_size -1 ) * grid_size, room_size-1): if ix != self._c_pos[1] and (ix, self._c_pos[1]) != tuple(agent_pos): room_sets.append([ix, self._c_pos[1]]) if ix != self._c_pos[0] and (self._c_pos[0], ix) != tuple(agent_pos): room_sets.append([self._c_pos[0], ix]) else: room_sets = default_room_sets self._max_seed = 999999999 self._random_seed_number = 0 # print(room_sets) room_sets = [room_sets] super().__init__( num_rows=num_rows, num_cols=num_cols, goal_center_room=goal_center_room, room_size=room_size, agent_pos=agent_pos, room_sets=room_sets, goal_rooms=1, **kwargs ) def _gen_grid(self, width, height): seed = self._rand_int(0, self._max_seed) if self._level_seed is None else self._level_seed % self._max_seed self.np_random, _ = seeding.np_random(seed) self._random_seed_number = seed super()._gen_grid(width, height) rnd = np.random.RandomState(seed) room_size = self.room_size - 1 max_rooms = self.num_rows ag_pos = self.agent_pos close_doors_trials = self.close_doors_trials ag_start_room = ag_pos // room_size goal_room = tuple(self.goal_crt_pos // room_size) checked_rooms = [tuple(ag_start_room)] # make tunnels # print(self.width) for idx, size in enumerate([self.height, self.width]): for i in range(0, size): if abs(self._c_pos[idx] - i) > 1: for diff in [-1, 1]: pos = (self._c_pos[idx]+diff, i) pos = pos if idx == 0 else reversed(pos) self.grid.set(*pos, Wall()) if close_doors_trials > 0: raise NotImplementedError if goal_room[0] == ag_start_room[0] and goal_room[1] == ag_start_room[1]: reached, rooms = True, checked_rooms else: reached, rooms = connect_rooms(checked_rooms, goal_room, max_rooms, rnd=rnd) for i in range(close_doors_trials): # Pick random room. Try to close random door but not the one connecting ag to goal x, y = rnd.randint(0, max_rooms, (2,)) room = self.room_grid[x][y] doors_i = [i for i in range(len(room.door_pos)) if room.door_pos[i] is not None] if len(doors_i) == 0: continue select_door = rnd.choice(doors_i, 1)[0] door_neigh_room = get_room_neighbour(select_door, x, y) can_remove_door = True # Door positions, order is right, down, left, up room_coord = tuple([x, y]) if room_coord in rooms: # Check if door connects to closeby rooms rpos = rooms.index(room_coord) if rpos > 0 and rooms[rpos - 1] == door_neigh_room: can_remove_door = False if rpos < len(rooms) - 1 and rooms[rpos + 1] == door_neigh_room: can_remove_door = False if can_remove_door: dy, dx = room.door_pos[select_door] if dx != ag_pos[0] or dy != ag_pos[1]: # dx, dy = room.door_pos[select_door] self.grid.set(dx, dy, Wall()) room.door_pos[select_door] = None class GridMazeEGO(GridMaze): def __init__(self, *args, agent_view_size=13, see_through_walls=True, **kwargs): super().__init__(*args, **kwargs) self.see_through_walls = see_through_walls self.agent_view_size = agent_view_size self.observation_space.spaces["image"] = spaces.Box( low=0, high=255, shape=(agent_view_size, agent_view_size, 3), dtype='uint8' ) def get_view_exts(self): topY = self.agent_pos[1] - self.agent_view_size // 2 topX = self.agent_pos[0] - self.agent_view_size // 2 botX = topX + self.agent_view_size botY = topY + self.agent_view_size return (topX, topY, botX, botY) def gen_obs_grid(self): """ Generate the sub-grid observed by the agent. This method also outputs a visibility mask telling us which grid cells the agent can actually see. """ topX, topY, botX, botY = self.get_view_exts() grid = self.grid.slice(topX, topY, self.agent_view_size, self.agent_view_size) # for i in range(self.agent_dir + 1): # grid = grid.rotate_left() # Process occluders and visibility # Note that this incurs some performance cost if not self.see_through_walls: vis_mask = grid.process_vis(agent_pos=(self.agent_view_size // 2, self.agent_view_size // 2)) else: vis_mask = np.ones(shape=(grid.width, grid.height), dtype=np.bool) # Make it so the agent sees what it's carrying # We do this by placing the carried object at the agent's position # in the agent's partially observable view agent_pos = grid.width // 2, grid.height // 2 if self.carrying: grid.set(*agent_pos, self.carrying) else: grid.set(*agent_pos, None) return grid, vis_mask def get_obs_render(self, obs, tile_size=TILE_PIXELS//2): """ Render an agent observation for visualization """ grid, vis_mask = Grid.decode(obs) vis_mask.fill(True) # Render the whole grid img = grid.render( tile_size, agent_pos=(self.agent_view_size // 2, self.agent_view_size // 2), agent_dir=3, highlight_mask=vis_mask ) return img class GridMazeEnv2x2(GridMaze): def __init__(self): super().__init__(grid_size=2) register( id="MiniGrid-GridMaze-v0", entry_point="gym_minigrid.envs:GridMaze" ) register( id="MiniGrid-SpecialMaze-v0", entry_point="gym_minigrid.envs:SpecialMaze" ) register( id="MiniGrid-GridMaze-2x2-v0", entry_point="gym_minigrid.envs:GridMazeEnv2x2" ) register( id="MiniGrid-GridMazeEGO-v0", entry_point="gym_minigrid.envs:GridMazeEGO" )
991,330
2110e66bb69069cb5a9ed90bb9697b0f18e48af3
import os import unittest import json from flask_sqlalchemy import SQLAlchemy from flaskr import create_app from models import setup_db,Question, Category class TriviaAppTestCase(unittest.TestCase): """This class represents the trivia test case""" def setUp(self): """Define test variables and initialize app.""" self.app = create_app() self.client = self.app.test_client self.DB_HOST = os.getenv('DB_HOST', '127.0.0.1:5432') self.DB_USER = os.getenv('DB_USER', 'postgres') self.DB_PASSWORD = os.getenv('DB_PASSWORD', 'postgres') self.DB_NAME = os.getenv('DB_NAME', 'trivia_test') self.DB_PATH = 'postgresql+psycopg2://{}:{}@{}/{}'.format(self.DB_USER, self.DB_PASSWORD, self.DB_HOST, self.DB_NAME) setup_db(self.app, self.DB_PATH) # binds the app to the current context with self.app.app_context(): self.db = SQLAlchemy() self.db.init_app(self.app) # create all tables self.db.create_all() self.Adding_Question = { 'question' : "What is the currancy of Saudi Arabia ?", 'answer' : "Ryial", 'category' : 5, 'difficulty' : 3 } self.Quiz = { "previous_questions":[],'quiz_category' : {'type': 'History' , 'id' : 4}} self.Quiz2 = { "previous_questions":[],'quiz_category' : {'type': 'History' , 'id' : 1}} def tearDown(self): """Executed after reach test""" pass """ 14/14 Q per page [[DONE]] Q creat [[DONE]] Q delete [[DONE]] Category list [[DONE]] Q per category [[DONE]] Q search [[DONE]] Quizzes [[DONE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]] TODO Write at least one test for each test for successful operation and for expected errors. """ # Now for tests ''' Questions per page ''' #Tests for displaying question endpoint # Success test for displaying questions per pages def test_get_paginated_Questions(self): res = self.client().get('/Questions') data = json.loads(res.data) self.assertEqual(res.status_code, 200) self.assertEqual(data['success'],True) self.assertTrue(data['Questions_list']) self.assertTrue(data['total_Qs']) # Error test for displaying questions for rquested page def test_404_sent_requesting_on_unvalid_page(self): respond = self.client().get('/Questions?page=2000') data = json.loads(respond.data) self.assertEqual(respond.status_code, 404) self.assertEqual(data['success'],False) self.assertEqual(data['message'], "resource not found") # the message should be exactly as it is in the errorhandler function '''Question addition ''' # Tests for adding new question # success request for creating Question def test_create_new_Quuestion(self): res = self.client().post('/Questions/create', json=self.Adding_Question) data = json.loads(res.data) self.assertEqual(res.status_code, 200) self.assertEqual(data['success'], True) self.assertTrue(data['created']) self.assertTrue(len(data['Questions'])) # Failed on adding Question def test_405_when_adding_Question_not_possible(self): res = self.client().post('/Questions/create/45', json=self.Adding_Question) data = json.loads(res.data) self.assertEqual(res.status_code, 404) self.assertEqual(data['success'], False) self.assertEqual(data['message'], 'resource not found') '''Question deletion''' # Tests for delete endpoint # succfull deleting question request # Note \ use new id for each test # Tip for using the rest of the tests without this one is to change the function name from test to Test def test_deleting_Question(self): res = self.client().delete('/Questions/100') data = json.loads(res.data) Q = Question.query.filter(Question.id == 10).one_or_none() self.assertEqual(Q, None) self.assertEqual(res.status_code, 10) self.assertEqual(data['success'], True) self.assertEqual(data['deleted'],10) # Deleting non existing question def test_deleting_Question_that_does_not_exist(self): res = self.client().delete('/Questions/2000') data = json.loads(res.data) Q = Question.query.filter(Question.id == 2000).one_or_none() self.assertEqual(Q, None) self.assertEqual(res.status_code, 422) self.assertEqual(data['success'], False) self.assertEqual(data['message'], 'unprocessable') '''Category list ''' # Tests for Category list endpoint # Success request on getting category list def test_get_categories_list(self): res = self.client().get('/Questions/categories') data = json.loads(res.data) self.assertEqual(res.status_code, 200) self.assertEqual(data['success'],True) self.assertTrue(data['categories']) # Failed on getting missing categry element def test_error_for_unexisting_category_element(self): res = self.client().get('/Questions/categories/0') data = json.loads(res.data) C = Category.query.filter(Category.id == 0).one_or_none() self.assertEqual(C, None) self.assertEqual(res.status_code, 404) self.assertEqual(data['success'],False) self.assertEqual(data['message'], 'resource not found') '''Qusetions per category ''' # Tests for category endpoint # Success test for displaying questions for specific Category def test_get_categorized_Questions(self): respond = self.client().get('/Categories/1/Questions') data = json.loads(respond.data) self.assertEqual(data['success'],True) self.assertEqual(respond.status_code, 200) self.assertEqual(data['current_category'],1) self.assertTrue(data['total_Qs']) # Failed request for displaying questions for unexisting Category def test_error_get_categorized_Questions_unexisting_category(self): respond = self.client().get('/Categories/55/Questions') data = json.loads(respond.data) self.assertEqual(data['success'],False) self.assertEqual(respond.status_code, 404) self.assertEqual(data['message'], 'resource not found') ''' Qusetions search''' # Tests for search results # succesful search attempt def test_search(self): res = self.client().post('/Questions/search', json={'searchTerm': 'what'} ) data = json.loads(res.data) self.assertEqual(res.status_code, 200) self.assertEqual(data['success'], True) self.assertTrue(data['Questions']) self.assertTrue(data['total_Qs']) self.assertTrue(data['current_category']) # giving error for specific char def test_error_search(self): res = self.client().post('/Questions/search', json={'searchTerm': ','} ) data = json.loads(res.data) self.assertEqual(res.status_code, 422) self.assertEqual(data['success'], False) self.assertEqual(data['message'], 'unprocessable') '''Quizzes''' # playing game # checking if post request is succeful def test_successful_quizzes(self): res = self.client().post('/quizzes', json = self.Quiz) data = json.loads(res.data) self.assertEqual(data['success'], True) self.assertEqual(res.status_code, 200) self.assertTrue(data['question']) # Error for non for non-existing quiz page def test_quizzes(self): res = self.client().post('/quizzes/3') data = json.loads(res.data) self.assertEqual(res.status_code, 404) self.assertEqual(data['success'], False) self.assertEqual(data['message'], 'resource not found') # Make the tests conveniently executable if __name__ == "__main__": unittest.main()
991,331
014c55d7624ee3dd324b7d5418c661dbe54587d6
#!/usr/bin/env python3 # articles_scraper.py import asyncio import json import logging import re import sys import time import aiohttp from aiohttp import ClientSession from bs4 import BeautifulSoup from pathlib import Path import aiomysql logging.basicConfig( format="%(asctime)s %(levelname)s:%(name)s: %(message)s", level=logging.DEBUG, datefmt="%H:%M:%S", stream=sys.stderr, ) logger = logging.getLogger("articles_scraper") logging.getLogger("chardet.charsetprober").disabled = True ROOT_URL = "https://www.terveyskirjasto.fi/terveyskirjasto/tk.koti" API_URL = "https://www.terveyskirjasto.fi/terveyskirjasto/terveyskirjasto.kasp_api.selaus_json?p_teos={teos}&p_selaus=" MAX_PARAGRAPH_LENGTH = 2048 DEFAULT_CONFIG_FILE_PATH = './config.json' async def get_page(url): try: async with aiohttp.ClientSession() as session: async with session.get(url) as resp: assert resp.status == 200 return await resp.text() except Exception as e: logger.exception(f"Exception occurred: {e}") return None def parse_categories(main_page): """ Parse main page left menu to populate list of dict with categories, subcategories and corespondent URLs :param main_page: URL :return: List of dicts e.g. { "category_main": cat_name, "subcategory_name": sub_cat_name, "teos": teos # link to articles list } """ if not main_page: logger.error("Main page is empty. Nothing to parse") categories_output = [] bs = BeautifulSoup(main_page, 'html.parser') categories_root = bs.find(id="vakionavi") try: for cat in categories_root.children: if cat != "\n": for a in cat.find_all("a"): # validate whether it is a main menu item if "class" in a.attrs and 'main-menu-item' in a.attrs["class"]: cat_name = a.text else: teos = a.attrs['href'].split("=")[1] sub_cat_name = a.text categories_output.append( { "category_main": cat_name, "subcategory_name": sub_cat_name, "teos": teos } ) except Exception as e: logger.exception("Parsing Exception occurred: %s", getattr(e, "__dict__", {})) return None logging.info(f"Successfully Parsed {len(categories_output)} categories") return categories_output async def fetch_articles_list_page(teos, session, **kwargs): api_url = API_URL.format(teos=teos) resp = await fetch_page(api_url, session, **kwargs) if resp: if resp.content_type == 'application/json': return await resp.text() async def fetch_page(api_url, session, **kwargs): try: resp = await session.request(method="GET", url=api_url, **kwargs) resp.raise_for_status() except ( aiohttp.ClientError, aiohttp.http_exceptions.HttpProcessingError, ) as e: logger.error(f"aiohttp exception for {api_url}\nException: {e}") return None except Exception as e: logger.exception( f"Non-aiohttp exception occurred: [{type(e).__name__}]: {e}\n" f"URL: {api_url}" ) return None logger.info(f"Got response [{resp.status}] for URL: {api_url}\n" f"Content-type: {resp.content_type}") return resp def recursive_article_list_processing(root_node_name, tree, result_article_data): if 'text' not in tree: logger.error("Current article list node does not contain 'text' ") logger.debug(f"Corrupted articles list json: {result_article_data}") raise KeyError() current_node_name = tree['text'] try: if 'nodes' in tree: for node in tree['nodes']: list_name = ' ^ '.join([root_node_name, current_node_name]) recursive_article_list_processing(list_name, node, result_article_data) else: if current_node_name == "New article" or 'href' not in tree: return result_article_data.append( { 'list_name': root_node_name, 'title': current_node_name, 'article_href': tree['href'] }) except Exception as ex: logger.exception(f"Failed to process articles list: [{type(ex).__name__}]: {ex}") logger.debug(f"Current node: {current_node_name}") logger.debug(f"Current sub tree: {tree}") logger.debug(f"Currently processed articles nodes: {result_article_data}") return async def parse_articles_lists(category_url, session, **kwargs): """ :param category_url: relative articles list url for specific category :param session: aiohttp session :param kwargs: :return: Dict: { 'list_name': "concatenated list name", 'title': current_node_name, 'article_href': "article relative url"] } """ articles_list_content = await fetch_articles_list_page(category_url, session=session, **kwargs) if not articles_list_content: logger.error('No articles list obtained') return try: articles_list = json.loads(articles_list_content) except Exception as e: logger.exception(f"JSON Encode exception: {e}\n" f"Category URL: {API_URL.format(teos=category_url)}") logger.debug(f"Failed json:\n: {articles_list_content}") return # TODO Candidate to be async if articles_list: root_list_name = articles_list[0]['text'] logger.info(f"Start Parsing {root_list_name} articles list") result_articles_list = [] for node in articles_list[0]['nodes']: recursive_article_list_processing(root_list_name, node, result_articles_list) logger.info(f"[{root_list_name}]: Discovered {len(result_articles_list)} articles") return result_articles_list else: logger.error("Empty article list obtained") async def fetch_articles_page(category, session, **kwargs): articles_lists = await parse_articles_lists(category['teos'], session) if articles_lists: try: for article in articles_lists: article_url = ROOT_URL.replace("tk.koti", article['article_href']) html = await fetch_page(article_url, session, **kwargs) if not html: logger.error(f"No article html obtained.\n" f"Category: {category['category_main']} - {category['subcategory_name']}\n" f"Title: {article['title']}") continue article_id = re.search(r'p_artikkeli=(\w+)', article['article_href']).groups()[0] yield { 'list_name': article['list_name'], 'article_id': article_id, 'title': article['title'], 'article_html': await html.text() } except Exception as ex: logger.exception(f"Failed to process articles list.\n{ex}\n" f"Category {category['category_main']} - {category['subcategory_name']}") else: logger.info( f"No articles list data obtained for category {category['category_main']} - {category['subcategory_name']}") return async def parse_article(category, session): """ Parse article html page provided bu sub coroutine :param category: :param session: :return: { 'list_name' : 'list path' 'title': "_article_title_" 'keywords': '', 'article_paragraphs'; [ 'name': '', 'content': '' ] } """ article_contents = fetch_articles_page(category, session) async for article_content in article_contents: bs = BeautifulSoup(article_content['article_html'], 'html.parser') article = bs.find(id='duo-article') parsed_article = { 'list_name': article_content['list_name'], 'title': article_content['title'], 'article_id': article_content['article_id'] } meta_keywords = article.find('meta', {'name': 'keywords'}) if meta_keywords: keywords = meta_keywords.attrs['content'] parsed_article['keywords'] = keywords h1 = article.h1 sections = article.select(".section") for sec in sections: name = h1.text[:8] h2_name = "" h3_name = "" h2 = sec.find('h2', recursive=False) if h2: h2_name = h2.text h3 = sec.find('h3', recursive=False) if h3: h3_name = h3.text all_paragraphs = sec.find_all("p", recursive=False) p_content = [] current_p_length = 0 for p in all_paragraphs: if len(p.text) + current_p_length > MAX_PARAGRAPH_LENGTH: break p_content.append(p.text) current_p_length += len(p.text) p_content_str = "".join(p_content) if 'article_paragraphs' not in parsed_article: parsed_article['article_paragraphs'] = [] parsed_article['article_paragraphs'].append({ 'name': name, 'content': p_content_str, 'h2': h2_name, 'h3': h3_name }) yield parsed_article def load_config(filepath=DEFAULT_CONFIG_FILE_PATH): config = {} config_file = Path(filepath) if config_file.exists(): with open(filepath) as f: config = json.load(f) if not config: print(f'Error: Failed to read config file "{filepath}"\n') sys.exit(3) return config async def store_to_db(db_cfg, category, session, **kwargs): async for articles_obj in parse_article(category, session): async with aiomysql.create_pool(host=db_cfg['host'], port=db_cfg['port'], user=db_cfg['user'], password=db_cfg['password'], db=db_cfg['dbname'], echo=db_cfg['echo']) as pool: async with pool.acquire() as conn: async with conn.cursor() as cur: create_content_table = """ CREATE TABLE IF NOT EXISTS content ( id INT AUTO_INCREMENT, description TEXT, text TEXT, PRIMARY KEY (id) ) ENGINE = InnoDB """ await cur.execute(create_content_table) create_articles_table = """ CREATE TABLE IF NOT EXISTS articles ( id INT AUTO_INCREMENT, main_category TEXT NOT NULL, sub_category TEXT, list_name TEXT, article_id TEXT NOT NULL, article_name TEXT NOT NULL, h2_name TEXT NOT NULL, h3_name TEXT NOT NULL, keywords TEXT, content_id INTEGER NOT NULL, PRIMARY KEY (id), FOREIGN KEY fk_content_id (content_id) REFERENCES content(id) ) ENGINE = InnoDB """ await cur.execute(create_articles_table) for a in articles_obj['article_paragraphs']: try: add_article_content = f"INSERT INTO content (description, text)" \ f"VALUES (%s, %s)" await cur.execute(add_article_content, [a['name'], a['content']]) await conn.commit() except Exception as ex: logger.exception(f"Failed to add article content: {ex}. \n{add_article_content}") try: add_article = f"INSERT INTO articles " \ f"(main_category, sub_category, list_name, article_id, article_name, " \ f"h2_name, h3_name, keywords, content_id)" \ f"VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)" add_article_values = [ category['category_main'], category['subcategory_name'], articles_obj['list_name'], articles_obj['article_id'], articles_obj['title'], a['h2'], a['h3'], articles_obj['keywords'], cur.lastrowid ] await cur.execute(add_article, add_article_values) await conn.commit() except Exception as ex: logger.exception(f"Failed to add article meta: {ex}. \n{add_article}") async def bulk_crawl_and_store(db_cfg, categories, **kwargs): """ Crawl each subcategory page with list of articles, parsing eash article, format required data structure and flush it to specified DB :param db_cfg: :param categories: :return: """ async with ClientSession() as session: tasks = [] for cat in categories: tasks.append( store_to_db(db_cfg=db_cfg, category=cat, session=session, **kwargs) ) await asyncio.gather(*tasks) if __name__ == "__main__": config = load_config() if 'LOGGING' in config: log_cfg = config['LOGGING'] if 'level' in log_cfg: logger.setLevel(log_cfg['level']) if 'DATABASE' not in config: raise Exception("Database configuration does not should. make sure your config json is correct") main_page = asyncio.run(get_page(ROOT_URL)) categories = parse_categories(main_page) start = time.perf_counter() asyncio.run(bulk_crawl_and_store(db_cfg=config['DATABASE'], categories=categories)) duration = time.perf_counter() - start logger.info("Completed for {:4.2f} seconds.".format(duration))
991,332
952d4e3a972c27fd6ec45f40d876e10f7bfd41eb
from django.db import models from django.contrib.auth.models import User from datetime import date from django.forms import ModelForm from django import forms # Create your models here. class Genre(models.Model): """Model representing a book genre.""" name = models.CharField(max_length=200, help_text='Enter a book genre (e.g. Science Fiction)') def __str__(self): """String for representing the Model object.""" return self.name # Create your models here. class Type_Of_Injury(models.Model): """Model representing a book genre.""" name = models.CharField(max_length=200, help_text='Enter a type of injury (e.g. Break, Burn)') def __str__(self): """String for representing the Model object.""" return self.name from django.urls import reverse # Used to generate URLs by reversing the URL patterns class Language(models.Model): """Model representing a Language (e.g. English, French, Japanese, etc.)""" name = models.CharField(max_length=200, help_text="Enter the book's natural language (e.g. English, French, Japanese etc.)") def __str__(self): """String for representing the Model object (in Admin site etc.)""" return self.name from django.contrib.auth.models import User # Required to assign User as a borrower from catalog.choices import * class BleedInfo(models.Model): """Model representing a book (but not a specific copy of a book).""" title = models.CharField(max_length=200) patient = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True) ticket_initated_by = models.IntegerField(choices=USER_TYPES, default=1) when_bleed_occured = models.DateField() summary = models.TextField(max_length=1000, help_text='Enter a brief description of the bleed') bleed_type = models.IntegerField(choices=BLEED_TYPE, default=1) bleed_location = models.IntegerField(choices=BODY_LOCATIONS, default=1) bleed_location_details = models.CharField(max_length=200) extra_factor_yn = models.IntegerField(choices=YES_NO, default=1) num_of_days_extra_factor_was_used = models.IntegerField() name_of_extra_factor_drug = models.CharField(max_length=200) did_patient_use_factor_yn = models.IntegerField(choices=YES_NO, default=1) why_patinet_did_not_use_facor = models.CharField(max_length=200) did_patient_use_home_factor_yn = models.IntegerField(choices=YES_NO, default=1) home_factor_supply_details= models.CharField(max_length=200) def __str__(self): """String for representing the Model object.""" return self.title def get_absolute_url(self): """Returns the url to access a detail record for this injury.""" return reverse('bleedinfo-detail', args=[str(self.id)]) # def display_injury_type(self): # """Create a string for the Genre. This is required to display genre in Admin.""" # return ', '.join(type_of_injury.name for genre in self.type_of_injury.all()[:3]) # # display_injury_type.short_description = 'Type_Of_Injury' class DateInput(forms.DateInput): input_type = 'date' class BleedForm(ModelForm): class Meta: model = BleedInfo fields = ['title', 'patient', 'ticket_initated_by', 'summary', 'bleed_type', 'bleed_location', 'bleed_location_details', 'when_bleed_occured', 'extra_factor_yn', 'num_of_days_extra_factor_was_used', 'did_patient_use_factor_yn', 'why_patinet_did_not_use_facor', 'did_patient_use_home_factor_yn', 'home_factor_supply_details'] widgets = { 'when_bleed_occured': DateInput(), } class Injury(models.Model): """Model representing a book (but not a specific copy of a book).""" title = models.CharField(max_length=200) # Foreign Key used because book can only have one author, but authors can have multiple books # Author as a string rather than object because it hasn't been declared yet in the file person = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True) # User summary = models.TextField(max_length=1000, help_text='Enter a brief description of the book') # ManyToManyField used because genre can contain many books. Books can cover many genres. # Genre class has already been defined so we can specify the object above. # type_of_injury = models.ManyToManyField(Type_Of_Injury, help_text='Select a type of injury for this incident') injury_type = models.IntegerField(choices=BLEED_TYPE, default=1) def __str__(self): """String for representing the Model object.""" return self.title def get_absolute_url(self): """Returns the url to access a detail record for this injury.""" return reverse('injury-detail', args=[str(self.id)]) def display_injury_type(self): """Create a string for the Genre. This is required to display genre in Admin.""" return ', '.join(type_of_injury.name for genre in self.type_of_injury.all()[:3]) display_injury_type.short_description = 'Type_Of_Injury' class InjuryForm(ModelForm): class Meta: model = Injury fields = ['title', 'summary', 'injury_type'] class Book(models.Model): """Model representing a book (but not a specific copy of a book).""" title = models.CharField(max_length=200) # Foreign Key used because book can only have one author, but authors can have multiple books # Author as a string rather than object because it hasn't been declared yet in the file author = models.ForeignKey('Author', on_delete=models.SET_NULL, null=True) summary = models.TextField(max_length=1000, help_text='Enter a brief description of the book') isbn = models.CharField('ISBN', max_length=13, help_text='13 Character <a href="https://www.isbn-international.org/content/what-isbn">ISBN number</a>') # ManyToManyField used because genre can contain many books. Books can cover many genres. # Genre class has already been defined so we can specify the object above. genre = models.ManyToManyField(Genre, help_text='Select a genre for this book') def __str__(self): """String for representing the Model object.""" return self.title def get_absolute_url(self): """Returns the url to access a detail record for this book.""" return reverse('book-detail', args=[str(self.id)]) def display_genre(self): """Create a string for the Genre. This is required to display genre in Admin.""" return ', '.join(genre.name for genre in self.genre.all()[:3]) display_genre.short_description = 'Genre' import uuid # Required for unique book instances from datetime import date class BookInstance(models.Model): """Model representing a specific copy of a book (i.e. that can be borrowed from the library).""" id = models.UUIDField(primary_key=True, default=uuid.uuid4, help_text='Unique ID for this particular book across whole library') book = models.ForeignKey('Book', on_delete=models.SET_NULL, null=True) imprint = models.CharField(max_length=200) due_back = models.DateField(null=True, blank=True) borrower = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True) @property def is_overdue(self): if self.due_back and date.today() > self.due_back: return True return False LOAN_STATUS = ( ('m', 'Maintenance'), ('o', 'On loan'), ('a', 'Available'), ('r', 'Reserved'), ) status = models.CharField( max_length=1, choices=LOAN_STATUS, blank=True, default='m', help_text='Book availability', ) class Meta: ordering = ['due_back'] permissions = (("can_mark_returned", "Set book as returned"),) def __str__(self): """String for representing the Model object.""" return f'{self.id} ({self.book.title})' class Meta: ordering = ['due_back'] permissions = (("can_mark_returned", "Set book as returned"),) def __str__(self): """String for representing the Model object.""" return f'{self.id} ({self.book.title})' class Author(models.Model): """Model representing an author.""" first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) date_of_birth = models.DateField(null=True, blank=True) date_of_death = models.DateField('Died', null=True, blank=True) class Meta: ordering = ['last_name', 'first_name'] def get_absolute_url(self): """Returns the url to access a particular author instance.""" return reverse('author-detail', args=[str(self.id)]) def __str__(self): """String for representing the Model object.""" return f'{self.last_name}, {self.first_name}' class Person(models.Model): """Model representing an author.""" first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) date_of_birth = models.DateField(null=True, blank=True) date_of_death = models.DateField('Died', null=True, blank=True) class Meta: ordering = ['last_name', 'first_name'] def get_absolute_url(self): """Returns the url to access a particular author instance.""" return reverse('author-detail', args=[str(self.id)]) def __str__(self): """String for representing the Model object.""" return f'{self.last_name}, {self.first_name}'
991,333
99aea987557331db056e21b5139dd71ac51b4268
# users/urls.py from django.conf.urls import url from dashboard.views import CreateOrganisation from dashboard.views import OrganisationAPIView urlpatterns = [ url(r'^$', CreateOrganisation.as_view()), url('search/', OrganisationAPIView.as_view()) ]
991,334
cffbb7bf9591fd2dfc3b9d9e161779d4316dbd28
from lambdastack_lex import lexer from lambdastack_interp_gram import parser from lambdastack_state import state from lambdastack_interp_walk import walk from grammar_stuff import dump_AST def main(): while True: try: input_stream = input() except EOFError: return # initialize the state object state.initialize() # build the AST parser.parse(input_stream, lexer=lexer) # walk the AST #dump_AST(state.AST) walk(state.AST) main()
991,335
d2c34d45097c8829c7222fbd290b35888560e830
def show_info(name): print('이름:', name) #show_info('홍길동') # 이렇게 해버리면 import될때 자동으로 실행되어버린다 if __name__ == '__main__': # 이렇게 해야 python module3.py같이 밖에서 직접 실행할때만 실행되고 import될때는 실행되지않는다 show_info('홍길동')
991,336
9641c6a496a68af3743f177d3eaef02a63336c60
from pylab import * delta = 0.01 x = arange(-3.0, 3.0, delta) y = arange(-3.0, 3.0, delta) X,Y = meshgrid(x, y) Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1) Z = Z2 - Z1 # difference of Gaussians cmap = cm.get_cmap('rainbow', 10) # PiYG cmap_colors = cmap._segmentdata def print_hex(r,b,g): if not(0 <= r <= 255 or 0 <= b <= 255 or 0 <= g <= 255): raise ValueError('rgb not in range(256)') print('#%02x%02x%02x' % (r, b, g)) for i in range(len(cmap_colors['blue'])): r = int(cmap_colors['red'][i][2]*255) b = int(cmap_colors['blue'][i][2]*255) g = int(cmap_colors['green'][i][2]*255) print_hex(r, g, b) im = imshow(Z, cmap=cmap, interpolation='bilinear', vmax=abs(Z).max(), vmin=-abs(Z).max()) axis('off') colorbar() show()
991,337
bd8fc248544a10327c03f02d0399604a27e2e1c3
import requests # Loop over a file using the hint commend for line in open("ELECTION_ID"): # Download the csv addr = "http://historical.elections.virginia.gov/elections/download/{}/precincts_include:0/".format(line[5:10]) resp = requests.get(addr) # Set the format of name groups, it will show up election by election in 4 years file_name = "president_general_{}.csv".format(line[0:4]) with open(file_name, "w") as out: out.write(resp.text)
991,338
063944aad9553afb016e2a2f97d1e68f78dccc04
import gym import numpy as np import random import matplotlib.pyplot as plt import math from collections import deque import tensorflow as tf import tensorflow_quantum as tfq import cirq import sympy import time import datetime # https://stackoverflow.com/questions/10607688/how-to-create-a-file-name-with-the-current-date-time-in-python from circuit_builder import * from cirq.contrib.svg import SVGCircuit from make_path import * from collections import namedtuple, deque Transition = namedtuple('Transition', ('state', 'action', 'reward', 'next_state', 'done')) class QDQN_alt(object): def __init__(self, action_space, state_space, batch, no_qubits=4, no_layers=1) -> None: super().__init__() self.action_space = action_space self.n_layers= no_layers self.state_space = state_space self.no_qubits = no_qubits self.qubits = [cirq.GridQubit(0, i) for i in range(no_qubits)] self.q_network = self.make_pure_model() self.learning_rate = 0.01 self.opt = tf.keras.optimizers.Adam(lr=self.learning_rate) self.buff = 10000 self.batch = batch self.states = np.zeros((self.buff, self.state_space)) self.actions = np.zeros((self.buff, 1)) self.rewards = np.zeros((self.buff, 1)) self.dones = np.zeros((self.buff, 1)) self.next_states = np.zeros((self.buff, self.state_space)) # Q Learning self.gamma = 0.95 self.epsilon = 1.0 self.epsilon_decay = 0.9 self.epsilon_min = 0.01 self.counter = 0 self.date = datetime.date.today() self.model_name = "QDQN-{date}_qbits{q}_ADAM_lr{lr}_bs_{bs}_g{g}_eps{ep}_epsmin{epmin}_epsd{epd}".format( date=self.date, q=self.no_qubits,g=self.gamma, lr=self.learning_rate, bs=self.batch, ep=self.epsilon, epmin=self.epsilon_min, epd=self.epsilon_decay) self.msbe = None def make_pure_model(self): readout_operators = [cirq.Z(self.qubits[i]) for i in range(2,4)] inputs = tf.keras.Input(shape=(), dtype=tf.dtypes.string) diff = tfq.differentiators.ParameterShift() init = tf.keras.initializers.Zeros pqc = tfq.layers.PQC(self.make_circuit(self.qubits, self.n_layers), readout_operators, differentiator=diff, initializer=init)(inputs) model = tf.keras.Model(inputs=inputs, outputs=pqc) return model def make_hybrid_model(self): readout_operators = [cirq.Z(self.qubits[i]) for i in range(2,4)] diff = tfq.differentiators.ParameterShift() init = tf.keras.initializers.Zeros model = tf.keras.Sequential([tf.keras.Input(shape=(), dtype=tf.dtypes.string), tfq.layers.PQC(self.make_circuit_h(self.qubits, self.n_layers), readout_operators, differentiator=diff, initializer=init), tf.keras.layers.Dense(self.action_space)]) return model def convert_data(self, classical_data, flag=True): ops = cirq.Circuit() print(classical_data) binNum = bin(int(classical_data))[2:] outputNum = [int(item) for item in binNum] if len(outputNum) < 4: outputNum = np.concatenate((np.zeros((4-len(outputNum),)),np.array(outputNum))) else: outputNum = np.array(outputNum) for i, ang in enumerate(outputNum): ang = 0 if ang < 0 else 1 ops.append(cirq.rx(np.pi * ang).on(self.qubits[i])) ops.append(cirq.rz(np.pi * ang).on(self.qubits[i])) if flag: return tfq.convert_to_tensor([ops]) else: return ops def one_qubit_rotation(self, qubit, symbols): """ Returns Cirq gates that apply a rotation of the bloch sphere about the X, Y and Z axis, specified by the values in `symbols`. """ # print(symbols, "hi") return [cirq.rx(symbols[0])(qubit), cirq.ry(symbols[1])(qubit), cirq.rz(symbols[2])(qubit)] def two_qubit_rotation(self, bits, symbols): """Make a Cirq circuit that creates an arbitrary two qubit unitary.""" circuit = cirq.Circuit() circuit += cirq.Circuit(self.one_qubit_rotation(bits[0], symbols[0:3])) circuit += cirq.Circuit(self.one_qubit_rotation(bits[1], symbols[3:6])) circuit += [cirq.ZZ(*bits)**symbols[6]] circuit += [cirq.YY(*bits)**symbols[7]] circuit += [cirq.XX(*bits)**symbols[8]] circuit += cirq.Circuit(self.one_qubit_rotation(bits[0], symbols[9:12])) circuit += cirq.Circuit(self.one_qubit_rotation(bits[1], symbols[12:])) return circuit def entangling_layer(self, qubits): """ Returns a layer of CZ entangling gates (arranged in a circular topology). """ cz_ops = [cirq.CNOT(q0, q1) for q0, q1 in zip(qubits, qubits[1:])] cz_ops += ([cirq.CNOT(qubits[0], qubits[-1])] if len(qubits) != 2 else []) return cz_ops def quantum_pool_circuit(self, source_bits, sink_bits, symbols): """A layer that specifies a quantum pooling operation. A Quantum pool tries to learn to pool the relevant information from two qubits onto 1. """ circuit = cirq.Circuit() for source, sink in zip(source_bits, sink_bits): circuit += self.two_qubit_pool(source, sink, symbols) return circuit def two_qubit_pool(self, source_qubit, sink_qubit, symbols): pool_circuit = cirq.Circuit() sink_basis_selector = cirq.Circuit(self.one_qubit_rotation(sink_qubit, symbols[0:3])) source_basis_selector = cirq.Circuit(self.one_qubit_rotation(source_qubit, symbols[3:6])) pool_circuit.append(sink_basis_selector) pool_circuit.append(source_basis_selector) pool_circuit.append(cirq.CNOT(control=source_qubit, target=sink_qubit)) pool_circuit.append(sink_basis_selector**-1) return pool_circuit def make_circuit(self, qubits, n_layers): m = cirq.Circuit() n_qubits = len(qubits) # 4 qubits * 3 weights per bit * 3 layers + 2 * 6 pooling = 36 + 12 = 48 params_w_pool = sympy.symbols(f'theta(0:{3*(n_layers+1)*n_qubits + 2*3*n_qubits//2})') params = params_w_pool[:-2*3*n_qubits//2] params = np.asarray(params).reshape((n_layers + 1, n_qubits, 3)) inputs = sympy.symbols(f'x(0:{n_qubits})'+f'(0:{n_layers})') inputs = np.asarray(inputs).reshape((n_layers, n_qubits)) for l in range(n_layers): # Variational layer m += cirq.Circuit(self.one_qubit_rotation(q, params[l, i]) for i, q in enumerate(qubits)) m += self.entangling_layer(qubits) # Encoding layer m += cirq.Circuit(cirq.rx(inputs[l, i])(q) for i, q in enumerate(qubits)) m += cirq.Circuit(self.one_qubit_rotation(q, params[n_layers, i]) for i,q in enumerate(qubits)) # pooling pool_params = params_w_pool[-2*3*n_qubits//2:] sources= qubits[:n_qubits//2] sinks = qubits[n_qubits//2:] m += self.quantum_pool_circuit(sources, sinks, pool_params) print(m) return m def make_circuit_h(self, qubits, n_layers): m = cirq.Circuit() n_qubits = len(qubits) # 4 qubits * 3 weights per bit * 3 layers + 2 * 6 pooling = 36 + 12 = 48 params = sympy.symbols(f'theta(0:{3*(n_layers+1)*n_qubits })') params = np.asarray(params).reshape((n_layers + 1, n_qubits, 3)) inputs = sympy.symbols(f'x(0:{n_qubits})'+f'(0:{n_layers})') inputs = np.asarray(inputs).reshape((n_layers, n_qubits)) for l in range(n_layers): # Variational layer m += cirq.Circuit(self.one_qubit_rotation(q, params[l, i]) for i, q in enumerate(qubits)) m += self.entangling_layer(qubits) # Encoding layer m += cirq.Circuit(cirq.rx(inputs[l, i])(q) for i, q in enumerate(qubits)) m += cirq.Circuit(self.one_qubit_rotation(q, params[n_layers, i]) for i,q in enumerate(qubits)) print(m) return m def remember(self, state, action, reward, next_state, done): i = self.counter % self.buff self.states[i] = state self.actions[i] = action self.rewards[i] = reward self.next_states[i] = next_state self.dones[i] = int(done) self.counter += 1 def get_action(self, obs): if random.random() < self.epsilon: return np.random.choice(self.action_space) else: return np.argmax(self.q_network.predict(self.convert_data(obs))) # @tf.function def train(self): batch_indices = np.random.choice(min(self.counter, self.buff), self.batch) print(self.states[batch_indices]) state_batch = tfq.convert_to_tensor([self.convert_data(i[0], False) for i in self.states[batch_indices]]) action_batch = tf.convert_to_tensor(self.actions[batch_indices], dtype=tf.int32) action_batch = [[i, action_batch[i][0]] for i in range(len(action_batch))] reward_batch = tf.convert_to_tensor(self.rewards[batch_indices], dtype=tf.float32) dones_batch = tf.convert_to_tensor(self.dones[batch_indices], dtype=tf.float32) next_state_batch = tfq.convert_to_tensor([self.convert_data(i[0], False) for i in self.next_states[batch_indices]]) with tf.GradientTape() as tape: next_q = self.q_network(next_state_batch) next_q = tf.expand_dims(tf.reduce_max(next_q, axis=1), -1) y = reward_batch + (1 - dones_batch) * self.gamma * next_q q_guess = self.q_network(state_batch, training=True) pred = tf.gather_nd(q_guess, action_batch) pred = tf.reshape(pred, [self.batch, 1]) msbe = tf.math.reduce_mean(tf.math.square(y - pred)) self.msbe = msbe grads = tape.gradient(msbe, self.q_network.trainable_variables) self.opt.apply_gradients(zip(grads, self.q_network.trainable_variables)) if self.epsilon > self.epsilon_min: self.epsilon *= self.epsilon_decay ITERATIONS = 200 windows = 50 learn_delay = 2 qubits = [4] batch_sizes = 32 for q in qubits: losses = [] cur_loss = 1 env = gym.make("FrozenLake-v0") env.reset() env.seed(10) np.random.seed(10) random.seed(10) tf.random.set_seed(10) print(env.action_space, env.observation_space) agent = QDQN_alt(4, 16, batch_sizes, q, 3) cur_path = os.getcwd() cartpole_path = make_path(cur_path,"/frozen") print(cartpole_path) master_path = make_path(cartpole_path+"/", agent.model_name+"final") rewards = [] losses = [] cur_loss = 1 avg_reward = [] best_avg_reward = -math.inf for i in range(ITERATIONS): s1 = env.reset() print(s1) total_reward = 0 episode_losses=[] done = False episode_start = time.process_time() while not done: action = agent.get_action(s1) print(s1) s2, reward, done, info = env.step(action) total_reward += reward agent.remember(s1, action, reward, s2, done) if agent.counter > learn_delay and done: agent.train() episode_losses.append(agent.msbe) s1 = s2 rewards.append(total_reward) avg =0 if len(rewards)>windows: avg = np.mean(rewards[-windows:]) avg_reward.append(avg) if avg > best_avg_reward: best_avg_reward = avg if len(episode_losses)>0: EPISODE_LOSSES= np.asarray(episode_losses) AVERAGE_EPISODE_LOSS = np.mean(EPISODE_LOSSES) losses.append(AVERAGE_EPISODE_LOSS) cur_loss = AVERAGE_EPISODE_LOSS else: losses.append(cur_loss) print("\rEpisode {}/{} || Best average reward {}, Current Avg {}, Current Iteration Reward {}, eps {}".format(i, ITERATIONS, best_avg_reward, avg, total_reward, agent.epsilon), end='', flush=True) reward_file = "{h}/rewards".format(h = master_path) average_file = "{h}/averages".format(h=master_path) loss_file = "{h}/loss".format(h=master_path) np.save(reward_file , np.asarray(rewards)) np.save(average_file , np.asarray(avg_reward)) np.save(loss_file , np.asarray(losses)) plt.ylim(0,200) plt.plot(rewards, color='olive', label='Reward') plt.plot(avg_reward, color='red', label='Average') plt.legend() plt.ylabel('Reward') plt.xlabel('Generation') plt.show()
991,339
2a7e99b0995e896b97c9862990e9785b45343f7f
from django.db import models from django.db.models import Q, QuerySet, F from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from collective_blog import settings from collective_blog.utils.errors import PermissionCheckFailed from s_markdown.models import MarkdownField, HtmlCacheField from s_markdown.datatype import Markdown from s_markdown.renderer import BaseRenderer from s_markdown.extensions import (FencedCodeExtension, EscapeHtmlExtension, SemiSaneListExtension, StrikethroughExtension, AutomailExtension, AutolinkExtension, CommentExtension) from s_appearance.utils.icons import ICONS from s_voting.models import VoteCacheField from .post import PostVote from .comment import CommentVote from uuslug import uuslug class Blog(models.Model): name = models.CharField(max_length=100, verbose_name=_('Name'), unique=True) slug = models.SlugField(max_length=100, db_index=True, unique=True, blank=True, editable=False) about = MarkdownField(blank=True, markdown=Markdown, renderer=BaseRenderer( extensions=[ 'markdown.extensions.smarty', 'markdown.extensions.abbr', 'markdown.extensions.def_list', 'markdown.extensions.tables', 'markdown.extensions.smart_strong', FencedCodeExtension(), EscapeHtmlExtension(), SemiSaneListExtension(), StrikethroughExtension(), AutolinkExtension(), AutomailExtension(), CommentExtension(), ] ), verbose_name=_('About this blog')) _about_html = HtmlCacheField(about) icon = models.CharField(max_length=100, blank=True, choices=ICONS) TYPES = ( ('O', _('Open')), ('P', _('Private')), ) type = models.CharField(max_length=2, default='0', choices=TYPES, verbose_name=_('Type of the blog')) JOIN_CONDITIONS = ( ('A', _('Anyone can join')), ('K', _('Only users with high karma can join')), ('I', _('Manual approval required')) ) join_condition = models.CharField(max_length=2, default='A', choices=JOIN_CONDITIONS, verbose_name=_('Who can join the blog')) join_karma_threshold = models.SmallIntegerField(default=0, verbose_name=_( 'Join karma threshold')) POST_CONDITIONS = ( ('A', _('Anyone can add posts')), ('K', _('Only users with high karma can add posts')), ) post_condition = models.CharField(max_length=2, default='K', choices=POST_CONDITIONS, verbose_name=_('Who can add posts')) post_membership_required = models.BooleanField( default=True, verbose_name=_('Require membership to write posts')) post_admin_required = models.BooleanField( default=False, verbose_name=_('Only admins can write posts')) post_karma_threshold = models.SmallIntegerField( default=0, verbose_name=_('Post karma threshold')) COMMENT_CONDITIONS = ( ('A', _('Anyone can comment')), ('K', _('Only users with high karma can comment')), ) comment_condition = models.CharField(max_length=2, default='A', choices=COMMENT_CONDITIONS, verbose_name=_( 'Who can comment in the blog')) comment_membership_required = models.BooleanField( default=False, verbose_name=_('Require membership to write comments')) comment_karma_threshold = models.SmallIntegerField( default=0, verbose_name=_('Comment karma threshold')) members = models.ManyToManyField(settings.AUTH_USER_MODEL, through='Membership', editable=False) # Common methods # -------------- def save(self, force_insert=False, force_update=False, using=None, update_fields=None): self.slug = uuslug(self.name, instance=self, max_length=100, start_no=2, word_boundary=True, save_order=True) if not self.slug: self.slug = uuslug(self.heading + '_blog', instance=self, max_length=100, start_no=2, word_boundary=True, save_order=True) self.slug = self.slug.lower() super(Blog, self).save(force_insert, force_update, using, update_fields) class Meta: verbose_name = _("Blog") verbose_name_plural = _("Blogs") ordering = ("name",) def __str__(self): return str(self.name) # Permissions control # ------------------- def check_membership(self, user): """Check if the given user is a member of the blog""" if user.is_anonymous(): return None return Membership.objects.filter(blog=self, user=user).with_rating().first() @staticmethod def can_be_moderated_by(user): """Check if the user is a moderator with profile editing rights""" return user.is_active and user.is_staff and ( user.has_perm('blog.change_membership') or user.has_perm('blog.change_blog')) @staticmethod def is_banned(membership): """Check if the given user is banned in this blog No-members (membership==None) considered to be not banned. """ if membership is not None and not membership.is_left(): return membership.is_banned() else: return False @staticmethod def check_can_change_settings(membership): """Check if the given user has permissions to change settings No-members (membership==None) considered to have no rights. """ if membership is not None and not membership.is_left(): return membership.can_change_settings() else: return False @staticmethod def check_can_delete_posts(membership): """Check if the given user has permissions delete posts in the blog No-members (membership==None) considered to have no rights. """ if membership is not None and not membership.is_left(): return membership.can_delete_posts() else: return False @staticmethod def check_can_delete_comments(membership): """Check if the given user has permissions delete comments in the blog No-members (membership==None) considered to have no rights. """ if membership is not None and not membership.is_left(): return membership.can_delete_comments() else: return False @staticmethod def check_can_ban(membership): """Check if the given user has permissions to ban members of the blog No-members (membership==None) considered to have no rights. """ if membership is not None and not membership.is_left(): return membership.can_ban() else: return False @staticmethod def check_can_accept_new_users(membership): """Check if the given user has permissions to can accept new users No-members (membership==None) considered to have no rights. """ if membership is not None and not membership.is_left(): return membership.can_accept_new_users() else: return False @staticmethod def check_can_manage_permissions(membership): """Check if the given user has permissions to manage permissions of other users. No-members (membership==None) considered to have no rights. """ if membership is not None and not membership.is_left(): return membership.can_manage_permissions() else: return False def check_can_post(self, user): """Check if the given user has permissions to add posts to this blog""" if not user.is_active or user.is_anonymous(): return False membership = self.check_membership(user) if ((self.type != 'O' or self.post_membership_required or self.post_admin_required) and (membership is None or membership.is_banned() or membership.is_left())): return False elif self.post_admin_required and membership.role not in ['O', 'A']: return False elif (self.post_condition == 'K' and user.profile.karma < self.post_karma_threshold): return False else: return True def check_can_comment(self, user): """Check if the given user has permissions to add comments to this blog""" if not user.is_active or user.is_anonymous(): return False membership = self.check_membership(user) if ((self.type != 'O' or self.comment_membership_required) and (membership is None or membership.is_banned() or membership.is_left())): return False elif (self.comment_condition == 'K' and user.profile.karma < self.post_karma_threshold): return False else: return True def check_can_join(self, user): """Checks if the user can join the blog Note that joining process should go through the special method. Note also that this method returns `True` for blogs with manual approval required. Makes database queries: `check_membership` and karma calculation. """ if not user.is_active or user.is_anonymous(): return False membership = self.check_membership(user) if membership is not None and not membership.is_left(): return False # Already joined if self.join_condition == 'A': return True elif self.join_condition == 'K': return user.profile.karma >= self.join_karma_threshold elif self.join_condition == 'I': return True # Can send a request else: return False # Actions # ------- def join(self, user, role=None): """Add the user to the blog's membership :param user: User which wants to be a member. :param role: Force the role of the user. Ignore join conditions. Does change the role of the users who already joined. :return: Message or None if the role passed. :raises PermissionCheckFailed: If the user can't join the blog. """ if self.check_can_join(user) or role is not None: membership, c = Membership.objects.get_or_create(user=user, blog=self) if c: post_rating = PostVote.objects.filter(object__author=user, object__blog=self).score() membership.overall_posts_rating = post_rating comment_rating = CommentVote.objects.filter(object__author=user, object__post__blog=self).score() membership.overall_comments_rating = comment_rating if role is not None: membership.role = role membership.save() return if membership.role == 'LB': membership.role = 'B' membership.save() return _("Success. You are still banned, though") elif membership.role != 'L': return _("You've already joined to the=is blog") elif self.join_condition == 'I': membership.role = 'W' membership.save() return _("A request has been sent") else: membership.role = 'M' membership.save() return _("Success") else: raise PermissionCheckFailed(_("You can't join this blog")) def leave(self, user): """Remove the user to the blog's membership :param user: User which wants to leave. """ membership = self.check_membership(user) if membership is not None and membership.role != 'O': if membership.role == 'B': membership.role = 'LB' else: membership.role = 'L' membership.save() class MembershipQuerySet(QuerySet): """Queryset of votes Allows for routine operations like getting overall rating etc. """ def with_rating(self): """Annotate rating of the member""" return self.annotate( rating=F('overall_posts_rating') * 10 + F('overall_comments_rating') ) class MembershipManager(models.Manager): """Wrap objects to the `MembershipQuerySet`""" def get_queryset(self): return MembershipQuerySet(self.model) def _overall_posts_rating_cache_query(v): return Q(user__pk=v.object.author.pk) & Q(blog__pk=v.object.blog.pk) def _overall_comments_rating_cache_query(v): return Q(user__pk=v.object.author.pk) & Q(blog__pk=v.object.post.blog.pk) class Membership(models.Model): """Members of blogs""" user = models.ForeignKey(settings.AUTH_USER_MODEL, models.CASCADE) blog = models.ForeignKey(Blog, models.CASCADE) COLORS = ( ('gray', _('Gray')), ('black', _('Black')), ('blue', _('Blue')), ('orange', _('Orange')), ('purple', _('Purple')), ('marshy', _('Marshy')), ('turquoise', _('Turquoise')), ('red', _('Red')), ('yellow', _('Yellow')), ('green', _('Green')), ) color = models.CharField(max_length=10, choices=COLORS, default='gray') ROLES = ( ('O', _('Owner')), ('M', _('Member')), ('B', _('Banned')), ('A', _('Administrator')), ('W', _('Waiting for approval')), ('L', _('Left the blog')), ('LB', _('Left the blog (banned)')), ) ROLE_ORDERING = dict(O=0, A=2, W=3, M=4, B=5, LB=5, L=6) role = models.CharField(max_length=2, choices=ROLES, default='L') ban_expiration = models.DateTimeField(default=timezone.now) can_change_settings_flag = models.BooleanField( default=False, verbose_name=_("Can change blog's settings")) can_delete_posts_flag = models.BooleanField( default=False, verbose_name=_("Can delete posts")) can_delete_comments_flag = models.BooleanField( default=False, verbose_name=_("Can delete comments")) can_ban_flag = models.BooleanField( default=False, verbose_name=_("Can ban a member")) can_accept_new_users_flag = models.BooleanField( default=False, verbose_name=_("Can accept new users")) can_manage_permissions_flag = models.BooleanField( default=False, verbose_name=_("Can manage permissions")) overall_posts_rating = VoteCacheField(PostVote, _overall_posts_rating_cache_query) overall_comments_rating = VoteCacheField(CommentVote, _overall_comments_rating_cache_query) # Common methods # -------------- objects = MembershipManager() class Meta: unique_together = ('user', 'blog') def __str__(self): return str(self.user) + ' in ' + str(self.blog) # Permissions control # ------------------- def can_be_banned(self): return self.role in ['M', 'B', 'LB'] def ban(self, time=None): if self.can_be_banned(): if time is None: self.role = 'B' else: self.ban_expiration = timezone.now() + time self.save() def unban(self): if self.can_be_banned(): self.role = 'M' self.ban_expiration = timezone.now() self.save() def is_banned(self): return self.role == 'B' or self.ban_expiration >= timezone.now() def ban_is_permanent(self): return self.role == 'B' def is_left(self): return self.role in ['L', 'LB'] def _common_check(self, flag): """Check that the member can perform an action Here to reduce code duplication. """ has_perms = self.user.is_active and self.user.is_staff and ( self.user.has_perm('blog.change_membership') or self.user.has_perm('blog.change_blog')) return has_perms or (self.role in ['O', 'A'] and not self.is_left() and not self.is_banned() and (flag or self.role == 'O')) def can_change_settings(self): return self._common_check(self.can_change_settings_flag) def can_delete_posts(self): return self._common_check(self.can_delete_posts_flag) def can_delete_comments(self): return self._common_check(self.can_delete_comments_flag) def can_ban(self): return self._common_check(self.can_ban_flag) def can_accept_new_users(self): return self._common_check(self.can_accept_new_users_flag) def can_manage_permissions(self): return self._common_check(self.can_manage_permissions_flag)
991,340
1f94005e306b8d4827fd23377469105a9ddb3250
import unittest from osu.local.beatmap.beatmapIO import BeatmapIO from analysis.osu.std.map_data import StdMapData from analysis.osu.std.map_patterns import StdMapPatterns class TestStdMapPatterns(unittest.TestCase): @classmethod def setUpClass(cls): cls.beatmap = BeatmapIO.open_beatmap('unit_tests\\maps\\osu\\test\\abraker - unknown (abraker) [250ms].osu') cls.map_data = StdMapData.get_map_data(cls.beatmap.hitobjects) @classmethod def tearDown(cls): pass def test_detect_short_sliders_dist(self): short_sliders = StdMapPatterns.detect_short_sliders_dist(self.map_data, cs_px=4) def test_detect_short_sliders_time(self): short_sliders = StdMapPatterns.detect_short_sliders_time(self.map_data, min_time=100) def test_reinterpret_short_sliders(self): map_data = StdMapPatterns.reinterpret_short_sliders(self.map_data, min_time=100, cs_px=4)
991,341
b350f7e361c25d5acb106c29d759d89b0fe1f002
from bisect import bisect_left import WhiteListData, BlackListData import re class WhiteList: def __init__(self, sequenceList=[]): self.setChatType(0) self.setSequenceList(sequenceList) def setChatType(self, chatType): if chatType == 0: self.setWords(WhiteListData.WHITELIST) elif chatType == 1: self.setWords(BlackListData.BLACKLIST) self.chatType = chatType def setWords(self, words): self.words = words self.numWords = len(self.words) def setSequenceList(self, sequences): self.sequenceList = sequences def getSequenceList(self, word): return self.sequenceList[word] if word and word in self.sequenceList else None def cleanText(self, text): return text.strip('.,?!').lower() def isWord(self, text): return self.cleanText(text) in self.words def isPrefix(self, text): text = self.cleanText(text) i = bisect_left(self.words, text) try: word = self.words[i] except: return False if self.chatType == 0: return word.startswith(text) elif self.chatType == 1: return word != text def getReplacement(self, text, av=None): if not av: return '\x01red\x01%s\x02' % text elif av == base.localAvatar: return '\x01italic\x01%s\x02' % text else: return av.garble(len(text.split(' '))) def processText(self, text, av=None): if not self.words: return text words = text.split(' ') newWords = [] for word in words: if ((not word) or self.isWord(word)): replace = self.chatType == 1 else: replace = self.chatType == 0 if replace: newWords.append(self.getReplacement(word, av)) else: newWords.append(word) lastWord = words[-1] if not av: if (not lastWord) or self.isPrefix(lastWord): newWords[-1] = lastWord else: newWords[-1] = self.getReplacement(lastWord, av) return ' '.join(newWords) def processSequences(self, text, av=None): if not self.sequenceList: return text words = text.split(' ') for wordNum in xrange(len(words)): word = words[wordNum].lower() sequences = self.getSequenceList(word) if not sequences: continue for sequenceNum in xrange(len(sequences)): sequence = sequences[sequenceNum].split() total = wordNum + len(sequence) + 1 if total <= len(words) and sequence == [word.lower() for word in words[wordNum + 1:total]]: words[wordNum:total] = self.getReplacement(' '.join(words[wordNum:total]), av).split() return ' '.join(words) def processThroughAll(self, text, av=None): if (text.startswith('~') and not av): return text return self.processSequences(self.processText(re.sub(' +', ' ', text), av), av)
991,342
6ff8d7d416a22a5153597aafd48800715be7f4dc
from itertools import zip_longest def chunk(n, iterable, fillvalue=None): ''' Generate sequences of `chunk_size` elements from `iterable`. source: stackoverflow, 8991506 Usage: grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx ''' args = [iter(iterable)] * n return zip_longest(fillvalue=fillvalue, *args)
991,343
90bac200c066fbfdd9194de7d3b0aae1b6bfa430
import argparse from datetime import datetime,timedelta import glob import json import logging.config import os import pprint import re import shlex import signal import subprocess import sys import time import requests requests.packages.urllib3.disable_warnings() from sysmon_more import SysMonMore from configparser import ConfigParser from dateutil import tz from queue import Queue from threading import Thread # logging LOGGER = logging.getLogger('sme') LOGGER.setLevel(logging.DEBUG) LOGGER.propagate = False formatter = logging.Formatter('[%(levelname)s] %(message)s') handler = logging.StreamHandler() handler.setFormatter(formatter) handler.setLevel(logging.DEBUG) LOGGER.addHandler(handler) # MAX number of threads performing splunk searches #MAX_SEARCHES = 4 # Configuration file HOME_DIR = os.path.dirname(os.path.realpath(__file__)) CONFIG_PATH = os.path.join(HOME_DIR, 'etc', 'sme.ini') def clean_exit(signal, frame): print("\nExiting ..") sys.exit(0) signal.signal(signal.SIGINT, clean_exit) # custom ConfigParser to keep case sensitivity class CaseConfigParser(ConfigParser): def optionxform(self, optionstr): return optionstr class SysMonElasticsearch(object): def __init__(self): self.config = CaseConfigParser() # load configuration try: self.config.read('etc/sme.ini') except Exception as e: logging.fatal("unable to load configuration from {0}: {1}".format( 'etc/config.ini', str(e))) sys.exit(1) # initialize logging try: logging.config.fileConfig('etc/logging.ini') except Exception as e: sys.stderr.write("ERROR: unable to load logging config from {0}: {1}".format( 'etc/logging.ini', str(e))) sys.exit(1) def search_to_json(self,search,index,filter_script,fields,earliest,latest,use_index_time,max_result_count): search_json = { 'query': { 'bool': { 'filter': [ { 'query_string': { 'query': search } }, self.get_time_spec_json(earliest,latest,use_index_time) ] } } } if fields: search_json['_source'] = fields.split(',') #allow for index to not be set, many companies will create a field for the index alias instead of using elasticsearch's index pattern and just alias * if index: search_uri = "{}{}/_search".format(CONFIG['elk']['uri'],index) else: search_uri = "{}{}/_search".format(CONFIG['elk']['uri'],"*") if filter_script: script = { 'script': { 'script' : filter_script } } search_json['query']['bool']['filter'].append(script) # set max result count if max_result_count is None: max_result_count = self.config['rule'].getint('max_result_count') search_json['size'] = max_result_count return search_json,search_uri def simple_search_json(self,search,host=None,earliest='now-365d',latest='now'): if 'log_source_identifier' in self.config['elk'].keys() and 'log_source_identifier_value' in self.config['elk'].keys(): index = "{}:{}".format(self.config['elk']['log_source_identifier'],self.config['elk']['log_source_identifier_value']) if index not in search: search = "{} AND ({})".format(index,search) if host: search = "{}:{} AND {}".format(self.config['event_id_1']['Computer'],host,search) search_json = { 'query': { 'bool': { 'filter': [ { 'query_string': { 'query': search } } , { "range": { self.config['elk']['event_time_field']: { "gt": earliest, "lte": latest } } } ] } } } search_json['size'] = 10000 return search_json def perform_query(self,search_json): # perform query search_uri = "{}{}/_search".format(self.config['elk']['uri'],self.config['elk']['index']) logging.info("executing search {}".format(json.dumps(search_json))) logging.debug("{}".format(json.dumps(search_json))) headers = {'Content-type':'application/json'} search_result = requests.get(search_uri,data=json.dumps(search_json),headers=headers,verify=False) if search_result.status_code != 200: logging.error("search failed for {0}".format(json.dumps(search_json))) logging.error(search_result.text) return False logging.debug("result messages: timed_out:{} - took:{} - _shards:{}".format(search_result.json()['timed_out'],search_result.json()['took'],search_result.json()['_shards'])) return search_result def print_query(self, search): jsonsearch = self.simple_search_json(search,earliest='now-30d') print("executing search ...") results = self.perform_query(jsonsearch) hits = results.json()["hits"]["hits"] total = results.json()['hits']['total'] answer = 'Y' print("{} process segments found.".format(total)) if total > 100: answer = input("Print process segments? (Y/N):") if answer.lower() == 'y' and total > 0: for event in hits: self.print_critical_process_data(event['_source']) def print_critical_process_data(self,event): spaces = " " print() print("{}-------------------------".format(spaces)) for conf,val in self.config.items('sme'): #print("{}:{}".format(conf,val)) if val in event.keys(): print("{}{}: {}".format(spaces,val,event[val])) def print_config_section(self,event,config_section_name): spaces = " " output = "" for conf,val in self.config.items(config_section_name): if val in event.keys(): if len(output) == 0: output = "{}{} |".format(spaces,event[val]) else: output = "{} {} |".format(output,event[val]) # remove last | output = output[0:len(output)-2] print(output) def sanitize_guid(self,guid): guid = guid.replace("\\","") guid = guid.replace("}","") guid = guid.replace("{","") if len(guid) != 36: logging.error("ERROR: {} is not a guid. GUID format is as follows {}".format(guid,"{1D9C98A5-B153-5C1A-0000-0010E11F850A}")) sys.exit(1) guid = "\\{"+guid+"\\}" return guid def print_tree(self,guid,yarascan=False): # get all related info from elasticsearch for this guid smm = self.get_es_data(guid) smm.print_guid(guid,alldata=True) if yarascan: smm.scan_all() def walk_entire_tree(self,guid,yarascan=False): smm = self.get_es_data(guid) guid = self.sanitize_guid(guid) guid = guid.replace("\\","") smm.print_entire_process_tree(smm.get_host(guid),guid,"details") print() if yarascan: smm.scan_all() def child_crawler(self,smm,guid,depth,host,earliest=None,latest=None): if depth > int(self.config['main']['max_level_walk']): return else: depth += 1 search = "{}:{}".format(self.config['event_id_1']['ParentProcessGuid'],self.sanitize_guid(guid)) results = None if earliest and latest: results = self.perform_query(self.simple_search_json(search,host,earliest=earliest,latest=latest)) else: results = self.perform_query(self.simple_search_json(search,host)) hits = results.json()["hits"]["hits"] total = results.json()['hits']['total'] logging.debug("{} results.".format(total)) # add the events to sysmon_more for event in hits: smm.add_event(event['_source']) for event in hits: self.child_crawler(smm,event['_source'][self.config['event_id_1']['ProcessGuid']],depth,host,earliest=earliest,latest=latest) return # query elasticsearch, pull ancestry info for all types of events def get_es_data(self,guid): smm = SysMonMore(config=self.config) # find all events for this process guid search = self.findAllProcesses(self.sanitize_guid(guid)) logging.debug("executing search {}".format(search)) results = self.perform_query(self.simple_search_json(search)) hits = results.json()["hits"]["hits"] total = results.json()['hits']['total'] logging.debug("{} results.".format(total)) parent_guid = None host = None latest = earliest = None # add the events to sysmon_more #print(hits) for event in hits: data = event['_source'] if self.config['elk']['event_time_field'] in data.keys(): # only searching across a specific period of time should help performance for children/parent queries event_time = datetime.strptime(data[self.config['elk']['event_time_field']],"%Y-%m-%dT%H:%M:%S.%fZ") earliest = str((event_time - timedelta(days=1)).strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3]) latest = str((event_time + timedelta(days=1)).strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3]) if self.config['event_id_1']['Computer'] in data.keys(): host = data[self.config['event_id_1']['Computer']] if self.config['event_id_1']['ParentProcessGuid'] in data.keys(): parent_guid = data[self.config['event_id_1']['ParentProcessGuid']] smm.add_event(data) # find all children's children's etc processes of the guid self.child_crawler(smm,guid,1,host,earliest=earliest,latest=latest) # get Parents - we should already have the Parent from the initial query while parent_guid is not None: #search = "{}:{}".format(self.config['event_id_1']['ProcessGuid'],self.sanitize_guid(parent_guid)) search = self.findAllProcesses(self.sanitize_guid(parent_guid)) results = self.perform_query(self.simple_search_json(search,host,earliest,latest)) hits = results.json()["hits"]["hits"] total = results.json()['hits']['total'] logging.debug("{} results.".format(total)) parent_guid = None for event in hits: smm.add_event(event['_source']) # a process should have 1 unique parent guid if self.config['event_id_1']['ParentProcessGuid'] in event['_source'].keys(): parent_guid = event['_source'][self.config['event_id_1']['ParentProcessGuid']] return smm def findAllProcesses(self, guid): # take into account that process id is potentially in a few different fields search = "{}:{}".format(self.config['event_id_1']['ProcessGuid'],guid) search = "{} OR {}:{}".format(search,self.config['event_id_8']['SourceProcessGuid'],guid) return search def print_process(self, guid): guid = self.sanitize_guid(guid) # take into account that process id is potentially in a few different fields search = self.findAllProcesses(guid) logging.debug("executing search {}".format(search)) jsonsearch = self.simple_search_json(search) results = self.perform_query(jsonsearch) hits = results.json()["hits"]["hits"] total = results.json()['hits']['total'] logging.debug("{} results.".format(total)) process = {} for event in hits: eventid = event['_source'][self.config['sysmon']['EventID']] if eventid not in process.keys(): process[eventid] = [] process[eventid].append(event['_source']) for eventid in process.keys(): if eventid == 1: print(" ==== PROCESS ====") for item in process[eventid]: self.print_critical_process_data(item) if eventid == 2: print(" ==== FILE CREATION CHANGED ====") for item in process[eventid]: self.print_config_section(item,'event_id_2') if eventid == 3: print(" ==== NETCONNS ====") for item in process[eventid]: self.print_config_section(item,'event_id_3') if eventid == 5: logging.debug("EventID 5, process termination, skipping {}".format(hits)) if eventid == 6: print(" ==== DRIVER LOADED ====") for item in process[eventid]: self.print_config_section(item,'event_id_6') if eventid == 7: print(" ==== IMAGE LOADED ====") for item in process[eventid]: self.print_config_section(item,'event_id_7') if eventid == 8: print(" ==== CREATEREMOTETHREAD ====") for item in process[eventid]: self.print_config_section(item,'event_id_8') if eventid == 9: print(" ==== RAWACCESSREAD ====") for item in process[eventid]: self.print_config_section(item,'event_id_9') if eventid == 10: print(" ==== PROCESSACCESS ====") for item in process[eventid]: self.print_config_section(item,'event_id_10') if eventid == 11: print(" ==== FILECREATE ====") for item in process[eventid]: self.print_config_section(item,'event_id_11') if eventid == 12 or eventid == 13 or eventid == 14: print(" ==== REGMOD ====") for item in process[eventid]: self.print_config_section(item,'event_id_12') if eventid == 17 or eventid == 18: print(" ==== PIPEMOD ====") for item in process[eventid]: self.print_config_section(item,'event_id_17') if eventid == 19: print(" ==== WMIEVENTFILTER ====") for item in process[eventid]: self.print_config_section(item,'event_id_19') if eventid == 20: print(" ==== WMIEVENTCONSUMER ====") for item in process[eventid]: self.print_config_section(item,'event_id_20') if eventid == 21: print(" ==== WMIEVENTCONSUMERTOFILTER ====") for item in process[eventid]: self.print_config_section(item,'event_id_21') print() def main(): parser = argparse.ArgumentParser(description="An interface to sysmon data in elasticsearch") #profiles = auth.CredentialStore("response").get_profiles() #parser.add_argument('-e', '--environment', choices=auth.CredentialStore("response").get_profiles(), # help='specify an environment you want to work with. Default=All \'production\' environments') #parser.add_argument('--debug', action='store_true', help='print debugging info') #parser.add_argument('--warnings', action='store_true', # help="Warn before printing large executions") subparsers = parser.add_subparsers(dest='command') #title='subcommands', help='additional help') interface_commands = [ 'query', 'proc'] parser_proc = subparsers.add_parser('proc', help="analyze a process GUID. 'proc -h' for more") parser_proc.add_argument('process', help="the process GUID to analyze") #parser_proc.add_argument('--warnings', action='store_true', # help="Warn before printing large executions") parser_proc.add_argument('-a', '--ancestry', action='store_true', help="show children, process, parent, grandparent, and greatgrandparent full analysis") parser_proc.add_argument('-w', '--walk-tree', action='store_true', help="show children, process, parent, grandparent, and greatgrandparent full analysis") parser_proc.add_argument('-y', '--yara', action="store_true", dest='yarascan', help="scan ancestry with yara (rules directory configuration is required)") #parser_proc.add_argument('-wp', '--walk-parents', action='store_true', # help="print details on the process ancestry") #parser_proc.add_argument('-d', '--detection', action='store_true', # help="show detections that would result in ACE alerts") #parser_proc.add_argument('-i', '--proc-info', action='store_true', # help="show binary and process information") #parser_proc.add_argument('-c','--show-children', action='store_true', # help="only print process children event details") #parser_proc.add_argument('-nc', '--netconns', action='store_true', # help="print network connections") #parser_proc.add_argument('-fm', '--filemods', action='store_true', # help="print file modifications") #parser_proc.add_argument('-rm', '--regmods', action='store_true', # help="print registry modifications") #parser_proc.add_argument('-um', '--unsigned-modloads', action='store_true', # help="print unsigned modloads") #parser_proc.add_argument('-ml', '--modloads', action='store_true', # help="print modloads") #parser_proc.add_argument('-cp', '--crossprocs', action='store_true', # help="print crossprocs") #parser_proc.add_argument('-intel', '--intel-hits', action='store_true', # help="show intel (feed/WL) hits that do not result in ACE alerts") #parser_proc.add_argument('--no-analysis', action='store_true', # help="Don't fetch and print process activity") #parser_proc.add_argument('--json', action='store_true', help='output process summary in json') facet_args = [ 'process_name', 'childproc_name', 'username', 'parent_name', 'path', 'hostname', 'parent_pid', 'comms_ip', 'process_md5', 'start', 'group', 'interface_ip', 'modload_count', 'childproc_count', 'cmdline', 'regmod_count', 'process_pid', 'parent_id', 'os_type', 'rocessblock_count', 'crossproc_count', 'netconn_count', 'parent_md5', 'host_type', 'last_update', 'filemod_count' ] parser_query = subparsers.add_parser('query', help="execute a process search query. 'query -h' for more") parser_query.add_argument('query', help="the process search query you'd like to execute") parser_query.add_argument('-s', '--start-time', action='store', help="Only return processes with events after given date/time stamp\ (server’s clock). Format:'Y-m-d H:M:S' eastern time") parser_query.add_argument('-e', '--end-time', action='store', help="Set the maximum last update time. Format:'Y-m-d H:M:S' eastern time") parser_query.add_argument('--facet', action='store', choices=facet_args, help='stats info on single field accross query results (ex. process_name)') parser_query.add_argument('--no-warnings', action='store_true', help="Don't warn before printing large query results") parser_query.add_argument('-lh', '--logon-history', action='store_true', help="Display available logon history for given username or hostname") args = parser.parse_args() if args.command is None: print("\n\n*****") print("You must specify one of the following commands:\n") print(interface_commands) print("\n*****\n\n") parser.parse_args(['-h']) #args.debug = True #if args.debug: # configure some more logging #root = logging.getLogger() #root.addHandler(logging.StreamHandler()) #logging.getLogger("cbapi").setLevel(logging.ERROR) #logging.getLogger("lerc_api").setLevel(logging.WARNING) logging.getLogger("sme").setLevel(logging.INFO) # ignore the proxy if 'https_proxy' in os.environ: del os.environ['https_proxy'] # Process Quering # if args.command == 'query': es = SysMonElasticsearch() es.print_query(args.query) return 0 # lerc install arguments can differ by company/environment # same lazy hack to define in cb config config = {} try: default_profile = auth.default_profile default_profile['lerc_install_cmd'] = None config = auth.CredentialStore("response").get_credentials(profile=profile) except: pass # Process Investigation # process_tree = None if args.command == 'proc': # search where proccess_guid = guid es = SysMonElasticsearch() if args.ancestry: if args.yarascan: es.print_tree(args.process,yarascan=True) else: es.print_tree(args.process) elif args.walk_tree: if args.yarascan: es.walk_entire_tree(args.process,yarascan=True) else: es.walk_entire_tree(args.process) else: es.print_process(args.process) print() return True if __name__ == "__main__": print(time.ctime() + "... starting") result = main() if result: print(time.ctime() + "... Done.") sys.exit(result)
991,344
0a8dbeae3d3320b132c5827a28f8eabef4f9a42e
from flask_restful import Resource from flask_login import login_required,current_user from flask import request from .models import Post from app import db class Index(Resource): def get(self): return {"message":"Hello World"} class Article(Resource): decorators = [login_required] def post(self): title = request.form['title'] body = request.form['body'] article = Post(title=title,body=body) article.author = current_user db.session.add(article) db.session.commit() return { "message":"add article successful." }
991,345
cb9a55072ccfd0257e7f2e81ab10e1d00d64dbd0
''' this is the module that consumes assumption files and process the raw input''' class Assumptions(): def __init__(self, assumption_filename): self.assumption_filename = assumption_filename def mortality(self): """return a class of mortality curve object""" pass def lapse(self): """return a class of lapse curve object""" pass # TODO: clearly define what needs to be here
991,346
6907bff43fa8e3f0dc23eced4c684a496d76ed89
#!/home/antounes/anaconda3/bin/python3 #-*- coding: Utf-8 -*- # Algorithme d'exponentiation rapide # Etant donnés un réel positif a et un entier n, on remarque que : # a^n = # (a^(n/2))^2 si n est pair, # a*(a^(n-1)/2)^2 si n est impair. # Cet algorithme se programme naturellement par une fonction récursive def expo(a, n): if n == 0: return 1 else: if n%2 == 0: return expo(a, n//2)**2 else: return a*(expo(a, (n-1)//2)**2)
991,347
6d04c140172fcf20fe19b3796395dad01c362b56
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : quickstart_demo0.py @Time : 2020/10/29 15:25:16 @Author : Jeffrey Wang @Version : 1.0 @Contact : shwangjj@163.com @Desc : 官方QuickStart第1个策略示例 买入的尝试,如果价格连续跌两天则买入,如果持仓5天则卖出 加入手续费的概念 ''' import backtrader as bt import bc_study.tushare_csv_datafeed as ts_df # 演示用策略,每日输出开盘价 class TestStrategy(bt.Strategy): def log(self, txt, dt=None): ''' Logging function for this strategy''' dt = dt or self.datas[0].datetime.date(0) print('%s, %s' % (dt.isoformat(), txt)) def __init__(self): # Keep a reference to the "open" line in the data[0] dataseries self.dataopen = self.datas[0].open print("TestStrategy init function called") def notify_order(self, order): # self.log("func notify_order :") if order.status in [order.Submitted, order.Accepted]: # Buy/Sell order submitted/accepted to/by broker - Nothing to do return # Check if an order has been completed # Attention: broker could reject order if not enough cash if order.status in [order.Completed]: if order.isbuy(): self.log('BUY EXECUTED, %.2f' % order.executed.price) elif order.issell(): self.log('SELL EXECUTED, %.2f' % order.executed.price) self.bar_executed = len(self) elif order.status in [order.Canceled, order.Margin, order.Rejected]: self.log('Order Canceled/Margin/Rejected') # Write down: no pending order self.order = None def notify_trade(self, trade): if not trade.isclosed: return self.log('OPERATION PROFIT, GROSS %.2f, NET %.2f' % (trade.pnl, trade.pnlcomm)) def next(self): # Simply log the closing price of the series from the reference self.log('Open, %.2f' % self.dataopen[0]) # self.log('LEN OF STY = {0}'.format( len(self) )) self.log('position = {0}'.format(self.position)) if not self.position: if self.dataopen[0] < self.dataopen[-1]: if self.dataopen[-1] < self.dataopen[-2]: # BUY, BUY, BUY!!! (with all possible default parameters) self.log('BUY CREATE, %.2f' % self.dataopen[0]) self.buy() else: # Already in the market ... we might sell if len(self) >= (self.bar_executed + 5): # SELL, SELL, SELL!!! (with all possible default parameters) self.log('SELL CREATE, %.2f' % self.dataopen[0]) # Keep track of the created order to avoid a 2nd order self.order = self.sell() # if self.position: # print("{0}".format(self.position)) # 打印交易后的资金市值 # next中只是下单,还未成交 # print('Portfolio Value: %.2f' % self.cerebro.broker.getvalue()) # 启动回测 def engine_run(): # 初始化引擎 cerebro = bt.Cerebro() # 给Cebro引擎添加策略 cerebro.addstrategy(TestStrategy) # 设置初始资金: cerebro.broker.setcash(200000.0) # Set the commission - 0.1% ... divide by 100 to remove the % cerebro.broker.setcommission(commission=0.001) # 从csv文件加载数据 data = ts_df.get_csv_daily_data(stock_id="600016.SH") cerebro.adddata(data) print('Starting Portfolio Value: %.2f' % cerebro.broker.getvalue()) # 回测启动运行 cerebro.run() print('Final Portfolio Value: %.2f' % cerebro.broker.getvalue()) # cerebro.plot() if __name__ == '__main__': # get_data() engine_run()
991,348
26ff9ccf035c6dd70c114584b282ec9cf03644d2
#!/usr/bin/env python import ast import pickle import pprint import os import os.path import random import string import sys import numpy as np from scipy.io import savemat, loadmat from skimage.io import imread, imsave import skimage.measure import skimage.segmentation ################################################################################# ## Setup ################################################################################# if not len(sys.argv) == 4: print('./index.py image_path flattened_path map.txt') sys.exit() image_dirname = sys.argv[1] label_dirname = sys.argv[2] map_filename = sys.argv[3] # Load labels print('loading labels') label_names = ['empty'] with open(map_filename, 'r') as f: label_names += [x.split(': ')[1].strip() for x in f] # Get list of labels if os.path.exists('index.pickle'): print('index cache found, loading from cache') label_images = pickle.load(open('index.pickle', 'r')) else: print('no index cache found, generating index') label_images = dict([(x, []) for x in label_names]) for folder, subfolders, filenames in os.walk(label_dirname): for filename in filenames: print(' checking %s...' % os.path.join(folder, filename)) label_filename = os.path.join(folder, filename) try: label_image = loadmat(label_filename)['Label'] except KeyError: label_image = loadmat(label_filename)['LabelMap'] for label_int in np.unique(label_image): try: label_images[label_names[label_int]].append((os.path.splitext(filename)[0], label_filename, folder)) except IndexError: print('ERROR: Label index %d is out of range!' % label_int) print('caching index') pickle.dump(label_images, open('index.pickle', 'w')) # Get label sets print('collecting label sets') label_sets = set() for label_name in label_names: for image_name, label_filename, folder in label_images[label_name]: label_sets.add(folder) # Get list of changes if os.path.exists('changes.pickle'): print('change cache found, loading from cache') changes = pickle.load(open('changes.pickle', 'r')) else: print('no change cache found') changes = {} pickle.dump(changes, open('changes.pickle', 'w')) ################################################################################# ## Server ################################################################################# from index_template import index_template from results_template import results_template from flask import Flask, send_from_directory, request app = Flask('Label Explorer') @app.route('/') def get_index(): global label_names namespace = {'label_names': label_names} tmpl = index_template(searchList=[namespace]) return str(tmpl) @app.route('/change/<image_name>/<from_label>/to/', defaults={'to_label': ''}) @app.route('/change/<image_name>/<from_label>/to/<to_label>') def change_label(image_name, from_label, to_label): global changes print('to_label = %s' % to_label) if to_label == '': if changes.has_key((image_name, from_label)): del changes[(image_name, from_label)] else: changes[(image_name, from_label)] = to_label pickle.dump(changes, open('changes.pickle', 'w')) return '' @app.route('/regions/<path:filename>') def get_image(filename): return send_from_directory(os.path.join(os.getcwd(), 'regions'), filename) @app.route('/query/<query_label>') def get_label_examples(query_label): global label_names global label_sets global label_images global results_template if query_label not in label_names: return 'Could not find label "%s"!' % query_label query_image_index = label_names.index(query_label) query_image_list = label_images[query_label] if len(query_image_list) == 0: return 'No images found with label "%s"!' % query_label try: response_num = int(request.args.get('num')) except: response_num = 10 query_label_sets = set(label_sets) set_filter = request.args.get('set') if set_filter: query_label_sets = set([set_filter]) query_image_list = filter(lambda x: set_filter in x[2], query_image_list) change_filter = request.args.get('nochanges') if change_filter: query_image_list = filter(lambda x: not changes.has_key((x[0], query_label)) or changes[(x[0], query_label)] is '', query_image_list) response_num = min(len(query_image_list), response_num) random_images = random.sample(query_image_list, response_num) regions_metadata = [] for image_name, label_filename, label_folder in random_images: image_filename = os.path.join(image_dirname, '%s.jpg' % image_name) image = imread(image_filename) try: label_image = loadmat(label_filename)['Label'] except KeyError: label_image = loadmat(label_filename)['LabelMap'] image_rows, image_cols = label_image.shape regions = skimage.measure.regionprops(label_image) for region_index, region in enumerate(regions): if region.label != query_image_index: continue print('Processing image "%s", region %d...' % (label_filename, region_index)) # min_row, min_col, max_row, max_col = region.bbox # min_row = max(min_row - 10, 0) # min_col = max(min_col - 10, 0) # max_row = min(max_row + 10, image_rows) # max_col = min(max_col + 10, image_cols) # region_image = image[min_row:max_row, min_col:max_col] region_image = skimage.segmentation.mark_boundaries(image, label_image == region.label, color=(0, 1, 0)) region_filename = 'regions/%s-%s-%d.png' % (query_label, image_name, region_index) change_value = '' if changes.has_key((image_name, query_label)): change_value = changes[(image_name, query_label)] regions_metadata.append((image_name, region_filename, label_folder, change_value)) if not os.path.exists(region_filename): imsave(region_filename, region_image) namespace = dict(locals()) tmpl = results_template(searchList=[namespace]) return str(tmpl) if __name__ == '__main__': app.run(host='0.0.0.0', port=8888, debug=True)
991,349
40fa7e4fe59d3b6feb98a82d662b9df24e71283c
import keras import numpy as np from sklearn.preprocessing import OneHotEncoder from keras.models import Sequential from keras.layers import Dense, Activation, Conv2D, MaxPooling2D, Flatten, Dropout, BatchNormalization from keras.optimizers import Adam as Adam from keras.layers.advanced_activations import LeakyReLU import pandas as pd EPOCH = 1000 BATCH_SIZE = 512 alpha = 0.001 #learning rate CLASS = 40 WIDTH = 64 HEIGHT = 64 def deepCNN(): #Define the model: model = Sequential() #First layer model.add(Conv2D(16, (5, 5), input_shape=[WIDTH,HEIGHT,1] , strides = 1, padding='same')) model.add(LeakyReLU(alpha=0.3) ) model.add(BatchNormalization(axis=-1)) #2nd model.add(Conv2D(16, (5, 5), strides = 1, padding='same')) model.add(LeakyReLU(alpha=0.3) ) #Pool model.add(MaxPooling2D(pool_size=(2, 2), strides=2)) model.add(BatchNormalization(axis=-1)) #3rd model.add(Conv2D(32, (5, 5), strides = 1, padding='same')) model.add(LeakyReLU(alpha=0.3) ) #pool model.add(MaxPooling2D(pool_size=(2, 2), strides=2)) #4th model.add(Conv2D(32, (5, 5), strides = 1, padding='same')) model.add(LeakyReLU(alpha=0.3) ) #pool model.add(MaxPooling2D(pool_size=(2, 2), strides=2)) #Flatten model.add(Flatten()) model.add(BatchNormalization(axis=-1)) #Fully connected model.add(Dense(1024)) model.add(LeakyReLU(alpha=0.3) ) model.add(BatchNormalization(axis=-1)) #Dropout model.add(Dropout(0.4)) #Final output layer model.add(Dense(CLASS, activation ='softmax')) model.summary() model.compile(Adam(), loss = 'categorical_crossentropy', metrics=['accuracy'] ) return model def main(x, y, test_x, test_y, test, mapping): #Reshape x: model = deepCNN() model.fit(x, y, validation_data = (tx, ty), shuffle = True, epochs = EPOCH, batch_size = BATCH_SIZE, verbose = 2) model.save_weights('my_model_weights.h5') #Model prediction on testing data best = model.predict(test, batch_size = BATCH_SIZE) best = np.argmax(best, axis = 1) #Remap the indice of one hot encoded labels to its original label: remap = lambda x: mapping[x] best = best.tolist() best = [remap(indice) for indice in best] #Write to prediction file pred = pd.DataFrame(data=best) pred.index+=1 pred.to_csv("cnn_KERAS_1000.csv", sep=',', header=['Label'], index=True, index_label='ID', encoding='utf-8') if __name__ == '__main__': #load data file_x = "../data/newClean/train.csv" file_t = "../data/newClean/test.csv" tx = np.genfromtxt(file_x, delimiter = ' ', skip_header = 1) test = np.genfromtxt(file_t, delimiter = ' ', skip_header = 1) ty = tx[:, 0] tx = tx[:, 2:] test = test[:, 2:] #randomly shuffle tx: np.random.shuffle(tx) #Split train and test ind = int(tx.shape[0]/10*9.5) test_x = tx[ind:] test_y = ty[ind:] test_y = test_y.reshape(-1, 1) ty = ty.reshape(-1, 1) #one hot encode ty, test_y enc = OneHotEncoder() ty = enc.fit_transform(ty) test_y = enc.transform(test_y) ty = ty.toarray() test_y = test_y.toarray() tx = np.reshape(tx, (-1, WIDTH, HEIGHT, 1)) test_x = np.reshape(test_x, (-1, WIDTH, HEIGHT, 1)) test = np.reshape(test, (-1, WIDTH, HEIGHT, 1)) #Create a mapping between indice in one hot encoded labels to actual label labels = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 24, 25, 27, 28, 30, 32, 35, 36, 40, 42, 45, 48, 49, 54, 56, 63, 64, 72, 81] ind = [i for i in range(40)] mapping = dict() for i, l in zip(ind, labels): mapping[i] = l print(tx.shape) print(test_x.shape) print(test_y.shape) print(test.shape) print("___________________________Finished Loading data___________________________") main(tx, ty, test_x, test_y, test, mapping)
991,350
b40d0505c6681e47d0823bce2ff7e8e8164b2eeb
from collections import defaultdict from typing import List, Tuple # Given an array of size n, find the most common and the least common elements. # The most common element is the element that appears more than n // 2 times. # The least common element is the element that appears fewer than other. # You may assume that the array is non-empty and the most common element # always exist in the array. def major_and_minor_elem(elements_list: List[int]) -> Tuple[int, int]: elements_dict = defaultdict(int) for i in elements_list: elements_dict[i] += 1 result = (max(elements_dict, key=elements_dict.get)), ( min(elements_dict, key=elements_dict.get) ) return result
991,351
2fc0061a2f30f746d35fdb74034dfb0e76ea2429
# -*- coding: utf-8 -*- """ File Name: test02 Author : mengkai date: 2019/2/2 description: """ import tensorflow as tf import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # 定义输入和参数 x = tf.placeholder(tf.float32, shape=(1, 2)) w1 = tf.Variable(tf.random_normal([2, 3], stddev=1, seed=1)) w2 = tf.Variable(tf.random_normal([3, 1], stddev=1, seed=1)) # 定义前向传播过程 a = tf.matmul(x, w1) y = tf.matmul(a, w2) # 用会话计算结果 with tf.Session() as sess: init_op = tf.global_variables_initializer() sess.run(init_op) print("y in test02 is :\n", sess.run(y, feed_dict={x: [[0.7, 0.5]]}))
991,352
f6059cde4c9a0af3957d3e9724e6b13491ff7081
def even(x): if x % 2 == 0: return True else: return False def productnum(v, a, b, c): if a > b: return v elif even(c) or c == 0 or a == b: return productnum(v*a, a+2, b, c+1) else: return productnum(v*a, a, b, c+1) def productden(v, a, b, c): if a > b: return v elif even(c): return productden(v*a, a+2, b, c+1) else: return productden(v*a, a, b, c+1) def pi(n): x = productnum(1, 2, n, 0) y = productden(1,3, n-1,1) return 4 * ((x+.00)/y) #return (4 * (productnum(1,2,n,0) / productden(1, 3, n-1, 1))) def check(n): if even(n): return pi(n) else: return pi(n-1) print check(8) print check(100) print check(125) print check(150) print check(171)
991,353
e01f63b91f4f98a0bb290802beaf48ef386fc418
# import re # n=input()#行数 # print(n.isalpha()) # print(n[len(n)-1]) # print(''.join([s for s in n if s.isalpha()])) # for j in range(ord(n)): # input_lines = input() # print(input_lines) # for each in input_lines[j]: # print('test') n=ord(input("输入行数:\n")) stopword = '' str_line = '' for line in iter(input, stopword): str_line += line + '\n' a = str_line.split("\n") for i in range(len(a)): # print(a[i].isalpha()) # print(''.join([s for s in a[i] if s.isalpha()])) # print(''.join([s for s in a[i] if s.isalnum()])) # print (a[i] + ": " + str(i+1)) num=''.join([s for s in a[i] if s.isdigit()]) name=''.join([s for s in a[i] if s.isalpha()]) # print(num) if num=='3': print(name) # print(''.join([s for s in a[i] if s.isdigit()])) # # line = """qqq # sss # fff""" # a = line.split("\n") # for i in range(len(a)): # print (a[i] + ": " + str(i)) # a=input().lower() # b=input().lower() # print(a.count(b)) # input_lines = input() # print(input_lines[0::2])
991,354
7c383f093aa1b93f6ea2b94416beb3f3de0dae6b
from .sift import SIFT from .cm import ColorMoments from .hog import HOG from .lbp import LocalBP from .cavg import ColorAvg MODELS = {"cm": ColorMoments, "hog": HOG, "cavg": ColorAvg} def getSupportModel(): return list(MODELS.keys()) def creatModel(model, **kwargs): model = model.lower() if model in MODELS: return MODELS[model](**kwargs) else: raise Exception("Supported model: sift, cm, cavg, hog, lbp")
991,355
a9aadbb5929b3de8dafbb9373ad5bf55a371df50
# -*- coding: utf-8 -*- from PyQt4 import QtCore from PyQt4.QtGui import * class Ui_Main(object): def setupUi(self, Main): Main.setObjectName("Main") Main.resize(602, 402) # CentralWidget self.CentralWidget = QFrame(Main) # menubar menubar = Main.menuBar() file = menubar.addMenu('&File') # top self.topSplitter = QSplitter(self.CentralWidget) self.topSplitter.setOrientation(QtCore.Qt.Horizontal) # top :: left side self.listView = QListWidget(self.topSplitter) # sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) # sizePolicy.setHorizontalStretch(0) # sizePolicy.setVerticalStretch(0) # sizePolicy.setHeightForWidth(self.listView.sizePolicy().hasHeightForWidth()) # self.listView.setSizePolicy(sizePolicy) self.listView.setObjectName("listView") # top :: right side self.rightSplitter = QSplitter(self.topSplitter) self.rightSplitter.setOrientation(QtCore.Qt.Vertical) # top :: right side :: instance info self.instanceInfo_LayoutWidget = QWidget(self.rightSplitter) self.instanceInfo_Layout = QGridLayout(self.instanceInfo_LayoutWidget) # top :: right side :: instance info :: query display label and box self.queryDisplayLabel = QLabel(self.instanceInfo_LayoutWidget) self.instanceInfo_Layout.addWidget(self.queryDisplayLabel, 0, 0) self.queryDisplayBox = QLineEdit(self.instanceInfo_LayoutWidget) self.queryDisplayBox.setReadOnly(True) self.queryDisplayBox.setObjectName("queryDisplayBox") self.instanceInfo_Layout.addWidget(self.queryDisplayBox, 0, 1) # top :: right side :: instance info :: views display label and box self.viewsDisplayLabel = QLabel(self.instanceInfo_LayoutWidget) self.instanceInfo_Layout.addWidget(self.viewsDisplayLabel, 1, 0, QtCore.Qt.AlignTop) self.viewsDisplayBox = QListWidget(self.instanceInfo_LayoutWidget) self.viewsDisplayBox.setObjectName("viewsDisplayBox") self.instanceInfo_Layout.addWidget(self.viewsDisplayBox, 1, 1) # top :: right side :: solutions self.solutions_LayoutWidget = QWidget(self.rightSplitter) self.solutions_Layout = QVBoxLayout(self.solutions_LayoutWidget) # top :: right side :: solutions :: dnnf self.dnnf_Widget = QGroupBox() self.dnnf_Widget.setTitle("Intermediate Representation") self.solutions_Layout.addWidget(self.dnnf_Widget) self.dnnf_Layout = QVBoxLayout() self.dnnf_Widget.setLayout(self.dnnf_Layout) # top :: right side :: solutions :: dnnf :: dnnf label layout self.dnnf_LabelWidget = QWidget() self.dnnf_Layout.addWidget(self.dnnf_LabelWidget) self.dnnf_LabelLayout = QHBoxLayout() self.dnnf_LabelWidget.setLayout(self.dnnf_LabelLayout) # top :: right side :: solutions :: dnnf :: dnnf label layout :: dnnf label self.dnnfLabel = QLabel(self.dnnf_Widget) self.dnnf_LabelLayout.addWidget(self.dnnfLabel) # top :: right side :: solutions :: dnnf :: dnnf label layout :: dnnf status label self.dnnfStatusLabel = QLabel(self.dnnf_Widget) self.dnnf_LabelLayout.addWidget(self.dnnfStatusLabel) # top :: right side :: solutions :: dnnf :: dnnf buttons layout self.dnnf_ButtonsWidget = QWidget() self.dnnf_Layout.addWidget(self.dnnf_ButtonsWidget) self.dnnf_ButtonsLayout = QHBoxLayout() self.dnnf_ButtonsWidget.setLayout(self.dnnf_ButtonsLayout) # top :: right side :: solutions :: dnnf :: dnnf buttons layout :: dnnf buttons self.dnnfGenAndLoadButton = QPushButton("Generate && Load") self.dnnf_ButtonsLayout.addWidget(self.dnnfGenAndLoadButton) self.dnnfLoadFromFileButton = QPushButton("Load From File") self.dnnf_ButtonsLayout.addWidget(self.dnnfLoadFromFileButton) self.dnnfUnloadButton = QPushButton("Unload") self.dnnf_ButtonsLayout.addWidget(self.dnnfUnloadButton) # top :: right side :: solutions :: rewritings self.rewritings_Widget = QGroupBox() self.rewritings_Widget.setTitle("Instantiations") self.solutions_Layout.addWidget(self.rewritings_Widget) self.rewritings_Layout = QVBoxLayout() self.rewritings_Widget.setLayout(self.rewritings_Layout) # top :: right side :: solutions :: rewritings :: rewritings buttons layout self.rewritings_ButtonsWidget = QWidget() self.rewritings_Layout.addWidget(self.rewritings_ButtonsWidget) self.rewritings_ButtonsLayout = QHBoxLayout() self.rewritings_ButtonsWidget.setLayout(self.rewritings_ButtonsLayout) # top :: right side :: solutions :: rewritings :: rewritings buttons layout :: rewritings buttons self.rewritingsGetAllButton = QPushButton("Get All") self.rewritings_ButtonsLayout.addWidget(self.rewritingsGetAllButton) self.rewritingsGetBestButton = QPushButton("Get Best") self.rewritings_ButtonsLayout.addWidget(self.rewritingsGetBestButton) self.rewritingsChangeCostModelButton = QPushButton("Change Cost Model") self.rewritings_ButtonsLayout.addWidget(self.rewritingsChangeCostModelButton) # self.horizontalLayoutWidget = QWidget(self.rightSplitter) # self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget") # self.horizontalLayout = QHBoxLayout(self.horizontalLayoutWidget) # self.horizontalLayout.setObjectName("horizontalLayout") # self.label = QLabel(self.horizontalLayoutWidget) # self.label.setObjectName("label") # self.horizontalLayout.addWidget(self.label) # self.horizontalLayout.addWidget(self.queryDisplay) # self.horizontalLayoutWidget_3 = QWidget(self.rightSplitter) # self.horizontalLayoutWidget_3.setObjectName("horizontalLayoutWidget_3") # self.horizontalLayout_3 = QHBoxLayout(self.horizontalLayoutWidget_3) # self.horizontalLayout_3.setObjectName("horizontalLayout_3") Main.setCentralWidget(self.CentralWidget) self.retranslateUi(Main) QtCore.QMetaObject.connectSlotsByName(Main) def retranslateUi(self, Main): Main.setWindowTitle(QApplication.translate("Main", "SATWins", None, QApplication.UnicodeUTF8)) self.queryDisplayLabel.setText(QApplication.translate("Main", "Workflow", None, QApplication.UnicodeUTF8)) self.viewsDisplayLabel.setText(QApplication.translate("Main", "Concrete Services", None, QApplication.UnicodeUTF8)) self.dnnfLabel.setText(QApplication.translate("Main", "d-DNNF: loaded (28K)", None, QApplication.UnicodeUTF8)) #TODO activate next label #self.dnnfStatusLabel.setText(QApplication.translate("Main", "loaded", None, QApplication.UnicodeUTF8))
991,356
ea1df97cb5b3facc1547baee6e0242ad97c5d9c9
#!/usr/bin/env python3 ''' Example exposing the plot_labelled_group_connectivity_circle function. Author: Praveen Sripad <pravsripad@gmail.com> ''' import numpy as np from jumeg.connectivity import plot_labelled_group_connectivity_circle from jumeg import get_jumeg_path import yaml # load the yaml grouping of Freesurfer labels yaml_fname = get_jumeg_path() + '/data/rsn_desikan_aparc_cortex_grouping.yaml' label_names_yaml_fname = get_jumeg_path() + '/data/desikan_label_names.yaml' with open(label_names_yaml_fname, 'r') as f: label_names = yaml.safe_load(f)['label_names'] # make a random matrix with 68 nodes # use simple seed for reproducibility np.random.seed(42) con = np.random.random((68, 68)) con[con < 0.5] = 0. # plotting within a subplot plot_labelled_group_connectivity_circle(yaml_fname, con, label_names, out_fname='rsn_circle.png', show=False, n_lines=20, fontsize_names=6, title='test RSN circ labels')
991,357
63da31c5aa0f658217c88218a2db63f3de96c23d
import pytest from check_phonenumber.service import CheckPhoneNumber @pytest.fixture def test_data(): data = { "phone_number": "+40721234567", "country_code": "RO" } return data def test_service(test_data): result = CheckPhoneNumber.validate_phone(data=test_data) assert result.get('valid_number') is True
991,358
d3716c97308e6f8ae7ae4ac365e3bf621ca6956e
from .base_page import BasePage from .locators import ProductPageLocators class ProductPage(BasePage): def click_on_add_to_basket_button(self): add_to_basket_button = self.browser.find_element(*ProductPageLocators.ADD_TO_BASKET_BUTTON) add_to_basket_button.click() def should_be_add_basket_button(self): assert self.is_element_is_present( *ProductPageLocators.ADD_TO_BASKET_BUTTON), "Add to basket button is not presented" def check_item_names_equal(self): item_name = self.browser.find_element(*ProductPageLocators.ITEM_NAME).text item_added_message = self.browser.find_element(*ProductPageLocators.ITEM_ADDED_MESSAGE).text print(item_name) print(item_added_message) assert item_name == item_added_message, "Item names aren't equal" def check_prices_equal(self): item_price = self.browser.find_element(*ProductPageLocators.ITEM_PRICE).text item_price_in_basket = self.browser.find_element(*ProductPageLocators.PRICE_IN_BASKET).text print(item_price) print(item_price_in_basket) assert item_price == item_price_in_basket, "Prices aren't equal" def should_not_presented_succeed_message(self): assert self.is_not_element_present(*ProductPageLocators.ITEM_ADDED_MESSAGE), "Item is presented" def should_disappeared_success_message(self): assert self.is_element_is_present(*ProductPageLocators.ITEM_ADDED_MESSAGE), "Item isn't presented" assert self.is_disappeared(*ProductPageLocators.ITEM_ADDED_MESSAGE), "Success message still presented"
991,359
dd406f723aa18bc3a39a96b592e18230e848ee72
''' This module contains the necessary functionality to run basic runtime tests. The test suite is run for all programming languages added in `test/config.py`. **Important**: This test suite makes several assumptions regarding naming conventions and the location of specific files: - The bot binary should be located at `docker-sandbox/test/bot_binaries/<lowercase_programming_language_name>/` - The compiler image should be named as `gcr.io/riddles-microservices/sandbox-runtime-<lowercase_programming_language_name>` A marker is generated for each programming language added to the test suite. This marker can be used to run a subset of the tests. See README.md for more info. ''' import os import pytest import shutil from test.config import PROGRAMMING_LANGUAGES from util.subprocess import SubprocessRunner from util.temp_dir import temp_dir from util.test_utils import ( as_id, as_param, create_docker_compile_command, create_docker_runtime_command, compiler_image, get_manifest_executable, runtime_image, ) @pytest.fixture( ids=as_id, params=list(map(as_param, PROGRAMMING_LANGUAGES)), scope="module", ) def runtime(request): programming_language, runtime = request.param module_dir = os.path.dirname(os.path.realpath(__file__)) bin_dir = os.path.join( module_dir, 'bot_binaries/{}'.format(programming_language) ) manifest_path = os.path.join(bin_dir, 'manifest') # Step 1: Run the runtime and get the output command = create_docker_runtime_command( bin_dir, runtime, get_manifest_executable(manifest_path), runtime_image(programming_language) ) result = SubprocessRunner().run('cat test_scenario.txt | ' + command) if (result.return_code != 0): print('===STDOUT===') print(result.stdout) print('===STDERR===') print(result.stderr) return result @pytest.mark.runtime def test_succesful_return_code(runtime): assert runtime.return_code == 0 @pytest.mark.runtime def test_bot_returns_correct_output(runtime): assert runtime.stdout.strip() in ['rock', 'paper', 'scissors']
991,360
0879b90882ed24a893e6c953db1e59353a75c7ec
# Utility functions meant to aid our convolutional neural network. from scipy import stats import pandas as pb import numpy as np import matplotlib.pyplot as plt import tensorflow as tf %matplotlib inline plt.style.use('ggplot') def read_data(file_path): ''' TODO: Documentation ''' column_names = ['user-id', 'activity', 'timestamp', 'x-axis', 'y-axis', 'z-axis'] data = pd.read_csv(file_path, header=None, names=column_names) return data def feature_normalize(dataset): ''' TODO: Documentation ''' mu = np.mean(dataset, axis=0) sigma = np.std(dataset, axis=0) return (dataset - mu)/sigma def plot_axis(ax, x, y, title): ''' TODO: Documentation ''' ax.plot(x, y) ax.set_title(title) ax.xaxis.set_visible(False) ax.set_ylim([min(y) - np.std(y), max(y) + np.std(y)]) ax.set_xlim([min(x), max(x)]) ax.grid(True) def plot_activity(activity, data): ''' TODO: Documentation. ''' fig, (ax0, ax1, ax2) = plt.subplots(ntows = 3, figsize = (15, 10), sharex=True) # Plot the axis that is in use. plot_axis(ax0, data['timestamp'], data['x-axis'], 'x-axis') plot_axis(ax1, data['timestamp'], data['y-axis'], 'y-axis') plot_axis(ax2, data['timestamp'], data['z-axis'], 'z-axis') # Figure processing. fig.suptitle(activity) plt.subplots_adjust(top=0.90) plt.show()
991,361
148df04ef59f5e2b9737af2dfa739caca0837044
# Copyright 2020 Kaggle Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import time from kaggle_environments import make, evaluate, utils, DeadlineExceeded env = None def custom1(obs): step = sum(1 for mark in obs.board if mark == obs.mark) return [0, 2, 4, 6, 8][step] def custom2(obs): step = sum(1 for mark in obs.board if mark == obs.mark) return [1, 3, 5, 7][step] def custom3(obs): step = sum(1 for mark in obs.board if mark == obs.mark) time.sleep(4) return [1, 3, 5, 7][step] def custom4(): raise Exception("Foo Bar") def custom5(): return -1 def custom6(obs): step = sum(1 for mark in obs.board if mark == obs.mark) time.sleep(2) return [1, 3, 5, 7][step] def before_each(state=None): global env steps = [] if state == None else [state] env = make("tictactoe", steps=steps, debug=True) def test_to_json(): before_each() json = env.toJSON() assert json["name"] == "tictactoe" assert json["rewards"] == [0, 0] assert json["statuses"] == ["ACTIVE", "INACTIVE"] assert json["specification"]["reward"]["type"] == ["number", "null"] def test_can_reset(): before_each() assert env.reset() == [ { "action": 0, "status": "ACTIVE", "info": {}, "observation": {"remainingOverageTime": 2, "mark": 1, "board": [0, 0, 0, 0, 0, 0, 0, 0, 0], "step": 0}, "reward": 0, }, { "action": 0, "status": "INACTIVE", "info": {}, "observation": {"remainingOverageTime": 2, "mark": 2}, "reward": 0, }, ] def test_can_place_valid_mark(): before_each() assert env.step([4, None]) == [ { "action": 4, "status": "INACTIVE", "info": {}, "observation": {"remainingOverageTime": 2, "mark": 1, "board": [0, 0, 0, 0, 1, 0, 0, 0, 0], "step": 1}, "reward": 0, }, { "action": 0, # None caused the default action to be applied. "status": "ACTIVE", "info": {}, "observation": {"remainingOverageTime": 2, "mark": 2}, "reward": 0, }, ] def test_can_place_invalid_mark(): before_each() env.step([4, None]) assert env.step([None, 4]) == [ { "action": 0, "status": "DONE", "info": {}, "observation": {"remainingOverageTime": 2, "mark": 1, "board": [0, 0, 0, 0, 1, 0, 0, 0, 0], "step": 2}, "reward": 0, }, { "action": 4, "status": "INVALID", "info": {}, "observation": {"remainingOverageTime": 2, "mark": 2}, "reward": None, }, ] def test_can_place_winning_mark(): state1 = {"observation": {"board": [2, 1, 0, 1, 1, 0, 2, 0, 2]}} state2 = {} before_each([state1, state2]) assert env.step([7, None]) == [ { "action": 7, "status": "DONE", "info": {}, "observation": {"remainingOverageTime": 2, "mark": 1, "board": [2, 1, 0, 1, 1, 0, 2, 1, 2], "step": 1}, "reward": 1, }, { "action": 0, "status": "DONE", "info": {}, "observation": {"remainingOverageTime": 2, "mark": 2}, "reward": -1, }, ] def test_can_render(): obs = {"observation": {"board": [0, 1, 0, 2, 1, 2, 0, 0, 2]}} before_each([obs, obs]) out = " | X | \n---+---+---\n O | X | O \n---+---+---\n | | O " assert env.render(mode="ansi") == out def test_can_step_through_agents(): before_each() while not env.done: action1 = env.agents.random(env.state[0].observation) action2 = env.agents.reaction( utils.structify({"board": env.state[0].observation.board, "mark": 2})) env.step([action1, action2]) assert env.state[0].reward + env.state[1].reward == 0 def test_can_run_agents(): before_each() state = env.run(["random", "reaction"])[-1] assert state[0].reward + state[1].reward == 0 def test_can_evaluate(): rewards = evaluate("tictactoe", ["random", "reaction"], num_episodes=2) assert (rewards[0][0] + rewards[0][1] == 0) and rewards[1][0] + rewards[1][1] == 0 def test_can_run_custom_agents(): before_each() state = env.run([custom1, custom2])[-1] assert state == [ { "action": 6, "reward": 1, "info": {}, "observation": {"remainingOverageTime": 2, "board": [1, 2, 1, 2, 1, 2, 1, 0, 0], "mark": 1, "step": 7}, "status": "DONE", }, { "action": 0, "reward": -1, "info": {}, "observation": {"remainingOverageTime": 2, "mark": 2}, "status": "DONE", }, ] def test_agents_can_timeout_on_init(): env = make("tictactoe", debug=True) state = env.run([custom1, custom3])[-1] assert state[1]["status"] == "TIMEOUT" assert state[1]["observation"]["remainingOverageTime"] < 0 def test_agents_can_timeout_on_act(): env = make("tictactoe", debug=True) state = env.run([custom1, custom6])[-1] print(state) assert state[1]["status"] == "TIMEOUT" assert state[1]["observation"]["remainingOverageTime"] < 0 def test_run_timeout(): env = make("tictactoe", debug=True, configuration={"actTimeout": 10, "runTimeout": 1}) try: state = env.run([custom1, custom3])[-1] except DeadlineExceeded: pass except: assert False, "should fail with deadline exceeded" else: assert False, "Should fail when runtimeout is reached" def test_agents_can_error(): before_each() state = env.run([custom1, custom4])[-1] assert state == [ { "action": 0, "reward": 0, "info": {}, "observation": {"remainingOverageTime": 2, "board": [1, 0, 0, 0, 0, 0, 0, 0, 0], "mark": 1, "step": 2}, "status": "DONE", }, { "action": None, "reward": None, "info": {}, "observation": {"remainingOverageTime": 2, "mark": 2}, "status": "ERROR", }, ] def test_agents_can_have_invalid_actions(): before_each() state = env.run([custom1, custom5])[-1] assert state == [ { "action": 0, "reward": 0, "info": {}, "observation": {"remainingOverageTime": 2, "board": [1, 0, 0, 0, 0, 0, 0, 0, 0], "mark": 1, "step": 2}, "status": "DONE", }, { "action": None, "reward": None, "info": {}, "observation": {"remainingOverageTime": 2, "mark": 2}, "status": "INVALID", }, ]
991,362
1fcb3b54cede07afaf085000fa02be3e0637f1c5
for i in range(1, 101): # 1부터 100까지 증가하면서 100번 반복 if i % 2 != 0: # i를 2로 나누었을 때 나머지가 0이 아니면 홀수 continue # 아래 코드를 실행하지 않고 건너뜀 print(i)
991,363
3c724ec486afe970ddeb0fac0bed4985fbf7ee48
from db import Icd10Code, db, Mapper, Icd9Code import codecs def read_icd10_codes(): # Diagnosis with open('sources/icd10cm_order_2012.txt', 'r') as f: for line in f.readlines(): code = line[6:13].strip() if len(code) > 3: code = "%s.%s" % (code[:3], code[3:]) code = Icd10Code( order_no=line[0:5], code=code, ub04_valid=line[14:15], description=line[16:75].strip(), long_desc=line[77:].strip(), diagnosis=True, ) db.session.add(code) # pcs - procedures with open('sources/icd10pcs_order_2012.txt', 'r') as f: for line in f.readlines(): code = Icd10Code( order_no=line[0:5], code=line[6:13].strip(), ub04_valid=line[14:15], description=line[16:75].strip(), long_desc=line[77:].strip(), diagnosis=False, ) db.session.add(code) db.session.commit() def read_icd9_codes(): # dx with codecs.open('sources/CMS29_DESC_LONG_DX.101111.txt', 'rb', encoding='latin-1') as f: for line in f.readlines(): code = line[0:6].strip() if len(code) > 3: code = "%s.%s" % (code[:3], code[3:]) code = Icd9Code( diagnosis=True, code=code, description=line[6:].strip(), ) db.session.add(code) # px with codecs.open('sources/CMS29_DESC_LONG_SG.txt', 'rb', encoding='latin-1') as f: for line in f.readlines(): code = line[0:5].strip() if len(code) > 2: code = "%s.%s" % (code[:2], code[2:]) code = Icd9Code( diagnosis=False, code=code, description=line[5:].strip() ) db.session.add(code) db.session.commit() def read_icd10_gem_files(): # DX with open('sources/2012_I10gem.txt', 'r') as f: for line in f.readlines(): code = Mapper( forward = False, icd10code = line[0:7].strip(), icd9code = line[8:13].strip(), approximate = line[14:15], no_map = line[15:16], combination = line[16:17], scenario = line[17:18], choice_list = line[18:19], diagnosis = True, ) db.session.add(code) # procedures with open('sources/gem_pcsi9.txt', 'r') as f: for line in f.readlines(): code = Mapper( forward = False, icd10code = line[0:7].strip(), icd9code = line[8:13].strip(), approximate = line[14:15], no_map = line[15:16], combination = line[16:17], scenario = line[17:18], choice_list = line[18:19], diagnosis = False, ) db.session.add(code) db.session.commit() def read_icd9_gem_files(): with open('sources/2012_I9gem.txt', 'r') as f: for line in f.readlines(): mapping = Mapper( forward = True, icd9code = line[0:5].strip(), icd10code = line[6:13].strip(), approximate = line[14:15], no_map = line[15:16], combination = line[16:17], scenario = line[17:18], choice_list = line[18:19], diagnosis = True, ) db.session.add(mapping) with open('sources/gem_i9pcs.txt', 'r') as f: for line in f.readlines(): mapping = Mapper( forward = True, icd9code = line[0:5].strip(), icd10code = line[6:13].strip(), approximate = line[14:15], no_map = line[15:16], combination = line[16:17], scenario = line[17:18], choice_list = line[18:19], diagnosis = False, ) db.session.add(mapping) db.session.commit() if __name__ == "__main__": read_icd10_gem_files() read_icd9_gem_files() # read_icd10_codes() # read_icd9_codes()
991,364
7f947a937baaa67619958ad31962a7019a64b5f7
"""14. Special operators Write note on Identity operator Write note on membership operator """ """membership opetator Membership operators are operators used to validate the membership of a value. It test for membership in a sequence, such as strings, lists, or tuples. in operator : The ‘in’ operator is used to check if a value exists in a sequence or not. Evaluates to true if it finds a variable in the specified sequence and false otherwise.""" """ identity operator In Python are used to determine whether a value is of a certain class or type. They are usually used to determine the type of data a certain variable contains. There are different identity operators such as"""
991,365
9daab8048af84695a09365277469632ec7e49c56
def primeFactors(): num=int(input("enter a number to find the factors:")) for i in range(2,num): if (num%i)==0: print(i) num=num/i primeFactors()
991,366
3dcf716fd35483347e4d8be090791d9d2ee09e9a
import pygame for font in pygame.font.get_fonts(): print(font)
991,367
d5975e11a3aa6600e127fd05475a44b81fb65814
import logging import multiprocessing from scipy import signal import scipy.io.wavfile import itertools import numpy import gc logger = logging.getLogger(__name__) def remove_channel(samples): return samples[:, 0] def _do_filter(args): samples, fir_window = args filtered_samples = scipy.signal.lfilter(fir_window,1,samples) return filtered_samples def band_pass_filter(samples, samplerate, low_hz, high_hz): taps = 61 cutoff_low = float(low_hz) cutoff_high = float(high_hz) nyquist = samplerate / 2.0 fir_window = signal.firwin(taps, cutoff=[cutoff_low / nyquist, cutoff_high / nyquist], pass_zero=False, window="blackman") # Split samples in no. of processor subarrays samples_list = numpy.array_split(samples, multiprocessing.cpu_count()) worker_pool = multiprocessing.Pool(processes=multiprocessing.cpu_count()) results = worker_pool.map(_do_filter, itertools.izip(samples_list, itertools.repeat(fir_window))) filtered_samples = numpy.concatenate(results).astype(samples.dtype) print "Filtered samples len ", len(filtered_samples) return filtered_samples def normalize_volume(samples): samples /= numpy.max(numpy.abs(samples), axis=0) return samples def downsample(samples, samplerate, max_frequency): # First find minimum samplerate multiplier to satisfy nyquist q = 1 while samplerate / (q + 1) > (max_frequency * 2): q += 1 logger.debug("[DECIMATE] Found decimation factor: %s (%s -> %s)" % (q, samplerate, samplerate / q)) decimated_samples = signal.decimate(samples, q).astype(samples.dtype) return decimated_samples, samplerate / q
991,368
d0c63b20f88045392d232499fcb76321950a2ee0
# # Project: MXCuBE # https://github.com/mxcube. # # This file is part of MXCuBE software. # # MXCuBE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # MXCuBE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with MXCuBE. If not, see <http://www.gnu.org/licenses/>. import logging import gevent from HardwareRepository.BaseHardwareObjects import Device import _tine as tine __credits__ = ["EMBL Hamburg"] __version__ = "2.3." __category__ = "General" class EMBLDoorInterlock(Device): DoorInterlockState = {3: 'unlocked', 1: 'closed', 0: 'locked_active', 46: 'locked_inactive', -1: 'error' } def __init__(self, name): Device.__init__(self, name) self.use_door_interlock = None self.door_interlock_state = None self.door_interlock_final_state = None self.door_interlock_breakabled = None self.detector_distance_hwobj = None self.before_unlock_commands_present = None self.before_unlock_commands = None self.chan_state_locked = None self.chan_state_breakable = None self.cmd_break_interlock = None def init(self): self.door_interlock_state = "unknown" self.detector_distance_hwobj = \ self.getObjectByRole("detector_distance") self.before_unlock_commands_present = \ self.getProperty("before_unlock_commands_present") self.before_unlock_commands = eval(self.getProperty("beforeUnlockCommands")) self.use_door_interlock = self.getProperty('useDoorInterlock') if self.use_door_interlock is None: self.use_door_interlock = True self.chan_state_locked = self.getChannelObject('chanStateLocked') self.chan_state_locked.connectSignal('update', self.state_locked_changed) self.chan_state_breakable = self.getChannelObject('chanStateBreakable') self.chan_state_breakable.connectSignal('update', self.state_breakable_changed) self.cmd_break_interlock = self.getCommandObject('cmdBreak') self.getState = self.get_state def connected(self): """Sets is ready""" self.setIsReady(True) def disconnected(self): self.setIsReady(False) def state_breakable_changed(self, state): self.door_interlock_breakabled = state self.get_state() def state_locked_changed(self, state): """Updates door interlock state""" self.door_interlock_state = state self.get_state() def get_state(self): """Returns current state""" if self.door_interlock_state: if self.door_interlock_breakabled: self.door_interlock_final_state = 'locked_active' msg = "Locked (unlock enabled)" else: self.door_interlock_final_state = 'locked_inactive' msg = "Locked (unlock disabled)" else: self.door_interlock_final_state = 'unlocked' msg = "Unlocked" if not self.use_door_interlock: self.door_interlock_final_state = 'locked_active' msg = "Locked (unlock enabled)" self.emit('doorInterlockStateChanged', self.door_interlock_final_state, msg) return self.door_interlock_final_state, msg def unlock_door_interlock(self): """Break Interlock (only if it is allowed by doorInterlockCanUnlock) It doesn't matter what we are sending in the command as long as it is a one char """ if self.detector_distance_hwobj.getPosition() < 340: self.detector_distance_hwobj.move(500) gevent.sleep(1) if not self.use_door_interlock: logging.getLogger().info('Door interlock is disabled') return if self.door_interlock_state: gevent.spawn(self.unlock_doors_thread) else: logging.getLogger().info('Door is Interlocked') def before_unlock_actions(self): """Executes some commands bedore unlocking the doors""" for command in self.before_unlock_commands: addr = command["address"] prop = command["property"] if len(command["argument"]) == 0: arg = [0] else: try: arg = [eval(command["argument"])] except: arg = [command["argument"]] if command["type"] == "set": tine.set(addr, prop, arg) elif command["type"] == "query": tine.query(addr, prop, arg[0]) def unlock_doors_thread(self): """Gevent method to unlock the doors""" if self.door_interlock_breakabled: try: self.before_unlock_actions() except: pass if self.cmd_break_interlock is None: self.cmd_break_interlock = self.getCommandObject('cmdBreakInterlock') self.cmd_break_interlock() else: msg = "Door Interlock cannot be broken at the moment " + \ "please check its status and try again." logging.getLogger("user_level_log").error(msg) def update_values(self): self.get_state()
991,369
6103a7e9073d77c64c8e757b927e5b33bc3abf29
#!/usr/bin/env python # -*- coding=utf-8; -*- """ Calculate monitor DPI. """ from math import sqrt def dpi(x, y, diag): return sqrt(x*x + y*y) / diag hor_res = input('Horizontal resolution: ') vert_res = input('Vertical resolution: ') diag = input('Diagonal size: ') result = dpi(hor_res, vert_res, diag) print 'DPI: {0}'.format(result)
991,370
d93727737a9f2cbdd1694d55f2948679d6c25b11
from django.test import TestCase from django.urls import reverse class TestViews(TestCase): def test_index(self): response = self.client.get(reverse('index')) self.assertContains(response, 'TDE Central')
991,371
1d1c8d7b42d0ec41355ad8400db4247a4f55f7fe
################################################################################# # Author : Webkul Software Pvt. Ltd. (<https://webkul.com/>) # Copyright(c): 2015-Present Webkul Software Pvt. Ltd. # All Rights Reserved. # # # # This program is copyright property of the author mentioned above. # You can`t redistribute it and/or modify it. # # # You should have received a copy of the License along with this program. # If not, see <https://store.webkul.com/license.html/> ################################################################################# import odoo from odoo import api, fields, models, _ from odoo.osv import expression from datetime import datetime import time from dateutil.relativedelta import relativedelta class AccountFiscalyear(models.Model): _name = "account.fiscalyear" _description = "Fiscal Year" name = fields.Char('Fiscal Year', required=True) code = fields.Char('Code', size=6, required=True) company_id = fields.Many2one('res.company', 'Company', required=True, default=lambda self: self.env['res.company']._company_default_get('account.invoice')) date_start = fields.Date('Start Date', required=True, default=lambda * a: time.strftime('%Y-%m-01 %H:59:%S')) date_stop = fields.Date('End Date', required=True, default=lambda * a: time.strftime('%Y-12-31 %H:59:%S')) period_ids = fields.One2many('account.period', 'fiscalyear_id', 'Periods') _order = "date_start, id" @api.multi def _check_duration(self): if self.date_stop < self.date_start: return False return True _constraints = [ (_check_duration, 'Error!\nThe start date of a fiscal year must precede its end date.', ['date_start','date_stop']) ] @api.multi def create_period3(self): return self.create_period(3) @api.multi def create_period1(self): return self.create_period(1) @api.multi def create_period(self, interval=1): period_obj = self.env['account.period'] for fy in self: ds = datetime.strptime(fy.date_start, '%Y-%m-%d') period_obj.create({ 'name': "%s %s" % (_('Opening Period'), ds.strftime('%Y')), 'code': ds.strftime('00/%Y'), 'date_start': ds, 'date_stop': ds, 'special': True, 'fiscalyear_id': fy.id, }) while ds.strftime('%Y-%m-%d') < fy.date_stop: de = ds + relativedelta(months=interval, days=-1) if de.strftime('%Y-%m-%d') > fy.date_stop: de = datetime.strptime(fy.date_stop, '%Y-%m-%d') period_obj.create({ 'name': ds.strftime('%b-%Y'), 'code': ds.strftime('%m/%Y'), 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d'), 'fiscalyear_id': fy.id, }) ds = ds + relativedelta(months=interval) return True @api.model def find(self, dt=None, exception=True): res = self.finds(dt, exception) return res and res[0] or False @api.model def finds(self, dt=None, exception=True): context = self._context if context is None: context = {} if not dt: dt = fields.date.context_today(self) args = [('date_start', '<=' ,dt), ('date_stop', '>=', dt)] if context.get('company_id', False): company_id = context['company_id'] else: company_id = self.env['res.users'].browse(self._uid).company_id.id args.append(('company_id', '=', company_id)) objs = self.search(args) if not objs: if exception: model, action_id = self.env['ir.model.data'].get_object_reference('account', 'action_account_fiscalyear') msg = _('There is no period defined for this date: %s.\nPlease go to Configuration/Periods and configure a fiscal year.') % dt raise odoo.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) else: return [] ids = objs.ids return ids @api.model def name_search(self, name, args=None, operator='ilike', limit=100): if args is None: args = [] if operator in expression.NEGATIVE_TERM_OPERATORS: domain = [('code', operator, name), ('name', operator, name)] else: domain = ['|', ('code', operator, name), ('name', operator, name)] objs = self.search(expression.AND([domain, args]), limit=limit) return objs.name_get()
991,372
f96dee8db7d6e1cfc0ded654c7f1c6df483472c7
""" https://leetcode.com/problems/reconstruct-original-digits-from-english/ The order of digits is the key to solve problem. Go through the digits in order, and remove the letters from the string. """ from header import * class Solution: def originalDigits(self, s: str) -> str: mp = [('zero', 'z', 0), ('two', 'w', 2), ('six', 'x', 6), ('four', 'u', 4), ('one', 'o', 1), ('eight', 'g', 8), ('five', 'f', 5), ('nine', 'i', 9), ('seven', 's', 7), ('three', 'r', 3)] cnt = Counter(s) ans = [0]*10 for d, c, n in mp: ans[n] += cnt[c] cnt -= Counter(d*cnt[c]) return ''.join([str(i)*c for i, c in enumerate(ans) if c!=0])
991,373
1ce14ae1c9f5fc7b43a719b5d7bf5da7bb30be9e
##Dylan Rodriguez ## TCMG 412 ## Project 3 -- Python Stuff ## This uses Python 3 import urllib.request import os.path from os import path import re from collections import Counter url = "https://s3.amazonaws.com/tcmg476/http_access_log" #Regular expression used to parse the log file -- breaks the line into groups regex = re.compile(".*\[([^:]*):(.*) \-[0-9]{4}\] \"([A-Z]+) (.+?)( HTTP.*\"|\") ([2-5]0[0-9]) .*") print("Checking to see if log already exists:") if not path.exists('log'): print("Log did not exist, downloading from: ") print(url) urllib.request.urlretrieve(url, 'log') print("Done downloading") else: print("Log existed, skipping download.\n") file = open('log', 'r') logfile =[] #array to hold broken_line =[] #Loop through the file, place each line into logfile array for line in file: logfile.append(line) code_4xx = 0 code_3xx = 0 file_requests = [] #Loop throough logfile array, break each line using regex for element in logfile: pieces = re.split(regex, element) #Look at the 3rd item in pieces, add that item to file_requests array try: file_requests.append(pieces[4]) if pieces[6].startswith('3'): code_3xx+=1 if pieces[6].startswith('4'): code_4xx+=1 except IndexError: pass continue total_count = 0 for item in logfile: total_count+=1 print("***** Total 4xx respones *****") print(code_4xx) percent_4xx = (code_4xx/total_count) * 100 print(round(percent_4xx,2)) print("***** Total 4xx respones *****\n") print("***** Total 3xx respones *****") print(code_3xx) percent_3xx = (code_3xx / total_count) * 100 print(round(percent_3xx,2)) print("***** Total 3xx respones *****") #Count most requested file Counter = Counter(file_requests) most_freq = Counter.most_common(1) print(most_freq) #print(pieces) #print(file_requests) ##Total Count total_count = 0 for item in logfile: total_count+=1 print("Total line count= \n") print(total_count) ##Calculate percentages of 3xx codes -- ROUND to 2 decimals ##Calculate percentages of 4xx codes -- ROUND to 2 decimals ##Count per day - week - month ##Percentage not successful -- 4xx codes ##Percentage redirected else -- 3xx codes ##Most requested file ##Least requested file
991,374
9bb4b3a3ca5137ebf8320a5d34158a33713b84d7
"""Application Framework classes to handle RGB images """ from rgbLib import *
991,375
8e4cec50d50eb0da92cecd78eecad4be92c22ced
import os from os.path import basename os.environ['CUDA_VISIBLE_DEVICES'] = '' from keras.models import load_model import matplotlib.pyplot as plt from skimage import io import numpy as np from skimage.color import gray2rgb, label2rgb from skimage.io import imsave from datetime import datetime from functions import your_loss import glob from scipy.misc import imread #from skimage.io import imread import glob import re import time import random from datetime import datetime labels = 4 channels = 1 size = 56 inner_size = 36 ysize = 36 batch_size = 254 def output_to_colors(result, x): zeros = np.zeros((rows,cols,4)) #zeros[:,:,:-1]=gray2rgb(x.copy()) #zeros = gray2rgb(x.copy()) #output = result.argmax(axis=-1) zeros[output==2]=[0,0,1] return zeros def chunks(l, n): """Yield successive n-sized chunks from l.""" for i in range(0, len(l), n): yield l[i:i + n] def get_tiles(img, inner_size, overlap): img_padded = np.pad(img, ((overlap,overlap), (overlap,overlap)), mode='reflect') xs = [] for i in xrange(0, img.shape[0], inner_size): for j in xrange(0, img.shape[1], inner_size): #print(i-overlap+overlap,i+inner_size+overlap+overlap,j-overlap+overlap, j+inner_size+overlap+overlap) img_overlapped = img_padded[i:i+inner_size+overlap+overlap,j:j+inner_size+overlap+overlap] xs.append(img_overlapped) return xs def natural_sort(l): convert = lambda text: int(text) if text.isdigit() else text.lower() alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ] return sorted(l, key = alphanum_key) models = sorted(natural_sort(glob.glob('models/*')), key=lambda name: int(re.search(r'\d+', name).group()), reverse=True)[0:1] print(models) tick = datetime.now() for model_n in models: model = load_model(model_n, custom_objects={'your_loss': your_loss}) print("Loaded :%s", model_n) files_all = glob.glob('temp_cropped/*') #files_all = glob.glob('cleaned/raw/*.png') #files_all = glob.glob('images/single_frames/*.png') #files_all = glob.glob('images/all_grey/15_jpgs/*.jpg') #files_all = random.sample(files_all) #files_all = glob.glob('cleaned/penta/*') #files = files+files+files# + files[-4:-1] #print(files) file_chunks = chunks(files_all, batch_size) for idx, files in enumerate(file_chunks): file_names = [basename(path) for path in files] #print(file_names) imgs = np.array([np.pad(imread(fl, mode='L'), (8,8), mode='reflect').astype(float)/255 for fl in files]) #import pdb; pdb.set_trace() tiles = np.array([get_tiles(img, 36, 10) for img in imgs]) #print(file_chunks) #print("Processing: %s"%(fl)) #print("Imgs shape: %s", tiles.shape) #Create input tensor xs = tiles.reshape(imgs.shape[0]*len(tiles[0]),size,size,channels) #print(np.unique(xs[0])) start_time = time.time() # Predict output ys = model.predict(xs) print("---- %s seconds for size: %d ----"%(time.time()-start_time, xs.shape[0])) ys = ys.reshape(imgs.shape[0],len(tiles[0]), ysize, ysize, labels) # Stitch it together for ix,y in enumerate(ys): #imgcount = 0 count= 0 img = imgs[ix] tile_output = np.zeros((img.shape[0],img.shape[1],4)) zeros = np.zeros((img.shape[0],img.shape[1],4)) for i in xrange(0, img.shape[0], inner_size): for j in xrange(0, img.shape[1], inner_size): zeros[i:i+inner_size,j:j+inner_size] = y[count] count += 1 for i in range(img.shape[0]): for j in range(img.shape[1]): output = tile_output[i,j] zeros[i,j,np.argmax(output)] = 1 #count += 1 #import pdb; pdb.set_trace() zeros[:,:,3]=1 #color = output_to_colors(zeros, img) #colors = [output_to_colors(y, imgs[i]) for i,y in enumerate(ys)] #colors = [label2rgb(y.argmax(axis=-1), image=imgs[i], colors=[(1,0,0), (0,1,0), (0,0,1), (0,0,0)], alpha=0.9, bg_label=3) for i,y in enumerate(ys)] #[plt.imsave('plots/%s_%s'%(model_n, file_names[i]), zeros) for i,zeros in enumerate(colors)] #print(file_names) plt.imsave('plots/results/%s.png'%(file_names[ix]), zeros) print "total processing done in: "+str((datetime.now()-tick).total_seconds())
991,376
fea6c00133f7cee1d29806575660c595bc628f19
import matplotlib.pyplot as plt import numpy as np from random import random import matplotlib from skimage.filters import threshold_otsu from skimage.color import rgb2gray import skimage.morphology as m def FindPixel(img): #find foreground pixel image for i in range(img.shape[0]): for j in range(img.shape[1]): if img[i][j] > 0: img2 = np.zeros((img.shape[0], img.shape[1])) img2[i][j] = img[i][j] return img2 return np.zeros(1) def connectedExtraction (img, imgE): SE = m.square(3) imgO = np.logical_and(m.dilation(imgE, SE), img) imgTemp = np.ones(1) while(not (imgO==imgTemp).all()): #check for change in subsequent iterations imgTemp = np.logical_and(m.dilation(imgO, SE), img) imgO = np.logical_and(m.dilation(imgTemp, SE), img) return imgO def ExtractAndLabelComponents(img): components = [] imgP = FindPixel(img) while imgP.shape[0] != 1: #extract each component components.append(connectedExtraction(img, imgP)) img = np.bitwise_xor(img,components[len(components)-1]) imgP = FindPixel(img) for i in range(len(components)): #label components[i] = np.multiply(components[i], i+1) return components colors = [(0,0,0)] #generate colour mapping for i in range(255): if i%25==0 and i >= 50: colors.append((i/255,random(),random())) for i in range(255): if i%25==0 and i >= 50: colors.append((random(),i/255,random())) for i in range(255): if i%25==0 and i >= 50: colors.append((random(),random(),i/255)) new_map = matplotlib.colors.LinearSegmentedColormap.from_list('new_map', colors, N=27) img4 = rgb2gray(plt.imread('imgs/coins.png')) SE = m.disk(25) img41 = m.dilation(img4, SE) thresh4 = threshold_otsu(img41) binary4 = img41 < thresh4 c4 = ExtractAndLabelComponents(binary4) l4 = c4[0] for i in range(len(c4)-1): l4 += c4[i+1] print("Coin amount is: ", len(c4)) plt.gray() plt.imsave("output/4.png", l4, cmap=new_map) fig, axs = plt.subplots(1,2,figsize=(9,5)) [axi.set_axis_off() for axi in axs.ravel()] axs[0] = fig.add_subplot(1,2,1) axs[0].set_title("Original") axs[0].imshow(img4) plt.axis('off') axs[1] = fig.add_subplot(1,2,2) axs[1].set_title("Coloured and Seperated") axs[1].imshow(l4, cmap = new_map) plt.axis('off') fig.savefig("output/4Comparison.jpg")
991,377
d69b447eb28fea1b3565fd138ef70b7c523297ba
from django.shortcuts import render from django import views from django.http import HttpResponse # Create your views here. class Home(views.View): def get(self, request): return HttpResponse('This is the home page with a GET request <h1> this is the greatest </h1>')
991,378
fc0697e35593d14e8bb771ec88f37aefc8b39209
from django.shortcuts import render def board(request): if request.method == "GET": return render(request, 'index.html')
991,379
e31a6eaa6e72e48fe3b76c4bb4e9b6ac9b1cbbfa
# Escribe un programa que lea una cadena y devuelva un diccionario con la cantidad de apariciones de cada carácter en la cadena. dict = {} cadena = input("Dame una cadena:") for caracter in cadena: if caracter in dict: dict[caracter]+=1 else: dict[caracter]=1 for campo,valor in dict.items(): print (campo,"->",valor)
991,380
9df37dd72e55b3b533bb619bc9a4bb7e66aa5495
#!/usr/bin/python import serial, time #initialization and open the port #possible timeout values: # 1. None: wait forever, block call # 2. 0: non-blocking mode, return immediately # 3. x, x is bigger than 0, float allowed, timeout block call ser = serial.Serial() #ser.port = "/dev/ttyUSB0" ser.port = "/dev/ttyUSB0" #ser.port = "/dev/ttyS2" ser.baudrate = 57600 ser.bytesize = serial.EIGHTBITS #number of bits per bytes ser.parity = serial.PARITY_NONE #set parity check: no parity ser.stopbits = serial.STOPBITS_ONE #number of stop bits ser.timeout = None #block read #ser.timeout = 1 #non-block read #ser.timeout = 2 #timeout block read ser.xonxoff = False #disable software flow control ser.rtscts = False #disable hardware (RTS/CTS) flow control ser.dsrdtr = False #disable hardware (DSR/DTR) flow control ser.writeTimeout = 2 #timeout for write try: ser.open() except Exception, e: print "error open serial port: " + str(e) exit() fileObj = open("energy.csv", 'a') tagList = ["time","tmpr","sensor","id","type", "watts", "focus"] title = "" for tn in tagList: title += tn + "," titleStr = title[:-1] + "\n" print titleStr #fileObj.write(titleStr) if ser.isOpen(): try: ser.flushInput() #flush input buffer, discarding all its contents ser.flushOutput()#flush output buffer, aborting current output #and discard all that is in buffer numOfLines = 0 while True: response = ser.readline() readstr = ""+response # print readstr n = 0 tagLen = 0 tagTally = 0 dictOfTags = {} #Make a tag dictionary dictOfData = {} #Make a data dictionary for ti in tagList: dictOfData[ti] = " " while n < len(readstr): # get start of tag in readstr if readstr[n] == "<": tagStart = n # get length of tagName if readstr[n] == ">": tagLen = n - tagStart # Trim <> from tagName tagName = readstr[tagStart+1:-(len(readstr)-n)] # Register current string position '>' with tagName dictOfTags[tagName] = n # Is this a closing tag? if tagName[0] == "/": # mark end of data substring dataEnd = tagStart # recall start point of data substring # and remove '/' from tagName dataStart = dictOfTags[tagName[1:]]+1; dataStr = readstr[dataStart:-(len(readstr)-dataEnd)] if dataStr[0] == "<": break dictOfData[tagName[1:]] = dataStr print dataStr n+=1 record = "" for tn in tagList: # if dictOfData[tn] == " ": # continue record += dictOfData[tn] + "," recordStr = record[:-1] + "\n" # lose final comma print recordStr fileObj.write(recordStr) numOfLines += 1 #print "\n"; if (numOfLines >= 30): break ser.close() fileObj.close() # print "Name of the file: ", fileObj.name print "Closed or not : ", fileObj.closed # print "Opening mode : ", fileObj.mode # print "Softspace flag : ", fileObj.softspace except Exception, e1: print "error communicating...: " + str(e1) else: print "cannot open serial port "
991,381
2fe99e90d14917c493bb1efaa074ca5dcd9ebe40
# Jacob Wahl # 2/8/21 # Problem 1.8 - Wrtie an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to 0. # -> list[list[int]] def zeroMatrix(matrix: list[list[int]]) -> list[list[int]]: # Not in-place ''' new_matrix = [[-1 for y in range(len(matrix[x]))] for x in range(len(matrix))] i = 0 while i < len(matrix): j = 0 while j < len(matrix): if matrix[i][j] == 0: new_matrix = zeroize(i, j, new_matrix) elif new_matrix[i][j] != 0: new_matrix[i][j] = matrix[i][j] j += 1 i += 1 return new_matrix ''' # In-place rows = set() cols = set() i = 0 while i < len(matrix): j = 0 while j < len(matrix): if matrix[i][j] == 0: rows.add(i) cols.add(j) j += 1 i += 1 return zeroize(rows, cols, matrix) def zeroize(row: set or int, col: set or int, matrix: list[list[int]]) -> list[list[int]]: if isinstance(row, set) and isinstance(col, set): for i in row: idx = 0 while(idx < len(matrix[i])): matrix[i][idx] = 0 idx += 1 for i in col: idx = 0 while(idx < len(matrix)): matrix[idx][i] = 0 idx += 1 else: idx = 0 while(idx < len(matrix[row])): matrix[row][idx] = 0 idx += 1 idx = 0 while(idx < len(matrix)): matrix[idx][col] = 0 idx += 1 return matrix test_case = [[-1, -1, -1, -1], [-1, -1, -1, -1], [-1, -1, -1, -1], [-1, -1, -1, -1]] ''' test_case = [[-1, -1, -1], [-1, -1, -1], [-1, -1, -1]] ''' test_case = zeroMatrix(test_case) for i in test_case: print(i)
991,382
91aab731235f6802cf666a8503daf4567c26aadb
from trade_tariff_reference.documents.tasks import generate_fta_document from trade_tariff_reference.documents.utils import update_document_status from trade_tariff_reference.schedule.models import DocumentStatus def generate_document(agreement): update_document_status(agreement, DocumentStatus.GENERATING) generate_fta_document.delay(agreement.slug) def get_initial_quotas(agreement, lst=False): return { 'origin_quotas': get_initial_origin_quotas(agreement, lst=lst), 'licensed_quotas': get_initial_licensed_quotas(agreement, lst=lst), 'scope_quotas': get_initial_scope_quotas(agreement, lst=lst), 'staging_quotas': get_initial_staging_quotas(agreement, lst=lst) } def get_initial_origin_quotas(agreement, lst=False): quotas = [quota.origin_quota_string for quota in agreement.origin_quotas] if lst: return quotas return '\r\n'.join(quotas) def get_initial_licensed_quotas(agreement, lst=False): quotas = [quota.licensed_quota_string for quota in agreement.licensed_quotas] if lst: return quotas return '\r\n'.join(quotas) def get_initial_scope_quotas(agreement, lst=False): quotas = [quota.scope_quota_string for quota in agreement.scope_quotas] if lst: return quotas return '\r\n'.join(quotas) def get_initial_staging_quotas(agreement, lst=False): quotas = [quota.staging_quota_string for quota in agreement.staging_quotas] if lst: return quotas return '\r\n'.join(quotas)
991,383
080262a299ee72f4c18ac103e7dbe0bb94ed1089
import numpy as np np.random.seed(2019) np.set_printoptions(precision = 3) x = np.random.laplace(loc=10, scale=3, size = 1000) x[:10] hist, bin_edges = np.histogram(x) hist bin_edges # Lo que np.histogram hace para crear los intervalos min_edge = min(x) max_edge = x.max() n_bins = 10 bin_edges = np.linspace(start=min_edge, stop=max_edge, num=n_bins+1, endpoint = True) bin_edges #### np.bincount() # Cuenta las frecuencias absolutas de números enteros (creo, porque no le veo sentido al vector que devuelve)
991,384
6323af2b6111865885b15102a9bac7a225602753
from modelo.album import Album from modelo.cancion import Cancion from modelo.declarative_base import session, engine, Base from modelo.interprete import Interprete class Coleccion(): def __init__(self): Base.metadata.create_all(engine) def darAlbumes(self): albumes = session.query(Album).all() return albumes def darCancionesDeAlbum(self, album_id): canciones = session.query(Cancion).filter(Cancion.albumes.any(Album.id.in_([album_id]))).all() return canciones def darCanciones(self): canciones = session.query(Cancion).all() return canciones def darInterpretes(self): interpretes = session.query(Interprete).all() return interpretes def buscarAlbumesPorTitulo(self, album_titulo): albumes = session.query(Album).filter(Album.titulo.ilike(album_titulo)).all() return albumes def buscarCancionesPorTitulo(self, cancion_titulo): canciones = session.query(Cancion).filter(Cancion.titulo.ilike(cancion_titulo)).all() return canciones def buscarCancionesPorInterprete(self, nombre): canciones = session.query(Cancion).filter(Cancion.interpretes.any(Interprete.nombre.ilike(nombre))).all() return canciones def agregarAlbum(self, titulo, anio, descripcion, medio): try: album = Album(titulo=titulo, ano=anio, descripcion=descripcion, medio=medio) session.add(album) session.commit() return True except: return False def agregarCancion(self, titulo, minutos, segundos, compositor, album_id, interpretes_id): busqueda = session.query(Cancion).filter(Cancion.albumes.any(Album.id.in_([album_id])), Cancion.titulo == titulo).all() if len(busqueda) == 0: album = session.query(Album).filter(Album.id == album_id).all()[0] interpretesCancion = [] for item in interpretes_id: interprete = session.query(Interprete).filter(Interprete.id == item).all()[0] interpretesCancion.append(interprete) nuevaCancion = Cancion(titulo=titulo, minutos=minutos, segundos=segundos, compositor=compositor, albumes=[album], interpretes=interpretesCancion) session.add(nuevaCancion) session.commit() return True else: return False def agregarInterprete(self, nombre): interprete = session.query(Interprete).filter(Interprete.nombre == nombre).all() if len(interprete) == 0: nuevoInterprete = Interprete(nombre=nombre) session.add(nuevoInterprete) session.commit() return True else: return False def eliminarAlbum(self, album_id): try: album = session.query(Album).filter(Album.id == album_id).all()[0] session.delete(album) session.commit() return True except: return False def eliminarCancion(self, cancion_id, album_id): try: cancion = session.query(Cancion).filter(Cancion.id == cancion_id).all()[0] album = session.query(Album).filter(Album.id == album_id).all()[0] if len(cancion.albumes) == 1: session.delete(cancion) elif len(cancion.albumes) > 1: album.canciones.remove(cancion) session.commit() return True except: return False def eliminarInterprete(self, interprete_id): interprete = session.query(Interprete).filter(Interprete.id == interprete_id).all() if len(interprete) > 0: if interprete[0].cancion is None: session.delete(interprete[0]) session.commit() return True else: return False else: return False def editarAlbum(self, album_id, titulo, anio, descripcion, medio): try: album = session.query(Album).filter(Album.id == album_id).all()[0] if titulo: album.titulo = titulo if anio: album.ano = anio if descripcion: album.descripcion = descripcion if medio: album.medio = medio session.commit() return True except: return False def editarCancion(self, cancion_id, titulo, minutos, segundos, compositor, album_id, interpretes_id): busqueda = session.query(Cancion).filter(Cancion.albumes.any(Album.id.in_([album_id])), Cancion.titulo == titulo, Cancion.id != cancion_id).all() if len(busqueda) == 0: cancion = session.query(Cancion).filter(Cancion.id == cancion_id).all()[0] cancion.titulo = titulo cancion.minutos = minutos cancion.segundos = segundos cancion.compositor = compositor interpretesCancion = [] for item in interpretes_id: interprete = session.query(Interprete).filter(Interprete.id == item).all()[0] interpretesCancion.append(interprete) cancion.interpretes = interpretesCancion session.commit() return True else: return False def editarInterprete(self, interprete_id, nombre): busqueda = session.query(Interprete).filter(Interprete.id != interprete_id, Interprete.nombre == nombre).all() if len(busqueda) == 0: interprete = session.query(Interprete).filter(Interprete.id == interprete_id).all()[0] interprete.nombre = nombre session.commit() return True else: return False
991,385
8cbfcb3c98b516f16328b10ad5eea08e3de76df3
from wtforms import Form, SubmitField, BooleanField, TextField, SelectField, \ PasswordField, IntegerField, FieldList, FormField, HiddenField, TextAreaField, validators from rfk.database.streaming import Relay class RelayForm(Form): address = TextField('Address', [validators.Required()]) port = TextField('Port', [validators.Required()]) bandwidth = TextField('Bandwidth in kbps', [validators.Required()]) admin_username = TextField('Admin Username', [validators.Required()]) admin_password = TextField('Admin Password', [validators.Required()]) auth_username = TextField('Auth Username', [validators.Required()]) auth_password = TextField('Auth Password', [validators.Required()]) relay_username = TextField('Relay Username', [validators.Required()]) relay_password = TextField('Relay Password', [validators.Required()]) type = SelectField('Type', coerce=int, choices=Relay.TYPE.tuples()) def new_relay(rform): return RelayForm(rform)
991,386
ccc4966742583eb606745195a5c2566b1222074e
""" You are given a m x n 2D grid initialized with these three possible values. -1 - A wall or an obstacle. 0 - A gate. INF - Infinity means an empty room. We use the value 231 - 1 = 2147483647 to represent INF as you may assume that the distance to a gate is less than 2147483647. Fill each empty room with the distance to its nearest gate. If it is impossible to reach a gate, it should be filled with INF. For example, given the 2D grid: INF -1 0 INF INF INF INF -1 INF -1 INF -1 0 -1 INF INF After running your function, the 2D grid should be: 3 -1 0 1 2 2 1 -1 1 -1 2 -1 0 -1 3 4 """ ''' Created on Feb 6, 2017 @author: fanxueyi ''' class Solution(object): def wallsAndGates(self, rooms): """ :type rooms: List[List[int]] :rtype: void Do not return anything, modify rooms in-place instead. """ if not rooms: return nrow = len(rooms) ncol = len(rooms[0]) queue = [] for c in range(ncol): for r in range(nrow): if rooms[r][c] == 0: queue.append([(r,c),0]) self.bfs(rooms, queue) return(rooms) def bfs(self, rooms, queue): nrow = len(rooms) ncol = len(rooms[0]) visited = [] while queue: [pos, depth] = queue.pop(0) i,j = pos """ #using this strategy is TEL visited.append((i,j)) rooms[i][j] = min(rooms[i][j], depth) if i > 0: #print(i-1, j) if rooms[i-1][j] != -1 and rooms[i-1][j] != 0 and ((i-1,j) not in visited) and ((i-1,j) not in [q[0] for q in queue]): queue.append([(i-1,j),depth+1]) if j > 0: #print(i, j-1) if rooms[i][j-1] != -1 and rooms[i][j-1] != 0 and ((i,j-1) not in visited) and ((i,j-1) not in [q[0] for q in queue]): queue.append([(i,j-1), depth+1]) if i < nrow-1: #print(i+1, j) if rooms[i+1][j] != -1 and rooms[i+1][j] != 0 and ((i+1,j) not in visited) and ((i+1,j) not in [q[0] for q in queue]): queue.append([(i+1,j), depth+1]) if j < ncol-1: #print(i, j+1) if rooms[i][j+1] != -1 and rooms[i][j+1] != 0 and ((i,j+1) not in visited) and ((i,j+1) not in [q[0] for q in queue]): queue.append([(i,j+1), depth+1]) """ if i > 0: if rooms[i-1][j] > depth+1: rooms[i-1][j] = depth+1 queue.append([(i-1,j),depth+1]) if j > 0: if rooms[i][j-1] > depth+1: rooms[i][j-1] = depth+1 queue.append([(i,j-1), depth+1]) if i < nrow-1: if rooms[i+1][j] > depth+1: rooms[i+1][j] = depth+1 queue.append([(i+1,j), depth+1]) if j < ncol-1: if rooms[i][j+1] > depth+1: rooms[i][j+1] = depth+1 queue.append([(i,j+1), depth+1]) s = Solution() print(s.wallsAndGates([[0,2147483647,2147483647,0,-1,-1,0,0,0,-1,-1,0,2147483647,2147483647],[2147483647,-1,2147483647,-1,2147483647,0,-1,2147483647,-1,2147483647,2147483647,-1,-1,2147483647],[0,0,-1,2147483647,-1,2147483647,-1,-1,2147483647,0,0,2147483647,0,2147483647],[-1,0,2147483647,-1,0,0,-1,2147483647,0,2147483647,0,-1,0,-1]]))
991,387
416eacbf58b7faa44c69c6ae88aba485775b76a8
from rest_framework import serializers from exam.models import ExamSession class ExamSessionAPISerializer(serializers.ModelSerializer): def create(self, validated_data): user = ExamSession.objects.create(start=validated_data['start'], finish=validated_data['finish'], stream=validated_data['stream'], major=validated_data['major'], start_button=False) return user class Meta: model = ExamSession fields = [ 'pk', 'start', 'finish', 'stream', 'major', 'start_button' ] class ExamSessionStudentAPISerializer(serializers.ModelSerializer): class Meta: model = ExamSession fields = [ 'pk', 'start', 'finish', 'stream', 'start_button' ] class ExamSessionSerializer(serializers.ModelSerializer): def update(self, instance, validated_data): instance.start = validated_data.get('start', instance.start) instance.finish = validated_data.get('finish', instance.finish) instance.stream = validated_data.get('stream', instance.stream) instance.start_button = validated_data.get('start_button', instance.stream) instance.save() return instance class Meta: model = ExamSession fields = [ 'pk', 'start', 'finish', 'stream', 'start_button' ] class ExamSessionTeacherSerializer(serializers.ModelSerializer): def update(self, instance, validated_data): instance.start = validated_data.get('start', instance.start) instance.finish = validated_data.get('finish', instance.finish) instance.stream = validated_data.get('stream', instance.stream) instance.major = validated_data.get('major', instance.major) instance.start_button = validated_data.get('start_button', instance.major) instance.save() return instance class Meta: model = ExamSession fields = [ 'pk', 'start', 'finish', 'stream', 'major', 'start_button' ]
991,388
2cfbc7a454c1c923bf8a555f036bb376940a42c7
from standardweb import db, app from standardweb.models import ForumCategory, ForumTopic, ForumPost def migrate_post_topic_counts(): for category in ForumCategory.query.all(): for forum in category.forums: post_count = 0 forum.topic_count = ForumTopic.query.filter_by(deleted=False, forum=forum).count() for topic in forum.topics: topic.post_count = ForumPost.query.filter_by(deleted=False, topic=topic).count() topic.save(commit=False) post_count += topic.post_count for post in topic.posts: post.body = post.body.replace('[size ', '[size=') post.save(commit=False) forum.post_count = post_count forum.save(commit=False) db.session.commit() print 'Done post and topic counts' def main(): try: migrate_post_topic_counts() except: db.session.rollback() raise else: db.session.commit() print 'Done!' if __name__ == '__main__': with app.test_request_context(): app.config.from_object('settings') main()
991,389
c4436f4bf290c0c21275206d9e4dde9dd9819a4e
import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('ex.png') kernel = np.ones((5, 5), np.uint8) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) blurred = cv2.GaussianBlur(gray, (5, 5), 0) erosion = cv2.erode(blurred, kernel, iterations=2) #cv2.imshow("Image", erosion) #cv2.waitKey(0) imagen = erosion #Crear un kernel de '1' de 3x3 kernel = np.ones((3, 3), np.uint8) #Se aplica la transformacion: Morphological Gradient transformacion = cv2.dilate(imagen, kernel, iterations=1) - cv2.erode(imagen, kernel, iterations=1) ''' Mostrar el resultado y salir cv2.imshow('resultado', transformacion) cv2.waitKey(0) cv2.destroyAllWindows() ''' edges = cv2.Canny(transformacion, 90, 90) plt.subplot(121), plt.imshow(transformacion, cmap='gray') plt.title('Original Image'), plt.xticks([]), plt.yticks([]) plt.subplot(122), plt.imshow(edges, cmap='gray') plt.title('Edge Image'), plt.xticks([]), plt.yticks([]) plt.show()
991,390
6a6d12806425206c959ddebb74f4d93d5dfba2ef
''' PYTHON SERIAL DEBUGGING CODE HOW TO USE: 1. run script in terminal with the -i flag and with a comport number as argument (python -i main.py) e.g. 'python -i main.py 3' 2. to continuously print recieved data, type read() 3. python will now print all received data to the console 4. to stop reading, use a keyboard interrupt (CTRL+C) 5. the connection to the arduino will close automatically 6. flash a new version of your C code and start again at step 2, no need to stop python 7. ??? 8. profit ''' import serial import sys if len(sys.argv) == 1: raise Exception('\n\nNo arguments given for comport. Read main.py for more information.') BAUD = 9600 timeout = 2 port = 'COM{}'.format(sys.argv[1]) def read(bytes_nr=1): with serial.Serial(port, BAUD, timeout=timeout) as ser: while True: data_hex = ser.read(bytes_nr).hex() data_nr = str(data_hex) if data_nr == '': data_nr = '0' data_nr = int(data_nr, 16) print('0x{} - {}'.format(data_hex, data_nr))
991,391
5be8585cf7bef75ebc88d583c948ba6d74aa49ed
# Generated by Django 3.0.2 on 2020-01-14 02:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('occasions', '0002_assembly_address'), ('whereabouts', '0003_address'), ] operations = [ migrations.AddField( model_name='address', name='assemblies', field=models.ManyToManyField(through='occasions.AssemblyAddress', to='occasions.Assembly'), ), ]
991,392
19f6e01ef5a0566fb91c672995c0458b7443645e
import random # Read and understand the docstrings of all of the functions in detail. def make_deck(num): '''(int)->list of int Returns a list of integers representing the strange deck with num ranks. >>> deck=make_deck(13) >>> deck [101, 201, 301, 401, 102, 202, 302, 402, 103, 203, 303, 403, 104, 204, 304, 404, 105, 205, 305, 405, 106, 206, 306, 406, 107, 207, 307, 407, 108, 208, 308, 408, 109, 209, 309, 409, 110, 210, 310, 410, 111, 211, 311, 411, 112, 212, 312, 412, 113, 213, 313, 413] >>> deck=make_deck(4) >>> deck [101, 201, 301, 401, 102, 202, 302, 402, 103, 203, 303, 403, 104, 204, 304, 404] ''' l=[] for i in range(1,num+1): l=l+[100+i,200+i,300+i,400+i] return l def shuffle_deck(deck): '''(list of int)->None Shuffles the given list of strings representing the playing deck Here you should use random.shuffle function from random module. Since shufflling is random, exceptionally in this function your output does not need to match that show in examples below: >>> deck=[101, 201, 301, 401, 102, 202, 302, 402, 103, 203, 303, 403, 104, 204, 304, 404] >>> shuffle_deck(deck) >>> deck [102, 101, 302, 104, 304, 103, 301, 403, 401, 404, 203, 204, 303, 202, 402, 201] >>> shuffle_deck(deck) >>> deck [402, 302, 303, 102, 104, 103, 203, 301, 401, 403, 204, 101, 304, 201, 404, 202] ''' random.shuffle(deck) def deal_cards_start(deck): '''(list of int)-> list of int Returns a list representing the player's starting hand. It is obtained by dealing the first 7 cards from the top of the deck. Precondition: len(deck)>=7 ''' dealt_cards=[] for i in range(len(deck)-1,len(deck)-8,-1): dealt_cards.append(deck[i]) deck.remove(deck[i]) return dealt_cards def deal_new_cards(deck, player, num): '''(list of int, list of int, int)-> None Given the remaining deck, current player's hand and an integer num, the function deals num cards to the player from the top of the deck. If len(deck)<num then len(deck) cards is dealt, in particular all the remaining cards from the deck are dealt. Precondition: 1<=num<=6 deck and player are disjoint subsets of the strange deck. >>> deck=[201, 303, 210, 407, 213, 313] >>> player=[302, 304, 404] >>> deal_new_cards(deck, player, 4) >>> player [302, 304, 404, 313, 213, 407, 210] >>> deck [201, 303] >>> >>> deck=[201, 303] >>> player=[302, 304, 404] >>> deal_new_cards(deck, player, 4) >>> player [302, 304, 404, 303, 201] >>> deck [] ''' if 1<=num<=6: for i in range(len(deck)-1,len(deck)-(num+1),-1): player.append(deck[i]) deck.remove(deck[i]) def print_deck_twice(hand): '''(list)->None Prints elements of a given list deck in two useful ways. First way: sorted by suit and then rank. Second way: sorted by rank. Precondition: hand is a subset of the strange deck. Your function should not change the order of elements in list hand. You should first make a copy of the list and then call sorting functions/methods. Example run: >>> a=[311, 409, 305, 104, 301, 204, 101, 306, 313, 202, 303, 410, 401, 105, 407, 408] >>> print_deck_twice(a) 101 104 105 202 204 301 303 305 306 311 313 401 407 408 409 410 101 301 401 202 303 104 204 105 305 306 407 408 409 410 311 313 >>> a [311, 409, 305, 104, 301, 204, 101, 306, 313, 202, 303, 410, 401, 105, 407, 408] ''' l1=[] l1=l1+hand l1.sort() for num in l1: print(num,end=' ') print('\n') l2=[] for i in range(14): for num in l1: if num%100==i: l2.append(num) for num in l2: print (num,end=' ') print() def is_valid(cards, player): '''(list of int, list of int)->bool Function returns True if every card in cards is the player's hand. Otherwise it prints an error message and then returns False, as illustrated in the followinng example runs. Precondition: cards and player are subsets of the strange deck. >>> is_valid([210,310],[201, 201, 210, 302, 311]) 310 not in your hand. Invalid input False >>> is_valid([210,310],[201, 201, 210, 302, 310, 401]) True ''' for number in cards: if number not in player: print (number, ' not in your hand. Invalid input') return False return True def is_discardable_kind(cards): '''(list of int)->True Function returns True if cards form 2-, 3- or 4- of a kind of the strange deck. Otherwise it returns False. If there is not enough cards for a meld it also prints a message about it, as illustrated in the followinng example runs. Precondition: cards is a subset of the strange deck. In this function you CANNOT use strings except in calls to print function. In particular, you cannot convert elements of cards to strings. >>> is_discardable_kind([207, 107, 407]) True >>> is_discardable_kind([207, 107, 405, 305]) False >>> is_discardable_kind([207]) Invalid input. Discardable set needs to have at least 2 cards. False ''' x=1 if len(cards)<2: print("Invalid input. Discardable set needs to have at least 2 cards.") return False else: for i in range(len(cards)-1): if (cards[i]%100)==(cards[i+1]%100): x=x+1 else: x=1 if x==2: return True if x<2: return False def is_discardable_seq(cards): '''(list of int)->True Function returns True if cards form progression of the strange deck. Otherwise it prints an error message and then returns False, as illustrated in the followinng example runs. Precondition: cards is a subset of the strange deck. In this function you CANNOT use strings except in calls to print function. In particular, you cannot conver elements of cards to strings. >>> is_discardable_seq([313, 311, 312]) True >>> is_discardable_seq([311, 312, 313, 414]) Invalid sequence. Cards are not of same suit. False >>> is_discardable_seq([311,312,313,316]) Invalid sequence. While the cards are of the same suit the ranks are not consecutive integers. False >>> is_discardable_seq([201, 202]) Invalid sequence. Discardable sequence needs to have at least 3 cards. False >>> is_discardable_seq([]) Invalid sequence. Discardable sequence needs to have at least 3 cards. False ''' l=[] l=l+cards l.sort() x=1 if len(cards)<3: print('Invalid sequence. Discardable sequence needs to have at least 3 cards.') return False for i in range(len(l)-1): if l[i]//100 != l[i+1]//100: print('Invalid sequence. Cards are not of same suit.') return False for i in range(len(l)-1): if l[i]%100==(l[i+1]%100)-1: x=x+1 else: print("Invalid sequence. While the cards are of the same suit the ranks are not consecutive integers.") return False x=1 if x==len(l): return True def rolled_one_round(player): '''(list of int)->None This function plays the part when the player rolls 1 Precondition: player is a subset of the strange deck >>> #example 1: >>> rolled_one_round(player) Discard any card of your choosing. Which card would you like to discard? 103 103 No such card in your hand. Try again. Which card would you like to discard? 102 Here is your new hand printed in two ways: 201 212 311 201 311 212 ''' flag=True print('Discard any card of your choosing.') while flag==True: card_discarded=int(input('which card would you like to discard')) if card_discarded in player: player.remove(card_discarded) flag=False else: print('No such card in your hand. Try again.') print('\nHere is your new hand printed in two ways:\n') print_deck_twice(player) def rolled_nonone_round(player): '''(list of int)->None This function plays the part when the player rolls 2, 3, 4, 5, or 6. Precondition: player is a subset of the strange deck >>> #example 1: >>> player=[401, 102, 403, 104, 203] >>> rolled_nonone_round(player) Yes or no, do you have a sequences of three or more cards of the same suit or two or more of a kind? yes Which 3+ sequence or 2+ of a kind would you like to discard? Type in cards separated by space: 102 103 104 103 not in your hand. Invalid input Yes or no, do you have a sequences of three or more cards of the same suit or two or more of a kind? yes Which 3+ sequence or 2+ of a kind would you like to discard? Type in cards separated by space: 403 203 Here is your new hand printed in two ways: 102 104 401 401 102 104 Yes or no, do you have a sequences of three or more cards of the same suit or two or more of a kind? no >>> #example 2: >>> player=[211, 412, 411, 103, 413] >>> rolled_nonone_round(player) Yes or no, do you have a sequences of three or more cards of the same suit or two or more of a kind? yes Which 3+ sequence or 2+ of a kind would you like to discard? Type in cards separated by space: 411 412 413 Here is your new hand printed in two ways: 103 211 103 211 Yes or no, do you have a sequences of three or more cards of the same suit or two or more of a kind? no >>> #example 3: >>> player=[211, 412, 411, 103, 413] >>> rolled_nonone_round(player) Yes or no, do you have a sequences of three or more cards of the same suit or two or more of a kind? yes Which 3+ sequence or 2+ of a kind would you like to discard? Type in cards separated by space: 411 412 Invalid sequence. Discardable sequence needs to have at least 3 cards. >>> #example 4: >>> player=[401, 102, 403, 104, 203] >>> rolled_nonone_round(player) Yes or no, do you have a sequences of three or more cards of the same suit or two or more of a kind? alsj Yes or no, do you have a sequences of three or more cards of the same suit or two or more of a kind? hlakj Yes or no, do you have a sequences of three or more cards of the same suit or two or more of a kind? 22 33 Yes or no, do you have a sequences of three or more cards of the same suit or two or more of a kind? no ''' flag=True melds=[] while flag: melds=[] question=input("Yes or no, do you have a sequence of three or more cards of the same suit or two or more of a kind? ") question=(question.strip()).lower() if question=='no': flag=False elif question == 'yes': cards= input('Which 3+ sequence or 2+ of a kind would you like to discard? Type in cards separated by space:' ) cards= (cards.strip()).split() for num in cards: melds.append(int(num)) print(melds) if is_valid(melds, player): if is_discardable_kind(melds) or is_discardable_seq(melds): for num in melds: player.remove(num) print('\nHere is your new hand printed in two ways:\n') print_deck_twice(player) flag=True else: melds=[] flag=True else: cards=[] melds=[] flag=True else: flag=True # main print("Welcome to Single Player Rummy with Dice and strange deck.\n") size_change=input("The standard deck has 52 cards: 13 ranks times 4 suits.\nWould you like to change the number of cards by changing the number of ranks? ").strip().lower() # YOUR CODE GOES HERE and in all of the above functions instead of keyword pass if size_change=='yes': number_of_cards=input('Enter a number between 3 and 99, for the numbers of ranks: ').strip() hand=make_deck(int(number_of_cards)) print('You are playing with a deck of ', int(number_of_cards)*4, ' cards') else: hand=make_deck(13) print('You are playing with a deck of 52 cards') shuffle_deck(hand) player=deal_cards_start(hand) print ('Here is your starting hand printed in two ways: \n') print_deck_twice(player) i=1 flag=True while flag: print('Welcome to round ', i,'.') print('Please roll the dice.') dice=random.randint(1,6) if len(hand)<=dice: if 2<=dice<=6: print('You rolled the dice and it shows:',dice,' \nSince your rolled, ' ,dice , 'the following',dice ,' or', len(hand), ' (if the deck has less than n 3 cards will be added to your hand from the top of the deck.)') deal_new_cards(hand, player, len(hand)) print ('Here is your starting hand printed in two ways: \n') print_deck_twice(player) rolled_nonone_round(player) print('Round ',i ,' completed.') i=i+1 print('Welcome to round ', i,'. \nThe game is in empty deck phase.') for x in range(0,len(player)): rolled_one_round(player) print('Round ',i+x,' completed') x=x+1 print('Congratulations, you completed the game in',(i+x)-1,' rounds.') flag=False else: print('You rolled the dice and it shows:',dice) rolled_one_round(player) print('Round ',i ,' completed.') i=i+1 print('Welcome to round ', i,'. \nThe game is in empty deck phase.') rolled_nonone_round(player) for x in range(0,len(player)+1): rolled_one_round(player) print('Round ',i+x,' completed') x=x+1 print('Congratulations, you completed the game in',(i+x)-1,' rounds.') flag=False else: if 2<=dice<=6: print('You rolled the dice and it shows:',dice, ' \nSince your rolled, ' ,dice ,'the following',dice ,' or', len(hand), ' (if the deck has less than n 3 cards will be added to your hand from the top of the deck.)') deal_new_cards(hand, player, dice) print ('Here is your starting hand printed in two ways: \n') print_deck_twice(player) rolled_nonone_round(player) print('Round ',i ,' completed.') i=i+1 else: print('You rolled the dice and it shows:',dice) rolled_one_round(player) print('Round ',i ,' completed.') i=i+1
991,393
54bf3d0ebcc1fa0f13c6ee5079bc1533a571bc29
__author__ = 'wdolowicz' def test_add_group(app, xlsx_groups): group = xlsx_groups old_list = app.group.get_group_list(app.main_window) app.group.add_new_group(app.main_window, group) new_list = app.group.get_group_list(app.main_window) old_list.append(group.name) assert sorted(old_list) == sorted(new_list)
991,394
bc2797c8a35dff6ac9ca202bef68ee68152623c7
from numpy import absolute, where from scipy.spatial.distance import correlation from .ALMOST_ZERO import ALMOST_ZERO def compute_correlation_distance_between_2_1d_arrays(_1d_array_0, _1d_array_1): correlation_distance = correlation(_1d_array_0, _1d_array_1) return where(absolute(correlation_distance) < ALMOST_ZERO, 0, correlation_distance)
991,395
2897778bb879464cf29b7190a2fac3468ffb0bf7
API_KEY="675cbcc8a79998079a4605a19ccdca44"
991,396
73af06f39b5bea34eb5376cd2bc184ff625390f2
#!/usr/bin/env python # encoding: utf-8 """ This is the bootstrap that installs required code at runtime and runs the tool for the job. The bootstrap is also responsible for communicating with the slave daemon on the host (this is assumed to be running in a virtual machine guest). """ from __future__ import absolute_import from pprint import pprint from requests.auth import HTTPBasicAuth import base64 import imp import json import logging import marshal import os import pip import pip.req import re import requests import select import shutil import site import socket import struct import subprocess import sys import tarfile import threading import time import traceback class FriendlyJSONEncoder(json.JSONEncoder): """Encode json data correctly. Created in order to handle ObjectId instances correctly. """ def default(self, o): # I don't want to have to import bson here, since that's installed # via a top-level requirements.txt with pymongo. We'll just check the # class name instead (HACK). # # also see the note in HostComms.send_msg if o.__class__.__name__ == "ObjectId": return str(o) else: return super(self.__class__, self).default(o) ORIG_ARGS = sys.argv # clear out any existing handlers logging.getLogger().handlers = [] logging.getLogger("urllib3").setLevel(logging.WARN) logging.getLogger("pip").setLevel(logging.WARN) DEV = len(sys.argv) > 1 and sys.argv[1] == "dev" log_file = os.path.join(os.path.dirname(__file__), __file__.split(".")[0] + ".log") if DEV: logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(filename=log_file, level=logging.DEBUG) logging.getLogger("requests").setLevel(logging.CRITICAL) stream_handler = logging.StreamHandler(sys.stdout) stream_handler.setLevel(logging.DEBUG) formatter = logging.Formatter('%(name)s:%(levelname)s: %(message)s') stream_handler.setFormatter(formatter) logging.getLogger().addHandler(stream_handler) class LogAccumulator(logging.Handler): def __init__(self): super(self.__class__, self).__init__() self.records = [] def emit(self, record): self.records.append(record) def get_records(self): formatter = logging.Formatter('%(asctime)s %(levelname)s:%(name)s:%(message)s') res = [] for record in self.records: res.append(formatter.format(record)) return res class HostComms(threading.Thread): """Communications class to communicate with the host. """ def __init__(self, recv_callback, job_id, job_idx, tool, dev=False): """Create the HostComms instance. :param function recv_callback: A callback to call when new messages are received. :param str job_id: The id of the current job. :param int job_idx: The index into the current job. :param str tool: The name of the tool to run. :param bool dev: If this class should run in dev mode. """ super(HostComms, self).__init__() self._log = logging.getLogger("HostComms") self._dev = dev # spin until we have a real ip address while True: self._my_ip = socket.gethostbyname(socket.gethostname()) if self._my_ip.startswith("127.0"): p = subprocess.Popen(["ifconfig", "eth0"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout, stderr = p.communicate() for line in stdout.split("\n"): if "inet addr:" in line: match = re.match(r'^\s*inet addr:(\d+\.\d+\.\d+\.\d+).*$', line) self._my_ip = match.group(1) break if not self._my_ip.startswith("192.168.123."): self._log.debug("We don't have an ip address yet (currently '{}')".format(self._my_ip)) time.sleep(0.2) continue break self._log.debug("We have an ip! {}".format(self._my_ip)) self._host_ip = self._my_ip.rsplit(".", 1)[0] + ".1" self._host_port = 55555 self._job_id = job_id self._job_idx = job_idx self._tool = tool self._running = threading.Event() self._running.clear() self._connected = threading.Event() self._connected.clear() self._send_recv_lock = threading.Lock() self._recv_callback = recv_callback self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) def run(self): """Run the host comms in a new thread. :returns: None """ self._log.info("Running") self._running.set() if not self._dev: self._sock.connect((self._host_ip, self._host_port)) self._connected.set() # select on the socket until we're told not to run anymore while self._running.is_set(): if not self._dev: reads, _, _ = select.select([self._sock], [], [], 0.1) if len(reads) > 0: data = "" with self._send_recv_lock: while True: recvd = self._sock.recv(0x1000) if len(recvd) == 0: break data += recvd self._recv_callback(data) time.sleep(0.1) self._log.info("Finished") def stop(self): """Stop the host comms from running """ self._log.info("Stopping") self._running.clear() def send_msg(self, type, data): """Send a message to the host. :param str type: The type of message to send :param dict data: The data to send to the host :returns: None """ data = json.dumps( { "job": self._job_id, "idx": self._job_idx, "tool": self._tool, "type": type, "data": data }, # use this so that users don't run into errors with ObjectIds not being # able to be encodable. If using bson.json_util.dumps was strictly used # everywhere, could just use that dumps method, but it's not, and I'd rather # keep it simple for now cls=FriendlyJSONEncoder ) self._connected.wait(2 ** 31) data_len = struct.pack(">L", len(data)) if not self._dev: try: with self._send_recv_lock: self._sock.send(data_len + data) except: # yes, just silently fail I think??? pass class TalusCodeImporter(object): """This class will dynamically import tools and components from the talus git repository. This class *should* conform to "pep-302":https://www.python.org/dev/peps/pep-0302/ """ def __init__(self, loc, username, password, parent_log=None): """Create a new talus code importer that will fetch code from the specified ``location``, using ``username`` and ``password``. :param str loc: The repo location (e.g. ``https://....`` or ``ssh://...``) :param str username: The username to fetch the code with :param str password: The password to fetch the code with """ if parent_log is None: parent_log = logging.getLogger("BOOT") self._log = parent_log.getChild("importer") self.loc = loc self.pypi_loc = loc.replace("/code_cache", "/pypi/") if self.loc.endswith("/"): self.loc = self.loc[:-1] self.username = username self.password = password self._code_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), "TALUS_CODE") if not os.path.exists(self._code_dir): os.makedirs(self._code_dir) sys.path.insert(0, self._code_dir) self._pypi_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), "TALUS_PYPI") if not os.path.exists(self._pypi_dir): os.makedirs(self._pypi_dir) os.makedirs(os.path.join(self._pypi_dir, "simple")) # since we will be installing code via "pip install --user ...", make # sure the user site is on our path if not os.path.exists(site.USER_SITE): os.makedirs(site.USER_SITE) sys.path.insert(0, site.USER_SITE) self.cache = {} dir_check = lambda x: x.endswith("/") self.cache["git"] = {"__items__": set(["talus/"]), "talus/": {"__items__": set()}} # this will add lib to the cache # these are python packages that are stored in git (and aren't cachable in our # own pypi) package_items = self._git_show("talus/packages")["items"] self.cache["packages"] = dict(map(lambda x: (x.replace("/", ""), True), filter(dir_check, package_items))) pypi_items = self._git_show("talus/pypi/simple")["items"] self.cache["pypi"] = dict(map(lambda x: (x.replace("/", ""), True), filter(dir_check, pypi_items))) def find_module(self, abs_name, path=None): """Normally, a finder object would return a loader that can load the module. In our case, we're going to be sneaky and just download the files and return ``None`` and let the normal sys.path-type loading take place. This method is cleaner and less error prone :param str abs_name: The absolute name of the module to be imported """ package_name = abs_name.split(".")[0] last_name = abs_name.split(".")[-1] if last_name in sys.modules: return None try: # means it can already be imported, no work to be done here imp.find_module(abs_name) # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # see the comment in the docstring return None except ImportError as e: pass if package_name == "talus" and self._module_in_git(abs_name): self.download_module(abs_name) # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # see the comment in the docstring return None if package_name in self.cache["packages"] and package_name not in sys.modules: self.install_package_from_talus(package_name) return None # we NEED to have the 2nd check here or else it will keep downloading # the same package over and over if package_name in self.cache["pypi"] and package_name not in sys.modules: self.install_cached_package(package_name) return None # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # THIS IS IMPORTANT, YES WE WANT TO RETURN NONE!!! # see the comment in the docstring return None def download_module(self, abs_name): """Download the module found at ``abs_name`` from the talus git repository :param str abs_name: The absolute module name of the module to be downloaded """ self._log.info("Downloading module {}".format(abs_name)) path = abs_name.replace(".", "/") filepath = path + ".py" info = self._git_show(path) if info is None: info_test = self._git_show(path + ".py") if info_test is None: raise ImportError(abs_name) info = info_test self._download(path, info=info) return None def install_cached_package(self, package_name): """Install the python package from our cached pypi. :param str package_name: The name of the python package to install :returns: None """ self._log.info("Installing package {!r} from talus pypi".format(package_name)) pinfo = self.cache["pypi"][package_name] pypi_hostname = re.match(r'^.*://([^/]+)/.*$', self.pypi_loc).group(1) try: self._run_pip_main([ "install", "--user", "--trusted-host", pypi_hostname, "-i", self.pypi_loc, package_name ]) except SystemExit as e: raise Exception("Is SystemExit expected?") def install_package_from_talus(self, package_name): """Install the package in talus/packages """ self._log.info( "Installing package {!r} from talus_code/talus/packages".format(package_name) ) info = self._git_show("talus/packages/{}".format(package_name)) # should handle .tar.gz files if available self._download("talus/packages/{}".format(package_name)) full_path = os.path.join( self._code_dir, "talus", "packages", package_name ) pypi_hostname = re.match(r'^.*://([^/]+)/.*$', self.pypi_loc).group(1) try: self._run_pip_main([ "install", "--user", "--upgrade", # point pip at the talus pypi in case the package has a # requirements.txt "--trusted-host", pypi_hostname, "-i", self.pypi_loc, full_path ]) except SystemExit as e: # TODO raise Exception("Is SystemExit normal?") def _download_file(self, path, info=None): """Download the specified resource at ``path``, optionally using the already-fetched ``info`` (result of ``self._git_show(path)``). :param str path: The relative path using '/' separators inside the talus_code repository :param dict info: The result of ``self._git_show(path)`` (default=``None``) :returns: None """ self._log.debug("Downloading file {!r}".format(path)) if info is None: info = self._git_show(path) # info *SHOULD* be a basestring if not isinstance(info, basestring): raise Exception("{!r} was not a file! (info was {!r})".format( path, info )) dest_path = os.path.join(self._code_dir, path.replace("/", os.path.sep)) self._save_file(dest_path, info) def _save_file(self, file_path, data): """Save the single file from git :param str file_path: The path to save the data to :param str data: The data for the file at ``file_path`` :returns: None """ self._ensure_directory(os.path.dirname(file_path)) with open(file_path, "wb") as f: f.write(data) def _ensure_directory(self, dirname): """Make sure the directory exists. :param str dirname: The directory to ensure :returns: None """ if not os.path.exists(dirname): os.makedirs(dirname) def _download_folder(self, path, info=None, install_requirements=True): """Download the folder specified by ``path``, possibly using already-fetched ``info`` (result of ``self._git_show(path)``), optionally installing the requirements.txt that may exist inside of the downloaded folder. If the specified path is in one of the main subdirectories (see ``_is_in_main_subdir``), the .tar.gz of the directory will be downloaded and extracted, if it exists. :param str path: The relative path in the talus_code repository. Uses '/' for separators :param dict info: Result of ``self._git_show(path)`` (default=``None``) :param bool install_requirements: Whether requirements.txt should be installed (if it exists). (default=True) """ self._log.debug("Downloading directory {!r}".format(path)) if info is None: info = self._git_show(path) # check for compressed version of the folder tar_gz_name = os.path.basename(path) + ".tar.gz" parent_info = self._git_show(os.path.dirname(path)) if parent_info is None: parent_info = {"items":[]} if self._is_in_main_subdir(path) and tar_gz_name in parent_info["items"]: self._log.debug("Found compressed version of main subdir {!r}".format( path )) self._download_compressed_dir(path + ".tar.gz") # download like normal else: # only recursively download tools/components/packages/lib folders/subdirectories recurse = self._is_in_main_subdir(path, descendant=True) for item in info["items"]: if item.endswith("/") and not recurse: continue item_path = path + "/" + item # don't just download all of the .tar.gz's in main subdirectories! if item_path.endswith(".tar.gz") and self._is_in_main_subdir(item_path): continue self._download(item_path) # install requirements.txt if requested if install_requirements and "requirements.txt" in info["items"]: self.install_requirements(path + "/requirements.txt") def install_requirements(self, rel_path): """Install the requirements.txt located at ``rel_path``. Note that the path is a relative path using ``/`` separators. :param str rel_path: The relative path inside of ``self._code_dir`` :returns: None """ self._log.debug("Installing requirements {}".format(rel_path)) rel_path = rel_path.replace("/", os.path.sep) full_path = os.path.join(self._code_dir, rel_path) with open(full_path, "rb") as f: data = f.read() # this takes a fair amount of time sometimes, so if there's an # empty requirements.txt file, skip installing it actual_req_count = 0 for line in data.split("\n"): line = line.strip() if line == "" or line.startswith("#"): continue actual_req_count += 1 if actual_req_count == 0: self._log.debug("Empty requirements.txt, skipping") return try: threading.local().indentation = 0 pypi_hostname = re.match(r'^.*://([^/]+)/.*$', self.pypi_loc).group(1) self._run_pip_main([ "install", "--user", "--trusted-host", pypi_hostname, "-i", self.pypi_loc, "-r", full_path ]) # this is expected - pip.main will *always* exit except SystemExit as e: # TODO raise Exception("Is SystemExit normal?") threading.local().indentation = 0 def _is_in_main_subdir(self, path, descendant=False): """Return ``True`` or ``False`` if the specified path is in one of the main subdirectories of the talus codebase. I.e. if it is a subfolder of or a file in one the following directories: * talus/tools * talus/components * talus/packages * talus/lib :param str path: The path to check :param bool descendant: If the path can be a several levels deep inside a main subdirectory. :returns: bool """ base_regex = r'^(talus\/(tools|packages|components|lib))/' # anything inside that directory if descendant: regex = base_regex + ".*" # strictly must be an immediate child of one of the # main subdirectories else: regex = base_regex + r'[^/]*$' main_subdir_match = re.match(regex, path) return main_subdir_match is not None def _download(self, path, info=None): """Download the specified ``path``, possibly using an already- fetched ``info`` (result of ``self._git_show(path)``), optionally recursively downloading the folder. :param str path: The relative path in the talus_code repository. Uses '/' for separators :param dict info: Result of ``self._git_show(path)`` (default=``None``) :returns: None """ if info is None: info = self._git_show(path) if info is None: raise Exception("Error! could not get information from code cache about {!r}".format(path)) # it's a directory that we're downloading if isinstance(info, dict): self._download_folder(path, info=info) # it's a single file that we're downloading elif isinstance(info, basestring): self._download_file(path, info=info) else: raise Exception("Unknown resource info: {!r}".format(info)) def _download_compressed_dir(self, tar_gz_path): """Download/make available/install the compressed directory. This also includes installing the requirements.txt if it exists. :param str dest: The path to where the tar file (and extracted contents) should be saved :param str tar_gz_name: The path to download from code cache :returns: None """ self._log.debug("Downloading compressed directory at {!r}".format(tar_gz_path)) tar_gz = self._git_show(tar_gz_path) dest_tar_path = os.path.join(self._code_dir, tar_gz_path.replace("/", os.path.sep)) self._ensure_directory(os.path.dirname(dest_tar_path)) self._save_file(dest_tar_path, tar_gz) self._extract(dest_tar_path) def _extract(self, file_path): """ Extracts the .tar.gz file at the specified abs_name :param file_path: path to file :return: None """ self._log.debug("Extracting file {!r}".format( os.path.basename(file_path) )) tar = tarfile.open(file_path, "r:gz") tar.extractall(os.path.dirname(file_path)) tar.close() def _run_pip_main(self, pip_args): proc = subprocess.Popen(["pip"] + pip_args) proc.communicate() def _git_show(self, path, ref="HEAD"): """Return the json object returned from the /code_cache on the web server :str param path: The talus-code-relative path to get information about (file or directory) :str param ref: The reference with which to lookup the code (can be a branch, commit, etc) """ res = requests.get( "/".join([self.loc, ref, path]), auth=HTTPBasicAuth(self.username, self.password) ) if res.status_code // 100 != 2: return None if res.headers['Content-Type'] == 'application/json': res = json.loads(res.content) # cache existence info about all directories shown! if path != "talus/pypi/simple" and res["type"] == "listing": self._add_to_cache(path, items=res["items"]) else: res = res.content return res def _add_to_cache(self, path, items=None): cache = root = self.cache["git"] parts = path.split("/") for part in parts: cache = cache.setdefault(part + "/", {"__items__": set()}) for item in items: cache["__items__"].add(item) def _module_in_git(self, modname): parts = modname.split(".") cache = self.cache["git"] for part in parts[:-1]: items = cache["__items__"] if part + "/" not in items: return False cache = cache[part + "/"] last_part = parts[-1] items = cache["__items__"] # e.g. talus.fileset if last_part + ".py" in items: return True # e.g. talus.tools if last_part + "/" in items: return True return False class TalusBootstrap(object): """The main class that will bootstrap the job and get things running """ def __init__(self, config_path, dev=False): """ :param str config_path: The path to the config file containing json information about the job """ self._log = logging.getLogger("BOOT") self._log_accumulator = LogAccumulator() # add this to the root logger so it will capture EVERYTHING logging.getLogger().addHandler(self._log_accumulator) if not os.path.exists(config_path): self._log.error("ERROR, config path {} not found!".format(config_path)) self._flush_logs() exit(1) with open(config_path, "r") as f: self._config = json.loads(f.read()) self._job_id = self._config["id"] self._idx = self._config["idx"] self._tool = self._config["tool"] self._params = self._config["params"] self._fileset = self._config["fileset"] self._db_host = self._config["db_host"] self._debug = self._config["debug"] self._num_progresses = 0 self.dev = dev self._host_comms = HostComms(self._on_host_msg_received, self._job_id, self._idx, self._tool, dev=dev) def _flush_logs(self): logging.shutdown() def sys_except_hook(self, type_, value, traceback): formatted = traceback.format_exception(type_, value, traceback) self._log.exception("There was an exception!") self._log.error(formatted) cleanup() try: self._host_comms.send_msg("error", { "message": str(value), "backtrace": formatted, "logs": self._log_accumulator.get_records() }) except: pass def run(self): self._log.info("Running bootstrap") start_time = time.time() self._host_comms.start() self._host_comms.send_msg("installing", {}) self._install_code_importer() talus_mod = __import__("talus", globals(), locals(), fromlist=["job"]) fileset_mod = getattr(talus_mod, "fileset") fileset_mod.set_connection(self._db_host) job_mod = getattr(talus_mod, "job") Job = getattr(job_mod, "Job") try: job = Job( id=self._job_id, idx=self._idx, tool=self._tool, params=self._params, fileset_id=self._fileset, progress_callback=self._on_progress, results_callback=self._on_result, ) self._log.info("Took {:.02f}s to start running job!".format( time.time() - start_time )) # should be a signal that things are about to start running self._host_comms.send_msg("started", {}) job.run() except Exception as e: self._log.exception("Job had an error!") formatted = traceback.format_exc() self._host_comms.send_msg("error", { "message": str(e), "backtrace": formatted, "logs": self._log_accumulator.get_records() }) self._flush_logs() # if the debug flag was set, then ALWAYS store the logs! if self._debug: self._host_comms.send_msg("logs", { "message": "DEBUG LOGS", "backtrace": "", "logs": self._log_accumulator.get_records() }) if self._num_progresses == 0: self._log.info("Progress was never called, but job finished running, inc progress by 1") self._on_progress(1) self._host_comms.send_msg("finished", {}) self._host_comms.stop() self._shutdown() def _shutdown(self): """shutdown the vm""" os_name = os.name.lower() if os_name == "nt": os.system("shutdown /t 0 /s /f") else: os.system("shutdown -h now") def _on_host_msg_received(self, data): """Handle the data received from the host :param str data: The raw data (probably in json format) """ self._log.info("Received a message from the host: {}".format(data)) data = json.loads(data) def _on_progress(self, num): """Increment the progress count for this job by ``num`` :param int num: The number to increment the progress count of this job by """ self._num_progresses += num self._log.info("Progress incrementing by {}".format(num)) self._host_comms.send_msg("progress", num) def _on_result(self, result_type, result_data): """Append this to the results for this job :param object result_data: Any python object to be stored with this job's results (str, dict, a number, etc) """ self._log.info("Sending result") self._host_comms.send_msg("result", {"type": result_type, "data": result_data}) def _install_code_importer(self): """Install the sys.meta_path finder/loader to automatically load modules from the talus git repo. """ self._log.info("Installing talus code importer") code = self._config["code"] self._code_importer = TalusCodeImporter( code["loc"], code["username"], code["password"], parent_log=self._log ) sys.meta_path = [self._code_importer] def main(dev=False): config_path = os.path.join(os.path.dirname(__file__), "config.json") bootstrap = TalusBootstrap(config_path, dev=dev) bootstrap.run() if __name__ == "__main__": dev = False if len(sys.argv) > 1 and sys.argv[1] == "dev": dev = True main(dev=dev)
991,397
92ac3abee26a3fc35f22bfdbf6e6531cdf7d4ca2
#stampa i primi 6 multipli di n def StampaMultipli(n): i = 1 while i <= 6: print (n*i, '\t') i= i + 1 #perché? print () StampaMultipli(6) #generalizzazione 6*6 def TabellaMoltiplicazioneGenerica(Grandezza): i = 1 while i <= Grandezza: StampaMultipli(i) i = i + 1 #generalizzazione7*7 def StampaMultipli(n, Grandezza): i = 1 while i <= Grandezza: print (n*i, '\t') i = i + 1 print(n, '\t', Grandezza) def TabellaMoltiplicazioneGenerica(Grandezza): i = 1 while i <= Grandezza: StampaMultipli(i, Grandezza) i = i + 1 TabellaMoltiplicazioneGenerica(7)
991,398
f95af2c6d99bb2cd827362f0266e24022a09f8a9
from functools import wraps def beg(target_function): @wraps(target_function) def wrapper(*args,**kwargs): msg,say_please=target_function(*args,**kwargs) if say_please: return "{}{}".format(msg,'please ! I am poor:(') return msg return wrapper @beg def say(say_please=False): msg='can you buy me a beer?' return msg,say_please print say() print say(say_please=True)
991,399
0ce2b98956ff98d7f5fe328170339a429baae9c4
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . import outputs __all__ = ['RoleManagementPolicyAssignmentArgs', 'RoleManagementPolicyAssignment'] @pulumi.input_type class RoleManagementPolicyAssignmentArgs: def __init__(__self__, *, scope: pulumi.Input[str], policy_id: Optional[pulumi.Input[str]] = None, role_definition_id: Optional[pulumi.Input[str]] = None, role_management_policy_assignment_name: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a RoleManagementPolicyAssignment resource. :param pulumi.Input[str] scope: The role management policy scope. :param pulumi.Input[str] policy_id: The policy id role management policy assignment. :param pulumi.Input[str] role_definition_id: The role definition of management policy assignment. :param pulumi.Input[str] role_management_policy_assignment_name: The name of format {guid_guid} the role management policy assignment to upsert. """ pulumi.set(__self__, "scope", scope) if policy_id is not None: pulumi.set(__self__, "policy_id", policy_id) if role_definition_id is not None: pulumi.set(__self__, "role_definition_id", role_definition_id) if role_management_policy_assignment_name is not None: pulumi.set(__self__, "role_management_policy_assignment_name", role_management_policy_assignment_name) @property @pulumi.getter def scope(self) -> pulumi.Input[str]: """ The role management policy scope. """ return pulumi.get(self, "scope") @scope.setter def scope(self, value: pulumi.Input[str]): pulumi.set(self, "scope", value) @property @pulumi.getter(name="policyId") def policy_id(self) -> Optional[pulumi.Input[str]]: """ The policy id role management policy assignment. """ return pulumi.get(self, "policy_id") @policy_id.setter def policy_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "policy_id", value) @property @pulumi.getter(name="roleDefinitionId") def role_definition_id(self) -> Optional[pulumi.Input[str]]: """ The role definition of management policy assignment. """ return pulumi.get(self, "role_definition_id") @role_definition_id.setter def role_definition_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "role_definition_id", value) @property @pulumi.getter(name="roleManagementPolicyAssignmentName") def role_management_policy_assignment_name(self) -> Optional[pulumi.Input[str]]: """ The name of format {guid_guid} the role management policy assignment to upsert. """ return pulumi.get(self, "role_management_policy_assignment_name") @role_management_policy_assignment_name.setter def role_management_policy_assignment_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "role_management_policy_assignment_name", value) class RoleManagementPolicyAssignment(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, policy_id: Optional[pulumi.Input[str]] = None, role_definition_id: Optional[pulumi.Input[str]] = None, role_management_policy_assignment_name: Optional[pulumi.Input[str]] = None, scope: Optional[pulumi.Input[str]] = None, __props__=None): """ Role management policy Azure REST API version: 2020-10-01. Prior API version in Azure Native 1.x: 2020-10-01 :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] policy_id: The policy id role management policy assignment. :param pulumi.Input[str] role_definition_id: The role definition of management policy assignment. :param pulumi.Input[str] role_management_policy_assignment_name: The name of format {guid_guid} the role management policy assignment to upsert. :param pulumi.Input[str] scope: The role management policy scope. """ ... @overload def __init__(__self__, resource_name: str, args: RoleManagementPolicyAssignmentArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Role management policy Azure REST API version: 2020-10-01. Prior API version in Azure Native 1.x: 2020-10-01 :param str resource_name: The name of the resource. :param RoleManagementPolicyAssignmentArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(RoleManagementPolicyAssignmentArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, policy_id: Optional[pulumi.Input[str]] = None, role_definition_id: Optional[pulumi.Input[str]] = None, role_management_policy_assignment_name: Optional[pulumi.Input[str]] = None, scope: Optional[pulumi.Input[str]] = None, __props__=None): opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = RoleManagementPolicyAssignmentArgs.__new__(RoleManagementPolicyAssignmentArgs) __props__.__dict__["policy_id"] = policy_id __props__.__dict__["role_definition_id"] = role_definition_id __props__.__dict__["role_management_policy_assignment_name"] = role_management_policy_assignment_name if scope is None and not opts.urn: raise TypeError("Missing required property 'scope'") __props__.__dict__["scope"] = scope __props__.__dict__["effective_rules"] = None __props__.__dict__["name"] = None __props__.__dict__["policy_assignment_properties"] = None __props__.__dict__["type"] = None alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="azure-native:authorization/v20201001:RoleManagementPolicyAssignment"), pulumi.Alias(type_="azure-native:authorization/v20201001preview:RoleManagementPolicyAssignment")]) opts = pulumi.ResourceOptions.merge(opts, alias_opts) super(RoleManagementPolicyAssignment, __self__).__init__( 'azure-native:authorization:RoleManagementPolicyAssignment', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None) -> 'RoleManagementPolicyAssignment': """ Get an existing RoleManagementPolicyAssignment resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = RoleManagementPolicyAssignmentArgs.__new__(RoleManagementPolicyAssignmentArgs) __props__.__dict__["effective_rules"] = None __props__.__dict__["name"] = None __props__.__dict__["policy_assignment_properties"] = None __props__.__dict__["policy_id"] = None __props__.__dict__["role_definition_id"] = None __props__.__dict__["scope"] = None __props__.__dict__["type"] = None return RoleManagementPolicyAssignment(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="effectiveRules") def effective_rules(self) -> pulumi.Output[Sequence[Any]]: """ The readonly computed rule applied to the policy. """ return pulumi.get(self, "effective_rules") @property @pulumi.getter def name(self) -> pulumi.Output[str]: """ The role management policy name. """ return pulumi.get(self, "name") @property @pulumi.getter(name="policyAssignmentProperties") def policy_assignment_properties(self) -> pulumi.Output['outputs.PolicyAssignmentPropertiesResponse']: """ Additional properties of scope, role definition and policy """ return pulumi.get(self, "policy_assignment_properties") @property @pulumi.getter(name="policyId") def policy_id(self) -> pulumi.Output[Optional[str]]: """ The policy id role management policy assignment. """ return pulumi.get(self, "policy_id") @property @pulumi.getter(name="roleDefinitionId") def role_definition_id(self) -> pulumi.Output[Optional[str]]: """ The role definition of management policy assignment. """ return pulumi.get(self, "role_definition_id") @property @pulumi.getter def scope(self) -> pulumi.Output[Optional[str]]: """ The role management policy scope. """ return pulumi.get(self, "scope") @property @pulumi.getter def type(self) -> pulumi.Output[str]: """ The role management policy type. """ return pulumi.get(self, "type")