max_stars_repo_path
stringlengths 4
237
| max_stars_repo_name
stringlengths 6
117
| max_stars_count
int64 0
95.2k
| id
stringlengths 1
7
| content
stringlengths 12
593k
| input_ids
sequencelengths 7
549k
|
---|---|---|---|---|---|
checkov/gitlab/runner.py | pmalkki/checkov | 1 | 158875 | from checkov.common.output.report import CheckType
from checkov.gitlab.dal import Gitlab
from checkov.json_doc.runner import Runner as JsonRunner
from checkov.runner_filter import RunnerFilter
class Runner(JsonRunner):
check_type = CheckType.GITLAB_CONFIGURATION
def __init__(self):
self.gitlab = Gitlab()
super().__init__()
def run(self, root_folder=None, external_checks_dir=None, files=None,
runner_filter=RunnerFilter(), collect_skip_comments=True):
self.prepare_data()
report = super().run(root_folder=self.gitlab.gitlab_conf_dir_path, external_checks_dir=external_checks_dir,
files=files,
runner_filter=runner_filter, collect_skip_comments=collect_skip_comments)
JsonRunner._change_files_path_to_relative(report)
return report
def prepare_data(self):
self.gitlab.persist_all_confs()
def require_external_checks(self):
# default json runner require only external checks. Gitlab runner brings build in checks
return False
def import_registry(self):
from checkov.gitlab.registry import registry
return registry
| [
1,
515,
1423,
586,
29889,
9435,
29889,
4905,
29889,
12276,
1053,
5399,
1542,
13,
3166,
1423,
586,
29889,
5559,
8205,
29889,
12293,
1053,
11786,
8205,
13,
3166,
1423,
586,
29889,
3126,
29918,
1514,
29889,
27492,
1053,
7525,
1089,
408,
14355,
16802,
13,
3166,
1423,
586,
29889,
27492,
29918,
4572,
1053,
7525,
1089,
5072,
13,
13,
13,
1990,
7525,
1089,
29898,
8148,
16802,
1125,
13,
1678,
1423,
29918,
1853,
353,
5399,
1542,
29889,
29954,
1806,
24461,
29918,
25903,
4574,
8098,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
5559,
8205,
353,
11786,
8205,
580,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
13,
1678,
822,
1065,
29898,
1311,
29892,
3876,
29918,
12083,
29922,
8516,
29892,
7029,
29918,
3198,
29879,
29918,
3972,
29922,
8516,
29892,
2066,
29922,
8516,
29892,
13,
9651,
28877,
29918,
4572,
29922,
16802,
5072,
3285,
6314,
29918,
11014,
29918,
21032,
29922,
5574,
1125,
13,
4706,
1583,
29889,
19125,
29918,
1272,
580,
13,
13,
4706,
3461,
353,
2428,
2141,
3389,
29898,
4632,
29918,
12083,
29922,
1311,
29889,
5559,
8205,
29889,
5559,
8205,
29918,
5527,
29918,
3972,
29918,
2084,
29892,
7029,
29918,
3198,
29879,
29918,
3972,
29922,
23176,
29918,
3198,
29879,
29918,
3972,
29892,
13,
462,
632,
2066,
29922,
5325,
29892,
13,
462,
632,
28877,
29918,
4572,
29922,
27492,
29918,
4572,
29892,
6314,
29918,
11014,
29918,
21032,
29922,
15914,
29918,
11014,
29918,
21032,
29897,
13,
4706,
14355,
16802,
3032,
3167,
29918,
5325,
29918,
2084,
29918,
517,
29918,
22925,
29898,
12276,
29897,
13,
4706,
736,
3461,
13,
13,
1678,
822,
19012,
29918,
1272,
29898,
1311,
1125,
13,
4706,
1583,
29889,
5559,
8205,
29889,
6774,
391,
29918,
497,
29918,
5527,
29879,
580,
13,
13,
1678,
822,
1996,
29918,
23176,
29918,
3198,
29879,
29898,
1311,
1125,
13,
4706,
396,
2322,
4390,
28877,
1996,
871,
7029,
12747,
29889,
11786,
8205,
28877,
23522,
2048,
297,
12747,
13,
4706,
736,
7700,
13,
13,
1678,
822,
1053,
29918,
1727,
6020,
29898,
1311,
1125,
13,
4706,
515,
1423,
586,
29889,
5559,
8205,
29889,
1727,
6020,
1053,
21235,
13,
4706,
736,
21235,
13,
2
] |
qymel/core/__init__.py | hal1932/QyMEL | 6 | 16039 | <reponame>hal1932/QyMEL
# coding: utf-8
from .force_reload import *
from .scopes import *
| [
1,
529,
276,
1112,
420,
29958,
4077,
29896,
29929,
29941,
29906,
29914,
29984,
29891,
2303,
29931,
13,
29937,
14137,
29901,
23616,
29899,
29947,
13,
3166,
869,
10118,
29918,
28120,
1053,
334,
13,
3166,
869,
21785,
267,
1053,
334,
13,
2
] |
app.py | ballmaK/StockPool_V2 | 0 | 1614390 | <filename>app.py
# -*- coding: utf-8 -*-
#!/usr/bin/python
import re
import os
import sys
import time
import random
import httplib
import json
import datetime
import traceback
import threadpool
import Queue
from math import ceil
from optparse import OptionParser,OptionGroup
DATADIR="data/historys"
DATEHIS="data/date-historys"
PH=50
PL=-15
STOCKINFO={}
# 获取所有交易日
def __getFullDate(yearStart,yearEnd):
for year in range(yearStart,yearEnd+1):
year = str(year)
startdate = year+'0101'
enddate = year+'1231'
timestam = time.time()
url = "q.stock.sohu.com"
path = "/hisHq?code=zs_000001&start=%s&end=%s&stat=1&order=D&period=d&callback=historySerchHandler&rt=jsonp&r=%s" % (startdate, enddate, timestam)
content = __httpGetContent(url, path)
print content
datelist = [date[0].replace('-','') for date in json.loads(content[len('historySerchHandler('):-2].replace('%',''), encoding="GBK")[0]['hq']]
if not os.path.exists(DATEHIS):
os.mkdir(DATEHIS)
fd = open(os.path.join(DATEHIS,year), 'w+')
fd.write(json.dumps(datelist))
fd.close()
def __getTurnOver(code, year):
timestam = time.time()
dateStart = year+'0101'
dateEnd = year +'1231'
url = "q.stock.sohu.com"
path = "/hisHq?code=cn_%s&start=%s&end=%s&stat=1&order=D&period=d&callback=historySerchHandler&rt=jsonp&r=%s" % (code, dateStart, dateEnd, timestam)
content = __httpGetContent(url, path)
# print content
try:
jsonp = json.loads(content[len('historySerchHandler('):-2].replace('%',''), encoding="GBK")
stockinfo = jsonp[0]['hq']
except:
stockinfo = []
datedict = {}
for date in stockinfo:
datedict[date[0].replace('-','')] = date[9]
if not stockinfo:
datedict[dateStart] = 0
return datedict
def getShangHaiInfo(year):
timestam = time.time()
dateStart = year+'0101'
dateEnd = year +'1231'
url = "q.stock.sohu.com"
path = "/hisHq?code=zs_000001&start=%s&end=%s&stat=1&order=D&period=d&callback=historySerchHandler&rt=jsonp&r=%s" % (dateStart, dateEnd, timestam)
content = __httpGetContent(url, path)
try:
jsonp = json.loads(content[len('historySerchHandler('):-2].replace('%',''), encoding="GBK")
stockinfo = jsonp[0]['hq']
except:
stockinfo = []
sh = {}
for info in stockinfo:
shStock = {}
date = info[0]#.replace('-','')
shStock['date'] = date
shStock['start'] = float(info[1])
shStock['end'] = float(info[2])
shStock['low'] = float(info[5])
shStock['high'] = float(info[6])
shStock['volume'] = int(ceil(float(info[7])))
shStock['total'] = int(ceil(float(info[8])))
sh[date]=shStock
return sh
def getShangHaiBR(stock):
stock_date = stock.keys()
stocklist = [(k,stock[k]) for k in sorted(stock_date, reverse=True)]
sorted_stock_date = [s[0] for s in stocklist]
for date in stock_date:
if date:
try:
index = sorted_stock_date.index(date)
except:
delist = True
index = 0
else:
index = 0
stockdayslist = stocklist[index:index+20]
#print stocklist20
h, l, a = __getHLIn(stockdayslist)
BR = a/(h/l)
stock[date]['BR'] = BR
now_price = stocklist[index][1]['end']
if index >= 1:
day1 = stocklist[index-1][1]['end'] #1日后收盘价
day1_p = round((day1 - now_price)/now_price, 3) * 100 #1日后涨跌幅
if index >= 3:
day3 = stocklist[index-3][1]['end'] #3日后收盘价
day3_p = round((day3 - now_price)/now_price, 3) * 100 #3日后涨跌幅
if index >= 5:
day5 = stocklist[index-5][1]['end'] #5日后收盘价
day5_p = round((day5 - now_price)/now_price, 3) * 100 #5日后涨跌幅
stock[date]['1d'] = day1_p
stock[date]['3d'] = day3_p
stock[date]['5d'] = day5_p
stock[date]['price'] = now_price
#print "%-8s %-15s %8s %8s %8s" % ('DATE', 'BR-20', '1-DAYS', '3-DAYS', '5-DAYS')
#print "%s,%s,%s,%s,%s,%s" % ('DATE', 'BR-20', 'PRICE', '1-DAYS', '3-DAYS', '5-DAYS')
total = b = 0
for s in sorted_stock_date:
#print "%-8s %-15.2f %8.2f %8.2f %8.2f" % (stock[s]['date'],stock[s]['BR'],stock[s]['1d'],stock[s]['3d'],stock[s]['5d'])
aa = stock[s]['BR']/stock[s]['total']
#if aa <= 0.72:
# total += 1
# print "%s,%.2f,%d,%.2f,%d,%.2f" % (stock[s]['date'],stock[s]['BR'],stock[s]['price'],stock[s]['1d'],stock[s]['total'],stock[s]['BR']/stock[s]['total'])
# if stock[s]['1d'] <= 0:
# b += 1
print "%s,%.2f,%d,%.2f,%d,%.2f" % (stock[s]['date'],stock[s]['BR'],stock[s]['price'],stock[s]['1d'],stock[s]['total'],stock[s]['BR']/stock[s]['total'])
#print "TOTAL: %s, BINGO: %s" % (total, b)
#return stock
def __convert_inner(stock, todict, stock_dict={}):
stock_day = stock.split(',')
if all(stock_day):
date = stock_day[0] #日期
start = float(stock_day[1]) #开盘价格
high = float(stock_day[2]) #最高价格
low = float(stock_day[3]) #最低价格
end = float(stock_day[4]) #收盘价格
volume = int(ceil(float(stock_day[5]))) #成交量
total = int(ceil(float(stock_day[6]))) #成交额
try:
to = float(todict[date])
except:
to = 0.0
#print stock, date, to
stock_dict[date] = {
"date": date,
'start': start,
'high': high,
'low': low,
'end': end,
'volume': volume,
'total': total,
'to': to
}
return stock_dict
def __convert_day(content, todict):
stock_list = content.split('=')[1].split('|')
stock_dict = {}
for stock in stock_list:
if stock and stock.strip():
__convert_inner(stock, todict, stock_dict)
#print stock_dict
return stock_dict
def __httpGetContent(url,path):
conn = httplib.HTTPConnection(url,timeout=60)
conn.request("GET", path)
response = conn.getresponse()
if response.status == 200:
content = response.read()
else:
content = None
return content
def __getHLIn(stocklist):
high_list = []
low_list = []
money = 0
for stock in stocklist:
info = stock[1]
high_list.append(info['high'])
low_list.append(info['low'])
#计算每10亿股相对成交额
#if info['to'] != 0:
# rate = info['volume']/info['to'] / 1000000000
money += info['total']#/rate
return sorted(high_list)[-1], sorted(low_list)[0], money/20
def updateStockDayHistory(code, market, year='2015', type='b'):
"""
http://qd.10jqka.com.cn/api.php?p=stock_day&info=k_sz_000005&year=2012,2013&fq=
sz:深证
sh:上海
b向后复权
q向前复权
return dict
"""
if needUpdate(market, code, year, type):
url = "qd.10jqka.com.cn"
path = "/api.php?p=stock_day&info=k_%s_%s&year=%s&fq=%s" % (market, code, year, type)
todict = __getTurnOver(code, year)
try:
content = __httpGetContent(url, path)
except:
content = None
print code, ": Request failed ..."
if content:
#print code, ": Request success ..."
stock_dict = __convert_day(content,todict)
try:
updateSingleLocalHistory(market, code, year, type, stock_dict)
except Exception, e:
#print traceback.print_exc(e)
pass
return stock_dict
else:
# print '< ' + market + code + ' > need not to update ..'
pass
def __getLocalStockInfo(code, market, year, type):
code = market+code
try:
if code and year and type:
fd = open(os.path.join(DATADIR,code, year, type, '%s' % code),'r')
content = fd.read()
fd.close()
else:
fd = None
except Exception, e:
#print traceback.print_exc(e)
#if fd:
# fd.close()
return
return json.loads(content)
def __getMemeryStockInfo(code, market, year, type):
global STOCKINFO
stockcode = market+code
if stockcode in STOCKINFO:
return STOCKINFO[stockcode]
else:
codeMemInfo = __getLocalStockInfo(code, market, year, type)
STOCKINFO[stockcode] = codeMemInfo
return codeMemInfo
def needUpdate (market, code, year, type):
code = market+code
need = False
if not os.path.exists(os.path.join(DATADIR,code)):
need = True
if not os.path.exists(os.path.join(DATADIR,code, year)):
need = True
if not os.path.exists(os.path.join(DATADIR,code, year, type)):
need = True
# print os.path.join(DATADIR,code), os.path.join(DATADIR,code, year), os.path.join(DATADIR,code, year, type)
return need
def updateSingleLocalHistory(market, code, year, type, stock_dict):
code = market+code
print 'update <', code, '> info ..'
if os.path.exists(os.path.join(DATADIR,code)):
if os.path.exists(os.path.join(DATADIR,code, year)):
if os.path.exists(os.path.join(DATADIR,code, year, type)):
fd = open(os.path.join(DATADIR,code, year, type, '%s' % code), 'w+')
fd.write(json.dumps(stock_dict))
fd.close()
else:
os.mkdir(os.path.join(DATADIR,code, year, type))
fd = open(os.path.join(DATADIR,code, year, type, '%s' % code), 'w+')
fd.write(json.dumps(stock_dict))
fd.close()
else:
os.mkdir(os.path.join(DATADIR,code, year))
os.mkdir(os.path.join(DATADIR,code, year, type))
fd = open(os.path.join(DATADIR,code, year, type, '%s' % code), 'w+')
fd.write(json.dumps(stock_dict))
fd.close()
else:
os.mkdir(os.path.join(DATADIR,code))
os.mkdir(os.path.join(DATADIR,code, year))
os.mkdir(os.path.join(DATADIR,code, year, type))
fd = open(os.path.join(DATADIR,code, year, type, '%s' % code), 'w+')
fd.write(json.dumps(stock_dict))
fd.close()
def isTradeDay(date):
year = date[:4]
fd = open(os.path.join(DATEHIS,year),'r')
datelist = json.loads(fd.read())
fd.close()
try:
index = datelist.index(date)
except Exception,e:
return False
return True
def getNextDate(date,code=''):
year = date[:4]
fd = open(os.path.join(DATEHIS,year),'r')
datelist = json.loads(fd.read())
fd.close()
#print datelist
if datelist.index(date) >= 1:
return datelist[datelist.index(date)-1]
else:
return datelist[0]
def getLastDate(date,code=''):
year = date[:4]
month = date[4:6]
day = date[6:]
if code:
codeDateList = sorted(__getLocalStockInfo(code[2:], code[:2], year, type='b').keys(), reverse=True)
delta = 1
while 1:
try:
index = codeDateList.index(date)
break
#return codeDateList[index+1]
except:
newDate = datetime.datetime(int(year), int(month),int(day)) - datetime.timedelta(delta)
year, month, day = str(newDate.year), '%02d' % newDate.month , '%02d' % newDate.day
date = year+month+day
#return codeDateList[0]
return codeDateList[index+1]
else:
fd = open(os.path.join(DATEHIS,year),'r')
datelist = json.loads(fd.read())
fd.close()
delta = 1
while 1:
try:
index = datelist.index(date)
break
except:
print "Date is not deal day, choose one before it"
#delta += 1
newDate = datetime.datetime(int(year), int(month),int(day)) - datetime.timedelta(delta)
year, month, day = str(newDate.year), '%02d' % newDate.month , '%02d' % newDate.day
date = year+month+day
if index >= 1:
return datelist[index+1]
else:
return datelist[0]
def getBR(stockCode,date="",days=20):
code, market = stockCode[2:], stockCode[:2]
#print code, market
#stock = getStockDayHistory(code, market, year="2015", type="b")
year = date[:4]
stock = __getMemeryStockInfo(code, market, year, type="b")
day1 = day3 = day5 = 'NaN'
day1_p = day3_p = day5_p = 'NaN'
now_volume = 'NaN'
flow_volume = 0
flow_money = 0
delist = False
if stock:
stock_date = stock.keys()
stocklist = [(k,stock[k]) for k in sorted(stock_date, reverse=True)]
sorted_stock_date = [s[0] for s in stocklist]
if date:
try:
index = sorted_stock_date.index(date)
except:
delist = True
index = 0
else:
index = 0
#print "date: ",sorted_stock_date[index]
stockdayslist = stocklist[index:index+days]
#print stocklist20
h, l, a = __getHLIn(stockdayslist)
BR = a/(h/l)
stList = getSTStock()
now_price = stocklist[index][1]['end'] #当日收盘价
now_volume = stocklist[index][1]['volume']
turnover = stocklist[index][1]['to']
if turnover == 0:
flow_volume = 0
else:
flow_volume = now_volume / turnover * 100 / 100000000
flow_money = flow_volume * now_price
if now_volume <= 1000000 or delist or stockCode[2:] in stList: #当天交易量小于10000手
BR = 99999999999999999
if index >= 1:
day1 = stocklist[index-1][1]['end'] #1日后收盘价
day1_p = round((day1 - now_price)/now_price, 3) * 100 #1日后涨跌幅
if index >= 3:
day3 = stocklist[index-3][1]['end'] #3日后收盘价
day3_p = round((day3 - now_price)/now_price, 3) * 100 #3日后涨跌幅
if index >= 5:
day5 = stocklist[index-5][1]['end'] #5日后收盘价
day5_p = round((day5 - now_price)/now_price, 3) * 100 #5日后涨跌幅
return stockCode,BR,day1_p,day3_p,day5_p,now_volume,delist,flow_volume, flow_money
#return BR,day1,day3,day5
else:
return stockCode,99999999999999999,day1_p,day3_p,day5_p,now_volume,delist,flow_volume,flow_money
def getStockCode():
fdHA = open('data/HA.data','r')
fdSA = open('data/SA.data','r')
fdZX = open('data/ZX.data','r')
fdCY = open('data/CY.data','r')
HA = fdHA.read().split()
SA = fdSA.read().split()
ZX = fdZX.read().split()
CY = fdCY.read().split()
allStock = HA+SA+ZX+CY
allStockDict = {}
for stock in allStock:
k,v = stock.split(',')
allStockDict[k] = v
return allStockDict
def getSTStock():
fdST = open('data/ST.data','r')
ST = fdST.read().split()
stDict = {}
for st in ST:
k,v = st.split(',')
stDict[k] = v
return stDict
def getResult(request, br_info):
global sorted_s
sorted_s.append(br_info)
def updateLocalHistory(year, type):
'''
year@string: 2015
type@string: b=后复权;q=前复权
'''
allStockDict = getStockCode()
stock_data = allStockDict.keys()
q_size = len(stock_data)
pool = threadpool.ThreadPool(10, q_size=q_size, resq_size=q_size)
data = [([stock[2:], stock[:2], year, type],{}) for stock in stock_data]
requests = threadpool.makeRequests(updateStockDayHistory, data)
[pool.putRequest(req) for req in requests]
pool.wait()
def getBest(date="",length=50, days=20, printOut=False, filter=0.01):
'''
date@string: 20150729
length@int:
days@int: avg day
'''
#a = time.time()
global sorted_s
sorted_s = []
allStockDict = getStockCode()
stock_data = allStockDict.keys()
q_size = len(stock_data)
pool = threadpool.ThreadPool(1, q_size=q_size, resq_size=q_size)
data = [([stock],{"date": date,"days": days}) for stock in stock_data]
requests = threadpool.makeRequests(getBR, data, getResult)
[pool.putRequest(req, False) for req in requests]
pool.wait()
#print len(sorted_s)
best50 = sorted(sorted_s, key=lambda sorted_s:sorted_s[1])#[:50]
stList = getSTStock().keys()
length = length
best = []
#print "DATE: %s" % date
if printOut:
print "==================================== TRADE DATE: %s ====================================" % date
print "%-10s %-20s\t%-20s %-20s %-20s %-20s %-20s %-10s" % ("CODE","股票名字","BR-%s" % days,"1DAY_P","3DAY_P","5DAY_P","VOL","DELIST")
for b in best50:
if length > 0:
if not filter:
if printOut:
print "%-10s %-20s\t%-20.2f %-20s %-20s %-20s %-20s %-10s %10.2f %10.2f" % (b[0],allStockDict[b[0]],b[1],str(b[2]),str(b[3]),str(b[4]), b[5], b[6],b[7], b[8] )
length -= 1
best.append(b[0])
else:
if b[7] >= float(filter):
length -= 1
if printOut:
print "%-10s %-20s\t%-20.2f %-20s %-20s %-20s %-20s %-10s %10.2f %10.2f" % (b[0],allStockDict[b[0]],b[1],str(b[2]),str(b[3]),str(b[4]), b[5], b[6],b[7], b[8] )
best.append(b[0])
else:
#print 'GET BEST TAKE: %s' % (time.time() - a)
return best
def getFullCode(code):
'''
return@string: sz002891/sh600061 etc.
'''
if code.find('sz') < 0 or code.find('sh') < 0:
if code.find('60') == 0:
code = 'sh' + code
else:
code = 'sz' + code
return code
def getStockBR(stockCode, year='2015', type='b'):
'''
stockCode@string: full code
year@string: year
type@string: b=后复权;q=前复权
return@int:
'''
code, market = stockCode[2:], stockCode[:2]
stockinfo = __getMemeryStockInfo(code, market, year, type)
dateBRList = [(tuple([info]) + getBR(stockCode,info)) for info in stockinfo]
s_date = sorted(dateBRList, key=lambda dateBRList:dateBRList[0])
print "%-10s %-10s %-20s %-20s %-20s %-20s %-20s %-10s" % ("DATE","CODE","BR","1DAY_P","3DAY_P","5DAY_P","VOL","DELIST")
for b in s_date:
print "%-10s %-10s %-20s %-20s %-20s %-20s %-20s %-10s" % (b[0],b[1],str(b[2]),str(b[3]),str(b[4]), b[5], b[6], b[7] )
def updateStockCodeList():
url = "quote.eastmoney.com"
path = "/stocklist.html"
content = __httpGetContent(url, path)
p_sh = 'sh\d+'
p_sz = 'sz\d+'
p_st = "ST(.+)\((\d+)"
all = re.findall(p_sh, content) + re.findall(p_sz, content)
HA = []
SA = []
ZX = []
ST = []
CY = []
ST = [ t[1]+',*ST'+t[0].decode('GBK').encode('utf-8')+'\n' for t in re.findall(p_st, content)]
#print ST
#print content.decode('GBK')
#print all
for code in all:
p_cn = '">(.+)\(' + code[2:]
try:
codeCN = re.findall(p_cn, content)[0].decode('GBK').encode('utf-8')
except Exception, e:
codeCN = 'NONAME'
# print code, codeCN
if code[2:].find('60') == 0:
HA.append(code+','+codeCN+'\n')
if code[2:].find('000') == 0:
SA.append(code+','+codeCN+'\n')
if code[2:].find('002') == 0:
ZX.append(code+','+codeCN+'\n')
if code[2:].find('300') == 0:
CY.append(code+','+codeCN+'\n')
# print CY
fdHA = open('data/HA.data', 'w+')
fdSA = open('data/SA.data', 'w+')
fdZX = open('data/ZX.data', 'w+')
fdST = open('data/ST.data', 'w+')
fdCY = open('data/CY.data', 'w+')
fdHA.writelines(HA)
fdSA.writelines(SA)
fdZX.writelines(ZX)
fdST.writelines(ST)
fdCY.writelines(CY)
fdHA.close()
fdSA.close()
fdST.close()
fdZX.close()
fdCY.close()
#print content
def makeDeal(s_date, e_date, filter, codeinfo=[], rest_money=1000000, stockpick=10):
'''
s_date@string: start date
e_date@string: end date
codeinfo@list: [('002063', 27.78, 300), ('002150', 21.78, 200), ('600604', 18.21, 250)]; 数量单位:(股票代码,买入价格,手数))]
rest_money@int: 1000000
'''
a = time.time()
if not codeinfo:
#还未购买股票
#根据上一个交易日BR,在前20随机得出5支股票
suspension = False
while not isTradeDay(s_date):
s_date = getLastDate(s_date)
#s_date = getLastDate(s_date)
#lastDate = getLastDate(s_date)
allStock = getBest(s_date,length=5000,days=20)
bestlist = allStock[:20]
codelist = []
while len(codelist) < stockpick:
index = random.randint(0, 19)
if bestlist[index] not in codelist:
codelist.append(bestlist[index])
#codelist = [bestlist[random.randint(0,19)] for i in range(0,stockpick)]
#infodict@dict: {codefull_0:stockyear_0, codefull_1:stockyear_1}
infodict = {}
#print codelist
for bestcode in codelist:
infodict.update({bestcode:__getMemeryStockInfo(bestcode[2:], bestcode[:2], s_date[:4], type='b')})
#股票交易
rest_total = 0
#print 'TRADE DATE: ',s_date
newCodeInfo = []
print "==================================== TRADE DATE: %s ====================================" % s_date
print "<<OP>> : %-10s %-6s %-6s %-6s %-6s %-6s %-6s %6s%% %8s" % ('CODE','BUY','SELL','NOW', 'DEALT', 'SUSPEN', 'RANGE', 'P/L', 'MONEY')
for code in codelist:
codeinfoyear = infodict[code]
codeinfoday = codeinfoyear[s_date]
range = allStock.index(code)
buy = codeinfoday['start'] #开盘价买入
avgMoney = int(rest_money / stockpick) #每支买入金钱
buyNumber = int(avgMoney/buy/100) #每支买入数量
avgRestMoney = avgMoney - buy*buyNumber*100 #每支剩余金钱
nextDate = getNextDate(s_date) #获取下一个交易日天日期
rest_total += avgRestMoney
print "-> BUY : %-10s %-6.2f %-6.2f %-6.2f %-6d %-6s %-6s %6s%% %8s" % (code,buy,0,buy, buyNumber, suspension, range, 0,'-'+str(int(buy*buyNumber*100)))
newCodeInfo.append((code, buy, buyNumber))
print ">>TOTAL: %-10s %-6s %-6s %-6s %-6s %-6s %-6s %6.2f%% %8s" % ('-','-','-','-', '-', '-', '-', 0 , 1000000)
print 'TAKE ',int(time.time()) - a, ' seconds'
makeDeal(nextDate, e_date, filter, newCodeInfo, rest_total, stockpick)
else:
print "==================================== TRADE DATE: %s ====================================" % s_date
print "<<OP>> : %-10s %-6s %-6s %-6s %-6s %-6s %-6s %6s%% %8s" % ('CODE','BUY','SELL','NOW', 'DEALT', 'SUSPEN', 'RANGE', 'P/L', 'MONEY')
#计算股票市值
infodict = {}
totalValue = 0
lastDate = getLastDate(s_date)
allStock = getBest(lastDate,length=5000,days=20)
#print lastDate, allStock
bestlist= allStock[:20]
codelist = [_code[0] for _code in codeinfo]
for bestcode in codelist:
infodict.update({bestcode:__getMemeryStockInfo(bestcode[2:], bestcode[:2], s_date[:4], type='b')})
newCodeInfo = []
#newCodeInfo@list: [('002063', 27.78, 300), ('002150', 21.78, 200), ('600604', 18.21, 250)]; 数量单位:(股票代码,买入价格,手数))]
for info in codeinfo:
suspension = False
code, buy, oBuyNumber = info
#print allStock
range = allStock.index(code)
codeinfoyear = infodict[code]
codeinfoday = None
start_date = s_date
while not codeinfoday:
try:
codeinfoday = codeinfoyear[start_date]
break
except Exception,e:
#print traceback.print_exc(e)
codeinfoday = None
suspension = True
start_date = getLastDate(start_date, code)
#print start_date, code
#判断是否换股
if not suspension:
#未停牌
#卖出条件:1.BR不在前20;2.盈利超过35%
#判断盈利率
oldPrice = codeinfo[codelist.index(code)][1]
newPrice = codeinfoyear[s_date]['start']
percent = (newPrice/oldPrice - 1) * 100
#判断BR
if code not in bestlist:
#从前20挑出一支没有买过的新股
#print code,' out of 20'
tmpList = [_code[0] for _code in codelist]
while 1:
new = int(random.randint(0,19))
#新股不在codeinfo中且当日没有停牌
if bestlist[new] not in codelist:
newStock = bestlist[new]
newcodeinfoyear = __getMemeryStockInfo(newStock[2:], newStock[:2], s_date[:4], type='b')
if s_date in newcodeinfoyear.keys():
newRange = bestlist.index(newStock)
break
#print codeinfoyear[s_date]
sell = newPrice
print "<- SELL: %-10s %-6.2f %-6.2f %-6.2f %-6d %-6s %-6s %6.2f%% %8s" % (code,oldPrice, sell,0,oBuyNumber, suspension, range, percent,'+'+str(int(sell*oBuyNumber*100)))
#print sell, oBuyNumber, rest_money
oIndex=codelist.index(code)
codelist.remove(code)
codelist.insert(oIndex, newStock)
aTotalValue = sell * oBuyNumber * 100 + rest_money
#print sell, oBuyNumber, rest_money, aTotalValue
totalValue += aTotalValue
buy = newcodeinfoyear[s_date]['start'] #以开盘价购买
buyNumber = int(aTotalValue/buy/100) #计算股票数量
rest_money = aTotalValue - buy*buyNumber*100 #重新计算剩余金钱
#print buy, buyNumber, rest_money
print "-> BUY : %-10s %-6.2f %-6.2f %-6.2f %-6d %-6s %-6s %6.2f%% %8s" % (newStock,buy, 0,buy,buyNumber, suspension, newRange, 0,'-'+str(int(buy*buyNumber*100)))
newCodeInfo.append((newStock, buy, buyNumber))
continue
if percent >= PH or percent <= PL:
#盈利大于50%或者亏损大于15%,换股
#print 'Percent: ',newPrice/oldPrice
tmpList = [_code[0] for _code in codelist]
while 1:
new = int(random.randint(0,19))
if bestlist[new] not in codelist:
newStock = bestlist[new]
newcodeinfoyear = __getMemeryStockInfo(newStock[2:], newStock[:2], s_date[:4], type='b')
if s_date in newcodeinfoyear.keys():
newRange = bestlist.index(newStock)
break
#print codeinfoyear[s_date]
sell = newPrice
print "<- SELL: %-10s %-6.2f %-6.2f %-6.2f %-6d %-6s %-6s %6.2f%% %8s" % (code,oldPrice,sell,0,oBuyNumber, suspension, range, percent,'+'+str(int(sell*oBuyNumber*100)))
#print sell, oBuyNumber, rest_money
oIndex=codelist.index(code)
codelist.remove(code)
codelist.insert(oIndex, newStock)
aTotalValue = sell * oBuyNumber * 100 + rest_money
totalValue += aTotalValue
newcodeinfoyear = __getMemeryStockInfo(newStock[2:], newStock[:2], s_date[:4], type='b')
buy = newcodeinfoyear[s_date]['start'] #以开盘价购买
buyNumber = int(aTotalValue/buy/100) #计算股票数量
rest_money = aTotalValue - buy*buyNumber*100 #重新计算剩余金钱
print "-> BUY : %-10s %-6.2f %-6.2f %-6.2f %-6d %-6s %-6s %6.2f%% %8s" % (newStock,buy,0,buy, buyNumber, suspension, range, percent,'-'+str(int(buy*buyNumber*100)))
newCodeInfo.append((newStock, buy, buyNumber))
continue
if percent > PL and percent < PH and code in bestlist:
oPrice = codeinfoday['start']
aTotalValue = oPrice * oBuyNumber * 100
totalValue += aTotalValue
print "-* HOLD: %-10s %-6.2f %-6.2f %-6.2f %-6d %-6s %-6s %6.2f%% %8d" % (code,oldPrice,0,oPrice,oBuyNumber, suspension, range, percent,oPrice*oBuyNumber*100)
newCodeInfo.append((code, oldPrice, oBuyNumber))
continue
else:
#停牌,不换股
oldPrice = codeinfo[codelist.index(code)][1]
lastDate = getLastDate(s_date, code)
newPrice = codeinfoyear[lastDate]['end'] #停牌当天收盘价
#newPrice = codeinfoyear[s_date]['start']
percent = (newPrice/oldPrice - 1) * 100
oPrice = codeinfoday['end']
aTotalValue = oPrice * oBuyNumber * 100
totalValue += aTotalValue
print "-* HOLD: %-10s %-6.2f %-6.2f %-6.2f %-6d %-6s %-6s %6.2f%% %8d" % (code,oldPrice,0,newPrice,oBuyNumber, suspension, range, percent,oPrice*oBuyNumber*100)
newCodeInfo.append((code, oldPrice, oBuyNumber))
#else:
# totalValue = rest_money + totalValue
print ">>TOTAL: %-10s %-6s %-6s %-6s %-6s %-6s %-6s %6.2f%% %8s" % ('-','-','-','-', '-', '-', '-', ((totalValue+rest_money)/1000000 - 1)*100 , int(totalValue+rest_money))
#print "STOCK INFO: %s" % newCodeInfo
#print "STOCK VALUE: %s" % totalValue
#print "REST MONEY: %s" % rest_money
#print type(s_date.encode(sys.getdefaultencoding())), type(e_date)
#print s_date.encode(sys.getdefaultencoding()), e_date
if s_date!=e_date:
print 'TAKE ',int(time.time()) - a, ' seconds'
return makeDeal(getNextDate(s_date),e_date, filter, newCodeInfo,rest_money,stockpick)
else:
print "FINALLY VALUE: %s" % totalValue
return True
def getRange(stocklist, date='', length=20, days=20):
'''
stocklist: ['002063','002150', '600604']
return: [('002063', 1374), ('002150', 2), ('600604', 'NaN')]
'''
bestlist = [stock for stock in getBest(date, length, days)]
range = []
for stock in stocklist:
try:
#print getFullCode(stock)
index = bestlist.index(getFullCode(stock))
except:
index = 'NaN'
range.append((stock,index))
else:
return range
def setupParser():
usage = "usage: %prog [options] arg"
parser = OptionParser(usage=usage)
parser.add_option("-F", "--flow-filter", action="store", type="string", dest="filter", help="Filtrate by capital stock in circulation.", default='0.01')
parser.add_option("-P", "--print-out", action="store_true", dest="aPrint", help="Decide if to print out result.", default=False)
parser.add_option("-D", "--selected-date", action="store",type="string", dest="sDate", help="Selected date of picking.", default='')
parser.add_option("-t", "--top-X", action="store",type="int", dest="topX", help="Picking stock from topX.", default=20)
updateGroup = OptionGroup(parser, "Update Options","These options update all local data.")
updateGroup.add_option("-d", "--update-date", action="store_true", dest="update_date", help="Update all date from 1999.", default=False)
updateGroup.add_option("-l", "--update-local", action="store_true", dest="update_local", help="Update local stock info of specified year.", default=False)
updateGroup.add_option("-s", "--update-stock", action="store", dest="update_stock", help="Update stock list, from given year(2010 later).", default='')
parser.add_option_group(updateGroup)
makeDealGroup = OptionGroup(parser, "Make Deal Options","These options simulate deals. \
e.g: python app.py -f 20100105 -e 20101231 -m 1000000 -n 10")
makeDealGroup.add_option("-f", "--start-date", action="store",type="string", dest="sDate", help="Starting date of simulation.", default='')
makeDealGroup.add_option("-e", "--end-date", action="store",type="string", dest="eDate", help="Ending date of simulation.", default='')
makeDealGroup.add_option("-m", "--start-money", action="store",type="int", dest="sMoney", help="Get range by specified stocks number.", default=1000000)
makeDealGroup.add_option("-p", "--pick-policy", action="store",type="int", dest="policy", help="Policy of stock picking: \
0: random in pick number; \
1: static top 10.", default=0)
makeDealGroup.add_option("-n", "--pick-number", action="store",type="int", dest="pNumber", help="Number of stocks for random picking.", default=5)
parser.add_option_group(makeDealGroup)
getBestGroup = OptionGroup(parser, "Pick Best Stocks","These options pick out best stocks by specified args. \
e.g: python app.py -D 20100231 -P [-t 20] [-a 20] [-F 5]")
getBestGroup.add_option("-a", "--average-day", action="store",type="int", dest="aDays", help="BR's average day.", default=20)
getRangeGroup = OptionGroup(parser, "Get Stock Range","These options get range of stocks by given args. \
e.g: python app.py -D 20100231 [-t 20] [-a 20] [-F 5]")
getRangeGroup.add_option("-r", "--get-range", action="store",type="string", dest="sList", help="Get one or multi stocks range. \
e.g.: 000651,000731.", default='')
parser.add_option_group(getRangeGroup)
parser.add_option_group(getBestGroup)
return parser
if __name__ == "__main__":
#l = ['2015','2014','2013','2012','2011','2010']
#for year in l:
#sh = getShangHaiInfo('2015')
# sh = getShangHaiInfo(year)
# getShangHaiBR(sh)
#sh = getShangHaiInfo('2015')
#getShangHaiBR(sh)
sorted_s = []
parser = setupParser()
(options, args) = parser.parse_args()
if options.update_date:
print 'Update full date list ...'
__getFullDate(2010,2018)
print 'Complete ...'
print 'Update stock list ...'
updateStockCodeList()
print 'Complete ...'
if options.update_local:
print 'Update ST stocks ...'
getSTStock()
print 'Complete ...'
if options.update_stock:
try:
year = int(options.update_stock)
except Exception,e:
parser.error('%s is not a year' % options.update_stock)
print 'Update stocks from %s to now ...' % options.update_stock
for i in range(int(year),year+1):
print 'Update %s\'s stocks info ...' % i
updateLocalHistory(str(i),'b')
else:
print 'Complete ...'
if options.sDate and options.topX and options.aDays:
try:
date, topX, aDays,filter= options.sDate, options.topX, options.aDays, options.filter
except Exception,e:
parser.error("Not enough args.")
try:
filter = float(options.filter)
except Exception,e:
parser.error('%s is not a float.' % options.filter)
getBest(date,length=topX,days=aDays,printOut=options.aPrint,filter=filter)
#else:
# parser.error("Not enough args.")
if options.sDate and options.eDate and options.sMoney and options.pNumber:
sDate, eDate, filter, sMoney, pNumber = options.sDate, options.eDate, options.filter, options.sMoney, options.pNumber
makeDeal(sDate, eDate, filter, [], sMoney, pNumber)
if options.sList and options.sDate:
sDate, sList = options.sDate,options.sList
try:
l = sList.split(',')
except:
parser.error('Split stock with ",".' % options.filter)
print getRange(l,date=sDate, length=options.topX)
#print __getFullDate(1999,2015)
#getStockBR('sz000739')
#getSTStock()
#best = getBest("20150730",length=20,days=20,printOut=True)
#stocklist = ['000736','002735','002323','603006','002679','000025','603268','002680','603009']
#print getRange(stocklist,date='20150730', length=20)
#print best
#makeDeal('20150715','20150730', [], 1000000, 5)
#money = makeDeal("20150720", "20150724", 1000000, stockpick=2)
#updateLocalHistory('2015','b')
#updateStockCodeList()
| [
1,
529,
9507,
29958,
932,
29889,
2272,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
13,
5215,
337,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
931,
13,
5215,
4036,
13,
5215,
1732,
1982,
13,
5215,
4390,
13,
5215,
12865,
13,
5215,
9637,
1627,
13,
5215,
3244,
10109,
13,
5215,
5462,
434,
13,
13,
3166,
5844,
1053,
2257,
309,
13,
3166,
3523,
5510,
1053,
10831,
11726,
29892,
8375,
4782,
13,
13,
25832,
3035,
8193,
543,
1272,
29914,
18434,
29879,
29908,
13,
6248,
29950,
3235,
543,
1272,
29914,
1256,
29899,
18434,
29879,
29908,
13,
19689,
29922,
29945,
29900,
13,
7390,
10457,
29896,
29945,
13,
1254,
29949,
7077,
11690,
3790,
29913,
13,
13,
29937,
29871,
31024,
30683,
30744,
30417,
31398,
233,
155,
150,
30325,
13,
1753,
4770,
657,
13658,
2539,
29898,
6360,
4763,
29892,
6360,
5044,
1125,
13,
1678,
363,
1629,
297,
3464,
29898,
6360,
4763,
29892,
6360,
5044,
29974,
29896,
1125,
13,
4706,
1629,
353,
851,
29898,
6360,
29897,
13,
4706,
1369,
1256,
353,
1629,
23097,
29900,
29896,
29900,
29896,
29915,
13,
4706,
1095,
1256,
353,
1629,
23097,
29896,
29906,
29941,
29896,
29915,
13,
4706,
5335,
342,
314,
353,
931,
29889,
2230,
580,
13,
4706,
3142,
353,
376,
29939,
29889,
17712,
29889,
578,
6905,
29889,
510,
29908,
13,
4706,
2224,
353,
5591,
22880,
29950,
29939,
29973,
401,
29922,
22381,
29918,
29900,
29900,
29900,
29900,
29900,
29896,
29987,
2962,
16328,
29879,
29987,
355,
16328,
29879,
29987,
6112,
29922,
29896,
29987,
2098,
29922,
29928,
29987,
19145,
29922,
29881,
29987,
14035,
29922,
18434,
1748,
305,
4598,
29987,
2273,
29922,
3126,
29886,
29987,
29878,
16328,
29879,
29908,
1273,
313,
2962,
1256,
29892,
1095,
1256,
29892,
5335,
342,
314,
29897,
13,
4706,
2793,
353,
4770,
1124,
2577,
3916,
29898,
2271,
29892,
2224,
29897,
13,
4706,
1596,
2793,
13,
4706,
1418,
295,
391,
353,
518,
1256,
29961,
29900,
1822,
6506,
877,
29899,
3788,
1495,
363,
2635,
297,
4390,
29889,
18132,
29898,
3051,
29961,
2435,
877,
18434,
1748,
305,
4598,
877,
1125,
29899,
29906,
1822,
6506,
877,
29995,
3788,
5477,
8025,
543,
7210,
29968,
1159,
29961,
29900,
22322,
29882,
29939,
2033,
29962,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
6248,
29950,
3235,
1125,
13,
9651,
2897,
29889,
11256,
3972,
29898,
6248,
29950,
3235,
29897,
13,
4706,
285,
29881,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
6248,
29950,
3235,
29892,
6360,
511,
525,
29893,
29974,
1495,
13,
4706,
285,
29881,
29889,
3539,
29898,
3126,
29889,
29881,
17204,
29898,
4130,
295,
391,
876,
13,
4706,
285,
29881,
29889,
5358,
580,
13,
13,
1753,
4770,
657,
27407,
3563,
29898,
401,
29892,
1629,
1125,
268,
13,
1678,
5335,
342,
314,
353,
931,
29889,
2230,
580,
13,
1678,
2635,
4763,
353,
1629,
23097,
29900,
29896,
29900,
29896,
29915,
13,
1678,
2635,
5044,
353,
1629,
718,
29915,
29896,
29906,
29941,
29896,
29915,
13,
1678,
3142,
353,
376,
29939,
29889,
17712,
29889,
578,
6905,
29889,
510,
29908,
13,
1678,
2224,
353,
5591,
22880,
29950,
29939,
29973,
401,
29922,
18038,
29918,
29995,
29879,
29987,
2962,
16328,
29879,
29987,
355,
16328,
29879,
29987,
6112,
29922,
29896,
29987,
2098,
29922,
29928,
29987,
19145,
29922,
29881,
29987,
14035,
29922,
18434,
1748,
305,
4598,
29987,
2273,
29922,
3126,
29886,
29987,
29878,
16328,
29879,
29908,
1273,
313,
401,
29892,
2635,
4763,
29892,
2635,
5044,
29892,
5335,
342,
314,
29897,
13,
1678,
2793,
353,
4770,
1124,
2577,
3916,
29898,
2271,
29892,
2224,
29897,
13,
1678,
396,
1596,
2793,
13,
1678,
1018,
29901,
13,
4706,
4390,
29886,
353,
4390,
29889,
18132,
29898,
3051,
29961,
2435,
877,
18434,
1748,
305,
4598,
877,
1125,
29899,
29906,
1822,
6506,
877,
29995,
3788,
5477,
8025,
543,
7210,
29968,
1159,
13,
4706,
10961,
3888,
353,
4390,
29886,
29961,
29900,
22322,
29882,
29939,
2033,
13,
1678,
5174,
29901,
13,
4706,
10961,
3888,
353,
5159,
13,
268,
13,
1678,
29797,
919,
353,
6571,
13,
1678,
363,
2635,
297,
10961,
3888,
29901,
13,
4706,
29797,
919,
29961,
1256,
29961,
29900,
1822,
6506,
877,
29899,
3788,
1495,
29962,
353,
2635,
29961,
29929,
29962,
13,
308,
13,
1678,
565,
451,
10961,
3888,
29901,
13,
4706,
29797,
919,
29961,
1256,
4763,
29962,
353,
29871,
29900,
13,
268,
13,
1678,
736,
29797,
919,
13,
13,
1753,
679,
2713,
574,
29950,
1794,
3401,
29898,
6360,
1125,
13,
1678,
5335,
342,
314,
353,
931,
29889,
2230,
580,
13,
1678,
2635,
4763,
353,
1629,
23097,
29900,
29896,
29900,
29896,
29915,
13,
1678,
2635,
5044,
353,
1629,
718,
29915,
29896,
29906,
29941,
29896,
29915,
13,
1678,
3142,
353,
376,
29939,
29889,
17712,
29889,
578,
6905,
29889,
510,
29908,
13,
1678,
2224,
353,
5591,
22880,
29950,
29939,
29973,
401,
29922,
22381,
29918,
29900,
29900,
29900,
29900,
29900,
29896,
29987,
2962,
16328,
29879,
29987,
355,
16328,
29879,
29987,
6112,
29922,
29896,
29987,
2098,
29922,
29928,
29987,
19145,
29922,
29881,
29987,
14035,
29922,
18434,
1748,
305,
4598,
29987,
2273,
29922,
3126,
29886,
29987,
29878,
16328,
29879,
29908,
1273,
313,
1256,
4763,
29892,
2635,
5044,
29892,
5335,
342,
314,
29897,
13,
1678,
2793,
353,
4770,
1124,
2577,
3916,
29898,
2271,
29892,
2224,
29897,
13,
1678,
1018,
29901,
13,
4706,
4390,
29886,
353,
4390,
29889,
18132,
29898,
3051,
29961,
2435,
877,
18434,
1748,
305,
4598,
877,
1125,
29899,
29906,
1822,
6506,
877,
29995,
3788,
5477,
8025,
543,
7210,
29968,
1159,
13,
4706,
10961,
3888,
353,
4390,
29886,
29961,
29900,
22322,
29882,
29939,
2033,
13,
1678,
5174,
29901,
13,
4706,
10961,
3888,
353,
5159,
13,
1678,
528,
353,
6571,
13,
1678,
363,
5235,
297,
10961,
3888,
29901,
13,
4706,
528,
20754,
384,
353,
6571,
13,
4706,
2635,
353,
5235,
29961,
29900,
29962,
29937,
29889,
6506,
877,
29899,
3788,
1495,
13,
4706,
528,
20754,
384,
1839,
1256,
2033,
353,
2635,
13,
4706,
528,
20754,
384,
1839,
2962,
2033,
353,
5785,
29898,
3888,
29961,
29896,
2314,
13,
4706,
528,
20754,
384,
1839,
355,
2033,
353,
5785,
29898,
3888,
29961,
29906,
2314,
13,
4706,
528,
20754,
384,
1839,
677,
2033,
353,
5785,
29898,
3888,
29961,
29945,
2314,
13,
4706,
528,
20754,
384,
1839,
9812,
2033,
353,
5785,
29898,
3888,
29961,
29953,
2314,
13,
4706,
528,
20754,
384,
1839,
24623,
2033,
353,
938,
29898,
27696,
29898,
7411,
29898,
3888,
29961,
29955,
29962,
4961,
13,
4706,
528,
20754,
384,
1839,
7827,
2033,
353,
938,
29898,
27696,
29898,
7411,
29898,
3888,
29961,
29947,
29962,
4961,
13,
4706,
528,
29961,
1256,
13192,
845,
20754,
384,
13,
1678,
736,
528,
13,
13,
1753,
679,
2713,
574,
29950,
1794,
15176,
29898,
17712,
1125,
13,
1678,
10961,
29918,
1256,
353,
10961,
29889,
8149,
580,
13,
1678,
10961,
1761,
353,
17288,
29895,
29892,
17712,
29961,
29895,
2314,
363,
413,
297,
12705,
29898,
17712,
29918,
1256,
29892,
11837,
29922,
5574,
4638,
13,
1678,
12705,
29918,
17712,
29918,
1256,
353,
518,
29879,
29961,
29900,
29962,
363,
269,
297,
10961,
1761,
29962,
13,
1678,
363,
2635,
297,
10961,
29918,
1256,
29901,
13,
4706,
565,
2635,
29901,
13,
9651,
1018,
29901,
13,
18884,
2380,
353,
12705,
29918,
17712,
29918,
1256,
29889,
2248,
29898,
1256,
29897,
13,
9651,
5174,
29901,
13,
18884,
628,
391,
353,
5852,
13,
18884,
2380,
353,
29871,
29900,
13,
4706,
1683,
29901,
13,
9651,
2380,
353,
29871,
29900,
13,
4706,
10961,
16700,
1761,
353,
10961,
1761,
29961,
2248,
29901,
2248,
29974,
29906,
29900,
29962,
13,
4706,
396,
2158,
10961,
1761,
29906,
29900,
13,
4706,
298,
29892,
301,
29892,
263,
353,
29871,
4770,
657,
15444,
797,
29898,
17712,
16700,
1761,
29897,
13,
4706,
25185,
353,
263,
14571,
29882,
29914,
29880,
29897,
13,
4706,
10961,
29961,
1256,
22322,
15176,
2033,
353,
25185,
13,
4706,
1286,
29918,
9175,
353,
10961,
1761,
29961,
2248,
3816,
29896,
22322,
355,
2033,
29871,
13,
308,
13,
4706,
565,
2380,
6736,
29871,
29896,
29901,
13,
9651,
2462,
29896,
353,
10961,
1761,
29961,
2248,
29899,
29896,
3816,
29896,
22322,
355,
2033,
632,
396,
29896,
30325,
30822,
31997,
234,
158,
155,
231,
190,
186,
13,
9651,
2462,
29896,
29918,
29886,
353,
4513,
3552,
3250,
29896,
448,
1286,
29918,
9175,
6802,
3707,
29918,
9175,
29892,
29871,
29941,
29897,
334,
29871,
29896,
29900,
29900,
259,
396,
29896,
30325,
30822,
233,
185,
171,
235,
186,
143,
232,
188,
136,
13,
632,
13,
4706,
565,
2380,
6736,
29871,
29941,
29901,
13,
9651,
2462,
29941,
353,
10961,
1761,
29961,
2248,
29899,
29941,
3816,
29896,
22322,
355,
2033,
632,
396,
29941,
30325,
30822,
31997,
234,
158,
155,
231,
190,
186,
13,
9651,
2462,
29941,
29918,
29886,
353,
4513,
3552,
3250,
29941,
448,
1286,
29918,
9175,
6802,
3707,
29918,
9175,
29892,
29871,
29941,
29897,
334,
29871,
29896,
29900,
29900,
259,
396,
29941,
30325,
30822,
233,
185,
171,
235,
186,
143,
232,
188,
136,
13,
632,
13,
4706,
565,
2380,
6736,
29871,
29945,
29901,
13,
9651,
2462,
29945,
353,
10961,
1761,
29961,
2248,
29899,
29945,
3816,
29896,
22322,
355,
2033,
632,
396,
29945,
30325,
30822,
31997,
234,
158,
155,
231,
190,
186,
13,
9651,
2462,
29945,
29918,
29886,
353,
4513,
3552,
3250,
29945,
448,
1286,
29918,
9175,
6802,
3707,
29918,
9175,
29892,
29871,
29941,
29897,
334,
29871,
29896,
29900,
29900,
259,
396,
29945,
30325,
30822,
233,
185,
171,
235,
186,
143,
232,
188,
136,
13,
4706,
10961,
29961,
1256,
22322,
29896,
29881,
2033,
353,
2462,
29896,
29918,
29886,
13,
4706,
10961,
29961,
1256,
22322,
29941,
29881,
2033,
353,
2462,
29941,
29918,
29886,
13,
4706,
10961,
29961,
1256,
22322,
29945,
29881,
2033,
353,
2462,
29945,
29918,
29886,
13,
4706,
10961,
29961,
1256,
22322,
9175,
2033,
353,
1286,
29918,
9175,
13,
1678,
396,
2158,
11860,
29899,
29947,
29879,
1273,
29899,
29896,
29945,
29879,
1273,
29947,
29879,
1273,
29947,
29879,
1273,
29947,
29879,
29908,
1273,
6702,
6248,
742,
525,
15176,
29899,
29906,
29900,
742,
525,
29896,
29899,
7698,
21554,
742,
525,
29941,
29899,
7698,
21554,
742,
525,
29945,
29899,
7698,
21554,
1495,
13,
1678,
396,
2158,
11860,
29879,
24163,
29879,
24163,
29879,
24163,
29879,
24163,
29879,
24163,
29879,
29908,
1273,
6702,
6248,
742,
525,
15176,
29899,
29906,
29900,
742,
525,
10593,
12107,
742,
525,
29896,
29899,
7698,
21554,
742,
525,
29941,
29899,
7698,
21554,
742,
525,
29945,
29899,
7698,
21554,
1495,
13,
1678,
3001,
353,
289,
353,
29871,
29900,
29871,
13,
1678,
363,
269,
297,
12705,
29918,
17712,
29918,
1256,
29901,
13,
4706,
396,
2158,
11860,
29899,
29947,
29879,
1273,
29899,
29896,
29945,
29889,
29906,
29888,
1273,
29947,
29889,
29906,
29888,
1273,
29947,
29889,
29906,
29888,
1273,
29947,
29889,
29906,
29888,
29908,
1273,
313,
17712,
29961,
29879,
22322,
1256,
7464,
17712,
29961,
29879,
22322,
15176,
7464,
17712,
29961,
29879,
22322,
29896,
29881,
7464,
17712,
29961,
29879,
22322,
29941,
29881,
7464,
17712,
29961,
29879,
22322,
29945,
29881,
11287,
13,
4706,
29099,
353,
10961,
29961,
29879,
22322,
15176,
2033,
29914,
17712,
29961,
29879,
22322,
7827,
2033,
13,
4706,
396,
361,
29099,
5277,
29871,
29900,
29889,
29955,
29906,
29901,
13,
4706,
396,
1678,
3001,
4619,
29871,
29896,
13,
4706,
396,
1678,
1596,
11860,
29879,
29892,
15543,
29906,
29888,
24163,
29881,
29892,
15543,
29906,
29888,
24163,
29881,
29892,
15543,
29906,
29888,
29908,
1273,
313,
17712,
29961,
29879,
22322,
1256,
7464,
17712,
29961,
29879,
22322,
15176,
7464,
17712,
29961,
29879,
22322,
9175,
7464,
17712,
29961,
29879,
22322,
29896,
29881,
7464,
17712,
29961,
29879,
22322,
7827,
7464,
17712,
29961,
29879,
22322,
15176,
2033,
29914,
17712,
29961,
29879,
22322,
7827,
11287,
13,
4706,
396,
1678,
565,
10961,
29961,
29879,
22322,
29896,
29881,
2033,
5277,
29871,
29900,
29901,
13,
4706,
396,
4706,
289,
4619,
29871,
29896,
13,
4706,
1596,
11860,
29879,
29892,
15543,
29906,
29888,
24163,
29881,
29892,
15543,
29906,
29888,
24163,
29881,
29892,
15543,
29906,
29888,
29908,
1273,
313,
17712,
29961,
29879,
22322,
1256,
7464,
17712,
29961,
29879,
22322,
15176,
7464,
17712,
29961,
29879,
22322,
9175,
7464,
17712,
29961,
29879,
22322,
29896,
29881,
7464,
17712,
29961,
29879,
22322,
7827,
7464,
17712,
29961,
29879,
22322,
15176,
2033,
29914,
17712,
29961,
29879,
22322,
7827,
11287,
13,
13,
1678,
396,
2158,
376,
29911,
2891,
1964,
29901,
1273,
29879,
29892,
350,
4214,
29949,
29901,
1273,
29879,
29908,
1273,
313,
7827,
29892,
289,
29897,
13,
1678,
396,
2457,
10961,
13,
268,
13,
268,
13,
13,
1753,
4770,
13441,
29918,
3993,
29898,
17712,
29892,
7379,
919,
29892,
10961,
29918,
8977,
3790,
29913,
1125,
13,
1678,
10961,
29918,
3250,
353,
10961,
29889,
5451,
29317,
1495,
13,
1678,
565,
599,
29898,
17712,
29918,
3250,
1125,
13,
4706,
2635,
353,
10961,
29918,
3250,
29961,
29900,
29962,
396,
30325,
31117,
13,
4706,
1369,
353,
5785,
29898,
17712,
29918,
3250,
29961,
29896,
2314,
396,
31026,
234,
158,
155,
231,
190,
186,
31168,
13,
4706,
1880,
353,
5785,
29898,
17712,
29918,
3250,
29961,
29906,
2314,
396,
30878,
30528,
231,
190,
186,
31168,
13,
4706,
4482,
353,
5785,
29898,
17712,
29918,
3250,
29961,
29941,
2314,
396,
30878,
231,
192,
145,
231,
190,
186,
31168,
13,
4706,
1095,
353,
5785,
29898,
17712,
29918,
3250,
29961,
29946,
2314,
396,
31997,
234,
158,
155,
231,
190,
186,
31168,
13,
4706,
7977,
353,
938,
29898,
27696,
29898,
7411,
29898,
17712,
29918,
3250,
29961,
29945,
29962,
4961,
396,
30494,
31398,
31180,
13,
4706,
3001,
353,
938,
29898,
27696,
29898,
7411,
29898,
17712,
29918,
3250,
29961,
29953,
29962,
4961,
396,
30494,
31398,
236,
165,
160,
13,
4706,
1018,
29901,
13,
9651,
304,
353,
5785,
29898,
20034,
919,
29961,
1256,
2314,
13,
4706,
5174,
29901,
13,
9651,
304,
353,
29871,
29900,
29889,
29900,
13,
4706,
396,
2158,
10961,
29892,
2635,
29892,
304,
13,
13,
4706,
10961,
29918,
8977,
29961,
1256,
29962,
353,
426,
13,
9651,
376,
1256,
1115,
2635,
29892,
13,
9651,
525,
2962,
2396,
1369,
29892,
13,
9651,
525,
9812,
2396,
1880,
29892,
13,
9651,
525,
677,
2396,
4482,
29892,
13,
9651,
525,
355,
2396,
1095,
29892,
13,
9651,
525,
24623,
2396,
7977,
29892,
13,
9651,
525,
7827,
2396,
3001,
29892,
13,
9651,
525,
517,
2396,
304,
13,
4706,
500,
13,
4706,
736,
10961,
29918,
8977,
13,
13,
1753,
4770,
13441,
29918,
3250,
29898,
3051,
29892,
7379,
919,
1125,
13,
1678,
10961,
29918,
1761,
353,
2793,
29889,
5451,
877,
29922,
29861,
29896,
1822,
5451,
877,
29989,
1495,
13,
1678,
10961,
29918,
8977,
353,
6571,
13,
1678,
363,
10961,
297,
10961,
29918,
1761,
29901,
13,
4706,
565,
10961,
322,
10961,
29889,
17010,
7295,
13,
9651,
4770,
13441,
29918,
3993,
29898,
17712,
29892,
7379,
919,
29892,
10961,
29918,
8977,
29897,
13,
1678,
396,
2158,
10961,
29918,
8977,
13,
1678,
736,
10961,
29918,
8977,
13,
13,
1753,
4770,
1124,
2577,
3916,
29898,
2271,
29892,
2084,
1125,
13,
1678,
11009,
353,
1732,
1982,
29889,
10493,
5350,
29898,
2271,
29892,
15619,
29922,
29953,
29900,
29897,
13,
1678,
11009,
29889,
3827,
703,
7194,
613,
2224,
29897,
13,
1678,
2933,
353,
11009,
29889,
657,
5327,
580,
13,
1678,
565,
2933,
29889,
4882,
1275,
29871,
29906,
29900,
29900,
29901,
13,
4706,
2793,
353,
2933,
29889,
949,
580,
13,
1678,
1683,
29901,
13,
4706,
2793,
353,
6213,
13,
1678,
736,
2793,
13,
13,
1753,
4770,
657,
15444,
797,
29898,
17712,
1761,
1125,
13,
1678,
1880,
29918,
1761,
353,
5159,
13,
1678,
4482,
29918,
1761,
353,
5159,
13,
1678,
6909,
353,
29871,
29900,
13,
1678,
363,
10961,
297,
10961,
1761,
29901,
13,
4706,
5235,
353,
10961,
29961,
29896,
29962,
13,
4706,
1880,
29918,
1761,
29889,
4397,
29898,
3888,
1839,
9812,
11287,
13,
4706,
4482,
29918,
1761,
29889,
4397,
29898,
3888,
1839,
677,
11287,
13,
4706,
396,
31466,
31565,
31951,
29896,
29900,
231,
189,
194,
235,
133,
164,
30990,
30783,
30494,
31398,
236,
165,
160,
13,
4706,
396,
361,
5235,
1839,
517,
2033,
2804,
29871,
29900,
29901,
13,
4706,
396,
1678,
6554,
353,
5235,
1839,
24623,
2033,
29914,
3888,
1839,
517,
2033,
847,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
13,
4706,
6909,
4619,
5235,
1839,
7827,
2033,
29937,
29914,
10492,
13,
1678,
736,
12705,
29898,
9812,
29918,
1761,
9601,
29899,
29896,
1402,
12705,
29898,
677,
29918,
1761,
9601,
29900,
1402,
6909,
29914,
29906,
29900,
13,
13,
1753,
2767,
20754,
384,
12742,
20570,
29898,
401,
29892,
9999,
29892,
1629,
2433,
29906,
29900,
29896,
29945,
742,
1134,
2433,
29890,
29374,
13,
1678,
9995,
13,
1678,
1732,
597,
29939,
29881,
29889,
29896,
29900,
28695,
1335,
29889,
510,
29889,
18038,
29914,
2754,
29889,
1961,
29973,
29886,
29922,
17712,
29918,
3250,
29987,
3888,
29922,
29895,
29918,
3616,
29918,
29900,
29900,
29900,
29900,
29900,
29945,
29987,
6360,
29922,
29906,
29900,
29896,
29906,
29892,
29906,
29900,
29896,
29941,
29987,
29888,
29939,
29922,
13,
1678,
2268,
29901,
31947,
235,
178,
132,
13,
1678,
528,
29901,
30429,
30581,
13,
1678,
289,
31331,
30822,
31810,
233,
160,
134,
13,
1678,
3855,
31331,
30658,
31810,
233,
160,
134,
13,
1678,
736,
9657,
13,
1678,
9995,
13,
1678,
565,
817,
6422,
29898,
28549,
29892,
775,
29892,
1629,
29892,
1134,
1125,
13,
4706,
3142,
353,
376,
29939,
29881,
29889,
29896,
29900,
28695,
1335,
29889,
510,
29889,
18038,
29908,
13,
4706,
2224,
353,
5591,
2754,
29889,
1961,
29973,
29886,
29922,
17712,
29918,
3250,
29987,
3888,
29922,
29895,
29918,
29995,
29879,
29918,
29995,
29879,
29987,
6360,
16328,
29879,
29987,
29888,
29939,
16328,
29879,
29908,
1273,
313,
28549,
29892,
775,
29892,
1629,
29892,
1134,
29897,
13,
4706,
7379,
919,
353,
4770,
657,
27407,
3563,
29898,
401,
29892,
1629,
29897,
13,
4706,
1018,
29901,
13,
9651,
2793,
353,
4770,
1124,
2577,
3916,
29898,
2271,
29892,
2224,
29897,
13,
4706,
5174,
29901,
13,
9651,
2793,
353,
6213,
13,
9651,
1596,
775,
29892,
29242,
10729,
5229,
2023,
29908,
13,
4706,
565,
2793,
29901,
13,
9651,
396,
2158,
775,
29892,
29242,
10729,
2551,
2023,
29908,
13,
9651,
10961,
29918,
8977,
353,
4770,
13441,
29918,
3250,
29898,
3051,
29892,
20034,
919,
29897,
13,
9651,
1018,
29901,
13,
18884,
2767,
15771,
7717,
20570,
29898,
28549,
29892,
775,
29892,
1629,
29892,
1134,
29892,
10961,
29918,
8977,
29897,
13,
9651,
5174,
8960,
29892,
321,
29901,
13,
18884,
396,
2158,
9637,
1627,
29889,
2158,
29918,
735,
29883,
29898,
29872,
29897,
13,
18884,
1209,
13,
9651,
736,
10961,
29918,
8977,
13,
1678,
1683,
29901,
13,
4706,
396,
1596,
12801,
525,
718,
9999,
718,
775,
718,
525,
1405,
817,
451,
304,
2767,
6317,
29915,
13,
4706,
1209,
13,
268,
13,
1753,
4770,
657,
7717,
20754,
384,
3401,
29898,
401,
29892,
9999,
29892,
1629,
29892,
1134,
1125,
13,
1678,
775,
353,
9999,
29974,
401,
13,
1678,
1018,
29901,
13,
4706,
565,
775,
322,
1629,
322,
1134,
29901,
13,
9651,
285,
29881,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
29892,
1134,
29892,
14210,
29879,
29915,
1273,
775,
511,
29915,
29878,
1495,
13,
9651,
2793,
353,
285,
29881,
29889,
949,
580,
13,
9651,
285,
29881,
29889,
5358,
580,
13,
4706,
1683,
29901,
13,
9651,
285,
29881,
353,
6213,
13,
1678,
5174,
8960,
29892,
321,
29901,
13,
4706,
396,
2158,
9637,
1627,
29889,
2158,
29918,
735,
29883,
29898,
29872,
29897,
13,
4706,
396,
361,
285,
29881,
29901,
13,
4706,
396,
1678,
285,
29881,
29889,
5358,
580,
13,
4706,
736,
13,
1678,
736,
4390,
29889,
18132,
29898,
3051,
29897,
268,
13,
13,
1753,
4770,
657,
11442,
708,
20754,
384,
3401,
29898,
401,
29892,
9999,
29892,
1629,
29892,
1134,
1125,
13,
1678,
5534,
317,
4986,
7077,
11690,
13,
1678,
10961,
401,
353,
9999,
29974,
401,
29871,
13,
1678,
565,
10961,
401,
297,
317,
4986,
7077,
11690,
29901,
13,
4706,
736,
317,
4986,
7077,
11690,
29961,
17712,
401,
29962,
13,
1678,
1683,
29901,
13,
4706,
775,
11442,
3401,
353,
4770,
657,
7717,
20754,
384,
3401,
29898,
401,
29892,
9999,
29892,
1629,
29892,
1134,
29897,
13,
4706,
317,
4986,
7077,
11690,
29961,
17712,
401,
29962,
353,
775,
11442,
3401,
13,
4706,
736,
775,
11442,
3401,
13,
268,
13,
1753,
817,
6422,
313,
28549,
29892,
775,
29892,
1629,
29892,
1134,
1125,
13,
1678,
775,
353,
9999,
29974,
401,
13,
1678,
817,
353,
7700,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
22164,
13,
4706,
817,
353,
29871,
5852,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
22164,
13,
4706,
817,
353,
5852,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
29892,
1134,
22164,
13,
4706,
817,
353,
5852,
13,
1678,
396,
1596,
2897,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
511,
2897,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
511,
2897,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
29892,
1134,
29897,
13,
1678,
736,
817,
13,
13,
1753,
2767,
15771,
7717,
20570,
29898,
28549,
29892,
775,
29892,
1629,
29892,
1134,
29892,
10961,
29918,
8977,
1125,
13,
1678,
775,
353,
9999,
29974,
401,
13,
1678,
1596,
525,
5504,
529,
742,
775,
29892,
525,
29958,
5235,
6317,
29915,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
22164,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
22164,
13,
9651,
565,
2897,
29889,
2084,
29889,
9933,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
29892,
1134,
22164,
13,
18884,
285,
29881,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
29892,
1134,
29892,
14210,
29879,
29915,
1273,
775,
511,
525,
29893,
29974,
1495,
13,
18884,
285,
29881,
29889,
3539,
29898,
3126,
29889,
29881,
17204,
29898,
17712,
29918,
8977,
876,
13,
18884,
285,
29881,
29889,
5358,
580,
13,
9651,
1683,
29901,
13,
18884,
2897,
29889,
11256,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
29892,
1134,
876,
13,
18884,
285,
29881,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
29892,
1134,
29892,
14210,
29879,
29915,
1273,
775,
511,
525,
29893,
29974,
1495,
13,
18884,
285,
29881,
29889,
3539,
29898,
3126,
29889,
29881,
17204,
29898,
17712,
29918,
8977,
876,
13,
18884,
285,
29881,
29889,
5358,
580,
13,
4706,
1683,
29901,
13,
9651,
2897,
29889,
11256,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
876,
13,
9651,
2897,
29889,
11256,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
29892,
1134,
876,
13,
9651,
285,
29881,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
29892,
1134,
29892,
14210,
29879,
29915,
1273,
775,
511,
525,
29893,
29974,
1495,
13,
9651,
285,
29881,
29889,
3539,
29898,
3126,
29889,
29881,
17204,
29898,
17712,
29918,
8977,
876,
13,
9651,
285,
29881,
29889,
5358,
580,
13,
1678,
1683,
29901,
13,
4706,
2897,
29889,
11256,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
876,
13,
4706,
2897,
29889,
11256,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
876,
13,
4706,
2897,
29889,
11256,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
29892,
1134,
876,
13,
4706,
285,
29881,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
25832,
3035,
8193,
29892,
401,
29892,
1629,
29892,
1134,
29892,
14210,
29879,
29915,
1273,
775,
511,
525,
29893,
29974,
1495,
13,
4706,
285,
29881,
29889,
3539,
29898,
3126,
29889,
29881,
17204,
29898,
17712,
29918,
8977,
876,
13,
4706,
285,
29881,
29889,
5358,
580,
13,
13,
1753,
338,
5323,
311,
12742,
29898,
1256,
1125,
13,
1678,
1629,
353,
2635,
7503,
29946,
29962,
13,
1678,
285,
29881,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
6248,
29950,
3235,
29892,
6360,
511,
29915,
29878,
1495,
13,
1678,
1418,
295,
391,
353,
4390,
29889,
18132,
29898,
11512,
29889,
949,
3101,
13,
1678,
285,
29881,
29889,
5358,
580,
13,
1678,
1018,
29901,
13,
4706,
2380,
353,
1418,
295,
391,
29889,
2248,
29898,
1256,
29897,
13,
1678,
5174,
8960,
29892,
29872,
29901,
13,
4706,
736,
7700,
13,
1678,
736,
5852,
13,
13,
1753,
679,
9190,
2539,
29898,
1256,
29892,
401,
2433,
29374,
13,
1678,
1629,
353,
2635,
7503,
29946,
29962,
13,
1678,
285,
29881,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
6248,
29950,
3235,
29892,
6360,
511,
29915,
29878,
1495,
13,
1678,
1418,
295,
391,
353,
4390,
29889,
18132,
29898,
11512,
29889,
949,
3101,
13,
1678,
285,
29881,
29889,
5358,
580,
13,
1678,
396,
2158,
1418,
295,
391,
13,
1678,
565,
1418,
295,
391,
29889,
2248,
29898,
1256,
29897,
6736,
29871,
29896,
29901,
13,
4706,
736,
1418,
295,
391,
29961,
4130,
295,
391,
29889,
2248,
29898,
1256,
6817,
29896,
29962,
13,
1678,
1683,
29901,
13,
4706,
736,
1418,
295,
391,
29961,
29900,
29962,
13,
268,
13,
1753,
679,
8897,
2539,
29898,
1256,
29892,
401,
2433,
29374,
13,
1678,
1629,
353,
2635,
7503,
29946,
29962,
13,
1678,
4098,
353,
2635,
29961,
29946,
29901,
29953,
29962,
13,
1678,
2462,
353,
2635,
29961,
29953,
17531,
13,
1678,
565,
775,
29901,
13,
4706,
775,
2539,
1293,
353,
12705,
22168,
657,
7717,
20754,
384,
3401,
29898,
401,
29961,
29906,
29901,
1402,
775,
7503,
29906,
1402,
1629,
29892,
1134,
2433,
29890,
2824,
8149,
3285,
11837,
29922,
5574,
29897,
13,
4706,
19471,
353,
29871,
29896,
13,
4706,
1550,
29871,
29896,
29901,
13,
9651,
1018,
29901,
13,
18884,
2380,
353,
775,
2539,
1293,
29889,
2248,
29898,
1256,
29897,
13,
18884,
2867,
13,
18884,
396,
2457,
775,
2539,
1293,
29961,
2248,
29974,
29896,
29962,
13,
9651,
5174,
29901,
13,
18884,
716,
2539,
353,
12865,
29889,
12673,
29898,
524,
29898,
6360,
511,
938,
29898,
10874,
511,
524,
29898,
3250,
876,
448,
12865,
29889,
9346,
287,
2554,
29898,
4181,
29897,
13,
18884,
1629,
29892,
4098,
29892,
2462,
353,
851,
29898,
1482,
2539,
29889,
6360,
511,
14210,
29900,
29906,
29881,
29915,
1273,
716,
2539,
29889,
10874,
1919,
14210,
29900,
29906,
29881,
29915,
1273,
716,
2539,
29889,
3250,
13,
18884,
2635,
353,
1629,
29974,
10874,
29974,
3250,
29871,
13,
18884,
396,
2457,
775,
2539,
1293,
29961,
29900,
29962,
13,
4706,
736,
775,
2539,
1293,
29961,
2248,
29974,
29896,
29962,
13,
1678,
1683,
29901,
13,
4706,
285,
29881,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
6248,
29950,
3235,
29892,
6360,
511,
29915,
29878,
1495,
13,
4706,
1418,
295,
391,
353,
4390,
29889,
18132,
29898,
11512,
29889,
949,
3101,
13,
4706,
285,
29881,
29889,
5358,
580,
13,
4706,
19471,
353,
29871,
29896,
13,
4706,
1550,
29871,
29896,
29901,
13,
9651,
1018,
29901,
13,
18884,
2380,
353,
1418,
295,
391,
29889,
2248,
29898,
1256,
29897,
13,
18884,
2867,
13,
9651,
5174,
29901,
13,
18884,
1596,
376,
2539,
338,
451,
5376,
2462,
29892,
6755,
697,
1434,
372,
29908,
13,
18884,
396,
4181,
4619,
29871,
29896,
13,
18884,
716,
2539,
353,
12865,
29889,
12673,
29898,
524,
29898,
6360,
511,
938,
29898,
10874,
511,
524,
29898,
3250,
876,
448,
12865,
29889,
9346,
287,
2554,
29898,
4181,
29897,
13,
18884,
1629,
29892,
4098,
29892,
2462,
353,
851,
29898,
1482,
2539,
29889,
6360,
511,
14210,
29900,
29906,
29881,
29915,
1273,
716,
2539,
29889,
10874,
1919,
14210,
29900,
29906,
29881,
29915,
1273,
716,
2539,
29889,
3250,
13,
18884,
2635,
353,
1629,
29974,
10874,
29974,
3250,
29871,
13,
632,
13,
4706,
565,
2380,
6736,
29871,
29896,
29901,
13,
9651,
736,
1418,
295,
391,
29961,
2248,
29974,
29896,
29962,
13,
4706,
1683,
29901,
13,
9651,
736,
1418,
295,
391,
29961,
29900,
29962,
13,
13,
1753,
679,
15176,
29898,
17712,
3399,
29892,
1256,
543,
613,
16700,
29922,
29906,
29900,
1125,
13,
1678,
775,
29892,
9999,
353,
10961,
3399,
29961,
29906,
29901,
1402,
10961,
3399,
7503,
29906,
29962,
13,
1678,
396,
2158,
775,
29892,
9999,
13,
1678,
396,
17712,
353,
679,
20754,
384,
12742,
20570,
29898,
401,
29892,
9999,
29892,
1629,
543,
29906,
29900,
29896,
29945,
613,
1134,
543,
29890,
1159,
13,
1678,
1629,
353,
2635,
7503,
29946,
29962,
13,
1678,
10961,
353,
4770,
657,
11442,
708,
20754,
384,
3401,
29898,
401,
29892,
9999,
29892,
1629,
29892,
1134,
543,
29890,
1159,
13,
1678,
2462,
29896,
353,
2462,
29941,
353,
2462,
29945,
353,
525,
19377,
29915,
13,
1678,
2462,
29896,
29918,
29886,
353,
2462,
29941,
29918,
29886,
353,
2462,
29945,
29918,
29886,
353,
525,
19377,
29915,
13,
1678,
1286,
29918,
24623,
353,
525,
19377,
29915,
13,
1678,
4972,
29918,
24623,
353,
29871,
29900,
13,
1678,
4972,
29918,
29885,
4992,
353,
29871,
29900,
13,
1678,
628,
391,
353,
7700,
13,
1678,
565,
10961,
29901,
13,
4706,
10961,
29918,
1256,
353,
10961,
29889,
8149,
580,
13,
4706,
10961,
1761,
353,
17288,
29895,
29892,
17712,
29961,
29895,
2314,
363,
413,
297,
12705,
29898,
17712,
29918,
1256,
29892,
11837,
29922,
5574,
4638,
13,
4706,
12705,
29918,
17712,
29918,
1256,
353,
518,
29879,
29961,
29900,
29962,
363,
269,
297,
10961,
1761,
29962,
13,
4706,
565,
2635,
29901,
13,
9651,
1018,
29901,
13,
18884,
2380,
353,
12705,
29918,
17712,
29918,
1256,
29889,
2248,
29898,
1256,
29897,
13,
9651,
5174,
29901,
13,
18884,
628,
391,
353,
5852,
13,
18884,
2380,
353,
29871,
29900,
13,
4706,
1683,
29901,
13,
9651,
2380,
353,
29871,
29900,
13,
4706,
396,
2158,
376,
1256,
29901,
9162,
24582,
29918,
17712,
29918,
1256,
29961,
2248,
29962,
13,
4706,
10961,
16700,
1761,
353,
10961,
1761,
29961,
2248,
29901,
2248,
29974,
16700,
29962,
13,
4706,
396,
2158,
10961,
1761,
29906,
29900,
13,
4706,
298,
29892,
301,
29892,
263,
353,
29871,
4770,
657,
15444,
797,
29898,
17712,
16700,
1761,
29897,
13,
4706,
25185,
353,
263,
14571,
29882,
29914,
29880,
29897,
13,
4706,
380,
1293,
353,
679,
1254,
20754,
384,
580,
13,
4706,
1286,
29918,
9175,
353,
10961,
1761,
29961,
2248,
3816,
29896,
22322,
355,
2033,
795,
396,
30948,
30325,
31997,
234,
158,
155,
231,
190,
186,
13,
4706,
1286,
29918,
24623,
353,
10961,
1761,
29961,
2248,
3816,
29896,
22322,
24623,
2033,
13,
4706,
2507,
957,
353,
10961,
1761,
29961,
2248,
3816,
29896,
22322,
517,
2033,
13,
4706,
565,
2507,
957,
1275,
29871,
29900,
29901,
13,
9651,
4972,
29918,
24623,
353,
29871,
29900,
13,
4706,
1683,
29901,
13,
9651,
4972,
29918,
24623,
353,
1286,
29918,
24623,
847,
2507,
957,
334,
29871,
29896,
29900,
29900,
847,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
13,
9651,
4972,
29918,
29885,
4992,
353,
4972,
29918,
24623,
334,
1286,
29918,
9175,
13,
4706,
565,
1286,
29918,
24623,
5277,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
470,
628,
391,
470,
10961,
3399,
29961,
29906,
17531,
297,
380,
1293,
29901,
539,
396,
30948,
30408,
31398,
233,
155,
150,
31180,
30446,
30909,
29896,
29900,
29900,
29900,
29900,
30880,
13,
9651,
25185,
353,
29871,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
13,
4706,
565,
2380,
6736,
29871,
29896,
29901,
13,
9651,
2462,
29896,
353,
10961,
1761,
29961,
2248,
29899,
29896,
3816,
29896,
22322,
355,
2033,
632,
396,
29896,
30325,
30822,
31997,
234,
158,
155,
231,
190,
186,
13,
9651,
2462,
29896,
29918,
29886,
353,
4513,
3552,
3250,
29896,
448,
1286,
29918,
9175,
6802,
3707,
29918,
9175,
29892,
29871,
29941,
29897,
334,
29871,
29896,
29900,
29900,
259,
396,
29896,
30325,
30822,
233,
185,
171,
235,
186,
143,
232,
188,
136,
13,
632,
13,
4706,
565,
2380,
6736,
29871,
29941,
29901,
13,
9651,
2462,
29941,
353,
10961,
1761,
29961,
2248,
29899,
29941,
3816,
29896,
22322,
355,
2033,
632,
396,
29941,
30325,
30822,
31997,
234,
158,
155,
231,
190,
186,
13,
9651,
2462,
29941,
29918,
29886,
353,
4513,
3552,
3250,
29941,
448,
1286,
29918,
9175,
6802,
3707,
29918,
9175,
29892,
29871,
29941,
29897,
334,
29871,
29896,
29900,
29900,
259,
396,
29941,
30325,
30822,
233,
185,
171,
235,
186,
143,
232,
188,
136,
13,
632,
13,
4706,
565,
2380,
6736,
29871,
29945,
29901,
13,
9651,
2462,
29945,
353,
10961,
1761,
29961,
2248,
29899,
29945,
3816,
29896,
22322,
355,
2033,
632,
396,
29945,
30325,
30822,
31997,
234,
158,
155,
231,
190,
186,
13,
9651,
2462,
29945,
29918,
29886,
353,
4513,
3552,
3250,
29945,
448,
1286,
29918,
9175,
6802,
3707,
29918,
9175,
29892,
29871,
29941,
29897,
334,
29871,
29896,
29900,
29900,
259,
396,
29945,
30325,
30822,
233,
185,
171,
235,
186,
143,
232,
188,
136,
13,
632,
13,
4706,
736,
10961,
3399,
29892,
15176,
29892,
3250,
29896,
29918,
29886,
29892,
3250,
29941,
29918,
29886,
29892,
3250,
29945,
29918,
29886,
29892,
3707,
29918,
24623,
29892,
6144,
391,
29892,
1731,
29918,
24623,
29892,
4972,
29918,
29885,
4992,
13,
4706,
396,
2457,
25185,
29892,
3250,
29896,
29892,
3250,
29941,
29892,
3250,
29945,
13,
1678,
1683,
29901,
13,
4706,
736,
10961,
3399,
29892,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29892,
3250,
29896,
29918,
29886,
29892,
3250,
29941,
29918,
29886,
29892,
3250,
29945,
29918,
29886,
29892,
3707,
29918,
24623,
29892,
6144,
391,
29892,
1731,
29918,
24623,
29892,
1731,
29918,
29885,
4992,
13,
13,
1753,
679,
20754,
384,
3399,
7295,
13,
1678,
285,
29881,
15715,
353,
1722,
877,
1272,
29914,
15715,
29889,
1272,
3788,
29878,
1495,
13,
1678,
285,
29881,
8132,
353,
1722,
877,
1272,
29914,
8132,
29889,
1272,
3788,
29878,
1495,
13,
1678,
285,
29881,
29999,
29990,
353,
1722,
877,
1272,
29914,
29999,
29990,
29889,
1272,
3788,
29878,
1495,
13,
1678,
285,
29881,
29907,
29979,
353,
1722,
877,
1272,
29914,
29907,
29979,
29889,
1272,
3788,
29878,
1495,
13,
1678,
379,
29909,
353,
285,
29881,
15715,
29889,
949,
2141,
5451,
580,
13,
1678,
16698,
353,
285,
29881,
8132,
29889,
949,
2141,
5451,
580,
13,
1678,
796,
29990,
353,
285,
29881,
29999,
29990,
29889,
949,
2141,
5451,
580,
13,
1678,
315,
29979,
353,
285,
29881,
29907,
29979,
29889,
949,
2141,
5451,
580,
13,
1678,
599,
20754,
384,
353,
379,
29909,
29974,
8132,
29974,
29999,
29990,
29974,
29907,
29979,
13,
1678,
599,
20754,
384,
21533,
353,
6571,
13,
1678,
363,
10961,
297,
599,
20754,
384,
29901,
13,
4706,
413,
29892,
29894,
353,
10961,
29889,
5451,
29317,
1495,
13,
4706,
599,
20754,
384,
21533,
29961,
29895,
29962,
353,
325,
13,
1678,
736,
599,
20754,
384,
21533,
13,
13,
1753,
679,
1254,
20754,
384,
7295,
13,
1678,
285,
29881,
1254,
353,
1722,
877,
1272,
29914,
1254,
29889,
1272,
3788,
29878,
1495,
13,
1678,
6850,
353,
285,
29881,
1254,
29889,
949,
2141,
5451,
580,
13,
1678,
380,
21533,
353,
6571,
13,
1678,
363,
380,
297,
6850,
29901,
13,
4706,
413,
29892,
29894,
353,
380,
29889,
5451,
29317,
1495,
13,
4706,
380,
21533,
29961,
29895,
29962,
353,
325,
13,
1678,
736,
380,
21533,
13,
308,
13,
1753,
679,
3591,
29898,
3827,
29892,
1506,
29918,
3888,
1125,
13,
1678,
5534,
12705,
29918,
29879,
13,
1678,
12705,
29918,
29879,
29889,
4397,
29898,
1182,
29918,
3888,
29897,
13,
268,
13,
1753,
2767,
7717,
20570,
29898,
6360,
29892,
1134,
1125,
13,
1678,
14550,
13,
1678,
1629,
29992,
1807,
29901,
29871,
29906,
29900,
29896,
29945,
13,
1678,
1134,
29992,
1807,
29901,
289,
29922,
30822,
31810,
233,
160,
134,
29936,
29939,
29922,
30658,
31810,
233,
160,
134,
13,
1678,
14550,
13,
1678,
599,
20754,
384,
21533,
353,
679,
20754,
384,
3399,
580,
13,
1678,
10961,
29918,
1272,
353,
599,
20754,
384,
21533,
29889,
8149,
580,
13,
1678,
3855,
29918,
2311,
353,
7431,
29898,
17712,
29918,
1272,
29897,
13,
1678,
11565,
353,
3244,
10109,
29889,
23574,
29898,
29896,
29900,
29892,
3855,
29918,
2311,
29922,
29939,
29918,
2311,
29892,
620,
29939,
29918,
2311,
29922,
29939,
29918,
2311,
29897,
13,
1678,
848,
353,
518,
4197,
17712,
29961,
29906,
29901,
1402,
10961,
7503,
29906,
1402,
1629,
29892,
1134,
1402,
29912,
1800,
363,
10961,
297,
10961,
29918,
1272,
29962,
13,
1678,
7274,
353,
3244,
10109,
29889,
5675,
3089,
29879,
29898,
5504,
20754,
384,
12742,
20570,
29892,
848,
29897,
13,
1678,
518,
10109,
29889,
649,
3089,
29898,
7971,
29897,
363,
12428,
297,
7274,
29962,
13,
1678,
11565,
29889,
10685,
580,
13,
268,
13,
1753,
679,
25353,
29898,
1256,
543,
613,
2848,
29922,
29945,
29900,
29892,
3841,
29922,
29906,
29900,
29892,
1596,
3744,
29922,
8824,
29892,
4175,
29922,
29900,
29889,
29900,
29896,
1125,
13,
1678,
14550,
13,
1678,
2635,
29992,
1807,
29901,
29871,
29906,
29900,
29896,
29945,
29900,
29955,
29906,
29929,
13,
1678,
3309,
29992,
524,
29901,
268,
13,
1678,
3841,
29992,
524,
29901,
1678,
1029,
29887,
2462,
13,
1678,
14550,
13,
1678,
396,
29874,
353,
931,
29889,
2230,
580,
13,
1678,
5534,
12705,
29918,
29879,
13,
1678,
12705,
29918,
29879,
353,
5159,
13,
1678,
599,
20754,
384,
21533,
353,
679,
20754,
384,
3399,
580,
13,
1678,
10961,
29918,
1272,
353,
599,
20754,
384,
21533,
29889,
8149,
580,
13,
1678,
3855,
29918,
2311,
353,
7431,
29898,
17712,
29918,
1272,
29897,
13,
1678,
11565,
353,
3244,
10109,
29889,
23574,
29898,
29896,
29892,
3855,
29918,
2311,
29922,
29939,
29918,
2311,
29892,
620,
29939,
29918,
2311,
29922,
29939,
29918,
2311,
29897,
13,
1678,
848,
353,
518,
4197,
17712,
1402,
6377,
1256,
1115,
2635,
1699,
16700,
1115,
3841,
1800,
363,
10961,
297,
10961,
29918,
1272,
29962,
13,
1678,
7274,
353,
3244,
10109,
29889,
5675,
3089,
29879,
29898,
657,
15176,
29892,
848,
29892,
679,
3591,
29897,
13,
1678,
518,
10109,
29889,
649,
3089,
29898,
7971,
29892,
7700,
29897,
363,
12428,
297,
7274,
29962,
259,
13,
1678,
11565,
29889,
10685,
580,
13,
1678,
396,
2158,
7431,
29898,
24582,
29918,
29879,
29897,
13,
1678,
1900,
29945,
29900,
353,
12705,
29898,
24582,
29918,
29879,
29892,
1820,
29922,
2892,
12705,
29918,
29879,
29901,
24582,
29918,
29879,
29961,
29896,
2314,
29937,
7503,
29945,
29900,
29962,
13,
1678,
380,
1293,
353,
679,
1254,
20754,
384,
2141,
8149,
580,
13,
1678,
3309,
353,
3309,
13,
1678,
1900,
353,
5159,
13,
1678,
396,
2158,
376,
6248,
29901,
1273,
29879,
29908,
1273,
2635,
13,
1678,
565,
1596,
3744,
29901,
13,
4706,
1596,
376,
9166,
9166,
2751,
323,
4717,
2287,
20231,
29901,
1273,
29879,
1275,
9166,
9166,
26359,
1273,
2635,
13,
4706,
1596,
11860,
29899,
29896,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
29905,
29873,
29995,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29896,
29900,
29879,
29908,
1273,
4852,
16524,
3284,
235,
133,
164,
234,
168,
171,
30548,
30578,
3284,
15176,
19222,
29879,
29908,
1273,
3841,
1699,
29896,
28658,
29918,
29925,
3284,
29941,
28658,
29918,
29925,
3284,
29945,
28658,
29918,
29925,
3284,
29963,
5607,
3284,
2287,
24360,
1159,
13,
1678,
363,
289,
297,
1900,
29945,
29900,
29901,
13,
4706,
565,
3309,
1405,
29871,
29900,
29901,
13,
9651,
565,
451,
4175,
29901,
13,
18884,
565,
1596,
3744,
29901,
13,
462,
1678,
1596,
11860,
29899,
29896,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
29905,
29873,
29995,
29899,
29906,
29900,
29889,
29906,
29888,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29896,
29900,
29879,
1273,
29896,
29900,
29889,
29906,
29888,
1273,
29896,
29900,
29889,
29906,
29888,
29908,
1273,
313,
29890,
29961,
29900,
1402,
497,
20754,
384,
21533,
29961,
29890,
29961,
29900,
20526,
29890,
29961,
29896,
1402,
710,
29898,
29890,
29961,
29906,
11724,
710,
29898,
29890,
29961,
29941,
11724,
710,
29898,
29890,
29961,
29946,
11724,
289,
29961,
29945,
1402,
289,
29961,
29953,
1402,
29890,
29961,
29955,
1402,
289,
29961,
29947,
29962,
1723,
29871,
13,
18884,
3309,
22361,
29871,
29896,
13,
18884,
1900,
29889,
4397,
29898,
29890,
29961,
29900,
2314,
13,
9651,
1683,
29901,
13,
18884,
565,
289,
29961,
29955,
29962,
6736,
5785,
29898,
4572,
1125,
13,
462,
1678,
3309,
22361,
29871,
29896,
13,
462,
1678,
565,
1596,
3744,
29901,
13,
462,
4706,
1596,
11860,
29899,
29896,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
29905,
29873,
29995,
29899,
29906,
29900,
29889,
29906,
29888,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29896,
29900,
29879,
1273,
29896,
29900,
29889,
29906,
29888,
1273,
29896,
29900,
29889,
29906,
29888,
29908,
1273,
313,
29890,
29961,
29900,
1402,
497,
20754,
384,
21533,
29961,
29890,
29961,
29900,
20526,
29890,
29961,
29896,
1402,
710,
29898,
29890,
29961,
29906,
11724,
710,
29898,
29890,
29961,
29941,
11724,
710,
29898,
29890,
29961,
29946,
11724,
289,
29961,
29945,
1402,
289,
29961,
29953,
1402,
29890,
29961,
29955,
1402,
289,
29961,
29947,
29962,
1723,
29871,
13,
18884,
1900,
29889,
4397,
29898,
29890,
29961,
29900,
2314,
13,
1678,
1683,
29901,
13,
4706,
396,
2158,
525,
7194,
20700,
1254,
323,
29909,
6059,
29901,
1273,
29879,
29915,
1273,
313,
2230,
29889,
2230,
580,
448,
263,
29897,
13,
4706,
736,
1900,
13,
268,
13,
1753,
679,
13658,
3399,
29898,
401,
1125,
13,
1678,
14550,
13,
1678,
736,
29992,
1807,
29901,
2268,
29900,
29900,
29906,
29947,
29929,
29896,
29914,
845,
29953,
29900,
29900,
29900,
29953,
29896,
2992,
29889,
29871,
13,
1678,
14550,
13,
1678,
565,
775,
29889,
2886,
877,
3616,
1495,
529,
29871,
29900,
470,
775,
29889,
2886,
877,
845,
1495,
529,
29871,
29900,
29901,
13,
4706,
565,
775,
29889,
2886,
877,
29953,
29900,
1495,
1275,
29871,
29900,
29901,
13,
9651,
775,
353,
525,
845,
29915,
718,
775,
13,
4706,
1683,
29901,
13,
9651,
775,
353,
525,
3616,
29915,
718,
775,
13,
1678,
736,
775,
13,
13,
1753,
679,
20754,
384,
15176,
29898,
17712,
3399,
29892,
1629,
2433,
29906,
29900,
29896,
29945,
742,
1134,
2433,
29890,
29374,
13,
1678,
14550,
13,
1678,
10961,
3399,
29992,
1807,
29901,
268,
2989,
775,
13,
1678,
1629,
29992,
1807,
29901,
3986,
1629,
13,
1678,
1134,
29992,
1807,
29901,
3986,
289,
29922,
30822,
31810,
233,
160,
134,
29936,
29939,
29922,
30658,
31810,
233,
160,
134,
259,
13,
1678,
736,
29992,
524,
29901,
29871,
13,
1678,
14550,
13,
1678,
775,
29892,
9999,
353,
10961,
3399,
29961,
29906,
29901,
1402,
10961,
3399,
7503,
29906,
29962,
13,
1678,
10961,
3888,
353,
4770,
657,
11442,
708,
20754,
384,
3401,
29898,
401,
29892,
9999,
29892,
1629,
29892,
1134,
29897,
13,
1678,
2635,
15176,
1293,
353,
17288,
23583,
4197,
3888,
2314,
718,
679,
15176,
29898,
17712,
3399,
29892,
3888,
876,
363,
5235,
297,
10961,
3888,
29962,
13,
1678,
269,
29918,
1256,
353,
12705,
29898,
1256,
15176,
1293,
29892,
1820,
29922,
2892,
2635,
15176,
1293,
29901,
1256,
15176,
1293,
29961,
29900,
2314,
13,
1678,
1596,
11860,
29899,
29896,
29900,
29879,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29896,
29900,
29879,
29908,
1273,
4852,
6248,
3284,
16524,
3284,
15176,
3284,
29896,
28658,
29918,
29925,
3284,
29941,
28658,
29918,
29925,
3284,
29945,
28658,
29918,
29925,
3284,
29963,
5607,
3284,
2287,
24360,
1159,
13,
1678,
363,
289,
297,
269,
29918,
1256,
29901,
13,
4706,
1596,
11860,
29899,
29896,
29900,
29879,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29906,
29900,
29879,
1273,
29899,
29896,
29900,
29879,
29908,
1273,
313,
29890,
29961,
29900,
1402,
29890,
29961,
29896,
1402,
710,
29898,
29890,
29961,
29906,
11724,
710,
29898,
29890,
29961,
29941,
11724,
710,
29898,
29890,
29961,
29946,
11724,
289,
29961,
29945,
1402,
289,
29961,
29953,
1402,
289,
29961,
29955,
29962,
1723,
13,
268,
13,
1753,
2767,
20754,
384,
3399,
1293,
7295,
13,
1678,
3142,
353,
376,
1396,
29889,
23027,
29885,
4992,
29889,
510,
29908,
13,
1678,
2224,
353,
5591,
17712,
1761,
29889,
1420,
29908,
268,
13,
1678,
2793,
353,
4770,
1124,
2577,
3916,
29898,
2271,
29892,
2224,
29897,
13,
1678,
282,
29918,
845,
353,
525,
845,
29905,
29881,
23097,
13,
1678,
282,
29918,
3616,
353,
525,
3616,
29905,
29881,
23097,
13,
1678,
282,
29918,
303,
353,
376,
1254,
11891,
29974,
2144,
29898,
1194,
29881,
29974,
5513,
13,
1678,
599,
353,
337,
29889,
2886,
497,
29898,
29886,
29918,
845,
29892,
2793,
29897,
718,
337,
29889,
2886,
497,
29898,
29886,
29918,
3616,
29892,
2793,
29897,
13,
1678,
379,
29909,
353,
5159,
13,
1678,
16698,
353,
5159,
13,
1678,
796,
29990,
353,
5159,
13,
1678,
6850,
353,
5159,
13,
1678,
315,
29979,
353,
5159,
13,
1678,
6850,
353,
518,
260,
29961,
29896,
10062,
742,
29930,
1254,
18717,
29873,
29961,
29900,
1822,
13808,
877,
7210,
29968,
2824,
12508,
877,
9420,
29899,
29947,
1495,
29974,
12764,
29876,
29915,
363,
260,
297,
337,
29889,
2886,
497,
29898,
29886,
29918,
303,
29892,
2793,
4638,
13,
1678,
396,
2158,
6850,
13,
1678,
396,
2158,
2793,
29889,
13808,
877,
7210,
29968,
1495,
13,
1678,
396,
2158,
599,
13,
1678,
363,
775,
297,
599,
29901,
13,
4706,
282,
29918,
18038,
353,
525,
1013,
11891,
29974,
2144,
877,
718,
775,
29961,
29906,
17531,
13,
4706,
1018,
29901,
13,
9651,
775,
13778,
353,
337,
29889,
2886,
497,
29898,
29886,
29918,
18038,
29892,
2793,
9601,
29900,
1822,
13808,
877,
7210,
29968,
2824,
12508,
877,
9420,
29899,
29947,
1495,
13,
4706,
5174,
8960,
29892,
321,
29901,
13,
9651,
775,
13778,
353,
525,
29940,
1164,
25797,
29915,
13,
4706,
396,
1596,
775,
29892,
775,
13778,
13,
4706,
565,
775,
29961,
29906,
29901,
1822,
2886,
877,
29953,
29900,
1495,
1275,
29871,
29900,
29901,
13,
9651,
379,
29909,
29889,
4397,
29898,
401,
29974,
3788,
29974,
401,
13778,
29974,
12764,
29876,
1495,
13,
4706,
565,
775,
29961,
29906,
29901,
1822,
2886,
877,
29900,
29900,
29900,
1495,
1275,
29871,
29900,
29901,
13,
9651,
16698,
29889,
4397,
29898,
401,
29974,
3788,
29974,
401,
13778,
29974,
12764,
29876,
1495,
13,
4706,
565,
775,
29961,
29906,
29901,
1822,
2886,
877,
29900,
29900,
29906,
1495,
1275,
29871,
29900,
29901,
13,
9651,
796,
29990,
29889,
4397,
29898,
401,
29974,
3788,
29974,
401,
13778,
29974,
12764,
29876,
1495,
13,
4706,
565,
775,
29961,
29906,
29901,
1822,
2886,
877,
29941,
29900,
29900,
1495,
1275,
29871,
29900,
29901,
13,
9651,
315,
29979,
29889,
4397,
29898,
401,
29974,
3788,
29974,
401,
13778,
29974,
12764,
29876,
1495,
13,
13,
1678,
396,
1596,
315,
29979,
13,
1678,
285,
29881,
15715,
353,
1722,
877,
1272,
29914,
15715,
29889,
1272,
742,
525,
29893,
29974,
1495,
13,
1678,
285,
29881,
8132,
353,
1722,
877,
1272,
29914,
8132,
29889,
1272,
742,
525,
29893,
29974,
1495,
13,
1678,
285,
29881,
29999,
29990,
353,
1722,
877,
1272,
29914,
29999,
29990,
29889,
1272,
742,
525,
29893,
29974,
1495,
29871,
13,
1678,
285,
29881,
1254,
353,
1722,
877,
1272,
29914,
1254,
29889,
1272,
742,
525,
29893,
29974,
1495,
29871,
13,
1678,
285,
29881,
29907,
29979,
353,
1722,
877,
1272,
29914,
29907,
29979,
29889,
1272,
742,
525,
29893,
29974,
1495,
29871,
13,
1678,
285,
29881,
15715,
29889,
8231,
24210,
29898,
15715,
29897,
259,
13,
1678,
285,
29881,
8132,
29889,
8231,
24210,
29898,
8132,
29897,
13,
1678,
285,
29881,
29999,
29990,
29889,
8231,
24210,
29898,
29999,
29990,
29897,
13,
1678,
285,
29881,
1254,
29889,
8231,
24210,
29898,
1254,
29897,
13,
1678,
285,
29881,
29907,
29979,
29889,
8231,
24210,
29898,
29907,
29979,
29897,
13,
1678,
285,
29881,
15715,
29889,
5358,
580,
13,
1678,
285,
29881,
8132,
29889,
5358,
580,
13,
1678,
285,
29881,
1254,
29889,
5358,
580,
29871,
13,
1678,
285,
29881,
29999,
29990,
29889,
5358,
580,
13,
1678,
285,
29881,
29907,
29979,
29889,
5358,
580,
13,
1678,
396,
2158,
2793,
13,
13,
1753,
1207,
2772,
284,
29898,
29879,
29918,
1256,
29892,
321,
29918,
1256,
29892,
4175,
29892,
775,
3888,
11759,
1402,
1791,
29918,
29885,
4992,
29922,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
10961,
23945,
29922,
29896,
29900,
1125,
13,
1678,
14550,
13,
1678,
269,
29918,
1256,
29992,
1807,
29901,
268,
1369,
2635,
13,
1678,
321,
29918,
1256,
29992,
1807,
29901,
268,
1095,
2635,
13,
1678,
775,
3888,
29992,
1761,
29901,
268,
518,
877,
29900,
29900,
29906,
29900,
29953,
29941,
742,
29871,
29906,
29955,
29889,
29955,
29947,
29892,
29871,
29941,
29900,
29900,
511,
6702,
29900,
29900,
29906,
29896,
29945,
29900,
742,
29871,
29906,
29896,
29889,
29955,
29947,
29892,
29871,
29906,
29900,
29900,
511,
6702,
29953,
29900,
29900,
29953,
29900,
29946,
742,
29871,
29896,
29947,
29889,
29906,
29896,
29892,
29871,
29906,
29945,
29900,
27077,
29871,
30354,
31180,
31166,
30956,
30383,
29898,
235,
133,
164,
234,
168,
171,
30690,
31183,
29892,
231,
188,
179,
30752,
231,
190,
186,
31168,
29892,
30880,
30354,
28166,
13,
1678,
1791,
29918,
29885,
4992,
29992,
524,
29901,
268,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
13,
1678,
14550,
13,
1678,
263,
353,
931,
29889,
2230,
580,
13,
1678,
565,
451,
775,
3888,
29901,
13,
4706,
396,
31994,
31295,
235,
183,
176,
231,
188,
179,
235,
133,
164,
234,
168,
171,
13,
4706,
396,
31393,
30763,
30429,
30287,
30502,
31398,
233,
155,
150,
30325,
15176,
30214,
30505,
30658,
29906,
29900,
236,
157,
146,
31429,
31050,
30544,
29945,
31541,
235,
133,
164,
234,
168,
171,
13,
4706,
8872,
2673,
353,
7700,
13,
4706,
1550,
451,
338,
5323,
311,
12742,
29898,
29879,
29918,
1256,
1125,
13,
9651,
269,
29918,
1256,
353,
679,
8897,
2539,
29898,
29879,
29918,
1256,
29897,
13,
4706,
396,
29879,
29918,
1256,
353,
679,
8897,
2539,
29898,
29879,
29918,
1256,
29897,
13,
4706,
396,
4230,
2539,
353,
679,
8897,
2539,
29898,
29879,
29918,
1256,
29897,
13,
4706,
599,
20754,
384,
353,
679,
25353,
29898,
29879,
29918,
1256,
29892,
2848,
29922,
29945,
29900,
29900,
29900,
29892,
16700,
29922,
29906,
29900,
29897,
13,
4706,
1900,
1761,
353,
599,
20754,
384,
7503,
29906,
29900,
29962,
13,
4706,
15234,
295,
391,
353,
5159,
13,
4706,
1550,
7431,
29898,
19284,
295,
391,
29897,
529,
10961,
23945,
29901,
13,
9651,
2380,
353,
4036,
29889,
9502,
524,
29898,
29900,
29892,
29871,
29896,
29929,
29897,
13,
9651,
565,
1900,
1761,
29961,
2248,
29962,
451,
297,
15234,
295,
391,
29901,
13,
18884,
15234,
295,
391,
29889,
4397,
29898,
13318,
1761,
29961,
2248,
2314,
13,
4706,
396,
19284,
295,
391,
353,
518,
13318,
1761,
29961,
8172,
29889,
9502,
524,
29898,
29900,
29892,
29896,
29929,
4638,
363,
474,
297,
3464,
29898,
29900,
29892,
17712,
23945,
4638,
13,
4706,
396,
7192,
397,
919,
29992,
8977,
29901,
426,
401,
8159,
29918,
29900,
29901,
17712,
6360,
29918,
29900,
29892,
775,
8159,
29918,
29896,
29901,
17712,
6360,
29918,
29896,
29913,
13,
4706,
3041,
397,
919,
353,
6571,
13,
4706,
396,
2158,
15234,
295,
391,
13,
4706,
363,
1900,
401,
297,
15234,
295,
391,
29901,
13,
9651,
3041,
397,
919,
29889,
5504,
3319,
13318,
401,
29901,
1649,
657,
11442,
708,
20754,
384,
3401,
29898,
13318,
401,
29961,
29906,
29901,
1402,
1900,
401,
7503,
29906,
1402,
269,
29918,
1256,
7503,
29946,
1402,
1134,
2433,
29890,
1495,
1800,
13,
4706,
396,
235,
133,
164,
234,
168,
171,
31398,
233,
155,
150,
13,
4706,
1791,
29918,
7827,
353,
29871,
29900,
13,
4706,
396,
2158,
525,
29911,
4717,
2287,
20231,
29901,
13420,
29879,
29918,
1256,
13,
4706,
716,
3399,
3401,
353,
5159,
13,
4706,
1596,
376,
9166,
9166,
2751,
323,
4717,
2287,
20231,
29901,
1273,
29879,
1275,
9166,
9166,
26359,
1273,
269,
29918,
1256,
13,
4706,
1596,
376,
9314,
4590,
6778,
584,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29953,
29879,
7686,
1273,
29947,
29879,
29908,
1273,
6702,
16524,
3788,
7838,
29979,
3788,
1660,
2208,
3788,
6632,
29956,
742,
525,
2287,
1964,
29911,
742,
525,
29903,
3308,
29925,
1430,
742,
525,
29934,
24336,
742,
525,
29925,
29914,
29931,
742,
525,
29924,
12413,
29979,
1495,
13,
4706,
363,
775,
297,
15234,
295,
391,
29901,
13,
9651,
775,
3888,
6360,
353,
3041,
397,
919,
29961,
401,
29962,
13,
9651,
775,
7192,
397,
388,
353,
775,
3888,
6360,
29961,
29879,
29918,
1256,
29962,
13,
9651,
3464,
353,
599,
20754,
384,
29889,
2248,
29898,
401,
29897,
13,
9651,
15649,
353,
775,
7192,
397,
388,
1839,
2962,
2033,
462,
418,
396,
31026,
234,
158,
155,
231,
190,
186,
231,
188,
179,
30752,
13,
9651,
1029,
29887,
29924,
4992,
353,
938,
29898,
5060,
29918,
29885,
4992,
847,
10961,
23945,
29897,
3986,
396,
31951,
31541,
231,
188,
179,
30752,
30659,
236,
149,
180,
13,
9651,
15649,
4557,
353,
938,
29898,
485,
29887,
29924,
4992,
29914,
2423,
29891,
29914,
29896,
29900,
29900,
29897,
1669,
396,
31951,
31541,
231,
188,
179,
30752,
30354,
31180,
13,
9651,
1029,
29887,
15078,
29924,
4992,
353,
1029,
29887,
29924,
4992,
448,
15649,
29930,
2423,
29891,
4557,
29930,
29896,
29900,
29900,
268,
396,
31951,
31541,
232,
140,
172,
231,
192,
156,
30659,
236,
149,
180,
13,
9651,
2446,
2539,
353,
679,
9190,
2539,
29898,
29879,
29918,
1256,
29897,
462,
29871,
396,
31024,
30683,
30557,
30287,
30502,
31398,
233,
155,
150,
30325,
30408,
30325,
31117,
13,
9651,
1791,
29918,
7827,
4619,
1029,
29887,
15078,
29924,
4992,
13,
9651,
1596,
376,
976,
350,
29965,
29979,
584,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29881,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29953,
29879,
7686,
1273,
29947,
29879,
29908,
1273,
313,
401,
29892,
2423,
29891,
29892,
29900,
29892,
2423,
29891,
29892,
15649,
4557,
29892,
8872,
2673,
29892,
3464,
29892,
29871,
29900,
5501,
29899,
18717,
710,
29898,
524,
29898,
2423,
29891,
29930,
2423,
29891,
4557,
29930,
29896,
29900,
29900,
4961,
13,
9651,
716,
3399,
3401,
29889,
4397,
3552,
401,
29892,
15649,
29892,
15649,
4557,
876,
13,
4706,
1596,
376,
6778,
29911,
2891,
1964,
29901,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29953,
29889,
29906,
29888,
7686,
1273,
29947,
29879,
29908,
1273,
6702,
29899,
3788,
29899,
3788,
29899,
3788,
29899,
742,
17411,
742,
17411,
742,
17411,
742,
29871,
29900,
1919,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29897,
13,
4706,
1596,
525,
6040,
6059,
13420,
524,
29898,
2230,
29889,
2230,
3101,
448,
263,
29892,
525,
6923,
29915,
13,
4706,
1207,
2772,
284,
29898,
4622,
2539,
29892,
321,
29918,
1256,
29892,
4175,
29892,
716,
3399,
3401,
29892,
1791,
29918,
7827,
29892,
10961,
23945,
29897,
13,
1678,
1683,
29901,
13,
4706,
1596,
376,
9166,
9166,
2751,
323,
4717,
2287,
20231,
29901,
1273,
29879,
1275,
9166,
9166,
26359,
1273,
269,
29918,
1256,
13,
4706,
1596,
376,
9314,
4590,
6778,
584,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29953,
29879,
7686,
1273,
29947,
29879,
29908,
1273,
6702,
16524,
3788,
7838,
29979,
3788,
1660,
2208,
3788,
6632,
29956,
742,
525,
2287,
1964,
29911,
742,
525,
29903,
3308,
29925,
1430,
742,
525,
29934,
24336,
742,
525,
29925,
29914,
29931,
742,
525,
29924,
12413,
29979,
1495,
13,
4706,
396,
31466,
31565,
235,
133,
164,
234,
168,
171,
30461,
30959,
13,
4706,
3041,
397,
919,
353,
6571,
13,
4706,
3001,
1917,
353,
29871,
29900,
13,
4706,
1833,
2539,
353,
679,
8897,
2539,
29898,
29879,
29918,
1256,
29897,
13,
4706,
599,
20754,
384,
353,
679,
25353,
29898,
4230,
2539,
29892,
2848,
29922,
29945,
29900,
29900,
29900,
29892,
16700,
29922,
29906,
29900,
29897,
13,
4706,
396,
2158,
1833,
2539,
29892,
599,
20754,
384,
13,
4706,
1900,
1761,
29922,
599,
20754,
384,
7503,
29906,
29900,
29962,
13,
4706,
15234,
295,
391,
353,
23160,
401,
29961,
29900,
29962,
363,
903,
401,
297,
775,
3888,
29962,
13,
4706,
363,
1900,
401,
297,
15234,
295,
391,
29901,
13,
9651,
3041,
397,
919,
29889,
5504,
3319,
13318,
401,
29901,
1649,
657,
11442,
708,
20754,
384,
3401,
29898,
13318,
401,
29961,
29906,
29901,
1402,
1900,
401,
7503,
29906,
1402,
269,
29918,
1256,
7503,
29946,
1402,
1134,
2433,
29890,
1495,
1800,
13,
4706,
716,
3399,
3401,
353,
5159,
13,
4706,
396,
1482,
3399,
3401,
29992,
1761,
29901,
518,
877,
29900,
29900,
29906,
29900,
29953,
29941,
742,
29871,
29906,
29955,
29889,
29955,
29947,
29892,
29871,
29941,
29900,
29900,
511,
6702,
29900,
29900,
29906,
29896,
29945,
29900,
742,
29871,
29906,
29896,
29889,
29955,
29947,
29892,
29871,
29906,
29900,
29900,
511,
6702,
29953,
29900,
29900,
29953,
29900,
29946,
742,
29871,
29896,
29947,
29889,
29906,
29896,
29892,
29871,
29906,
29945,
29900,
27077,
29871,
30354,
31180,
31166,
30956,
30383,
29898,
235,
133,
164,
234,
168,
171,
30690,
31183,
29892,
231,
188,
179,
30752,
231,
190,
186,
31168,
29892,
30880,
30354,
28166,
13,
4706,
363,
5235,
297,
775,
3888,
29901,
13,
9651,
8872,
2673,
353,
7700,
13,
9651,
775,
29892,
15649,
29892,
288,
3727,
29891,
4557,
353,
5235,
13,
9651,
396,
2158,
599,
20754,
384,
13,
9651,
3464,
353,
599,
20754,
384,
29889,
2248,
29898,
401,
29897,
13,
9651,
775,
3888,
6360,
353,
3041,
397,
919,
29961,
401,
29962,
13,
9651,
775,
7192,
397,
388,
353,
6213,
13,
9651,
1369,
29918,
1256,
353,
269,
29918,
1256,
13,
9651,
1550,
451,
775,
7192,
397,
388,
29901,
13,
18884,
1018,
29901,
13,
462,
1678,
775,
7192,
397,
388,
353,
775,
3888,
6360,
29961,
2962,
29918,
1256,
29962,
13,
462,
1678,
2867,
13,
18884,
5174,
8960,
29892,
29872,
29901,
13,
462,
1678,
396,
2158,
9637,
1627,
29889,
2158,
29918,
735,
29883,
29898,
29872,
29897,
13,
462,
1678,
775,
7192,
397,
388,
353,
6213,
13,
462,
1678,
8872,
2673,
353,
5852,
13,
462,
1678,
1369,
29918,
1256,
353,
679,
8897,
2539,
29898,
2962,
29918,
1256,
29892,
775,
29897,
13,
462,
1678,
396,
2158,
1369,
29918,
1256,
29892,
775,
13,
13,
9651,
396,
31791,
31683,
30392,
31191,
31640,
235,
133,
164,
13,
9651,
565,
451,
8872,
2673,
29901,
13,
18884,
396,
31295,
232,
132,
159,
234,
140,
143,
13,
18884,
396,
232,
144,
153,
30544,
31217,
30631,
30383,
29896,
29889,
15176,
30413,
30505,
30658,
29906,
29900,
31608,
29906,
29889,
234,
158,
139,
31107,
31480,
31138,
29941,
29945,
29995,
13,
18884,
396,
31791,
31683,
234,
158,
139,
31107,
234,
145,
138,
13,
18884,
2030,
13026,
353,
775,
3888,
29961,
19284,
295,
391,
29889,
2248,
29898,
401,
29897,
3816,
29896,
29962,
13,
18884,
716,
13026,
353,
775,
3888,
6360,
29961,
29879,
29918,
1256,
22322,
2962,
2033,
13,
18884,
10151,
353,
313,
1482,
13026,
29914,
1025,
13026,
448,
29871,
29896,
29897,
334,
29871,
29896,
29900,
29900,
13,
18884,
396,
31791,
31683,
15176,
13,
18884,
565,
775,
451,
297,
1900,
1761,
29901,
13,
462,
1678,
396,
31594,
30658,
29906,
29900,
233,
143,
148,
30544,
30287,
31541,
31423,
30417,
231,
188,
179,
31138,
30210,
30374,
235,
133,
164,
13,
462,
1678,
396,
2158,
775,
5501,
714,
310,
29871,
29906,
29900,
29915,
13,
462,
1678,
13128,
1293,
353,
23160,
401,
29961,
29900,
29962,
363,
903,
401,
297,
15234,
295,
391,
29962,
13,
462,
1678,
1550,
29871,
29896,
29901,
13,
462,
4706,
716,
353,
938,
29898,
8172,
29889,
9502,
524,
29898,
29900,
29892,
29896,
29929,
876,
13,
462,
308,
13,
462,
4706,
396,
30374,
235,
133,
164,
30413,
30505,
401,
3888,
30275,
231,
187,
151,
30948,
30325,
31423,
30417,
232,
132,
159,
234,
140,
143,
13,
462,
4706,
565,
1900,
1761,
29961,
1482,
29962,
451,
297,
15234,
295,
391,
29901,
13,
462,
9651,
716,
20754,
384,
353,
1900,
1761,
29961,
1482,
29962,
13,
462,
9651,
716,
401,
3888,
6360,
353,
4770,
657,
11442,
708,
20754,
384,
3401,
29898,
1482,
20754,
384,
29961,
29906,
29901,
1402,
716,
20754,
384,
7503,
29906,
1402,
269,
29918,
1256,
7503,
29946,
1402,
1134,
2433,
29890,
1495,
13,
462,
9651,
565,
269,
29918,
1256,
297,
716,
401,
3888,
6360,
29889,
8149,
7295,
13,
462,
18884,
716,
6069,
353,
1900,
1761,
29889,
2248,
29898,
1482,
20754,
384,
29897,
13,
462,
18884,
2867,
13,
462,
1678,
396,
2158,
775,
3888,
6360,
29961,
29879,
29918,
1256,
29962,
13,
462,
1678,
19417,
353,
716,
13026,
13,
462,
1678,
1596,
9872,
29899,
3725,
2208,
29901,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29881,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29953,
29889,
29906,
29888,
7686,
1273,
29947,
29879,
29908,
1273,
313,
401,
29892,
1025,
13026,
29892,
19417,
29892,
29900,
29892,
29877,
3727,
29891,
4557,
29892,
8872,
2673,
29892,
3464,
29892,
10151,
5501,
29974,
18717,
710,
29898,
524,
29898,
29879,
514,
29930,
29877,
3727,
29891,
4557,
29930,
29896,
29900,
29900,
4961,
13,
462,
1678,
396,
2158,
19417,
29892,
288,
3727,
29891,
4557,
29892,
1791,
29918,
29885,
4992,
13,
462,
1678,
288,
3220,
29922,
19284,
295,
391,
29889,
2248,
29898,
401,
29897,
13,
462,
1678,
15234,
295,
391,
29889,
5992,
29898,
401,
29897,
13,
462,
1678,
15234,
295,
391,
29889,
7851,
29898,
29877,
3220,
29892,
716,
20754,
384,
29897,
13,
462,
1678,
263,
11536,
1917,
353,
19417,
334,
288,
3727,
29891,
4557,
334,
29871,
29896,
29900,
29900,
718,
1791,
29918,
29885,
4992,
13,
462,
1678,
396,
2158,
19417,
29892,
288,
3727,
29891,
4557,
29892,
1791,
29918,
29885,
4992,
29892,
263,
11536,
1917,
13,
462,
1678,
3001,
1917,
4619,
263,
11536,
1917,
13,
462,
1678,
15649,
353,
716,
401,
3888,
6360,
29961,
29879,
29918,
1256,
22322,
2962,
2033,
462,
29871,
396,
30651,
31026,
234,
158,
155,
231,
190,
186,
235,
183,
176,
231,
188,
179,
13,
462,
1678,
15649,
4557,
353,
938,
29898,
29874,
11536,
1917,
29914,
2423,
29891,
29914,
29896,
29900,
29900,
29897,
462,
268,
396,
31466,
31565,
235,
133,
164,
234,
168,
171,
30354,
31180,
13,
462,
1678,
1791,
29918,
29885,
4992,
353,
263,
11536,
1917,
448,
15649,
29930,
2423,
29891,
4557,
29930,
29896,
29900,
29900,
632,
396,
30908,
30374,
31466,
31565,
232,
140,
172,
231,
192,
156,
30659,
236,
149,
180,
13,
462,
1678,
396,
2158,
15649,
29892,
15649,
4557,
29892,
1791,
29918,
29885,
4992,
13,
462,
1678,
1596,
376,
976,
350,
29965,
29979,
584,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29881,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29953,
29889,
29906,
29888,
7686,
1273,
29947,
29879,
29908,
1273,
313,
1482,
20754,
384,
29892,
2423,
29891,
29892,
29871,
29900,
29892,
2423,
29891,
29892,
2423,
29891,
4557,
29892,
8872,
2673,
29892,
716,
6069,
29892,
29871,
29900,
5501,
29899,
18717,
710,
29898,
524,
29898,
2423,
29891,
29930,
2423,
29891,
4557,
29930,
29896,
29900,
29900,
4961,
13,
462,
1678,
716,
3399,
3401,
29889,
4397,
3552,
1482,
20754,
384,
29892,
15649,
29892,
15649,
4557,
876,
13,
462,
1678,
6773,
13,
462,
13,
18884,
565,
10151,
6736,
349,
29950,
470,
10151,
5277,
16507,
29901,
13,
462,
1678,
396,
234,
158,
139,
31107,
30257,
30909,
29945,
29900,
29995,
31391,
30767,
231,
189,
146,
233,
144,
162,
30257,
30909,
29896,
29945,
29995,
30214,
31640,
235,
133,
164,
13,
462,
1678,
396,
2158,
525,
27933,
29901,
13420,
1482,
13026,
29914,
1025,
13026,
13,
462,
1678,
13128,
1293,
353,
23160,
401,
29961,
29900,
29962,
363,
903,
401,
297,
15234,
295,
391,
29962,
13,
462,
1678,
1550,
29871,
29896,
29901,
13,
462,
4706,
716,
353,
938,
29898,
8172,
29889,
9502,
524,
29898,
29900,
29892,
29896,
29929,
876,
13,
462,
4706,
565,
1900,
1761,
29961,
1482,
29962,
451,
297,
15234,
295,
391,
29901,
13,
462,
9651,
716,
20754,
384,
353,
1900,
1761,
29961,
1482,
29962,
13,
462,
9651,
716,
401,
3888,
6360,
353,
4770,
657,
11442,
708,
20754,
384,
3401,
29898,
1482,
20754,
384,
29961,
29906,
29901,
1402,
716,
20754,
384,
7503,
29906,
1402,
269,
29918,
1256,
7503,
29946,
1402,
1134,
2433,
29890,
1495,
13,
462,
9651,
565,
269,
29918,
1256,
297,
716,
401,
3888,
6360,
29889,
8149,
7295,
13,
462,
18884,
716,
6069,
353,
1900,
1761,
29889,
2248,
29898,
1482,
20754,
384,
29897,
13,
462,
18884,
2867,
13,
462,
1678,
396,
2158,
775,
3888,
6360,
29961,
29879,
29918,
1256,
29962,
13,
462,
1678,
19417,
353,
716,
13026,
13,
462,
1678,
1596,
9872,
29899,
3725,
2208,
29901,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29881,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29953,
29889,
29906,
29888,
7686,
1273,
29947,
29879,
29908,
1273,
313,
401,
29892,
1025,
13026,
29892,
29879,
514,
29892,
29900,
29892,
29877,
3727,
29891,
4557,
29892,
8872,
2673,
29892,
3464,
29892,
10151,
5501,
29974,
18717,
710,
29898,
524,
29898,
29879,
514,
29930,
29877,
3727,
29891,
4557,
29930,
29896,
29900,
29900,
4961,
13,
462,
1678,
396,
2158,
19417,
29892,
288,
3727,
29891,
4557,
29892,
1791,
29918,
29885,
4992,
13,
462,
1678,
288,
3220,
29922,
19284,
295,
391,
29889,
2248,
29898,
401,
29897,
13,
462,
1678,
15234,
295,
391,
29889,
5992,
29898,
401,
29897,
13,
462,
1678,
15234,
295,
391,
29889,
7851,
29898,
29877,
3220,
29892,
716,
20754,
384,
29897,
13,
462,
1678,
263,
11536,
1917,
353,
19417,
334,
288,
3727,
29891,
4557,
334,
29871,
29896,
29900,
29900,
718,
1791,
29918,
29885,
4992,
13,
462,
1678,
3001,
1917,
4619,
263,
11536,
1917,
13,
462,
1678,
716,
401,
3888,
6360,
353,
4770,
657,
11442,
708,
20754,
384,
3401,
29898,
1482,
20754,
384,
29961,
29906,
29901,
1402,
716,
20754,
384,
7503,
29906,
1402,
269,
29918,
1256,
7503,
29946,
1402,
1134,
2433,
29890,
1495,
13,
462,
1678,
15649,
353,
716,
401,
3888,
6360,
29961,
29879,
29918,
1256,
22322,
2962,
2033,
462,
29871,
396,
30651,
31026,
234,
158,
155,
231,
190,
186,
235,
183,
176,
231,
188,
179,
13,
462,
1678,
15649,
4557,
353,
938,
29898,
29874,
11536,
1917,
29914,
2423,
29891,
29914,
29896,
29900,
29900,
29897,
462,
268,
396,
31466,
31565,
235,
133,
164,
234,
168,
171,
30354,
31180,
13,
462,
1678,
1791,
29918,
29885,
4992,
353,
263,
11536,
1917,
448,
15649,
29930,
2423,
29891,
4557,
29930,
29896,
29900,
29900,
632,
396,
30908,
30374,
31466,
31565,
232,
140,
172,
231,
192,
156,
30659,
236,
149,
180,
13,
462,
1678,
1596,
376,
976,
350,
29965,
29979,
584,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29881,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29953,
29889,
29906,
29888,
7686,
1273,
29947,
29879,
29908,
1273,
313,
1482,
20754,
384,
29892,
2423,
29891,
29892,
29900,
29892,
2423,
29891,
29892,
15649,
4557,
29892,
8872,
2673,
29892,
3464,
29892,
10151,
5501,
29899,
18717,
710,
29898,
524,
29898,
2423,
29891,
29930,
2423,
29891,
4557,
29930,
29896,
29900,
29900,
4961,
13,
462,
1678,
716,
3399,
3401,
29889,
4397,
3552,
1482,
20754,
384,
29892,
29871,
15649,
29892,
15649,
4557,
876,
13,
462,
1678,
6773,
13,
462,
13,
18884,
565,
10151,
1405,
16507,
322,
10151,
529,
349,
29950,
322,
775,
297,
1900,
1761,
29901,
13,
462,
1678,
288,
13026,
353,
775,
7192,
397,
388,
1839,
2962,
2033,
13,
462,
1678,
263,
11536,
1917,
353,
288,
13026,
334,
288,
3727,
29891,
4557,
334,
29871,
29896,
29900,
29900,
13,
462,
1678,
3001,
1917,
4619,
263,
11536,
1917,
13,
462,
1678,
1596,
11663,
29930,
379,
5607,
29928,
29901,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29881,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29953,
29889,
29906,
29888,
7686,
1273,
29947,
29881,
29908,
1273,
313,
401,
29892,
1025,
13026,
29892,
29900,
29892,
29877,
13026,
29892,
29877,
3727,
29891,
4557,
29892,
8872,
2673,
29892,
3464,
29892,
10151,
29892,
29877,
13026,
29930,
29877,
3727,
29891,
4557,
29930,
29896,
29900,
29900,
29897,
13,
462,
1678,
716,
3399,
3401,
29889,
4397,
3552,
401,
29892,
2030,
13026,
29892,
288,
3727,
29891,
4557,
876,
13,
462,
1678,
6773,
13,
462,
268,
13,
462,
632,
13,
9651,
1683,
29901,
13,
18884,
396,
232,
132,
159,
234,
140,
143,
29892,
30413,
31640,
235,
133,
164,
13,
18884,
2030,
13026,
353,
775,
3888,
29961,
19284,
295,
391,
29889,
2248,
29898,
401,
29897,
3816,
29896,
29962,
13,
18884,
1833,
2539,
353,
679,
8897,
2539,
29898,
29879,
29918,
1256,
29892,
775,
29897,
13,
18884,
716,
13026,
353,
775,
3888,
6360,
29961,
4230,
2539,
22322,
355,
2033,
539,
396,
232,
132,
159,
234,
140,
143,
30948,
30408,
31997,
234,
158,
155,
231,
190,
186,
13,
18884,
396,
1482,
13026,
353,
775,
3888,
6360,
29961,
29879,
29918,
1256,
22322,
2962,
2033,
13,
18884,
10151,
353,
313,
1482,
13026,
29914,
1025,
13026,
448,
29871,
29896,
29897,
334,
29871,
29896,
29900,
29900,
13,
18884,
288,
13026,
353,
775,
7192,
397,
388,
1839,
355,
2033,
13,
18884,
263,
11536,
1917,
353,
288,
13026,
334,
288,
3727,
29891,
4557,
334,
29871,
29896,
29900,
29900,
13,
18884,
3001,
1917,
4619,
263,
11536,
1917,
13,
18884,
1596,
11663,
29930,
379,
5607,
29928,
29901,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29889,
29906,
29888,
1273,
29899,
29953,
29881,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29953,
29889,
29906,
29888,
7686,
1273,
29947,
29881,
29908,
1273,
313,
401,
29892,
1025,
13026,
29892,
29900,
29892,
1482,
13026,
29892,
29877,
3727,
29891,
4557,
29892,
8872,
2673,
29892,
3464,
29892,
10151,
29892,
29877,
13026,
29930,
29877,
3727,
29891,
4557,
29930,
29896,
29900,
29900,
29897,
13,
18884,
716,
3399,
3401,
29889,
4397,
3552,
401,
29892,
2030,
13026,
29892,
288,
3727,
29891,
4557,
876,
13,
4706,
396,
2870,
29901,
13,
4706,
396,
1678,
3001,
1917,
353,
1791,
29918,
29885,
4992,
718,
3001,
1917,
13,
4706,
1596,
376,
6778,
29911,
2891,
1964,
29901,
1273,
29899,
29896,
29900,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29899,
29953,
29879,
1273,
29953,
29889,
29906,
29888,
7686,
1273,
29947,
29879,
29908,
1273,
6702,
29899,
3788,
29899,
3788,
29899,
3788,
29899,
742,
17411,
742,
17411,
742,
17411,
742,
5135,
7827,
1917,
29974,
5060,
29918,
29885,
4992,
6802,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
448,
29871,
29896,
11877,
29896,
29900,
29900,
1919,
938,
29898,
7827,
1917,
29974,
5060,
29918,
29885,
4992,
876,
13,
4706,
396,
2158,
376,
1254,
29949,
7077,
15233,
29901,
1273,
29879,
29908,
1273,
716,
3399,
3401,
13,
4706,
396,
2158,
376,
1254,
29949,
7077,
12599,
4462,
29901,
1273,
29879,
29908,
1273,
3001,
1917,
13,
4706,
396,
2158,
376,
1525,
1254,
341,
12413,
29979,
29901,
1273,
29879,
29908,
1273,
1791,
29918,
29885,
4992,
13,
308,
13,
4706,
396,
2158,
1134,
29898,
29879,
29918,
1256,
29889,
12508,
29898,
9675,
29889,
657,
4381,
22331,
3101,
511,
1134,
29898,
29872,
29918,
1256,
29897,
13,
4706,
396,
2158,
269,
29918,
1256,
29889,
12508,
29898,
9675,
29889,
657,
4381,
22331,
25739,
321,
29918,
1256,
13,
4706,
565,
269,
29918,
1256,
19216,
29872,
29918,
1256,
29901,
13,
9651,
1596,
525,
6040,
6059,
13420,
524,
29898,
2230,
29889,
2230,
3101,
448,
263,
29892,
525,
6923,
29915,
13,
9651,
736,
1207,
2772,
284,
29898,
657,
9190,
2539,
29898,
29879,
29918,
1256,
511,
29872,
29918,
1256,
29892,
4175,
29892,
716,
3399,
3401,
29892,
5060,
29918,
29885,
4992,
29892,
17712,
23945,
29897,
13,
4706,
1683,
29901,
13,
9651,
1596,
376,
29943,
1177,
9818,
29979,
12599,
4462,
29901,
1273,
29879,
29908,
1273,
3001,
1917,
13,
9651,
736,
5852,
13,
308,
13,
1753,
679,
6069,
29898,
17712,
1761,
29892,
2635,
2433,
742,
3309,
29922,
29906,
29900,
29892,
3841,
29922,
29906,
29900,
1125,
13,
1678,
14550,
13,
1678,
10961,
1761,
29901,
6024,
29900,
29900,
29906,
29900,
29953,
29941,
3788,
29900,
29900,
29906,
29896,
29945,
29900,
742,
525,
29953,
29900,
29900,
29953,
29900,
29946,
2033,
13,
1678,
736,
29901,
518,
877,
29900,
29900,
29906,
29900,
29953,
29941,
742,
29871,
29896,
29941,
29955,
29946,
511,
6702,
29900,
29900,
29906,
29896,
29945,
29900,
742,
29871,
29906,
511,
6702,
29953,
29900,
29900,
29953,
29900,
29946,
742,
525,
19377,
1495,
29962,
13,
1678,
14550,
13,
1678,
1900,
1761,
353,
518,
17712,
363,
10961,
297,
679,
25353,
29898,
1256,
29892,
3309,
29892,
3841,
4638,
13,
1678,
3464,
353,
5159,
13,
1678,
363,
10961,
297,
10961,
1761,
29901,
13,
4706,
1018,
29901,
13,
9651,
396,
2158,
679,
13658,
3399,
29898,
17712,
29897,
13,
9651,
2380,
353,
1900,
1761,
29889,
2248,
29898,
657,
13658,
3399,
29898,
17712,
876,
13,
4706,
5174,
29901,
13,
9651,
2380,
353,
525,
19377,
29915,
13,
4706,
3464,
29889,
4397,
3552,
17712,
29892,
2248,
876,
13,
1678,
1683,
29901,
13,
4706,
736,
3464,
539,
13,
13,
1753,
6230,
11726,
7295,
13,
1678,
8744,
353,
376,
21125,
29901,
1273,
29097,
518,
6768,
29962,
1852,
29908,
13,
1678,
13812,
353,
10831,
11726,
29898,
21125,
29922,
21125,
29897,
13,
1678,
13812,
29889,
1202,
29918,
3385,
703,
29899,
29943,
613,
376,
489,
1731,
29899,
4572,
613,
3158,
543,
8899,
613,
1134,
543,
1807,
613,
2731,
543,
4572,
613,
1371,
543,
3434,
509,
403,
491,
7483,
10961,
297,
18342,
362,
19602,
2322,
2433,
29900,
29889,
29900,
29896,
1495,
13,
1678,
13812,
29889,
1202,
29918,
3385,
703,
29899,
29925,
613,
376,
489,
2158,
29899,
449,
613,
3158,
543,
8899,
29918,
3009,
613,
2731,
543,
29874,
11816,
613,
1371,
543,
2772,
8204,
565,
304,
1596,
714,
1121,
19602,
2322,
29922,
8824,
29897,
13,
1678,
13812,
29889,
1202,
29918,
3385,
703,
29899,
29928,
613,
376,
489,
8391,
29899,
1256,
613,
3158,
543,
8899,
613,
1853,
543,
1807,
613,
2731,
543,
29879,
2539,
613,
1371,
543,
8592,
2635,
310,
5839,
292,
19602,
2322,
2433,
1495,
13,
1678,
13812,
29889,
1202,
29918,
3385,
703,
29899,
29873,
613,
376,
489,
3332,
29899,
29990,
613,
3158,
543,
8899,
613,
1853,
543,
524,
613,
2731,
543,
3332,
29990,
613,
1371,
543,
29925,
860,
292,
10961,
515,
2246,
29990,
19602,
2322,
29922,
29906,
29900,
29897,
13,
1678,
2767,
4782,
353,
10831,
4782,
29898,
16680,
29892,
376,
6422,
25186,
3284,
1349,
968,
3987,
2767,
599,
1887,
848,
23157,
13,
1678,
2767,
4782,
29889,
1202,
29918,
3385,
703,
29899,
29881,
613,
376,
489,
5504,
29899,
1256,
613,
3158,
543,
8899,
29918,
3009,
613,
2731,
543,
5504,
29918,
1256,
613,
1371,
543,
6422,
599,
2635,
515,
29871,
29896,
29929,
29929,
29929,
19602,
2322,
29922,
8824,
29897,
13,
1678,
2767,
4782,
29889,
1202,
29918,
3385,
703,
29899,
29880,
613,
376,
489,
5504,
29899,
2997,
613,
3158,
543,
8899,
29918,
3009,
613,
2731,
543,
5504,
29918,
2997,
613,
1371,
543,
6422,
1887,
10961,
5235,
310,
6790,
1629,
19602,
2322,
29922,
8824,
29897,
13,
1678,
2767,
4782,
29889,
1202,
29918,
3385,
703,
29899,
29879,
613,
376,
489,
5504,
29899,
17712,
613,
3158,
543,
8899,
613,
2731,
543,
5504,
29918,
17712,
613,
1371,
543,
6422,
10961,
1051,
29892,
515,
2183,
1629,
29898,
29906,
29900,
29896,
29900,
2678,
467,
613,
2322,
2433,
1495,
13,
1678,
13812,
29889,
1202,
29918,
3385,
29918,
2972,
29898,
5504,
4782,
29897,
13,
268,
13,
1678,
1207,
2772,
284,
4782,
353,
10831,
4782,
29898,
16680,
29892,
376,
9984,
897,
284,
25186,
3284,
1349,
968,
3987,
29611,
316,
1338,
29889,
1678,
320,
13,
462,
462,
4706,
321,
29889,
29887,
29901,
3017,
623,
29889,
2272,
448,
29888,
29871,
29906,
29900,
29896,
29900,
29900,
29896,
29900,
29945,
448,
29872,
29871,
29906,
29900,
29896,
29900,
29896,
29906,
29941,
29896,
448,
29885,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
448,
29876,
29871,
29896,
29900,
1159,
13,
1678,
1207,
2772,
284,
4782,
29889,
1202,
29918,
3385,
703,
29899,
29888,
613,
376,
489,
2962,
29899,
1256,
613,
3158,
543,
8899,
613,
1853,
543,
1807,
613,
2731,
543,
29879,
2539,
613,
1371,
543,
4763,
292,
2635,
310,
17402,
19602,
2322,
2433,
1495,
13,
1678,
1207,
2772,
284,
4782,
29889,
1202,
29918,
3385,
703,
29899,
29872,
613,
376,
489,
355,
29899,
1256,
613,
3158,
543,
8899,
613,
1853,
543,
1807,
613,
2731,
543,
29872,
2539,
613,
1371,
543,
5044,
292,
2635,
310,
17402,
19602,
2322,
2433,
1495,
13,
1678,
1207,
2772,
284,
4782,
29889,
1202,
29918,
3385,
703,
29899,
29885,
613,
376,
489,
2962,
29899,
29885,
4992,
613,
3158,
543,
8899,
613,
1853,
543,
524,
613,
2731,
543,
29879,
29924,
4992,
613,
1371,
543,
2577,
3464,
491,
6790,
10961,
29879,
1353,
19602,
2322,
29922,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29897,
13,
1678,
1207,
2772,
284,
4782,
29889,
1202,
29918,
3385,
703,
29899,
29886,
613,
376,
489,
23945,
29899,
22197,
613,
3158,
543,
8899,
613,
1853,
543,
524,
613,
2731,
543,
22197,
613,
1371,
543,
15644,
310,
10961,
5839,
292,
29901,
268,
320,
13,
462,
462,
462,
462,
462,
462,
268,
29900,
29901,
4036,
297,
5839,
1353,
29936,
1678,
320,
13,
462,
462,
462,
462,
462,
462,
268,
29896,
29901,
2294,
2246,
29871,
29896,
29900,
19602,
2322,
29922,
29900,
29897,
13,
1678,
1207,
2772,
284,
4782,
29889,
1202,
29918,
3385,
703,
29899,
29876,
613,
376,
489,
23945,
29899,
4537,
613,
3158,
543,
8899,
613,
1853,
543,
524,
613,
2731,
543,
29886,
4557,
613,
1371,
543,
4557,
310,
10961,
29879,
363,
4036,
5839,
292,
19602,
2322,
29922,
29945,
29897,
13,
1678,
13812,
29889,
1202,
29918,
3385,
29918,
2972,
29898,
5675,
2772,
284,
4782,
29897,
13,
268,
13,
1678,
679,
25353,
4782,
353,
10831,
4782,
29898,
16680,
29892,
376,
29925,
860,
6407,
6639,
4684,
3284,
1349,
968,
3987,
5839,
714,
1900,
10961,
29879,
491,
6790,
6389,
29889,
1678,
320,
13,
462,
462,
4706,
321,
29889,
29887,
29901,
3017,
623,
29889,
2272,
448,
29928,
29871,
29906,
29900,
29896,
29900,
29900,
29906,
29941,
29896,
448,
29925,
21069,
29873,
29871,
29906,
29900,
29962,
21069,
29874,
29871,
29906,
29900,
29962,
21069,
29943,
29871,
29945,
29962,
1159,
13,
268,
13,
268,
13,
1678,
679,
25353,
4782,
29889,
1202,
29918,
3385,
703,
29899,
29874,
613,
376,
489,
12483,
482,
29899,
3250,
613,
3158,
543,
8899,
613,
1853,
543,
524,
613,
2731,
543,
29874,
25991,
613,
1371,
543,
15176,
29915,
29879,
6588,
2462,
19602,
2322,
29922,
29906,
29900,
29897,
13,
268,
13,
1678,
679,
6069,
4782,
353,
10831,
4782,
29898,
16680,
29892,
376,
2577,
10224,
12146,
3284,
1349,
968,
3987,
679,
3464,
310,
10961,
29879,
491,
2183,
6389,
29889,
1678,
320,
13,
462,
462,
4706,
321,
29889,
29887,
29901,
3017,
623,
29889,
2272,
448,
29928,
29871,
29906,
29900,
29896,
29900,
29900,
29906,
29941,
29896,
21069,
29873,
29871,
29906,
29900,
29962,
21069,
29874,
29871,
29906,
29900,
29962,
21069,
29943,
29871,
29945,
29962,
1159,
13,
1678,
679,
6069,
4782,
29889,
1202,
29918,
3385,
703,
29899,
29878,
613,
376,
489,
657,
29899,
3881,
613,
3158,
543,
8899,
613,
1853,
543,
1807,
613,
2731,
543,
29879,
1293,
613,
1371,
543,
2577,
697,
470,
2473,
10961,
29879,
3464,
29889,
1678,
320,
13,
462,
462,
462,
462,
462,
462,
1678,
321,
29889,
29887,
4898,
29871,
29900,
29900,
29900,
29953,
29945,
29896,
29892,
29900,
29900,
29900,
29955,
29941,
29896,
19602,
2322,
2433,
1495,
13,
1678,
13812,
29889,
1202,
29918,
3385,
29918,
2972,
29898,
657,
6069,
4782,
29897,
13,
268,
13,
1678,
13812,
29889,
1202,
29918,
3385,
29918,
2972,
29898,
657,
25353,
4782,
29897,
13,
1678,
736,
13812,
13,
268,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
396,
29880,
353,
6024,
29906,
29900,
29896,
29945,
3788,
29906,
29900,
29896,
29946,
3788,
29906,
29900,
29896,
29941,
3788,
29906,
29900,
29896,
29906,
3788,
29906,
29900,
29896,
29896,
3788,
29906,
29900,
29896,
29900,
2033,
13,
1678,
396,
1454,
1629,
297,
301,
29901,
13,
1678,
396,
845,
353,
679,
2713,
574,
29950,
1794,
3401,
877,
29906,
29900,
29896,
29945,
1495,
13,
1678,
396,
1678,
528,
353,
679,
2713,
574,
29950,
1794,
3401,
29898,
6360,
29897,
13,
1678,
396,
1678,
679,
2713,
574,
29950,
1794,
15176,
29898,
845,
29897,
13,
1678,
396,
845,
353,
679,
2713,
574,
29950,
1794,
3401,
877,
29906,
29900,
29896,
29945,
1495,
13,
1678,
396,
657,
2713,
574,
29950,
1794,
15176,
29898,
845,
29897,
13,
1678,
12705,
29918,
29879,
353,
5159,
13,
1678,
13812,
353,
6230,
11726,
580,
13,
1678,
313,
6768,
29892,
6389,
29897,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
1678,
565,
3987,
29889,
5504,
29918,
1256,
29901,
13,
4706,
1596,
525,
6422,
2989,
2635,
1051,
2023,
29915,
13,
4706,
4770,
657,
13658,
2539,
29898,
29906,
29900,
29896,
29900,
29892,
29906,
29900,
29896,
29947,
29897,
13,
4706,
1596,
525,
17813,
2023,
29915,
13,
4706,
1596,
525,
6422,
10961,
1051,
2023,
29915,
13,
4706,
2767,
20754,
384,
3399,
1293,
580,
13,
4706,
1596,
525,
17813,
2023,
29915,
13,
1678,
565,
3987,
29889,
5504,
29918,
2997,
29901,
13,
4706,
1596,
525,
6422,
6850,
10961,
29879,
2023,
29915,
13,
4706,
679,
1254,
20754,
384,
580,
13,
4706,
1596,
525,
17813,
2023,
29915,
13,
268,
13,
1678,
565,
3987,
29889,
5504,
29918,
17712,
29901,
13,
4706,
1018,
29901,
13,
9651,
1629,
353,
938,
29898,
6768,
29889,
5504,
29918,
17712,
29897,
13,
4706,
5174,
8960,
29892,
29872,
29901,
13,
9651,
13812,
29889,
2704,
877,
29995,
29879,
338,
451,
263,
1629,
29915,
1273,
3987,
29889,
5504,
29918,
17712,
29897,
13,
4706,
1596,
525,
6422,
10961,
29879,
515,
1273,
29879,
304,
1286,
2023,
29915,
1273,
3987,
29889,
5504,
29918,
17712,
13,
308,
13,
4706,
363,
474,
297,
3464,
29898,
524,
29898,
6360,
511,
6360,
29974,
29896,
1125,
13,
9651,
1596,
525,
6422,
1273,
29879,
20333,
29879,
10961,
29879,
5235,
2023,
29915,
1273,
474,
13,
9651,
2767,
7717,
20570,
29898,
710,
29898,
29875,
511,
29915,
29890,
1495,
13,
4706,
1683,
29901,
13,
9651,
1596,
525,
17813,
2023,
29915,
13,
632,
13,
1678,
565,
3987,
29889,
29879,
2539,
322,
3987,
29889,
3332,
29990,
322,
3987,
29889,
29874,
25991,
29901,
13,
4706,
1018,
29901,
13,
9651,
2635,
29892,
2246,
29990,
29892,
263,
25991,
29892,
4572,
29922,
3987,
29889,
29879,
2539,
29892,
3987,
29889,
3332,
29990,
29892,
3987,
29889,
29874,
25991,
29892,
3987,
29889,
4572,
13,
4706,
5174,
8960,
29892,
29872,
29901,
13,
9651,
13812,
29889,
2704,
703,
3664,
3307,
6389,
23157,
13,
4706,
1018,
29901,
13,
9651,
4175,
353,
5785,
29898,
6768,
29889,
4572,
29897,
13,
4706,
5174,
8960,
29892,
29872,
29901,
13,
9651,
13812,
29889,
2704,
877,
29995,
29879,
338,
451,
263,
5785,
6169,
1273,
3987,
29889,
4572,
29897,
13,
4706,
679,
25353,
29898,
1256,
29892,
2848,
29922,
3332,
29990,
29892,
16700,
29922,
29874,
25991,
29892,
2158,
3744,
29922,
6768,
29889,
29874,
11816,
29892,
4572,
29922,
4572,
29897,
13,
1678,
396,
2870,
29901,
13,
1678,
396,
1678,
13812,
29889,
2704,
703,
3664,
3307,
6389,
23157,
13,
308,
13,
1678,
565,
3987,
29889,
29879,
2539,
322,
3987,
29889,
29872,
2539,
322,
3987,
29889,
29879,
29924,
4992,
322,
3987,
29889,
29886,
4557,
29901,
13,
4706,
269,
2539,
29892,
321,
2539,
29892,
4175,
29892,
269,
29924,
4992,
29892,
282,
4557,
353,
3987,
29889,
29879,
2539,
29892,
3987,
29889,
29872,
2539,
29892,
3987,
29889,
4572,
29892,
3987,
29889,
29879,
29924,
4992,
29892,
3987,
29889,
29886,
4557,
13,
4706,
1207,
2772,
284,
29898,
29879,
2539,
29892,
321,
2539,
29892,
4175,
29892,
19997,
269,
29924,
4992,
29892,
282,
4557,
29897,
13,
268,
13,
1678,
565,
3987,
29889,
29879,
1293,
322,
3987,
29889,
29879,
2539,
29901,
13,
4706,
269,
2539,
29892,
269,
1293,
353,
3987,
29889,
29879,
2539,
29892,
6768,
29889,
29879,
1293,
13,
4706,
1018,
29901,
13,
9651,
301,
353,
269,
1293,
29889,
5451,
29317,
1495,
13,
4706,
5174,
29901,
13,
9651,
13812,
29889,
2704,
877,
18772,
10961,
411,
9162,
1642,
29915,
1273,
3987,
29889,
4572,
29897,
13,
4706,
1596,
679,
6069,
29898,
29880,
29892,
1256,
29922,
29879,
2539,
29892,
3309,
29922,
6768,
29889,
3332,
29990,
29897,
13,
1678,
396,
2158,
4770,
657,
13658,
2539,
29898,
29896,
29929,
29929,
29929,
29892,
29906,
29900,
29896,
29945,
29897,
13,
1678,
396,
657,
20754,
384,
15176,
877,
3616,
29900,
29900,
29900,
29955,
29941,
29929,
1495,
13,
1678,
396,
657,
1254,
20754,
384,
580,
13,
1678,
396,
13318,
353,
679,
25353,
703,
29906,
29900,
29896,
29945,
29900,
29955,
29941,
29900,
613,
2848,
29922,
29906,
29900,
29892,
16700,
29922,
29906,
29900,
29892,
2158,
3744,
29922,
5574,
29897,
13,
1678,
396,
17712,
1761,
353,
6024,
29900,
29900,
29900,
29955,
29941,
29953,
3788,
29900,
29900,
29906,
29955,
29941,
29945,
3788,
29900,
29900,
29906,
29941,
29906,
29941,
3788,
29953,
29900,
29941,
29900,
29900,
29953,
3788,
29900,
29900,
29906,
29953,
29955,
29929,
3788,
29900,
29900,
29900,
29900,
29906,
29945,
3788,
29953,
29900,
29941,
29906,
29953,
29947,
3788,
29900,
29900,
29906,
29953,
29947,
29900,
3788,
29953,
29900,
29941,
29900,
29900,
29929,
2033,
13,
1678,
396,
2158,
679,
6069,
29898,
17712,
1761,
29892,
1256,
2433,
29906,
29900,
29896,
29945,
29900,
29955,
29941,
29900,
742,
3309,
29922,
29906,
29900,
29897,
13,
1678,
396,
2158,
1900,
13,
1678,
396,
5675,
2772,
284,
877,
29906,
29900,
29896,
29945,
29900,
29955,
29896,
29945,
3788,
29906,
29900,
29896,
29945,
29900,
29955,
29941,
29900,
742,
19997,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
29871,
29945,
29897,
13,
1678,
396,
29885,
4992,
353,
1207,
2772,
284,
703,
29906,
29900,
29896,
29945,
29900,
29955,
29906,
29900,
613,
376,
29906,
29900,
29896,
29945,
29900,
29955,
29906,
29946,
613,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
10961,
23945,
29922,
29906,
29897,
13,
1678,
396,
5504,
7717,
20570,
877,
29906,
29900,
29896,
29945,
3788,
29890,
1495,
13,
1678,
396,
5504,
20754,
384,
3399,
1293,
580,
13,
308,
13,
308,
13,
308,
13,
308,
2
] |
tests/mod_todo_tests.py | rockyhandsm2k/website | 0 | 79188 | from tests.app_tests import BaseTestCase
from app.mod_todo.models import *
from flask import url_for
import datetime
TODO = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ille enim occurrentia nescio quae comminiscebatur; Sin tantum modo ad indicia veteris memoriae cognoscenda, curiosorum. Duo Reges: constructio interrete. Tollenda est atque extrahenda radicitus. Atque ego: Scis me, inquam, istud idem sentire, Piso, sed a te opportune facta mentio est.'
TODO2 = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ille enim occurrentia nescio quae comminiscebatur; Sin tantum modo'
CATEGORY = 'Category'
PRIORITY = 'Priority'
DO_BEFORE = datetime.date(2020, 12, 12)
class TestTodo(BaseTestCase):
@classmethod
def setUpClass(cls):
cls.disable_login = True
super().setUpClass()
cls.url = url_for('adminpanel.configure_module', bp_name='todo')
TodoCategory.create(category=CATEGORY)
TodoPriority.create(name=PRIORITY, priority=0)
def create_todo_item(self, todo, category_id, priority_id, do_before):
return self.client.post(url_for('todo.index'), data=dict(
todo=todo,
category=category_id,
priority=priority_id,
do_before=do_before,
create='Create'
))
def delete_todo_items(self, todo_ids):
return self.client.get(url_for('todo.index', delete=','.join([str(x) for x in todo_ids])))
def complete_todo_items(self, todo_ids):
return self.client.get(url_for('todo.index', complete=','.join([str(x) for x in todo_ids])))
def test_create_todo_item(self):
# Test adding an item
self.create_todo_item(TODO, 1, 1, DO_BEFORE)
todo_item = Todo.query.filter_by(todo=TODO).first()
self.assertIsInstance(todo_item, Todo)
self.assertEquals(todo_item.category_id, 1)
self.assertEquals(todo_item.priority_id, 1)
self.assertEquals(todo_item.do_before.date(), DO_BEFORE)
# Test that adding an empty item fails
self.create_todo_item('', 1, 1, DO_BEFORE)
todo_item = Todo.query.filter_by(todo='').first()
self.assertIsNone(todo_item)
def test_delete_todo_item(self):
# Test deleting a single item
self.create_todo_item(TODO, 1, 1, DO_BEFORE)
self.delete_todo_items([1])
todo = Todo.query.filter_by(id=1).first()
self.assertIsNone(todo)
# Test deleting multiple items
self.create_todo_item(TODO, 1, 1, DO_BEFORE)
self.create_todo_item(TODO2, 1, 1, DO_BEFORE)
self.delete_todo_items([2, 3])
todo = Todo.query.filter(Todo.id.in_([2, 3])).all()
self.assertEquals(todo, [])
def test_complete_todo_item(self):
# Test completing a single item
self.create_todo_item(TODO, 1, 1, DO_BEFORE)
self.complete_todo_items([1])
todo = Todo.query.filter_by(id=1).first()
timedelta = datetime.datetime.now() - todo.completed_on
self.assertLess(timedelta, datetime.timedelta(seconds=0.1))
# Test trying to complete the same item again doesn't change the closed on time.
old_completed_on = todo.completed_on
self.complete_todo_items([1])
todo = Todo.query.filter_by(id=1).first()
self.assertEquals(old_completed_on, todo.completed_on)
# Test completing multiple items
self.create_todo_item(TODO, 1, 1, DO_BEFORE)
self.create_todo_item(TODO2, 1, 1, DO_BEFORE)
self.complete_todo_items([2, 3])
todo = Todo.query.filter(Todo.id.in_([2, 3])).all()
for item in todo:
self.assertIsNotNone(item.completed_on) | [
1,
515,
6987,
29889,
932,
29918,
21150,
1053,
7399,
3057,
8259,
13,
3166,
623,
29889,
1545,
29918,
29873,
8144,
29889,
9794,
1053,
334,
13,
3166,
29784,
1053,
3142,
29918,
1454,
13,
5215,
12865,
13,
13,
4986,
3970,
353,
525,
29931,
3668,
23421,
22224,
7845,
27315,
29892,
5178,
312,
300,
332,
594,
666,
275,
3277,
560,
277,
29889,
1720,
280,
427,
326,
2179,
1264,
423,
302,
267,
3934,
439,
3660,
844,
262,
17438,
29890,
1337,
29936,
8882,
11172,
398,
13963,
594,
4221,
423,
25808,
275,
2626,
4108,
29872,
25323,
14174,
8395,
29892,
20301,
17220,
29889,
5334,
29877,
2169,
267,
29901,
3386,
601,
1006,
276,
371,
29889,
323,
3028,
8395,
707,
472,
802,
4805,
29882,
8395,
2971,
293,
277,
375,
29889,
2180,
802,
321,
1484,
29901,
2522,
275,
592,
29892,
25501,
314,
29892,
1752,
566,
1957,
29885,
2665,
533,
29892,
349,
10718,
29892,
7048,
263,
734,
11406,
1540,
2114,
29874,
6042,
601,
707,
6169,
13,
4986,
3970,
29906,
353,
525,
29931,
3668,
23421,
22224,
7845,
27315,
29892,
5178,
312,
300,
332,
594,
666,
275,
3277,
560,
277,
29889,
1720,
280,
427,
326,
2179,
1264,
423,
302,
267,
3934,
439,
3660,
844,
262,
17438,
29890,
1337,
29936,
8882,
11172,
398,
13963,
29915,
13,
29907,
3040,
29954,
18929,
353,
525,
10900,
29915,
13,
29829,
1955,
11937,
353,
525,
29925,
21766,
29915,
13,
3970,
29918,
15349,
5800,
1525,
353,
12865,
29889,
1256,
29898,
29906,
29900,
29906,
29900,
29892,
29871,
29896,
29906,
29892,
29871,
29896,
29906,
29897,
13,
13,
13,
1990,
4321,
29911,
8144,
29898,
5160,
3057,
8259,
1125,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
731,
3373,
2385,
29898,
25932,
1125,
13,
4706,
1067,
29879,
29889,
20472,
29918,
7507,
353,
5852,
13,
4706,
2428,
2141,
842,
3373,
2385,
580,
13,
4706,
1067,
29879,
29889,
2271,
353,
3142,
29918,
1454,
877,
6406,
15119,
29889,
17591,
29918,
5453,
742,
289,
29886,
29918,
978,
2433,
29873,
8144,
1495,
13,
4706,
7561,
29877,
10900,
29889,
3258,
29898,
7320,
29922,
29907,
3040,
29954,
18929,
29897,
13,
4706,
7561,
29877,
29925,
21766,
29889,
3258,
29898,
978,
29922,
29829,
1955,
11937,
29892,
20136,
29922,
29900,
29897,
13,
13,
1678,
822,
1653,
29918,
29873,
8144,
29918,
667,
29898,
1311,
29892,
10481,
29892,
7663,
29918,
333,
29892,
20136,
29918,
333,
29892,
437,
29918,
11083,
1125,
13,
4706,
736,
1583,
29889,
4645,
29889,
2490,
29898,
2271,
29918,
1454,
877,
29873,
8144,
29889,
2248,
5477,
848,
29922,
8977,
29898,
13,
9651,
10481,
29922,
29873,
8144,
29892,
13,
9651,
7663,
29922,
7320,
29918,
333,
29892,
13,
9651,
20136,
29922,
29886,
21766,
29918,
333,
29892,
13,
9651,
437,
29918,
11083,
29922,
1867,
29918,
11083,
29892,
13,
9651,
1653,
2433,
4391,
29915,
13,
308,
876,
13,
13,
1678,
822,
5217,
29918,
29873,
8144,
29918,
7076,
29898,
1311,
29892,
10481,
29918,
4841,
1125,
13,
4706,
736,
1583,
29889,
4645,
29889,
657,
29898,
2271,
29918,
1454,
877,
29873,
8144,
29889,
2248,
742,
5217,
29922,
3788,
29889,
7122,
4197,
710,
29898,
29916,
29897,
363,
921,
297,
10481,
29918,
4841,
29962,
4961,
13,
13,
1678,
822,
4866,
29918,
29873,
8144,
29918,
7076,
29898,
1311,
29892,
10481,
29918,
4841,
1125,
13,
4706,
736,
1583,
29889,
4645,
29889,
657,
29898,
2271,
29918,
1454,
877,
29873,
8144,
29889,
2248,
742,
4866,
29922,
3788,
29889,
7122,
4197,
710,
29898,
29916,
29897,
363,
921,
297,
10481,
29918,
4841,
29962,
4961,
13,
13,
1678,
822,
1243,
29918,
3258,
29918,
29873,
8144,
29918,
667,
29898,
1311,
1125,
13,
4706,
396,
4321,
4417,
385,
2944,
13,
4706,
1583,
29889,
3258,
29918,
29873,
8144,
29918,
667,
29898,
4986,
3970,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
11662,
29918,
15349,
5800,
1525,
29897,
13,
4706,
10481,
29918,
667,
353,
7561,
29877,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
29873,
8144,
29922,
4986,
3970,
467,
4102,
580,
13,
4706,
1583,
29889,
9294,
3624,
4998,
29898,
29873,
8144,
29918,
667,
29892,
7561,
29877,
29897,
13,
4706,
1583,
29889,
9294,
14776,
29898,
29873,
8144,
29918,
667,
29889,
7320,
29918,
333,
29892,
29871,
29896,
29897,
13,
4706,
1583,
29889,
9294,
14776,
29898,
29873,
8144,
29918,
667,
29889,
29886,
21766,
29918,
333,
29892,
29871,
29896,
29897,
13,
4706,
1583,
29889,
9294,
14776,
29898,
29873,
8144,
29918,
667,
29889,
1867,
29918,
11083,
29889,
1256,
3285,
11662,
29918,
15349,
5800,
1525,
29897,
13,
4706,
396,
4321,
393,
4417,
385,
4069,
2944,
8465,
13,
4706,
1583,
29889,
3258,
29918,
29873,
8144,
29918,
667,
877,
742,
29871,
29896,
29892,
29871,
29896,
29892,
11662,
29918,
15349,
5800,
1525,
29897,
13,
4706,
10481,
29918,
667,
353,
7561,
29877,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
29873,
8144,
2433,
2824,
4102,
580,
13,
4706,
1583,
29889,
9294,
3624,
8516,
29898,
29873,
8144,
29918,
667,
29897,
13,
13,
1678,
822,
1243,
29918,
8143,
29918,
29873,
8144,
29918,
667,
29898,
1311,
1125,
13,
4706,
396,
4321,
21228,
263,
2323,
2944,
13,
4706,
1583,
29889,
3258,
29918,
29873,
8144,
29918,
667,
29898,
4986,
3970,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
11662,
29918,
15349,
5800,
1525,
29897,
13,
4706,
1583,
29889,
8143,
29918,
29873,
8144,
29918,
7076,
4197,
29896,
2314,
13,
4706,
10481,
353,
7561,
29877,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
333,
29922,
29896,
467,
4102,
580,
13,
4706,
1583,
29889,
9294,
3624,
8516,
29898,
29873,
8144,
29897,
13,
4706,
396,
4321,
21228,
2999,
4452,
13,
4706,
1583,
29889,
3258,
29918,
29873,
8144,
29918,
667,
29898,
4986,
3970,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
11662,
29918,
15349,
5800,
1525,
29897,
13,
4706,
1583,
29889,
3258,
29918,
29873,
8144,
29918,
667,
29898,
4986,
3970,
29906,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
11662,
29918,
15349,
5800,
1525,
29897,
13,
4706,
1583,
29889,
8143,
29918,
29873,
8144,
29918,
7076,
4197,
29906,
29892,
29871,
29941,
2314,
13,
4706,
10481,
353,
7561,
29877,
29889,
1972,
29889,
4572,
29898,
29911,
8144,
29889,
333,
29889,
262,
29918,
4197,
29906,
29892,
29871,
29941,
2314,
467,
497,
580,
13,
4706,
1583,
29889,
9294,
14776,
29898,
29873,
8144,
29892,
518,
2314,
13,
13,
1678,
822,
1243,
29918,
8835,
29918,
29873,
8144,
29918,
667,
29898,
1311,
1125,
13,
4706,
396,
4321,
1614,
1259,
263,
2323,
2944,
13,
4706,
1583,
29889,
3258,
29918,
29873,
8144,
29918,
667,
29898,
4986,
3970,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
11662,
29918,
15349,
5800,
1525,
29897,
13,
4706,
1583,
29889,
8835,
29918,
29873,
8144,
29918,
7076,
4197,
29896,
2314,
13,
4706,
10481,
353,
7561,
29877,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
333,
29922,
29896,
467,
4102,
580,
13,
4706,
5335,
287,
2554,
353,
12865,
29889,
12673,
29889,
3707,
580,
448,
10481,
29889,
5729,
9446,
29918,
265,
13,
4706,
1583,
29889,
9294,
29931,
404,
29898,
9346,
287,
2554,
29892,
12865,
29889,
9346,
287,
2554,
29898,
23128,
29922,
29900,
29889,
29896,
876,
13,
4706,
396,
4321,
1811,
304,
4866,
278,
1021,
2944,
1449,
1838,
29915,
29873,
1735,
278,
5764,
373,
931,
29889,
13,
4706,
2030,
29918,
5729,
9446,
29918,
265,
353,
10481,
29889,
5729,
9446,
29918,
265,
13,
4706,
1583,
29889,
8835,
29918,
29873,
8144,
29918,
7076,
4197,
29896,
2314,
13,
4706,
10481,
353,
7561,
29877,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
333,
29922,
29896,
467,
4102,
580,
13,
4706,
1583,
29889,
9294,
14776,
29898,
1025,
29918,
5729,
9446,
29918,
265,
29892,
10481,
29889,
5729,
9446,
29918,
265,
29897,
13,
4706,
396,
4321,
1614,
1259,
2999,
4452,
13,
4706,
1583,
29889,
3258,
29918,
29873,
8144,
29918,
667,
29898,
4986,
3970,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
11662,
29918,
15349,
5800,
1525,
29897,
13,
4706,
1583,
29889,
3258,
29918,
29873,
8144,
29918,
667,
29898,
4986,
3970,
29906,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
11662,
29918,
15349,
5800,
1525,
29897,
13,
4706,
1583,
29889,
8835,
29918,
29873,
8144,
29918,
7076,
4197,
29906,
29892,
29871,
29941,
2314,
13,
4706,
10481,
353,
7561,
29877,
29889,
1972,
29889,
4572,
29898,
29911,
8144,
29889,
333,
29889,
262,
29918,
4197,
29906,
29892,
29871,
29941,
2314,
467,
497,
580,
13,
4706,
363,
2944,
297,
10481,
29901,
13,
9651,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
667,
29889,
5729,
9446,
29918,
265,
29897,
2
] |
research/width_control.py | HewJhong/1st_Day_Hack | 1 | 106987 | import streamlit as st
def select_block_container_style():
"""Add selection section for setting setting the max-width and padding
of the main block container"""
st.sidebar.header("Block Container Style")
max_width_100_percent = st.sidebar.checkbox("Max-width: 100%?", False)
if not max_width_100_percent:
max_width = st.sidebar.slider("Select max-width in px", 100, 2000, 1200, 100)
else:
max_width = 1200
dark_theme = st.sidebar.checkbox("Dark Theme?", False)
padding_top = st.sidebar.number_input("Select padding top in rem", 0, 200, 5, 1)
padding_right = st.sidebar.number_input("Select padding right in rem", 0, 200, 1, 1)
padding_left = st.sidebar.number_input("Select padding left in rem", 0, 200, 1, 1)
padding_bottom = st.sidebar.number_input(
"Select padding bottom in rem", 0, 200, 10, 1
)
if dark_theme:
BACKGROUND_COLOR = "rgb(17,17,17)"
COLOR = "#fff"
else:
BACKGROUND_COLOR = "rgb(255,255,255)"
COLOR = "#000"
_set_block_container_style(
BACKGROUND_COLOR,
COLOR,
max_width,
max_width_100_percent,
padding_top,
padding_right,
padding_left,
padding_bottom,
)
def _set_block_container_style(
bg_color: str,
color: str,
max_width: int = 1000,
max_width_100_percent: bool = False,
padding_top: int = 5,
padding_right: int = 1,
padding_left: int = 1,
padding_bottom: int = 10,
):
if max_width_100_percent:
max_width_str = f"max-width: 100%;"
else:
max_width_str = f"max-width: {max_width}px;"
st.markdown(
f"""
<style>
.reportview-container .main .block-container{{
{max_width_str}
padding-top: {padding_top}rem;
padding-right: {padding_right}rem;
padding-left: {padding_left}rem;
padding-bottom: {padding_bottom}rem;
}}
.reportview-container .main {{
color: {color};
background-color: {bg_color};
}}
</style>
""",
unsafe_allow_html=True,
)
| [
1,
1053,
4840,
19411,
408,
380,
13,
13,
1753,
1831,
29918,
1271,
29918,
7611,
29918,
3293,
7295,
13,
1678,
9995,
2528,
9262,
4004,
363,
4444,
4444,
278,
4236,
29899,
2103,
322,
7164,
13,
1678,
310,
278,
1667,
2908,
5639,
15945,
29908,
13,
1678,
380,
29889,
2975,
1646,
29889,
6672,
703,
7445,
21679,
22135,
1159,
13,
1678,
4236,
29918,
2103,
29918,
29896,
29900,
29900,
29918,
25376,
353,
380,
29889,
2975,
1646,
29889,
12348,
703,
7976,
29899,
2103,
29901,
29871,
29896,
29900,
29900,
29995,
29973,
613,
7700,
29897,
13,
1678,
565,
451,
4236,
29918,
2103,
29918,
29896,
29900,
29900,
29918,
25376,
29901,
13,
4706,
4236,
29918,
2103,
353,
380,
29889,
2975,
1646,
29889,
23165,
703,
3549,
4236,
29899,
2103,
297,
282,
29916,
613,
29871,
29896,
29900,
29900,
29892,
29871,
29906,
29900,
29900,
29900,
29892,
29871,
29896,
29906,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29897,
13,
1678,
1683,
29901,
13,
4706,
4236,
29918,
2103,
353,
29871,
29896,
29906,
29900,
29900,
13,
1678,
6501,
29918,
18193,
353,
380,
29889,
2975,
1646,
29889,
12348,
703,
29928,
935,
498,
2004,
29973,
613,
7700,
29897,
13,
1678,
7164,
29918,
3332,
353,
380,
29889,
2975,
1646,
29889,
4537,
29918,
2080,
703,
3549,
7164,
2246,
297,
1083,
613,
29871,
29900,
29892,
29871,
29906,
29900,
29900,
29892,
29871,
29945,
29892,
29871,
29896,
29897,
13,
1678,
7164,
29918,
1266,
353,
380,
29889,
2975,
1646,
29889,
4537,
29918,
2080,
703,
3549,
7164,
1492,
297,
1083,
613,
29871,
29900,
29892,
29871,
29906,
29900,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
1678,
7164,
29918,
1563,
353,
380,
29889,
2975,
1646,
29889,
4537,
29918,
2080,
703,
3549,
7164,
2175,
297,
1083,
613,
29871,
29900,
29892,
29871,
29906,
29900,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
1678,
7164,
29918,
8968,
353,
380,
29889,
2975,
1646,
29889,
4537,
29918,
2080,
29898,
13,
4706,
376,
3549,
7164,
5970,
297,
1083,
613,
29871,
29900,
29892,
29871,
29906,
29900,
29900,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
13,
1678,
1723,
13,
1678,
565,
6501,
29918,
18193,
29901,
13,
4706,
350,
11375,
29954,
1672,
18783,
29918,
15032,
1955,
353,
376,
23973,
29898,
29896,
29955,
29892,
29896,
29955,
29892,
29896,
29955,
5513,
13,
4706,
23958,
1955,
353,
12305,
18725,
29908,
13,
13,
1678,
1683,
29901,
13,
4706,
350,
11375,
29954,
1672,
18783,
29918,
15032,
1955,
353,
376,
23973,
29898,
29906,
29945,
29945,
29892,
29906,
29945,
29945,
29892,
29906,
29945,
29945,
5513,
13,
4706,
23958,
1955,
353,
12305,
29900,
29900,
29900,
29908,
13,
13,
1678,
903,
842,
29918,
1271,
29918,
7611,
29918,
3293,
29898,
13,
4706,
350,
11375,
29954,
1672,
18783,
29918,
15032,
1955,
29892,
13,
4706,
23958,
1955,
29892,
13,
4706,
4236,
29918,
2103,
29892,
13,
4706,
4236,
29918,
2103,
29918,
29896,
29900,
29900,
29918,
25376,
29892,
13,
4706,
7164,
29918,
3332,
29892,
13,
4706,
7164,
29918,
1266,
29892,
13,
4706,
7164,
29918,
1563,
29892,
13,
4706,
7164,
29918,
8968,
29892,
13,
1678,
1723,
13,
13,
13,
1753,
903,
842,
29918,
1271,
29918,
7611,
29918,
3293,
29898,
13,
1678,
25989,
29918,
2780,
29901,
851,
29892,
13,
1678,
2927,
29901,
851,
29892,
13,
1678,
4236,
29918,
2103,
29901,
938,
353,
29871,
29896,
29900,
29900,
29900,
29892,
13,
1678,
4236,
29918,
2103,
29918,
29896,
29900,
29900,
29918,
25376,
29901,
6120,
353,
7700,
29892,
13,
1678,
7164,
29918,
3332,
29901,
938,
353,
29871,
29945,
29892,
13,
1678,
7164,
29918,
1266,
29901,
938,
353,
29871,
29896,
29892,
13,
1678,
7164,
29918,
1563,
29901,
938,
353,
29871,
29896,
29892,
13,
1678,
7164,
29918,
8968,
29901,
938,
353,
29871,
29896,
29900,
29892,
13,
1125,
13,
1678,
565,
4236,
29918,
2103,
29918,
29896,
29900,
29900,
29918,
25376,
29901,
13,
4706,
4236,
29918,
2103,
29918,
710,
353,
285,
29908,
3317,
29899,
2103,
29901,
29871,
29896,
29900,
29900,
8874,
29908,
13,
1678,
1683,
29901,
13,
4706,
4236,
29918,
2103,
29918,
710,
353,
285,
29908,
3317,
29899,
2103,
29901,
426,
3317,
29918,
2103,
29913,
1756,
15458,
13,
1678,
380,
29889,
3502,
3204,
29898,
13,
4706,
285,
15945,
29908,
13,
29966,
3293,
29958,
13,
1678,
869,
12276,
1493,
29899,
7611,
869,
3396,
869,
1271,
29899,
7611,
6224,
13,
4706,
426,
3317,
29918,
2103,
29918,
710,
29913,
13,
4706,
7164,
29899,
3332,
29901,
426,
12791,
29918,
3332,
29913,
1745,
29936,
13,
4706,
7164,
29899,
1266,
29901,
426,
12791,
29918,
1266,
29913,
1745,
29936,
13,
4706,
7164,
29899,
1563,
29901,
426,
12791,
29918,
1563,
29913,
1745,
29936,
13,
4706,
7164,
29899,
8968,
29901,
426,
12791,
29918,
8968,
29913,
1745,
29936,
13,
1678,
9156,
13,
1678,
869,
12276,
1493,
29899,
7611,
869,
3396,
8620,
13,
4706,
2927,
29901,
426,
2780,
3400,
13,
4706,
3239,
29899,
2780,
29901,
426,
16264,
29918,
2780,
3400,
13,
1678,
9156,
13,
829,
3293,
29958,
13,
15945,
613,
13,
4706,
25110,
29918,
9536,
29918,
1420,
29922,
5574,
29892,
13,
1678,
1723,
13,
2
] |
Part5/varargs3.py | BaiMoHan/LearningPython_ING_202002 | 0 | 111934 | <reponame>BaiMoHan/LearningPython_ING_202002
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/2/14 14:58
# @Author : Baimohan/PH
# @Site : https://github.com/BaiMoHan
# @File : varargs3.py
# @Software: PyCharm
def test(x, y, z=3, *books, **scores): # **代表收集关键字参数
print(x, y, z)
print(books) # 收集参数保存的是元组
print(scores) # 对于关键字参数保存的是字典形式
if __name__ == '__main__':
test(1, 2, 3, 'fluent phthon', 'first python', Chinese=89, Math=36)
test(1, 2, Chinese=88, Englishi=88) | [
1,
529,
276,
1112,
420,
29958,
29933,
1794,
22638,
29950,
273,
29914,
29931,
799,
1076,
11980,
29918,
4214,
29918,
29906,
29900,
29906,
29900,
29900,
29906,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
732,
2481,
1678,
584,
29871,
29906,
29900,
29906,
29900,
29914,
29906,
29914,
29896,
29946,
29871,
29896,
29946,
29901,
29945,
29947,
13,
29937,
732,
13720,
29871,
584,
6000,
326,
1148,
273,
29914,
19689,
13,
29937,
732,
17033,
1678,
584,
2045,
597,
3292,
29889,
510,
29914,
29933,
1794,
22638,
29950,
273,
13,
29937,
732,
2283,
1678,
584,
722,
5085,
29941,
29889,
2272,
13,
29937,
732,
6295,
14093,
29901,
10772,
1451,
2817,
13,
13,
13,
1753,
1243,
29898,
29916,
29892,
343,
29892,
503,
29922,
29941,
29892,
334,
12733,
29892,
3579,
1557,
2361,
1125,
396,
3579,
30690,
30746,
31997,
30893,
31057,
236,
151,
177,
30578,
31125,
30354,
13,
1678,
1596,
29898,
29916,
29892,
343,
29892,
503,
29897,
13,
1678,
1596,
29898,
12733,
29897,
1678,
396,
29871,
31997,
30893,
31125,
30354,
30982,
30946,
30210,
30392,
30824,
31263,
13,
1678,
1596,
29898,
1557,
2361,
29897,
259,
396,
29871,
30783,
30909,
31057,
236,
151,
177,
30578,
31125,
30354,
30982,
30946,
30210,
30392,
30578,
31259,
31305,
30607,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1243,
29898,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
525,
1579,
8122,
1374,
386,
265,
742,
525,
4102,
3017,
742,
10013,
29922,
29947,
29929,
29892,
5792,
29922,
29941,
29953,
29897,
13,
1678,
1243,
29898,
29896,
29892,
29871,
29906,
29892,
10013,
29922,
29947,
29947,
29892,
4223,
29875,
29922,
29947,
29947,
29897,
2
] |
Python3-world2/ex068.py | samirsaravia/Python_101 | 0 | 38161 | <filename>Python3-world2/ex068.py
import random
title = 'par ou ímpar'.upper()
print('~~' * 10)
print(f'\033[7;30m{title:^20}\033[m')
print('~~' * 10)
# poi = par ou impar
# vop = vitoria ou perda
poi = vop = ''
cont = 0
while True:
cont += 1
escolha_numero = int(input('Digite um número: '))
escolha_parinpar = str(input('Par ou Impar[P/I]: ')).strip().upper()[0]
en = escolha_numero
epi = escolha_parinpar
# npc = numero do pc
npc = random.randint(1, 100)
soma = npc + en
if soma % 2 == 0:
poi = 'par'
else:
poi = 'ímpar'
if soma % 2 == 0 and epi in 'Pp' or soma % 2 != 0 and epi in 'Ii':
vop = '\033[1;32mganhou\033[m'
else:
vop = '\033[1;31mperdeu\033[m'
break
print(f'O numero escolhido pelo pc foi : {npc}')
print(f'A soma foi: \033[1;33m{soma}\033[m')
print(f'Você {vop}, deu \033[1;33m{poi}\033[m')
print('---' * 10)
print(f'O numero escolhido pelo pc foi : {npc}')
print(f'A soma foi: \033[1;33m{soma}\033[m')
if cont > 1:
print(f'Depois de {cont - 1} vezes seguidas, ', end='')
print(f'Você {vop}, deu \033[1;33m{poi}')
| [
1,
529,
9507,
29958,
11980,
29941,
29899,
11526,
29906,
29914,
735,
29900,
29953,
29947,
29889,
2272,
13,
5215,
4036,
13,
3257,
353,
525,
862,
2123,
29871,
5487,
862,
4286,
21064,
580,
13,
2158,
877,
7377,
29915,
334,
29871,
29896,
29900,
29897,
13,
2158,
29898,
29888,
12764,
29900,
29941,
29941,
29961,
29955,
29936,
29941,
29900,
29885,
29912,
3257,
29901,
29985,
29906,
29900,
1012,
29900,
29941,
29941,
29961,
29885,
1495,
13,
2158,
877,
7377,
29915,
334,
29871,
29896,
29900,
29897,
13,
29937,
11899,
353,
610,
2123,
527,
862,
13,
29937,
325,
459,
353,
325,
2105,
423,
2123,
639,
1388,
13,
1129,
29875,
353,
325,
459,
353,
6629,
13,
1285,
353,
29871,
29900,
13,
8000,
5852,
29901,
13,
1678,
640,
4619,
29871,
29896,
13,
1678,
25224,
2350,
29918,
1949,
1489,
353,
938,
29898,
2080,
877,
14991,
568,
1922,
13831,
29901,
525,
876,
13,
1678,
25224,
2350,
29918,
862,
262,
862,
353,
851,
29898,
2080,
877,
2177,
2123,
1954,
862,
29961,
29925,
29914,
29902,
5387,
525,
8106,
17010,
2141,
21064,
580,
29961,
29900,
29962,
13,
1678,
427,
353,
25224,
2350,
29918,
1949,
1489,
13,
1678,
321,
1631,
353,
25224,
2350,
29918,
862,
262,
862,
13,
1678,
396,
302,
6739,
353,
17910,
437,
22844,
13,
1678,
302,
6739,
353,
4036,
29889,
9502,
524,
29898,
29896,
29892,
29871,
29896,
29900,
29900,
29897,
13,
1678,
1047,
29874,
353,
302,
6739,
718,
427,
13,
1678,
565,
1047,
29874,
1273,
29871,
29906,
1275,
29871,
29900,
29901,
13,
4706,
11899,
353,
525,
862,
29915,
13,
1678,
1683,
29901,
13,
4706,
11899,
353,
525,
5487,
862,
29915,
13,
1678,
565,
1047,
29874,
1273,
29871,
29906,
1275,
29871,
29900,
322,
321,
1631,
297,
525,
29925,
29886,
29915,
470,
1047,
29874,
1273,
29871,
29906,
2804,
29871,
29900,
322,
321,
1631,
297,
525,
29902,
29875,
2396,
13,
4706,
325,
459,
353,
11297,
29900,
29941,
29941,
29961,
29896,
29936,
29941,
29906,
29885,
6249,
10774,
29905,
29900,
29941,
29941,
29961,
29885,
29915,
13,
1678,
1683,
29901,
13,
4706,
325,
459,
353,
11297,
29900,
29941,
29941,
29961,
29896,
29936,
29941,
29896,
29885,
546,
311,
29884,
29905,
29900,
29941,
29941,
29961,
29885,
29915,
13,
4706,
2867,
13,
1678,
1596,
29898,
29888,
29915,
29949,
17910,
25224,
29882,
1941,
10845,
22844,
4732,
584,
426,
29876,
6739,
29913,
1495,
13,
1678,
1596,
29898,
29888,
29915,
29909,
1047,
29874,
4732,
29901,
320,
29900,
29941,
29941,
29961,
29896,
29936,
29941,
29941,
29885,
29912,
29879,
4125,
1012,
29900,
29941,
29941,
29961,
29885,
1495,
13,
1678,
1596,
29898,
29888,
29915,
29963,
542,
30037,
426,
29894,
459,
1118,
316,
29884,
320,
29900,
29941,
29941,
29961,
29896,
29936,
29941,
29941,
29885,
29912,
1129,
29875,
1012,
29900,
29941,
29941,
29961,
29885,
1495,
13,
1678,
1596,
877,
5634,
29915,
334,
29871,
29896,
29900,
29897,
13,
2158,
29898,
29888,
29915,
29949,
17910,
25224,
29882,
1941,
10845,
22844,
4732,
584,
426,
29876,
6739,
29913,
1495,
13,
2158,
29898,
29888,
29915,
29909,
1047,
29874,
4732,
29901,
320,
29900,
29941,
29941,
29961,
29896,
29936,
29941,
29941,
29885,
29912,
29879,
4125,
1012,
29900,
29941,
29941,
29961,
29885,
1495,
13,
361,
640,
1405,
29871,
29896,
29901,
13,
1678,
1596,
29898,
29888,
29915,
8498,
11505,
316,
426,
1285,
448,
29871,
29896,
29913,
7763,
267,
2377,
5416,
294,
29892,
13420,
1095,
2433,
1495,
13,
2158,
29898,
29888,
29915,
29963,
542,
30037,
426,
29894,
459,
1118,
316,
29884,
320,
29900,
29941,
29941,
29961,
29896,
29936,
29941,
29941,
29885,
29912,
1129,
29875,
29913,
1495,
13,
2
] |
pedantic/decorators/fn_deco_pedantic.py | LostInDarkMath/Pedantic-python-decorators | 15 | 109204 | from functools import wraps
from typing import Any, Optional
from pedantic.type_checking_logic.check_docstring import _check_docstring
from pedantic.constants import ReturnType, F
from pedantic.models.decorated_function import DecoratedFunction
from pedantic.models.function_call import FunctionCall
from pedantic.env_var_logic import is_enabled
def pedantic(func: Optional[F] = None, require_docstring: bool = False) -> F:
"""
A PedanticException is raised if one of the following happened:
- The decorated function is called with positional arguments.
- The function has no type annotation for their return type or one or more parameters do not have type
annotations.
- A type annotation is incorrect.
- A type annotation misses type arguments, e.g. typing.List instead of typing.List[int].
- The documented arguments do not match the argument list or their type annotations.
Example:
>>> @pedantic
... def my_function(a: int, b: float, c: str) -> bool:
... return float(a) == b and str(b) == c
>>> my_function(a=42.0, b=14.0, c='hi')
Traceback (most recent call last):
...
pedantic.exceptions.PedanticTypeCheckException: In function my_function:
Type hint is incorrect: Argument a=42.0 of type <class 'float'> does not match expected type <class 'int'>.
>>> my_function(a=42, b=None, c='hi')
Traceback (most recent call last):
...
pedantic.exceptions.PedanticTypeCheckException: In function my_function:
Type hint is incorrect: Argument b=None of type <class 'NoneType'> does not match expected type <class 'float'>.
>>> my_function(a=42, b=42, c='hi')
Traceback (most recent call last):
...
pedantic.exceptions.PedanticTypeCheckException: In function my_function:
Type hint is incorrect: Argument b=42 of type <class 'int'> does not match expected type <class 'float'>.
>>> my_function(5, 4.0, 'hi')
Traceback (most recent call last):
...
pedantic.exceptions.PedanticCallWithArgsException: In function my_function:
Use kwargs when you call function my_function. Args: (5, 4.0, 'hi')
"""
def decorator(f: F) -> F:
if not is_enabled():
return f
decorated_func = DecoratedFunction(func=f)
if require_docstring or len(decorated_func.docstring.params) > 0:
_check_docstring(decorated_func=decorated_func)
@wraps(f)
def wrapper(*args: Any, **kwargs: Any) -> ReturnType:
call = FunctionCall(func=decorated_func, args=args, kwargs=kwargs)
call.assert_uses_kwargs()
return call.check_types()
async def async_wrapper(*args: Any, **kwargs: Any) -> ReturnType:
call = FunctionCall(func=decorated_func, args=args, kwargs=kwargs)
call.assert_uses_kwargs()
return await call.async_check_types()
if decorated_func.is_coroutine:
return async_wrapper
else:
return wrapper
return decorator if func is None else decorator(f=func)
def pedantic_require_docstring(func: Optional[F] = None) -> F:
"""Shortcut for @pedantic(require_docstring=True) """
return pedantic(func=func, require_docstring=True)
if __name__ == "__main__":
import doctest
doctest.testmod(verbose=False, optionflags=doctest.ELLIPSIS)
| [
1,
515,
2090,
312,
8789,
1053,
11463,
567,
13,
3166,
19229,
1053,
3139,
29892,
28379,
13,
13,
3166,
8939,
7716,
29889,
1853,
29918,
3198,
292,
29918,
19227,
29889,
3198,
29918,
1514,
1807,
1053,
903,
3198,
29918,
1514,
1807,
13,
3166,
8939,
7716,
29889,
3075,
1934,
1053,
7106,
1542,
29892,
383,
13,
3166,
8939,
7716,
29889,
9794,
29889,
19557,
630,
29918,
2220,
1053,
3826,
272,
630,
6678,
13,
3166,
8939,
7716,
29889,
9794,
29889,
2220,
29918,
4804,
1053,
6680,
5594,
13,
3166,
8939,
7716,
29889,
6272,
29918,
1707,
29918,
19227,
1053,
338,
29918,
17590,
13,
13,
13,
1753,
8939,
7716,
29898,
9891,
29901,
28379,
29961,
29943,
29962,
353,
6213,
29892,
1996,
29918,
1514,
1807,
29901,
6120,
353,
7700,
29897,
1599,
383,
29901,
13,
1678,
9995,
13,
4706,
319,
9293,
7716,
2451,
338,
10425,
565,
697,
310,
278,
1494,
9559,
29901,
13,
4706,
448,
450,
10200,
630,
740,
338,
2000,
411,
2602,
284,
6273,
29889,
13,
4706,
448,
450,
740,
756,
694,
1134,
17195,
363,
1009,
736,
1134,
470,
697,
470,
901,
4128,
437,
451,
505,
1134,
13,
9651,
25495,
29889,
13,
4706,
448,
319,
1134,
17195,
338,
10240,
29889,
13,
4706,
448,
319,
1134,
17195,
3052,
267,
1134,
6273,
29892,
321,
29889,
29887,
29889,
19229,
29889,
1293,
2012,
310,
19229,
29889,
1293,
29961,
524,
1822,
13,
4706,
448,
450,
23531,
6273,
437,
451,
1993,
278,
2980,
1051,
470,
1009,
1134,
25495,
29889,
13,
13,
539,
8741,
29901,
13,
13,
539,
8653,
732,
9795,
7716,
13,
539,
2023,
822,
590,
29918,
2220,
29898,
29874,
29901,
938,
29892,
289,
29901,
5785,
29892,
274,
29901,
851,
29897,
1599,
6120,
29901,
13,
539,
2023,
268,
736,
5785,
29898,
29874,
29897,
1275,
289,
322,
851,
29898,
29890,
29897,
1275,
274,
13,
539,
8653,
590,
29918,
2220,
29898,
29874,
29922,
29946,
29906,
29889,
29900,
29892,
289,
29922,
29896,
29946,
29889,
29900,
29892,
274,
2433,
2918,
1495,
13,
539,
29243,
313,
3242,
7786,
1246,
1833,
1125,
13,
539,
2023,
13,
539,
8939,
7716,
29889,
11739,
29879,
29889,
29925,
287,
7716,
1542,
5596,
2451,
29901,
512,
740,
590,
29918,
2220,
29901,
13,
539,
5167,
13182,
338,
10240,
29901,
23125,
263,
29922,
29946,
29906,
29889,
29900,
310,
1134,
529,
1990,
525,
7411,
11041,
947,
451,
1993,
3806,
1134,
529,
1990,
525,
524,
11041,
29889,
13,
539,
8653,
590,
29918,
2220,
29898,
29874,
29922,
29946,
29906,
29892,
289,
29922,
8516,
29892,
274,
2433,
2918,
1495,
13,
539,
29243,
313,
3242,
7786,
1246,
1833,
1125,
13,
539,
2023,
13,
539,
8939,
7716,
29889,
11739,
29879,
29889,
29925,
287,
7716,
1542,
5596,
2451,
29901,
512,
740,
590,
29918,
2220,
29901,
13,
539,
5167,
13182,
338,
10240,
29901,
23125,
289,
29922,
8516,
310,
1134,
529,
1990,
525,
8516,
1542,
11041,
947,
451,
1993,
3806,
1134,
529,
1990,
525,
7411,
11041,
29889,
13,
539,
8653,
590,
29918,
2220,
29898,
29874,
29922,
29946,
29906,
29892,
289,
29922,
29946,
29906,
29892,
274,
2433,
2918,
1495,
13,
539,
29243,
313,
3242,
7786,
1246,
1833,
1125,
13,
539,
2023,
13,
539,
8939,
7716,
29889,
11739,
29879,
29889,
29925,
287,
7716,
1542,
5596,
2451,
29901,
512,
740,
590,
29918,
2220,
29901,
13,
539,
5167,
13182,
338,
10240,
29901,
23125,
289,
29922,
29946,
29906,
310,
1134,
529,
1990,
525,
524,
11041,
947,
451,
1993,
3806,
1134,
529,
1990,
525,
7411,
11041,
29889,
13,
539,
8653,
590,
29918,
2220,
29898,
29945,
29892,
29871,
29946,
29889,
29900,
29892,
525,
2918,
1495,
13,
539,
29243,
313,
3242,
7786,
1246,
1833,
1125,
13,
539,
2023,
13,
539,
8939,
7716,
29889,
11739,
29879,
29889,
29925,
287,
7716,
5594,
3047,
7883,
2451,
29901,
512,
740,
590,
29918,
2220,
29901,
13,
539,
4803,
9049,
5085,
746,
366,
1246,
740,
590,
29918,
2220,
29889,
826,
3174,
29901,
313,
29945,
29892,
29871,
29946,
29889,
29900,
29892,
525,
2918,
1495,
13,
259,
9995,
13,
13,
1678,
822,
10200,
1061,
29898,
29888,
29901,
383,
29897,
1599,
383,
29901,
13,
4706,
565,
451,
338,
29918,
17590,
7295,
13,
9651,
736,
285,
13,
13,
4706,
10200,
630,
29918,
9891,
353,
3826,
272,
630,
6678,
29898,
9891,
29922,
29888,
29897,
13,
13,
4706,
565,
1996,
29918,
1514,
1807,
470,
7431,
29898,
19557,
630,
29918,
9891,
29889,
1514,
1807,
29889,
7529,
29897,
1405,
29871,
29900,
29901,
13,
9651,
903,
3198,
29918,
1514,
1807,
29898,
19557,
630,
29918,
9891,
29922,
19557,
630,
29918,
9891,
29897,
13,
13,
4706,
732,
29893,
336,
567,
29898,
29888,
29897,
13,
4706,
822,
14476,
10456,
5085,
29901,
3139,
29892,
3579,
19290,
29901,
3139,
29897,
1599,
7106,
1542,
29901,
13,
9651,
1246,
353,
6680,
5594,
29898,
9891,
29922,
19557,
630,
29918,
9891,
29892,
6389,
29922,
5085,
29892,
9049,
5085,
29922,
19290,
29897,
13,
9651,
1246,
29889,
9294,
29918,
6394,
29918,
19290,
580,
13,
9651,
736,
1246,
29889,
3198,
29918,
8768,
580,
13,
13,
4706,
7465,
822,
7465,
29918,
17699,
10456,
5085,
29901,
3139,
29892,
3579,
19290,
29901,
3139,
29897,
1599,
7106,
1542,
29901,
13,
9651,
1246,
353,
6680,
5594,
29898,
9891,
29922,
19557,
630,
29918,
9891,
29892,
6389,
29922,
5085,
29892,
9049,
5085,
29922,
19290,
29897,
13,
9651,
1246,
29889,
9294,
29918,
6394,
29918,
19290,
580,
13,
9651,
736,
7272,
1246,
29889,
12674,
29918,
3198,
29918,
8768,
580,
13,
13,
4706,
565,
10200,
630,
29918,
9891,
29889,
275,
29918,
2616,
449,
457,
29901,
13,
9651,
736,
7465,
29918,
17699,
13,
4706,
1683,
29901,
13,
9651,
736,
14476,
13,
13,
1678,
736,
10200,
1061,
565,
3653,
338,
6213,
1683,
10200,
1061,
29898,
29888,
29922,
9891,
29897,
13,
13,
13,
1753,
8939,
7716,
29918,
12277,
29918,
1514,
1807,
29898,
9891,
29901,
28379,
29961,
29943,
29962,
353,
6213,
29897,
1599,
383,
29901,
13,
1678,
9995,
21322,
7582,
363,
732,
9795,
7716,
29898,
12277,
29918,
1514,
1807,
29922,
5574,
29897,
9995,
13,
1678,
736,
8939,
7716,
29898,
9891,
29922,
9891,
29892,
1996,
29918,
1514,
1807,
29922,
5574,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1053,
437,
312,
342,
13,
1678,
437,
312,
342,
29889,
1688,
1545,
29898,
369,
15828,
29922,
8824,
29892,
2984,
15764,
29922,
1867,
312,
342,
29889,
29923,
2208,
5690,
29903,
3235,
29897,
13,
2
] |
dp/combination_sum.py | Ratione/Python-Algroithms | 0 | 186262 | <reponame>Ratione/Python-Algroithms
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.
Example:
nums = [1, 2, 3]
target = 4
The possible combination ways are:
(1, 1, 1, 1)
(1, 1, 2)
(1, 2, 1)
(1, 3)
(2, 1, 1)
(2, 2)
(3, 1)
Note that different sequences are counted as different combinations.
Therefore the output is 7.
Follow up:
What if negative numbers are allowed in the given array?
How does it change the problem?
What limitation we need to add to the question to allow negative numbers?
private int[] dp;
public int combinationSum4(int[] nums, int target) {
dp = new int[target + 1];
Arrays.fill(dp, -1);
dp[0] = 1;
return helper(nums, target);
}
private int helper(int[] nums, int target) {
if (dp[target] != -1) {
return dp[target];
}
int res = 0;
for (int i = 0; i < nums.length; i++) {
if (target >= nums[i]) {
res += helper(nums, target - nums[i]);
}
}
dp[target] = res;
return res;
}
EDIT: The above solution is top-down. How about a bottom-up one?
public int combinationSum4(int[] nums, int target) {
int[] comb = new int[target + 1];
comb[0] = 1;
for (int i = 1; i < comb.length; i++) {
for (int j = 0; j < nums.length; j++) {
if (i - nums[j] >= 0) {
comb[i] += comb[i - nums[j]];
}
}
}
return comb[target];
}
| [
1,
529,
276,
1112,
420,
29958,
29934,
362,
29872,
29914,
11980,
29899,
2499,
17170,
389,
1516,
13,
29954,
5428,
385,
6043,
1409,
411,
599,
6374,
3694,
322,
694,
20955,
29892,
1284,
278,
1353,
310,
1950,
18240,
393,
788,
701,
304,
263,
6374,
6043,
3646,
29889,
13,
13,
14023,
29901,
13,
13,
1949,
29879,
353,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29962,
13,
5182,
353,
29871,
29946,
13,
13,
1576,
1950,
10296,
5837,
526,
29901,
13,
29898,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
29898,
29896,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
29898,
29896,
29892,
29871,
29906,
29892,
29871,
29896,
29897,
13,
29898,
29896,
29892,
29871,
29941,
29897,
13,
29898,
29906,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
29898,
29906,
29892,
29871,
29906,
29897,
13,
29898,
29941,
29892,
29871,
29896,
29897,
13,
13,
9842,
393,
1422,
15602,
526,
29115,
408,
1422,
18240,
29889,
13,
13,
8439,
1079,
278,
1962,
338,
29871,
29955,
29889,
13,
29943,
2952,
701,
29901,
13,
5618,
565,
8178,
3694,
526,
6068,
297,
278,
2183,
1409,
29973,
13,
5328,
947,
372,
1735,
278,
1108,
29973,
13,
5618,
29485,
591,
817,
304,
788,
304,
278,
1139,
304,
2758,
8178,
3694,
29973,
13,
13,
13,
9053,
938,
2636,
270,
29886,
29936,
13,
13,
3597,
938,
10296,
11139,
29946,
29898,
524,
2636,
954,
29879,
29892,
938,
3646,
29897,
426,
13,
1678,
270,
29886,
353,
716,
938,
29961,
5182,
718,
29871,
29896,
1385,
13,
1678,
4398,
29879,
29889,
5589,
29898,
6099,
29892,
448,
29896,
416,
13,
1678,
270,
29886,
29961,
29900,
29962,
353,
29871,
29896,
29936,
13,
1678,
736,
16876,
29898,
1949,
29879,
29892,
3646,
416,
13,
29913,
13,
13,
9053,
938,
16876,
29898,
524,
2636,
954,
29879,
29892,
938,
3646,
29897,
426,
13,
1678,
565,
313,
6099,
29961,
5182,
29962,
2804,
448,
29896,
29897,
426,
13,
4706,
736,
270,
29886,
29961,
5182,
1385,
13,
1678,
500,
13,
1678,
938,
620,
353,
29871,
29900,
29936,
13,
1678,
363,
313,
524,
474,
353,
29871,
29900,
29936,
474,
529,
954,
29879,
29889,
2848,
29936,
474,
4862,
426,
13,
4706,
565,
313,
5182,
6736,
954,
29879,
29961,
29875,
2314,
426,
13,
9651,
620,
4619,
16876,
29898,
1949,
29879,
29892,
3646,
448,
954,
29879,
29961,
29875,
5691,
13,
4706,
500,
13,
1678,
500,
13,
1678,
270,
29886,
29961,
5182,
29962,
353,
620,
29936,
13,
1678,
736,
620,
29936,
13,
29913,
13,
13,
13,
12378,
29901,
450,
2038,
1650,
338,
2246,
29899,
3204,
29889,
1128,
1048,
263,
5970,
29899,
786,
697,
29973,
13,
13,
3597,
938,
10296,
11139,
29946,
29898,
524,
2636,
954,
29879,
29892,
938,
3646,
29897,
426,
13,
1678,
938,
2636,
4145,
353,
716,
938,
29961,
5182,
718,
29871,
29896,
1385,
13,
1678,
4145,
29961,
29900,
29962,
353,
29871,
29896,
29936,
13,
1678,
363,
313,
524,
474,
353,
29871,
29896,
29936,
474,
529,
4145,
29889,
2848,
29936,
474,
4862,
426,
13,
4706,
363,
313,
524,
432,
353,
29871,
29900,
29936,
432,
529,
954,
29879,
29889,
2848,
29936,
432,
4862,
426,
13,
9651,
565,
313,
29875,
448,
954,
29879,
29961,
29926,
29962,
6736,
29871,
29900,
29897,
426,
13,
18884,
4145,
29961,
29875,
29962,
4619,
4145,
29961,
29875,
448,
954,
29879,
29961,
29926,
19942,
13,
9651,
500,
13,
4706,
500,
13,
1678,
500,
13,
1678,
736,
4145,
29961,
5182,
1385,
13,
29913,
13,
2
] |
run_evaluation.py | XiaoSanGit/wda_tracker | 24 | 62152 | <filename>run_evaluation.py<gh_stars>10-100
import sys
def append_to_pythonpath(paths):
for path in paths:
sys.path.append(path)
append_to_pythonpath(['/home/koehlp/Dokumente/JTA-MTMCT-Mod/deep_sort_mc/clustering',
'/home/koehlp/Dokumente/JTA-MTMCT-Mod/deep_sort_mc',
'/home/koehlp/Dokumente/JTA-MTMCT-Mod/deep_sort_mc/detectors/mmdetection',
'/home/koehlp/Dokumente/JTA-MTMCT-Mod/deep_sort_mc/trackers/iou_tracker',
'/home/koehlp/Dokumente/JTA-MTMCT-Mod/deep_sort_mc/evaluation/py_motmetrics',
'/home/koehlp/Dokumente/JTA-MTMCT-Mod/deep_sort_mc/feature_extractors/reid-strong-baseline',
'/home/koehlp/Dokumente/JTA-MTMCT-Mod/deep_sort_mc/clustering',
'/home/koehlp/Dokumente/JTA-MTMCT-Mod/deep_sort_mc/detectors/mmdetection',
'/home/koehlp/Dokumente/JTA-MTMCT-Mod/deep_sort_mc/feature_extractors/ABD_Net'])
import argparse
import mmcv
import logging
from utils.logger import setup_logger
import os
import json
from evaluation.multicam_evaluation import splitted_multi_cam_evaluation
from evaluation.motmetrics_evaluation import splitted_single_cam_evaluation
class Run_clustering:
def __init__(self,args):
self.cfg = mmcv.Config.fromfile(args.config).root
self.cfg.config_basename = os.path.basename(args.config).replace(".py", "")
config_run_path = os.path.join(self.cfg.config_run_path, self.cfg.config_basename)
setattr(self.cfg, "config_run_path", config_run_path)
os.makedirs(config_run_path,exist_ok=True)
self.logger = setup_logger("clustering_logger", self.cfg.config_run_path, 0)
self.logger.info(json.dumps(self.cfg, sort_keys=True, indent=4))
def run(self):
if self.cfg.evaluate_multi_cam:
multi_cam_eval_results_folder = os.path.join(self.cfg.config_run_path,"multi_cam_evaluation")
self.logger.info("Started multi cam evaluation")
splitted_multi_cam_evaluation(dataset_folder=self.cfg.dataset_folder
,
track_results_folder=self.cfg.track_results_folder
, results_output_folder=multi_cam_eval_results_folder
, cam_ids=self.cfg.cam_ids
, working_dir=self.cfg.working_dir
, n_parts=self.cfg.n_parts
)
self.logger.info("Finished multi cam evaluation")
if self.cfg.evaluate_single_cam:
single_cam_eval_results_folder = os.path.join(self.cfg.config_run_path,"single_cam_evaluation")
self.logger.info("Started single cam evaluation")
splitted_single_cam_evaluation(dataset_folder=self.cfg.dataset_folder
,
track_results_folder=self.cfg.track_results_folder
, results_output_folder=single_cam_eval_results_folder
, cam_ids=self.cfg.cam_ids
, working_dir=self.cfg.working_dir
, n_parts=self.cfg.n_parts
)
self.logger.info("Finished single cam evaluation")
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--config", type=str)
return parser.parse_args()
if __name__=="__main__":
args = parse_args()
run_clustering = Run_clustering(args)
run_clustering.run() | [
1,
529,
9507,
29958,
3389,
29918,
24219,
362,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
13,
13,
5215,
10876,
13,
13,
1753,
9773,
29918,
517,
29918,
4691,
2084,
29898,
24772,
1125,
13,
1678,
363,
2224,
297,
10898,
29901,
13,
4706,
10876,
29889,
2084,
29889,
4397,
29898,
2084,
29897,
13,
13,
13,
4397,
29918,
517,
29918,
4691,
2084,
18959,
29914,
5184,
29914,
2901,
29872,
4415,
29886,
29914,
29928,
554,
942,
29872,
29914,
29967,
6040,
29899,
11490,
29924,
1783,
29899,
2111,
29914,
24535,
29918,
6605,
29918,
14047,
29914,
695,
504,
3241,
742,
13,
462,
418,
8207,
5184,
29914,
2901,
29872,
4415,
29886,
29914,
29928,
554,
942,
29872,
29914,
29967,
6040,
29899,
11490,
29924,
1783,
29899,
2111,
29914,
24535,
29918,
6605,
29918,
14047,
742,
13,
462,
418,
8207,
5184,
29914,
2901,
29872,
4415,
29886,
29914,
29928,
554,
942,
29872,
29914,
29967,
6040,
29899,
11490,
29924,
1783,
29899,
2111,
29914,
24535,
29918,
6605,
29918,
14047,
29914,
4801,
11142,
29914,
29885,
3487,
2650,
428,
742,
13,
462,
418,
8207,
5184,
29914,
2901,
29872,
4415,
29886,
29914,
29928,
554,
942,
29872,
29914,
29967,
6040,
29899,
11490,
29924,
1783,
29899,
2111,
29914,
24535,
29918,
6605,
29918,
14047,
29914,
11294,
414,
29914,
29875,
283,
29918,
3018,
4937,
742,
13,
462,
418,
8207,
5184,
29914,
2901,
29872,
4415,
29886,
29914,
29928,
554,
942,
29872,
29914,
29967,
6040,
29899,
11490,
29924,
1783,
29899,
2111,
29914,
24535,
29918,
6605,
29918,
14047,
29914,
24219,
362,
29914,
2272,
29918,
14817,
2527,
10817,
742,
13,
462,
418,
8207,
5184,
29914,
2901,
29872,
4415,
29886,
29914,
29928,
554,
942,
29872,
29914,
29967,
6040,
29899,
11490,
29924,
1783,
29899,
2111,
29914,
24535,
29918,
6605,
29918,
14047,
29914,
14394,
29918,
21111,
943,
29914,
276,
333,
29899,
1110,
29899,
6500,
5570,
742,
13,
462,
418,
8207,
5184,
29914,
2901,
29872,
4415,
29886,
29914,
29928,
554,
942,
29872,
29914,
29967,
6040,
29899,
11490,
29924,
1783,
29899,
2111,
29914,
24535,
29918,
6605,
29918,
14047,
29914,
695,
504,
3241,
742,
13,
462,
418,
8207,
5184,
29914,
2901,
29872,
4415,
29886,
29914,
29928,
554,
942,
29872,
29914,
29967,
6040,
29899,
11490,
29924,
1783,
29899,
2111,
29914,
24535,
29918,
6605,
29918,
14047,
29914,
4801,
11142,
29914,
29885,
3487,
2650,
428,
742,
13,
462,
418,
8207,
5184,
29914,
2901,
29872,
4415,
29886,
29914,
29928,
554,
942,
29872,
29914,
29967,
6040,
29899,
11490,
29924,
1783,
29899,
2111,
29914,
24535,
29918,
6605,
29918,
14047,
29914,
14394,
29918,
21111,
943,
29914,
2882,
29928,
29918,
6779,
11287,
13,
13,
5215,
1852,
5510,
13,
5215,
5654,
11023,
13,
5215,
12183,
13,
3166,
3667,
29879,
29889,
21707,
1053,
6230,
29918,
21707,
13,
5215,
2897,
13,
5215,
4390,
13,
3166,
17983,
29889,
4713,
293,
314,
29918,
24219,
362,
1053,
8536,
4430,
29918,
9910,
29918,
11108,
29918,
24219,
362,
13,
3166,
17983,
29889,
14817,
2527,
10817,
29918,
24219,
362,
1053,
8536,
4430,
29918,
14369,
29918,
11108,
29918,
24219,
362,
13,
13,
1990,
7525,
29918,
695,
504,
3241,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
5085,
1125,
13,
4706,
1583,
29889,
16859,
353,
5654,
11023,
29889,
3991,
29889,
3166,
1445,
29898,
5085,
29889,
2917,
467,
4632,
13,
13,
4706,
1583,
29889,
16859,
29889,
2917,
29918,
6500,
3871,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
5085,
29889,
2917,
467,
6506,
17350,
2272,
613,
20569,
13,
13,
4706,
2295,
29918,
3389,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
16859,
29889,
2917,
29918,
3389,
29918,
2084,
29892,
1583,
29889,
16859,
29889,
2917,
29918,
6500,
3871,
29897,
13,
4706,
731,
5552,
29898,
1311,
29889,
16859,
29892,
376,
2917,
29918,
3389,
29918,
2084,
613,
2295,
29918,
3389,
29918,
2084,
29897,
13,
13,
4706,
2897,
29889,
29885,
12535,
12935,
29898,
2917,
29918,
3389,
29918,
2084,
29892,
28997,
29918,
554,
29922,
5574,
29897,
13,
13,
4706,
1583,
29889,
21707,
353,
6230,
29918,
21707,
703,
695,
504,
3241,
29918,
21707,
613,
1583,
29889,
16859,
29889,
2917,
29918,
3389,
29918,
2084,
29892,
29871,
29900,
29897,
13,
13,
4706,
1583,
29889,
21707,
29889,
3888,
29898,
3126,
29889,
29881,
17204,
29898,
1311,
29889,
16859,
29892,
2656,
29918,
8149,
29922,
5574,
29892,
29536,
29922,
29946,
876,
13,
13,
13,
13,
13,
13,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
13,
4706,
565,
1583,
29889,
16859,
29889,
24219,
403,
29918,
9910,
29918,
11108,
29901,
13,
13,
9651,
2473,
29918,
11108,
29918,
14513,
29918,
9902,
29918,
12083,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
16859,
29889,
2917,
29918,
3389,
29918,
2084,
1699,
9910,
29918,
11108,
29918,
24219,
362,
1159,
13,
13,
9651,
1583,
29889,
21707,
29889,
3888,
703,
4763,
287,
2473,
3949,
17983,
1159,
13,
9651,
8536,
4430,
29918,
9910,
29918,
11108,
29918,
24219,
362,
29898,
24713,
29918,
12083,
29922,
1311,
29889,
16859,
29889,
24713,
29918,
12083,
13,
462,
462,
3986,
1919,
13,
462,
462,
3986,
5702,
29918,
9902,
29918,
12083,
29922,
1311,
29889,
16859,
29889,
11294,
29918,
9902,
29918,
12083,
13,
462,
462,
3986,
1919,
2582,
29918,
4905,
29918,
12083,
29922,
9910,
29918,
11108,
29918,
14513,
29918,
9902,
29918,
12083,
13,
462,
462,
3986,
1919,
3949,
29918,
4841,
29922,
1311,
29889,
16859,
29889,
11108,
29918,
4841,
13,
462,
462,
3986,
1919,
1985,
29918,
3972,
29922,
1311,
29889,
16859,
29889,
22899,
29918,
3972,
13,
462,
462,
3986,
1919,
302,
29918,
20895,
29922,
1311,
29889,
16859,
29889,
29876,
29918,
20895,
13,
462,
462,
3986,
1723,
13,
13,
9651,
1583,
29889,
21707,
29889,
3888,
703,
12881,
3276,
2473,
3949,
17983,
1159,
13,
13,
13,
13,
4706,
565,
1583,
29889,
16859,
29889,
24219,
403,
29918,
14369,
29918,
11108,
29901,
13,
13,
9651,
2323,
29918,
11108,
29918,
14513,
29918,
9902,
29918,
12083,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
16859,
29889,
2917,
29918,
3389,
29918,
2084,
1699,
14369,
29918,
11108,
29918,
24219,
362,
1159,
13,
13,
9651,
1583,
29889,
21707,
29889,
3888,
703,
4763,
287,
2323,
3949,
17983,
1159,
13,
9651,
8536,
4430,
29918,
14369,
29918,
11108,
29918,
24219,
362,
29898,
24713,
29918,
12083,
29922,
1311,
29889,
16859,
29889,
24713,
29918,
12083,
13,
462,
462,
3986,
1919,
13,
462,
462,
3986,
5702,
29918,
9902,
29918,
12083,
29922,
1311,
29889,
16859,
29889,
11294,
29918,
9902,
29918,
12083,
13,
462,
462,
3986,
1919,
2582,
29918,
4905,
29918,
12083,
29922,
14369,
29918,
11108,
29918,
14513,
29918,
9902,
29918,
12083,
13,
462,
462,
3986,
1919,
3949,
29918,
4841,
29922,
1311,
29889,
16859,
29889,
11108,
29918,
4841,
13,
462,
462,
3986,
1919,
1985,
29918,
3972,
29922,
1311,
29889,
16859,
29889,
22899,
29918,
3972,
13,
462,
462,
3986,
1919,
302,
29918,
20895,
29922,
1311,
29889,
16859,
29889,
29876,
29918,
20895,
13,
462,
462,
3986,
1723,
13,
9651,
1583,
29889,
21707,
29889,
3888,
703,
12881,
3276,
2323,
3949,
17983,
1159,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
1753,
6088,
29918,
5085,
7295,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
2917,
613,
1134,
29922,
710,
29897,
13,
13,
1678,
736,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
13,
13,
361,
4770,
978,
1649,
26359,
1649,
3396,
1649,
1115,
13,
13,
13,
1678,
6389,
353,
6088,
29918,
5085,
580,
13,
13,
1678,
1065,
29918,
695,
504,
3241,
353,
7525,
29918,
695,
504,
3241,
29898,
5085,
29897,
13,
13,
13,
1678,
1065,
29918,
695,
504,
3241,
29889,
3389,
580,
2
] |
src/list_screen/__init__.py | JeremyMoeglich/Python-Cmd-Screen | 0 | 184488 | from .main import Screen | [
1,
515,
869,
3396,
1053,
22666,
2
] |
crowdbotics_test/animal/serializers/dog.py | marslan390/DjangoModelInheritance | 0 | 160065 | from .animal import AnimalSerializer
from crowdbotics_test.animal.models import Dog
class DogSerializer(AnimalSerializer):
def create(self, validated_data):
return Dog.objects.create(**validated_data)
def update(self, instance, validated_data):
instance.name = validated_data.get('name', instance.name)
instance.birthday = validated_data.get('birthday', instance.birthday)
instance.save()
return instance
| [
1,
515,
869,
273,
3039,
1053,
22809,
17679,
13,
3166,
11660,
2585,
327,
1199,
29918,
1688,
29889,
273,
3039,
29889,
9794,
1053,
18776,
13,
13,
13,
1990,
18776,
17679,
29898,
2744,
3039,
17679,
1125,
13,
13,
1678,
822,
1653,
29898,
1311,
29892,
2854,
630,
29918,
1272,
1125,
13,
4706,
736,
18776,
29889,
12650,
29889,
3258,
29898,
1068,
3084,
630,
29918,
1272,
29897,
13,
13,
1678,
822,
2767,
29898,
1311,
29892,
2777,
29892,
2854,
630,
29918,
1272,
1125,
13,
4706,
2777,
29889,
978,
353,
2854,
630,
29918,
1272,
29889,
657,
877,
978,
742,
2777,
29889,
978,
29897,
13,
4706,
2777,
29889,
29890,
7515,
3250,
353,
2854,
630,
29918,
1272,
29889,
657,
877,
29890,
7515,
3250,
742,
2777,
29889,
29890,
7515,
3250,
29897,
13,
4706,
2777,
29889,
7620,
580,
13,
4706,
736,
2777,
13,
2
] |
bitey/cpu/flag/flag_json_decoder.py | jgerrish/bitey | 0 | 197405 | from dataclasses import dataclass
import json
from json import JSONDecoder
from typing import ClassVar
from bitey.cpu.flag.flag import Flag, Flags
from bitey.cpu.flag.carry_flag import CarryFlag
from bitey.cpu.flag.decimal_flag import DecimalFlag
from bitey.cpu.flag.negative_flag import NegativeFlag
from bitey.cpu.flag.zero_flag import ZeroFlag
@dataclass
class FlagJSONDecoder(JSONDecoder):
"""
Decode a flag definition in JSON format
"""
flag_map: ClassVar[dict[str, Flag]] = {
"C": CarryFlag,
"N": NegativeFlag,
"Z": ZeroFlag,
"D": DecimalFlag,
}
def decode(self, json_doc):
"""
Decode a flag definition in JSON format
json_doc should be a parsed JSON structure
"""
if (
("short_name" in json_doc)
and ("name" in json_doc)
and ("bit_field_pos" in json_doc)
and ("status" in json_doc)
):
status = False
if json_doc["status"] == 0:
status = False
elif json_doc["status"] == 1:
status = True
short_name = json_doc["short_name"]
if "options" in json_doc:
options = json_doc["options"]
else:
options = None
# Create a specific class if it exists
if short_name in FlagJSONDecoder.flag_map:
flag_class = FlagJSONDecoder.flag_map[short_name]
return flag_class(
short_name,
json_doc["name"],
json_doc["bit_field_pos"],
status,
options,
)
return Flag(
short_name,
json_doc["name"],
json_doc["bit_field_pos"],
status,
options,
)
else:
# Return None if the flag JSON object is missing fields or invalid
return None
class FlagsJSONDecoder(JSONDecoder):
"""
Decode a list of flag definitions in JSON format
"""
def decode(self, json_doc):
parsed_json = json.loads(json_doc)
return self.decode_parsed(parsed_json)
def decode_parsed(self, parsed_json):
flag_list = []
rjd = FlagJSONDecoder()
for flag in parsed_json:
f = rjd.decode(flag)
# Only append the flag if all fields are present and the JSON
# is valid for the flag
if f:
flag_list.append(f)
# TODO: Some things should be initialized to certain values
# Make sure setting the flags byte to zero on start is ok
return Flags(flag_list, None)
| [
1,
515,
848,
13203,
1053,
848,
1990,
13,
5215,
4390,
13,
3166,
4390,
1053,
4663,
6185,
6119,
13,
3166,
19229,
1053,
4134,
9037,
13,
13,
3166,
289,
568,
29891,
29889,
21970,
29889,
15581,
29889,
15581,
1053,
28697,
29892,
2379,
810,
13,
3166,
289,
568,
29891,
29889,
21970,
29889,
15581,
29889,
4287,
719,
29918,
15581,
1053,
1704,
719,
21979,
13,
3166,
289,
568,
29891,
29889,
21970,
29889,
15581,
29889,
7099,
3039,
29918,
15581,
1053,
3826,
3039,
21979,
13,
3166,
289,
568,
29891,
29889,
21970,
29889,
15581,
29889,
22198,
29918,
15581,
1053,
12610,
1230,
21979,
13,
3166,
289,
568,
29891,
29889,
21970,
29889,
15581,
29889,
9171,
29918,
15581,
1053,
28933,
21979,
13,
13,
13,
29992,
1272,
1990,
13,
1990,
28697,
7249,
6185,
6119,
29898,
7249,
6185,
6119,
1125,
13,
1678,
9995,
13,
1678,
897,
401,
263,
7353,
5023,
297,
4663,
3402,
13,
1678,
9995,
13,
13,
1678,
7353,
29918,
1958,
29901,
4134,
9037,
29961,
8977,
29961,
710,
29892,
28697,
5262,
353,
426,
13,
4706,
376,
29907,
1115,
1704,
719,
21979,
29892,
13,
4706,
376,
29940,
1115,
12610,
1230,
21979,
29892,
13,
4706,
376,
29999,
1115,
28933,
21979,
29892,
13,
4706,
376,
29928,
1115,
3826,
3039,
21979,
29892,
13,
1678,
500,
13,
13,
1678,
822,
21822,
29898,
1311,
29892,
4390,
29918,
1514,
1125,
13,
4706,
9995,
13,
4706,
897,
401,
263,
7353,
5023,
297,
4663,
3402,
13,
4706,
4390,
29918,
1514,
881,
367,
263,
21213,
4663,
3829,
13,
4706,
9995,
13,
4706,
565,
313,
13,
9651,
4852,
12759,
29918,
978,
29908,
297,
4390,
29918,
1514,
29897,
13,
9651,
322,
4852,
978,
29908,
297,
4390,
29918,
1514,
29897,
13,
9651,
322,
4852,
2966,
29918,
2671,
29918,
1066,
29908,
297,
4390,
29918,
1514,
29897,
13,
9651,
322,
4852,
4882,
29908,
297,
4390,
29918,
1514,
29897,
13,
308,
1125,
13,
9651,
4660,
353,
7700,
13,
9651,
565,
4390,
29918,
1514,
3366,
4882,
3108,
1275,
29871,
29900,
29901,
13,
18884,
4660,
353,
7700,
13,
9651,
25342,
4390,
29918,
1514,
3366,
4882,
3108,
1275,
29871,
29896,
29901,
13,
18884,
4660,
353,
5852,
13,
13,
9651,
3273,
29918,
978,
353,
4390,
29918,
1514,
3366,
12759,
29918,
978,
3108,
13,
13,
9651,
565,
376,
6768,
29908,
297,
4390,
29918,
1514,
29901,
13,
18884,
3987,
353,
4390,
29918,
1514,
3366,
6768,
3108,
13,
9651,
1683,
29901,
13,
18884,
3987,
353,
6213,
13,
13,
9651,
396,
6204,
263,
2702,
770,
565,
372,
4864,
13,
9651,
565,
3273,
29918,
978,
297,
28697,
7249,
6185,
6119,
29889,
15581,
29918,
1958,
29901,
13,
18884,
7353,
29918,
1990,
353,
28697,
7249,
6185,
6119,
29889,
15581,
29918,
1958,
29961,
12759,
29918,
978,
29962,
13,
18884,
736,
7353,
29918,
1990,
29898,
13,
462,
1678,
3273,
29918,
978,
29892,
13,
462,
1678,
4390,
29918,
1514,
3366,
978,
12436,
13,
462,
1678,
4390,
29918,
1514,
3366,
2966,
29918,
2671,
29918,
1066,
12436,
13,
462,
1678,
4660,
29892,
13,
462,
1678,
3987,
29892,
13,
18884,
1723,
13,
13,
9651,
736,
28697,
29898,
13,
18884,
3273,
29918,
978,
29892,
13,
18884,
4390,
29918,
1514,
3366,
978,
12436,
13,
18884,
4390,
29918,
1514,
3366,
2966,
29918,
2671,
29918,
1066,
12436,
13,
18884,
4660,
29892,
13,
18884,
3987,
29892,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
396,
7106,
6213,
565,
278,
7353,
4663,
1203,
338,
4567,
4235,
470,
8340,
13,
9651,
736,
6213,
13,
13,
13,
1990,
2379,
810,
7249,
6185,
6119,
29898,
7249,
6185,
6119,
1125,
13,
1678,
9995,
13,
1678,
897,
401,
263,
1051,
310,
7353,
15848,
297,
4663,
3402,
13,
1678,
9995,
13,
13,
1678,
822,
21822,
29898,
1311,
29892,
4390,
29918,
1514,
1125,
13,
4706,
21213,
29918,
3126,
353,
4390,
29889,
18132,
29898,
3126,
29918,
1514,
29897,
13,
4706,
736,
1583,
29889,
13808,
29918,
862,
8485,
29898,
862,
8485,
29918,
3126,
29897,
13,
13,
1678,
822,
21822,
29918,
862,
8485,
29898,
1311,
29892,
21213,
29918,
3126,
1125,
13,
4706,
7353,
29918,
1761,
353,
5159,
13,
4706,
364,
26012,
353,
28697,
7249,
6185,
6119,
580,
13,
4706,
363,
7353,
297,
21213,
29918,
3126,
29901,
13,
9651,
285,
353,
364,
26012,
29889,
13808,
29898,
15581,
29897,
13,
9651,
396,
9333,
9773,
278,
7353,
565,
599,
4235,
526,
2198,
322,
278,
4663,
13,
9651,
396,
338,
2854,
363,
278,
7353,
13,
9651,
565,
285,
29901,
13,
18884,
7353,
29918,
1761,
29889,
4397,
29898,
29888,
29897,
13,
4706,
396,
14402,
29901,
3834,
2712,
881,
367,
16601,
304,
3058,
1819,
13,
4706,
396,
8561,
1854,
4444,
278,
13449,
7023,
304,
5225,
373,
1369,
338,
3431,
13,
4706,
736,
2379,
810,
29898,
15581,
29918,
1761,
29892,
6213,
29897,
13,
2
] |
tests/test_game_map.py | brittleshinpass/mossbread | 1 | 15127 | import pytest
from array import array
from game_map import GameMap
from tests.conftest import get_relative_path
sample_map_data = tuple(
reversed(
(
array("I", (0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0)),
array("I", (0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0)),
array("I", (1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1)),
array("I", (1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1)),
array("I", (1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)),
array("I", (1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
array("I", (1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1)),
array("I", (0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0)),
array("I", (0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0)),
)
)
)
def test_game_map_from_file(sample_game_map, sample_tiles):
assert sample_game_map.map_data == sample_map_data
assert sample_game_map.width == 21
assert sample_game_map.height == 21
assert sample_game_map.tile_data == sample_tiles
# Assert map is read right-up
assert sample_game_map.get(16, 2) == 0
assert sample_game_map.get(16, 18) == 1
def test_game_map_get_out_of_bounds(sample_game_map):
with pytest.raises(AssertionError):
sample_game_map.get(-1, 0)
sample_game_map.get(0, -1)
sample_game_map.get(-1, -1)
sample_game_map.get(21, 0)
sample_game_map.get(0, 21)
sample_game_map.get(21, 21)
def test_game_map_load_mapfile_nonrectangular():
with pytest.raises(AssertionError):
GameMap.load_mapfile(get_relative_path("fixtures/map_nonrectangular.csv"))
def test_game_map_traversable(sample_game_map):
assert sample_game_map.traversable(2, 2)
assert not sample_game_map.traversable(1, 1)
assert sample_game_map.traversable(16, 2)
assert not sample_game_map.traversable(16, 18)
| [
1,
1053,
11451,
1688,
13,
13,
3166,
1409,
1053,
1409,
13,
3166,
3748,
29918,
1958,
1053,
8448,
3388,
13,
3166,
6987,
29889,
535,
615,
342,
1053,
679,
29918,
22925,
29918,
2084,
13,
13,
13,
11249,
29918,
1958,
29918,
1272,
353,
18761,
29898,
13,
1678,
18764,
287,
29898,
13,
4706,
313,
13,
9651,
1409,
703,
29902,
613,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
8243,
13,
9651,
1409,
703,
29902,
613,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
8243,
13,
4706,
1723,
13,
1678,
1723,
13,
29897,
13,
13,
13,
1753,
1243,
29918,
11802,
29918,
1958,
29918,
3166,
29918,
1445,
29898,
11249,
29918,
11802,
29918,
1958,
29892,
4559,
29918,
1376,
267,
1125,
13,
1678,
4974,
4559,
29918,
11802,
29918,
1958,
29889,
1958,
29918,
1272,
1275,
4559,
29918,
1958,
29918,
1272,
13,
1678,
4974,
4559,
29918,
11802,
29918,
1958,
29889,
2103,
1275,
29871,
29906,
29896,
13,
1678,
4974,
4559,
29918,
11802,
29918,
1958,
29889,
3545,
1275,
29871,
29906,
29896,
13,
1678,
4974,
4559,
29918,
11802,
29918,
1958,
29889,
29873,
488,
29918,
1272,
1275,
4559,
29918,
1376,
267,
13,
13,
1678,
396,
16499,
2910,
338,
1303,
1492,
29899,
786,
13,
1678,
4974,
4559,
29918,
11802,
29918,
1958,
29889,
657,
29898,
29896,
29953,
29892,
29871,
29906,
29897,
1275,
29871,
29900,
13,
1678,
4974,
4559,
29918,
11802,
29918,
1958,
29889,
657,
29898,
29896,
29953,
29892,
29871,
29896,
29947,
29897,
1275,
29871,
29896,
13,
13,
13,
1753,
1243,
29918,
11802,
29918,
1958,
29918,
657,
29918,
449,
29918,
974,
29918,
23687,
29898,
11249,
29918,
11802,
29918,
1958,
1125,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
14697,
291,
2392,
1125,
13,
4706,
4559,
29918,
11802,
29918,
1958,
29889,
657,
6278,
29896,
29892,
29871,
29900,
29897,
13,
4706,
4559,
29918,
11802,
29918,
1958,
29889,
657,
29898,
29900,
29892,
448,
29896,
29897,
13,
4706,
4559,
29918,
11802,
29918,
1958,
29889,
657,
6278,
29896,
29892,
448,
29896,
29897,
13,
4706,
4559,
29918,
11802,
29918,
1958,
29889,
657,
29898,
29906,
29896,
29892,
29871,
29900,
29897,
13,
4706,
4559,
29918,
11802,
29918,
1958,
29889,
657,
29898,
29900,
29892,
29871,
29906,
29896,
29897,
13,
4706,
4559,
29918,
11802,
29918,
1958,
29889,
657,
29898,
29906,
29896,
29892,
29871,
29906,
29896,
29897,
13,
13,
13,
1753,
1243,
29918,
11802,
29918,
1958,
29918,
1359,
29918,
1958,
1445,
29918,
5464,
1621,
6825,
7295,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
14697,
291,
2392,
1125,
13,
4706,
8448,
3388,
29889,
1359,
29918,
1958,
1445,
29898,
657,
29918,
22925,
29918,
2084,
703,
7241,
486,
1973,
29914,
1958,
29918,
5464,
1621,
6825,
29889,
7638,
5783,
13,
13,
13,
1753,
1243,
29918,
11802,
29918,
1958,
29918,
3018,
874,
519,
29898,
11249,
29918,
11802,
29918,
1958,
1125,
13,
1678,
4974,
4559,
29918,
11802,
29918,
1958,
29889,
3018,
874,
519,
29898,
29906,
29892,
29871,
29906,
29897,
13,
1678,
4974,
451,
4559,
29918,
11802,
29918,
1958,
29889,
3018,
874,
519,
29898,
29896,
29892,
29871,
29896,
29897,
13,
1678,
4974,
4559,
29918,
11802,
29918,
1958,
29889,
3018,
874,
519,
29898,
29896,
29953,
29892,
29871,
29906,
29897,
13,
1678,
4974,
451,
4559,
29918,
11802,
29918,
1958,
29889,
3018,
874,
519,
29898,
29896,
29953,
29892,
29871,
29896,
29947,
29897,
13,
2
] |
evernotebot/bot/storage.py | AuroraDysis/evernote-telegram-bot | 1 | 14550 | import json
import sqlite3
import typing
from typing import Optional, Dict
from copy import deepcopy
from contextlib import suppress
from bson.objectid import ObjectId
from pymongo import MongoClient
from pymongo.errors import ConfigurationError
class MongoStorageException(Exception):
pass
class Mongo:
def __init__(self, connection_string, *, collection=None, db_name=None):
if collection is None:
raise MongoStorageException('`collection` is required')
self._driver = MongoClient(connection_string)
with suppress(ConfigurationError):
db = self._driver.get_database(db_name)
if db is None:
raise MongoStorageException(
'You have to specify database name '
'either in connection string or as `db_name` parameter')
self._collection = db.get_collection(collection)
def create(self, data: dict, auto_generate_id=False):
data = deepcopy(data)
if "id" in data:
data["_id"] = data["id"]
del data["id"]
elif not auto_generate_id:
raise MongoStorageException("`id` required")
object_id = self._collection.insert_one(data).inserted_id
if isinstance(object_id, ObjectId):
object_id = str(object_id)
return object_id
def get(self, object_id, fail_if_not_exists=False):
query = object_id if isinstance(object_id, dict) else {"_id": object_id}
data = self._collection.find_one(query)
if fail_if_not_exists and not data:
raise MongoStorageException(f"Object not found. Query: {query}")
if data:
data["id"] = data["_id"]
del data["_id"]
return data
def get_all(self, query):
for document in self._collection.find(query):
document["id"] = document["_id"]
del document["_id"]
yield document
def save(self, data: dict):
object_id = data.get("id")
if object_id:
data["_id"] = object_id
del data["id"]
query = {"_id": object_id}
result = self._collection.update_one(query, {"$set": data})
if result.matched_count == 0:
raise MongoStorageException(f"Object `{object_id}` not found")
data["id"] = object_id
else:
object_id = str(self._collection.insert_one(data).inserted_id)
if isinstance(object_id, ObjectId):
object_id = str(object_id)
data["id"] = object_id
return object_id
def delete(self, object_id, check_deleted_count=True):
result = self._collection.delete_one({"_id": object_id})
if check_deleted_count and result.deleted_count != 1:
raise MongoStorageException(f"Object `{object_id}` not found")
def close(self):
self._driver.close()
class Sqlite:
def __init__(self, dirpath: str, *, collection: str = None, db_name: str = None) -> None:
db_filepath = f'{dirpath}/{db_name}'
self._connection = sqlite3.connect(db_filepath)
self._table_name = collection
self.__execute_sql(
f'CREATE TABLE IF NOT EXISTS {collection}'
'(id INTEGER PRIMARY KEY AUTOINCREMENT, data TEXT)'
)
def __execute_sql(self, sql: str, *args) -> sqlite3.Cursor:
sql = sql.strip().upper()
cursor = self._connection.execute(sql, args)
if not sql.startswith('SELECT'):
self._connection.commit()
return cursor
def create(self, data: dict, auto_generate_id: bool = False) -> int:
table = self._table_name
if auto_generate_id:
if 'id' in data:
del data['id']
sql = f'INSERT INTO {table}(data) VALUES(?)'
cursor = self.__execute_sql(sql, json.dumps(data))
else:
object_id = data['id']
if object_id <= 0:
raise Exception(f'Invalid id `{object_id}`. Id must be >= 0')
cursor = self.__execute_sql(f'INSERT INTO {table}(id, data) VALUES(?, ?)',
object_id, json.dumps(data))
return cursor.lastrowid
def get(self, object_id: int, fail_if_not_exists: bool = False) -> Dict:
query = object_id if isinstance(object_id, dict) else {'id': object_id}
objects = self.get_all(query)
result = list(objects)
if fail_if_not_exists and not result:
raise Exception(f'Object not found. Query: {query}')
return result and result[0]
def get_all(self, query: Optional[Dict] = None) -> typing.Generator:
if query is None:
query = {}
table = self._table_name
args = tuple()
if 'id' in query:
sql = f'SELECT id, data FROM {table} WHERE id=?'
args = (query['id'],)
else:
sql = f'SELECT id, data FROM {table}'
cursor = self.__execute_sql(sql, *args)
objects = cursor.fetchall()
if not objects:
return tuple()
for object_id, json_data in objects:
data = json.loads(json_data)
data['id'] = object_id
if self._check_query(data, query):
yield data
def _check_query(self, document: dict, query: dict) -> bool:
matched = True
for k, query_value in query.items():
key_value = document
for name in k.split('.'):
key_value = key_value.get(name) if isinstance(key_value, dict) else None
if key_value is None:
break
if isinstance(query_value, dict):
matched = self._check_query(key_value, query_value)
else:
matched = key_value == query_value
if not matched:
return False
return matched
def save(self, data: dict) -> int:
object_id = data['id']
if not object_id:
object_id = self.create(data, auto_generate_id=True)
else:
table = self._table_name
sql = f'UPDATE {table} SET data=? WHERE id=?'
cursor = self.__execute_sql(sql, json.dumps(data), object_id)
if cursor.rowcount == 0:
raise Exception(f'Object `{object_id}` not found')
return object_id
def delete(self, object_id: int, check_deleted_count: bool = True) -> None:
table = self._table_name
sql = f'DELETE FROM {table} WHERE id=?'
cursor = self.__execute_sql(sql, object_id)
if check_deleted_count and cursor.rowcount != 1:
raise Exception(f'Object `{object_id}` not found')
def close(self) -> None:
self._connection.commit()
self._connection.close() | [
1,
1053,
4390,
13,
5215,
21120,
29941,
13,
5215,
19229,
13,
3166,
19229,
1053,
28379,
29892,
360,
919,
13,
3166,
3509,
1053,
6483,
8552,
13,
3166,
3030,
1982,
1053,
21301,
13,
13,
3166,
289,
1100,
29889,
3318,
333,
1053,
4669,
1204,
13,
3166,
282,
962,
7443,
1053,
18294,
4032,
13,
3166,
282,
962,
7443,
29889,
12523,
1053,
20999,
2392,
13,
13,
13,
1990,
18294,
10486,
2451,
29898,
2451,
1125,
13,
1678,
1209,
13,
13,
13,
1990,
18294,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3957,
29918,
1807,
29892,
334,
29892,
4333,
29922,
8516,
29892,
4833,
29918,
978,
29922,
8516,
1125,
13,
4706,
565,
4333,
338,
6213,
29901,
13,
9651,
12020,
18294,
10486,
2451,
877,
29952,
10855,
29952,
338,
3734,
1495,
13,
4706,
1583,
3032,
9465,
353,
18294,
4032,
29898,
9965,
29918,
1807,
29897,
13,
4706,
411,
21301,
29898,
8614,
2392,
1125,
13,
9651,
4833,
353,
1583,
3032,
9465,
29889,
657,
29918,
9803,
29898,
2585,
29918,
978,
29897,
13,
4706,
565,
4833,
338,
6213,
29901,
13,
9651,
12020,
18294,
10486,
2451,
29898,
13,
18884,
525,
3492,
505,
304,
6084,
2566,
1024,
525,
13,
18884,
525,
29872,
2121,
297,
3957,
1347,
470,
408,
421,
2585,
29918,
978,
29952,
3443,
1495,
13,
4706,
1583,
3032,
10855,
353,
4833,
29889,
657,
29918,
10855,
29898,
10855,
29897,
13,
13,
1678,
822,
1653,
29898,
1311,
29892,
848,
29901,
9657,
29892,
4469,
29918,
17158,
29918,
333,
29922,
8824,
1125,
13,
4706,
848,
353,
6483,
8552,
29898,
1272,
29897,
13,
4706,
565,
376,
333,
29908,
297,
848,
29901,
13,
9651,
848,
3366,
29918,
333,
3108,
353,
848,
3366,
333,
3108,
13,
9651,
628,
848,
3366,
333,
3108,
13,
4706,
25342,
451,
4469,
29918,
17158,
29918,
333,
29901,
13,
9651,
12020,
18294,
10486,
2451,
703,
29952,
333,
29952,
3734,
1159,
13,
4706,
1203,
29918,
333,
353,
1583,
3032,
10855,
29889,
7851,
29918,
650,
29898,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
565,
338,
8758,
29898,
3318,
29918,
333,
29892,
4669,
1204,
1125,
13,
9651,
1203,
29918,
333,
353,
851,
29898,
3318,
29918,
333,
29897,
13,
4706,
736,
1203,
29918,
333,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
1203,
29918,
333,
29892,
4418,
29918,
361,
29918,
1333,
29918,
9933,
29922,
8824,
1125,
13,
4706,
2346,
353,
1203,
29918,
333,
565,
338,
8758,
29898,
3318,
29918,
333,
29892,
9657,
29897,
1683,
8853,
29918,
333,
1115,
1203,
29918,
333,
29913,
13,
4706,
848,
353,
1583,
3032,
10855,
29889,
2886,
29918,
650,
29898,
1972,
29897,
13,
4706,
565,
4418,
29918,
361,
29918,
1333,
29918,
9933,
322,
451,
848,
29901,
13,
9651,
12020,
18294,
10486,
2451,
29898,
29888,
29908,
2061,
451,
1476,
29889,
13641,
29901,
426,
1972,
27195,
13,
4706,
565,
848,
29901,
13,
9651,
848,
3366,
333,
3108,
353,
848,
3366,
29918,
333,
3108,
13,
9651,
628,
848,
3366,
29918,
333,
3108,
13,
9651,
736,
848,
13,
13,
1678,
822,
679,
29918,
497,
29898,
1311,
29892,
2346,
1125,
13,
4706,
363,
1842,
297,
1583,
3032,
10855,
29889,
2886,
29898,
1972,
1125,
13,
9651,
1842,
3366,
333,
3108,
353,
1842,
3366,
29918,
333,
3108,
13,
9651,
628,
1842,
3366,
29918,
333,
3108,
13,
9651,
7709,
1842,
13,
13,
1678,
822,
4078,
29898,
1311,
29892,
848,
29901,
9657,
1125,
13,
4706,
1203,
29918,
333,
353,
848,
29889,
657,
703,
333,
1159,
13,
4706,
565,
1203,
29918,
333,
29901,
13,
9651,
848,
3366,
29918,
333,
3108,
353,
1203,
29918,
333,
13,
9651,
628,
848,
3366,
333,
3108,
13,
9651,
2346,
353,
8853,
29918,
333,
1115,
1203,
29918,
333,
29913,
13,
9651,
1121,
353,
1583,
3032,
10855,
29889,
5504,
29918,
650,
29898,
1972,
29892,
8853,
29938,
842,
1115,
848,
1800,
13,
9651,
565,
1121,
29889,
4352,
287,
29918,
2798,
1275,
29871,
29900,
29901,
13,
18884,
12020,
18294,
10486,
2451,
29898,
29888,
29908,
2061,
23230,
3318,
29918,
333,
10114,
451,
1476,
1159,
13,
9651,
848,
3366,
333,
3108,
353,
1203,
29918,
333,
13,
4706,
1683,
29901,
13,
9651,
1203,
29918,
333,
353,
851,
29898,
1311,
3032,
10855,
29889,
7851,
29918,
650,
29898,
1272,
467,
7851,
287,
29918,
333,
29897,
13,
9651,
565,
338,
8758,
29898,
3318,
29918,
333,
29892,
4669,
1204,
1125,
13,
18884,
1203,
29918,
333,
353,
851,
29898,
3318,
29918,
333,
29897,
13,
9651,
848,
3366,
333,
3108,
353,
1203,
29918,
333,
13,
4706,
736,
1203,
29918,
333,
13,
13,
1678,
822,
5217,
29898,
1311,
29892,
1203,
29918,
333,
29892,
1423,
29918,
311,
22742,
29918,
2798,
29922,
5574,
1125,
13,
4706,
1121,
353,
1583,
3032,
10855,
29889,
8143,
29918,
650,
3319,
29908,
29918,
333,
1115,
1203,
29918,
333,
1800,
13,
4706,
565,
1423,
29918,
311,
22742,
29918,
2798,
322,
1121,
29889,
311,
22742,
29918,
2798,
2804,
29871,
29896,
29901,
13,
9651,
12020,
18294,
10486,
2451,
29898,
29888,
29908,
2061,
23230,
3318,
29918,
333,
10114,
451,
1476,
1159,
13,
13,
1678,
822,
3802,
29898,
1311,
1125,
13,
4706,
1583,
3032,
9465,
29889,
5358,
580,
13,
13,
13,
1990,
13093,
568,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4516,
2084,
29901,
851,
29892,
334,
29892,
4333,
29901,
851,
353,
6213,
29892,
4833,
29918,
978,
29901,
851,
353,
6213,
29897,
1599,
6213,
29901,
13,
4706,
4833,
29918,
1445,
2084,
353,
285,
29915,
29912,
3972,
2084,
6822,
29912,
2585,
29918,
978,
10162,
13,
4706,
1583,
3032,
9965,
353,
21120,
29941,
29889,
6915,
29898,
2585,
29918,
1445,
2084,
29897,
13,
4706,
1583,
3032,
2371,
29918,
978,
353,
4333,
13,
4706,
1583,
17255,
7978,
29918,
2850,
29898,
13,
9651,
285,
29915,
27045,
10911,
10762,
6058,
28731,
426,
10855,
10162,
13,
9651,
525,
29898,
333,
2672,
4330,
17070,
29778,
14636,
26524,
6992,
22245,
13780,
29892,
848,
323,
12194,
16029,
13,
4706,
1723,
13,
13,
1678,
822,
4770,
7978,
29918,
2850,
29898,
1311,
29892,
4576,
29901,
851,
29892,
334,
5085,
29897,
1599,
21120,
29941,
29889,
19890,
29901,
13,
4706,
4576,
353,
4576,
29889,
17010,
2141,
21064,
580,
13,
4706,
10677,
353,
1583,
3032,
9965,
29889,
7978,
29898,
2850,
29892,
6389,
29897,
13,
4706,
565,
451,
4576,
29889,
27382,
2541,
877,
6404,
29374,
13,
9651,
1583,
3032,
9965,
29889,
15060,
580,
13,
4706,
736,
10677,
13,
13,
1678,
822,
1653,
29898,
1311,
29892,
848,
29901,
9657,
29892,
4469,
29918,
17158,
29918,
333,
29901,
6120,
353,
7700,
29897,
1599,
938,
29901,
13,
4706,
1591,
353,
1583,
3032,
2371,
29918,
978,
13,
4706,
565,
4469,
29918,
17158,
29918,
333,
29901,
13,
9651,
565,
525,
333,
29915,
297,
848,
29901,
13,
18884,
628,
848,
1839,
333,
2033,
13,
9651,
4576,
353,
285,
29915,
19460,
11646,
426,
2371,
2119,
1272,
29897,
15673,
29898,
7897,
29915,
13,
9651,
10677,
353,
1583,
17255,
7978,
29918,
2850,
29898,
2850,
29892,
4390,
29889,
29881,
17204,
29898,
1272,
876,
13,
4706,
1683,
29901,
13,
9651,
1203,
29918,
333,
353,
848,
1839,
333,
2033,
13,
9651,
565,
1203,
29918,
333,
5277,
29871,
29900,
29901,
13,
18884,
12020,
8960,
29898,
29888,
29915,
13919,
1178,
23230,
3318,
29918,
333,
29913,
1412,
5163,
1818,
367,
6736,
29871,
29900,
1495,
13,
9651,
10677,
353,
1583,
17255,
7978,
29918,
2850,
29898,
29888,
29915,
19460,
11646,
426,
2371,
2119,
333,
29892,
848,
29897,
15673,
10780,
29892,
1577,
29897,
742,
13,
462,
462,
4706,
1203,
29918,
333,
29892,
4390,
29889,
29881,
17204,
29898,
1272,
876,
13,
4706,
736,
10677,
29889,
4230,
798,
333,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
1203,
29918,
333,
29901,
938,
29892,
4418,
29918,
361,
29918,
1333,
29918,
9933,
29901,
6120,
353,
7700,
29897,
1599,
360,
919,
29901,
13,
4706,
2346,
353,
1203,
29918,
333,
565,
338,
8758,
29898,
3318,
29918,
333,
29892,
9657,
29897,
1683,
11117,
333,
2396,
1203,
29918,
333,
29913,
13,
4706,
3618,
353,
1583,
29889,
657,
29918,
497,
29898,
1972,
29897,
13,
4706,
1121,
353,
1051,
29898,
12650,
29897,
13,
4706,
565,
4418,
29918,
361,
29918,
1333,
29918,
9933,
322,
451,
1121,
29901,
13,
9651,
12020,
8960,
29898,
29888,
29915,
2061,
451,
1476,
29889,
13641,
29901,
426,
1972,
29913,
1495,
13,
4706,
736,
1121,
322,
1121,
29961,
29900,
29962,
13,
13,
1678,
822,
679,
29918,
497,
29898,
1311,
29892,
2346,
29901,
28379,
29961,
21533,
29962,
353,
6213,
29897,
1599,
19229,
29889,
21575,
29901,
13,
4706,
565,
2346,
338,
6213,
29901,
13,
9651,
2346,
353,
6571,
13,
4706,
1591,
353,
1583,
3032,
2371,
29918,
978,
13,
4706,
6389,
353,
18761,
580,
13,
4706,
565,
525,
333,
29915,
297,
2346,
29901,
13,
9651,
4576,
353,
285,
29915,
6404,
1178,
29892,
848,
3895,
426,
2371,
29913,
5754,
1178,
29922,
17901,
13,
9651,
6389,
353,
313,
1972,
1839,
333,
7464,
29897,
13,
4706,
1683,
29901,
13,
9651,
4576,
353,
285,
29915,
6404,
1178,
29892,
848,
3895,
426,
2371,
10162,
13,
4706,
10677,
353,
1583,
17255,
7978,
29918,
2850,
29898,
2850,
29892,
334,
5085,
29897,
13,
4706,
3618,
353,
10677,
29889,
9155,
497,
580,
13,
4706,
565,
451,
3618,
29901,
13,
9651,
736,
18761,
580,
13,
4706,
363,
1203,
29918,
333,
29892,
4390,
29918,
1272,
297,
3618,
29901,
13,
9651,
848,
353,
4390,
29889,
18132,
29898,
3126,
29918,
1272,
29897,
13,
9651,
848,
1839,
333,
2033,
353,
1203,
29918,
333,
13,
9651,
565,
1583,
3032,
3198,
29918,
1972,
29898,
1272,
29892,
2346,
1125,
13,
18884,
7709,
848,
13,
13,
1678,
822,
903,
3198,
29918,
1972,
29898,
1311,
29892,
1842,
29901,
9657,
29892,
2346,
29901,
9657,
29897,
1599,
6120,
29901,
13,
4706,
19228,
353,
5852,
13,
4706,
363,
413,
29892,
2346,
29918,
1767,
297,
2346,
29889,
7076,
7295,
13,
9651,
1820,
29918,
1767,
353,
1842,
13,
9651,
363,
1024,
297,
413,
29889,
5451,
877,
6169,
1125,
13,
18884,
1820,
29918,
1767,
353,
1820,
29918,
1767,
29889,
657,
29898,
978,
29897,
565,
338,
8758,
29898,
1989,
29918,
1767,
29892,
9657,
29897,
1683,
6213,
13,
18884,
565,
1820,
29918,
1767,
338,
6213,
29901,
13,
462,
1678,
2867,
13,
9651,
565,
338,
8758,
29898,
1972,
29918,
1767,
29892,
9657,
1125,
13,
18884,
19228,
353,
1583,
3032,
3198,
29918,
1972,
29898,
1989,
29918,
1767,
29892,
2346,
29918,
1767,
29897,
13,
9651,
1683,
29901,
13,
18884,
19228,
353,
1820,
29918,
1767,
1275,
2346,
29918,
1767,
13,
9651,
565,
451,
19228,
29901,
13,
18884,
736,
7700,
13,
4706,
736,
19228,
13,
13,
1678,
822,
4078,
29898,
1311,
29892,
848,
29901,
9657,
29897,
1599,
938,
29901,
13,
4706,
1203,
29918,
333,
353,
848,
1839,
333,
2033,
13,
4706,
565,
451,
1203,
29918,
333,
29901,
13,
9651,
1203,
29918,
333,
353,
1583,
29889,
3258,
29898,
1272,
29892,
4469,
29918,
17158,
29918,
333,
29922,
5574,
29897,
13,
4706,
1683,
29901,
13,
9651,
1591,
353,
1583,
3032,
2371,
29918,
978,
13,
9651,
4576,
353,
285,
29915,
14474,
426,
2371,
29913,
11368,
848,
29922,
29973,
5754,
1178,
29922,
17901,
13,
9651,
10677,
353,
1583,
17255,
7978,
29918,
2850,
29898,
2850,
29892,
4390,
29889,
29881,
17204,
29898,
1272,
511,
1203,
29918,
333,
29897,
13,
9651,
565,
10677,
29889,
798,
2798,
1275,
29871,
29900,
29901,
13,
18884,
12020,
8960,
29898,
29888,
29915,
2061,
23230,
3318,
29918,
333,
10114,
451,
1476,
1495,
13,
4706,
736,
1203,
29918,
333,
13,
13,
1678,
822,
5217,
29898,
1311,
29892,
1203,
29918,
333,
29901,
938,
29892,
1423,
29918,
311,
22742,
29918,
2798,
29901,
6120,
353,
5852,
29897,
1599,
6213,
29901,
13,
4706,
1591,
353,
1583,
3032,
2371,
29918,
978,
13,
4706,
4576,
353,
285,
29915,
2287,
18476,
3895,
426,
2371,
29913,
5754,
1178,
29922,
17901,
13,
4706,
10677,
353,
1583,
17255,
7978,
29918,
2850,
29898,
2850,
29892,
1203,
29918,
333,
29897,
13,
4706,
565,
1423,
29918,
311,
22742,
29918,
2798,
322,
10677,
29889,
798,
2798,
2804,
29871,
29896,
29901,
13,
9651,
12020,
8960,
29898,
29888,
29915,
2061,
23230,
3318,
29918,
333,
10114,
451,
1476,
1495,
13,
13,
1678,
822,
3802,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
1583,
3032,
9965,
29889,
15060,
580,
13,
4706,
1583,
3032,
9965,
29889,
5358,
580,
2
] |
hubspot/crm/products/api/__init__.py | fakepop/hubspot-api-python | 117 | 43727 | <reponame>fakepop/hubspot-api-python
from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from hubspot.crm.products.api.associations_api import AssociationsApi
from hubspot.crm.products.api.basic_api import BasicApi
from hubspot.crm.products.api.batch_api import BatchApi
from hubspot.crm.products.api.search_api import SearchApi
| [
1,
529,
276,
1112,
420,
29958,
29888,
1296,
7323,
29914,
29882,
431,
17500,
29899,
2754,
29899,
4691,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
13,
29937,
17422,
446,
29947,
29901,
694,
25621,
13,
13,
29937,
1053,
3095,
275,
964,
7882,
3577,
13,
3166,
19766,
17500,
29889,
29883,
1758,
29889,
14456,
29889,
2754,
29889,
21264,
800,
29918,
2754,
1053,
6853,
800,
11713,
13,
3166,
19766,
17500,
29889,
29883,
1758,
29889,
14456,
29889,
2754,
29889,
16121,
29918,
2754,
1053,
19219,
11713,
13,
3166,
19766,
17500,
29889,
29883,
1758,
29889,
14456,
29889,
2754,
29889,
16175,
29918,
2754,
1053,
350,
905,
11713,
13,
3166,
19766,
17500,
29889,
29883,
1758,
29889,
14456,
29889,
2754,
29889,
4478,
29918,
2754,
1053,
11856,
11713,
13,
2
] |
yoon/stage1_kernel.py | yoon28/realsr-noise-injection | 17 | 6379 | <reponame>yoon28/realsr-noise-injection
import os, sys
import numpy as np
import cv2
import random
import torch
from configs import Config
from kernelGAN import KernelGAN
from data import DataGenerator
from learner import Learner
import tqdm
DATA_LOC = "/mnt/data/NTIRE2020/realSR/track2" # "/mnt/data/NTIRE2020/realSR/track1"
DATA_X = "DPEDiphone-tr-x" # "Corrupted-tr-x"
DATA_Y = "DPEDiphone-tr-y" # "Corrupted-tr-y"
DATA_VAL = "DPEDiphone-va" # "Corrupted-va-x"
def config_kernelGAN(afile):
img_folder = os.path.dirname(afile)
img_file = os.path.basename(afile)
out_dir = "yoon/kernels/track2"
params = ["--input_image_path", afile,
"--output_dir_path", out_dir,
"--noise_scale", str(1.0),
"--X4"]
conf = Config().parse(params)
conf.input2 = None
return conf
def estimate_kernel(img_file):
conf = config_kernelGAN(img_file)
kgan = KernelGAN(conf)
learner = Learner()
data = DataGenerator(conf, kgan)
for iteration in tqdm.tqdm(range(conf.max_iters), ncols=70):
[g_in, d_in, _] = data.__getitem__(iteration)
kgan.train(g_in, d_in)
learner.update(iteration, kgan)
kgan.finish()
if __name__ == "__main__":
seed_num = 0
torch.manual_seed(seed_num)
torch.cuda.manual_seed(seed_num)
torch.cuda.manual_seed_all(seed_num)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
np.random.seed(seed_num)
random.seed(seed_num)
# exit(0)
data = {"X":[os.path.join(DATA_LOC, DATA_X, f) for f in os.listdir(os.path.join(DATA_LOC, DATA_X)) if f[-4:] == ".png"],
"Y":[os.path.join(DATA_LOC, DATA_Y, f) for f in os.listdir(os.path.join(DATA_LOC, DATA_Y)) if f[-4:] == ".png"],
"val":[os.path.join(DATA_LOC, DATA_VAL, f) for f in os.listdir(os.path.join(DATA_LOC, DATA_VAL)) if f[-4:] == ".png"]}
Kernels = []
Noises = []
for f in data["X"]:
estimate_kernel(f)
print("fin.")
| [
1,
529,
276,
1112,
420,
29958,
29891,
6150,
29906,
29947,
29914,
276,
1338,
29878,
29899,
1217,
895,
29899,
262,
6929,
13,
5215,
2897,
29892,
10876,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
13850,
29906,
13,
5215,
4036,
13,
5215,
4842,
305,
13,
13,
3166,
2295,
29879,
1053,
12782,
13,
3166,
8466,
29954,
2190,
1053,
476,
5851,
29954,
2190,
13,
3166,
848,
1053,
3630,
21575,
13,
3166,
24298,
1089,
1053,
19530,
1089,
13,
13,
5215,
260,
29939,
18933,
13,
13,
14573,
29918,
16652,
353,
5591,
29885,
593,
29914,
1272,
29914,
20321,
29902,
1525,
29906,
29900,
29906,
29900,
29914,
6370,
14098,
29914,
11294,
29906,
29908,
396,
5591,
29885,
593,
29914,
1272,
29914,
20321,
29902,
1525,
29906,
29900,
29906,
29900,
29914,
6370,
14098,
29914,
11294,
29896,
29908,
13,
14573,
29918,
29990,
353,
376,
11191,
3352,
29875,
6710,
29899,
509,
29899,
29916,
29908,
396,
376,
12521,
14214,
29899,
509,
29899,
29916,
29908,
13,
14573,
29918,
29979,
353,
376,
11191,
3352,
29875,
6710,
29899,
509,
29899,
29891,
29908,
396,
376,
12521,
14214,
29899,
509,
29899,
29891,
29908,
13,
14573,
29918,
8932,
353,
376,
11191,
3352,
29875,
6710,
29899,
1564,
29908,
396,
376,
12521,
14214,
29899,
1564,
29899,
29916,
29908,
13,
13,
1753,
2295,
29918,
17460,
29954,
2190,
29898,
29874,
1445,
1125,
13,
1678,
10153,
29918,
12083,
353,
2897,
29889,
2084,
29889,
25721,
29898,
29874,
1445,
29897,
13,
1678,
10153,
29918,
1445,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
29874,
1445,
29897,
13,
1678,
714,
29918,
3972,
353,
376,
29891,
6150,
29914,
22178,
1379,
29914,
11294,
29906,
29908,
13,
13,
1678,
8636,
353,
6796,
489,
2080,
29918,
3027,
29918,
2084,
613,
263,
1445,
29892,
13,
9651,
376,
489,
4905,
29918,
3972,
29918,
2084,
613,
714,
29918,
3972,
29892,
13,
9651,
376,
489,
1217,
895,
29918,
7052,
613,
851,
29898,
29896,
29889,
29900,
511,
13,
9651,
376,
489,
29990,
29946,
3108,
13,
1678,
1970,
353,
12782,
2141,
5510,
29898,
7529,
29897,
13,
1678,
1970,
29889,
2080,
29906,
353,
6213,
13,
1678,
736,
1970,
13,
13,
1753,
12678,
29918,
17460,
29898,
2492,
29918,
1445,
1125,
13,
1678,
1970,
353,
2295,
29918,
17460,
29954,
2190,
29898,
2492,
29918,
1445,
29897,
13,
1678,
413,
6249,
353,
476,
5851,
29954,
2190,
29898,
5527,
29897,
13,
1678,
24298,
1089,
353,
19530,
1089,
580,
13,
1678,
848,
353,
3630,
21575,
29898,
5527,
29892,
413,
6249,
29897,
13,
1678,
363,
12541,
297,
260,
29939,
18933,
29889,
29873,
29939,
18933,
29898,
3881,
29898,
5527,
29889,
3317,
29918,
277,
414,
511,
302,
22724,
29922,
29955,
29900,
1125,
13,
4706,
518,
29887,
29918,
262,
29892,
270,
29918,
262,
29892,
903,
29962,
353,
848,
17255,
657,
667,
12035,
1524,
362,
29897,
13,
4706,
413,
6249,
29889,
14968,
29898,
29887,
29918,
262,
29892,
270,
29918,
262,
29897,
13,
4706,
24298,
1089,
29889,
5504,
29898,
1524,
362,
29892,
413,
6249,
29897,
13,
1678,
413,
6249,
29889,
4951,
728,
580,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
16717,
29918,
1949,
353,
29871,
29900,
13,
1678,
4842,
305,
29889,
11288,
29918,
26776,
29898,
26776,
29918,
1949,
29897,
13,
1678,
4842,
305,
29889,
29883,
6191,
29889,
11288,
29918,
26776,
29898,
26776,
29918,
1949,
29897,
13,
1678,
4842,
305,
29889,
29883,
6191,
29889,
11288,
29918,
26776,
29918,
497,
29898,
26776,
29918,
1949,
29897,
13,
1678,
4842,
305,
29889,
1627,
1975,
29889,
29883,
566,
15755,
29889,
4801,
837,
262,
4695,
353,
5852,
13,
1678,
4842,
305,
29889,
1627,
1975,
29889,
29883,
566,
15755,
29889,
1785,
16580,
353,
7700,
13,
1678,
7442,
29889,
8172,
29889,
26776,
29898,
26776,
29918,
1949,
29897,
13,
1678,
4036,
29889,
26776,
29898,
26776,
29918,
1949,
29897,
13,
13,
1678,
396,
6876,
29898,
29900,
29897,
13,
13,
1678,
848,
353,
8853,
29990,
1115,
29961,
359,
29889,
2084,
29889,
7122,
29898,
14573,
29918,
16652,
29892,
360,
8254,
29918,
29990,
29892,
285,
29897,
363,
285,
297,
2897,
29889,
1761,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
14573,
29918,
16652,
29892,
360,
8254,
29918,
29990,
876,
565,
285,
14352,
29946,
17531,
1275,
11393,
2732,
12436,
13,
9651,
376,
29979,
1115,
29961,
359,
29889,
2084,
29889,
7122,
29898,
14573,
29918,
16652,
29892,
360,
8254,
29918,
29979,
29892,
285,
29897,
363,
285,
297,
2897,
29889,
1761,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
14573,
29918,
16652,
29892,
360,
8254,
29918,
29979,
876,
565,
285,
14352,
29946,
17531,
1275,
11393,
2732,
12436,
13,
9651,
376,
791,
1115,
29961,
359,
29889,
2084,
29889,
7122,
29898,
14573,
29918,
16652,
29892,
360,
8254,
29918,
8932,
29892,
285,
29897,
363,
285,
297,
2897,
29889,
1761,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
14573,
29918,
16652,
29892,
360,
8254,
29918,
8932,
876,
565,
285,
14352,
29946,
17531,
1275,
11393,
2732,
3108,
29913,
13,
13,
1678,
476,
824,
1379,
353,
5159,
13,
1678,
1939,
4637,
353,
5159,
13,
1678,
363,
285,
297,
848,
3366,
29990,
3108,
29901,
13,
4706,
12678,
29918,
17460,
29898,
29888,
29897,
13,
1678,
1596,
703,
4951,
23157,
13,
2
] |
code/doubanUtils.py | verazuo/douban_crawler | 1 | 7143 | <gh_stars>1-10
import requests
import re
from bs4 import BeautifulSoup
def nextPageLink(sess,soup,page,head=""):
NextPage=soup.find(class_='next').link.get('href')
req=sess.get(head + NextPage)
print(f'第{page}页:',req.status_code)
return BeautifulSoup(req.text,'html.parser') | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
7274,
13,
5215,
337,
13,
3166,
24512,
29946,
1053,
25685,
29903,
1132,
13,
13,
13,
1753,
2446,
5074,
6595,
29898,
29879,
404,
29892,
29879,
1132,
29892,
3488,
29892,
2813,
13776,
1125,
13,
1678,
8084,
5074,
29922,
29879,
1132,
29889,
2886,
29898,
1990,
29918,
2433,
4622,
2824,
2324,
29889,
657,
877,
12653,
1495,
13,
1678,
12428,
29922,
29879,
404,
29889,
657,
29898,
2813,
718,
8084,
5074,
29897,
13,
1678,
1596,
29898,
29888,
29915,
30622,
29912,
3488,
29913,
31610,
30383,
742,
7971,
29889,
4882,
29918,
401,
29897,
13,
1678,
736,
25685,
29903,
1132,
29898,
7971,
29889,
726,
5501,
1420,
29889,
16680,
1495,
2
] |
flask_application/script.py | fmarella/dalie-flask | 8 | 1601425 | <reponame>fmarella/dalie-flask
from flask.ext.script import Command
from flask_application.populate import populate_data
from flask_application.models import db, User, Role
class ResetDB(Command):
"""Drops all tables and recreates them"""
def run(self, **kwargs):
for m in [User, Role]:
m.drop()
class PopulateDB(Command):
"""Fills in predefined data into DB"""
def run(self, **kwargs):
populate_data()
| [
1,
529,
276,
1112,
420,
29958,
24826,
598,
13520,
29914,
12293,
347,
29899,
1579,
1278,
13,
3166,
29784,
29889,
1062,
29889,
2154,
1053,
10516,
13,
3166,
29784,
29918,
6214,
29889,
7323,
5987,
1053,
19450,
29918,
1272,
13,
3166,
29784,
29918,
6214,
29889,
9794,
1053,
4833,
29892,
4911,
29892,
1528,
280,
13,
13,
13,
1990,
2538,
300,
4051,
29898,
6255,
1125,
13,
1678,
9995,
29928,
307,
567,
599,
6131,
322,
28709,
1078,
963,
15945,
29908,
13,
1678,
822,
1065,
29898,
1311,
29892,
3579,
19290,
1125,
13,
4706,
363,
286,
297,
518,
2659,
29892,
1528,
280,
5387,
13,
9651,
286,
29889,
8865,
580,
13,
13,
1990,
6977,
5987,
4051,
29898,
6255,
1125,
13,
1678,
9995,
29943,
6090,
297,
758,
12119,
848,
964,
6535,
15945,
29908,
13,
1678,
822,
1065,
29898,
1311,
29892,
3579,
19290,
1125,
13,
4706,
19450,
29918,
1272,
580,
13,
2
] |
mat2py/core/specgraph.py | mat2py/mat2py | 0 | 181999 | # type: ignore
__all__ = [
"meshc",
"barh",
"trisurf",
"compass",
"isonormals",
"plotutils",
"ezcontour",
"streamslice",
"scatter",
"rgb2ind",
"usev6plotapi",
"quiver",
"streamline",
"triplot",
"tetramesh",
"rose",
"patch",
"comet",
"voronoi",
"contourslice",
"histogram",
"errorbar",
"reducepatch",
"ezgraph3",
"interpstreamspeed",
"shrinkfaces",
"ezplot3",
"ezpolar",
"curl",
"stream3",
"contour",
"contours",
"coneplot",
"rotate",
"isosurface",
"pie3",
"specgraphhelper",
"stem",
"frame2im",
"comet3",
"ezmeshc",
"contourf",
"fplot",
"quiver3",
"isocolors",
"soundview",
"ellipsoid",
"parseplotapi",
"streamtube",
"changeseriestype",
"makebars",
"bar3h",
"image",
"trimesh",
"clabel",
"fill",
"spinmap",
"plotmatrix",
"ezsurf",
"divergence",
"ind2rgb",
"pareto",
"isocaps",
"moviein",
"pie",
"contourc",
"feather",
"hgline2lineseries",
"ezcontourf",
"stairs",
"surfc",
"im2java",
"ezplot",
"im2frame",
"colstyle",
"movieview",
"contour3",
"rgbplot",
"surf2patch",
"dither",
"contrast",
"waterfall",
"cylinder",
"bar",
"slice",
"histogram2",
"streamribbon",
"pcolor",
"ribbon",
"isplotchild",
"sphere",
"reducevolume",
"ezsurfc",
"imagesc",
"subvolume",
"streamparticles",
"volumebounds",
"plotchild",
"area",
"meshz",
"imageview",
"stem3",
"scatter3",
"ezmesh",
"plotdoneevent",
"stream2",
"vissuite",
"bar3",
"smooth3",
]
def meshc(*args):
raise NotImplementedError("meshc")
def barh(*args):
raise NotImplementedError("barh")
def trisurf(*args):
raise NotImplementedError("trisurf")
def compass(*args):
raise NotImplementedError("compass")
def isonormals(*args):
raise NotImplementedError("isonormals")
def plotutils(*args):
raise NotImplementedError("plotutils")
def ezcontour(*args):
raise NotImplementedError("ezcontour")
def streamslice(*args):
raise NotImplementedError("streamslice")
def scatter(*args):
raise NotImplementedError("scatter")
def rgb2ind(*args):
raise NotImplementedError("rgb2ind")
def usev6plotapi(*args):
raise NotImplementedError("usev6plotapi")
def quiver(*args):
raise NotImplementedError("quiver")
def streamline(*args):
raise NotImplementedError("streamline")
def triplot(*args):
raise NotImplementedError("triplot")
def tetramesh(*args):
raise NotImplementedError("tetramesh")
def rose(*args):
raise NotImplementedError("rose")
def patch(*args):
raise NotImplementedError("patch")
def comet(*args):
raise NotImplementedError("comet")
def voronoi(*args):
raise NotImplementedError("voronoi")
def contourslice(*args):
raise NotImplementedError("contourslice")
def histogram(*args):
raise NotImplementedError("histogram")
def errorbar(*args):
raise NotImplementedError("errorbar")
def reducepatch(*args):
raise NotImplementedError("reducepatch")
def ezgraph3(*args):
raise NotImplementedError("ezgraph3")
def interpstreamspeed(*args):
raise NotImplementedError("interpstreamspeed")
def shrinkfaces(*args):
raise NotImplementedError("shrinkfaces")
def ezplot3(*args):
raise NotImplementedError("ezplot3")
def ezpolar(*args):
raise NotImplementedError("ezpolar")
def curl(*args):
raise NotImplementedError("curl")
def stream3(*args):
raise NotImplementedError("stream3")
def contour(*args):
raise NotImplementedError("contour")
def contours(*args):
raise NotImplementedError("contours")
def coneplot(*args):
raise NotImplementedError("coneplot")
def rotate(*args):
raise NotImplementedError("rotate")
def isosurface(*args):
raise NotImplementedError("isosurface")
def pie3(*args):
raise NotImplementedError("pie3")
def specgraphhelper(*args):
raise NotImplementedError("specgraphhelper")
def stem(*args):
raise NotImplementedError("stem")
def frame2im(*args):
raise NotImplementedError("frame2im")
def comet3(*args):
raise NotImplementedError("comet3")
def ezmeshc(*args):
raise NotImplementedError("ezmeshc")
def contourf(*args):
raise NotImplementedError("contourf")
def fplot(*args):
raise NotImplementedError("fplot")
def quiver3(*args):
raise NotImplementedError("quiver3")
def isocolors(*args):
raise NotImplementedError("isocolors")
def soundview(*args):
raise NotImplementedError("soundview")
def ellipsoid(*args):
raise NotImplementedError("ellipsoid")
def parseplotapi(*args):
raise NotImplementedError("parseplotapi")
def streamtube(*args):
raise NotImplementedError("streamtube")
def changeseriestype(*args):
raise NotImplementedError("changeseriestype")
def makebars(*args):
raise NotImplementedError("makebars")
def bar3h(*args):
raise NotImplementedError("bar3h")
def image(*args):
raise NotImplementedError("image")
def trimesh(*args):
raise NotImplementedError("trimesh")
def clabel(*args):
raise NotImplementedError("clabel")
def fill(*args):
raise NotImplementedError("fill")
def spinmap(*args):
raise NotImplementedError("spinmap")
def plotmatrix(*args):
raise NotImplementedError("plotmatrix")
def ezsurf(*args):
raise NotImplementedError("ezsurf")
def divergence(*args):
raise NotImplementedError("divergence")
def ind2rgb(*args):
raise NotImplementedError("ind2rgb")
def pareto(*args):
raise NotImplementedError("pareto")
def isocaps(*args):
raise NotImplementedError("isocaps")
def moviein(*args):
raise NotImplementedError("moviein")
def pie(*args):
raise NotImplementedError("pie")
def contourc(*args):
raise NotImplementedError("contourc")
def feather(*args):
raise NotImplementedError("feather")
def hgline2lineseries(*args):
raise NotImplementedError("hgline2lineseries")
def ezcontourf(*args):
raise NotImplementedError("ezcontourf")
def stairs(*args):
raise NotImplementedError("stairs")
def surfc(*args):
raise NotImplementedError("surfc")
def im2java(*args):
raise NotImplementedError("im2java")
def ezplot(*args):
raise NotImplementedError("ezplot")
def im2frame(*args):
raise NotImplementedError("im2frame")
def colstyle(*args):
raise NotImplementedError("colstyle")
def movieview(*args):
raise NotImplementedError("movieview")
def contour3(*args):
raise NotImplementedError("contour3")
def rgbplot(*args):
raise NotImplementedError("rgbplot")
def surf2patch(*args):
raise NotImplementedError("surf2patch")
def dither(*args):
raise NotImplementedError("dither")
def contrast(*args):
raise NotImplementedError("contrast")
def waterfall(*args):
raise NotImplementedError("waterfall")
def cylinder(*args):
raise NotImplementedError("cylinder")
def bar(*args):
raise NotImplementedError("bar")
def slice(*args):
raise NotImplementedError("slice")
def histogram2(*args):
raise NotImplementedError("histogram2")
def streamribbon(*args):
raise NotImplementedError("streamribbon")
def pcolor(*args):
raise NotImplementedError("pcolor")
def ribbon(*args):
raise NotImplementedError("ribbon")
def isplotchild(*args):
raise NotImplementedError("isplotchild")
def sphere(*args):
raise NotImplementedError("sphere")
def reducevolume(*args):
raise NotImplementedError("reducevolume")
def ezsurfc(*args):
raise NotImplementedError("ezsurfc")
def imagesc(*args):
raise NotImplementedError("imagesc")
def subvolume(*args):
raise NotImplementedError("subvolume")
def streamparticles(*args):
raise NotImplementedError("streamparticles")
def volumebounds(*args):
raise NotImplementedError("volumebounds")
def plotchild(*args):
raise NotImplementedError("plotchild")
def area(*args):
raise NotImplementedError("area")
def meshz(*args):
raise NotImplementedError("meshz")
def imageview(*args):
raise NotImplementedError("imageview")
def stem3(*args):
raise NotImplementedError("stem3")
def scatter3(*args):
raise NotImplementedError("scatter3")
def ezmesh(*args):
raise NotImplementedError("ezmesh")
def plotdoneevent(*args):
raise NotImplementedError("plotdoneevent")
def stream2(*args):
raise NotImplementedError("stream2")
def vissuite(*args):
raise NotImplementedError("vissuite")
def bar3(*args):
raise NotImplementedError("bar3")
def smooth3(*args):
raise NotImplementedError("smooth3")
| [
1,
396,
1134,
29901,
11455,
13,
13,
1649,
497,
1649,
353,
518,
13,
1678,
376,
4467,
29882,
29883,
613,
13,
1678,
376,
1646,
29882,
613,
13,
1678,
376,
509,
275,
332,
29888,
613,
13,
1678,
376,
2388,
465,
613,
13,
1678,
376,
2285,
555,
1338,
613,
13,
1678,
376,
5317,
13239,
613,
13,
1678,
376,
6096,
1285,
473,
613,
13,
1678,
376,
5461,
18337,
613,
13,
1678,
376,
1557,
2620,
613,
13,
1678,
376,
23973,
29906,
513,
613,
13,
1678,
376,
1509,
29894,
29953,
5317,
2754,
613,
13,
1678,
376,
339,
2147,
613,
13,
1678,
376,
5461,
1220,
613,
13,
1678,
376,
3626,
5317,
613,
13,
1678,
376,
29873,
18184,
1280,
29882,
613,
13,
1678,
376,
17811,
613,
13,
1678,
376,
5041,
613,
13,
1678,
376,
510,
300,
613,
13,
1678,
376,
5267,
3231,
29875,
613,
13,
1678,
376,
1285,
2470,
5897,
613,
13,
1678,
376,
29882,
391,
13342,
613,
13,
1678,
376,
2704,
1646,
613,
13,
1678,
376,
17469,
5041,
613,
13,
1678,
376,
6096,
4262,
29941,
613,
13,
1678,
376,
1639,
29886,
5461,
19322,
613,
13,
1678,
376,
845,
29878,
682,
8726,
613,
13,
1678,
376,
6096,
5317,
29941,
613,
13,
1678,
376,
6096,
3733,
279,
613,
13,
1678,
376,
18963,
613,
13,
1678,
376,
5461,
29941,
613,
13,
1678,
376,
1285,
473,
613,
13,
1678,
376,
1285,
2470,
613,
13,
1678,
376,
535,
29872,
5317,
613,
13,
1678,
376,
23361,
613,
13,
1678,
376,
275,
359,
332,
2161,
613,
13,
1678,
376,
12343,
29941,
613,
13,
1678,
376,
6550,
4262,
20907,
613,
13,
1678,
376,
303,
331,
613,
13,
1678,
376,
2557,
29906,
326,
613,
13,
1678,
376,
510,
300,
29941,
613,
13,
1678,
376,
6096,
4467,
29882,
29883,
613,
13,
1678,
376,
1285,
473,
29888,
613,
13,
1678,
376,
29888,
5317,
613,
13,
1678,
376,
339,
2147,
29941,
613,
13,
1678,
376,
275,
542,
324,
943,
613,
13,
1678,
376,
29802,
1493,
613,
13,
1678,
376,
5481,
567,
3398,
613,
13,
1678,
376,
5510,
5317,
2754,
613,
13,
1678,
376,
5461,
29873,
4003,
613,
13,
1678,
376,
25990,
261,
12239,
668,
613,
13,
1678,
376,
5675,
28408,
613,
13,
1678,
376,
1646,
29941,
29882,
613,
13,
1678,
376,
3027,
613,
13,
1678,
376,
509,
1355,
29882,
613,
13,
1678,
376,
695,
1107,
613,
13,
1678,
376,
5589,
613,
13,
1678,
376,
1028,
262,
1958,
613,
13,
1678,
376,
5317,
5344,
613,
13,
1678,
376,
6096,
7610,
29888,
613,
13,
1678,
376,
29881,
2147,
10238,
613,
13,
1678,
376,
513,
29906,
23973,
613,
13,
1678,
376,
29886,
598,
517,
613,
13,
1678,
376,
275,
542,
2547,
613,
13,
1678,
376,
27362,
262,
613,
13,
1678,
376,
12343,
613,
13,
1678,
376,
1285,
473,
29883,
613,
13,
1678,
376,
1725,
1624,
613,
13,
1678,
376,
29882,
29887,
1220,
29906,
9012,
6358,
613,
13,
1678,
376,
6096,
1285,
473,
29888,
613,
13,
1678,
376,
303,
7121,
613,
13,
1678,
376,
7610,
13801,
613,
13,
1678,
376,
326,
29906,
1645,
613,
13,
1678,
376,
6096,
5317,
613,
13,
1678,
376,
326,
29906,
2557,
613,
13,
1678,
376,
1054,
3293,
613,
13,
1678,
376,
27362,
1493,
613,
13,
1678,
376,
1285,
473,
29941,
613,
13,
1678,
376,
23973,
5317,
613,
13,
1678,
376,
7610,
29888,
29906,
5041,
613,
13,
1678,
376,
29881,
2121,
613,
13,
1678,
376,
9996,
579,
613,
13,
1678,
376,
13405,
11950,
613,
13,
1678,
376,
1270,
29880,
4995,
613,
13,
1678,
376,
1646,
613,
13,
1678,
376,
18337,
613,
13,
1678,
376,
29882,
391,
13342,
29906,
613,
13,
1678,
376,
5461,
1091,
6718,
613,
13,
1678,
376,
29886,
2780,
613,
13,
1678,
376,
1091,
6718,
613,
13,
1678,
376,
275,
5317,
5145,
613,
13,
1678,
376,
29879,
9085,
613,
13,
1678,
376,
17469,
24623,
613,
13,
1678,
376,
6096,
7610,
13801,
613,
13,
1678,
376,
8346,
29883,
613,
13,
1678,
376,
1491,
24623,
613,
13,
1678,
376,
13045,
1160,
18569,
613,
13,
1678,
376,
1555,
398,
774,
3885,
613,
13,
1678,
376,
5317,
5145,
613,
13,
1678,
376,
6203,
613,
13,
1678,
376,
4467,
29882,
29920,
613,
13,
1678,
376,
3027,
1493,
613,
13,
1678,
376,
303,
331,
29941,
613,
13,
1678,
376,
1557,
2620,
29941,
613,
13,
1678,
376,
6096,
4467,
29882,
613,
13,
1678,
376,
5317,
15091,
3696,
613,
13,
1678,
376,
5461,
29906,
613,
13,
1678,
376,
29894,
790,
29884,
568,
613,
13,
1678,
376,
1646,
29941,
613,
13,
1678,
376,
3844,
6983,
29941,
613,
13,
29962,
13,
13,
13,
1753,
27716,
29883,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
4467,
29882,
29883,
1159,
13,
13,
13,
1753,
2594,
29882,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1646,
29882,
1159,
13,
13,
13,
1753,
534,
275,
332,
29888,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
509,
275,
332,
29888,
1159,
13,
13,
13,
1753,
752,
465,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
2388,
465,
1159,
13,
13,
13,
1753,
338,
265,
555,
1338,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
2285,
555,
1338,
1159,
13,
13,
13,
1753,
6492,
13239,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5317,
13239,
1159,
13,
13,
13,
1753,
20803,
1285,
473,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6096,
1285,
473,
1159,
13,
13,
13,
1753,
4840,
18337,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5461,
18337,
1159,
13,
13,
13,
1753,
14801,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1557,
2620,
1159,
13,
13,
13,
1753,
15552,
29890,
29906,
513,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
23973,
29906,
513,
1159,
13,
13,
13,
1753,
671,
29894,
29953,
5317,
2754,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1509,
29894,
29953,
5317,
2754,
1159,
13,
13,
13,
1753,
1750,
369,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
339,
2147,
1159,
13,
13,
13,
1753,
4840,
1220,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5461,
1220,
1159,
13,
13,
13,
1753,
3367,
5317,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
3626,
5317,
1159,
13,
13,
13,
1753,
260,
18184,
1280,
29882,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29873,
18184,
1280,
29882,
1159,
13,
13,
13,
1753,
11492,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
17811,
1159,
13,
13,
13,
1753,
13261,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5041,
1159,
13,
13,
13,
1753,
419,
300,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
510,
300,
1159,
13,
13,
13,
1753,
3764,
3231,
29875,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5267,
3231,
29875,
1159,
13,
13,
13,
1753,
640,
2470,
5897,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1285,
2470,
5897,
1159,
13,
13,
13,
1753,
9825,
13342,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29882,
391,
13342,
1159,
13,
13,
13,
1753,
1059,
1646,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
2704,
1646,
1159,
13,
13,
13,
1753,
10032,
5041,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
17469,
5041,
1159,
13,
13,
13,
1753,
20803,
4262,
29941,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6096,
4262,
29941,
1159,
13,
13,
13,
1753,
1006,
29886,
5461,
19322,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1639,
29886,
5461,
19322,
1159,
13,
13,
13,
1753,
14653,
682,
8726,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
845,
29878,
682,
8726,
1159,
13,
13,
13,
1753,
20803,
5317,
29941,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6096,
5317,
29941,
1159,
13,
13,
13,
1753,
20803,
3733,
279,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6096,
3733,
279,
1159,
13,
13,
13,
1753,
11051,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
18963,
1159,
13,
13,
13,
1753,
4840,
29941,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5461,
29941,
1159,
13,
13,
13,
1753,
640,
473,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1285,
473,
1159,
13,
13,
13,
1753,
640,
2470,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1285,
2470,
1159,
13,
13,
13,
1753,
27843,
5317,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
535,
29872,
5317,
1159,
13,
13,
13,
1753,
16734,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
23361,
1159,
13,
13,
13,
1753,
338,
359,
332,
2161,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
275,
359,
332,
2161,
1159,
13,
13,
13,
1753,
5036,
29941,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
12343,
29941,
1159,
13,
13,
13,
1753,
1580,
4262,
20907,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6550,
4262,
20907,
1159,
13,
13,
13,
1753,
20805,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
303,
331,
1159,
13,
13,
13,
1753,
3515,
29906,
326,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
2557,
29906,
326,
1159,
13,
13,
13,
1753,
419,
300,
29941,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
510,
300,
29941,
1159,
13,
13,
13,
1753,
20803,
4467,
29882,
29883,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6096,
4467,
29882,
29883,
1159,
13,
13,
13,
1753,
640,
473,
29888,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1285,
473,
29888,
1159,
13,
13,
13,
1753,
285,
5317,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29888,
5317,
1159,
13,
13,
13,
1753,
1750,
369,
29941,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
339,
2147,
29941,
1159,
13,
13,
13,
1753,
338,
542,
324,
943,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
275,
542,
324,
943,
1159,
13,
13,
13,
1753,
6047,
1493,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29802,
1493,
1159,
13,
13,
13,
1753,
22434,
567,
3398,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5481,
567,
3398,
1159,
13,
13,
13,
1753,
6088,
5317,
2754,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5510,
5317,
2754,
1159,
13,
13,
13,
1753,
4840,
29873,
4003,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5461,
29873,
4003,
1159,
13,
13,
13,
1753,
3620,
261,
12239,
668,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
25990,
261,
12239,
668,
1159,
13,
13,
13,
1753,
1207,
28408,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5675,
28408,
1159,
13,
13,
13,
1753,
2594,
29941,
29882,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1646,
29941,
29882,
1159,
13,
13,
13,
1753,
1967,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
3027,
1159,
13,
13,
13,
1753,
534,
1355,
29882,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
509,
1355,
29882,
1159,
13,
13,
13,
1753,
1067,
1107,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
695,
1107,
1159,
13,
13,
13,
1753,
5445,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5589,
1159,
13,
13,
13,
1753,
10917,
1958,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1028,
262,
1958,
1159,
13,
13,
13,
1753,
6492,
5344,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5317,
5344,
1159,
13,
13,
13,
1753,
20803,
7610,
29888,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6096,
7610,
29888,
1159,
13,
13,
13,
1753,
17089,
10238,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29881,
2147,
10238,
1159,
13,
13,
13,
1753,
1399,
29906,
23973,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
513,
29906,
23973,
1159,
13,
13,
13,
1753,
9541,
517,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29886,
598,
517,
1159,
13,
13,
13,
1753,
338,
542,
2547,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
275,
542,
2547,
1159,
13,
13,
13,
1753,
14064,
262,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
27362,
262,
1159,
13,
13,
13,
1753,
5036,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
12343,
1159,
13,
13,
13,
1753,
640,
473,
29883,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1285,
473,
29883,
1159,
13,
13,
13,
1753,
1238,
1624,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1725,
1624,
1159,
13,
13,
13,
1753,
298,
29887,
1220,
29906,
9012,
6358,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29882,
29887,
1220,
29906,
9012,
6358,
1159,
13,
13,
13,
1753,
20803,
1285,
473,
29888,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6096,
1285,
473,
29888,
1159,
13,
13,
13,
1753,
380,
7121,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
303,
7121,
1159,
13,
13,
13,
1753,
1190,
13801,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
7610,
13801,
1159,
13,
13,
13,
1753,
527,
29906,
1645,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
326,
29906,
1645,
1159,
13,
13,
13,
1753,
20803,
5317,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6096,
5317,
1159,
13,
13,
13,
1753,
527,
29906,
2557,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
326,
29906,
2557,
1159,
13,
13,
13,
1753,
784,
3293,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1054,
3293,
1159,
13,
13,
13,
1753,
14064,
1493,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
27362,
1493,
1159,
13,
13,
13,
1753,
640,
473,
29941,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1285,
473,
29941,
1159,
13,
13,
13,
1753,
15552,
29890,
5317,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
23973,
5317,
1159,
13,
13,
13,
1753,
1190,
29888,
29906,
5041,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
7610,
29888,
29906,
5041,
1159,
13,
13,
13,
1753,
270,
2121,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29881,
2121,
1159,
13,
13,
13,
1753,
12814,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
9996,
579,
1159,
13,
13,
13,
1753,
4094,
11950,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
13405,
11950,
1159,
13,
13,
13,
1753,
20396,
4995,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1270,
29880,
4995,
1159,
13,
13,
13,
1753,
2594,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1646,
1159,
13,
13,
13,
1753,
22780,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
18337,
1159,
13,
13,
13,
1753,
9825,
13342,
29906,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29882,
391,
13342,
29906,
1159,
13,
13,
13,
1753,
4840,
1091,
6718,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5461,
1091,
6718,
1159,
13,
13,
13,
1753,
282,
2780,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29886,
2780,
1159,
13,
13,
13,
1753,
18130,
6718,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1091,
6718,
1159,
13,
13,
13,
1753,
338,
5317,
5145,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
275,
5317,
5145,
1159,
13,
13,
13,
1753,
20745,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29879,
9085,
1159,
13,
13,
13,
1753,
10032,
24623,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
17469,
24623,
1159,
13,
13,
13,
1753,
20803,
7610,
13801,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6096,
7610,
13801,
1159,
13,
13,
13,
1753,
4558,
29883,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
8346,
29883,
1159,
13,
13,
13,
1753,
1014,
24623,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1491,
24623,
1159,
13,
13,
13,
1753,
12243,
1160,
18569,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
13045,
1160,
18569,
1159,
13,
13,
13,
1753,
1700,
398,
774,
3885,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1555,
398,
774,
3885,
1159,
13,
13,
13,
1753,
6492,
5145,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5317,
5145,
1159,
13,
13,
13,
1753,
4038,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6203,
1159,
13,
13,
13,
1753,
27716,
29920,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
4467,
29882,
29920,
1159,
13,
13,
13,
1753,
1967,
1493,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
3027,
1493,
1159,
13,
13,
13,
1753,
20805,
29941,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
303,
331,
29941,
1159,
13,
13,
13,
1753,
14801,
29941,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1557,
2620,
29941,
1159,
13,
13,
13,
1753,
20803,
4467,
29882,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
6096,
4467,
29882,
1159,
13,
13,
13,
1753,
6492,
15091,
3696,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5317,
15091,
3696,
1159,
13,
13,
13,
1753,
4840,
29906,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
5461,
29906,
1159,
13,
13,
13,
1753,
22003,
29884,
568,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
29894,
790,
29884,
568,
1159,
13,
13,
13,
1753,
2594,
29941,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
1646,
29941,
1159,
13,
13,
13,
1753,
10597,
29941,
10456,
5085,
1125,
13,
1678,
12020,
2216,
1888,
2037,
287,
2392,
703,
3844,
6983,
29941,
1159,
13,
2
] |
tests/test_req_vars.py | fast01/falcon-python | 1 | 74446 | import datetime
import six
import testtools
import ddt
import falcon
from falcon.request import Request
import falcon.testing as testing
@ddt.ddt
class TestReqVars(testing.TestBase):
def before(self):
self.qs = 'marker=deadbeef&limit=10'
self.headers = {
'Content-Type': 'text/plain',
'Content-Length': '4829',
'Authorization': ''
}
self.app = '/test'
self.path = '/hello'
self.relative_uri = self.path + '?' + self.qs
self.req = Request(testing.create_environ(
app=self.app,
port=8080,
path='/hello',
query_string=self.qs,
headers=self.headers))
self.req_noqs = Request(testing.create_environ(
app=self.app,
path='/hello',
headers=self.headers))
def test_missing_qs(self):
env = testing.create_environ()
if 'QUERY_STRING' in env:
del env['QUERY_STRING']
# Should not cause an exception when Request is instantiated
Request(env)
def test_empty(self):
self.assertIs(self.req.auth, None)
def test_host(self):
self.assertEqual(self.req.host, testing.DEFAULT_HOST)
def test_subdomain(self):
req = Request(testing.create_environ(
host='com',
path='/hello',
headers=self.headers))
self.assertIs(req.subdomain, None)
req = Request(testing.create_environ(
host='example.com',
path='/hello',
headers=self.headers))
self.assertEqual(req.subdomain, 'example')
req = Request(testing.create_environ(
host='highwire.example.com',
path='/hello',
headers=self.headers))
self.assertEqual(req.subdomain, 'highwire')
req = Request(testing.create_environ(
host='lb01.dfw01.example.com',
port=8080,
path='/hello',
headers=self.headers))
self.assertEqual(req.subdomain, 'lb01')
# NOTE(kgriffs): Behavior for IP addresses is undefined,
# so just make sure it doesn't blow up.
req = Request(testing.create_environ(
host='127.0.0.1',
path='/hello',
headers=self.headers))
self.assertEqual(type(req.subdomain), str)
# NOTE(kgriffs): Test fallback to SERVER_NAME by using
# HTTP 1.0, which will cause .create_environ to not set
# HTTP_HOST.
req = Request(testing.create_environ(
protocol='HTTP/1.0',
host='example.com',
path='/hello',
headers=self.headers))
self.assertEqual(req.subdomain, 'example')
def test_reconstruct_url(self):
req = self.req
scheme = req.protocol
host = req.get_header('host')
app = req.app
path = req.path
query_string = req.query_string
expected_uri = ''.join([scheme, '://', host, app, path,
'?', query_string])
self.assertEqual(expected_uri, req.uri)
@testtools.skipUnless(six.PY3, 'Test only applies to Python 3')
def test_nonlatin_path(self):
cyrillic_path = u'/hello_\u043f\u0440\u0438\u0432\u0435\u0442'
cyrillic_path_decoded = cyrillic_path.encode('utf-8').decode('latin1')
req = Request(testing.create_environ(
host='com',
path=cyrillic_path_decoded,
headers=self.headers))
self.assertEqual(req.path, cyrillic_path)
def test_uri(self):
uri = ('http://' + testing.DEFAULT_HOST + ':8080' +
self.app + self.relative_uri)
self.assertEqual(self.req.url, uri)
# NOTE(kgriffs): Call twice to check caching works
self.assertEqual(self.req.uri, uri)
self.assertEqual(self.req.uri, uri)
uri_noqs = ('http://' + testing.DEFAULT_HOST + self.app + self.path)
self.assertEqual(self.req_noqs.uri, uri_noqs)
def test_uri_https(self):
# =======================================================
# Default port, implicit
# =======================================================
req = Request(testing.create_environ(
path='/hello', scheme='https'))
uri = ('https://' + testing.DEFAULT_HOST + '/hello')
self.assertEqual(req.uri, uri)
# =======================================================
# Default port, explicit
# =======================================================
req = Request(testing.create_environ(
path='/hello', scheme='https', port=443))
uri = ('https://' + testing.DEFAULT_HOST + '/hello')
self.assertEqual(req.uri, uri)
# =======================================================
# Non-default port
# =======================================================
req = Request(testing.create_environ(
path='/hello', scheme='https', port=22))
uri = ('https://' + testing.DEFAULT_HOST + ':22/hello')
self.assertEqual(req.uri, uri)
def test_uri_http_1_0(self):
# =======================================================
# HTTP, 80
# =======================================================
req = Request(testing.create_environ(
protocol='HTTP/1.0',
app=self.app,
port=80,
path='/hello',
query_string=self.qs,
headers=self.headers))
uri = ('http://' + testing.DEFAULT_HOST +
self.app + self.relative_uri)
self.assertEqual(req.uri, uri)
# =======================================================
# HTTP, 80
# =======================================================
req = Request(testing.create_environ(
protocol='HTTP/1.0',
app=self.app,
port=8080,
path='/hello',
query_string=self.qs,
headers=self.headers))
uri = ('http://' + testing.DEFAULT_HOST + ':8080' +
self.app + self.relative_uri)
self.assertEqual(req.uri, uri)
# =======================================================
# HTTP, 80
# =======================================================
req = Request(testing.create_environ(
protocol='HTTP/1.0',
scheme='https',
app=self.app,
port=443,
path='/hello',
query_string=self.qs,
headers=self.headers))
uri = ('https://' + testing.DEFAULT_HOST +
self.app + self.relative_uri)
self.assertEqual(req.uri, uri)
# =======================================================
# HTTP, 80
# =======================================================
req = Request(testing.create_environ(
protocol='HTTP/1.0',
scheme='https',
app=self.app,
port=22,
path='/hello',
query_string=self.qs,
headers=self.headers))
uri = ('https://' + testing.DEFAULT_HOST + ':22' +
self.app + self.relative_uri)
self.assertEqual(req.uri, uri)
def test_relative_uri(self):
self.assertEqual(self.req.relative_uri, self.app + self.relative_uri)
self.assertEqual(
self.req_noqs.relative_uri, self.app + self.path)
req_noapp = Request(testing.create_environ(
path='/hello',
query_string=self.qs,
headers=self.headers))
self.assertEqual(req_noapp.relative_uri, self.relative_uri)
req_noapp = Request(testing.create_environ(
path='/hello/',
query_string=self.qs,
headers=self.headers))
# NOTE(kgriffs): Call twice to check caching works
self.assertEqual(req_noapp.relative_uri, self.relative_uri)
self.assertEqual(req_noapp.relative_uri, self.relative_uri)
def test_client_accepts(self):
headers = {'Accept': 'application/xml'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('application/xml'))
headers = {'Accept': '*/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('application/xml'))
self.assertTrue(req.client_accepts('application/json'))
self.assertTrue(req.client_accepts('application/x-msgpack'))
headers = {'Accept': 'application/x-msgpack'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts('application/xml'))
self.assertFalse(req.client_accepts('application/json'))
self.assertTrue(req.client_accepts('application/x-msgpack'))
headers = {} # NOTE(kgriffs): Equivalent to '*/*' per RFC
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('application/xml'))
headers = {'Accept': 'application/json'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts('application/xml'))
headers = {'Accept': 'application/x-msgpack'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('application/x-msgpack'))
headers = {'Accept': 'application/xm'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts('application/xml'))
headers = {'Accept': 'application/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('application/json'))
self.assertTrue(req.client_accepts('application/xml'))
self.assertTrue(req.client_accepts('application/x-msgpack'))
headers = {'Accept': 'text/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('text/plain'))
self.assertTrue(req.client_accepts('text/csv'))
self.assertFalse(req.client_accepts('application/xhtml+xml'))
headers = {'Accept': 'text/*, application/xhtml+xml; q=0.0'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('text/plain'))
self.assertTrue(req.client_accepts('text/csv'))
self.assertTrue(req.client_accepts('application/xhtml+xml'))
headers = {'Accept': 'text/*; q=0.1, application/xhtml+xml; q=0.5'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('text/plain'))
headers = {'Accept': 'text/*, application/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('text/plain'))
self.assertTrue(req.client_accepts('application/xml'))
self.assertTrue(req.client_accepts('application/json'))
self.assertTrue(req.client_accepts('application/x-msgpack'))
headers = {'Accept': 'text/*,application/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('text/plain'))
self.assertTrue(req.client_accepts('application/xml'))
self.assertTrue(req.client_accepts('application/json'))
self.assertTrue(req.client_accepts('application/x-msgpack'))
def test_client_accepts_bogus(self):
headers = {'Accept': '~'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts('text/plain'))
self.assertFalse(req.client_accepts('application/json'))
def test_client_accepts_props(self):
headers = {'Accept': 'application/xml'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts_xml)
self.assertFalse(req.client_accepts_json)
self.assertFalse(req.client_accepts_msgpack)
headers = {'Accept': 'application/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts_xml)
self.assertTrue(req.client_accepts_json)
self.assertTrue(req.client_accepts_msgpack)
headers = {'Accept': 'application/json'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts_xml)
self.assertTrue(req.client_accepts_json)
self.assertFalse(req.client_accepts_msgpack)
headers = {'Accept': 'application/x-msgpack'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts_xml)
self.assertFalse(req.client_accepts_json)
self.assertTrue(req.client_accepts_msgpack)
headers = {'Accept': 'application/msgpack'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts_xml)
self.assertFalse(req.client_accepts_json)
self.assertTrue(req.client_accepts_msgpack)
headers = {
'Accept': 'application/json,application/xml,application/x-msgpack'
}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts_xml)
self.assertTrue(req.client_accepts_json)
self.assertTrue(req.client_accepts_msgpack)
def test_client_prefers(self):
headers = {'Accept': 'application/xml'}
req = Request(testing.create_environ(headers=headers))
preferred_type = req.client_prefers(['application/xml'])
self.assertEqual(preferred_type, 'application/xml')
headers = {'Accept': '*/*'}
preferred_type = req.client_prefers(('application/xml',
'application/json'))
# NOTE(kgriffs): If client doesn't care, "preferr" the first one
self.assertEqual(preferred_type, 'application/xml')
headers = {'Accept': 'text/*; q=0.1, application/xhtml+xml; q=0.5'}
req = Request(testing.create_environ(headers=headers))
preferred_type = req.client_prefers(['application/xhtml+xml'])
self.assertEqual(preferred_type, 'application/xhtml+xml')
headers = {'Accept': '3p12845j;;;asfd;'}
req = Request(testing.create_environ(headers=headers))
preferred_type = req.client_prefers(['application/xhtml+xml'])
self.assertEqual(preferred_type, None)
def test_range(self):
headers = {'Range': 'bytes=10-'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (10, -1))
headers = {'Range': 'bytes=10-20'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (10, 20))
headers = {'Range': 'bytes=-10240'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (-10240, -1))
headers = {'Range': 'bytes=0-2'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (0, 2))
headers = {'Range': ''}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPInvalidHeader, lambda: req.range)
req = Request(testing.create_environ())
self.assertIs(req.range, None)
def test_range_unit(self):
headers = {'Range': 'bytes=10-'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (10, -1))
self.assertEqual(req.range_unit, 'bytes')
headers = {'Range': 'items=10-'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (10, -1))
self.assertEqual(req.range_unit, 'items')
headers = {'Range': ''}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPInvalidHeader, lambda: req.range_unit)
req = Request(testing.create_environ())
self.assertIs(req.range_unit, None)
def test_range_invalid(self):
headers = {'Range': 'bytes=10240'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=-'}
expected_desc = ('The value provided for the Range header is '
'invalid. The range offsets are missing.')
self._test_error_details(headers, 'range',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
headers = {'Range': 'bytes=--'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=-3-'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=-3-4'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=3-3-4'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=3-3-'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=3-3- '}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=fizbit'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=a-'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=a-3'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=-b'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=3-b'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=x-y'}
expected_desc = ('The value provided for the Range header is '
'invalid. It must be a range formatted '
'according to RFC 7233.')
self._test_error_details(headers, 'range',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
headers = {'Range': 'bytes=0-0,-1'}
expected_desc = ('The value provided for the Range '
'header is invalid. The value must be a '
'continuous range.')
self._test_error_details(headers, 'range',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
headers = {'Range': '10-'}
expected_desc = ("The value provided for the Range "
"header is invalid. The value must be "
"prefixed with a range unit, e.g. 'bytes='")
self._test_error_details(headers, 'range',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
def test_missing_attribute_header(self):
req = Request(testing.create_environ())
self.assertEqual(req.range, None)
req = Request(testing.create_environ())
self.assertEqual(req.content_length, None)
def test_content_length(self):
headers = {'content-length': '5656'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.content_length, 5656)
headers = {'content-length': ''}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.content_length, None)
def test_bogus_content_length_nan(self):
headers = {'content-length': 'fuzzy-bunnies'}
expected_desc = ('The value provided for the '
'Content-Length header is invalid. The value '
'of the header must be a number.')
self._test_error_details(headers, 'content_length',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
def test_bogus_content_length_neg(self):
headers = {'content-length': '-1'}
expected_desc = ('The value provided for the Content-Length '
'header is invalid. The value of the header '
'must be a positive number.')
self._test_error_details(headers, 'content_length',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
@ddt.data(('Date', 'date'),
('If-Modified-since', 'if_modified_since'),
('If-Unmodified-since', 'if_unmodified_since'),
)
@ddt.unpack
def test_date(self, header, attr):
date = datetime.datetime(2013, 4, 4, 5, 19, 18)
date_str = 'Thu, 04 Apr 2013 05:19:18 GMT'
self._test_header_expected_value(header, date_str, attr, date)
@ddt.data(('Date', 'date'),
('If-Modified-Since', 'if_modified_since'),
('If-Unmodified-Since', 'if_unmodified_since'),
)
@ddt.unpack
def test_date_invalid(self, header, attr):
# Date formats don't conform to RFC 1123
headers = {header: 'Thu, 04 Apr 2013'}
expected_desc = ('The value provided for the {0} '
'header is invalid. It must be formatted '
'according to RFC 7231, Section 7.1.1.1')
self._test_error_details(headers, attr,
falcon.HTTPInvalidHeader,
'Invalid header value',
expected_desc.format(header))
headers = {header: ''}
self._test_error_details(headers, attr,
falcon.HTTPInvalidHeader,
'Invalid header value',
expected_desc.format(header))
@ddt.data('date', 'if_modified_since', 'if_unmodified_since')
def test_date_missing(self, attr):
req = Request(testing.create_environ())
self.assertIs(getattr(req, attr), None)
def test_attribute_headers(self):
hash = 'fa0d1a60ef6616bb28038515c8ea4cb2'
auth = 'HMAC_SHA1 c590afa9bb59191ffab30f223791e82d3fd3e3af'
agent = 'testing/1.0.1'
default_agent = 'curl/7.24.0 (x86_64-apple-darwin12.0)'
self._test_attribute_header('Accept', 'x-falcon', 'accept',
default='*/*')
self._test_attribute_header('Authorization', auth, 'auth')
self._test_attribute_header('Content-Type', 'text/plain',
'content_type')
self._test_attribute_header('Expect', '100-continue', 'expect')
self._test_attribute_header('If-Match', hash, 'if_match')
self._test_attribute_header('If-None-Match', hash, 'if_none_match')
self._test_attribute_header('If-Range', hash, 'if_range')
self._test_attribute_header('User-Agent', agent, 'user_agent',
default=default_agent)
def test_method(self):
self.assertEqual(self.req.method, 'GET')
self.req = Request(testing.create_environ(path='', method='HEAD'))
self.assertEqual(self.req.method, 'HEAD')
def test_empty_path(self):
self.req = Request(testing.create_environ(path=''))
self.assertEqual(self.req.path, '/')
def test_content_type_method(self):
self.assertEqual(self.req.get_header('content-type'), 'text/plain')
def test_content_length_method(self):
self.assertEqual(self.req.get_header('content-length'), '4829')
# -------------------------------------------------------------------------
# Helpers
# -------------------------------------------------------------------------
def _test_attribute_header(self, name, value, attr, default=None):
headers = {name: value}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(getattr(req, attr), value)
req = Request(testing.create_environ())
self.assertEqual(getattr(req, attr), default)
def _test_header_expected_value(self, name, value, attr, expected_value):
headers = {name: value}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(getattr(req, attr), expected_value)
def _test_error_details(self, headers, attr_name,
error_type, title, description):
req = Request(testing.create_environ(headers=headers))
try:
getattr(req, attr_name)
self.fail('{0} not raised'.format(error_type.__name__))
except error_type as ex:
self.assertEqual(ex.title, title)
self.assertEqual(ex.description, description)
| [
1,
1053,
12865,
13,
5215,
4832,
13,
5215,
1243,
8504,
13,
13,
5215,
270,
6008,
13,
13,
5215,
11092,
535,
13,
3166,
11092,
535,
29889,
3827,
1053,
10729,
13,
5215,
11092,
535,
29889,
13424,
408,
6724,
13,
13,
13,
29992,
1289,
29873,
29889,
1289,
29873,
13,
1990,
4321,
1123,
29939,
29963,
1503,
29898,
13424,
29889,
3057,
5160,
1125,
13,
13,
1678,
822,
1434,
29898,
1311,
1125,
13,
4706,
1583,
29889,
29939,
29879,
353,
525,
22976,
29922,
311,
328,
915,
1389,
29987,
13400,
29922,
29896,
29900,
29915,
13,
13,
4706,
1583,
29889,
13662,
353,
426,
13,
9651,
525,
3916,
29899,
1542,
2396,
525,
726,
29914,
24595,
742,
13,
9651,
525,
3916,
29899,
6513,
2396,
525,
29946,
29947,
29906,
29929,
742,
13,
9651,
525,
25471,
2396,
6629,
13,
4706,
500,
13,
13,
4706,
1583,
29889,
932,
353,
8207,
1688,
29915,
13,
4706,
1583,
29889,
2084,
353,
8207,
12199,
29915,
13,
4706,
1583,
29889,
22925,
29918,
5338,
353,
1583,
29889,
2084,
718,
525,
17901,
718,
1583,
29889,
29939,
29879,
13,
13,
4706,
1583,
29889,
7971,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
623,
29922,
1311,
29889,
932,
29892,
13,
9651,
2011,
29922,
29947,
29900,
29947,
29900,
29892,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
2346,
29918,
1807,
29922,
1311,
29889,
29939,
29879,
29892,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
13,
4706,
1583,
29889,
7971,
29918,
1217,
29939,
29879,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
623,
29922,
1311,
29889,
932,
29892,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
13,
1678,
822,
1243,
29918,
27259,
29918,
29939,
29879,
29898,
1311,
1125,
13,
4706,
8829,
353,
6724,
29889,
3258,
29918,
21813,
580,
13,
4706,
565,
525,
13356,
24422,
29918,
20785,
29915,
297,
8829,
29901,
13,
9651,
628,
8829,
1839,
13356,
24422,
29918,
20785,
2033,
13,
13,
4706,
396,
10575,
451,
4556,
385,
3682,
746,
10729,
338,
13213,
630,
13,
4706,
10729,
29898,
6272,
29897,
13,
13,
1678,
822,
1243,
29918,
6310,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
3624,
29898,
1311,
29889,
7971,
29889,
5150,
29892,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
3069,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
7971,
29889,
3069,
29892,
6724,
29889,
23397,
29918,
20832,
29897,
13,
13,
1678,
822,
1243,
29918,
1491,
7247,
29898,
1311,
1125,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
3495,
2433,
510,
742,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
4706,
1583,
29889,
9294,
3624,
29898,
7971,
29889,
1491,
7247,
29892,
6213,
29897,
13,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
3495,
2433,
4773,
29889,
510,
742,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
1491,
7247,
29892,
525,
4773,
1495,
13,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
3495,
2433,
9812,
22376,
29889,
4773,
29889,
510,
742,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
1491,
7247,
29892,
525,
9812,
22376,
1495,
13,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
3495,
2433,
27728,
29900,
29896,
29889,
2176,
29893,
29900,
29896,
29889,
4773,
29889,
510,
742,
13,
9651,
2011,
29922,
29947,
29900,
29947,
29900,
29892,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
1491,
7247,
29892,
525,
27728,
29900,
29896,
1495,
13,
13,
4706,
396,
6058,
29923,
29898,
29895,
629,
28324,
1125,
1522,
16300,
363,
5641,
14157,
338,
7580,
29892,
13,
4706,
396,
577,
925,
1207,
1854,
372,
1838,
29915,
29873,
13031,
701,
29889,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
3495,
2433,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
742,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1853,
29898,
7971,
29889,
1491,
7247,
511,
851,
29897,
13,
13,
4706,
396,
6058,
29923,
29898,
29895,
629,
28324,
1125,
4321,
6416,
1627,
304,
26996,
5348,
29918,
5813,
491,
773,
13,
4706,
396,
7331,
29871,
29896,
29889,
29900,
29892,
607,
674,
4556,
869,
3258,
29918,
21813,
304,
451,
731,
13,
4706,
396,
7331,
29918,
20832,
29889,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
9608,
2433,
10493,
29914,
29896,
29889,
29900,
742,
13,
9651,
3495,
2433,
4773,
29889,
510,
742,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
1491,
7247,
29892,
525,
4773,
1495,
13,
13,
1678,
822,
1243,
29918,
276,
11433,
29918,
2271,
29898,
1311,
1125,
13,
4706,
12428,
353,
1583,
29889,
7971,
13,
13,
4706,
11380,
353,
12428,
29889,
20464,
13,
4706,
3495,
353,
12428,
29889,
657,
29918,
6672,
877,
3069,
1495,
13,
4706,
623,
353,
12428,
29889,
932,
13,
4706,
2224,
353,
12428,
29889,
2084,
13,
4706,
2346,
29918,
1807,
353,
12428,
29889,
1972,
29918,
1807,
13,
13,
4706,
3806,
29918,
5338,
353,
525,
4286,
7122,
4197,
816,
2004,
29892,
525,
597,
742,
3495,
29892,
623,
29892,
2224,
29892,
13,
462,
18884,
525,
29973,
742,
2346,
29918,
1807,
2314,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
9684,
29918,
5338,
29892,
12428,
29889,
5338,
29897,
13,
13,
1678,
732,
1688,
8504,
29889,
11014,
2525,
2222,
29898,
28319,
29889,
20055,
29941,
29892,
525,
3057,
871,
16058,
304,
5132,
29871,
29941,
1495,
13,
1678,
822,
1243,
29918,
5464,
5066,
262,
29918,
2084,
29898,
1311,
1125,
13,
4706,
274,
4316,
453,
293,
29918,
2084,
353,
318,
29915,
29914,
12199,
3187,
29884,
29900,
29946,
29941,
29888,
29905,
29884,
29900,
29946,
29946,
29900,
29905,
29884,
29900,
29946,
29941,
29947,
29905,
29884,
29900,
29946,
29941,
29906,
29905,
29884,
29900,
29946,
29941,
29945,
29905,
29884,
29900,
29946,
29946,
29906,
29915,
13,
4706,
274,
4316,
453,
293,
29918,
2084,
29918,
7099,
6797,
353,
274,
4316,
453,
293,
29918,
2084,
29889,
12508,
877,
9420,
29899,
29947,
2824,
13808,
877,
5066,
262,
29896,
1495,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
3495,
2433,
510,
742,
13,
9651,
2224,
29922,
1270,
29878,
453,
293,
29918,
2084,
29918,
7099,
6797,
29892,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
2084,
29892,
274,
4316,
453,
293,
29918,
2084,
29897,
13,
13,
1678,
822,
1243,
29918,
5338,
29898,
1311,
1125,
13,
4706,
21333,
353,
6702,
1124,
597,
29915,
718,
6724,
29889,
23397,
29918,
20832,
718,
525,
29901,
29947,
29900,
29947,
29900,
29915,
718,
13,
1669,
1583,
29889,
932,
718,
1583,
29889,
22925,
29918,
5338,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
7971,
29889,
2271,
29892,
21333,
29897,
13,
13,
4706,
396,
6058,
29923,
29898,
29895,
629,
28324,
1125,
8251,
8951,
304,
1423,
22488,
1736,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
7971,
29889,
5338,
29892,
21333,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
7971,
29889,
5338,
29892,
21333,
29897,
13,
13,
4706,
21333,
29918,
1217,
29939,
29879,
353,
6702,
1124,
597,
29915,
718,
6724,
29889,
23397,
29918,
20832,
718,
1583,
29889,
932,
718,
1583,
29889,
2084,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
7971,
29918,
1217,
29939,
29879,
29889,
5338,
29892,
21333,
29918,
1217,
29939,
29879,
29897,
13,
13,
1678,
822,
1243,
29918,
5338,
29918,
991,
29898,
1311,
1125,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
396,
13109,
2011,
29892,
12235,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
2224,
2433,
29914,
12199,
742,
11380,
2433,
991,
8785,
13,
4706,
21333,
353,
6702,
991,
597,
29915,
718,
6724,
29889,
23397,
29918,
20832,
718,
8207,
12199,
1495,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
5338,
29892,
21333,
29897,
13,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
396,
13109,
2011,
29892,
6261,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
2224,
2433,
29914,
12199,
742,
11380,
2433,
991,
742,
2011,
29922,
29946,
29946,
29941,
876,
13,
4706,
21333,
353,
6702,
991,
597,
29915,
718,
6724,
29889,
23397,
29918,
20832,
718,
8207,
12199,
1495,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
5338,
29892,
21333,
29897,
13,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
396,
10050,
29899,
4381,
2011,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
2224,
2433,
29914,
12199,
742,
11380,
2433,
991,
742,
2011,
29922,
29906,
29906,
876,
13,
4706,
21333,
353,
6702,
991,
597,
29915,
718,
6724,
29889,
23397,
29918,
20832,
718,
525,
29901,
29906,
29906,
29914,
12199,
1495,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
5338,
29892,
21333,
29897,
13,
13,
1678,
822,
1243,
29918,
5338,
29918,
1124,
29918,
29896,
29918,
29900,
29898,
1311,
1125,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
396,
7331,
29892,
29871,
29947,
29900,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
9608,
2433,
10493,
29914,
29896,
29889,
29900,
742,
13,
9651,
623,
29922,
1311,
29889,
932,
29892,
13,
9651,
2011,
29922,
29947,
29900,
29892,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
2346,
29918,
1807,
29922,
1311,
29889,
29939,
29879,
29892,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
13,
4706,
21333,
353,
6702,
1124,
597,
29915,
718,
6724,
29889,
23397,
29918,
20832,
718,
13,
1669,
1583,
29889,
932,
718,
1583,
29889,
22925,
29918,
5338,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
5338,
29892,
21333,
29897,
13,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
396,
7331,
29892,
29871,
29947,
29900,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
9608,
2433,
10493,
29914,
29896,
29889,
29900,
742,
13,
9651,
623,
29922,
1311,
29889,
932,
29892,
13,
9651,
2011,
29922,
29947,
29900,
29947,
29900,
29892,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
2346,
29918,
1807,
29922,
1311,
29889,
29939,
29879,
29892,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
13,
4706,
21333,
353,
6702,
1124,
597,
29915,
718,
6724,
29889,
23397,
29918,
20832,
718,
525,
29901,
29947,
29900,
29947,
29900,
29915,
718,
13,
1669,
1583,
29889,
932,
718,
1583,
29889,
22925,
29918,
5338,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
5338,
29892,
21333,
29897,
13,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
396,
7331,
29892,
29871,
29947,
29900,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
9608,
2433,
10493,
29914,
29896,
29889,
29900,
742,
13,
9651,
11380,
2433,
991,
742,
13,
9651,
623,
29922,
1311,
29889,
932,
29892,
13,
9651,
2011,
29922,
29946,
29946,
29941,
29892,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
2346,
29918,
1807,
29922,
1311,
29889,
29939,
29879,
29892,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
13,
4706,
21333,
353,
6702,
991,
597,
29915,
718,
6724,
29889,
23397,
29918,
20832,
718,
13,
1669,
1583,
29889,
932,
718,
1583,
29889,
22925,
29918,
5338,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
5338,
29892,
21333,
29897,
13,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
396,
7331,
29892,
29871,
29947,
29900,
13,
4706,
396,
1275,
9166,
9166,
9166,
2751,
29922,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
9608,
2433,
10493,
29914,
29896,
29889,
29900,
742,
13,
9651,
11380,
2433,
991,
742,
13,
9651,
623,
29922,
1311,
29889,
932,
29892,
13,
9651,
2011,
29922,
29906,
29906,
29892,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
2346,
29918,
1807,
29922,
1311,
29889,
29939,
29879,
29892,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
13,
4706,
21333,
353,
6702,
991,
597,
29915,
718,
6724,
29889,
23397,
29918,
20832,
718,
525,
29901,
29906,
29906,
29915,
718,
13,
1669,
1583,
29889,
932,
718,
1583,
29889,
22925,
29918,
5338,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
5338,
29892,
21333,
29897,
13,
13,
1678,
822,
1243,
29918,
22925,
29918,
5338,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
7971,
29889,
22925,
29918,
5338,
29892,
1583,
29889,
932,
718,
1583,
29889,
22925,
29918,
5338,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
1583,
29889,
7971,
29918,
1217,
29939,
29879,
29889,
22925,
29918,
5338,
29892,
1583,
29889,
932,
718,
1583,
29889,
2084,
29897,
13,
13,
4706,
12428,
29918,
1217,
932,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
2224,
2433,
29914,
12199,
742,
13,
9651,
2346,
29918,
1807,
29922,
1311,
29889,
29939,
29879,
29892,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29918,
1217,
932,
29889,
22925,
29918,
5338,
29892,
1583,
29889,
22925,
29918,
5338,
29897,
13,
13,
4706,
12428,
29918,
1217,
932,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13,
9651,
2224,
2433,
29914,
12199,
29914,
742,
13,
9651,
2346,
29918,
1807,
29922,
1311,
29889,
29939,
29879,
29892,
13,
9651,
9066,
29922,
1311,
29889,
13662,
876,
13,
13,
4706,
396,
6058,
29923,
29898,
29895,
629,
28324,
1125,
8251,
8951,
304,
1423,
22488,
1736,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29918,
1217,
932,
29889,
22925,
29918,
5338,
29892,
1583,
29889,
22925,
29918,
5338,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29918,
1217,
932,
29889,
22925,
29918,
5338,
29892,
1583,
29889,
22925,
29918,
5338,
29897,
13,
13,
1678,
822,
1243,
29918,
4645,
29918,
16044,
29879,
29898,
1311,
1125,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
29914,
3134,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3134,
8785,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
3877,
29930,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3134,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3126,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
29916,
29899,
7645,
4058,
8785,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
29914,
29916,
29899,
7645,
4058,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3134,
8785,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3126,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
29916,
29899,
7645,
4058,
8785,
13,
13,
4706,
9066,
353,
6571,
29871,
396,
6058,
29923,
29898,
29895,
629,
28324,
1125,
11243,
27445,
304,
525,
3877,
29930,
29915,
639,
390,
8610,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3134,
8785,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
29914,
3126,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3134,
8785,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
29914,
29916,
29899,
7645,
4058,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
29916,
29899,
7645,
4058,
8785,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
29914,
29916,
29885,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3134,
8785,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
5515,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3126,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3134,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
29916,
29899,
7645,
4058,
8785,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
726,
5515,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
726,
29914,
24595,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
726,
29914,
7638,
8785,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
28392,
29974,
3134,
8785,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
726,
5515,
29892,
2280,
29914,
28392,
29974,
3134,
29936,
3855,
29922,
29900,
29889,
29900,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
726,
29914,
24595,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
726,
29914,
7638,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
28392,
29974,
3134,
8785,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
726,
5515,
29936,
3855,
29922,
29900,
29889,
29896,
29892,
2280,
29914,
28392,
29974,
3134,
29936,
3855,
29922,
29900,
29889,
29945,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
726,
29914,
24595,
8785,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
726,
5515,
29892,
308,
2280,
5515,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
726,
29914,
24595,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3134,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3126,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
29916,
29899,
7645,
4058,
8785,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
726,
5515,
29892,
6214,
5515,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
726,
29914,
24595,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3134,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3126,
8785,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
29916,
29899,
7645,
4058,
8785,
13,
13,
1678,
822,
1243,
29918,
4645,
29918,
16044,
29879,
29918,
29890,
468,
375,
29898,
1311,
1125,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
30022,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
726,
29914,
24595,
8785,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
877,
6214,
29914,
3126,
8785,
13,
13,
1678,
822,
1243,
29918,
4645,
29918,
16044,
29879,
29918,
11030,
29898,
1311,
1125,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
29914,
3134,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3134,
29897,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3126,
29897,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
7645,
4058,
29897,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
5515,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3134,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3126,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
7645,
4058,
29897,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
29914,
3126,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3134,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3126,
29897,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
7645,
4058,
29897,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
29914,
29916,
29899,
7645,
4058,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3134,
29897,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3126,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
7645,
4058,
29897,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
29914,
7645,
4058,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3134,
29897,
13,
4706,
1583,
29889,
9294,
8824,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3126,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
7645,
4058,
29897,
13,
13,
4706,
9066,
353,
426,
13,
9651,
525,
23965,
2396,
525,
6214,
29914,
3126,
29892,
6214,
29914,
3134,
29892,
6214,
29914,
29916,
29899,
7645,
4058,
29915,
13,
4706,
500,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3134,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
3126,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
7971,
29889,
4645,
29918,
16044,
29879,
29918,
7645,
4058,
29897,
13,
13,
1678,
822,
1243,
29918,
4645,
29918,
29886,
999,
414,
29898,
1311,
1125,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
6214,
29914,
3134,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
16389,
29918,
1853,
353,
12428,
29889,
4645,
29918,
29886,
999,
414,
18959,
6214,
29914,
3134,
11287,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1457,
14373,
29918,
1853,
29892,
525,
6214,
29914,
3134,
1495,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
3877,
29930,
10827,
13,
4706,
16389,
29918,
1853,
353,
12428,
29889,
4645,
29918,
29886,
999,
414,
29898,
877,
6214,
29914,
3134,
742,
13,
462,
462,
632,
525,
6214,
29914,
3126,
8785,
13,
13,
4706,
396,
6058,
29923,
29898,
29895,
629,
28324,
1125,
960,
3132,
1838,
29915,
29873,
2562,
29892,
376,
1457,
571,
29878,
29908,
278,
937,
697,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1457,
14373,
29918,
1853,
29892,
525,
6214,
29914,
3134,
1495,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
726,
5515,
29936,
3855,
29922,
29900,
29889,
29896,
29892,
2280,
29914,
28392,
29974,
3134,
29936,
3855,
29922,
29900,
29889,
29945,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
16389,
29918,
1853,
353,
12428,
29889,
4645,
29918,
29886,
999,
414,
18959,
6214,
29914,
28392,
29974,
3134,
11287,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1457,
14373,
29918,
1853,
29892,
525,
6214,
29914,
28392,
29974,
3134,
1495,
13,
13,
4706,
9066,
353,
11117,
23965,
2396,
525,
29941,
29886,
29896,
29906,
29947,
29946,
29945,
29926,
7859,
29936,
294,
11512,
29936,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
16389,
29918,
1853,
353,
12428,
29889,
4645,
29918,
29886,
999,
414,
18959,
6214,
29914,
28392,
29974,
3134,
11287,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1457,
14373,
29918,
1853,
29892,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
3881,
29898,
1311,
1125,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29896,
29900,
29899,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3881,
29892,
313,
29896,
29900,
29892,
448,
29896,
876,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29896,
29900,
29899,
29906,
29900,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3881,
29892,
313,
29896,
29900,
29892,
29871,
29906,
29900,
876,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
10457,
29896,
29900,
29906,
29946,
29900,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3881,
29892,
8521,
29896,
29900,
29906,
29946,
29900,
29892,
448,
29896,
876,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29900,
29899,
29906,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3881,
29892,
313,
29900,
29892,
29871,
29906,
876,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
6629,
29913,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
13919,
7850,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
3101,
13,
4706,
1583,
29889,
9294,
3624,
29898,
7971,
29889,
3881,
29892,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
3881,
29918,
5441,
29898,
1311,
1125,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29896,
29900,
29899,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3881,
29892,
313,
29896,
29900,
29892,
448,
29896,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3881,
29918,
5441,
29892,
525,
13193,
1495,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
7076,
29922,
29896,
29900,
29899,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3881,
29892,
313,
29896,
29900,
29892,
448,
29896,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3881,
29918,
5441,
29892,
525,
7076,
1495,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
6629,
29913,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
13919,
7850,
29892,
14013,
29901,
12428,
29889,
3881,
29918,
5441,
29897,
13,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
3101,
13,
4706,
1583,
29889,
9294,
3624,
29898,
7971,
29889,
3881,
29918,
5441,
29892,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
3881,
29918,
20965,
29898,
1311,
1125,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29896,
29900,
29906,
29946,
29900,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
10457,
10827,
13,
4706,
3806,
29918,
14273,
353,
6702,
1576,
995,
4944,
363,
278,
12146,
4839,
338,
525,
13,
462,
308,
525,
20965,
29889,
450,
3464,
1283,
7224,
526,
4567,
29889,
1495,
13,
4706,
1583,
3032,
1688,
29918,
2704,
29918,
14144,
29898,
13662,
29892,
525,
3881,
742,
13,
462,
462,
11092,
535,
29889,
10493,
13919,
7850,
29892,
13,
462,
462,
525,
13919,
4839,
995,
742,
3806,
29918,
14273,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
489,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
10457,
29941,
29899,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
10457,
29941,
29899,
29946,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29941,
29899,
29941,
29899,
29946,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29941,
29899,
29941,
29899,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29941,
29899,
29941,
29899,
525,
29913,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29888,
466,
2966,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29874,
29899,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29874,
29899,
29941,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
10457,
29890,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29941,
29899,
29890,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
18263,
535,
29889,
10493,
22050,
3089,
29892,
14013,
29901,
12428,
29889,
3881,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29916,
29899,
29891,
10827,
13,
4706,
3806,
29918,
14273,
353,
6702,
1576,
995,
4944,
363,
278,
12146,
4839,
338,
525,
13,
462,
308,
525,
20965,
29889,
739,
1818,
367,
263,
3464,
20917,
525,
13,
462,
308,
525,
5753,
3278,
304,
390,
8610,
29871,
29955,
29906,
29941,
29941,
29889,
1495,
13,
4706,
1583,
3032,
1688,
29918,
2704,
29918,
14144,
29898,
13662,
29892,
525,
3881,
742,
13,
462,
462,
11092,
535,
29889,
10493,
13919,
7850,
29892,
13,
462,
462,
525,
13919,
4839,
995,
742,
3806,
29918,
14273,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
13193,
29922,
29900,
29899,
29900,
6653,
29896,
10827,
13,
4706,
3806,
29918,
14273,
353,
6702,
1576,
995,
4944,
363,
278,
12146,
525,
13,
462,
308,
525,
6672,
338,
8340,
29889,
450,
995,
1818,
367,
263,
525,
13,
462,
308,
525,
20621,
681,
3464,
29889,
1495,
13,
4706,
1583,
3032,
1688,
29918,
2704,
29918,
14144,
29898,
13662,
29892,
525,
3881,
742,
13,
462,
462,
11092,
535,
29889,
10493,
13919,
7850,
29892,
13,
462,
462,
525,
13919,
4839,
995,
742,
3806,
29918,
14273,
29897,
13,
13,
4706,
9066,
353,
11117,
6069,
2396,
525,
29896,
29900,
29899,
10827,
13,
4706,
3806,
29918,
14273,
353,
4852,
1576,
995,
4944,
363,
278,
12146,
376,
13,
462,
308,
376,
6672,
338,
8340,
29889,
450,
995,
1818,
367,
376,
13,
462,
308,
376,
13506,
287,
411,
263,
3464,
5190,
29892,
321,
29889,
29887,
29889,
525,
13193,
2433,
1159,
13,
4706,
1583,
3032,
1688,
29918,
2704,
29918,
14144,
29898,
13662,
29892,
525,
3881,
742,
13,
462,
462,
11092,
535,
29889,
10493,
13919,
7850,
29892,
13,
462,
462,
525,
13919,
4839,
995,
742,
3806,
29918,
14273,
29897,
13,
13,
1678,
822,
1243,
29918,
27259,
29918,
12715,
29918,
6672,
29898,
1311,
1125,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
3101,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3881,
29892,
6213,
29897,
13,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
3101,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3051,
29918,
2848,
29892,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
3051,
29918,
2848,
29898,
1311,
1125,
13,
4706,
9066,
353,
11117,
3051,
29899,
2848,
2396,
525,
29945,
29953,
29945,
29953,
10827,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3051,
29918,
2848,
29892,
29871,
29945,
29953,
29945,
29953,
29897,
13,
13,
4706,
9066,
353,
11117,
3051,
29899,
2848,
2396,
6629,
29913,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7971,
29889,
3051,
29918,
2848,
29892,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
29890,
468,
375,
29918,
3051,
29918,
2848,
29918,
13707,
29898,
1311,
1125,
13,
4706,
9066,
353,
11117,
3051,
29899,
2848,
2396,
525,
29888,
3365,
1537,
29899,
29890,
5963,
583,
10827,
13,
4706,
3806,
29918,
14273,
353,
6702,
1576,
995,
4944,
363,
278,
525,
13,
462,
308,
525,
3916,
29899,
6513,
4839,
338,
8340,
29889,
450,
995,
525,
13,
462,
308,
525,
974,
278,
4839,
1818,
367,
263,
1353,
29889,
1495,
13,
4706,
1583,
3032,
1688,
29918,
2704,
29918,
14144,
29898,
13662,
29892,
525,
3051,
29918,
2848,
742,
13,
462,
462,
11092,
535,
29889,
10493,
13919,
7850,
29892,
13,
462,
462,
525,
13919,
4839,
995,
742,
3806,
29918,
14273,
29897,
13,
13,
1678,
822,
1243,
29918,
29890,
468,
375,
29918,
3051,
29918,
2848,
29918,
10052,
29898,
1311,
1125,
13,
4706,
9066,
353,
11117,
3051,
29899,
2848,
2396,
17411,
29896,
10827,
13,
4706,
3806,
29918,
14273,
353,
6702,
1576,
995,
4944,
363,
278,
10576,
29899,
6513,
525,
13,
462,
308,
525,
6672,
338,
8340,
29889,
450,
995,
310,
278,
4839,
525,
13,
462,
308,
525,
21969,
367,
263,
6374,
1353,
29889,
1495,
13,
4706,
1583,
3032,
1688,
29918,
2704,
29918,
14144,
29898,
13662,
29892,
525,
3051,
29918,
2848,
742,
13,
462,
462,
11092,
535,
29889,
10493,
13919,
7850,
29892,
13,
462,
462,
525,
13919,
4839,
995,
742,
3806,
29918,
14273,
29897,
13,
13,
1678,
732,
1289,
29873,
29889,
1272,
29898,
877,
2539,
742,
525,
1256,
5477,
13,
795,
6702,
3644,
29899,
2111,
2164,
29899,
16076,
742,
525,
361,
29918,
1545,
2164,
29918,
16076,
5477,
13,
795,
6702,
3644,
29899,
2525,
1545,
2164,
29899,
16076,
742,
525,
361,
29918,
348,
1545,
2164,
29918,
16076,
5477,
13,
795,
1723,
13,
1678,
732,
1289,
29873,
29889,
348,
4058,
13,
1678,
822,
1243,
29918,
1256,
29898,
1311,
29892,
4839,
29892,
12421,
1125,
13,
4706,
2635,
353,
12865,
29889,
12673,
29898,
29906,
29900,
29896,
29941,
29892,
29871,
29946,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
29871,
29896,
29929,
29892,
29871,
29896,
29947,
29897,
13,
4706,
2635,
29918,
710,
353,
525,
1349,
29884,
29892,
29871,
29900,
29946,
319,
558,
29871,
29906,
29900,
29896,
29941,
29871,
29900,
29945,
29901,
29896,
29929,
29901,
29896,
29947,
402,
11490,
29915,
13,
13,
4706,
1583,
3032,
1688,
29918,
6672,
29918,
9684,
29918,
1767,
29898,
6672,
29892,
2635,
29918,
710,
29892,
12421,
29892,
2635,
29897,
13,
13,
1678,
732,
1289,
29873,
29889,
1272,
29898,
877,
2539,
742,
525,
1256,
5477,
13,
795,
6702,
3644,
29899,
2111,
2164,
29899,
23036,
742,
525,
361,
29918,
1545,
2164,
29918,
16076,
5477,
13,
795,
6702,
3644,
29899,
2525,
1545,
2164,
29899,
23036,
742,
525,
361,
29918,
348,
1545,
2164,
29918,
16076,
5477,
13,
795,
1723,
13,
1678,
732,
1289,
29873,
29889,
348,
4058,
13,
1678,
822,
1243,
29918,
1256,
29918,
20965,
29898,
1311,
29892,
4839,
29892,
12421,
1125,
13,
13,
4706,
396,
4712,
21971,
1016,
29915,
29873,
14670,
304,
390,
8610,
29871,
29896,
29896,
29906,
29941,
13,
4706,
9066,
353,
426,
6672,
29901,
525,
1349,
29884,
29892,
29871,
29900,
29946,
319,
558,
29871,
29906,
29900,
29896,
29941,
10827,
13,
4706,
3806,
29918,
14273,
353,
6702,
1576,
995,
4944,
363,
278,
426,
29900,
29913,
525,
13,
462,
308,
525,
6672,
338,
8340,
29889,
739,
1818,
367,
20917,
525,
13,
462,
308,
525,
5753,
3278,
304,
390,
8610,
29871,
29955,
29906,
29941,
29896,
29892,
9779,
29871,
29955,
29889,
29896,
29889,
29896,
29889,
29896,
1495,
13,
13,
4706,
1583,
3032,
1688,
29918,
2704,
29918,
14144,
29898,
13662,
29892,
12421,
29892,
13,
462,
462,
11092,
535,
29889,
10493,
13919,
7850,
29892,
13,
462,
462,
525,
13919,
4839,
995,
742,
13,
462,
462,
3806,
29918,
14273,
29889,
4830,
29898,
6672,
876,
13,
13,
4706,
9066,
353,
426,
6672,
29901,
6629,
29913,
13,
4706,
1583,
3032,
1688,
29918,
2704,
29918,
14144,
29898,
13662,
29892,
12421,
29892,
13,
462,
462,
11092,
535,
29889,
10493,
13919,
7850,
29892,
13,
462,
462,
525,
13919,
4839,
995,
742,
13,
462,
462,
3806,
29918,
14273,
29889,
4830,
29898,
6672,
876,
13,
13,
1678,
732,
1289,
29873,
29889,
1272,
877,
1256,
742,
525,
361,
29918,
1545,
2164,
29918,
16076,
742,
525,
361,
29918,
348,
1545,
2164,
29918,
16076,
1495,
13,
1678,
822,
1243,
29918,
1256,
29918,
27259,
29898,
1311,
29892,
12421,
1125,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
3101,
13,
4706,
1583,
29889,
9294,
3624,
29898,
657,
5552,
29898,
7971,
29892,
12421,
511,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
12715,
29918,
13662,
29898,
1311,
1125,
13,
4706,
6608,
353,
525,
5444,
29900,
29881,
29896,
29874,
29953,
29900,
1389,
29953,
29953,
29896,
29953,
1327,
29906,
29947,
29900,
29941,
29947,
29945,
29896,
29945,
29883,
29947,
11248,
29946,
10702,
29906,
29915,
13,
4706,
4817,
353,
525,
29950,
1529,
29907,
29918,
23498,
29896,
274,
29945,
29929,
29900,
2142,
29874,
29929,
1327,
29945,
29929,
29896,
29929,
29896,
600,
370,
29941,
29900,
29888,
29906,
29906,
29941,
29955,
29929,
29896,
29872,
29947,
29906,
29881,
29941,
11512,
29941,
29872,
29941,
2142,
29915,
13,
4706,
10823,
353,
525,
13424,
29914,
29896,
29889,
29900,
29889,
29896,
29915,
13,
4706,
2322,
29918,
14748,
353,
525,
18963,
29914,
29955,
29889,
29906,
29946,
29889,
29900,
313,
29916,
29947,
29953,
29918,
29953,
29946,
29899,
11548,
29899,
16702,
5080,
29896,
29906,
29889,
29900,
16029,
13,
13,
4706,
1583,
3032,
1688,
29918,
12715,
29918,
6672,
877,
23965,
742,
525,
29916,
29899,
18263,
535,
742,
525,
16044,
742,
13,
462,
462,
1678,
2322,
2433,
3877,
29930,
1495,
13,
13,
4706,
1583,
3032,
1688,
29918,
12715,
29918,
6672,
877,
25471,
742,
4817,
29892,
525,
5150,
1495,
13,
13,
4706,
1583,
3032,
1688,
29918,
12715,
29918,
6672,
877,
3916,
29899,
1542,
742,
525,
726,
29914,
24595,
742,
13,
462,
462,
1678,
525,
3051,
29918,
1853,
1495,
13,
4706,
1583,
3032,
1688,
29918,
12715,
29918,
6672,
877,
1252,
1103,
742,
525,
29896,
29900,
29900,
29899,
19878,
742,
525,
17854,
1495,
13,
13,
4706,
1583,
3032,
1688,
29918,
12715,
29918,
6672,
877,
3644,
29899,
9652,
742,
6608,
29892,
525,
361,
29918,
4352,
1495,
13,
4706,
1583,
3032,
1688,
29918,
12715,
29918,
6672,
877,
3644,
29899,
8516,
29899,
9652,
742,
6608,
29892,
525,
361,
29918,
9290,
29918,
4352,
1495,
13,
4706,
1583,
3032,
1688,
29918,
12715,
29918,
6672,
877,
3644,
29899,
6069,
742,
6608,
29892,
525,
361,
29918,
3881,
1495,
13,
13,
4706,
1583,
3032,
1688,
29918,
12715,
29918,
6672,
877,
2659,
29899,
19661,
742,
10823,
29892,
525,
1792,
29918,
14748,
742,
13,
462,
462,
1678,
2322,
29922,
4381,
29918,
14748,
29897,
13,
13,
1678,
822,
1243,
29918,
5696,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
7971,
29889,
5696,
29892,
525,
7194,
1495,
13,
13,
4706,
1583,
29889,
7971,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
2084,
2433,
742,
1158,
2433,
23252,
8785,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
7971,
29889,
5696,
29892,
525,
23252,
1495,
13,
13,
1678,
822,
1243,
29918,
6310,
29918,
2084,
29898,
1311,
1125,
13,
4706,
1583,
29889,
7971,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
2084,
2433,
8785,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
7971,
29889,
2084,
29892,
8207,
1495,
13,
13,
1678,
822,
1243,
29918,
3051,
29918,
1853,
29918,
5696,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
7971,
29889,
657,
29918,
6672,
877,
3051,
29899,
1853,
5477,
525,
726,
29914,
24595,
1495,
13,
13,
1678,
822,
1243,
29918,
3051,
29918,
2848,
29918,
5696,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
7971,
29889,
657,
29918,
6672,
877,
3051,
29899,
2848,
5477,
525,
29946,
29947,
29906,
29929,
1495,
13,
13,
1678,
396,
448,
2683,
2683,
2683,
2683,
1378,
13,
1678,
396,
6162,
6774,
13,
1678,
396,
448,
2683,
2683,
2683,
2683,
1378,
13,
13,
1678,
822,
903,
1688,
29918,
12715,
29918,
6672,
29898,
1311,
29892,
1024,
29892,
995,
29892,
12421,
29892,
2322,
29922,
8516,
1125,
13,
4706,
9066,
353,
426,
978,
29901,
995,
29913,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
657,
5552,
29898,
7971,
29892,
12421,
511,
995,
29897,
13,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
3101,
13,
4706,
1583,
29889,
9294,
9843,
29898,
657,
5552,
29898,
7971,
29892,
12421,
511,
2322,
29897,
13,
13,
1678,
822,
903,
1688,
29918,
6672,
29918,
9684,
29918,
1767,
29898,
1311,
29892,
1024,
29892,
995,
29892,
12421,
29892,
3806,
29918,
1767,
1125,
13,
4706,
9066,
353,
426,
978,
29901,
995,
29913,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
657,
5552,
29898,
7971,
29892,
12421,
511,
3806,
29918,
1767,
29897,
13,
13,
1678,
822,
903,
1688,
29918,
2704,
29918,
14144,
29898,
1311,
29892,
9066,
29892,
12421,
29918,
978,
29892,
13,
462,
9651,
1059,
29918,
1853,
29892,
3611,
29892,
6139,
1125,
13,
4706,
12428,
353,
10729,
29898,
13424,
29889,
3258,
29918,
21813,
29898,
13662,
29922,
13662,
876,
13,
13,
4706,
1018,
29901,
13,
9651,
679,
5552,
29898,
7971,
29892,
12421,
29918,
978,
29897,
13,
9651,
1583,
29889,
14057,
877,
29912,
29900,
29913,
451,
10425,
4286,
4830,
29898,
2704,
29918,
1853,
17255,
978,
1649,
876,
13,
4706,
5174,
1059,
29918,
1853,
408,
429,
29901,
13,
9651,
1583,
29889,
9294,
9843,
29898,
735,
29889,
3257,
29892,
3611,
29897,
13,
9651,
1583,
29889,
9294,
9843,
29898,
735,
29889,
8216,
29892,
6139,
29897,
13,
2
] |
oop/data-hiding.py | sinhdev/python-demo | 0 | 58222 | <reponame>sinhdev/python-demo<gh_stars>0
#!/usr/bin/python
class JustCounter:
__secret_count = 0
def count(self):
self.__secret_count += 1
print(self.__secret_count)
counter = JustCounter()
counter.count()
counter.count()
# can't access
print(counter.__secret_count) | [
1,
529,
276,
1112,
420,
29958,
5223,
29882,
3359,
29914,
4691,
29899,
17482,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
13,
13,
1990,
3387,
17779,
29901,
13,
259,
4770,
19024,
29918,
2798,
353,
29871,
29900,
13,
259,
13,
259,
822,
2302,
29898,
1311,
1125,
13,
418,
1583,
17255,
19024,
29918,
2798,
4619,
29871,
29896,
13,
418,
1596,
29898,
1311,
17255,
19024,
29918,
2798,
29897,
13,
13,
11808,
353,
3387,
17779,
580,
13,
11808,
29889,
2798,
580,
13,
11808,
29889,
2798,
580,
13,
29937,
508,
29915,
29873,
2130,
13,
2158,
29898,
11808,
17255,
19024,
29918,
2798,
29897,
2
] |
users/views.py | Slawomir-Kwiatkowski/auto-maniac | 3 | 1600297 | from django.shortcuts import render, redirect
from django.contrib.auth.forms import UserCreationForm, PasswordChangeForm
from django.contrib.auth import login, authenticate, update_session_auth_hash
from django.views.generic import CreateView
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
class RegisterUser(CreateView):
form_class = UserCreationForm
def get(self, request, *args, **kwargs):
return render(request, 'users/register-user.html', {'form': UserCreationForm()})
def post(self, request, *args, **kwargs):
form = UserCreationForm(request.POST)
if form.is_valid():
form.save()
username = form.cleaned_data.get('username')
password = form.cleaned_data.get('<PASSWORD>')
user = authenticate(username=username, password=password)
login(request, user)
messages.success(request, f'Welcome, {username}!')
return redirect('cars')
return render(request, 'users/register-user.html', {'form': form})
class ChangePassword(LoginRequiredMixin, CreateView):
form_class = PasswordChangeForm
def get(self, request, *args, **kwargs):
form = PasswordChangeForm(request.user)
return render(request, 'users/change-password.html', {'form': form})
def post(self, request, *args, **kwargs):
form = PasswordChangeForm(request.user, request.POST)
if form.is_valid():
user = form.save()
update_session_auth_hash(request, user)
messages.success(request, 'Password changed!')
return redirect('cars')
return render(request, 'users/change-password.html', {'form': form})
| [
1,
515,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
29892,
6684,
13,
3166,
9557,
29889,
21570,
29889,
5150,
29889,
9514,
1053,
4911,
9832,
362,
2500,
29892,
25280,
7277,
2500,
13,
3166,
9557,
29889,
21570,
29889,
5150,
1053,
6464,
29892,
15585,
403,
29892,
2767,
29918,
7924,
29918,
5150,
29918,
8568,
13,
3166,
9557,
29889,
7406,
29889,
19206,
1053,
6204,
1043,
13,
3166,
9557,
29889,
21570,
1053,
7191,
13,
3166,
9557,
29889,
21570,
29889,
5150,
29889,
28084,
1144,
1053,
19130,
19347,
29924,
861,
262,
13,
13,
13,
1990,
12577,
2659,
29898,
4391,
1043,
1125,
13,
1678,
883,
29918,
1990,
353,
4911,
9832,
362,
2500,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
736,
4050,
29898,
3827,
29892,
525,
7193,
29914,
9573,
29899,
1792,
29889,
1420,
742,
11117,
689,
2396,
4911,
9832,
362,
2500,
580,
1800,
13,
13,
1678,
822,
1400,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
883,
353,
4911,
9832,
362,
2500,
29898,
3827,
29889,
5438,
29897,
13,
4706,
565,
883,
29889,
275,
29918,
3084,
7295,
13,
9651,
883,
29889,
7620,
580,
13,
9651,
8952,
353,
883,
29889,
14941,
287,
29918,
1272,
29889,
657,
877,
6786,
1495,
13,
9651,
4800,
353,
883,
29889,
14941,
287,
29918,
1272,
29889,
657,
877,
29966,
25711,
17013,
29958,
1495,
13,
9651,
1404,
353,
15585,
403,
29898,
6786,
29922,
6786,
29892,
4800,
29922,
5630,
29897,
13,
9651,
6464,
29898,
3827,
29892,
1404,
29897,
13,
9651,
7191,
29889,
8698,
29898,
3827,
29892,
285,
29915,
28862,
2763,
29892,
426,
6786,
29913,
29991,
1495,
13,
9651,
736,
6684,
877,
29883,
1503,
1495,
13,
4706,
736,
4050,
29898,
3827,
29892,
525,
7193,
29914,
9573,
29899,
1792,
29889,
1420,
742,
11117,
689,
2396,
883,
1800,
13,
13,
13,
1990,
10726,
10048,
29898,
11049,
19347,
29924,
861,
262,
29892,
6204,
1043,
1125,
13,
1678,
883,
29918,
1990,
353,
25280,
7277,
2500,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
883,
353,
25280,
7277,
2500,
29898,
3827,
29889,
1792,
29897,
13,
4706,
736,
4050,
29898,
3827,
29892,
525,
7193,
29914,
3167,
29899,
5630,
29889,
1420,
742,
11117,
689,
2396,
883,
1800,
13,
13,
1678,
822,
1400,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
883,
353,
25280,
7277,
2500,
29898,
3827,
29889,
1792,
29892,
2009,
29889,
5438,
29897,
13,
4706,
565,
883,
29889,
275,
29918,
3084,
7295,
13,
9651,
1404,
353,
883,
29889,
7620,
580,
13,
9651,
2767,
29918,
7924,
29918,
5150,
29918,
8568,
29898,
3827,
29892,
1404,
29897,
13,
9651,
7191,
29889,
8698,
29898,
3827,
29892,
525,
10048,
3939,
29991,
1495,
13,
9651,
736,
6684,
877,
29883,
1503,
1495,
13,
4706,
736,
4050,
29898,
3827,
29892,
525,
7193,
29914,
3167,
29899,
5630,
29889,
1420,
742,
11117,
689,
2396,
883,
1800,
13,
2
] |
atcoder/abc/abc135_b.py | knuu/competitive-programming | 1 | 125127 | N = int(input())
A = [int(x) for x in input().split()]
for i in range(N):
for j in range(i, N):
A[i], A[j] = A[j], A[i]
if sorted(A) == A:
print("YES")
quit()
A[i], A[j] = A[j], A[i]
print("NO")
| [
1,
405,
353,
938,
29898,
2080,
3101,
13,
29909,
353,
518,
524,
29898,
29916,
29897,
363,
921,
297,
1881,
2141,
5451,
580,
29962,
13,
1454,
474,
297,
3464,
29898,
29940,
1125,
13,
1678,
363,
432,
297,
3464,
29898,
29875,
29892,
405,
1125,
13,
4706,
319,
29961,
29875,
1402,
319,
29961,
29926,
29962,
353,
319,
29961,
29926,
1402,
319,
29961,
29875,
29962,
13,
4706,
565,
12705,
29898,
29909,
29897,
1275,
319,
29901,
13,
9651,
1596,
703,
21143,
1159,
13,
9651,
23283,
580,
13,
4706,
319,
29961,
29875,
1402,
319,
29961,
29926,
29962,
353,
319,
29961,
29926,
1402,
319,
29961,
29875,
29962,
13,
2158,
703,
6632,
1159,
13,
2
] |
app/actions/campaigns.py | appliedbloc/cm-data-service | 0 | 116611 | <filename>app/actions/campaigns.py<gh_stars>0
from sqlalchemy.orm import Session
from sqlalchemy import update
from fastapi.encoders import jsonable_encoder
import models, schemas
def get_campaign(db: Session, campaign_id: int):
return db.query(models.Campaign).filter(models.Campaign.id == campaign_id).first()
def get_campaign_by_recipient(db: Session, recipient: str):
return db.query(models.Campaign).filter(models.Campaign.recipient == recipient).first()
def get_campaigns(db: Session, skip: int = 0, limit: int = 10):
return db.query(models.Campaign).offset(skip).limit(limit).all()
def create_campaign(db: Session, campaign: schemas.CampaignCreate):
db_campaign = models.Campaign(**campaign.dict())
db.add(db_campaign)
db.commit()
db.refresh(db_campaign)
return db_campaign
def update_campaign(db: Session, db_campaign: models.Campaign, campaign: schemas.CampaignUpdate):
campaign_in = campaign.dict(exclude_unset=True)
obj_data = jsonable_encoder(db_campaign)
for field in obj_data:
if field in campaign_in:
setattr(db_campaign, field, campaign_in[field])
db.add(db_campaign)
db.commit()
db.refresh(db_campaign)
return db_campaign
| [
1,
529,
9507,
29958,
932,
29914,
7387,
29914,
24821,
8729,
29879,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
4576,
284,
305,
6764,
29889,
555,
1053,
16441,
13,
3166,
4576,
284,
305,
6764,
1053,
2767,
13,
3166,
5172,
2754,
29889,
3977,
397,
414,
1053,
4390,
519,
29918,
3977,
6119,
13,
13,
5215,
4733,
29892,
1364,
8609,
13,
13,
13,
1753,
679,
29918,
24821,
8729,
29898,
2585,
29901,
16441,
29892,
11531,
29918,
333,
29901,
938,
1125,
13,
1678,
736,
4833,
29889,
1972,
29898,
9794,
29889,
29907,
1160,
8729,
467,
4572,
29898,
9794,
29889,
29907,
1160,
8729,
29889,
333,
1275,
11531,
29918,
333,
467,
4102,
580,
13,
13,
13,
1753,
679,
29918,
24821,
8729,
29918,
1609,
29918,
4361,
29886,
993,
29898,
2585,
29901,
16441,
29892,
23957,
993,
29901,
851,
1125,
13,
1678,
736,
4833,
29889,
1972,
29898,
9794,
29889,
29907,
1160,
8729,
467,
4572,
29898,
9794,
29889,
29907,
1160,
8729,
29889,
4361,
29886,
993,
1275,
23957,
993,
467,
4102,
580,
13,
13,
13,
1753,
679,
29918,
24821,
8729,
29879,
29898,
2585,
29901,
16441,
29892,
14383,
29901,
938,
353,
29871,
29900,
29892,
4046,
29901,
938,
353,
29871,
29896,
29900,
1125,
13,
1678,
736,
4833,
29889,
1972,
29898,
9794,
29889,
29907,
1160,
8729,
467,
10289,
29898,
11014,
467,
13400,
29898,
13400,
467,
497,
580,
13,
13,
13,
1753,
1653,
29918,
24821,
8729,
29898,
2585,
29901,
16441,
29892,
11531,
29901,
1364,
8609,
29889,
29907,
1160,
8729,
4391,
1125,
13,
1678,
4833,
29918,
24821,
8729,
353,
4733,
29889,
29907,
1160,
8729,
29898,
1068,
24821,
8729,
29889,
8977,
3101,
13,
1678,
4833,
29889,
1202,
29898,
2585,
29918,
24821,
8729,
29897,
13,
1678,
4833,
29889,
15060,
580,
13,
1678,
4833,
29889,
22379,
29898,
2585,
29918,
24821,
8729,
29897,
13,
1678,
736,
4833,
29918,
24821,
8729,
13,
13,
13,
1753,
2767,
29918,
24821,
8729,
29898,
2585,
29901,
16441,
29892,
4833,
29918,
24821,
8729,
29901,
4733,
29889,
29907,
1160,
8729,
29892,
11531,
29901,
1364,
8609,
29889,
29907,
1160,
8729,
6422,
1125,
13,
1678,
11531,
29918,
262,
353,
11531,
29889,
8977,
29898,
735,
2325,
29918,
348,
842,
29922,
5574,
29897,
13,
1678,
5446,
29918,
1272,
353,
4390,
519,
29918,
3977,
6119,
29898,
2585,
29918,
24821,
8729,
29897,
13,
13,
1678,
363,
1746,
297,
5446,
29918,
1272,
29901,
13,
4706,
565,
1746,
297,
11531,
29918,
262,
29901,
13,
9651,
731,
5552,
29898,
2585,
29918,
24821,
8729,
29892,
1746,
29892,
11531,
29918,
262,
29961,
2671,
2314,
13,
13,
1678,
4833,
29889,
1202,
29898,
2585,
29918,
24821,
8729,
29897,
13,
1678,
4833,
29889,
15060,
580,
13,
1678,
4833,
29889,
22379,
29898,
2585,
29918,
24821,
8729,
29897,
13,
1678,
736,
4833,
29918,
24821,
8729,
13,
2
] |
test_vs_model_DEMs.py | drewleonard42/CoronaTemps | 1 | 34608 | <reponame>drewleonard42/CoronaTemps
# -*- coding: utf-8 -*-
"""
Script to produce synthetic AIA data based on arbitrary model DEMs and test the
results of the tempmap code against the model.
Created on Mon Jul 28 16:34:28 2014
@author: <NAME>
"""
import numpy as np
from matplotlib import use, rc
use('agg')
rc('savefig', bbox='tight', pad_inches=0.5)
import matplotlib.pyplot as plt
from matplotlib import patches
import sunpy
from sunpy.map import Map
from temperature import TemperatureMap
from utils import gaussian, load_temp_responses
from os import path, makedirs
import subprocess32 as subp
from itertools import product
from skimage import measure
from sys import argv
# Decide whether to assess single-parameter or full-Gaussian method
n_pars = int(argv[1])
# Define which wavelength to use for EM estimation with 1-parameter TMaps
emwlen = str(argv[2])
# Define CoronaTemps home folder and output folder
CThome = path.join(path.expanduser('~'), 'CoronaTemps')
outdir = path.join(CThome, 'validation', '{}pars'.format(n_pars))
tmap_script = path.join(CThome, 'create_tempmap.py')
if not path.exists(outdir): makedirs(outdir)
# Define parameter ranges
#temps = np.arange(4.6, 7.405, 0.01)#0.005)
temps = np.arange(5.6, 7.005, 0.01)
widths = np.array([0.01, 0.1, 0.5])#np.arange(0.01, 0.605, 0.005) # Just copying Aschwanden's range here
#heights = 10 ** np.arange(18, 37, 0.1)#0.05)
heights = 10 ** np.arange(20, 35, 0.1)
#print heights
n_temps = len(temps)
n_widths = len(widths)
n_heights = len(heights)
parvals = np.array([i for i in product(temps, widths, heights)])
#print parvals.shape
n_vals = n_temps * n_widths * n_heights
#print n_temps, n_widths, n_heights, n_vals, n_vals * 6
# Create model DEMs and synthetic emission
emission = np.zeros((6, n_temps, n_widths, n_heights))
#print emission.shape
logt = np.arange(0, 15.05, 0.05)
resp = load_temp_responses()
delta_t = logt[1] - logt[0]
for p, params in enumerate(parvals):
dem = gaussian(logt, *params)
f = resp * dem
t = np.where(temps == params[0])[0][0]
w = np.where(widths == params[1])[0][0]
h = np.where(heights == params[2])[0][0]
emission[:, t, w, h] = np.sum(f, axis=1) * delta_t
#emission = emission / emission[2, :, :, :]
#print '----', emission[2, :, :, :].min(), emission[2, :, :, :].max()
# Load AIA response functions
resp = load_temp_responses()
# Load unnessecary map for its metadata
voidmap = Map(sunpy.AIA_171_IMAGE)
mapmeta = voidmap.meta
#rect = patches.Rectangle([25.0, 5.6], 1.0, 1.0, color='black', fill=True, clip_on=False)
# Run synthetic data through 1param tempmap method
for w, wid in enumerate(widths):#heights):
print '\nWidth:', wid
fig = plt.figure(figsize=(30, 12))
for wl, wlength in enumerate(['94', '131', '171', '193', '211', '335']):
#emiss = Map(emission[wl, :, :, w], mapmeta)
emiss = Map(emission[wl, :, w, :].copy(), mapmeta)
emiss.cmap = sunpy.cm.get_cmap('sdoaia{}'.format(wlength))
emiss.meta['naxis1'] = emiss.shape[1]
emiss.meta['naxis2'] = emiss.shape[0]
#emiss.meta['cdelt1'] = widths[1] - widths[0]
emiss.meta['cdelt1'] = heights[1] - heights[0] #np.log10(heights[1]) - np.log10(heights[0])
emiss.meta['cdelt2'] = temps[1] - temps[0]
#emiss.meta['crval1'] = widths[0]
emiss.meta['crval1'] = heights[0] #np.log10(heights[0])
emiss.meta['crval2'] = temps[0]
emiss.meta['crpix1'] = 0.5
emiss.meta['crpix2'] = 0.5
if wlength == '94': wlength = '094'
fits_dir = path.join(CThome, 'data', 'synthetic', wlength)
if not path.exists(fits_dir): makedirs(fits_dir)
emiss.save(path.join(fits_dir, 'model.fits'), clobber=True)
#print '----', emission[2, :, :, :].min(), emission[2, :, :, :].max()
#print '------', emission[2, :, w, :].min(), emission[2, :, w, :].max()
emiss.data /= emission[2, :, w, :]
#print '--------', emiss.min(), emiss.max()
ax = fig.add_subplot(1, 6, wl+1)
emiss.plot(aspect='auto', vmin=emiss.min(), vmax=emiss.max())
plt.title('{}'.format(wlength))
plt.xlabel('Input EM')
plt.ylabel('Input log(T)')
plt.colorbar()
#fig.gca().add_artist(rect)
plt.axvline(20.0, color='white')
plt.axvline(35.0, color='white')
plt.axhline(5.6, color='white')
plt.axhline(7.0, color='white')
#plt.savefig(path.join(outdir, 'model_emission_h={}'.format(np.log10(wid)).replace('.', '_')))
plt.savefig(path.join(outdir, 'model_emission_w={}'.format(wid).replace('.', '_')))
plt.close()
#images = [Map(emission[i, :, :, w], mapmeta) for i in range(6)]
images = [Map(emission[i, :, w, :], mapmeta) for i in range(6)]
if n_pars == 3:
cmdargs = "mpiexec -n 10 python {} model {} {} {} {} {} {}".format(
tmap_script, n_pars, path.join(CThome, 'data'),
None, None, True, True).split()
else:
cmdargs = "python {} model {} {} {} {} {} {}".format(
tmap_script, n_pars, path.join(CThome, 'data'),
None, None, True, True).split()
status = subp.call(cmdargs)
newmap = TemperatureMap(fname=path.join(CThome, 'temporary.fits'))
subp.call(["rm", path.join(CThome, 'temporary.fits')])
data, meta = newmap.data, newmap.meta
fitsmap = Map(np.log10(newmap.goodness_of_fit), newmap.meta.copy())
#print fitsmap.max()
newmap.data = data
print '-------------MINMAX:-------------'#, newmap.min(), newmap.max(), newmap.shape,
#print newmap.data[newmap.data == 0].shape, '----------\n'
print 'GoF', fitsmap.min(), fitsmap.mean(), fitsmap.max()
print 'T_out', newmap.min(), newmap.mean(), newmap.max()
#truetemp = np.array(list(temps)*n_widths).reshape((n_widths, n_temps)).T
truetemp = np.array(list(temps)*n_heights).reshape((n_heights, n_temps)).T
#print truetemp.shape, data.shape
diff = Map((abs(truetemp - data) / truetemp) * 100, newmap.meta.copy())
print 'T_diff', diff.min(), diff.mean(), diff.max()
if n_pars == 3:
wdata = Map(newmap.dem_width, newmap.meta.copy())
truew = np.ones(shape=(n_temps, n_heights)) * wid
#print 'truew', truew.min(), truew.mean(), truew.max()
diffw = Map((abs(truew - wdata.data) / truew) * 100, newmap.meta.copy())
print 'w_out', wdata.min(), wdata.mean(), wdata.max()
print 'w_diff', diffw.min(), diffw.mean(), diffw.max()
#print wid, newmap.xrange, newmap.yrange, newmap.scale
#print wid, diff.xrange, diff.yrange, diff.scale
fig = plt.figure(figsize=(24, 12))
fig.add_subplot(1, 3, 1)
newmap.plot(cmap='coolwarm', vmin=5.6, vmax=7.0, aspect='auto')
plt.colorbar()
plt.title('Solution log(T)', fontsize=28)
plt.ylabel('Input log(T)', fontsize=24)
plt.xlabel('Input EM', fontsize=24)#width', fontsize=24)
#fig.gca().add_artist(rect)
plt.axvline(20.0, color='white')
plt.axvline(35.0, color='white')
plt.axhline(5.6, color='white')
plt.axhline(7.0, color='white')
ax = fig.add_subplot(1, 3, 2)
#print 'diff', diff.min(), diff.max()
#print np.nanmin(diff.data), np.nanmax(diff.data)
diff.plot(cmap='RdYlGn_r', aspect='auto')#, vmin=diff.min(), vmax=diff.max())
plt.colorbar()
plt.title('Difference from input (%)', fontsize=28)
plt.xlabel('Input EM', fontsize=24)
#fig.gca().add_artist(rect)
plt.axvline(20.0, color='white')
plt.axvline(35.0, color='white')
plt.axhline(5.6, color='white')
plt.axhline(7.0, color='white')
ax = fig.add_subplot(1, 3, 3)
#print 'fits', fitsmap.min(), fitsmap.max()
#print np.nanmin(fitsmap.data), np.nanmax(fitsmap.data)
fitsmap.plot(cmap='cubehelix', aspect='auto')#,
# vmin=np.nanmin(fitsmap.data)-(2.0*(np.nanstd(fitsmap.data))),
# vmax=np.nanmax(fitsmap.data)+(2.0*(np.nanstd(fitsmap.data))))
plt.colorbar()
plt.title('log(Goodness-of-fit)', fontsize=28)
plt.xlabel('Input EM', fontsize=24)
#fig.gca().add_artist(rect)
plt.axvline(20.0, color='white')
plt.axvline(35.0, color='white')
plt.axhline(5.6, color='white')
plt.axhline(7.0, color='white')
#plt.savefig(path.join(outdir, 'tempsolutions_em={}'.format(np.log10(wid)).replace('.', '_')))
plt.savefig(path.join(outdir, 'tempsolutions_wid={:.3f}'.format(wid).replace('.', '_')))
plt.close()
if n_pars == 3:
emdata = Map(newmap.emission_measure, newmap.meta.copy())
else:
if emwlen == 'three':
total = np.zeros(newmap.shape)
for w in ['171', '193', '211']:
emdata = newmap.calculate_em(w, model=True)
total += emdata.data
emdata.data = total/3.0
elif emwlen == 'all':
total = np.zeros(newmap.shape)
for w in ['94', '131', '171', '193', '211', '335']:
emdata = newmap.calculate_em(w, model=True)
total += emdata.data
emdata.data = total/6.0
else:
emdata = newmap.calculate_em(emwlen, model=True)
trueem = np.array(list(heights)*n_temps).reshape(n_temps, n_heights)
diffem = Map((abs(trueem - emdata.data) / trueem) * 100, newmap.meta.copy())
#print wid, emdata.xrange, emdata.yrange, emdata.scale
#print wid, diffem.xrange, diffem.yrange, diffem.scale
#print wid, fitsmap.xrange, fitsmap.yrange, fitsmap.scale
fig = plt.figure(figsize=(24, 12))
ax = fig.add_subplot(1, 3, 1)
print 'em_out', emdata.min(), emdata.mean(), emdata.max()
print 'em_diff', diffem.min(), diffem.mean(), diffem.max()
#print np.nanmin(emdata.data), np.nanmax(emdata.data)
emdata.plot(cmap='coolwarm', aspect='auto',
vmin=emdata.min(), vmax=emdata.max())
# vmin=np.log10(heights[0]), vmax=np.log10(heights[-1]))
contours = measure.find_contours(emdata.data, heights[0])
for contour in contours:
contour[:, 0] *= emdata.scale['y']
contour[:, 1] *= emdata.scale['x']
contour[:, 0] += emdata.yrange[0]
contour[:, 1] += emdata.xrange[0]
plt.plot(contour[:, 1], contour[:, 0], color='blue')
plt.xlim(*emdata.xrange)
plt.ylim(*emdata.yrange)
contours = measure.find_contours(emdata.data, heights[-1])
for contour in contours:
contour[:, 0] *= emdata.scale['y']
contour[:, 1] *= emdata.scale['x']
contour[:, 0] += emdata.yrange[0]
contour[:, 1] += emdata.xrange[0]
plt.plot(contour[:, 1], contour[:, 0], color='black')
plt.xlim(*emdata.xrange)
plt.ylim(*emdata.yrange)
if n_pars == 3:
plt.axvline(20.0, color='white')
plt.axvline(35.0, color='white')
plt.axhline(5.6, color='white')
plt.axhline(7.0, color='white')
plt.colorbar()
plt.title('Solution EM', fontsize=28)
plt.ylabel('Input log(T)', fontsize=24)
plt.xlabel('Input EM', fontsize=24)#width', fontsize=24)
ax = fig.add_subplot(1, 3, 2)
#print 'diffem', diffem.min(), diffem.max()
#print np.nanmin(diffem.data), np.nanmax(diffem.data)
diffem.plot(cmap='RdYlGn_r', aspect='auto',
# vmin=0, vmax=50)
vmin=diffem.min(), vmax=diffem.max())
#fig.gca().add_artist(rect)
if n_pars == 3:
plt.axvline(20.0, color='white')
plt.axvline(35.0, color='white')
plt.axhline(5.6, color='white')
plt.axhline(7.0, color='white')
plt.colorbar()
plt.title('Difference from input (%)', fontsize=28)
plt.xlabel('Input EM', fontsize=24)
ax = fig.add_subplot(1, 3, 3)
fitsmap.plot(cmap='cubehelix', aspect='auto')
if n_pars == 3:
plt.axvline(20.0, color='white')
plt.axvline(35.0, color='white')
plt.axhline(5.6, color='white')
plt.axhline(7.0, color='white')
plt.colorbar()
plt.title('log(Goodness-of-fit)', fontsize=28)
plt.xlabel('Input EM', fontsize=24)
if n_pars == 3:
plt.savefig(path.join(outdir, 'emsolutions_wid={:.3f}'.format(wid).replace('.', '_')))
else:
plt.savefig(path.join(outdir, 'emsolutions_wid={:.3f}_wlen={}'.format(wid, emwlen).replace('.', '_')))
plt.close()
if n_pars == 3:
#print wid, wdata.xrange, wdata.yrange, wdata.scale
#print wid, diffw.xrange, diffw.yrange, diffw.scale
fig = plt.figure(figsize=(24, 12))
ax = fig.add_subplot(1, 3, 1)
wdata.plot(cmap='coolwarm', vmin=widths[0], vmax=widths[-1], aspect='auto')
#fig.gca().add_artist(rect)
plt.axvline(20.0, color='white')
plt.axvline(35.0, color='white')
plt.axhline(5.6, color='white')
plt.axhline(7.0, color='white')
plt.colorbar()
plt.title('Solution width', fontsize=28)
plt.ylabel('Input log(T)', fontsize=24)
plt.xlabel('Input EM', fontsize=24)#width', fontsize=24)
ax = fig.add_subplot(1, 3, 2)
#print 'diffw', diffw.min(), diffw.max()
#print np.nanmin(diffw.data), np.nanmax(diffw.data)
diffw.plot(cmap='RdYlGn_r', vmin=diffw.min(), vmax=diffw.max(), aspect='auto')
#fig.gca().add_artist(rect)
plt.axvline(20.0, color='white')
plt.axvline(35.0, color='white')
plt.axhline(5.6, color='white')
plt.axhline(7.0, color='white')
plt.colorbar()
plt.title('Difference from input (%)', fontsize=28)
plt.xlabel('Input EM', fontsize=24)
ax = fig.add_subplot(1, 3, 3)
fitsmap.plot(cmap='cubehelix', aspect='auto')
#fig.gca().add_artist(rect)
plt.axvline(20.0, color='white')
plt.axvline(35.0, color='white')
plt.axhline(5.6, color='white')
plt.axhline(7.0, color='white')
plt.colorbar()
plt.title('log(Goodness-of-fit)', fontsize=28)
plt.xlabel('Input EM', fontsize=24)
plt.savefig(path.join(outdir, 'widsolutions_wid={:.3f}'.format(wid).replace('.', '_')))
plt.close()
"""w = np.where((widths > 0.097)*(widths < 0.103))
dataslice = data[:, w].reshape(len(temps))
diffslice = diff[:, w].reshape(len(temps))
fitslice = fits[:, w].reshape(len(temps))
fig = plt.figure(figsize=(16, 12))
plt.plot(temps, dataslice)
plt.title('Solution log(T) at width=0.1', fontsize=28)
plt.xlabel('Input log(T)', fontsize=24)
plt.ylabel('Solution log(T)', fontsize=24)
plt.savefig('/home/drew/Dropbox/euroscipy/dataslice')
plt.close()
fig = plt.figure(figsize=(16, 12))
plt.plot(temps, diffslice)
plt.title('Difference from input at width=0.1', fontsize=28)
plt.xlabel('Input log(T)', fontsize=24)
plt.ylabel('Difference (%)', fontsize=24)
plt.savefig('/home/drew/Dropbox/euroscipy/diffslice')
plt.close()
fig = plt.figure(figsize=(16, 12))
ax = fig.add_subplot(1, 1, 1)
plt.plot(temps, np.log10(fitslice))
plt.title('Goodness-of-fit at width=0.1', fontsize=28)
plt.xlabel('Input log(T)', fontsize=24)
plt.ylabel('log(Goodness-of-fit)', fontsize=24)
plt.savefig('/home/drew/Dropbox/euroscipy/fitslice')
plt.close()"""
# Run synthetic data throguh 3param tempmap method
# Somehow display the results.
| [
1,
529,
276,
1112,
420,
29958,
29881,
3973,
280,
265,
538,
29946,
29906,
29914,
12521,
2681,
5776,
567,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
4081,
304,
7738,
14710,
7492,
319,
10764,
848,
2729,
373,
11472,
1904,
5012,
29924,
29879,
322,
1243,
278,
13,
9902,
310,
278,
5694,
1958,
775,
2750,
278,
1904,
29889,
13,
13,
20399,
373,
2598,
2739,
29871,
29906,
29947,
29871,
29896,
29953,
29901,
29941,
29946,
29901,
29906,
29947,
29871,
29906,
29900,
29896,
29946,
13,
13,
29992,
8921,
29901,
529,
5813,
29958,
13,
15945,
29908,
13,
13,
5215,
12655,
408,
7442,
13,
3166,
22889,
1053,
671,
29892,
364,
29883,
13,
1509,
877,
16170,
1495,
13,
2214,
877,
7620,
1003,
742,
289,
1884,
2433,
29873,
523,
742,
17132,
29918,
262,
6609,
29922,
29900,
29889,
29945,
29897,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
3166,
22889,
1053,
13261,
267,
13,
5215,
6575,
2272,
13,
3166,
6575,
2272,
29889,
1958,
1053,
7315,
13,
3166,
10430,
1053,
6789,
546,
1535,
3388,
13,
3166,
3667,
29879,
1053,
330,
17019,
29892,
2254,
29918,
7382,
29918,
26679,
267,
13,
3166,
2897,
1053,
2224,
29892,
2136,
287,
12935,
13,
5215,
1014,
5014,
29941,
29906,
408,
1014,
29886,
13,
3166,
4256,
8504,
1053,
3234,
13,
3166,
2071,
3027,
1053,
5645,
13,
3166,
10876,
1053,
1852,
29894,
13,
13,
29937,
897,
8204,
3692,
304,
24809,
2323,
29899,
15501,
470,
2989,
29899,
29954,
17019,
1158,
13,
29876,
29918,
862,
29879,
353,
938,
29898,
19218,
29961,
29896,
2314,
13,
13,
29937,
22402,
607,
281,
6447,
1477,
304,
671,
363,
27295,
23248,
411,
29871,
29896,
29899,
15501,
323,
29924,
2547,
13,
331,
29893,
2435,
353,
851,
29898,
19218,
29961,
29906,
2314,
13,
13,
29937,
22402,
2994,
2681,
5776,
567,
3271,
4138,
322,
1962,
4138,
13,
29907,
1349,
608,
353,
2224,
29889,
7122,
29898,
2084,
29889,
18837,
1792,
877,
30022,
5477,
525,
12521,
2681,
5776,
567,
1495,
13,
449,
3972,
353,
2224,
29889,
7122,
29898,
29907,
1349,
608,
29892,
525,
18157,
742,
525,
8875,
862,
29879,
4286,
4830,
29898,
29876,
29918,
862,
29879,
876,
13,
29873,
1958,
29918,
2154,
353,
2224,
29889,
7122,
29898,
29907,
1349,
608,
29892,
525,
3258,
29918,
7382,
1958,
29889,
2272,
1495,
13,
361,
451,
2224,
29889,
9933,
29898,
449,
3972,
1125,
2136,
287,
12935,
29898,
449,
3972,
29897,
13,
13,
29937,
22402,
3443,
20238,
13,
29937,
27761,
353,
7442,
29889,
279,
927,
29898,
29946,
29889,
29953,
29892,
29871,
29955,
29889,
29946,
29900,
29945,
29892,
29871,
29900,
29889,
29900,
29896,
29897,
29937,
29900,
29889,
29900,
29900,
29945,
29897,
13,
27761,
353,
7442,
29889,
279,
927,
29898,
29945,
29889,
29953,
29892,
29871,
29955,
29889,
29900,
29900,
29945,
29892,
29871,
29900,
29889,
29900,
29896,
29897,
13,
2103,
29879,
353,
7442,
29889,
2378,
4197,
29900,
29889,
29900,
29896,
29892,
29871,
29900,
29889,
29896,
29892,
29871,
29900,
29889,
29945,
2314,
29937,
9302,
29889,
279,
927,
29898,
29900,
29889,
29900,
29896,
29892,
29871,
29900,
29889,
29953,
29900,
29945,
29892,
29871,
29900,
29889,
29900,
29900,
29945,
29897,
396,
3387,
17596,
319,
816,
29893,
7257,
29915,
29879,
3464,
1244,
13,
29937,
3545,
29879,
353,
29871,
29896,
29900,
3579,
7442,
29889,
279,
927,
29898,
29896,
29947,
29892,
29871,
29941,
29955,
29892,
29871,
29900,
29889,
29896,
29897,
29937,
29900,
29889,
29900,
29945,
29897,
13,
3545,
29879,
353,
29871,
29896,
29900,
3579,
7442,
29889,
279,
927,
29898,
29906,
29900,
29892,
29871,
29941,
29945,
29892,
29871,
29900,
29889,
29896,
29897,
13,
29937,
2158,
3171,
29879,
13,
29876,
29918,
27761,
353,
7431,
29898,
27761,
29897,
13,
29876,
29918,
2103,
29879,
353,
7431,
29898,
2103,
29879,
29897,
13,
29876,
29918,
3545,
29879,
353,
7431,
29898,
3545,
29879,
29897,
13,
862,
791,
29879,
353,
7442,
29889,
2378,
4197,
29875,
363,
474,
297,
3234,
29898,
27761,
29892,
2920,
29879,
29892,
3171,
29879,
29897,
2314,
13,
29937,
2158,
610,
791,
29879,
29889,
12181,
13,
29876,
29918,
791,
29879,
353,
302,
29918,
27761,
334,
302,
29918,
2103,
29879,
334,
302,
29918,
3545,
29879,
13,
29937,
2158,
302,
29918,
27761,
29892,
302,
29918,
2103,
29879,
29892,
302,
29918,
3545,
29879,
29892,
302,
29918,
791,
29879,
29892,
302,
29918,
791,
29879,
334,
29871,
29953,
13,
13,
29937,
6204,
1904,
5012,
29924,
29879,
322,
14710,
7492,
25477,
13,
331,
2333,
353,
7442,
29889,
3298,
359,
3552,
29953,
29892,
302,
29918,
27761,
29892,
302,
29918,
2103,
29879,
29892,
302,
29918,
3545,
29879,
876,
13,
29937,
2158,
25477,
29889,
12181,
13,
1188,
29873,
353,
7442,
29889,
279,
927,
29898,
29900,
29892,
29871,
29896,
29945,
29889,
29900,
29945,
29892,
29871,
29900,
29889,
29900,
29945,
29897,
13,
13713,
353,
2254,
29918,
7382,
29918,
26679,
267,
580,
13,
4181,
29918,
29873,
353,
1480,
29873,
29961,
29896,
29962,
448,
1480,
29873,
29961,
29900,
29962,
13,
1454,
282,
29892,
8636,
297,
26985,
29898,
862,
791,
29879,
1125,
13,
1678,
1261,
353,
330,
17019,
29898,
1188,
29873,
29892,
334,
7529,
29897,
13,
1678,
285,
353,
4613,
334,
1261,
13,
1678,
260,
353,
7442,
29889,
3062,
29898,
27761,
1275,
8636,
29961,
29900,
2314,
29961,
29900,
3816,
29900,
29962,
13,
1678,
281,
353,
7442,
29889,
3062,
29898,
2103,
29879,
1275,
8636,
29961,
29896,
2314,
29961,
29900,
3816,
29900,
29962,
13,
1678,
298,
353,
7442,
29889,
3062,
29898,
3545,
29879,
1275,
8636,
29961,
29906,
2314,
29961,
29900,
3816,
29900,
29962,
13,
1678,
25477,
7503,
29892,
260,
29892,
281,
29892,
298,
29962,
353,
7442,
29889,
2083,
29898,
29888,
29892,
9685,
29922,
29896,
29897,
334,
19471,
29918,
29873,
13,
13,
29937,
331,
2333,
353,
25477,
847,
25477,
29961,
29906,
29892,
584,
29892,
584,
29892,
584,
29962,
13,
29937,
2158,
525,
807,
742,
25477,
29961,
29906,
29892,
584,
29892,
584,
29892,
584,
1822,
1195,
3285,
25477,
29961,
29906,
29892,
584,
29892,
584,
29892,
584,
1822,
3317,
580,
13,
13,
29937,
16012,
319,
10764,
2933,
3168,
13,
13713,
353,
2254,
29918,
7382,
29918,
26679,
267,
580,
13,
13,
29937,
16012,
443,
4515,
3471,
653,
2910,
363,
967,
15562,
13,
5405,
1958,
353,
7315,
29898,
11445,
2272,
29889,
29909,
10764,
29918,
29896,
29955,
29896,
29918,
2382,
29897,
13,
1958,
7299,
353,
1780,
1958,
29889,
7299,
13,
13,
29937,
1621,
353,
13261,
267,
29889,
7364,
2521,
4197,
29906,
29945,
29889,
29900,
29892,
29871,
29945,
29889,
29953,
1402,
29871,
29896,
29889,
29900,
29892,
29871,
29896,
29889,
29900,
29892,
2927,
2433,
8517,
742,
5445,
29922,
5574,
29892,
20102,
29918,
265,
29922,
8824,
29897,
13,
29937,
7525,
14710,
7492,
848,
1549,
29871,
29896,
3207,
5694,
1958,
1158,
13,
1454,
281,
29892,
9449,
297,
26985,
29898,
2103,
29879,
1125,
29937,
3545,
29879,
1125,
13,
1678,
1596,
11297,
29876,
6110,
29901,
742,
9449,
13,
1678,
2537,
353,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29941,
29900,
29892,
29871,
29896,
29906,
876,
13,
1678,
363,
281,
29880,
29892,
281,
2848,
29871,
297,
26985,
18959,
29929,
29946,
742,
525,
29896,
29941,
29896,
742,
525,
29896,
29955,
29896,
742,
525,
29896,
29929,
29941,
742,
525,
29906,
29896,
29896,
742,
525,
29941,
29941,
29945,
2033,
1125,
13,
4706,
396,
331,
790,
353,
7315,
29898,
331,
2333,
29961,
29893,
29880,
29892,
584,
29892,
584,
29892,
281,
1402,
2910,
7299,
29897,
13,
4706,
953,
790,
353,
7315,
29898,
331,
2333,
29961,
29893,
29880,
29892,
584,
29892,
281,
29892,
584,
1822,
8552,
3285,
2910,
7299,
29897,
13,
4706,
953,
790,
29889,
29883,
1958,
353,
6575,
2272,
29889,
4912,
29889,
657,
29918,
29883,
1958,
877,
29879,
1867,
29874,
423,
8875,
4286,
4830,
29898,
29893,
2848,
876,
13,
4706,
953,
790,
29889,
7299,
1839,
1056,
11497,
29896,
2033,
353,
953,
790,
29889,
12181,
29961,
29896,
29962,
13,
4706,
953,
790,
29889,
7299,
1839,
1056,
11497,
29906,
2033,
353,
953,
790,
29889,
12181,
29961,
29900,
29962,
13,
4706,
396,
331,
790,
29889,
7299,
1839,
2252,
2152,
29896,
2033,
353,
2920,
29879,
29961,
29896,
29962,
448,
2920,
29879,
29961,
29900,
29962,
13,
4706,
953,
790,
29889,
7299,
1839,
2252,
2152,
29896,
2033,
353,
3171,
29879,
29961,
29896,
29962,
448,
3171,
29879,
29961,
29900,
29962,
396,
9302,
29889,
1188,
29896,
29900,
29898,
3545,
29879,
29961,
29896,
2314,
448,
7442,
29889,
1188,
29896,
29900,
29898,
3545,
29879,
29961,
29900,
2314,
13,
4706,
953,
790,
29889,
7299,
1839,
2252,
2152,
29906,
2033,
353,
8714,
29961,
29896,
29962,
448,
8714,
29961,
29900,
29962,
13,
4706,
396,
331,
790,
29889,
7299,
1839,
7283,
791,
29896,
2033,
353,
2920,
29879,
29961,
29900,
29962,
13,
4706,
953,
790,
29889,
7299,
1839,
7283,
791,
29896,
2033,
353,
3171,
29879,
29961,
29900,
29962,
396,
9302,
29889,
1188,
29896,
29900,
29898,
3545,
29879,
29961,
29900,
2314,
13,
4706,
953,
790,
29889,
7299,
1839,
7283,
791,
29906,
2033,
353,
8714,
29961,
29900,
29962,
13,
4706,
953,
790,
29889,
7299,
1839,
7283,
29886,
861,
29896,
2033,
353,
29871,
29900,
29889,
29945,
13,
4706,
953,
790,
29889,
7299,
1839,
7283,
29886,
861,
29906,
2033,
353,
29871,
29900,
29889,
29945,
13,
4706,
565,
281,
2848,
1275,
525,
29929,
29946,
2396,
281,
2848,
353,
525,
29900,
29929,
29946,
29915,
13,
4706,
23994,
29918,
3972,
353,
2224,
29889,
7122,
29898,
29907,
1349,
608,
29892,
525,
1272,
742,
525,
19274,
386,
7492,
742,
281,
2848,
29897,
13,
4706,
565,
451,
2224,
29889,
9933,
29898,
29888,
1169,
29918,
3972,
1125,
2136,
287,
12935,
29898,
29888,
1169,
29918,
3972,
29897,
13,
4706,
953,
790,
29889,
7620,
29898,
2084,
29889,
7122,
29898,
29888,
1169,
29918,
3972,
29892,
525,
4299,
29889,
29888,
1169,
5477,
274,
2127,
495,
29922,
5574,
29897,
13,
4706,
396,
2158,
525,
807,
742,
25477,
29961,
29906,
29892,
584,
29892,
584,
29892,
584,
1822,
1195,
3285,
25477,
29961,
29906,
29892,
584,
29892,
584,
29892,
584,
1822,
3317,
580,
13,
4706,
396,
2158,
525,
22158,
742,
25477,
29961,
29906,
29892,
584,
29892,
281,
29892,
584,
1822,
1195,
3285,
25477,
29961,
29906,
29892,
584,
29892,
281,
29892,
584,
1822,
3317,
580,
13,
4706,
953,
790,
29889,
1272,
847,
29922,
25477,
29961,
29906,
29892,
584,
29892,
281,
29892,
584,
29962,
13,
4706,
396,
2158,
525,
1378,
742,
953,
790,
29889,
1195,
3285,
953,
790,
29889,
3317,
580,
13,
4706,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29892,
29871,
29953,
29892,
281,
29880,
29974,
29896,
29897,
13,
4706,
953,
790,
29889,
5317,
29898,
294,
1103,
2433,
6921,
742,
325,
1195,
29922,
331,
790,
29889,
1195,
3285,
325,
3317,
29922,
331,
790,
29889,
3317,
3101,
13,
4706,
14770,
29889,
3257,
877,
8875,
4286,
4830,
29898,
29893,
2848,
876,
13,
4706,
14770,
29889,
29916,
1643,
877,
4290,
27295,
1495,
13,
4706,
14770,
29889,
29891,
1643,
877,
4290,
1480,
29898,
29911,
29897,
1495,
13,
4706,
14770,
29889,
2780,
1646,
580,
13,
4706,
396,
1003,
29889,
29887,
1113,
2141,
1202,
29918,
442,
391,
29898,
1621,
29897,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29906,
29900,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29941,
29945,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
7760,
29898,
29945,
29889,
29953,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
7760,
29898,
29955,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
396,
572,
29873,
29889,
7620,
1003,
29898,
2084,
29889,
7122,
29898,
449,
3972,
29892,
525,
4299,
29918,
331,
2333,
29918,
29882,
3790,
29913,
4286,
4830,
29898,
9302,
29889,
1188,
29896,
29900,
29898,
9163,
8106,
6506,
12839,
742,
22868,
29915,
4961,
13,
1678,
14770,
29889,
7620,
1003,
29898,
2084,
29889,
7122,
29898,
449,
3972,
29892,
525,
4299,
29918,
331,
2333,
29918,
29893,
3790,
29913,
4286,
4830,
29898,
9163,
467,
6506,
12839,
742,
22868,
29915,
4961,
13,
1678,
14770,
29889,
5358,
580,
13,
268,
13,
1678,
396,
8346,
353,
518,
3388,
29898,
331,
2333,
29961,
29875,
29892,
584,
29892,
584,
29892,
281,
1402,
2910,
7299,
29897,
363,
474,
297,
3464,
29898,
29953,
4638,
13,
1678,
4558,
353,
518,
3388,
29898,
331,
2333,
29961,
29875,
29892,
584,
29892,
281,
29892,
584,
1402,
2910,
7299,
29897,
363,
474,
297,
3464,
29898,
29953,
4638,
13,
1678,
565,
302,
29918,
862,
29879,
1275,
29871,
29941,
29901,
13,
4706,
9920,
5085,
353,
376,
1526,
347,
29916,
687,
448,
29876,
29871,
29896,
29900,
3017,
6571,
1904,
6571,
6571,
6571,
6571,
6571,
6571,
1642,
4830,
29898,
13,
9651,
260,
1958,
29918,
2154,
29892,
302,
29918,
862,
29879,
29892,
2224,
29889,
7122,
29898,
29907,
1349,
608,
29892,
525,
1272,
5477,
13,
9651,
6213,
29892,
6213,
29892,
5852,
29892,
5852,
467,
5451,
580,
13,
1678,
1683,
29901,
13,
4706,
9920,
5085,
353,
376,
4691,
6571,
1904,
6571,
6571,
6571,
6571,
6571,
6571,
1642,
4830,
29898,
13,
9651,
260,
1958,
29918,
2154,
29892,
302,
29918,
862,
29879,
29892,
2224,
29889,
7122,
29898,
29907,
1349,
608,
29892,
525,
1272,
5477,
13,
9651,
6213,
29892,
6213,
29892,
5852,
29892,
5852,
467,
5451,
580,
13,
1678,
4660,
353,
1014,
29886,
29889,
4804,
29898,
9006,
5085,
29897,
13,
1678,
716,
1958,
353,
6789,
546,
1535,
3388,
29898,
29888,
978,
29922,
2084,
29889,
7122,
29898,
29907,
1349,
608,
29892,
525,
1356,
1971,
653,
29889,
29888,
1169,
8785,
13,
1678,
1014,
29886,
29889,
4804,
29898,
3366,
1758,
613,
2224,
29889,
7122,
29898,
29907,
1349,
608,
29892,
525,
1356,
1971,
653,
29889,
29888,
1169,
1495,
2314,
13,
1678,
848,
29892,
12700,
353,
716,
1958,
29889,
1272,
29892,
716,
1958,
29889,
7299,
13,
1678,
23994,
1958,
353,
7315,
29898,
9302,
29889,
1188,
29896,
29900,
29898,
1482,
1958,
29889,
16773,
2264,
29918,
974,
29918,
9202,
511,
716,
1958,
29889,
7299,
29889,
8552,
3101,
13,
1678,
396,
2158,
23994,
1958,
29889,
3317,
580,
13,
1678,
716,
1958,
29889,
1272,
353,
848,
13,
1678,
1596,
525,
9072,
29899,
16173,
12648,
29901,
9072,
29899,
29915,
6552,
716,
1958,
29889,
1195,
3285,
716,
1958,
29889,
3317,
3285,
716,
1958,
29889,
12181,
29892,
29871,
13,
1678,
396,
2158,
716,
1958,
29889,
1272,
29961,
1482,
1958,
29889,
1272,
1275,
29871,
29900,
1822,
12181,
29892,
525,
28400,
29905,
29876,
29915,
13,
1678,
1596,
525,
8120,
29943,
742,
23994,
1958,
29889,
1195,
3285,
23994,
1958,
29889,
12676,
3285,
23994,
1958,
29889,
3317,
580,
13,
1678,
1596,
525,
29911,
29918,
449,
742,
716,
1958,
29889,
1195,
3285,
716,
1958,
29889,
12676,
3285,
716,
1958,
29889,
3317,
580,
13,
13,
1678,
396,
509,
14484,
3451,
353,
7442,
29889,
2378,
29898,
1761,
29898,
27761,
11877,
29876,
29918,
2103,
29879,
467,
690,
14443,
3552,
29876,
29918,
2103,
29879,
29892,
302,
29918,
27761,
8106,
29911,
13,
1678,
534,
14484,
3451,
353,
7442,
29889,
2378,
29898,
1761,
29898,
27761,
11877,
29876,
29918,
3545,
29879,
467,
690,
14443,
3552,
29876,
29918,
3545,
29879,
29892,
302,
29918,
27761,
8106,
29911,
13,
1678,
396,
2158,
534,
14484,
3451,
29889,
12181,
29892,
848,
29889,
12181,
13,
1678,
2923,
353,
7315,
3552,
6897,
29898,
509,
14484,
3451,
448,
848,
29897,
847,
534,
14484,
3451,
29897,
334,
29871,
29896,
29900,
29900,
29892,
716,
1958,
29889,
7299,
29889,
8552,
3101,
13,
1678,
1596,
525,
29911,
29918,
12765,
742,
2923,
29889,
1195,
3285,
2923,
29889,
12676,
3285,
2923,
29889,
3317,
580,
13,
1678,
565,
302,
29918,
862,
29879,
1275,
29871,
29941,
29901,
13,
4706,
281,
1272,
353,
7315,
29898,
1482,
1958,
29889,
2310,
29918,
2103,
29892,
716,
1958,
29889,
7299,
29889,
8552,
3101,
13,
4706,
1565,
29893,
353,
7442,
29889,
2873,
29898,
12181,
7607,
29876,
29918,
27761,
29892,
302,
29918,
3545,
29879,
876,
334,
9449,
13,
4706,
396,
2158,
525,
3009,
29893,
742,
1565,
29893,
29889,
1195,
3285,
1565,
29893,
29889,
12676,
3285,
1565,
29893,
29889,
3317,
580,
13,
4706,
2923,
29893,
353,
7315,
3552,
6897,
29898,
3009,
29893,
448,
281,
1272,
29889,
1272,
29897,
847,
1565,
29893,
29897,
334,
29871,
29896,
29900,
29900,
29892,
716,
1958,
29889,
7299,
29889,
8552,
3101,
13,
4706,
1596,
525,
29893,
29918,
449,
742,
281,
1272,
29889,
1195,
3285,
281,
1272,
29889,
12676,
3285,
281,
1272,
29889,
3317,
580,
13,
4706,
1596,
525,
29893,
29918,
12765,
742,
2923,
29893,
29889,
1195,
3285,
2923,
29893,
29889,
12676,
3285,
2923,
29893,
29889,
3317,
580,
13,
268,
13,
1678,
396,
2158,
9449,
29892,
716,
1958,
29889,
29916,
3881,
29892,
716,
1958,
29889,
29891,
3881,
29892,
716,
1958,
29889,
7052,
13,
1678,
396,
2158,
9449,
29892,
2923,
29889,
29916,
3881,
29892,
2923,
29889,
29891,
3881,
29892,
2923,
29889,
7052,
13,
1678,
2537,
353,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29906,
29946,
29892,
29871,
29896,
29906,
876,
13,
1678,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29892,
29871,
29941,
29892,
29871,
29896,
29897,
13,
1678,
716,
1958,
29889,
5317,
29898,
29883,
1958,
2433,
1111,
324,
29893,
2817,
742,
325,
1195,
29922,
29945,
29889,
29953,
29892,
325,
3317,
29922,
29955,
29889,
29900,
29892,
9565,
2433,
6921,
1495,
13,
1678,
14770,
29889,
2780,
1646,
580,
13,
1678,
14770,
29889,
3257,
877,
13296,
918,
1480,
29898,
29911,
29897,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
1678,
14770,
29889,
29891,
1643,
877,
4290,
1480,
29898,
29911,
29897,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
1678,
14770,
29889,
29916,
1643,
877,
4290,
27295,
742,
4079,
2311,
29922,
29906,
29946,
29897,
29937,
2103,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
1678,
396,
1003,
29889,
29887,
1113,
2141,
1202,
29918,
442,
391,
29898,
1621,
29897,
13,
1678,
14770,
29889,
1165,
29894,
1220,
29898,
29906,
29900,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
29894,
1220,
29898,
29941,
29945,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29945,
29889,
29953,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29955,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
268,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29892,
29871,
29941,
29892,
29871,
29906,
29897,
13,
1678,
396,
2158,
525,
12765,
742,
2923,
29889,
1195,
3285,
2923,
29889,
3317,
580,
13,
1678,
396,
2158,
7442,
29889,
13707,
1195,
29898,
12765,
29889,
1272,
511,
7442,
29889,
13707,
3317,
29898,
12765,
29889,
1272,
29897,
13,
1678,
2923,
29889,
5317,
29898,
29883,
1958,
2433,
29934,
29881,
29979,
29880,
29954,
29876,
29918,
29878,
742,
9565,
2433,
6921,
1495,
6552,
325,
1195,
29922,
12765,
29889,
1195,
3285,
325,
3317,
29922,
12765,
29889,
3317,
3101,
13,
1678,
14770,
29889,
2780,
1646,
580,
13,
1678,
14770,
29889,
3257,
877,
29928,
17678,
515,
1881,
313,
10997,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
1678,
14770,
29889,
29916,
1643,
877,
4290,
27295,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
1678,
396,
1003,
29889,
29887,
1113,
2141,
1202,
29918,
442,
391,
29898,
1621,
29897,
13,
1678,
14770,
29889,
1165,
29894,
1220,
29898,
29906,
29900,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
29894,
1220,
29898,
29941,
29945,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29945,
29889,
29953,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29955,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
268,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29892,
29871,
29941,
29892,
29871,
29941,
29897,
13,
1678,
396,
2158,
525,
29888,
1169,
742,
23994,
1958,
29889,
1195,
3285,
23994,
1958,
29889,
3317,
580,
13,
1678,
396,
2158,
7442,
29889,
13707,
1195,
29898,
29888,
1169,
1958,
29889,
1272,
511,
7442,
29889,
13707,
3317,
29898,
29888,
1169,
1958,
29889,
1272,
29897,
13,
1678,
23994,
1958,
29889,
5317,
29898,
29883,
1958,
2433,
29883,
4003,
3952,
861,
742,
9565,
2433,
6921,
1495,
6552,
13,
1678,
396,
632,
325,
1195,
29922,
9302,
29889,
13707,
1195,
29898,
29888,
1169,
1958,
29889,
1272,
6817,
29898,
29906,
29889,
29900,
16395,
9302,
29889,
13707,
4172,
29898,
29888,
1169,
1958,
29889,
1272,
876,
511,
13,
1678,
396,
632,
325,
3317,
29922,
9302,
29889,
13707,
3317,
29898,
29888,
1169,
1958,
29889,
1272,
7240,
29898,
29906,
29889,
29900,
16395,
9302,
29889,
13707,
4172,
29898,
29888,
1169,
1958,
29889,
1272,
13697,
13,
1678,
14770,
29889,
2780,
1646,
580,
13,
1678,
14770,
29889,
3257,
877,
1188,
29898,
18420,
2264,
29899,
974,
29899,
9202,
29897,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
1678,
14770,
29889,
29916,
1643,
877,
4290,
27295,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
1678,
396,
1003,
29889,
29887,
1113,
2141,
1202,
29918,
442,
391,
29898,
1621,
29897,
13,
1678,
14770,
29889,
1165,
29894,
1220,
29898,
29906,
29900,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
29894,
1220,
29898,
29941,
29945,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29945,
29889,
29953,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29955,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
396,
572,
29873,
29889,
7620,
1003,
29898,
2084,
29889,
7122,
29898,
449,
3972,
29892,
525,
27761,
324,
17925,
29918,
331,
3790,
29913,
4286,
4830,
29898,
9302,
29889,
1188,
29896,
29900,
29898,
9163,
8106,
6506,
12839,
742,
22868,
29915,
4961,
13,
1678,
14770,
29889,
7620,
1003,
29898,
2084,
29889,
7122,
29898,
449,
3972,
29892,
525,
27761,
324,
17925,
29918,
9163,
3790,
29901,
29889,
29941,
29888,
29913,
4286,
4830,
29898,
9163,
467,
6506,
12839,
742,
22868,
29915,
4961,
13,
1678,
14770,
29889,
5358,
580,
13,
13,
1678,
565,
302,
29918,
862,
29879,
1275,
29871,
29941,
29901,
13,
4706,
953,
1272,
353,
7315,
29898,
1482,
1958,
29889,
331,
2333,
29918,
26658,
29892,
716,
1958,
29889,
7299,
29889,
8552,
3101,
13,
1678,
1683,
29901,
13,
4706,
565,
953,
29893,
2435,
1275,
525,
17536,
2396,
13,
9651,
3001,
353,
7442,
29889,
3298,
359,
29898,
1482,
1958,
29889,
12181,
29897,
13,
9651,
363,
281,
297,
6024,
29896,
29955,
29896,
742,
525,
29896,
29929,
29941,
742,
525,
29906,
29896,
29896,
2033,
29901,
13,
18884,
953,
1272,
353,
716,
1958,
29889,
15807,
403,
29918,
331,
29898,
29893,
29892,
1904,
29922,
5574,
29897,
13,
18884,
3001,
4619,
953,
1272,
29889,
1272,
13,
9651,
953,
1272,
29889,
1272,
353,
3001,
29914,
29941,
29889,
29900,
13,
4706,
25342,
953,
29893,
2435,
1275,
525,
497,
2396,
13,
9651,
3001,
353,
7442,
29889,
3298,
359,
29898,
1482,
1958,
29889,
12181,
29897,
13,
9651,
363,
281,
297,
6024,
29929,
29946,
742,
525,
29896,
29941,
29896,
742,
525,
29896,
29955,
29896,
742,
525,
29896,
29929,
29941,
742,
525,
29906,
29896,
29896,
742,
525,
29941,
29941,
29945,
2033,
29901,
13,
18884,
953,
1272,
353,
716,
1958,
29889,
15807,
403,
29918,
331,
29898,
29893,
29892,
1904,
29922,
5574,
29897,
13,
18884,
3001,
4619,
953,
1272,
29889,
1272,
13,
9651,
953,
1272,
29889,
1272,
353,
3001,
29914,
29953,
29889,
29900,
13,
4706,
1683,
29901,
13,
9651,
953,
1272,
353,
716,
1958,
29889,
15807,
403,
29918,
331,
29898,
331,
29893,
2435,
29892,
1904,
29922,
5574,
29897,
13,
1678,
1565,
331,
353,
7442,
29889,
2378,
29898,
1761,
29898,
3545,
29879,
11877,
29876,
29918,
27761,
467,
690,
14443,
29898,
29876,
29918,
27761,
29892,
302,
29918,
3545,
29879,
29897,
13,
1678,
2923,
331,
353,
7315,
3552,
6897,
29898,
3009,
331,
448,
953,
1272,
29889,
1272,
29897,
847,
1565,
331,
29897,
334,
29871,
29896,
29900,
29900,
29892,
716,
1958,
29889,
7299,
29889,
8552,
3101,
13,
1678,
396,
2158,
9449,
29892,
953,
1272,
29889,
29916,
3881,
29892,
953,
1272,
29889,
29891,
3881,
29892,
953,
1272,
29889,
7052,
13,
1678,
396,
2158,
9449,
29892,
2923,
331,
29889,
29916,
3881,
29892,
2923,
331,
29889,
29891,
3881,
29892,
2923,
331,
29889,
7052,
13,
1678,
396,
2158,
9449,
29892,
23994,
1958,
29889,
29916,
3881,
29892,
23994,
1958,
29889,
29891,
3881,
29892,
23994,
1958,
29889,
7052,
13,
1678,
2537,
353,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29906,
29946,
29892,
29871,
29896,
29906,
876,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29892,
29871,
29941,
29892,
29871,
29896,
29897,
13,
1678,
1596,
525,
331,
29918,
449,
742,
953,
1272,
29889,
1195,
3285,
953,
1272,
29889,
12676,
3285,
953,
1272,
29889,
3317,
580,
13,
1678,
1596,
525,
331,
29918,
12765,
742,
2923,
331,
29889,
1195,
3285,
2923,
331,
29889,
12676,
3285,
2923,
331,
29889,
3317,
580,
13,
1678,
396,
2158,
7442,
29889,
13707,
1195,
29898,
331,
1272,
29889,
1272,
511,
7442,
29889,
13707,
3317,
29898,
331,
1272,
29889,
1272,
29897,
13,
1678,
953,
1272,
29889,
5317,
29898,
29883,
1958,
2433,
1111,
324,
29893,
2817,
742,
9565,
2433,
6921,
742,
13,
18884,
325,
1195,
29922,
331,
1272,
29889,
1195,
3285,
325,
3317,
29922,
331,
1272,
29889,
3317,
3101,
13,
1678,
396,
9651,
325,
1195,
29922,
9302,
29889,
1188,
29896,
29900,
29898,
3545,
29879,
29961,
29900,
11724,
325,
3317,
29922,
9302,
29889,
1188,
29896,
29900,
29898,
3545,
29879,
14352,
29896,
12622,
13,
1678,
640,
2470,
353,
5645,
29889,
2886,
29918,
1285,
2470,
29898,
331,
1272,
29889,
1272,
29892,
3171,
29879,
29961,
29900,
2314,
13,
1678,
363,
640,
473,
297,
640,
2470,
29901,
13,
4706,
640,
473,
7503,
29892,
29871,
29900,
29962,
334,
29922,
953,
1272,
29889,
7052,
1839,
29891,
2033,
13,
4706,
640,
473,
7503,
29892,
29871,
29896,
29962,
334,
29922,
953,
1272,
29889,
7052,
1839,
29916,
2033,
13,
4706,
640,
473,
7503,
29892,
29871,
29900,
29962,
4619,
953,
1272,
29889,
29891,
3881,
29961,
29900,
29962,
13,
4706,
640,
473,
7503,
29892,
29871,
29896,
29962,
4619,
953,
1272,
29889,
29916,
3881,
29961,
29900,
29962,
13,
4706,
14770,
29889,
5317,
29898,
1285,
473,
7503,
29892,
29871,
29896,
1402,
640,
473,
7503,
29892,
29871,
29900,
1402,
2927,
2433,
9539,
1495,
13,
4706,
14770,
29889,
29916,
2576,
10456,
331,
1272,
29889,
29916,
3881,
29897,
13,
4706,
14770,
29889,
29891,
2576,
10456,
331,
1272,
29889,
29891,
3881,
29897,
13,
1678,
640,
2470,
353,
5645,
29889,
2886,
29918,
1285,
2470,
29898,
331,
1272,
29889,
1272,
29892,
3171,
29879,
14352,
29896,
2314,
13,
1678,
363,
640,
473,
297,
640,
2470,
29901,
13,
4706,
640,
473,
7503,
29892,
29871,
29900,
29962,
334,
29922,
953,
1272,
29889,
7052,
1839,
29891,
2033,
13,
4706,
640,
473,
7503,
29892,
29871,
29896,
29962,
334,
29922,
953,
1272,
29889,
7052,
1839,
29916,
2033,
13,
4706,
640,
473,
7503,
29892,
29871,
29900,
29962,
4619,
953,
1272,
29889,
29891,
3881,
29961,
29900,
29962,
13,
4706,
640,
473,
7503,
29892,
29871,
29896,
29962,
4619,
953,
1272,
29889,
29916,
3881,
29961,
29900,
29962,
13,
4706,
14770,
29889,
5317,
29898,
1285,
473,
7503,
29892,
29871,
29896,
1402,
640,
473,
7503,
29892,
29871,
29900,
1402,
2927,
2433,
8517,
1495,
13,
4706,
14770,
29889,
29916,
2576,
10456,
331,
1272,
29889,
29916,
3881,
29897,
13,
4706,
14770,
29889,
29891,
2576,
10456,
331,
1272,
29889,
29891,
3881,
29897,
13,
1678,
565,
302,
29918,
862,
29879,
1275,
29871,
29941,
29901,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29906,
29900,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29941,
29945,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29945,
29889,
29953,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29955,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
2780,
1646,
580,
13,
1678,
14770,
29889,
3257,
877,
13296,
918,
27295,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
1678,
14770,
29889,
29891,
1643,
877,
4290,
1480,
29898,
29911,
29897,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
1678,
14770,
29889,
29916,
1643,
877,
4290,
27295,
742,
4079,
2311,
29922,
29906,
29946,
29897,
29937,
2103,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
268,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29892,
29871,
29941,
29892,
29871,
29906,
29897,
13,
1678,
396,
2158,
525,
12765,
331,
742,
2923,
331,
29889,
1195,
3285,
2923,
331,
29889,
3317,
580,
13,
1678,
396,
2158,
7442,
29889,
13707,
1195,
29898,
12765,
331,
29889,
1272,
511,
7442,
29889,
13707,
3317,
29898,
12765,
331,
29889,
1272,
29897,
13,
1678,
2923,
331,
29889,
5317,
29898,
29883,
1958,
2433,
29934,
29881,
29979,
29880,
29954,
29876,
29918,
29878,
742,
9565,
2433,
6921,
742,
13,
1678,
396,
9651,
325,
1195,
29922,
29900,
29892,
325,
3317,
29922,
29945,
29900,
29897,
13,
18884,
325,
1195,
29922,
12765,
331,
29889,
1195,
3285,
325,
3317,
29922,
12765,
331,
29889,
3317,
3101,
13,
1678,
396,
1003,
29889,
29887,
1113,
2141,
1202,
29918,
442,
391,
29898,
1621,
29897,
13,
1678,
565,
302,
29918,
862,
29879,
1275,
29871,
29941,
29901,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29906,
29900,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29941,
29945,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29945,
29889,
29953,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29955,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
2780,
1646,
580,
13,
1678,
14770,
29889,
3257,
877,
29928,
17678,
515,
1881,
313,
10997,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
1678,
14770,
29889,
29916,
1643,
877,
4290,
27295,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
268,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29892,
29871,
29941,
29892,
29871,
29941,
29897,
13,
1678,
23994,
1958,
29889,
5317,
29898,
29883,
1958,
2433,
29883,
4003,
3952,
861,
742,
9565,
2433,
6921,
1495,
13,
1678,
565,
302,
29918,
862,
29879,
1275,
29871,
29941,
29901,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29906,
29900,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29941,
29945,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29945,
29889,
29953,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
1165,
7760,
29898,
29955,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
1678,
14770,
29889,
2780,
1646,
580,
13,
1678,
14770,
29889,
3257,
877,
1188,
29898,
18420,
2264,
29899,
974,
29899,
9202,
29897,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
1678,
14770,
29889,
29916,
1643,
877,
4290,
27295,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
13,
1678,
565,
302,
29918,
862,
29879,
1275,
29871,
29941,
29901,
13,
4706,
14770,
29889,
7620,
1003,
29898,
2084,
29889,
7122,
29898,
449,
3972,
29892,
525,
1567,
324,
17925,
29918,
9163,
3790,
29901,
29889,
29941,
29888,
29913,
4286,
4830,
29898,
9163,
467,
6506,
12839,
742,
22868,
29915,
4961,
13,
1678,
1683,
29901,
13,
4706,
14770,
29889,
7620,
1003,
29898,
2084,
29889,
7122,
29898,
449,
3972,
29892,
525,
1567,
324,
17925,
29918,
9163,
3790,
29901,
29889,
29941,
29888,
2403,
29893,
2435,
3790,
29913,
4286,
4830,
29898,
9163,
29892,
953,
29893,
2435,
467,
6506,
12839,
742,
22868,
29915,
4961,
13,
1678,
14770,
29889,
5358,
580,
13,
13,
1678,
565,
302,
29918,
862,
29879,
1275,
29871,
29941,
29901,
13,
4706,
396,
2158,
9449,
29892,
281,
1272,
29889,
29916,
3881,
29892,
281,
1272,
29889,
29891,
3881,
29892,
281,
1272,
29889,
7052,
13,
4706,
396,
2158,
9449,
29892,
2923,
29893,
29889,
29916,
3881,
29892,
2923,
29893,
29889,
29891,
3881,
29892,
2923,
29893,
29889,
7052,
13,
4706,
2537,
353,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29906,
29946,
29892,
29871,
29896,
29906,
876,
13,
4706,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29892,
29871,
29941,
29892,
29871,
29896,
29897,
13,
4706,
281,
1272,
29889,
5317,
29898,
29883,
1958,
2433,
1111,
324,
29893,
2817,
742,
325,
1195,
29922,
2103,
29879,
29961,
29900,
1402,
325,
3317,
29922,
2103,
29879,
14352,
29896,
1402,
9565,
2433,
6921,
1495,
13,
4706,
396,
1003,
29889,
29887,
1113,
2141,
1202,
29918,
442,
391,
29898,
1621,
29897,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29906,
29900,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29941,
29945,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
7760,
29898,
29945,
29889,
29953,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
7760,
29898,
29955,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
2780,
1646,
580,
13,
4706,
14770,
29889,
3257,
877,
13296,
918,
2920,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
4706,
14770,
29889,
29891,
1643,
877,
4290,
1480,
29898,
29911,
29897,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
4706,
14770,
29889,
29916,
1643,
877,
4290,
27295,
742,
4079,
2311,
29922,
29906,
29946,
29897,
29937,
2103,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
268,
13,
4706,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29892,
29871,
29941,
29892,
29871,
29906,
29897,
13,
4706,
396,
2158,
525,
12765,
29893,
742,
2923,
29893,
29889,
1195,
3285,
2923,
29893,
29889,
3317,
580,
13,
4706,
396,
2158,
7442,
29889,
13707,
1195,
29898,
12765,
29893,
29889,
1272,
511,
7442,
29889,
13707,
3317,
29898,
12765,
29893,
29889,
1272,
29897,
13,
4706,
2923,
29893,
29889,
5317,
29898,
29883,
1958,
2433,
29934,
29881,
29979,
29880,
29954,
29876,
29918,
29878,
742,
325,
1195,
29922,
12765,
29893,
29889,
1195,
3285,
325,
3317,
29922,
12765,
29893,
29889,
3317,
3285,
9565,
2433,
6921,
1495,
13,
4706,
396,
1003,
29889,
29887,
1113,
2141,
1202,
29918,
442,
391,
29898,
1621,
29897,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29906,
29900,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29941,
29945,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
7760,
29898,
29945,
29889,
29953,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
7760,
29898,
29955,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
2780,
1646,
580,
13,
4706,
14770,
29889,
3257,
877,
29928,
17678,
515,
1881,
313,
10997,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
4706,
14770,
29889,
29916,
1643,
877,
4290,
27295,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
13,
4706,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29892,
29871,
29941,
29892,
29871,
29941,
29897,
13,
4706,
23994,
1958,
29889,
5317,
29898,
29883,
1958,
2433,
29883,
4003,
3952,
861,
742,
9565,
2433,
6921,
1495,
13,
4706,
396,
1003,
29889,
29887,
1113,
2141,
1202,
29918,
442,
391,
29898,
1621,
29897,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29906,
29900,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29941,
29945,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
7760,
29898,
29945,
29889,
29953,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
1165,
7760,
29898,
29955,
29889,
29900,
29892,
2927,
2433,
10921,
1495,
13,
4706,
14770,
29889,
2780,
1646,
580,
13,
4706,
14770,
29889,
3257,
877,
1188,
29898,
18420,
2264,
29899,
974,
29899,
9202,
29897,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
4706,
14770,
29889,
29916,
1643,
877,
4290,
27295,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
268,
13,
4706,
14770,
29889,
7620,
1003,
29898,
2084,
29889,
7122,
29898,
449,
3972,
29892,
525,
9163,
2929,
17925,
29918,
9163,
3790,
29901,
29889,
29941,
29888,
29913,
4286,
4830,
29898,
9163,
467,
6506,
12839,
742,
22868,
29915,
4961,
13,
4706,
14770,
29889,
5358,
580,
13,
13,
15945,
29908,
29893,
353,
7442,
29889,
3062,
3552,
2103,
29879,
1405,
29871,
29900,
29889,
29900,
29929,
29955,
11877,
29898,
2103,
29879,
529,
29871,
29900,
29889,
29896,
29900,
29941,
876,
13,
14538,
5897,
353,
848,
7503,
29892,
281,
1822,
690,
14443,
29898,
2435,
29898,
27761,
876,
13,
12765,
18337,
353,
2923,
7503,
29892,
281,
1822,
690,
14443,
29898,
2435,
29898,
27761,
876,
13,
29888,
1169,
5897,
353,
23994,
7503,
29892,
281,
1822,
690,
14443,
29898,
2435,
29898,
27761,
876,
13,
13,
1003,
353,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29896,
29953,
29892,
29871,
29896,
29906,
876,
13,
572,
29873,
29889,
5317,
29898,
27761,
29892,
6155,
5897,
29897,
13,
572,
29873,
29889,
3257,
877,
13296,
918,
1480,
29898,
29911,
29897,
472,
2920,
29922,
29900,
29889,
29896,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
572,
29873,
29889,
29916,
1643,
877,
4290,
1480,
29898,
29911,
29897,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
572,
29873,
29889,
29891,
1643,
877,
13296,
918,
1480,
29898,
29911,
29897,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
572,
29873,
29889,
7620,
1003,
11219,
5184,
29914,
29881,
3973,
29914,
15063,
1884,
29914,
12932,
1883,
455,
2272,
29914,
14538,
5897,
1495,
13,
572,
29873,
29889,
5358,
580,
13,
13,
1003,
353,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29896,
29953,
29892,
29871,
29896,
29906,
876,
13,
572,
29873,
29889,
5317,
29898,
27761,
29892,
2923,
18337,
29897,
13,
572,
29873,
29889,
3257,
877,
29928,
17678,
515,
1881,
472,
2920,
29922,
29900,
29889,
29896,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
572,
29873,
29889,
29916,
1643,
877,
4290,
1480,
29898,
29911,
29897,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
572,
29873,
29889,
29891,
1643,
877,
29928,
17678,
313,
10997,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
572,
29873,
29889,
7620,
1003,
11219,
5184,
29914,
29881,
3973,
29914,
15063,
1884,
29914,
12932,
1883,
455,
2272,
29914,
12765,
18337,
1495,
13,
572,
29873,
29889,
5358,
580,
13,
13,
1003,
353,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29896,
29953,
29892,
29871,
29896,
29906,
876,
13,
1165,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
572,
29873,
29889,
5317,
29898,
27761,
29892,
7442,
29889,
1188,
29896,
29900,
29898,
29888,
1169,
5897,
876,
13,
572,
29873,
29889,
3257,
877,
18420,
2264,
29899,
974,
29899,
9202,
472,
2920,
29922,
29900,
29889,
29896,
742,
4079,
2311,
29922,
29906,
29947,
29897,
13,
572,
29873,
29889,
29916,
1643,
877,
4290,
1480,
29898,
29911,
29897,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
572,
29873,
29889,
29891,
1643,
877,
1188,
29898,
18420,
2264,
29899,
974,
29899,
9202,
29897,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
572,
29873,
29889,
7620,
1003,
11219,
5184,
29914,
29881,
3973,
29914,
15063,
1884,
29914,
12932,
1883,
455,
2272,
29914,
29888,
1169,
5897,
1495,
13,
572,
29873,
29889,
5358,
580,
15945,
29908,
13,
13,
29937,
7525,
14710,
7492,
848,
20961,
2543,
29882,
29871,
29941,
3207,
5694,
1958,
1158,
13,
13,
29937,
3834,
3525,
2479,
278,
2582,
29889,
13,
2
] |
get_block_data/relation.py | cyclone923/blocks-world | 1 | 3997 | class SceneRelation:
def __init__(self):
self.on_ground = set()
self.on_block = {}
self.clear = set()
def print_relation(self):
print(self.on_ground)
print(self.on_block)
print(self.clear) | [
1,
770,
2522,
1600,
9662,
362,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
265,
29918,
2057,
353,
731,
580,
13,
4706,
1583,
29889,
265,
29918,
1271,
353,
6571,
13,
4706,
1583,
29889,
8551,
353,
731,
580,
13,
13,
1678,
822,
1596,
29918,
23445,
29898,
1311,
1125,
13,
4706,
1596,
29898,
1311,
29889,
265,
29918,
2057,
29897,
13,
4706,
1596,
29898,
1311,
29889,
265,
29918,
1271,
29897,
13,
4706,
1596,
29898,
1311,
29889,
8551,
29897,
2
] |
sigopt/cli/commands/run_base.py | emattia/sigopt-python | 67 | 143137 | import functools
import click
from ..arguments import commands_argument, run_file_option
def run_command(f):
@commands_argument
@run_file_option
@functools.wraps(f)
def wrapper(*args, commands, run_file, **kwargs):
if run_file:
run_options = run_file.data
else:
run_options = {}
if not commands:
try:
commands = run_options["run"]
except KeyError as ke:
raise click.UsageError(
"Missing command: Please specify your run command via arguments or in the 'run' section of the run file."
) from ke
return f(*args, command=commands, run_options=run_options, **kwargs)
return wrapper
| [
1,
1053,
2090,
312,
8789,
13,
13,
5215,
2828,
13,
13,
3166,
6317,
25699,
1053,
8260,
29918,
23516,
29892,
1065,
29918,
1445,
29918,
3385,
13,
13,
13,
1753,
1065,
29918,
6519,
29898,
29888,
1125,
13,
13,
29871,
732,
26381,
29918,
23516,
13,
29871,
732,
3389,
29918,
1445,
29918,
3385,
13,
29871,
732,
7692,
312,
8789,
29889,
29893,
336,
567,
29898,
29888,
29897,
13,
29871,
822,
14476,
10456,
5085,
29892,
8260,
29892,
1065,
29918,
1445,
29892,
3579,
19290,
1125,
13,
1678,
565,
1065,
29918,
1445,
29901,
13,
418,
1065,
29918,
6768,
353,
1065,
29918,
1445,
29889,
1272,
13,
1678,
1683,
29901,
13,
418,
1065,
29918,
6768,
353,
6571,
13,
1678,
565,
451,
8260,
29901,
13,
418,
1018,
29901,
13,
4706,
8260,
353,
1065,
29918,
6768,
3366,
3389,
3108,
13,
418,
5174,
7670,
2392,
408,
1589,
29901,
13,
4706,
12020,
2828,
29889,
27573,
2392,
29898,
13,
3986,
376,
18552,
292,
1899,
29901,
3529,
6084,
596,
1065,
1899,
3025,
6273,
470,
297,
278,
525,
3389,
29915,
4004,
310,
278,
1065,
934,
1213,
13,
4706,
1723,
515,
1589,
13,
1678,
736,
285,
10456,
5085,
29892,
1899,
29922,
26381,
29892,
1065,
29918,
6768,
29922,
3389,
29918,
6768,
29892,
3579,
19290,
29897,
13,
13,
29871,
736,
14476,
13,
2
] |
gen_api/generate_cpp_api.py | jordenson/nakama-cpp | 0 | 82955 | #!/usr/bin/env python
#
# Copyright 2019 The Nakama Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import print_function
import os
import sys
import subprocess
import argparse
import platform
def getEnvVar(name):
if name in os.environ:
return os.environ[name]
return ''
parser = argparse.ArgumentParser(description='Nakama C++ API generator')
parser.add_argument('-n', '--nakama', help='Nakama server sources')
parser.add_argument('-g', '--gateway', help='grpc-gateway sources')
args = parser.parse_args()
def getArgOrEnvVar(env_var_name, arg_value):
if arg_value:
value = arg_value
else:
value = getEnvVar(env_var_name)
if not value:
print('Error: missing "' + env_var_name + '" env variable')
sys.exit(-1)
return value
# https://github.com/heroiclabs/nakama
NAKAMA = getArgOrEnvVar('NAKAMA', args.nakama)
# https://github.com/grpc-ecosystem/grpc-gateway
GRPC_GATEWAY = getArgOrEnvVar('GRPC_GATEWAY', args.gateway)
def path(p):
return os.path.normpath(p)
def get_host_arch():
import platform
bits, _ = platform.architecture()
if bits == '64bit':
arch = 'x64'
elif bits == '32bit':
arch = 'x86'
else:
arch = bits
return arch
NAKAMA_CPP = os.path.abspath('./..')
GRPC = path(NAKAMA_CPP + '/third_party/grpc')
GOOGLEAPIS = path(GRPC_GATEWAY + '/third_party/googleapis')
PROTOBUF_SRC = path(GRPC + '/third_party/protobuf/src')
OUT = os.path.abspath('cppout')
is_windows = platform.system() == 'Windows'
is_mac = platform.system() == 'Darwin'
if is_windows:
build_dir = NAKAMA_CPP + '/build/windows/build/v142_x86'
elif is_mac:
build_dir_debug = NAKAMA_CPP + '/build/mac/build/Debug'
build_dir_release = NAKAMA_CPP + '/build/mac/build/Release'
else:
# linux
arch = get_host_arch()
build_dir_debug = NAKAMA_CPP + '/build/linux/build/Debug_' + arch
build_dir_release = NAKAMA_CPP + '/build/linux/build/Release_' + arch
def find_grpc_cpp_plugin():
if is_windows:
grpc_cpp_plugin = path(build_dir + '/third_party/grpc/Debug/grpc_cpp_plugin.exe')
if not os.path.exists(grpc_cpp_plugin):
grpc_cpp_plugin = path(build_dir + '/third_party/grpc/Release/grpc_cpp_plugin.exe')
else:
grpc_cpp_plugin = path(build_dir_release + '/third_party/grpc/grpc_cpp_plugin')
if not os.path.exists(grpc_cpp_plugin):
grpc_cpp_plugin = path(build_dir_debug + '/third_party/grpc/grpc_cpp_plugin')
if not os.path.exists(grpc_cpp_plugin):
print('grpc_cpp_plugin not found')
print('Please build for desktop OS first')
sys.exit(-1)
return grpc_cpp_plugin
def find_protoc():
if is_windows:
protoc = path(build_dir + '/third_party/grpc/third_party/protobuf/Debug/protoc.exe')
if not os.path.exists(protoc):
protoc = path(build_dir + '/third_party/grpc/third_party/protobuf/Release/protoc.exe')
else:
protoc = path(build_dir_release + '/third_party/grpc/third_party/protobuf/protoc')
if not os.path.exists(protoc):
protoc = path(build_dir_debug + '/third_party/grpc/third_party/protobuf/protoc')
if not os.path.exists(protoc):
print('protoc not found')
print('Please build for desktop OS first')
sys.exit(-1)
return protoc
def call(commands, shell=False):
#print('call', str(commands))
res = subprocess.call(commands, shell=shell)
if res != 0:
sys.exit(-1)
def check_required_folder(folder):
if not os.path.exists(folder):
print('ERROR: not exist', folder)
sys.exit(-1)
def makedirs(path):
if not os.path.exists(path):
os.makedirs(path)
def mklink(link, target):
if not os.path.exists(link):
if is_windows:
call(['mklink', link, target], shell=True)
else:
call(['ln', '-s', target, link], shell=False)
GRPC_CPP_PLUGIN = find_grpc_cpp_plugin()
PROTOC = find_protoc()
check_required_folder(NAKAMA)
check_required_folder(GRPC)
check_required_folder(GRPC_GATEWAY)
check_required_folder(GOOGLEAPIS)
check_required_folder(GRPC_CPP_PLUGIN)
check_required_folder(PROTOC)
check_required_folder(PROTOBUF_SRC)
CUR_DIR = os.path.abspath('.')
makedirs(OUT)
makedirs(path(OUT + '/google/api'))
makedirs(path(OUT + '/google/rpc'))
makedirs(path(CUR_DIR + '/github.com/heroiclabs/nakama-common/api'))
makedirs(path(CUR_DIR + '/github.com/heroiclabs/nakama/apigrpc'))
makedirs(path(CUR_DIR + '/github.com/heroiclabs/nakama-common/rtapi'))
mklink(path(CUR_DIR + '/github.com/heroiclabs/nakama-common/api/api.proto'), path(NAKAMA + '/vendor/github.com/heroiclabs/nakama-common/api/api.proto'))
mklink(path(CUR_DIR + '/github.com/heroiclabs/nakama/apigrpc/apigrpc.proto'), path(NAKAMA + '/apigrpc/apigrpc.proto'))
mklink(path(CUR_DIR + '/github.com/heroiclabs/nakama-common/rtapi/realtime.proto'), path(NAKAMA + '/vendor/github.com/heroiclabs/nakama-common/rtapi/realtime.proto'))
print('generating apigrpc')
call([PROTOC, '-I.', '-I' + GRPC_GATEWAY, '-I' + GOOGLEAPIS, '-I' + PROTOBUF_SRC, '--grpc_out=' + OUT, '--plugin=protoc-gen-grpc=' + GRPC_CPP_PLUGIN, path('github.com/heroiclabs/nakama/apigrpc/apigrpc.proto')])
call([PROTOC, '-I.', '-I' + GRPC_GATEWAY, '-I' + GOOGLEAPIS, '-I' + PROTOBUF_SRC, '--cpp_out=' + OUT, path('github.com/heroiclabs/nakama/apigrpc/apigrpc.proto')])
call([PROTOC, '-I.', '-I' + GRPC_GATEWAY, '-I' + GOOGLEAPIS, '-I' + PROTOBUF_SRC, '--cpp_out=' + OUT, path('github.com/heroiclabs/nakama-common/api/api.proto')])
os.chdir(path(GOOGLEAPIS + '/google/rpc'))
call([PROTOC, '-I.', '-I' + GRPC_GATEWAY, '-I' + GOOGLEAPIS, '-I' + PROTOBUF_SRC, '--cpp_out=' + path(OUT + '/google/rpc'), 'status.proto'])
os.chdir(path(GOOGLEAPIS + '/google/api'))
call([PROTOC, '-I.', '-I' + GRPC_GATEWAY, '-I' + GOOGLEAPIS, '-I' + PROTOBUF_SRC, '--cpp_out=' + path(OUT + '/google/api'), 'annotations.proto'])
call([PROTOC, '-I.', '-I' + GRPC_GATEWAY, '-I' + GOOGLEAPIS, '-I' + PROTOBUF_SRC, '--cpp_out=' + path(OUT + '/google/api'), 'http.proto'])
os.chdir(CUR_DIR)
call([PROTOC, '-I.', '-I' + GRPC_GATEWAY, '-I' + GOOGLEAPIS, '-I' + PROTOBUF_SRC, '--cpp_out=' + OUT, path(GRPC_GATEWAY + '/protoc-gen-swagger/options/annotations.proto')])
call([PROTOC, '-I.', '-I' + GRPC_GATEWAY, '-I' + GOOGLEAPIS, '-I' + PROTOBUF_SRC, '--cpp_out=' + OUT, path(GRPC_GATEWAY + '/protoc-gen-swagger/options/openapiv2.proto')])
print('generating rtapi')
call([PROTOC, '-I.', '-I' + PROTOBUF_SRC, '--cpp_out=' + OUT, path('github.com/heroiclabs/nakama-common/rtapi/realtime.proto')])
print('done.')
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29929,
450,
20962,
3304,
13189,
943,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
29937,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
1014,
5014,
13,
5215,
1852,
5510,
13,
5215,
7481,
13,
13,
1753,
679,
21745,
9037,
29898,
978,
1125,
13,
1678,
565,
1024,
297,
2897,
29889,
21813,
29901,
13,
4706,
736,
2897,
29889,
21813,
29961,
978,
29962,
13,
1678,
736,
6629,
13,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
29940,
557,
3304,
315,
1817,
3450,
15299,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
29876,
742,
525,
489,
8546,
3304,
742,
1371,
2433,
29940,
557,
3304,
1923,
8974,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
29887,
742,
525,
489,
17062,
1582,
742,
1371,
2433,
629,
6739,
29899,
17062,
1582,
8974,
1495,
13,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
1753,
679,
8559,
2816,
21745,
9037,
29898,
6272,
29918,
1707,
29918,
978,
29892,
1852,
29918,
1767,
1125,
13,
1678,
565,
1852,
29918,
1767,
29901,
13,
4706,
995,
353,
1852,
29918,
1767,
13,
1678,
1683,
29901,
13,
4706,
995,
353,
679,
21745,
9037,
29898,
6272,
29918,
1707,
29918,
978,
29897,
13,
4706,
565,
451,
995,
29901,
13,
9651,
1596,
877,
2392,
29901,
4567,
13577,
718,
8829,
29918,
1707,
29918,
978,
718,
18793,
8829,
2286,
1495,
13,
9651,
10876,
29889,
13322,
6278,
29896,
29897,
13,
13,
1678,
736,
995,
13,
13,
29937,
2045,
597,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
13,
3521,
29968,
29909,
1529,
353,
679,
8559,
2816,
21745,
9037,
877,
3521,
29968,
29909,
1529,
742,
6389,
29889,
8546,
3304,
29897,
13,
13,
29937,
2045,
597,
3292,
29889,
510,
29914,
629,
6739,
29899,
687,
359,
973,
29914,
629,
6739,
29899,
17062,
1582,
13,
14345,
9026,
29918,
29954,
3040,
12982,
29979,
353,
679,
8559,
2816,
21745,
9037,
877,
14345,
9026,
29918,
29954,
3040,
12982,
29979,
742,
6389,
29889,
17062,
1582,
29897,
13,
13,
1753,
2224,
29898,
29886,
1125,
13,
1678,
736,
2897,
29889,
2084,
29889,
12324,
2084,
29898,
29886,
29897,
13,
13,
1753,
679,
29918,
3069,
29918,
1279,
7295,
13,
1678,
1053,
7481,
13,
1678,
9978,
29892,
903,
353,
7481,
29889,
25428,
580,
13,
1678,
565,
9978,
1275,
525,
29953,
29946,
2966,
2396,
13,
4706,
3190,
353,
525,
29916,
29953,
29946,
29915,
13,
1678,
25342,
9978,
1275,
525,
29941,
29906,
2966,
2396,
13,
4706,
3190,
353,
525,
29916,
29947,
29953,
29915,
13,
1678,
1683,
29901,
13,
4706,
3190,
353,
9978,
13,
1678,
736,
3190,
13,
13,
3521,
29968,
29909,
1529,
29918,
6271,
29925,
418,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
877,
6904,
636,
1495,
13,
14345,
9026,
9651,
353,
2224,
29898,
3521,
29968,
29909,
1529,
29918,
6271,
29925,
718,
8207,
22585,
29918,
22633,
29914,
629,
6739,
1495,
13,
17080,
29949,
29954,
1307,
8787,
29903,
418,
353,
2224,
29898,
14345,
9026,
29918,
29954,
3040,
12982,
29979,
718,
8207,
22585,
29918,
22633,
29914,
15947,
1495,
13,
8618,
4986,
7838,
29943,
29918,
29903,
10363,
1678,
353,
2224,
29898,
14345,
9026,
718,
8207,
22585,
29918,
22633,
29914,
17529,
9721,
29914,
4351,
1495,
13,
12015,
632,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
877,
8223,
449,
1495,
13,
13,
275,
29918,
10499,
353,
7481,
29889,
5205,
580,
1275,
525,
7685,
29915,
13,
275,
29918,
8628,
268,
353,
7481,
29889,
5205,
580,
1275,
525,
29928,
279,
5080,
29915,
13,
13,
361,
338,
29918,
10499,
29901,
13,
1678,
2048,
29918,
3972,
353,
8598,
29968,
29909,
1529,
29918,
6271,
29925,
718,
8207,
4282,
29914,
10499,
29914,
4282,
29914,
29894,
29896,
29946,
29906,
29918,
29916,
29947,
29953,
29915,
13,
23681,
338,
29918,
8628,
29901,
13,
1678,
2048,
29918,
3972,
29918,
8382,
353,
8598,
29968,
29909,
1529,
29918,
6271,
29925,
718,
8207,
4282,
29914,
8628,
29914,
4282,
29914,
11862,
29915,
13,
1678,
2048,
29918,
3972,
29918,
14096,
353,
8598,
29968,
29909,
1529,
29918,
6271,
29925,
718,
8207,
4282,
29914,
8628,
29914,
4282,
29914,
19729,
29915,
13,
2870,
29901,
13,
1678,
396,
10542,
13,
1678,
3190,
353,
679,
29918,
3069,
29918,
1279,
580,
13,
1678,
2048,
29918,
3972,
29918,
8382,
353,
8598,
29968,
29909,
1529,
29918,
6271,
29925,
718,
8207,
4282,
29914,
9389,
29914,
4282,
29914,
11862,
29918,
29915,
718,
3190,
13,
1678,
2048,
29918,
3972,
29918,
14096,
353,
8598,
29968,
29909,
1529,
29918,
6271,
29925,
718,
8207,
4282,
29914,
9389,
29914,
4282,
29914,
19729,
29918,
29915,
718,
3190,
13,
13,
1753,
1284,
29918,
629,
6739,
29918,
8223,
29918,
8582,
7295,
13,
1678,
565,
338,
29918,
10499,
29901,
13,
4706,
867,
6739,
29918,
8223,
29918,
8582,
353,
2224,
29898,
4282,
29918,
3972,
718,
8207,
22585,
29918,
22633,
29914,
629,
6739,
29914,
11862,
29914,
629,
6739,
29918,
8223,
29918,
8582,
29889,
8097,
1495,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
629,
6739,
29918,
8223,
29918,
8582,
1125,
13,
9651,
867,
6739,
29918,
8223,
29918,
8582,
353,
2224,
29898,
4282,
29918,
3972,
718,
8207,
22585,
29918,
22633,
29914,
629,
6739,
29914,
19729,
29914,
629,
6739,
29918,
8223,
29918,
8582,
29889,
8097,
1495,
13,
1678,
1683,
29901,
13,
4706,
867,
6739,
29918,
8223,
29918,
8582,
353,
2224,
29898,
4282,
29918,
3972,
29918,
14096,
718,
8207,
22585,
29918,
22633,
29914,
629,
6739,
29914,
629,
6739,
29918,
8223,
29918,
8582,
1495,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
629,
6739,
29918,
8223,
29918,
8582,
1125,
13,
9651,
867,
6739,
29918,
8223,
29918,
8582,
353,
2224,
29898,
4282,
29918,
3972,
29918,
8382,
718,
8207,
22585,
29918,
22633,
29914,
629,
6739,
29914,
629,
6739,
29918,
8223,
29918,
8582,
1495,
13,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
629,
6739,
29918,
8223,
29918,
8582,
1125,
13,
4706,
1596,
877,
629,
6739,
29918,
8223,
29918,
8582,
451,
1476,
1495,
13,
4706,
1596,
877,
12148,
2048,
363,
14616,
6570,
937,
1495,
13,
4706,
10876,
29889,
13322,
6278,
29896,
29897,
13,
268,
13,
1678,
736,
867,
6739,
29918,
8223,
29918,
8582,
13,
13,
1753,
1284,
29918,
17529,
29883,
7295,
13,
1678,
565,
338,
29918,
10499,
29901,
13,
4706,
17814,
29883,
353,
2224,
29898,
4282,
29918,
3972,
718,
8207,
22585,
29918,
22633,
29914,
629,
6739,
29914,
22585,
29918,
22633,
29914,
17529,
9721,
29914,
11862,
29914,
17529,
29883,
29889,
8097,
1495,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
17529,
29883,
1125,
13,
9651,
17814,
29883,
353,
2224,
29898,
4282,
29918,
3972,
718,
8207,
22585,
29918,
22633,
29914,
629,
6739,
29914,
22585,
29918,
22633,
29914,
17529,
9721,
29914,
19729,
29914,
17529,
29883,
29889,
8097,
1495,
13,
1678,
1683,
29901,
13,
4706,
17814,
29883,
353,
2224,
29898,
4282,
29918,
3972,
29918,
14096,
718,
8207,
22585,
29918,
22633,
29914,
629,
6739,
29914,
22585,
29918,
22633,
29914,
17529,
9721,
29914,
17529,
29883,
1495,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
17529,
29883,
1125,
13,
9651,
17814,
29883,
353,
2224,
29898,
4282,
29918,
3972,
29918,
8382,
718,
8207,
22585,
29918,
22633,
29914,
629,
6739,
29914,
22585,
29918,
22633,
29914,
17529,
9721,
29914,
17529,
29883,
1495,
13,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
17529,
29883,
1125,
13,
4706,
1596,
877,
17529,
29883,
451,
1476,
1495,
13,
4706,
1596,
877,
12148,
2048,
363,
14616,
6570,
937,
1495,
13,
4706,
10876,
29889,
13322,
6278,
29896,
29897,
13,
268,
13,
1678,
736,
17814,
29883,
13,
13,
1753,
1246,
29898,
26381,
29892,
6473,
29922,
8824,
1125,
13,
1678,
396,
2158,
877,
4804,
742,
851,
29898,
26381,
876,
13,
1678,
620,
353,
1014,
5014,
29889,
4804,
29898,
26381,
29892,
6473,
29922,
15903,
29897,
13,
1678,
565,
620,
2804,
29871,
29900,
29901,
13,
4706,
10876,
29889,
13322,
6278,
29896,
29897,
13,
13,
1753,
1423,
29918,
12403,
29918,
12083,
29898,
12083,
1125,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
12083,
1125,
13,
4706,
1596,
877,
11432,
29901,
451,
1863,
742,
4138,
29897,
13,
4706,
10876,
29889,
13322,
6278,
29896,
29897,
13,
13,
1753,
2136,
287,
12935,
29898,
2084,
1125,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
2084,
1125,
13,
4706,
2897,
29889,
29885,
12535,
12935,
29898,
2084,
29897,
13,
13,
1753,
14690,
2324,
29898,
2324,
29892,
3646,
1125,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
2324,
1125,
13,
4706,
565,
338,
29918,
10499,
29901,
13,
9651,
1246,
18959,
11256,
2324,
742,
1544,
29892,
3646,
1402,
6473,
29922,
5574,
29897,
13,
4706,
1683,
29901,
13,
9651,
1246,
18959,
3083,
742,
17411,
29879,
742,
3646,
29892,
1544,
1402,
6473,
29922,
8824,
29897,
13,
13,
14345,
9026,
29918,
6271,
29925,
29918,
7390,
23338,
1177,
353,
1284,
29918,
629,
6739,
29918,
8223,
29918,
8582,
580,
13,
8618,
4986,
29907,
3986,
353,
1284,
29918,
17529,
29883,
580,
13,
13,
3198,
29918,
12403,
29918,
12083,
29898,
3521,
29968,
29909,
1529,
29897,
13,
3198,
29918,
12403,
29918,
12083,
29898,
14345,
9026,
29897,
13,
3198,
29918,
12403,
29918,
12083,
29898,
14345,
9026,
29918,
29954,
3040,
12982,
29979,
29897,
13,
3198,
29918,
12403,
29918,
12083,
29898,
17080,
29949,
29954,
1307,
8787,
29903,
29897,
13,
3198,
29918,
12403,
29918,
12083,
29898,
14345,
9026,
29918,
6271,
29925,
29918,
7390,
23338,
1177,
29897,
13,
3198,
29918,
12403,
29918,
12083,
29898,
8618,
4986,
29907,
29897,
13,
3198,
29918,
12403,
29918,
12083,
29898,
8618,
4986,
7838,
29943,
29918,
29903,
10363,
29897,
13,
13,
22484,
29918,
9464,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
12839,
1495,
13,
13,
29885,
12535,
12935,
29898,
12015,
29897,
13,
29885,
12535,
12935,
29898,
2084,
29898,
12015,
718,
8207,
3608,
29914,
2754,
8785,
13,
29885,
12535,
12935,
29898,
2084,
29898,
12015,
718,
8207,
3608,
29914,
29878,
6739,
8785,
13,
13,
29885,
12535,
12935,
29898,
2084,
29898,
22484,
29918,
9464,
718,
8207,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29899,
9435,
29914,
2754,
8785,
13,
29885,
12535,
12935,
29898,
2084,
29898,
22484,
29918,
9464,
718,
8207,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29914,
481,
4481,
6739,
8785,
13,
29885,
12535,
12935,
29898,
2084,
29898,
22484,
29918,
9464,
718,
8207,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29899,
9435,
29914,
2273,
2754,
8785,
13,
11256,
2324,
29898,
2084,
29898,
22484,
29918,
9464,
718,
8207,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29899,
9435,
29914,
2754,
29914,
2754,
29889,
17529,
5477,
2224,
29898,
3521,
29968,
29909,
1529,
718,
8207,
19167,
29914,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29899,
9435,
29914,
2754,
29914,
2754,
29889,
17529,
8785,
13,
11256,
2324,
29898,
2084,
29898,
22484,
29918,
9464,
718,
8207,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29914,
481,
4481,
6739,
29914,
481,
4481,
6739,
29889,
17529,
5477,
2224,
29898,
3521,
29968,
29909,
1529,
718,
8207,
481,
4481,
6739,
29914,
481,
4481,
6739,
29889,
17529,
8785,
13,
11256,
2324,
29898,
2084,
29898,
22484,
29918,
9464,
718,
8207,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29899,
9435,
29914,
2273,
2754,
29914,
276,
1997,
603,
29889,
17529,
5477,
2224,
29898,
3521,
29968,
29909,
1529,
718,
8207,
19167,
29914,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29899,
9435,
29914,
2273,
2754,
29914,
276,
1997,
603,
29889,
17529,
8785,
13,
13,
2158,
877,
4738,
1218,
3095,
4481,
6739,
1495,
13,
13,
4804,
4197,
8618,
4986,
29907,
29892,
17411,
29902,
29889,
742,
17411,
29902,
29915,
718,
18016,
9026,
29918,
29954,
3040,
12982,
29979,
29892,
17411,
29902,
29915,
718,
21947,
29949,
29954,
1307,
8787,
29903,
29892,
17411,
29902,
29915,
718,
13756,
4986,
7838,
29943,
29918,
29903,
10363,
29892,
525,
489,
629,
6739,
29918,
449,
2433,
718,
19474,
29892,
525,
489,
8582,
29922,
17529,
29883,
29899,
1885,
29899,
629,
6739,
2433,
718,
18016,
9026,
29918,
6271,
29925,
29918,
7390,
23338,
1177,
29892,
2224,
877,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29914,
481,
4481,
6739,
29914,
481,
4481,
6739,
29889,
17529,
1495,
2314,
13,
4804,
4197,
8618,
4986,
29907,
29892,
17411,
29902,
29889,
742,
17411,
29902,
29915,
718,
18016,
9026,
29918,
29954,
3040,
12982,
29979,
29892,
17411,
29902,
29915,
718,
21947,
29949,
29954,
1307,
8787,
29903,
29892,
17411,
29902,
29915,
718,
13756,
4986,
7838,
29943,
29918,
29903,
10363,
29892,
525,
489,
8223,
29918,
449,
2433,
718,
19474,
29892,
2224,
877,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29914,
481,
4481,
6739,
29914,
481,
4481,
6739,
29889,
17529,
1495,
2314,
13,
4804,
4197,
8618,
4986,
29907,
29892,
17411,
29902,
29889,
742,
17411,
29902,
29915,
718,
18016,
9026,
29918,
29954,
3040,
12982,
29979,
29892,
17411,
29902,
29915,
718,
21947,
29949,
29954,
1307,
8787,
29903,
29892,
17411,
29902,
29915,
718,
13756,
4986,
7838,
29943,
29918,
29903,
10363,
29892,
525,
489,
8223,
29918,
449,
2433,
718,
19474,
29892,
2224,
877,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29899,
9435,
29914,
2754,
29914,
2754,
29889,
17529,
1495,
2314,
13,
13,
359,
29889,
305,
3972,
29898,
2084,
29898,
17080,
29949,
29954,
1307,
8787,
29903,
718,
8207,
3608,
29914,
29878,
6739,
8785,
13,
13,
4804,
4197,
8618,
4986,
29907,
29892,
17411,
29902,
29889,
742,
17411,
29902,
29915,
718,
18016,
9026,
29918,
29954,
3040,
12982,
29979,
29892,
17411,
29902,
29915,
718,
21947,
29949,
29954,
1307,
8787,
29903,
29892,
17411,
29902,
29915,
718,
13756,
4986,
7838,
29943,
29918,
29903,
10363,
29892,
525,
489,
8223,
29918,
449,
2433,
718,
2224,
29898,
12015,
718,
8207,
3608,
29914,
29878,
6739,
5477,
525,
4882,
29889,
17529,
11287,
13,
13,
359,
29889,
305,
3972,
29898,
2084,
29898,
17080,
29949,
29954,
1307,
8787,
29903,
718,
8207,
3608,
29914,
2754,
8785,
13,
13,
4804,
4197,
8618,
4986,
29907,
29892,
17411,
29902,
29889,
742,
17411,
29902,
29915,
718,
18016,
9026,
29918,
29954,
3040,
12982,
29979,
29892,
17411,
29902,
29915,
718,
21947,
29949,
29954,
1307,
8787,
29903,
29892,
17411,
29902,
29915,
718,
13756,
4986,
7838,
29943,
29918,
29903,
10363,
29892,
525,
489,
8223,
29918,
449,
2433,
718,
2224,
29898,
12015,
718,
8207,
3608,
29914,
2754,
5477,
525,
6735,
800,
29889,
17529,
11287,
13,
4804,
4197,
8618,
4986,
29907,
29892,
17411,
29902,
29889,
742,
17411,
29902,
29915,
718,
18016,
9026,
29918,
29954,
3040,
12982,
29979,
29892,
17411,
29902,
29915,
718,
21947,
29949,
29954,
1307,
8787,
29903,
29892,
17411,
29902,
29915,
718,
13756,
4986,
7838,
29943,
29918,
29903,
10363,
29892,
525,
489,
8223,
29918,
449,
2433,
718,
2224,
29898,
12015,
718,
8207,
3608,
29914,
2754,
5477,
525,
1124,
29889,
17529,
11287,
13,
13,
359,
29889,
305,
3972,
29898,
22484,
29918,
9464,
29897,
13,
13,
4804,
4197,
8618,
4986,
29907,
29892,
17411,
29902,
29889,
742,
17411,
29902,
29915,
718,
18016,
9026,
29918,
29954,
3040,
12982,
29979,
29892,
17411,
29902,
29915,
718,
21947,
29949,
29954,
1307,
8787,
29903,
29892,
17411,
29902,
29915,
718,
13756,
4986,
7838,
29943,
29918,
29903,
10363,
29892,
525,
489,
8223,
29918,
449,
2433,
718,
19474,
29892,
2224,
29898,
14345,
9026,
29918,
29954,
3040,
12982,
29979,
718,
8207,
17529,
29883,
29899,
1885,
29899,
2774,
9921,
29914,
6768,
29914,
6735,
800,
29889,
17529,
1495,
2314,
13,
4804,
4197,
8618,
4986,
29907,
29892,
17411,
29902,
29889,
742,
17411,
29902,
29915,
718,
18016,
9026,
29918,
29954,
3040,
12982,
29979,
29892,
17411,
29902,
29915,
718,
21947,
29949,
29954,
1307,
8787,
29903,
29892,
17411,
29902,
29915,
718,
13756,
4986,
7838,
29943,
29918,
29903,
10363,
29892,
525,
489,
8223,
29918,
449,
2433,
718,
19474,
29892,
2224,
29898,
14345,
9026,
29918,
29954,
3040,
12982,
29979,
718,
8207,
17529,
29883,
29899,
1885,
29899,
2774,
9921,
29914,
6768,
29914,
3150,
481,
440,
29906,
29889,
17529,
1495,
2314,
13,
13,
2158,
877,
4738,
1218,
364,
29873,
2754,
1495,
13,
13,
4804,
4197,
8618,
4986,
29907,
29892,
17411,
29902,
29889,
742,
17411,
29902,
29915,
718,
13756,
4986,
7838,
29943,
29918,
29903,
10363,
29892,
525,
489,
8223,
29918,
449,
2433,
718,
19474,
29892,
2224,
877,
3292,
29889,
510,
29914,
29882,
1489,
293,
29880,
6897,
29914,
8546,
3304,
29899,
9435,
29914,
2273,
2754,
29914,
276,
1997,
603,
29889,
17529,
1495,
2314,
13,
13,
2158,
877,
15091,
29889,
1495,
13,
2
] |
md.py | Tensai7/manga-dl | 0 | 51190 | <filename>md.py
import argparse
import os
import urllib.request
from urllib.error import HTTPError
from urllib.request import urlopen
from sys import exit
import extra
from parsers import Mangapanda, Mangasee
opener = urllib.request.build_opener()
opener.addheaders = [('User-Agent',
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1941.0 Safari/537.36')]
urllib.request.install_opener(opener)
"""
A Multi Site Manga Downloader.
"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2017"
__credits__ = "<NAME>"
__license__ = "MIT License, Tensai No License"
__version__ = "4.0"
__maintainer__ = "Sudarshan(Ashura)"
__email__ = "<EMAIL>"
__status__ = "Under Production"
print("\n\tMangaDownloader\n Author: {}\n Copyright: {}\n Credits: {}\n License: {}\n Version: {}\n".format(__author__, __copyright__, __credits__, __license__, __version__))
#######################################################################################################################################################################
parser = argparse.ArgumentParser(description="Command Line Mode.")
parser.add_argument("-u",
"--url",
help="Url of the manga to be downloaded.")
parser.add_argument("-b",
"--begin",
help="The chapter number to begin from or list of space seperated chapter numbers.")
parser.add_argument("-e",
"--end",
help="The chapter to end at."
)
parser.add_argument("-z",
"--zip",
action="store_true",
help="Enable if zipped chapters are needed.")
parser.add_argument("-i",
"--interactive",
action="store_true",
help="Enable if you want interactive Mode")
parser.add_argument("-a",
"--all",
action="store_true",
help="Download all the chapters")
parser.add_argument("-A",
"--Archive",
action="store_true",
help="Downloads All available chapters of the series, the cover Image and zips them")
parser.add_argument("-s",
"--site",
help="Enter 1 for mangapanda.com, 2 for mangaseeonline.us .")
parser.add_argument("-n",
"--name",
help="Enter the name of the manga series, use if you know the correct name. Else use -g option.")
parser.add_argument("-g",
"--guess",
help="Name of manga to be guessed.")
# parser.add_argument("-t",
# "--test",
# action='store_true',
# help="Download a series as test under Archive mode.")
args = parser.parse_args()
if args.interactive is True:
""" For Interactive Mode. """
args.url = None
args.begin = None
args.end = "int"
args.zip = None
if args.url is True:
args.site = 0
if args.all is True:
""" In All Chapters Downloading mode."""
args.begin = 1
args.end = None # None used to distinguish b/w interactive and all mode
if args.Archive is True:
""" For Archive Mode. """
args.all = True
args.zip = True
args.begin = 1
args.end = "Archive"
if args.guess is not None:
if args.site is None:
args.site = ("Please input site!!!!\nUse -s option.")
exit()
url = extra.Guess(int(args.site), args.guess)
res = ""
try:
response = urllib.request.urlopen(url).read().decode('utf-8')
except HTTPError: # if our guess doesnt work
match = extra.Search(int(args.site), args.guess)
print("Press 'y' for yes, 'n' for no.\n")
for m in match:
print("Did you mean :\n{}".format(m))
res = input()
if res is 'y':
args.url = extra.Guess(int(args.site), m.lower())
matched = m
if args.end is None:
args.end = "GuessMode" # for clarification.
break
if res is not 'y':
print("Could not find manga series.\n Please use -u / --url option.\n Off Out!")
exit()
print("The Selected series is >>> {} <<<".format(matched))
if type(args.site) is str and type(args.name) is str: # Guess the url of the manga series
try:
url = extra.Guess(int(args.site), args.name) # get the guessed url
x = urlopen(url) # check if the url exists
args.url = "Guessed" # so that interactive mode doesn't gets implemented
except HTTPError: # if the url is wrong, go to interactive mode
print("Guess didn't work, lets continue in interactive mode.")
args.url = None
url = ""
total = 0
stop = ""
if args.url is None:
url = str(input("Enter the url of the manga.\n1)http://www.mangapanda.com/naruto : For "
"mangapanda.com\n2)http://mangaseeonline.us/manga/naruto : For mangaseeonline.us \n"))
elif args.url is "Guessed":
pass
else:
url = args.url
if url[-1] is "/": # Remove trailing "/" if found
url = url[0:-1]
if args.begin is None:
start = int(input("Enter the chapter to start from.\n"))
else:
start = int(args.begin)
if args.end is "int" or args.end is "GuessMode": # "int" : Interactive, None : all chapters
stop = input("Enter the chapter to stop at.\n")
try:
stop = int(stop)
if stop == 0:
stop = None
except (ValueError, TypeError) as e:
stop = None
elif args.end is None:
stop = None
zip_flag = "" # Initialize zip_flag
if args.zip is None: # interactive mode is enabled
response = input(("Do you want zip archives of each chapter? Input 'y' for Yes ; 'n' for No.\n"))
if response is 'y':
zip_flag = True
elif response is 'n':
zip_flag = False
else:
zip_flag = False
elif args.zip is True:
zip_flag = True
site = extra.site(url, args.site)
#####################################################################################################################################################
class InvalidSite(BaseException): # Invalid Site Exception
pass
class Error(BaseException): # Other Errors Exception
pass
######################################################################################################################################################
## Lets Start downloading
if site is "Mangapanda" or args.site is 1:
manga = Mangapanda.Mangapanda(url, start, stop)
MangaName = manga.GetMangaName()
MangaName = extra.Namer(MangaName)
Site = 1
elif site is "Mangasee" or args.site is 2:
manga = Mangasee.Mangasee(url, start, stop)
MangaName = manga.GetMangaName()
MangaName = extra.Namer(MangaName)
print(MangaName)
Site = 2
else:
raise InvalidSite("Error Site Not Supported.\nSee help.txt for more.!!!")
# The following logic was implemented due to non consistent naming of chapters by mangaseeonline.us
if args.end is "Archive": # if -A is true, set stop = Total Chapters
x = manga.TotalChapters()
stop = len(x)
else:
x = manga.TotalChapters() # x = total chapters
if Site is 1 and args.end is not "GuessMode": # To avoid confusion
stop = args.end
elif Site is 2 and args.end is not "GuessMode":
if args.end is None:
args.end = start
int(args.end)
stop = len(x[:args.end])
else:
stop = int(args.end) # if -e is given
stop = len(x[: int(args.end)]) #stop = 0 to args.end
print("Total Chapters Available : [].".format(stop))
#################################################################################################################################################################
""" Main Logic For Downloading. """
if stop is None or start == stop:
""" single chapter downloading mode """
cwd = os.getcwd()
NewPath = os.path.join(cwd, str(MangaName))
extra.MakeDir(str(MangaName), NewPath)
if args.Archive is True: # Archive mode.
manga.GetCoverImage() # gets cover image under Archive Mode
total = manga.TotalPgs(start)
ChapterPath = os.path.join(NewPath, str(start)) # Creates a new path for chapter's folder
extra.MakeDir(str(start), ChapterPath, NewPath)
print("Chapter-{} is Starting!".format(start))
for number in range(1, total + 1):
currentUrl = manga.CurrentUrl(start, number)
imgSrc = manga.GetSrc(currentUrl)
manga.imgGetter(imgSrc, number)
print("Chapter-{} is Downloaded".format(start))
if zip_flag is True: # Zipping of chapters.
os.chdir('..')
extra.zip(str(start), ChapterPath)
print("Chapter-{} is Zipped!".format(start))
extra.DeleteDir(ChapterPath)
else:
""" Multi chapter Mode """
# Making a New folder for MangaName
cwd = os.getcwd()
NewPath = os.path.join(cwd, str(MangaName))
print(NewPath)
extra.MakeDir(str(MangaName), NewPath)
if args.Archive is True: # Archive mode
manga.GetCoverImage() # gets cover image under Archive Mode
print("stop is {}".format(stop))
for i in range(start, int(stop) + 1): # i = Chapter Number(generally)
if Site is 1:
total = manga.TotalPgs(i) # mangapanda is consistent in naming, so i is not altered
elif Site is 2:
total = manga.TotalPgs(int(x[i - 1])) # mangaseeonline is non consistent, so i is changed
x[i - 1] = i
ChapterPath = os.path.join(NewPath, str(i)) # Creates a new path for chapter's folder
extra.MakeDir(str(i), ChapterPath, NewPath)
print("Chapter-{} is Starting!".format(i))
for number in range(1, total + 1): # number = page number
currentUrl = manga.CurrentUrl(i, number)
imgSrc = manga.GetSrc(currentUrl)
manga.imgGetter(imgSrc, number)
print("Chapter-{} is Downloaded".format(i))
if zip_flag is True: # zipping block
os.chdir('..')
extra.zip(str(i), ChapterPath)
print("Chapter-{} is Zipped!".format(i))
extra.DeleteDir(ChapterPath)
else:
os.chdir('..')
print("Download Complete!!!\n")
| [
1,
529,
9507,
29958,
3487,
29889,
2272,
13,
5215,
1852,
5510,
13,
5215,
2897,
13,
5215,
3142,
1982,
29889,
3827,
13,
3166,
3142,
1982,
29889,
2704,
1053,
7331,
2392,
13,
3166,
3142,
1982,
29889,
3827,
1053,
5065,
417,
2238,
13,
3166,
10876,
1053,
6876,
13,
5215,
4805,
13,
3166,
610,
4253,
1053,
29237,
481,
5863,
29892,
29237,
559,
29872,
13,
13,
459,
759,
353,
3142,
1982,
29889,
3827,
29889,
4282,
29918,
459,
759,
580,
13,
459,
759,
29889,
1202,
13662,
353,
518,
877,
2659,
29899,
19661,
742,
13,
462,
418,
525,
29924,
2112,
2911,
29914,
29945,
29889,
29900,
313,
7685,
405,
29911,
29871,
29953,
29889,
29896,
29936,
399,
9806,
29953,
29946,
29897,
12113,
3609,
13117,
29914,
29945,
29941,
29955,
29889,
29941,
29953,
313,
29968,
7020,
29892,
763,
1879,
27604,
29897,
10228,
29914,
29941,
29953,
29889,
29900,
29889,
29896,
29929,
29946,
29896,
29889,
29900,
24544,
29914,
29945,
29941,
29955,
29889,
29941,
29953,
1495,
29962,
13,
2271,
1982,
29889,
3827,
29889,
6252,
29918,
459,
759,
29898,
459,
759,
29897,
13,
13,
15945,
29908,
13,
29909,
14974,
10781,
341,
12686,
9943,
12657,
29889,
13,
15945,
29908,
13,
1649,
8921,
1649,
353,
9872,
5813,
11903,
13,
1649,
8552,
1266,
1649,
353,
376,
11882,
1266,
29871,
29906,
29900,
29896,
29955,
29908,
13,
1649,
11944,
1169,
1649,
353,
9872,
5813,
11903,
13,
1649,
506,
1947,
1649,
353,
376,
26349,
19245,
29892,
323,
575,
1794,
1939,
19245,
29908,
13,
1649,
3259,
1649,
353,
376,
29946,
29889,
29900,
29908,
13,
1649,
29885,
2365,
4008,
1649,
353,
376,
29903,
566,
279,
845,
273,
29898,
29909,
845,
2002,
5513,
13,
1649,
5269,
1649,
353,
9872,
26862,
6227,
11903,
13,
1649,
4882,
1649,
353,
376,
29177,
19561,
29908,
13,
13,
2158,
14182,
29876,
29905,
29873,
29924,
12686,
6767,
12657,
29905,
29876,
13361,
29901,
426,
1012,
29876,
14187,
1266,
29901,
426,
1012,
29876,
24596,
1169,
29901,
426,
1012,
29876,
19245,
29901,
426,
1012,
29876,
10079,
29901,
426,
1012,
29876,
1642,
4830,
22168,
8921,
1649,
29892,
4770,
8552,
1266,
1649,
29892,
4770,
11944,
1169,
1649,
29892,
4770,
506,
1947,
1649,
29892,
4770,
3259,
1649,
876,
13,
13,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
4136,
2277,
29937,
13,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
543,
6255,
7407,
21864,
23157,
13,
13,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29884,
613,
13,
462,
1678,
376,
489,
2271,
613,
13,
462,
1678,
1371,
543,
5983,
310,
278,
286,
12686,
304,
367,
16532,
23157,
13,
13,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29890,
613,
13,
462,
1678,
376,
489,
463,
613,
13,
462,
1678,
1371,
543,
1576,
16385,
1353,
304,
3380,
515,
470,
1051,
310,
2913,
409,
546,
630,
16385,
3694,
23157,
13,
13,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29872,
613,
13,
462,
1678,
376,
489,
355,
613,
13,
462,
1678,
1371,
543,
1576,
16385,
304,
1095,
472,
1213,
13,
462,
1678,
1723,
13,
13,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29920,
613,
13,
462,
1678,
376,
489,
7554,
613,
13,
462,
1678,
3158,
543,
8899,
29918,
3009,
613,
13,
462,
1678,
1371,
543,
20701,
565,
503,
16242,
10708,
2153,
526,
4312,
23157,
13,
13,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29875,
613,
13,
462,
1678,
376,
489,
1639,
4925,
613,
13,
462,
1678,
3158,
543,
8899,
29918,
3009,
613,
13,
462,
1678,
1371,
543,
20701,
565,
366,
864,
28923,
21864,
1159,
13,
13,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29874,
613,
13,
462,
1678,
376,
489,
497,
613,
13,
462,
1678,
3158,
543,
8899,
29918,
3009,
613,
13,
462,
1678,
1371,
543,
22954,
599,
278,
10708,
2153,
1159,
13,
13,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29909,
613,
13,
462,
1678,
376,
489,
13197,
573,
613,
13,
462,
1678,
3158,
543,
8899,
29918,
3009,
613,
13,
462,
1678,
1371,
543,
6767,
18132,
2178,
3625,
10708,
2153,
310,
278,
3652,
29892,
278,
4612,
7084,
322,
503,
4512,
963,
1159,
13,
13,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29879,
613,
13,
462,
1678,
376,
489,
2746,
613,
13,
462,
1678,
1371,
543,
10399,
29871,
29896,
363,
25016,
481,
5863,
29889,
510,
29892,
29871,
29906,
363,
25016,
559,
29872,
14627,
29889,
375,
869,
1159,
13,
13,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29876,
613,
13,
462,
1678,
376,
489,
978,
613,
13,
462,
1678,
1371,
543,
10399,
278,
1024,
310,
278,
286,
12686,
3652,
29892,
671,
565,
366,
1073,
278,
1959,
1024,
29889,
15785,
671,
448,
29887,
2984,
23157,
13,
13,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29887,
613,
13,
462,
1678,
376,
489,
2543,
404,
613,
13,
462,
1678,
1371,
543,
1170,
310,
286,
12686,
304,
367,
4140,
287,
23157,
13,
13,
29937,
13812,
29889,
1202,
29918,
23516,
703,
29899,
29873,
613,
13,
29937,
462,
268,
376,
489,
1688,
613,
13,
29937,
462,
268,
3158,
2433,
8899,
29918,
3009,
742,
13,
29937,
462,
268,
1371,
543,
22954,
263,
3652,
408,
1243,
1090,
9000,
4464,
23157,
13,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
361,
6389,
29889,
1639,
4925,
338,
5852,
29901,
13,
1678,
9995,
1152,
4124,
4925,
21864,
29889,
9995,
13,
1678,
6389,
29889,
2271,
353,
6213,
13,
1678,
6389,
29889,
463,
353,
6213,
13,
1678,
6389,
29889,
355,
353,
376,
524,
29908,
13,
1678,
6389,
29889,
7554,
353,
6213,
13,
13,
361,
6389,
29889,
2271,
338,
5852,
29901,
13,
1678,
6389,
29889,
2746,
353,
29871,
29900,
13,
13,
13,
361,
6389,
29889,
497,
338,
5852,
29901,
13,
1678,
9995,
512,
2178,
13741,
2153,
9943,
13234,
4464,
1213,
15945,
13,
1678,
6389,
29889,
463,
353,
29871,
29896,
13,
1678,
6389,
29889,
355,
353,
6213,
29871,
396,
6213,
1304,
304,
20820,
289,
29914,
29893,
28923,
322,
599,
4464,
13,
13,
361,
6389,
29889,
13197,
573,
338,
5852,
29901,
13,
1678,
9995,
1152,
9000,
21864,
29889,
9995,
13,
1678,
6389,
29889,
497,
353,
5852,
13,
1678,
6389,
29889,
7554,
353,
5852,
13,
1678,
6389,
29889,
463,
353,
29871,
29896,
13,
1678,
6389,
29889,
355,
353,
376,
13197,
573,
29908,
13,
13,
361,
6389,
29889,
2543,
404,
338,
451,
6213,
29901,
13,
1678,
565,
6389,
29889,
2746,
338,
6213,
29901,
13,
4706,
6389,
29889,
2746,
353,
4852,
12148,
1881,
3268,
6824,
6824,
29905,
29876,
11403,
448,
29879,
2984,
23157,
13,
4706,
6876,
580,
13,
1678,
3142,
353,
4805,
29889,
9485,
404,
29898,
524,
29898,
5085,
29889,
2746,
511,
6389,
29889,
2543,
404,
29897,
13,
1678,
620,
353,
5124,
13,
1678,
1018,
29901,
13,
4706,
2933,
353,
3142,
1982,
29889,
3827,
29889,
332,
417,
2238,
29898,
2271,
467,
949,
2141,
13808,
877,
9420,
29899,
29947,
1495,
13,
1678,
5174,
7331,
2392,
29901,
462,
462,
462,
259,
396,
565,
1749,
4140,
19403,
664,
13,
4706,
1993,
353,
4805,
29889,
7974,
29898,
524,
29898,
5085,
29889,
2746,
511,
6389,
29889,
2543,
404,
29897,
13,
4706,
1596,
703,
10923,
525,
29891,
29915,
363,
4874,
29892,
525,
29876,
29915,
363,
694,
7790,
29876,
1159,
13,
4706,
363,
286,
297,
1993,
29901,
13,
9651,
1596,
703,
9260,
366,
2099,
584,
29905,
29876,
8875,
1642,
4830,
29898,
29885,
876,
13,
9651,
620,
353,
1881,
580,
13,
9651,
565,
620,
338,
525,
29891,
2396,
13,
18884,
6389,
29889,
2271,
353,
4805,
29889,
9485,
404,
29898,
524,
29898,
5085,
29889,
2746,
511,
286,
29889,
13609,
3101,
13,
18884,
19228,
353,
286,
13,
18884,
565,
6389,
29889,
355,
338,
6213,
29901,
13,
462,
1678,
6389,
29889,
355,
353,
376,
9485,
404,
6818,
29908,
462,
29871,
396,
363,
7542,
2450,
29889,
13,
18884,
2867,
13,
13,
1678,
565,
620,
338,
451,
525,
29891,
2396,
13,
4706,
1596,
703,
23323,
451,
1284,
286,
12686,
3652,
7790,
29876,
3529,
671,
448,
29884,
847,
1192,
2271,
2984,
7790,
29876,
5947,
4451,
29991,
1159,
13,
4706,
6876,
580,
13,
13,
1678,
1596,
703,
1576,
22012,
3652,
338,
8653,
6571,
3532,
29966,
1642,
4830,
29898,
4352,
287,
876,
13,
13,
13,
13,
13,
13,
361,
1134,
29898,
5085,
29889,
2746,
29897,
338,
851,
322,
1134,
29898,
5085,
29889,
978,
29897,
338,
851,
29901,
29871,
396,
2088,
404,
278,
3142,
310,
278,
286,
12686,
3652,
13,
1678,
1018,
29901,
13,
4706,
3142,
353,
4805,
29889,
9485,
404,
29898,
524,
29898,
5085,
29889,
2746,
511,
6389,
29889,
978,
29897,
29871,
396,
679,
278,
4140,
287,
3142,
13,
4706,
921,
353,
5065,
417,
2238,
29898,
2271,
29897,
29871,
396,
1423,
565,
278,
3142,
4864,
13,
4706,
6389,
29889,
2271,
353,
376,
9485,
11517,
29908,
29871,
396,
577,
393,
28923,
4464,
1838,
29915,
29873,
4947,
8762,
13,
1678,
5174,
7331,
2392,
29901,
29871,
396,
565,
278,
3142,
338,
2743,
29892,
748,
304,
28923,
4464,
13,
4706,
1596,
703,
9485,
404,
3282,
29915,
29873,
664,
29892,
16869,
6773,
297,
28923,
4464,
23157,
13,
4706,
6389,
29889,
2271,
353,
6213,
13,
13,
2271,
353,
5124,
13,
7827,
353,
29871,
29900,
13,
9847,
353,
5124,
13,
13,
13,
361,
6389,
29889,
2271,
338,
6213,
29901,
13,
1678,
3142,
353,
851,
29898,
2080,
703,
10399,
278,
3142,
310,
278,
286,
12686,
7790,
29876,
29896,
29897,
1124,
597,
1636,
29889,
29885,
574,
481,
5863,
29889,
510,
29914,
24156,
3066,
584,
1152,
376,
13,
462,
1678,
376,
29885,
574,
481,
5863,
29889,
510,
29905,
29876,
29906,
29897,
1124,
597,
29885,
574,
559,
29872,
14627,
29889,
375,
29914,
29885,
12686,
29914,
24156,
3066,
584,
1152,
25016,
559,
29872,
14627,
29889,
375,
320,
29876,
5783,
13,
23681,
6389,
29889,
2271,
338,
376,
9485,
11517,
1115,
13,
1678,
1209,
13,
2870,
29901,
13,
1678,
3142,
353,
6389,
29889,
2271,
13,
1678,
565,
3142,
14352,
29896,
29962,
338,
5591,
1115,
29871,
396,
15154,
25053,
5591,
29908,
565,
1476,
13,
4706,
3142,
353,
3142,
29961,
29900,
13018,
29896,
29962,
13,
13,
361,
6389,
29889,
463,
338,
6213,
29901,
13,
1678,
1369,
353,
938,
29898,
2080,
703,
10399,
278,
16385,
304,
1369,
515,
7790,
29876,
5783,
13,
2870,
29901,
13,
1678,
1369,
353,
938,
29898,
5085,
29889,
463,
29897,
13,
13,
361,
6389,
29889,
355,
338,
376,
524,
29908,
470,
6389,
29889,
355,
338,
376,
9485,
404,
6818,
1115,
29871,
396,
376,
524,
29908,
584,
4124,
4925,
29892,
6213,
584,
599,
10708,
2153,
13,
1678,
5040,
353,
1881,
703,
10399,
278,
16385,
304,
5040,
472,
7790,
29876,
1159,
13,
1678,
1018,
29901,
13,
4706,
5040,
353,
938,
29898,
9847,
29897,
13,
4706,
565,
5040,
1275,
29871,
29900,
29901,
13,
9651,
5040,
353,
6213,
13,
1678,
5174,
313,
1917,
2392,
29892,
20948,
29897,
408,
321,
29901,
13,
4706,
5040,
353,
6213,
13,
23681,
6389,
29889,
355,
338,
6213,
29901,
13,
1678,
5040,
353,
6213,
13,
13,
13,
7554,
29918,
15581,
353,
5124,
29871,
396,
25455,
14319,
29918,
15581,
13,
361,
6389,
29889,
7554,
338,
6213,
29901,
29871,
396,
28923,
4464,
338,
9615,
13,
1678,
2933,
353,
1881,
29898,
703,
6132,
366,
864,
14319,
3190,
3145,
310,
1269,
16385,
29973,
10567,
525,
29891,
29915,
363,
3869,
2056,
525,
29876,
29915,
363,
1939,
7790,
29876,
5783,
13,
1678,
565,
2933,
338,
525,
29891,
2396,
13,
4706,
14319,
29918,
15581,
353,
5852,
13,
1678,
25342,
2933,
338,
525,
29876,
2396,
13,
4706,
14319,
29918,
15581,
353,
7700,
13,
1678,
1683,
29901,
13,
4706,
14319,
29918,
15581,
353,
7700,
13,
23681,
6389,
29889,
7554,
338,
5852,
29901,
13,
1678,
14319,
29918,
15581,
353,
5852,
13,
13,
2746,
353,
4805,
29889,
2746,
29898,
2271,
29892,
6389,
29889,
2746,
29897,
13,
13,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
4136,
29937,
13,
13,
1990,
21403,
17033,
29898,
5160,
2451,
1125,
29871,
396,
21403,
10781,
8960,
13,
1678,
1209,
13,
13,
13,
1990,
4829,
29898,
5160,
2451,
1125,
29871,
396,
5901,
4829,
29879,
8960,
13,
1678,
1209,
13,
13,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
4136,
2277,
13,
13,
2277,
365,
1691,
7370,
28536,
13,
13,
361,
3268,
338,
376,
29924,
574,
481,
5863,
29908,
470,
6389,
29889,
2746,
338,
29871,
29896,
29901,
13,
1678,
286,
12686,
353,
29237,
481,
5863,
29889,
29924,
574,
481,
5863,
29898,
2271,
29892,
1369,
29892,
5040,
29897,
13,
1678,
341,
12686,
1170,
353,
286,
12686,
29889,
2577,
29924,
12686,
1170,
580,
13,
1678,
341,
12686,
1170,
353,
4805,
29889,
29940,
4183,
29898,
29924,
12686,
1170,
29897,
13,
1678,
10781,
353,
29871,
29896,
13,
13,
23681,
3268,
338,
376,
29924,
574,
559,
29872,
29908,
470,
6389,
29889,
2746,
338,
29871,
29906,
29901,
13,
1678,
286,
12686,
353,
29237,
559,
29872,
29889,
29924,
574,
559,
29872,
29898,
2271,
29892,
1369,
29892,
5040,
29897,
13,
1678,
341,
12686,
1170,
353,
286,
12686,
29889,
2577,
29924,
12686,
1170,
580,
13,
1678,
341,
12686,
1170,
353,
4805,
29889,
29940,
4183,
29898,
29924,
12686,
1170,
29897,
13,
1678,
1596,
29898,
29924,
12686,
1170,
29897,
13,
1678,
10781,
353,
29871,
29906,
13,
2870,
29901,
13,
1678,
12020,
21403,
17033,
703,
2392,
10781,
2216,
18601,
287,
7790,
29876,
13393,
1371,
29889,
3945,
363,
901,
29889,
21004,
1159,
13,
13,
29937,
450,
1494,
5900,
471,
8762,
2861,
304,
1661,
13747,
22006,
310,
10708,
2153,
491,
25016,
559,
29872,
14627,
29889,
375,
13,
361,
6389,
29889,
355,
338,
376,
13197,
573,
1115,
29871,
396,
565,
448,
29909,
338,
1565,
29892,
731,
5040,
353,
14990,
13741,
2153,
13,
1678,
921,
353,
286,
12686,
29889,
11536,
1451,
481,
2153,
580,
13,
1678,
5040,
353,
7431,
29898,
29916,
29897,
13,
2870,
29901,
13,
1678,
921,
353,
286,
12686,
29889,
11536,
1451,
481,
2153,
580,
462,
462,
259,
396,
921,
353,
3001,
10708,
2153,
13,
1678,
565,
10781,
338,
29871,
29896,
322,
6389,
29889,
355,
338,
451,
376,
9485,
404,
6818,
1115,
1669,
396,
1763,
4772,
14679,
13,
4706,
5040,
353,
6389,
29889,
355,
13,
1678,
25342,
10781,
338,
29871,
29906,
322,
6389,
29889,
355,
338,
451,
376,
9485,
404,
6818,
1115,
13,
4706,
565,
6389,
29889,
355,
338,
6213,
29901,
13,
9651,
6389,
29889,
355,
353,
1369,
13,
9651,
938,
29898,
5085,
29889,
355,
29897,
13,
9651,
5040,
353,
7431,
29898,
29916,
7503,
5085,
29889,
355,
2314,
13,
4706,
1683,
29901,
13,
9651,
5040,
353,
938,
29898,
5085,
29889,
355,
29897,
462,
18884,
396,
565,
448,
29872,
338,
2183,
13,
9651,
5040,
353,
7431,
29898,
29916,
7503,
938,
29898,
5085,
29889,
355,
29897,
2314,
462,
418,
396,
9847,
353,
29871,
29900,
304,
6389,
29889,
355,
13,
13,
13,
2158,
703,
11536,
13741,
2153,
7740,
3106,
584,
5159,
1213,
29889,
4830,
29898,
9847,
876,
13,
13,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
13383,
29937,
13,
13,
15945,
29908,
4241,
4522,
293,
1152,
9943,
13234,
29889,
9995,
13,
361,
5040,
338,
6213,
470,
1369,
1275,
5040,
29901,
13,
13,
1678,
9995,
2323,
16385,
28536,
4464,
9995,
13,
13,
1678,
274,
9970,
353,
2897,
29889,
657,
29883,
9970,
580,
13,
1678,
1570,
2605,
353,
2897,
29889,
2084,
29889,
7122,
29898,
29883,
9970,
29892,
851,
29898,
29924,
12686,
1170,
876,
13,
1678,
4805,
29889,
9984,
9170,
29898,
710,
29898,
29924,
12686,
1170,
511,
1570,
2605,
29897,
13,
13,
1678,
565,
6389,
29889,
13197,
573,
338,
5852,
29901,
29871,
396,
9000,
4464,
29889,
13,
4706,
286,
12686,
29889,
2577,
29907,
957,
2940,
580,
29871,
396,
4947,
4612,
1967,
1090,
9000,
21864,
13,
13,
1678,
3001,
353,
286,
12686,
29889,
11536,
29925,
3174,
29898,
2962,
29897,
13,
1678,
23040,
2605,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4373,
2605,
29892,
851,
29898,
2962,
876,
29871,
396,
6760,
1078,
263,
716,
2224,
363,
16385,
29915,
29879,
4138,
13,
1678,
4805,
29889,
9984,
9170,
29898,
710,
29898,
2962,
511,
23040,
2605,
29892,
1570,
2605,
29897,
13,
1678,
1596,
703,
1451,
3314,
29899,
8875,
338,
23748,
29991,
1642,
4830,
29898,
2962,
876,
13,
1678,
363,
1353,
297,
3464,
29898,
29896,
29892,
3001,
718,
29871,
29896,
1125,
13,
4706,
1857,
5983,
353,
286,
12686,
29889,
7583,
5983,
29898,
2962,
29892,
1353,
29897,
13,
4706,
10153,
29903,
2214,
353,
286,
12686,
29889,
2577,
29903,
2214,
29898,
3784,
5983,
29897,
13,
4706,
286,
12686,
29889,
2492,
2577,
357,
29898,
2492,
29903,
2214,
29892,
1353,
29897,
13,
13,
1678,
1596,
703,
1451,
3314,
29899,
8875,
338,
9943,
15638,
1642,
4830,
29898,
2962,
876,
13,
13,
1678,
565,
14319,
29918,
15581,
338,
5852,
29901,
29871,
396,
796,
17347,
310,
10708,
2153,
29889,
13,
4706,
2897,
29889,
305,
3972,
877,
636,
1495,
13,
4706,
4805,
29889,
7554,
29898,
710,
29898,
2962,
511,
23040,
2605,
29897,
13,
4706,
1596,
703,
1451,
3314,
29899,
8875,
338,
796,
16242,
29991,
1642,
4830,
29898,
2962,
876,
13,
4706,
4805,
29889,
12498,
9170,
29898,
1451,
3314,
2605,
29897,
13,
13,
2870,
29901,
13,
1678,
9995,
29871,
14974,
16385,
21864,
9995,
13,
13,
1678,
396,
341,
5086,
263,
1570,
4138,
363,
341,
12686,
1170,
13,
1678,
274,
9970,
353,
2897,
29889,
657,
29883,
9970,
580,
13,
1678,
1570,
2605,
353,
2897,
29889,
2084,
29889,
7122,
29898,
29883,
9970,
29892,
851,
29898,
29924,
12686,
1170,
876,
13,
1678,
1596,
29898,
4373,
2605,
29897,
13,
1678,
4805,
29889,
9984,
9170,
29898,
710,
29898,
29924,
12686,
1170,
511,
1570,
2605,
29897,
13,
13,
1678,
565,
6389,
29889,
13197,
573,
338,
5852,
29901,
29871,
396,
9000,
4464,
13,
4706,
286,
12686,
29889,
2577,
29907,
957,
2940,
580,
29871,
396,
4947,
4612,
1967,
1090,
9000,
21864,
13,
13,
1678,
1596,
703,
9847,
338,
6571,
1642,
4830,
29898,
9847,
876,
13,
1678,
363,
474,
297,
3464,
29898,
2962,
29892,
938,
29898,
9847,
29897,
718,
29871,
29896,
1125,
29871,
396,
474,
353,
23040,
9681,
29898,
4738,
635,
29897,
13,
4706,
565,
10781,
338,
29871,
29896,
29901,
13,
9651,
3001,
353,
286,
12686,
29889,
11536,
29925,
3174,
29898,
29875,
29897,
29871,
396,
25016,
481,
5863,
338,
13747,
297,
22006,
29892,
577,
474,
338,
451,
10551,
287,
13,
4706,
25342,
10781,
338,
29871,
29906,
29901,
13,
9651,
3001,
353,
286,
12686,
29889,
11536,
29925,
3174,
29898,
524,
29898,
29916,
29961,
29875,
448,
29871,
29896,
12622,
29871,
396,
25016,
559,
29872,
14627,
338,
1661,
13747,
29892,
577,
474,
338,
3939,
13,
9651,
921,
29961,
29875,
448,
29871,
29896,
29962,
353,
474,
13,
4706,
23040,
2605,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4373,
2605,
29892,
851,
29898,
29875,
876,
29871,
396,
6760,
1078,
263,
716,
2224,
363,
16385,
29915,
29879,
4138,
13,
4706,
4805,
29889,
9984,
9170,
29898,
710,
29898,
29875,
511,
23040,
2605,
29892,
1570,
2605,
29897,
13,
13,
4706,
1596,
703,
1451,
3314,
29899,
8875,
338,
23748,
29991,
1642,
4830,
29898,
29875,
876,
13,
13,
4706,
363,
1353,
297,
3464,
29898,
29896,
29892,
3001,
718,
29871,
29896,
1125,
29871,
396,
1353,
353,
1813,
1353,
13,
9651,
1857,
5983,
353,
286,
12686,
29889,
7583,
5983,
29898,
29875,
29892,
1353,
29897,
13,
9651,
10153,
29903,
2214,
353,
286,
12686,
29889,
2577,
29903,
2214,
29898,
3784,
5983,
29897,
13,
9651,
286,
12686,
29889,
2492,
2577,
357,
29898,
2492,
29903,
2214,
29892,
1353,
29897,
13,
13,
4706,
1596,
703,
1451,
3314,
29899,
8875,
338,
9943,
15638,
1642,
4830,
29898,
29875,
876,
13,
13,
4706,
565,
14319,
29918,
15581,
338,
5852,
29901,
29871,
396,
503,
17347,
2908,
13,
9651,
2897,
29889,
305,
3972,
877,
636,
1495,
13,
9651,
4805,
29889,
7554,
29898,
710,
29898,
29875,
511,
23040,
2605,
29897,
13,
9651,
1596,
703,
1451,
3314,
29899,
8875,
338,
796,
16242,
29991,
1642,
4830,
29898,
29875,
876,
13,
9651,
4805,
29889,
12498,
9170,
29898,
1451,
3314,
2605,
29897,
13,
4706,
1683,
29901,
13,
9651,
2897,
29889,
305,
3972,
877,
636,
1495,
13,
13,
2158,
703,
22954,
25034,
6824,
9903,
29876,
1159,
13,
2
] |
src/UQpy/Distributions/baseclass/DistributionContinuous1D.py | marrov/UQpy | 132 | 17858 | import numpy as np
import scipy.stats as stats
from UQpy.Distributions.baseclass.Distribution import Distribution
class DistributionContinuous1D(Distribution):
"""
Parent class for univariate continuous probability distributions.
"""
def __init__(self, **kwargs):
super().__init__(**kwargs)
@staticmethod
def _check_x_dimension(x):
"""
Check the dimension of input x - must be an ndarray of shape (npoints,) or (npoints, 1)
"""
x = np.atleast_1d(x)
if len(x.shape) > 2 or (len(x.shape) == 2 and x.shape[1] != 1):
raise ValueError('Wrong dimension in x.')
return x.reshape((-1,))
def _construct_from_scipy(self, scipy_name=stats.rv_continuous):
self.cdf = lambda x: scipy_name.cdf(x=self._check_x_dimension(x), **self.params)
self.pdf = lambda x: scipy_name.pdf(x=self._check_x_dimension(x), **self.params)
self.log_pdf = lambda x: scipy_name.logpdf(x=self._check_x_dimension(x), **self.params)
self.icdf = lambda x: scipy_name.ppf(q=self._check_x_dimension(x), **self.params)
self.moments = lambda moments2return='mvsk': scipy_name.stats(moments=moments2return, **self.params)
self.rvs = lambda nsamples=1, random_state=None: scipy_name.rvs(
size=nsamples, random_state=random_state, **self.params).reshape((nsamples, 1))
def tmp_fit(dist, data):
data = self._check_x_dimension(data)
fixed_params = {}
for key, value in dist.params.items():
if value is not None:
fixed_params['f' + key] = value
params_fitted = scipy_name.fit(data=data, **fixed_params)
return dict(zip(dist.order_params, params_fitted))
self.fit = lambda data: tmp_fit(self, data) | [
1,
1053,
12655,
408,
7442,
13,
5215,
4560,
2272,
29889,
16202,
408,
22663,
13,
3166,
501,
29984,
2272,
29889,
13398,
3224,
29879,
29889,
3188,
1990,
29889,
13398,
3224,
1053,
17740,
13,
13,
13,
1990,
17740,
1323,
8675,
681,
29896,
29928,
29898,
13398,
3224,
1125,
13,
1678,
9995,
13,
1678,
22280,
770,
363,
443,
27432,
403,
9126,
6976,
18822,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3579,
19290,
1125,
13,
4706,
2428,
2141,
1649,
2344,
12035,
1068,
19290,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
903,
3198,
29918,
29916,
29918,
6229,
2673,
29898,
29916,
1125,
13,
4706,
9995,
13,
4706,
5399,
278,
9927,
310,
1881,
921,
448,
1818,
367,
385,
29871,
299,
2378,
310,
8267,
313,
29876,
9748,
29892,
29897,
470,
313,
29876,
9748,
29892,
29871,
29896,
29897,
13,
4706,
9995,
13,
4706,
921,
353,
7442,
29889,
271,
280,
579,
29918,
29896,
29881,
29898,
29916,
29897,
13,
4706,
565,
7431,
29898,
29916,
29889,
12181,
29897,
1405,
29871,
29906,
470,
313,
2435,
29898,
29916,
29889,
12181,
29897,
1275,
29871,
29906,
322,
921,
29889,
12181,
29961,
29896,
29962,
2804,
29871,
29896,
1125,
13,
9651,
12020,
7865,
2392,
877,
29956,
29373,
9927,
297,
921,
29889,
1495,
13,
4706,
736,
921,
29889,
690,
14443,
3552,
29899,
29896,
29892,
876,
13,
13,
1678,
822,
903,
11433,
29918,
3166,
29918,
26167,
2272,
29898,
1311,
29892,
4560,
2272,
29918,
978,
29922,
16202,
29889,
15291,
29918,
20621,
681,
1125,
13,
4706,
1583,
29889,
29883,
2176,
353,
14013,
921,
29901,
4560,
2272,
29918,
978,
29889,
29883,
2176,
29898,
29916,
29922,
1311,
3032,
3198,
29918,
29916,
29918,
6229,
2673,
29898,
29916,
511,
3579,
1311,
29889,
7529,
29897,
13,
4706,
1583,
29889,
5140,
353,
14013,
921,
29901,
4560,
2272,
29918,
978,
29889,
5140,
29898,
29916,
29922,
1311,
3032,
3198,
29918,
29916,
29918,
6229,
2673,
29898,
29916,
511,
3579,
1311,
29889,
7529,
29897,
13,
4706,
1583,
29889,
1188,
29918,
5140,
353,
14013,
921,
29901,
4560,
2272,
29918,
978,
29889,
1188,
5140,
29898,
29916,
29922,
1311,
3032,
3198,
29918,
29916,
29918,
6229,
2673,
29898,
29916,
511,
3579,
1311,
29889,
7529,
29897,
13,
4706,
1583,
29889,
293,
2176,
353,
14013,
921,
29901,
4560,
2272,
29918,
978,
29889,
407,
29888,
29898,
29939,
29922,
1311,
3032,
3198,
29918,
29916,
29918,
6229,
2673,
29898,
29916,
511,
3579,
1311,
29889,
7529,
29897,
13,
4706,
1583,
29889,
29885,
290,
1237,
353,
14013,
19462,
29906,
2457,
2433,
29324,
808,
2396,
4560,
2272,
29918,
978,
29889,
16202,
29898,
29885,
290,
1237,
29922,
29885,
290,
1237,
29906,
2457,
29892,
3579,
1311,
29889,
7529,
29897,
13,
4706,
1583,
29889,
29878,
4270,
353,
14013,
17534,
9422,
29922,
29896,
29892,
4036,
29918,
3859,
29922,
8516,
29901,
4560,
2272,
29918,
978,
29889,
29878,
4270,
29898,
13,
9651,
2159,
29922,
1983,
9422,
29892,
4036,
29918,
3859,
29922,
8172,
29918,
3859,
29892,
3579,
1311,
29889,
7529,
467,
690,
14443,
3552,
1983,
9422,
29892,
29871,
29896,
876,
13,
13,
4706,
822,
13128,
29918,
9202,
29898,
5721,
29892,
848,
1125,
13,
9651,
848,
353,
1583,
3032,
3198,
29918,
29916,
29918,
6229,
2673,
29898,
1272,
29897,
13,
9651,
4343,
29918,
7529,
353,
6571,
13,
9651,
363,
1820,
29892,
995,
297,
1320,
29889,
7529,
29889,
7076,
7295,
13,
18884,
565,
995,
338,
451,
6213,
29901,
13,
462,
1678,
4343,
29918,
7529,
1839,
29888,
29915,
718,
1820,
29962,
353,
995,
13,
9651,
8636,
29918,
29888,
4430,
353,
4560,
2272,
29918,
978,
29889,
9202,
29898,
1272,
29922,
1272,
29892,
3579,
20227,
29918,
7529,
29897,
13,
9651,
736,
9657,
29898,
7554,
29898,
5721,
29889,
2098,
29918,
7529,
29892,
8636,
29918,
29888,
4430,
876,
13,
4706,
1583,
29889,
9202,
353,
14013,
848,
29901,
13128,
29918,
9202,
29898,
1311,
29892,
848,
29897,
2
] |
cwvae.py | juliuskunze/cwvae | 0 | 1603508 | <filename>cwvae.py
import tensorflow.compat.v1 as tf
import cnns
from cells import *
import tools
class CWVAE:
def __init__(
self,
levels,
tmp_abs_factor,
state_sizes,
embed_size,
cell_type,
lr,
min_stddev,
mean_only_cell=False,
reset_states=False,
var_scope="CWVAE",
):
self.cell_type = cell_type
self._levels = levels
self._state_size = state_sizes["stoch"]
self._detstate_size = state_sizes["deter"]
self._embed_size = embed_size
self._var_scope = var_scope
self.lr = lr
self._min_stddev = min_stddev
self._tmp_abs_factor = tmp_abs_factor
self._reset_states = reset_states
self.cells = []
for i_lvl in range(self._levels):
if self.cell_type == "RSSMCell":
assert (
self._detstate_size
), f"deter state size should be non-zero int, found {self._detstate_size}"
cell = RSSMCell(
self._state_size,
self._detstate_size,
self._embed_size,
reset_states=self._reset_states,
min_stddev=self._min_stddev,
mean_only=mean_only_cell,
var_scope="cell_" + str(i_lvl),
)
else:
raise ValueError(f"Cell type {self.cell_type} not supported")
self.cells.append(cell)
def hierarchical_unroll(
self, inputs, actions=None, use_observations=None, initial_state=None
):
"""
Used to unroll a list of recurrent cells.
Arguments:
cells
inputs : list of encoded observations
Number of nodes at every level in 'inputs' is the exact number of nodes to be unrolled
actions
use_observations : bool or list[bool]
initial_state : list of cell states
"""
if use_observations is None:
use_observations = self._levels * [True]
elif not isinstance(use_observations, list):
use_observations = self._levels * [use_observations]
if initial_state is None:
initial_state = self._levels * [None]
level_top = self._levels - 1
inputs_top = inputs[level_top]
level = level_top
# Feeding in zeros as context to the top level.
context = tf.zeros(
shape=tf.concat(
[tf.shape(inputs_top)[0:2], [self.cells[-1].state_size["output"]]], -1
)
)
# Init reset_state: alternate zeros and ones, of the size of input[level=-2]
if level_top >= 1:
inputs_top_ = inputs[level_top - 1]
temp_zeros = tf.zeros(
tf.concat([tf.shape(inputs_top_)[:2], [tf.constant(1)]], -1)
)
temp_ones = tf.ones_like(temp_zeros)
_reset_state = tf.concat([temp_zeros, temp_ones], -1)
_reset_state = tf.reshape(_reset_state, [tf.shape(_reset_state)[0], -1, 1])
_reset_state = tf.slice(
_reset_state,
[0, 0, 0],
tf.concat([tf.shape(inputs_top_)[:2], [tf.constant(1)]], -1),
)
else:
_reset_state = tf.no_op()
prior_list = [] # Stored bot to top.
posterior_list = [] # Stored bot to top.
last_state_all_levels = []
for level in range(level_top, -1, -1):
obs_inputs = inputs[level]
print(f"Input shape in CWVAE level {level}: {obs_inputs.shape}")
if level == level_top:
reset_state, reset_state_next = (
tf.ones(shape=tf.concat([tf.shape(obs_inputs)[0:2], [1]], -1)),
_reset_state,
)
else:
reset_state, reset_state_next = (
reset_state,
tf.tile(reset_state, [1, self._tmp_abs_factor, 1]),
)
# Pruning reset_state, context from previous layer, to match the num of nodes reqd as in inputs[level]
reset_state = tf.slice(
reset_state,
len(context.shape.as_list()) * [0],
tf.concat([tf.shape(obs_inputs)[:2], [1]], -1),
)
context = tf.slice(
context,
len(context.shape.as_list()) * [0],
tf.concat([tf.shape(obs_inputs)[:2], context.shape.as_list()[2:]], -1),
)
# Concatenating actions (if provided) to the context at the bottom-most level.
if level == 0 and actions is not None:
context = tf.concat([context, actions], axis=-1)
# Dynamic unroll of RNN cell.
initial = self.cells[level].zero_out_state(tf.shape(obs_inputs)[0])
if initial_state[level] is not None:
initial["state"] = initial_state[level]
(prior, posterior), posterior_last_step = tools.scan(
self.cells[level],
(obs_inputs, context, reset_state),
use_observations[level],
initial,
)
last_state_all_levels.insert(0, posterior_last_step)
context = posterior["output"]
prior_list.insert(0, prior)
posterior_list.insert(0, posterior)
# Tiling context by a factor of tmp_abs_factor for use at the level below.
if level != 0:
context = tf.expand_dims(context, axis=2)
context = tf.tile(
context,
[1, 1, self._tmp_abs_factor]
+ (len(context.shape.as_list()) - 3) * [1],
)
context = tf.reshape(
context,
[tf.shape(context)[0], tf.reduce_prod(tf.shape(context)[1:3])]
+ context.shape.as_list()[3:],
)
reset_state = reset_state_next
output_bot_level = context
return output_bot_level, last_state_all_levels, prior_list, posterior_list
def open_loop_unroll(self, inputs, ctx_len, actions=None, use_observations=None):
if use_observations is None:
use_observations = self._levels * [True]
ctx_len_backup = ctx_len
pre_inputs = []
post_inputs = []
for lvl in range(self._levels):
pre_inputs.append(inputs[lvl][:, :ctx_len, ...])
post_inputs.append(tf.zeros_like(inputs[lvl][:, ctx_len:, ...]))
ctx_len = int(ctx_len / self._tmp_abs_factor)
ctx_len = ctx_len_backup
actions_pre = actions_post = None
if actions is not None:
actions_pre = actions[:, :ctx_len, :]
actions_post = actions[:, ctx_len:, :]
(
_,
pre_last_state_all_levels,
pre_priors,
pre_posteriors,
) = self.hierarchical_unroll(
pre_inputs, actions=actions_pre, use_observations=use_observations
)
_, _, post_priors, _ = self.hierarchical_unroll(
post_inputs,
actions=actions_post,
use_observations=self._levels * [False],
initial_state=pre_last_state_all_levels,
)
return pre_posteriors, pre_priors, post_priors
def _gaussian_KLD(self, dist1, dist2):
"""
Computes KL(dist1 || dist2)
Arguments:
dist1 : dict containing 'mean' and 'stddev' for multivariate normal distributions
shape of mean/stddev: (batch size, timesteps, [dim1, dim2, ...])
dist2 : (same as dist1)
"""
if len(dist1["mean"].shape[2:]) > 1:
new_shape = tf.concat([tf.shape(dist1["mean"])[:2], [-1]], -1)
dist1["mean"] = tf.reshape(dist1["mean"], new_shape)
dist1["stddev"] = tf.reshape(dist1["stddev"], new_shape)
dist2["mean"] = tf.reshape(dist2["mean"], new_shape)
dist2["stddev"] = tf.reshape(dist2["stddev"], new_shape)
mvn1 = tfd.MultivariateNormalDiag(loc=dist1["mean"], scale_diag=dist1["stddev"])
mvn2 = tfd.MultivariateNormalDiag(loc=dist2["mean"], scale_diag=dist2["stddev"])
return mvn1.kl_divergence(mvn2)
def _log_prob_obs(self, samples, mean, stddev):
"""
Returns prob density of samples in the given distribution
The last dim of the samples is the one taken sum over.
"""
if len(samples.shape[2:]) > 1:
new_shape = tf.concat([tf.shape(samples)[:2], [-1]], -1)
samples = tf.reshape(samples, new_shape)
mean = tf.reshape(mean, new_shape)
if isinstance(stddev, tf.Tensor):
stddev = tf.reshape(stddev, new_shape)
dist = tfd.Independent(tfd.Normal(mean, stddev), reinterpreted_batch_ndims=1)
return dist.log_prob(samples)
def _stop_grad_dist(self, dist):
dist["mean"] = tf.stop_gradient(dist["mean"])
dist["stddev"] = tf.stop_gradient(dist["stddev"])
return dist
def compute_losses(
self,
obs,
obs_decoded,
priors,
posteriors,
dec_stddev=0.1,
kl_grad_post_perc=None,
free_nats=None,
beta=None,
):
"""
Computes ELBO.
Arguments:
obs : Placeholder
Observed video
obs_decoded : Tensor
Decoded video
priors : list[dict]
each dict holds the priors at all timesteps for a particular level in the model
posteriors : list[dict]
each dict holds the posteriors at all timesteps for a particular level in the model
"""
nll_term = -self._log_prob_obs(obs, obs_decoded, dec_stddev) # shape: (B,T)
nll_term = tf.reduce_mean(tf.reduce_sum(nll_term, axis=1), 0)
assert len(nll_term.shape) == 0, nll_term.shape
# Computing KLs between priors and posteriors
self.kld_all_levels = []
kl_term = tf.constant(0.0)
for i in range(self._levels):
kld_level = self._gaussian_KLD(posteriors[i], priors[i])
if kl_grad_post_perc is None:
kld_level_total = tf.reduce_mean(tf.reduce_sum(kld_level, axis=1))
else:
# Scaling gradient between prior and posterior.
kld_level_p = (1 - kl_grad_post_perc) * self._gaussian_KLD(
self._stop_grad_dist(posteriors[i]), priors[i]
) # shape: (B,T)
kld_level_q = kl_grad_post_perc * self._gaussian_KLD(
posteriors[i], self._stop_grad_dist(priors[i])
) # shape: (B,T)
kld_level_total_p = tf.reduce_mean(tf.reduce_sum(kld_level_p, axis=1))
kld_level_total_q = tf.reduce_mean(tf.reduce_sum(kld_level_q, axis=1))
# Giving 1 free nat to the posterior.
kld_level_total_q = tf.maximum(1.0, kld_level_total_q)
kld_level_total = kld_level_total_p + kld_level_total_q
if free_nats is None:
if beta is None:
kl_term += kld_level_total
else:
if isinstance(beta, list):
kl_term += beta[i] * kld_level_total
else:
kl_term += beta * kld_level_total
else:
if beta is None:
kl_term += tf.maximum(0.0, kld_level_total - free_nats)
else:
if isinstance(beta, list):
kl_term += beta[i] * tf.maximum(
0.0, kld_level_total - free_nats
)
else:
kl_term += beta * tf.maximum(0.0, kld_level_total - free_nats)
self.kld_all_levels.insert(i, kld_level)
neg_elbo = nll_term + kl_term
num_timesteps_obs = tf.cast(tf.shape(obs)[1], tf.float32)
self.loss = neg_elbo / num_timesteps_obs
self._kl_term = kl_term / num_timesteps_obs
self._nll_term = nll_term / num_timesteps_obs
return self.loss
def build_model(cfg, open_loop=True):
obs = tf.placeholder(tf.float32, [None, None, 64, 64, cfg.channels], name="obs")
encoder = cnns.Encoder(
cfg.levels,
cfg.tmp_abs_factor,
dense_layers=cfg.enc_dense_layers,
embed_size=cfg.enc_dense_embed_size,
channels_mult=cfg.channels_mult,
)
decoder = cnns.Decoder(cfg.channels, channels_mult=cfg.channels_mult)
obs_encoded = encoder(obs)
model = CWVAE(
cfg.levels,
cfg.tmp_abs_factor,
dict(stoch=cfg.cell_stoch_size, deter=cfg.cell_deter_size),
cfg.cell_embed_size,
cfg.cell_type,
cfg.lr,
cfg.cell_min_stddev,
mean_only_cell=cfg.cell_mean_only,
reset_states=cfg.cell_reset_state,
)
outputs_bot, _, priors, posteriors = model.hierarchical_unroll(obs_encoded)
obs_decoded = decoder(outputs_bot)
loss = model.compute_losses(
obs,
obs_decoded,
priors,
posteriors,
dec_stddev=cfg.dec_stddev,
kl_grad_post_perc=cfg.kl_grad_post_perc,
free_nats=cfg.free_nats,
beta=cfg.beta,
)
out = dict(training=dict(obs=obs, encoder=encoder, decoder=decoder,
obs_encoded=obs_encoded, obs_decoded=obs_decoded,
priors=priors, posteriors=posteriors, loss=loss),
meta={"model": model})
if open_loop:
posteriors_recon, priors_onestep, priors_multistep = model.open_loop_unroll(
obs_encoded, cfg.open_loop_ctx, use_observations=cfg.use_obs
)
obs_decoded_posterior_recon = decoder(posteriors_recon[0]["output"])
obs_decoded_prior_onestep = decoder(priors_onestep[0]["output"])
obs_decoded_prior_multistep = decoder(priors_multistep[0]["output"])
gt_multistep = obs[:, cfg.open_loop_ctx :, ...]
out.update(
dict(open_loop_obs_decoded=dict(
posterior_recon=obs_decoded_posterior_recon,
prior_onestep=obs_decoded_prior_onestep,
prior_multistep=obs_decoded_prior_multistep,
gt_multistep=gt_multistep))
)
return out
| [
1,
529,
9507,
29958,
29883,
29893,
1564,
29872,
29889,
2272,
13,
5215,
26110,
29889,
12667,
29889,
29894,
29896,
408,
15886,
13,
13,
5215,
274,
29876,
1983,
13,
3166,
9101,
1053,
334,
13,
5215,
8492,
13,
13,
13,
1990,
315,
29956,
29963,
16036,
29901,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
13,
4706,
11174,
29892,
13,
4706,
13128,
29918,
6897,
29918,
19790,
29892,
13,
4706,
2106,
29918,
29879,
7093,
29892,
13,
4706,
8297,
29918,
2311,
29892,
13,
4706,
3038,
29918,
1853,
29892,
13,
4706,
301,
29878,
29892,
13,
4706,
1375,
29918,
4172,
3359,
29892,
13,
4706,
2099,
29918,
6194,
29918,
3729,
29922,
8824,
29892,
13,
4706,
10092,
29918,
28631,
29922,
8824,
29892,
13,
4706,
722,
29918,
6078,
543,
29907,
29956,
29963,
16036,
613,
13,
268,
1125,
13,
4706,
1583,
29889,
3729,
29918,
1853,
353,
3038,
29918,
1853,
13,
4706,
1583,
3032,
5563,
29879,
353,
11174,
13,
4706,
1583,
3032,
3859,
29918,
2311,
353,
2106,
29918,
29879,
7093,
3366,
303,
2878,
3108,
13,
4706,
1583,
3032,
4801,
3859,
29918,
2311,
353,
2106,
29918,
29879,
7093,
3366,
29881,
1308,
3108,
13,
4706,
1583,
3032,
17987,
29918,
2311,
353,
8297,
29918,
2311,
13,
4706,
1583,
3032,
1707,
29918,
6078,
353,
722,
29918,
6078,
13,
4706,
1583,
29889,
29212,
353,
301,
29878,
13,
4706,
1583,
3032,
1195,
29918,
4172,
3359,
353,
1375,
29918,
4172,
3359,
13,
4706,
1583,
3032,
7050,
29918,
6897,
29918,
19790,
353,
13128,
29918,
6897,
29918,
19790,
13,
4706,
1583,
3032,
12071,
29918,
28631,
353,
10092,
29918,
28631,
13,
13,
4706,
1583,
29889,
3729,
29879,
353,
5159,
13,
4706,
363,
474,
29918,
29880,
20901,
297,
3464,
29898,
1311,
3032,
5563,
29879,
1125,
13,
9651,
565,
1583,
29889,
3729,
29918,
1853,
1275,
376,
29934,
1799,
29924,
4617,
1115,
13,
18884,
4974,
313,
13,
462,
1678,
1583,
3032,
4801,
3859,
29918,
2311,
13,
18884,
10353,
285,
29908,
29881,
1308,
2106,
2159,
881,
367,
1661,
29899,
9171,
938,
29892,
1476,
426,
1311,
3032,
4801,
3859,
29918,
2311,
5038,
13,
18884,
3038,
353,
390,
1799,
29924,
4617,
29898,
13,
462,
1678,
1583,
3032,
3859,
29918,
2311,
29892,
13,
462,
1678,
1583,
3032,
4801,
3859,
29918,
2311,
29892,
13,
462,
1678,
1583,
3032,
17987,
29918,
2311,
29892,
13,
462,
1678,
10092,
29918,
28631,
29922,
1311,
3032,
12071,
29918,
28631,
29892,
13,
462,
1678,
1375,
29918,
4172,
3359,
29922,
1311,
3032,
1195,
29918,
4172,
3359,
29892,
13,
462,
1678,
2099,
29918,
6194,
29922,
12676,
29918,
6194,
29918,
3729,
29892,
13,
462,
1678,
722,
29918,
6078,
543,
3729,
27508,
718,
851,
29898,
29875,
29918,
29880,
20901,
511,
13,
18884,
1723,
13,
9651,
1683,
29901,
13,
18884,
12020,
7865,
2392,
29898,
29888,
29908,
4617,
1134,
426,
1311,
29889,
3729,
29918,
1853,
29913,
451,
6969,
1159,
13,
9651,
1583,
29889,
3729,
29879,
29889,
4397,
29898,
3729,
29897,
13,
13,
1678,
822,
6128,
1279,
936,
29918,
348,
1245,
29898,
13,
4706,
1583,
29892,
10970,
29892,
8820,
29922,
8516,
29892,
671,
29918,
26739,
800,
29922,
8516,
29892,
2847,
29918,
3859,
29922,
8516,
13,
268,
1125,
13,
4706,
9995,
13,
4706,
501,
8485,
304,
443,
1245,
263,
1051,
310,
1162,
1264,
9101,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
9101,
13,
9651,
10970,
584,
1051,
310,
18511,
13917,
13,
18884,
9681,
310,
7573,
472,
1432,
3233,
297,
525,
2080,
29879,
29915,
338,
278,
2684,
1353,
310,
7573,
304,
367,
443,
24476,
13,
9651,
8820,
13,
9651,
671,
29918,
26739,
800,
584,
6120,
470,
1051,
29961,
11227,
29962,
13,
9651,
2847,
29918,
3859,
584,
1051,
310,
3038,
5922,
13,
4706,
9995,
13,
4706,
565,
671,
29918,
26739,
800,
338,
6213,
29901,
13,
9651,
671,
29918,
26739,
800,
353,
1583,
3032,
5563,
29879,
334,
518,
5574,
29962,
13,
4706,
25342,
451,
338,
8758,
29898,
1509,
29918,
26739,
800,
29892,
1051,
1125,
13,
9651,
671,
29918,
26739,
800,
353,
1583,
3032,
5563,
29879,
334,
518,
1509,
29918,
26739,
800,
29962,
13,
13,
4706,
565,
2847,
29918,
3859,
338,
6213,
29901,
13,
9651,
2847,
29918,
3859,
353,
1583,
3032,
5563,
29879,
334,
518,
8516,
29962,
13,
13,
4706,
3233,
29918,
3332,
353,
1583,
3032,
5563,
29879,
448,
29871,
29896,
13,
4706,
10970,
29918,
3332,
353,
10970,
29961,
5563,
29918,
3332,
29962,
13,
13,
4706,
3233,
353,
3233,
29918,
3332,
13,
13,
4706,
396,
5169,
21219,
297,
24786,
408,
3030,
304,
278,
2246,
3233,
29889,
13,
4706,
3030,
353,
15886,
29889,
3298,
359,
29898,
13,
9651,
8267,
29922,
13264,
29889,
17685,
29898,
13,
18884,
518,
13264,
29889,
12181,
29898,
2080,
29879,
29918,
3332,
9601,
29900,
29901,
29906,
1402,
518,
1311,
29889,
3729,
29879,
14352,
29896,
1822,
3859,
29918,
2311,
3366,
4905,
3108,
20526,
448,
29896,
13,
9651,
1723,
13,
4706,
1723,
13,
13,
4706,
396,
10886,
10092,
29918,
3859,
29901,
25010,
24786,
322,
6743,
29892,
310,
278,
2159,
310,
1881,
29961,
5563,
10457,
29906,
29962,
13,
4706,
565,
3233,
29918,
3332,
6736,
29871,
29896,
29901,
13,
9651,
10970,
29918,
3332,
29918,
353,
10970,
29961,
5563,
29918,
3332,
448,
29871,
29896,
29962,
13,
9651,
5694,
29918,
3298,
359,
353,
15886,
29889,
3298,
359,
29898,
13,
18884,
15886,
29889,
17685,
4197,
13264,
29889,
12181,
29898,
2080,
29879,
29918,
3332,
19925,
7503,
29906,
1402,
518,
13264,
29889,
23362,
29898,
29896,
4638,
1402,
448,
29896,
29897,
13,
9651,
1723,
13,
9651,
5694,
29918,
2873,
353,
15886,
29889,
2873,
29918,
4561,
29898,
7382,
29918,
3298,
359,
29897,
13,
9651,
903,
12071,
29918,
3859,
353,
15886,
29889,
17685,
4197,
7382,
29918,
3298,
359,
29892,
5694,
29918,
2873,
1402,
448,
29896,
29897,
13,
9651,
903,
12071,
29918,
3859,
353,
15886,
29889,
690,
14443,
7373,
12071,
29918,
3859,
29892,
518,
13264,
29889,
12181,
7373,
12071,
29918,
3859,
9601,
29900,
1402,
448,
29896,
29892,
29871,
29896,
2314,
13,
9651,
903,
12071,
29918,
3859,
353,
15886,
29889,
18337,
29898,
13,
18884,
903,
12071,
29918,
3859,
29892,
13,
18884,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
13,
18884,
15886,
29889,
17685,
4197,
13264,
29889,
12181,
29898,
2080,
29879,
29918,
3332,
19925,
7503,
29906,
1402,
518,
13264,
29889,
23362,
29898,
29896,
4638,
1402,
448,
29896,
511,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
903,
12071,
29918,
3859,
353,
15886,
29889,
1217,
29918,
459,
580,
13,
13,
4706,
7536,
29918,
1761,
353,
5159,
29871,
396,
624,
4395,
9225,
304,
2246,
29889,
13,
4706,
13446,
29918,
1761,
353,
5159,
29871,
396,
624,
4395,
9225,
304,
2246,
29889,
13,
13,
4706,
1833,
29918,
3859,
29918,
497,
29918,
5563,
29879,
353,
5159,
13,
13,
4706,
363,
3233,
297,
3464,
29898,
5563,
29918,
3332,
29892,
448,
29896,
29892,
448,
29896,
1125,
13,
9651,
20881,
29918,
2080,
29879,
353,
10970,
29961,
5563,
29962,
13,
9651,
1596,
29898,
29888,
29908,
4290,
8267,
297,
315,
29956,
29963,
16036,
3233,
426,
5563,
6177,
426,
26290,
29918,
2080,
29879,
29889,
12181,
27195,
13,
9651,
565,
3233,
1275,
3233,
29918,
3332,
29901,
13,
18884,
10092,
29918,
3859,
29892,
10092,
29918,
3859,
29918,
4622,
353,
313,
13,
462,
1678,
15886,
29889,
2873,
29898,
12181,
29922,
13264,
29889,
17685,
4197,
13264,
29889,
12181,
29898,
26290,
29918,
2080,
29879,
9601,
29900,
29901,
29906,
1402,
518,
29896,
20526,
448,
29896,
8243,
13,
462,
1678,
903,
12071,
29918,
3859,
29892,
13,
18884,
1723,
13,
9651,
1683,
29901,
13,
18884,
10092,
29918,
3859,
29892,
10092,
29918,
3859,
29918,
4622,
353,
313,
13,
462,
1678,
10092,
29918,
3859,
29892,
13,
462,
1678,
15886,
29889,
29873,
488,
29898,
12071,
29918,
3859,
29892,
518,
29896,
29892,
1583,
3032,
7050,
29918,
6897,
29918,
19790,
29892,
29871,
29896,
11724,
13,
18884,
1723,
13,
13,
9651,
396,
1588,
27964,
10092,
29918,
3859,
29892,
3030,
515,
3517,
7546,
29892,
304,
1993,
278,
954,
310,
7573,
12428,
29881,
408,
297,
10970,
29961,
5563,
29962,
13,
9651,
10092,
29918,
3859,
353,
15886,
29889,
18337,
29898,
13,
18884,
10092,
29918,
3859,
29892,
13,
18884,
7431,
29898,
4703,
29889,
12181,
29889,
294,
29918,
1761,
3101,
334,
518,
29900,
1402,
13,
18884,
15886,
29889,
17685,
4197,
13264,
29889,
12181,
29898,
26290,
29918,
2080,
29879,
29897,
7503,
29906,
1402,
518,
29896,
20526,
448,
29896,
511,
13,
9651,
1723,
13,
9651,
3030,
353,
15886,
29889,
18337,
29898,
13,
18884,
3030,
29892,
13,
18884,
7431,
29898,
4703,
29889,
12181,
29889,
294,
29918,
1761,
3101,
334,
518,
29900,
1402,
13,
18884,
15886,
29889,
17685,
4197,
13264,
29889,
12181,
29898,
26290,
29918,
2080,
29879,
29897,
7503,
29906,
1402,
3030,
29889,
12181,
29889,
294,
29918,
1761,
580,
29961,
29906,
17531,
1402,
448,
29896,
511,
13,
9651,
1723,
13,
13,
9651,
396,
23924,
2579,
1218,
8820,
313,
361,
4944,
29897,
304,
278,
3030,
472,
278,
5970,
29899,
3242,
3233,
29889,
13,
9651,
565,
3233,
1275,
29871,
29900,
322,
8820,
338,
451,
6213,
29901,
13,
18884,
3030,
353,
15886,
29889,
17685,
4197,
4703,
29892,
8820,
1402,
9685,
10457,
29896,
29897,
13,
13,
9651,
396,
27747,
443,
1245,
310,
390,
10262,
3038,
29889,
13,
9651,
2847,
353,
1583,
29889,
3729,
29879,
29961,
5563,
1822,
9171,
29918,
449,
29918,
3859,
29898,
13264,
29889,
12181,
29898,
26290,
29918,
2080,
29879,
9601,
29900,
2314,
13,
9651,
565,
2847,
29918,
3859,
29961,
5563,
29962,
338,
451,
6213,
29901,
13,
18884,
2847,
3366,
3859,
3108,
353,
2847,
29918,
3859,
29961,
5563,
29962,
13,
9651,
313,
29886,
13479,
29892,
13446,
511,
13446,
29918,
4230,
29918,
10568,
353,
8492,
29889,
16192,
29898,
13,
18884,
1583,
29889,
3729,
29879,
29961,
5563,
1402,
13,
18884,
313,
26290,
29918,
2080,
29879,
29892,
3030,
29892,
10092,
29918,
3859,
511,
13,
18884,
671,
29918,
26739,
800,
29961,
5563,
1402,
13,
18884,
2847,
29892,
13,
9651,
1723,
13,
13,
9651,
1833,
29918,
3859,
29918,
497,
29918,
5563,
29879,
29889,
7851,
29898,
29900,
29892,
13446,
29918,
4230,
29918,
10568,
29897,
13,
9651,
3030,
353,
13446,
3366,
4905,
3108,
13,
13,
9651,
7536,
29918,
1761,
29889,
7851,
29898,
29900,
29892,
7536,
29897,
13,
9651,
13446,
29918,
1761,
29889,
7851,
29898,
29900,
29892,
13446,
29897,
13,
13,
9651,
396,
323,
6504,
3030,
491,
263,
7329,
310,
13128,
29918,
6897,
29918,
19790,
363,
671,
472,
278,
3233,
2400,
29889,
13,
9651,
565,
3233,
2804,
29871,
29900,
29901,
13,
18884,
3030,
353,
15886,
29889,
18837,
29918,
6229,
29879,
29898,
4703,
29892,
9685,
29922,
29906,
29897,
13,
18884,
3030,
353,
15886,
29889,
29873,
488,
29898,
13,
462,
1678,
3030,
29892,
13,
462,
1678,
518,
29896,
29892,
29871,
29896,
29892,
1583,
3032,
7050,
29918,
6897,
29918,
19790,
29962,
13,
462,
1678,
718,
313,
2435,
29898,
4703,
29889,
12181,
29889,
294,
29918,
1761,
3101,
448,
29871,
29941,
29897,
334,
518,
29896,
1402,
13,
18884,
1723,
13,
18884,
3030,
353,
15886,
29889,
690,
14443,
29898,
13,
462,
1678,
3030,
29892,
13,
462,
1678,
518,
13264,
29889,
12181,
29898,
4703,
9601,
29900,
1402,
15886,
29889,
17469,
29918,
10633,
29898,
13264,
29889,
12181,
29898,
4703,
9601,
29896,
29901,
29941,
2314,
29962,
13,
462,
1678,
718,
3030,
29889,
12181,
29889,
294,
29918,
1761,
580,
29961,
29941,
29901,
1402,
13,
18884,
1723,
13,
13,
9651,
10092,
29918,
3859,
353,
10092,
29918,
3859,
29918,
4622,
13,
4706,
1962,
29918,
7451,
29918,
5563,
353,
3030,
13,
13,
4706,
736,
1962,
29918,
7451,
29918,
5563,
29892,
1833,
29918,
3859,
29918,
497,
29918,
5563,
29879,
29892,
7536,
29918,
1761,
29892,
13446,
29918,
1761,
13,
13,
1678,
822,
1722,
29918,
7888,
29918,
348,
1245,
29898,
1311,
29892,
10970,
29892,
12893,
29918,
2435,
29892,
8820,
29922,
8516,
29892,
671,
29918,
26739,
800,
29922,
8516,
1125,
13,
4706,
565,
671,
29918,
26739,
800,
338,
6213,
29901,
13,
9651,
671,
29918,
26739,
800,
353,
1583,
3032,
5563,
29879,
334,
518,
5574,
29962,
13,
4706,
12893,
29918,
2435,
29918,
1627,
786,
353,
12893,
29918,
2435,
13,
4706,
758,
29918,
2080,
29879,
353,
5159,
13,
4706,
1400,
29918,
2080,
29879,
353,
5159,
13,
4706,
363,
301,
20901,
297,
3464,
29898,
1311,
3032,
5563,
29879,
1125,
13,
9651,
758,
29918,
2080,
29879,
29889,
4397,
29898,
2080,
29879,
29961,
29880,
20901,
3816,
29901,
29892,
584,
13073,
29918,
2435,
29892,
2023,
2314,
13,
9651,
1400,
29918,
2080,
29879,
29889,
4397,
29898,
13264,
29889,
3298,
359,
29918,
4561,
29898,
2080,
29879,
29961,
29880,
20901,
3816,
29901,
29892,
12893,
29918,
2435,
29901,
29892,
2023,
12622,
13,
9651,
12893,
29918,
2435,
353,
938,
29898,
13073,
29918,
2435,
847,
1583,
3032,
7050,
29918,
6897,
29918,
19790,
29897,
13,
4706,
12893,
29918,
2435,
353,
12893,
29918,
2435,
29918,
1627,
786,
13,
4706,
8820,
29918,
1457,
353,
8820,
29918,
2490,
353,
6213,
13,
4706,
565,
8820,
338,
451,
6213,
29901,
13,
9651,
8820,
29918,
1457,
353,
8820,
7503,
29892,
584,
13073,
29918,
2435,
29892,
584,
29962,
13,
9651,
8820,
29918,
2490,
353,
8820,
7503,
29892,
12893,
29918,
2435,
29901,
29892,
584,
29962,
13,
13,
4706,
313,
13,
9651,
17117,
13,
9651,
758,
29918,
4230,
29918,
3859,
29918,
497,
29918,
5563,
29879,
29892,
13,
9651,
758,
29918,
29886,
28739,
29892,
13,
9651,
758,
29918,
2490,
13613,
943,
29892,
13,
4706,
1723,
353,
1583,
29889,
29882,
631,
1279,
936,
29918,
348,
1245,
29898,
13,
9651,
758,
29918,
2080,
29879,
29892,
8820,
29922,
7387,
29918,
1457,
29892,
671,
29918,
26739,
800,
29922,
1509,
29918,
26739,
800,
13,
4706,
1723,
13,
4706,
17117,
17117,
1400,
29918,
29886,
28739,
29892,
903,
353,
1583,
29889,
29882,
631,
1279,
936,
29918,
348,
1245,
29898,
13,
9651,
1400,
29918,
2080,
29879,
29892,
13,
9651,
8820,
29922,
7387,
29918,
2490,
29892,
13,
9651,
671,
29918,
26739,
800,
29922,
1311,
3032,
5563,
29879,
334,
518,
8824,
1402,
13,
9651,
2847,
29918,
3859,
29922,
1457,
29918,
4230,
29918,
3859,
29918,
497,
29918,
5563,
29879,
29892,
13,
4706,
1723,
13,
13,
4706,
736,
758,
29918,
2490,
13613,
943,
29892,
758,
29918,
29886,
28739,
29892,
1400,
29918,
29886,
28739,
13,
13,
1678,
822,
903,
29887,
17019,
29918,
29968,
10249,
29898,
1311,
29892,
1320,
29896,
29892,
1320,
29906,
1125,
13,
4706,
9995,
13,
4706,
11796,
267,
476,
29931,
29898,
5721,
29896,
3830,
1320,
29906,
29897,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
1320,
29896,
584,
9657,
6943,
525,
12676,
29915,
322,
525,
4172,
3359,
29915,
363,
1773,
27432,
403,
4226,
18822,
13,
18884,
8267,
310,
2099,
29914,
4172,
3359,
29901,
313,
16175,
2159,
29892,
5335,
4196,
567,
29892,
518,
6229,
29896,
29892,
3964,
29906,
29892,
2023,
2314,
13,
9651,
1320,
29906,
584,
313,
17642,
408,
1320,
29896,
29897,
13,
4706,
9995,
13,
4706,
565,
7431,
29898,
5721,
29896,
3366,
12676,
16862,
12181,
29961,
29906,
29901,
2314,
1405,
29871,
29896,
29901,
13,
9651,
716,
29918,
12181,
353,
15886,
29889,
17685,
4197,
13264,
29889,
12181,
29898,
5721,
29896,
3366,
12676,
20068,
7503,
29906,
1402,
21069,
29896,
20526,
448,
29896,
29897,
13,
9651,
1320,
29896,
3366,
12676,
3108,
353,
15886,
29889,
690,
14443,
29898,
5721,
29896,
3366,
12676,
12436,
716,
29918,
12181,
29897,
13,
9651,
1320,
29896,
3366,
4172,
3359,
3108,
353,
15886,
29889,
690,
14443,
29898,
5721,
29896,
3366,
4172,
3359,
12436,
716,
29918,
12181,
29897,
13,
9651,
1320,
29906,
3366,
12676,
3108,
353,
15886,
29889,
690,
14443,
29898,
5721,
29906,
3366,
12676,
12436,
716,
29918,
12181,
29897,
13,
9651,
1320,
29906,
3366,
4172,
3359,
3108,
353,
15886,
29889,
690,
14443,
29898,
5721,
29906,
3366,
4172,
3359,
12436,
716,
29918,
12181,
29897,
13,
4706,
286,
18564,
29896,
353,
260,
11512,
29889,
6857,
27432,
403,
19077,
12130,
351,
29898,
2029,
29922,
5721,
29896,
3366,
12676,
12436,
6287,
29918,
6051,
351,
29922,
5721,
29896,
3366,
4172,
3359,
20068,
13,
4706,
286,
18564,
29906,
353,
260,
11512,
29889,
6857,
27432,
403,
19077,
12130,
351,
29898,
2029,
29922,
5721,
29906,
3366,
12676,
12436,
6287,
29918,
6051,
351,
29922,
5721,
29906,
3366,
4172,
3359,
20068,
13,
4706,
736,
286,
18564,
29896,
29889,
6321,
29918,
29881,
2147,
10238,
29898,
29885,
18564,
29906,
29897,
13,
13,
1678,
822,
903,
1188,
29918,
22795,
29918,
26290,
29898,
1311,
29892,
11916,
29892,
2099,
29892,
3659,
3359,
1125,
13,
4706,
9995,
13,
4706,
16969,
2070,
9027,
310,
11916,
297,
278,
2183,
4978,
13,
4706,
450,
1833,
3964,
310,
278,
11916,
338,
278,
697,
4586,
2533,
975,
29889,
13,
4706,
9995,
13,
4706,
565,
7431,
29898,
27736,
29889,
12181,
29961,
29906,
29901,
2314,
1405,
29871,
29896,
29901,
13,
9651,
716,
29918,
12181,
353,
15886,
29889,
17685,
4197,
13264,
29889,
12181,
29898,
27736,
29897,
7503,
29906,
1402,
21069,
29896,
20526,
448,
29896,
29897,
13,
9651,
11916,
353,
15886,
29889,
690,
14443,
29898,
27736,
29892,
716,
29918,
12181,
29897,
13,
9651,
2099,
353,
15886,
29889,
690,
14443,
29898,
12676,
29892,
716,
29918,
12181,
29897,
13,
9651,
565,
338,
8758,
29898,
4172,
3359,
29892,
15886,
29889,
29911,
6073,
1125,
13,
18884,
3659,
3359,
353,
15886,
29889,
690,
14443,
29898,
4172,
3359,
29892,
716,
29918,
12181,
29897,
13,
4706,
1320,
353,
260,
11512,
29889,
2568,
1022,
3906,
29898,
29873,
11512,
29889,
19077,
29898,
12676,
29892,
3659,
3359,
511,
337,
1639,
1457,
9446,
29918,
16175,
29918,
299,
9893,
29922,
29896,
29897,
13,
4706,
736,
1320,
29889,
1188,
29918,
22795,
29898,
27736,
29897,
13,
13,
1678,
822,
903,
9847,
29918,
5105,
29918,
5721,
29898,
1311,
29892,
1320,
1125,
13,
4706,
1320,
3366,
12676,
3108,
353,
15886,
29889,
9847,
29918,
24970,
29898,
5721,
3366,
12676,
20068,
13,
4706,
1320,
3366,
4172,
3359,
3108,
353,
15886,
29889,
9847,
29918,
24970,
29898,
5721,
3366,
4172,
3359,
20068,
13,
4706,
736,
1320,
13,
13,
1678,
822,
10272,
29918,
6758,
267,
29898,
13,
4706,
1583,
29892,
13,
4706,
20881,
29892,
13,
4706,
20881,
29918,
7099,
6797,
29892,
13,
4706,
3691,
943,
29892,
13,
4706,
10368,
18930,
29892,
13,
4706,
1602,
29918,
4172,
3359,
29922,
29900,
29889,
29896,
29892,
13,
4706,
9489,
29918,
5105,
29918,
2490,
29918,
546,
29883,
29922,
8516,
29892,
13,
4706,
3889,
29918,
27479,
29922,
8516,
29892,
13,
4706,
21762,
29922,
8516,
29892,
13,
268,
1125,
13,
4706,
9995,
13,
4706,
11796,
267,
14845,
8456,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
20881,
584,
15484,
7694,
13,
18884,
4250,
643,
1490,
4863,
13,
9651,
20881,
29918,
7099,
6797,
584,
323,
6073,
13,
18884,
3826,
6797,
4863,
13,
9651,
3691,
943,
584,
1051,
29961,
8977,
29962,
13,
18884,
1269,
9657,
8640,
278,
3691,
943,
472,
599,
5335,
4196,
567,
363,
263,
3153,
3233,
297,
278,
1904,
13,
9651,
10368,
18930,
584,
1051,
29961,
8977,
29962,
13,
18884,
1269,
9657,
8640,
278,
10368,
18930,
472,
599,
5335,
4196,
567,
363,
263,
3153,
3233,
297,
278,
1904,
13,
4706,
9995,
13,
4706,
302,
645,
29918,
8489,
353,
448,
1311,
3032,
1188,
29918,
22795,
29918,
26290,
29898,
26290,
29892,
20881,
29918,
7099,
6797,
29892,
1602,
29918,
4172,
3359,
29897,
29871,
396,
8267,
29901,
313,
29933,
29892,
29911,
29897,
13,
4706,
302,
645,
29918,
8489,
353,
15886,
29889,
17469,
29918,
12676,
29898,
13264,
29889,
17469,
29918,
2083,
29898,
29876,
645,
29918,
8489,
29892,
9685,
29922,
29896,
511,
29871,
29900,
29897,
13,
4706,
4974,
7431,
29898,
29876,
645,
29918,
8489,
29889,
12181,
29897,
1275,
29871,
29900,
29892,
302,
645,
29918,
8489,
29889,
12181,
13,
13,
4706,
396,
11796,
292,
476,
29931,
29879,
1546,
3691,
943,
322,
10368,
18930,
13,
4706,
1583,
29889,
29895,
430,
29918,
497,
29918,
5563,
29879,
353,
5159,
13,
4706,
9489,
29918,
8489,
353,
15886,
29889,
23362,
29898,
29900,
29889,
29900,
29897,
13,
4706,
363,
474,
297,
3464,
29898,
1311,
3032,
5563,
29879,
1125,
13,
9651,
413,
430,
29918,
5563,
353,
1583,
3032,
29887,
17019,
29918,
29968,
10249,
29898,
2490,
13613,
943,
29961,
29875,
1402,
3691,
943,
29961,
29875,
2314,
13,
9651,
565,
9489,
29918,
5105,
29918,
2490,
29918,
546,
29883,
338,
6213,
29901,
13,
18884,
413,
430,
29918,
5563,
29918,
7827,
353,
15886,
29889,
17469,
29918,
12676,
29898,
13264,
29889,
17469,
29918,
2083,
29898,
29895,
430,
29918,
5563,
29892,
9685,
29922,
29896,
876,
13,
9651,
1683,
29901,
13,
18884,
396,
317,
1052,
292,
16030,
1546,
7536,
322,
13446,
29889,
13,
18884,
413,
430,
29918,
5563,
29918,
29886,
353,
313,
29896,
448,
9489,
29918,
5105,
29918,
2490,
29918,
546,
29883,
29897,
334,
1583,
3032,
29887,
17019,
29918,
29968,
10249,
29898,
13,
462,
1678,
1583,
3032,
9847,
29918,
5105,
29918,
5721,
29898,
2490,
13613,
943,
29961,
29875,
11724,
3691,
943,
29961,
29875,
29962,
13,
18884,
1723,
29871,
396,
8267,
29901,
313,
29933,
29892,
29911,
29897,
13,
18884,
413,
430,
29918,
5563,
29918,
29939,
353,
9489,
29918,
5105,
29918,
2490,
29918,
546,
29883,
334,
1583,
3032,
29887,
17019,
29918,
29968,
10249,
29898,
13,
462,
1678,
10368,
18930,
29961,
29875,
1402,
1583,
3032,
9847,
29918,
5105,
29918,
5721,
29898,
29886,
28739,
29961,
29875,
2314,
13,
18884,
1723,
29871,
396,
8267,
29901,
313,
29933,
29892,
29911,
29897,
13,
18884,
413,
430,
29918,
5563,
29918,
7827,
29918,
29886,
353,
15886,
29889,
17469,
29918,
12676,
29898,
13264,
29889,
17469,
29918,
2083,
29898,
29895,
430,
29918,
5563,
29918,
29886,
29892,
9685,
29922,
29896,
876,
13,
18884,
413,
430,
29918,
5563,
29918,
7827,
29918,
29939,
353,
15886,
29889,
17469,
29918,
12676,
29898,
13264,
29889,
17469,
29918,
2083,
29898,
29895,
430,
29918,
5563,
29918,
29939,
29892,
9685,
29922,
29896,
876,
13,
18884,
396,
402,
4357,
29871,
29896,
3889,
14033,
304,
278,
13446,
29889,
13,
18884,
413,
430,
29918,
5563,
29918,
7827,
29918,
29939,
353,
15886,
29889,
27525,
398,
29898,
29896,
29889,
29900,
29892,
413,
430,
29918,
5563,
29918,
7827,
29918,
29939,
29897,
13,
18884,
413,
430,
29918,
5563,
29918,
7827,
353,
413,
430,
29918,
5563,
29918,
7827,
29918,
29886,
718,
413,
430,
29918,
5563,
29918,
7827,
29918,
29939,
13,
13,
9651,
565,
3889,
29918,
27479,
338,
6213,
29901,
13,
18884,
565,
21762,
338,
6213,
29901,
13,
462,
1678,
9489,
29918,
8489,
4619,
413,
430,
29918,
5563,
29918,
7827,
13,
18884,
1683,
29901,
13,
462,
1678,
565,
338,
8758,
29898,
3571,
29892,
1051,
1125,
13,
462,
4706,
9489,
29918,
8489,
4619,
21762,
29961,
29875,
29962,
334,
413,
430,
29918,
5563,
29918,
7827,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
9489,
29918,
8489,
4619,
21762,
334,
413,
430,
29918,
5563,
29918,
7827,
13,
9651,
1683,
29901,
13,
18884,
565,
21762,
338,
6213,
29901,
13,
462,
1678,
9489,
29918,
8489,
4619,
15886,
29889,
27525,
398,
29898,
29900,
29889,
29900,
29892,
413,
430,
29918,
5563,
29918,
7827,
448,
3889,
29918,
27479,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
565,
338,
8758,
29898,
3571,
29892,
1051,
1125,
13,
462,
4706,
9489,
29918,
8489,
4619,
21762,
29961,
29875,
29962,
334,
15886,
29889,
27525,
398,
29898,
13,
462,
632,
29900,
29889,
29900,
29892,
413,
430,
29918,
5563,
29918,
7827,
448,
3889,
29918,
27479,
13,
462,
4706,
1723,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
9489,
29918,
8489,
4619,
21762,
334,
15886,
29889,
27525,
398,
29898,
29900,
29889,
29900,
29892,
413,
430,
29918,
5563,
29918,
7827,
448,
3889,
29918,
27479,
29897,
13,
9651,
1583,
29889,
29895,
430,
29918,
497,
29918,
5563,
29879,
29889,
7851,
29898,
29875,
29892,
413,
430,
29918,
5563,
29897,
13,
13,
4706,
3480,
29918,
295,
833,
353,
302,
645,
29918,
8489,
718,
9489,
29918,
8489,
13,
13,
4706,
954,
29918,
9346,
4196,
567,
29918,
26290,
353,
15886,
29889,
4384,
29898,
13264,
29889,
12181,
29898,
26290,
9601,
29896,
1402,
15886,
29889,
7411,
29941,
29906,
29897,
13,
4706,
1583,
29889,
6758,
353,
3480,
29918,
295,
833,
847,
954,
29918,
9346,
4196,
567,
29918,
26290,
13,
4706,
1583,
3032,
6321,
29918,
8489,
353,
9489,
29918,
8489,
847,
954,
29918,
9346,
4196,
567,
29918,
26290,
13,
4706,
1583,
3032,
29876,
645,
29918,
8489,
353,
302,
645,
29918,
8489,
847,
954,
29918,
9346,
4196,
567,
29918,
26290,
13,
13,
4706,
736,
1583,
29889,
6758,
13,
13,
13,
1753,
2048,
29918,
4299,
29898,
16859,
29892,
1722,
29918,
7888,
29922,
5574,
1125,
13,
1678,
20881,
353,
15886,
29889,
27074,
29898,
13264,
29889,
7411,
29941,
29906,
29892,
518,
8516,
29892,
6213,
29892,
29871,
29953,
29946,
29892,
29871,
29953,
29946,
29892,
274,
16434,
29889,
305,
12629,
1402,
1024,
543,
26290,
1159,
13,
1678,
2094,
6119,
353,
274,
29876,
1983,
29889,
8566,
6119,
29898,
13,
4706,
274,
16434,
29889,
5563,
29879,
29892,
13,
4706,
274,
16434,
29889,
7050,
29918,
6897,
29918,
19790,
29892,
13,
4706,
20619,
29918,
29277,
29922,
16859,
29889,
3977,
29918,
1145,
344,
29918,
29277,
29892,
13,
4706,
8297,
29918,
2311,
29922,
16859,
29889,
3977,
29918,
1145,
344,
29918,
17987,
29918,
2311,
29892,
13,
4706,
18196,
29918,
4713,
29922,
16859,
29889,
305,
12629,
29918,
4713,
29892,
13,
1678,
1723,
13,
1678,
1602,
6119,
353,
274,
29876,
1983,
29889,
6185,
6119,
29898,
16859,
29889,
305,
12629,
29892,
18196,
29918,
4713,
29922,
16859,
29889,
305,
12629,
29918,
4713,
29897,
13,
1678,
20881,
29918,
26716,
353,
2094,
6119,
29898,
26290,
29897,
13,
1678,
1904,
353,
315,
29956,
29963,
16036,
29898,
13,
4706,
274,
16434,
29889,
5563,
29879,
29892,
13,
4706,
274,
16434,
29889,
7050,
29918,
6897,
29918,
19790,
29892,
13,
4706,
9657,
29898,
303,
2878,
29922,
16859,
29889,
3729,
29918,
303,
2878,
29918,
2311,
29892,
270,
1308,
29922,
16859,
29889,
3729,
29918,
29881,
1308,
29918,
2311,
511,
13,
4706,
274,
16434,
29889,
3729,
29918,
17987,
29918,
2311,
29892,
13,
4706,
274,
16434,
29889,
3729,
29918,
1853,
29892,
13,
4706,
274,
16434,
29889,
29212,
29892,
13,
4706,
274,
16434,
29889,
3729,
29918,
1195,
29918,
4172,
3359,
29892,
13,
4706,
2099,
29918,
6194,
29918,
3729,
29922,
16859,
29889,
3729,
29918,
12676,
29918,
6194,
29892,
13,
4706,
10092,
29918,
28631,
29922,
16859,
29889,
3729,
29918,
12071,
29918,
3859,
29892,
13,
1678,
1723,
13,
1678,
14391,
29918,
7451,
29892,
17117,
3691,
943,
29892,
10368,
18930,
353,
1904,
29889,
29882,
631,
1279,
936,
29918,
348,
1245,
29898,
26290,
29918,
26716,
29897,
13,
1678,
20881,
29918,
7099,
6797,
353,
1602,
6119,
29898,
4905,
29879,
29918,
7451,
29897,
13,
1678,
6410,
353,
1904,
29889,
26017,
29918,
6758,
267,
29898,
13,
4706,
20881,
29892,
13,
4706,
20881,
29918,
7099,
6797,
29892,
13,
4706,
3691,
943,
29892,
13,
4706,
10368,
18930,
29892,
13,
4706,
1602,
29918,
4172,
3359,
29922,
16859,
29889,
7099,
29918,
4172,
3359,
29892,
13,
4706,
9489,
29918,
5105,
29918,
2490,
29918,
546,
29883,
29922,
16859,
29889,
6321,
29918,
5105,
29918,
2490,
29918,
546,
29883,
29892,
13,
4706,
3889,
29918,
27479,
29922,
16859,
29889,
9021,
29918,
27479,
29892,
13,
4706,
21762,
29922,
16859,
29889,
3571,
29892,
13,
1678,
1723,
13,
1678,
714,
353,
9657,
29898,
26495,
29922,
8977,
29898,
26290,
29922,
26290,
29892,
2094,
6119,
29922,
3977,
6119,
29892,
1602,
6119,
29922,
7099,
6119,
29892,
13,
462,
632,
20881,
29918,
26716,
29922,
26290,
29918,
26716,
29892,
20881,
29918,
7099,
6797,
29922,
26290,
29918,
7099,
6797,
29892,
13,
462,
632,
3691,
943,
29922,
29886,
28739,
29892,
10368,
18930,
29922,
2490,
13613,
943,
29892,
6410,
29922,
6758,
511,
13,
1669,
12700,
3790,
29908,
4299,
1115,
1904,
1800,
13,
1678,
565,
1722,
29918,
7888,
29901,
13,
4706,
10368,
18930,
29918,
276,
535,
29892,
3691,
943,
29918,
265,
342,
1022,
29892,
3691,
943,
29918,
4713,
2488,
29886,
353,
1904,
29889,
3150,
29918,
7888,
29918,
348,
1245,
29898,
13,
9651,
20881,
29918,
26716,
29892,
274,
16434,
29889,
3150,
29918,
7888,
29918,
13073,
29892,
671,
29918,
26739,
800,
29922,
16859,
29889,
1509,
29918,
26290,
13,
4706,
1723,
13,
4706,
20881,
29918,
7099,
6797,
29918,
2490,
261,
1611,
29918,
276,
535,
353,
1602,
6119,
29898,
2490,
13613,
943,
29918,
276,
535,
29961,
29900,
29962,
3366,
4905,
20068,
13,
4706,
20881,
29918,
7099,
6797,
29918,
29886,
13479,
29918,
265,
342,
1022,
353,
1602,
6119,
29898,
29886,
28739,
29918,
265,
342,
1022,
29961,
29900,
29962,
3366,
4905,
20068,
13,
4706,
20881,
29918,
7099,
6797,
29918,
29886,
13479,
29918,
4713,
2488,
29886,
353,
1602,
6119,
29898,
29886,
28739,
29918,
4713,
2488,
29886,
29961,
29900,
29962,
3366,
4905,
20068,
13,
4706,
330,
29873,
29918,
4713,
2488,
29886,
353,
20881,
7503,
29892,
274,
16434,
29889,
3150,
29918,
7888,
29918,
13073,
584,
29892,
2023,
29962,
13,
4706,
714,
29889,
5504,
29898,
13,
9651,
9657,
29898,
3150,
29918,
7888,
29918,
26290,
29918,
7099,
6797,
29922,
8977,
29898,
13,
18884,
13446,
29918,
276,
535,
29922,
26290,
29918,
7099,
6797,
29918,
2490,
261,
1611,
29918,
276,
535,
29892,
13,
18884,
7536,
29918,
265,
342,
1022,
29922,
26290,
29918,
7099,
6797,
29918,
29886,
13479,
29918,
265,
342,
1022,
29892,
13,
18884,
7536,
29918,
4713,
2488,
29886,
29922,
26290,
29918,
7099,
6797,
29918,
29886,
13479,
29918,
4713,
2488,
29886,
29892,
13,
18884,
330,
29873,
29918,
4713,
2488,
29886,
29922,
4141,
29918,
4713,
2488,
29886,
876,
13,
4706,
1723,
13,
1678,
736,
714,
13,
2
] |
app.py | varshithrajbasa/RetailBanking | 0 | 70964 | from flask import Flask, render_template, request,redirect, url_for,session
from flask_mysqldb import MySQL
app = Flask(__name__)
app.secret_key = "<KEY>"
app.config['MYSQL_HOST'] = 'localhost'
app.config['MYSQL_USER'] = 'root'
app.config['MYSQL_PASSWORD'] = '<PASSWORD>'
app.config['MYSQL_DB'] = 'retailbanking'
mysql = MySQL(app)
@app.route('/', methods=['post', 'get'])
def login():
message = ''
if request.method == 'POST':
username = request.form.get('uname') # access the data inside
password = request.form.get('password')
cur = mysql.connection.cursor()
cur.execute('SELECT * FROM userstore WHERE login = %s AND password = %s', (username, password,))
results = cur.fetchall()
if results:
session['username'] = username
return redirect(url_for('create_customer'))
else:
message = "Wrong username or password"
mysql.connection.commit()
cur.close()
return render_template('login.html', message=message)
@app.route('/create_customer', methods=['post', 'get'])
def create_customer():
if session=={}:
return redirect(url_for('login'))
message=""
if request.method == 'POST':
ssn_id=int(request.form.get('ssn-id'))
cust_id=int(request.form.get('cust-id'))
cname=request.form.get('cname')
c_age=int(request.form.get('cage'))
address=request.form.get('address')
city=request.form.get('secondlist')
state=request.form.get('listBox')
if(mysql):
cursor= mysql.connection.cursor()
#cursor.execute("select * from customer")
cursor.execute('''INSERT INTO customer(ws_ssn, ws_cust_id, ws_name, ws_age, ws_adrs, city, state) values(%s, %s, %s, %s, %s, %s, %s)''',(ssn_id,cust_id,cname,c_age,address,city,state))
mysql.connection.commit()
message="Done"
else:
message = "Error"
return render_template('create_customer.html',message=message)
@app.route('/view_customer')
def users():
if session=={}:
return redirect(url_for('login'))
cur = mysql.connection.cursor()
resultValue = cur.execute("SELECT * FROM customer")
if resultValue > 0:
userDetails = cur.fetchall()
return render_template('view_customer.html',userDetails=userDetails)
@app.route('/update_customer',methods=['post', 'get'])
def update_customer():
if session=={}:
return redirect(url_for('login'))
id=int(request.form.get('id'))
cur = mysql.connection.cursor()
resultValue = cur.execute("select * from customer where ws_ssn = %s",(id,))
if resultValue > 0:
userDetails = cur.fetchall()
return render_template('update_customer.html',userDetails=userDetails)
@app.route('/update',methods=['post', 'get'])
def update():
if session=={}:
return redirect(url_for('login'))
id=int(request.form.get('id'))
cname=request.form.get('cname')
address=request.form.get('address')
c_age=int(request.form.get('cage'))
cur = mysql.connection.cursor()
cur.execute('''UPDATE customer Set ws_age= %s ,ws_adrs= %s,ws_name= %s where ws_ssn= %s''',(c_age,address,cname,id))
mysql.connection.commit()
return redirect(url_for('users'))
@app.route('/view_customer2')
def users1():
if session=={}:
return redirect(url_for('login'))
cur = mysql.connection.cursor()
resultValue = cur.execute("SELECT * FROM customer")
if resultValue > 0:
userDetails = cur.fetchall()
return render_template('view_customer2.html',userDetails=userDetails)
@app.route('/delete_customer',methods=['post', 'get'])
def delete_customer():
if session=={}:
return redirect(url_for('login'))
id=int(request.form.get('id'))
cur = mysql.connection.cursor()
resultValue = cur.execute("select * from customer where ws_ssn = %s",(id,))
if resultValue > 0:
userDetails = cur.fetchall()
return render_template('delete_customer.html',userDetails=userDetails)
@app.route('/delete',methods=['post', 'get'])
def delete():
if session=={}:
return redirect(url_for('login'))
id=int(request.form.get('id'))
cur = mysql.connection.cursor()
cur.execute('''delete from customer where ws_ssn= %s''',(id,))
mysql.connection.commit()
return redirect(url_for('users'))
#For accounts
@app.route('/create_a')
def create_a():
if session=={}:
return redirect(url_for('login'))
return render_template('create_account.html')
@app.route('/create_account', methods=['post', 'get'])
def create_account():
if session=={}:
return redirect(url_for('login'))
message=""
id=int(request.form.get('cust-id'))
a_type=request.form.get('account_type')
print(a_type)
balance=request.form.get('deposit_amount')
today = date.today()
cur = mysql.connection.cursor()
cur.execute('''select * from customer where ws_cust_id= %s''',(id,))
result_value=cur.fetchall()
if result_value:
account_id=result_value[0][0]
cur.execute('''INSERT INTO `retailbanking`.`account` (`ws_cust_id` ,`ws_acct_id` ,`ws_acct_type` ,`ws_acct_balance` ,`ws_acct_crdate` ) VALUES (%s, %s, %s, %s, %s)''',(id,account_id,a_type,balance,today,))
mysql.connection.commit()
message="Account created"
return render_template('create_account.html',message=message)
@app.route('/delete_account')
def delete_account():
if session=={}:
return redirect(url_for('login'))
cur = mysql.connection.cursor()
resultValue = cur.execute("SELECT * FROM account")
if resultValue > 0:
userDetails = cur.fetchall()
return render_template('delete_account.html',accountDetails=userDetails)
@app.route('/delete_a', methods=['post', 'get'])
def delete_a():
if session=={}:
return redirect(url_for('login'))
account_id=int(request.form.get('account_id'))
account_type=request.form.get('account_type')
cur = mysql.connection.cursor()
cur.execute('''select * from account where ws_acct_type= %s && ws_acct_id= %s''',(account_type,account_id,))
result_value=cur.fetchall()
print(result_value)
if result_value:
cur.execute('''delete from account where ws_acct_id= %s''',(account_id,))
mysql.connection.commit()
return redirect(url_for('delete_account'))
#For Cashier
@app.route('/account_details')
def account_details():
if session=={}:
return redirect(url_for('login'))
return render_template('account_details.html')
@app.route('/account_details')
def account_details():
if session=={}:
return redirect(url_for('login'))
cur = mysql.connection.cursor()
resultValue = cur.execute("SELECT * FROM account")
if resultValue > 0:
userDetails = cur.fetchall()
return render_template('account_holders.html',userDetails=userDetails)
@app.route('/deposit_amount', methods=['post', 'get'])
def deposit_amount():
if session=={}:
return redirect(url_for('login'))
id=request.form.get('id')
print(id)
cur = mysql.connection.cursor()
resultValue = cur.execute("select * from account where ws_cust_id = %s",(id,))
if resultValue > 0:
users = cur.fetchall()
return render_template('deposit_money.html',user=users)
@app.route('/deposit',methods=['post','get'])
def deposit():
if session=={}:
return redirect(url_for('login'))
message=""
id=int(request.form.get('id'))
amount=int(request.form.get('deposit'))
cur = mysql.connection.cursor()
cur.execute("update account set ws_acct_balance=ws_acct_balance+cast(%s as decimal(16,2)) where ws_cust_id= %s",(amount,id,))
mysql.connection.commit()
resultValue = cur.execute("select * from account where ws_cust_id = %s",(id,))
if resultValue > 0:
userDetails = cur.fetchall()
message="Amount deposited successfully"
today = date.today()
a_type=userDetails[0][2]
balance=int(request.form.get('deposit'))
cur.execute('''INSERT INTO `retailbanking`.`transactions` (`ws_cust_id` ,`ws_accnt_type` ,`ws_amt` ,`ws_trxn_date` ,`ws_src_typ` ,`ws_tgt_typ`)VALUES (%s, %s, %s, %s , %s , %s);''',(id,a_type,balance,today,a_type,a_type))
mysql.connection.commit()
return render_template('deposit_money.html',user=userDetails,message=message)
#for transfer
@app.route("/transfer", methods=['post', 'get'])
def transfer():
if session=={}:
return redirect(url_for('login'))
return render_template("transfer_money.html")
@app.route("/transfer_amount", methods=['post', 'get'])
def transfer_amount():
if session=={}:
return redirect(url_for('login'))
cust_id=int(request.form.get('id'))
print(cust_id)
tran_id=int(request.form.get('transfer_id'))
amount=int(request.form.get('transfer'))
cur = mysql.connection.cursor()
result=cur.execute('''select * from account where ws_cust_id= %s''',(cust_id,))
cust=cur.fetchall()
result1=cur.execute('''select * from account where ws_cust_id= %s''',(tran_id,))
trans=cur.fetchall()
today = date.today()
if result > 0:
if result1 > 0:
cust_after=cust[0][3]-amount
print(trans)
trans_after=trans[0][3]+amount
cur.execute('''update account set ws_acct_balance=%s where ws_cust_id=%s''',(cust_after,cust_id,))
mysql.connection.commit()
cur.execute('''update account set ws_acct_balance=%s where ws_cust_id=%s''',(trans_after,tran_id,))
mysql.connection.commit()
type1=cust[0][2]
cur.execute('''INSERT INTO `retailbanking`.`transactions` (`ws_cust_id` ,`ws_accnt_type` ,`ws_amt` ,`ws_trxn_date` ,`ws_src_typ` ,`ws_tgt_typ`)VALUES (%s, %s, %s, %s , %s , %s);''',(cust_id,type1,amount,today,type1,type1))
mysql.connection.commit()
type2=trans[0][2]
cur.execute('''INSERT INTO `retailbanking`.`transactions` (`ws_cust_id` ,`ws_accnt_type` ,`ws_amt` ,`ws_trxn_date` ,`ws_src_typ` ,`ws_tgt_typ`)VALUES (%s, %s, %s, %s , %s , %s);''',(tran_id,type2,amount,today,type2,type2))
mysql.connection.commit()
message="Amount transfer completed successfully"
return render_template('transfer_Details.html',message=message,cust=cust,trans=trans,cust_after=cust_after,trans_after=trans_after)
else:
message="Enter correct Target ID"
else:
message="Enter correct Customer ID"
return render_template("transfer_money.html",message=message)
#for logout
@app.route('/logout',methods=['post','get'])
def logout():
if session=={}:
return redirect(url_for('login'))
session.pop('username', None)
print(session)
return redirect(url_for('login'))
#for customer search
@app.route('/csearch',methods=['post','get'])
def csearch():
return render_template('customer_search.html')
@app.route('/customersearch',methods=['post','get'])
def customersearch():
cust_id=request.form.get('cust-id')
ssn_id=request.form.get('ssn-id')
cur = mysql.connection.cursor()
result=cur.execute('''select * from customer where ws_cust_id= %s or ws_ssn=%s''',(cust_id,ssn_id))
if result>0:
sample=cur.fetchall()
return render_template('customer_detail.html',sample=sample) | [
1,
515,
29784,
1053,
2379,
1278,
29892,
4050,
29918,
6886,
29892,
2009,
29892,
17886,
29892,
3142,
29918,
1454,
29892,
7924,
30004,
13,
3166,
29784,
29918,
19268,
430,
29890,
1053,
9254,
6756,
13,
30004,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
8443,
13,
932,
29889,
19024,
29918,
1989,
353,
9872,
10818,
11903,
30004,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
20832,
2033,
353,
525,
7640,
29915,
30004,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
11889,
2033,
353,
525,
4632,
29915,
30004,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
25711,
17013,
2033,
353,
12801,
25711,
17013,
16299,
30004,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
4051,
2033,
353,
525,
2267,
737,
9157,
292,
29915,
30004,
13,
7938,
353,
9254,
29898,
932,
8443,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
742,
3519,
29922,
1839,
2490,
742,
525,
657,
2033,
8443,
13,
1753,
6464,
7295,
30004,
13,
1678,
2643,
353,
6629,
30004,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
30004,
13,
4706,
8952,
353,
2009,
29889,
689,
29889,
657,
877,
348,
420,
1495,
29871,
396,
2130,
278,
848,
2768,
6756,
13,
4706,
4800,
353,
2009,
29889,
689,
29889,
657,
877,
5630,
1495,
30004,
13,
4706,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
4706,
3151,
29889,
7978,
877,
6404,
334,
3895,
1404,
8899,
5754,
6464,
353,
1273,
29879,
5300,
4800,
353,
1273,
29879,
742,
313,
6786,
29892,
4800,
29892,
876,
30004,
13,
4706,
2582,
353,
3151,
29889,
9155,
497,
26471,
13,
4706,
565,
2582,
29901,
30004,
13,
9651,
4867,
1839,
6786,
2033,
353,
8952,
30004,
13,
9651,
736,
6684,
29898,
2271,
29918,
1454,
877,
3258,
29918,
15539,
8785,
30004,
13,
4706,
1683,
29901,
30004,
13,
9651,
2643,
353,
376,
29956,
29373,
8952,
470,
4800,
19451,
13,
4706,
5749,
29889,
9965,
29889,
15060,
26471,
13,
4706,
3151,
29889,
5358,
26471,
13,
6756,
13,
1678,
736,
4050,
29918,
6886,
877,
7507,
29889,
1420,
742,
2643,
29922,
4906,
8443,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
3258,
29918,
15539,
742,
3519,
29922,
1839,
2490,
742,
525,
657,
2033,
8443,
13,
1753,
1653,
29918,
15539,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
2643,
13776,
30004,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
30004,
13,
4706,
269,
16586,
29918,
333,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
893,
29876,
29899,
333,
8785,
30004,
13,
4706,
25387,
29918,
333,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
29883,
504,
29899,
333,
8785,
30004,
13,
4706,
274,
978,
29922,
3827,
29889,
689,
29889,
657,
877,
29883,
978,
1495,
30004,
13,
4706,
274,
29918,
482,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
29883,
482,
8785,
30004,
13,
4706,
3211,
29922,
3827,
29889,
689,
29889,
657,
877,
7328,
1495,
30004,
13,
4706,
4272,
29922,
3827,
29889,
689,
29889,
657,
877,
7496,
1761,
1495,
30004,
13,
4706,
2106,
29922,
3827,
29889,
689,
29889,
657,
877,
1761,
3313,
1495,
30004,
13,
4706,
565,
29898,
7938,
1125,
30004,
13,
9651,
10677,
29922,
5749,
29889,
9965,
29889,
18127,
26471,
13,
9651,
396,
18127,
29889,
7978,
703,
2622,
334,
515,
11962,
1159,
30004,
13,
9651,
10677,
29889,
7978,
877,
4907,
19460,
11646,
11962,
29898,
5652,
29918,
893,
29876,
29892,
16904,
29918,
29883,
504,
29918,
333,
29892,
16904,
29918,
978,
29892,
16904,
29918,
482,
29892,
16904,
29918,
328,
2288,
29892,
4272,
29892,
2106,
29897,
1819,
29414,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29897,
4907,
742,
29898,
893,
29876,
29918,
333,
29892,
29883,
504,
29918,
333,
29892,
29883,
978,
29892,
29883,
29918,
482,
29892,
7328,
29892,
12690,
29892,
3859,
876,
30004,
13,
9651,
5749,
29889,
9965,
29889,
15060,
26471,
13,
9651,
2643,
543,
25632,
19451,
13,
4706,
1683,
29901,
30004,
13,
9651,
2643,
353,
376,
2392,
19451,
13,
1678,
736,
4050,
29918,
6886,
877,
3258,
29918,
15539,
29889,
1420,
742,
4906,
29922,
4906,
8443,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
1493,
29918,
15539,
1495,
30004,
13,
1753,
4160,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
1121,
1917,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
11962,
1159,
30004,
13,
1678,
565,
1121,
1917,
1405,
29871,
29900,
29901,
30004,
13,
4706,
1404,
10602,
353,
3151,
29889,
9155,
497,
26471,
13,
4706,
736,
4050,
29918,
6886,
877,
1493,
29918,
15539,
29889,
1420,
742,
1792,
10602,
29922,
1792,
10602,
8443,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
5504,
29918,
15539,
742,
23515,
29922,
1839,
2490,
742,
525,
657,
2033,
8443,
13,
1753,
2767,
29918,
15539,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
1178,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
333,
8785,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
1121,
1917,
353,
3151,
29889,
7978,
703,
2622,
334,
515,
11962,
988,
16904,
29918,
893,
29876,
353,
1273,
29879,
613,
29898,
333,
29892,
876,
30004,
13,
1678,
565,
1121,
1917,
1405,
29871,
29900,
29901,
30004,
13,
4706,
1404,
10602,
353,
3151,
29889,
9155,
497,
26471,
13,
4706,
736,
4050,
29918,
6886,
877,
5504,
29918,
15539,
29889,
1420,
742,
1792,
10602,
29922,
1792,
10602,
8443,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
5504,
742,
23515,
29922,
1839,
2490,
742,
525,
657,
2033,
8443,
13,
1753,
2767,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
1178,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
333,
8785,
30004,
13,
1678,
274,
978,
29922,
3827,
29889,
689,
29889,
657,
877,
29883,
978,
1495,
30004,
13,
1678,
3211,
29922,
3827,
29889,
689,
29889,
657,
877,
7328,
1495,
30004,
13,
1678,
274,
29918,
482,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
29883,
482,
8785,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
3151,
29889,
7978,
877,
4907,
14474,
29871,
11962,
3789,
16904,
29918,
482,
29922,
1273,
29879,
1919,
5652,
29918,
328,
2288,
29922,
1273,
29879,
29892,
5652,
29918,
978,
29922,
1273,
29879,
988,
16904,
29918,
893,
29876,
29922,
1273,
29879,
4907,
742,
29898,
29883,
29918,
482,
29892,
7328,
29892,
29883,
978,
29892,
333,
876,
30004,
13,
1678,
5749,
29889,
9965,
29889,
15060,
26471,
13,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
7193,
8785,
30004,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
1493,
29918,
15539,
29906,
1495,
30004,
13,
1753,
4160,
29896,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
1121,
1917,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
11962,
1159,
30004,
13,
1678,
565,
1121,
1917,
1405,
29871,
29900,
29901,
30004,
13,
4706,
1404,
10602,
353,
3151,
29889,
9155,
497,
26471,
13,
4706,
736,
4050,
29918,
6886,
877,
1493,
29918,
15539,
29906,
29889,
1420,
742,
1792,
10602,
29922,
1792,
10602,
8443,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
8143,
29918,
15539,
742,
23515,
29922,
1839,
2490,
742,
525,
657,
2033,
8443,
13,
1753,
5217,
29918,
15539,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
1178,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
333,
8785,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
1121,
1917,
353,
3151,
29889,
7978,
703,
2622,
334,
515,
11962,
988,
16904,
29918,
893,
29876,
353,
1273,
29879,
613,
29898,
333,
29892,
876,
30004,
13,
1678,
565,
1121,
1917,
1405,
29871,
29900,
29901,
30004,
13,
4706,
1404,
10602,
353,
3151,
29889,
9155,
497,
26471,
13,
4706,
736,
4050,
29918,
6886,
877,
8143,
29918,
15539,
29889,
1420,
742,
1792,
10602,
29922,
1792,
10602,
8443,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
8143,
742,
23515,
29922,
1839,
2490,
742,
525,
657,
2033,
8443,
13,
1753,
5217,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
1178,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
333,
8785,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
3151,
29889,
7978,
877,
4907,
8143,
515,
11962,
29871,
988,
16904,
29918,
893,
29876,
29922,
1273,
29879,
4907,
742,
29898,
333,
29892,
876,
30004,
13,
1678,
5749,
29889,
9965,
29889,
15060,
26471,
13,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
7193,
8785,
30004,
13,
30004,
13,
29937,
2831,
15303,
30004,
13,
29992,
932,
29889,
13134,
11219,
3258,
29918,
29874,
1495,
30004,
13,
1753,
1653,
29918,
29874,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
736,
4050,
29918,
6886,
877,
3258,
29918,
10149,
29889,
1420,
1495,
30004,
13,
29992,
932,
29889,
13134,
11219,
3258,
29918,
10149,
742,
3519,
29922,
1839,
2490,
742,
525,
657,
2033,
8443,
13,
1753,
1653,
29918,
10149,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
2643,
13776,
30004,
13,
1678,
1178,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
29883,
504,
29899,
333,
8785,
30004,
13,
1678,
263,
29918,
1853,
29922,
3827,
29889,
689,
29889,
657,
877,
10149,
29918,
1853,
1495,
30004,
13,
1678,
1596,
29898,
29874,
29918,
1853,
8443,
13,
1678,
17346,
29922,
3827,
29889,
689,
29889,
657,
877,
311,
1066,
277,
29918,
14506,
1495,
30004,
13,
1678,
9826,
353,
2635,
29889,
27765,
26471,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
3151,
29889,
7978,
877,
4907,
2622,
334,
515,
11962,
988,
16904,
29918,
29883,
504,
29918,
333,
29922,
1273,
29879,
4907,
742,
29898,
333,
29892,
876,
30004,
13,
1678,
1121,
29918,
1767,
29922,
2764,
29889,
9155,
497,
26471,
13,
1678,
565,
1121,
29918,
1767,
29901,
30004,
13,
4706,
3633,
29918,
333,
29922,
2914,
29918,
1767,
29961,
29900,
3816,
29900,
29962,
30004,
13,
4706,
3151,
29889,
7978,
877,
4907,
19460,
11646,
421,
2267,
737,
9157,
292,
27870,
10149,
29952,
6695,
5652,
29918,
29883,
504,
29918,
333,
29952,
1919,
29952,
5652,
29918,
562,
312,
29918,
333,
29952,
1919,
29952,
5652,
29918,
562,
312,
29918,
1853,
29952,
1919,
29952,
5652,
29918,
562,
312,
29918,
5521,
749,
29952,
1919,
29952,
5652,
29918,
562,
312,
29918,
7283,
1256,
29952,
1723,
15673,
313,
29995,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29897,
4907,
742,
29898,
333,
29892,
10149,
29918,
333,
29892,
29874,
29918,
1853,
29892,
5521,
749,
29892,
27765,
29892,
876,
30004,
13,
4706,
5749,
29889,
9965,
29889,
15060,
26471,
13,
4706,
2643,
543,
10601,
2825,
19451,
13,
1678,
736,
4050,
29918,
6886,
877,
3258,
29918,
10149,
29889,
1420,
742,
4906,
29922,
4906,
8443,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
8143,
29918,
10149,
1495,
30004,
13,
1753,
5217,
29918,
10149,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
1121,
1917,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
3633,
1159,
30004,
13,
1678,
565,
1121,
1917,
1405,
29871,
29900,
29901,
30004,
13,
4706,
1404,
10602,
353,
3151,
29889,
9155,
497,
26471,
13,
1678,
736,
4050,
29918,
6886,
877,
8143,
29918,
10149,
29889,
1420,
742,
10149,
10602,
29922,
1792,
10602,
8443,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
8143,
29918,
29874,
742,
3519,
29922,
1839,
2490,
742,
525,
657,
2033,
8443,
13,
1753,
5217,
29918,
29874,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
3633,
29918,
333,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
10149,
29918,
333,
8785,
30004,
13,
1678,
3633,
29918,
1853,
29922,
3827,
29889,
689,
29889,
657,
877,
10149,
29918,
1853,
1495,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
3151,
29889,
7978,
877,
4907,
2622,
334,
515,
3633,
988,
16904,
29918,
562,
312,
29918,
1853,
29922,
1273,
29879,
2607,
16904,
29918,
562,
312,
29918,
333,
29922,
1273,
29879,
4907,
742,
29898,
10149,
29918,
1853,
29892,
10149,
29918,
333,
29892,
876,
30004,
13,
1678,
1121,
29918,
1767,
29922,
2764,
29889,
9155,
497,
26471,
13,
1678,
1596,
29898,
2914,
29918,
1767,
8443,
13,
1678,
565,
1121,
29918,
1767,
29901,
30004,
13,
4706,
3151,
29889,
7978,
877,
4907,
8143,
515,
3633,
988,
16904,
29918,
562,
312,
29918,
333,
29922,
1273,
29879,
4907,
742,
29898,
10149,
29918,
333,
29892,
876,
30004,
13,
4706,
5749,
29889,
9965,
29889,
15060,
26471,
13,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
8143,
29918,
10149,
8785,
30004,
13,
1678,
6756,
13,
29937,
2831,
315,
1161,
631,
30004,
13,
29992,
932,
29889,
13134,
11219,
10149,
29918,
14144,
1495,
30004,
13,
1753,
3633,
29918,
14144,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
736,
4050,
29918,
6886,
877,
10149,
29918,
14144,
29889,
1420,
1495,
30004,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
10149,
29918,
14144,
1495,
30004,
13,
1753,
3633,
29918,
14144,
7295,
30004,
13,
1678,
6756,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
1121,
1917,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
3633,
1159,
30004,
13,
1678,
565,
1121,
1917,
1405,
29871,
29900,
29901,
30004,
13,
4706,
1404,
10602,
353,
3151,
29889,
9155,
497,
26471,
13,
4706,
736,
4050,
29918,
6886,
877,
10149,
29918,
8948,
414,
29889,
1420,
742,
1792,
10602,
29922,
1792,
10602,
8443,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
311,
1066,
277,
29918,
14506,
742,
3519,
29922,
1839,
2490,
742,
525,
657,
2033,
8443,
13,
1753,
19754,
277,
29918,
14506,
7295,
30004,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
1178,
29922,
3827,
29889,
689,
29889,
657,
877,
333,
1495,
30004,
13,
1678,
1596,
29898,
333,
8443,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
1121,
1917,
353,
3151,
29889,
7978,
703,
2622,
334,
515,
3633,
988,
16904,
29918,
29883,
504,
29918,
333,
353,
1273,
29879,
613,
29898,
333,
29892,
876,
30004,
13,
1678,
565,
1121,
1917,
1405,
29871,
29900,
29901,
30004,
13,
4706,
4160,
353,
3151,
29889,
9155,
497,
26471,
13,
1678,
736,
4050,
29918,
6886,
877,
311,
1066,
277,
29918,
29885,
4992,
29889,
1420,
742,
1792,
29922,
7193,
8443,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
311,
1066,
277,
742,
23515,
29922,
1839,
2490,
3788,
657,
2033,
8443,
13,
1753,
19754,
277,
7295,
30004,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
2643,
13776,
30004,
13,
1678,
1178,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
333,
8785,
30004,
13,
1678,
5253,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
311,
1066,
277,
8785,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
3151,
29889,
7978,
703,
5504,
3633,
731,
16904,
29918,
562,
312,
29918,
5521,
749,
29922,
5652,
29918,
562,
312,
29918,
5521,
749,
29974,
4384,
29414,
29879,
408,
13677,
29898,
29896,
29953,
29892,
29906,
876,
988,
16904,
29918,
29883,
504,
29918,
333,
29922,
1273,
29879,
613,
29898,
14506,
29892,
333,
29892,
876,
30004,
13,
1678,
5749,
29889,
9965,
29889,
15060,
26471,
13,
1678,
1121,
1917,
353,
3151,
29889,
7978,
703,
2622,
334,
515,
3633,
988,
16904,
29918,
29883,
504,
29918,
333,
353,
1273,
29879,
613,
29898,
333,
29892,
876,
30004,
13,
1678,
565,
1121,
1917,
1405,
29871,
29900,
29901,
30004,
13,
4706,
1404,
10602,
353,
3151,
29889,
9155,
497,
26471,
13,
4706,
2643,
543,
18087,
19754,
1573,
8472,
19451,
13,
1678,
9826,
353,
2635,
29889,
27765,
26471,
13,
1678,
263,
29918,
1853,
29922,
1792,
10602,
29961,
29900,
3816,
29906,
29962,
30004,
13,
1678,
17346,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
311,
1066,
277,
8785,
30004,
13,
1678,
3151,
29889,
7978,
877,
4907,
19460,
11646,
421,
2267,
737,
9157,
292,
27870,
3286,
7387,
29952,
6695,
5652,
29918,
29883,
504,
29918,
333,
29952,
1919,
29952,
5652,
29918,
5753,
593,
29918,
1853,
29952,
1919,
29952,
5652,
29918,
8035,
29952,
1919,
29952,
5652,
29918,
509,
29916,
29876,
29918,
1256,
29952,
1919,
29952,
5652,
29918,
4351,
29918,
22449,
29952,
1919,
29952,
5652,
29918,
29873,
4141,
29918,
22449,
6348,
8932,
12996,
313,
29995,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
1919,
1273,
29879,
1919,
1273,
29879,
416,
4907,
742,
29898,
333,
29892,
29874,
29918,
1853,
29892,
5521,
749,
29892,
27765,
29892,
29874,
29918,
1853,
29892,
29874,
29918,
1853,
876,
30004,
13,
1678,
5749,
29889,
9965,
29889,
15060,
26471,
13,
1678,
736,
4050,
29918,
6886,
877,
311,
1066,
277,
29918,
29885,
4992,
29889,
1420,
742,
1792,
29922,
1792,
10602,
29892,
4906,
29922,
4906,
8443,
13,
30004,
13,
29937,
1454,
6782,
30004,
13,
29992,
932,
29889,
13134,
11974,
3286,
571,
613,
3519,
29922,
1839,
2490,
742,
525,
657,
2033,
8443,
13,
1753,
6782,
7295,
30004,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
736,
4050,
29918,
6886,
703,
3286,
571,
29918,
29885,
4992,
29889,
1420,
1159,
30004,
13,
29992,
932,
29889,
13134,
11974,
3286,
571,
29918,
14506,
613,
3519,
29922,
1839,
2490,
742,
525,
657,
2033,
8443,
13,
30004,
13,
1753,
6782,
29918,
14506,
7295,
30004,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
25387,
29918,
333,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
333,
8785,
30004,
13,
1678,
1596,
29898,
29883,
504,
29918,
333,
8443,
13,
1678,
22024,
29918,
333,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
3286,
571,
29918,
333,
8785,
30004,
13,
1678,
5253,
29922,
524,
29898,
3827,
29889,
689,
29889,
657,
877,
3286,
571,
8785,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
1121,
29922,
2764,
29889,
7978,
877,
4907,
2622,
334,
515,
3633,
988,
16904,
29918,
29883,
504,
29918,
333,
29922,
1273,
29879,
4907,
742,
29898,
29883,
504,
29918,
333,
29892,
876,
30004,
13,
1678,
25387,
29922,
2764,
29889,
9155,
497,
26471,
13,
1678,
1121,
29896,
29922,
2764,
29889,
7978,
877,
4907,
2622,
334,
515,
3633,
988,
16904,
29918,
29883,
504,
29918,
333,
29922,
1273,
29879,
4907,
742,
29898,
509,
273,
29918,
333,
29892,
876,
30004,
13,
1678,
1301,
29922,
2764,
29889,
9155,
497,
26471,
13,
1678,
9826,
353,
2635,
29889,
27765,
26471,
13,
1678,
565,
1121,
1405,
29871,
29900,
29901,
30004,
13,
4706,
565,
1121,
29896,
1405,
29871,
29900,
29901,
30004,
13,
9651,
25387,
29918,
7045,
29922,
29883,
504,
29961,
29900,
3816,
29941,
29962,
29899,
14506,
30004,
13,
9651,
1596,
29898,
3286,
8443,
13,
9651,
1301,
29918,
7045,
29922,
3286,
29961,
29900,
3816,
29941,
10062,
14506,
30004,
13,
9651,
3151,
29889,
7978,
877,
4907,
5504,
3633,
731,
16904,
29918,
562,
312,
29918,
5521,
749,
16328,
29879,
988,
16904,
29918,
29883,
504,
29918,
333,
16328,
29879,
4907,
742,
29898,
29883,
504,
29918,
7045,
29892,
29883,
504,
29918,
333,
29892,
876,
30004,
13,
9651,
5749,
29889,
9965,
29889,
15060,
26471,
13,
9651,
3151,
29889,
7978,
877,
4907,
5504,
3633,
731,
16904,
29918,
562,
312,
29918,
5521,
749,
16328,
29879,
988,
16904,
29918,
29883,
504,
29918,
333,
16328,
29879,
4907,
742,
29898,
3286,
29918,
7045,
29892,
509,
273,
29918,
333,
29892,
876,
30004,
13,
9651,
5749,
29889,
9965,
29889,
15060,
26471,
13,
9651,
1134,
29896,
29922,
29883,
504,
29961,
29900,
3816,
29906,
29962,
30004,
13,
9651,
3151,
29889,
7978,
877,
4907,
19460,
11646,
421,
2267,
737,
9157,
292,
27870,
3286,
7387,
29952,
6695,
5652,
29918,
29883,
504,
29918,
333,
29952,
1919,
29952,
5652,
29918,
5753,
593,
29918,
1853,
29952,
1919,
29952,
5652,
29918,
8035,
29952,
1919,
29952,
5652,
29918,
509,
29916,
29876,
29918,
1256,
29952,
1919,
29952,
5652,
29918,
4351,
29918,
22449,
29952,
1919,
29952,
5652,
29918,
29873,
4141,
29918,
22449,
6348,
8932,
12996,
313,
29995,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
1919,
1273,
29879,
1919,
1273,
29879,
416,
4907,
742,
29898,
29883,
504,
29918,
333,
29892,
1853,
29896,
29892,
14506,
29892,
27765,
29892,
1853,
29896,
29892,
1853,
29896,
876,
30004,
13,
9651,
5749,
29889,
9965,
29889,
15060,
26471,
13,
9651,
1134,
29906,
29922,
3286,
29961,
29900,
3816,
29906,
29962,
30004,
13,
9651,
3151,
29889,
7978,
877,
4907,
19460,
11646,
421,
2267,
737,
9157,
292,
27870,
3286,
7387,
29952,
6695,
5652,
29918,
29883,
504,
29918,
333,
29952,
1919,
29952,
5652,
29918,
5753,
593,
29918,
1853,
29952,
1919,
29952,
5652,
29918,
8035,
29952,
1919,
29952,
5652,
29918,
509,
29916,
29876,
29918,
1256,
29952,
1919,
29952,
5652,
29918,
4351,
29918,
22449,
29952,
1919,
29952,
5652,
29918,
29873,
4141,
29918,
22449,
6348,
8932,
12996,
313,
29995,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
1919,
1273,
29879,
1919,
1273,
29879,
416,
4907,
742,
29898,
509,
273,
29918,
333,
29892,
1853,
29906,
29892,
14506,
29892,
27765,
29892,
1853,
29906,
29892,
1853,
29906,
876,
30004,
13,
9651,
5749,
29889,
9965,
29889,
15060,
26471,
13,
9651,
2643,
543,
18087,
6782,
8676,
8472,
19451,
13,
9651,
736,
4050,
29918,
6886,
877,
3286,
571,
29918,
10602,
29889,
1420,
742,
4906,
29922,
4906,
29892,
29883,
504,
29922,
29883,
504,
29892,
3286,
29922,
3286,
29892,
29883,
504,
29918,
7045,
29922,
29883,
504,
29918,
7045,
29892,
3286,
29918,
7045,
29922,
3286,
29918,
7045,
8443,
13,
4706,
1683,
29901,
30004,
13,
9651,
2643,
543,
10399,
1959,
17157,
3553,
19451,
13,
1678,
1683,
29901,
30004,
13,
4706,
2643,
543,
10399,
1959,
21886,
3553,
19451,
13,
1678,
736,
4050,
29918,
6886,
703,
3286,
571,
29918,
29885,
4992,
29889,
1420,
613,
4906,
29922,
4906,
8443,
13,
30004,
13,
29937,
1454,
1480,
449,
30004,
13,
29992,
932,
29889,
13134,
11219,
1188,
449,
742,
23515,
29922,
1839,
2490,
3788,
657,
2033,
8443,
13,
1753,
1480,
449,
7295,
30004,
13,
1678,
565,
4867,
1360,
29912,
6177,
30004,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
1678,
4867,
29889,
7323,
877,
6786,
742,
6213,
8443,
13,
1678,
1596,
29898,
7924,
8443,
13,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
30004,
13,
30004,
13,
29937,
1454,
11962,
2740,
30004,
13,
29992,
932,
29889,
13134,
11219,
29883,
4478,
742,
23515,
29922,
1839,
2490,
3788,
657,
2033,
8443,
13,
1753,
274,
4478,
7295,
30004,
13,
1678,
736,
4050,
29918,
6886,
877,
15539,
29918,
4478,
29889,
1420,
1495,
30004,
13,
30004,
13,
29992,
932,
29889,
13134,
11219,
15539,
4478,
742,
23515,
29922,
1839,
2490,
3788,
657,
2033,
8443,
13,
1753,
11962,
4478,
7295,
30004,
13,
1678,
25387,
29918,
333,
29922,
3827,
29889,
689,
29889,
657,
877,
29883,
504,
29899,
333,
1495,
30004,
13,
1678,
269,
16586,
29918,
333,
29922,
3827,
29889,
689,
29889,
657,
877,
893,
29876,
29899,
333,
1495,
30004,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
26471,
13,
1678,
1121,
29922,
2764,
29889,
7978,
877,
4907,
2622,
334,
515,
11962,
988,
16904,
29918,
29883,
504,
29918,
333,
29922,
1273,
29879,
470,
16904,
29918,
893,
29876,
16328,
29879,
4907,
742,
29898,
29883,
504,
29918,
333,
29892,
893,
29876,
29918,
333,
876,
30004,
13,
1678,
565,
1121,
29958,
29900,
29901,
30004,
13,
4706,
4559,
29922,
2764,
29889,
9155,
497,
26471,
13,
4706,
736,
4050,
29918,
6886,
877,
15539,
29918,
16432,
29889,
1420,
742,
11249,
29922,
11249,
29897,
1678,
2
] |
test/sortByMostFrequent.py | rootadminWalker/SearchByObjects | 0 | 161873 | <filename>test/sortByMostFrequent.py
#!/usr/bin/env python3
from os import path, listdir
import cv2 as cv
from operator import itemgetter
from core.Detection import YOLOPreprocessWithTarget, YOLODetect, yoloIMG
from core.basePaths import basePaths
from core.settings import Settings
from time import time
# Initialize start time
start = time()
# Initialize variables
yolo = YOLODetect(
model_path=basePaths(
'../models/yolov3_416.h5'
).joinBase(),
anchors_path=basePaths(
'../models/yolo_anchors.txt'
).joinBase(),
classes_path=basePaths(
'../models/coco_classes.txt'
).joinBase()
)
target = 'cow'
videos = basePaths(
'../static/videos'
).joinBase()
_targetCount = 0
_allCounts = {}
# You can set how much themes will the program
# Jump to predict. More themes jumped will resulting
# In a faster program and fewer themes jumped will be Slow
#
# Total frames you wanna jump = total seconds * fps
_jumpThemes = 500
# Start looping with all videos
for video in listdir(videos):
boxes = {}
video_name = path.join(videos, video) # Read the video
video = cv.VideoCapture(video_name)
# Configure the settings
settings = Settings(video)
start_predict = 0
while True:
ret, frame = video.read()
if not ret:
continue
# We'll jump n themes before we predict
# In this case, we jumped 100 themes
if start_predict % _jumpThemes == 0:
frame = yoloIMG(frame).preprocess_to() # Preprocess the frame into PIL format
frame, box_count, predicted_classes = yolo.detect(frame) # Predict our frame
frame = yoloIMG(frame).rollback() # Rollback our theme
# Get duration in H:M:S format
duration = settings.get_current_SEC()
settings.format_to_HMS(duration)
duration = settings.duration
# Process our output with target counting
result = YOLOPreprocessWithTarget(
[predicted_classes, box_count], duration,
target
).process_outputs()
targetCount = result[duration]['target']
print(video_name + ":", duration, predicted_classes, box_count, targetCount, end='\r')
_targetCount += targetCount
start_predict += 1
# Check if we have to stop
if settings.get_fps() * settings.get_current_SEC() == settings.get_frames_count():
break
_allCounts[video_name] = _targetCount
# Sort our targets from largest to smallest
_allCounts = sorted(_allCounts.items(), key=itemgetter(1), reverse=True)
_allCounts = dict((key, value) for key, value in _allCounts)
print(_allCounts)
# Initialize end time
end = time()
print("Program runtime: {}".format(
round(
end - start, 5
)
))
| [
1,
529,
9507,
29958,
1688,
29914,
6605,
2059,
29924,
520,
23923,
16011,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
13,
3166,
2897,
1053,
2224,
29892,
1051,
3972,
13,
5215,
13850,
29906,
408,
13850,
13,
3166,
5455,
1053,
2944,
657,
357,
13,
13,
3166,
7136,
29889,
29928,
2650,
428,
1053,
612,
29949,
3927,
6572,
5014,
3047,
8667,
29892,
612,
29949,
3927,
6362,
522,
29892,
343,
3543,
7833,
29954,
13,
3166,
7136,
29889,
3188,
2605,
29879,
1053,
2967,
2605,
29879,
13,
3166,
7136,
29889,
11027,
1053,
19215,
13,
3166,
931,
1053,
931,
13,
13,
29937,
25455,
1369,
931,
13,
2962,
353,
931,
580,
13,
13,
29937,
25455,
3651,
13,
29891,
3543,
353,
612,
29949,
3927,
6362,
522,
29898,
13,
1678,
1904,
29918,
2084,
29922,
3188,
2605,
29879,
29898,
13,
4706,
525,
6995,
9794,
29914,
29891,
324,
586,
29941,
29918,
29946,
29896,
29953,
29889,
29882,
29945,
29915,
13,
1678,
13742,
7122,
5160,
3285,
13,
1678,
23791,
943,
29918,
2084,
29922,
3188,
2605,
29879,
29898,
13,
4706,
525,
6995,
9794,
29914,
29891,
3543,
29918,
14588,
943,
29889,
3945,
29915,
13,
1678,
13742,
7122,
5160,
3285,
13,
1678,
4413,
29918,
2084,
29922,
3188,
2605,
29879,
29898,
13,
4706,
525,
6995,
9794,
29914,
29883,
6235,
29918,
13203,
29889,
3945,
29915,
13,
1678,
13742,
7122,
5160,
580,
13,
29897,
13,
13,
5182,
353,
525,
20587,
29915,
13,
29894,
7958,
353,
2967,
2605,
29879,
29898,
13,
1678,
525,
6995,
7959,
29914,
29894,
7958,
29915,
13,
467,
7122,
5160,
580,
13,
13,
29918,
5182,
3981,
353,
29871,
29900,
13,
29918,
497,
3981,
29879,
353,
6571,
13,
13,
29937,
887,
508,
731,
920,
1568,
963,
267,
674,
278,
1824,
13,
29937,
435,
3427,
304,
8500,
29889,
5853,
963,
267,
12500,
287,
674,
9819,
13,
29937,
512,
263,
8473,
1824,
322,
28145,
963,
267,
12500,
287,
674,
367,
317,
677,
13,
29937,
13,
29937,
14990,
16608,
366,
281,
9713,
12500,
353,
3001,
6923,
334,
285,
567,
13,
29918,
29926,
3427,
1349,
13826,
353,
29871,
29945,
29900,
29900,
13,
13,
29937,
7370,
26113,
411,
599,
19707,
13,
1454,
4863,
297,
1051,
3972,
29898,
29894,
7958,
1125,
13,
1678,
16273,
353,
6571,
13,
1678,
4863,
29918,
978,
353,
2224,
29889,
7122,
29898,
29894,
7958,
29892,
4863,
29897,
29871,
396,
7523,
278,
4863,
13,
1678,
4863,
353,
13850,
29889,
15167,
21133,
545,
29898,
9641,
29918,
978,
29897,
13,
13,
1678,
396,
1281,
4532,
278,
6055,
13,
1678,
6055,
353,
19215,
29898,
9641,
29897,
13,
1678,
1369,
29918,
27711,
353,
29871,
29900,
13,
1678,
1550,
5852,
29901,
13,
4706,
3240,
29892,
3515,
353,
4863,
29889,
949,
580,
13,
4706,
565,
451,
3240,
29901,
13,
9651,
6773,
13,
13,
4706,
396,
1334,
29915,
645,
12500,
302,
963,
267,
1434,
591,
8500,
13,
4706,
396,
512,
445,
1206,
29892,
591,
12500,
287,
29871,
29896,
29900,
29900,
963,
267,
13,
4706,
565,
1369,
29918,
27711,
1273,
903,
29926,
3427,
1349,
13826,
1275,
29871,
29900,
29901,
13,
9651,
3515,
353,
343,
3543,
7833,
29954,
29898,
2557,
467,
1457,
5014,
29918,
517,
580,
29871,
396,
4721,
5014,
278,
3515,
964,
349,
6227,
3402,
13,
13,
9651,
3515,
29892,
3800,
29918,
2798,
29892,
25383,
29918,
13203,
353,
343,
3543,
29889,
4801,
522,
29898,
2557,
29897,
29871,
396,
21099,
919,
1749,
3515,
13,
13,
9651,
3515,
353,
343,
3543,
7833,
29954,
29898,
2557,
467,
1245,
1627,
580,
29871,
396,
21809,
1627,
1749,
10929,
13,
13,
9651,
396,
3617,
14385,
297,
379,
29901,
29924,
29901,
29903,
3402,
13,
9651,
14385,
353,
6055,
29889,
657,
29918,
3784,
29918,
1660,
29907,
580,
13,
9651,
6055,
29889,
4830,
29918,
517,
29918,
29950,
4345,
29898,
19708,
29897,
13,
9651,
14385,
353,
6055,
29889,
19708,
13,
13,
9651,
396,
10554,
1749,
1962,
411,
3646,
21248,
13,
9651,
1121,
353,
612,
29949,
3927,
6572,
5014,
3047,
8667,
29898,
13,
18884,
518,
11965,
18186,
29918,
13203,
29892,
3800,
29918,
2798,
1402,
14385,
29892,
13,
18884,
3646,
13,
9651,
13742,
5014,
29918,
4905,
29879,
580,
13,
9651,
3646,
3981,
353,
1121,
29961,
19708,
22322,
5182,
2033,
13,
13,
9651,
1596,
29898,
9641,
29918,
978,
718,
29242,
613,
14385,
29892,
25383,
29918,
13203,
29892,
3800,
29918,
2798,
29892,
3646,
3981,
29892,
1095,
2433,
29905,
29878,
1495,
13,
13,
9651,
903,
5182,
3981,
4619,
3646,
3981,
13,
13,
4706,
1369,
29918,
27711,
4619,
29871,
29896,
13,
13,
4706,
396,
5399,
565,
591,
505,
304,
5040,
13,
4706,
565,
6055,
29889,
657,
29918,
29888,
567,
580,
334,
6055,
29889,
657,
29918,
3784,
29918,
1660,
29907,
580,
1275,
6055,
29889,
657,
29918,
19935,
29918,
2798,
7295,
13,
9651,
2867,
13,
13,
1678,
903,
497,
3981,
29879,
29961,
9641,
29918,
978,
29962,
353,
903,
5182,
3981,
13,
13,
29937,
20025,
1749,
22525,
515,
10150,
304,
19087,
13,
29918,
497,
3981,
29879,
353,
12705,
7373,
497,
3981,
29879,
29889,
7076,
3285,
1820,
29922,
667,
657,
357,
29898,
29896,
511,
11837,
29922,
5574,
29897,
13,
29918,
497,
3981,
29879,
353,
9657,
3552,
1989,
29892,
995,
29897,
363,
1820,
29892,
995,
297,
903,
497,
3981,
29879,
29897,
13,
2158,
7373,
497,
3981,
29879,
29897,
13,
13,
29937,
25455,
1095,
931,
13,
355,
353,
931,
580,
13,
13,
2158,
703,
9283,
10073,
29901,
6571,
1642,
4830,
29898,
13,
1678,
4513,
29898,
13,
4706,
1095,
448,
1369,
29892,
29871,
29945,
13,
1678,
1723,
13,
876,
13,
2
] |
Find Minimum in Rotated Array.py | lisnb/leetcode | 2 | 164703 | <reponame>lisnb/leetcode
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: LiSnB
# @Date: 2015-01-09 11:01:40
# @Last Modified by: LiSnB
# @Last Modified time: 2015-01-09 11:21:54
# @Email: <EMAIL>
"""
# @comment here:
"""
class Solution:
# @param num, a list of integer
# @return an integer
def findMin(self, num):
print num
if not len(num):
return None
l = len(num)
if l<=2:
return min(num)
pivot = l/2
print pivot
if num[0]<num[-1]:
return num[0]
if num[pivot]<num[pivot-1] and num[pivot]<num[pivot+1]:
return num[pivot]
# if num[0]<num[pivot-1] and num[pivot+1]<num[-1]:
# return num[pivot] if num[pivot]<num[pivot+1] else num[pivot+1]
else:
if num[0]>num[pivot-1]:
return self.findMin(num[0:pivot])
else:
return self.findMin(num[pivot+1:])
if __name__ == '__main__':
s=Solution()
num = [3,3,3,3,3,3,4,4,4,4,4,4,6,6,6,6,6,6,6,6,1,1,1,1,2]
num2 = [0,0,0]
print s.findMin(num2)
| [
1,
529,
276,
1112,
420,
29958,
23443,
9877,
29914,
280,
300,
401,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
732,
13720,
29901,
2718,
29903,
29876,
29933,
13,
29937,
732,
2539,
29901,
1678,
29906,
29900,
29896,
29945,
29899,
29900,
29896,
29899,
29900,
29929,
29871,
29896,
29896,
29901,
29900,
29896,
29901,
29946,
29900,
13,
29937,
732,
8897,
3382,
2164,
491,
29901,
259,
2718,
29903,
29876,
29933,
13,
29937,
732,
8897,
3382,
2164,
931,
29901,
29871,
29906,
29900,
29896,
29945,
29899,
29900,
29896,
29899,
29900,
29929,
29871,
29896,
29896,
29901,
29906,
29896,
29901,
29945,
29946,
13,
29937,
732,
9823,
29901,
529,
26862,
6227,
29958,
13,
13,
15945,
29908,
13,
29937,
732,
9342,
1244,
29901,
13,
13,
15945,
29908,
13,
13,
1990,
24380,
29901,
13,
1678,
396,
732,
3207,
954,
29892,
263,
1051,
310,
6043,
13,
1678,
396,
732,
2457,
385,
6043,
13,
1678,
822,
1284,
8140,
29898,
1311,
29892,
954,
1125,
13,
4706,
1596,
954,
13,
4706,
565,
451,
7431,
29898,
1949,
1125,
13,
9651,
736,
6213,
13,
4706,
301,
353,
7431,
29898,
1949,
29897,
13,
4706,
565,
301,
14065,
29906,
29901,
13,
9651,
736,
1375,
29898,
1949,
29897,
13,
4706,
24438,
353,
301,
29914,
29906,
13,
4706,
1596,
24438,
13,
4706,
565,
954,
29961,
29900,
29962,
29966,
1949,
14352,
29896,
5387,
13,
9651,
736,
954,
29961,
29900,
29962,
13,
4706,
565,
954,
29961,
29886,
11002,
29962,
29966,
1949,
29961,
29886,
11002,
29899,
29896,
29962,
322,
954,
29961,
29886,
11002,
29962,
29966,
1949,
29961,
29886,
11002,
29974,
29896,
5387,
13,
9651,
736,
954,
29961,
29886,
11002,
29962,
13,
4706,
396,
565,
954,
29961,
29900,
29962,
29966,
1949,
29961,
29886,
11002,
29899,
29896,
29962,
322,
954,
29961,
29886,
11002,
29974,
29896,
29962,
29966,
1949,
14352,
29896,
5387,
13,
4706,
396,
268,
736,
954,
29961,
29886,
11002,
29962,
565,
954,
29961,
29886,
11002,
29962,
29966,
1949,
29961,
29886,
11002,
29974,
29896,
29962,
1683,
954,
29961,
29886,
11002,
29974,
29896,
29962,
13,
4706,
1683,
29901,
13,
9651,
565,
954,
29961,
29900,
29962,
29958,
1949,
29961,
29886,
11002,
29899,
29896,
5387,
13,
18884,
736,
1583,
29889,
2886,
8140,
29898,
1949,
29961,
29900,
29901,
29886,
11002,
2314,
13,
9651,
1683,
29901,
13,
18884,
736,
1583,
29889,
2886,
8140,
29898,
1949,
29961,
29886,
11002,
29974,
29896,
29901,
2314,
13,
308,
13,
268,
13,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
269,
29922,
13296,
918,
580,
13,
1678,
954,
353,
518,
29941,
29892,
29941,
29892,
29941,
29892,
29941,
29892,
29941,
29892,
29941,
29892,
29946,
29892,
29946,
29892,
29946,
29892,
29946,
29892,
29946,
29892,
29946,
29892,
29953,
29892,
29953,
29892,
29953,
29892,
29953,
29892,
29953,
29892,
29953,
29892,
29953,
29892,
29953,
29892,
29896,
29892,
29896,
29892,
29896,
29892,
29896,
29892,
29906,
29962,
13,
1678,
954,
29906,
353,
518,
29900,
29892,
29900,
29892,
29900,
29962,
13,
1678,
1596,
269,
29889,
2886,
8140,
29898,
1949,
29906,
29897,
13,
13,
13,
13,
13,
13,
13,
12,
2
] |
openstack_dashboard/test/integration_tests/steps.py | Mirantis/mos-horizon | 9 | 26888 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import logging
from openstack_dashboard.test.integration_tests.pages import loginpage
from openstack_dashboard.test.integration_tests.regions import messages
LOGGER = logging.getLogger(__name__)
def login(test_case):
test_case.login_pg = loginpage.LoginPage(test_case.driver,
test_case.CONFIG)
test_case.login_pg.go_to_login_page()
test_case.create_demo_user()
test_case.home_pg = test_case.login_pg.login(test_case.TEST_USER_NAME,
test_case.TEST_PASSWORD)
test_case.home_pg.change_project(test_case.HOME_PROJECT)
test_case.assertTrue(
test_case.home_pg.find_message_and_dismiss(messages.SUCCESS))
test_case.assertFalse(
test_case.home_pg.find_message_and_dismiss(messages.ERROR))
yield
if test_case.home_pg.is_logged_in:
test_case.home_pg.log_out()
else:
LOGGER.warn("{!r} isn't logged in".format(test_case.TEST_USER_NAME))
| [
1,
396,
1678,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
366,
1122,
13,
29937,
1678,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
887,
1122,
4017,
13,
29937,
1678,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
308,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
1678,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
1678,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
13,
29937,
1678,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
2823,
278,
13,
29937,
1678,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
27028,
13,
29937,
1678,
1090,
278,
19245,
29889,
13,
13,
5215,
12183,
13,
13,
3166,
1722,
1429,
29918,
14592,
3377,
29889,
1688,
29889,
27925,
29918,
21150,
29889,
12292,
1053,
6464,
3488,
13,
3166,
1722,
1429,
29918,
14592,
3377,
29889,
1688,
29889,
27925,
29918,
21150,
29889,
1727,
1080,
1053,
7191,
13,
13,
14480,
17070,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
13,
1753,
6464,
29898,
1688,
29918,
4878,
1125,
13,
1678,
1243,
29918,
4878,
29889,
7507,
29918,
4061,
353,
6464,
3488,
29889,
11049,
5074,
29898,
1688,
29918,
4878,
29889,
9465,
29892,
13,
462,
462,
632,
1243,
29918,
4878,
29889,
25903,
29897,
13,
1678,
1243,
29918,
4878,
29889,
7507,
29918,
4061,
29889,
1484,
29918,
517,
29918,
7507,
29918,
3488,
580,
13,
13,
1678,
1243,
29918,
4878,
29889,
3258,
29918,
17482,
29918,
1792,
580,
13,
13,
1678,
1243,
29918,
4878,
29889,
5184,
29918,
4061,
353,
1243,
29918,
4878,
29889,
7507,
29918,
4061,
29889,
7507,
29898,
1688,
29918,
4878,
29889,
18267,
29918,
11889,
29918,
5813,
29892,
13,
462,
462,
462,
1243,
29918,
4878,
29889,
18267,
29918,
25711,
17013,
29897,
13,
1678,
1243,
29918,
4878,
29889,
5184,
29918,
4061,
29889,
3167,
29918,
4836,
29898,
1688,
29918,
4878,
29889,
17353,
29918,
8618,
17637,
29897,
13,
1678,
1243,
29918,
4878,
29889,
9294,
5574,
29898,
13,
4706,
1243,
29918,
4878,
29889,
5184,
29918,
4061,
29889,
2886,
29918,
4906,
29918,
392,
29918,
29881,
28303,
29898,
19158,
29889,
14605,
26925,
876,
13,
1678,
1243,
29918,
4878,
29889,
9294,
8824,
29898,
13,
4706,
1243,
29918,
4878,
29889,
5184,
29918,
4061,
29889,
2886,
29918,
4906,
29918,
392,
29918,
29881,
28303,
29898,
19158,
29889,
11432,
876,
13,
13,
1678,
7709,
13,
13,
1678,
565,
1243,
29918,
4878,
29889,
5184,
29918,
4061,
29889,
275,
29918,
1188,
3192,
29918,
262,
29901,
13,
4706,
1243,
29918,
4878,
29889,
5184,
29918,
4061,
29889,
1188,
29918,
449,
580,
13,
1678,
1683,
29901,
13,
4706,
25401,
17070,
29889,
25442,
703,
29912,
29991,
29878,
29913,
3508,
29915,
29873,
13817,
297,
1642,
4830,
29898,
1688,
29918,
4878,
29889,
18267,
29918,
11889,
29918,
5813,
876,
13,
2
] |
python_tamer/SpecificDoses.py | tch521/python-TAMER | 0 | 110206 | import pandas as pd
import numpy as np
import netCDF4 as nc
from .subroutines import *
class SpecificDoses(pd.DataFrame):
"""A class for specific dose estimates akin to dosimetry measurements
High resolution data allows for personal and ambient dose estimation without the need for
direct measurement. This class is structured like a table with a set of functions to add
columns ultimately leading to dose estimates. Each row of this table represents a specific
exposure instance, i.e. an individual at a specific location for a specific date and time
with a specific exposure ratio. See Harris et al. 2021
(https://doi.org/10.3390/atmos12020268) for more information on calculations appropriate
for this class.
Parameters
----------
src_filename_format : str
Describes the filename of the netCDF files containing the UV data with 'yyyy' in place
of the year.
src_directory : str
The directory where the data is stored. Must end with a slash.
Notes
-----
Presently, the class is inherited from a pandas.DataFrame which is somewhat restrictive
and will likely be revised in a later update. For the time being, this means that the
parameters cannot be set when initialising a `SpecificDoses` object, they must instead
be adjusted after initialisation, like so::
ExistingExposureMapObject.src_directory = "/new/data/directory/"
Example
-------
In this example, we illustrate the process for calculating the doses in Harris et al. 2021
(https://doi.org/10.3390/atmos12020268) from the spreadsheet supplied as supplementary
data (https://www.mdpi.com/2073-4433/12/2/268/s1). Note that results will differ as the
spreadsheet contains only local Swiss time and not UTC time. There are four important
functions as part of this class, three for standardising and preparing the columns,
and one for actually loading the data and performing the dose calculations. See below::
import python_tamer as pt
import pandas as pd
example = pt.SpecificDoses(pd.read_excel(r'atmosphere-12-00268-s001.xlsx',
header=2,index_col=0,usecols="B:K"))
example.src_directory = 'C:/enter_the_directory_of_your_dataset_here'
example = example.standard_column_names()
example = example.schedule_constant_exposure().ER_from_posture()
example = example.calculate_specific_dose()
"""
# This property ensures that functions return the same subclass
@property
def _constructor(self):
return SpecificDoses
# This adds some useful metadata (self-explanatory)
_metadata = ["src_filename_format","src_directory"]
src_filename_format = 'UVery.AS_ch02.lonlat_yyyy01010000.nc'
src_directory = 'C:/Data/UV/' # TODO: set up __init__ for these options
# It feels like this should be declared with __init__ as well but idk
def standard_column_names(self) :
"""Limited function to standardise column names
When loading tables to use as the basis for a SpecificDoses table, some columns may have
slightly names to what is expected. This function standardises the names but is very
limited in terms of what it can recognise. The user is encourages to ensure the columns
are correctly labelled themselves and not to rely on this function.
Returns
-------
SpecificDoses
The table has its column names modified.
"""
legend_dict_reverse = {'Point' : ['Lieu de mesure'],
'Date' : ['Date'],
'Time_start' : ['Heure début','Start_time','Start time'],
'Time_end' : ['Heure fin','End_time','End time'],
'Measured_dose' : ['Exposition [MED]','Exposure'],
'Anatomic_zone' : ['Zone anatomique','Body part','Anatomic zone'],
'Posture' : ['Body posture'],
'Latitude' : ['lat'],
'Longitude' : ['lon','lng']}
legend_dict = {keys: old_keys for old_keys, old_values in legend_dict_reverse.items() for keys in old_values}
self = self.rename(columns=legend_dict)
return self
def schedule_constant_exposure(self) :
"""Generates exposure schedules given start and end times.
This function generates exposure schedules based on simple continuous exposure, i.e.
with a start time and an end time. The exposure schedule is a vector with length 24
with each entry representing the proportion of the corresponding hour of the day that
the subject is exposed.
Returns
-------
python_tamer.SpecificDoses
An exposure_schedule column is created and is appended to the input
`SpecificDoses` object or, if that column already exists, it is overwritten.
Notes
-----
The input `SpecificDoses` object must contain the following columns:
* ``Time_start``
* ``Time_end``
Example
-------
In this example, we illustrate the process for calculating the doses in Harris et al. 2021
(https://doi.org/10.3390/atmos12020268) from the spreadsheet supplied as supplementary
data (https://www.mdpi.com/2073-4433/12/2/268/s1). Note that results will differ as the
spreadsheet contains only local Swiss time and not UTC time. There are four important
functions as part of this class, three for standardising and preparing the columns,
and one for actually loading the data and performing the dose calculations. See below::
import python_tamer as pt
import pandas as pd
example = pt.SpecificDoses(pd.read_excel(r'atmosphere-12-00268-s001.xlsx',
header=2,index_col=0,usecols="B:K"))
example.src_directory = 'C:/enter_the_directory_of_your_dataset_here'
example = example.standard_column_names()
example = example.schedule_constant_exposure().ER_from_posture()
example = example.calculate_specific_dose()
"""
def schedule_constant_exposure_iter(Start_time,End_time) :
"""Iterates through rows of a SpecificDoses table to generate schedules.
This function is designed to be applied to each row in a datatable to generate an
exposure schedule based on a start time and end time
Parameters
----------
Start_time : datetime.time
UTC time at which exposure period begins
End_time : datetime.time
UTC time at which exposure period end
Returns
-------
numpy.array
24 length vector of values between 0 and 1 indicating proportion
of time exposed for that corresponding hour of the day.
"""
schedule = np.zeros(24)
schedule[Start_time.hour:End_time.hour] = 1
# Modify start and end hours according to proportion of time exposed
if Start_time.minute != 0 :
schedule[Start_time.hour] = (1 - Start_time.minute/60)
if End_time.minute != 0 :
schedule[End_time.hour] = End_time.minute/60
return schedule
# With that function defined, we need just one line to apply it to the whole table
self["Schedule"] = self.apply(lambda x: schedule_constant_exposure_iter(
x["Time_start"],x["Time_end"]),axis='columns')
return self
def ER_from_posture(self,
Vis_table_path=None,
Vis_table=None) :
"""ER_from_posture calculates Exposure Ratios for a given anatomic zone, posture, and date.
This function calculates ER as a percentage between 0 and 100 based on information from an input table.
The input table must contain certain columns at a minimum. Those are: Date, Anatomic_zone, and Posture.
This function contains hard-coded synonyms for certain anatomical zones, e.g. 'Forehead" maps to "Face'.
See Vernez et al., Journal of Exposure Science and Environmental Epidemiology (2015) 25, 113–118
(https://doi.org/10.1038/jes.2014.6) for further details on the model used for the calculation.
Parameters
----------
Vis_table_path : str, optional
The full path to an alternative table for the Vis parameter.
Must be a csv file. Defaults to None.
Vis_table : str, optional
An alternative table for the Vis parameter. Defaults to None.
Returns
-------
SpecificDoses
Returns input table appended with ER column
Notes
-----
The SpecificDoses table used must contain columns for Date, Anatomic_zone, and Posture.
The Date column should contain DateTime entries. The Anatonic_zone column should contain one string per
row describing the exposed body part. The Posture column should contain one string per row describing
one of six accepted postures.
Example
-------
In this example, we illustrate the process for calculating the doses in Harris et al. 2021
(https://doi.org/10.3390/atmos12020268) from the spreadsheet supplied as supplementary
data (https://www.mdpi.com/2073-4433/12/2/268/s1). Note that results will differ as the
spreadsheet contains only local Swiss time and not UTC time. There are four important
functions as part of this class, three for standardising and preparing the columns,
and one for actually loading the data and performing the dose calculations. See below::
import python_tamer as pt
import pandas as pd
example = pt.SpecificDoses(pd.read_excel(r'atmosphere-12-00268-s001.xlsx',
header=2,index_col=0,usecols="B:K"))
example.src_directory = 'C:/enter_the_directory_of_your_dataset_here'
example = example.standard_column_names()
example = example.schedule_constant_exposure().ER_from_posture()
example = example.calculate_specific_dose()
"""
# This chunk of code checks if the default Vis table should be used or if the user enters some alternative table.
if Vis_table is None and Vis_table_path is None :
Vis_table = pd.DataFrame.from_records(
columns=['Seated','Kneeling','Standing erect arms down','Standing erect arms up','Standing bowing'],
index=['Face','Skull','Forearm','Upper arm','Neck','Top of shoulders','Belly','Upper back','Hand','Shoulder','Upper leg','Lower leg','Lower back'],
data=[[53.7,28.7,46.6,44.9,19.2],
[56.2,66.6,61.1,58.4,67.5],
[62.3,56.5,49.4,53.1,62.1],
[51.7,60.5,45.9,65.3,61.6],
[58.3,84.3,67.6,65.2,81.6],
[35.9,50.3,48.6,45.7,85.3],
[58.1,45.1,50.3,49.6,15.2],
[35.9,50.3,48.6,45.7,85.3],
[59.2,58.8,42.4,55,58.5],
[68,62,63,67.1,64],
[65.4,45.4,50.9,51,43.5],
[32.8,63.4,49.7,50.3,50],
[44.9,51.6,56.6,53.4,86.9]])
# The 'standing moving' posture must be dealt with somehow...
# Vis_table['Standing moving']= (Vis_table['Standing erect arms down'] + Vis_table['Standing bowing']) / 2
# TODO: add interpeter or force users to conform?
Vis_table['Standing moving']= Vis_table['Standing erect arms down']
elif Vis_table is None :
Vis_table = pd.read_csv(Vis_table_path)
# Below is a dictionary describing a range of synonyms for the anatomical zones defined in the Vis table.
Anatomic_zone_synonyms_reverse = {
'Forearm' : ['wrist',
'Left extern radial',
'Right extern radial',
'Left wrist: radius head',
'Right wrist: radius head',
'Left wrist',
'Right wrist'],
'Face' : ['Forehead'],
'Upper back' : ['Right trapezoid',
'Left trapezoid',
'trapezius'],
'Belly' : ['Chest'],
'Shoulder' : ['Left deltoid',
'Right deltoid',
'Left shoulder',
'Right shoulder'],
'Upper arm' : ['Left elbow',
'Right elbow',
'Left biceps',
'Right biceps'],
'Upper leg' : ['Left thigh',
'Right thigh',
'Left knee',
'Right knee'],
'Lower back' : ['Low back']
}
# The dictionary is reversed so that the multiple synonyms can be mapped to the few correct terms for the Vis table.
Anatomic_zone_synonyms = {keys: old_keys for old_keys, old_values in Anatomic_zone_synonyms_reverse.items() for keys in old_values}
self = self.replace({'Anatomic_zone' : Anatomic_zone_synonyms})
# With the correct anatomic zone names established, we can lookup the Vis values from the table
# TODO: lookup is being depreciated, must replace with something new
Vis = Vis_table.lookup(self['Anatomic_zone'],self['Posture'])
# Next we must calculate the minimal Solar Zenith Angle for the given date
mSZA = min_solar_zenith_angle(self.Date,self.Latitude)
# With the Vis value and the SZA, we can calculate the ER according to the Vernez model
self.loc[:,'ER'] = ER_Vernez_model_equation(Vis,mSZA) / 100
return self
def calculate_specific_dose(self) :
"""Calculates doses according to exposure schedule, ER, date, and location.
This function takes the SpecificDoseEstimationTable and calculates the specific
ambient and personal doses according to the exposure schedule and ER. There are
a few key steps to this function. First it reads the Date column to determine
which years of data must be loaded. It then iterates through each year, loading
only the necessary dates. It applies the exposure schedule and the ER to
calculate the ambient and personal doses.
Returns
-------
SpecificDoses
The input table is appended with a Ambient_dose and Personal_dose column.
Notes
-----
The input SpecificDoses object must include Date, Schedule, ER, Latitude,
and Longitude columns.
Consult Harris et al. 2021 (https://doi.org/10.3390/atmos12020268) for more
information on how this function can be used in the context of mimicking UV
dosimetry measurements.
Example
-------
In this example, we illustrate the process for calculating the doses in Harris et al. 2021
(https://doi.org/10.3390/atmos12020268) from the spreadsheet supplied as supplementary
data (https://www.mdpi.com/2073-4433/12/2/268/s1). Note that results will differ as the
spreadsheet contains only local Swiss time and not UTC time. There are four important
functions as part of this class, three for standardising and preparing the columns,
and one for actually loading the data and performing the dose calculations. See below::
import python_tamer as pt
import pandas as pd
example = pt.SpecificDoses(pd.read_excel(r'atmosphere-12-00268-s001.xlsx',
header=2,index_col=0,usecols="B:K"))
example.src_directory = 'C:/enter_the_directory_of_your_dataset_here'
example = example.standard_column_names()
example = example.schedule_constant_exposure().ER_from_posture()
example = example.calculate_specific_dose()
"""
# First step is find unique years to avoid loading unnecessary data
years = pd.DatetimeIndex(self.Date).year
unique_years = sorted(set(years))
self['Ambient_dose'] = np.nan
self['Personal_dose'] = np.nan
for year in unique_years :
# Load netCDF file
print("Processing year "+str(year))
dataset=nc.Dataset(self.src_directory+self.src_filename_format.replace('yyyy',str(year)))
dataset.set_auto_mask(False) # This is important for nans to import correctly
# Make temporary table for yearly subset
temp_table = self[years == year].copy()
# find all unique days in year to be loaded
unique_days,unique_days_idx = np.unique(pd.DatetimeIndex(temp_table.Date).dayofyear,
return_inverse=True)
temp_table['unique_days_idx'] = unique_days_idx
#pd.DatetimeIndex(nc.num2date(dataset.variables["time"][:],dataset.variables["time"].units,only_use_cftime_datetimes=False))
if dataset.dimensions['time'].size == 24 :
# needed if just a single day
time_subset = [True for i in range(dataset.dimensions['time'].size)]
else :
# Next we pull a subset from the netCDF file
# declare false array with same length of time dimension from netCDF
time_subset = [False for i in range(dataset.dimensions['time'].size)]
# reshape false array to have first dimension 24 (hours in day)
time_subset = assert_data_shape_24(time_subset)
# set the appropriate days as true
time_subset[:,unique_days-1] = True
# flatten time_subset array back to one dimension
time_subset = time_subset.flatten(order='F')
data = assert_data_shape_24(dataset['UV_AS'][time_subset,:,:])
# TODO: improve comprehension of raw data units rather than assuming
# convert lat lon into pixel coordinates
# TODO: consider is necessary to load entire maps for just a few required pixels
lat = dataset['lat'][:]
lon = dataset['lon'][:]
temp_table['pixel_lat'] = temp_table.apply(lambda x:
find_nearest(lat,x['Latitude']),axis='columns')
temp_table['pixel_lon'] = temp_table.apply(lambda x:
find_nearest(lon,x['Longitude']),axis='columns')
# calculate doses
temp_table['Ambient_dose'] = temp_table.apply(lambda x:
np.sum(data[:,x['unique_days_idx'],x['pixel_lat'],x['pixel_lon']] *
x['Schedule']),axis='columns')
temp_table['Personal_dose'] = temp_table.apply(lambda x:
np.sum(data[:,x['unique_days_idx'],x['pixel_lat'],x['pixel_lon']] *
(x['Schedule'] * x['ER'])),axis='columns')
# extra step necessary to ensure correct assignment
self.loc[temp_table.index,'Ambient_dose'] = temp_table['Ambient_dose'].values
self.loc[temp_table.index,'Personal_dose'] = temp_table['Personal_dose'].values
# TODO: improve units options here
self['Ambient_dose'] = self['Ambient_dose']/40*3600/100 # SED
self['Personal_dose'] = self['Personal_dose']/40*3600/100 # SED
return self
def analyse_variable(self,
variable="UV_AS",
statistic="Mean",
src_filename_format=None,
src_directory=None) :
"""Basic calculations for specific exposure instances
This function is for calculating information other than ambient and personal
doses that corresponds to specific exposure instances.
Parameters
----------
variable : str, optional
The name of the variable to be analysed. This informs what data should be
pulled from the source netCDF files. This also informs the name of the column(s)
that will be created by this function. Defaults to "UV_AS", i.e. the All-Sky
UV data that is used in the calculate_specific_dose function.
statistic : str or list, optional
The statistic to be calculated, options include: mean, median, stdev, variance,
min, max, weighted_mean, and sum. Not case sensitive. Can be a single string or
a list of strings whereby multiple columns will be calculated. Defaults to "Mean".
src_filename_format : str, optional
Allows the user to select different source data. This may be useful in cases where
the user wants to compare doses calculated with one dataset to (say) cloud cover
from another dataset. Defaults to None, where the function uses the source files
specified by the object's metadata.
src_directory : str, optional
Allows the user to select different source data. This may be useful in cases where
the user wants to compare doses calculated with one dataset to (say) cloud cover
from another dataset. Defaults to None, where the function uses the source files
specified by the object's metadata.
Returns
-------
SpecificDoses
The table is appended with new columns named [variable]_[statistic].
Example
-------
In this example, we illustrate the process for calculating the doses in Harris et al. 2021
(https://doi.org/10.3390/atmos12020268) from the spreadsheet supplied as supplementary
data (https://www.mdpi.com/2073-4433/12/2/268/s1). Note that results will differ as the
spreadsheet contains only local Swiss time and not UTC time. Additionally, to demonstrate
the analyse_variable function, we also calculate the weighted mean CMF assuming it to be
an additional variable in the source data files. See below::
import python_tamer as pt
import pandas as pd
example = pt.SpecificDoses(pd.read_excel(r'atmosphere-12-00268-s001.xlsx',
header=2,index_col=0,usecols="B:K"))
example.src_directory = 'C:/enter_the_directory_of_your_dataset_here'
example = example.standard_column_names()
example = example.schedule_constant_exposure().ER_from_posture()
example = example.calculate_specific_dose()
example = example.analyse_variable(variable="CMF",statistic="weighted_mean")
"""
# users have option to load different files, otherwise defaults to metadata
if src_filename_format is None :
src_filename_format = self.src_filename_format
if src_directory is None :
src_directory = self.src_directory
# First step is find unique years to avoid loading unnecessary data
years = pd.DatetimeIndex(self.Date).year
unique_years = sorted(set(years))
if isinstance(statistic,str) :
self[variable+"_"+statistic] = np.nan
# convert to list to simplify code later
statistic = [statistic]
elif isinstance(statistic,list) :
for x in statistic :
self[variable+"_"+x]=np.nan
else :
raise TypeError("statistic input must be str or list of str")
for year in unique_years :
# Load netCDF file
print("Processing year "+str(year))
dataset=nc.Dataset(src_directory+src_filename_format.replace('yyyy',str(year)))
dataset.set_auto_mask(False) # This is important for nans to import correctly
# Make temporary table for yearly subset
temp_table = self[years == year].copy()
# find all unique days in year to be loaded
unique_days,unique_days_idx = np.unique(pd.DatetimeIndex(temp_table.Date).dayofyear,
return_inverse=True)
temp_table['unique_days_idx'] = unique_days_idx
#pd.DatetimeIndex(nc.num2date(dataset.variables["time"][:],dataset.variables["time"].units,only_use_cftime_datetimes=False))
if dataset.dimensions['time'].size == 24 :
# needed if just a single day
time_subset = [True for i in range(dataset.dimensions['time'].size)]
else :
# Next we pull a subset from the netCDF file
# declare false array with same length of time dimension from netCDF
time_subset = [False for i in range(dataset.dimensions['time'].size)]
# reshape false array to have first dimension 24 (hours in day)
time_subset = assert_data_shape_24(time_subset)
# set the appropriate days as true
time_subset[:,unique_days-1] = True
# flatten time_subset array back to one dimension
time_subset = time_subset.flatten(order='F')
data = assert_data_shape_24(dataset[variable][time_subset,:,:])
# TODO: improve comprehension of raw data units rather than assuming
# convert lat lon into pixel coordinates
# TODO: consider is necessary to load entire maps for just a few required pixels
lat = dataset['lat'][:]
lon = dataset['lon'][:]
temp_table['pixel_lat'] = temp_table.apply(lambda x:
find_nearest(lat,x['Latitude']),axis='columns')
temp_table['pixel_lon'] = temp_table.apply(lambda x:
find_nearest(lon,x['Longitude']),axis='columns')
# calculate
for stat in statistic :
# mean
if stat.lower() in ["mean",'average','avg'] :
temp_table[variable+"_"+stat] = temp_table.apply(lambda x:
np.mean(data[x['Schedule']!=0,x['unique_days_idx'],x['pixel_lat'],x['pixel_lon']] ),axis='columns')
# median
elif stat.lower() in ["median","med"] :
temp_table[variable+"_"+stat] = temp_table.apply(lambda x:
np.median(data[x['Schedule']!=0,x['unique_days_idx'],x['pixel_lat'],x['pixel_lon']] ),axis='columns')
# stdev
elif stat.lower() in ["std","sd","stdev"] :
temp_table[variable+"_"+stat] = temp_table.apply(lambda x:
np.std(data[x['Schedule']!=0,x['unique_days_idx'],x['pixel_lat'],x['pixel_lon']] ),axis='columns')
# variance
elif stat.lower() in ["var","variance"] :
temp_table[variable+"_"+stat] = temp_table.apply(lambda x:
np.var(data[x['Schedule']!=0,x['unique_days_idx'],x['pixel_lat'],x['pixel_lon']] ),axis='columns')
# minimum
elif stat.lower() in ["min",'minimum'] :
temp_table[variable+"_"+stat] = temp_table.apply(lambda x:
np.amin(data[x['Schedule']!=0,x['unique_days_idx'],x['pixel_lat'],x['pixel_lon']] ),axis='columns')
# maximum
elif stat.lower() in ["max","maximum"] :
temp_table[variable+"_"+stat] = temp_table.apply(lambda x:
np.amax(data[x['Schedule']!=0,x['unique_days_idx'],x['pixel_lat'],x['pixel_lon']] ),axis='columns')
# weighted mean
elif stat.lower() in ["weighted_mean","weighted_average","mean_weighted","average_weighted","avg_weighted"] :
temp_table[variable+"_"+stat] = temp_table.apply(lambda x:
np.average(data[:,x['unique_days_idx'],x['pixel_lat'],x['pixel_lon']],weights=x['Schedule']),axis='columns')
# sum
elif stat.lower() in ["sum","total"] :
temp_table[variable+"_"+stat] = temp_table.apply(lambda x:
np.sum(data[x['Schedule']!=0,x['unique_days_idx'],x['pixel_lat'],x['pixel_lon']] ),axis='columns')
# extra step necessary to ensure correct assignment
self.loc[temp_table.index,variable+"_"+stat] = temp_table[variable+"_"+stat].values
return self
| [
1,
1053,
11701,
408,
10518,
13,
5215,
12655,
408,
7442,
13,
5215,
7787,
29907,
4037,
29946,
408,
302,
29883,
13,
3166,
869,
1491,
14608,
1475,
1053,
334,
13,
13,
13,
1990,
21220,
29928,
15806,
29898,
15926,
29889,
17271,
1125,
13,
1678,
9995,
29909,
770,
363,
2702,
437,
344,
21875,
263,
9089,
304,
3248,
17528,
719,
20398,
13,
13,
1678,
5057,
10104,
848,
6511,
363,
7333,
322,
25040,
437,
344,
23248,
1728,
278,
817,
363,
13,
1678,
1513,
20039,
29889,
910,
770,
338,
2281,
2955,
763,
263,
1591,
411,
263,
731,
310,
3168,
304,
788,
29871,
13,
1678,
4341,
18973,
8236,
304,
437,
344,
21875,
29889,
7806,
1948,
310,
445,
1591,
11524,
263,
2702,
13,
1678,
14060,
545,
2777,
29892,
474,
29889,
29872,
29889,
385,
5375,
472,
263,
2702,
4423,
363,
263,
2702,
2635,
322,
931,
13,
1678,
411,
263,
2702,
14060,
545,
11959,
29889,
2823,
20349,
634,
394,
29889,
29871,
29906,
29900,
29906,
29896,
29871,
13,
1678,
313,
991,
597,
1867,
29875,
29889,
990,
29914,
29896,
29900,
29889,
29941,
29941,
29929,
29900,
29914,
271,
7681,
29896,
29906,
29900,
29906,
29900,
29906,
29953,
29947,
29897,
363,
901,
2472,
373,
17203,
8210,
29871,
13,
1678,
363,
445,
770,
29889,
13,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
13,
1678,
4765,
29918,
9507,
29918,
4830,
584,
851,
13,
4706,
20355,
5707,
278,
10422,
310,
278,
7787,
29907,
4037,
2066,
6943,
278,
501,
29963,
848,
411,
525,
18855,
29915,
297,
2058,
29871,
13,
4706,
310,
278,
1629,
29889,
13,
268,
13,
1678,
4765,
29918,
12322,
584,
851,
13,
4706,
450,
3884,
988,
278,
848,
338,
6087,
29889,
19928,
1095,
411,
263,
24765,
29889,
13,
13,
13,
1678,
8695,
13,
1678,
448,
807,
13,
13,
1678,
4360,
2705,
29892,
278,
770,
338,
23878,
515,
263,
11701,
29889,
17271,
607,
338,
10579,
9250,
573,
29871,
13,
1678,
322,
674,
5517,
367,
337,
11292,
297,
263,
2678,
2767,
29889,
1152,
278,
931,
1641,
29892,
445,
2794,
393,
278,
29871,
13,
1678,
4128,
2609,
367,
731,
746,
2847,
5921,
263,
421,
10299,
928,
29928,
15806,
29952,
1203,
29892,
896,
1818,
2012,
13,
1678,
367,
10365,
287,
1156,
2847,
4371,
29892,
763,
577,
1057,
13,
13,
4706,
1222,
15423,
1252,
1066,
545,
3388,
2061,
29889,
4351,
29918,
12322,
353,
5591,
1482,
29914,
1272,
29914,
12322,
12975,
13,
13,
268,
13,
1678,
8741,
13,
1678,
448,
22158,
13,
13,
1678,
512,
445,
1342,
29892,
591,
28475,
278,
1889,
363,
25202,
278,
3248,
267,
297,
20349,
634,
394,
29889,
29871,
29906,
29900,
29906,
29896,
13,
1678,
313,
991,
597,
1867,
29875,
29889,
990,
29914,
29896,
29900,
29889,
29941,
29941,
29929,
29900,
29914,
271,
7681,
29896,
29906,
29900,
29906,
29900,
29906,
29953,
29947,
29897,
515,
278,
9677,
9855,
19056,
408,
1462,
944,
653,
29871,
13,
1678,
848,
313,
991,
597,
1636,
29889,
3487,
1631,
29889,
510,
29914,
29906,
29900,
29955,
29941,
29899,
29946,
29946,
29941,
29941,
29914,
29896,
29906,
29914,
29906,
29914,
29906,
29953,
29947,
29914,
29879,
29896,
467,
3940,
393,
2582,
674,
1163,
408,
278,
13,
1678,
9677,
9855,
3743,
871,
1887,
26182,
931,
322,
451,
17998,
931,
29889,
1670,
526,
3023,
4100,
13,
1678,
3168,
408,
760,
310,
445,
770,
29892,
2211,
363,
3918,
5921,
322,
10223,
292,
278,
4341,
29892,
13,
1678,
322,
697,
363,
2869,
8363,
278,
848,
322,
15859,
278,
437,
344,
17203,
29889,
2823,
2400,
1057,
13,
13,
4706,
1053,
3017,
29918,
29873,
4183,
408,
19592,
13,
4706,
1053,
11701,
408,
10518,
13,
4706,
1342,
353,
19592,
29889,
10299,
928,
29928,
15806,
29898,
15926,
29889,
949,
29918,
24633,
29898,
29878,
29915,
271,
7681,
9085,
29899,
29896,
29906,
29899,
29900,
29900,
29906,
29953,
29947,
29899,
29879,
29900,
29900,
29896,
29889,
20267,
29916,
742,
13,
462,
462,
462,
4839,
29922,
29906,
29892,
2248,
29918,
1054,
29922,
29900,
29892,
1509,
22724,
543,
29933,
29901,
29968,
5783,
13,
4706,
1342,
29889,
4351,
29918,
12322,
353,
525,
29907,
8419,
5893,
29918,
1552,
29918,
12322,
29918,
974,
29918,
8066,
29918,
24713,
29918,
4150,
29915,
13,
4706,
1342,
353,
1342,
29889,
15770,
29918,
4914,
29918,
7039,
580,
29871,
13,
4706,
1342,
353,
1342,
29889,
816,
11272,
29918,
23362,
29918,
735,
1066,
545,
2141,
1001,
29918,
3166,
29918,
2490,
545,
580,
13,
4706,
1342,
353,
1342,
29889,
15807,
403,
29918,
14940,
29918,
29881,
852,
580,
13,
13,
13,
1678,
9995,
13,
13,
1678,
396,
910,
2875,
5662,
1973,
393,
3168,
736,
278,
1021,
19481,
13,
1678,
732,
6799,
13,
1678,
822,
903,
27821,
29898,
1311,
1125,
13,
4706,
736,
21220,
29928,
15806,
13,
268,
13,
1678,
396,
910,
12778,
777,
5407,
15562,
313,
1311,
29899,
735,
9018,
7606,
29897,
13,
1678,
903,
19635,
353,
6796,
4351,
29918,
9507,
29918,
4830,
3284,
4351,
29918,
12322,
3108,
13,
1678,
4765,
29918,
9507,
29918,
4830,
353,
525,
29965,
29963,
708,
29889,
3289,
29918,
305,
29900,
29906,
29889,
12957,
5066,
29918,
18855,
29900,
29896,
29900,
29896,
29900,
29900,
29900,
29900,
29889,
17608,
29915,
13,
1678,
4765,
29918,
12322,
353,
525,
29907,
8419,
1469,
29914,
29965,
29963,
22208,
396,
14402,
29901,
731,
701,
4770,
2344,
1649,
363,
1438,
3987,
13,
1678,
396,
739,
23880,
763,
445,
881,
367,
8052,
411,
4770,
2344,
1649,
408,
1532,
541,
1178,
29895,
13,
13,
1678,
822,
3918,
29918,
4914,
29918,
7039,
29898,
1311,
29897,
584,
13,
4706,
9995,
29931,
326,
1573,
740,
304,
3918,
895,
1897,
2983,
13,
13,
4706,
1932,
8363,
6131,
304,
671,
408,
278,
8405,
363,
263,
21220,
29928,
15806,
1591,
29892,
777,
4341,
1122,
505,
13,
4706,
10029,
2983,
304,
825,
338,
3806,
29889,
910,
740,
3918,
4637,
278,
2983,
541,
338,
1407,
13,
4706,
9078,
297,
4958,
310,
825,
372,
508,
5936,
895,
29889,
450,
1404,
338,
18443,
267,
304,
9801,
278,
4341,
13,
4706,
526,
5149,
3858,
839,
6053,
322,
451,
304,
19104,
373,
445,
740,
29889,
13,
13,
4706,
16969,
13,
4706,
448,
22158,
13,
4706,
21220,
29928,
15806,
13,
9651,
450,
1591,
756,
967,
1897,
2983,
9120,
29889,
13,
4706,
9995,
13,
4706,
15983,
29918,
8977,
29918,
24244,
353,
11117,
5228,
29915,
584,
6024,
29931,
9532,
316,
29188,
7464,
13,
9651,
525,
2539,
29915,
584,
6024,
2539,
7464,
13,
9651,
525,
2481,
29918,
2962,
29915,
584,
6024,
3868,
545,
13222,
3788,
4763,
29918,
2230,
3788,
4763,
931,
7464,
13,
9651,
525,
2481,
29918,
355,
29915,
584,
6024,
3868,
545,
1436,
3788,
5044,
29918,
2230,
3788,
5044,
931,
7464,
13,
9651,
525,
6816,
294,
2955,
29918,
29881,
852,
29915,
584,
6024,
1252,
3283,
518,
2303,
29928,
29962,
3788,
1252,
1066,
545,
7464,
13,
9651,
525,
2744,
21641,
29918,
8028,
29915,
584,
6024,
18482,
385,
8678,
1387,
3788,
8434,
760,
3788,
2744,
21641,
10640,
7464,
13,
9651,
525,
6747,
545,
29915,
584,
6024,
8434,
1400,
545,
7464,
13,
9651,
525,
13992,
4279,
29915,
584,
6024,
5066,
7464,
13,
9651,
525,
8208,
4279,
29915,
584,
6024,
12957,
3788,
29880,
865,
2033,
29913,
13,
4706,
15983,
29918,
8977,
353,
426,
8149,
29901,
2030,
29918,
8149,
363,
2030,
29918,
8149,
29892,
2030,
29918,
5975,
297,
15983,
29918,
8977,
29918,
24244,
29889,
7076,
580,
363,
6611,
297,
2030,
29918,
5975,
29913,
13,
4706,
1583,
353,
1583,
29889,
1267,
420,
29898,
13099,
29922,
26172,
29918,
8977,
29897,
13,
13,
4706,
736,
1583,
13,
13,
1678,
822,
20410,
29918,
23362,
29918,
735,
1066,
545,
29898,
1311,
29897,
584,
13,
4706,
9995,
5631,
1078,
14060,
545,
28598,
2540,
2183,
1369,
322,
1095,
3064,
29889,
13,
13,
4706,
910,
740,
16785,
14060,
545,
28598,
2540,
2729,
373,
2560,
9126,
14060,
545,
29892,
474,
29889,
29872,
29889,
13,
4706,
411,
263,
1369,
931,
322,
385,
1095,
931,
29889,
450,
14060,
545,
20410,
338,
263,
4608,
411,
3309,
29871,
29906,
29946,
13,
4706,
411,
1269,
6251,
15783,
278,
18618,
310,
278,
6590,
7234,
310,
278,
2462,
393,
13,
4706,
278,
4967,
338,
19884,
29889,
29871,
13,
13,
13,
4706,
16969,
13,
4706,
448,
22158,
13,
13,
4706,
3017,
29918,
29873,
4183,
29889,
10299,
928,
29928,
15806,
13,
9651,
530,
14060,
545,
29918,
816,
11272,
1897,
338,
2825,
322,
338,
623,
2760,
304,
278,
1881,
29871,
13,
9651,
421,
10299,
928,
29928,
15806,
29952,
1203,
470,
29892,
565,
393,
1897,
2307,
4864,
29892,
372,
338,
975,
17625,
29889,
13,
308,
13,
13,
4706,
8695,
13,
4706,
448,
807,
13,
13,
4706,
450,
1881,
421,
10299,
928,
29928,
15806,
29952,
1203,
1818,
1712,
278,
1494,
4341,
29901,
13,
4706,
334,
4954,
2481,
29918,
2962,
16159,
13,
4706,
334,
4954,
2481,
29918,
355,
16159,
13,
13,
13,
4706,
8741,
13,
4706,
448,
22158,
13,
13,
4706,
512,
445,
1342,
29892,
591,
28475,
278,
1889,
363,
25202,
278,
3248,
267,
297,
20349,
634,
394,
29889,
29871,
29906,
29900,
29906,
29896,
13,
4706,
313,
991,
597,
1867,
29875,
29889,
990,
29914,
29896,
29900,
29889,
29941,
29941,
29929,
29900,
29914,
271,
7681,
29896,
29906,
29900,
29906,
29900,
29906,
29953,
29947,
29897,
515,
278,
9677,
9855,
19056,
408,
1462,
944,
653,
29871,
13,
4706,
848,
313,
991,
597,
1636,
29889,
3487,
1631,
29889,
510,
29914,
29906,
29900,
29955,
29941,
29899,
29946,
29946,
29941,
29941,
29914,
29896,
29906,
29914,
29906,
29914,
29906,
29953,
29947,
29914,
29879,
29896,
467,
3940,
393,
2582,
674,
1163,
408,
278,
13,
4706,
9677,
9855,
3743,
871,
1887,
26182,
931,
322,
451,
17998,
931,
29889,
1670,
526,
3023,
4100,
13,
4706,
3168,
408,
760,
310,
445,
770,
29892,
2211,
363,
3918,
5921,
322,
10223,
292,
278,
4341,
29892,
13,
4706,
322,
697,
363,
2869,
8363,
278,
848,
322,
15859,
278,
437,
344,
17203,
29889,
2823,
2400,
1057,
13,
13,
9651,
1053,
3017,
29918,
29873,
4183,
408,
19592,
13,
9651,
1053,
11701,
408,
10518,
13,
9651,
1342,
353,
19592,
29889,
10299,
928,
29928,
15806,
29898,
15926,
29889,
949,
29918,
24633,
29898,
29878,
29915,
271,
7681,
9085,
29899,
29896,
29906,
29899,
29900,
29900,
29906,
29953,
29947,
29899,
29879,
29900,
29900,
29896,
29889,
20267,
29916,
742,
13,
462,
462,
462,
1678,
4839,
29922,
29906,
29892,
2248,
29918,
1054,
29922,
29900,
29892,
1509,
22724,
543,
29933,
29901,
29968,
5783,
13,
9651,
1342,
29889,
4351,
29918,
12322,
353,
525,
29907,
8419,
5893,
29918,
1552,
29918,
12322,
29918,
974,
29918,
8066,
29918,
24713,
29918,
4150,
29915,
13,
9651,
1342,
353,
1342,
29889,
15770,
29918,
4914,
29918,
7039,
580,
29871,
13,
9651,
1342,
353,
1342,
29889,
816,
11272,
29918,
23362,
29918,
735,
1066,
545,
2141,
1001,
29918,
3166,
29918,
2490,
545,
580,
13,
9651,
1342,
353,
1342,
29889,
15807,
403,
29918,
14940,
29918,
29881,
852,
580,
13,
13,
13,
4706,
9995,
13,
13,
4706,
822,
20410,
29918,
23362,
29918,
735,
1066,
545,
29918,
1524,
29898,
4763,
29918,
2230,
29892,
5044,
29918,
2230,
29897,
584,
13,
9651,
9995,
13463,
1078,
1549,
4206,
310,
263,
21220,
29928,
15806,
1591,
304,
5706,
28598,
2540,
29889,
13,
13,
9651,
910,
740,
338,
8688,
304,
367,
7436,
304,
1269,
1948,
297,
263,
1418,
17219,
304,
5706,
385,
13,
9651,
14060,
545,
20410,
2729,
373,
263,
1369,
931,
322,
1095,
931,
13,
13,
9651,
12662,
2699,
13,
9651,
448,
1378,
29899,
13,
9651,
7370,
29918,
2230,
584,
12865,
29889,
2230,
13,
18884,
17998,
931,
472,
607,
14060,
545,
3785,
16410,
13,
9651,
2796,
29918,
2230,
584,
12865,
29889,
2230,
13,
18884,
17998,
931,
472,
607,
14060,
545,
3785,
1095,
13,
13,
9651,
16969,
13,
9651,
448,
22158,
13,
9651,
12655,
29889,
2378,
13,
462,
29906,
29946,
3309,
4608,
310,
1819,
1546,
29871,
29900,
322,
29871,
29896,
23941,
18618,
29871,
13,
18884,
310,
931,
19884,
363,
393,
6590,
7234,
310,
278,
2462,
29889,
13,
13,
13,
9651,
9995,
13,
13,
9651,
20410,
353,
7442,
29889,
3298,
359,
29898,
29906,
29946,
29897,
13,
9651,
20410,
29961,
4763,
29918,
2230,
29889,
18721,
29901,
5044,
29918,
2230,
29889,
18721,
29962,
353,
29871,
29896,
13,
13,
9651,
396,
3382,
1598,
1369,
322,
1095,
6199,
5034,
304,
18618,
310,
931,
19884,
13,
9651,
565,
7370,
29918,
2230,
29889,
1195,
1082,
2804,
29871,
29900,
584,
13,
18884,
20410,
29961,
4763,
29918,
2230,
29889,
18721,
29962,
353,
313,
29896,
448,
7370,
29918,
2230,
29889,
1195,
1082,
29914,
29953,
29900,
29897,
13,
13,
9651,
565,
2796,
29918,
2230,
29889,
1195,
1082,
2804,
29871,
29900,
584,
13,
18884,
20410,
29961,
5044,
29918,
2230,
29889,
18721,
29962,
353,
2796,
29918,
2230,
29889,
1195,
1082,
29914,
29953,
29900,
29871,
13,
13,
9651,
736,
20410,
13,
4706,
396,
2973,
393,
740,
3342,
29892,
591,
817,
925,
697,
1196,
304,
3394,
372,
304,
278,
3353,
1591,
13,
4706,
1583,
3366,
4504,
11272,
3108,
353,
1583,
29889,
7302,
29898,
2892,
921,
29901,
20410,
29918,
23362,
29918,
735,
1066,
545,
29918,
1524,
29898,
13,
9651,
921,
3366,
2481,
29918,
2962,
12436,
29916,
3366,
2481,
29918,
355,
3108,
511,
8990,
2433,
13099,
1495,
13,
4706,
736,
1583,
13,
268,
13,
1678,
822,
8982,
29918,
3166,
29918,
2490,
545,
29898,
1311,
29892,
13,
1678,
5741,
29918,
2371,
29918,
2084,
29922,
8516,
29892,
13,
1678,
5741,
29918,
2371,
29922,
8516,
29897,
584,
13,
4706,
9995,
1001,
29918,
3166,
29918,
2490,
545,
3408,
1078,
1222,
1066,
545,
390,
2219,
359,
363,
263,
2183,
385,
21641,
10640,
29892,
1400,
545,
29892,
322,
2635,
29889,
13,
13,
4706,
910,
740,
3408,
1078,
8982,
408,
263,
19649,
1546,
29871,
29900,
322,
29871,
29896,
29900,
29900,
2729,
373,
2472,
515,
385,
1881,
1591,
29889,
13,
4706,
450,
1881,
1591,
1818,
1712,
3058,
4341,
472,
263,
9212,
29889,
16025,
526,
29901,
4712,
29892,
530,
21641,
29918,
8028,
29892,
322,
4918,
545,
29889,
13,
4706,
910,
740,
3743,
2898,
29899,
29659,
5222,
4735,
29879,
363,
3058,
385,
8678,
936,
20542,
29892,
321,
29889,
29887,
29889,
525,
29943,
487,
2813,
29908,
11053,
304,
376,
23360,
4286,
13,
4706,
2823,
1798,
16617,
634,
394,
1696,
8237,
310,
1222,
1066,
545,
9327,
322,
16738,
284,
14055,
680,
2460,
3002,
313,
29906,
29900,
29896,
29945,
29897,
29871,
29906,
29945,
29892,
29871,
29896,
29896,
29941,
29994,
29896,
29896,
29947,
29871,
13,
4706,
313,
991,
597,
1867,
29875,
29889,
990,
29914,
29896,
29900,
29889,
29896,
29900,
29941,
29947,
29914,
10246,
29889,
29906,
29900,
29896,
29946,
29889,
29953,
29897,
363,
4340,
4902,
373,
278,
1904,
1304,
363,
278,
13944,
29889,
13,
13,
13,
4706,
12662,
2699,
13,
4706,
448,
1378,
29899,
13,
13,
4706,
5741,
29918,
2371,
29918,
2084,
584,
851,
29892,
13136,
13,
9651,
450,
2989,
2224,
304,
385,
8671,
1591,
363,
278,
5741,
3443,
29889,
29871,
13,
18884,
19928,
367,
263,
11799,
934,
29889,
13109,
29879,
304,
6213,
29889,
13,
4706,
5741,
29918,
2371,
584,
851,
29892,
13136,
13,
9651,
530,
8671,
1591,
363,
278,
5741,
3443,
29889,
13109,
29879,
304,
6213,
29889,
13,
13,
13,
4706,
16969,
13,
4706,
448,
22158,
13,
13,
4706,
21220,
29928,
15806,
13,
9651,
16969,
1881,
1591,
623,
2760,
411,
8982,
1897,
13,
13,
13,
4706,
8695,
13,
4706,
448,
807,
13,
13,
4706,
450,
21220,
29928,
15806,
1591,
1304,
1818,
1712,
4341,
363,
4712,
29892,
530,
21641,
29918,
8028,
29892,
322,
4918,
545,
29889,
13,
4706,
450,
4712,
1897,
881,
1712,
12315,
9976,
29889,
450,
530,
271,
8927,
29918,
8028,
1897,
881,
1712,
697,
1347,
639,
29871,
13,
4706,
1948,
20766,
278,
19884,
3573,
760,
29889,
450,
4918,
545,
1897,
881,
1712,
697,
1347,
639,
1948,
20766,
29871,
13,
4706,
697,
310,
4832,
9259,
1400,
1973,
29889,
13,
13,
13,
4706,
8741,
13,
4706,
448,
22158,
13,
13,
4706,
512,
445,
1342,
29892,
591,
28475,
278,
1889,
363,
25202,
278,
3248,
267,
297,
20349,
634,
394,
29889,
29871,
29906,
29900,
29906,
29896,
13,
4706,
313,
991,
597,
1867,
29875,
29889,
990,
29914,
29896,
29900,
29889,
29941,
29941,
29929,
29900,
29914,
271,
7681,
29896,
29906,
29900,
29906,
29900,
29906,
29953,
29947,
29897,
515,
278,
9677,
9855,
19056,
408,
1462,
944,
653,
29871,
13,
4706,
848,
313,
991,
597,
1636,
29889,
3487,
1631,
29889,
510,
29914,
29906,
29900,
29955,
29941,
29899,
29946,
29946,
29941,
29941,
29914,
29896,
29906,
29914,
29906,
29914,
29906,
29953,
29947,
29914,
29879,
29896,
467,
3940,
393,
2582,
674,
1163,
408,
278,
13,
4706,
9677,
9855,
3743,
871,
1887,
26182,
931,
322,
451,
17998,
931,
29889,
1670,
526,
3023,
4100,
13,
4706,
3168,
408,
760,
310,
445,
770,
29892,
2211,
363,
3918,
5921,
322,
10223,
292,
278,
4341,
29892,
13,
4706,
322,
697,
363,
2869,
8363,
278,
848,
322,
15859,
278,
437,
344,
17203,
29889,
2823,
2400,
1057,
13,
13,
9651,
1053,
3017,
29918,
29873,
4183,
408,
19592,
13,
9651,
1053,
11701,
408,
10518,
13,
9651,
1342,
353,
19592,
29889,
10299,
928,
29928,
15806,
29898,
15926,
29889,
949,
29918,
24633,
29898,
29878,
29915,
271,
7681,
9085,
29899,
29896,
29906,
29899,
29900,
29900,
29906,
29953,
29947,
29899,
29879,
29900,
29900,
29896,
29889,
20267,
29916,
742,
13,
462,
462,
462,
1678,
4839,
29922,
29906,
29892,
2248,
29918,
1054,
29922,
29900,
29892,
1509,
22724,
543,
29933,
29901,
29968,
5783,
13,
9651,
1342,
29889,
4351,
29918,
12322,
353,
525,
29907,
8419,
5893,
29918,
1552,
29918,
12322,
29918,
974,
29918,
8066,
29918,
24713,
29918,
4150,
29915,
13,
9651,
1342,
353,
1342,
29889,
15770,
29918,
4914,
29918,
7039,
580,
29871,
13,
9651,
1342,
353,
1342,
29889,
816,
11272,
29918,
23362,
29918,
735,
1066,
545,
2141,
1001,
29918,
3166,
29918,
2490,
545,
580,
13,
9651,
1342,
353,
1342,
29889,
15807,
403,
29918,
14940,
29918,
29881,
852,
580,
13,
13,
13,
4706,
9995,
13,
13,
4706,
396,
910,
19875,
310,
775,
12747,
565,
278,
2322,
5741,
1591,
881,
367,
1304,
470,
565,
278,
1404,
24395,
777,
8671,
1591,
29889,
13,
4706,
565,
5741,
29918,
2371,
338,
6213,
322,
5741,
29918,
2371,
29918,
2084,
338,
6213,
584,
13,
9651,
5741,
29918,
2371,
353,
10518,
29889,
17271,
29889,
3166,
29918,
3757,
4339,
29898,
13,
18884,
4341,
29922,
1839,
2008,
630,
3788,
29968,
484,
14067,
3788,
11042,
292,
14737,
312,
10188,
1623,
3788,
11042,
292,
14737,
312,
10188,
701,
3788,
11042,
292,
12580,
292,
7464,
13,
18884,
2380,
29922,
1839,
23360,
3788,
15797,
913,
3788,
29943,
487,
2817,
3788,
26214,
5075,
3788,
8139,
384,
3788,
7031,
310,
26671,
3788,
29933,
14112,
3788,
26214,
1250,
3788,
3481,
3788,
26857,
261,
3788,
26214,
2814,
3788,
19357,
2814,
3788,
19357,
1250,
7464,
13,
18884,
848,
29922,
8999,
29945,
29941,
29889,
29955,
29892,
29906,
29947,
29889,
29955,
29892,
29946,
29953,
29889,
29953,
29892,
29946,
29946,
29889,
29929,
29892,
29896,
29929,
29889,
29906,
1402,
13,
462,
1678,
518,
29945,
29953,
29889,
29906,
29892,
29953,
29953,
29889,
29953,
29892,
29953,
29896,
29889,
29896,
29892,
29945,
29947,
29889,
29946,
29892,
29953,
29955,
29889,
29945,
1402,
13,
462,
1678,
518,
29953,
29906,
29889,
29941,
29892,
29945,
29953,
29889,
29945,
29892,
29946,
29929,
29889,
29946,
29892,
29945,
29941,
29889,
29896,
29892,
29953,
29906,
29889,
29896,
1402,
13,
462,
1678,
518,
29945,
29896,
29889,
29955,
29892,
29953,
29900,
29889,
29945,
29892,
29946,
29945,
29889,
29929,
29892,
29953,
29945,
29889,
29941,
29892,
29953,
29896,
29889,
29953,
1402,
13,
462,
1678,
518,
29945,
29947,
29889,
29941,
29892,
29947,
29946,
29889,
29941,
29892,
29953,
29955,
29889,
29953,
29892,
29953,
29945,
29889,
29906,
29892,
29947,
29896,
29889,
29953,
1402,
13,
462,
1678,
518,
29941,
29945,
29889,
29929,
29892,
29945,
29900,
29889,
29941,
29892,
29946,
29947,
29889,
29953,
29892,
29946,
29945,
29889,
29955,
29892,
29947,
29945,
29889,
29941,
1402,
13,
462,
1678,
518,
29945,
29947,
29889,
29896,
29892,
29946,
29945,
29889,
29896,
29892,
29945,
29900,
29889,
29941,
29892,
29946,
29929,
29889,
29953,
29892,
29896,
29945,
29889,
29906,
1402,
13,
462,
1678,
518,
29941,
29945,
29889,
29929,
29892,
29945,
29900,
29889,
29941,
29892,
29946,
29947,
29889,
29953,
29892,
29946,
29945,
29889,
29955,
29892,
29947,
29945,
29889,
29941,
1402,
13,
462,
1678,
518,
29945,
29929,
29889,
29906,
29892,
29945,
29947,
29889,
29947,
29892,
29946,
29906,
29889,
29946,
29892,
29945,
29945,
29892,
29945,
29947,
29889,
29945,
1402,
13,
462,
1678,
518,
29953,
29947,
29892,
29953,
29906,
29892,
29953,
29941,
29892,
29953,
29955,
29889,
29896,
29892,
29953,
29946,
1402,
13,
462,
1678,
518,
29953,
29945,
29889,
29946,
29892,
29946,
29945,
29889,
29946,
29892,
29945,
29900,
29889,
29929,
29892,
29945,
29896,
29892,
29946,
29941,
29889,
29945,
1402,
13,
462,
1678,
518,
29941,
29906,
29889,
29947,
29892,
29953,
29941,
29889,
29946,
29892,
29946,
29929,
29889,
29955,
29892,
29945,
29900,
29889,
29941,
29892,
29945,
29900,
1402,
13,
462,
1678,
518,
29946,
29946,
29889,
29929,
29892,
29945,
29896,
29889,
29953,
29892,
29945,
29953,
29889,
29953,
29892,
29945,
29941,
29889,
29946,
29892,
29947,
29953,
29889,
29929,
24960,
13,
9651,
396,
450,
525,
11235,
8401,
29915,
1400,
545,
1818,
367,
316,
1997,
411,
10431,
856,
13,
9651,
396,
5741,
29918,
2371,
1839,
11042,
292,
8401,
2033,
29922,
313,
6116,
29918,
2371,
1839,
11042,
292,
14737,
312,
10188,
1623,
2033,
718,
5741,
29918,
2371,
1839,
11042,
292,
12580,
292,
11287,
847,
29871,
29906,
13,
9651,
396,
14402,
29901,
788,
1006,
29886,
1308,
470,
4889,
4160,
304,
14670,
29973,
13,
9651,
5741,
29918,
2371,
1839,
11042,
292,
8401,
2033,
29922,
5741,
29918,
2371,
1839,
11042,
292,
14737,
312,
10188,
1623,
2033,
29871,
13,
4706,
25342,
5741,
29918,
2371,
338,
6213,
584,
13,
9651,
5741,
29918,
2371,
353,
10518,
29889,
949,
29918,
7638,
29898,
6116,
29918,
2371,
29918,
2084,
29897,
13,
13,
4706,
396,
13866,
338,
263,
8600,
20766,
263,
3464,
310,
5222,
4735,
29879,
363,
278,
385,
8678,
936,
20542,
3342,
297,
278,
5741,
1591,
29889,
13,
4706,
530,
21641,
29918,
8028,
29918,
19274,
4735,
29879,
29918,
24244,
353,
426,
13,
9651,
525,
29943,
487,
2817,
29915,
584,
6024,
29893,
2021,
742,
13,
462,
308,
525,
8091,
3622,
28373,
742,
13,
462,
308,
525,
7341,
3622,
28373,
742,
13,
462,
308,
525,
8091,
281,
2021,
29901,
11855,
2343,
742,
13,
462,
308,
525,
7341,
281,
2021,
29901,
11855,
2343,
742,
13,
462,
308,
525,
8091,
281,
2021,
742,
13,
462,
308,
525,
7341,
281,
2021,
7464,
13,
9651,
525,
23360,
29915,
584,
6024,
29943,
487,
2813,
7464,
13,
9651,
525,
26214,
1250,
29915,
584,
6024,
7341,
1020,
412,
2502,
333,
742,
13,
462,
9651,
525,
8091,
1020,
412,
2502,
333,
742,
13,
462,
9651,
525,
3018,
14001,
2482,
7464,
13,
9651,
525,
29933,
14112,
29915,
584,
6024,
1451,
342,
7464,
13,
9651,
525,
26857,
261,
29915,
584,
6024,
8091,
628,
517,
333,
742,
13,
462,
3986,
525,
7341,
628,
517,
333,
742,
13,
462,
3986,
525,
8091,
23468,
742,
13,
462,
3986,
525,
7341,
23468,
7464,
13,
9651,
525,
26214,
5075,
29915,
584,
6024,
8091,
560,
17729,
742,
13,
462,
965,
525,
7341,
560,
17729,
742,
13,
462,
965,
525,
8091,
289,
625,
567,
742,
13,
462,
965,
525,
7341,
289,
625,
567,
7464,
13,
9651,
525,
26214,
2814,
29915,
584,
6024,
8091,
266,
1141,
742,
13,
462,
965,
525,
7341,
266,
1141,
742,
13,
462,
965,
525,
8091,
17905,
29872,
742,
13,
462,
965,
525,
7341,
17905,
29872,
7464,
13,
9651,
525,
19357,
1250,
29915,
584,
6024,
29931,
340,
1250,
2033,
13,
4706,
500,
13,
4706,
396,
450,
8600,
338,
18764,
287,
577,
393,
278,
2999,
5222,
4735,
29879,
508,
367,
20545,
304,
278,
2846,
1959,
4958,
363,
278,
5741,
1591,
29889,
13,
4706,
530,
21641,
29918,
8028,
29918,
19274,
4735,
29879,
353,
426,
8149,
29901,
2030,
29918,
8149,
363,
2030,
29918,
8149,
29892,
2030,
29918,
5975,
297,
530,
21641,
29918,
8028,
29918,
19274,
4735,
29879,
29918,
24244,
29889,
7076,
580,
363,
6611,
297,
2030,
29918,
5975,
29913,
13,
13,
4706,
1583,
353,
1583,
29889,
6506,
3319,
29915,
2744,
21641,
29918,
8028,
29915,
584,
530,
21641,
29918,
8028,
29918,
19274,
4735,
29879,
1800,
13,
13,
4706,
396,
2973,
278,
1959,
385,
21641,
10640,
2983,
7841,
29892,
591,
508,
16280,
278,
5741,
1819,
515,
278,
1591,
13,
4706,
396,
14402,
29901,
16280,
338,
1641,
1401,
4361,
630,
29892,
1818,
5191,
411,
1554,
716,
13,
4706,
5741,
353,
5741,
29918,
2371,
29889,
20401,
29898,
1311,
1839,
2744,
21641,
29918,
8028,
7464,
1311,
1839,
6747,
545,
11287,
13,
13,
4706,
396,
8084,
591,
1818,
8147,
278,
13114,
4956,
279,
796,
264,
389,
3218,
280,
363,
278,
2183,
2635,
13,
4706,
286,
29903,
29999,
29909,
353,
1375,
29918,
2929,
279,
29918,
2256,
389,
29918,
2521,
29898,
1311,
29889,
2539,
29892,
1311,
29889,
13992,
4279,
29897,
13,
13,
4706,
396,
2973,
278,
5741,
995,
322,
278,
317,
29999,
29909,
29892,
591,
508,
8147,
278,
8982,
5034,
304,
278,
1798,
16617,
1904,
13,
4706,
1583,
29889,
2029,
7503,
5501,
1001,
2033,
353,
8982,
29918,
6565,
16617,
29918,
4299,
29918,
2573,
29898,
6116,
29892,
29885,
29903,
29999,
29909,
29897,
847,
29871,
29896,
29900,
29900,
13,
13,
4706,
736,
1583,
13,
13,
1678,
822,
8147,
29918,
14940,
29918,
29881,
852,
29898,
1311,
29897,
584,
13,
4706,
9995,
27065,
1078,
3248,
267,
5034,
304,
14060,
545,
20410,
29892,
8982,
29892,
2635,
29892,
322,
4423,
29889,
13,
13,
4706,
910,
740,
4893,
278,
21220,
29928,
852,
12787,
7715,
3562,
322,
3408,
1078,
278,
2702,
29871,
13,
4706,
25040,
322,
7333,
3248,
267,
5034,
304,
278,
14060,
545,
20410,
322,
8982,
29889,
1670,
526,
13,
4706,
263,
2846,
1820,
6576,
304,
445,
740,
29889,
3824,
372,
13623,
278,
4712,
1897,
304,
8161,
29871,
13,
4706,
607,
2440,
310,
848,
1818,
367,
7500,
29889,
739,
769,
4256,
1078,
1549,
1269,
1629,
29892,
8363,
13,
4706,
871,
278,
5181,
10116,
29889,
739,
16058,
278,
14060,
545,
20410,
322,
278,
8982,
304,
29871,
13,
4706,
8147,
278,
25040,
322,
7333,
3248,
267,
29889,
13,
13,
13,
4706,
16969,
13,
4706,
448,
22158,
13,
13,
4706,
21220,
29928,
15806,
13,
9651,
450,
1881,
1591,
338,
623,
2760,
411,
263,
15145,
993,
29918,
29881,
852,
322,
16224,
29918,
29881,
852,
1897,
29889,
13,
308,
13,
13,
4706,
8695,
13,
4706,
448,
807,
13,
13,
4706,
450,
1881,
21220,
29928,
15806,
1203,
1818,
3160,
4712,
29892,
1102,
11272,
29892,
8982,
29892,
7053,
4279,
29892,
13,
4706,
322,
6242,
4279,
4341,
29889,
13,
4706,
2138,
499,
20349,
634,
394,
29889,
29871,
29906,
29900,
29906,
29896,
313,
991,
597,
1867,
29875,
29889,
990,
29914,
29896,
29900,
29889,
29941,
29941,
29929,
29900,
29914,
271,
7681,
29896,
29906,
29900,
29906,
29900,
29906,
29953,
29947,
29897,
363,
901,
29871,
13,
4706,
2472,
373,
920,
445,
740,
508,
367,
1304,
297,
278,
3030,
310,
286,
326,
860,
292,
501,
29963,
13,
4706,
3248,
17528,
719,
20398,
29889,
13,
13,
13,
4706,
8741,
13,
4706,
448,
22158,
13,
13,
4706,
512,
445,
1342,
29892,
591,
28475,
278,
1889,
363,
25202,
278,
3248,
267,
297,
20349,
634,
394,
29889,
29871,
29906,
29900,
29906,
29896,
13,
4706,
313,
991,
597,
1867,
29875,
29889,
990,
29914,
29896,
29900,
29889,
29941,
29941,
29929,
29900,
29914,
271,
7681,
29896,
29906,
29900,
29906,
29900,
29906,
29953,
29947,
29897,
515,
278,
9677,
9855,
19056,
408,
1462,
944,
653,
29871,
13,
4706,
848,
313,
991,
597,
1636,
29889,
3487,
1631,
29889,
510,
29914,
29906,
29900,
29955,
29941,
29899,
29946,
29946,
29941,
29941,
29914,
29896,
29906,
29914,
29906,
29914,
29906,
29953,
29947,
29914,
29879,
29896,
467,
3940,
393,
2582,
674,
1163,
408,
278,
13,
4706,
9677,
9855,
3743,
871,
1887,
26182,
931,
322,
451,
17998,
931,
29889,
1670,
526,
3023,
4100,
13,
4706,
3168,
408,
760,
310,
445,
770,
29892,
2211,
363,
3918,
5921,
322,
10223,
292,
278,
4341,
29892,
13,
4706,
322,
697,
363,
2869,
8363,
278,
848,
322,
15859,
278,
437,
344,
17203,
29889,
2823,
2400,
1057,
13,
13,
9651,
1053,
3017,
29918,
29873,
4183,
408,
19592,
13,
9651,
1053,
11701,
408,
10518,
13,
9651,
1342,
353,
19592,
29889,
10299,
928,
29928,
15806,
29898,
15926,
29889,
949,
29918,
24633,
29898,
29878,
29915,
271,
7681,
9085,
29899,
29896,
29906,
29899,
29900,
29900,
29906,
29953,
29947,
29899,
29879,
29900,
29900,
29896,
29889,
20267,
29916,
742,
13,
462,
462,
462,
1678,
4839,
29922,
29906,
29892,
2248,
29918,
1054,
29922,
29900,
29892,
1509,
22724,
543,
29933,
29901,
29968,
5783,
13,
9651,
1342,
29889,
4351,
29918,
12322,
353,
525,
29907,
8419,
5893,
29918,
1552,
29918,
12322,
29918,
974,
29918,
8066,
29918,
24713,
29918,
4150,
29915,
13,
9651,
1342,
353,
1342,
29889,
15770,
29918,
4914,
29918,
7039,
580,
29871,
13,
9651,
1342,
353,
1342,
29889,
816,
11272,
29918,
23362,
29918,
735,
1066,
545,
2141,
1001,
29918,
3166,
29918,
2490,
545,
580,
13,
9651,
1342,
353,
1342,
29889,
15807,
403,
29918,
14940,
29918,
29881,
852,
580,
13,
13,
13,
4706,
9995,
13,
13,
4706,
396,
3824,
4331,
338,
1284,
5412,
2440,
304,
4772,
8363,
19039,
848,
13,
4706,
2440,
353,
10518,
29889,
16390,
5410,
3220,
29898,
1311,
29889,
2539,
467,
6360,
13,
4706,
5412,
29918,
6360,
29879,
353,
12705,
29898,
842,
29898,
6360,
29879,
876,
13,
13,
4706,
1583,
1839,
6833,
29890,
993,
29918,
29881,
852,
2033,
353,
7442,
29889,
13707,
29871,
13,
4706,
1583,
1839,
7435,
284,
29918,
29881,
852,
2033,
353,
7442,
29889,
13707,
13,
13,
4706,
363,
1629,
297,
5412,
29918,
6360,
29879,
584,
13,
9651,
396,
16012,
7787,
29907,
4037,
934,
13,
9651,
1596,
703,
7032,
292,
1629,
15691,
710,
29898,
6360,
876,
29871,
13,
9651,
8783,
29922,
17608,
29889,
16390,
24541,
29898,
1311,
29889,
4351,
29918,
12322,
29974,
1311,
29889,
4351,
29918,
9507,
29918,
4830,
29889,
6506,
877,
18855,
742,
710,
29898,
6360,
4961,
29871,
13,
9651,
8783,
29889,
842,
29918,
6921,
29918,
13168,
29898,
8824,
29897,
396,
910,
338,
4100,
363,
302,
550,
304,
1053,
5149,
13,
13,
9651,
396,
8561,
13201,
1591,
363,
1629,
368,
11306,
13,
9651,
5694,
29918,
2371,
353,
1583,
29961,
6360,
29879,
1275,
1629,
1822,
8552,
580,
13,
13,
9651,
396,
1284,
599,
5412,
3841,
297,
1629,
304,
367,
7500,
13,
9651,
5412,
29918,
16700,
29892,
13092,
29918,
16700,
29918,
13140,
353,
7442,
29889,
13092,
29898,
15926,
29889,
16390,
5410,
3220,
29898,
7382,
29918,
2371,
29889,
2539,
467,
3250,
974,
6360,
29892,
13,
18884,
736,
29918,
262,
3901,
29922,
5574,
29897,
13,
9651,
5694,
29918,
2371,
1839,
13092,
29918,
16700,
29918,
13140,
2033,
353,
5412,
29918,
16700,
29918,
13140,
13,
13,
9651,
396,
15926,
29889,
16390,
5410,
3220,
29898,
17608,
29889,
1949,
29906,
1256,
29898,
24713,
29889,
20897,
3366,
2230,
3108,
7503,
1402,
24713,
29889,
20897,
3366,
2230,
16862,
348,
1169,
29892,
6194,
29918,
1509,
29918,
29883,
615,
603,
29918,
4130,
300,
1355,
29922,
8824,
876,
13,
13,
9651,
565,
8783,
29889,
6229,
5580,
1839,
2230,
13359,
2311,
1275,
29871,
29906,
29946,
584,
13,
18884,
396,
4312,
565,
925,
263,
2323,
2462,
13,
18884,
931,
29918,
6484,
353,
518,
5574,
363,
474,
297,
3464,
29898,
24713,
29889,
6229,
5580,
1839,
2230,
13359,
2311,
4638,
13,
9651,
1683,
584,
13,
18884,
396,
8084,
591,
8206,
263,
11306,
515,
278,
7787,
29907,
4037,
934,
13,
18884,
396,
9607,
2089,
1409,
411,
1021,
3309,
310,
931,
9927,
515,
7787,
29907,
4037,
13,
18884,
931,
29918,
6484,
353,
518,
8824,
363,
474,
297,
3464,
29898,
24713,
29889,
6229,
5580,
1839,
2230,
13359,
2311,
4638,
29871,
13,
18884,
396,
620,
14443,
2089,
1409,
304,
505,
937,
9927,
29871,
29906,
29946,
313,
29882,
2470,
297,
2462,
29897,
13,
18884,
931,
29918,
6484,
353,
4974,
29918,
1272,
29918,
12181,
29918,
29906,
29946,
29898,
2230,
29918,
6484,
29897,
29871,
13,
18884,
396,
731,
278,
8210,
3841,
408,
1565,
13,
18884,
931,
29918,
6484,
7503,
29892,
13092,
29918,
16700,
29899,
29896,
29962,
353,
5852,
29871,
13,
18884,
396,
1652,
8606,
931,
29918,
6484,
1409,
1250,
304,
697,
9927,
13,
18884,
931,
29918,
6484,
353,
931,
29918,
6484,
29889,
1579,
8606,
29898,
2098,
2433,
29943,
1495,
13,
13,
9651,
848,
353,
4974,
29918,
1272,
29918,
12181,
29918,
29906,
29946,
29898,
24713,
1839,
29965,
29963,
29918,
3289,
2033,
29961,
2230,
29918,
6484,
29892,
29901,
29892,
29901,
2314,
29871,
13,
9651,
396,
14402,
29901,
11157,
15171,
2673,
310,
10650,
848,
10340,
3265,
1135,
10241,
13,
13,
9651,
396,
3588,
3405,
23123,
964,
15526,
10350,
13,
9651,
396,
14402,
29901,
2050,
338,
5181,
304,
2254,
4152,
11053,
363,
925,
263,
2846,
3734,
17036,
13,
9651,
3405,
353,
8783,
1839,
5066,
2033,
7503,
29962,
13,
9651,
23123,
353,
8783,
1839,
12957,
2033,
7503,
29962,
13,
9651,
5694,
29918,
2371,
1839,
29886,
15711,
29918,
5066,
2033,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
18884,
1284,
29918,
28502,
342,
29898,
5066,
29892,
29916,
1839,
13992,
4279,
2033,
511,
8990,
2433,
13099,
1495,
13,
9651,
5694,
29918,
2371,
1839,
29886,
15711,
29918,
12957,
2033,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
18884,
1284,
29918,
28502,
342,
29898,
12957,
29892,
29916,
1839,
8208,
4279,
2033,
511,
8990,
2433,
13099,
1495,
13,
13,
632,
13,
9651,
396,
8147,
3248,
267,
13,
9651,
5694,
29918,
2371,
1839,
6833,
29890,
993,
29918,
29881,
852,
2033,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
18884,
7442,
29889,
2083,
29898,
1272,
7503,
29892,
29916,
1839,
13092,
29918,
16700,
29918,
13140,
7464,
29916,
1839,
29886,
15711,
29918,
5066,
7464,
29916,
1839,
29886,
15711,
29918,
12957,
2033,
29962,
334,
29871,
13,
462,
1678,
921,
1839,
4504,
11272,
2033,
511,
8990,
2433,
13099,
1495,
13,
9651,
5694,
29918,
2371,
1839,
7435,
284,
29918,
29881,
852,
2033,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
18884,
7442,
29889,
2083,
29898,
1272,
7503,
29892,
29916,
1839,
13092,
29918,
16700,
29918,
13140,
7464,
29916,
1839,
29886,
15711,
29918,
5066,
7464,
29916,
1839,
29886,
15711,
29918,
12957,
2033,
29962,
334,
29871,
13,
462,
1678,
313,
29916,
1839,
4504,
11272,
2033,
334,
921,
1839,
1001,
2033,
8243,
8990,
2433,
13099,
1495,
13,
13,
9651,
396,
4805,
4331,
5181,
304,
9801,
1959,
12827,
13,
9651,
1583,
29889,
2029,
29961,
7382,
29918,
2371,
29889,
2248,
5501,
6833,
29890,
993,
29918,
29881,
852,
2033,
353,
5694,
29918,
2371,
1839,
6833,
29890,
993,
29918,
29881,
852,
13359,
5975,
13,
9651,
1583,
29889,
2029,
29961,
7382,
29918,
2371,
29889,
2248,
5501,
7435,
284,
29918,
29881,
852,
2033,
353,
5694,
29918,
2371,
1839,
7435,
284,
29918,
29881,
852,
13359,
5975,
13,
13,
4706,
396,
14402,
29901,
11157,
10340,
3987,
1244,
13,
4706,
1583,
1839,
6833,
29890,
993,
29918,
29881,
852,
2033,
353,
1583,
1839,
6833,
29890,
993,
29918,
29881,
852,
2033,
29914,
29946,
29900,
29930,
29941,
29953,
29900,
29900,
29914,
29896,
29900,
29900,
396,
317,
3352,
13,
4706,
1583,
1839,
7435,
284,
29918,
29881,
852,
2033,
353,
1583,
1839,
7435,
284,
29918,
29881,
852,
2033,
29914,
29946,
29900,
29930,
29941,
29953,
29900,
29900,
29914,
29896,
29900,
29900,
396,
317,
3352,
13,
4706,
736,
1583,
308,
13,
13,
13,
13,
13,
13,
1678,
822,
16455,
344,
29918,
11918,
29898,
1311,
29892,
13,
1678,
2286,
543,
29965,
29963,
29918,
3289,
613,
13,
1678,
1002,
4695,
543,
6816,
273,
613,
13,
1678,
4765,
29918,
9507,
29918,
4830,
29922,
8516,
29892,
13,
1678,
4765,
29918,
12322,
29922,
8516,
29897,
584,
13,
4706,
9995,
16616,
17203,
363,
2702,
14060,
545,
8871,
13,
13,
4706,
910,
740,
338,
363,
25202,
2472,
916,
1135,
25040,
322,
7333,
13,
4706,
3248,
267,
393,
16161,
304,
2702,
14060,
545,
8871,
29889,
29871,
13,
13,
13,
4706,
12662,
2699,
13,
4706,
448,
1378,
29899,
13,
4706,
2286,
584,
851,
29892,
13136,
13,
9651,
450,
1024,
310,
278,
2286,
304,
367,
3483,
952,
287,
29889,
910,
1871,
29879,
825,
848,
881,
367,
13,
9651,
20043,
515,
278,
2752,
7787,
29907,
4037,
2066,
29889,
910,
884,
1871,
29879,
278,
1024,
310,
278,
1897,
29898,
29879,
29897,
13,
9651,
393,
674,
367,
2825,
491,
445,
740,
29889,
13109,
29879,
304,
376,
29965,
29963,
29918,
3289,
613,
474,
29889,
29872,
29889,
278,
2178,
29899,
29903,
3459,
13,
9651,
501,
29963,
848,
393,
338,
1304,
297,
278,
8147,
29918,
14940,
29918,
29881,
852,
740,
29889,
13,
13,
4706,
1002,
4695,
584,
851,
470,
1051,
29892,
13136,
13,
9651,
450,
1002,
4695,
304,
367,
12833,
29892,
3987,
3160,
29901,
2099,
29892,
19194,
29892,
380,
3359,
29892,
20162,
29892,
29871,
13,
9651,
1375,
29892,
4236,
29892,
7688,
287,
29918,
12676,
29892,
322,
2533,
29889,
2216,
1206,
20502,
29889,
1815,
367,
263,
2323,
1347,
470,
13,
9651,
263,
1051,
310,
6031,
988,
1609,
2999,
4341,
674,
367,
12833,
29889,
13109,
29879,
304,
376,
6816,
273,
1642,
13,
13,
4706,
4765,
29918,
9507,
29918,
4830,
584,
851,
29892,
13136,
13,
9651,
2178,
1242,
278,
1404,
304,
1831,
1422,
2752,
848,
29889,
910,
1122,
367,
5407,
297,
4251,
988,
13,
9651,
278,
1404,
10753,
304,
7252,
3248,
267,
12833,
411,
697,
8783,
304,
313,
20834,
29897,
9570,
4612,
13,
9651,
515,
1790,
8783,
29889,
13109,
29879,
304,
6213,
29892,
988,
278,
740,
3913,
278,
2752,
2066,
13,
9651,
6790,
491,
278,
1203,
29915,
29879,
15562,
29889,
13,
13,
4706,
4765,
29918,
12322,
584,
851,
29892,
13136,
13,
9651,
2178,
1242,
278,
1404,
304,
1831,
1422,
2752,
848,
29889,
910,
1122,
367,
5407,
297,
4251,
988,
13,
9651,
278,
1404,
10753,
304,
7252,
3248,
267,
12833,
411,
697,
8783,
304,
313,
20834,
29897,
9570,
4612,
13,
9651,
515,
1790,
8783,
29889,
13109,
29879,
304,
6213,
29892,
988,
278,
740,
3913,
278,
2752,
2066,
13,
9651,
6790,
491,
278,
1203,
29915,
29879,
15562,
29889,
13,
13,
13,
4706,
16969,
13,
4706,
448,
22158,
13,
4706,
21220,
29928,
15806,
13,
9651,
450,
1591,
338,
623,
2760,
411,
716,
4341,
4257,
518,
11918,
21540,
29961,
6112,
4695,
1822,
13,
13,
13,
4706,
8741,
13,
4706,
448,
22158,
13,
13,
4706,
512,
445,
1342,
29892,
591,
28475,
278,
1889,
363,
25202,
278,
3248,
267,
297,
20349,
634,
394,
29889,
29871,
29906,
29900,
29906,
29896,
13,
4706,
313,
991,
597,
1867,
29875,
29889,
990,
29914,
29896,
29900,
29889,
29941,
29941,
29929,
29900,
29914,
271,
7681,
29896,
29906,
29900,
29906,
29900,
29906,
29953,
29947,
29897,
515,
278,
9677,
9855,
19056,
408,
1462,
944,
653,
29871,
13,
4706,
848,
313,
991,
597,
1636,
29889,
3487,
1631,
29889,
510,
29914,
29906,
29900,
29955,
29941,
29899,
29946,
29946,
29941,
29941,
29914,
29896,
29906,
29914,
29906,
29914,
29906,
29953,
29947,
29914,
29879,
29896,
467,
3940,
393,
2582,
674,
1163,
408,
278,
13,
4706,
9677,
9855,
3743,
871,
1887,
26182,
931,
322,
451,
17998,
931,
29889,
19814,
29892,
304,
22222,
13,
4706,
278,
16455,
344,
29918,
11918,
740,
29892,
591,
884,
8147,
278,
7688,
287,
2099,
315,
29924,
29943,
10241,
372,
304,
367,
13,
4706,
385,
5684,
2286,
297,
278,
2752,
848,
2066,
29889,
2823,
2400,
1057,
13,
13,
9651,
1053,
3017,
29918,
29873,
4183,
408,
19592,
13,
9651,
1053,
11701,
408,
10518,
13,
9651,
1342,
353,
19592,
29889,
10299,
928,
29928,
15806,
29898,
15926,
29889,
949,
29918,
24633,
29898,
29878,
29915,
271,
7681,
9085,
29899,
29896,
29906,
29899,
29900,
29900,
29906,
29953,
29947,
29899,
29879,
29900,
29900,
29896,
29889,
20267,
29916,
742,
13,
462,
462,
462,
1678,
4839,
29922,
29906,
29892,
2248,
29918,
1054,
29922,
29900,
29892,
1509,
22724,
543,
29933,
29901,
29968,
5783,
13,
9651,
1342,
29889,
4351,
29918,
12322,
353,
525,
29907,
8419,
5893,
29918,
1552,
29918,
12322,
29918,
974,
29918,
8066,
29918,
24713,
29918,
4150,
29915,
13,
9651,
1342,
353,
1342,
29889,
15770,
29918,
4914,
29918,
7039,
580,
29871,
13,
9651,
1342,
353,
1342,
29889,
816,
11272,
29918,
23362,
29918,
735,
1066,
545,
2141,
1001,
29918,
3166,
29918,
2490,
545,
580,
13,
9651,
1342,
353,
1342,
29889,
15807,
403,
29918,
14940,
29918,
29881,
852,
580,
13,
9651,
1342,
353,
1342,
29889,
24209,
344,
29918,
11918,
29898,
11918,
543,
24494,
29943,
613,
6112,
4695,
543,
7915,
287,
29918,
12676,
1159,
13,
13,
4706,
9995,
13,
13,
4706,
396,
4160,
505,
2984,
304,
2254,
1422,
2066,
29892,
6467,
21274,
304,
15562,
13,
4706,
565,
4765,
29918,
9507,
29918,
4830,
338,
6213,
584,
13,
9651,
4765,
29918,
9507,
29918,
4830,
353,
1583,
29889,
4351,
29918,
9507,
29918,
4830,
13,
4706,
565,
4765,
29918,
12322,
338,
6213,
584,
13,
9651,
4765,
29918,
12322,
353,
1583,
29889,
4351,
29918,
12322,
13,
13,
4706,
396,
3824,
4331,
338,
1284,
5412,
2440,
304,
4772,
8363,
19039,
848,
13,
4706,
2440,
353,
10518,
29889,
16390,
5410,
3220,
29898,
1311,
29889,
2539,
467,
6360,
13,
4706,
5412,
29918,
6360,
29879,
353,
12705,
29898,
842,
29898,
6360,
29879,
876,
13,
13,
4706,
565,
338,
8758,
29898,
6112,
4695,
29892,
710,
29897,
584,
13,
9651,
1583,
29961,
11918,
13578,
29918,
17969,
6112,
4695,
29962,
353,
7442,
29889,
13707,
13,
9651,
396,
3588,
304,
1051,
304,
21092,
775,
2678,
13,
9651,
1002,
4695,
353,
518,
6112,
4695,
29962,
13,
4706,
25342,
338,
8758,
29898,
6112,
4695,
29892,
1761,
29897,
584,
13,
9651,
363,
921,
297,
1002,
4695,
584,
13,
18884,
1583,
29961,
11918,
13578,
29918,
17969,
29916,
13192,
9302,
29889,
13707,
13,
4706,
1683,
584,
13,
9651,
12020,
20948,
703,
6112,
4695,
1881,
1818,
367,
851,
470,
1051,
310,
851,
1159,
13,
13,
4706,
363,
1629,
297,
5412,
29918,
6360,
29879,
584,
13,
9651,
396,
16012,
7787,
29907,
4037,
934,
13,
9651,
1596,
703,
7032,
292,
1629,
15691,
710,
29898,
6360,
876,
29871,
13,
9651,
8783,
29922,
17608,
29889,
16390,
24541,
29898,
4351,
29918,
12322,
29974,
4351,
29918,
9507,
29918,
4830,
29889,
6506,
877,
18855,
742,
710,
29898,
6360,
4961,
29871,
13,
9651,
8783,
29889,
842,
29918,
6921,
29918,
13168,
29898,
8824,
29897,
396,
910,
338,
4100,
363,
302,
550,
304,
1053,
5149,
13,
13,
9651,
396,
8561,
13201,
1591,
363,
1629,
368,
11306,
13,
9651,
5694,
29918,
2371,
353,
1583,
29961,
6360,
29879,
1275,
1629,
1822,
8552,
580,
13,
13,
9651,
396,
1284,
599,
5412,
3841,
297,
1629,
304,
367,
7500,
13,
9651,
5412,
29918,
16700,
29892,
13092,
29918,
16700,
29918,
13140,
353,
7442,
29889,
13092,
29898,
15926,
29889,
16390,
5410,
3220,
29898,
7382,
29918,
2371,
29889,
2539,
467,
3250,
974,
6360,
29892,
13,
18884,
736,
29918,
262,
3901,
29922,
5574,
29897,
13,
9651,
5694,
29918,
2371,
1839,
13092,
29918,
16700,
29918,
13140,
2033,
353,
5412,
29918,
16700,
29918,
13140,
13,
13,
9651,
396,
15926,
29889,
16390,
5410,
3220,
29898,
17608,
29889,
1949,
29906,
1256,
29898,
24713,
29889,
20897,
3366,
2230,
3108,
7503,
1402,
24713,
29889,
20897,
3366,
2230,
16862,
348,
1169,
29892,
6194,
29918,
1509,
29918,
29883,
615,
603,
29918,
4130,
300,
1355,
29922,
8824,
876,
13,
13,
9651,
565,
8783,
29889,
6229,
5580,
1839,
2230,
13359,
2311,
1275,
29871,
29906,
29946,
584,
13,
18884,
396,
4312,
565,
925,
263,
2323,
2462,
13,
18884,
931,
29918,
6484,
353,
518,
5574,
363,
474,
297,
3464,
29898,
24713,
29889,
6229,
5580,
1839,
2230,
13359,
2311,
4638,
13,
9651,
1683,
584,
13,
18884,
396,
8084,
591,
8206,
263,
11306,
515,
278,
7787,
29907,
4037,
934,
13,
18884,
396,
9607,
2089,
1409,
411,
1021,
3309,
310,
931,
9927,
515,
7787,
29907,
4037,
13,
18884,
931,
29918,
6484,
353,
518,
8824,
363,
474,
297,
3464,
29898,
24713,
29889,
6229,
5580,
1839,
2230,
13359,
2311,
4638,
29871,
13,
18884,
396,
620,
14443,
2089,
1409,
304,
505,
937,
9927,
29871,
29906,
29946,
313,
29882,
2470,
297,
2462,
29897,
13,
18884,
931,
29918,
6484,
353,
4974,
29918,
1272,
29918,
12181,
29918,
29906,
29946,
29898,
2230,
29918,
6484,
29897,
29871,
13,
18884,
396,
731,
278,
8210,
3841,
408,
1565,
13,
18884,
931,
29918,
6484,
7503,
29892,
13092,
29918,
16700,
29899,
29896,
29962,
353,
5852,
29871,
13,
18884,
396,
1652,
8606,
931,
29918,
6484,
1409,
1250,
304,
697,
9927,
13,
18884,
931,
29918,
6484,
353,
931,
29918,
6484,
29889,
1579,
8606,
29898,
2098,
2433,
29943,
1495,
13,
13,
9651,
848,
353,
4974,
29918,
1272,
29918,
12181,
29918,
29906,
29946,
29898,
24713,
29961,
11918,
3816,
2230,
29918,
6484,
29892,
29901,
29892,
29901,
2314,
29871,
13,
9651,
396,
14402,
29901,
11157,
15171,
2673,
310,
10650,
848,
10340,
3265,
1135,
10241,
13,
13,
9651,
396,
3588,
3405,
23123,
964,
15526,
10350,
13,
9651,
396,
14402,
29901,
2050,
338,
5181,
304,
2254,
4152,
11053,
363,
925,
263,
2846,
3734,
17036,
13,
9651,
3405,
353,
8783,
1839,
5066,
2033,
7503,
29962,
13,
9651,
23123,
353,
8783,
1839,
12957,
2033,
7503,
29962,
13,
9651,
5694,
29918,
2371,
1839,
29886,
15711,
29918,
5066,
2033,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
18884,
1284,
29918,
28502,
342,
29898,
5066,
29892,
29916,
1839,
13992,
4279,
2033,
511,
8990,
2433,
13099,
1495,
13,
9651,
5694,
29918,
2371,
1839,
29886,
15711,
29918,
12957,
2033,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
18884,
1284,
29918,
28502,
342,
29898,
12957,
29892,
29916,
1839,
8208,
4279,
2033,
511,
8990,
2433,
13099,
1495,
13,
13,
632,
13,
9651,
396,
8147,
29871,
13,
9651,
363,
1002,
297,
1002,
4695,
584,
13,
18884,
396,
2099,
13,
18884,
565,
1002,
29889,
13609,
580,
297,
6796,
12676,
613,
29915,
12483,
482,
3788,
485,
29887,
2033,
584,
13,
462,
1678,
5694,
29918,
2371,
29961,
11918,
13578,
29918,
17969,
6112,
29962,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
462,
4706,
7442,
29889,
12676,
29898,
1272,
29961,
29916,
1839,
4504,
11272,
2033,
19216,
29900,
29892,
29916,
1839,
13092,
29918,
16700,
29918,
13140,
7464,
29916,
1839,
29886,
15711,
29918,
5066,
7464,
29916,
1839,
29886,
15711,
29918,
12957,
2033,
29962,
10353,
8990,
2433,
13099,
1495,
13,
18884,
396,
19194,
13,
18884,
25342,
1002,
29889,
13609,
580,
297,
6796,
2168,
713,
3284,
2168,
3108,
584,
13,
462,
1678,
5694,
29918,
2371,
29961,
11918,
13578,
29918,
17969,
6112,
29962,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
462,
4706,
7442,
29889,
2168,
713,
29898,
1272,
29961,
29916,
1839,
4504,
11272,
2033,
19216,
29900,
29892,
29916,
1839,
13092,
29918,
16700,
29918,
13140,
7464,
29916,
1839,
29886,
15711,
29918,
5066,
7464,
29916,
1839,
29886,
15711,
29918,
12957,
2033,
29962,
10353,
8990,
2433,
13099,
1495,
13,
18884,
396,
380,
3359,
13,
18884,
25342,
1002,
29889,
13609,
580,
297,
6796,
4172,
3284,
4928,
3284,
303,
3359,
3108,
584,
13,
462,
1678,
5694,
29918,
2371,
29961,
11918,
13578,
29918,
17969,
6112,
29962,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
462,
4706,
7442,
29889,
4172,
29898,
1272,
29961,
29916,
1839,
4504,
11272,
2033,
19216,
29900,
29892,
29916,
1839,
13092,
29918,
16700,
29918,
13140,
7464,
29916,
1839,
29886,
15711,
29918,
5066,
7464,
29916,
1839,
29886,
15711,
29918,
12957,
2033,
29962,
10353,
8990,
2433,
13099,
1495,
13,
18884,
396,
20162,
13,
18884,
25342,
1002,
29889,
13609,
580,
297,
6796,
1707,
3284,
1707,
8837,
3108,
584,
13,
462,
1678,
5694,
29918,
2371,
29961,
11918,
13578,
29918,
17969,
6112,
29962,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
462,
4706,
7442,
29889,
1707,
29898,
1272,
29961,
29916,
1839,
4504,
11272,
2033,
19216,
29900,
29892,
29916,
1839,
13092,
29918,
16700,
29918,
13140,
7464,
29916,
1839,
29886,
15711,
29918,
5066,
7464,
29916,
1839,
29886,
15711,
29918,
12957,
2033,
29962,
10353,
8990,
2433,
13099,
1495,
13,
18884,
396,
9212,
13,
18884,
25342,
1002,
29889,
13609,
580,
297,
6796,
1195,
613,
29915,
1195,
12539,
2033,
584,
13,
462,
1678,
5694,
29918,
2371,
29961,
11918,
13578,
29918,
17969,
6112,
29962,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
462,
4706,
7442,
29889,
9103,
29898,
1272,
29961,
29916,
1839,
4504,
11272,
2033,
19216,
29900,
29892,
29916,
1839,
13092,
29918,
16700,
29918,
13140,
7464,
29916,
1839,
29886,
15711,
29918,
5066,
7464,
29916,
1839,
29886,
15711,
29918,
12957,
2033,
29962,
10353,
8990,
2433,
13099,
1495,
13,
18884,
396,
7472,
13,
18884,
25342,
1002,
29889,
13609,
580,
297,
6796,
3317,
3284,
27525,
398,
3108,
584,
13,
462,
1678,
5694,
29918,
2371,
29961,
11918,
13578,
29918,
17969,
6112,
29962,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
462,
4706,
7442,
29889,
314,
1165,
29898,
1272,
29961,
29916,
1839,
4504,
11272,
2033,
19216,
29900,
29892,
29916,
1839,
13092,
29918,
16700,
29918,
13140,
7464,
29916,
1839,
29886,
15711,
29918,
5066,
7464,
29916,
1839,
29886,
15711,
29918,
12957,
2033,
29962,
10353,
8990,
2433,
13099,
1495,
13,
18884,
396,
7688,
287,
2099,
13,
18884,
25342,
1002,
29889,
13609,
580,
297,
6796,
7915,
287,
29918,
12676,
3284,
7915,
287,
29918,
12483,
482,
3284,
12676,
29918,
7915,
287,
3284,
12483,
482,
29918,
7915,
287,
3284,
485,
29887,
29918,
7915,
287,
3108,
584,
13,
462,
1678,
5694,
29918,
2371,
29961,
11918,
13578,
29918,
17969,
6112,
29962,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
462,
4706,
7442,
29889,
12483,
482,
29898,
1272,
7503,
29892,
29916,
1839,
13092,
29918,
16700,
29918,
13140,
7464,
29916,
1839,
29886,
15711,
29918,
5066,
7464,
29916,
1839,
29886,
15711,
29918,
12957,
2033,
1402,
705,
5861,
29922,
29916,
1839,
4504,
11272,
2033,
511,
8990,
2433,
13099,
1495,
13,
18884,
396,
2533,
13,
18884,
25342,
1002,
29889,
13609,
580,
297,
6796,
2083,
3284,
7827,
3108,
584,
13,
462,
1678,
5694,
29918,
2371,
29961,
11918,
13578,
29918,
17969,
6112,
29962,
353,
5694,
29918,
2371,
29889,
7302,
29898,
2892,
921,
29901,
29871,
13,
462,
4706,
7442,
29889,
2083,
29898,
1272,
29961,
29916,
1839,
4504,
11272,
2033,
19216,
29900,
29892,
29916,
1839,
13092,
29918,
16700,
29918,
13140,
7464,
29916,
1839,
29886,
15711,
29918,
5066,
7464,
29916,
1839,
29886,
15711,
29918,
12957,
2033,
29962,
10353,
8990,
2433,
13099,
1495,
13,
13,
18884,
396,
4805,
4331,
5181,
304,
9801,
1959,
12827,
13,
18884,
1583,
29889,
2029,
29961,
7382,
29918,
2371,
29889,
2248,
29892,
11918,
13578,
29918,
17969,
6112,
29962,
353,
5694,
29918,
2371,
29961,
11918,
13578,
29918,
17969,
6112,
1822,
5975,
13,
13,
4706,
736,
1583,
308,
13,
2
] |
fabfile.py | codersquid/richard-deploy | 0 | 167972 | <filename>fabfile.py
"""deployment scripts for researchcompendia
with credit to scipy-2014 and researchcompendia fabric.py
fab <deploy|provision>[:<git ref>]
provision: provisions a box to run the site. is not idempotent. do not rerun.
deploy: deploys a update to the site. if no git ref is provided, deploys HEAD.
git ref: a git branch, hash, tag
provision: provisions a new box.
example usages:
deploy new version of the site with an updated virtualenv.
$ fab provision:1.1.1
WARNINGS
This does not set up elasticsearch or the cron jobs for indexing and running
the link checker.
deploy has never been properly tested
provision is no longer properly tested, Carl wanted an vagrant example
and I don't have time to finish this today. It's a start for him to pick
up, unless I get to it first.
"""
import string, random
from os.path import join, dirname, abspath
from fabric.api import run, task, env, cd, sudo, local
from fabric.contrib.files import sed, append
from fabtools import require, supervisor, postgres, files
from fabtools.files import upload_template
import fabtools
from fabtools.vagrant import vagrant
FAB_HOME = dirname(abspath(__file__))
TEMPLATE_DIR = join(FAB_HOME, 'templates')
# shourt name - user, group, db name, supervised_process...
SITE_NAME = "rt1"
# public facing name (connonical? fqdn?)
SERVER_NAME='richard.test1.nextdayvideo.com'
try:
from secrets import admins
except:
# you will need to run ./manage.py createsuperuser
admins = []
SITE_CLONE_NAME = SITE_NAME
SITE_DIR = join('/', 'srv', SITE_NAME)
SITE_SETTINGS = {
'site_name': SITE_NAME,
'repo_dir': join(SITE_DIR, SITE_NAME),
'setup_args': '.[postgresql]',
'django_site_url': 'http://{0}'.format(SERVER_NAME),
'repo': 'https://github.com/willkg/richard.git',
'user': SITE_NAME,
'group': SITE_NAME,
'virtualenv': 'venv',
'supervised_process': SITE_NAME,
'settings_module': '{0}.richard.settings'.format(SITE_NAME) ,
'wsgi_module': '{0}.richard.wsgi'.format(SITE_NAME),
'server_name': SERVER_NAME,
'nginx_site': SITE_NAME,
'gunicorn_port':'8001',
'admins':admins
}
env.disable_known_hosts = True
env.hosts = ['root@'+SERVER_NAME]
# env.hosts = [SERVER_NAME+':2222']
#env.hosts = ['127.0.0.1:2222']
#env.hosts = ['<EMAIL>']
@task
def uname():
"""call uname to check that we can do a simple command
"""
run('uname -a')
@task
def deploy(version_tag=None):
"""deploys a updated version of the site
version_tag: a git tag, defaults to HEAD
"""
supervised_process = SITE_SETTINGS['supervised_process']
#dust()
stop(supervised_process)
update(commit=version_tag)
setup()
collectstatic()
start(supervised_process)
#undust()
@task
def stop(process_name):
"""stops supervisor process
"""
supervisor.stop_process(process_name)
@task
def start(process_name):
"""starts supervisor process
"""
supervisor.start_process(process_name)
@task
def update(commit='origin/master'):
repo_dir = SITE_SETTINGS['repo_dir']
with cd(repo_dir):
su('git fetch')
su('git checkout %s' % commit)
@task
def migrate(app):
""" run south migration on specified app
"""
with cd(SITE_SETTINGS['repo_dir']):
vsu('./manage.py migrate %s' % app)
@task
def provision(commit='origin/master'):
"""Run only once to provision a new host.
This is not idempotent. Only run once!
"""
install_packages()
install_python_packages()
lockdown_nginx()
# lockdown_ssh() # locks you out if you don't have keys setup
setup_database()
setup_site_user()
setup_site_root()
provision_django()
provision_django_settings()
syncdb()
create_superuser()
collectstatic()
setup_nginx_site()
setup_supervisor()
print("")
print('handy debugging stuff:')
print('127.0.0.1 localhost {server_name}'.format(
**SITE_SETTINGS))
print('curl http://{server_name}:8081'.format(
**SITE_SETTINGS))
# not the gunicorn_port. this is the port mapped to 80 by vagrant
print('curl --head http://{server_name}:8081'.format(
**SITE_SETTINGS))
print("sudo supervisorctl restart {0}".format(SITE_NAME))
print('cat {0}/logs/gunicorn.log'.format(SITE_DIR))
activate = join(
SITE_DIR, SITE_SETTINGS['virtualenv'], 'bin', 'activate')
print('cd {repo_dir}'.format(**SITE_SETTINGS))
print( 'sudo su {user} -c "source {activate} && ./manage.py shell"'.format(activate=activate, **SITE_SETTINGS))
def setup_nginx_site():
nginx_site = SITE_NAME
static_dir = SITE_SETTINGS['repo_dir']
upload_template('nginx_site.conf',
'/etc/nginx/sites-available/%s' % nginx_site,
context={
'server_name': SITE_SETTINGS['server_name'],
'gunicorn_port': SITE_SETTINGS['gunicorn_port'],
'path_to_static': join(static_dir, 'static'),
'site_dir': SITE_DIR,
'static_parent': '%s/' % static_dir,
},
use_jinja=True, use_sudo=True, template_dir=TEMPLATE_DIR)
require.nginx.enabled(nginx_site)
def setup_supervisor():
supervised_process = SITE_SETTINGS['supervised_process']
bindir = join(SITE_DIR, 'bin')
logdir = join(SITE_DIR, 'logs')
upload_template('supervised_site.conf',
'/etc/supervisor/conf.d/%s.conf' % supervised_process,
context={
'supervised_process': supervised_process,
'command': join(bindir, 'gunicorn.sh'),
'user': SITE_SETTINGS['user'],
'group': SITE_SETTINGS['group'],
'logfile': join(logdir, 'gunicorn.log'),
'site_dir': bindir,
},
use_jinja=True, use_sudo=True, template_dir=TEMPLATE_DIR)
supervisor.update_config()
def lockdown_nginx():
# don't share nginx version in header and error pages
sed('/etc/nginx/nginx.conf', '# server_tokens off;', 'server_tokens off;', use_sudo=True)
sudo('service nginx restart')
def lockdown_ssh():
sed('/etc/ssh/sshd_config', '^#PasswordAuthentication yes', 'PasswordAuthentication no', use_sudo=True)
append('/etc/ssh/sshd_config', ['UseDNS no', 'PermitRootLogin no', 'DebianBanner no', 'TcpKeepAlive yes'], use_sudo=True)
sudo('service ssh restart')
def clone_site():
with cd(SITE_DIR):
su('git clone -q %s %s' % (SITE_SETTINGS['repo'], SITE_CLONE_NAME))
with cd(join(SITE_DIR, SITE_CLONE_NAME)):
su('touch __init__.py') # janky way to treat the SITE_CLONE_NAME like a module name
def provision_django():
with cd(SITE_DIR):
su('virtualenv {0}'.format(SITE_SETTINGS['virtualenv']))
clone_site()
setup()
@task
def provision_django_settings():
settings_local = join(SITE_DIR, SITE_SETTINGS['repo_dir'],
'richard', 'settings_local.py')
secret_key = ''.join(random.choice(string.ascii_letters +
string.digits + '~@#%^&*-_') for x in range(64))
upload_template('settings_local.py',
settings_local,
context={
'site_name': SITE_NAME,
'db_name': SITE_NAME,
'secret_key': secret_key,
'admins': SITE_SETTINGS['admins'],
'server_name': SITE_SETTINGS['server_name'],
},
use_jinja=True, use_sudo=True, template_dir=TEMPLATE_DIR)
sudo('chown {user}:{group} {file}'.format(
file=settings_local, **SITE_SETTINGS ))
def syncdb():
with cd(SITE_SETTINGS['repo_dir']):
vsu('./manage.py syncdb --noinput --migrate')
@task
def create_superuser():
""" create admin user.
richard uses Persona, which is tied to email.
"""
with cd(SITE_SETTINGS['repo_dir']):
for user,email in SITE_SETTINGS['admins']:
vsu('./manage.py createsuperuser --noinput --username {user} --email {email}'.format(user=user,email=email))
@task
def setup(virtualenv='venv'):
with cd(SITE_SETTINGS['repo_dir']):
# TODO: figure out how to escape .[postgresql], I keep getting: invalid command name
#vsu("python setup.py '%s'" % SITE_SETTINGS['setup_args'], virtualenv=virtualenv)
vsu("python setup.py install", virtualenv=virtualenv)
vsu("pip install gunicorn", virtualenv=virtualenv)
vsu("pip install psycopg2", virtualenv=virtualenv)
def setup_database():
user = SITE_SETTINGS['user']
require.postgres.server()
# TODO: fabtools.require.postgres.user did not allow a user with no pw prompt? see if there is a better way
if not postgres.user_exists(user):
su('createuser -S -D -R -w %s' % user, 'postgres')
if not postgres.database_exists(user):
require.postgres.database(user, user, encoding='UTF8', locale='en_US.UTF-8')
# TODO: change default port
# port = 5432
# /etc/postgresql/9.1/main/postgresql.conf
def setup_site_user():
user = SITE_SETTINGS['user']
if not fabtools.user.exists(user):
sudo('useradd -s/bin/bash -d/home/%s -m %s' % (user, user))
def setup_site_root():
bindir = join(SITE_DIR, 'bin')
user = SITE_SETTINGS['user']
sudo('mkdir -p %s' % SITE_DIR)
sudo('chown %s:%s %s' % (user, user, SITE_DIR))
with cd(SITE_DIR):
su('mkdir -p logs bin {0}'.format(SITE_SETTINGS['virtualenv']))
with cd(bindir):
setup_gunicorn_script()
sudo('chown -R %s:%s %s' % (user, user, SITE_DIR))
su('chmod +x gunicorn.sh')
def setup_gunicorn_script():
bindir = join(SITE_DIR, 'bin')
python_path = SITE_SETTINGS['repo_dir']
upload_template('gunicorn.sh',
join(bindir, 'gunicorn.sh'),
context={
'settings_module': SITE_SETTINGS['settings_module'],
'path_to_virtualenv': join(SITE_DIR, SITE_SETTINGS['virtualenv']),
'user': SITE_SETTINGS['user'],
'group': SITE_SETTINGS['group'],
'site_dir': SITE_DIR,
'wsgi_module': SITE_SETTINGS['wsgi_module'],
'gunicorn_port': SITE_SETTINGS['gunicorn_port'],
'python_path': python_path,
},
use_jinja=True, use_sudo=True, template_dir=TEMPLATE_DIR)
def install_packages():
require.deb.uptodate_index(max_age={'hour': 1})
require.deb.packages([
'python-software-properties',
'python-dev',
'build-essential',
'libxml2',
'libxslt-dev',
'git',
'nginx-extras',
'libxslt1-dev',
'supervisor',
'postgresql',
'postgresql-server-dev-9.1',
# useful but not strictly required
'tig',
'vim',
'curl',
'tmux',
'htop',
'ack-grep',
])
def install_python_packages():
sudo('wget --quiet https://raw.github.com/pypa/pip/master/contrib/get-pip.py')
sudo('python get-pip.py')
# install global python packages
require.python.packages([
'virtualenvwrapper',
'setproctitle',
'wheel',
], use_sudo=True)
def su(cmd, user=None):
if user is None:
user = SITE_SETTINGS['user']
sudo("su %s -c '%s'" % (user, cmd))
def vsu(cmd, virtualenv='venv', user=None):
if user is None:
user = SITE_SETTINGS['user']
activate = join(SITE_DIR, virtualenv, 'bin', 'activate')
sudo("su {0} -c 'source {1}; {2}'".format(user, activate, cmd))
def collectstatic():
with cd(SITE_SETTINGS['repo_dir']):
vsu('./manage.py collectstatic --noinput')
def randomstring(n):
return ''.join(random.choice(string.ascii_letters + string.digits + '~@#%^&*-_') for x in range(n))
| [
1,
529,
9507,
29958,
16582,
1445,
29889,
2272,
13,
15945,
29908,
16519,
358,
12078,
363,
5925,
2388,
355,
423,
13,
2541,
16200,
304,
4560,
2272,
29899,
29906,
29900,
29896,
29946,
322,
5925,
2388,
355,
423,
18187,
29889,
2272,
13,
13,
16582,
529,
16519,
29989,
771,
4924,
29958,
7503,
29966,
5559,
2143,
29958,
29962,
13,
13,
771,
4924,
29901,
1326,
12112,
263,
3800,
304,
1065,
278,
3268,
29889,
338,
451,
1957,
1526,
327,
296,
29889,
437,
451,
364,
261,
348,
29889,
13,
16519,
29901,
1401,
417,
952,
263,
2767,
304,
278,
3268,
29889,
565,
694,
6315,
2143,
338,
4944,
29892,
1401,
417,
952,
17714,
3035,
29889,
13,
5559,
2143,
29901,
263,
6315,
5443,
29892,
6608,
29892,
4055,
13,
13,
771,
4924,
29901,
1326,
12112,
263,
716,
3800,
29889,
13,
13,
4773,
502,
1179,
29901,
13,
13,
16519,
716,
1873,
310,
278,
3268,
411,
385,
4784,
6901,
6272,
29889,
13,
29938,
10135,
25161,
29901,
29896,
29889,
29896,
29889,
29896,
13,
13,
13,
29956,
25614,
29903,
13,
13,
4013,
947,
451,
731,
701,
560,
20291,
470,
278,
18863,
17643,
363,
26190,
322,
2734,
13,
1552,
1544,
1423,
261,
29889,
13,
13,
16519,
756,
2360,
1063,
6284,
9528,
13,
13,
771,
4924,
338,
694,
5520,
6284,
9528,
29892,
8965,
5131,
385,
325,
29592,
1342,
13,
392,
306,
1016,
29915,
29873,
505,
931,
304,
8341,
445,
9826,
29889,
739,
29915,
29879,
263,
1369,
363,
1075,
304,
5839,
13,
786,
29892,
6521,
306,
679,
304,
372,
937,
29889,
13,
13,
15945,
29908,
13,
5215,
1347,
29892,
4036,
13,
3166,
2897,
29889,
2084,
1053,
5988,
29892,
4516,
978,
29892,
633,
1028,
493,
13,
3166,
18187,
29889,
2754,
1053,
1065,
29892,
3414,
29892,
8829,
29892,
14965,
29892,
9196,
29892,
1887,
13,
3166,
18187,
29889,
21570,
29889,
5325,
1053,
7048,
29892,
9773,
13,
3166,
10135,
8504,
1053,
1996,
29892,
2428,
19188,
29892,
1400,
7201,
29892,
2066,
13,
3166,
10135,
8504,
29889,
5325,
1053,
6441,
29918,
6886,
13,
5215,
10135,
8504,
13,
13,
3166,
10135,
8504,
29889,
29894,
29592,
1053,
325,
29592,
13,
13,
29943,
2882,
29918,
17353,
353,
4516,
978,
29898,
370,
1028,
493,
22168,
1445,
1649,
876,
13,
4330,
3580,
29931,
3040,
29918,
9464,
353,
5988,
29898,
29943,
2882,
29918,
17353,
29892,
525,
20943,
1495,
13,
13,
29937,
528,
14316,
1024,
448,
1404,
29892,
2318,
29892,
4833,
1024,
29892,
2428,
11292,
29918,
5014,
856,
13,
29903,
9094,
29918,
5813,
353,
376,
2273,
29896,
29908,
13,
29937,
970,
14870,
1024,
313,
535,
5464,
936,
29973,
29871,
285,
29939,
5200,
7897,
13,
18603,
29918,
5813,
2433,
4018,
538,
29889,
1688,
29896,
29889,
4622,
3250,
9641,
29889,
510,
29915,
13,
13,
2202,
29901,
13,
1678,
515,
22183,
1372,
1053,
7336,
1144,
13,
19499,
29901,
13,
1678,
396,
366,
674,
817,
304,
1065,
11431,
1171,
482,
29889,
2272,
10017,
14805,
1792,
13,
1678,
7336,
1144,
353,
5159,
13,
13,
29903,
9094,
29918,
6154,
12413,
29918,
5813,
353,
317,
9094,
29918,
5813,
13,
13,
29903,
9094,
29918,
9464,
353,
5988,
11219,
742,
525,
29879,
15291,
742,
317,
9094,
29918,
5813,
29897,
29871,
13,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
353,
426,
13,
1678,
525,
2746,
29918,
978,
2396,
317,
9094,
29918,
5813,
29892,
259,
13,
1678,
525,
20095,
29918,
3972,
2396,
5988,
29898,
29903,
9094,
29918,
9464,
29892,
317,
9094,
29918,
5813,
511,
13,
1678,
525,
14669,
29918,
5085,
2396,
525,
7226,
29272,
29962,
742,
13,
1678,
525,
14095,
29918,
2746,
29918,
2271,
2396,
525,
1124,
597,
29912,
29900,
29913,
4286,
4830,
29898,
18603,
29918,
5813,
511,
13,
1678,
525,
20095,
2396,
525,
991,
597,
3292,
29889,
510,
29914,
14043,
9415,
29914,
4018,
538,
29889,
5559,
742,
13,
1678,
525,
1792,
2396,
317,
9094,
29918,
5813,
29892,
259,
13,
1678,
525,
2972,
2396,
317,
9094,
29918,
5813,
29892,
13,
1678,
525,
18714,
6272,
2396,
525,
854,
29894,
742,
13,
1678,
525,
9136,
11292,
29918,
5014,
2396,
317,
9094,
29918,
5813,
29892,
13,
1678,
525,
11027,
29918,
5453,
2396,
22372,
29900,
1836,
4018,
538,
29889,
11027,
4286,
4830,
29898,
29903,
9094,
29918,
5813,
29897,
1919,
29871,
13,
1678,
525,
5652,
3146,
29918,
5453,
2396,
22372,
29900,
1836,
4018,
538,
29889,
5652,
3146,
4286,
4830,
29898,
29903,
9094,
29918,
5813,
511,
29871,
13,
1678,
525,
2974,
29918,
978,
2396,
26996,
5348,
29918,
5813,
29892,
29871,
13,
1678,
525,
23257,
29918,
2746,
2396,
317,
9094,
29918,
5813,
29892,
13,
1678,
525,
29887,
2523,
1398,
29918,
637,
22099,
29947,
29900,
29900,
29896,
742,
13,
1678,
525,
328,
29885,
1144,
2396,
328,
29885,
1144,
13,
29913,
13,
13,
13,
6272,
29889,
20472,
29918,
5203,
29918,
23525,
353,
5852,
13,
13,
6272,
29889,
23525,
353,
6024,
4632,
29992,
18717,
18603,
29918,
5813,
29962,
13,
29937,
8829,
29889,
23525,
353,
518,
18603,
29918,
5813,
29974,
2396,
29906,
29906,
29906,
29906,
2033,
13,
29937,
6272,
29889,
23525,
353,
6024,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
29901,
29906,
29906,
29906,
29906,
2033,
13,
29937,
6272,
29889,
23525,
353,
6024,
29966,
26862,
6227,
29958,
2033,
13,
13,
13,
29992,
7662,
13,
1753,
443,
420,
7295,
13,
1678,
9995,
4804,
443,
420,
304,
1423,
393,
591,
508,
437,
263,
2560,
1899,
13,
1678,
9995,
13,
1678,
1065,
877,
348,
420,
448,
29874,
1495,
13,
13,
13,
29992,
7662,
13,
1753,
7246,
29898,
3259,
29918,
4039,
29922,
8516,
1125,
13,
1678,
9995,
2716,
417,
952,
263,
4784,
1873,
310,
278,
3268,
13,
13,
1678,
1873,
29918,
4039,
29901,
263,
6315,
4055,
29892,
21274,
304,
17714,
3035,
13,
1678,
9995,
13,
1678,
2428,
11292,
29918,
5014,
353,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
9136,
11292,
29918,
5014,
2033,
13,
13,
1678,
396,
29881,
504,
580,
13,
1678,
5040,
29898,
9136,
11292,
29918,
5014,
29897,
13,
1678,
2767,
29898,
15060,
29922,
3259,
29918,
4039,
29897,
13,
1678,
6230,
580,
13,
1678,
6314,
7959,
580,
13,
1678,
1369,
29898,
9136,
11292,
29918,
5014,
29897,
13,
1678,
396,
870,
504,
580,
13,
13,
13,
29992,
7662,
13,
1753,
5040,
29898,
5014,
29918,
978,
1125,
13,
1678,
9995,
303,
3554,
2428,
19188,
1889,
13,
1678,
9995,
13,
1678,
2428,
19188,
29889,
9847,
29918,
5014,
29898,
5014,
29918,
978,
29897,
13,
13,
13,
29992,
7662,
13,
1753,
1369,
29898,
5014,
29918,
978,
1125,
13,
1678,
9995,
27382,
2428,
19188,
1889,
13,
1678,
9995,
13,
1678,
2428,
19188,
29889,
2962,
29918,
5014,
29898,
5014,
29918,
978,
29897,
13,
13,
29992,
7662,
13,
1753,
2767,
29898,
15060,
2433,
12574,
29914,
6207,
29374,
13,
1678,
13761,
29918,
3972,
353,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
20095,
29918,
3972,
2033,
13,
1678,
411,
14965,
29898,
20095,
29918,
3972,
1125,
13,
4706,
480,
877,
5559,
6699,
1495,
13,
4706,
480,
877,
5559,
24808,
1273,
29879,
29915,
1273,
9063,
29897,
13,
13,
29992,
7662,
13,
1753,
9725,
403,
29898,
932,
1125,
13,
1678,
9995,
1065,
7062,
20332,
373,
6790,
623,
13,
1678,
9995,
13,
1678,
411,
14965,
29898,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
20095,
29918,
3972,
2033,
1125,
13,
4706,
325,
2146,
877,
6904,
1171,
482,
29889,
2272,
9725,
403,
1273,
29879,
29915,
1273,
623,
29897,
13,
13,
13,
29992,
7662,
13,
1753,
25161,
29898,
15060,
2433,
12574,
29914,
6207,
29374,
13,
1678,
9995,
6558,
871,
2748,
304,
25161,
263,
716,
3495,
29889,
13,
1678,
910,
338,
451,
1957,
1526,
327,
296,
29889,
9333,
1065,
2748,
29991,
13,
1678,
9995,
13,
1678,
2601,
29918,
8318,
580,
13,
1678,
2601,
29918,
4691,
29918,
8318,
580,
13,
1678,
7714,
3204,
29918,
23257,
580,
13,
1678,
396,
7714,
3204,
29918,
15269,
580,
396,
658,
4684,
366,
714,
565,
366,
1016,
29915,
29873,
505,
6611,
6230,
13,
1678,
6230,
29918,
9803,
580,
13,
1678,
6230,
29918,
2746,
29918,
1792,
580,
13,
1678,
6230,
29918,
2746,
29918,
4632,
580,
13,
1678,
25161,
29918,
14095,
580,
13,
1678,
25161,
29918,
14095,
29918,
11027,
580,
13,
1678,
5222,
2252,
29890,
580,
13,
1678,
1653,
29918,
9136,
1792,
580,
13,
1678,
6314,
7959,
580,
13,
1678,
6230,
29918,
23257,
29918,
2746,
580,
13,
1678,
6230,
29918,
9136,
19188,
580,
13,
13,
1678,
1596,
703,
1159,
13,
1678,
1596,
877,
3179,
29891,
13490,
6433,
29901,
1495,
13,
1678,
1596,
877,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
1678,
15683,
426,
2974,
29918,
978,
29913,
4286,
4830,
29898,
13,
4706,
3579,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
876,
13,
1678,
1596,
877,
18963,
1732,
597,
29912,
2974,
29918,
978,
6177,
29947,
29900,
29947,
29896,
4286,
4830,
29898,
13,
4706,
3579,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
876,
13,
4706,
396,
451,
278,
330,
2523,
1398,
29918,
637,
29889,
445,
338,
278,
2011,
20545,
304,
29871,
29947,
29900,
491,
325,
29592,
13,
1678,
1596,
877,
18963,
1192,
2813,
1732,
597,
29912,
2974,
29918,
978,
6177,
29947,
29900,
29947,
29896,
4286,
4830,
29898,
13,
4706,
3579,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
876,
13,
1678,
1596,
703,
15360,
2428,
19188,
16948,
10715,
426,
29900,
29913,
1642,
4830,
29898,
29903,
9094,
29918,
5813,
876,
13,
1678,
1596,
877,
4117,
426,
29900,
6822,
20756,
29914,
29887,
2523,
1398,
29889,
1188,
4286,
4830,
29898,
29903,
9094,
29918,
9464,
876,
13,
13,
1678,
5039,
403,
353,
5988,
29898,
13,
9651,
317,
9094,
29918,
9464,
29892,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
18714,
6272,
7464,
525,
2109,
742,
525,
11236,
403,
1495,
13,
1678,
1596,
877,
2252,
426,
20095,
29918,
3972,
29913,
4286,
4830,
29898,
1068,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
876,
13,
1678,
1596,
29898,
525,
15360,
480,
426,
1792,
29913,
448,
29883,
376,
4993,
426,
11236,
403,
29913,
2607,
11431,
1171,
482,
29889,
2272,
6473,
29908,
4286,
4830,
29898,
11236,
403,
29922,
11236,
403,
29892,
3579,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
876,
13,
13,
13,
13,
1753,
6230,
29918,
23257,
29918,
2746,
7295,
13,
1678,
19376,
29918,
2746,
353,
317,
9094,
29918,
5813,
13,
1678,
2294,
29918,
3972,
353,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
20095,
29918,
3972,
2033,
13,
1678,
6441,
29918,
6886,
877,
23257,
29918,
2746,
29889,
5527,
742,
13,
4706,
8207,
7070,
29914,
23257,
29914,
16315,
29899,
16515,
22584,
29879,
29915,
1273,
19376,
29918,
2746,
29892,
13,
4706,
3030,
3790,
13,
9651,
525,
2974,
29918,
978,
2396,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
2974,
29918,
978,
7464,
13,
9651,
525,
29887,
2523,
1398,
29918,
637,
2396,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
29887,
2523,
1398,
29918,
637,
7464,
13,
9651,
525,
2084,
29918,
517,
29918,
7959,
2396,
5988,
29898,
7959,
29918,
3972,
29892,
525,
7959,
5477,
13,
9651,
525,
2746,
29918,
3972,
2396,
317,
9094,
29918,
9464,
29892,
13,
9651,
525,
7959,
29918,
3560,
2396,
14210,
29879,
22208,
1273,
2294,
29918,
3972,
29892,
13,
4706,
2981,
13,
4706,
671,
29918,
28789,
1764,
29922,
5574,
29892,
671,
29918,
15360,
29922,
5574,
29892,
4472,
29918,
3972,
29922,
4330,
3580,
29931,
3040,
29918,
9464,
29897,
13,
1678,
1996,
29889,
23257,
29889,
17590,
29898,
23257,
29918,
2746,
29897,
13,
13,
13,
1753,
6230,
29918,
9136,
19188,
7295,
13,
1678,
2428,
11292,
29918,
5014,
353,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
9136,
11292,
29918,
5014,
2033,
13,
1678,
7868,
381,
353,
5988,
29898,
29903,
9094,
29918,
9464,
29892,
525,
2109,
1495,
13,
1678,
1480,
3972,
353,
5988,
29898,
29903,
9094,
29918,
9464,
29892,
525,
20756,
1495,
13,
1678,
6441,
29918,
6886,
877,
9136,
11292,
29918,
2746,
29889,
5527,
742,
13,
4706,
8207,
7070,
29914,
9136,
19188,
29914,
5527,
29889,
29881,
22584,
29879,
29889,
5527,
29915,
1273,
2428,
11292,
29918,
5014,
29892,
13,
4706,
3030,
3790,
13,
9651,
525,
9136,
11292,
29918,
5014,
2396,
2428,
11292,
29918,
5014,
29892,
13,
9651,
525,
6519,
2396,
5988,
29898,
5355,
381,
29892,
525,
29887,
2523,
1398,
29889,
845,
5477,
13,
9651,
525,
1792,
2396,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
1792,
7464,
13,
9651,
525,
2972,
2396,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
2972,
7464,
13,
9651,
525,
1188,
1445,
2396,
5988,
29898,
1188,
3972,
29892,
525,
29887,
2523,
1398,
29889,
1188,
5477,
13,
9651,
525,
2746,
29918,
3972,
2396,
7868,
381,
29892,
13,
4706,
2981,
13,
4706,
671,
29918,
28789,
1764,
29922,
5574,
29892,
671,
29918,
15360,
29922,
5574,
29892,
4472,
29918,
3972,
29922,
4330,
3580,
29931,
3040,
29918,
9464,
29897,
13,
1678,
2428,
19188,
29889,
5504,
29918,
2917,
580,
13,
13,
13,
1753,
7714,
3204,
29918,
23257,
7295,
13,
1678,
396,
1016,
29915,
29873,
6232,
19376,
1873,
297,
4839,
322,
1059,
6515,
13,
1678,
7048,
11219,
7070,
29914,
23257,
29914,
23257,
29889,
5527,
742,
16321,
1923,
29918,
517,
12360,
1283,
29936,
742,
525,
2974,
29918,
517,
12360,
1283,
29936,
742,
671,
29918,
15360,
29922,
5574,
29897,
13,
1678,
9196,
877,
5509,
19376,
10715,
1495,
13,
13,
13,
1753,
7714,
3204,
29918,
15269,
7295,
13,
1678,
7048,
11219,
7070,
29914,
15269,
29914,
15269,
29881,
29918,
2917,
742,
525,
29985,
29937,
10048,
16746,
4874,
742,
525,
10048,
16746,
694,
742,
671,
29918,
15360,
29922,
5574,
29897,
13,
1678,
9773,
11219,
7070,
29914,
15269,
29914,
15269,
29881,
29918,
2917,
742,
6024,
11403,
29928,
3059,
694,
742,
525,
15737,
277,
10303,
11049,
694,
742,
525,
10251,
713,
29933,
7310,
694,
742,
525,
29911,
6814,
9598,
1022,
29909,
9258,
4874,
7464,
671,
29918,
15360,
29922,
5574,
29897,
13,
1678,
9196,
877,
5509,
13927,
10715,
1495,
13,
13,
13,
1753,
17432,
29918,
2746,
7295,
13,
1678,
411,
14965,
29898,
29903,
9094,
29918,
9464,
1125,
13,
4706,
480,
877,
5559,
17432,
448,
29939,
1273,
29879,
1273,
29879,
29915,
1273,
313,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
20095,
7464,
317,
9094,
29918,
6154,
12413,
29918,
5813,
876,
13,
1678,
411,
14965,
29898,
7122,
29898,
29903,
9094,
29918,
9464,
29892,
317,
9094,
29918,
6154,
12413,
29918,
5813,
22164,
13,
4706,
480,
877,
16747,
4770,
2344,
26914,
2272,
1495,
396,
432,
804,
29891,
982,
304,
7539,
278,
317,
9094,
29918,
6154,
12413,
29918,
5813,
763,
263,
3883,
1024,
13,
13,
13,
1753,
25161,
29918,
14095,
7295,
13,
1678,
411,
14965,
29898,
29903,
9094,
29918,
9464,
1125,
13,
4706,
480,
877,
18714,
6272,
426,
29900,
29913,
4286,
4830,
29898,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
18714,
6272,
25901,
13,
1678,
17432,
29918,
2746,
580,
13,
1678,
6230,
580,
13,
13,
29992,
7662,
13,
1753,
25161,
29918,
14095,
29918,
11027,
7295,
13,
1678,
6055,
29918,
2997,
353,
5988,
29898,
29903,
9094,
29918,
9464,
29892,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
20095,
29918,
3972,
7464,
29871,
13,
9651,
525,
4018,
538,
742,
525,
11027,
29918,
2997,
29889,
2272,
1495,
13,
13,
1678,
7035,
29918,
1989,
353,
525,
4286,
7122,
29898,
8172,
29889,
16957,
29898,
1807,
29889,
294,
18869,
29918,
1026,
2153,
718,
29871,
13,
18884,
1347,
29889,
7501,
1169,
718,
525,
30022,
29992,
29937,
29995,
29985,
29987,
29930,
29899,
29918,
1495,
363,
921,
297,
3464,
29898,
29953,
29946,
876,
13,
13,
1678,
6441,
29918,
6886,
877,
11027,
29918,
2997,
29889,
2272,
742,
13,
4706,
6055,
29918,
2997,
29892,
13,
4706,
3030,
3790,
13,
9651,
525,
2746,
29918,
978,
2396,
317,
9094,
29918,
5813,
29892,
13,
9651,
525,
2585,
29918,
978,
2396,
317,
9094,
29918,
5813,
29892,
13,
9651,
525,
19024,
29918,
1989,
2396,
7035,
29918,
1989,
29892,
13,
9651,
525,
328,
29885,
1144,
2396,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
328,
29885,
1144,
7464,
13,
9651,
525,
2974,
29918,
978,
2396,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
2974,
29918,
978,
7464,
13,
4706,
2981,
13,
4706,
671,
29918,
28789,
1764,
29922,
5574,
29892,
671,
29918,
15360,
29922,
5574,
29892,
4472,
29918,
3972,
29922,
4330,
3580,
29931,
3040,
29918,
9464,
29897,
13,
13,
1678,
9196,
877,
305,
776,
426,
1792,
6177,
29912,
2972,
29913,
426,
1445,
29913,
4286,
4830,
29898,
29871,
13,
4706,
934,
29922,
11027,
29918,
2997,
29892,
3579,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
29871,
876,
13,
13,
13,
1753,
5222,
2252,
29890,
7295,
13,
1678,
411,
14965,
29898,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
20095,
29918,
3972,
2033,
1125,
13,
4706,
325,
2146,
877,
6904,
1171,
482,
29889,
2272,
5222,
2252,
29890,
1192,
1217,
2080,
1192,
26983,
403,
1495,
13,
13,
13,
29992,
7662,
13,
1753,
1653,
29918,
9136,
1792,
7295,
13,
1678,
9995,
1653,
4113,
1404,
29889,
29871,
13,
1678,
8261,
538,
3913,
5196,
29874,
29892,
607,
338,
21351,
304,
4876,
29889,
13,
1678,
9995,
13,
1678,
411,
14965,
29898,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
20095,
29918,
3972,
2033,
1125,
13,
4706,
363,
1404,
29892,
5269,
297,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
328,
29885,
1144,
2033,
29901,
13,
9651,
325,
2146,
877,
6904,
1171,
482,
29889,
2272,
10017,
14805,
1792,
1192,
1217,
2080,
1192,
6786,
426,
1792,
29913,
1192,
5269,
426,
5269,
29913,
4286,
4830,
29898,
1792,
29922,
1792,
29892,
5269,
29922,
5269,
876,
13,
13,
13,
29992,
7662,
13,
1753,
6230,
29898,
18714,
6272,
2433,
854,
29894,
29374,
13,
13,
1678,
411,
14965,
29898,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
20095,
29918,
3972,
2033,
1125,
13,
4706,
396,
14402,
29901,
4377,
714,
920,
304,
10169,
869,
29961,
29272,
1402,
306,
3013,
2805,
29901,
8340,
1899,
1024,
13,
4706,
396,
29894,
2146,
703,
4691,
6230,
29889,
2272,
14210,
29879,
11838,
1273,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
14669,
29918,
5085,
7464,
6901,
6272,
29922,
18714,
6272,
29897,
13,
4706,
325,
2146,
703,
4691,
6230,
29889,
2272,
2601,
613,
6901,
6272,
29922,
18714,
6272,
29897,
13,
4706,
325,
2146,
703,
13096,
2601,
330,
2523,
1398,
613,
6901,
6272,
29922,
18714,
6272,
29897,
13,
4706,
325,
2146,
703,
13096,
2601,
6529,
29891,
9708,
29887,
29906,
613,
6901,
6272,
29922,
18714,
6272,
29897,
13,
13,
13,
1753,
6230,
29918,
9803,
7295,
13,
1678,
1404,
353,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
1792,
2033,
13,
1678,
1996,
29889,
2490,
7201,
29889,
2974,
580,
13,
1678,
396,
14402,
29901,
10135,
8504,
29889,
12277,
29889,
2490,
7201,
29889,
1792,
1258,
451,
2758,
263,
1404,
411,
694,
282,
29893,
9508,
29973,
1074,
565,
727,
338,
263,
2253,
982,
13,
1678,
565,
451,
1400,
7201,
29889,
1792,
29918,
9933,
29898,
1792,
1125,
13,
4706,
480,
877,
3258,
1792,
448,
29903,
448,
29928,
448,
29934,
448,
29893,
1273,
29879,
29915,
1273,
1404,
29892,
525,
2490,
7201,
1495,
13,
1678,
565,
451,
1400,
7201,
29889,
9803,
29918,
9933,
29898,
1792,
1125,
13,
4706,
1996,
29889,
2490,
7201,
29889,
9803,
29898,
1792,
29892,
1404,
29892,
8025,
2433,
10496,
29947,
742,
15068,
2433,
264,
29918,
3308,
29889,
10496,
29899,
29947,
1495,
13,
1678,
396,
14402,
29901,
1735,
2322,
2011,
13,
1678,
396,
2011,
353,
29871,
29945,
29946,
29941,
29906,
13,
1678,
396,
847,
7070,
29914,
29272,
29914,
29929,
29889,
29896,
29914,
3396,
29914,
29272,
29889,
5527,
13,
13,
13,
1753,
6230,
29918,
2746,
29918,
1792,
7295,
13,
1678,
1404,
353,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
1792,
2033,
13,
1678,
565,
451,
10135,
8504,
29889,
1792,
29889,
9933,
29898,
1792,
1125,
13,
4706,
9196,
877,
1792,
1202,
448,
29879,
29914,
2109,
29914,
13067,
448,
29881,
29914,
5184,
22584,
29879,
448,
29885,
1273,
29879,
29915,
1273,
313,
1792,
29892,
1404,
876,
13,
13,
13,
1753,
6230,
29918,
2746,
29918,
4632,
7295,
13,
1678,
7868,
381,
353,
5988,
29898,
29903,
9094,
29918,
9464,
29892,
525,
2109,
1495,
13,
1678,
1404,
353,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
1792,
2033,
13,
1678,
9196,
877,
11256,
3972,
448,
29886,
1273,
29879,
29915,
1273,
317,
9094,
29918,
9464,
29897,
13,
1678,
9196,
877,
305,
776,
1273,
29879,
16664,
29879,
1273,
29879,
29915,
1273,
313,
1792,
29892,
1404,
29892,
317,
9094,
29918,
9464,
876,
13,
13,
1678,
411,
14965,
29898,
29903,
9094,
29918,
9464,
1125,
13,
4706,
480,
877,
11256,
3972,
448,
29886,
10748,
9016,
426,
29900,
29913,
4286,
4830,
29898,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
18714,
6272,
25901,
13,
13,
1678,
411,
14965,
29898,
5355,
381,
1125,
13,
4706,
6230,
29918,
29887,
2523,
1398,
29918,
2154,
580,
13,
4706,
9196,
877,
305,
776,
448,
29934,
1273,
29879,
16664,
29879,
1273,
29879,
29915,
1273,
313,
1792,
29892,
1404,
29892,
317,
9094,
29918,
9464,
876,
13,
4706,
480,
877,
305,
1545,
718,
29916,
330,
2523,
1398,
29889,
845,
1495,
13,
13,
13,
1753,
6230,
29918,
29887,
2523,
1398,
29918,
2154,
7295,
13,
1678,
7868,
381,
353,
5988,
29898,
29903,
9094,
29918,
9464,
29892,
525,
2109,
1495,
13,
1678,
3017,
29918,
2084,
353,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
20095,
29918,
3972,
2033,
13,
13,
1678,
6441,
29918,
6886,
877,
29887,
2523,
1398,
29889,
845,
742,
13,
4706,
5988,
29898,
5355,
381,
29892,
525,
29887,
2523,
1398,
29889,
845,
5477,
13,
4706,
3030,
3790,
13,
9651,
525,
11027,
29918,
5453,
2396,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
11027,
29918,
5453,
7464,
13,
9651,
525,
2084,
29918,
517,
29918,
18714,
6272,
2396,
5988,
29898,
29903,
9094,
29918,
9464,
29892,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
18714,
6272,
2033,
511,
13,
9651,
525,
1792,
2396,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
1792,
7464,
13,
9651,
525,
2972,
2396,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
2972,
7464,
13,
9651,
525,
2746,
29918,
3972,
2396,
317,
9094,
29918,
9464,
29892,
13,
9651,
525,
5652,
3146,
29918,
5453,
2396,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
5652,
3146,
29918,
5453,
7464,
13,
9651,
525,
29887,
2523,
1398,
29918,
637,
2396,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
29887,
2523,
1398,
29918,
637,
7464,
13,
9651,
525,
4691,
29918,
2084,
2396,
3017,
29918,
2084,
29892,
13,
4706,
2981,
13,
4706,
671,
29918,
28789,
1764,
29922,
5574,
29892,
671,
29918,
15360,
29922,
5574,
29892,
4472,
29918,
3972,
29922,
4330,
3580,
29931,
3040,
29918,
9464,
29897,
13,
13,
13,
1753,
2601,
29918,
8318,
7295,
13,
1678,
1996,
29889,
16529,
29889,
21245,
397,
403,
29918,
2248,
29898,
3317,
29918,
482,
3790,
29915,
18721,
2396,
29871,
29896,
1800,
13,
1678,
1996,
29889,
16529,
29889,
8318,
4197,
13,
4706,
525,
4691,
29899,
20415,
29899,
11330,
742,
13,
4706,
525,
4691,
29899,
3359,
742,
13,
4706,
525,
4282,
29899,
404,
2556,
742,
13,
4706,
525,
1982,
3134,
29906,
742,
13,
4706,
525,
1982,
10351,
1896,
29899,
3359,
742,
13,
4706,
525,
5559,
742,
13,
4706,
525,
23257,
29899,
1062,
3417,
742,
13,
4706,
525,
1982,
10351,
1896,
29896,
29899,
3359,
742,
13,
4706,
525,
9136,
19188,
742,
13,
4706,
525,
29272,
742,
13,
4706,
525,
29272,
29899,
2974,
29899,
3359,
29899,
29929,
29889,
29896,
742,
13,
4706,
396,
5407,
541,
451,
18719,
3734,
13,
4706,
525,
29873,
335,
742,
13,
4706,
525,
26770,
742,
13,
4706,
525,
18963,
742,
13,
4706,
525,
18276,
1314,
742,
13,
4706,
525,
400,
459,
742,
13,
4706,
525,
547,
29899,
22385,
742,
13,
268,
2314,
13,
13,
13,
1753,
2601,
29918,
4691,
29918,
8318,
7295,
13,
1678,
9196,
877,
29893,
657,
1192,
339,
2035,
2045,
597,
1610,
29889,
3292,
29889,
510,
29914,
29886,
1478,
29874,
29914,
13096,
29914,
6207,
29914,
21570,
29914,
657,
29899,
13096,
29889,
2272,
1495,
13,
1678,
9196,
877,
4691,
679,
29899,
13096,
29889,
2272,
1495,
13,
1678,
396,
2601,
5534,
3017,
9741,
13,
1678,
1996,
29889,
4691,
29889,
8318,
4197,
13,
4706,
525,
18714,
6272,
17699,
742,
13,
4706,
525,
842,
771,
312,
1740,
742,
13,
4706,
525,
29893,
10552,
742,
13,
1678,
21251,
671,
29918,
15360,
29922,
5574,
29897,
13,
13,
13,
1753,
480,
29898,
9006,
29892,
1404,
29922,
8516,
1125,
13,
1678,
565,
1404,
338,
6213,
29901,
13,
4706,
1404,
353,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
1792,
2033,
13,
1678,
9196,
703,
2146,
1273,
29879,
448,
29883,
14210,
29879,
11838,
1273,
313,
1792,
29892,
9920,
876,
13,
13,
13,
1753,
325,
2146,
29898,
9006,
29892,
6901,
6272,
2433,
854,
29894,
742,
1404,
29922,
8516,
1125,
13,
1678,
565,
1404,
338,
6213,
29901,
13,
4706,
1404,
353,
317,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
1792,
2033,
13,
1678,
5039,
403,
353,
5988,
29898,
29903,
9094,
29918,
9464,
29892,
6901,
6272,
29892,
525,
2109,
742,
525,
11236,
403,
1495,
13,
1678,
9196,
703,
2146,
426,
29900,
29913,
448,
29883,
525,
4993,
426,
29896,
3400,
426,
29906,
10162,
1642,
4830,
29898,
1792,
29892,
5039,
403,
29892,
9920,
876,
13,
13,
13,
1753,
6314,
7959,
7295,
13,
1678,
411,
14965,
29898,
29903,
9094,
29918,
10490,
29911,
4214,
29903,
1839,
20095,
29918,
3972,
2033,
1125,
13,
4706,
325,
2146,
877,
6904,
1171,
482,
29889,
2272,
6314,
7959,
1192,
1217,
2080,
1495,
13,
13,
13,
1753,
4036,
1807,
29898,
29876,
1125,
13,
1678,
736,
525,
4286,
7122,
29898,
8172,
29889,
16957,
29898,
1807,
29889,
294,
18869,
29918,
1026,
2153,
718,
1347,
29889,
7501,
1169,
718,
525,
30022,
29992,
29937,
29995,
29985,
29987,
29930,
29899,
29918,
1495,
363,
921,
297,
3464,
29898,
29876,
876,
13,
2
] |
spec/__init__.py | deep-spin/spec-blackboxnlp | 2 | 26623 | <gh_stars>1-10
"""
SpEC
~~~~~~~~~~~~~~~~~~~
Sparsity, Explainability, and Communication
:copyright: (c) 2019 by <NAME>
:licence: MIT, see LICENSE for more details
"""
# Generate your own AsciiArt at:
# patorjk.com/software/taag/#f=Calvin%20S&t=SpEC
__banner__ = """
_____ _____ _____
| __|___| __| |
|__ | . | __| --|
|_____| _|_____|_____|
|_|
"""
__prog__ = "spec"
__title__ = 'SpEC'
__summary__ = 'Sparsity, Explainability, and Communication'
__uri__ = 'https://github.com/mtreviso/spec'
__version__ = '0.0.1'
__author__ = '<NAME> and <NAME>'
__email__ = '<EMAIL>'
__license__ = 'MIT'
__copyright__ = 'Copyright 2019 Marcos Treviso'
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
15945,
29908,
13,
5592,
11206,
13,
26594,
26594,
7377,
30022,
13,
29903,
862,
29879,
537,
29892,
12027,
7420,
3097,
29892,
322,
22365,
362,
13,
13,
29901,
8552,
1266,
29901,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29929,
491,
529,
5813,
29958,
13,
29901,
506,
663,
29901,
341,
1806,
29892,
1074,
365,
2965,
1430,
1660,
363,
901,
4902,
13,
15945,
29908,
13,
13,
29937,
3251,
403,
596,
1914,
1094,
18869,
9986,
472,
29901,
13,
29937,
282,
1061,
25467,
29889,
510,
29914,
20415,
29914,
941,
351,
8484,
29888,
29922,
7856,
3845,
29995,
29906,
29900,
29903,
29987,
29873,
29922,
5592,
11206,
13,
1649,
29890,
7310,
1649,
353,
9995,
13,
903,
7652,
268,
903,
7652,
903,
7652,
13,
29989,
259,
4770,
29989,
22359,
29989,
259,
4770,
29989,
268,
891,
13,
29989,
1649,
259,
891,
869,
891,
259,
4770,
29989,
259,
1192,
29989,
13,
29989,
7652,
29918,
29989,
29871,
903,
29989,
7652,
29918,
29989,
7652,
29918,
29989,
13,
418,
891,
29918,
29989,
13,
15945,
29908,
13,
13,
1649,
29097,
1649,
353,
376,
6550,
29908,
13,
1649,
3257,
1649,
353,
525,
5592,
11206,
29915,
13,
1649,
7727,
1649,
353,
525,
29903,
862,
29879,
537,
29892,
12027,
7420,
3097,
29892,
322,
22365,
362,
29915,
13,
1649,
5338,
1649,
353,
525,
991,
597,
3292,
29889,
510,
29914,
29885,
2484,
1730,
29877,
29914,
6550,
29915,
13,
13,
1649,
3259,
1649,
353,
525,
29900,
29889,
29900,
29889,
29896,
29915,
13,
13,
1649,
8921,
1649,
353,
12801,
5813,
29958,
322,
529,
5813,
16299,
13,
1649,
5269,
1649,
353,
12801,
26862,
6227,
16299,
13,
13,
1649,
506,
1947,
1649,
353,
525,
26349,
29915,
13,
1649,
8552,
1266,
1649,
353,
525,
11882,
1266,
29871,
29906,
29900,
29896,
29929,
1085,
3944,
6479,
1730,
29877,
29915,
13,
2
] |
httpd.py | bshah2016/web-processing | 250 | 70335 | #!/usr/bin/env python
PORT = 9914
SERVER = '127.0.0.1'
import SimpleHTTPServer
import BaseHTTPServer
import SocketServer
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
class Server(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer):
pass
httpd = Server((SERVER, PORT), Handler)
print "Web Server listening on http://%s:%s/ (stop with ctrl+c)..." % (SERVER, PORT)
try:
httpd.serve_forever()
except KeyboardInterrupt:
print "Going down..." | [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29871,
13,
15082,
353,
29871,
29929,
29929,
29896,
29946,
13,
18603,
353,
525,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
29915,
13,
29871,
13,
5215,
12545,
10493,
6004,
13,
5215,
7399,
10493,
6004,
13,
5215,
29141,
6004,
13,
13,
4598,
353,
12545,
10493,
6004,
29889,
15427,
10493,
3089,
4598,
13,
13,
1990,
5656,
29898,
11373,
6004,
29889,
4899,
292,
29924,
861,
797,
29892,
7399,
10493,
6004,
29889,
10493,
6004,
1125,
13,
1678,
1209,
13,
13,
1124,
29881,
353,
5656,
3552,
18603,
29892,
349,
8476,
511,
5166,
1358,
29897,
13,
2158,
376,
3609,
5656,
19866,
373,
1732,
597,
29995,
29879,
16664,
29879,
29914,
313,
9847,
411,
274,
11742,
29974,
29883,
467,
636,
29908,
1273,
313,
18603,
29892,
349,
8476,
29897,
13,
13,
2202,
29901,
13,
1678,
1732,
29881,
29889,
16349,
29918,
1079,
369,
580,
13,
19499,
7670,
3377,
4074,
6685,
29901,
13,
1678,
1596,
376,
8120,
292,
1623,
17794,
2
] |
scripts/junction_tree/generate_vocab.py | rtriangle/moses | 2 | 164523 | <reponame>rtriangle/moses<gh_stars>1-10
import argparse
import rdkit
import torch
import tqdm
from moses.junction_tree.datautils import JTreeVocab
from moses.junction_tree.jtnn.mol_tree import MolTree
from moses.script_utils import read_smiles_csv
lg = rdkit.RDLogger.logger()
lg.setLevel(rdkit.RDLogger.CRITICAL)
def main(config):
data = read_smiles_csv(config.train_load)
clusters = set()
for smiles in tqdm.tqdm(data):
mol = MolTree(smiles)
for c in mol.nodes:
clusters.add(c.smiles)
vocab = JTreeVocab(sorted(list(clusters)))
torch.save(vocab, config.vocab_save)
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument("--train_load", type=str, required=True, help='Input data in csv format to train')
parser.add_argument('--vocab_save', type=str, default='vocab.pt', help='Where to save the vocab')
return parser
if __name__ == '__main__':
parser = get_parser()
config = parser.parse_known_args()[0]
main(config)
| [
1,
529,
276,
1112,
420,
29958,
2273,
374,
2521,
29914,
7681,
267,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
1852,
5510,
13,
13,
5215,
364,
29881,
7354,
13,
5215,
4842,
305,
13,
5215,
260,
29939,
18933,
13,
13,
3166,
286,
15806,
29889,
29926,
651,
29918,
8336,
29889,
1272,
13239,
1053,
435,
9643,
29963,
542,
370,
13,
3166,
286,
15806,
29889,
29926,
651,
29918,
8336,
29889,
29926,
6277,
29876,
29889,
29885,
324,
29918,
8336,
1053,
10750,
9643,
13,
3166,
286,
15806,
29889,
2154,
29918,
13239,
1053,
1303,
29918,
3844,
5475,
29918,
7638,
13,
13,
19920,
353,
364,
29881,
7354,
29889,
29934,
29928,
16363,
29889,
21707,
580,
13,
19920,
29889,
842,
10108,
29898,
5499,
7354,
29889,
29934,
29928,
16363,
29889,
11341,
1806,
2965,
1964,
29897,
13,
13,
13,
1753,
1667,
29898,
2917,
1125,
13,
1678,
848,
353,
1303,
29918,
3844,
5475,
29918,
7638,
29898,
2917,
29889,
14968,
29918,
1359,
29897,
13,
13,
1678,
24554,
353,
731,
580,
13,
13,
1678,
363,
1560,
5475,
297,
260,
29939,
18933,
29889,
29873,
29939,
18933,
29898,
1272,
1125,
13,
4706,
6062,
353,
10750,
9643,
29898,
3844,
5475,
29897,
13,
4706,
363,
274,
297,
6062,
29889,
18010,
29901,
13,
9651,
24554,
29889,
1202,
29898,
29883,
29889,
3844,
5475,
29897,
13,
13,
1678,
7931,
370,
353,
435,
9643,
29963,
542,
370,
29898,
24582,
29898,
1761,
29898,
695,
504,
414,
4961,
13,
1678,
4842,
305,
29889,
7620,
29898,
29894,
542,
370,
29892,
2295,
29889,
29894,
542,
370,
29918,
7620,
29897,
13,
13,
13,
1753,
679,
29918,
16680,
7295,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
14968,
29918,
1359,
613,
1134,
29922,
710,
29892,
3734,
29922,
5574,
29892,
1371,
2433,
4290,
848,
297,
11799,
3402,
304,
7945,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
29894,
542,
370,
29918,
7620,
742,
1134,
29922,
710,
29892,
2322,
2433,
29894,
542,
370,
29889,
415,
742,
1371,
2433,
11921,
304,
4078,
278,
7931,
370,
1495,
13,
13,
1678,
736,
13812,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
13812,
353,
679,
29918,
16680,
580,
13,
1678,
2295,
353,
13812,
29889,
5510,
29918,
5203,
29918,
5085,
580,
29961,
29900,
29962,
13,
1678,
1667,
29898,
2917,
29897,
13,
2
] |
tests/providers/apache/hive/transfers/test_s3_to_hive.py | gtossou/airflow | 2 | 197823 | <gh_stars>1-10
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import bz2
import errno
import filecmp
import logging
import shutil
import unittest
from collections import OrderedDict
from gzip import GzipFile
from itertools import product
from tempfile import NamedTemporaryFile, mkdtemp
from unittest import mock
from airflow.exceptions import AirflowException
from airflow.providers.apache.hive.transfers.s3_to_hive import S3ToHiveOperator
try:
import boto3
from moto import mock_s3
except ImportError:
mock_s3 = None
class TestS3ToHiveTransfer(unittest.TestCase):
def setUp(self):
self.file_names = {}
self.task_id = 'S3ToHiveTransferTest'
self.s3_key = 'S32hive_test_file'
self.field_dict = OrderedDict([('Sno', 'BIGINT'), ('Some,Text', 'STRING')])
self.hive_table = 'S32hive_test_table'
self.delimiter = '\t'
self.create = True
self.recreate = True
self.partition = {'ds': 'STRING'}
self.headers = True
self.check_headers = True
self.wildcard_match = False
self.input_compressed = False
self.kwargs = {
'task_id': self.task_id,
's3_key': self.s3_key,
'field_dict': self.field_dict,
'hive_table': self.hive_table,
'delimiter': self.delimiter,
'create': self.create,
'recreate': self.recreate,
'partition': self.partition,
'headers': self.headers,
'check_headers': self.check_headers,
'wildcard_match': self.wildcard_match,
'input_compressed': self.input_compressed,
}
try:
header = b"Sno\tSome,Text \n"
line1 = b"1\tAirflow Test\n"
line2 = b"2\tS32HiveTransfer\n"
self.tmp_dir = mkdtemp(prefix='test_tmps32hive_')
# create sample txt, gz and bz2 with and without headers
with NamedTemporaryFile(mode='wb+', dir=self.tmp_dir, delete=False) as f_txt_h:
self._set_fn(f_txt_h.name, '.txt', True)
f_txt_h.writelines([header, line1, line2])
fn_gz = self._get_fn('.txt', True) + ".gz"
with GzipFile(filename=fn_gz, mode="wb") as f_gz_h:
self._set_fn(fn_gz, '.gz', True)
f_gz_h.writelines([header, line1, line2])
fn_gz_upper = self._get_fn('.txt', True) + ".GZ"
with GzipFile(filename=fn_gz_upper, mode="wb") as f_gz_upper_h:
self._set_fn(fn_gz_upper, '.GZ', True)
f_gz_upper_h.writelines([header, line1, line2])
fn_bz2 = self._get_fn('.txt', True) + '.bz2'
with bz2.BZ2File(filename=fn_bz2, mode="wb") as f_bz2_h:
self._set_fn(fn_bz2, '.bz2', True)
f_bz2_h.writelines([header, line1, line2])
# create sample txt, bz and bz2 without header
with NamedTemporaryFile(mode='wb+', dir=self.tmp_dir, delete=False) as f_txt_nh:
self._set_fn(f_txt_nh.name, '.txt', False)
f_txt_nh.writelines([line1, line2])
fn_gz = self._get_fn('.txt', False) + ".gz"
with GzipFile(filename=fn_gz, mode="wb") as f_gz_nh:
self._set_fn(fn_gz, '.gz', False)
f_gz_nh.writelines([line1, line2])
fn_gz_upper = self._get_fn('.txt', False) + ".GZ"
with GzipFile(filename=fn_gz_upper, mode="wb") as f_gz_upper_nh:
self._set_fn(fn_gz_upper, '.GZ', False)
f_gz_upper_nh.writelines([line1, line2])
fn_bz2 = self._get_fn('.txt', False) + '.bz2'
with bz2.BZ2File(filename=fn_bz2, mode="wb") as f_bz2_nh:
self._set_fn(fn_bz2, '.bz2', False)
f_bz2_nh.writelines([line1, line2])
# Base Exception so it catches Keyboard Interrupt
except BaseException as e:
logging.error(e)
self.tearDown()
def tearDown(self):
try:
shutil.rmtree(self.tmp_dir)
except OSError as e:
# ENOENT - no such file or directory
if e.errno != errno.ENOENT:
raise e
# Helper method to create a dictionary of file names and
# file types (file extension and header)
def _set_fn(self, fn, ext, header):
key = self._get_key(ext, header)
self.file_names[key] = fn
# Helper method to fetch a file of a
# certain format (file extension and header)
def _get_fn(self, ext, header):
key = self._get_key(ext, header)
return self.file_names[key]
@staticmethod
def _get_key(ext, header):
key = ext + "_" + ('h' if header else 'nh')
return key
@staticmethod
def _check_file_equality(fn_1, fn_2, ext):
# gz files contain mtime and filename in the header that
# causes filecmp to return False even if contents are identical
# Hence decompress to test for equality
if ext.lower() == '.gz':
with GzipFile(fn_1, 'rb') as f_1, NamedTemporaryFile(mode='wb') as f_txt_1:
with GzipFile(fn_2, 'rb') as f_2, NamedTemporaryFile(mode='wb') as f_txt_2:
shutil.copyfileobj(f_1, f_txt_1)
shutil.copyfileobj(f_2, f_txt_2)
f_txt_1.flush()
f_txt_2.flush()
return filecmp.cmp(f_txt_1.name, f_txt_2.name, shallow=False)
else:
return filecmp.cmp(fn_1, fn_2, shallow=False)
def test_bad_parameters(self):
self.kwargs['check_headers'] = True
self.kwargs['headers'] = False
self.assertRaisesRegex(AirflowException, "To check_headers.*", S3ToHiveOperator, **self.kwargs)
def test__get_top_row_as_list(self):
self.kwargs['delimiter'] = '\t'
fn_txt = self._get_fn('.txt', True)
header_list = S3ToHiveOperator(**self.kwargs)._get_top_row_as_list(fn_txt)
self.assertEqual(
header_list, ['Sno', 'Some,Text'], msg="Top row from file doesnt matched expected value"
)
self.kwargs['delimiter'] = ','
header_list = S3ToHiveOperator(**self.kwargs)._get_top_row_as_list(fn_txt)
self.assertEqual(
header_list, ['Sno\tSome', 'Text'], msg="Top row from file doesnt matched expected value"
)
def test__match_headers(self):
self.kwargs['field_dict'] = OrderedDict([('Sno', 'BIGINT'), ('Some,Text', 'STRING')])
self.assertTrue(
S3ToHiveOperator(**self.kwargs)._match_headers(['Sno', 'Some,Text']),
msg="Header row doesnt match expected value",
)
# Testing with different column order
self.assertFalse(
S3ToHiveOperator(**self.kwargs)._match_headers(['Some,Text', 'Sno']),
msg="Header row doesnt match expected value",
)
# Testing with extra column in header
self.assertFalse(
S3ToHiveOperator(**self.kwargs)._match_headers(['Sno', 'Some,Text', 'ExtraColumn']),
msg="Header row doesnt match expected value",
)
def test__delete_top_row_and_compress(self):
s32hive = S3ToHiveOperator(**self.kwargs)
# Testing gz file type
fn_txt = self._get_fn('.txt', True)
gz_txt_nh = s32hive._delete_top_row_and_compress(fn_txt, '.gz', self.tmp_dir)
fn_gz = self._get_fn('.gz', False)
self.assertTrue(
self._check_file_equality(gz_txt_nh, fn_gz, '.gz'), msg="gz Compressed file not as expected"
)
# Testing bz2 file type
bz2_txt_nh = s32hive._delete_top_row_and_compress(fn_txt, '.bz2', self.tmp_dir)
fn_bz2 = self._get_fn('.bz2', False)
self.assertTrue(
self._check_file_equality(bz2_txt_nh, fn_bz2, '.bz2'), msg="bz2 Compressed file not as expected"
)
@unittest.skipIf(mock is None, 'mock package not present')
@unittest.skipIf(mock_s3 is None, 'moto package not present')
@mock.patch('airflow.providers.apache.hive.transfers.s3_to_hive.HiveCliHook')
@mock_s3
def test_execute(self, mock_hiveclihook):
conn = boto3.client('s3')
conn.create_bucket(Bucket='bucket')
# Testing txt, zip, bz2 files with and without header row
for (ext, has_header) in product(['.txt', '.gz', '.bz2', '.GZ'], [True, False]):
self.kwargs['headers'] = has_header
self.kwargs['check_headers'] = has_header
logging.info("Testing %s format %s header", ext, 'with' if has_header else 'without')
self.kwargs['input_compressed'] = ext.lower() != '.txt'
self.kwargs['s3_key'] = 's3://bucket/' + self.s3_key + ext
ip_fn = self._get_fn(ext, self.kwargs['headers'])
op_fn = self._get_fn(ext, False)
# Upload the file into the Mocked S3 bucket
conn.upload_file(ip_fn, 'bucket', self.s3_key + ext)
# file parameter to HiveCliHook.load_file is compared
# against expected file output
mock_hiveclihook().load_file.side_effect = lambda *args, **kwargs: self.assertTrue(
self._check_file_equality(args[0], op_fn, ext),
msg='{0} output file not as expected'.format(ext),
)
# Execute S3ToHiveTransfer
s32hive = S3ToHiveOperator(**self.kwargs)
s32hive.execute(None)
@unittest.skipIf(mock is None, 'mock package not present')
@unittest.skipIf(mock_s3 is None, 'moto package not present')
@mock.patch('airflow.providers.apache.hive.transfers.s3_to_hive.HiveCliHook')
@mock_s3
def test_execute_with_select_expression(self, mock_hiveclihook):
conn = boto3.client('s3')
conn.create_bucket(Bucket='bucket')
select_expression = "SELECT * FROM S3Object s"
bucket = 'bucket'
# Only testing S3ToHiveTransfer calls S3Hook.select_key with
# the right parameters and its execute method succeeds here,
# since Moto doesn't support select_object_content as of 1.3.2.
for (ext, has_header) in product(['.txt', '.gz', '.GZ'], [True, False]):
input_compressed = ext.lower() != '.txt'
key = self.s3_key + ext
self.kwargs['check_headers'] = False
self.kwargs['headers'] = has_header
self.kwargs['input_compressed'] = input_compressed
self.kwargs['select_expression'] = select_expression
self.kwargs['s3_key'] = 's3://{0}/{1}'.format(bucket, key)
ip_fn = self._get_fn(ext, has_header)
# Upload the file into the Mocked S3 bucket
conn.upload_file(ip_fn, bucket, key)
input_serialization = {'CSV': {'FieldDelimiter': self.delimiter}}
if input_compressed:
input_serialization['CompressionType'] = 'GZIP'
if has_header:
input_serialization['CSV']['FileHeaderInfo'] = 'USE'
# Confirm that select_key was called with the right params
with mock.patch(
'airflow.providers.amazon.aws.hooks.s3.S3Hook.select_key', return_value=""
) as mock_select_key:
# Execute S3ToHiveTransfer
s32hive = S3ToHiveOperator(**self.kwargs)
s32hive.execute(None)
mock_select_key.assert_called_once_with(
bucket_name=bucket,
key=key,
expression=select_expression,
input_serialization=input_serialization,
)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
13,
29937,
10413,
21144,
304,
278,
13380,
18540,
10606,
313,
3289,
29943,
29897,
1090,
697,
13,
29937,
470,
901,
17737,
3406,
19405,
8571,
4110,
29889,
29871,
2823,
278,
6058,
12107,
934,
13,
29937,
13235,
411,
445,
664,
363,
5684,
2472,
13,
29937,
11211,
3509,
1266,
27428,
29889,
29871,
450,
3339,
29943,
7794,
11259,
445,
934,
13,
29937,
304,
366,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
13,
29937,
376,
29931,
293,
1947,
1496,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
13,
29937,
411,
278,
19245,
29889,
29871,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
259,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
13,
29937,
7047,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
13,
29937,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
13,
29937,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
29871,
2823,
278,
19245,
363,
278,
13,
29937,
2702,
4086,
14765,
1076,
11239,
322,
27028,
13,
29937,
1090,
278,
19245,
29889,
13,
13,
5215,
289,
29920,
29906,
13,
5215,
4589,
1217,
13,
5215,
934,
21058,
13,
5215,
12183,
13,
5215,
528,
4422,
13,
5215,
443,
27958,
13,
3166,
16250,
1053,
8170,
287,
21533,
13,
3166,
330,
7554,
1053,
402,
7554,
2283,
13,
3166,
4256,
8504,
1053,
3234,
13,
3166,
5694,
1445,
1053,
405,
2795,
5776,
1971,
653,
2283,
29892,
14690,
29881,
7382,
13,
13,
3166,
443,
27958,
1053,
11187,
13,
13,
3166,
4799,
1731,
29889,
11739,
29879,
1053,
5593,
1731,
2451,
13,
3166,
4799,
1731,
29889,
771,
29454,
29889,
4288,
29889,
29882,
573,
29889,
3286,
25534,
29889,
29879,
29941,
29918,
517,
29918,
29882,
573,
1053,
317,
29941,
1762,
29950,
573,
26486,
13,
13,
2202,
29901,
13,
1678,
1053,
289,
3747,
29941,
13,
1678,
515,
3184,
29877,
1053,
11187,
29918,
29879,
29941,
13,
19499,
16032,
2392,
29901,
13,
1678,
11187,
29918,
29879,
29941,
353,
6213,
13,
13,
13,
1990,
4321,
29903,
29941,
1762,
29950,
573,
4300,
571,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1445,
29918,
7039,
353,
6571,
13,
4706,
1583,
29889,
7662,
29918,
333,
353,
525,
29903,
29941,
1762,
29950,
573,
4300,
571,
3057,
29915,
13,
4706,
1583,
29889,
29879,
29941,
29918,
1989,
353,
525,
29903,
29941,
29906,
29882,
573,
29918,
1688,
29918,
1445,
29915,
13,
4706,
1583,
29889,
2671,
29918,
8977,
353,
8170,
287,
21533,
4197,
877,
29903,
1217,
742,
525,
29933,
6259,
10192,
5477,
6702,
9526,
29892,
1626,
742,
525,
20785,
1495,
2314,
13,
4706,
1583,
29889,
29882,
573,
29918,
2371,
353,
525,
29903,
29941,
29906,
29882,
573,
29918,
1688,
29918,
2371,
29915,
13,
4706,
1583,
29889,
6144,
19657,
353,
11297,
29873,
29915,
13,
4706,
1583,
29889,
3258,
353,
5852,
13,
4706,
1583,
29889,
276,
3258,
353,
5852,
13,
4706,
1583,
29889,
16707,
353,
11117,
6289,
2396,
525,
20785,
10827,
13,
4706,
1583,
29889,
13662,
353,
5852,
13,
4706,
1583,
29889,
3198,
29918,
13662,
353,
5852,
13,
4706,
1583,
29889,
29893,
789,
7543,
29918,
4352,
353,
7700,
13,
4706,
1583,
29889,
2080,
29918,
510,
13120,
353,
7700,
13,
4706,
1583,
29889,
19290,
353,
426,
13,
9651,
525,
7662,
29918,
333,
2396,
1583,
29889,
7662,
29918,
333,
29892,
13,
9651,
525,
29879,
29941,
29918,
1989,
2396,
1583,
29889,
29879,
29941,
29918,
1989,
29892,
13,
9651,
525,
2671,
29918,
8977,
2396,
1583,
29889,
2671,
29918,
8977,
29892,
13,
9651,
525,
29882,
573,
29918,
2371,
2396,
1583,
29889,
29882,
573,
29918,
2371,
29892,
13,
9651,
525,
6144,
19657,
2396,
1583,
29889,
6144,
19657,
29892,
13,
9651,
525,
3258,
2396,
1583,
29889,
3258,
29892,
13,
9651,
525,
276,
3258,
2396,
1583,
29889,
276,
3258,
29892,
13,
9651,
525,
16707,
2396,
1583,
29889,
16707,
29892,
13,
9651,
525,
13662,
2396,
1583,
29889,
13662,
29892,
13,
9651,
525,
3198,
29918,
13662,
2396,
1583,
29889,
3198,
29918,
13662,
29892,
13,
9651,
525,
29893,
789,
7543,
29918,
4352,
2396,
1583,
29889,
29893,
789,
7543,
29918,
4352,
29892,
13,
9651,
525,
2080,
29918,
510,
13120,
2396,
1583,
29889,
2080,
29918,
510,
13120,
29892,
13,
4706,
500,
13,
4706,
1018,
29901,
13,
9651,
4839,
353,
289,
29908,
29903,
1217,
29905,
29873,
9526,
29892,
1626,
320,
29876,
29908,
13,
9651,
1196,
29896,
353,
289,
29908,
29896,
29905,
29873,
29909,
381,
1731,
4321,
29905,
29876,
29908,
13,
9651,
1196,
29906,
353,
289,
29908,
29906,
29905,
29873,
29903,
29941,
29906,
29950,
573,
4300,
571,
29905,
29876,
29908,
13,
9651,
1583,
29889,
7050,
29918,
3972,
353,
14690,
29881,
7382,
29898,
13506,
2433,
1688,
29918,
18276,
567,
29941,
29906,
29882,
573,
29918,
1495,
13,
9651,
396,
1653,
4559,
13872,
29892,
330,
29920,
322,
289,
29920,
29906,
411,
322,
1728,
9066,
13,
9651,
411,
405,
2795,
5776,
1971,
653,
2283,
29898,
8513,
2433,
29893,
29890,
29974,
742,
4516,
29922,
1311,
29889,
7050,
29918,
3972,
29892,
5217,
29922,
8824,
29897,
408,
285,
29918,
3945,
29918,
29882,
29901,
13,
18884,
1583,
3032,
842,
29918,
9144,
29898,
29888,
29918,
3945,
29918,
29882,
29889,
978,
29892,
15300,
3945,
742,
5852,
29897,
13,
18884,
285,
29918,
3945,
29918,
29882,
29889,
8231,
24210,
4197,
6672,
29892,
1196,
29896,
29892,
1196,
29906,
2314,
13,
9651,
7876,
29918,
18828,
353,
1583,
3032,
657,
29918,
9144,
12839,
3945,
742,
5852,
29897,
718,
11393,
18828,
29908,
13,
9651,
411,
402,
7554,
2283,
29898,
9507,
29922,
9144,
29918,
18828,
29892,
4464,
543,
29893,
29890,
1159,
408,
285,
29918,
18828,
29918,
29882,
29901,
13,
18884,
1583,
3032,
842,
29918,
9144,
29898,
9144,
29918,
18828,
29892,
15300,
18828,
742,
5852,
29897,
13,
18884,
285,
29918,
18828,
29918,
29882,
29889,
8231,
24210,
4197,
6672,
29892,
1196,
29896,
29892,
1196,
29906,
2314,
13,
9651,
7876,
29918,
18828,
29918,
21064,
353,
1583,
3032,
657,
29918,
9144,
12839,
3945,
742,
5852,
29897,
718,
11393,
29954,
29999,
29908,
13,
9651,
411,
402,
7554,
2283,
29898,
9507,
29922,
9144,
29918,
18828,
29918,
21064,
29892,
4464,
543,
29893,
29890,
1159,
408,
285,
29918,
18828,
29918,
21064,
29918,
29882,
29901,
13,
18884,
1583,
3032,
842,
29918,
9144,
29898,
9144,
29918,
18828,
29918,
21064,
29892,
15300,
29954,
29999,
742,
5852,
29897,
13,
18884,
285,
29918,
18828,
29918,
21064,
29918,
29882,
29889,
8231,
24210,
4197,
6672,
29892,
1196,
29896,
29892,
1196,
29906,
2314,
13,
9651,
7876,
29918,
29890,
29920,
29906,
353,
1583,
3032,
657,
29918,
9144,
12839,
3945,
742,
5852,
29897,
718,
15300,
29890,
29920,
29906,
29915,
13,
9651,
411,
289,
29920,
29906,
29889,
29933,
29999,
29906,
2283,
29898,
9507,
29922,
9144,
29918,
29890,
29920,
29906,
29892,
4464,
543,
29893,
29890,
1159,
408,
285,
29918,
29890,
29920,
29906,
29918,
29882,
29901,
13,
18884,
1583,
3032,
842,
29918,
9144,
29898,
9144,
29918,
29890,
29920,
29906,
29892,
15300,
29890,
29920,
29906,
742,
5852,
29897,
13,
18884,
285,
29918,
29890,
29920,
29906,
29918,
29882,
29889,
8231,
24210,
4197,
6672,
29892,
1196,
29896,
29892,
1196,
29906,
2314,
13,
9651,
396,
1653,
4559,
13872,
29892,
289,
29920,
322,
289,
29920,
29906,
1728,
4839,
13,
9651,
411,
405,
2795,
5776,
1971,
653,
2283,
29898,
8513,
2433,
29893,
29890,
29974,
742,
4516,
29922,
1311,
29889,
7050,
29918,
3972,
29892,
5217,
29922,
8824,
29897,
408,
285,
29918,
3945,
29918,
29876,
29882,
29901,
13,
18884,
1583,
3032,
842,
29918,
9144,
29898,
29888,
29918,
3945,
29918,
29876,
29882,
29889,
978,
29892,
15300,
3945,
742,
7700,
29897,
13,
18884,
285,
29918,
3945,
29918,
29876,
29882,
29889,
8231,
24210,
4197,
1220,
29896,
29892,
1196,
29906,
2314,
13,
9651,
7876,
29918,
18828,
353,
1583,
3032,
657,
29918,
9144,
12839,
3945,
742,
7700,
29897,
718,
11393,
18828,
29908,
13,
9651,
411,
402,
7554,
2283,
29898,
9507,
29922,
9144,
29918,
18828,
29892,
4464,
543,
29893,
29890,
1159,
408,
285,
29918,
18828,
29918,
29876,
29882,
29901,
13,
18884,
1583,
3032,
842,
29918,
9144,
29898,
9144,
29918,
18828,
29892,
15300,
18828,
742,
7700,
29897,
13,
18884,
285,
29918,
18828,
29918,
29876,
29882,
29889,
8231,
24210,
4197,
1220,
29896,
29892,
1196,
29906,
2314,
13,
9651,
7876,
29918,
18828,
29918,
21064,
353,
1583,
3032,
657,
29918,
9144,
12839,
3945,
742,
7700,
29897,
718,
11393,
29954,
29999,
29908,
13,
9651,
411,
402,
7554,
2283,
29898,
9507,
29922,
9144,
29918,
18828,
29918,
21064,
29892,
4464,
543,
29893,
29890,
1159,
408,
285,
29918,
18828,
29918,
21064,
29918,
29876,
29882,
29901,
13,
18884,
1583,
3032,
842,
29918,
9144,
29898,
9144,
29918,
18828,
29918,
21064,
29892,
15300,
29954,
29999,
742,
7700,
29897,
13,
18884,
285,
29918,
18828,
29918,
21064,
29918,
29876,
29882,
29889,
8231,
24210,
4197,
1220,
29896,
29892,
1196,
29906,
2314,
13,
9651,
7876,
29918,
29890,
29920,
29906,
353,
1583,
3032,
657,
29918,
9144,
12839,
3945,
742,
7700,
29897,
718,
15300,
29890,
29920,
29906,
29915,
13,
9651,
411,
289,
29920,
29906,
29889,
29933,
29999,
29906,
2283,
29898,
9507,
29922,
9144,
29918,
29890,
29920,
29906,
29892,
4464,
543,
29893,
29890,
1159,
408,
285,
29918,
29890,
29920,
29906,
29918,
29876,
29882,
29901,
13,
18884,
1583,
3032,
842,
29918,
9144,
29898,
9144,
29918,
29890,
29920,
29906,
29892,
15300,
29890,
29920,
29906,
742,
7700,
29897,
13,
18884,
285,
29918,
29890,
29920,
29906,
29918,
29876,
29882,
29889,
8231,
24210,
4197,
1220,
29896,
29892,
1196,
29906,
2314,
13,
4706,
396,
7399,
8960,
577,
372,
4380,
267,
7670,
3377,
4124,
6685,
13,
4706,
5174,
7399,
2451,
408,
321,
29901,
13,
9651,
12183,
29889,
2704,
29898,
29872,
29897,
13,
9651,
1583,
29889,
371,
279,
6767,
580,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
528,
4422,
29889,
1758,
8336,
29898,
1311,
29889,
7050,
29918,
3972,
29897,
13,
4706,
5174,
438,
29173,
408,
321,
29901,
13,
9651,
396,
382,
6632,
3919,
448,
694,
1316,
934,
470,
3884,
13,
9651,
565,
321,
29889,
3127,
1217,
2804,
4589,
1217,
29889,
1430,
29949,
3919,
29901,
13,
18884,
12020,
321,
13,
13,
1678,
396,
6162,
546,
1158,
304,
1653,
263,
8600,
310,
934,
2983,
322,
13,
1678,
396,
934,
4072,
313,
1445,
6081,
322,
4839,
29897,
13,
1678,
822,
903,
842,
29918,
9144,
29898,
1311,
29892,
7876,
29892,
1294,
29892,
4839,
1125,
13,
4706,
1820,
353,
1583,
3032,
657,
29918,
1989,
29898,
1062,
29892,
4839,
29897,
13,
4706,
1583,
29889,
1445,
29918,
7039,
29961,
1989,
29962,
353,
7876,
13,
13,
1678,
396,
6162,
546,
1158,
304,
6699,
263,
934,
310,
263,
13,
1678,
396,
3058,
3402,
313,
1445,
6081,
322,
4839,
29897,
13,
1678,
822,
903,
657,
29918,
9144,
29898,
1311,
29892,
1294,
29892,
4839,
1125,
13,
4706,
1820,
353,
1583,
3032,
657,
29918,
1989,
29898,
1062,
29892,
4839,
29897,
13,
4706,
736,
1583,
29889,
1445,
29918,
7039,
29961,
1989,
29962,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
903,
657,
29918,
1989,
29898,
1062,
29892,
4839,
1125,
13,
4706,
1820,
353,
1294,
718,
11119,
29908,
718,
6702,
29882,
29915,
565,
4839,
1683,
525,
29876,
29882,
1495,
13,
4706,
736,
1820,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
903,
3198,
29918,
1445,
29918,
13895,
29898,
9144,
29918,
29896,
29892,
7876,
29918,
29906,
29892,
1294,
1125,
13,
4706,
396,
330,
29920,
2066,
1712,
286,
2230,
322,
10422,
297,
278,
4839,
393,
13,
4706,
396,
9946,
934,
21058,
304,
736,
7700,
1584,
565,
8118,
526,
13557,
13,
4706,
396,
10133,
17753,
2139,
304,
1243,
363,
17193,
13,
4706,
565,
1294,
29889,
13609,
580,
1275,
15300,
18828,
2396,
13,
9651,
411,
402,
7554,
2283,
29898,
9144,
29918,
29896,
29892,
525,
6050,
1495,
408,
285,
29918,
29896,
29892,
405,
2795,
5776,
1971,
653,
2283,
29898,
8513,
2433,
29893,
29890,
1495,
408,
285,
29918,
3945,
29918,
29896,
29901,
13,
18884,
411,
402,
7554,
2283,
29898,
9144,
29918,
29906,
29892,
525,
6050,
1495,
408,
285,
29918,
29906,
29892,
405,
2795,
5776,
1971,
653,
2283,
29898,
8513,
2433,
29893,
29890,
1495,
408,
285,
29918,
3945,
29918,
29906,
29901,
13,
462,
1678,
528,
4422,
29889,
8552,
1445,
5415,
29898,
29888,
29918,
29896,
29892,
285,
29918,
3945,
29918,
29896,
29897,
13,
462,
1678,
528,
4422,
29889,
8552,
1445,
5415,
29898,
29888,
29918,
29906,
29892,
285,
29918,
3945,
29918,
29906,
29897,
13,
462,
1678,
285,
29918,
3945,
29918,
29896,
29889,
23126,
580,
13,
462,
1678,
285,
29918,
3945,
29918,
29906,
29889,
23126,
580,
13,
462,
1678,
736,
934,
21058,
29889,
21058,
29898,
29888,
29918,
3945,
29918,
29896,
29889,
978,
29892,
285,
29918,
3945,
29918,
29906,
29889,
978,
29892,
4091,
340,
29922,
8824,
29897,
13,
4706,
1683,
29901,
13,
9651,
736,
934,
21058,
29889,
21058,
29898,
9144,
29918,
29896,
29892,
7876,
29918,
29906,
29892,
4091,
340,
29922,
8824,
29897,
13,
13,
1678,
822,
1243,
29918,
12313,
29918,
16744,
29898,
1311,
1125,
13,
4706,
1583,
29889,
19290,
1839,
3198,
29918,
13662,
2033,
353,
5852,
13,
4706,
1583,
29889,
19290,
1839,
13662,
2033,
353,
7700,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
4597,
735,
29898,
29909,
381,
1731,
2451,
29892,
376,
1762,
1423,
29918,
13662,
5575,
613,
317,
29941,
1762,
29950,
573,
26486,
29892,
3579,
1311,
29889,
19290,
29897,
13,
13,
1678,
822,
1243,
1649,
657,
29918,
3332,
29918,
798,
29918,
294,
29918,
1761,
29898,
1311,
1125,
13,
4706,
1583,
29889,
19290,
1839,
6144,
19657,
2033,
353,
11297,
29873,
29915,
13,
4706,
7876,
29918,
3945,
353,
1583,
3032,
657,
29918,
9144,
12839,
3945,
742,
5852,
29897,
13,
4706,
4839,
29918,
1761,
353,
317,
29941,
1762,
29950,
573,
26486,
29898,
1068,
1311,
29889,
19290,
467,
29918,
657,
29918,
3332,
29918,
798,
29918,
294,
29918,
1761,
29898,
9144,
29918,
3945,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
4839,
29918,
1761,
29892,
6024,
29903,
1217,
742,
525,
9526,
29892,
1626,
7464,
10191,
543,
7031,
1948,
515,
934,
19403,
19228,
3806,
995,
29908,
13,
4706,
1723,
13,
13,
4706,
1583,
29889,
19290,
1839,
6144,
19657,
2033,
353,
525,
5501,
13,
4706,
4839,
29918,
1761,
353,
317,
29941,
1762,
29950,
573,
26486,
29898,
1068,
1311,
29889,
19290,
467,
29918,
657,
29918,
3332,
29918,
798,
29918,
294,
29918,
1761,
29898,
9144,
29918,
3945,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
4839,
29918,
1761,
29892,
6024,
29903,
1217,
29905,
29873,
9526,
742,
525,
1626,
7464,
10191,
543,
7031,
1948,
515,
934,
19403,
19228,
3806,
995,
29908,
13,
4706,
1723,
13,
13,
1678,
822,
1243,
1649,
4352,
29918,
13662,
29898,
1311,
1125,
13,
4706,
1583,
29889,
19290,
1839,
2671,
29918,
8977,
2033,
353,
8170,
287,
21533,
4197,
877,
29903,
1217,
742,
525,
29933,
6259,
10192,
5477,
6702,
9526,
29892,
1626,
742,
525,
20785,
1495,
2314,
13,
4706,
1583,
29889,
9294,
5574,
29898,
13,
9651,
317,
29941,
1762,
29950,
573,
26486,
29898,
1068,
1311,
29889,
19290,
467,
29918,
4352,
29918,
13662,
18959,
29903,
1217,
742,
525,
9526,
29892,
1626,
2033,
511,
13,
9651,
10191,
543,
7850,
1948,
19403,
1993,
3806,
995,
613,
13,
4706,
1723,
13,
4706,
396,
4321,
292,
411,
1422,
1897,
1797,
13,
4706,
1583,
29889,
9294,
8824,
29898,
13,
9651,
317,
29941,
1762,
29950,
573,
26486,
29898,
1068,
1311,
29889,
19290,
467,
29918,
4352,
29918,
13662,
18959,
9526,
29892,
1626,
742,
525,
29903,
1217,
2033,
511,
13,
9651,
10191,
543,
7850,
1948,
19403,
1993,
3806,
995,
613,
13,
4706,
1723,
13,
4706,
396,
4321,
292,
411,
4805,
1897,
297,
4839,
13,
4706,
1583,
29889,
9294,
8824,
29898,
13,
9651,
317,
29941,
1762,
29950,
573,
26486,
29898,
1068,
1311,
29889,
19290,
467,
29918,
4352,
29918,
13662,
18959,
29903,
1217,
742,
525,
9526,
29892,
1626,
742,
525,
18126,
4409,
2033,
511,
13,
9651,
10191,
543,
7850,
1948,
19403,
1993,
3806,
995,
613,
13,
4706,
1723,
13,
13,
1678,
822,
1243,
1649,
8143,
29918,
3332,
29918,
798,
29918,
392,
29918,
510,
2139,
29898,
1311,
1125,
13,
4706,
269,
29941,
29906,
29882,
573,
353,
317,
29941,
1762,
29950,
573,
26486,
29898,
1068,
1311,
29889,
19290,
29897,
13,
4706,
396,
4321,
292,
330,
29920,
934,
1134,
13,
4706,
7876,
29918,
3945,
353,
1583,
3032,
657,
29918,
9144,
12839,
3945,
742,
5852,
29897,
13,
4706,
330,
29920,
29918,
3945,
29918,
29876,
29882,
353,
269,
29941,
29906,
29882,
573,
3032,
8143,
29918,
3332,
29918,
798,
29918,
392,
29918,
510,
2139,
29898,
9144,
29918,
3945,
29892,
15300,
18828,
742,
1583,
29889,
7050,
29918,
3972,
29897,
13,
4706,
7876,
29918,
18828,
353,
1583,
3032,
657,
29918,
9144,
12839,
18828,
742,
7700,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
13,
9651,
1583,
3032,
3198,
29918,
1445,
29918,
13895,
29898,
18828,
29918,
3945,
29918,
29876,
29882,
29892,
7876,
29918,
18828,
29892,
15300,
18828,
5477,
10191,
543,
18828,
422,
13120,
934,
451,
408,
3806,
29908,
13,
4706,
1723,
13,
4706,
396,
4321,
292,
289,
29920,
29906,
934,
1134,
13,
4706,
289,
29920,
29906,
29918,
3945,
29918,
29876,
29882,
353,
269,
29941,
29906,
29882,
573,
3032,
8143,
29918,
3332,
29918,
798,
29918,
392,
29918,
510,
2139,
29898,
9144,
29918,
3945,
29892,
15300,
29890,
29920,
29906,
742,
1583,
29889,
7050,
29918,
3972,
29897,
13,
4706,
7876,
29918,
29890,
29920,
29906,
353,
1583,
3032,
657,
29918,
9144,
12839,
29890,
29920,
29906,
742,
7700,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
13,
9651,
1583,
3032,
3198,
29918,
1445,
29918,
13895,
29898,
29890,
29920,
29906,
29918,
3945,
29918,
29876,
29882,
29892,
7876,
29918,
29890,
29920,
29906,
29892,
15300,
29890,
29920,
29906,
5477,
10191,
543,
29890,
29920,
29906,
422,
13120,
934,
451,
408,
3806,
29908,
13,
4706,
1723,
13,
13,
1678,
732,
348,
27958,
29889,
11014,
3644,
29898,
17640,
338,
6213,
29892,
525,
17640,
3577,
451,
2198,
1495,
13,
1678,
732,
348,
27958,
29889,
11014,
3644,
29898,
17640,
29918,
29879,
29941,
338,
6213,
29892,
525,
29885,
3747,
3577,
451,
2198,
1495,
13,
1678,
732,
17640,
29889,
5041,
877,
1466,
1731,
29889,
771,
29454,
29889,
4288,
29889,
29882,
573,
29889,
3286,
25534,
29889,
29879,
29941,
29918,
517,
29918,
29882,
573,
29889,
29950,
573,
29907,
492,
29950,
2550,
1495,
13,
1678,
732,
17640,
29918,
29879,
29941,
13,
1678,
822,
1243,
29918,
7978,
29898,
1311,
29892,
11187,
29918,
29882,
573,
11303,
20849,
1125,
13,
4706,
11009,
353,
289,
3747,
29941,
29889,
4645,
877,
29879,
29941,
1495,
13,
4706,
11009,
29889,
3258,
29918,
21454,
29898,
29933,
2707,
300,
2433,
21454,
1495,
13,
13,
4706,
396,
4321,
292,
13872,
29892,
14319,
29892,
289,
29920,
29906,
2066,
411,
322,
1728,
4839,
1948,
13,
4706,
363,
313,
1062,
29892,
756,
29918,
6672,
29897,
297,
3234,
18959,
29889,
3945,
742,
15300,
18828,
742,
15300,
29890,
29920,
29906,
742,
15300,
29954,
29999,
7464,
518,
5574,
29892,
7700,
29962,
1125,
13,
9651,
1583,
29889,
19290,
1839,
13662,
2033,
353,
756,
29918,
6672,
13,
9651,
1583,
29889,
19290,
1839,
3198,
29918,
13662,
2033,
353,
756,
29918,
6672,
13,
9651,
12183,
29889,
3888,
703,
3057,
292,
1273,
29879,
3402,
1273,
29879,
4839,
613,
1294,
29892,
525,
2541,
29915,
565,
756,
29918,
6672,
1683,
525,
14037,
1495,
13,
9651,
1583,
29889,
19290,
1839,
2080,
29918,
510,
13120,
2033,
353,
1294,
29889,
13609,
580,
2804,
15300,
3945,
29915,
13,
9651,
1583,
29889,
19290,
1839,
29879,
29941,
29918,
1989,
2033,
353,
525,
29879,
29941,
597,
21454,
22208,
718,
1583,
29889,
29879,
29941,
29918,
1989,
718,
1294,
13,
9651,
10377,
29918,
9144,
353,
1583,
3032,
657,
29918,
9144,
29898,
1062,
29892,
1583,
29889,
19290,
1839,
13662,
11287,
13,
9651,
1015,
29918,
9144,
353,
1583,
3032,
657,
29918,
9144,
29898,
1062,
29892,
7700,
29897,
13,
13,
9651,
396,
5020,
1359,
278,
934,
964,
278,
26297,
287,
317,
29941,
20968,
13,
9651,
11009,
29889,
9009,
29918,
1445,
29898,
666,
29918,
9144,
29892,
525,
21454,
742,
1583,
29889,
29879,
29941,
29918,
1989,
718,
1294,
29897,
13,
13,
9651,
396,
934,
3443,
304,
379,
573,
29907,
492,
29950,
2550,
29889,
1359,
29918,
1445,
338,
9401,
13,
9651,
396,
2750,
3806,
934,
1962,
13,
9651,
11187,
29918,
29882,
573,
11303,
20849,
2141,
1359,
29918,
1445,
29889,
2975,
29918,
15987,
353,
14013,
334,
5085,
29892,
3579,
19290,
29901,
1583,
29889,
9294,
5574,
29898,
13,
18884,
1583,
3032,
3198,
29918,
1445,
29918,
13895,
29898,
5085,
29961,
29900,
1402,
1015,
29918,
9144,
29892,
1294,
511,
13,
18884,
10191,
2433,
29912,
29900,
29913,
1962,
934,
451,
408,
3806,
4286,
4830,
29898,
1062,
511,
13,
9651,
1723,
13,
9651,
396,
11080,
1082,
317,
29941,
1762,
29950,
573,
4300,
571,
13,
9651,
269,
29941,
29906,
29882,
573,
353,
317,
29941,
1762,
29950,
573,
26486,
29898,
1068,
1311,
29889,
19290,
29897,
13,
9651,
269,
29941,
29906,
29882,
573,
29889,
7978,
29898,
8516,
29897,
13,
13,
1678,
732,
348,
27958,
29889,
11014,
3644,
29898,
17640,
338,
6213,
29892,
525,
17640,
3577,
451,
2198,
1495,
13,
1678,
732,
348,
27958,
29889,
11014,
3644,
29898,
17640,
29918,
29879,
29941,
338,
6213,
29892,
525,
29885,
3747,
3577,
451,
2198,
1495,
13,
1678,
732,
17640,
29889,
5041,
877,
1466,
1731,
29889,
771,
29454,
29889,
4288,
29889,
29882,
573,
29889,
3286,
25534,
29889,
29879,
29941,
29918,
517,
29918,
29882,
573,
29889,
29950,
573,
29907,
492,
29950,
2550,
1495,
13,
1678,
732,
17640,
29918,
29879,
29941,
13,
1678,
822,
1243,
29918,
7978,
29918,
2541,
29918,
2622,
29918,
17471,
29898,
1311,
29892,
11187,
29918,
29882,
573,
11303,
20849,
1125,
13,
4706,
11009,
353,
289,
3747,
29941,
29889,
4645,
877,
29879,
29941,
1495,
13,
4706,
11009,
29889,
3258,
29918,
21454,
29898,
29933,
2707,
300,
2433,
21454,
1495,
13,
13,
4706,
1831,
29918,
17471,
353,
376,
6404,
334,
3895,
317,
29941,
2061,
269,
29908,
13,
4706,
20968,
353,
525,
21454,
29915,
13,
13,
4706,
396,
9333,
6724,
317,
29941,
1762,
29950,
573,
4300,
571,
5717,
317,
29941,
29950,
2550,
29889,
2622,
29918,
1989,
411,
13,
4706,
396,
278,
1492,
4128,
322,
967,
6222,
1158,
9269,
29879,
1244,
29892,
13,
4706,
396,
1951,
341,
3747,
1838,
29915,
29873,
2304,
1831,
29918,
3318,
29918,
3051,
408,
310,
29871,
29896,
29889,
29941,
29889,
29906,
29889,
13,
4706,
363,
313,
1062,
29892,
756,
29918,
6672,
29897,
297,
3234,
18959,
29889,
3945,
742,
15300,
18828,
742,
15300,
29954,
29999,
7464,
518,
5574,
29892,
7700,
29962,
1125,
13,
9651,
1881,
29918,
510,
13120,
353,
1294,
29889,
13609,
580,
2804,
15300,
3945,
29915,
13,
9651,
1820,
353,
1583,
29889,
29879,
29941,
29918,
1989,
718,
1294,
13,
13,
9651,
1583,
29889,
19290,
1839,
3198,
29918,
13662,
2033,
353,
7700,
13,
9651,
1583,
29889,
19290,
1839,
13662,
2033,
353,
756,
29918,
6672,
13,
9651,
1583,
29889,
19290,
1839,
2080,
29918,
510,
13120,
2033,
353,
1881,
29918,
510,
13120,
13,
9651,
1583,
29889,
19290,
1839,
2622,
29918,
17471,
2033,
353,
1831,
29918,
17471,
13,
9651,
1583,
29889,
19290,
1839,
29879,
29941,
29918,
1989,
2033,
353,
525,
29879,
29941,
597,
29912,
29900,
6822,
29912,
29896,
29913,
4286,
4830,
29898,
21454,
29892,
1820,
29897,
13,
13,
9651,
10377,
29918,
9144,
353,
1583,
3032,
657,
29918,
9144,
29898,
1062,
29892,
756,
29918,
6672,
29897,
13,
13,
9651,
396,
5020,
1359,
278,
934,
964,
278,
26297,
287,
317,
29941,
20968,
13,
9651,
11009,
29889,
9009,
29918,
1445,
29898,
666,
29918,
9144,
29892,
20968,
29892,
1820,
29897,
13,
13,
9651,
1881,
29918,
15550,
2133,
353,
11117,
29907,
7597,
2396,
11117,
3073,
13157,
19657,
2396,
1583,
29889,
6144,
19657,
930,
13,
9651,
565,
1881,
29918,
510,
13120,
29901,
13,
18884,
1881,
29918,
15550,
2133,
1839,
1523,
2590,
1542,
2033,
353,
525,
29954,
29999,
5690,
29915,
13,
9651,
565,
756,
29918,
6672,
29901,
13,
18884,
1881,
29918,
15550,
2133,
1839,
29907,
7597,
16215,
2283,
7850,
3401,
2033,
353,
525,
17171,
29915,
13,
13,
9651,
396,
10811,
3568,
393,
1831,
29918,
1989,
471,
2000,
411,
278,
1492,
8636,
13,
9651,
411,
11187,
29889,
5041,
29898,
13,
18884,
525,
1466,
1731,
29889,
771,
29454,
29889,
17260,
29889,
10467,
29889,
1251,
12117,
29889,
29879,
29941,
29889,
29903,
29941,
29950,
2550,
29889,
2622,
29918,
1989,
742,
736,
29918,
1767,
13776,
13,
9651,
1723,
408,
11187,
29918,
2622,
29918,
1989,
29901,
13,
18884,
396,
11080,
1082,
317,
29941,
1762,
29950,
573,
4300,
571,
13,
18884,
269,
29941,
29906,
29882,
573,
353,
317,
29941,
1762,
29950,
573,
26486,
29898,
1068,
1311,
29889,
19290,
29897,
13,
18884,
269,
29941,
29906,
29882,
573,
29889,
7978,
29898,
8516,
29897,
13,
13,
18884,
11187,
29918,
2622,
29918,
1989,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
1678,
20968,
29918,
978,
29922,
21454,
29892,
13,
462,
1678,
1820,
29922,
1989,
29892,
13,
462,
1678,
4603,
29922,
2622,
29918,
17471,
29892,
13,
462,
1678,
1881,
29918,
15550,
2133,
29922,
2080,
29918,
15550,
2133,
29892,
13,
18884,
1723,
13,
2
] |
Weltantschauung/__init__.py | area42/Weltanschauung- | 0 | 23286 | from .Weltantschauung import Weltantschauung
| [
1,
515,
869,
29956,
2152,
424,
29172,
686,
1053,
7633,
424,
29172,
686,
13,
2
] |
python算法/3.3如何从顶部开始逐层打印二叉树结点数据.py | RobinYaoWenbin/Python-CommonCode | 12 | 77879 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 23 14:31:43 2019
@author: wenbin
"""
"""
给定一棵二叉树,要求逐层打印二叉树结点的数据,例如有如下二叉树:
1
2 3
4 5 6 7
对这棵二叉树层序遍历的结果为1,2,3,4,5,6,7;
"""
from collections import deque
class BiTNode:
# the node of the binary tree
def __init__(self , data = None):
self.Data = data
self.Lchild = None
self.Rchild = None
def GenerateTree():
# generate the tree for the case research
Root = BiTNode(data = 1)
Root.Lchild = BiTNode(data = 2) ; Root.Rchild = BiTNode(data = 3)
Root.Lchild.Lchild = BiTNode(data = 4) ; Root.Lchild.Rchild = BiTNode(data = 5)
Root.Rchild.Lchild = BiTNode(data = 6) ; Root.Rchild.Rchild = BiTNode(data = 7)
return Root
def PrintMidOrder(Root):
# print the binary tree by the middle order
if Root == None:
return
if Root.Lchild != None:
PrintMidOrder(Root.Lchild)
print(Root.Data , " " , end = "")
if Root.Rchild != None:
PrintMidOrder(Root.Rchild)
def TraversalbyLayer(Root):
# traversal the tree by layer, 1st layer, 2nd layer````,时间复杂夫O(n),空间复杂度O(n)
queue = deque() # new a queue
queue.append(Root)
print("Traversal the binary tree in the order by layer!")
while len(queue) != 0:
tempnode = queue.popleft()
print(tempnode.Data , " " , end = "")
if tempnode.Lchild != None:
queue.append(tempnode.Lchild)
if tempnode.Rchild != None:
queue.append(tempnode.Rchild)
def PrintAtLevel(root , level):
# travelsal the tree by layer. 空间复杂度是O(1),以时间换取空间
if root == None or level < 0 : # 空树或是要求打印出负的层数,返回0
return
elif level == 0:
print(root.Data , " " , end = "") # 打印出这一层的数据
return
else:
PrintAtLevel(root.Lchild , level - 1)
PrintAtLevel(root.Rchild , level - 1)
if __name__ == "__main__":
Root = GenerateTree()
print("The generating tree in the middel order is : ")
PrintMidOrder(Root)
print("")
TraversalbyLayer(Root)
print("")
print("Another method : ")
for i in range(3):
PrintAtLevel(Root , i)
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
30004,
13,
15945,
19451,
13,
20399,
373,
2598,
3826,
29871,
29906,
29941,
29871,
29896,
29946,
29901,
29941,
29896,
29901,
29946,
29941,
29871,
29906,
29900,
29896,
29929,
30004,
13,
30004,
13,
29992,
8921,
29901,
12987,
2109,
30004,
13,
15945,
19451,
13,
30004,
13,
15945,
19451,
13,
31999,
30495,
30287,
233,
166,
184,
30685,
232,
146,
140,
233,
163,
148,
29892,
30698,
31376,
236,
131,
147,
232,
180,
133,
31656,
232,
144,
179,
30685,
232,
146,
140,
233,
163,
148,
31320,
30940,
30210,
30354,
30763,
29892,
31507,
30847,
30417,
30847,
30557,
30685,
232,
146,
140,
233,
163,
148,
29901,
30004,
13,
308,
29896,
30004,
13,
268,
29906,
4706,
29941,
30004,
13,
259,
29946,
1678,
29945,
1678,
29953,
268,
29955,
30004,
13,
30783,
30810,
233,
166,
184,
30685,
232,
146,
140,
233,
163,
148,
232,
180,
133,
31463,
236,
132,
144,
232,
145,
137,
30210,
31320,
30801,
30573,
29896,
29892,
29906,
29892,
29941,
29892,
29946,
29892,
29945,
29892,
29953,
29892,
29955,
2104,
13,
15945,
19451,
13,
3166,
16250,
1053,
316,
802,
30004,
13,
30004,
13,
1990,
3457,
29911,
4247,
29901,
30004,
13,
1678,
396,
278,
2943,
310,
278,
7581,
5447,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
1919,
848,
353,
6213,
1125,
30004,
13,
4706,
1583,
29889,
1469,
353,
848,
30004,
13,
4706,
1583,
29889,
29931,
5145,
353,
6213,
30004,
13,
4706,
1583,
29889,
29934,
5145,
353,
6213,
30004,
13,
30004,
13,
1753,
3251,
403,
9643,
7295,
30004,
13,
1678,
396,
5706,
278,
5447,
363,
278,
1206,
5925,
30004,
13,
1678,
28272,
353,
3457,
29911,
4247,
29898,
1272,
353,
29871,
29896,
8443,
13,
1678,
28272,
29889,
29931,
5145,
353,
3457,
29911,
4247,
29898,
1272,
353,
29871,
29906,
29897,
2056,
28272,
29889,
29934,
5145,
353,
3457,
29911,
4247,
29898,
1272,
353,
29871,
29941,
8443,
13,
1678,
28272,
29889,
29931,
5145,
29889,
29931,
5145,
353,
3457,
29911,
4247,
29898,
1272,
353,
29871,
29946,
29897,
2056,
28272,
29889,
29931,
5145,
29889,
29934,
5145,
353,
3457,
29911,
4247,
29898,
1272,
353,
29871,
29945,
8443,
13,
1678,
28272,
29889,
29934,
5145,
29889,
29931,
5145,
353,
3457,
29911,
4247,
29898,
1272,
353,
29871,
29953,
29897,
2056,
28272,
29889,
29934,
5145,
29889,
29934,
5145,
353,
3457,
29911,
4247,
29898,
1272,
353,
29871,
29955,
8443,
13,
1678,
736,
28272,
30004,
13,
30004,
13,
1753,
13905,
29924,
333,
7514,
29898,
10303,
1125,
30004,
13,
1678,
396,
1596,
278,
7581,
5447,
491,
278,
7256,
1797,
30004,
13,
1678,
565,
28272,
1275,
6213,
29901,
30004,
13,
4706,
736,
6756,
13,
1678,
565,
28272,
29889,
29931,
5145,
2804,
6213,
29901,
30004,
13,
4706,
13905,
29924,
333,
7514,
29898,
10303,
29889,
29931,
5145,
8443,
13,
1678,
1596,
29898,
10303,
29889,
1469,
1919,
376,
376,
1919,
1095,
353,
20569,
30004,
13,
1678,
565,
28272,
29889,
29934,
5145,
2804,
6213,
29901,
30004,
13,
4706,
13905,
29924,
333,
7514,
29898,
10303,
29889,
29934,
5145,
8443,
13,
30004,
13,
1753,
3201,
874,
284,
1609,
14420,
29898,
10303,
1125,
30004,
13,
1678,
396,
13310,
284,
278,
5447,
491,
7546,
29892,
29871,
29896,
303,
7546,
29892,
29871,
29906,
299,
7546,
28956,
1673,
30594,
31016,
31810,
233,
160,
133,
31176,
29949,
29898,
29876,
511,
30816,
31016,
31810,
233,
160,
133,
30898,
29949,
29898,
29876,
8443,
13,
1678,
9521,
353,
316,
802,
580,
396,
716,
263,
9521,
30004,
13,
1678,
9521,
29889,
4397,
29898,
10303,
8443,
13,
1678,
1596,
703,
5323,
874,
284,
278,
7581,
5447,
297,
278,
1797,
491,
7546,
29991,
1159,
30004,
13,
1678,
1550,
7431,
29898,
9990,
29897,
2804,
29871,
29900,
29901,
30004,
13,
4706,
5694,
3177,
353,
9521,
29889,
7323,
1563,
26471,
13,
4706,
1596,
29898,
7382,
3177,
29889,
1469,
1919,
376,
376,
1919,
1095,
353,
20569,
30004,
13,
4706,
565,
5694,
3177,
29889,
29931,
5145,
2804,
6213,
29901,
30004,
13,
9651,
9521,
29889,
4397,
29898,
7382,
3177,
29889,
29931,
5145,
8443,
13,
4706,
565,
5694,
3177,
29889,
29934,
5145,
2804,
6213,
29901,
30004,
13,
9651,
9521,
29889,
4397,
29898,
7382,
3177,
29889,
29934,
5145,
8443,
13,
30004,
13,
1753,
13905,
4178,
10108,
29898,
4632,
1919,
3233,
1125,
30004,
13,
1678,
396,
9850,
19585,
278,
5447,
491,
7546,
29889,
29871,
30816,
31016,
31810,
233,
160,
133,
30898,
30392,
29949,
29898,
29896,
29897,
30214,
30651,
30594,
31016,
31640,
30683,
30816,
31016,
30004,
13,
1678,
565,
3876,
1275,
6213,
470,
3233,
529,
29871,
29900,
584,
29871,
396,
29871,
30816,
233,
163,
148,
31391,
30392,
30698,
31376,
31656,
232,
144,
179,
30544,
235,
183,
162,
30210,
232,
180,
133,
30354,
29892,
31086,
30742,
29900,
30004,
13,
4706,
736,
6756,
13,
1678,
25342,
3233,
1275,
29871,
29900,
29901,
30004,
13,
4706,
1596,
29898,
4632,
29889,
1469,
1919,
376,
376,
1919,
1095,
353,
20569,
29871,
396,
29871,
31656,
232,
144,
179,
30544,
30810,
30287,
232,
180,
133,
30210,
30354,
30763,
30004,
13,
4706,
736,
6756,
13,
1678,
1683,
29901,
30004,
13,
4706,
13905,
4178,
10108,
29898,
4632,
29889,
29931,
5145,
1919,
3233,
448,
29871,
29896,
29897,
6756,
13,
4706,
13905,
4178,
10108,
29898,
4632,
29889,
29934,
5145,
1919,
3233,
448,
29871,
29896,
8443,
13,
30004,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
30004,
13,
1678,
28272,
353,
3251,
403,
9643,
26471,
13,
1678,
1596,
703,
1576,
14655,
5447,
297,
278,
286,
2205,
295,
1797,
338,
584,
376,
8443,
13,
1678,
13905,
29924,
333,
7514,
29898,
10303,
8443,
13,
1678,
1596,
703,
1159,
30004,
13,
1678,
3201,
874,
284,
1609,
14420,
29898,
10303,
8443,
13,
1678,
1596,
703,
1159,
30004,
13,
1678,
1596,
703,
2744,
1228,
1158,
584,
376,
8443,
13,
1678,
363,
474,
297,
3464,
29898,
29941,
1125,
30004,
13,
4706,
13905,
4178,
10108,
29898,
10303,
1919,
474,
8443,
13,
2
] |
applications/FluidDynamicsApplication/tests/embedded_couette_flow_test.py | lkusch/Kratos | 778 | 1617996 | # Import kratos core and applications
import KratosMultiphysics
import KratosMultiphysics.KratosUnittest as KratosUnittest
import KratosMultiphysics.kratos_utilities as KratosUtilities
from KratosMultiphysics.FluidDynamicsApplication.fluid_dynamics_analysis import FluidDynamicsAnalysis
class EmbeddedCouetteTestFluidDynamicsAnalysis(FluidDynamicsAnalysis):
def __init__(self, model, parameters, slip_interface, distance):
super().__init__(model, parameters)
self.distance = distance
self.slip_interface = slip_interface
def ModifyAfterSolverInitialize(self):
super().ModifyAfterSolverInitialize()
# Set up distance field in the DISTANCE nodal variable
computing_model_part = self._GetSolver().GetComputingModelPart()
domain_size = computing_model_part.ProcessInfo[KratosMultiphysics.DOMAIN_SIZE]
if domain_size == 2:
for node in computing_model_part.Nodes:
distance = node.Y-self.distance
node.SetSolutionStepValue(KratosMultiphysics.DISTANCE, 0, distance)
elif domain_size == 3:
for node in computing_model_part.Nodes:
distance = node.Z-self.distance
node.SetSolutionStepValue(KratosMultiphysics.DISTANCE, 0, distance)
else:
raise Exception("DOMAIN_SIZE has not been set in the ProcessInfo container.")
# Set the ELEMENTAL_DISTANCES value
# This is required for the discontinuous elements tests
n_nodes = len(computing_model_part.Elements[1].GetNodes())
n_edges = computing_model_part.Elements[1].GetGeometry().EdgesNumber()
elem_edge_dist = KratosMultiphysics.Vector(n_edges, -1.0)
for element in computing_model_part.Elements:
elem_dist = KratosMultiphysics.Vector(n_nodes)
elem_nodes = element.GetNodes()
for i_node in range(n_nodes):
elem_dist[i_node] = elem_nodes[i_node].GetSolutionStepValue(KratosMultiphysics.DISTANCE)
element.SetValue(KratosMultiphysics.ELEMENTAL_DISTANCES, elem_dist)
element.SetValue(KratosMultiphysics.ELEMENTAL_EDGE_DISTANCES, elem_edge_dist)
# Set up the initial velocity condition
if self.slip_interface:
init_v = KratosMultiphysics.Vector([1.0,0.0,0.0])
for node in computing_model_part.Nodes:
if node.GetSolutionStepValue(KratosMultiphysics.DISTANCE) > 0.0:
node.SetSolutionStepValue(KratosMultiphysics.VELOCITY, init_v)
else:
for node in computing_model_part.Nodes:
dist = node.GetSolutionStepValue(KratosMultiphysics.DISTANCE)
if dist > 0.0:
init_v = KratosMultiphysics.Vector([dist,0.0,0.0])
node.SetSolutionStepValue(KratosMultiphysics.VELOCITY, init_v)
def ApplyBoundaryConditions(self):
super().ApplyBoundaryConditions()
# Set velocity boundary condition
main_model_part = self._GetSolver().GetComputingModelPart().GetRootModelPart()
if self.slip_interface:
for node in main_model_part.GetSubModelPart("Inlet").Nodes:
if node.GetSolutionStepValue(KratosMultiphysics.DISTANCE) > 0.0:
aux_vel = KratosMultiphysics.Vector([1.0,0.0,0.0])
node.SetSolutionStepValue(KratosMultiphysics.VELOCITY, aux_vel)
node.Fix(KratosMultiphysics.VELOCITY_X)
node.Fix(KratosMultiphysics.VELOCITY_Y)
node.Fix(KratosMultiphysics.VELOCITY_Z)
else:
aux_vel = KratosMultiphysics.Vector([0.0,0.0,0.0])
node.SetSolutionStepValue(KratosMultiphysics.VELOCITY, aux_vel)
else:
for node in main_model_part.GetSubModelPart("Inlet").Nodes:
dist = node.GetSolutionStepValue(KratosMultiphysics.DISTANCE)
if (dist > 0.0):
aux_vel = KratosMultiphysics.Vector([dist,0.0,0.0])
node.SetSolutionStepValue(KratosMultiphysics.VELOCITY, aux_vel)
node.Fix(KratosMultiphysics.VELOCITY_X)
node.Fix(KratosMultiphysics.VELOCITY_Y)
node.Fix(KratosMultiphysics.VELOCITY_Z)
else:
aux_vel = KratosMultiphysics.Vector([0.0,0.0,0.0])
node.SetSolutionStepValue(KratosMultiphysics.VELOCITY, aux_vel)
# Set and fix the top boundary velocity
for node in main_model_part.GetSubModelPart("Top").Nodes:
dist = node.GetSolutionStepValue(KratosMultiphysics.DISTANCE)
aux_vel = KratosMultiphysics.Vector([dist,0.0,0.0])
node.SetSolutionStepValue(KratosMultiphysics.VELOCITY, aux_vel)
node.Fix(KratosMultiphysics.VELOCITY_X)
node.Fix(KratosMultiphysics.VELOCITY_Y)
node.Fix(KratosMultiphysics.VELOCITY_Z)
@KratosUnittest.skipIfApplicationsNotAvailable("LinearSolversApplication")
class EmbeddedCouetteFlowTest(KratosUnittest.TestCase):
# Continuous level set 2D tests
def testEmbeddedCouetteFlowEmbeddedWeaklyCompressibleNavierStokes2D(self):
self.distance = 0.25
self.slip_flag = False
self.settings_filename = "ProjectParameters2D.json"
self.formulation_settings = KratosMultiphysics.Parameters("""{
"element_type": "embedded_weakly_compressible_navier_stokes",
"is_slip": false,
"dynamic_tau": 1.0
}""")
self._ReadAndCustomizeTestSettings()
self._RunEmbeddedCouetteFlowTest()
def testEmbeddedCouetteFlowEmbeddedWeaklyCompressibleNavierStokes2DSlip(self):
self.distance = 0.25
self.slip_flag = True
self.settings_filename = "ProjectParameters2D.json"
self.formulation_settings = KratosMultiphysics.Parameters("""{
"element_type": "embedded_weakly_compressible_navier_stokes",
"is_slip": true,
"dynamic_tau": 1.0
}""")
self._ReadAndCustomizeTestSettings()
self._RunEmbeddedCouetteFlowTest()
# Continuous level set 3D tests
def testEmbeddedCouetteFlowEmbeddedWeaklyCompressibleNavierStokes3D(self):
self.distance = 0.25
self.slip_flag = False
self.settings_filename = "ProjectParameters3D.json"
self.formulation_settings = KratosMultiphysics.Parameters("""{
"element_type": "embedded_weakly_compressible_navier_stokes",
"is_slip": false,
"dynamic_tau": 1.0
}""")
self._ReadAndCustomizeTestSettings()
self._RunEmbeddedCouetteFlowTest()
def testEmbeddedCouetteFlowEmbeddedWeaklyCompressibleNavierStokes3DSlip(self):
self.distance = 0.25
self.slip_flag = True
self.settings_filename = "ProjectParameters3D.json"
self.formulation_settings = KratosMultiphysics.Parameters("""{
"element_type": "embedded_weakly_compressible_navier_stokes",
"is_slip": true,
"dynamic_tau": 1.0
}""")
self._ReadAndCustomizeTestSettings()
self._RunEmbeddedCouetteFlowTest()
# Discontinuous level set tests
def testEmbeddedCouetteFlowEmbeddedWeaklyCompressibleNavierStokesDiscontinuous2D(self):
self.distance = 0.25
self.slip_flag = False
self.settings_filename = "ProjectParameters2D.json"
self.formulation_settings = KratosMultiphysics.Parameters("""{
"element_type": "embedded_weakly_compressible_navier_stokes_discontinuous",
"is_slip": true,
"slip_length": 1.0e8,
"penalty_coefficient": 0.1,
"dynamic_tau": 1.0
}""")
self._ReadAndCustomizeTestSettings()
self._RunEmbeddedCouetteFlowTest()
def testEmbeddedCouetteFlowEmbeddedWeaklyCompressibleNavierStokesDiscontinuous3D(self):
self.distance = 0.25
self.slip_flag = True
self.settings_filename = "ProjectParameters3D.json"
self.formulation_settings = KratosMultiphysics.Parameters("""{
"element_type": "embedded_weakly_compressible_navier_stokes_discontinuous",
"is_slip": true,
"slip_length": 1.0e8,
"penalty_coefficient": 0.1,
"dynamic_tau": 1.0
}""")
self._ReadAndCustomizeTestSettings()
self._RunEmbeddedCouetteFlowTest()
def setUp(self):
self.print_output = False
self.check_tolerance = 1.0e-6
self.check_relative_tolerance = 1.0e-8
self.print_reference_values = False
self.work_folder = "embedded_couette_flow_test"
def _RunEmbeddedCouetteFlowTest(self):
# Create the test simulation
with KratosUnittest.WorkFolderScope(self.work_folder,__file__):
self.model = KratosMultiphysics.Model()
simulation = EmbeddedCouetteTestFluidDynamicsAnalysis(self.model, self.parameters, self.slip_flag, self.distance)
simulation.Run()
def tearDown(self):
with KratosUnittest.WorkFolderScope(self.work_folder, __file__):
KratosUtilities.DeleteFileIfExisting('{0}.time'.format(self.parameters["solver_settings"]["model_import_settings"]["input_filename"].GetString()))
def _ReadAndCustomizeTestSettings(self):
# Read the simulation settings
with KratosUnittest.WorkFolderScope(self.work_folder,__file__):
with open(self.settings_filename,'r') as parameter_file:
self.parameters = KratosMultiphysics.Parameters(parameter_file.read())
# Customize simulation settings
self.parameters["solver_settings"]["formulation"] = self.formulation_settings
# If required, add the output process to the test settings
if self.print_output:
self._AddOutput()
# If required, add the reference values output process to the test settings
if self.print_reference_values:
self._AddReferenceValuesOutput()
else:
self._AddReferenceValuesCheck()
def _AddOutput(self):
gid_output_settings = KratosMultiphysics.Parameters("""{
"python_module" : "gid_output_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "GiDOutputProcess",
"help" : "This process writes postprocessing files for GiD",
"Parameters" : {
"model_part_name" : "MainModelPart.fluid_computational_model_part",
"output_name" : "embedded_couette_flow_test",
"postprocess_parameters" : {
"result_file_configuration" : {
"gidpost_flags" : {
"GiDPostMode" : "GiD_PostBinary",
"WriteDeformedMeshFlag" : "WriteDeformed",
"WriteConditionsFlag" : "WriteConditions",
"MultiFileFlag" : "SingleFile"
},
"file_label" : "time",
"output_control_type" : "step",
"output_interval" : 1,
"body_output" : true,
"node_output" : false,
"skin_output" : false,
"plane_output" : [],
"nodal_results" : ["DISTANCE","VELOCITY","PRESSURE"],
"gauss_point_results" : [],
"nodal_nonhistorical_results" : []
},
"point_data_configuration" : []
}
}
}""")
domain_size = self.parameters["solver_settings"]["domain_size"].GetInt()
output_name = gid_output_settings["Parameters"]["output_name"].GetString()
output_name += "_{0}_{1}d".format(self.formulation_settings["element_type"].GetString(), domain_size)
if self.slip_flag:
output_name += "_slip"
gid_output_settings["Parameters"]["output_name"].SetString(output_name)
self.parameters["output_processes"]["gid_output"].Append(gid_output_settings)
def _AddReferenceValuesOutput(self):
json_output_settings = KratosMultiphysics.Parameters("""{
"python_module" : "json_output_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "JsonOutputProcess",
"Parameters" : {
"output_variables" : ["VELOCITY","PRESSURE"],
"output_file_name" : "reference_embedded_couette_flow_test",
"model_part_name" : "MainModelPart.Parts_Fluid",
"time_frequency" : 0.1
}
}""")
domain_size = self.parameters["solver_settings"]["domain_size"].GetInt()
output_file_name = json_output_settings["Parameters"]["output_file_name"].GetString()
output_file_name += "_{0}_{1}d".format(self.formulation_settings["element_type"].GetString(), domain_size)
if self.slip_flag:
output_file_name += "_slip"
json_output_settings["Parameters"]["output_file_name"].SetString(output_file_name)
self.parameters["processes"]["json_check_process_list"].Append(json_output_settings)
def _AddReferenceValuesCheck(self):
json_check_settings = KratosMultiphysics.Parameters("""{
"python_module" : "from_json_check_result_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "FromJsonCheckResultProcess",
"Parameters" : {
"check_variables" : ["VELOCITY_X","VELOCITY_Y","PRESSURE"],
"input_file_name" : "reference_embedded_couette_flow_test",
"model_part_name" : "MainModelPart.Parts_Fluid",
"tolerance" : 0.0,
"relative_tolerance" : 0.0,
"time_frequency" : 0.1
}
}""")
domain_size = self.parameters["solver_settings"]["domain_size"].GetInt()
input_file_name = json_check_settings["Parameters"]["input_file_name"].GetString()
input_file_name += "_{0}_{1}d".format(self.formulation_settings["element_type"].GetString(), domain_size)
if self.slip_flag:
input_file_name += "_slip"
json_check_settings["Parameters"]["input_file_name"].SetString(input_file_name)
json_check_settings["Parameters"]["tolerance"].SetDouble(self.check_tolerance)
json_check_settings["Parameters"]["relative_tolerance"].SetDouble(self.check_relative_tolerance)
self.parameters["processes"]["json_check_process_list"].Append(json_check_settings)
if __name__ == '__main__':
KratosUnittest.main()
| [
1,
396,
16032,
413,
3605,
359,
7136,
322,
8324,
13,
5215,
476,
3605,
359,
15329,
25105,
13,
5215,
476,
3605,
359,
15329,
25105,
29889,
29968,
3605,
359,
2525,
27958,
408,
476,
3605,
359,
2525,
27958,
13,
5215,
476,
3605,
359,
15329,
25105,
29889,
29895,
3605,
359,
29918,
4422,
1907,
408,
476,
3605,
359,
7270,
1907,
13,
3166,
476,
3605,
359,
15329,
25105,
29889,
8754,
5416,
29928,
2926,
1199,
4873,
29889,
1579,
5416,
29918,
29881,
2926,
1199,
29918,
15916,
1053,
2379,
5416,
29928,
2926,
1199,
21067,
4848,
13,
13,
1990,
2812,
2580,
7176,
29907,
283,
2353,
3057,
8754,
5416,
29928,
2926,
1199,
21067,
4848,
29898,
8754,
5416,
29928,
2926,
1199,
21067,
4848,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1904,
29892,
4128,
29892,
269,
3466,
29918,
13248,
29892,
5418,
1125,
13,
4706,
2428,
2141,
1649,
2344,
12035,
4299,
29892,
4128,
29897,
13,
4706,
1583,
29889,
19244,
353,
5418,
13,
4706,
1583,
29889,
29879,
3466,
29918,
13248,
353,
269,
3466,
29918,
13248,
13,
13,
1678,
822,
3382,
1598,
13555,
13296,
369,
6644,
6646,
29898,
1311,
1125,
13,
4706,
2428,
2141,
2111,
1598,
13555,
13296,
369,
6644,
6646,
580,
13,
13,
4706,
396,
3789,
701,
5418,
1746,
297,
278,
360,
9047,
23219,
18778,
284,
2286,
13,
4706,
20602,
29918,
4299,
29918,
1595,
353,
1583,
3032,
2577,
13296,
369,
2141,
2577,
20606,
292,
3195,
7439,
580,
13,
4706,
5354,
29918,
2311,
353,
20602,
29918,
4299,
29918,
1595,
29889,
7032,
3401,
29961,
29968,
3605,
359,
15329,
25105,
29889,
3970,
29032,
29918,
14226,
29962,
13,
4706,
565,
5354,
29918,
2311,
1275,
29871,
29906,
29901,
13,
9651,
363,
2943,
297,
20602,
29918,
4299,
29918,
1595,
29889,
20284,
29901,
13,
18884,
5418,
353,
2943,
29889,
29979,
29899,
1311,
29889,
19244,
13,
18884,
2943,
29889,
2697,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
4571,
1254,
23219,
29892,
29871,
29900,
29892,
5418,
29897,
13,
4706,
25342,
5354,
29918,
2311,
1275,
29871,
29941,
29901,
13,
9651,
363,
2943,
297,
20602,
29918,
4299,
29918,
1595,
29889,
20284,
29901,
13,
18884,
5418,
353,
2943,
29889,
29999,
29899,
1311,
29889,
19244,
13,
18884,
2943,
29889,
2697,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
4571,
1254,
23219,
29892,
29871,
29900,
29892,
5418,
29897,
13,
4706,
1683,
29901,
13,
9651,
12020,
8960,
703,
3970,
29032,
29918,
14226,
756,
451,
1063,
731,
297,
278,
10554,
3401,
5639,
23157,
13,
13,
4706,
396,
3789,
278,
382,
1307,
13780,
1964,
29918,
4571,
1254,
2190,
27266,
995,
13,
4706,
396,
910,
338,
3734,
363,
278,
766,
20621,
681,
3161,
6987,
13,
4706,
302,
29918,
18010,
353,
7431,
29898,
12097,
292,
29918,
4299,
29918,
1595,
29889,
18868,
29961,
29896,
1822,
2577,
20284,
3101,
13,
4706,
302,
29918,
287,
2710,
353,
20602,
29918,
4299,
29918,
1595,
29889,
18868,
29961,
29896,
1822,
2577,
7999,
7843,
2141,
3853,
2710,
4557,
580,
13,
4706,
21268,
29918,
12864,
29918,
5721,
353,
476,
3605,
359,
15329,
25105,
29889,
12877,
29898,
29876,
29918,
287,
2710,
29892,
448,
29896,
29889,
29900,
29897,
13,
4706,
363,
1543,
297,
20602,
29918,
4299,
29918,
1595,
29889,
18868,
29901,
13,
9651,
21268,
29918,
5721,
353,
476,
3605,
359,
15329,
25105,
29889,
12877,
29898,
29876,
29918,
18010,
29897,
13,
9651,
21268,
29918,
18010,
353,
1543,
29889,
2577,
20284,
580,
13,
9651,
363,
474,
29918,
3177,
297,
3464,
29898,
29876,
29918,
18010,
1125,
13,
18884,
21268,
29918,
5721,
29961,
29875,
29918,
3177,
29962,
353,
21268,
29918,
18010,
29961,
29875,
29918,
3177,
1822,
2577,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
4571,
1254,
23219,
29897,
13,
9651,
1543,
29889,
2697,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
29923,
1307,
13780,
1964,
29918,
4571,
1254,
2190,
27266,
29892,
21268,
29918,
5721,
29897,
13,
9651,
1543,
29889,
2697,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
29923,
1307,
13780,
1964,
29918,
3352,
1692,
29918,
4571,
1254,
2190,
27266,
29892,
21268,
29918,
12864,
29918,
5721,
29897,
13,
13,
4706,
396,
3789,
701,
278,
2847,
12885,
4195,
13,
4706,
565,
1583,
29889,
29879,
3466,
29918,
13248,
29901,
13,
9651,
2069,
29918,
29894,
353,
476,
3605,
359,
15329,
25105,
29889,
12877,
4197,
29896,
29889,
29900,
29892,
29900,
29889,
29900,
29892,
29900,
29889,
29900,
2314,
13,
9651,
363,
2943,
297,
20602,
29918,
4299,
29918,
1595,
29889,
20284,
29901,
13,
18884,
565,
2943,
29889,
2577,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
4571,
1254,
23219,
29897,
1405,
29871,
29900,
29889,
29900,
29901,
13,
462,
1678,
2943,
29889,
2697,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29892,
2069,
29918,
29894,
29897,
13,
4706,
1683,
29901,
13,
9651,
363,
2943,
297,
20602,
29918,
4299,
29918,
1595,
29889,
20284,
29901,
13,
18884,
1320,
353,
2943,
29889,
2577,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
4571,
1254,
23219,
29897,
13,
18884,
565,
1320,
1405,
29871,
29900,
29889,
29900,
29901,
13,
462,
1678,
2069,
29918,
29894,
353,
476,
3605,
359,
15329,
25105,
29889,
12877,
4197,
5721,
29892,
29900,
29889,
29900,
29892,
29900,
29889,
29900,
2314,
13,
462,
1678,
2943,
29889,
2697,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29892,
2069,
29918,
29894,
29897,
13,
13,
1678,
822,
2401,
368,
17109,
653,
10983,
2187,
29898,
1311,
1125,
13,
4706,
2428,
2141,
2052,
368,
17109,
653,
10983,
2187,
580,
13,
13,
4706,
396,
3789,
12885,
10452,
4195,
13,
4706,
1667,
29918,
4299,
29918,
1595,
353,
1583,
3032,
2577,
13296,
369,
2141,
2577,
20606,
292,
3195,
7439,
2141,
2577,
10303,
3195,
7439,
580,
13,
4706,
565,
1583,
29889,
29879,
3466,
29918,
13248,
29901,
13,
9651,
363,
2943,
297,
1667,
29918,
4299,
29918,
1595,
29889,
2577,
4035,
3195,
7439,
703,
797,
1026,
2564,
20284,
29901,
13,
18884,
565,
2943,
29889,
2577,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
4571,
1254,
23219,
29897,
1405,
29871,
29900,
29889,
29900,
29901,
13,
462,
1678,
3479,
29918,
955,
353,
476,
3605,
359,
15329,
25105,
29889,
12877,
4197,
29896,
29889,
29900,
29892,
29900,
29889,
29900,
29892,
29900,
29889,
29900,
2314,
13,
462,
1678,
2943,
29889,
2697,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29892,
3479,
29918,
955,
29897,
13,
462,
1678,
2943,
29889,
29943,
861,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29918,
29990,
29897,
13,
462,
1678,
2943,
29889,
29943,
861,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29918,
29979,
29897,
13,
462,
1678,
2943,
29889,
29943,
861,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29918,
29999,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
3479,
29918,
955,
353,
476,
3605,
359,
15329,
25105,
29889,
12877,
4197,
29900,
29889,
29900,
29892,
29900,
29889,
29900,
29892,
29900,
29889,
29900,
2314,
13,
462,
1678,
2943,
29889,
2697,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29892,
3479,
29918,
955,
29897,
13,
4706,
1683,
29901,
13,
9651,
363,
2943,
297,
1667,
29918,
4299,
29918,
1595,
29889,
2577,
4035,
3195,
7439,
703,
797,
1026,
2564,
20284,
29901,
13,
18884,
1320,
353,
2943,
29889,
2577,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
4571,
1254,
23219,
29897,
13,
18884,
565,
313,
5721,
1405,
29871,
29900,
29889,
29900,
1125,
13,
462,
1678,
3479,
29918,
955,
353,
476,
3605,
359,
15329,
25105,
29889,
12877,
4197,
5721,
29892,
29900,
29889,
29900,
29892,
29900,
29889,
29900,
2314,
13,
462,
1678,
2943,
29889,
2697,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29892,
3479,
29918,
955,
29897,
13,
462,
1678,
2943,
29889,
29943,
861,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29918,
29990,
29897,
13,
462,
1678,
2943,
29889,
29943,
861,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29918,
29979,
29897,
13,
462,
1678,
2943,
29889,
29943,
861,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29918,
29999,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
3479,
29918,
955,
353,
476,
3605,
359,
15329,
25105,
29889,
12877,
4197,
29900,
29889,
29900,
29892,
29900,
29889,
29900,
29892,
29900,
29889,
29900,
2314,
13,
462,
1678,
2943,
29889,
2697,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29892,
3479,
29918,
955,
29897,
13,
13,
9651,
396,
3789,
322,
2329,
278,
2246,
10452,
12885,
13,
9651,
363,
2943,
297,
1667,
29918,
4299,
29918,
1595,
29889,
2577,
4035,
3195,
7439,
703,
7031,
2564,
20284,
29901,
13,
18884,
1320,
353,
2943,
29889,
2577,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
4571,
1254,
23219,
29897,
13,
18884,
3479,
29918,
955,
353,
476,
3605,
359,
15329,
25105,
29889,
12877,
4197,
5721,
29892,
29900,
29889,
29900,
29892,
29900,
29889,
29900,
2314,
13,
18884,
2943,
29889,
2697,
13296,
918,
14448,
1917,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29892,
3479,
29918,
955,
29897,
13,
18884,
2943,
29889,
29943,
861,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29918,
29990,
29897,
13,
18884,
2943,
29889,
29943,
861,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29918,
29979,
29897,
13,
18884,
2943,
29889,
29943,
861,
29898,
29968,
3605,
359,
15329,
25105,
29889,
12064,
16652,
11937,
29918,
29999,
29897,
13,
13,
29992,
29968,
3605,
359,
2525,
27958,
29889,
11014,
3644,
2052,
5795,
3664,
27635,
703,
12697,
13296,
874,
4873,
1159,
13,
1990,
2812,
2580,
7176,
29907,
283,
2353,
17907,
3057,
29898,
29968,
3605,
359,
2525,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
396,
2866,
8675,
681,
3233,
731,
29871,
29906,
29928,
6987,
13,
1678,
822,
1243,
6026,
2580,
7176,
29907,
283,
2353,
17907,
6026,
2580,
7176,
4806,
557,
368,
1523,
2139,
1821,
29940,
18852,
20754,
10794,
29906,
29928,
29898,
1311,
1125,
13,
4706,
1583,
29889,
19244,
353,
29871,
29900,
29889,
29906,
29945,
13,
4706,
1583,
29889,
29879,
3466,
29918,
15581,
353,
7700,
13,
4706,
1583,
29889,
11027,
29918,
9507,
353,
376,
7653,
11507,
29906,
29928,
29889,
3126,
29908,
13,
4706,
1583,
29889,
689,
2785,
29918,
11027,
353,
476,
3605,
359,
15329,
25105,
29889,
11507,
703,
15945,
29912,
13,
9651,
376,
5029,
29918,
1853,
1115,
376,
17987,
7176,
29918,
25129,
368,
29918,
510,
2139,
1821,
29918,
6654,
631,
29918,
303,
23195,
613,
13,
9651,
376,
275,
29918,
29879,
3466,
1115,
2089,
29892,
13,
9651,
376,
16626,
29918,
4722,
1115,
29871,
29896,
29889,
29900,
13,
4706,
500,
15945,
1159,
13,
4706,
1583,
3032,
6359,
2855,
7281,
675,
3057,
9585,
580,
13,
4706,
1583,
3032,
6558,
6026,
2580,
7176,
29907,
283,
2353,
17907,
3057,
580,
13,
13,
1678,
822,
1243,
6026,
2580,
7176,
29907,
283,
2353,
17907,
6026,
2580,
7176,
4806,
557,
368,
1523,
2139,
1821,
29940,
18852,
20754,
10794,
29906,
8452,
3466,
29898,
1311,
1125,
13,
4706,
1583,
29889,
19244,
353,
29871,
29900,
29889,
29906,
29945,
13,
4706,
1583,
29889,
29879,
3466,
29918,
15581,
353,
5852,
13,
4706,
1583,
29889,
11027,
29918,
9507,
353,
376,
7653,
11507,
29906,
29928,
29889,
3126,
29908,
13,
4706,
1583,
29889,
689,
2785,
29918,
11027,
353,
476,
3605,
359,
15329,
25105,
29889,
11507,
703,
15945,
29912,
13,
9651,
376,
5029,
29918,
1853,
1115,
376,
17987,
7176,
29918,
25129,
368,
29918,
510,
2139,
1821,
29918,
6654,
631,
29918,
303,
23195,
613,
13,
9651,
376,
275,
29918,
29879,
3466,
1115,
1565,
29892,
13,
9651,
376,
16626,
29918,
4722,
1115,
29871,
29896,
29889,
29900,
13,
4706,
500,
15945,
1159,
13,
4706,
1583,
3032,
6359,
2855,
7281,
675,
3057,
9585,
580,
13,
4706,
1583,
3032,
6558,
6026,
2580,
7176,
29907,
283,
2353,
17907,
3057,
580,
13,
13,
1678,
396,
2866,
8675,
681,
3233,
731,
29871,
29941,
29928,
6987,
13,
1678,
822,
1243,
6026,
2580,
7176,
29907,
283,
2353,
17907,
6026,
2580,
7176,
4806,
557,
368,
1523,
2139,
1821,
29940,
18852,
20754,
10794,
29941,
29928,
29898,
1311,
1125,
13,
4706,
1583,
29889,
19244,
353,
29871,
29900,
29889,
29906,
29945,
13,
4706,
1583,
29889,
29879,
3466,
29918,
15581,
353,
7700,
13,
4706,
1583,
29889,
11027,
29918,
9507,
353,
376,
7653,
11507,
29941,
29928,
29889,
3126,
29908,
13,
4706,
1583,
29889,
689,
2785,
29918,
11027,
353,
476,
3605,
359,
15329,
25105,
29889,
11507,
703,
15945,
29912,
13,
9651,
376,
5029,
29918,
1853,
1115,
376,
17987,
7176,
29918,
25129,
368,
29918,
510,
2139,
1821,
29918,
6654,
631,
29918,
303,
23195,
613,
13,
9651,
376,
275,
29918,
29879,
3466,
1115,
2089,
29892,
13,
9651,
376,
16626,
29918,
4722,
1115,
29871,
29896,
29889,
29900,
13,
4706,
500,
15945,
1159,
13,
4706,
1583,
3032,
6359,
2855,
7281,
675,
3057,
9585,
580,
13,
4706,
1583,
3032,
6558,
6026,
2580,
7176,
29907,
283,
2353,
17907,
3057,
580,
13,
13,
1678,
822,
1243,
6026,
2580,
7176,
29907,
283,
2353,
17907,
6026,
2580,
7176,
4806,
557,
368,
1523,
2139,
1821,
29940,
18852,
20754,
10794,
29941,
8452,
3466,
29898,
1311,
1125,
13,
4706,
1583,
29889,
19244,
353,
29871,
29900,
29889,
29906,
29945,
13,
4706,
1583,
29889,
29879,
3466,
29918,
15581,
353,
5852,
13,
4706,
1583,
29889,
11027,
29918,
9507,
353,
376,
7653,
11507,
29941,
29928,
29889,
3126,
29908,
13,
4706,
1583,
29889,
689,
2785,
29918,
11027,
353,
476,
3605,
359,
15329,
25105,
29889,
11507,
703,
15945,
29912,
13,
9651,
376,
5029,
29918,
1853,
1115,
376,
17987,
7176,
29918,
25129,
368,
29918,
510,
2139,
1821,
29918,
6654,
631,
29918,
303,
23195,
613,
13,
9651,
376,
275,
29918,
29879,
3466,
1115,
1565,
29892,
13,
9651,
376,
16626,
29918,
4722,
1115,
29871,
29896,
29889,
29900,
13,
4706,
500,
15945,
1159,
13,
4706,
1583,
3032,
6359,
2855,
7281,
675,
3057,
9585,
580,
13,
4706,
1583,
3032,
6558,
6026,
2580,
7176,
29907,
283,
2353,
17907,
3057,
580,
13,
13,
1678,
396,
3295,
20621,
681,
3233,
731,
6987,
13,
1678,
822,
1243,
6026,
2580,
7176,
29907,
283,
2353,
17907,
6026,
2580,
7176,
4806,
557,
368,
1523,
2139,
1821,
29940,
18852,
20754,
10794,
4205,
20621,
681,
29906,
29928,
29898,
1311,
1125,
13,
4706,
1583,
29889,
19244,
353,
29871,
29900,
29889,
29906,
29945,
13,
4706,
1583,
29889,
29879,
3466,
29918,
15581,
353,
7700,
13,
4706,
1583,
29889,
11027,
29918,
9507,
353,
376,
7653,
11507,
29906,
29928,
29889,
3126,
29908,
13,
4706,
1583,
29889,
689,
2785,
29918,
11027,
353,
476,
3605,
359,
15329,
25105,
29889,
11507,
703,
15945,
29912,
13,
9651,
376,
5029,
29918,
1853,
1115,
376,
17987,
7176,
29918,
25129,
368,
29918,
510,
2139,
1821,
29918,
6654,
631,
29918,
303,
23195,
29918,
2218,
20621,
681,
613,
13,
9651,
376,
275,
29918,
29879,
3466,
1115,
1565,
29892,
13,
9651,
376,
29879,
3466,
29918,
2848,
1115,
29871,
29896,
29889,
29900,
29872,
29947,
29892,
13,
9651,
376,
2238,
18745,
29918,
1111,
8462,
1115,
29871,
29900,
29889,
29896,
29892,
13,
9651,
376,
16626,
29918,
4722,
1115,
29871,
29896,
29889,
29900,
13,
4706,
500,
15945,
1159,
13,
4706,
1583,
3032,
6359,
2855,
7281,
675,
3057,
9585,
580,
13,
4706,
1583,
3032,
6558,
6026,
2580,
7176,
29907,
283,
2353,
17907,
3057,
580,
13,
13,
1678,
822,
1243,
6026,
2580,
7176,
29907,
283,
2353,
17907,
6026,
2580,
7176,
4806,
557,
368,
1523,
2139,
1821,
29940,
18852,
20754,
10794,
4205,
20621,
681,
29941,
29928,
29898,
1311,
1125,
13,
4706,
1583,
29889,
19244,
353,
29871,
29900,
29889,
29906,
29945,
13,
4706,
1583,
29889,
29879,
3466,
29918,
15581,
353,
5852,
13,
4706,
1583,
29889,
11027,
29918,
9507,
353,
376,
7653,
11507,
29941,
29928,
29889,
3126,
29908,
13,
4706,
1583,
29889,
689,
2785,
29918,
11027,
353,
476,
3605,
359,
15329,
25105,
29889,
11507,
703,
15945,
29912,
13,
9651,
376,
5029,
29918,
1853,
1115,
376,
17987,
7176,
29918,
25129,
368,
29918,
510,
2139,
1821,
29918,
6654,
631,
29918,
303,
23195,
29918,
2218,
20621,
681,
613,
13,
9651,
376,
275,
29918,
29879,
3466,
1115,
1565,
29892,
13,
9651,
376,
29879,
3466,
29918,
2848,
1115,
29871,
29896,
29889,
29900,
29872,
29947,
29892,
13,
9651,
376,
2238,
18745,
29918,
1111,
8462,
1115,
29871,
29900,
29889,
29896,
29892,
13,
9651,
376,
16626,
29918,
4722,
1115,
29871,
29896,
29889,
29900,
13,
4706,
500,
15945,
1159,
13,
4706,
1583,
3032,
6359,
2855,
7281,
675,
3057,
9585,
580,
13,
4706,
1583,
3032,
6558,
6026,
2580,
7176,
29907,
283,
2353,
17907,
3057,
580,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
2158,
29918,
4905,
353,
7700,
13,
4706,
1583,
29889,
3198,
29918,
25027,
261,
749,
353,
29871,
29896,
29889,
29900,
29872,
29899,
29953,
13,
4706,
1583,
29889,
3198,
29918,
22925,
29918,
25027,
261,
749,
353,
29871,
29896,
29889,
29900,
29872,
29899,
29947,
13,
4706,
1583,
29889,
2158,
29918,
5679,
29918,
5975,
353,
7700,
13,
4706,
1583,
29889,
1287,
29918,
12083,
353,
376,
17987,
7176,
29918,
16589,
2353,
29918,
1731,
29918,
1688,
29908,
13,
13,
1678,
822,
903,
6558,
6026,
2580,
7176,
29907,
283,
2353,
17907,
3057,
29898,
1311,
1125,
13,
4706,
396,
6204,
278,
1243,
17402,
13,
4706,
411,
476,
3605,
359,
2525,
27958,
29889,
5531,
12924,
15289,
29898,
1311,
29889,
1287,
29918,
12083,
29892,
1649,
1445,
1649,
1125,
13,
9651,
1583,
29889,
4299,
353,
476,
3605,
359,
15329,
25105,
29889,
3195,
580,
13,
9651,
17402,
353,
2812,
2580,
7176,
29907,
283,
2353,
3057,
8754,
5416,
29928,
2926,
1199,
21067,
4848,
29898,
1311,
29889,
4299,
29892,
1583,
29889,
16744,
29892,
1583,
29889,
29879,
3466,
29918,
15581,
29892,
1583,
29889,
19244,
29897,
13,
9651,
17402,
29889,
6558,
580,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
411,
476,
3605,
359,
2525,
27958,
29889,
5531,
12924,
15289,
29898,
1311,
29889,
1287,
29918,
12083,
29892,
4770,
1445,
1649,
1125,
13,
9651,
476,
3605,
359,
7270,
1907,
29889,
12498,
2283,
3644,
1252,
15423,
877,
29912,
29900,
1836,
2230,
4286,
4830,
29898,
1311,
29889,
16744,
3366,
2929,
369,
29918,
11027,
3108,
3366,
4299,
29918,
5215,
29918,
11027,
3108,
3366,
2080,
29918,
9507,
16862,
2577,
1231,
22130,
13,
13,
1678,
822,
903,
6359,
2855,
7281,
675,
3057,
9585,
29898,
1311,
1125,
13,
4706,
396,
7523,
278,
17402,
6055,
13,
4706,
411,
476,
3605,
359,
2525,
27958,
29889,
5531,
12924,
15289,
29898,
1311,
29889,
1287,
29918,
12083,
29892,
1649,
1445,
1649,
1125,
13,
9651,
411,
1722,
29898,
1311,
29889,
11027,
29918,
9507,
5501,
29878,
1495,
408,
3443,
29918,
1445,
29901,
13,
18884,
1583,
29889,
16744,
353,
476,
3605,
359,
15329,
25105,
29889,
11507,
29898,
15501,
29918,
1445,
29889,
949,
3101,
13,
13,
4706,
396,
8701,
675,
17402,
6055,
13,
4706,
1583,
29889,
16744,
3366,
2929,
369,
29918,
11027,
3108,
3366,
689,
2785,
3108,
353,
1583,
29889,
689,
2785,
29918,
11027,
13,
13,
4706,
396,
960,
3734,
29892,
788,
278,
1962,
1889,
304,
278,
1243,
6055,
13,
4706,
565,
1583,
29889,
2158,
29918,
4905,
29901,
13,
9651,
1583,
3032,
2528,
6466,
580,
13,
13,
4706,
396,
960,
3734,
29892,
788,
278,
3407,
1819,
1962,
1889,
304,
278,
1243,
6055,
13,
4706,
565,
1583,
29889,
2158,
29918,
5679,
29918,
5975,
29901,
13,
9651,
1583,
3032,
2528,
7422,
9065,
6466,
580,
13,
4706,
1683,
29901,
13,
9651,
1583,
3032,
2528,
7422,
9065,
5596,
580,
13,
13,
1678,
822,
903,
2528,
6466,
29898,
1311,
1125,
13,
4706,
330,
333,
29918,
4905,
29918,
11027,
353,
476,
3605,
359,
15329,
25105,
29889,
11507,
703,
15945,
29912,
13,
9651,
376,
4691,
29918,
5453,
29908,
584,
376,
29887,
333,
29918,
4905,
29918,
5014,
613,
13,
9651,
376,
29895,
3605,
359,
29918,
5453,
29908,
584,
376,
29968,
3605,
359,
15329,
25105,
613,
13,
9651,
376,
5014,
29918,
978,
29908,
29871,
584,
376,
26074,
29928,
6466,
7032,
613,
13,
9651,
376,
8477,
29908,
3986,
584,
376,
4013,
1889,
15873,
1400,
19170,
2066,
363,
4406,
29928,
613,
13,
9651,
376,
11507,
29908,
1678,
584,
426,
13,
18884,
376,
4299,
29918,
1595,
29918,
978,
29908,
4706,
584,
376,
6330,
3195,
7439,
29889,
1579,
5416,
29918,
12097,
1288,
29918,
4299,
29918,
1595,
613,
13,
18884,
376,
4905,
29918,
978,
29908,
9651,
584,
376,
17987,
7176,
29918,
16589,
2353,
29918,
1731,
29918,
1688,
613,
13,
18884,
376,
2490,
5014,
29918,
16744,
29908,
584,
426,
13,
462,
1678,
376,
2914,
29918,
1445,
29918,
13305,
29908,
584,
426,
13,
462,
4706,
376,
29887,
333,
2490,
29918,
15764,
29908,
1669,
584,
426,
13,
462,
9651,
376,
26074,
29928,
6747,
6818,
29908,
965,
584,
376,
26074,
29928,
29918,
6747,
25196,
613,
13,
462,
9651,
376,
6113,
2772,
15628,
29924,
12094,
21979,
29908,
584,
376,
6113,
2772,
15628,
613,
13,
462,
9651,
376,
6113,
10983,
2187,
21979,
29908,
259,
584,
376,
6113,
10983,
2187,
613,
13,
462,
9651,
376,
15329,
2283,
21979,
29908,
308,
584,
376,
15771,
2283,
29908,
13,
462,
4706,
2981,
13,
462,
4706,
376,
1445,
29918,
1643,
29908,
462,
29871,
584,
376,
2230,
613,
13,
462,
4706,
376,
4905,
29918,
6451,
29918,
1853,
29908,
308,
584,
376,
10568,
613,
13,
462,
4706,
376,
4905,
29918,
19207,
29908,
632,
584,
29871,
29896,
29892,
13,
462,
4706,
376,
2587,
29918,
4905,
29908,
462,
584,
1565,
29892,
13,
462,
4706,
376,
3177,
29918,
4905,
29908,
462,
584,
2089,
29892,
13,
462,
4706,
376,
808,
262,
29918,
4905,
29908,
462,
584,
2089,
29892,
13,
462,
4706,
376,
22116,
29918,
4905,
29908,
18884,
584,
19997,
13,
462,
4706,
376,
29876,
397,
284,
29918,
9902,
29908,
1669,
584,
6796,
4571,
1254,
23219,
3284,
12064,
16652,
11937,
3284,
15094,
1799,
11499,
12436,
13,
462,
4706,
376,
29887,
11214,
29918,
3149,
29918,
9902,
29908,
308,
584,
19997,
13,
462,
4706,
376,
29876,
397,
284,
29918,
5464,
16211,
936,
29918,
9902,
29908,
584,
5159,
13,
462,
1678,
2981,
13,
462,
1678,
376,
3149,
29918,
1272,
29918,
13305,
29908,
29871,
584,
5159,
13,
18884,
500,
13,
9651,
500,
13,
4706,
500,
15945,
1159,
13,
4706,
5354,
29918,
2311,
353,
1583,
29889,
16744,
3366,
2929,
369,
29918,
11027,
3108,
3366,
7247,
29918,
2311,
16862,
2577,
2928,
580,
13,
4706,
1962,
29918,
978,
353,
330,
333,
29918,
4905,
29918,
11027,
3366,
11507,
3108,
3366,
4905,
29918,
978,
16862,
2577,
1231,
580,
13,
4706,
1962,
29918,
978,
4619,
376,
648,
29900,
3227,
29896,
29913,
29881,
1642,
4830,
29898,
1311,
29889,
689,
2785,
29918,
11027,
3366,
5029,
29918,
1853,
16862,
2577,
1231,
3285,
5354,
29918,
2311,
29897,
13,
4706,
565,
1583,
29889,
29879,
3466,
29918,
15581,
29901,
13,
9651,
1962,
29918,
978,
4619,
11119,
29879,
3466,
29908,
13,
4706,
330,
333,
29918,
4905,
29918,
11027,
3366,
11507,
3108,
3366,
4905,
29918,
978,
16862,
2697,
1231,
29898,
4905,
29918,
978,
29897,
13,
4706,
1583,
29889,
16744,
3366,
4905,
29918,
5014,
267,
3108,
3366,
29887,
333,
29918,
4905,
16862,
18277,
29898,
29887,
333,
29918,
4905,
29918,
11027,
29897,
13,
13,
1678,
822,
903,
2528,
7422,
9065,
6466,
29898,
1311,
1125,
13,
4706,
4390,
29918,
4905,
29918,
11027,
353,
476,
3605,
359,
15329,
25105,
29889,
11507,
703,
15945,
29912,
13,
9651,
376,
4691,
29918,
5453,
29908,
584,
376,
3126,
29918,
4905,
29918,
5014,
613,
13,
9651,
376,
29895,
3605,
359,
29918,
5453,
29908,
584,
376,
29968,
3605,
359,
15329,
25105,
613,
13,
9651,
376,
5014,
29918,
978,
29908,
29871,
584,
376,
8148,
6466,
7032,
613,
13,
9651,
376,
11507,
29908,
1678,
584,
426,
13,
18884,
376,
4905,
29918,
20897,
29908,
584,
6796,
12064,
16652,
11937,
3284,
15094,
1799,
11499,
12436,
13,
18884,
376,
4905,
29918,
1445,
29918,
978,
29908,
584,
376,
5679,
29918,
17987,
7176,
29918,
16589,
2353,
29918,
1731,
29918,
1688,
613,
13,
18884,
376,
4299,
29918,
1595,
29918,
978,
29908,
29871,
584,
376,
6330,
3195,
7439,
29889,
29925,
5708,
29918,
8754,
5416,
613,
13,
18884,
376,
2230,
29918,
10745,
23860,
29908,
259,
584,
29871,
29900,
29889,
29896,
13,
9651,
500,
13,
4706,
500,
15945,
1159,
13,
4706,
5354,
29918,
2311,
353,
1583,
29889,
16744,
3366,
2929,
369,
29918,
11027,
3108,
3366,
7247,
29918,
2311,
16862,
2577,
2928,
580,
13,
4706,
1962,
29918,
1445,
29918,
978,
353,
4390,
29918,
4905,
29918,
11027,
3366,
11507,
3108,
3366,
4905,
29918,
1445,
29918,
978,
16862,
2577,
1231,
580,
13,
4706,
1962,
29918,
1445,
29918,
978,
4619,
376,
648,
29900,
3227,
29896,
29913,
29881,
1642,
4830,
29898,
1311,
29889,
689,
2785,
29918,
11027,
3366,
5029,
29918,
1853,
16862,
2577,
1231,
3285,
5354,
29918,
2311,
29897,
13,
4706,
565,
1583,
29889,
29879,
3466,
29918,
15581,
29901,
13,
9651,
1962,
29918,
1445,
29918,
978,
4619,
11119,
29879,
3466,
29908,
13,
4706,
4390,
29918,
4905,
29918,
11027,
3366,
11507,
3108,
3366,
4905,
29918,
1445,
29918,
978,
16862,
2697,
1231,
29898,
4905,
29918,
1445,
29918,
978,
29897,
13,
4706,
1583,
29889,
16744,
3366,
5014,
267,
3108,
3366,
3126,
29918,
3198,
29918,
5014,
29918,
1761,
16862,
18277,
29898,
3126,
29918,
4905,
29918,
11027,
29897,
13,
13,
1678,
822,
903,
2528,
7422,
9065,
5596,
29898,
1311,
1125,
13,
4706,
4390,
29918,
3198,
29918,
11027,
353,
476,
3605,
359,
15329,
25105,
29889,
11507,
703,
15945,
29912,
13,
9651,
376,
4691,
29918,
5453,
29908,
584,
376,
3166,
29918,
3126,
29918,
3198,
29918,
2914,
29918,
5014,
613,
13,
9651,
376,
29895,
3605,
359,
29918,
5453,
29908,
584,
376,
29968,
3605,
359,
15329,
25105,
613,
13,
9651,
376,
5014,
29918,
978,
29908,
29871,
584,
376,
4591,
8148,
5596,
3591,
7032,
613,
13,
9651,
376,
11507,
29908,
1678,
584,
426,
13,
18884,
376,
3198,
29918,
20897,
29908,
418,
584,
6796,
12064,
16652,
11937,
29918,
29990,
3284,
12064,
16652,
11937,
29918,
29979,
3284,
15094,
1799,
11499,
12436,
13,
18884,
376,
2080,
29918,
1445,
29918,
978,
29908,
418,
584,
376,
5679,
29918,
17987,
7176,
29918,
16589,
2353,
29918,
1731,
29918,
1688,
613,
13,
18884,
376,
4299,
29918,
1595,
29918,
978,
29908,
418,
584,
376,
6330,
3195,
7439,
29889,
29925,
5708,
29918,
8754,
5416,
613,
13,
18884,
376,
25027,
261,
749,
29908,
9651,
584,
29871,
29900,
29889,
29900,
29892,
13,
18884,
376,
22925,
29918,
25027,
261,
749,
29908,
259,
584,
29871,
29900,
29889,
29900,
29892,
13,
18884,
376,
2230,
29918,
10745,
23860,
29908,
539,
584,
29871,
29900,
29889,
29896,
13,
9651,
500,
13,
4706,
500,
15945,
1159,
13,
4706,
5354,
29918,
2311,
353,
1583,
29889,
16744,
3366,
2929,
369,
29918,
11027,
3108,
3366,
7247,
29918,
2311,
16862,
2577,
2928,
580,
13,
4706,
1881,
29918,
1445,
29918,
978,
353,
4390,
29918,
3198,
29918,
11027,
3366,
11507,
3108,
3366,
2080,
29918,
1445,
29918,
978,
16862,
2577,
1231,
580,
13,
4706,
1881,
29918,
1445,
29918,
978,
4619,
376,
648,
29900,
3227,
29896,
29913,
29881,
1642,
4830,
29898,
1311,
29889,
689,
2785,
29918,
11027,
3366,
5029,
29918,
1853,
16862,
2577,
1231,
3285,
5354,
29918,
2311,
29897,
13,
4706,
565,
1583,
29889,
29879,
3466,
29918,
15581,
29901,
13,
9651,
1881,
29918,
1445,
29918,
978,
4619,
11119,
29879,
3466,
29908,
13,
4706,
4390,
29918,
3198,
29918,
11027,
3366,
11507,
3108,
3366,
2080,
29918,
1445,
29918,
978,
16862,
2697,
1231,
29898,
2080,
29918,
1445,
29918,
978,
29897,
13,
4706,
4390,
29918,
3198,
29918,
11027,
3366,
11507,
3108,
3366,
25027,
261,
749,
16862,
2697,
11843,
29898,
1311,
29889,
3198,
29918,
25027,
261,
749,
29897,
13,
4706,
4390,
29918,
3198,
29918,
11027,
3366,
11507,
3108,
3366,
22925,
29918,
25027,
261,
749,
16862,
2697,
11843,
29898,
1311,
29889,
3198,
29918,
22925,
29918,
25027,
261,
749,
29897,
13,
4706,
1583,
29889,
16744,
3366,
5014,
267,
3108,
3366,
3126,
29918,
3198,
29918,
5014,
29918,
1761,
16862,
18277,
29898,
3126,
29918,
3198,
29918,
11027,
29897,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
476,
3605,
359,
2525,
27958,
29889,
3396,
580,
13,
2
] |
test.py | xiaohuaibaoguigui/EllSeg | 1 | 3001 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import tqdm
import torch
import pickle
import resource
import numpy as np
import matplotlib.pyplot as plt
from args import parse_args
from modelSummary import model_dict
from pytorchtools import load_from_file
from torch.utils.data import DataLoader
from helperfunctions import mypause, stackall_Dict
from loss import get_seg2ptLoss
from utils import get_nparams, get_predictions
from utils import getSeg_metrics, getPoint_metric, generateImageGrid, unnormPts
sys.path.append(os.path.abspath(os.path.join(os.getcwd(), os.pardir)))
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (2048*10, rlimit[1]))
#%%
if __name__ == '__main__':
args = parse_args()
device=torch.device("cuda")
torch.cuda.manual_seed(12)
if torch.cuda.device_count() > 1:
print('Moving to a multiGPU setup.')
args.useMultiGPU = True
else:
args.useMultiGPU = False
torch.backends.cudnn.deterministic=False
if args.model not in model_dict:
print("Model not found.")
print("valid models are: {}".format(list(model_dict.keys())))
exit(1)
LOGDIR = os.path.join(os.getcwd(), 'logs', args.model, args.expname)
path2model = os.path.join(LOGDIR, 'weights')
path2checkpoint = os.path.join(LOGDIR, 'checkpoints')
path2writer = os.path.join(LOGDIR, 'TB.lock')
path2op = os.path.join(os.getcwd(), 'op', str(args.curObj))
os.makedirs(LOGDIR, exist_ok=True)
os.makedirs(path2model, exist_ok=True)
os.makedirs(path2checkpoint, exist_ok=True)
os.makedirs(path2writer, exist_ok=True)
os.makedirs(path2op, exist_ok=True)
model = model_dict[args.model]
netDict = load_from_file([args.loadfile,
os.path.join(path2checkpoint, 'checkpoint.pt')])
startEp = netDict['epoch'] if 'epoch' in netDict.keys() else 0
if 'state_dict' in netDict.keys():
model.load_state_dict(netDict['state_dict'])
print('Parameters: {}'.format(get_nparams(model)))
model = model if not args.useMultiGPU else torch.nn.DataParallel(model)
model = model.to(device).to(args.prec)
f = open(os.path.join('curObjects',
'baseline',
'cond_'+str(args.curObj)+'.pkl'), 'rb')
_, _, testObj = pickle.load(f)
testObj.path2data = os.path.join(args.path2data, 'Datasets', 'All')
testObj.augFlag = False
testloader = DataLoader(testObj,
batch_size=args.batchsize,
shuffle=False,
num_workers=args.workers,
drop_last=False)
if args.disp:
fig, axs = plt.subplots(nrows=1, ncols=1)
#%%
accLoss = 0.0
imCounter = 0
ious = []
dists_pupil_latent = []
dists_pupil_seg = []
dists_iris_latent = []
dists_iris_seg = []
model.eval()
opDict = {'id':[], 'archNum': [], 'archName': [], 'code': [],
'scores':{'iou':[], 'lat_dst':[], 'seg_dst':[]},
'pred':{'pup_latent_c':[],
'pup_seg_c':[],
'iri_latent_c':[],
'iri_seg_c':[],
'mask':[]},
'gt':{'pup_c':[], 'mask':[]}}
with torch.no_grad():
for bt, batchdata in enumerate(tqdm.tqdm(testloader)):
img, labels, spatialWeights, distMap, pupil_center, iris_center, elNorm, cond, imInfo = batchdata
out_tup = model(img.to(device).to(args.prec),
labels.to(device).long(),
pupil_center.to(device).to(args.prec),
elNorm.to(device).to(args.prec),
spatialWeights.to(device).to(args.prec),
distMap.to(device).to(args.prec),
cond.to(device).to(args.prec),
imInfo[:, 2].to(device).to(torch.long),
0.5)
output, elOut, latent, loss = out_tup
latent_pupil_center = elOut[:, 0:2].detach().cpu().numpy()
latent_iris_center = elOut[:, 5:7].detach().cpu().numpy()
_, seg_pupil_center = get_seg2ptLoss(output[:, 2, ...].cpu(), pupil_center, temperature=4)
_, seg_iris_center = get_seg2ptLoss(-output[:, 0, ...].cpu(), iris_center, temperature=4)
loss = loss if args.useMultiGPU else loss.mean()
accLoss += loss.detach().cpu().item()
predict = get_predictions(output)
iou, iou_bySample = getSeg_metrics(labels.numpy(),
predict.numpy(),
cond[:, 1].numpy())[1:]
latent_pupil_dist, latent_pupil_dist_bySample = getPoint_metric(pupil_center.numpy(),
latent_pupil_center,
cond[:,0].numpy(),
img.shape[2:],
True) # Unnormalizes the points
seg_pupil_dist, seg_pupil_dist_bySample = getPoint_metric(pupil_center.numpy(),
seg_pupil_center,
cond[:,1].numpy(),
img.shape[2:],
True) # Unnormalizes the points
latent_iris_dist, latent_iris_dist_bySample = getPoint_metric(iris_center.numpy(),
latent_iris_center,
cond[:,1].numpy(),
img.shape[2:],
True) # Unnormalizes the points
seg_iris_dist, seg_iris_dist_bySample = getPoint_metric(iris_center.numpy(),
seg_iris_center,
cond[:,1].numpy(),
img.shape[2:],
True) # Unnormalizes the points
dists_pupil_latent.append(latent_pupil_dist)
dists_iris_latent.append(latent_iris_dist)
dists_pupil_seg.append(seg_pupil_dist)
dists_iris_seg.append(seg_iris_dist)
ious.append(iou)
pup_latent_c = unnormPts(latent_pupil_center,
img.shape[2:])
pup_seg_c = unnormPts(seg_pupil_center,
img.shape[2:])
iri_latent_c = unnormPts(latent_iris_center,
img.shape[2:])
iri_seg_c = unnormPts(seg_iris_center,
img.shape[2:])
dispI = generateImageGrid(img.numpy().squeeze(),
predict.numpy(),
elOut.detach().cpu().numpy().reshape(-1, 2, 5),
pup_seg_c,
cond.numpy(),
override=True,
heatmaps=False)
for i in range(0, img.shape[0]):
archNum = testObj.imList[imCounter, 1]
opDict['id'].append(testObj.imList[imCounter, 0])
opDict['code'].append(latent[i,...].detach().cpu().numpy())
opDict['archNum'].append(archNum)
opDict['archName'].append(testObj.arch[archNum])
opDict['pred']['pup_latent_c'].append(pup_latent_c[i, :])
opDict['pred']['pup_seg_c'].append(pup_seg_c[i, :])
opDict['pred']['iri_latent_c'].append(iri_latent_c[i, :])
opDict['pred']['iri_seg_c'].append(iri_seg_c[i, :])
if args.test_save_op_masks:
opDict['pred']['mask'].append(predict[i,...].numpy().astype(np.uint8))
opDict['scores']['iou'].append(iou_bySample[i, ...])
opDict['scores']['lat_dst'].append(latent_pupil_dist_bySample[i, ...])
opDict['scores']['seg_dst'].append(seg_pupil_dist_bySample[i, ...])
opDict['gt']['pup_c'].append(pupil_center[i,...].numpy())
if args.test_save_op_masks:
opDict['gt']['mask'].append(labels[i,...].numpy().astype(np.uint8))
imCounter+=1
if args.disp:
if bt == 0:
h_im = plt.imshow(dispI.permute(1, 2, 0))
plt.pause(0.01)
else:
h_im.set_data(dispI.permute(1, 2, 0))
mypause(0.01)
opDict = stackall_Dict(opDict)
ious = np.stack(ious, axis=0)
ious = np.nanmean(ious, axis=0)
print('mIoU: {}. IoUs: {}'.format(np.mean(ious), ious))
print('Latent space PUPIL dist. Med: {}, STD: {}'.format(np.nanmedian(dists_pupil_latent),
np.nanstd(dists_pupil_latent)))
print('Segmentation PUPIL dist. Med: {}, STD: {}'.format(np.nanmedian(dists_pupil_seg),
np.nanstd(dists_pupil_seg)))
print('Latent space IRIS dist. Med: {}, STD: {}'.format(np.nanmedian(dists_iris_latent),
np.nanstd(dists_iris_latent)))
print('Segmentation IRIS dist. Med: {}, STD: {}'.format(np.nanmedian(dists_iris_seg),
np.nanstd(dists_iris_seg)))
print('--- Saving output directory ---')
f = open(os.path.join(path2op, 'opDict.pkl'), 'wb')
pickle.dump(opDict, f)
f.close()
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
260,
29939,
18933,
13,
5215,
4842,
305,
13,
5215,
5839,
280,
13,
5215,
6503,
13,
5215,
12655,
408,
7442,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
13,
3166,
6389,
1053,
6088,
29918,
5085,
13,
3166,
1904,
26289,
1053,
1904,
29918,
8977,
13,
3166,
282,
3637,
25350,
8504,
1053,
2254,
29918,
3166,
29918,
1445,
13,
3166,
4842,
305,
29889,
13239,
29889,
1272,
1053,
3630,
10036,
13,
13,
3166,
16876,
12171,
1053,
590,
29886,
1071,
29892,
5096,
497,
29918,
21533,
13,
13,
3166,
6410,
1053,
679,
29918,
10199,
29906,
415,
29931,
2209,
13,
13,
3166,
3667,
29879,
1053,
679,
29918,
29876,
7529,
29892,
679,
29918,
27711,
1080,
13,
3166,
3667,
29879,
1053,
679,
17669,
29918,
2527,
10817,
29892,
679,
5228,
29918,
16414,
29892,
5706,
2940,
5756,
29892,
443,
12324,
29925,
1372,
13,
13,
9675,
29889,
2084,
29889,
4397,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
29898,
359,
29889,
2084,
29889,
7122,
29898,
359,
29889,
657,
29883,
9970,
3285,
2897,
29889,
29886,
538,
381,
4961,
13,
13,
2096,
13083,
353,
6503,
29889,
657,
2096,
13083,
29898,
10314,
29889,
2241,
7833,
1806,
29918,
6632,
7724,
29897,
13,
10314,
29889,
842,
2096,
13083,
29898,
10314,
29889,
2241,
7833,
1806,
29918,
6632,
7724,
29892,
313,
29906,
29900,
29946,
29947,
29930,
29896,
29900,
29892,
364,
13400,
29961,
29896,
12622,
13,
13,
29937,
7686,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
13,
1678,
6389,
353,
6088,
29918,
5085,
580,
13,
13,
1678,
4742,
29922,
7345,
305,
29889,
10141,
703,
29883,
6191,
1159,
13,
1678,
4842,
305,
29889,
29883,
6191,
29889,
11288,
29918,
26776,
29898,
29896,
29906,
29897,
13,
1678,
565,
4842,
305,
29889,
29883,
6191,
29889,
10141,
29918,
2798,
580,
1405,
29871,
29896,
29901,
13,
4706,
1596,
877,
29924,
21081,
304,
263,
2473,
29954,
7056,
6230,
29889,
1495,
13,
4706,
6389,
29889,
1509,
15329,
29954,
7056,
353,
5852,
13,
1678,
1683,
29901,
13,
4706,
6389,
29889,
1509,
15329,
29954,
7056,
353,
7700,
13,
1678,
4842,
305,
29889,
1627,
1975,
29889,
29883,
566,
15755,
29889,
4801,
837,
262,
4695,
29922,
8824,
13,
13,
1678,
565,
6389,
29889,
4299,
451,
297,
1904,
29918,
8977,
29901,
13,
4706,
1596,
703,
3195,
451,
1476,
23157,
13,
4706,
1596,
703,
3084,
4733,
526,
29901,
6571,
1642,
4830,
29898,
1761,
29898,
4299,
29918,
8977,
29889,
8149,
580,
4961,
13,
4706,
6876,
29898,
29896,
29897,
13,
13,
1678,
25401,
9464,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
657,
29883,
9970,
3285,
525,
20756,
742,
6389,
29889,
4299,
29892,
6389,
29889,
4548,
978,
29897,
13,
1678,
2224,
29906,
4299,
353,
2897,
29889,
2084,
29889,
7122,
29898,
14480,
9464,
29892,
525,
705,
5861,
1495,
13,
1678,
2224,
29906,
3198,
3149,
353,
2897,
29889,
2084,
29889,
7122,
29898,
14480,
9464,
29892,
525,
3198,
9748,
1495,
13,
1678,
2224,
29906,
13236,
353,
2897,
29889,
2084,
29889,
7122,
29898,
14480,
9464,
29892,
525,
24895,
29889,
908,
1495,
13,
1678,
2224,
29906,
459,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
657,
29883,
9970,
3285,
525,
459,
742,
851,
29898,
5085,
29889,
2764,
9930,
876,
13,
13,
1678,
2897,
29889,
29885,
12535,
12935,
29898,
14480,
9464,
29892,
1863,
29918,
554,
29922,
5574,
29897,
13,
1678,
2897,
29889,
29885,
12535,
12935,
29898,
2084,
29906,
4299,
29892,
1863,
29918,
554,
29922,
5574,
29897,
13,
1678,
2897,
29889,
29885,
12535,
12935,
29898,
2084,
29906,
3198,
3149,
29892,
1863,
29918,
554,
29922,
5574,
29897,
13,
1678,
2897,
29889,
29885,
12535,
12935,
29898,
2084,
29906,
13236,
29892,
1863,
29918,
554,
29922,
5574,
29897,
13,
1678,
2897,
29889,
29885,
12535,
12935,
29898,
2084,
29906,
459,
29892,
1863,
29918,
554,
29922,
5574,
29897,
13,
13,
1678,
1904,
353,
1904,
29918,
8977,
29961,
5085,
29889,
4299,
29962,
13,
13,
1678,
7787,
21533,
353,
2254,
29918,
3166,
29918,
1445,
4197,
5085,
29889,
1359,
1445,
29892,
13,
462,
795,
2897,
29889,
2084,
29889,
7122,
29898,
2084,
29906,
3198,
3149,
29892,
525,
3198,
3149,
29889,
415,
1495,
2314,
13,
1678,
1369,
29923,
29886,
353,
7787,
21533,
1839,
1022,
2878,
2033,
565,
525,
1022,
2878,
29915,
297,
7787,
21533,
29889,
8149,
580,
1683,
29871,
29900,
13,
1678,
565,
525,
3859,
29918,
8977,
29915,
297,
7787,
21533,
29889,
8149,
7295,
13,
4706,
1904,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
1212,
21533,
1839,
3859,
29918,
8977,
11287,
13,
13,
1678,
1596,
877,
11507,
29901,
6571,
4286,
4830,
29898,
657,
29918,
29876,
7529,
29898,
4299,
4961,
13,
1678,
1904,
353,
1904,
565,
451,
6389,
29889,
1509,
15329,
29954,
7056,
1683,
4842,
305,
29889,
15755,
29889,
1469,
2177,
6553,
29898,
4299,
29897,
13,
1678,
1904,
353,
1904,
29889,
517,
29898,
10141,
467,
517,
29898,
5085,
29889,
17990,
29897,
13,
13,
1678,
285,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
877,
2764,
12724,
742,
13,
462,
3986,
525,
6500,
5570,
742,
13,
462,
3986,
525,
1116,
29918,
18717,
710,
29898,
5085,
29889,
2764,
9930,
7240,
4286,
29886,
6321,
5477,
525,
6050,
1495,
13,
13,
1678,
17117,
17117,
1243,
9930,
353,
5839,
280,
29889,
1359,
29898,
29888,
29897,
13,
1678,
1243,
9930,
29889,
2084,
29906,
1272,
353,
2897,
29889,
2084,
29889,
7122,
29898,
5085,
29889,
2084,
29906,
1272,
29892,
525,
16390,
294,
1691,
742,
525,
3596,
1495,
13,
1678,
1243,
9930,
29889,
2987,
21979,
353,
7700,
13,
13,
1678,
1243,
12657,
353,
3630,
10036,
29898,
1688,
9930,
29892,
13,
462,
9651,
9853,
29918,
2311,
29922,
5085,
29889,
16175,
2311,
29892,
13,
462,
9651,
528,
21897,
29922,
8824,
29892,
13,
462,
9651,
954,
29918,
1287,
414,
29922,
5085,
29889,
1287,
414,
29892,
13,
462,
9651,
5768,
29918,
4230,
29922,
8824,
29897,
13,
13,
1678,
565,
6389,
29889,
2218,
29886,
29901,
13,
4706,
2537,
29892,
4853,
29879,
353,
14770,
29889,
1491,
26762,
29898,
29876,
5727,
29922,
29896,
29892,
302,
22724,
29922,
29896,
29897,
13,
1678,
396,
7686,
13,
1678,
1035,
29931,
2209,
353,
29871,
29900,
29889,
29900,
13,
1678,
527,
17779,
353,
29871,
29900,
13,
13,
1678,
474,
681,
353,
5159,
13,
13,
1678,
1320,
29879,
29918,
29886,
786,
309,
29918,
5066,
296,
353,
5159,
13,
1678,
1320,
29879,
29918,
29886,
786,
309,
29918,
10199,
353,
5159,
13,
13,
1678,
1320,
29879,
29918,
381,
275,
29918,
5066,
296,
353,
5159,
13,
1678,
1320,
29879,
29918,
381,
275,
29918,
10199,
353,
5159,
13,
13,
1678,
1904,
29889,
14513,
580,
13,
13,
1678,
1015,
21533,
353,
11117,
333,
2396,
29961,
1402,
525,
1279,
8009,
2396,
19997,
525,
1279,
1170,
2396,
19997,
525,
401,
2396,
19997,
13,
795,
525,
1557,
2361,
2396,
10998,
29875,
283,
2396,
29961,
1402,
525,
5066,
29918,
22992,
2396,
29961,
1402,
525,
10199,
29918,
22992,
2396,
2636,
1118,
13,
795,
525,
11965,
2396,
10998,
29886,
786,
29918,
5066,
296,
29918,
29883,
2396,
29961,
1402,
13,
462,
418,
525,
29886,
786,
29918,
10199,
29918,
29883,
2396,
29961,
1402,
13,
462,
418,
525,
12737,
29918,
5066,
296,
29918,
29883,
2396,
29961,
1402,
13,
462,
418,
525,
12737,
29918,
10199,
29918,
29883,
2396,
29961,
1402,
13,
462,
418,
525,
13168,
2396,
2636,
1118,
13,
795,
525,
4141,
2396,
10998,
29886,
786,
29918,
29883,
2396,
29961,
1402,
525,
13168,
2396,
2636,
930,
13,
13,
1678,
411,
4842,
305,
29889,
1217,
29918,
5105,
7295,
13,
4706,
363,
289,
29873,
29892,
9853,
1272,
297,
26985,
29898,
29873,
29939,
18933,
29889,
29873,
29939,
18933,
29898,
1688,
12657,
22164,
13,
9651,
10153,
29892,
11073,
29892,
18652,
4806,
5861,
29892,
1320,
3388,
29892,
23449,
309,
29918,
5064,
29892,
3805,
275,
29918,
5064,
29892,
560,
29940,
555,
29892,
2148,
29892,
527,
3401,
353,
9853,
1272,
13,
9651,
714,
29918,
29873,
786,
353,
1904,
29898,
2492,
29889,
517,
29898,
10141,
467,
517,
29898,
5085,
29889,
17990,
511,
13,
462,
9651,
11073,
29889,
517,
29898,
10141,
467,
5426,
3285,
13,
462,
9651,
23449,
309,
29918,
5064,
29889,
517,
29898,
10141,
467,
517,
29898,
5085,
29889,
17990,
511,
13,
462,
9651,
560,
29940,
555,
29889,
517,
29898,
10141,
467,
517,
29898,
5085,
29889,
17990,
511,
13,
462,
9651,
18652,
4806,
5861,
29889,
517,
29898,
10141,
467,
517,
29898,
5085,
29889,
17990,
511,
13,
462,
9651,
1320,
3388,
29889,
517,
29898,
10141,
467,
517,
29898,
5085,
29889,
17990,
511,
13,
462,
9651,
2148,
29889,
517,
29898,
10141,
467,
517,
29898,
5085,
29889,
17990,
511,
13,
462,
9651,
527,
3401,
7503,
29892,
29871,
29906,
1822,
517,
29898,
10141,
467,
517,
29898,
7345,
305,
29889,
5426,
511,
13,
462,
632,
29900,
29889,
29945,
29897,
13,
13,
9651,
1962,
29892,
560,
3744,
29892,
3405,
296,
29892,
6410,
353,
714,
29918,
29873,
786,
13,
13,
9651,
3405,
296,
29918,
29886,
786,
309,
29918,
5064,
353,
560,
3744,
7503,
29892,
29871,
29900,
29901,
29906,
1822,
4801,
496,
2141,
21970,
2141,
23749,
580,
13,
9651,
3405,
296,
29918,
381,
275,
29918,
5064,
29871,
353,
560,
3744,
7503,
29892,
29871,
29945,
29901,
29955,
1822,
4801,
496,
2141,
21970,
2141,
23749,
580,
13,
13,
9651,
17117,
2377,
29918,
29886,
786,
309,
29918,
5064,
353,
679,
29918,
10199,
29906,
415,
29931,
2209,
29898,
4905,
7503,
29892,
29871,
29906,
29892,
2023,
1822,
21970,
3285,
23449,
309,
29918,
5064,
29892,
10430,
29922,
29946,
29897,
13,
9651,
17117,
2377,
29918,
381,
275,
29918,
5064,
29871,
353,
679,
29918,
10199,
29906,
415,
29931,
2209,
6278,
4905,
7503,
29892,
29871,
29900,
29892,
2023,
1822,
21970,
3285,
3805,
275,
29918,
5064,
29892,
10430,
29922,
29946,
29897,
13,
13,
9651,
6410,
353,
6410,
565,
6389,
29889,
1509,
15329,
29954,
7056,
1683,
6410,
29889,
12676,
580,
13,
13,
9651,
1035,
29931,
2209,
4619,
6410,
29889,
4801,
496,
2141,
21970,
2141,
667,
580,
13,
9651,
8500,
353,
679,
29918,
27711,
1080,
29898,
4905,
29897,
13,
13,
9651,
474,
283,
29892,
474,
283,
29918,
1609,
17708,
353,
679,
17669,
29918,
2527,
10817,
29898,
21134,
29889,
23749,
3285,
13,
462,
462,
1669,
8500,
29889,
23749,
3285,
13,
462,
462,
1669,
2148,
7503,
29892,
29871,
29896,
1822,
23749,
3101,
29961,
29896,
17531,
13,
13,
9651,
3405,
296,
29918,
29886,
786,
309,
29918,
5721,
29892,
3405,
296,
29918,
29886,
786,
309,
29918,
5721,
29918,
1609,
17708,
353,
679,
5228,
29918,
16414,
29898,
29886,
786,
309,
29918,
5064,
29889,
23749,
3285,
13,
462,
462,
462,
462,
9651,
3405,
296,
29918,
29886,
786,
309,
29918,
5064,
29892,
13,
462,
462,
462,
462,
9651,
2148,
7503,
29892,
29900,
1822,
23749,
3285,
13,
462,
462,
462,
462,
9651,
10153,
29889,
12181,
29961,
29906,
29901,
1402,
13,
462,
462,
462,
462,
9651,
5852,
29897,
396,
853,
8945,
7093,
278,
3291,
13,
13,
9651,
2377,
29918,
29886,
786,
309,
29918,
5721,
29892,
2377,
29918,
29886,
786,
309,
29918,
5721,
29918,
1609,
17708,
353,
679,
5228,
29918,
16414,
29898,
29886,
786,
309,
29918,
5064,
29889,
23749,
3285,
13,
462,
462,
462,
462,
418,
2377,
29918,
29886,
786,
309,
29918,
5064,
29892,
13,
462,
462,
462,
462,
418,
2148,
7503,
29892,
29896,
1822,
23749,
3285,
13,
462,
462,
462,
462,
418,
10153,
29889,
12181,
29961,
29906,
29901,
1402,
13,
462,
462,
462,
462,
418,
5852,
29897,
396,
853,
8945,
7093,
278,
3291,
13,
13,
9651,
3405,
296,
29918,
381,
275,
29918,
5721,
29892,
3405,
296,
29918,
381,
275,
29918,
5721,
29918,
1609,
17708,
353,
679,
5228,
29918,
16414,
29898,
381,
275,
29918,
5064,
29889,
23749,
3285,
13,
462,
462,
462,
462,
3986,
3405,
296,
29918,
381,
275,
29918,
5064,
29892,
13,
462,
462,
462,
462,
3986,
2148,
7503,
29892,
29896,
1822,
23749,
3285,
13,
462,
462,
462,
462,
3986,
10153,
29889,
12181,
29961,
29906,
29901,
1402,
13,
462,
462,
462,
462,
3986,
5852,
29897,
396,
853,
8945,
7093,
278,
3291,
13,
13,
9651,
2377,
29918,
381,
275,
29918,
5721,
29892,
2377,
29918,
381,
275,
29918,
5721,
29918,
1609,
17708,
353,
679,
5228,
29918,
16414,
29898,
381,
275,
29918,
5064,
29889,
23749,
3285,
13,
462,
462,
462,
462,
1678,
2377,
29918,
381,
275,
29918,
5064,
29892,
13,
462,
462,
462,
462,
1678,
2148,
7503,
29892,
29896,
1822,
23749,
3285,
13,
462,
462,
462,
462,
1678,
10153,
29889,
12181,
29961,
29906,
29901,
1402,
13,
462,
462,
462,
462,
1678,
5852,
29897,
396,
853,
8945,
7093,
278,
3291,
13,
13,
9651,
1320,
29879,
29918,
29886,
786,
309,
29918,
5066,
296,
29889,
4397,
29898,
5066,
296,
29918,
29886,
786,
309,
29918,
5721,
29897,
13,
9651,
1320,
29879,
29918,
381,
275,
29918,
5066,
296,
29889,
4397,
29898,
5066,
296,
29918,
381,
275,
29918,
5721,
29897,
13,
9651,
1320,
29879,
29918,
29886,
786,
309,
29918,
10199,
29889,
4397,
29898,
10199,
29918,
29886,
786,
309,
29918,
5721,
29897,
13,
9651,
1320,
29879,
29918,
381,
275,
29918,
10199,
29889,
4397,
29898,
10199,
29918,
381,
275,
29918,
5721,
29897,
13,
13,
9651,
474,
681,
29889,
4397,
29898,
29875,
283,
29897,
13,
13,
9651,
23449,
29918,
5066,
296,
29918,
29883,
353,
443,
12324,
29925,
1372,
29898,
5066,
296,
29918,
29886,
786,
309,
29918,
5064,
29892,
13,
462,
462,
268,
10153,
29889,
12181,
29961,
29906,
29901,
2314,
13,
9651,
23449,
29918,
10199,
29918,
29883,
353,
443,
12324,
29925,
1372,
29898,
10199,
29918,
29886,
786,
309,
29918,
5064,
29892,
13,
462,
462,
29871,
10153,
29889,
12181,
29961,
29906,
29901,
2314,
13,
9651,
474,
374,
29918,
5066,
296,
29918,
29883,
353,
443,
12324,
29925,
1372,
29898,
5066,
296,
29918,
381,
275,
29918,
5064,
29892,
13,
462,
462,
268,
10153,
29889,
12181,
29961,
29906,
29901,
2314,
13,
9651,
474,
374,
29918,
10199,
29918,
29883,
353,
443,
12324,
29925,
1372,
29898,
10199,
29918,
381,
275,
29918,
5064,
29892,
13,
462,
462,
29871,
10153,
29889,
12181,
29961,
29906,
29901,
2314,
13,
13,
9651,
12272,
29902,
353,
5706,
2940,
5756,
29898,
2492,
29889,
23749,
2141,
29879,
802,
29872,
911,
3285,
13,
462,
462,
418,
8500,
29889,
23749,
3285,
13,
462,
462,
418,
560,
3744,
29889,
4801,
496,
2141,
21970,
2141,
23749,
2141,
690,
14443,
6278,
29896,
29892,
29871,
29906,
29892,
29871,
29945,
511,
13,
462,
462,
418,
23449,
29918,
10199,
29918,
29883,
29892,
13,
462,
462,
418,
2148,
29889,
23749,
3285,
13,
462,
462,
418,
5712,
29922,
5574,
29892,
13,
462,
462,
418,
12871,
10339,
29922,
8824,
29897,
13,
13,
9651,
363,
474,
297,
3464,
29898,
29900,
29892,
10153,
29889,
12181,
29961,
29900,
29962,
1125,
13,
18884,
3190,
8009,
353,
1243,
9930,
29889,
326,
1293,
29961,
326,
17779,
29892,
29871,
29896,
29962,
13,
18884,
1015,
21533,
1839,
333,
13359,
4397,
29898,
1688,
9930,
29889,
326,
1293,
29961,
326,
17779,
29892,
29871,
29900,
2314,
13,
18884,
1015,
21533,
1839,
401,
13359,
4397,
29898,
5066,
296,
29961,
29875,
29892,
856,
1822,
4801,
496,
2141,
21970,
2141,
23749,
3101,
13,
13,
18884,
1015,
21533,
1839,
1279,
8009,
13359,
4397,
29898,
1279,
8009,
29897,
13,
18884,
1015,
21533,
1839,
1279,
1170,
13359,
4397,
29898,
1688,
9930,
29889,
1279,
29961,
1279,
8009,
2314,
13,
13,
18884,
1015,
21533,
1839,
11965,
16215,
29886,
786,
29918,
5066,
296,
29918,
29883,
13359,
4397,
29898,
29886,
786,
29918,
5066,
296,
29918,
29883,
29961,
29875,
29892,
584,
2314,
13,
18884,
1015,
21533,
1839,
11965,
16215,
29886,
786,
29918,
10199,
29918,
29883,
13359,
4397,
29898,
29886,
786,
29918,
10199,
29918,
29883,
29961,
29875,
29892,
584,
2314,
13,
18884,
1015,
21533,
1839,
11965,
16215,
12737,
29918,
5066,
296,
29918,
29883,
13359,
4397,
29898,
12737,
29918,
5066,
296,
29918,
29883,
29961,
29875,
29892,
584,
2314,
13,
18884,
1015,
21533,
1839,
11965,
16215,
12737,
29918,
10199,
29918,
29883,
13359,
4397,
29898,
12737,
29918,
10199,
29918,
29883,
29961,
29875,
29892,
584,
2314,
13,
13,
18884,
565,
6389,
29889,
1688,
29918,
7620,
29918,
459,
29918,
13168,
29879,
29901,
13,
462,
1678,
1015,
21533,
1839,
11965,
16215,
13168,
13359,
4397,
29898,
27711,
29961,
29875,
29892,
856,
1822,
23749,
2141,
579,
668,
29898,
9302,
29889,
13470,
29947,
876,
13,
13,
18884,
1015,
21533,
1839,
1557,
2361,
16215,
29875,
283,
13359,
4397,
29898,
29875,
283,
29918,
1609,
17708,
29961,
29875,
29892,
2023,
2314,
13,
18884,
1015,
21533,
1839,
1557,
2361,
16215,
5066,
29918,
22992,
13359,
4397,
29898,
5066,
296,
29918,
29886,
786,
309,
29918,
5721,
29918,
1609,
17708,
29961,
29875,
29892,
2023,
2314,
13,
18884,
1015,
21533,
1839,
1557,
2361,
16215,
10199,
29918,
22992,
13359,
4397,
29898,
10199,
29918,
29886,
786,
309,
29918,
5721,
29918,
1609,
17708,
29961,
29875,
29892,
2023,
2314,
13,
13,
18884,
1015,
21533,
1839,
4141,
16215,
29886,
786,
29918,
29883,
13359,
4397,
29898,
29886,
786,
309,
29918,
5064,
29961,
29875,
29892,
856,
1822,
23749,
3101,
13,
13,
18884,
565,
6389,
29889,
1688,
29918,
7620,
29918,
459,
29918,
13168,
29879,
29901,
13,
462,
1678,
1015,
21533,
1839,
4141,
16215,
13168,
13359,
4397,
29898,
21134,
29961,
29875,
29892,
856,
1822,
23749,
2141,
579,
668,
29898,
9302,
29889,
13470,
29947,
876,
13,
13,
18884,
527,
17779,
23661,
29896,
13,
13,
9651,
565,
6389,
29889,
2218,
29886,
29901,
13,
18884,
565,
289,
29873,
1275,
29871,
29900,
29901,
13,
462,
1678,
298,
29918,
326,
353,
14770,
29889,
326,
4294,
29898,
2218,
29886,
29902,
29889,
17858,
1082,
29898,
29896,
29892,
29871,
29906,
29892,
29871,
29900,
876,
13,
462,
1678,
14770,
29889,
29886,
1071,
29898,
29900,
29889,
29900,
29896,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
298,
29918,
326,
29889,
842,
29918,
1272,
29898,
2218,
29886,
29902,
29889,
17858,
1082,
29898,
29896,
29892,
29871,
29906,
29892,
29871,
29900,
876,
13,
462,
1678,
590,
29886,
1071,
29898,
29900,
29889,
29900,
29896,
29897,
13,
13,
4706,
1015,
21533,
353,
5096,
497,
29918,
21533,
29898,
459,
21533,
29897,
13,
4706,
474,
681,
353,
7442,
29889,
1429,
29898,
2738,
29892,
9685,
29922,
29900,
29897,
13,
4706,
474,
681,
353,
7442,
29889,
13707,
12676,
29898,
2738,
29892,
9685,
29922,
29900,
29897,
13,
4706,
1596,
877,
29885,
29902,
29877,
29965,
29901,
426,
1836,
22244,
15922,
29901,
6571,
4286,
4830,
29898,
9302,
29889,
12676,
29898,
2738,
511,
474,
681,
876,
13,
4706,
1596,
877,
13992,
296,
2913,
349,
29965,
2227,
29931,
1320,
29889,
3436,
29901,
24335,
6850,
29928,
29901,
6571,
4286,
4830,
29898,
9302,
29889,
13707,
2168,
713,
29898,
29881,
2879,
29918,
29886,
786,
309,
29918,
5066,
296,
511,
13,
462,
462,
462,
9651,
7442,
29889,
13707,
4172,
29898,
29881,
2879,
29918,
29886,
786,
309,
29918,
5066,
296,
4961,
13,
4706,
1596,
877,
17669,
358,
362,
349,
29965,
2227,
29931,
1320,
29889,
3436,
29901,
24335,
6850,
29928,
29901,
6571,
4286,
4830,
29898,
9302,
29889,
13707,
2168,
713,
29898,
29881,
2879,
29918,
29886,
786,
309,
29918,
10199,
511,
13,
462,
462,
462,
9651,
7442,
29889,
13707,
4172,
29898,
29881,
2879,
29918,
29886,
786,
309,
29918,
10199,
4961,
13,
4706,
1596,
877,
13992,
296,
2913,
23292,
3235,
1320,
29889,
3436,
29901,
24335,
6850,
29928,
29901,
6571,
4286,
4830,
29898,
9302,
29889,
13707,
2168,
713,
29898,
29881,
2879,
29918,
381,
275,
29918,
5066,
296,
511,
13,
462,
462,
462,
965,
7442,
29889,
13707,
4172,
29898,
29881,
2879,
29918,
381,
275,
29918,
5066,
296,
4961,
13,
4706,
1596,
877,
17669,
358,
362,
23292,
3235,
1320,
29889,
3436,
29901,
24335,
6850,
29928,
29901,
6571,
4286,
4830,
29898,
9302,
29889,
13707,
2168,
713,
29898,
29881,
2879,
29918,
381,
275,
29918,
10199,
511,
13,
462,
462,
462,
965,
7442,
29889,
13707,
4172,
29898,
29881,
2879,
29918,
381,
275,
29918,
10199,
4961,
13,
13,
4706,
1596,
877,
5634,
317,
5555,
1962,
3884,
11474,
1495,
13,
4706,
285,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
2084,
29906,
459,
29892,
525,
459,
21533,
29889,
29886,
6321,
5477,
525,
29893,
29890,
1495,
13,
4706,
5839,
280,
29889,
15070,
29898,
459,
21533,
29892,
285,
29897,
13,
4706,
285,
29889,
5358,
580,
13,
2
] |
pipeline/tests/engine/core/data/test_api.py | wkma/bk-sops | 2 | 12162 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""
import sys
from django.test import TestCase
from django.utils.module_loading import import_string
from pipeline.tests.mock import * # noqa
from pipeline.tests.mock_settings import * # noqa
class EngineDataAPITestCase(TestCase):
@classmethod
def setUpClass(cls):
cls.mock_settings = MagicMock()
cls.settings_patch = patch(ENGINE_DATA_API_SETTINGS, cls.mock_settings)
cls.import_backend_patch = patch(ENGINE_DATA_API_IMPORT_BACKEND, MagicMock())
cls.settings_patch.start()
cls.import_backend_patch.start()
cls.api = import_string("pipeline.engine.core.data.api")
cls.write_methods = ["set_object", "del_object", "expire_cache"]
cls.read_methods = ["get_object", "cache_for"]
cls.method_params = {
"set_object": ["key", "obj"],
"del_object": ["key"],
"expire_cache": ["key", "obj", "expires"],
"cache_for": ["key"],
"get_object": ["key"],
}
@classmethod
def tearDownClass(cls):
cls.settings_patch.stop()
cls.import_backend_patch.stop()
def setUp(self):
self.backend = MagicMock()
self.candidate_backend = MagicMock()
self.mock_settings.PIPELINE_DATA_BACKEND_AUTO_EXPIRE = False
def test_write__without_candidate(self):
for method in self.write_methods:
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, None):
getattr(self.api, method)(*self.method_params[method])
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_not_called()
sys.stdout.write(
"{} pass test_write__without_candidate test\n".format(method)
)
def test_write__without_candiate_raise_err(self):
for method in self.write_methods:
setattr(self.backend, method, MagicMock(side_effect=Exception))
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, None):
self.assertRaises(
Exception,
getattr(self.api, method),
*self.method_params[method]
)
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_not_called()
sys.stdout.write(
"{} pass test_write__without_candiate_raise_err test\n".format(method)
)
def test_write__with_candidate(self):
for method in self.write_methods:
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
getattr(self.api, method)(*self.method_params[method])
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_called_once_with(
*self.method_params[method]
)
sys.stdout.write("{} pass test_write__with_candidate test\n".format(method))
def test_write__with_candidate_main_raise_err(self):
for method in self.write_methods:
setattr(self.backend, method, MagicMock(side_effect=Exception))
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
getattr(self.api, method)(*self.method_params[method])
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_called_once_with(
*self.method_params[method]
)
sys.stdout.write(
"{} pass test_write__with_candidate_main_raise_err test\n".format(
method
)
)
def test_write__with_candidate_raise_err(self):
for method in self.write_methods:
setattr(self.candidate_backend, method, MagicMock(side_effect=Exception))
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
getattr(self.api, method)(*self.method_params[method])
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_called_once_with(
*self.method_params[method]
)
sys.stdout.write(
"{} pass test_write__with_candidate_raise_err test\n".format(method)
)
def test_write__with_candidate_both_raise_err(self):
for method in self.write_methods:
setattr(self.backend, method, MagicMock(side_effect=Exception))
setattr(self.candidate_backend, method, MagicMock(side_effect=Exception))
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
self.assertRaises(
Exception,
getattr(self.api, method),
*self.method_params[method]
)
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_called_once_with(
*self.method_params[method]
)
sys.stdout.write(
"{} pass test_write__with_candidate_both_raise_err test\n".format(
method
)
)
def test_write__with_auto_expire(self):
self.mock_settings.PIPELINE_DATA_BACKEND_AUTO_EXPIRE = True
self.mock_settings.PIPELINE_DATA_BACKEND_AUTO_EXPIRE_SECONDS = 30
for method in self.write_methods:
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
getattr(self.api, method)(*self.method_params[method])
if method == "set_object":
getattr(self.backend, "expire_cache").assert_called_once_with(
*self.method_params[method], expires=30
)
self.backend.expire_cache.reset_mock()
else:
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_called_once_with(
*self.method_params[method]
)
sys.stdout.write(
"{} pass test_write__with_candidate_both_raise_err test\n".format(
method
)
)
def test_read__without_candidate(self):
for method in self.read_methods:
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, None):
data = getattr(self.api, method)(*self.method_params[method])
self.assertIsNotNone(data)
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_not_called()
sys.stdout.write(
"{} pass test_read__without_candidate test\n".format(method)
)
def test_read__without_candidate_raise_err(self):
for method in self.read_methods:
setattr(self.backend, method, MagicMock(side_effect=Exception))
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, None):
self.assertRaises(
Exception,
getattr(self.api, method),
*self.method_params[method]
)
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_not_called()
sys.stdout.write(
"{} pass test_read__without_candidate_raise_err test\n".format(method)
)
def test_read__with_candidate_not_use(self):
for method in self.read_methods:
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
data = getattr(self.api, method)(*self.method_params[method])
self.assertIsNotNone(data)
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_not_called()
sys.stdout.write(
"{} pass test_read__with_candidate_not_use test\n".format(method)
)
def test_read__with_candidate_use(self):
for method in self.read_methods:
setattr(self.backend, method, MagicMock(return_value=None))
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
data = getattr(self.api, method)(*self.method_params[method])
self.assertIsNotNone(data)
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_called_once_with(
*self.method_params[method]
)
sys.stdout.write(
"{} pass test_read__with_candidate_use test\n".format(method)
)
def test_read__with_candidate_err(self):
for method in self.read_methods:
setattr(self.backend, method, MagicMock(return_value=None))
setattr(self.candidate_backend, method, MagicMock(side_effect=Exception))
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
data = getattr(self.api, method)(*self.method_params[method])
self.assertIsNone(data)
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_called_once_with(
*self.method_params[method]
)
sys.stdout.write(
"{} pass test_read__with_candidate_err test\n".format(method)
)
def test_read__with_candidate_main_raise_err(self):
for method in self.read_methods:
setattr(self.backend, method, MagicMock(side_effect=Exception))
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
data = getattr(self.api, method)(*self.method_params[method])
self.assertIsNotNone(data)
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_called_once_with(
*self.method_params[method]
)
sys.stdout.write(
"{} pass test_read__with_candidate_main_raise_err test\n".format(method)
)
def test_read__with_candidate_both_raise_err(self):
for method in self.read_methods:
setattr(self.backend, method, MagicMock(side_effect=Exception))
setattr(self.candidate_backend, method, MagicMock(side_effect=Exception))
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
self.assertRaises(
Exception,
getattr(self.api, method),
*self.method_params[method]
)
getattr(self.backend, method).assert_called_once_with(
*self.method_params[method]
)
getattr(self.candidate_backend, method).assert_called_once_with(
*self.method_params[method]
)
sys.stdout.write(
"{} pass test_read__with_candidate_both_raise_err test\n".format(method)
)
def test_set_schedule_data(self):
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
self.api.set_schedule_data("key", "data")
self.backend.set_object.assert_called_once_with(
"key_schedule_parent_data", "data"
)
self.candidate_backend.set_object.assert_called_once_with(
"key_schedule_parent_data", "data"
)
def test_delete_parent_data(self):
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
self.api.delete_parent_data("key")
self.backend.del_object.assert_called_once_with(
"key_schedule_parent_data"
)
self.candidate_backend.del_object.assert_called_once_with(
"key_schedule_parent_data"
)
def test_get_schedule_parent_data(self):
with patch(ENGINE_DATA_API_BACKEND, self.backend):
with patch(ENGINE_DATA_API_CANDIDATE_BACKEND, self.candidate_backend):
data = self.api.get_schedule_parent_data("key")
self.assertIsNotNone(data)
self.backend.get_object.assert_called_once_with(
"key_schedule_parent_data"
)
self.candidate_backend.get_object.assert_not_called()
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
29911,
264,
1760,
338,
22301,
304,
2304,
278,
1722,
2752,
7881,
491,
3907,
29871,
235,
150,
160,
236,
181,
187,
31676,
31784,
29925,
7340,
29903,
30606,
31037,
30564,
30467,
30845,
313,
21319,
29968,
292,
2621,
29874,
29903,
19184,
13,
3853,
654,
29897,
3625,
29889,
13,
11882,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29896,
29955,
29899,
29906,
29900,
29906,
29896,
3446,
29931,
319,
29906,
29929,
28873,
29892,
263,
12444,
1760,
5001,
29889,
2178,
10462,
21676,
29889,
13,
29931,
293,
21144,
1090,
278,
341,
1806,
19245,
313,
1552,
376,
29931,
293,
1947,
1496,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
3492,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
1124,
597,
22156,
1167,
29889,
990,
29914,
506,
11259,
29914,
26349,
13,
2525,
2222,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13235,
1090,
278,
19245,
338,
13235,
373,
13,
273,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
2823,
278,
19245,
363,
278,
13,
14940,
4086,
14765,
1076,
11239,
322,
27028,
1090,
278,
19245,
29889,
13,
15945,
29908,
13,
13,
5215,
10876,
13,
13,
3166,
9557,
29889,
1688,
1053,
4321,
8259,
13,
3166,
9557,
29889,
13239,
29889,
5453,
29918,
13234,
1053,
1053,
29918,
1807,
13,
13,
3166,
16439,
29889,
21150,
29889,
17640,
1053,
334,
29871,
396,
694,
25621,
13,
3166,
16439,
29889,
21150,
29889,
17640,
29918,
11027,
1053,
334,
29871,
396,
694,
25621,
13,
13,
13,
1990,
10863,
1469,
3301,
1806,
342,
8259,
29898,
3057,
8259,
1125,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
731,
3373,
2385,
29898,
25932,
1125,
13,
4706,
1067,
29879,
29889,
17640,
29918,
11027,
353,
26494,
18680,
580,
13,
4706,
1067,
29879,
29889,
11027,
29918,
5041,
353,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
10490,
29911,
4214,
29903,
29892,
1067,
29879,
29889,
17640,
29918,
11027,
29897,
13,
4706,
1067,
29879,
29889,
5215,
29918,
27852,
29918,
5041,
353,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29902,
3580,
8476,
29918,
29933,
11375,
11794,
29892,
26494,
18680,
3101,
13,
4706,
1067,
29879,
29889,
11027,
29918,
5041,
29889,
2962,
580,
13,
4706,
1067,
29879,
29889,
5215,
29918,
27852,
29918,
5041,
29889,
2962,
580,
13,
13,
4706,
1067,
29879,
29889,
2754,
353,
1053,
29918,
1807,
703,
13096,
5570,
29889,
10599,
29889,
3221,
29889,
1272,
29889,
2754,
1159,
13,
4706,
1067,
29879,
29889,
3539,
29918,
23515,
353,
6796,
842,
29918,
3318,
613,
376,
6144,
29918,
3318,
613,
376,
4548,
533,
29918,
8173,
3108,
13,
4706,
1067,
29879,
29889,
949,
29918,
23515,
353,
6796,
657,
29918,
3318,
613,
376,
8173,
29918,
1454,
3108,
13,
4706,
1067,
29879,
29889,
5696,
29918,
7529,
353,
426,
13,
9651,
376,
842,
29918,
3318,
1115,
6796,
1989,
613,
376,
5415,
12436,
13,
9651,
376,
6144,
29918,
3318,
1115,
6796,
1989,
12436,
13,
9651,
376,
4548,
533,
29918,
8173,
1115,
6796,
1989,
613,
376,
5415,
613,
376,
4548,
2658,
12436,
13,
9651,
376,
8173,
29918,
1454,
1115,
6796,
1989,
12436,
13,
9651,
376,
657,
29918,
3318,
1115,
6796,
1989,
12436,
13,
4706,
500,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
734,
279,
6767,
2385,
29898,
25932,
1125,
13,
4706,
1067,
29879,
29889,
11027,
29918,
5041,
29889,
9847,
580,
13,
4706,
1067,
29879,
29889,
5215,
29918,
27852,
29918,
5041,
29889,
9847,
580,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
27852,
353,
26494,
18680,
580,
13,
4706,
1583,
29889,
29883,
5380,
403,
29918,
27852,
353,
26494,
18680,
580,
13,
4706,
1583,
29889,
17640,
29918,
11027,
29889,
2227,
4162,
18521,
29918,
14573,
29918,
29933,
11375,
11794,
29918,
20656,
29949,
29918,
5746,
2227,
1525,
353,
7700,
13,
13,
1678,
822,
1243,
29918,
3539,
1649,
14037,
29918,
29883,
5380,
403,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
3539,
29918,
23515,
29901,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
6213,
1125,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
5033,
29930,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
2314,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
1333,
29918,
13998,
580,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
3539,
1649,
14037,
29918,
29883,
5380,
403,
1243,
29905,
29876,
1642,
4830,
29898,
5696,
29897,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
3539,
1649,
14037,
29918,
29883,
392,
29347,
29918,
22692,
29918,
3127,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
3539,
29918,
23515,
29901,
13,
13,
9651,
731,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2975,
29918,
15987,
29922,
2451,
876,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
6213,
1125,
13,
462,
1678,
1583,
29889,
9294,
29934,
1759,
267,
29898,
13,
462,
4706,
8960,
29892,
13,
462,
4706,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
511,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
1333,
29918,
13998,
580,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
3539,
1649,
14037,
29918,
29883,
392,
29347,
29918,
22692,
29918,
3127,
1243,
29905,
29876,
1642,
4830,
29898,
5696,
29897,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
3539,
1649,
2541,
29918,
29883,
5380,
403,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
3539,
29918,
23515,
29901,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
5033,
29930,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
2314,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
703,
8875,
1209,
1243,
29918,
3539,
1649,
2541,
29918,
29883,
5380,
403,
1243,
29905,
29876,
1642,
4830,
29898,
5696,
876,
13,
13,
1678,
822,
1243,
29918,
3539,
1649,
2541,
29918,
29883,
5380,
403,
29918,
3396,
29918,
22692,
29918,
3127,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
3539,
29918,
23515,
29901,
13,
13,
9651,
731,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2975,
29918,
15987,
29922,
2451,
876,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
5033,
29930,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
2314,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
3539,
1649,
2541,
29918,
29883,
5380,
403,
29918,
3396,
29918,
22692,
29918,
3127,
1243,
29905,
29876,
1642,
4830,
29898,
13,
462,
1678,
1158,
13,
18884,
1723,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
3539,
1649,
2541,
29918,
29883,
5380,
403,
29918,
22692,
29918,
3127,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
3539,
29918,
23515,
29901,
13,
13,
9651,
731,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2975,
29918,
15987,
29922,
2451,
876,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
5033,
29930,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
2314,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
3539,
1649,
2541,
29918,
29883,
5380,
403,
29918,
22692,
29918,
3127,
1243,
29905,
29876,
1642,
4830,
29898,
5696,
29897,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
3539,
1649,
2541,
29918,
29883,
5380,
403,
29918,
20313,
29918,
22692,
29918,
3127,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
3539,
29918,
23515,
29901,
13,
13,
9651,
731,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2975,
29918,
15987,
29922,
2451,
876,
13,
9651,
731,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2975,
29918,
15987,
29922,
2451,
876,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
462,
1678,
1583,
29889,
9294,
29934,
1759,
267,
29898,
13,
462,
4706,
8960,
29892,
13,
462,
4706,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
511,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
3539,
1649,
2541,
29918,
29883,
5380,
403,
29918,
20313,
29918,
22692,
29918,
3127,
1243,
29905,
29876,
1642,
4830,
29898,
13,
462,
1678,
1158,
13,
18884,
1723,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
3539,
1649,
2541,
29918,
6921,
29918,
4548,
533,
29898,
1311,
1125,
13,
4706,
1583,
29889,
17640,
29918,
11027,
29889,
2227,
4162,
18521,
29918,
14573,
29918,
29933,
11375,
11794,
29918,
20656,
29949,
29918,
5746,
2227,
1525,
353,
5852,
13,
4706,
1583,
29889,
17640,
29918,
11027,
29889,
2227,
4162,
18521,
29918,
14573,
29918,
29933,
11375,
11794,
29918,
20656,
29949,
29918,
5746,
2227,
1525,
29918,
1660,
6007,
8452,
353,
29871,
29941,
29900,
13,
13,
4706,
363,
1158,
297,
1583,
29889,
3539,
29918,
23515,
29901,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
5033,
29930,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
2314,
13,
462,
1678,
565,
1158,
1275,
376,
842,
29918,
3318,
1115,
13,
462,
4706,
679,
5552,
29898,
1311,
29889,
27852,
29892,
376,
4548,
533,
29918,
8173,
2564,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
9651,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
1402,
1518,
2658,
29922,
29941,
29900,
13,
462,
4706,
1723,
13,
462,
4706,
1583,
29889,
27852,
29889,
4548,
533,
29918,
8173,
29889,
12071,
29918,
17640,
580,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
9651,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
4706,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
3539,
1649,
2541,
29918,
29883,
5380,
403,
29918,
20313,
29918,
22692,
29918,
3127,
1243,
29905,
29876,
1642,
4830,
29898,
13,
462,
1678,
1158,
13,
18884,
1723,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
949,
1649,
14037,
29918,
29883,
5380,
403,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
949,
29918,
23515,
29901,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
6213,
1125,
13,
462,
1678,
848,
353,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
5033,
29930,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
2314,
13,
462,
1678,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
1272,
29897,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
1333,
29918,
13998,
580,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
949,
1649,
14037,
29918,
29883,
5380,
403,
1243,
29905,
29876,
1642,
4830,
29898,
5696,
29897,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
949,
1649,
14037,
29918,
29883,
5380,
403,
29918,
22692,
29918,
3127,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
949,
29918,
23515,
29901,
13,
13,
9651,
731,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2975,
29918,
15987,
29922,
2451,
876,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
6213,
1125,
13,
462,
1678,
1583,
29889,
9294,
29934,
1759,
267,
29898,
13,
462,
4706,
8960,
29892,
13,
462,
4706,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
511,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
1333,
29918,
13998,
580,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
949,
1649,
14037,
29918,
29883,
5380,
403,
29918,
22692,
29918,
3127,
1243,
29905,
29876,
1642,
4830,
29898,
5696,
29897,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
949,
1649,
2541,
29918,
29883,
5380,
403,
29918,
1333,
29918,
1509,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
949,
29918,
23515,
29901,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
462,
1678,
848,
353,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
5033,
29930,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
2314,
13,
462,
1678,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
1272,
29897,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
1333,
29918,
13998,
580,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
949,
1649,
2541,
29918,
29883,
5380,
403,
29918,
1333,
29918,
1509,
1243,
29905,
29876,
1642,
4830,
29898,
5696,
29897,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
949,
1649,
2541,
29918,
29883,
5380,
403,
29918,
1509,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
949,
29918,
23515,
29901,
13,
13,
9651,
731,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2457,
29918,
1767,
29922,
8516,
876,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
462,
1678,
848,
353,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
5033,
29930,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
2314,
13,
462,
1678,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
1272,
29897,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
949,
1649,
2541,
29918,
29883,
5380,
403,
29918,
1509,
1243,
29905,
29876,
1642,
4830,
29898,
5696,
29897,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
949,
1649,
2541,
29918,
29883,
5380,
403,
29918,
3127,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
949,
29918,
23515,
29901,
13,
13,
9651,
731,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2457,
29918,
1767,
29922,
8516,
876,
13,
9651,
731,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2975,
29918,
15987,
29922,
2451,
876,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
462,
1678,
848,
353,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
5033,
29930,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
2314,
13,
462,
1678,
1583,
29889,
9294,
3624,
8516,
29898,
1272,
29897,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
949,
1649,
2541,
29918,
29883,
5380,
403,
29918,
3127,
1243,
29905,
29876,
1642,
4830,
29898,
5696,
29897,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
949,
1649,
2541,
29918,
29883,
5380,
403,
29918,
3396,
29918,
22692,
29918,
3127,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
949,
29918,
23515,
29901,
13,
13,
9651,
731,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2975,
29918,
15987,
29922,
2451,
876,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
462,
1678,
848,
353,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
5033,
29930,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
2314,
13,
462,
1678,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
1272,
29897,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
949,
1649,
2541,
29918,
29883,
5380,
403,
29918,
3396,
29918,
22692,
29918,
3127,
1243,
29905,
29876,
1642,
4830,
29898,
5696,
29897,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
949,
1649,
2541,
29918,
29883,
5380,
403,
29918,
20313,
29918,
22692,
29918,
3127,
29898,
1311,
1125,
13,
4706,
363,
1158,
297,
1583,
29889,
949,
29918,
23515,
29901,
13,
13,
9651,
731,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2975,
29918,
15987,
29922,
2451,
876,
13,
9651,
731,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
29892,
26494,
18680,
29898,
2975,
29918,
15987,
29922,
2451,
876,
13,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
18884,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
462,
1678,
1583,
29889,
9294,
29934,
1759,
267,
29898,
13,
462,
4706,
8960,
29892,
13,
462,
4706,
679,
5552,
29898,
1311,
29889,
2754,
29892,
1158,
511,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
462,
1678,
679,
5552,
29898,
1311,
29889,
29883,
5380,
403,
29918,
27852,
29892,
1158,
467,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
4706,
334,
1311,
29889,
5696,
29918,
7529,
29961,
5696,
29962,
13,
462,
1678,
1723,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
8875,
1209,
1243,
29918,
949,
1649,
2541,
29918,
29883,
5380,
403,
29918,
20313,
29918,
22692,
29918,
3127,
1243,
29905,
29876,
1642,
4830,
29898,
5696,
29897,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
842,
29918,
816,
11272,
29918,
1272,
29898,
1311,
1125,
13,
4706,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
18884,
1583,
29889,
2754,
29889,
842,
29918,
816,
11272,
29918,
1272,
703,
1989,
613,
376,
1272,
1159,
13,
18884,
1583,
29889,
27852,
29889,
842,
29918,
3318,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
1678,
376,
1989,
29918,
816,
11272,
29918,
3560,
29918,
1272,
613,
376,
1272,
29908,
13,
18884,
1723,
13,
18884,
1583,
29889,
29883,
5380,
403,
29918,
27852,
29889,
842,
29918,
3318,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
1678,
376,
1989,
29918,
816,
11272,
29918,
3560,
29918,
1272,
613,
376,
1272,
29908,
13,
18884,
1723,
13,
13,
1678,
822,
1243,
29918,
8143,
29918,
3560,
29918,
1272,
29898,
1311,
1125,
13,
4706,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
18884,
1583,
29889,
2754,
29889,
8143,
29918,
3560,
29918,
1272,
703,
1989,
1159,
13,
18884,
1583,
29889,
27852,
29889,
6144,
29918,
3318,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
1678,
376,
1989,
29918,
816,
11272,
29918,
3560,
29918,
1272,
29908,
13,
18884,
1723,
13,
18884,
1583,
29889,
29883,
5380,
403,
29918,
27852,
29889,
6144,
29918,
3318,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
1678,
376,
1989,
29918,
816,
11272,
29918,
3560,
29918,
1272,
29908,
13,
18884,
1723,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
816,
11272,
29918,
3560,
29918,
1272,
29898,
1311,
1125,
13,
4706,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
27852,
1125,
13,
9651,
411,
13261,
29898,
1430,
29954,
8895,
29918,
14573,
29918,
8787,
29918,
29907,
9468,
1367,
3040,
29918,
29933,
11375,
11794,
29892,
1583,
29889,
29883,
5380,
403,
29918,
27852,
1125,
13,
18884,
848,
353,
1583,
29889,
2754,
29889,
657,
29918,
816,
11272,
29918,
3560,
29918,
1272,
703,
1989,
1159,
13,
18884,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
1272,
29897,
13,
18884,
1583,
29889,
27852,
29889,
657,
29918,
3318,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
462,
1678,
376,
1989,
29918,
816,
11272,
29918,
3560,
29918,
1272,
29908,
13,
18884,
1723,
13,
18884,
1583,
29889,
29883,
5380,
403,
29918,
27852,
29889,
657,
29918,
3318,
29889,
9294,
29918,
1333,
29918,
13998,
580,
13,
2
] |
setup.py | NogaOs/wit | 0 | 168076 | <reponame>NogaOs/wit
from setuptools import find_packages, setup
setup(
name='Swit',
packages=find_packages(where='Swit'),
package_dir={"": "Swit"},
include_package_data=True,
version='0.2',
license='MIT',
description='Swit is a basic open-source implementation of Git, meant for experimenting and studying Git\'s concepts and core design.',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/NogaOs/Swit',
download_url='https://github.com/NogaOs/Swit/archive/refs/tags/v0.2.tar.gz',
keywords=['git', 'version control', 'source control'],
install_requires=[
'wheel',
'loguru',
'networkx',
'matplotlib',
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
entry_points={
'console_scripts': ['Swit=Swit.Switter:main'],
},
)
| [
1,
529,
276,
1112,
420,
29958,
29940,
14895,
24768,
29914,
29893,
277,
13,
3166,
731,
21245,
8789,
1053,
1284,
29918,
8318,
29892,
6230,
13,
13,
13,
14669,
29898,
13,
1678,
1024,
2433,
10840,
277,
742,
13,
1678,
9741,
29922,
2886,
29918,
8318,
29898,
3062,
2433,
10840,
277,
5477,
13,
1678,
3577,
29918,
3972,
3790,
29908,
1115,
376,
10840,
277,
10758,
13,
1678,
3160,
29918,
5113,
29918,
1272,
29922,
5574,
29892,
13,
1678,
1873,
2433,
29900,
29889,
29906,
742,
13,
1678,
19405,
2433,
26349,
742,
13,
1678,
6139,
2433,
10840,
277,
338,
263,
6996,
1722,
29899,
4993,
5314,
310,
11786,
29892,
6839,
363,
7639,
292,
322,
23382,
11786,
20333,
29879,
22001,
322,
7136,
2874,
29889,
742,
13,
1678,
4148,
2433,
29966,
5813,
29958,
742,
13,
1678,
4148,
29918,
5269,
2433,
29966,
26862,
6227,
29958,
742,
13,
1678,
3142,
2433,
991,
597,
3292,
29889,
510,
29914,
29940,
14895,
24768,
29914,
10840,
277,
742,
13,
1678,
5142,
29918,
2271,
2433,
991,
597,
3292,
29889,
510,
29914,
29940,
14895,
24768,
29914,
10840,
277,
29914,
10867,
29914,
24539,
29914,
11338,
29914,
29894,
29900,
29889,
29906,
29889,
12637,
29889,
18828,
742,
13,
1678,
29361,
29922,
1839,
5559,
742,
525,
3259,
2761,
742,
525,
4993,
2761,
7464,
13,
1678,
2601,
29918,
276,
339,
2658,
11759,
13,
4706,
525,
29893,
10552,
742,
13,
4706,
525,
1188,
20144,
742,
13,
4706,
525,
11618,
29916,
742,
13,
4706,
525,
2922,
17357,
742,
13,
1678,
21251,
13,
1678,
770,
14903,
11759,
13,
4706,
525,
21956,
358,
16034,
4761,
29871,
29945,
448,
19561,
29914,
855,
519,
742,
13,
4706,
525,
2928,
2760,
319,
4749,
663,
4761,
10682,
414,
742,
13,
4706,
525,
7031,
293,
4761,
18540,
14650,
4761,
8878,
27564,
742,
13,
4706,
525,
29931,
293,
1947,
4761,
438,
5425,
28268,
1490,
4761,
341,
1806,
19245,
742,
13,
4706,
525,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
742,
13,
4706,
525,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
29889,
29947,
742,
13,
4706,
525,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
29889,
29929,
742,
13,
1678,
21251,
13,
1678,
6251,
29918,
9748,
3790,
13,
4706,
525,
11058,
29918,
16713,
2396,
6024,
10840,
277,
29922,
10840,
277,
29889,
10840,
5171,
29901,
3396,
7464,
13,
1678,
2981,
13,
29897,
13,
2
] |
wb/main/enumerates.py | openvinotoolkit/workbench | 23 | 82499 | """
OpenVINO DL Workbench
Enumerates classes
Copyright (c) 2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import enum
from typing import Tuple, Optional
class JobTypesEnum(enum.Enum):
profiling_type = 'ProfilingJob'
single_inference_type = 'SingleInferenceJob'
int8calibration_type = 'Int8CalibrationJob'
# Accuracy
create_accuracy_scripts_type = 'CreateAccuracyScriptsJob'
create_accuracy_bundle_type = 'CreateAccuracyBundleJob'
accuracy_type = 'AccuracyJob'
remote_accuracy_type = 'RemoteAccuracyJob'
# Per tensor report
create_per_tensor_scripts_type = 'CreatePerTensorScriptsJob'
create_per_tensor_bundle_type = 'CreatePerTensorBundleJob'
per_tensor_report_type = 'PerTensorReportJob'
remote_per_tensor_report_type = 'RemotePerTensorReportJob'
# Parent Accuracy Analysis
create_annotate_dataset_scripts_type = 'CreateAnnotateDatasetScriptsJob'
create_annotate_dataset_bundle_type = 'CreateAnnotateDatasetBundleJob'
annotate_dataset = 'AnnotateDatasetJob'
remote_annotate_dataset = 'RemoteAnnotateDatasetJob'
extract_dataset_type = 'ExtractDatasetJob'
extract_text_dataset_type = 'ExtractTextDatasetJob'
wait_upload_dataset_type = 'WaitDatasetUploadJob'
recognize_dataset_type = 'RecognizeDatasetJob'
convert_dataset_type = 'ConvertDatasetJob'
validate_dataset_type = 'ValidateDatasetJob'
validate_text_dataset_type = 'ValidateTextDatasetJob'
generate_dataset_type = 'DatasetGeneratorJob'
augment_dataset_type = 'DatasetAugmentationJob'
analyze_model_input_shape_type = 'AnalyzeModelInputShapeJob'
wait_upload_model_type = 'WaitModelUploadJob'
model_analyzer_type = 'ModelAnalyzerJob'
model_optimizer_type = 'ModelOptimizerJob'
model_optimizer_scan_type = 'ModelOptimizerScanJob'
convert_keras_type = 'ConvertKerasJob'
omz_model_download_type = 'OMZModelDownloadJob'
omz_model_convert_type = 'OMZModelConvertJob'
omz_model_move_type = 'OMZModelMoveJob'
download_model_type = 'DownloadModelJob'
deployment_manager_type = 'DeploymentManagerJob'
export_project_type = 'ExportProjectJob'
download_log_type = 'DownloadLogJob'
export_project_report = 'ProjectReportExportJob'
export_inference_report = 'InferenceReportExportJob'
create_profiling_scripts_type = 'CreateProfilingScriptsJob'
wait_upload_tokenizer_type = 'WaitTokenizerUploadJob'
validate_tokenizer_type = 'ValidateTokenizerJob'
# huggingface
import_huggingface_model_type = 'ImportHuggingfaceModelJob'
# Remote profiling
create_profiling_bundle_type = 'CreateProfilingBundleJob'
remote_profiling_type = 'RemoteProfilingJob'
remote_int8_calibration_type = 'RemoteInt8CalibrationJob'
# Remote INT8 calibration
create_int8_calibration_scripts_type = 'CreateInt8CalibrationScriptsJob'
create_int8_calibration_bundle_type = 'CreateInt8CalibrationBundleJob'
create_setup_bundle_type = 'CreateSetupBundleJob'
upload_artifact_to_target_type = 'UploadArtifactToTargetJob'
setup_target_type = 'SetupTargetJob'
get_devices_type = 'GetDevicesJob'
get_system_resources_type = 'GetSystemResourcesJob'
# DevCloud
trigger_dev_cloud_job = 'TriggerDevCloudJob'
handle_dev_cloud_profiling_sockets_job = 'HandleDevCloudProfilingSocketsJob'
handle_dev_cloud_int8_calibration_sockets_job = 'HandleDevCloudInt8CalibrationJob'
handle_dev_cloud_accuracy_sockets_job = 'HandleDevCloudAccuracyJob'
handle_dev_cloud_dataset_annotation_sockets_job = 'HandleDevCloudDatasetAnnotationJob'
handle_dev_cloud_per_tensor_sockets_job = 'HandleDevCloudPerTensorJob'
parse_dev_cloud_profiling_result_job = 'ParseDevCloudProfilingResultJob'
parse_dev_cloud_int8_calibration_result_job = 'ParseDevCloudInt8CalibrationResultJob'
parse_dev_cloud_accuracy_result_job = 'ParseDevCloudAccuracyResultJob'
parse_dev_cloud_dataset_annotation_result_job = 'ParseDevCloudDatasetAnnotationResultJob'
parse_dev_cloud_per_tensor_result_job = 'ParseDevCloudPerTensorResultJob'
# Accuracy visualization
inference_test_image_job = 'InferenceTestImageJob'
# Environment
setup_environment_job = 'SetupEnvironmentJob'
# Reshape Model
reshape_model = 'ReshapeModelJob'
create_reshape_model_scripts_job = 'CreateReshapeModelScriptsJob'
# Apply model layout
apply_model_layout = 'ApplyModelLayoutJob'
# Deprecated
winograd_tune_type = 'WinogradTuneJob'
class StatusEnum(enum.Enum):
queued = 'queued'
running = 'running'
ready = 'ready'
error = 'error'
cancelled = 'cancelled'
archived = 'archived'
warning = 'warning'
class ModelDomainEnum(enum.Enum):
CV = 'CV'
NLP = 'NLP'
class ThroughputUnitNameEnum(enum.Enum):
FPS = 'FPS'
SPS = 'SPS'
class TaskMethodEnum(enum.Enum):
classificator = 'classificator'
generic = 'generic'
ssd = 'ssd'
tiny_yolo_v2 = 'tiny_yolo_v2'
yolo_v2 = 'yolo_v2'
yolo_v3 = 'yolo_v3'
yolo_v4 = 'yolo_v4'
tiny_yolo_v3_v4 = 'tiny_yolo_v3_v4'
mask_rcnn = 'mask_rcnn'
segmentation = 'segmentation'
inpainting = 'inpainting'
style_transfer = 'style_transfer'
super_resolution = 'super_resolution'
face_recognition = 'face_recognition'
landmark_detection = 'landmark_detection'
custom = 'custom'
@classmethod
def has_value(cls, value: str) -> bool:
return any(value == item.value for item in cls)
class AnnotationConverterEnum(enum.Enum):
common_semantic_segmentation = 'common_semantic_segmentation'
custom = 'REQUIRED'
imagenet = 'imagenet'
inpainting = 'inpainting'
lfw = 'lfw'
mscoco_detection = 'mscoco_detection'
mscoco_mask_rcnn = 'mscoco_mask_rcnn'
style_transfer = 'style_transfer'
super_resolution = 'super_resolution'
super_resolution_dir_based = 'super_resolution_dir_based'
vgg_face = 'vgg_face'
voc_detection = 'voc_detection'
voc_segmentation = 'voc_segmentation'
wider = 'wider'
open_images_detection = 'open_images_detection'
image_processing = 'image_processing'
class YoloAnchorMasksEnum(enum.Enum):
yolo_v3 = [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
yolo_v4 = [[0, 1, 2], [3, 4, 5], [6, 7, 8]]
tiny_yolo_v3_v4 = [[3, 4, 5], [1, 2, 3]]
class OptimizationTypesEnum(enum.Enum):
inference = JobTypesEnum.profiling_type.value
int8calibration = JobTypesEnum.int8calibration_type.value
# Deprecated
winograd_tune = JobTypesEnum.winograd_tune_type.value
class SupportedFrameworksEnum(enum.Enum):
openvino = 'openvino'
caffe = 'caffe'
caffe2 = 'caffe2'
mxnet = 'mxnet'
onnx = 'onnx'
pytorch = 'pytorch'
tf = 'tf'
tf2 = 'tf2'
tf2_keras = 'tf2_keras'
@classmethod
def get_name(cls, key: str) -> Optional[str]:
_frameworks_names = {
cls.openvino.value: 'OpenVINO IR',
cls.caffe.value: 'Caffe',
cls.caffe2.value: 'Caffe2',
cls.mxnet.value: 'MXNet',
cls.onnx.value: 'ONNX',
cls.pytorch.value: 'PyTorch',
cls.tf.value: 'TensorFlow',
cls.tf2.value: 'TensorFlow 2.0',
cls.tf2_keras.value: 'TensorFlow 2.0 Keras',
}
return _frameworks_names.get(key)
class TF2FilesKeysEnum(enum.Enum):
keras = 'kerasModel'
saved_model_dir = 'savedModelDir'
class ConfigFileNames(enum.Enum):
tf_pipeline_config = 'pipeline.config'
transformations_config = 'transformations_config.json'
class ModelPrecisionEnum(enum.Enum):
fp32 = 'FP32'
fp16 = 'FP16'
i8 = 'INT8'
i1 = 'INT1'
mixed = 'MIXED'
unknown = 'UNKNOWN'
class ModelColorChannelsEnum(enum.Enum):
RGB = 'RGB'
BGR = 'BGR'
Grayscale = 'Grayscale'
@staticmethod
def values() -> set:
return set(item.value for item in ModelColorChannelsEnum)
class ArtifactTypesEnum(enum.Enum):
model = 'model'
project = 'project'
project_report = 'project_report'
inference_report = 'inference_report'
deployment_package = 'deployment_package'
bundle_package = 'bundle_package'
log = 'log'
job_bundle = 'job_bundle'
remote_job_result = 'remote_job_result'
class QuantizationAlgorithmEnum(enum.Enum):
default = 'DefaultQuantization'
accuracy_aware = 'AccuracyAwareQuantization'
class QuantizationAlgorithmPresetEnum(enum.Enum):
performance = 'performance'
mixed = 'mixed'
class ModelSourceEnum(enum.Enum):
omz = 'omz'
original = 'original'
ir = 'ir'
huggingface = 'huggingface'
class TargetOSEnum(enum.Enum):
ubuntu18 = 'ubuntu18'
ubuntu20 = 'ubuntu20'
windows = 'windows'
mac = 'mac'
class DeploymentTargetEnum(enum.Enum):
cpu = 'CPU'
gpu = 'GPU'
myriad = 'VPU'
hddl = 'HDDL'
opencv = 'opencv'
python36 = 'python3.6'
python37 = 'python3.7'
python38 = 'python3.8'
@staticmethod
def values() -> set:
return set(item.value for item in DeploymentTargetEnum)
@staticmethod
def create(value: str) -> 'DeploymentTargetEnum':
return DeploymentTargetEnum.myriad if DeploymentTargetEnum.is_myriad(value) else DeploymentTargetEnum(value)
@staticmethod
def get_python_targets() -> Tuple[str, ...]:
python_targets = (DeploymentTargetEnum.python36, DeploymentTargetEnum.python37, DeploymentTargetEnum.python38)
return tuple(python_target.value for python_target in python_targets)
@staticmethod
def is_myriad(device_name: str) -> bool:
return device_name == 'MYRIAD'
class DeploymentPackageSizesEnum(enum.Enum):
ie = 24
cpu = 31.2
gpu = 16.09
myriad = 1.8
hddl = 4.8
python = 24
install_script = 0.0032
gpu_drivers = 0.012
myriad_drivers = 0.0013
@staticmethod
def json():
return {
'IE_COMMON': DeploymentPackageSizesEnum.ie.value,
'TARGETS': {
'CPU': DeploymentPackageSizesEnum.cpu.value,
'GPU': DeploymentPackageSizesEnum.gpu.value,
'MYRIAD': DeploymentPackageSizesEnum.myriad.value,
'HDDL': DeploymentPackageSizesEnum.hddl.value,
},
'DRIVERS': {
'CPU': 0,
'GPU': DeploymentPackageSizesEnum.gpu_drivers.value,
'MYRIAD': DeploymentPackageSizesEnum.myriad_drivers.value,
'HDDL': 0,
},
'PYTHON': DeploymentPackageSizesEnum.python.value,
'INSTALL_SCRIPT': DeploymentPackageSizesEnum.install_script.value
}
STATUS_PRIORITY = {
StatusEnum.queued: 0,
StatusEnum.ready: 1,
StatusEnum.running: 2,
StatusEnum.cancelled: 3,
StatusEnum.error: 4
}
class DeviceTypeEnum(enum.Enum):
CPU = 'CPU'
GPU = 'GPU'
MYRIAD = 'MYRIAD'
HDDL = 'HDDL'
@staticmethod
def is_supported(device: str) -> bool:
return device in DeviceTypeEnum.values() or DeviceTypeEnum.is_myriad(device) or DeviceTypeEnum.is_gpu(device)
@staticmethod
def values() -> set:
return set(item.value for item in DeviceTypeEnum)
@staticmethod
def is_myriad(device_name: str) -> bool:
return DeviceTypeEnum.MYRIAD.value in device_name
@staticmethod
def is_gpu(device_name: str) -> bool:
return DeviceTypeEnum.GPU.value in device_name
@staticmethod
def is_hddl(device_name: str) -> bool:
return DeviceTypeEnum.HDDL.value == device_name
@staticmethod
def is_vpu(device_name: str) -> bool:
return DeviceTypeEnum.is_myriad(device_name) or DeviceTypeEnum.is_hddl(device_name)
@staticmethod
def get_device(device: str) -> str:
if DeviceTypeEnum.is_myriad(device):
return DeviceTypeEnum.MYRIAD.value
if DeviceTypeEnum.is_gpu(device):
return DeviceTypeEnum.GPU.value
return device
class TargetTypeEnum(enum.Enum):
local = 'local'
remote = 'remote'
dev_cloud = 'dev_cloud'
class TargetStatusEnum(enum.Enum):
available = 'available'
configuring = 'configuring'
connecting = 'connecting'
configuration_failure = 'configuration_failure'
connection_failure = 'connection_failure'
not_configured = 'not_configured'
busy = 'busy'
class PipelineTypeEnum(enum.Enum):
remote_profiling = 'remote_profiling'
local_profiling = 'local_profiling'
dev_cloud_profiling = 'dev_cloud_profiling'
local_int8_calibration = 'local_int8_calibration'
remote_int8_calibration = 'remote_int8_calibration'
dev_cloud_int8_calibration = 'dev_cloud_int8_calibration'
create_profiling_bundle = 'create_profiling_bundle'
download_log = 'download_log'
download_model = 'download_model'
deployment_manager = 'deployment_manager'
export_project = 'export_project'
setup = 'setup'
ping = 'ping'
inference_test_image = 'inference_test_image'
upload_dataset = 'upload_dataset'
upload_model = 'upload_model'
upload_tokenizer = 'upload_tokenizer'
download_omz_model = 'download_omz_model'
export_project_report = 'export_project_report'
export_inference_report = 'export_inference_report'
local_accuracy = 'local_accuracy'
remote_accuracy = 'remote_accuracy'
dev_cloud_accuracy = 'dev_cloud_accuracy'
local_per_tensor_report = 'local_per_tensor_report'
remote_per_tensor_report = 'remote_per_tensor_report'
dev_cloud_per_tensor_report = 'dev_cloud_per_tensor_report'
local_predictions_relative_accuracy_report = 'local_predictions_relative_accuracy_report'
remote_predictions_relative_accuracy_report = 'remote_predictions_relative_accuracy_report'
dev_cloud_predictions_relative_accuracy_report = 'dev_cloud_predictions_relative_accuracy_report'
configure_model = 'configure_model'
class PipelineStageEnum(enum.Enum):
accuracy = 'accuracy'
# Setup Pipeline stages
preparing_setup_assets = 'preparing_setup_assets'
uploading_setup_assets = 'uploading_setup_assets'
configuring_environment = 'configuring_environment'
# Ping Pipeline stages
collecting_available_devices = 'collecting_available_devices'
collecting_system_information = 'collecting_system_information'
# Remote Profile Pipeline stages
preparing_profiling_assets = 'preparing_profiling_assets'
preparing_int8_calibration_assets = 'preparing_int8_calibration_assets'
preparing_accuracy_assets = 'preparing_accuracy_assets'
profiling = 'profiling'
getting_remote_job_result = 'getting_remote_job_result'
# Download Log stage
download_log = 'download_log'
# Int8 calibration
int8_calibration = 'int8_calibration'
remote_int8_calibration = 'remote_int8_calibration'
# Dataset
augment_dataset = 'augment_dataset'
convert_dataset = 'convert_dataset'
extract_dataset = 'extract_dataset'
extract_text_dataset = 'extract_text_dataset'
recognize_dataset = 'recognize_dataset'
validate_dataset = 'validate_dataset'
validate_text_dataset = 'validate_text_dataset'
wait_dataset_upload = 'wait_dataset_upload'
# Export Report stages
export_project_report = 'export_project_report'
export_inference_report = 'export_inference_report'
# Tokenizer
wait_tokenizer_upload = 'wait_tokenizer_upload'
validate_tokenizer = 'validate_tokenizer'
# Model
wait_model_upload = 'wait_model_upload'
model_analyzer = 'model_analyzer'
model_optimizer_scan = 'model_optimizer_scan'
convert_keras_model = 'convert_keras_model'
convert_model = 'convert_model'
setup_environment = 'setup_environment'
# Huggingface
import_huggingface_model = 'import_huggingface_model',
# Model Downloader
download_omz_model = 'download_omz_model'
convert_omz_model = 'convert_omz_model'
move_omz_model = 'move_omz_model'
inference_test_image = 'inference_test_image'
export_project = 'export_project'
preparing_reshape_model_assets = 'preparing_reshape_model_assets'
reshape_model = 'reshape_model'
apply_model_layout = 'apply_model_layout'
class DevCloudRemoteJobTypeEnum(enum.Enum):
profiling = 'profiling'
calibration = 'calibration'
accuracy = 'accuracy'
class DevCloudAPIVersionEnum(enum.Enum):
v1 = 'v1'
v2 = 'v2'
class BenchmarkAppReportTypesEnum(enum.Enum):
no_counters = 'no_counters'
average_counters = 'average_counters'
class SocketNamespacesEnum(enum.Enum):
accuracy = '/accuracy'
feed = '/feed'
database = '/database'
deployment = '/deployment'
download = '/download'
profiling = '/profiling'
inference = '/inference'
optimization = '/optimization'
upload = '/upload'
log = '/log'
remote_target = '/remote_target'
create_profiling_bundle = '/create_profiling_bundle'
create_int8_calibration_bundle = '/create_int8_calibration_bundle'
export_project_report = '/export_project_report'
export_inference_report = '/export_inference_report'
export_project = '/export_project'
configure_model = '/configure_model'
class SocketEventsEnum(enum.Enum):
connect = 'connect'
accuracy = 'accuracy'
dump = 'dump'
events = 'events'
deployment = 'deployment'
download = 'download'
profiling = 'profiling'
int8 = 'int8'
dataset = 'dataset'
model = 'model'
tokenizer = 'tokenizer'
setup_target = 'setup_target'
ping_target = 'ping_target'
create_profiling_bundle = 'create_profiling_bundle'
create_int8_calibration_bundle = 'create_int8_calibration_bundle'
inference_test_image = 'inference_test_image'
configure_model = 'configure_model'
class SSHAuthStatusCodeEnum(enum.Enum):
SSH_AUTH_ERROR = 7001
INCORRECT_USERNAME = 7002
TIMEOUT = 7003
INCORRECT_HOSTNAME_PORT = 7004
INCORRECT_KEY = 7005
INCORRECT_KEY_CONTENT = 7006
INCORRECT_KEY_NAME = 7007
class SSHAuthStatusMessagesEnum(enum.Enum):
SSH_AUTH_ERROR = 'ssh_auth_error'
INCORRECT_USERNAME = 'incorrect_username'
TIMEOUT = 'timeout'
INCORRECT_HOSTNAME_PORT = 'incorrect_hostname_port'
INCORRECT_KEY = 'incorrect_key'
INCORRECT_KEY_CONTENT = 'incorrect_key_content'
INCORRECT_KEY_NAME = 'incorrect_key_name'
class RemoteSetupStatusMessagesEnum(enum.Enum):
NO_PYTHON = 'no_python'
PYTHON_VERSION_ERROR = 'python_version_error'
OS_VERSION_ERROR = 'os_version_error'
NO_INTERNET_CONNECTION = 'no_internet_connection'
PIP_VERSION_ERROR = 'pip_version_error'
NO_ROOT_WARNING = 'no_root_warning'
NO_SUDO_WARNING = 'no_sudo_warning'
class RemoteSetupStatusCodeEnum(enum.Enum):
PYTHON_VERSION_ERROR = 8001
OS_VERSION_ERROR = 8002
NO_INTERNET_CONNECTION = 8003
PIP_VERSION_ERROR = 8004
NO_PYTHON = 8005
class ModelAnalyzerErrorMessagesEnum(enum.Enum):
DEPRECATED_IR_VERSION = 'deprecated_ir_version'
class CPUPlatformTypeEnum(enum.Enum):
celeron = 'celeron'
atom = 'atom'
pentium = 'pentium'
core = 'core'
xeon = 'xeon'
not_recognized = 'not_recognized'
@classmethod
def _missing_(cls, unused_value: str) -> 'CPUPlatformTypeEnum':
return CPUPlatformTypeEnum.not_recognized
class AcceptableFileSizesMb(enum.Enum):
MODEL = 4500
DATASET = 10000
TOKENIZER = 5000
SSH_KEY = 1
class CeleryTaskSupportedSignal(enum.Enum):
SIGTERM = 'SIGTERM'
SIGKILL = 'SIGKILL'
SIGHUP = 'SIGHUP'
class TestInferVisualizationTypesEnum(enum.Enum):
explain = 'explain'
ref_visualization = 'ref_visualization'
default = 'default'
class AccuracyReportTypeEnum(enum.Enum):
parent_model_per_tensor = 'parent_model_per_tensor'
parent_model_predictions = 'parent_model_predictions'
dataset_annotations = 'dataset_annotations'
class CSVDatasetSeparatorEnum(enum.Enum):
tab = '\t'
comma = ','
semicolon = ';'
colon = ':'
pipe = '|'
class ModelShapeTypeEnum(enum.Enum):
static = 'static'
dynamic = 'dynamic'
class DatumaroModesEnum(enum.Enum):
convert = 'convert'
detect_format = 'detect-format'
class TokenizerTypeEnum(enum.Enum):
wordpiece = 'wordpiece'
BPE = 'BPE'
class OpenVINOWheelsEnum(enum.Enum):
ov_runtime_wheel = 'ov_runtime_wheel'
ov_dev_wheel = 'ov_dev_wheel'
class LayoutDimValuesEnum(enum.Enum):
N = 'N'
C = 'C'
H = 'H'
W = 'W'
D = 'D'
S = 'S'
OTHER = '?'
| [
1,
9995,
13,
4673,
29963,
1177,
29949,
360,
29931,
5244,
1785,
305,
13,
1174,
4680,
1078,
4413,
13,
13,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29900,
18555,
15025,
13,
13,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
418,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
27028,
1090,
278,
19245,
29889,
13,
15945,
29908,
13,
5215,
14115,
13,
3166,
19229,
1053,
12603,
552,
29892,
28379,
13,
13,
13,
1990,
17163,
10562,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
20077,
292,
29918,
1853,
353,
525,
1184,
1777,
292,
11947,
29915,
13,
1678,
2323,
29918,
262,
1659,
29918,
1853,
353,
525,
15771,
797,
1659,
11947,
29915,
13,
13,
1678,
938,
29947,
1052,
26218,
29918,
1853,
353,
525,
2928,
29947,
7856,
26218,
11947,
29915,
13,
13,
1678,
396,
4831,
332,
4135,
13,
1678,
1653,
29918,
562,
2764,
4135,
29918,
16713,
29918,
1853,
353,
525,
4391,
7504,
332,
4135,
4081,
29879,
11947,
29915,
13,
1678,
1653,
29918,
562,
2764,
4135,
29918,
16718,
29918,
1853,
353,
525,
4391,
7504,
332,
4135,
9534,
11947,
29915,
13,
1678,
13600,
29918,
1853,
353,
525,
7504,
332,
4135,
11947,
29915,
13,
1678,
7592,
29918,
562,
2764,
4135,
29918,
1853,
353,
525,
20224,
7504,
332,
4135,
11947,
29915,
13,
13,
1678,
396,
2431,
12489,
3461,
13,
1678,
1653,
29918,
546,
29918,
20158,
29918,
16713,
29918,
1853,
353,
525,
4391,
5894,
29911,
6073,
4081,
29879,
11947,
29915,
13,
1678,
1653,
29918,
546,
29918,
20158,
29918,
16718,
29918,
1853,
353,
525,
4391,
5894,
29911,
6073,
9534,
11947,
29915,
13,
1678,
639,
29918,
20158,
29918,
12276,
29918,
1853,
353,
525,
5894,
29911,
6073,
13020,
11947,
29915,
13,
1678,
7592,
29918,
546,
29918,
20158,
29918,
12276,
29918,
1853,
353,
525,
20224,
5894,
29911,
6073,
13020,
11947,
29915,
13,
13,
1678,
396,
22280,
4831,
332,
4135,
24352,
13,
1678,
1653,
29918,
6735,
403,
29918,
24713,
29918,
16713,
29918,
1853,
353,
525,
4391,
2744,
1333,
403,
16390,
24541,
4081,
29879,
11947,
29915,
13,
1678,
1653,
29918,
6735,
403,
29918,
24713,
29918,
16718,
29918,
1853,
353,
525,
4391,
2744,
1333,
403,
16390,
24541,
9534,
11947,
29915,
13,
1678,
9732,
403,
29918,
24713,
353,
525,
2744,
1333,
403,
16390,
24541,
11947,
29915,
13,
1678,
7592,
29918,
6735,
403,
29918,
24713,
353,
525,
20224,
2744,
1333,
403,
16390,
24541,
11947,
29915,
13,
13,
1678,
6597,
29918,
24713,
29918,
1853,
353,
525,
5647,
1461,
16390,
24541,
11947,
29915,
13,
1678,
6597,
29918,
726,
29918,
24713,
29918,
1853,
353,
525,
5647,
1461,
1626,
16390,
24541,
11947,
29915,
13,
1678,
4480,
29918,
9009,
29918,
24713,
29918,
1853,
353,
525,
15716,
16390,
24541,
17553,
11947,
29915,
13,
1678,
18720,
29918,
24713,
29918,
1853,
353,
525,
23122,
675,
16390,
24541,
11947,
29915,
13,
1678,
3588,
29918,
24713,
29918,
1853,
353,
525,
18455,
16390,
24541,
11947,
29915,
13,
1678,
12725,
29918,
24713,
29918,
1853,
353,
525,
7211,
403,
16390,
24541,
11947,
29915,
13,
1678,
12725,
29918,
726,
29918,
24713,
29918,
1853,
353,
525,
7211,
403,
1626,
16390,
24541,
11947,
29915,
13,
1678,
5706,
29918,
24713,
29918,
1853,
353,
525,
16390,
24541,
21575,
11947,
29915,
13,
1678,
18765,
29918,
24713,
29918,
1853,
353,
525,
16390,
24541,
29909,
688,
358,
362,
11947,
29915,
13,
13,
1678,
27599,
29918,
4299,
29918,
2080,
29918,
12181,
29918,
1853,
353,
525,
2744,
14997,
911,
3195,
4290,
24111,
11947,
29915,
13,
1678,
4480,
29918,
9009,
29918,
4299,
29918,
1853,
353,
525,
15716,
3195,
17553,
11947,
29915,
13,
1678,
1904,
29918,
24209,
3298,
29918,
1853,
353,
525,
3195,
2744,
14997,
3298,
11947,
29915,
13,
1678,
1904,
29918,
20640,
3950,
29918,
1853,
353,
525,
3195,
20624,
326,
3950,
11947,
29915,
13,
1678,
1904,
29918,
20640,
3950,
29918,
16192,
29918,
1853,
353,
525,
3195,
20624,
326,
3950,
29083,
11947,
29915,
13,
1678,
3588,
29918,
3946,
294,
29918,
1853,
353,
525,
18455,
29968,
18464,
11947,
29915,
13,
1678,
2703,
29920,
29918,
4299,
29918,
10382,
29918,
1853,
353,
525,
6488,
29999,
3195,
22954,
11947,
29915,
13,
1678,
2703,
29920,
29918,
4299,
29918,
13441,
29918,
1853,
353,
525,
6488,
29999,
3195,
18455,
11947,
29915,
13,
1678,
2703,
29920,
29918,
4299,
29918,
11631,
29918,
1853,
353,
525,
6488,
29999,
3195,
16619,
11947,
29915,
13,
13,
1678,
5142,
29918,
4299,
29918,
1853,
353,
525,
22954,
3195,
11947,
29915,
13,
1678,
18209,
29918,
12847,
29918,
1853,
353,
525,
8498,
22812,
3260,
11947,
29915,
13,
1678,
5609,
29918,
4836,
29918,
1853,
353,
525,
26382,
7653,
11947,
29915,
13,
13,
1678,
5142,
29918,
1188,
29918,
1853,
353,
525,
22954,
3403,
11947,
29915,
13,
13,
1678,
5609,
29918,
4836,
29918,
12276,
353,
525,
7653,
13020,
26382,
11947,
29915,
13,
13,
1678,
5609,
29918,
262,
1659,
29918,
12276,
353,
525,
797,
1659,
13020,
26382,
11947,
29915,
13,
13,
1678,
1653,
29918,
771,
1777,
292,
29918,
16713,
29918,
1853,
353,
525,
4391,
1184,
1777,
292,
4081,
29879,
11947,
29915,
13,
13,
1678,
4480,
29918,
9009,
29918,
6979,
3950,
29918,
1853,
353,
525,
15716,
6066,
3950,
17553,
11947,
29915,
13,
1678,
12725,
29918,
6979,
3950,
29918,
1853,
353,
525,
7211,
403,
6066,
3950,
11947,
29915,
13,
13,
1678,
396,
298,
688,
3460,
2161,
13,
1678,
1053,
29918,
29882,
688,
3460,
2161,
29918,
4299,
29918,
1853,
353,
525,
17518,
29950,
688,
3460,
2161,
3195,
11947,
29915,
13,
13,
1678,
396,
5240,
866,
20077,
292,
13,
1678,
1653,
29918,
771,
1777,
292,
29918,
16718,
29918,
1853,
353,
525,
4391,
1184,
1777,
292,
9534,
11947,
29915,
13,
1678,
7592,
29918,
771,
1777,
292,
29918,
1853,
353,
525,
20224,
1184,
1777,
292,
11947,
29915,
13,
1678,
7592,
29918,
524,
29947,
29918,
1052,
26218,
29918,
1853,
353,
525,
20224,
2928,
29947,
7856,
26218,
11947,
29915,
13,
13,
1678,
396,
5240,
866,
19578,
29947,
1208,
26218,
13,
1678,
1653,
29918,
524,
29947,
29918,
1052,
26218,
29918,
16713,
29918,
1853,
353,
525,
4391,
2928,
29947,
7856,
26218,
4081,
29879,
11947,
29915,
13,
1678,
1653,
29918,
524,
29947,
29918,
1052,
26218,
29918,
16718,
29918,
1853,
353,
525,
4391,
2928,
29947,
7856,
26218,
9534,
11947,
29915,
13,
13,
1678,
1653,
29918,
14669,
29918,
16718,
29918,
1853,
353,
525,
4391,
26947,
9534,
11947,
29915,
13,
1678,
6441,
29918,
8813,
29918,
517,
29918,
5182,
29918,
1853,
353,
525,
17553,
9986,
7060,
1762,
8667,
11947,
29915,
13,
1678,
6230,
29918,
5182,
29918,
1853,
353,
525,
26947,
8667,
11947,
29915,
13,
13,
1678,
679,
29918,
3359,
1575,
29918,
1853,
353,
525,
2577,
16618,
1575,
11947,
29915,
13,
1678,
679,
29918,
5205,
29918,
13237,
29918,
1853,
353,
525,
2577,
3924,
13770,
11947,
29915,
13,
13,
1678,
396,
9481,
20442,
13,
1678,
7135,
29918,
3359,
29918,
9274,
29918,
9057,
353,
525,
20211,
16618,
20442,
11947,
29915,
13,
1678,
4386,
29918,
3359,
29918,
9274,
29918,
771,
1777,
292,
29918,
578,
9737,
29918,
9057,
353,
525,
13554,
16618,
20442,
1184,
1777,
292,
29903,
1698,
1691,
11947,
29915,
13,
1678,
4386,
29918,
3359,
29918,
9274,
29918,
524,
29947,
29918,
1052,
26218,
29918,
578,
9737,
29918,
9057,
353,
525,
13554,
16618,
20442,
2928,
29947,
7856,
26218,
11947,
29915,
13,
1678,
4386,
29918,
3359,
29918,
9274,
29918,
562,
2764,
4135,
29918,
578,
9737,
29918,
9057,
353,
525,
13554,
16618,
20442,
7504,
332,
4135,
11947,
29915,
13,
1678,
4386,
29918,
3359,
29918,
9274,
29918,
24713,
29918,
18317,
29918,
578,
9737,
29918,
9057,
353,
525,
13554,
16618,
20442,
16390,
24541,
21978,
11947,
29915,
13,
1678,
4386,
29918,
3359,
29918,
9274,
29918,
546,
29918,
20158,
29918,
578,
9737,
29918,
9057,
353,
525,
13554,
16618,
20442,
5894,
29911,
6073,
11947,
29915,
13,
1678,
6088,
29918,
3359,
29918,
9274,
29918,
771,
1777,
292,
29918,
2914,
29918,
9057,
353,
525,
12914,
16618,
20442,
1184,
1777,
292,
3591,
11947,
29915,
13,
1678,
6088,
29918,
3359,
29918,
9274,
29918,
524,
29947,
29918,
1052,
26218,
29918,
2914,
29918,
9057,
353,
525,
12914,
16618,
20442,
2928,
29947,
7856,
26218,
3591,
11947,
29915,
13,
1678,
6088,
29918,
3359,
29918,
9274,
29918,
562,
2764,
4135,
29918,
2914,
29918,
9057,
353,
525,
12914,
16618,
20442,
7504,
332,
4135,
3591,
11947,
29915,
13,
1678,
6088,
29918,
3359,
29918,
9274,
29918,
24713,
29918,
18317,
29918,
2914,
29918,
9057,
353,
525,
12914,
16618,
20442,
16390,
24541,
21978,
3591,
11947,
29915,
13,
1678,
6088,
29918,
3359,
29918,
9274,
29918,
546,
29918,
20158,
29918,
2914,
29918,
9057,
353,
525,
12914,
16618,
20442,
5894,
29911,
6073,
3591,
11947,
29915,
13,
13,
1678,
396,
4831,
332,
4135,
7604,
2133,
13,
1678,
27262,
29918,
1688,
29918,
3027,
29918,
9057,
353,
525,
797,
1659,
3057,
2940,
11947,
29915,
13,
13,
1678,
396,
16738,
13,
1678,
6230,
29918,
20944,
29918,
9057,
353,
525,
26947,
18649,
11947,
29915,
13,
13,
1678,
396,
2538,
14443,
8125,
13,
1678,
620,
14443,
29918,
4299,
353,
525,
1666,
14443,
3195,
11947,
29915,
13,
1678,
1653,
29918,
690,
14443,
29918,
4299,
29918,
16713,
29918,
9057,
353,
525,
4391,
1666,
14443,
3195,
4081,
29879,
11947,
29915,
13,
13,
1678,
396,
2401,
368,
1904,
5912,
13,
1678,
3394,
29918,
4299,
29918,
2680,
353,
525,
2052,
368,
3195,
3453,
11947,
29915,
13,
13,
1678,
396,
897,
17990,
630,
13,
1678,
5401,
468,
3665,
29918,
29873,
1540,
29918,
1853,
353,
525,
17734,
468,
3665,
29911,
1540,
11947,
29915,
13,
13,
13,
1990,
16034,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
712,
6742,
353,
525,
802,
6742,
29915,
13,
1678,
2734,
353,
525,
21094,
29915,
13,
1678,
7960,
353,
525,
2040,
29915,
13,
1678,
1059,
353,
525,
2704,
29915,
13,
1678,
12611,
839,
353,
525,
20713,
839,
29915,
13,
1678,
3190,
2347,
353,
525,
1279,
2347,
29915,
13,
1678,
9177,
353,
525,
27392,
29915,
13,
13,
13,
1990,
8125,
15951,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
25778,
353,
525,
15633,
29915,
13,
1678,
405,
13208,
353,
525,
29940,
13208,
29915,
13,
13,
13,
1990,
17044,
649,
8325,
1170,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
383,
7024,
353,
525,
29943,
7024,
29915,
13,
1678,
317,
7024,
353,
525,
5550,
29903,
29915,
13,
13,
13,
1990,
9330,
4062,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
20670,
1061,
353,
525,
1990,
928,
1061,
29915,
13,
1678,
10035,
353,
525,
19206,
29915,
13,
1678,
269,
4928,
353,
525,
893,
29881,
29915,
13,
1678,
21577,
29918,
29891,
3543,
29918,
29894,
29906,
353,
525,
25649,
29918,
29891,
3543,
29918,
29894,
29906,
29915,
13,
1678,
343,
3543,
29918,
29894,
29906,
353,
525,
29891,
3543,
29918,
29894,
29906,
29915,
13,
1678,
343,
3543,
29918,
29894,
29941,
353,
525,
29891,
3543,
29918,
29894,
29941,
29915,
13,
1678,
343,
3543,
29918,
29894,
29946,
353,
525,
29891,
3543,
29918,
29894,
29946,
29915,
13,
1678,
21577,
29918,
29891,
3543,
29918,
29894,
29941,
29918,
29894,
29946,
353,
525,
25649,
29918,
29891,
3543,
29918,
29894,
29941,
29918,
29894,
29946,
29915,
13,
1678,
11105,
29918,
2214,
15755,
353,
525,
13168,
29918,
2214,
15755,
29915,
13,
1678,
10768,
362,
353,
525,
28192,
362,
29915,
13,
1678,
297,
29886,
475,
1259,
353,
525,
262,
29886,
475,
1259,
29915,
13,
1678,
3114,
29918,
3286,
571,
353,
525,
3293,
29918,
3286,
571,
29915,
13,
1678,
2428,
29918,
9778,
918,
353,
525,
9136,
29918,
9778,
918,
29915,
13,
1678,
3700,
29918,
29423,
654,
353,
525,
2161,
29918,
29423,
654,
29915,
13,
1678,
2982,
3502,
29918,
29881,
2650,
428,
353,
525,
1049,
3502,
29918,
29881,
2650,
428,
29915,
13,
1678,
2888,
353,
525,
6341,
29915,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
756,
29918,
1767,
29898,
25932,
29892,
995,
29901,
851,
29897,
1599,
6120,
29901,
13,
4706,
736,
738,
29898,
1767,
1275,
2944,
29889,
1767,
363,
2944,
297,
1067,
29879,
29897,
13,
13,
13,
1990,
530,
16666,
18545,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
3619,
29918,
12846,
7716,
29918,
28192,
362,
353,
525,
9435,
29918,
12846,
7716,
29918,
28192,
362,
29915,
13,
1678,
2888,
353,
525,
1525,
29984,
3120,
19386,
29915,
13,
1678,
527,
5370,
300,
353,
525,
326,
5370,
300,
29915,
13,
1678,
297,
29886,
475,
1259,
353,
525,
262,
29886,
475,
1259,
29915,
13,
1678,
301,
25051,
353,
525,
29880,
25051,
29915,
13,
1678,
286,
1557,
6235,
29918,
29881,
2650,
428,
353,
525,
1516,
29883,
6235,
29918,
29881,
2650,
428,
29915,
13,
1678,
286,
1557,
6235,
29918,
13168,
29918,
2214,
15755,
353,
525,
1516,
29883,
6235,
29918,
13168,
29918,
2214,
15755,
29915,
13,
1678,
3114,
29918,
3286,
571,
353,
525,
3293,
29918,
3286,
571,
29915,
13,
1678,
2428,
29918,
9778,
918,
353,
525,
9136,
29918,
9778,
918,
29915,
13,
1678,
2428,
29918,
9778,
918,
29918,
3972,
29918,
6707,
353,
525,
9136,
29918,
9778,
918,
29918,
3972,
29918,
6707,
29915,
13,
1678,
325,
1505,
29918,
2161,
353,
525,
29894,
1505,
29918,
2161,
29915,
13,
1678,
7931,
29918,
29881,
2650,
428,
353,
525,
29894,
542,
29918,
29881,
2650,
428,
29915,
13,
1678,
7931,
29918,
28192,
362,
353,
525,
29894,
542,
29918,
28192,
362,
29915,
13,
1678,
25734,
353,
525,
29893,
1241,
29915,
13,
1678,
1722,
29918,
8346,
29918,
29881,
2650,
428,
353,
525,
3150,
29918,
8346,
29918,
29881,
2650,
428,
29915,
13,
1678,
1967,
29918,
19170,
353,
525,
3027,
29918,
19170,
29915,
13,
13,
13,
1990,
612,
3543,
24458,
19832,
29879,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
343,
3543,
29918,
29894,
29941,
353,
5519,
29953,
29892,
29871,
29955,
29892,
29871,
29947,
1402,
518,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
1402,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
5262,
13,
1678,
343,
3543,
29918,
29894,
29946,
353,
5519,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
1402,
518,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
1402,
518,
29953,
29892,
29871,
29955,
29892,
29871,
29947,
5262,
13,
1678,
21577,
29918,
29891,
3543,
29918,
29894,
29941,
29918,
29894,
29946,
353,
5519,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
1402,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
5262,
13,
13,
13,
1990,
20693,
326,
2133,
10562,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
27262,
353,
17163,
10562,
16854,
29889,
771,
1777,
292,
29918,
1853,
29889,
1767,
13,
1678,
938,
29947,
1052,
26218,
353,
17163,
10562,
16854,
29889,
524,
29947,
1052,
26218,
29918,
1853,
29889,
1767,
13,
1678,
396,
897,
17990,
630,
13,
1678,
5401,
468,
3665,
29918,
29873,
1540,
353,
17163,
10562,
16854,
29889,
5080,
468,
3665,
29918,
29873,
1540,
29918,
1853,
29889,
1767,
13,
13,
13,
1990,
18601,
287,
4308,
13129,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
1722,
29894,
1789,
353,
525,
3150,
29894,
1789,
29915,
13,
1678,
274,
3470,
29872,
353,
525,
1113,
17615,
29915,
13,
1678,
274,
3470,
29872,
29906,
353,
525,
1113,
17615,
29906,
29915,
13,
1678,
286,
29916,
1212,
353,
525,
16838,
1212,
29915,
13,
1678,
373,
23818,
353,
525,
3409,
29916,
29915,
13,
1678,
282,
3637,
25350,
353,
525,
2272,
7345,
305,
29915,
13,
1678,
15886,
353,
525,
13264,
29915,
13,
1678,
15886,
29906,
353,
525,
13264,
29906,
29915,
13,
1678,
15886,
29906,
29918,
3946,
294,
353,
525,
13264,
29906,
29918,
3946,
294,
29915,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
679,
29918,
978,
29898,
25932,
29892,
1820,
29901,
851,
29897,
1599,
28379,
29961,
710,
5387,
13,
4706,
903,
4468,
29879,
29918,
7039,
353,
426,
13,
9651,
1067,
29879,
29889,
3150,
29894,
1789,
29889,
1767,
29901,
525,
6585,
29963,
1177,
29949,
23292,
742,
13,
9651,
1067,
29879,
29889,
1113,
17615,
29889,
1767,
29901,
525,
29907,
3470,
29872,
742,
13,
9651,
1067,
29879,
29889,
1113,
17615,
29906,
29889,
1767,
29901,
525,
29907,
3470,
29872,
29906,
742,
13,
9651,
1067,
29879,
29889,
16838,
1212,
29889,
1767,
29901,
525,
29924,
29990,
6779,
742,
13,
9651,
1067,
29879,
29889,
3409,
29916,
29889,
1767,
29901,
525,
1164,
29940,
29990,
742,
13,
9651,
1067,
29879,
29889,
2272,
7345,
305,
29889,
1767,
29901,
525,
19737,
29911,
25350,
742,
13,
9651,
1067,
29879,
29889,
13264,
29889,
1767,
29901,
525,
29911,
6073,
17907,
742,
13,
9651,
1067,
29879,
29889,
13264,
29906,
29889,
1767,
29901,
525,
29911,
6073,
17907,
29871,
29906,
29889,
29900,
742,
13,
9651,
1067,
29879,
29889,
13264,
29906,
29918,
3946,
294,
29889,
1767,
29901,
525,
29911,
6073,
17907,
29871,
29906,
29889,
29900,
12693,
294,
742,
13,
4706,
500,
13,
4706,
736,
903,
4468,
29879,
29918,
7039,
29889,
657,
29898,
1989,
29897,
13,
13,
13,
1990,
323,
29943,
29906,
10547,
15506,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
13023,
294,
353,
525,
3946,
294,
3195,
29915,
13,
1678,
7160,
29918,
4299,
29918,
3972,
353,
525,
17314,
3195,
9170,
29915,
13,
13,
13,
1990,
12782,
2283,
8659,
29898,
18605,
29889,
16854,
1125,
13,
1678,
15886,
29918,
13096,
5570,
29918,
2917,
353,
525,
13096,
5570,
29889,
2917,
29915,
13,
1678,
29304,
29918,
2917,
353,
525,
9067,
800,
29918,
2917,
29889,
3126,
29915,
13,
13,
13,
1990,
8125,
29925,
3757,
2459,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
285,
29886,
29941,
29906,
353,
525,
26353,
29941,
29906,
29915,
13,
1678,
285,
29886,
29896,
29953,
353,
525,
26353,
29896,
29953,
29915,
13,
1678,
474,
29947,
353,
525,
10192,
29947,
29915,
13,
1678,
474,
29896,
353,
525,
10192,
29896,
29915,
13,
1678,
12849,
353,
525,
29924,
6415,
3352,
29915,
13,
1678,
9815,
353,
525,
3904,
29968,
6632,
16048,
29915,
13,
13,
13,
1990,
8125,
3306,
1451,
12629,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
390,
7210,
353,
525,
28212,
29915,
13,
1678,
350,
14345,
353,
525,
29933,
14345,
29915,
13,
1678,
18956,
7052,
353,
525,
29954,
764,
7052,
29915,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1819,
580,
1599,
731,
29901,
13,
4706,
736,
731,
29898,
667,
29889,
1767,
363,
2944,
297,
8125,
3306,
1451,
12629,
16854,
29897,
13,
13,
13,
1990,
3012,
7060,
10562,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
1904,
353,
525,
4299,
29915,
13,
1678,
2060,
353,
525,
4836,
29915,
13,
1678,
2060,
29918,
12276,
353,
525,
4836,
29918,
12276,
29915,
13,
1678,
27262,
29918,
12276,
353,
525,
262,
1659,
29918,
12276,
29915,
13,
1678,
18209,
29918,
5113,
353,
525,
16519,
358,
29918,
5113,
29915,
13,
1678,
11846,
29918,
5113,
353,
525,
16718,
29918,
5113,
29915,
13,
1678,
1480,
353,
525,
1188,
29915,
13,
1678,
4982,
29918,
16718,
353,
525,
9057,
29918,
16718,
29915,
13,
1678,
7592,
29918,
9057,
29918,
2914,
353,
525,
16674,
29918,
9057,
29918,
2914,
29915,
13,
13,
13,
1990,
22746,
2133,
22461,
4540,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
2322,
353,
525,
4592,
22930,
2133,
29915,
13,
1678,
13600,
29918,
28327,
353,
525,
7504,
332,
4135,
29909,
2519,
22930,
2133,
29915,
13,
13,
13,
1990,
22746,
2133,
22461,
4540,
29925,
12071,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
4180,
353,
525,
546,
13390,
29915,
13,
1678,
12849,
353,
525,
29885,
11925,
29915,
13,
13,
13,
1990,
8125,
4435,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
2703,
29920,
353,
525,
290,
29920,
29915,
13,
1678,
2441,
353,
525,
13492,
29915,
13,
1678,
3805,
353,
525,
381,
29915,
13,
1678,
298,
688,
3460,
2161,
353,
525,
29882,
688,
3460,
2161,
29915,
13,
13,
13,
1990,
17157,
29949,
1660,
1949,
29898,
18605,
29889,
16854,
1125,
13,
1678,
16338,
29896,
29947,
353,
525,
8767,
29896,
29947,
29915,
13,
1678,
16338,
29906,
29900,
353,
525,
8767,
29906,
29900,
29915,
13,
1678,
5417,
353,
525,
10499,
29915,
13,
1678,
5825,
353,
525,
8628,
29915,
13,
13,
13,
1990,
10034,
22812,
8667,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
26403,
353,
525,
6271,
29965,
29915,
13,
1678,
330,
3746,
353,
525,
29954,
7056,
29915,
13,
1678,
590,
374,
328,
353,
525,
29963,
7056,
29915,
13,
1678,
298,
1289,
29880,
353,
525,
29950,
7858,
29931,
29915,
13,
1678,
1722,
11023,
353,
525,
3150,
11023,
29915,
13,
1678,
3017,
29941,
29953,
353,
525,
4691,
29941,
29889,
29953,
29915,
13,
1678,
3017,
29941,
29955,
353,
525,
4691,
29941,
29889,
29955,
29915,
13,
1678,
3017,
29941,
29947,
353,
525,
4691,
29941,
29889,
29947,
29915,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1819,
580,
1599,
731,
29901,
13,
4706,
736,
731,
29898,
667,
29889,
1767,
363,
2944,
297,
10034,
22812,
8667,
16854,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1653,
29898,
1767,
29901,
851,
29897,
1599,
525,
8498,
22812,
8667,
16854,
2396,
13,
4706,
736,
10034,
22812,
8667,
16854,
29889,
1357,
374,
328,
565,
10034,
22812,
8667,
16854,
29889,
275,
29918,
1357,
374,
328,
29898,
1767,
29897,
1683,
10034,
22812,
8667,
16854,
29898,
1767,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
679,
29918,
4691,
29918,
5182,
29879,
580,
1599,
12603,
552,
29961,
710,
29892,
2023,
5387,
13,
4706,
3017,
29918,
5182,
29879,
353,
313,
8498,
22812,
8667,
16854,
29889,
4691,
29941,
29953,
29892,
10034,
22812,
8667,
16854,
29889,
4691,
29941,
29955,
29892,
10034,
22812,
8667,
16854,
29889,
4691,
29941,
29947,
29897,
13,
4706,
736,
18761,
29898,
4691,
29918,
5182,
29889,
1767,
363,
3017,
29918,
5182,
297,
3017,
29918,
5182,
29879,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
338,
29918,
1357,
374,
328,
29898,
10141,
29918,
978,
29901,
851,
29897,
1599,
6120,
29901,
13,
4706,
736,
4742,
29918,
978,
1275,
525,
17870,
3960,
3035,
29915,
13,
13,
13,
1990,
10034,
22812,
14459,
29903,
7093,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
19282,
353,
29871,
29906,
29946,
13,
1678,
26403,
353,
29871,
29941,
29896,
29889,
29906,
13,
1678,
330,
3746,
353,
29871,
29896,
29953,
29889,
29900,
29929,
13,
1678,
590,
374,
328,
353,
29871,
29896,
29889,
29947,
13,
1678,
298,
1289,
29880,
353,
29871,
29946,
29889,
29947,
13,
1678,
3017,
353,
29871,
29906,
29946,
13,
1678,
2601,
29918,
2154,
353,
29871,
29900,
29889,
29900,
29900,
29941,
29906,
13,
1678,
330,
3746,
29918,
24477,
874,
353,
29871,
29900,
29889,
29900,
29896,
29906,
13,
1678,
590,
374,
328,
29918,
24477,
874,
353,
29871,
29900,
29889,
29900,
29900,
29896,
29941,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
4390,
7295,
13,
4706,
736,
426,
13,
9651,
525,
8673,
29918,
3217,
7428,
1164,
2396,
10034,
22812,
14459,
29903,
7093,
16854,
29889,
347,
29889,
1767,
29892,
13,
9651,
525,
29911,
1718,
7194,
29903,
2396,
426,
13,
18884,
525,
6271,
29965,
2396,
10034,
22812,
14459,
29903,
7093,
16854,
29889,
21970,
29889,
1767,
29892,
13,
18884,
525,
29954,
7056,
2396,
10034,
22812,
14459,
29903,
7093,
16854,
29889,
29887,
3746,
29889,
1767,
29892,
13,
18884,
525,
17870,
3960,
3035,
2396,
10034,
22812,
14459,
29903,
7093,
16854,
29889,
1357,
374,
328,
29889,
1767,
29892,
13,
18884,
525,
29950,
7858,
29931,
2396,
10034,
22812,
14459,
29903,
7093,
16854,
29889,
29882,
1289,
29880,
29889,
1767,
29892,
13,
9651,
2981,
13,
9651,
525,
29928,
3960,
5348,
29903,
2396,
426,
13,
18884,
525,
6271,
29965,
2396,
29871,
29900,
29892,
13,
18884,
525,
29954,
7056,
2396,
10034,
22812,
14459,
29903,
7093,
16854,
29889,
29887,
3746,
29918,
24477,
874,
29889,
1767,
29892,
13,
18884,
525,
17870,
3960,
3035,
2396,
10034,
22812,
14459,
29903,
7093,
16854,
29889,
1357,
374,
328,
29918,
24477,
874,
29889,
1767,
29892,
13,
18884,
525,
29950,
7858,
29931,
2396,
29871,
29900,
29892,
13,
9651,
2981,
13,
9651,
525,
20055,
4690,
1164,
2396,
10034,
22812,
14459,
29903,
7093,
16854,
29889,
4691,
29889,
1767,
29892,
13,
9651,
525,
25580,
9818,
29918,
7187,
24290,
2396,
10034,
22812,
14459,
29903,
7093,
16854,
29889,
6252,
29918,
2154,
29889,
1767,
13,
4706,
500,
13,
13,
13,
27047,
29918,
29829,
1955,
11937,
353,
426,
13,
1678,
16034,
16854,
29889,
802,
6742,
29901,
29871,
29900,
29892,
13,
1678,
16034,
16854,
29889,
2040,
29901,
29871,
29896,
29892,
13,
1678,
16034,
16854,
29889,
21094,
29901,
29871,
29906,
29892,
13,
1678,
16034,
16854,
29889,
20713,
839,
29901,
29871,
29941,
29892,
13,
1678,
16034,
16854,
29889,
2704,
29901,
29871,
29946,
13,
29913,
13,
13,
13,
1990,
21830,
1542,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
10808,
353,
525,
6271,
29965,
29915,
13,
1678,
22796,
353,
525,
29954,
7056,
29915,
13,
1678,
19519,
3960,
3035,
353,
525,
17870,
3960,
3035,
29915,
13,
1678,
379,
7858,
29931,
353,
525,
29950,
7858,
29931,
29915,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
338,
29918,
23765,
29898,
10141,
29901,
851,
29897,
1599,
6120,
29901,
13,
4706,
736,
4742,
297,
21830,
1542,
16854,
29889,
5975,
580,
470,
21830,
1542,
16854,
29889,
275,
29918,
1357,
374,
328,
29898,
10141,
29897,
470,
21830,
1542,
16854,
29889,
275,
29918,
29887,
3746,
29898,
10141,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1819,
580,
1599,
731,
29901,
13,
4706,
736,
731,
29898,
667,
29889,
1767,
363,
2944,
297,
21830,
1542,
16854,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
338,
29918,
1357,
374,
328,
29898,
10141,
29918,
978,
29901,
851,
29897,
1599,
6120,
29901,
13,
4706,
736,
21830,
1542,
16854,
29889,
17870,
3960,
3035,
29889,
1767,
297,
4742,
29918,
978,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
338,
29918,
29887,
3746,
29898,
10141,
29918,
978,
29901,
851,
29897,
1599,
6120,
29901,
13,
4706,
736,
21830,
1542,
16854,
29889,
29954,
7056,
29889,
1767,
297,
4742,
29918,
978,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
338,
29918,
29882,
1289,
29880,
29898,
10141,
29918,
978,
29901,
851,
29897,
1599,
6120,
29901,
13,
4706,
736,
21830,
1542,
16854,
29889,
29950,
7858,
29931,
29889,
1767,
1275,
4742,
29918,
978,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
338,
29918,
29894,
3746,
29898,
10141,
29918,
978,
29901,
851,
29897,
1599,
6120,
29901,
13,
4706,
736,
21830,
1542,
16854,
29889,
275,
29918,
1357,
374,
328,
29898,
10141,
29918,
978,
29897,
470,
21830,
1542,
16854,
29889,
275,
29918,
29882,
1289,
29880,
29898,
10141,
29918,
978,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
679,
29918,
10141,
29898,
10141,
29901,
851,
29897,
1599,
851,
29901,
13,
4706,
565,
21830,
1542,
16854,
29889,
275,
29918,
1357,
374,
328,
29898,
10141,
1125,
13,
9651,
736,
21830,
1542,
16854,
29889,
17870,
3960,
3035,
29889,
1767,
13,
4706,
565,
21830,
1542,
16854,
29889,
275,
29918,
29887,
3746,
29898,
10141,
1125,
13,
9651,
736,
21830,
1542,
16854,
29889,
29954,
7056,
29889,
1767,
13,
4706,
736,
4742,
13,
13,
13,
1990,
17157,
1542,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
1887,
353,
525,
2997,
29915,
13,
1678,
7592,
353,
525,
16674,
29915,
13,
1678,
2906,
29918,
9274,
353,
525,
3359,
29918,
9274,
29915,
13,
13,
13,
1990,
17157,
5709,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
3625,
353,
525,
16515,
29915,
13,
1678,
2295,
3864,
353,
525,
2917,
3864,
29915,
13,
1678,
16791,
353,
525,
6915,
292,
29915,
13,
1678,
5285,
29918,
14057,
545,
353,
525,
13305,
29918,
14057,
545,
29915,
13,
1678,
3957,
29918,
14057,
545,
353,
525,
9965,
29918,
14057,
545,
29915,
13,
1678,
451,
29918,
2917,
2955,
353,
525,
1333,
29918,
2917,
2955,
29915,
13,
1678,
19587,
353,
525,
8262,
29891,
29915,
13,
13,
13,
1990,
349,
23828,
1542,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
7592,
29918,
771,
1777,
292,
353,
525,
16674,
29918,
771,
1777,
292,
29915,
13,
1678,
1887,
29918,
771,
1777,
292,
353,
525,
2997,
29918,
771,
1777,
292,
29915,
13,
1678,
2906,
29918,
9274,
29918,
771,
1777,
292,
353,
525,
3359,
29918,
9274,
29918,
771,
1777,
292,
29915,
13,
1678,
1887,
29918,
524,
29947,
29918,
1052,
26218,
353,
525,
2997,
29918,
524,
29947,
29918,
1052,
26218,
29915,
13,
1678,
7592,
29918,
524,
29947,
29918,
1052,
26218,
353,
525,
16674,
29918,
524,
29947,
29918,
1052,
26218,
29915,
13,
1678,
2906,
29918,
9274,
29918,
524,
29947,
29918,
1052,
26218,
353,
525,
3359,
29918,
9274,
29918,
524,
29947,
29918,
1052,
26218,
29915,
13,
1678,
1653,
29918,
771,
1777,
292,
29918,
16718,
353,
525,
3258,
29918,
771,
1777,
292,
29918,
16718,
29915,
13,
1678,
5142,
29918,
1188,
353,
525,
10382,
29918,
1188,
29915,
13,
1678,
5142,
29918,
4299,
353,
525,
10382,
29918,
4299,
29915,
13,
1678,
18209,
29918,
12847,
353,
525,
16519,
358,
29918,
12847,
29915,
13,
1678,
5609,
29918,
4836,
353,
525,
15843,
29918,
4836,
29915,
13,
1678,
6230,
353,
525,
14669,
29915,
13,
1678,
24543,
353,
525,
15702,
29915,
13,
1678,
27262,
29918,
1688,
29918,
3027,
353,
525,
262,
1659,
29918,
1688,
29918,
3027,
29915,
13,
1678,
6441,
29918,
24713,
353,
525,
9009,
29918,
24713,
29915,
13,
1678,
6441,
29918,
4299,
353,
525,
9009,
29918,
4299,
29915,
13,
1678,
6441,
29918,
6979,
3950,
353,
525,
9009,
29918,
6979,
3950,
29915,
13,
1678,
5142,
29918,
290,
29920,
29918,
4299,
353,
525,
10382,
29918,
290,
29920,
29918,
4299,
29915,
13,
1678,
5609,
29918,
4836,
29918,
12276,
353,
525,
15843,
29918,
4836,
29918,
12276,
29915,
13,
1678,
5609,
29918,
262,
1659,
29918,
12276,
353,
525,
15843,
29918,
262,
1659,
29918,
12276,
29915,
13,
13,
1678,
1887,
29918,
562,
2764,
4135,
353,
525,
2997,
29918,
562,
2764,
4135,
29915,
13,
1678,
7592,
29918,
562,
2764,
4135,
353,
525,
16674,
29918,
562,
2764,
4135,
29915,
13,
1678,
2906,
29918,
9274,
29918,
562,
2764,
4135,
353,
525,
3359,
29918,
9274,
29918,
562,
2764,
4135,
29915,
13,
13,
1678,
1887,
29918,
546,
29918,
20158,
29918,
12276,
353,
525,
2997,
29918,
546,
29918,
20158,
29918,
12276,
29915,
13,
1678,
7592,
29918,
546,
29918,
20158,
29918,
12276,
353,
525,
16674,
29918,
546,
29918,
20158,
29918,
12276,
29915,
13,
1678,
2906,
29918,
9274,
29918,
546,
29918,
20158,
29918,
12276,
353,
525,
3359,
29918,
9274,
29918,
546,
29918,
20158,
29918,
12276,
29915,
13,
13,
1678,
1887,
29918,
27711,
1080,
29918,
22925,
29918,
562,
2764,
4135,
29918,
12276,
353,
525,
2997,
29918,
27711,
1080,
29918,
22925,
29918,
562,
2764,
4135,
29918,
12276,
29915,
13,
1678,
7592,
29918,
27711,
1080,
29918,
22925,
29918,
562,
2764,
4135,
29918,
12276,
353,
525,
16674,
29918,
27711,
1080,
29918,
22925,
29918,
562,
2764,
4135,
29918,
12276,
29915,
13,
1678,
2906,
29918,
9274,
29918,
27711,
1080,
29918,
22925,
29918,
562,
2764,
4135,
29918,
12276,
353,
525,
3359,
29918,
9274,
29918,
27711,
1080,
29918,
22925,
29918,
562,
2764,
4135,
29918,
12276,
29915,
13,
13,
1678,
10822,
29918,
4299,
353,
525,
17591,
29918,
4299,
29915,
13,
13,
13,
1990,
349,
23828,
27276,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
13600,
353,
525,
562,
2764,
4135,
29915,
13,
1678,
396,
3789,
786,
349,
23828,
22950,
13,
1678,
10223,
292,
29918,
14669,
29918,
16596,
353,
525,
1457,
862,
292,
29918,
14669,
29918,
16596,
29915,
13,
1678,
6441,
292,
29918,
14669,
29918,
16596,
353,
525,
9009,
292,
29918,
14669,
29918,
16596,
29915,
13,
1678,
2295,
3864,
29918,
20944,
353,
525,
2917,
3864,
29918,
20944,
29915,
13,
1678,
396,
349,
292,
349,
23828,
22950,
13,
1678,
6314,
292,
29918,
16515,
29918,
3359,
1575,
353,
525,
15914,
292,
29918,
16515,
29918,
3359,
1575,
29915,
13,
1678,
6314,
292,
29918,
5205,
29918,
19678,
353,
525,
15914,
292,
29918,
5205,
29918,
19678,
29915,
13,
1678,
396,
5240,
866,
20802,
349,
23828,
22950,
13,
1678,
10223,
292,
29918,
771,
1777,
292,
29918,
16596,
353,
525,
1457,
862,
292,
29918,
771,
1777,
292,
29918,
16596,
29915,
13,
1678,
10223,
292,
29918,
524,
29947,
29918,
1052,
26218,
29918,
16596,
353,
525,
1457,
862,
292,
29918,
524,
29947,
29918,
1052,
26218,
29918,
16596,
29915,
13,
1678,
10223,
292,
29918,
562,
2764,
4135,
29918,
16596,
353,
525,
1457,
862,
292,
29918,
562,
2764,
4135,
29918,
16596,
29915,
13,
1678,
20077,
292,
353,
525,
771,
1777,
292,
29915,
13,
1678,
2805,
29918,
16674,
29918,
9057,
29918,
2914,
353,
525,
29264,
29918,
16674,
29918,
9057,
29918,
2914,
29915,
13,
1678,
396,
25553,
4522,
7408,
13,
1678,
5142,
29918,
1188,
353,
525,
10382,
29918,
1188,
29915,
13,
1678,
396,
3159,
29947,
1208,
26218,
13,
1678,
938,
29947,
29918,
1052,
26218,
353,
525,
524,
29947,
29918,
1052,
26218,
29915,
13,
1678,
7592,
29918,
524,
29947,
29918,
1052,
26218,
353,
525,
16674,
29918,
524,
29947,
29918,
1052,
26218,
29915,
13,
1678,
396,
13373,
24541,
13,
1678,
18765,
29918,
24713,
353,
525,
2987,
358,
29918,
24713,
29915,
13,
1678,
3588,
29918,
24713,
353,
525,
13441,
29918,
24713,
29915,
13,
1678,
6597,
29918,
24713,
353,
525,
21111,
29918,
24713,
29915,
13,
1678,
6597,
29918,
726,
29918,
24713,
353,
525,
21111,
29918,
726,
29918,
24713,
29915,
13,
1678,
18720,
29918,
24713,
353,
525,
29423,
675,
29918,
24713,
29915,
13,
1678,
12725,
29918,
24713,
353,
525,
15480,
29918,
24713,
29915,
13,
1678,
12725,
29918,
726,
29918,
24713,
353,
525,
15480,
29918,
726,
29918,
24713,
29915,
13,
1678,
4480,
29918,
24713,
29918,
9009,
353,
525,
10685,
29918,
24713,
29918,
9009,
29915,
13,
1678,
396,
1222,
637,
13969,
22950,
13,
1678,
5609,
29918,
4836,
29918,
12276,
353,
525,
15843,
29918,
4836,
29918,
12276,
29915,
13,
1678,
5609,
29918,
262,
1659,
29918,
12276,
353,
525,
15843,
29918,
262,
1659,
29918,
12276,
29915,
13,
1678,
396,
25159,
3950,
13,
1678,
4480,
29918,
6979,
3950,
29918,
9009,
353,
525,
10685,
29918,
6979,
3950,
29918,
9009,
29915,
13,
1678,
12725,
29918,
6979,
3950,
353,
525,
15480,
29918,
6979,
3950,
29915,
13,
1678,
396,
8125,
13,
1678,
4480,
29918,
4299,
29918,
9009,
353,
525,
10685,
29918,
4299,
29918,
9009,
29915,
13,
1678,
1904,
29918,
24209,
3298,
353,
525,
4299,
29918,
24209,
3298,
29915,
13,
1678,
1904,
29918,
20640,
3950,
29918,
16192,
353,
525,
4299,
29918,
20640,
3950,
29918,
16192,
29915,
13,
1678,
3588,
29918,
3946,
294,
29918,
4299,
353,
525,
13441,
29918,
3946,
294,
29918,
4299,
29915,
13,
1678,
3588,
29918,
4299,
353,
525,
13441,
29918,
4299,
29915,
13,
1678,
6230,
29918,
20944,
353,
525,
14669,
29918,
20944,
29915,
13,
13,
1678,
396,
379,
688,
3460,
2161,
13,
1678,
1053,
29918,
29882,
688,
3460,
2161,
29918,
4299,
353,
525,
5215,
29918,
29882,
688,
3460,
2161,
29918,
4299,
742,
13,
13,
1678,
396,
8125,
9943,
12657,
13,
1678,
5142,
29918,
290,
29920,
29918,
4299,
353,
525,
10382,
29918,
290,
29920,
29918,
4299,
29915,
13,
1678,
3588,
29918,
290,
29920,
29918,
4299,
353,
525,
13441,
29918,
290,
29920,
29918,
4299,
29915,
13,
1678,
4337,
29918,
290,
29920,
29918,
4299,
353,
525,
11631,
29918,
290,
29920,
29918,
4299,
29915,
13,
13,
1678,
27262,
29918,
1688,
29918,
3027,
353,
525,
262,
1659,
29918,
1688,
29918,
3027,
29915,
13,
1678,
5609,
29918,
4836,
353,
525,
15843,
29918,
4836,
29915,
13,
13,
1678,
10223,
292,
29918,
690,
14443,
29918,
4299,
29918,
16596,
353,
525,
1457,
862,
292,
29918,
690,
14443,
29918,
4299,
29918,
16596,
29915,
13,
1678,
620,
14443,
29918,
4299,
353,
525,
690,
14443,
29918,
4299,
29915,
13,
1678,
3394,
29918,
4299,
29918,
2680,
353,
525,
7302,
29918,
4299,
29918,
2680,
29915,
13,
13,
13,
1990,
9481,
20442,
20224,
11947,
1542,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
20077,
292,
353,
525,
771,
1777,
292,
29915,
13,
1678,
1208,
26218,
353,
525,
1052,
26218,
29915,
13,
1678,
13600,
353,
525,
562,
2764,
4135,
29915,
13,
13,
13,
1990,
9481,
20442,
8787,
6594,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
325,
29896,
353,
525,
29894,
29896,
29915,
13,
1678,
325,
29906,
353,
525,
29894,
29906,
29915,
13,
13,
13,
1990,
4111,
16580,
2052,
13020,
10562,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
694,
29918,
29883,
1309,
2153,
353,
525,
1217,
29918,
29883,
1309,
2153,
29915,
13,
1678,
6588,
29918,
29883,
1309,
2153,
353,
525,
12483,
482,
29918,
29883,
1309,
2153,
29915,
13,
13,
13,
1990,
29141,
8659,
22459,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
13600,
353,
8207,
562,
2764,
4135,
29915,
13,
1678,
8343,
353,
8207,
18798,
29915,
13,
1678,
2566,
353,
8207,
9803,
29915,
13,
1678,
18209,
353,
8207,
16519,
358,
29915,
13,
1678,
5142,
353,
8207,
10382,
29915,
13,
1678,
20077,
292,
353,
8207,
771,
1777,
292,
29915,
13,
1678,
27262,
353,
8207,
262,
1659,
29915,
13,
1678,
13883,
353,
8207,
20640,
2133,
29915,
13,
1678,
6441,
353,
8207,
9009,
29915,
13,
1678,
1480,
353,
8207,
1188,
29915,
13,
1678,
7592,
29918,
5182,
353,
8207,
16674,
29918,
5182,
29915,
13,
1678,
1653,
29918,
771,
1777,
292,
29918,
16718,
353,
8207,
3258,
29918,
771,
1777,
292,
29918,
16718,
29915,
13,
1678,
1653,
29918,
524,
29947,
29918,
1052,
26218,
29918,
16718,
353,
8207,
3258,
29918,
524,
29947,
29918,
1052,
26218,
29918,
16718,
29915,
13,
1678,
5609,
29918,
4836,
29918,
12276,
353,
8207,
15843,
29918,
4836,
29918,
12276,
29915,
13,
1678,
5609,
29918,
262,
1659,
29918,
12276,
353,
8207,
15843,
29918,
262,
1659,
29918,
12276,
29915,
13,
1678,
5609,
29918,
4836,
353,
8207,
15843,
29918,
4836,
29915,
13,
1678,
10822,
29918,
4299,
353,
8207,
17591,
29918,
4299,
29915,
13,
13,
13,
1990,
29141,
13634,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
4511,
353,
525,
6915,
29915,
13,
1678,
13600,
353,
525,
562,
2764,
4135,
29915,
13,
1678,
16766,
353,
525,
15070,
29915,
13,
1678,
4959,
353,
525,
13604,
29915,
13,
1678,
18209,
353,
525,
16519,
358,
29915,
13,
1678,
5142,
353,
525,
10382,
29915,
13,
1678,
20077,
292,
353,
525,
771,
1777,
292,
29915,
13,
1678,
938,
29947,
353,
525,
524,
29947,
29915,
13,
1678,
8783,
353,
525,
24713,
29915,
13,
1678,
1904,
353,
525,
4299,
29915,
13,
1678,
5993,
3950,
353,
525,
6979,
3950,
29915,
13,
1678,
6230,
29918,
5182,
353,
525,
14669,
29918,
5182,
29915,
13,
1678,
24543,
29918,
5182,
353,
525,
15702,
29918,
5182,
29915,
13,
1678,
1653,
29918,
771,
1777,
292,
29918,
16718,
353,
525,
3258,
29918,
771,
1777,
292,
29918,
16718,
29915,
13,
1678,
1653,
29918,
524,
29947,
29918,
1052,
26218,
29918,
16718,
353,
525,
3258,
29918,
524,
29947,
29918,
1052,
26218,
29918,
16718,
29915,
13,
1678,
27262,
29918,
1688,
29918,
3027,
353,
525,
262,
1659,
29918,
1688,
29918,
3027,
29915,
13,
1678,
10822,
29918,
4299,
353,
525,
17591,
29918,
4299,
29915,
13,
13,
13,
1990,
22343,
6444,
5709,
3399,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
22343,
29918,
20656,
29950,
29918,
11432,
353,
29871,
29955,
29900,
29900,
29896,
13,
1678,
2672,
29907,
1955,
26282,
29918,
11889,
5813,
353,
29871,
29955,
29900,
29900,
29906,
13,
1678,
323,
8890,
12015,
353,
29871,
29955,
29900,
29900,
29941,
13,
1678,
2672,
29907,
1955,
26282,
29918,
20832,
5813,
29918,
15082,
353,
29871,
29955,
29900,
29900,
29946,
13,
1678,
2672,
29907,
1955,
26282,
29918,
10818,
353,
29871,
29955,
29900,
29900,
29945,
13,
1678,
2672,
29907,
1955,
26282,
29918,
10818,
29918,
22412,
3919,
353,
29871,
29955,
29900,
29900,
29953,
13,
1678,
2672,
29907,
1955,
26282,
29918,
10818,
29918,
5813,
353,
29871,
29955,
29900,
29900,
29955,
13,
13,
13,
1990,
22343,
6444,
5709,
25510,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
22343,
29918,
20656,
29950,
29918,
11432,
353,
525,
15269,
29918,
5150,
29918,
2704,
29915,
13,
1678,
2672,
29907,
1955,
26282,
29918,
11889,
5813,
353,
525,
262,
15728,
29918,
6786,
29915,
13,
1678,
323,
8890,
12015,
353,
525,
15619,
29915,
13,
1678,
2672,
29907,
1955,
26282,
29918,
20832,
5813,
29918,
15082,
353,
525,
262,
15728,
29918,
28988,
29918,
637,
29915,
13,
1678,
2672,
29907,
1955,
26282,
29918,
10818,
353,
525,
262,
15728,
29918,
1989,
29915,
13,
1678,
2672,
29907,
1955,
26282,
29918,
10818,
29918,
22412,
3919,
353,
525,
262,
15728,
29918,
1989,
29918,
3051,
29915,
13,
1678,
2672,
29907,
1955,
26282,
29918,
10818,
29918,
5813,
353,
525,
262,
15728,
29918,
1989,
29918,
978,
29915,
13,
13,
13,
1990,
5240,
866,
26947,
5709,
25510,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
11698,
29918,
20055,
4690,
1164,
353,
525,
1217,
29918,
4691,
29915,
13,
1678,
349,
29979,
4690,
1164,
29918,
16358,
29918,
11432,
353,
525,
4691,
29918,
3259,
29918,
2704,
29915,
13,
1678,
6570,
29918,
16358,
29918,
11432,
353,
525,
359,
29918,
3259,
29918,
2704,
29915,
13,
1678,
11698,
29918,
23845,
6006,
29918,
6007,
8186,
9838,
353,
525,
1217,
29918,
14168,
300,
29918,
9965,
29915,
13,
1678,
349,
5690,
29918,
16358,
29918,
11432,
353,
525,
13096,
29918,
3259,
29918,
2704,
29915,
13,
1678,
11698,
29918,
21289,
29918,
29956,
25614,
353,
525,
1217,
29918,
4632,
29918,
27392,
29915,
13,
1678,
11698,
29918,
14605,
3970,
29918,
29956,
25614,
353,
525,
1217,
29918,
15360,
29918,
27392,
29915,
13,
13,
13,
1990,
5240,
866,
26947,
5709,
3399,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
349,
29979,
4690,
1164,
29918,
16358,
29918,
11432,
353,
29871,
29947,
29900,
29900,
29896,
13,
1678,
6570,
29918,
16358,
29918,
11432,
353,
29871,
29947,
29900,
29900,
29906,
13,
1678,
11698,
29918,
23845,
6006,
29918,
6007,
8186,
9838,
353,
29871,
29947,
29900,
29900,
29941,
13,
1678,
349,
5690,
29918,
16358,
29918,
11432,
353,
29871,
29947,
29900,
29900,
29946,
13,
1678,
11698,
29918,
20055,
4690,
1164,
353,
29871,
29947,
29900,
29900,
29945,
13,
13,
13,
1990,
8125,
2744,
14997,
3298,
2392,
25510,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
5012,
15094,
29907,
3040,
29928,
29918,
8193,
29918,
16358,
353,
525,
311,
17990,
630,
29918,
381,
29918,
3259,
29915,
13,
13,
13,
1990,
10808,
21889,
1542,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
6432,
261,
265,
353,
525,
2242,
261,
265,
29915,
13,
1678,
12301,
353,
525,
8678,
29915,
13,
1678,
11137,
1974,
353,
525,
22825,
1974,
29915,
13,
1678,
7136,
353,
525,
3221,
29915,
13,
1678,
921,
29872,
265,
353,
525,
17115,
265,
29915,
13,
1678,
451,
29918,
29423,
1891,
353,
525,
1333,
29918,
29423,
1891,
29915,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
903,
27259,
23538,
25932,
29892,
443,
3880,
29918,
1767,
29901,
851,
29897,
1599,
525,
6271,
29965,
21889,
1542,
16854,
2396,
13,
4706,
736,
10808,
21889,
1542,
16854,
29889,
1333,
29918,
29423,
1891,
13,
13,
13,
1990,
29848,
519,
2283,
29903,
7093,
29924,
29890,
29898,
18605,
29889,
16854,
1125,
13,
1678,
16999,
2287,
29931,
353,
29871,
29946,
29945,
29900,
29900,
13,
1678,
27640,
8127,
29911,
353,
29871,
29896,
29900,
29900,
29900,
29900,
13,
1678,
7495,
29968,
1430,
26664,
1001,
353,
29871,
29945,
29900,
29900,
29900,
13,
1678,
22343,
29918,
10818,
353,
29871,
29896,
13,
13,
13,
1990,
14227,
708,
5398,
14039,
287,
10140,
284,
29898,
18605,
29889,
16854,
1125,
13,
1678,
317,
6259,
4945,
29924,
353,
525,
5425,
29954,
4945,
29924,
29915,
13,
1678,
317,
6259,
29968,
24071,
353,
525,
5425,
29954,
29968,
24071,
29915,
13,
1678,
317,
6259,
29950,
4897,
353,
525,
5425,
29954,
29950,
4897,
29915,
13,
13,
13,
1990,
4321,
797,
571,
16227,
2133,
10562,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
5649,
353,
525,
4548,
7420,
29915,
13,
1678,
2143,
29918,
20119,
2133,
353,
525,
999,
29918,
20119,
2133,
29915,
13,
1678,
2322,
353,
525,
4381,
29915,
13,
13,
13,
1990,
4831,
332,
4135,
13020,
1542,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
3847,
29918,
4299,
29918,
546,
29918,
20158,
353,
525,
3560,
29918,
4299,
29918,
546,
29918,
20158,
29915,
13,
1678,
3847,
29918,
4299,
29918,
27711,
1080,
353,
525,
3560,
29918,
4299,
29918,
27711,
1080,
29915,
13,
1678,
8783,
29918,
6735,
800,
353,
525,
24713,
29918,
6735,
800,
29915,
13,
13,
13,
1990,
16874,
16390,
24541,
2008,
17954,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
4434,
353,
11297,
29873,
29915,
13,
1678,
16694,
353,
525,
5501,
13,
1678,
3031,
5283,
265,
353,
21921,
29915,
13,
1678,
8104,
353,
525,
11283,
13,
1678,
14282,
353,
525,
29989,
29915,
13,
13,
13,
1990,
8125,
24111,
1542,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
2294,
353,
525,
7959,
29915,
13,
1678,
7343,
353,
525,
16626,
29915,
13,
13,
13,
1990,
13373,
398,
8854,
2111,
267,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
3588,
353,
525,
13441,
29915,
13,
1678,
6459,
29918,
4830,
353,
525,
4801,
522,
29899,
4830,
29915,
13,
13,
13,
1990,
25159,
3950,
1542,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
1734,
12343,
346,
353,
525,
1742,
12343,
346,
29915,
13,
1678,
350,
4162,
353,
525,
29933,
4162,
29915,
13,
13,
13,
1990,
4673,
29963,
1177,
9806,
354,
1379,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
15397,
29918,
15634,
29918,
29893,
10552,
353,
525,
586,
29918,
15634,
29918,
29893,
10552,
29915,
13,
1678,
15397,
29918,
3359,
29918,
29893,
10552,
353,
525,
586,
29918,
3359,
29918,
29893,
10552,
29915,
13,
13,
13,
1990,
20259,
16142,
9065,
16854,
29898,
18605,
29889,
16854,
1125,
13,
1678,
405,
353,
525,
29940,
29915,
13,
1678,
315,
353,
525,
29907,
29915,
13,
1678,
379,
353,
525,
29950,
29915,
13,
1678,
399,
353,
525,
29956,
29915,
13,
1678,
360,
353,
525,
29928,
29915,
13,
1678,
317,
353,
525,
29903,
29915,
13,
1678,
438,
29911,
4448,
353,
525,
17901,
13,
2
] |
src/szz/map_bugs2snapshot/get_sha_pairs_from_deleted_linums.py | dSar-UVA/repoMiner | 9 | 97437 | import pandas, sys
data_dir = sys.argv[1] + '/'
project_name = sys.argv[2]
deleted_lines_filename = data_dir + 'lines_deleted_in_bf_shas/' + project_name + '.buggylines'
df = pandas.read_csv(deleted_lines_filename)
df = df[['bf_sha', 'bi_sha']]
grouped = df.groupby(['bf_sha', 'bi_sha'])
index = [gp_keys[0] for gp_keys in grouped.groups.values()]
unique_df = df.reindex(index)
result_filename = data_dir + 'lines_deleted_in_bf_shas/' + project_name + '.pairs'
unique_df.to_csv(result_filename, columns=['bf_sha', 'bi_sha'], index=False)
| [
1,
1053,
11701,
29892,
10876,
13,
13,
1272,
29918,
3972,
353,
10876,
29889,
19218,
29961,
29896,
29962,
718,
8207,
29915,
13,
4836,
29918,
978,
353,
10876,
29889,
19218,
29961,
29906,
29962,
13,
311,
22742,
29918,
9012,
29918,
9507,
353,
848,
29918,
3972,
718,
525,
9012,
29918,
311,
22742,
29918,
262,
29918,
1635,
29918,
845,
294,
22208,
718,
2060,
29918,
978,
718,
15300,
6152,
1927,
9012,
29915,
13,
13,
2176,
353,
11701,
29889,
949,
29918,
7638,
29898,
311,
22742,
29918,
9012,
29918,
9507,
29897,
13,
2176,
353,
4489,
29961,
1839,
1635,
29918,
17051,
742,
525,
5365,
29918,
17051,
2033,
29962,
13,
2972,
287,
353,
4489,
29889,
27789,
18959,
1635,
29918,
17051,
742,
525,
5365,
29918,
17051,
11287,
13,
2248,
353,
518,
29887,
29886,
29918,
8149,
29961,
29900,
29962,
363,
330,
29886,
29918,
8149,
297,
27831,
29889,
13155,
29889,
5975,
580,
29962,
13,
13092,
29918,
2176,
353,
4489,
29889,
276,
2248,
29898,
2248,
29897,
13,
13,
2914,
29918,
9507,
353,
848,
29918,
3972,
718,
525,
9012,
29918,
311,
22742,
29918,
262,
29918,
1635,
29918,
845,
294,
22208,
718,
2060,
29918,
978,
718,
15300,
29886,
7121,
29915,
13,
13092,
29918,
2176,
29889,
517,
29918,
7638,
29898,
2914,
29918,
9507,
29892,
4341,
29922,
1839,
1635,
29918,
17051,
742,
525,
5365,
29918,
17051,
7464,
2380,
29922,
8824,
29897,
13,
2
] |
sdk/python/pulumi_azure/ad/service_principal_password.py | Frassle/pulumi-azure | 0 | 121342 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
import pulumi.runtime
from .. import utilities, tables
class ServicePrincipalPassword(pulumi.CustomResource):
"""
Manages a Password associated with a Service Principal within Azure Active Directory.
-> **NOTE:** If you're authenticating using a Service Principal then it must have permissions to both `Read and write all applications` and `Sign in and read user profile` within the `Windows Azure Active Directory` API.
"""
def __init__(__self__, __name__, __opts__=None, end_date=None, key_id=None, service_principal_id=None, start_date=None, value=None):
"""Create a ServicePrincipalPassword resource with the given unique name, props, and options."""
if not __name__:
raise TypeError('Missing resource name argument (for URN creation)')
if not isinstance(__name__, str):
raise TypeError('Expected resource name to be a string')
if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
__props__ = dict()
if not end_date:
raise TypeError('Missing required property end_date')
__props__['end_date'] = end_date
__props__['key_id'] = key_id
if not service_principal_id:
raise TypeError('Missing required property service_principal_id')
__props__['service_principal_id'] = service_principal_id
__props__['start_date'] = start_date
if not value:
raise TypeError('Missing required property value')
__props__['value'] = value
super(ServicePrincipalPassword, __self__).__init__(
'azure:ad/servicePrincipalPassword:ServicePrincipalPassword',
__name__,
__props__,
__opts__)
def translate_output_property(self, prop):
return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop
def translate_input_property(self, prop):
return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
| [
1,
396,
14137,
29922,
9420,
29899,
29947,
13,
29937,
18610,
399,
25614,
29901,
445,
934,
471,
5759,
491,
278,
27477,
15547,
20839,
689,
16230,
313,
13264,
1885,
29897,
21704,
29889,
18610,
13,
29937,
18610,
1938,
451,
3863,
491,
1361,
6521,
366,
29915,
276,
3058,
366,
1073,
825,
366,
526,
2599,
29991,
18610,
13,
13,
5215,
9505,
15547,
13,
5215,
9505,
15547,
29889,
15634,
13,
3166,
6317,
1053,
3667,
1907,
29892,
6131,
13,
13,
1990,
6692,
4040,
26706,
10048,
29898,
29886,
352,
15547,
29889,
7281,
6848,
1125,
13,
1678,
9995,
13,
1678,
2315,
1179,
263,
25280,
6942,
411,
263,
6692,
14771,
7830,
2629,
12634,
10731,
18862,
29889,
13,
268,
13,
1678,
1599,
3579,
12256,
29923,
29901,
1068,
960,
366,
29915,
276,
15585,
1218,
773,
263,
6692,
14771,
7830,
769,
372,
1818,
505,
11239,
304,
1716,
421,
6359,
322,
2436,
599,
8324,
29952,
322,
421,
10140,
297,
322,
1303,
1404,
8722,
29952,
2629,
278,
421,
7685,
12634,
10731,
18862,
29952,
3450,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1649,
1311,
1649,
29892,
4770,
978,
1649,
29892,
4770,
25707,
1649,
29922,
8516,
29892,
1095,
29918,
1256,
29922,
8516,
29892,
1820,
29918,
333,
29922,
8516,
29892,
2669,
29918,
558,
26706,
29918,
333,
29922,
8516,
29892,
1369,
29918,
1256,
29922,
8516,
29892,
995,
29922,
8516,
1125,
13,
4706,
9995,
4391,
263,
6692,
4040,
26706,
10048,
6503,
411,
278,
2183,
5412,
1024,
29892,
17761,
29892,
322,
3987,
1213,
15945,
13,
4706,
565,
451,
4770,
978,
1649,
29901,
13,
9651,
12020,
20948,
877,
18552,
292,
6503,
1024,
2980,
313,
1454,
501,
29934,
29940,
11265,
29897,
1495,
13,
4706,
565,
451,
338,
8758,
22168,
978,
1649,
29892,
851,
1125,
13,
9651,
12020,
20948,
877,
1252,
6021,
6503,
1024,
304,
367,
263,
1347,
1495,
13,
4706,
565,
4770,
25707,
1649,
322,
451,
338,
8758,
22168,
25707,
1649,
29892,
9505,
15547,
29889,
6848,
5856,
1125,
13,
9651,
12020,
20948,
877,
1252,
6021,
6503,
3987,
304,
367,
263,
18981,
5856,
2777,
1495,
13,
13,
4706,
4770,
11030,
1649,
353,
9657,
580,
13,
13,
4706,
565,
451,
1095,
29918,
1256,
29901,
13,
9651,
12020,
20948,
877,
18552,
292,
3734,
2875,
1095,
29918,
1256,
1495,
13,
4706,
4770,
11030,
1649,
1839,
355,
29918,
1256,
2033,
353,
1095,
29918,
1256,
13,
13,
4706,
4770,
11030,
1649,
1839,
1989,
29918,
333,
2033,
353,
1820,
29918,
333,
13,
13,
4706,
565,
451,
2669,
29918,
558,
26706,
29918,
333,
29901,
13,
9651,
12020,
20948,
877,
18552,
292,
3734,
2875,
2669,
29918,
558,
26706,
29918,
333,
1495,
13,
4706,
4770,
11030,
1649,
1839,
5509,
29918,
558,
26706,
29918,
333,
2033,
353,
2669,
29918,
558,
26706,
29918,
333,
13,
13,
4706,
4770,
11030,
1649,
1839,
2962,
29918,
1256,
2033,
353,
1369,
29918,
1256,
13,
13,
4706,
565,
451,
995,
29901,
13,
9651,
12020,
20948,
877,
18552,
292,
3734,
2875,
995,
1495,
13,
4706,
4770,
11030,
1649,
1839,
1767,
2033,
353,
995,
13,
13,
4706,
2428,
29898,
3170,
4040,
26706,
10048,
29892,
4770,
1311,
1649,
467,
1649,
2344,
12035,
13,
9651,
525,
17688,
29901,
328,
29914,
5509,
4040,
26706,
10048,
29901,
3170,
4040,
26706,
10048,
742,
13,
9651,
4770,
978,
1649,
29892,
13,
9651,
4770,
11030,
1649,
29892,
13,
9651,
4770,
25707,
1649,
29897,
13,
13,
13,
1678,
822,
14240,
29918,
4905,
29918,
6799,
29898,
1311,
29892,
3107,
1125,
13,
4706,
736,
6131,
3032,
5454,
2303,
29931,
29918,
4986,
29918,
29903,
3521,
6059,
29918,
23487,
29918,
21009,
29889,
657,
29898,
7728,
29897,
470,
3107,
13,
13,
1678,
822,
14240,
29918,
2080,
29918,
6799,
29898,
1311,
29892,
3107,
1125,
13,
4706,
736,
6131,
3032,
29903,
3521,
6059,
29918,
4986,
29918,
5454,
2303,
29931,
29918,
23487,
29918,
21009,
29889,
657,
29898,
7728,
29897,
470,
3107,
13,
13,
2
] |
subjects/code_only/CodeOnly.py | ytyaru/Python.pylangstudy.Subjects.Template.201705221143 | 0 | 1604123 | <reponame>ytyaru/Python.pylangstudy.Subjects.Template.201705221143
#!python3
#encoding: utf-8
import HtmlWrapper
import HeaderNavi
#import Breadcrumbs
#import MetaNavi
import NextPrevNavi
class HeaderNavi(object):
def __init__(self):
nav_head = HeaderNavi.HeaderNavi(directional_icon_type='FontAwesome')
nav_next = NextPrevNavi.NextPrevNavi()
def CreateHtml(self):
return self.__CreateHeaderNavi() + '\n\n' + self.__CreateNextPrevNavi()
| [
1,
529,
276,
1112,
420,
29958,
29891,
1017,
18071,
29914,
11980,
29889,
2272,
3893,
18082,
29891,
29889,
20622,
29879,
29889,
6733,
29889,
29906,
29900,
29896,
29955,
29900,
29945,
29906,
29906,
29896,
29896,
29946,
29941,
13,
29937,
29991,
4691,
29941,
13,
29937,
22331,
29901,
23616,
29899,
29947,
13,
5215,
24726,
15646,
13,
5215,
19345,
29940,
17345,
13,
29937,
5215,
350,
949,
7283,
3774,
29879,
13,
29937,
5215,
20553,
29940,
17345,
13,
5215,
8084,
6572,
29894,
29940,
17345,
13,
1990,
19345,
29940,
17345,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
6283,
29918,
2813,
353,
19345,
29940,
17345,
29889,
7850,
29940,
17345,
29898,
20845,
284,
29918,
4144,
29918,
1853,
2433,
9824,
29909,
29893,
14151,
1495,
13,
4706,
6283,
29918,
4622,
353,
8084,
6572,
29894,
29940,
17345,
29889,
9190,
6572,
29894,
29940,
17345,
580,
13,
1678,
822,
6204,
10922,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
4391,
7850,
29940,
17345,
580,
718,
11297,
29876,
29905,
29876,
29915,
718,
1583,
17255,
4391,
9190,
6572,
29894,
29940,
17345,
580,
13,
13,
2
] |
main.py | tmespe/linkedin_adder | 0 | 197614 | import os
import time
from dotenv import load_dotenv
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException, ElementClickInterceptedException
load_dotenv()
driver = webdriver.Firefox()
LOGIN_URL = "https://www.linkedin.com/login?fromSignIn=true&trk=guest_homepage-basic_nav-header-signin"
user_name = os.getenv("USER_NAME")
password = <PASSWORD>("PASSWORD")
def sign_in(user_name=user_name, password=password):
"""
Logs in to linkedin with username and password from arguments using selenium
:param user_name: Linkedin username
:param password: Linkedin password
:return: None
"""
driver.get(LOGIN_URL)
username_field = driver.find_element_by_xpath('//*[@id="username"]')
username_field.send_keys(user_name)
password_field = driver.find_element_by_xpath('//*[@id="password"]')
password_field.send_keys(password)
sign_in_button = driver.find_element_by_xpath('/html/body/div/main/div[3]/div[1]/form/div[3]/button')
sign_in_button.click()
def connect():
"""
Opens a linkedin page using selenium and checks if connect button is clickable. If the button is clickable an
invitation to connect is sent. If the button is not present and clickable prints message that person is most likely
added.
:return: None
"""
name_xpath = "/html/body/div[7]/div[3]/div/div/div/div/div[3]/div/div/main/div/section[1]/div[2]/div[2]/div/div[1]/h1"
try:
# Set Xpath paths for name, connect button and send button pop-up
name = driver.find_element_by_xpath(name_xpath)
connect_xpath = '//*[@data-control-name="connect"]'
send_xpath = "/html/body/div[3]/div/div/div[3]/button[2]/span"
# Waits for page to load
connect_button = driver.find_element_by_xpath(connect_xpath)
time.sleep(1)
connect_button.click()
time.sleep(1)
send_button = driver.find_element_by_xpath(send_xpath)
send_button.click()
print(f"Successfully connected with {name.text}")
except (NoSuchElementException, ElementClickInterceptedException) as e:
name = driver.find_element_by_xpath(name_xpath)
print(f"{name.text} is probably already added or error occurred. See following debug {e}")
def main():
with open("linkedin_urls.txt", "r") as linkedin_urls:
urls = linkedin_urls.read().splitlines()
sign_in()
for url in urls:
driver.get(url)
connect()
time.sleep(1)
main()
| [
1,
1053,
2897,
13,
5215,
931,
13,
13,
3166,
8329,
6272,
1053,
2254,
29918,
6333,
6272,
13,
3166,
18866,
1053,
1856,
9465,
13,
3166,
18866,
29889,
9435,
29889,
11739,
29879,
1053,
1939,
29903,
987,
2642,
2451,
29892,
10619,
4164,
4074,
1547,
287,
2451,
13,
13,
1359,
29918,
6333,
6272,
580,
13,
13,
9465,
353,
1856,
9465,
29889,
18654,
8944,
580,
13,
13,
14480,
1177,
29918,
4219,
353,
376,
991,
597,
1636,
29889,
2324,
287,
262,
29889,
510,
29914,
7507,
29973,
3166,
10140,
797,
29922,
3009,
29987,
509,
29895,
29922,
2543,
342,
29918,
5184,
3488,
29899,
16121,
29918,
6654,
29899,
6672,
29899,
4530,
262,
29908,
13,
13,
1792,
29918,
978,
353,
2897,
29889,
657,
6272,
703,
11889,
29918,
5813,
1159,
13,
5630,
353,
529,
25711,
17013,
29958,
703,
25711,
17013,
1159,
13,
13,
13,
1753,
1804,
29918,
262,
29898,
1792,
29918,
978,
29922,
1792,
29918,
978,
29892,
4800,
29922,
5630,
1125,
13,
1678,
9995,
13,
1678,
4522,
29879,
297,
304,
9024,
262,
411,
8952,
322,
4800,
515,
6273,
773,
18866,
13,
1678,
584,
3207,
1404,
29918,
978,
29901,
28547,
262,
8952,
13,
1678,
584,
3207,
4800,
29901,
28547,
262,
4800,
13,
1678,
584,
2457,
29901,
6213,
13,
1678,
9995,
13,
1678,
7156,
29889,
657,
29898,
14480,
1177,
29918,
4219,
29897,
13,
13,
1678,
8952,
29918,
2671,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
23635,
877,
458,
29930,
17548,
333,
543,
6786,
3108,
1495,
13,
1678,
8952,
29918,
2671,
29889,
6717,
29918,
8149,
29898,
1792,
29918,
978,
29897,
13,
13,
1678,
4800,
29918,
2671,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
23635,
877,
458,
29930,
17548,
333,
543,
5630,
3108,
1495,
13,
1678,
4800,
29918,
2671,
29889,
6717,
29918,
8149,
29898,
5630,
29897,
13,
13,
1678,
1804,
29918,
262,
29918,
3092,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
23635,
11219,
1420,
29914,
2587,
29914,
4563,
29914,
3396,
29914,
4563,
29961,
29941,
16261,
4563,
29961,
29896,
16261,
689,
29914,
4563,
29961,
29941,
16261,
3092,
1495,
13,
1678,
1804,
29918,
262,
29918,
3092,
29889,
3808,
580,
13,
13,
13,
1753,
4511,
7295,
13,
1678,
9995,
13,
1678,
6461,
575,
263,
9024,
262,
1813,
773,
18866,
322,
12747,
565,
4511,
2826,
338,
2828,
519,
29889,
960,
278,
2826,
338,
2828,
519,
385,
13,
1678,
2437,
7018,
304,
4511,
338,
2665,
29889,
960,
278,
2826,
338,
451,
2198,
322,
2828,
519,
14677,
2643,
393,
2022,
338,
1556,
5517,
13,
1678,
2715,
29889,
13,
1678,
584,
2457,
29901,
6213,
13,
1678,
9995,
13,
1678,
1024,
29918,
23635,
353,
5591,
1420,
29914,
2587,
29914,
4563,
29961,
29955,
16261,
4563,
29961,
29941,
16261,
4563,
29914,
4563,
29914,
4563,
29914,
4563,
29914,
4563,
29961,
29941,
16261,
4563,
29914,
4563,
29914,
3396,
29914,
4563,
29914,
2042,
29961,
29896,
16261,
4563,
29961,
29906,
16261,
4563,
29961,
29906,
16261,
4563,
29914,
4563,
29961,
29896,
16261,
29882,
29896,
29908,
13,
1678,
1018,
29901,
13,
4706,
396,
3789,
1060,
2084,
10898,
363,
1024,
29892,
4511,
2826,
322,
3638,
2826,
1835,
29899,
786,
13,
4706,
1024,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
23635,
29898,
978,
29918,
23635,
29897,
13,
4706,
4511,
29918,
23635,
353,
525,
458,
29930,
17548,
1272,
29899,
6451,
29899,
978,
543,
6915,
3108,
29915,
13,
4706,
3638,
29918,
23635,
353,
5591,
1420,
29914,
2587,
29914,
4563,
29961,
29941,
16261,
4563,
29914,
4563,
29914,
4563,
29961,
29941,
16261,
3092,
29961,
29906,
16261,
9653,
29908,
13,
13,
4706,
396,
22552,
1169,
363,
1813,
304,
2254,
13,
4706,
4511,
29918,
3092,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
23635,
29898,
6915,
29918,
23635,
29897,
13,
4706,
931,
29889,
17059,
29898,
29896,
29897,
13,
4706,
4511,
29918,
3092,
29889,
3808,
580,
13,
13,
4706,
931,
29889,
17059,
29898,
29896,
29897,
13,
4706,
3638,
29918,
3092,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
23635,
29898,
6717,
29918,
23635,
29897,
13,
4706,
3638,
29918,
3092,
29889,
3808,
580,
13,
4706,
1596,
29898,
29888,
29908,
14191,
3730,
6631,
411,
426,
978,
29889,
726,
27195,
13,
13,
1678,
5174,
313,
3782,
29903,
987,
2642,
2451,
29892,
10619,
4164,
4074,
1547,
287,
2451,
29897,
408,
321,
29901,
13,
4706,
1024,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
23635,
29898,
978,
29918,
23635,
29897,
13,
4706,
1596,
29898,
29888,
29908,
29912,
978,
29889,
726,
29913,
338,
3117,
2307,
2715,
470,
1059,
10761,
29889,
2823,
1494,
4744,
426,
29872,
27195,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
411,
1722,
703,
2324,
287,
262,
29918,
26045,
29889,
3945,
613,
376,
29878,
1159,
408,
9024,
262,
29918,
26045,
29901,
13,
4706,
23942,
353,
9024,
262,
29918,
26045,
29889,
949,
2141,
5451,
9012,
580,
13,
13,
4706,
1804,
29918,
262,
580,
13,
13,
4706,
363,
3142,
297,
23942,
29901,
13,
9651,
7156,
29889,
657,
29898,
2271,
29897,
13,
9651,
4511,
580,
13,
9651,
931,
29889,
17059,
29898,
29896,
29897,
13,
13,
13,
3396,
580,
13,
2
] |
nova/tests/servicegroup/test_zk_driver.py | vmthunder/nova | 7 | 8838 | # Copyright (c) AT&T 2012-2013 <NAME> <<EMAIL>>
# Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Test the ZooKeeper driver for servicegroup.
You need to install ZooKeeper locally and related dependencies
to run the test. It's unclear how to install python-zookeeper lib
in venv so you might have to run the test without it.
To set up in Ubuntu 12.04:
$ sudo apt-get install zookeeper zookeeperd python-zookeeper
$ sudo pip install evzookeeper
$ nosetests nova.tests.servicegroup.test_zk_driver
"""
import eventlet
from nova import servicegroup
from nova import test
class ZKServiceGroupTestCase(test.NoDBTestCase):
def setUp(self):
super(ZKServiceGroupTestCase, self).setUp()
servicegroup.API._driver = None
from nova.servicegroup.drivers import zk
self.flags(servicegroup_driver='zk')
self.flags(address='localhost:2181', group="zookeeper")
try:
zk.ZooKeeperDriver()
except ImportError:
self.skipTest("Unable to test due to lack of ZooKeeper")
def test_join_leave(self):
self.servicegroup_api = servicegroup.API()
service_id = {'topic': 'unittest', 'host': 'serviceA'}
self.servicegroup_api.join(service_id['host'], service_id['topic'])
self.assertTrue(self.servicegroup_api.service_is_up(service_id))
self.servicegroup_api.leave(service_id['host'], service_id['topic'])
# make sure zookeeper is updated and watcher is triggered
eventlet.sleep(1)
self.assertFalse(self.servicegroup_api.service_is_up(service_id))
def test_stop(self):
self.servicegroup_api = servicegroup.API()
service_id = {'topic': 'unittest', 'host': 'serviceA'}
pulse = self.servicegroup_api.join(service_id['host'],
service_id['topic'], None)
self.assertTrue(self.servicegroup_api.service_is_up(service_id))
pulse.stop()
eventlet.sleep(1)
self.assertFalse(self.servicegroup_api.service_is_up(service_id))
| [
1,
396,
14187,
1266,
313,
29883,
29897,
15531,
29987,
29911,
29871,
29906,
29900,
29896,
29906,
29899,
29906,
29900,
29896,
29941,
529,
5813,
29958,
3532,
26862,
6227,
6778,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29906,
27955,
2994,
29886,
29889,
13,
29937,
13,
29937,
1678,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
366,
1122,
13,
29937,
1678,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
887,
1122,
4017,
13,
29937,
1678,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
308,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
1678,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
1678,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
13,
29937,
1678,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
2823,
278,
13,
29937,
1678,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
27028,
13,
29937,
1678,
1090,
278,
19245,
29889,
13,
13,
15945,
29908,
3057,
278,
796,
3634,
29968,
3905,
546,
7156,
363,
3348,
293,
4872,
1132,
29889,
13,
13,
3492,
817,
304,
2601,
796,
3634,
29968,
3905,
546,
12430,
322,
4475,
9962,
13,
517,
1065,
278,
1243,
29889,
739,
29915,
29879,
20871,
920,
304,
2601,
3017,
29899,
2502,
6946,
11356,
4303,
13,
262,
6003,
29894,
577,
366,
1795,
505,
304,
1065,
278,
1243,
1728,
372,
29889,
13,
13,
1762,
731,
701,
297,
8294,
29871,
29896,
29906,
29889,
29900,
29946,
29901,
13,
29938,
9196,
10882,
29899,
657,
2601,
22424,
23935,
22424,
23935,
29881,
3017,
29899,
2502,
6946,
11356,
13,
29938,
9196,
8450,
2601,
3415,
2502,
6946,
11356,
13,
29938,
7814,
300,
9197,
26121,
29889,
21150,
29889,
2140,
293,
4872,
1132,
29889,
1688,
29918,
7730,
29918,
9465,
13,
15945,
29908,
13,
13,
5215,
1741,
1026,
13,
13,
3166,
26121,
1053,
3348,
293,
4872,
1132,
13,
3166,
26121,
1053,
1243,
13,
13,
13,
1990,
796,
29968,
3170,
4782,
3057,
8259,
29898,
1688,
29889,
3782,
4051,
3057,
8259,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
2428,
29898,
29999,
29968,
3170,
4782,
3057,
8259,
29892,
1583,
467,
842,
3373,
580,
13,
4706,
3348,
293,
4872,
1132,
29889,
8787,
3032,
9465,
353,
6213,
13,
4706,
515,
26121,
29889,
2140,
293,
4872,
1132,
29889,
24477,
874,
1053,
503,
29895,
13,
4706,
1583,
29889,
15764,
29898,
2140,
293,
4872,
1132,
29918,
9465,
2433,
7730,
1495,
13,
4706,
1583,
29889,
15764,
29898,
7328,
2433,
7640,
29901,
29906,
29896,
29947,
29896,
742,
2318,
543,
2502,
6946,
11356,
1159,
13,
4706,
1018,
29901,
13,
9651,
503,
29895,
29889,
29999,
3634,
29968,
3905,
546,
12376,
580,
13,
4706,
5174,
16032,
2392,
29901,
13,
9651,
1583,
29889,
11014,
3057,
703,
2525,
519,
304,
1243,
2861,
304,
10225,
310,
796,
3634,
29968,
3905,
546,
1159,
13,
13,
1678,
822,
1243,
29918,
7122,
29918,
280,
1351,
29898,
1311,
1125,
13,
4706,
1583,
29889,
2140,
293,
4872,
1132,
29918,
2754,
353,
3348,
293,
4872,
1132,
29889,
8787,
580,
13,
4706,
2669,
29918,
333,
353,
11117,
13010,
2396,
525,
348,
27958,
742,
525,
3069,
2396,
525,
5509,
29909,
10827,
13,
4706,
1583,
29889,
2140,
293,
4872,
1132,
29918,
2754,
29889,
7122,
29898,
5509,
29918,
333,
1839,
3069,
7464,
2669,
29918,
333,
1839,
13010,
11287,
13,
4706,
1583,
29889,
9294,
5574,
29898,
1311,
29889,
2140,
293,
4872,
1132,
29918,
2754,
29889,
5509,
29918,
275,
29918,
786,
29898,
5509,
29918,
333,
876,
13,
4706,
1583,
29889,
2140,
293,
4872,
1132,
29918,
2754,
29889,
280,
1351,
29898,
5509,
29918,
333,
1839,
3069,
7464,
2669,
29918,
333,
1839,
13010,
11287,
13,
4706,
396,
1207,
1854,
22424,
23935,
338,
4784,
322,
6505,
261,
338,
19799,
13,
4706,
1741,
1026,
29889,
17059,
29898,
29896,
29897,
13,
4706,
1583,
29889,
9294,
8824,
29898,
1311,
29889,
2140,
293,
4872,
1132,
29918,
2754,
29889,
5509,
29918,
275,
29918,
786,
29898,
5509,
29918,
333,
876,
13,
13,
1678,
822,
1243,
29918,
9847,
29898,
1311,
1125,
13,
4706,
1583,
29889,
2140,
293,
4872,
1132,
29918,
2754,
353,
3348,
293,
4872,
1132,
29889,
8787,
580,
13,
4706,
2669,
29918,
333,
353,
11117,
13010,
2396,
525,
348,
27958,
742,
525,
3069,
2396,
525,
5509,
29909,
10827,
13,
4706,
9505,
344,
353,
1583,
29889,
2140,
293,
4872,
1132,
29918,
2754,
29889,
7122,
29898,
5509,
29918,
333,
1839,
3069,
7464,
13,
462,
462,
308,
2669,
29918,
333,
1839,
13010,
7464,
6213,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
1311,
29889,
2140,
293,
4872,
1132,
29918,
2754,
29889,
5509,
29918,
275,
29918,
786,
29898,
5509,
29918,
333,
876,
13,
4706,
9505,
344,
29889,
9847,
580,
13,
4706,
1741,
1026,
29889,
17059,
29898,
29896,
29897,
13,
4706,
1583,
29889,
9294,
8824,
29898,
1311,
29889,
2140,
293,
4872,
1132,
29918,
2754,
29889,
5509,
29918,
275,
29918,
786,
29898,
5509,
29918,
333,
876,
13,
2
] |
src/status_node.py | Faust-Wang/vswarm | 21 | 1498 | #!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
import curses
import sys
from collections import deque
from datetime import datetime
import numpy as np
import rospy
from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus
from geometry_msgs.msg import PoseStamped
from mavros_msgs.msg import ExtendedState, PositionTarget, State # StatusText
from scipy.spatial.transform import Rotation as R
from sensor_msgs.msg import BatteryState, Image, NavSatFix
GPS_FIX_DICT = {
0: ('No GPS', curses.COLOR_RED),
1: ('No fix', curses.COLOR_RED),
2: ('2D lock', curses.COLOR_BLUE),
3: ('3D lock', curses.COLOR_BLUE),
4: ('DGPS', curses.COLOR_MAGENTA),
5: ('RTK float', curses.COLOR_YELLOW),
6: ('RTK fix', curses.COLOR_GREEN)
}
def get_color(color):
return curses.color_pair(color)
def frequency_from_messages(messages):
durations = []
for i in range(len(messages) - 1):
duration = messages[i + 1].header.stamp - messages[i].header.stamp
durations.append(duration.to_sec())
frequency = 1 / np.mean(durations)
if np.isnan(frequency):
return 0
return frequency
class StatusNode:
def __init__(self, screen):
rospy.init_node('status_node', argv=sys.argv)
self.rate = rospy.get_param('~rate', default=1.0)
# Curses setup
self.screen = curses.initscr()
self.rows, self.cols = self.screen.getmaxyx()
height_status = 15
self.status = curses.newwin(height_status, self.cols, 1, 2)
# self.console = curses.newwin(self.rows - height_status, self.cols, 12, 2)
self.lines = 0
self.text = ''
self.screen.keypad(True)
curses.curs_set(False) # Hide cursor
colors = [curses.COLOR_BLACK, curses.COLOR_BLUE, curses.COLOR_CYAN,
curses.COLOR_GREEN, curses.COLOR_MAGENTA, curses.COLOR_RED,
curses.COLOR_WHITE, curses.COLOR_YELLOW]
# Curses color setup
curses.use_default_colors()
for color in colors:
curses.init_pair(color, color, -1)
# Default variables
self.status_battery_perc = None
self.state = State()
self.state_sub = rospy.Subscriber('mavros/state', State,
callback=self.state_callback,
queue_size=1)
self.battery = BatteryState()
self.battery_sub = rospy.Subscriber('mavros/battery', BatteryState,
callback=self.battery_callback,
queue_size=1)
self.extended = ExtendedState()
self.extended_sub = rospy.Subscriber('mavros/extended_state', ExtendedState,
callback=self.extended_callback,
queue_size=1)
# self.statustext = StatusText()
# self.statustext_sub = rospy.Subscriber('mavros/statustext/recv', StatusText,
# callback=self.statustext_callback,
# queue_size=1)
self.gps = NavSatFix()
self.gps_sub = rospy.Subscriber('mavros/global_position/raw/fix', NavSatFix,
callback=self.gps_callback,
queue_size=1)
self.local_pose = PoseStamped()
self.local_pose_sub = rospy.Subscriber('mavros/local_position/pose', PoseStamped,
callback=self.local_pose_callback,
queue_size=1)
self.global_pose = PoseStamped()
self.global_pose_sub = rospy.Subscriber('global_position/pose', PoseStamped,
callback=self.global_pose_callback,
queue_size=1)
self.diagnostics = DiagnosticArray()
self.diagnostic_gps = DiagnosticStatus()
self.diagnostics_sub = rospy.Subscriber('/diagnostics', DiagnosticArray,
callback=self.diagnostics_callback,
queue_size=1)
self.setpoint = PositionTarget()
self.setpoint_sub = rospy.Subscriber('mavros/setpoint_raw/local', PositionTarget,
callback=self.setpoint_callback,
queue_size=1)
self.cameras = ['front', 'right', 'back', 'left']
self.image_subscribers = []
self.images = {c: deque(maxlen=10) for c in self.cameras}
for camera in self.cameras:
topic = f'camera_{camera}/image_raw'
subscriber = rospy.Subscriber(topic, Image, callback=self.image_callback,
callback_args=camera, queue_size=1,
buff_size=2 ** 24)
self.image_subscribers.append(subscriber)
def battery_callback(self, battery_msg):
if battery_msg.location == 'id0':
self.battery = battery_msg
def state_callback(self, state_msg):
self.state = state_msg
def extended_callback(self, extended_msg):
self.extended = extended_msg
def diagnostics_callback(self, diagnostics_msg):
for status in diagnostics_msg.status:
if 'GPS' in status.name:
self.diagnostic_gps = status
def gps_callback(self, gps_msg):
self.gps = gps_msg
def local_pose_callback(self, pose_msg):
self.local_pose = pose_msg
def global_pose_callback(self, pose_msg):
self.global_pose = pose_msg
def setpoint_callback(self, setpoint_msg):
self.setpoint = setpoint_msg
def image_callback(self, image_msg, camera):
self.images[camera].append(image_msg)
def statustext_callback(self, statustext_msg):
screen = self.console
time_str = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
# time_str = datetime.datetime.fromtimestamp(unix_time)
text = statustext_msg.text
severity = statustext_msg.severity
msg = statustext_msg
severity_red = [msg.EMERGENCY, msg.ALERT, msg.CRITICAL, msg.ERROR]
severity_yellow = [msg.WARNING, msg.NOTICE]
severity_neutral = [msg.INFO, msg.DEBUG]
color = curses.COLOR_CYAN
if severity in severity_red:
color = curses.COLOR_RED
elif severity in severity_yellow:
color = curses.COLOR_YELLOW
elif severity in severity_neutral:
color = curses.COLOR_WHITE
self.text = f'{time_str}: {text} ({color})'
# screen.addstr(self.lines, 0, log, get_color(color))
self.lines += 1
screen.refresh()
def print_status(self):
screen = self.status
screen.clear()
# rospy.loginfo(status)
# print(status)
x_tab = 0
x_indent = 14
row = 0
# Battery
battery_percentage = int(self.battery.percentage * 100)
color = curses.COLOR_CYAN
if battery_percentage > 50:
color = curses.COLOR_GREEN
elif battery_percentage > 25:
color = curses.COLOR_YELLOW
elif battery_percentage > 0:
color = curses.COLOR_RED
status_battery = str(battery_percentage) + '%'
screen.addstr(row, x_tab, 'Battery: ')
screen.addstr(row, x_indent, status_battery, get_color(color))
row += 1
# Armed
if self.state.armed:
color = curses.COLOR_RED
status_armed = 'Yes'
else:
color = curses.COLOR_GREEN
status_armed = 'No'
screen.addstr(row, x_tab, 'Armed: ')
screen.addstr(row, x_indent, status_armed, get_color(color))
row += 1
# Mode
color = curses.COLOR_CYAN
mode = self.state.mode
if mode.startswith('AUTO'):
mode = mode.split('.')[-1]
mode = mode.capitalize()
if mode == 'Offboard':
color = curses.COLOR_RED
else:
color = curses.COLOR_BLUE
if mode == '':
mode = 'None'
elif mode == 'Posctl':
mode = 'Position'
elif mode == 'Rtl':
mode = 'Return'
status_mode = '{}'.format(mode)
screen.addstr(row, x_tab, 'Mode: ')
screen.addstr(row, x_indent, status_mode, get_color(color))
row += 1
# Extended status
if self.extended.landed_state == self.extended.LANDED_STATE_IN_AIR:
status_extended = 'Air'
color = curses.COLOR_RED
elif self.extended.landed_state == self.extended.LANDED_STATE_LANDING:
status_extended = 'Landed'
color = curses.COLOR_GREEN
elif self.extended.landed_state == self.extended.LANDED_STATE_ON_GROUND:
status_extended = 'Ground'
color = curses.COLOR_GREEN
elif self.extended.landed_state == self.extended.LANDED_STATE_TAKEOFF:
status_extended = 'Takeoff'
color = curses.COLOR_RED
elif self.extended.landed_state == self.extended.LANDED_STATE_UNDEFINED:
status_extended = 'Undefined'
color = curses.COLOR_CYAN
screen.addstr(row, x_tab, 'State: ')
screen.addstr(row, x_indent, status_extended, get_color(color))
row += 1
# GPS info
satellites = 0
fix_type, color = GPS_FIX_DICT[0]
for value in self.diagnostic_gps.values:
if value.key == 'Satellites visible':
satellites = value.value
elif value.key == 'Fix type':
fix_type, color = GPS_FIX_DICT[int(value.value)]
screen.addstr(row, x_tab, 'GPS info: ')
screen.addstr(row, x_indent, f'{fix_type} ({satellites} sat)', get_color(color))
row += 2
# GPS pos
latitude = self.gps.latitude
longitude = self.gps.longitude
altitude = round(self.gps.altitude, 2)
status_gps = f'{latitude:.7f} {longitude:.7f} {altitude:.2f} (LLA)'
screen.addstr(row, x_tab, 'GPS pos: ')
screen.addstr(row, x_indent, status_gps)
row += 1
# Local pose
p = self.local_pose.pose.position
q = self.local_pose.pose.orientation
quaternion = [q.x, q.y, q.z, q.w]
try:
rot = R.from_quat(quaternion)
except ValueError:
rot = R.from_euler('zyx', [0.0, 0.0, 0.0])
yaw, pitch, roll = rot.as_euler('zyx', degrees=True)
x, y, z = round(p.x, 2), round(p.y, 2), round(p.z, 2)
yaw, pitch, roll = int(yaw), int(pitch), int(roll)
screen.addstr(row, x_tab, 'Local pos: ')
screen.addstr(row, x_indent, f'{x:.2f} {y:.2f} {z:.2f} (XYZ) {roll} {pitch} {yaw} (RPY)')
row += 1
# Global pose
p = self.global_pose.pose.position
q = self.global_pose.pose.orientation
quaternion = [q.x, q.y, q.z, q.w]
try:
rot = R.from_quat(quaternion)
except ValueError:
rot = R.from_euler('zyx', [0.0, 0.0, 0.0])
yaw, pitch, roll = rot.as_euler('zyx', degrees=True)
x, y, z = round(p.x, 2), round(p.y, 2), round(p.z, 2)
yaw, pitch, roll = int(yaw), int(pitch), int(roll)
screen.addstr(row, x_tab, 'Global pos: ')
screen.addstr(row, x_indent, f'{x:.2f} {y:.2f} {z:.2f} (XYZ) {roll} {pitch} {yaw} (RPY)')
row += 1
# Setpoint
v = self.setpoint.velocity
vx, vy, vz = round(v.x, 2), round(v.y, 2), round(v.z, 2)
yaw = int(np.rad2deg(self.setpoint.yaw))
screen.addstr(row, x_tab, 'Setpoint: ')
screen.addstr(row, x_indent, f'{vx:.2f} {vy:.2f} {vz:.2f} (XYZ) {yaw} (Y)')
row += 1
# Cameras
freqs = {c: 0 for c in self.cameras}
for cam, messages in self.images.items():
freqs[cam] = frequency_from_messages(messages)
ff, fr, fb, fl = [int(round(v)) for k, v in freqs.items()]
screen.addstr(row, x_tab, 'Cameras: ')
screen.addstr(row, x_indent, f'{ff} {fr} {fb} {fl} (front right back left [Hz])')
row += 1
screen.refresh()
self.screen.refresh()
def run(self):
rate = rospy.Rate(self.rate)
try:
while not rospy.is_shutdown():
self.print_status()
rate.sleep()
except rospy.ROSInterruptException:
curses.nocbreak()
self.screen.keypad(False)
curses.echo()
def curses_main(screen):
StatusNode(screen).run()
def main():
try:
curses.wrapper(curses_main)
except rospy.ROSInterruptException:
pass
if __name__ == '__main__':
main()
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
29892,
8542,
29892,
1596,
29918,
2220,
13,
13,
5215,
18580,
267,
13,
5215,
10876,
13,
3166,
16250,
1053,
316,
802,
13,
3166,
12865,
1053,
12865,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
696,
1028,
29891,
13,
3166,
652,
21780,
29918,
1516,
3174,
29889,
7645,
1053,
4671,
21780,
2588,
29892,
4671,
21780,
5709,
13,
3166,
16303,
29918,
1516,
3174,
29889,
7645,
1053,
349,
852,
855,
1160,
287,
13,
3166,
286,
485,
1883,
29918,
1516,
3174,
29889,
7645,
1053,
7338,
2760,
2792,
29892,
20627,
8667,
29892,
4306,
29871,
396,
16034,
1626,
13,
3166,
4560,
2272,
29889,
1028,
15238,
29889,
9067,
1053,
9664,
362,
408,
390,
13,
3166,
23530,
29918,
1516,
3174,
29889,
7645,
1053,
350,
2620,
29891,
2792,
29892,
7084,
29892,
13132,
29903,
271,
29943,
861,
13,
13,
29954,
7024,
29918,
25634,
29918,
4571,
1783,
353,
426,
13,
268,
29900,
29901,
6702,
3782,
402,
7024,
742,
18580,
267,
29889,
15032,
1955,
29918,
19386,
511,
13,
268,
29896,
29901,
6702,
3782,
2329,
742,
18580,
267,
29889,
15032,
1955,
29918,
19386,
511,
13,
268,
29906,
29901,
6702,
29906,
29928,
7714,
742,
18580,
267,
29889,
15032,
1955,
29918,
13367,
4462,
511,
13,
268,
29941,
29901,
6702,
29941,
29928,
7714,
742,
18580,
267,
29889,
15032,
1955,
29918,
13367,
4462,
511,
13,
268,
29946,
29901,
6702,
29928,
29954,
7024,
742,
18580,
267,
29889,
15032,
1955,
29918,
1529,
29954,
3919,
29909,
511,
13,
268,
29945,
29901,
6702,
13079,
29968,
5785,
742,
18580,
267,
29889,
15032,
1955,
29918,
29979,
29923,
2208,
9806,
511,
13,
268,
29953,
29901,
6702,
13079,
29968,
2329,
742,
18580,
267,
29889,
15032,
1955,
29918,
29954,
1525,
1430,
29897,
13,
29913,
13,
13,
13,
1753,
679,
29918,
2780,
29898,
2780,
1125,
13,
1678,
736,
18580,
267,
29889,
2780,
29918,
18784,
29898,
2780,
29897,
13,
13,
13,
1753,
10868,
29918,
3166,
29918,
19158,
29898,
19158,
1125,
13,
1678,
1411,
800,
353,
5159,
13,
1678,
363,
474,
297,
3464,
29898,
2435,
29898,
19158,
29897,
448,
29871,
29896,
1125,
13,
4706,
14385,
353,
7191,
29961,
29875,
718,
29871,
29896,
1822,
6672,
29889,
303,
1160,
448,
7191,
29961,
29875,
1822,
6672,
29889,
303,
1160,
13,
4706,
1411,
800,
29889,
4397,
29898,
19708,
29889,
517,
29918,
3471,
3101,
13,
1678,
10868,
353,
29871,
29896,
847,
7442,
29889,
12676,
29898,
29881,
332,
800,
29897,
13,
1678,
565,
7442,
29889,
275,
13707,
29898,
10745,
23860,
1125,
13,
4706,
736,
29871,
29900,
13,
1678,
736,
10868,
13,
13,
13,
1990,
16034,
4247,
29901,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4315,
1125,
13,
13,
4706,
696,
1028,
29891,
29889,
2344,
29918,
3177,
877,
4882,
29918,
3177,
742,
1852,
29894,
29922,
9675,
29889,
19218,
29897,
13,
13,
4706,
1583,
29889,
10492,
353,
696,
1028,
29891,
29889,
657,
29918,
3207,
877,
30022,
10492,
742,
2322,
29922,
29896,
29889,
29900,
29897,
13,
13,
4706,
396,
315,
1295,
267,
6230,
13,
4706,
1583,
29889,
10525,
353,
18580,
267,
29889,
262,
1169,
7283,
580,
13,
4706,
1583,
29889,
5727,
29892,
1583,
29889,
22724,
353,
1583,
29889,
10525,
29889,
657,
3317,
29891,
29916,
580,
13,
13,
4706,
3171,
29918,
4882,
353,
29871,
29896,
29945,
13,
13,
4706,
1583,
29889,
4882,
353,
18580,
267,
29889,
1482,
5080,
29898,
3545,
29918,
4882,
29892,
1583,
29889,
22724,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
4706,
396,
1583,
29889,
11058,
353,
18580,
267,
29889,
1482,
5080,
29898,
1311,
29889,
5727,
448,
3171,
29918,
4882,
29892,
1583,
29889,
22724,
29892,
29871,
29896,
29906,
29892,
29871,
29906,
29897,
13,
4706,
1583,
29889,
9012,
353,
29871,
29900,
13,
4706,
1583,
29889,
726,
353,
6629,
13,
13,
4706,
1583,
29889,
10525,
29889,
446,
1478,
328,
29898,
5574,
29897,
13,
4706,
18580,
267,
29889,
29883,
1295,
29918,
842,
29898,
8824,
29897,
29871,
396,
379,
680,
10677,
13,
13,
4706,
11955,
353,
518,
29883,
1295,
267,
29889,
15032,
1955,
29918,
13367,
11375,
29892,
18580,
267,
29889,
15032,
1955,
29918,
13367,
4462,
29892,
18580,
267,
29889,
15032,
1955,
29918,
29907,
29979,
2190,
29892,
13,
462,
29871,
18580,
267,
29889,
15032,
1955,
29918,
29954,
1525,
1430,
29892,
18580,
267,
29889,
15032,
1955,
29918,
1529,
29954,
3919,
29909,
29892,
18580,
267,
29889,
15032,
1955,
29918,
19386,
29892,
13,
462,
29871,
18580,
267,
29889,
15032,
1955,
29918,
25039,
9094,
29892,
18580,
267,
29889,
15032,
1955,
29918,
29979,
29923,
2208,
9806,
29962,
13,
13,
4706,
396,
315,
1295,
267,
2927,
6230,
13,
4706,
18580,
267,
29889,
1509,
29918,
4381,
29918,
27703,
580,
13,
4706,
363,
2927,
297,
11955,
29901,
13,
9651,
18580,
267,
29889,
2344,
29918,
18784,
29898,
2780,
29892,
2927,
29892,
448,
29896,
29897,
13,
13,
4706,
396,
13109,
3651,
13,
4706,
1583,
29889,
4882,
29918,
29890,
2620,
29891,
29918,
546,
29883,
353,
6213,
13,
13,
4706,
1583,
29889,
3859,
353,
4306,
580,
13,
4706,
1583,
29889,
3859,
29918,
1491,
353,
696,
1028,
29891,
29889,
4035,
7588,
495,
877,
29885,
485,
1883,
29914,
3859,
742,
4306,
29892,
13,
462,
462,
3986,
6939,
29922,
1311,
29889,
3859,
29918,
14035,
29892,
13,
462,
462,
3986,
9521,
29918,
2311,
29922,
29896,
29897,
13,
13,
4706,
1583,
29889,
29890,
2620,
29891,
353,
350,
2620,
29891,
2792,
580,
13,
4706,
1583,
29889,
29890,
2620,
29891,
29918,
1491,
353,
696,
1028,
29891,
29889,
4035,
7588,
495,
877,
29885,
485,
1883,
29914,
29890,
2620,
29891,
742,
350,
2620,
29891,
2792,
29892,
13,
462,
462,
9651,
6939,
29922,
1311,
29889,
29890,
2620,
29891,
29918,
14035,
29892,
13,
462,
462,
9651,
9521,
29918,
2311,
29922,
29896,
29897,
13,
13,
4706,
1583,
29889,
1062,
2760,
353,
7338,
2760,
2792,
580,
13,
4706,
1583,
29889,
1062,
2760,
29918,
1491,
353,
696,
1028,
29891,
29889,
4035,
7588,
495,
877,
29885,
485,
1883,
29914,
1062,
2760,
29918,
3859,
742,
7338,
2760,
2792,
29892,
13,
462,
462,
632,
6939,
29922,
1311,
29889,
1062,
2760,
29918,
14035,
29892,
13,
462,
462,
632,
9521,
29918,
2311,
29922,
29896,
29897,
13,
13,
4706,
396,
1583,
29889,
6112,
504,
1062,
353,
16034,
1626,
580,
13,
4706,
396,
1583,
29889,
6112,
504,
1062,
29918,
1491,
353,
696,
1028,
29891,
29889,
4035,
7588,
495,
877,
29885,
485,
1883,
29914,
6112,
504,
1062,
29914,
3757,
29894,
742,
16034,
1626,
29892,
13,
4706,
396,
462,
462,
4706,
6939,
29922,
1311,
29889,
6112,
504,
1062,
29918,
14035,
29892,
13,
4706,
396,
462,
462,
4706,
9521,
29918,
2311,
29922,
29896,
29897,
13,
13,
4706,
1583,
29889,
29887,
567,
353,
13132,
29903,
271,
29943,
861,
580,
13,
4706,
1583,
29889,
29887,
567,
29918,
1491,
353,
696,
1028,
29891,
29889,
4035,
7588,
495,
877,
29885,
485,
1883,
29914,
10945,
29918,
3283,
29914,
1610,
29914,
5878,
742,
13132,
29903,
271,
29943,
861,
29892,
13,
462,
462,
4706,
6939,
29922,
1311,
29889,
29887,
567,
29918,
14035,
29892,
13,
462,
462,
4706,
9521,
29918,
2311,
29922,
29896,
29897,
13,
13,
4706,
1583,
29889,
2997,
29918,
4220,
353,
349,
852,
855,
1160,
287,
580,
13,
4706,
1583,
29889,
2997,
29918,
4220,
29918,
1491,
353,
696,
1028,
29891,
29889,
4035,
7588,
495,
877,
29885,
485,
1883,
29914,
2997,
29918,
3283,
29914,
4220,
742,
349,
852,
855,
1160,
287,
29892,
13,
462,
462,
1669,
6939,
29922,
1311,
29889,
2997,
29918,
4220,
29918,
14035,
29892,
13,
462,
462,
1669,
9521,
29918,
2311,
29922,
29896,
29897,
13,
13,
4706,
1583,
29889,
10945,
29918,
4220,
353,
349,
852,
855,
1160,
287,
580,
13,
4706,
1583,
29889,
10945,
29918,
4220,
29918,
1491,
353,
696,
1028,
29891,
29889,
4035,
7588,
495,
877,
10945,
29918,
3283,
29914,
4220,
742,
349,
852,
855,
1160,
287,
29892,
13,
462,
462,
18884,
6939,
29922,
1311,
29889,
10945,
29918,
4220,
29918,
14035,
29892,
13,
462,
462,
18884,
9521,
29918,
2311,
29922,
29896,
29897,
13,
13,
4706,
1583,
29889,
6051,
20921,
353,
4671,
21780,
2588,
580,
13,
4706,
1583,
29889,
6051,
21780,
29918,
29887,
567,
353,
4671,
21780,
5709,
580,
13,
4706,
1583,
29889,
6051,
20921,
29918,
1491,
353,
696,
1028,
29891,
29889,
4035,
7588,
495,
11219,
6051,
20921,
742,
4671,
21780,
2588,
29892,
13,
462,
462,
18884,
6939,
29922,
1311,
29889,
6051,
20921,
29918,
14035,
29892,
13,
462,
462,
18884,
9521,
29918,
2311,
29922,
29896,
29897,
13,
13,
4706,
1583,
29889,
842,
3149,
353,
20627,
8667,
580,
13,
4706,
1583,
29889,
842,
3149,
29918,
1491,
353,
696,
1028,
29891,
29889,
4035,
7588,
495,
877,
29885,
485,
1883,
29914,
842,
3149,
29918,
1610,
29914,
2997,
742,
20627,
8667,
29892,
13,
462,
462,
632,
6939,
29922,
1311,
29889,
842,
3149,
29918,
14035,
29892,
13,
462,
462,
632,
9521,
29918,
2311,
29922,
29896,
29897,
13,
13,
4706,
1583,
29889,
29883,
4183,
294,
353,
6024,
8862,
742,
525,
1266,
742,
525,
1627,
742,
525,
1563,
2033,
13,
4706,
1583,
29889,
3027,
29918,
1491,
7588,
2596,
353,
5159,
13,
4706,
1583,
29889,
8346,
353,
426,
29883,
29901,
316,
802,
29898,
3317,
2435,
29922,
29896,
29900,
29897,
363,
274,
297,
1583,
29889,
29883,
4183,
294,
29913,
13,
4706,
363,
10656,
297,
1583,
29889,
29883,
4183,
294,
29901,
13,
9651,
11261,
353,
285,
29915,
26065,
648,
26065,
6822,
3027,
29918,
1610,
29915,
13,
9651,
21696,
495,
353,
696,
1028,
29891,
29889,
4035,
7588,
495,
29898,
13010,
29892,
7084,
29892,
6939,
29922,
1311,
29889,
3027,
29918,
14035,
29892,
13,
462,
462,
3986,
6939,
29918,
5085,
29922,
26065,
29892,
9521,
29918,
2311,
29922,
29896,
29892,
13,
462,
462,
3986,
20487,
29918,
2311,
29922,
29906,
3579,
29871,
29906,
29946,
29897,
13,
9651,
1583,
29889,
3027,
29918,
1491,
7588,
2596,
29889,
4397,
29898,
1491,
7588,
495,
29897,
13,
13,
1678,
822,
16988,
29918,
14035,
29898,
1311,
29892,
16988,
29918,
7645,
1125,
13,
4706,
565,
16988,
29918,
7645,
29889,
5479,
1275,
525,
333,
29900,
2396,
13,
9651,
1583,
29889,
29890,
2620,
29891,
353,
16988,
29918,
7645,
13,
13,
1678,
822,
2106,
29918,
14035,
29898,
1311,
29892,
2106,
29918,
7645,
1125,
13,
4706,
1583,
29889,
3859,
353,
2106,
29918,
7645,
13,
13,
1678,
822,
10410,
29918,
14035,
29898,
1311,
29892,
10410,
29918,
7645,
1125,
13,
4706,
1583,
29889,
1062,
2760,
353,
10410,
29918,
7645,
13,
13,
1678,
822,
652,
20921,
29918,
14035,
29898,
1311,
29892,
652,
20921,
29918,
7645,
1125,
13,
4706,
363,
4660,
297,
652,
20921,
29918,
7645,
29889,
4882,
29901,
13,
9651,
565,
525,
29954,
7024,
29915,
297,
4660,
29889,
978,
29901,
13,
18884,
1583,
29889,
6051,
21780,
29918,
29887,
567,
353,
4660,
13,
13,
1678,
822,
330,
567,
29918,
14035,
29898,
1311,
29892,
330,
567,
29918,
7645,
1125,
13,
4706,
1583,
29889,
29887,
567,
353,
330,
567,
29918,
7645,
13,
13,
1678,
822,
1887,
29918,
4220,
29918,
14035,
29898,
1311,
29892,
18593,
29918,
7645,
1125,
13,
4706,
1583,
29889,
2997,
29918,
4220,
353,
18593,
29918,
7645,
13,
13,
1678,
822,
5534,
29918,
4220,
29918,
14035,
29898,
1311,
29892,
18593,
29918,
7645,
1125,
13,
4706,
1583,
29889,
10945,
29918,
4220,
353,
18593,
29918,
7645,
13,
13,
1678,
822,
731,
3149,
29918,
14035,
29898,
1311,
29892,
731,
3149,
29918,
7645,
1125,
13,
4706,
1583,
29889,
842,
3149,
353,
731,
3149,
29918,
7645,
13,
13,
1678,
822,
1967,
29918,
14035,
29898,
1311,
29892,
1967,
29918,
7645,
29892,
10656,
1125,
13,
4706,
1583,
29889,
8346,
29961,
26065,
1822,
4397,
29898,
3027,
29918,
7645,
29897,
13,
13,
1678,
822,
1002,
504,
1062,
29918,
14035,
29898,
1311,
29892,
1002,
504,
1062,
29918,
7645,
1125,
13,
13,
4706,
4315,
353,
1583,
29889,
11058,
13,
4706,
931,
29918,
710,
353,
12865,
29889,
3707,
2141,
710,
615,
603,
877,
29995,
29979,
19222,
29885,
19222,
29881,
1273,
29950,
16664,
29924,
16664,
29903,
1495,
13,
4706,
396,
931,
29918,
710,
353,
12865,
29889,
12673,
29889,
3166,
16394,
29898,
24538,
29918,
2230,
29897,
13,
13,
4706,
1426,
353,
1002,
504,
1062,
29918,
7645,
29889,
726,
13,
4706,
2775,
537,
353,
1002,
504,
1062,
29918,
7645,
29889,
344,
369,
537,
13,
4706,
10191,
353,
1002,
504,
1062,
29918,
7645,
13,
13,
4706,
2775,
537,
29918,
1127,
353,
518,
7645,
29889,
12665,
1001,
24647,
29907,
29979,
29892,
10191,
29889,
1964,
20161,
29892,
10191,
29889,
11341,
1806,
2965,
1964,
29892,
10191,
29889,
11432,
29962,
13,
4706,
2775,
537,
29918,
29136,
353,
518,
7645,
29889,
29956,
25614,
29892,
10191,
29889,
12256,
12107,
29962,
13,
4706,
2775,
537,
29918,
17821,
1705,
353,
518,
7645,
29889,
11690,
29892,
10191,
29889,
18525,
29962,
13,
13,
4706,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
29907,
29979,
2190,
13,
4706,
565,
2775,
537,
297,
2775,
537,
29918,
1127,
29901,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
19386,
13,
4706,
25342,
2775,
537,
297,
2775,
537,
29918,
29136,
29901,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
29979,
29923,
2208,
9806,
13,
4706,
25342,
2775,
537,
297,
2775,
537,
29918,
17821,
1705,
29901,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
25039,
9094,
13,
13,
4706,
1583,
29889,
726,
353,
285,
29915,
29912,
2230,
29918,
710,
6177,
426,
726,
29913,
21313,
2780,
1800,
29915,
13,
4706,
396,
4315,
29889,
1202,
710,
29898,
1311,
29889,
9012,
29892,
29871,
29900,
29892,
1480,
29892,
679,
29918,
2780,
29898,
2780,
876,
13,
13,
4706,
1583,
29889,
9012,
4619,
29871,
29896,
13,
4706,
4315,
29889,
22379,
580,
13,
13,
1678,
822,
1596,
29918,
4882,
29898,
1311,
1125,
13,
13,
4706,
4315,
353,
1583,
29889,
4882,
13,
13,
4706,
4315,
29889,
8551,
580,
13,
13,
4706,
396,
696,
1028,
29891,
29889,
1188,
3888,
29898,
4882,
29897,
13,
13,
4706,
396,
1596,
29898,
4882,
29897,
13,
4706,
921,
29918,
3891,
353,
29871,
29900,
13,
4706,
921,
29918,
12860,
353,
29871,
29896,
29946,
13,
4706,
1948,
353,
29871,
29900,
13,
13,
4706,
396,
350,
2620,
29891,
13,
4706,
16988,
29918,
25376,
482,
353,
938,
29898,
1311,
29889,
29890,
2620,
29891,
29889,
25376,
482,
334,
29871,
29896,
29900,
29900,
29897,
13,
4706,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
29907,
29979,
2190,
13,
4706,
565,
16988,
29918,
25376,
482,
1405,
29871,
29945,
29900,
29901,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
29954,
1525,
1430,
13,
4706,
25342,
16988,
29918,
25376,
482,
1405,
29871,
29906,
29945,
29901,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
29979,
29923,
2208,
9806,
13,
4706,
25342,
16988,
29918,
25376,
482,
1405,
29871,
29900,
29901,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
19386,
13,
4706,
4660,
29918,
29890,
2620,
29891,
353,
851,
29898,
29890,
2620,
29891,
29918,
25376,
482,
29897,
718,
14210,
29915,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
3891,
29892,
525,
29933,
2620,
29891,
29901,
25710,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
12860,
29892,
4660,
29918,
29890,
2620,
29891,
29892,
679,
29918,
2780,
29898,
2780,
876,
13,
4706,
1948,
4619,
29871,
29896,
13,
13,
4706,
396,
826,
2168,
13,
4706,
565,
1583,
29889,
3859,
29889,
279,
2168,
29901,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
19386,
13,
9651,
4660,
29918,
279,
2168,
353,
525,
8241,
29915,
13,
4706,
1683,
29901,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
29954,
1525,
1430,
13,
9651,
4660,
29918,
279,
2168,
353,
525,
3782,
29915,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
3891,
29892,
525,
1433,
2168,
29901,
25710,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
12860,
29892,
4660,
29918,
279,
2168,
29892,
679,
29918,
2780,
29898,
2780,
876,
13,
4706,
1948,
4619,
29871,
29896,
13,
13,
4706,
396,
21864,
13,
4706,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
29907,
29979,
2190,
13,
4706,
4464,
353,
1583,
29889,
3859,
29889,
8513,
13,
4706,
565,
4464,
29889,
27382,
2541,
877,
20656,
29949,
29374,
13,
9651,
4464,
353,
4464,
29889,
5451,
12839,
1495,
14352,
29896,
29962,
13,
4706,
4464,
353,
4464,
29889,
5030,
2410,
675,
580,
13,
13,
4706,
565,
4464,
1275,
525,
6880,
3377,
2396,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
19386,
13,
4706,
1683,
29901,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
13367,
4462,
13,
13,
4706,
565,
4464,
1275,
525,
2396,
13,
9651,
4464,
353,
525,
8516,
29915,
13,
4706,
25342,
4464,
1275,
525,
9135,
16948,
2396,
13,
9651,
4464,
353,
525,
8003,
29915,
13,
4706,
25342,
4464,
1275,
525,
29934,
15206,
2396,
13,
9651,
4464,
353,
525,
11609,
29915,
13,
13,
4706,
4660,
29918,
8513,
353,
525,
8875,
4286,
4830,
29898,
8513,
29897,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
3891,
29892,
525,
6818,
29901,
25710,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
12860,
29892,
4660,
29918,
8513,
29892,
679,
29918,
2780,
29898,
2780,
876,
13,
4706,
1948,
4619,
29871,
29896,
13,
13,
4706,
396,
7338,
2760,
4660,
13,
4706,
565,
1583,
29889,
1062,
2760,
29889,
1049,
287,
29918,
3859,
1275,
1583,
29889,
1062,
2760,
29889,
29931,
2190,
2287,
29928,
29918,
19713,
29918,
1177,
29918,
29909,
8193,
29901,
13,
9651,
4660,
29918,
1062,
2760,
353,
525,
29909,
381,
29915,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
19386,
13,
4706,
25342,
1583,
29889,
1062,
2760,
29889,
1049,
287,
29918,
3859,
1275,
1583,
29889,
1062,
2760,
29889,
29931,
2190,
2287,
29928,
29918,
19713,
29918,
29931,
9468,
4214,
29901,
13,
9651,
4660,
29918,
1062,
2760,
353,
525,
22677,
287,
29915,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
29954,
1525,
1430,
13,
4706,
25342,
1583,
29889,
1062,
2760,
29889,
1049,
287,
29918,
3859,
1275,
1583,
29889,
1062,
2760,
29889,
29931,
2190,
2287,
29928,
29918,
19713,
29918,
1164,
29918,
29954,
1672,
18783,
29901,
13,
9651,
4660,
29918,
1062,
2760,
353,
525,
3338,
618,
29915,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
29954,
1525,
1430,
13,
4706,
25342,
1583,
29889,
1062,
2760,
29889,
1049,
287,
29918,
3859,
1275,
1583,
29889,
1062,
2760,
29889,
29931,
2190,
2287,
29928,
29918,
19713,
29918,
6040,
6059,
27681,
29901,
13,
9651,
4660,
29918,
1062,
2760,
353,
525,
26772,
2696,
29915,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
19386,
13,
4706,
25342,
1583,
29889,
1062,
2760,
29889,
1049,
287,
29918,
3859,
1275,
1583,
29889,
1062,
2760,
29889,
29931,
2190,
2287,
29928,
29918,
19713,
29918,
3904,
24405,
1177,
3352,
29901,
13,
9651,
4660,
29918,
1062,
2760,
353,
525,
25263,
5598,
29915,
13,
9651,
2927,
353,
18580,
267,
29889,
15032,
1955,
29918,
29907,
29979,
2190,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
3891,
29892,
525,
2792,
29901,
25710,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
12860,
29892,
4660,
29918,
1062,
2760,
29892,
679,
29918,
2780,
29898,
2780,
876,
13,
4706,
1948,
4619,
29871,
29896,
13,
13,
4706,
396,
402,
7024,
5235,
13,
4706,
3290,
514,
3246,
353,
29871,
29900,
13,
4706,
2329,
29918,
1853,
29892,
2927,
353,
402,
7024,
29918,
25634,
29918,
4571,
1783,
29961,
29900,
29962,
13,
4706,
363,
995,
297,
1583,
29889,
6051,
21780,
29918,
29887,
567,
29889,
5975,
29901,
13,
9651,
565,
995,
29889,
1989,
1275,
525,
29903,
271,
514,
3246,
7962,
2396,
13,
18884,
3290,
514,
3246,
353,
995,
29889,
1767,
13,
9651,
25342,
995,
29889,
1989,
1275,
525,
29943,
861,
1134,
2396,
13,
18884,
2329,
29918,
1853,
29892,
2927,
353,
402,
7024,
29918,
25634,
29918,
4571,
1783,
29961,
524,
29898,
1767,
29889,
1767,
4638,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
3891,
29892,
525,
29954,
7024,
5235,
29901,
25710,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
12860,
29892,
285,
29915,
29912,
5878,
29918,
1853,
29913,
21313,
29879,
271,
514,
3246,
29913,
3290,
29897,
742,
679,
29918,
2780,
29898,
2780,
876,
13,
4706,
1948,
4619,
29871,
29906,
13,
13,
4706,
396,
402,
7024,
926,
13,
4706,
26271,
353,
1583,
29889,
29887,
567,
29889,
5066,
4279,
13,
4706,
28745,
353,
1583,
29889,
29887,
567,
29889,
5426,
4279,
13,
4706,
5272,
4279,
353,
4513,
29898,
1311,
29889,
29887,
567,
29889,
1997,
4279,
29892,
29871,
29906,
29897,
13,
4706,
4660,
29918,
29887,
567,
353,
285,
29915,
29912,
5066,
4279,
29901,
29889,
29955,
29888,
29913,
426,
5426,
4279,
29901,
29889,
29955,
29888,
29913,
426,
1997,
4279,
29901,
29889,
29906,
29888,
29913,
29871,
313,
2208,
29909,
16029,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
3891,
29892,
525,
29954,
7024,
926,
29901,
25710,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
12860,
29892,
4660,
29918,
29887,
567,
29897,
13,
4706,
1948,
4619,
29871,
29896,
13,
13,
4706,
396,
9959,
18593,
13,
4706,
282,
353,
1583,
29889,
2997,
29918,
4220,
29889,
4220,
29889,
3283,
13,
4706,
3855,
353,
1583,
29889,
2997,
29918,
4220,
29889,
4220,
29889,
20659,
13,
4706,
439,
25744,
291,
353,
518,
29939,
29889,
29916,
29892,
3855,
29889,
29891,
29892,
3855,
29889,
29920,
29892,
3855,
29889,
29893,
29962,
13,
4706,
1018,
29901,
13,
9651,
5731,
353,
390,
29889,
3166,
29918,
339,
271,
29898,
339,
25744,
291,
29897,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
5731,
353,
390,
29889,
3166,
29918,
29872,
8584,
877,
1537,
29916,
742,
518,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
2314,
13,
4706,
343,
1450,
29892,
15905,
29892,
9679,
353,
5731,
29889,
294,
29918,
29872,
8584,
877,
1537,
29916,
742,
14496,
29922,
5574,
29897,
13,
4706,
921,
29892,
343,
29892,
503,
353,
4513,
29898,
29886,
29889,
29916,
29892,
29871,
29906,
511,
4513,
29898,
29886,
29889,
29891,
29892,
29871,
29906,
511,
4513,
29898,
29886,
29889,
29920,
29892,
29871,
29906,
29897,
13,
4706,
343,
1450,
29892,
15905,
29892,
9679,
353,
938,
29898,
29891,
1450,
511,
938,
29898,
29886,
2335,
511,
938,
29898,
1245,
29897,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
3891,
29892,
525,
7717,
926,
29901,
25710,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
12860,
29892,
285,
29915,
29912,
29916,
29901,
29889,
29906,
29888,
29913,
426,
29891,
29901,
29889,
29906,
29888,
29913,
426,
29920,
29901,
29889,
29906,
29888,
29913,
313,
18454,
29999,
29897,
1678,
426,
1245,
29913,
426,
29886,
2335,
29913,
426,
29891,
1450,
29913,
313,
29934,
20055,
29897,
1495,
13,
4706,
1948,
4619,
29871,
29896,
13,
13,
4706,
396,
12002,
18593,
13,
4706,
282,
353,
1583,
29889,
10945,
29918,
4220,
29889,
4220,
29889,
3283,
13,
4706,
3855,
353,
1583,
29889,
10945,
29918,
4220,
29889,
4220,
29889,
20659,
13,
4706,
439,
25744,
291,
353,
518,
29939,
29889,
29916,
29892,
3855,
29889,
29891,
29892,
3855,
29889,
29920,
29892,
3855,
29889,
29893,
29962,
13,
4706,
1018,
29901,
13,
9651,
5731,
353,
390,
29889,
3166,
29918,
339,
271,
29898,
339,
25744,
291,
29897,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
5731,
353,
390,
29889,
3166,
29918,
29872,
8584,
877,
1537,
29916,
742,
518,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
2314,
13,
4706,
343,
1450,
29892,
15905,
29892,
9679,
353,
5731,
29889,
294,
29918,
29872,
8584,
877,
1537,
29916,
742,
14496,
29922,
5574,
29897,
13,
4706,
921,
29892,
343,
29892,
503,
353,
4513,
29898,
29886,
29889,
29916,
29892,
29871,
29906,
511,
4513,
29898,
29886,
29889,
29891,
29892,
29871,
29906,
511,
4513,
29898,
29886,
29889,
29920,
29892,
29871,
29906,
29897,
13,
4706,
343,
1450,
29892,
15905,
29892,
9679,
353,
938,
29898,
29891,
1450,
511,
938,
29898,
29886,
2335,
511,
938,
29898,
1245,
29897,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
3891,
29892,
525,
12756,
926,
29901,
25710,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
12860,
29892,
285,
29915,
29912,
29916,
29901,
29889,
29906,
29888,
29913,
426,
29891,
29901,
29889,
29906,
29888,
29913,
426,
29920,
29901,
29889,
29906,
29888,
29913,
313,
18454,
29999,
29897,
1678,
426,
1245,
29913,
426,
29886,
2335,
29913,
426,
29891,
1450,
29913,
313,
29934,
20055,
29897,
1495,
13,
4706,
1948,
4619,
29871,
29896,
13,
13,
4706,
396,
3789,
3149,
13,
4706,
325,
353,
1583,
29889,
842,
3149,
29889,
955,
25245,
13,
4706,
325,
29916,
29892,
10195,
29892,
325,
29920,
353,
4513,
29898,
29894,
29889,
29916,
29892,
29871,
29906,
511,
4513,
29898,
29894,
29889,
29891,
29892,
29871,
29906,
511,
4513,
29898,
29894,
29889,
29920,
29892,
29871,
29906,
29897,
13,
4706,
343,
1450,
353,
938,
29898,
9302,
29889,
3665,
29906,
12163,
29898,
1311,
29889,
842,
3149,
29889,
29891,
1450,
876,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
3891,
29892,
525,
2697,
3149,
29901,
25710,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
12860,
29892,
285,
29915,
29912,
29894,
29916,
29901,
29889,
29906,
29888,
29913,
426,
13308,
29901,
29889,
29906,
29888,
29913,
426,
29894,
29920,
29901,
29889,
29906,
29888,
29913,
313,
18454,
29999,
29897,
1678,
426,
29891,
1450,
29913,
313,
29979,
29897,
1495,
13,
4706,
1948,
4619,
29871,
29896,
13,
13,
4706,
396,
20939,
294,
13,
4706,
3005,
29939,
29879,
353,
426,
29883,
29901,
29871,
29900,
363,
274,
297,
1583,
29889,
29883,
4183,
294,
29913,
13,
4706,
363,
3949,
29892,
7191,
297,
1583,
29889,
8346,
29889,
7076,
7295,
13,
9651,
3005,
29939,
29879,
29961,
11108,
29962,
353,
10868,
29918,
3166,
29918,
19158,
29898,
19158,
29897,
13,
4706,
14336,
29892,
1424,
29892,
285,
29890,
29892,
1652,
353,
518,
524,
29898,
14486,
29898,
29894,
876,
363,
413,
29892,
325,
297,
3005,
29939,
29879,
29889,
7076,
580,
29962,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
3891,
29892,
525,
29907,
4183,
294,
29901,
25710,
13,
4706,
4315,
29889,
1202,
710,
29898,
798,
29892,
921,
29918,
12860,
29892,
285,
29915,
29912,
600,
29913,
426,
1341,
29913,
426,
14943,
29913,
426,
1579,
29913,
29871,
313,
8862,
1492,
1250,
2175,
518,
12661,
2314,
1495,
13,
4706,
1948,
4619,
29871,
29896,
13,
13,
4706,
4315,
29889,
22379,
580,
13,
4706,
1583,
29889,
10525,
29889,
22379,
580,
13,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
4706,
6554,
353,
696,
1028,
29891,
29889,
19907,
29898,
1311,
29889,
10492,
29897,
13,
4706,
1018,
29901,
13,
9651,
1550,
451,
696,
1028,
29891,
29889,
275,
29918,
845,
329,
3204,
7295,
13,
18884,
1583,
29889,
2158,
29918,
4882,
580,
13,
18884,
6554,
29889,
17059,
580,
13,
4706,
5174,
696,
1028,
29891,
29889,
1672,
29903,
4074,
6685,
2451,
29901,
13,
9651,
18580,
267,
29889,
10763,
8690,
580,
13,
9651,
1583,
29889,
10525,
29889,
446,
1478,
328,
29898,
8824,
29897,
13,
9651,
18580,
267,
29889,
8057,
580,
13,
13,
13,
1753,
18580,
267,
29918,
3396,
29898,
10525,
1125,
13,
1678,
16034,
4247,
29898,
10525,
467,
3389,
580,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
1018,
29901,
13,
4706,
18580,
267,
29889,
17699,
29898,
29883,
1295,
267,
29918,
3396,
29897,
13,
1678,
5174,
696,
1028,
29891,
29889,
1672,
29903,
4074,
6685,
2451,
29901,
13,
4706,
1209,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
2
] |
packages/submodopt/submodopt/__init__.py | toruurakawa/DiPS | 75 | 57882 | <filename>packages/submodopt/submodopt/__init__.py<gh_stars>10-100
"""submodopt - A package for maximizing submodular functions"""
__version__ = '0.1.0'
__author__ = '<NAME> <<EMAIL>>'
__all__ = []
| [
1,
529,
9507,
29958,
8318,
29914,
1491,
1545,
3670,
29914,
1491,
1545,
3670,
29914,
1649,
2344,
26914,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
15945,
29908,
1491,
1545,
3670,
448,
319,
3577,
363,
5256,
5281,
1014,
1545,
1070,
3168,
15945,
29908,
13,
13,
1649,
3259,
1649,
353,
525,
29900,
29889,
29896,
29889,
29900,
29915,
13,
1649,
8921,
1649,
353,
12801,
5813,
29958,
3532,
26862,
6227,
6778,
29915,
13,
1649,
497,
1649,
353,
5159,
13,
2
] |
tests/mysensors-display.py | paulino/home-assistant-text-display | 0 | 193729 | """
Testing "gatewayserial.ino" at examples folder
Dep:
- https://github.com/theolind/pymysensors
- pip3 install pymysensors)
Raw commands using mysensors serial API
(https://www.mysensors.org/download/serial_api_20)
DISPLAY_OFF: 0;1;1;0;47;10
DISPLAY_ON: 0;1;1;0;47;11
CURSOR_OFF: 0;1;1;0;47;20
"""
import mysensors.mysensors as mysensors
import time
import sys
SERIAL_PORT="/dev/ttyUSB0"
DISPLAY_CLEAR = '30'
DISPLAY_ON = '11'
DISPLAY_OFF = '10'
BACKLIGHT = '1' # + 1 byte (1 .. 8)
CURSOR_ON = '21'
CURSOR_OFF = '20'
BLINK_CURSOR_ON = '40'
BLINK_CURSOR_OFF = '41'
def event_callback(msg):
"""Callback for mysensors updates."""
print('MSG | '\
' NodeId: {} | ChildId: {} | Type:{}'.format(
msg.node_id,msg.child_id,msg.type)
)
GATEWAY = mysensors.SerialGateway(
port = SERIAL_PORT,
baud = 115200,
event_callback = event_callback,
protocol_version='2.2')
GATEWAY.start()
# To set sensor 1, child 1, sub-type V_LIGHT (= 2), with value 1.
print("Wait for gateway ...")
time.sleep(2)
print("Sensors detected: {}".format(len(GATEWAY.sensors)))
is_sensor = GATEWAY.is_sensor(0,1)
# Check if there is a sensor
print('Check for a valid sensor at node 0 child 1: {}'.format(is_sensor))
### Start Test
print("Clear Screen ...")
GATEWAY.set_child_value(0, 1, 47, DISPLAY_CLEAR)
time.sleep(2)
print("Display OFF ...")
GATEWAY.set_child_value(0, 1, 47, DISPLAY_OFF)
time.sleep(2)
print("Display ON ...")
GATEWAY.set_child_value(0, 1, 47, DISPLAY_ON)
time.sleep(2)
print("Set BACKLIGHT 0 ...")
GATEWAY.set_child_value(0, 1, 47, BACKLIGHT + '0')
time.sleep(2)
print("Set BACKLIGHT 1 ...")
GATEWAY.set_child_value(0, 1, 47, BACKLIGHT + '1')
time.sleep(2)
print("Set BACKLIGHT 5 ...")
GATEWAY.set_child_value(0, 1, 47, BACKLIGHT + '5')
time.sleep(2)
col = 0
counter = 0
while True:
time.sleep(1)
counter = counter + 1
print("Set CURSOR_OFF ")
GATEWAY.set_child_value(0, 1, 47, CURSOR_OFF)
GATEWAY.set_child_value(0, 1, 47, BLINK_CURSOR_OFF)
time.sleep(2)
print("Send Hello at row 0 col 0")
GATEWAY.set_child_value(0, 1, 47, "AAHello at line 1")
print("Send text to row 1 col 1")
GATEWAY.set_child_value(0, 1, 47, "BBRow 2")
print("Send counter to row 2 col 10")
GATEWAY.set_child_value(0, 1, 47, "KCCount:{}".format(counter))
print("Moving text")
text = chr(ord('A') + col) + 'D <move> '
GATEWAY.set_child_value(0, 1, 47, text)
time.sleep(2)
print("Set CURSOR_ON ")
GATEWAY.set_child_value(0, 1, 47, CURSOR_ON)
if col < 10:
col = col +1
else:
col = 0
time.sleep(5) # Wait before clear screen @BUG
print("Clear screen")
GATEWAY.set_child_value(0, 1, 47, DISPLAY_CLEAR)
| [
1,
9995,
13,
1678,
4321,
292,
376,
17062,
1582,
15550,
29889,
1789,
29908,
472,
6455,
4138,
13,
13,
1678,
10034,
29901,
13,
4706,
448,
2045,
597,
3292,
29889,
510,
29914,
1552,
324,
513,
29914,
29886,
962,
952,
575,
943,
13,
4706,
448,
8450,
29941,
2601,
282,
962,
952,
575,
943,
29897,
13,
13,
13,
1678,
22038,
8260,
773,
590,
23149,
943,
7797,
3450,
13,
4706,
313,
991,
597,
1636,
29889,
5781,
575,
943,
29889,
990,
29914,
10382,
29914,
15550,
29918,
2754,
29918,
29906,
29900,
29897,
13,
13,
1678,
28657,
29925,
18799,
29918,
27681,
29901,
29871,
29900,
29936,
29896,
29936,
29896,
29936,
29900,
29936,
29946,
29955,
29936,
29896,
29900,
13,
1678,
28657,
29925,
18799,
29918,
1164,
29901,
29871,
29900,
29936,
29896,
29936,
29896,
29936,
29900,
29936,
29946,
29955,
29936,
29896,
29896,
13,
1678,
315,
4574,
29903,
1955,
29918,
27681,
29901,
29871,
29900,
29936,
29896,
29936,
29896,
29936,
29900,
29936,
29946,
29955,
29936,
29906,
29900,
13,
13,
15945,
29908,
13,
13,
5215,
590,
23149,
943,
29889,
5781,
575,
943,
408,
590,
23149,
943,
13,
5215,
931,
13,
5215,
10876,
13,
13,
6304,
25758,
29918,
15082,
13802,
3359,
29914,
4349,
29965,
1744,
29900,
29908,
13,
13,
23711,
29925,
18799,
29918,
29907,
1307,
1718,
353,
525,
29941,
29900,
29915,
13,
23711,
29925,
18799,
29918,
1164,
29871,
353,
525,
29896,
29896,
29915,
13,
23711,
29925,
18799,
29918,
27681,
29871,
353,
525,
29896,
29900,
29915,
13,
29933,
11375,
5265,
29954,
3912,
353,
525,
29896,
29915,
418,
396,
718,
29871,
29896,
7023,
313,
29896,
6317,
29871,
29947,
29897,
13,
22484,
29903,
1955,
29918,
1164,
353,
525,
29906,
29896,
29915,
13,
22484,
29903,
1955,
29918,
27681,
353,
525,
29906,
29900,
29915,
13,
13367,
1177,
29968,
29918,
22484,
29903,
1955,
29918,
1164,
353,
525,
29946,
29900,
29915,
13,
13367,
1177,
29968,
29918,
22484,
29903,
1955,
29918,
27681,
353,
525,
29946,
29896,
29915,
13,
13,
13,
1753,
1741,
29918,
14035,
29898,
7645,
1125,
13,
1678,
9995,
10717,
363,
590,
23149,
943,
11217,
1213,
15945,
13,
13,
1678,
1596,
877,
4345,
29954,
891,
11297,
13,
4706,
525,
9071,
1204,
29901,
6571,
891,
10517,
1204,
29901,
6571,
29871,
891,
5167,
29901,
8875,
4286,
4830,
29898,
13,
9651,
10191,
29889,
3177,
29918,
333,
29892,
7645,
29889,
5145,
29918,
333,
29892,
7645,
29889,
1853,
29897,
13,
4706,
1723,
13,
13,
29954,
3040,
12982,
29979,
353,
590,
23149,
943,
29889,
9125,
29954,
403,
1582,
29898,
13,
1678,
2011,
353,
26996,
25758,
29918,
15082,
29892,
13,
1678,
9922,
566,
353,
29871,
29896,
29896,
29945,
29906,
29900,
29900,
29892,
13,
1678,
1741,
29918,
14035,
353,
1741,
29918,
14035,
29892,
13,
1678,
9608,
29918,
3259,
2433,
29906,
29889,
29906,
1495,
13,
13,
13,
29954,
3040,
12982,
29979,
29889,
2962,
580,
13,
29937,
1763,
731,
23530,
29871,
29896,
29892,
2278,
29871,
29896,
29892,
1014,
29899,
1853,
478,
29918,
5265,
29954,
3912,
11070,
29871,
29906,
511,
411,
995,
29871,
29896,
29889,
13,
13,
2158,
703,
15716,
363,
28646,
2023,
1159,
13,
2230,
29889,
17059,
29898,
29906,
29897,
13,
2158,
703,
29903,
575,
943,
17809,
29901,
6571,
1642,
4830,
29898,
2435,
29898,
29954,
3040,
12982,
29979,
29889,
23149,
943,
4961,
13,
13,
275,
29918,
29879,
6073,
353,
402,
3040,
12982,
29979,
29889,
275,
29918,
29879,
6073,
29898,
29900,
29892,
29896,
29897,
13,
29937,
5399,
565,
727,
338,
263,
23530,
13,
2158,
877,
5596,
363,
263,
2854,
23530,
472,
2943,
29871,
29900,
2278,
29871,
29896,
29901,
6571,
4286,
4830,
29898,
275,
29918,
29879,
6073,
876,
13,
13,
13,
2277,
29937,
7370,
4321,
13,
13,
2158,
703,
18759,
22666,
2023,
1159,
13,
29954,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
28657,
29925,
18799,
29918,
29907,
1307,
1718,
29897,
13,
2230,
29889,
17059,
29898,
29906,
29897,
13,
13,
2158,
703,
9323,
438,
4198,
2023,
1159,
13,
29954,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
28657,
29925,
18799,
29918,
27681,
29897,
13,
2230,
29889,
17059,
29898,
29906,
29897,
13,
13,
2158,
703,
9323,
6732,
2023,
1159,
13,
29954,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
28657,
29925,
18799,
29918,
1164,
29897,
13,
2230,
29889,
17059,
29898,
29906,
29897,
13,
13,
2158,
703,
2697,
350,
11375,
5265,
29954,
3912,
29871,
29900,
2023,
1159,
13,
29954,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
350,
11375,
5265,
29954,
3912,
718,
525,
29900,
1495,
13,
2230,
29889,
17059,
29898,
29906,
29897,
13,
13,
2158,
703,
2697,
350,
11375,
5265,
29954,
3912,
29871,
29896,
2023,
1159,
13,
29954,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
350,
11375,
5265,
29954,
3912,
718,
525,
29896,
1495,
13,
2230,
29889,
17059,
29898,
29906,
29897,
13,
13,
13,
2158,
703,
2697,
350,
11375,
5265,
29954,
3912,
29871,
29945,
2023,
1159,
13,
29954,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
350,
11375,
5265,
29954,
3912,
718,
525,
29945,
1495,
13,
2230,
29889,
17059,
29898,
29906,
29897,
13,
13,
13,
1054,
353,
29871,
29900,
13,
11808,
353,
29871,
29900,
13,
8000,
5852,
29901,
13,
1678,
931,
29889,
17059,
29898,
29896,
29897,
13,
1678,
6795,
353,
6795,
718,
29871,
29896,
13,
13,
1678,
1596,
703,
2697,
315,
4574,
29903,
1955,
29918,
27681,
16521,
13,
1678,
402,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
315,
4574,
29903,
1955,
29918,
27681,
29897,
13,
1678,
402,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
350,
23714,
29968,
29918,
22484,
29903,
1955,
29918,
27681,
29897,
13,
1678,
931,
29889,
17059,
29898,
29906,
29897,
13,
13,
13,
1678,
1596,
703,
12600,
15043,
472,
1948,
29871,
29900,
784,
29871,
29900,
1159,
13,
1678,
402,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
376,
6344,
10994,
472,
1196,
29871,
29896,
1159,
13,
13,
1678,
1596,
703,
12600,
1426,
304,
1948,
29871,
29896,
784,
29871,
29896,
1159,
13,
1678,
402,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
376,
14388,
4301,
29871,
29906,
1159,
13,
1678,
1596,
703,
12600,
6795,
304,
1948,
29871,
29906,
784,
29871,
29896,
29900,
1159,
13,
1678,
402,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
376,
29968,
29907,
3981,
29901,
8875,
1642,
4830,
29898,
11808,
876,
13,
13,
1678,
1596,
703,
29924,
21081,
1426,
1159,
13,
1678,
1426,
353,
18460,
29898,
536,
877,
29909,
1495,
718,
784,
29897,
718,
525,
29928,
529,
11631,
29958,
525,
13,
1678,
402,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
1426,
29897,
13,
13,
1678,
931,
29889,
17059,
29898,
29906,
29897,
13,
1678,
1596,
703,
2697,
315,
4574,
29903,
1955,
29918,
1164,
16521,
13,
1678,
402,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
315,
4574,
29903,
1955,
29918,
1164,
29897,
13,
13,
13,
13,
1678,
565,
784,
529,
29871,
29896,
29900,
29901,
13,
4706,
784,
353,
784,
718,
29896,
13,
1678,
1683,
29901,
13,
4706,
784,
353,
29871,
29900,
13,
4706,
931,
29889,
17059,
29898,
29945,
29897,
396,
20340,
1434,
2821,
4315,
732,
11578,
13,
4706,
1596,
703,
18759,
4315,
1159,
13,
4706,
402,
3040,
12982,
29979,
29889,
842,
29918,
5145,
29918,
1767,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29955,
29892,
28657,
29925,
18799,
29918,
29907,
1307,
1718,
29897,
13,
13,
13,
13,
13,
13,
13,
13,
2
] |
flask_api_server/api_server.py | gdcrocx/CiscoDevNetHackathonToronto | 0 | 101283 | from flask import Flask, render_template, request, redirect, url_for
from bson import ObjectId
from pymongo import MongoClient
import os
app = Flask(__name__)
title = "Paste-Wise"
heading = "Paste-Wise Dashboard"
mongoClient = MongoClient("mongodb://10.4.64.209:27017") # host uri
dbObject = mongoClient.webex_teams # Select the database
dbCollection = dbObject.paste_log # Select the collection name
def redirect_url():
return request.args.get('next') or \
request.referrer or \
url_for('index')
@app.route("/")
def allLogs():
logItem = dbCollection.find()
return render_template('index.html', mode="get", logs=logItem, t=title, h=heading)
@app.route("/<string:log_id>", methods=['GET'])
def getLog(log_id):
logItem = dbCollection.find({"_id": ObjectId(log_id) })
return render_template('index.html', mode="get", logs=logItem, t=title, h=heading)
@app.route("/<string:log_id>", methods=['DELETE'])
def deleteLog(log_id):
logItem = dbCollection.find_one_and_delete({"_id": ObjectId(log_id) })
return render_template('index.html', mode="delete", logs=logItem, t=title, h=heading)
# @app.route('/todo/api/v1.0/tasks/<int:task_id>', methods=['DELETE'])
# def delete_task(task_id):
# task = [task for task in tasks if task['id'] == task_id]
# if len(task) == 0:
# abort(404)
# tasks.remove(task[0])
# return jsonify({'result': True})
if __name__ == "__main__":
app.run(host= '0.0.0.0', port=3010)
| [
1,
515,
29784,
1053,
2379,
1278,
29892,
4050,
29918,
6886,
29892,
2009,
29892,
6684,
29892,
3142,
29918,
1454,
13,
3166,
289,
1100,
1053,
4669,
1204,
13,
3166,
282,
962,
7443,
1053,
18294,
4032,
13,
5215,
2897,
13,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
13,
3257,
353,
376,
29925,
4350,
29899,
29956,
895,
29908,
13,
2813,
292,
353,
376,
29925,
4350,
29899,
29956,
895,
360,
1161,
3377,
29908,
13,
13,
29885,
7443,
4032,
353,
18294,
4032,
703,
23264,
597,
29896,
29900,
29889,
29946,
29889,
29953,
29946,
29889,
29906,
29900,
29929,
29901,
29906,
29955,
29900,
29896,
29955,
1159,
29871,
396,
3495,
21333,
13,
2585,
2061,
353,
19476,
4032,
29889,
2676,
735,
29918,
371,
2232,
29871,
396,
7605,
278,
2566,
13,
2585,
7196,
353,
4833,
2061,
29889,
16179,
29918,
1188,
29871,
396,
7605,
278,
4333,
1024,
13,
13,
13,
1753,
6684,
29918,
2271,
7295,
13,
1678,
736,
2009,
29889,
5085,
29889,
657,
877,
4622,
1495,
470,
320,
13,
4706,
2009,
29889,
276,
3735,
470,
320,
13,
4706,
3142,
29918,
1454,
877,
2248,
1495,
13,
13,
29992,
932,
29889,
13134,
11974,
1159,
13,
1753,
599,
3403,
29879,
7295,
268,
13,
1678,
1480,
2001,
353,
4833,
7196,
29889,
2886,
580,
13,
1678,
736,
4050,
29918,
6886,
877,
2248,
29889,
1420,
742,
4464,
543,
657,
613,
10748,
29922,
1188,
2001,
29892,
260,
29922,
3257,
29892,
298,
29922,
2813,
292,
29897,
13,
268,
13,
29992,
932,
29889,
13134,
11974,
29966,
1807,
29901,
1188,
29918,
333,
28341,
3519,
29922,
1839,
7194,
11287,
13,
1753,
679,
3403,
29898,
1188,
29918,
333,
1125,
268,
13,
1678,
1480,
2001,
353,
4833,
7196,
29889,
2886,
3319,
29908,
29918,
333,
1115,
4669,
1204,
29898,
1188,
29918,
333,
29897,
5615,
268,
13,
1678,
736,
4050,
29918,
6886,
877,
2248,
29889,
1420,
742,
4464,
543,
657,
613,
10748,
29922,
1188,
2001,
29892,
260,
29922,
3257,
29892,
298,
29922,
2813,
292,
29897,
13,
13,
29992,
932,
29889,
13134,
11974,
29966,
1807,
29901,
1188,
29918,
333,
28341,
3519,
29922,
1839,
2287,
18476,
11287,
13,
1753,
5217,
3403,
29898,
1188,
29918,
333,
1125,
268,
13,
1678,
1480,
2001,
353,
4833,
7196,
29889,
2886,
29918,
650,
29918,
392,
29918,
8143,
3319,
29908,
29918,
333,
1115,
4669,
1204,
29898,
1188,
29918,
333,
29897,
5615,
13,
1678,
736,
4050,
29918,
6886,
877,
2248,
29889,
1420,
742,
4464,
543,
8143,
613,
10748,
29922,
1188,
2001,
29892,
260,
29922,
3257,
29892,
298,
29922,
2813,
292,
29897,
13,
13,
29937,
732,
932,
29889,
13134,
11219,
29873,
8144,
29914,
2754,
29914,
29894,
29896,
29889,
29900,
29914,
20673,
29914,
29966,
524,
29901,
7662,
29918,
333,
29958,
742,
3519,
29922,
1839,
2287,
18476,
11287,
13,
29937,
822,
5217,
29918,
7662,
29898,
7662,
29918,
333,
1125,
13,
29937,
268,
3414,
353,
518,
7662,
363,
3414,
297,
9595,
565,
3414,
1839,
333,
2033,
1275,
3414,
29918,
333,
29962,
13,
29937,
268,
565,
7431,
29898,
7662,
29897,
1275,
29871,
29900,
29901,
13,
29937,
308,
27450,
29898,
29946,
29900,
29946,
29897,
13,
29937,
268,
9595,
29889,
5992,
29898,
7662,
29961,
29900,
2314,
13,
29937,
268,
736,
4390,
1598,
3319,
29915,
2914,
2396,
5852,
1800,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
13,
1678,
623,
29889,
3389,
29898,
3069,
29922,
525,
29900,
29889,
29900,
29889,
29900,
29889,
29900,
742,
2011,
29922,
29941,
29900,
29896,
29900,
29897,
13,
2
] |
hello_app/migrations/0002_auto_20160321_0846.py | Lessica/StatusHub | 0 | 148663 | <reponame>Lessica/StatusHub
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-21 08:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hello_app', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='resphostmodel',
old_name='expected_method',
new_name='match_method',
),
migrations.RemoveField(
model_name='resphostmodel',
name='expected_contents',
),
migrations.AddField(
model_name='resphostmodel',
name='expected_body',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='resphostmodel',
name='expected_headers',
field=models.TextField(blank=True),
),
]
| [
1,
529,
276,
1112,
420,
29958,
29931,
404,
983,
29914,
5709,
16046,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
3251,
630,
491,
15337,
29871,
29896,
29889,
29929,
29889,
29906,
373,
29871,
29906,
29900,
29896,
29953,
29899,
29900,
29941,
29899,
29906,
29896,
29871,
29900,
29947,
29901,
29946,
29953,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
12199,
29918,
932,
742,
525,
29900,
29900,
29900,
29896,
29918,
11228,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
29934,
3871,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
690,
561,
520,
4299,
742,
13,
9651,
2030,
29918,
978,
2433,
9684,
29918,
5696,
742,
13,
9651,
716,
29918,
978,
2433,
4352,
29918,
5696,
742,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
15941,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
690,
561,
520,
4299,
742,
13,
9651,
1024,
2433,
9684,
29918,
10853,
742,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
690,
561,
520,
4299,
742,
13,
9651,
1024,
2433,
9684,
29918,
2587,
742,
13,
9651,
1746,
29922,
9794,
29889,
15778,
29898,
19465,
29922,
5574,
511,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
690,
561,
520,
4299,
742,
13,
9651,
1024,
2433,
9684,
29918,
13662,
742,
13,
9651,
1746,
29922,
9794,
29889,
15778,
29898,
19465,
29922,
5574,
511,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
create_sp_model.py | pwldj/nls | 0 | 99910 | <reponame>pwldj/nls
import sentencepiece as spm
import os
dir = 'raw_data'
files = os.listdir(dir)
files = ','.join([dir+'/'+x for x in files])
spm.SentencePieceTrainer.train(input='raw_data/0_wiki_en.txt', model_prefix='30k_spm', vocab_size=32000,
input_sentence_size=3000000, shuffle_input_sentence=True,
unk_piece='[UNK]', pad_piece='[PAD]', user_defined_symbols=['[CLS]', '[SEP]', '[MASK]'])
| [
1,
529,
276,
1112,
420,
29958,
29886,
29893,
430,
29926,
29914,
29876,
3137,
13,
5215,
10541,
12343,
346,
408,
805,
29885,
13,
5215,
2897,
13,
13,
3972,
353,
525,
1610,
29918,
1272,
29915,
13,
13,
5325,
353,
2897,
29889,
1761,
3972,
29898,
3972,
29897,
13,
5325,
353,
13420,
4286,
7122,
4197,
3972,
23097,
29914,
18717,
29916,
363,
921,
297,
2066,
2314,
13,
1028,
29885,
29889,
29903,
296,
663,
29925,
347,
346,
5323,
4983,
29889,
14968,
29898,
2080,
2433,
1610,
29918,
1272,
29914,
29900,
29918,
4594,
29918,
264,
29889,
3945,
742,
1904,
29918,
13506,
2433,
29941,
29900,
29895,
29918,
1028,
29885,
742,
7931,
370,
29918,
2311,
29922,
29941,
29906,
29900,
29900,
29900,
29892,
13,
462,
1669,
1881,
29918,
18616,
663,
29918,
2311,
29922,
29941,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
528,
21897,
29918,
2080,
29918,
18616,
663,
29922,
5574,
29892,
13,
462,
1669,
443,
29895,
29918,
12343,
346,
2433,
29961,
3904,
29968,
29962,
742,
17132,
29918,
12343,
346,
2433,
29961,
29925,
3035,
29962,
742,
1404,
29918,
12119,
29918,
18098,
29879,
29922,
1839,
29961,
6154,
29903,
29962,
742,
525,
29961,
1660,
29925,
29962,
742,
525,
29961,
1529,
16033,
29962,
11287,
13,
2
] |
threads/migrations/0002_auto_20170909_1106.py | GunnerJnr/we_are_social_project | 4 | 125461 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-09 10:06
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('threads', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='thread',
old_name='Subject',
new_name='subject',
),
]
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
3251,
630,
491,
15337,
29871,
29896,
29889,
29896,
29896,
29889,
29946,
373,
29871,
29906,
29900,
29896,
29955,
29899,
29900,
29929,
29899,
29900,
29929,
29871,
29896,
29900,
29901,
29900,
29953,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
28993,
742,
525,
29900,
29900,
29900,
29896,
29918,
11228,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
29934,
3871,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
7097,
742,
13,
9651,
2030,
29918,
978,
2433,
20622,
742,
13,
9651,
716,
29918,
978,
2433,
16009,
742,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
resize_lfw.py | corganhejijun/frontal-face-trans | 0 | 93623 | from src.resize_for_train import getTrainImg
DATA_SET = "datasets/lfw_trans"
OUT_DIR = "datasets/lfw_resize_for_train_128"
MARGIN_FILE = "datasets/lfw_resize_margin_128.txt"
IMAGE_SIZE = 128
getTrainImg(DATA_SET, IMAGE_SIZE, OUT_DIR, MARGIN_FILE) | [
1,
515,
4765,
29889,
21476,
29918,
1454,
29918,
14968,
1053,
679,
5323,
262,
25518,
13,
13,
14573,
29918,
10490,
353,
376,
14538,
1691,
29914,
29880,
25051,
29918,
3286,
29908,
13,
12015,
29918,
9464,
353,
376,
14538,
1691,
29914,
29880,
25051,
29918,
21476,
29918,
1454,
29918,
14968,
29918,
29896,
29906,
29947,
29908,
13,
1529,
29934,
29954,
1177,
29918,
7724,
353,
376,
14538,
1691,
29914,
29880,
25051,
29918,
21476,
29918,
9264,
29918,
29896,
29906,
29947,
29889,
3945,
29908,
13,
13,
2382,
29918,
14226,
353,
29871,
29896,
29906,
29947,
13,
13,
657,
5323,
262,
25518,
29898,
14573,
29918,
10490,
29892,
306,
1529,
1692,
29918,
14226,
29892,
19474,
29918,
9464,
29892,
23851,
29954,
1177,
29918,
7724,
29897,
29871,
2
] |
demos/DPSRGAN/dpsrmodels/basicblock.py | hduba/MDF | 1 | 30650 | from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Module
'''
# ===================================
# Advanced nn.Sequential
# reform nn.Sequentials and nn.Modules
# to a single nn.Sequential
# ===================================
'''
def sequential(*args):
if len(args) == 1:
if isinstance(args[0], OrderedDict):
raise NotImplementedError('sequential does not support OrderedDict input.')
return args[0] # No sequential is needed.
modules = []
for module in args:
if isinstance(module, nn.Sequential):
for submodule in module.children():
modules.append(submodule)
elif isinstance(module, nn.Module):
modules.append(module)
return nn.Sequential(*modules)
'''
# ===================================
# Useful blocks
# --------------------------------
# conv (+ normaliation + relu)
# concat
# sum
# resblock (ResBlock)
# resdenseblock (ResidualDenseBlock_5C)
# resinresdenseblock (RRDB)
# ===================================
'''
# -------------------------------------------------------
# return nn.Sequantial of (Conv + BN + ReLU)
# -------------------------------------------------------
def conv(in_channels=64, out_channels=64, kernel_size=3, stride=1, padding=1, bias=True, mode='CBR'):
L = []
for t in mode:
if t == 'C':
L.append(nn.Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=kernel_size, stride=stride, padding=padding, bias=bias))
elif t == 'T':
L.append(nn.ConvTranspose2d(in_channels=in_channels, out_channels=out_channels, kernel_size=kernel_size, stride=stride, padding=padding, bias=bias))
elif t == 'B':
L.append(nn.BatchNorm2d(out_channels, momentum=0.9, eps=1e-04, affine=True))
elif t == 'I':
L.append(nn.InstanceNorm2d(out_channels, affine=True))
elif t == 'R':
L.append(nn.ReLU(inplace=True))
elif t == 'r':
L.append(nn.ReLU(inplace=False))
elif t == 'L':
L.append(nn.LeakyReLU(negative_slope=1e-1, inplace=True))
elif t == 'l':
L.append(nn.LeakyReLU(negative_slope=1e-1, inplace=False))
elif t == '2':
L.append(nn.PixelShuffle(upscale_factor=2))
elif t == '3':
L.append(nn.PixelShuffle(upscale_factor=3))
elif t == '4':
L.append(nn.PixelShuffle(upscale_factor=4))
elif t == 'U':
L.append(nn.Upsample(scale_factor=2, mode='nearest'))
elif t == 'u':
L.append(nn.Upsample(scale_factor=3, mode='nearest'))
elif t == 'M':
L.append(nn.MaxPool2d(kernel_size=kernel_size, stride=stride, padding=0))
elif t == 'A':
L.append(nn.AvgPool2d(kernel_size=kernel_size, stride=stride, padding=0))
else:
raise NotImplementedError('Undefined type: '.format(t))
return sequential(*L)
class MeanShift(nn.Conv2d):
def __init__(self, rgb_range=255, rgb_mean=(0.4488, 0.4371, 0.4040), rgb_std=(1.0, 1.0, 1.0), sign=-1):
super(MeanShift, self).__init__(3, 3, kernel_size=1)
std = torch.Tensor(rgb_std)
self.weight.data = torch.eye(3).view(3, 3, 1, 1) / std.view(3, 1, 1, 1)
self.bias.data = sign * rgb_range * torch.Tensor(rgb_mean) / std
for p in self.parameters():
p.requires_grad = False
# -------------------------------------------------------
# Concat the output of a submodule to its input
# -------------------------------------------------------
class ConcatBlock(nn.Module):
def __init__(self, submodule):
super(ConcatBlock, self).__init__()
self.sub = submodule
def forward(self, x):
output = torch.cat((x, self.sub(x)), dim=1)
return output
def __repr__(self):
return self.sub.__repr__() + 'concat'
# -------------------------------------------------------
# Elementwise sum the output of a submodule to its input
# -------------------------------------------------------
class ShortcutBlock(nn.Module):
def __init__(self, submodule):
super(ShortcutBlock, self).__init__()
self.sub = submodule
def forward(self, x):
output = x + self.sub(x)
return output
def __repr__(self):
tmpstr = 'Identity + \n|'
modstr = self.sub.__repr__().replace('\n', '\n|')
tmpstr = tmpstr + modstr
return tmpstr
# -------------------------------------------------------
# Res Block: x + conv(relu(conv(x)))
# -------------------------------------------------------
class ResBlock(nn.Module):
def __init__(self, in_channels=64, out_channels=64, kernel_size=3, stride=1, padding=1, bias=True, mode='CRC'):
super(ResBlock, self).__init__()
assert in_channels == out_channels, 'Only support in_channels==out_channels.'
if mode[0] in ['R','L']:
mode = mode[0].lower() + mode[1:]
self.res = conv(in_channels, out_channels, kernel_size, stride, padding, bias, mode)
def forward(self, x):
res = self.res(x)
return x + res
# -------------------------------------------------------
# Channel Attention (CA) Layer
# -------------------------------------------------------
class CALayer(nn.Module):
def __init__(self, channel=64, reduction=16):
super(CALayer, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.conv_fc = nn.Sequential(
nn.Conv2d(channel, channel // reduction, 1, padding=0, bias=True),
nn.ReLU(inplace=True),
nn.Conv2d(channel // reduction, channel, 1, padding=0, bias=True),
nn.Sigmoid()
)
def forward(self, x):
y = self.avg_pool(x)
y = self.conv_fc(y)
return x * y
# -------------------------------------------------------
# Residual Channel Attention Block (RCAB)
# -------------------------------------------------------
class RCABlock(nn.Module):
def __init__(self, in_channels=64, out_channels=64, kernel_size=3, stride=1, padding=1, bias=True, mode='CRC', reduction=16):
super(RCABlock, self).__init__()
assert in_channels == out_channels, 'Only support in_channels==out_channels.'
if mode[0] in ['R','L']:
mode = mode[0].lower() + mode[1:]
self.res = conv(in_channels, out_channels, kernel_size, stride, padding, bias, mode)
self.ca = CALayer(out_channels, reduction)
def forward(self, x):
res = self.res(x)
res = self.ca(res)
return res + x
# -------------------------------------------------------
# Residual Channel Attention Group (RG)
# -------------------------------------------------------
class RCAGroup(nn.Module):
def __init__(self, in_channels=64, out_channels=64, kernel_size=3, stride=1, padding=1, bias=True, mode='CRC', reduction=16, nb=12):
super(RCAGroup, self).__init__()
assert in_channels == out_channels, 'Only support in_channels==out_channels.'
if mode[0] in ['R','L']:
mode = mode[0].lower() + mode[1:]
RG = [RCABlock(in_channels, out_channels, kernel_size, stride, padding, bias, mode, reduction) for _ in range(nb)]
RG.append(conv(out_channels, out_channels, mode='C'))
self.rg = nn.Sequential(*RG) # self.rg = ShortcutBlock(nn.Sequential(*RG))
def forward(self, x):
res = self.rg(x)
return res + x
# -------------------------------------------------------
# Residual Dense Block
# style: 5 convs
# -------------------------------------------------------
class ResidualDenseBlock_5C(nn.Module):
def __init__(self, nc=64, gc=32, kernel_size=3, stride=1, padding=1, bias=True, mode='CR'):
super(ResidualDenseBlock_5C, self).__init__()
# gc: growth channel
self.conv1 = conv(nc, gc, kernel_size, stride, padding, bias, mode)
self.conv2 = conv(nc+gc, gc, kernel_size, stride, padding, bias, mode)
self.conv3 = conv(nc+2*gc, gc, kernel_size, stride, padding, bias, mode)
self.conv4 = conv(nc+3*gc, gc, kernel_size, stride, padding, bias, mode)
self.conv5 = conv(nc+4*gc, nc, kernel_size, stride, padding, bias, mode[:-1])
def forward(self, x):
x1 = self.conv1(x)
x2 = self.conv2(torch.cat((x, x1), 1))
x3 = self.conv3(torch.cat((x, x1, x2), 1))
x4 = self.conv4(torch.cat((x, x1, x2, x3), 1))
x5 = self.conv5(torch.cat((x, x1, x2, x3, x4), 1))
return x5.mul_(0.2) + x
# -------------------------------------------------------
# Residual in Residual Dense Block
# 3x5c
# -------------------------------------------------------
class RRDB(nn.Module):
def __init__(self, nc=64, gc=32, kernel_size=3, stride=1, padding=1, bias=True, mode='CR'):
super(RRDB, self).__init__()
self.RDB1 = ResidualDenseBlock_5C(nc, gc, kernel_size, stride, padding, bias, mode)
self.RDB2 = ResidualDenseBlock_5C(nc, gc, kernel_size, stride, padding, bias, mode)
self.RDB3 = ResidualDenseBlock_5C(nc, gc, kernel_size, stride, padding, bias, mode)
def forward(self, x):
out = self.RDB1(x)
out = self.RDB2(out)
out = self.RDB3(out)
return out.mul_(0.2) + x
'''
# ======================
# Upsampler
# ======================
'''
# -------------------------------------------------------
# conv + subp + relu
# -------------------------------------------------------
def upsample_pixelshuffle(in_channels=64, out_channels=3, kernel_size=3, stride=1, padding=1, bias=True, mode='2R'):
assert len(mode)<4 and mode[0] in ['2', '3', '4'], 'mode examples: 2, 2R, 2BR, 3, ..., 4BR.'
up1 = conv(in_channels, out_channels * (int(mode[0]) ** 2), kernel_size, stride, padding, bias, mode='C'+mode)
return up1
# -------------------------------------------------------
# nearest_upsample + conv + relu
# -------------------------------------------------------
def upsample_upconv(in_channels=64, out_channels=3, kernel_size=3, stride=1, padding=1, bias=True, mode='2R'):
assert len(mode)<4 and mode[0] in ['2', '3'], 'mode examples: 2, 2R, 2BR, 3, ..., 3BR.'
if mode[0] == '2':
uc = 'UC'
elif mode[0] == '3':
uc = 'uC'
mode = mode.replace(mode[0], uc)
up1 = conv(in_channels, out_channels, kernel_size, stride, padding, bias, mode=mode)
return up1
# -------------------------------------------------------
# convTranspose + relu
# -------------------------------------------------------
def upsample_convtranspose(in_channels=64, out_channels=3, kernel_size=2, stride=2, padding=0, bias=True, mode='2R'):
assert len(mode)<4 and mode[0] in ['2', '3', '4'], 'mode examples: 2, 2R, 2BR, 3, ..., 4BR.'
kernel_size = int(mode[0])
stride = int(mode[0])
mode = mode.replace(mode[0], 'T')
up1 = conv(in_channels, out_channels, kernel_size, stride, padding, bias, mode)
return up1
'''
# ======================
# Downsampler
# ======================
'''
# -------------------------------------------------------
# strideconv + relu
# -------------------------------------------------------
def downsample_strideconv(in_channels=64, out_channels=64, kernel_size=2, stride=2, padding=0, bias=True, mode='2R'):
assert len(mode)<4 and mode[0] in ['2', '3', '4'], 'mode examples: 2, 2R, 2BR, 3, ..., 4BR.'
kernel_size = int(mode[0])
stride = int(mode[0])
mode = mode.replace(mode[0], 'C')
down1 = conv(in_channels, out_channels, kernel_size, stride, padding, bias, mode)
return down1
# -------------------------------------------------------
# maxpooling + conv + relu
# -------------------------------------------------------
def downsample_maxpool(in_channels=64, out_channels=64, kernel_size=3, stride=1, padding=0, bias=True, mode='2R'):
assert len(mode)<4 and mode[0] in ['2', '3'], 'mode examples: 2, 2R, 2BR, 3, ..., 3BR.'
kernel_size_pool = int(mode[0])
stride_pool = int(mode[0])
mode = mode.replace(mode[0], 'MC')
pool = conv(kernel_size=kernel_size_pool, stride=stride_pool, mode=mode[0])
pool_tail = conv(in_channels, out_channels, kernel_size, stride, padding, bias, mode=mode[1:])
return sequential(pool, pool_tail)
# -------------------------------------------------------
# averagepooling + conv + relu
# -------------------------------------------------------
def downsample_avgpool(in_channels=64, out_channels=64, kernel_size=3, stride=1, padding=1, bias=True, mode='2R'):
assert len(mode)<4 and mode[0] in ['2', '3'], 'mode examples: 2, 2R, 2BR, 3, ..., 3BR.'
kernel_size_pool = int(mode[0])
stride_pool = int(mode[0])
mode = mode.replace(mode[0], 'AC')
pool = conv(kernel_size=kernel_size_pool, stride=stride_pool, mode=mode[0])
pool_tail = conv(in_channels, out_channels, kernel_size, stride, padding, bias, mode=mode[1:])
return sequential(pool, pool_tail)
| [
1,
515,
16250,
1053,
8170,
287,
21533,
13,
5215,
4842,
305,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
5215,
4842,
305,
29889,
15755,
29889,
2220,
284,
408,
383,
13,
3166,
4842,
305,
29889,
15755,
1053,
15591,
13,
13,
12008,
13,
29937,
1275,
9166,
9166,
29922,
13,
29937,
29287,
302,
29876,
29889,
16941,
2556,
13,
29937,
11736,
302,
29876,
29889,
16941,
9409,
322,
302,
29876,
29889,
2111,
2540,
13,
29937,
304,
263,
2323,
302,
29876,
29889,
16941,
2556,
13,
29937,
1275,
9166,
9166,
29922,
13,
12008,
13,
13,
13,
1753,
8617,
2556,
10456,
5085,
1125,
13,
1678,
565,
7431,
29898,
5085,
29897,
1275,
29871,
29896,
29901,
13,
4706,
565,
338,
8758,
29898,
5085,
29961,
29900,
1402,
8170,
287,
21533,
1125,
13,
9651,
12020,
2216,
1888,
2037,
287,
2392,
877,
6831,
2556,
947,
451,
2304,
8170,
287,
21533,
1881,
29889,
1495,
13,
4706,
736,
6389,
29961,
29900,
29962,
29871,
396,
1939,
8617,
2556,
338,
4312,
29889,
13,
1678,
10585,
353,
5159,
13,
1678,
363,
3883,
297,
6389,
29901,
13,
4706,
565,
338,
8758,
29898,
5453,
29892,
302,
29876,
29889,
16941,
2556,
1125,
13,
9651,
363,
1014,
5453,
297,
3883,
29889,
11991,
7295,
13,
18884,
10585,
29889,
4397,
29898,
1491,
5453,
29897,
13,
4706,
25342,
338,
8758,
29898,
5453,
29892,
302,
29876,
29889,
7355,
1125,
13,
9651,
10585,
29889,
4397,
29898,
5453,
29897,
13,
1678,
736,
302,
29876,
29889,
16941,
2556,
10456,
7576,
29897,
13,
13,
13,
12008,
13,
29937,
1275,
9166,
9166,
29922,
13,
29937,
4803,
1319,
10930,
13,
29937,
448,
2683,
9072,
5634,
13,
29937,
7602,
20532,
6056,
2606,
362,
718,
1104,
29884,
29897,
13,
29937,
3022,
271,
13,
29937,
2533,
13,
29937,
620,
1271,
313,
1666,
7445,
29897,
13,
29937,
620,
1145,
344,
1271,
313,
1666,
333,
950,
29928,
1947,
7445,
29918,
29945,
29907,
29897,
13,
29937,
620,
262,
690,
1145,
344,
1271,
313,
29934,
29934,
4051,
29897,
13,
29937,
1275,
9166,
9166,
29922,
13,
12008,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
736,
302,
29876,
29889,
16941,
424,
616,
310,
313,
1168,
29894,
718,
350,
29940,
718,
830,
29931,
29965,
29897,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1753,
7602,
29898,
262,
29918,
305,
12629,
29922,
29953,
29946,
29892,
714,
29918,
305,
12629,
29922,
29953,
29946,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
29907,
15176,
29374,
13,
1678,
365,
353,
5159,
13,
1678,
363,
260,
297,
4464,
29901,
13,
4706,
565,
260,
1275,
525,
29907,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
262,
29918,
305,
12629,
29922,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29922,
449,
29918,
305,
12629,
29892,
8466,
29918,
2311,
29922,
17460,
29918,
2311,
29892,
380,
2426,
29922,
303,
2426,
29892,
7164,
29922,
12791,
29892,
24003,
29922,
29890,
3173,
876,
13,
4706,
25342,
260,
1275,
525,
29911,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
1168,
29894,
4300,
4220,
29906,
29881,
29898,
262,
29918,
305,
12629,
29922,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29922,
449,
29918,
305,
12629,
29892,
8466,
29918,
2311,
29922,
17460,
29918,
2311,
29892,
380,
2426,
29922,
303,
2426,
29892,
7164,
29922,
12791,
29892,
24003,
29922,
29890,
3173,
876,
13,
4706,
25342,
260,
1275,
525,
29933,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
23145,
29940,
555,
29906,
29881,
29898,
449,
29918,
305,
12629,
29892,
19399,
29922,
29900,
29889,
29929,
29892,
321,
567,
29922,
29896,
29872,
29899,
29900,
29946,
29892,
2756,
457,
29922,
5574,
876,
13,
4706,
25342,
260,
1275,
525,
29902,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
4998,
29940,
555,
29906,
29881,
29898,
449,
29918,
305,
12629,
29892,
2756,
457,
29922,
5574,
876,
13,
4706,
25342,
260,
1275,
525,
29934,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
876,
13,
4706,
25342,
260,
1275,
525,
29878,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
8824,
876,
13,
4706,
25342,
260,
1275,
525,
29931,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
3226,
557,
29891,
1123,
29931,
29965,
29898,
22198,
29918,
29879,
417,
412,
29922,
29896,
29872,
29899,
29896,
29892,
297,
6689,
29922,
5574,
876,
13,
4706,
25342,
260,
1275,
525,
29880,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
3226,
557,
29891,
1123,
29931,
29965,
29898,
22198,
29918,
29879,
417,
412,
29922,
29896,
29872,
29899,
29896,
29892,
297,
6689,
29922,
8824,
876,
13,
4706,
25342,
260,
1275,
525,
29906,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
29637,
2713,
21897,
29898,
14340,
29883,
744,
29918,
19790,
29922,
29906,
876,
13,
4706,
25342,
260,
1275,
525,
29941,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
29637,
2713,
21897,
29898,
14340,
29883,
744,
29918,
19790,
29922,
29941,
876,
13,
4706,
25342,
260,
1275,
525,
29946,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
29637,
2713,
21897,
29898,
14340,
29883,
744,
29918,
19790,
29922,
29946,
876,
13,
4706,
25342,
260,
1275,
525,
29965,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
29965,
567,
981,
29898,
7052,
29918,
19790,
29922,
29906,
29892,
4464,
2433,
28502,
342,
8785,
13,
4706,
25342,
260,
1275,
525,
29884,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
29965,
567,
981,
29898,
7052,
29918,
19790,
29922,
29941,
29892,
4464,
2433,
28502,
342,
8785,
13,
4706,
25342,
260,
1275,
525,
29924,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
7976,
11426,
29906,
29881,
29898,
17460,
29918,
2311,
29922,
17460,
29918,
2311,
29892,
380,
2426,
29922,
303,
2426,
29892,
7164,
29922,
29900,
876,
13,
4706,
25342,
260,
1275,
525,
29909,
2396,
13,
9651,
365,
29889,
4397,
29898,
15755,
29889,
12810,
29887,
11426,
29906,
29881,
29898,
17460,
29918,
2311,
29922,
17460,
29918,
2311,
29892,
380,
2426,
29922,
303,
2426,
29892,
7164,
29922,
29900,
876,
13,
4706,
1683,
29901,
13,
9651,
12020,
2216,
1888,
2037,
287,
2392,
877,
25263,
5598,
1134,
29901,
15300,
4830,
29898,
29873,
876,
13,
1678,
736,
8617,
2556,
10456,
29931,
29897,
13,
13,
13,
13,
1990,
16316,
29657,
29898,
15755,
29889,
1168,
29894,
29906,
29881,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
15552,
29890,
29918,
3881,
29922,
29906,
29945,
29945,
29892,
15552,
29890,
29918,
12676,
7607,
29900,
29889,
29946,
29946,
29947,
29947,
29892,
29871,
29900,
29889,
29946,
29941,
29955,
29896,
29892,
29871,
29900,
29889,
29946,
29900,
29946,
29900,
511,
15552,
29890,
29918,
4172,
7607,
29896,
29889,
29900,
29892,
29871,
29896,
29889,
29900,
29892,
29871,
29896,
29889,
29900,
511,
1804,
10457,
29896,
1125,
13,
4706,
2428,
29898,
6816,
273,
29657,
29892,
1583,
467,
1649,
2344,
12035,
29941,
29892,
29871,
29941,
29892,
8466,
29918,
2311,
29922,
29896,
29897,
13,
4706,
3659,
353,
4842,
305,
29889,
29911,
6073,
29898,
23973,
29918,
4172,
29897,
13,
4706,
1583,
29889,
7915,
29889,
1272,
353,
4842,
305,
29889,
1032,
29872,
29898,
29941,
467,
1493,
29898,
29941,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
847,
3659,
29889,
1493,
29898,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
4706,
1583,
29889,
29890,
3173,
29889,
1272,
353,
1804,
334,
15552,
29890,
29918,
3881,
334,
4842,
305,
29889,
29911,
6073,
29898,
23973,
29918,
12676,
29897,
847,
3659,
13,
4706,
363,
282,
297,
1583,
29889,
16744,
7295,
13,
9651,
282,
29889,
276,
339,
2658,
29918,
5105,
353,
7700,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
1281,
4117,
278,
1962,
310,
263,
1014,
5453,
304,
967,
1881,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1990,
1281,
4117,
7445,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1014,
5453,
1125,
13,
4706,
2428,
29898,
1168,
4117,
7445,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
4706,
1583,
29889,
1491,
353,
1014,
5453,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
13,
4706,
1962,
353,
4842,
305,
29889,
4117,
3552,
29916,
29892,
1583,
29889,
1491,
29898,
29916,
8243,
3964,
29922,
29896,
29897,
13,
4706,
736,
1962,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
1491,
17255,
276,
558,
1649,
580,
718,
525,
17685,
29915,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
10619,
3538,
2533,
278,
1962,
310,
263,
1014,
5453,
304,
967,
1881,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1990,
13899,
7582,
7445,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1014,
5453,
1125,
13,
4706,
2428,
29898,
21322,
7582,
7445,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
4706,
1583,
29889,
1491,
353,
1014,
5453,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
13,
4706,
1962,
353,
921,
718,
1583,
29889,
1491,
29898,
29916,
29897,
13,
4706,
736,
1962,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
13128,
710,
353,
525,
18415,
718,
320,
29876,
29989,
29915,
13,
4706,
878,
710,
353,
1583,
29889,
1491,
17255,
276,
558,
1649,
2141,
6506,
28909,
29876,
742,
11297,
29876,
29989,
1495,
13,
4706,
13128,
710,
353,
13128,
710,
718,
878,
710,
13,
4706,
736,
13128,
710,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
2538,
15658,
29901,
921,
718,
7602,
29898,
2674,
29884,
29898,
20580,
29898,
29916,
4961,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1990,
2538,
7445,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
297,
29918,
305,
12629,
29922,
29953,
29946,
29892,
714,
29918,
305,
12629,
29922,
29953,
29946,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
29907,
10363,
29374,
13,
4706,
2428,
29898,
1666,
7445,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
4706,
4974,
297,
29918,
305,
12629,
1275,
714,
29918,
305,
12629,
29892,
525,
11730,
2304,
297,
29918,
305,
12629,
1360,
449,
29918,
305,
12629,
6169,
13,
4706,
565,
4464,
29961,
29900,
29962,
297,
6024,
29934,
3788,
29931,
2033,
29901,
13,
9651,
4464,
353,
4464,
29961,
29900,
1822,
13609,
580,
718,
4464,
29961,
29896,
17531,
13,
13,
4706,
1583,
29889,
690,
353,
7602,
29898,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29897,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
13,
4706,
620,
353,
1583,
29889,
690,
29898,
29916,
29897,
13,
4706,
736,
921,
718,
620,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
17368,
6212,
2509,
313,
5454,
29897,
365,
2747,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1990,
315,
1964,
2747,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
8242,
29922,
29953,
29946,
29892,
20376,
29922,
29896,
29953,
1125,
13,
4706,
2428,
29898,
29907,
1964,
2747,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
4706,
1583,
29889,
485,
29887,
29918,
10109,
353,
302,
29876,
29889,
29909,
1388,
415,
573,
12810,
29887,
11426,
29906,
29881,
29898,
29896,
29897,
13,
4706,
1583,
29889,
20580,
29918,
13801,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
18884,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
12719,
29892,
8242,
849,
20376,
29892,
29871,
29896,
29892,
7164,
29922,
29900,
29892,
24003,
29922,
5574,
511,
13,
18884,
302,
29876,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
511,
13,
18884,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
12719,
849,
20376,
29892,
8242,
29892,
29871,
29896,
29892,
7164,
29922,
29900,
29892,
24003,
29922,
5574,
511,
13,
18884,
302,
29876,
29889,
29903,
335,
29885,
3398,
580,
13,
4706,
1723,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
13,
4706,
343,
353,
1583,
29889,
485,
29887,
29918,
10109,
29898,
29916,
29897,
13,
4706,
343,
353,
1583,
29889,
20580,
29918,
13801,
29898,
29891,
29897,
13,
4706,
736,
921,
334,
343,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
2538,
333,
950,
17368,
6212,
2509,
15658,
313,
10363,
2882,
29897,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1990,
29138,
2882,
908,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
297,
29918,
305,
12629,
29922,
29953,
29946,
29892,
714,
29918,
305,
12629,
29922,
29953,
29946,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
29907,
10363,
742,
20376,
29922,
29896,
29953,
1125,
13,
4706,
2428,
29898,
10363,
2882,
908,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
4974,
297,
29918,
305,
12629,
1275,
714,
29918,
305,
12629,
29892,
525,
11730,
2304,
297,
29918,
305,
12629,
1360,
449,
29918,
305,
12629,
6169,
13,
4706,
565,
4464,
29961,
29900,
29962,
297,
6024,
29934,
3788,
29931,
2033,
29901,
13,
9651,
4464,
353,
4464,
29961,
29900,
1822,
13609,
580,
718,
4464,
29961,
29896,
17531,
13,
13,
4706,
1583,
29889,
690,
353,
7602,
29898,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29897,
13,
4706,
1583,
29889,
1113,
353,
315,
1964,
2747,
29898,
449,
29918,
305,
12629,
29892,
20376,
29897,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
13,
4706,
620,
353,
1583,
29889,
690,
29898,
29916,
29897,
13,
4706,
620,
353,
1583,
29889,
1113,
29898,
690,
29897,
13,
4706,
736,
620,
718,
921,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
2538,
333,
950,
17368,
6212,
2509,
6431,
313,
29934,
29954,
29897,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1990,
390,
5454,
4782,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
297,
29918,
305,
12629,
29922,
29953,
29946,
29892,
714,
29918,
305,
12629,
29922,
29953,
29946,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
29907,
10363,
742,
20376,
29922,
29896,
29953,
29892,
302,
29890,
29922,
29896,
29906,
1125,
13,
4706,
2428,
29898,
29934,
5454,
4782,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
4974,
297,
29918,
305,
12629,
1275,
714,
29918,
305,
12629,
29892,
525,
11730,
2304,
297,
29918,
305,
12629,
1360,
449,
29918,
305,
12629,
6169,
13,
4706,
565,
4464,
29961,
29900,
29962,
297,
6024,
29934,
3788,
29931,
2033,
29901,
13,
9651,
4464,
353,
4464,
29961,
29900,
1822,
13609,
580,
718,
4464,
29961,
29896,
17531,
13,
13,
4706,
390,
29954,
353,
518,
10363,
2882,
908,
29898,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29892,
20376,
29897,
29871,
363,
903,
297,
3464,
29898,
9877,
4638,
13,
4706,
390,
29954,
29889,
4397,
29898,
20580,
29898,
449,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29892,
4464,
2433,
29907,
8785,
13,
4706,
1583,
29889,
11007,
353,
302,
29876,
29889,
16941,
2556,
10456,
29934,
29954,
29897,
29871,
396,
1583,
29889,
11007,
353,
13899,
7582,
7445,
29898,
15755,
29889,
16941,
2556,
10456,
29934,
29954,
876,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
13,
4706,
620,
353,
1583,
29889,
11007,
29898,
29916,
29897,
13,
4706,
736,
620,
718,
921,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
2538,
333,
950,
360,
1947,
15658,
13,
29937,
3114,
29901,
29871,
29945,
378,
4270,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1990,
2538,
333,
950,
29928,
1947,
7445,
29918,
29945,
29907,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
302,
29883,
29922,
29953,
29946,
29892,
330,
29883,
29922,
29941,
29906,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
11341,
29374,
13,
4706,
2428,
29898,
1666,
333,
950,
29928,
1947,
7445,
29918,
29945,
29907,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
4706,
396,
330,
29883,
29901,
14321,
8242,
13,
4706,
1583,
29889,
20580,
29896,
353,
7602,
29898,
17608,
29892,
330,
29883,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29897,
13,
4706,
1583,
29889,
20580,
29906,
353,
7602,
29898,
17608,
29974,
27354,
29892,
330,
29883,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29897,
13,
4706,
1583,
29889,
20580,
29941,
353,
7602,
29898,
17608,
29974,
29906,
29930,
27354,
29892,
330,
29883,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29897,
13,
4706,
1583,
29889,
20580,
29946,
353,
7602,
29898,
17608,
29974,
29941,
29930,
27354,
29892,
330,
29883,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29897,
13,
4706,
1583,
29889,
20580,
29945,
353,
7602,
29898,
17608,
29974,
29946,
29930,
27354,
29892,
302,
29883,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
7503,
29899,
29896,
2314,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
13,
4706,
921,
29896,
353,
1583,
29889,
20580,
29896,
29898,
29916,
29897,
13,
4706,
921,
29906,
353,
1583,
29889,
20580,
29906,
29898,
7345,
305,
29889,
4117,
3552,
29916,
29892,
921,
29896,
511,
29871,
29896,
876,
13,
4706,
921,
29941,
353,
1583,
29889,
20580,
29941,
29898,
7345,
305,
29889,
4117,
3552,
29916,
29892,
921,
29896,
29892,
921,
29906,
511,
29871,
29896,
876,
13,
4706,
921,
29946,
353,
1583,
29889,
20580,
29946,
29898,
7345,
305,
29889,
4117,
3552,
29916,
29892,
921,
29896,
29892,
921,
29906,
29892,
921,
29941,
511,
29871,
29896,
876,
13,
4706,
921,
29945,
353,
1583,
29889,
20580,
29945,
29898,
7345,
305,
29889,
4117,
3552,
29916,
29892,
921,
29896,
29892,
921,
29906,
29892,
921,
29941,
29892,
921,
29946,
511,
29871,
29896,
876,
13,
4706,
736,
921,
29945,
29889,
16109,
23538,
29900,
29889,
29906,
29897,
718,
921,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
2538,
333,
950,
297,
2538,
333,
950,
360,
1947,
15658,
13,
29937,
29871,
29941,
29916,
29945,
29883,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1990,
390,
29934,
4051,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
302,
29883,
29922,
29953,
29946,
29892,
330,
29883,
29922,
29941,
29906,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
11341,
29374,
13,
4706,
2428,
29898,
29934,
29934,
4051,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
4706,
1583,
29889,
29934,
4051,
29896,
353,
2538,
333,
950,
29928,
1947,
7445,
29918,
29945,
29907,
29898,
17608,
29892,
330,
29883,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29897,
13,
4706,
1583,
29889,
29934,
4051,
29906,
353,
2538,
333,
950,
29928,
1947,
7445,
29918,
29945,
29907,
29898,
17608,
29892,
330,
29883,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29897,
13,
4706,
1583,
29889,
29934,
4051,
29941,
353,
2538,
333,
950,
29928,
1947,
7445,
29918,
29945,
29907,
29898,
17608,
29892,
330,
29883,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29897,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
13,
4706,
714,
353,
1583,
29889,
29934,
4051,
29896,
29898,
29916,
29897,
13,
4706,
714,
353,
1583,
29889,
29934,
4051,
29906,
29898,
449,
29897,
13,
4706,
714,
353,
1583,
29889,
29934,
4051,
29941,
29898,
449,
29897,
13,
4706,
736,
714,
29889,
16109,
23538,
29900,
29889,
29906,
29897,
718,
921,
13,
13,
13,
12008,
13,
29937,
1275,
9166,
2751,
13,
29937,
501,
567,
314,
20069,
13,
29937,
1275,
9166,
2751,
13,
12008,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
7602,
718,
1014,
29886,
718,
1104,
29884,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1753,
24081,
981,
29918,
29886,
15711,
845,
21897,
29898,
262,
29918,
305,
12629,
29922,
29953,
29946,
29892,
714,
29918,
305,
12629,
29922,
29941,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
29906,
29934,
29374,
13,
1678,
4974,
7431,
29898,
8513,
29897,
29966,
29946,
322,
4464,
29961,
29900,
29962,
297,
6024,
29906,
742,
525,
29941,
742,
525,
29946,
7464,
525,
8513,
6455,
29901,
29871,
29906,
29892,
29871,
29906,
29934,
29892,
29871,
29906,
15176,
29892,
29871,
29941,
29892,
2023,
29892,
29871,
29946,
15176,
6169,
13,
1678,
701,
29896,
353,
7602,
29898,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
334,
313,
524,
29898,
8513,
29961,
29900,
2314,
3579,
29871,
29906,
511,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
2433,
29907,
18717,
8513,
29897,
13,
1678,
736,
701,
29896,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
20471,
29918,
14340,
981,
718,
7602,
718,
1104,
29884,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1753,
24081,
981,
29918,
786,
20580,
29898,
262,
29918,
305,
12629,
29922,
29953,
29946,
29892,
714,
29918,
305,
12629,
29922,
29941,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
29906,
29934,
29374,
13,
1678,
4974,
7431,
29898,
8513,
29897,
29966,
29946,
322,
4464,
29961,
29900,
29962,
297,
6024,
29906,
742,
525,
29941,
7464,
525,
8513,
6455,
29901,
29871,
29906,
29892,
29871,
29906,
29934,
29892,
29871,
29906,
15176,
29892,
29871,
29941,
29892,
2023,
29892,
29871,
29941,
15176,
6169,
13,
1678,
565,
4464,
29961,
29900,
29962,
1275,
525,
29906,
2396,
13,
4706,
318,
29883,
353,
525,
23129,
29915,
13,
1678,
25342,
4464,
29961,
29900,
29962,
1275,
525,
29941,
2396,
13,
4706,
318,
29883,
353,
525,
29884,
29907,
29915,
13,
1678,
4464,
353,
4464,
29889,
6506,
29898,
8513,
29961,
29900,
1402,
318,
29883,
29897,
13,
1678,
701,
29896,
353,
7602,
29898,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29922,
8513,
29897,
13,
1678,
736,
701,
29896,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
7602,
4300,
4220,
718,
1104,
29884,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1753,
24081,
981,
29918,
20580,
3286,
4220,
29898,
262,
29918,
305,
12629,
29922,
29953,
29946,
29892,
714,
29918,
305,
12629,
29922,
29941,
29892,
8466,
29918,
2311,
29922,
29906,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
29900,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
29906,
29934,
29374,
13,
1678,
4974,
7431,
29898,
8513,
29897,
29966,
29946,
322,
4464,
29961,
29900,
29962,
297,
6024,
29906,
742,
525,
29941,
742,
525,
29946,
7464,
525,
8513,
6455,
29901,
29871,
29906,
29892,
29871,
29906,
29934,
29892,
29871,
29906,
15176,
29892,
29871,
29941,
29892,
2023,
29892,
29871,
29946,
15176,
6169,
13,
1678,
8466,
29918,
2311,
353,
938,
29898,
8513,
29961,
29900,
2314,
13,
1678,
380,
2426,
353,
938,
29898,
8513,
29961,
29900,
2314,
13,
1678,
4464,
353,
4464,
29889,
6506,
29898,
8513,
29961,
29900,
1402,
525,
29911,
1495,
13,
1678,
701,
29896,
353,
7602,
29898,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29897,
13,
1678,
736,
701,
29896,
13,
13,
13,
12008,
13,
29937,
1275,
9166,
2751,
13,
29937,
9943,
13445,
20069,
13,
29937,
1275,
9166,
2751,
13,
12008,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
380,
2426,
20580,
718,
1104,
29884,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1753,
1623,
11249,
29918,
303,
2426,
20580,
29898,
262,
29918,
305,
12629,
29922,
29953,
29946,
29892,
714,
29918,
305,
12629,
29922,
29953,
29946,
29892,
8466,
29918,
2311,
29922,
29906,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
29900,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
29906,
29934,
29374,
13,
1678,
4974,
7431,
29898,
8513,
29897,
29966,
29946,
322,
4464,
29961,
29900,
29962,
297,
6024,
29906,
742,
525,
29941,
742,
525,
29946,
7464,
525,
8513,
6455,
29901,
29871,
29906,
29892,
29871,
29906,
29934,
29892,
29871,
29906,
15176,
29892,
29871,
29941,
29892,
2023,
29892,
29871,
29946,
15176,
6169,
13,
1678,
8466,
29918,
2311,
353,
938,
29898,
8513,
29961,
29900,
2314,
13,
1678,
380,
2426,
353,
938,
29898,
8513,
29961,
29900,
2314,
13,
1678,
4464,
353,
4464,
29889,
6506,
29898,
8513,
29961,
29900,
1402,
525,
29907,
1495,
13,
1678,
1623,
29896,
353,
7602,
29898,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29897,
13,
1678,
736,
1623,
29896,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
4236,
10109,
292,
718,
7602,
718,
1104,
29884,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1753,
1623,
11249,
29918,
3317,
10109,
29898,
262,
29918,
305,
12629,
29922,
29953,
29946,
29892,
714,
29918,
305,
12629,
29922,
29953,
29946,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29900,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
29906,
29934,
29374,
13,
1678,
4974,
7431,
29898,
8513,
29897,
29966,
29946,
322,
4464,
29961,
29900,
29962,
297,
6024,
29906,
742,
525,
29941,
7464,
525,
8513,
6455,
29901,
29871,
29906,
29892,
29871,
29906,
29934,
29892,
29871,
29906,
15176,
29892,
29871,
29941,
29892,
2023,
29892,
29871,
29941,
15176,
6169,
13,
1678,
8466,
29918,
2311,
29918,
10109,
353,
938,
29898,
8513,
29961,
29900,
2314,
13,
1678,
380,
2426,
29918,
10109,
353,
938,
29898,
8513,
29961,
29900,
2314,
13,
1678,
4464,
353,
4464,
29889,
6506,
29898,
8513,
29961,
29900,
1402,
525,
12513,
1495,
13,
1678,
11565,
353,
7602,
29898,
17460,
29918,
2311,
29922,
17460,
29918,
2311,
29918,
10109,
29892,
380,
2426,
29922,
303,
2426,
29918,
10109,
29892,
4464,
29922,
8513,
29961,
29900,
2314,
13,
1678,
11565,
29918,
18237,
353,
7602,
29898,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29922,
8513,
29961,
29896,
29901,
2314,
13,
1678,
736,
8617,
2556,
29898,
10109,
29892,
11565,
29918,
18237,
29897,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
29937,
6588,
10109,
292,
718,
7602,
718,
1104,
29884,
13,
29937,
448,
2683,
2683,
2683,
22158,
13,
1753,
1623,
11249,
29918,
485,
29887,
10109,
29898,
262,
29918,
305,
12629,
29922,
29953,
29946,
29892,
714,
29918,
305,
12629,
29922,
29953,
29946,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29892,
24003,
29922,
5574,
29892,
4464,
2433,
29906,
29934,
29374,
13,
1678,
4974,
7431,
29898,
8513,
29897,
29966,
29946,
322,
4464,
29961,
29900,
29962,
297,
6024,
29906,
742,
525,
29941,
7464,
525,
8513,
6455,
29901,
29871,
29906,
29892,
29871,
29906,
29934,
29892,
29871,
29906,
15176,
29892,
29871,
29941,
29892,
2023,
29892,
29871,
29941,
15176,
6169,
13,
1678,
8466,
29918,
2311,
29918,
10109,
353,
938,
29898,
8513,
29961,
29900,
2314,
13,
1678,
380,
2426,
29918,
10109,
353,
938,
29898,
8513,
29961,
29900,
2314,
13,
1678,
4464,
353,
4464,
29889,
6506,
29898,
8513,
29961,
29900,
1402,
525,
2477,
1495,
13,
1678,
11565,
353,
7602,
29898,
17460,
29918,
2311,
29922,
17460,
29918,
2311,
29918,
10109,
29892,
380,
2426,
29922,
303,
2426,
29918,
10109,
29892,
4464,
29922,
8513,
29961,
29900,
2314,
13,
1678,
11565,
29918,
18237,
353,
7602,
29898,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29892,
8466,
29918,
2311,
29892,
380,
2426,
29892,
7164,
29892,
24003,
29892,
4464,
29922,
8513,
29961,
29896,
29901,
2314,
13,
1678,
736,
8617,
2556,
29898,
10109,
29892,
11565,
29918,
18237,
29897,
13,
2
] |
bot/utils/dma_api.py | webhp/discord-moderator-wumpus | 0 | 186214 | <reponame>webhp/discord-moderator-wumpus<gh_stars>0
import functools
import re
import textwrap
import aiohttp
from bs4 import BeautifulSoup
from loguru import logger
from bot.constants import DMA_API_URL, DMA_TITLE_REGEX
def get_api():
def wrapper(func):
@functools.wraps(func)
async def wrapped(search):
try:
async with aiohttp.ClientSession() as sess:
response = await sess.get(DMA_API_URL)
response.raise_for_status()
data = await response.json()
articles = data["articles"]
articles_parse = []
for item in articles:
if re.search(DMA_TITLE_REGEX, item["name"]):
article = {}
# Article
number, name = item["name"].split(": ")
article["series"] = number[0]
article["category"] = number[1]
article["digit"] = number[2]
article["name"] = name
soup = BeautifulSoup(item["body"], "html.parser")
placeholder = (
f"... [continue reading](https://dis.gd/dma{number})"
)
article["text"] = textwrap.shorten(
soup.p.text, 800, placeholder=placeholder
)
articles_parse.append(article)
except Exception:
logger.exception("Error fetching information from DMA")
return await func(search, articles_parse)
return wrapped
return wrapper
@get_api()
async def get_article(number, articles):
return [
item
for item in articles
if item["series"] == str(number)[0]
and item["category"] == str(number)[1]
and item["digit"] == str(number)[2]
]
@get_api()
async def get_series(series, articles):
return [item for item in articles if item["series"] == str(series)]
@get_api()
async def get_category(category, articles):
return [item for item in articles if item["category"] == str(category)]
@get_api()
async def search_term(term, articles):
return [
item
for item in articles
if term.lower() in item["text"].lower() or term.lower() in item["name"].lower()
]
| [
1,
529,
276,
1112,
420,
29958,
2676,
28887,
29914,
2218,
16090,
29899,
1545,
261,
1061,
29899,
29893,
3427,
375,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
2090,
312,
8789,
13,
5215,
337,
13,
5215,
1426,
6312,
13,
13,
5215,
263,
601,
1124,
13,
3166,
24512,
29946,
1053,
25685,
29903,
1132,
13,
3166,
1480,
20144,
1053,
17927,
13,
13,
3166,
9225,
29889,
3075,
1934,
1053,
360,
1529,
29918,
8787,
29918,
4219,
29892,
360,
1529,
29918,
29911,
1806,
1307,
29918,
1525,
1692,
29990,
13,
13,
13,
1753,
679,
29918,
2754,
7295,
13,
1678,
822,
14476,
29898,
9891,
1125,
13,
4706,
732,
7692,
312,
8789,
29889,
29893,
336,
567,
29898,
9891,
29897,
13,
4706,
7465,
822,
21021,
29898,
4478,
1125,
13,
9651,
1018,
29901,
13,
18884,
7465,
411,
263,
601,
1124,
29889,
4032,
7317,
580,
408,
27937,
29901,
13,
462,
1678,
2933,
353,
7272,
27937,
29889,
657,
29898,
29928,
1529,
29918,
8787,
29918,
4219,
29897,
13,
462,
1678,
2933,
29889,
22692,
29918,
1454,
29918,
4882,
580,
13,
462,
1678,
848,
353,
7272,
2933,
29889,
3126,
580,
13,
13,
462,
1678,
7456,
353,
848,
3366,
18569,
3108,
13,
462,
1678,
7456,
29918,
5510,
353,
5159,
13,
13,
462,
1678,
363,
2944,
297,
7456,
29901,
13,
462,
4706,
565,
337,
29889,
4478,
29898,
29928,
1529,
29918,
29911,
1806,
1307,
29918,
1525,
1692,
29990,
29892,
2944,
3366,
978,
3108,
1125,
13,
462,
9651,
4274,
353,
6571,
13,
462,
9651,
396,
21746,
13,
462,
9651,
1353,
29892,
1024,
353,
2944,
3366,
978,
16862,
5451,
703,
29901,
16521,
13,
462,
9651,
4274,
3366,
13757,
3108,
353,
1353,
29961,
29900,
29962,
13,
462,
9651,
4274,
3366,
7320,
3108,
353,
1353,
29961,
29896,
29962,
13,
462,
9651,
4274,
3366,
26204,
3108,
353,
1353,
29961,
29906,
29962,
13,
462,
9651,
4274,
3366,
978,
3108,
353,
1024,
13,
462,
9651,
22300,
353,
25685,
29903,
1132,
29898,
667,
3366,
2587,
12436,
376,
1420,
29889,
16680,
1159,
13,
13,
462,
9651,
12983,
353,
313,
13,
462,
18884,
285,
29908,
856,
518,
19878,
5183,
850,
991,
597,
2218,
29889,
29887,
29881,
29914,
29881,
655,
29912,
4537,
1800,
29908,
13,
462,
9651,
1723,
13,
462,
9651,
4274,
3366,
726,
3108,
353,
1426,
6312,
29889,
12759,
264,
29898,
13,
462,
18884,
22300,
29889,
29886,
29889,
726,
29892,
29871,
29947,
29900,
29900,
29892,
12983,
29922,
27074,
13,
462,
9651,
1723,
13,
462,
9651,
7456,
29918,
5510,
29889,
4397,
29898,
7914,
29897,
13,
9651,
5174,
8960,
29901,
13,
18884,
17927,
29889,
11739,
703,
2392,
6699,
292,
2472,
515,
360,
1529,
1159,
13,
9651,
736,
7272,
3653,
29898,
4478,
29892,
7456,
29918,
5510,
29897,
13,
13,
4706,
736,
21021,
13,
13,
1678,
736,
14476,
13,
13,
13,
29992,
657,
29918,
2754,
580,
13,
12674,
822,
679,
29918,
7914,
29898,
4537,
29892,
7456,
1125,
13,
1678,
736,
518,
13,
4706,
2944,
13,
4706,
363,
2944,
297,
7456,
13,
4706,
565,
2944,
3366,
13757,
3108,
1275,
851,
29898,
4537,
9601,
29900,
29962,
13,
4706,
322,
2944,
3366,
7320,
3108,
1275,
851,
29898,
4537,
9601,
29896,
29962,
13,
4706,
322,
2944,
3366,
26204,
3108,
1275,
851,
29898,
4537,
9601,
29906,
29962,
13,
1678,
4514,
13,
13,
13,
29992,
657,
29918,
2754,
580,
13,
12674,
822,
679,
29918,
13757,
29898,
13757,
29892,
7456,
1125,
13,
1678,
736,
518,
667,
363,
2944,
297,
7456,
565,
2944,
3366,
13757,
3108,
1275,
851,
29898,
13757,
4638,
13,
13,
13,
29992,
657,
29918,
2754,
580,
13,
12674,
822,
679,
29918,
7320,
29898,
7320,
29892,
7456,
1125,
13,
1678,
736,
518,
667,
363,
2944,
297,
7456,
565,
2944,
3366,
7320,
3108,
1275,
851,
29898,
7320,
4638,
13,
13,
13,
29992,
657,
29918,
2754,
580,
13,
12674,
822,
2740,
29918,
8489,
29898,
8489,
29892,
7456,
1125,
13,
1678,
736,
518,
13,
4706,
2944,
13,
4706,
363,
2944,
297,
7456,
13,
4706,
565,
1840,
29889,
13609,
580,
297,
2944,
3366,
726,
16862,
13609,
580,
470,
1840,
29889,
13609,
580,
297,
2944,
3366,
978,
16862,
13609,
580,
13,
1678,
4514,
13,
2
] |
trio/_core/tests/test_multierror.py | JefffHofffman/trio | 4 | 14733 | <gh_stars>1-10
import logging
import pytest
from traceback import extract_tb, print_exception, format_exception, _cause_message
import sys
import os
import re
from pathlib import Path
import subprocess
from .tutil import slow
from .._multierror import MultiError, concat_tb
from ..._core import open_nursery
class NotHashableException(Exception):
code = None
def __init__(self, code):
super().__init__()
self.code = code
def __eq__(self, other):
if not isinstance(other, NotHashableException):
return False
return self.code == other.code
async def raise_nothashable(code):
raise NotHashableException(code)
def raiser1():
raiser1_2()
def raiser1_2():
raiser1_3()
def raiser1_3():
raise ValueError("raiser1_string")
def raiser2():
raiser2_2()
def raiser2_2():
raise KeyError("raiser2_string")
def raiser3():
raise NameError
def get_exc(raiser):
try:
raiser()
except Exception as exc:
return exc
def get_tb(raiser):
return get_exc(raiser).__traceback__
def einfo(exc):
return (type(exc), exc, exc.__traceback__)
def test_concat_tb():
tb1 = get_tb(raiser1)
tb2 = get_tb(raiser2)
# These return a list of (filename, lineno, fn name, text) tuples
# https://docs.python.org/3/library/traceback.html#traceback.extract_tb
entries1 = extract_tb(tb1)
entries2 = extract_tb(tb2)
tb12 = concat_tb(tb1, tb2)
assert extract_tb(tb12) == entries1 + entries2
tb21 = concat_tb(tb2, tb1)
assert extract_tb(tb21) == entries2 + entries1
# Check degenerate cases
assert extract_tb(concat_tb(None, tb1)) == entries1
assert extract_tb(concat_tb(tb1, None)) == entries1
assert concat_tb(None, None) is None
# Make sure the original tracebacks didn't get mutated by mistake
assert extract_tb(get_tb(raiser1)) == entries1
assert extract_tb(get_tb(raiser2)) == entries2
def test_MultiError():
exc1 = get_exc(raiser1)
exc2 = get_exc(raiser2)
assert MultiError([exc1]) is exc1
m = MultiError([exc1, exc2])
assert m.exceptions == [exc1, exc2]
assert "ValueError" in str(m)
assert "ValueError" in repr(m)
with pytest.raises(TypeError):
MultiError(object())
with pytest.raises(TypeError):
MultiError([KeyError(), ValueError])
def test_MultiErrorOfSingleMultiError():
# For MultiError([MultiError]), ensure there is no bad recursion by the
# constructor where __init__ is called if __new__ returns a bare MultiError.
exceptions = [KeyError(), ValueError()]
a = MultiError(exceptions)
b = MultiError([a])
assert b == a
assert b.exceptions == exceptions
async def test_MultiErrorNotHashable():
exc1 = NotHashableException(42)
exc2 = NotHashableException(4242)
exc3 = ValueError()
assert exc1 != exc2
assert exc1 != exc3
with pytest.raises(MultiError):
async with open_nursery() as nursery:
nursery.start_soon(raise_nothashable, 42)
nursery.start_soon(raise_nothashable, 4242)
def test_MultiError_filter_NotHashable():
excs = MultiError([NotHashableException(42), ValueError()])
def handle_ValueError(exc):
if isinstance(exc, ValueError):
return None
else:
return exc
filtered_excs = MultiError.filter(handle_ValueError, excs)
assert isinstance(filtered_excs, NotHashableException)
def test_traceback_recursion():
exc1 = RuntimeError()
exc2 = KeyError()
exc3 = NotHashableException(42)
# Note how this creates a loop, where exc1 refers to exc1
# This could trigger an infinite recursion; the 'seen' set is supposed to prevent
# this.
exc1.__cause__ = MultiError([exc1, exc2, exc3])
# python traceback.TracebackException < 3.6.4 does not support unhashable exceptions
# and raises a TypeError exception
if sys.version_info < (3, 6, 4):
with pytest.raises(TypeError):
format_exception(*einfo(exc1))
else:
format_exception(*einfo(exc1))
def make_tree():
# Returns an object like:
# MultiError([
# MultiError([
# ValueError,
# KeyError,
# ]),
# NameError,
# ])
# where all exceptions except the root have a non-trivial traceback.
exc1 = get_exc(raiser1)
exc2 = get_exc(raiser2)
exc3 = get_exc(raiser3)
# Give m12 a non-trivial traceback
try:
raise MultiError([exc1, exc2])
except BaseException as m12:
return MultiError([m12, exc3])
def assert_tree_eq(m1, m2):
if m1 is None or m2 is None:
assert m1 is m2
return
assert type(m1) is type(m2)
assert extract_tb(m1.__traceback__) == extract_tb(m2.__traceback__)
assert_tree_eq(m1.__cause__, m2.__cause__)
assert_tree_eq(m1.__context__, m2.__context__)
if isinstance(m1, MultiError):
assert len(m1.exceptions) == len(m2.exceptions)
for e1, e2 in zip(m1.exceptions, m2.exceptions):
assert_tree_eq(e1, e2)
def test_MultiError_filter():
def null_handler(exc):
return exc
m = make_tree()
assert_tree_eq(m, m)
assert MultiError.filter(null_handler, m) is m
assert_tree_eq(m, make_tree())
# Make sure we don't pick up any detritus if run in a context where
# implicit exception chaining would like to kick in
m = make_tree()
try:
raise ValueError
except ValueError:
assert MultiError.filter(null_handler, m) is m
assert_tree_eq(m, make_tree())
def simple_filter(exc):
if isinstance(exc, ValueError):
return None
if isinstance(exc, KeyError):
return RuntimeError()
return exc
new_m = MultiError.filter(simple_filter, make_tree())
assert isinstance(new_m, MultiError)
assert len(new_m.exceptions) == 2
# was: [[ValueError, KeyError], NameError]
# ValueError disappeared & KeyError became RuntimeError, so now:
assert isinstance(new_m.exceptions[0], RuntimeError)
assert isinstance(new_m.exceptions[1], NameError)
# implicit chaining:
assert isinstance(new_m.exceptions[0].__context__, KeyError)
# also, the traceback on the KeyError incorporates what used to be the
# traceback on its parent MultiError
orig = make_tree()
# make sure we have the right path
assert isinstance(orig.exceptions[0].exceptions[1], KeyError)
# get original traceback summary
orig_extracted = (
extract_tb(orig.__traceback__) +
extract_tb(orig.exceptions[0].__traceback__) +
extract_tb(orig.exceptions[0].exceptions[1].__traceback__)
)
def p(exc):
print_exception(type(exc), exc, exc.__traceback__)
p(orig)
p(orig.exceptions[0])
p(orig.exceptions[0].exceptions[1])
p(new_m.exceptions[0].__context__)
# compare to the new path
assert new_m.__traceback__ is None
new_extracted = extract_tb(new_m.exceptions[0].__context__.__traceback__)
assert orig_extracted == new_extracted
# check preserving partial tree
def filter_NameError(exc):
if isinstance(exc, NameError):
return None
return exc
m = make_tree()
new_m = MultiError.filter(filter_NameError, m)
# with the NameError gone, the other branch gets promoted
assert new_m is m.exceptions[0]
# check fully handling everything
def filter_all(exc):
return None
assert MultiError.filter(filter_all, make_tree()) is None
def test_MultiError_catch():
# No exception to catch
def noop(_):
pass # pragma: no cover
with MultiError.catch(noop):
pass
# Simple pass-through of all exceptions
m = make_tree()
with pytest.raises(MultiError) as excinfo:
with MultiError.catch(lambda exc: exc):
raise m
assert excinfo.value is m
# Should be unchanged, except that we added a traceback frame by raising
# it here
assert m.__traceback__ is not None
assert m.__traceback__.tb_frame.f_code.co_name == "test_MultiError_catch"
assert m.__traceback__.tb_next is None
m.__traceback__ = None
assert_tree_eq(m, make_tree())
# Swallows everything
with MultiError.catch(lambda _: None):
raise make_tree()
def simple_filter(exc):
if isinstance(exc, ValueError):
return None
if isinstance(exc, KeyError):
return RuntimeError()
return exc
with pytest.raises(MultiError) as excinfo:
with MultiError.catch(simple_filter):
raise make_tree()
new_m = excinfo.value
assert isinstance(new_m, MultiError)
assert len(new_m.exceptions) == 2
# was: [[ValueError, KeyError], NameError]
# ValueError disappeared & KeyError became RuntimeError, so now:
assert isinstance(new_m.exceptions[0], RuntimeError)
assert isinstance(new_m.exceptions[1], NameError)
# Make sure that Python did not successfully attach the old MultiError to
# our new MultiError's __context__
assert not new_m.__suppress_context__
assert new_m.__context__ is None
# check preservation of __cause__ and __context__
v = ValueError()
v.__cause__ = KeyError()
with pytest.raises(ValueError) as excinfo:
with MultiError.catch(lambda exc: exc):
raise v
assert isinstance(excinfo.value.__cause__, KeyError)
v = ValueError()
context = KeyError()
v.__context__ = context
with pytest.raises(ValueError) as excinfo:
with MultiError.catch(lambda exc: exc):
raise v
assert excinfo.value.__context__ is context
assert not excinfo.value.__suppress_context__
for suppress_context in [True, False]:
v = ValueError()
context = KeyError()
v.__context__ = context
v.__suppress_context__ = suppress_context
distractor = RuntimeError()
with pytest.raises(ValueError) as excinfo:
def catch_RuntimeError(exc):
if isinstance(exc, RuntimeError):
return None
else:
return exc
with MultiError.catch(catch_RuntimeError):
raise MultiError([v, distractor])
assert excinfo.value.__context__ is context
assert excinfo.value.__suppress_context__ == suppress_context
def assert_match_in_seq(pattern_list, string):
offset = 0
print("looking for pattern matches...")
for pattern in pattern_list:
print("checking pattern:", pattern)
reobj = re.compile(pattern)
match = reobj.search(string, offset)
assert match is not None
offset = match.end()
def test_assert_match_in_seq():
assert_match_in_seq(["a", "b"], "xx a xx b xx")
assert_match_in_seq(["b", "a"], "xx b xx a xx")
with pytest.raises(AssertionError):
assert_match_in_seq(["a", "b"], "xx b xx a xx")
def test_format_exception():
exc = get_exc(raiser1)
formatted = "".join(format_exception(*einfo(exc)))
assert "raiser1_string" in formatted
assert "in raiser1_3" in formatted
assert "raiser2_string" not in formatted
assert "in raiser2_2" not in formatted
assert "direct cause" not in formatted
assert "During handling" not in formatted
exc = get_exc(raiser1)
exc.__cause__ = get_exc(raiser2)
formatted = "".join(format_exception(*einfo(exc)))
assert "raiser1_string" in formatted
assert "in raiser1_3" in formatted
assert "raiser2_string" in formatted
assert "in raiser2_2" in formatted
assert "direct cause" in formatted
assert "During handling" not in formatted
# ensure cause included
assert _cause_message in formatted
exc = get_exc(raiser1)
exc.__context__ = get_exc(raiser2)
formatted = "".join(format_exception(*einfo(exc)))
assert "raiser1_string" in formatted
assert "in raiser1_3" in formatted
assert "raiser2_string" in formatted
assert "in raiser2_2" in formatted
assert "direct cause" not in formatted
assert "During handling" in formatted
exc.__suppress_context__ = True
formatted = "".join(format_exception(*einfo(exc)))
assert "raiser1_string" in formatted
assert "in raiser1_3" in formatted
assert "raiser2_string" not in formatted
assert "in raiser2_2" not in formatted
assert "direct cause" not in formatted
assert "During handling" not in formatted
# chain=False
exc = get_exc(raiser1)
exc.__context__ = get_exc(raiser2)
formatted = "".join(format_exception(*einfo(exc), chain=False))
assert "raiser1_string" in formatted
assert "in raiser1_3" in formatted
assert "raiser2_string" not in formatted
assert "in raiser2_2" not in formatted
assert "direct cause" not in formatted
assert "During handling" not in formatted
# limit
exc = get_exc(raiser1)
exc.__context__ = get_exc(raiser2)
# get_exc adds a frame that counts against the limit, so limit=2 means we
# get 1 deep into the raiser stack
formatted = "".join(format_exception(*einfo(exc), limit=2))
print(formatted)
assert "raiser1_string" in formatted
assert "in raiser1" in formatted
assert "in raiser1_2" not in formatted
assert "raiser2_string" in formatted
assert "in raiser2" in formatted
assert "in raiser2_2" not in formatted
exc = get_exc(raiser1)
exc.__context__ = get_exc(raiser2)
formatted = "".join(format_exception(*einfo(exc), limit=1))
print(formatted)
assert "raiser1_string" in formatted
assert "in raiser1" not in formatted
assert "raiser2_string" in formatted
assert "in raiser2" not in formatted
# handles loops
exc = get_exc(raiser1)
exc.__cause__ = exc
formatted = "".join(format_exception(*einfo(exc)))
assert "raiser1_string" in formatted
assert "in raiser1_3" in formatted
assert "raiser2_string" not in formatted
assert "in raiser2_2" not in formatted
# ensure duplicate exception is not included as cause
assert _cause_message not in formatted
# MultiError
formatted = "".join(format_exception(*einfo(make_tree())))
print(formatted)
assert_match_in_seq(
[
# Outer exception is MultiError
r"MultiError:",
# First embedded exception is the embedded MultiError
r"\nDetails of embedded exception 1",
# Which has a single stack frame from make_tree raising it
r"in make_tree",
# Then it has two embedded exceptions
r" Details of embedded exception 1",
r"in raiser1_2",
# for some reason ValueError has no quotes
r"ValueError: raiser1_string",
r" Details of embedded exception 2",
r"in raiser2_2",
# But KeyError does have quotes
r"KeyError: 'raiser2_string'",
# And finally the NameError, which is a sibling of the embedded
# MultiError
r"\nDetails of embedded exception 2:",
r"in raiser3",
r"NameError",
],
formatted
)
# Prints duplicate exceptions in sub-exceptions
exc1 = get_exc(raiser1)
def raise1_raiser1():
try:
raise exc1
except:
raise ValueError("foo")
def raise2_raiser1():
try:
raise exc1
except:
raise KeyError("bar")
exc2 = get_exc(raise1_raiser1)
exc3 = get_exc(raise2_raiser1)
try:
raise MultiError([exc2, exc3])
except MultiError as e:
exc = e
formatted = "".join(format_exception(*einfo(exc)))
print(formatted)
assert_match_in_seq(
[
r"Traceback",
# Outer exception is MultiError
r"MultiError:",
# First embedded exception is the embedded ValueError with cause of raiser1
r"\nDetails of embedded exception 1",
# Print details of exc1
r" Traceback",
r"in get_exc",
r"in raiser1",
r"ValueError: raiser1_string",
# Print details of exc2
r"\n During handling of the above exception, another exception occurred:",
r" Traceback",
r"in get_exc",
r"in raise1_raiser1",
r" ValueError: foo",
# Second embedded exception is the embedded KeyError with cause of raiser1
r"\nDetails of embedded exception 2",
# Print details of exc1 again
r" Traceback",
r"in get_exc",
r"in raiser1",
r"ValueError: raiser1_string",
# Print details of exc3
r"\n During handling of the above exception, another exception occurred:",
r" Traceback",
r"in get_exc",
r"in raise2_raiser1",
r" KeyError: 'bar'",
],
formatted
)
def test_logging(caplog):
exc1 = get_exc(raiser1)
exc2 = get_exc(raiser2)
m = MultiError([exc1, exc2])
message = "test test test"
try:
raise m
except MultiError as exc:
logging.getLogger().exception(message)
# Join lines together
formatted = "".join(
format_exception(type(exc), exc, exc.__traceback__)
)
assert message in caplog.text
assert formatted in caplog.text
def run_script(name, use_ipython=False):
import trio
trio_path = Path(trio.__file__).parent.parent
script_path = Path(__file__).parent / "test_multierror_scripts" / name
env = dict(os.environ)
print("parent PYTHONPATH:", env.get("PYTHONPATH"))
if "PYTHONPATH" in env: # pragma: no cover
pp = env["PYTHONPATH"].split(os.pathsep)
else:
pp = []
pp.insert(0, str(trio_path))
pp.insert(0, str(script_path.parent))
env["PYTHONPATH"] = os.pathsep.join(pp)
print("subprocess PYTHONPATH:", env.get("PYTHONPATH"))
if use_ipython:
lines = [script_path.open().read(), "exit()"]
cmd = [
sys.executable,
"-u",
"-m",
"IPython",
# no startup files
"--quick",
"--TerminalIPythonApp.code_to_run=" + '\n'.join(lines),
]
else:
cmd = [sys.executable, "-u", str(script_path)]
print("running:", cmd)
completed = subprocess.run(
cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
print("process output:")
print(completed.stdout.decode("utf-8"))
return completed
def check_simple_excepthook(completed):
assert_match_in_seq(
[
"in <module>",
"MultiError",
"Details of embedded exception 1",
"in exc1_fn",
"ValueError",
"Details of embedded exception 2",
"in exc2_fn",
"KeyError",
], completed.stdout.decode("utf-8")
)
def test_simple_excepthook():
completed = run_script("simple_excepthook.py")
check_simple_excepthook(completed)
def test_custom_excepthook():
# Check that user-defined excepthooks aren't overridden
completed = run_script("custom_excepthook.py")
assert_match_in_seq(
[
# The warning
"RuntimeWarning",
"already have a custom",
# The message printed by the custom hook, proving we didn't
# override it
"custom running!",
# The MultiError
"MultiError:",
],
completed.stdout.decode("utf-8")
)
# This warning is triggered by ipython 7.5.0 on python 3.8
import warnings
warnings.filterwarnings(
"ignore",
message=".*\"@coroutine\" decorator is deprecated",
category=DeprecationWarning,
module="IPython.*"
)
try:
import IPython
except ImportError: # pragma: no cover
have_ipython = False
else:
have_ipython = True
need_ipython = pytest.mark.skipif(not have_ipython, reason="need IPython")
@slow
@need_ipython
def test_ipython_exc_handler():
completed = run_script("simple_excepthook.py", use_ipython=True)
check_simple_excepthook(completed)
@slow
@need_ipython
def test_ipython_imported_but_unused():
completed = run_script("simple_excepthook_IPython.py")
check_simple_excepthook(completed)
@slow
@need_ipython
def test_ipython_custom_exc_handler():
# Check we get a nice warning (but only one!) if the user is using IPython
# and already has some other set_custom_exc handler installed.
completed = run_script("ipython_custom_exc.py", use_ipython=True)
assert_match_in_seq(
[
# The warning
"RuntimeWarning",
"IPython detected",
"skip installing Trio",
# The MultiError
"MultiError",
"ValueError",
"KeyError",
],
completed.stdout.decode("utf-8")
)
# Make sure our other warning doesn't show up
assert "custom sys.excepthook" not in completed.stdout.decode("utf-8")
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
12183,
13,
5215,
11451,
1688,
13,
13,
3166,
9637,
1627,
1053,
6597,
29918,
22625,
29892,
1596,
29918,
11739,
29892,
3402,
29918,
11739,
29892,
903,
29883,
1071,
29918,
4906,
13,
5215,
10876,
13,
5215,
2897,
13,
5215,
337,
13,
3166,
2224,
1982,
1053,
10802,
13,
5215,
1014,
5014,
13,
13,
3166,
869,
29873,
4422,
1053,
5232,
13,
13,
3166,
6317,
29918,
4713,
631,
729,
1053,
14974,
2392,
29892,
3022,
271,
29918,
22625,
13,
3166,
2023,
29918,
3221,
1053,
1722,
29918,
29876,
332,
643,
29891,
13,
13,
13,
1990,
2216,
10438,
519,
2451,
29898,
2451,
1125,
13,
1678,
775,
353,
6213,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
775,
1125,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
401,
353,
775,
13,
13,
1678,
822,
4770,
1837,
12035,
1311,
29892,
916,
1125,
13,
4706,
565,
451,
338,
8758,
29898,
1228,
29892,
2216,
10438,
519,
2451,
1125,
13,
9651,
736,
7700,
13,
4706,
736,
1583,
29889,
401,
1275,
916,
29889,
401,
13,
13,
13,
12674,
822,
12020,
29918,
29876,
720,
1161,
519,
29898,
401,
1125,
13,
1678,
12020,
2216,
10438,
519,
2451,
29898,
401,
29897,
13,
13,
13,
1753,
1153,
7608,
29896,
7295,
13,
1678,
1153,
7608,
29896,
29918,
29906,
580,
13,
13,
13,
1753,
1153,
7608,
29896,
29918,
29906,
7295,
13,
1678,
1153,
7608,
29896,
29918,
29941,
580,
13,
13,
13,
1753,
1153,
7608,
29896,
29918,
29941,
7295,
13,
1678,
12020,
7865,
2392,
703,
336,
7608,
29896,
29918,
1807,
1159,
13,
13,
13,
1753,
1153,
7608,
29906,
7295,
13,
1678,
1153,
7608,
29906,
29918,
29906,
580,
13,
13,
13,
1753,
1153,
7608,
29906,
29918,
29906,
7295,
13,
1678,
12020,
7670,
2392,
703,
336,
7608,
29906,
29918,
1807,
1159,
13,
13,
13,
1753,
1153,
7608,
29941,
7295,
13,
1678,
12020,
4408,
2392,
13,
13,
13,
1753,
679,
29918,
735,
29883,
29898,
336,
7608,
1125,
13,
1678,
1018,
29901,
13,
4706,
1153,
7608,
580,
13,
1678,
5174,
8960,
408,
5566,
29901,
13,
4706,
736,
5566,
13,
13,
13,
1753,
679,
29918,
22625,
29898,
336,
7608,
1125,
13,
1678,
736,
679,
29918,
735,
29883,
29898,
336,
7608,
467,
1649,
15003,
1627,
1649,
13,
13,
13,
1753,
1011,
1181,
29898,
735,
29883,
1125,
13,
1678,
736,
313,
1853,
29898,
735,
29883,
511,
5566,
29892,
5566,
17255,
15003,
1627,
1649,
29897,
13,
13,
13,
1753,
1243,
29918,
17685,
29918,
22625,
7295,
13,
13,
1678,
260,
29890,
29896,
353,
679,
29918,
22625,
29898,
336,
7608,
29896,
29897,
13,
1678,
260,
29890,
29906,
353,
679,
29918,
22625,
29898,
336,
7608,
29906,
29897,
13,
13,
1678,
396,
4525,
736,
263,
1051,
310,
313,
9507,
29892,
6276,
8154,
29892,
7876,
1024,
29892,
1426,
29897,
5291,
2701,
13,
1678,
396,
2045,
597,
2640,
29889,
4691,
29889,
990,
29914,
29941,
29914,
5258,
29914,
15003,
1627,
29889,
1420,
29937,
15003,
1627,
29889,
21111,
29918,
22625,
13,
1678,
9976,
29896,
353,
6597,
29918,
22625,
29898,
22625,
29896,
29897,
13,
1678,
9976,
29906,
353,
6597,
29918,
22625,
29898,
22625,
29906,
29897,
13,
13,
1678,
260,
29890,
29896,
29906,
353,
3022,
271,
29918,
22625,
29898,
22625,
29896,
29892,
260,
29890,
29906,
29897,
13,
1678,
4974,
6597,
29918,
22625,
29898,
22625,
29896,
29906,
29897,
1275,
9976,
29896,
718,
9976,
29906,
13,
13,
1678,
260,
29890,
29906,
29896,
353,
3022,
271,
29918,
22625,
29898,
22625,
29906,
29892,
260,
29890,
29896,
29897,
13,
1678,
4974,
6597,
29918,
22625,
29898,
22625,
29906,
29896,
29897,
1275,
9976,
29906,
718,
9976,
29896,
13,
13,
1678,
396,
5399,
3587,
759,
403,
4251,
13,
1678,
4974,
6597,
29918,
22625,
29898,
17685,
29918,
22625,
29898,
8516,
29892,
260,
29890,
29896,
876,
1275,
9976,
29896,
13,
1678,
4974,
6597,
29918,
22625,
29898,
17685,
29918,
22625,
29898,
22625,
29896,
29892,
6213,
876,
1275,
9976,
29896,
13,
1678,
4974,
3022,
271,
29918,
22625,
29898,
8516,
29892,
6213,
29897,
338,
6213,
13,
13,
1678,
396,
8561,
1854,
278,
2441,
9637,
1627,
29879,
3282,
29915,
29873,
679,
5478,
630,
491,
10171,
13,
1678,
4974,
6597,
29918,
22625,
29898,
657,
29918,
22625,
29898,
336,
7608,
29896,
876,
1275,
9976,
29896,
13,
1678,
4974,
6597,
29918,
22625,
29898,
657,
29918,
22625,
29898,
336,
7608,
29906,
876,
1275,
9976,
29906,
13,
13,
13,
1753,
1243,
29918,
15329,
2392,
7295,
13,
1678,
5566,
29896,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29896,
29897,
13,
1678,
5566,
29906,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29906,
29897,
13,
13,
1678,
4974,
14974,
2392,
4197,
735,
29883,
29896,
2314,
338,
5566,
29896,
13,
1678,
286,
353,
14974,
2392,
4197,
735,
29883,
29896,
29892,
5566,
29906,
2314,
13,
1678,
4974,
286,
29889,
11739,
29879,
1275,
518,
735,
29883,
29896,
29892,
5566,
29906,
29962,
13,
1678,
4974,
376,
1917,
2392,
29908,
297,
851,
29898,
29885,
29897,
13,
1678,
4974,
376,
1917,
2392,
29908,
297,
2062,
29898,
29885,
29897,
13,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
1542,
2392,
1125,
13,
4706,
14974,
2392,
29898,
3318,
3101,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
1542,
2392,
1125,
13,
4706,
14974,
2392,
4197,
2558,
2392,
3285,
7865,
2392,
2314,
13,
13,
13,
1753,
1243,
29918,
15329,
2392,
2776,
15771,
15329,
2392,
7295,
13,
1678,
396,
1152,
14974,
2392,
4197,
15329,
2392,
11724,
9801,
727,
338,
694,
4319,
20437,
491,
278,
13,
1678,
396,
5823,
988,
4770,
2344,
1649,
338,
2000,
565,
4770,
1482,
1649,
3639,
263,
16079,
14974,
2392,
29889,
13,
1678,
15283,
353,
518,
2558,
2392,
3285,
7865,
2392,
580,
29962,
13,
1678,
263,
353,
14974,
2392,
29898,
11739,
29879,
29897,
13,
1678,
289,
353,
14974,
2392,
4197,
29874,
2314,
13,
1678,
4974,
289,
1275,
263,
13,
1678,
4974,
289,
29889,
11739,
29879,
1275,
15283,
13,
13,
13,
12674,
822,
1243,
29918,
15329,
2392,
3664,
10438,
519,
7295,
13,
1678,
5566,
29896,
353,
2216,
10438,
519,
2451,
29898,
29946,
29906,
29897,
13,
1678,
5566,
29906,
353,
2216,
10438,
519,
2451,
29898,
29946,
29906,
29946,
29906,
29897,
13,
1678,
5566,
29941,
353,
7865,
2392,
580,
13,
1678,
4974,
5566,
29896,
2804,
5566,
29906,
13,
1678,
4974,
5566,
29896,
2804,
5566,
29941,
13,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
15329,
2392,
1125,
13,
4706,
7465,
411,
1722,
29918,
29876,
332,
643,
29891,
580,
408,
5595,
643,
29891,
29901,
13,
9651,
5595,
643,
29891,
29889,
2962,
29918,
578,
265,
29898,
22692,
29918,
29876,
720,
1161,
519,
29892,
29871,
29946,
29906,
29897,
13,
9651,
5595,
643,
29891,
29889,
2962,
29918,
578,
265,
29898,
22692,
29918,
29876,
720,
1161,
519,
29892,
29871,
29946,
29906,
29946,
29906,
29897,
13,
13,
13,
1753,
1243,
29918,
15329,
2392,
29918,
4572,
29918,
3664,
10438,
519,
7295,
13,
1678,
429,
2395,
353,
14974,
2392,
4197,
3664,
10438,
519,
2451,
29898,
29946,
29906,
511,
7865,
2392,
580,
2314,
13,
13,
1678,
822,
4386,
29918,
1917,
2392,
29898,
735,
29883,
1125,
13,
4706,
565,
338,
8758,
29898,
735,
29883,
29892,
7865,
2392,
1125,
13,
9651,
736,
6213,
13,
4706,
1683,
29901,
13,
9651,
736,
5566,
13,
13,
1678,
22289,
29918,
735,
2395,
353,
14974,
2392,
29889,
4572,
29898,
8411,
29918,
1917,
2392,
29892,
429,
2395,
29897,
13,
1678,
4974,
338,
8758,
29898,
4572,
287,
29918,
735,
2395,
29892,
2216,
10438,
519,
2451,
29897,
13,
13,
13,
1753,
1243,
29918,
15003,
1627,
29918,
3757,
1295,
291,
7295,
13,
1678,
5566,
29896,
353,
24875,
2392,
580,
13,
1678,
5566,
29906,
353,
7670,
2392,
580,
13,
1678,
5566,
29941,
353,
2216,
10438,
519,
2451,
29898,
29946,
29906,
29897,
13,
1678,
396,
3940,
920,
445,
10017,
263,
2425,
29892,
988,
5566,
29896,
14637,
304,
5566,
29896,
13,
1678,
396,
910,
1033,
7135,
385,
10362,
20437,
29936,
278,
525,
28026,
29915,
731,
338,
7424,
304,
5557,
13,
1678,
396,
445,
29889,
13,
1678,
5566,
29896,
17255,
29883,
1071,
1649,
353,
14974,
2392,
4197,
735,
29883,
29896,
29892,
5566,
29906,
29892,
5566,
29941,
2314,
13,
1678,
396,
3017,
9637,
1627,
29889,
11591,
1627,
2451,
529,
29871,
29941,
29889,
29953,
29889,
29946,
947,
451,
2304,
443,
8568,
519,
15283,
13,
1678,
396,
322,
1153,
4637,
263,
20948,
3682,
13,
1678,
565,
10876,
29889,
3259,
29918,
3888,
529,
313,
29941,
29892,
29871,
29953,
29892,
29871,
29946,
1125,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
1542,
2392,
1125,
13,
9651,
3402,
29918,
11739,
10456,
29872,
3888,
29898,
735,
29883,
29896,
876,
13,
1678,
1683,
29901,
13,
4706,
3402,
29918,
11739,
10456,
29872,
3888,
29898,
735,
29883,
29896,
876,
13,
13,
13,
1753,
1207,
29918,
8336,
7295,
13,
1678,
396,
16969,
385,
1203,
763,
29901,
13,
1678,
396,
259,
14974,
2392,
4197,
13,
1678,
396,
268,
14974,
2392,
4197,
13,
1678,
396,
539,
7865,
2392,
29892,
13,
1678,
396,
539,
7670,
2392,
29892,
13,
1678,
396,
268,
4514,
511,
13,
1678,
396,
268,
4408,
2392,
29892,
13,
1678,
396,
1678,
2314,
13,
1678,
396,
988,
599,
15283,
5174,
278,
3876,
505,
263,
1661,
29899,
29873,
9473,
9637,
1627,
29889,
13,
1678,
5566,
29896,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29896,
29897,
13,
1678,
5566,
29906,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29906,
29897,
13,
1678,
5566,
29941,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29941,
29897,
13,
13,
1678,
396,
25538,
286,
29896,
29906,
263,
1661,
29899,
29873,
9473,
9637,
1627,
13,
1678,
1018,
29901,
13,
4706,
12020,
14974,
2392,
4197,
735,
29883,
29896,
29892,
5566,
29906,
2314,
13,
1678,
5174,
7399,
2451,
408,
286,
29896,
29906,
29901,
13,
4706,
736,
14974,
2392,
4197,
29885,
29896,
29906,
29892,
5566,
29941,
2314,
13,
13,
13,
1753,
4974,
29918,
8336,
29918,
1837,
29898,
29885,
29896,
29892,
286,
29906,
1125,
13,
1678,
565,
286,
29896,
338,
6213,
470,
286,
29906,
338,
6213,
29901,
13,
4706,
4974,
286,
29896,
338,
286,
29906,
13,
4706,
736,
13,
1678,
4974,
1134,
29898,
29885,
29896,
29897,
338,
1134,
29898,
29885,
29906,
29897,
13,
1678,
4974,
6597,
29918,
22625,
29898,
29885,
29896,
17255,
15003,
1627,
1649,
29897,
1275,
6597,
29918,
22625,
29898,
29885,
29906,
17255,
15003,
1627,
1649,
29897,
13,
1678,
4974,
29918,
8336,
29918,
1837,
29898,
29885,
29896,
17255,
29883,
1071,
1649,
29892,
286,
29906,
17255,
29883,
1071,
1649,
29897,
13,
1678,
4974,
29918,
8336,
29918,
1837,
29898,
29885,
29896,
17255,
4703,
1649,
29892,
286,
29906,
17255,
4703,
1649,
29897,
13,
1678,
565,
338,
8758,
29898,
29885,
29896,
29892,
14974,
2392,
1125,
13,
4706,
4974,
7431,
29898,
29885,
29896,
29889,
11739,
29879,
29897,
1275,
7431,
29898,
29885,
29906,
29889,
11739,
29879,
29897,
13,
4706,
363,
321,
29896,
29892,
321,
29906,
297,
14319,
29898,
29885,
29896,
29889,
11739,
29879,
29892,
286,
29906,
29889,
11739,
29879,
1125,
13,
9651,
4974,
29918,
8336,
29918,
1837,
29898,
29872,
29896,
29892,
321,
29906,
29897,
13,
13,
13,
1753,
1243,
29918,
15329,
2392,
29918,
4572,
7295,
13,
1678,
822,
1870,
29918,
13789,
29898,
735,
29883,
1125,
13,
4706,
736,
5566,
13,
13,
1678,
286,
353,
1207,
29918,
8336,
580,
13,
1678,
4974,
29918,
8336,
29918,
1837,
29898,
29885,
29892,
286,
29897,
13,
1678,
4974,
14974,
2392,
29889,
4572,
29898,
4304,
29918,
13789,
29892,
286,
29897,
338,
286,
13,
1678,
4974,
29918,
8336,
29918,
1837,
29898,
29885,
29892,
1207,
29918,
8336,
3101,
13,
13,
1678,
396,
8561,
1854,
591,
1016,
29915,
29873,
5839,
701,
738,
1439,
768,
375,
565,
1065,
297,
263,
3030,
988,
13,
1678,
396,
12235,
3682,
9704,
292,
723,
763,
304,
24817,
297,
13,
1678,
286,
353,
1207,
29918,
8336,
580,
13,
1678,
1018,
29901,
13,
4706,
12020,
7865,
2392,
13,
1678,
5174,
7865,
2392,
29901,
13,
4706,
4974,
14974,
2392,
29889,
4572,
29898,
4304,
29918,
13789,
29892,
286,
29897,
338,
286,
13,
1678,
4974,
29918,
8336,
29918,
1837,
29898,
29885,
29892,
1207,
29918,
8336,
3101,
13,
13,
1678,
822,
2560,
29918,
4572,
29898,
735,
29883,
1125,
13,
4706,
565,
338,
8758,
29898,
735,
29883,
29892,
7865,
2392,
1125,
13,
9651,
736,
6213,
13,
4706,
565,
338,
8758,
29898,
735,
29883,
29892,
7670,
2392,
1125,
13,
9651,
736,
24875,
2392,
580,
13,
4706,
736,
5566,
13,
13,
1678,
716,
29918,
29885,
353,
14974,
2392,
29889,
4572,
29898,
12857,
29918,
4572,
29892,
1207,
29918,
8336,
3101,
13,
1678,
4974,
338,
8758,
29898,
1482,
29918,
29885,
29892,
14974,
2392,
29897,
13,
1678,
4974,
7431,
29898,
1482,
29918,
29885,
29889,
11739,
29879,
29897,
1275,
29871,
29906,
13,
1678,
396,
471,
29901,
5519,
1917,
2392,
29892,
7670,
2392,
1402,
4408,
2392,
29962,
13,
1678,
396,
7865,
2392,
24273,
669,
7670,
2392,
3897,
24875,
2392,
29892,
577,
1286,
29901,
13,
1678,
4974,
338,
8758,
29898,
1482,
29918,
29885,
29889,
11739,
29879,
29961,
29900,
1402,
24875,
2392,
29897,
13,
1678,
4974,
338,
8758,
29898,
1482,
29918,
29885,
29889,
11739,
29879,
29961,
29896,
1402,
4408,
2392,
29897,
13,
13,
1678,
396,
12235,
9704,
292,
29901,
13,
1678,
4974,
338,
8758,
29898,
1482,
29918,
29885,
29889,
11739,
29879,
29961,
29900,
1822,
1649,
4703,
1649,
29892,
7670,
2392,
29897,
13,
13,
1678,
396,
884,
29892,
278,
9637,
1627,
373,
278,
7670,
2392,
11039,
1078,
825,
1304,
304,
367,
278,
13,
1678,
396,
9637,
1627,
373,
967,
3847,
14974,
2392,
13,
1678,
1677,
353,
1207,
29918,
8336,
580,
13,
1678,
396,
1207,
1854,
591,
505,
278,
1492,
2224,
13,
1678,
4974,
338,
8758,
29898,
12683,
29889,
11739,
29879,
29961,
29900,
1822,
11739,
29879,
29961,
29896,
1402,
7670,
2392,
29897,
13,
1678,
396,
679,
2441,
9637,
1627,
15837,
13,
1678,
1677,
29918,
21111,
287,
353,
313,
13,
4706,
6597,
29918,
22625,
29898,
12683,
17255,
15003,
1627,
1649,
29897,
718,
13,
4706,
6597,
29918,
22625,
29898,
12683,
29889,
11739,
29879,
29961,
29900,
1822,
1649,
15003,
1627,
1649,
29897,
718,
13,
4706,
6597,
29918,
22625,
29898,
12683,
29889,
11739,
29879,
29961,
29900,
1822,
11739,
29879,
29961,
29896,
1822,
1649,
15003,
1627,
1649,
29897,
13,
1678,
1723,
13,
13,
1678,
822,
282,
29898,
735,
29883,
1125,
13,
4706,
1596,
29918,
11739,
29898,
1853,
29898,
735,
29883,
511,
5566,
29892,
5566,
17255,
15003,
1627,
1649,
29897,
13,
13,
1678,
282,
29898,
12683,
29897,
13,
1678,
282,
29898,
12683,
29889,
11739,
29879,
29961,
29900,
2314,
13,
1678,
282,
29898,
12683,
29889,
11739,
29879,
29961,
29900,
1822,
11739,
29879,
29961,
29896,
2314,
13,
1678,
282,
29898,
1482,
29918,
29885,
29889,
11739,
29879,
29961,
29900,
1822,
1649,
4703,
1649,
29897,
13,
1678,
396,
7252,
304,
278,
716,
2224,
13,
1678,
4974,
716,
29918,
29885,
17255,
15003,
1627,
1649,
338,
6213,
13,
1678,
716,
29918,
21111,
287,
353,
6597,
29918,
22625,
29898,
1482,
29918,
29885,
29889,
11739,
29879,
29961,
29900,
1822,
1649,
4703,
1649,
17255,
15003,
1627,
1649,
29897,
13,
1678,
4974,
1677,
29918,
21111,
287,
1275,
716,
29918,
21111,
287,
13,
13,
1678,
396,
1423,
2225,
29530,
7687,
5447,
13,
1678,
822,
4175,
29918,
1170,
2392,
29898,
735,
29883,
1125,
13,
4706,
565,
338,
8758,
29898,
735,
29883,
29892,
4408,
2392,
1125,
13,
9651,
736,
6213,
13,
4706,
736,
5566,
13,
13,
1678,
286,
353,
1207,
29918,
8336,
580,
13,
1678,
716,
29918,
29885,
353,
14974,
2392,
29889,
4572,
29898,
4572,
29918,
1170,
2392,
29892,
286,
29897,
13,
1678,
396,
411,
278,
4408,
2392,
7695,
29892,
278,
916,
5443,
4947,
21201,
13,
1678,
4974,
716,
29918,
29885,
338,
286,
29889,
11739,
29879,
29961,
29900,
29962,
13,
13,
1678,
396,
1423,
8072,
11415,
4129,
13,
1678,
822,
4175,
29918,
497,
29898,
735,
29883,
1125,
13,
4706,
736,
6213,
13,
13,
1678,
4974,
14974,
2392,
29889,
4572,
29898,
4572,
29918,
497,
29892,
1207,
29918,
8336,
3101,
338,
6213,
13,
13,
13,
1753,
1243,
29918,
15329,
2392,
29918,
12510,
7295,
13,
1678,
396,
1939,
3682,
304,
4380,
13,
13,
1678,
822,
694,
459,
7373,
1125,
13,
4706,
1209,
29871,
396,
282,
23929,
29901,
694,
4612,
13,
13,
1678,
411,
14974,
2392,
29889,
12510,
29898,
1217,
459,
1125,
13,
4706,
1209,
13,
13,
1678,
396,
12545,
1209,
29899,
20678,
310,
599,
15283,
13,
1678,
286,
353,
1207,
29918,
8336,
580,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
15329,
2392,
29897,
408,
5566,
3888,
29901,
13,
4706,
411,
14974,
2392,
29889,
12510,
29898,
2892,
5566,
29901,
5566,
1125,
13,
9651,
12020,
286,
13,
1678,
4974,
5566,
3888,
29889,
1767,
338,
286,
13,
1678,
396,
10575,
367,
443,
15033,
29892,
5174,
393,
591,
2715,
263,
9637,
1627,
3515,
491,
29263,
13,
1678,
396,
372,
1244,
13,
1678,
4974,
286,
17255,
15003,
1627,
1649,
338,
451,
6213,
13,
1678,
4974,
286,
17255,
15003,
1627,
26914,
22625,
29918,
2557,
29889,
29888,
29918,
401,
29889,
1111,
29918,
978,
1275,
376,
1688,
29918,
15329,
2392,
29918,
12510,
29908,
13,
1678,
4974,
286,
17255,
15003,
1627,
26914,
22625,
29918,
4622,
338,
6213,
13,
1678,
286,
17255,
15003,
1627,
1649,
353,
6213,
13,
1678,
4974,
29918,
8336,
29918,
1837,
29898,
29885,
29892,
1207,
29918,
8336,
3101,
13,
13,
1678,
396,
3925,
497,
1242,
4129,
13,
1678,
411,
14974,
2392,
29889,
12510,
29898,
2892,
903,
29901,
6213,
1125,
13,
4706,
12020,
1207,
29918,
8336,
580,
13,
13,
1678,
822,
2560,
29918,
4572,
29898,
735,
29883,
1125,
13,
4706,
565,
338,
8758,
29898,
735,
29883,
29892,
7865,
2392,
1125,
13,
9651,
736,
6213,
13,
4706,
565,
338,
8758,
29898,
735,
29883,
29892,
7670,
2392,
1125,
13,
9651,
736,
24875,
2392,
580,
13,
4706,
736,
5566,
13,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
15329,
2392,
29897,
408,
5566,
3888,
29901,
13,
4706,
411,
14974,
2392,
29889,
12510,
29898,
12857,
29918,
4572,
1125,
13,
9651,
12020,
1207,
29918,
8336,
580,
13,
1678,
716,
29918,
29885,
353,
5566,
3888,
29889,
1767,
13,
1678,
4974,
338,
8758,
29898,
1482,
29918,
29885,
29892,
14974,
2392,
29897,
13,
1678,
4974,
7431,
29898,
1482,
29918,
29885,
29889,
11739,
29879,
29897,
1275,
29871,
29906,
13,
1678,
396,
471,
29901,
5519,
1917,
2392,
29892,
7670,
2392,
1402,
4408,
2392,
29962,
13,
1678,
396,
7865,
2392,
24273,
669,
7670,
2392,
3897,
24875,
2392,
29892,
577,
1286,
29901,
13,
1678,
4974,
338,
8758,
29898,
1482,
29918,
29885,
29889,
11739,
29879,
29961,
29900,
1402,
24875,
2392,
29897,
13,
1678,
4974,
338,
8758,
29898,
1482,
29918,
29885,
29889,
11739,
29879,
29961,
29896,
1402,
4408,
2392,
29897,
13,
1678,
396,
8561,
1854,
393,
5132,
1258,
451,
8472,
10641,
278,
2030,
14974,
2392,
304,
13,
1678,
396,
1749,
716,
14974,
2392,
29915,
29879,
4770,
4703,
1649,
13,
1678,
4974,
451,
716,
29918,
29885,
17255,
19303,
1253,
29918,
4703,
1649,
13,
1678,
4974,
716,
29918,
29885,
17255,
4703,
1649,
338,
6213,
13,
13,
1678,
396,
1423,
2225,
20525,
310,
4770,
29883,
1071,
1649,
322,
4770,
4703,
1649,
13,
1678,
325,
353,
7865,
2392,
580,
13,
1678,
325,
17255,
29883,
1071,
1649,
353,
7670,
2392,
580,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
1917,
2392,
29897,
408,
5566,
3888,
29901,
13,
4706,
411,
14974,
2392,
29889,
12510,
29898,
2892,
5566,
29901,
5566,
1125,
13,
9651,
12020,
325,
13,
1678,
4974,
338,
8758,
29898,
735,
29883,
3888,
29889,
1767,
17255,
29883,
1071,
1649,
29892,
7670,
2392,
29897,
13,
13,
1678,
325,
353,
7865,
2392,
580,
13,
1678,
3030,
353,
7670,
2392,
580,
13,
1678,
325,
17255,
4703,
1649,
353,
3030,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
1917,
2392,
29897,
408,
5566,
3888,
29901,
13,
4706,
411,
14974,
2392,
29889,
12510,
29898,
2892,
5566,
29901,
5566,
1125,
13,
9651,
12020,
325,
13,
1678,
4974,
5566,
3888,
29889,
1767,
17255,
4703,
1649,
338,
3030,
13,
1678,
4974,
451,
5566,
3888,
29889,
1767,
17255,
19303,
1253,
29918,
4703,
1649,
13,
13,
1678,
363,
21301,
29918,
4703,
297,
518,
5574,
29892,
7700,
5387,
13,
4706,
325,
353,
7865,
2392,
580,
13,
4706,
3030,
353,
7670,
2392,
580,
13,
4706,
325,
17255,
4703,
1649,
353,
3030,
13,
4706,
325,
17255,
19303,
1253,
29918,
4703,
1649,
353,
21301,
29918,
4703,
13,
4706,
1320,
28891,
353,
24875,
2392,
580,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
1917,
2392,
29897,
408,
5566,
3888,
29901,
13,
13,
9651,
822,
4380,
29918,
7944,
2392,
29898,
735,
29883,
1125,
13,
18884,
565,
338,
8758,
29898,
735,
29883,
29892,
24875,
2392,
1125,
13,
462,
1678,
736,
6213,
13,
18884,
1683,
29901,
13,
462,
1678,
736,
5566,
13,
13,
9651,
411,
14974,
2392,
29889,
12510,
29898,
12510,
29918,
7944,
2392,
1125,
13,
18884,
12020,
14974,
2392,
4197,
29894,
29892,
1320,
28891,
2314,
13,
4706,
4974,
5566,
3888,
29889,
1767,
17255,
4703,
1649,
338,
3030,
13,
4706,
4974,
5566,
3888,
29889,
1767,
17255,
19303,
1253,
29918,
4703,
1649,
1275,
21301,
29918,
4703,
13,
13,
13,
1753,
4974,
29918,
4352,
29918,
262,
29918,
11762,
29898,
11037,
29918,
1761,
29892,
1347,
1125,
13,
1678,
9210,
353,
29871,
29900,
13,
1678,
1596,
703,
23261,
363,
4766,
7087,
856,
1159,
13,
1678,
363,
4766,
297,
4766,
29918,
1761,
29901,
13,
4706,
1596,
703,
3198,
292,
4766,
29901,
613,
4766,
29897,
13,
4706,
337,
5415,
353,
337,
29889,
12198,
29898,
11037,
29897,
13,
4706,
1993,
353,
337,
5415,
29889,
4478,
29898,
1807,
29892,
9210,
29897,
13,
4706,
4974,
1993,
338,
451,
6213,
13,
4706,
9210,
353,
1993,
29889,
355,
580,
13,
13,
13,
1753,
1243,
29918,
9294,
29918,
4352,
29918,
262,
29918,
11762,
7295,
13,
1678,
4974,
29918,
4352,
29918,
262,
29918,
11762,
29898,
3366,
29874,
613,
376,
29890,
12436,
376,
4419,
263,
15473,
289,
15473,
1159,
13,
1678,
4974,
29918,
4352,
29918,
262,
29918,
11762,
29898,
3366,
29890,
613,
376,
29874,
12436,
376,
4419,
289,
15473,
263,
15473,
1159,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
14697,
291,
2392,
1125,
13,
4706,
4974,
29918,
4352,
29918,
262,
29918,
11762,
29898,
3366,
29874,
613,
376,
29890,
12436,
376,
4419,
289,
15473,
263,
15473,
1159,
13,
13,
13,
1753,
1243,
29918,
4830,
29918,
11739,
7295,
13,
1678,
5566,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29896,
29897,
13,
1678,
20917,
353,
376,
1642,
7122,
29898,
4830,
29918,
11739,
10456,
29872,
3888,
29898,
735,
29883,
4961,
13,
1678,
4974,
376,
336,
7608,
29896,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29896,
29918,
29941,
29908,
297,
20917,
13,
1678,
4974,
376,
336,
7608,
29906,
29918,
1807,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29906,
29918,
29906,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
11851,
4556,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
29928,
3864,
11415,
29908,
451,
297,
20917,
13,
13,
1678,
5566,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29896,
29897,
13,
1678,
5566,
17255,
29883,
1071,
1649,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29906,
29897,
13,
1678,
20917,
353,
376,
1642,
7122,
29898,
4830,
29918,
11739,
10456,
29872,
3888,
29898,
735,
29883,
4961,
13,
1678,
4974,
376,
336,
7608,
29896,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29896,
29918,
29941,
29908,
297,
20917,
13,
1678,
4974,
376,
336,
7608,
29906,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29906,
29918,
29906,
29908,
297,
20917,
13,
1678,
4974,
376,
11851,
4556,
29908,
297,
20917,
13,
1678,
4974,
376,
29928,
3864,
11415,
29908,
451,
297,
20917,
13,
1678,
396,
9801,
4556,
5134,
13,
1678,
4974,
903,
29883,
1071,
29918,
4906,
297,
20917,
13,
13,
1678,
5566,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29896,
29897,
13,
1678,
5566,
17255,
4703,
1649,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29906,
29897,
13,
1678,
20917,
353,
376,
1642,
7122,
29898,
4830,
29918,
11739,
10456,
29872,
3888,
29898,
735,
29883,
4961,
13,
1678,
4974,
376,
336,
7608,
29896,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29896,
29918,
29941,
29908,
297,
20917,
13,
1678,
4974,
376,
336,
7608,
29906,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29906,
29918,
29906,
29908,
297,
20917,
13,
1678,
4974,
376,
11851,
4556,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
29928,
3864,
11415,
29908,
297,
20917,
13,
13,
1678,
5566,
17255,
19303,
1253,
29918,
4703,
1649,
353,
5852,
13,
1678,
20917,
353,
376,
1642,
7122,
29898,
4830,
29918,
11739,
10456,
29872,
3888,
29898,
735,
29883,
4961,
13,
1678,
4974,
376,
336,
7608,
29896,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29896,
29918,
29941,
29908,
297,
20917,
13,
1678,
4974,
376,
336,
7608,
29906,
29918,
1807,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29906,
29918,
29906,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
11851,
4556,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
29928,
3864,
11415,
29908,
451,
297,
20917,
13,
13,
1678,
396,
9704,
29922,
8824,
13,
1678,
5566,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29896,
29897,
13,
1678,
5566,
17255,
4703,
1649,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29906,
29897,
13,
1678,
20917,
353,
376,
1642,
7122,
29898,
4830,
29918,
11739,
10456,
29872,
3888,
29898,
735,
29883,
511,
9704,
29922,
8824,
876,
13,
1678,
4974,
376,
336,
7608,
29896,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29896,
29918,
29941,
29908,
297,
20917,
13,
1678,
4974,
376,
336,
7608,
29906,
29918,
1807,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29906,
29918,
29906,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
11851,
4556,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
29928,
3864,
11415,
29908,
451,
297,
20917,
13,
13,
1678,
396,
4046,
13,
1678,
5566,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29896,
29897,
13,
1678,
5566,
17255,
4703,
1649,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29906,
29897,
13,
1678,
396,
679,
29918,
735,
29883,
12778,
263,
3515,
393,
18139,
2750,
278,
4046,
29892,
577,
4046,
29922,
29906,
2794,
591,
13,
1678,
396,
679,
29871,
29896,
6483,
964,
278,
1153,
7608,
5096,
13,
1678,
20917,
353,
376,
1642,
7122,
29898,
4830,
29918,
11739,
10456,
29872,
3888,
29898,
735,
29883,
511,
4046,
29922,
29906,
876,
13,
1678,
1596,
29898,
689,
19667,
29897,
13,
1678,
4974,
376,
336,
7608,
29896,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29896,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29896,
29918,
29906,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
336,
7608,
29906,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29906,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29906,
29918,
29906,
29908,
451,
297,
20917,
13,
13,
1678,
5566,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29896,
29897,
13,
1678,
5566,
17255,
4703,
1649,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29906,
29897,
13,
1678,
20917,
353,
376,
1642,
7122,
29898,
4830,
29918,
11739,
10456,
29872,
3888,
29898,
735,
29883,
511,
4046,
29922,
29896,
876,
13,
1678,
1596,
29898,
689,
19667,
29897,
13,
1678,
4974,
376,
336,
7608,
29896,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29896,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
336,
7608,
29906,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29906,
29908,
451,
297,
20917,
13,
13,
1678,
396,
17766,
12104,
13,
1678,
5566,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29896,
29897,
13,
1678,
5566,
17255,
29883,
1071,
1649,
353,
5566,
13,
1678,
20917,
353,
376,
1642,
7122,
29898,
4830,
29918,
11739,
10456,
29872,
3888,
29898,
735,
29883,
4961,
13,
1678,
4974,
376,
336,
7608,
29896,
29918,
1807,
29908,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29896,
29918,
29941,
29908,
297,
20917,
13,
1678,
4974,
376,
336,
7608,
29906,
29918,
1807,
29908,
451,
297,
20917,
13,
1678,
4974,
376,
262,
1153,
7608,
29906,
29918,
29906,
29908,
451,
297,
20917,
13,
1678,
396,
9801,
7929,
3682,
338,
451,
5134,
408,
4556,
13,
1678,
4974,
903,
29883,
1071,
29918,
4906,
451,
297,
20917,
13,
13,
1678,
396,
14974,
2392,
13,
1678,
20917,
353,
376,
1642,
7122,
29898,
4830,
29918,
11739,
10456,
29872,
3888,
29898,
5675,
29918,
8336,
580,
4961,
13,
1678,
1596,
29898,
689,
19667,
29897,
13,
13,
1678,
4974,
29918,
4352,
29918,
262,
29918,
11762,
29898,
13,
4706,
518,
13,
9651,
396,
4451,
261,
3682,
338,
14974,
2392,
13,
9651,
364,
29908,
15329,
2392,
29901,
613,
13,
9651,
396,
3824,
15685,
3682,
338,
278,
15685,
14974,
2392,
13,
9651,
364,
26732,
29876,
10602,
310,
15685,
3682,
29871,
29896,
613,
13,
9651,
396,
8449,
756,
263,
2323,
5096,
3515,
515,
1207,
29918,
8336,
29263,
372,
13,
9651,
364,
29908,
262,
1207,
29918,
8336,
613,
13,
9651,
396,
1987,
372,
756,
1023,
15685,
15283,
13,
9651,
364,
29908,
29871,
25577,
310,
15685,
3682,
29871,
29896,
613,
13,
9651,
364,
29908,
262,
1153,
7608,
29896,
29918,
29906,
613,
13,
9651,
396,
363,
777,
2769,
7865,
2392,
756,
694,
11839,
13,
9651,
364,
29908,
1917,
2392,
29901,
1153,
7608,
29896,
29918,
1807,
613,
13,
9651,
364,
29908,
29871,
25577,
310,
15685,
3682,
29871,
29906,
613,
13,
9651,
364,
29908,
262,
1153,
7608,
29906,
29918,
29906,
613,
13,
9651,
396,
1205,
7670,
2392,
947,
505,
11839,
13,
9651,
364,
29908,
2558,
2392,
29901,
525,
336,
7608,
29906,
29918,
1807,
29915,
613,
13,
9651,
396,
1126,
7146,
278,
4408,
2392,
29892,
607,
338,
263,
27767,
1847,
310,
278,
15685,
13,
9651,
396,
14974,
2392,
13,
9651,
364,
26732,
29876,
10602,
310,
15685,
3682,
29871,
29906,
29901,
613,
13,
9651,
364,
29908,
262,
1153,
7608,
29941,
613,
13,
9651,
364,
29908,
1170,
2392,
613,
13,
4706,
21251,
13,
4706,
20917,
13,
1678,
1723,
13,
13,
1678,
396,
1588,
9466,
7929,
15283,
297,
1014,
29899,
11739,
29879,
13,
1678,
5566,
29896,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29896,
29897,
13,
13,
1678,
822,
12020,
29896,
29918,
336,
7608,
29896,
7295,
13,
4706,
1018,
29901,
13,
9651,
12020,
5566,
29896,
13,
4706,
5174,
29901,
13,
9651,
12020,
7865,
2392,
703,
5431,
1159,
13,
13,
1678,
822,
12020,
29906,
29918,
336,
7608,
29896,
7295,
13,
4706,
1018,
29901,
13,
9651,
12020,
5566,
29896,
13,
4706,
5174,
29901,
13,
9651,
12020,
7670,
2392,
703,
1646,
1159,
13,
13,
1678,
5566,
29906,
353,
679,
29918,
735,
29883,
29898,
22692,
29896,
29918,
336,
7608,
29896,
29897,
13,
1678,
5566,
29941,
353,
679,
29918,
735,
29883,
29898,
22692,
29906,
29918,
336,
7608,
29896,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
12020,
14974,
2392,
4197,
735,
29883,
29906,
29892,
5566,
29941,
2314,
13,
1678,
5174,
14974,
2392,
408,
321,
29901,
13,
4706,
5566,
353,
321,
13,
13,
1678,
20917,
353,
376,
1642,
7122,
29898,
4830,
29918,
11739,
10456,
29872,
3888,
29898,
735,
29883,
4961,
13,
1678,
1596,
29898,
689,
19667,
29897,
13,
13,
1678,
4974,
29918,
4352,
29918,
262,
29918,
11762,
29898,
13,
4706,
518,
13,
9651,
364,
29908,
11591,
1627,
613,
13,
9651,
396,
4451,
261,
3682,
338,
14974,
2392,
13,
9651,
364,
29908,
15329,
2392,
29901,
613,
13,
9651,
396,
3824,
15685,
3682,
338,
278,
15685,
7865,
2392,
411,
4556,
310,
1153,
7608,
29896,
13,
9651,
364,
26732,
29876,
10602,
310,
15685,
3682,
29871,
29896,
613,
13,
9651,
396,
13905,
4902,
310,
5566,
29896,
13,
9651,
364,
29908,
29871,
29243,
613,
13,
9651,
364,
29908,
262,
679,
29918,
735,
29883,
613,
13,
9651,
364,
29908,
262,
1153,
7608,
29896,
613,
13,
9651,
364,
29908,
1917,
2392,
29901,
1153,
7608,
29896,
29918,
1807,
613,
13,
9651,
396,
13905,
4902,
310,
5566,
29906,
13,
9651,
364,
26732,
29876,
29871,
7133,
11415,
310,
278,
2038,
3682,
29892,
1790,
3682,
10761,
29901,
613,
13,
9651,
364,
29908,
29871,
29243,
613,
13,
9651,
364,
29908,
262,
679,
29918,
735,
29883,
613,
13,
9651,
364,
29908,
262,
12020,
29896,
29918,
336,
7608,
29896,
613,
13,
9651,
364,
29908,
29871,
7865,
2392,
29901,
7953,
613,
13,
9651,
396,
6440,
15685,
3682,
338,
278,
15685,
7670,
2392,
411,
4556,
310,
1153,
7608,
29896,
13,
9651,
364,
26732,
29876,
10602,
310,
15685,
3682,
29871,
29906,
613,
13,
9651,
396,
13905,
4902,
310,
5566,
29896,
1449,
13,
9651,
364,
29908,
29871,
29243,
613,
13,
9651,
364,
29908,
262,
679,
29918,
735,
29883,
613,
13,
9651,
364,
29908,
262,
1153,
7608,
29896,
613,
13,
9651,
364,
29908,
1917,
2392,
29901,
1153,
7608,
29896,
29918,
1807,
613,
13,
9651,
396,
13905,
4902,
310,
5566,
29941,
13,
9651,
364,
26732,
29876,
29871,
7133,
11415,
310,
278,
2038,
3682,
29892,
1790,
3682,
10761,
29901,
613,
13,
9651,
364,
29908,
29871,
29243,
613,
13,
9651,
364,
29908,
262,
679,
29918,
735,
29883,
613,
13,
9651,
364,
29908,
262,
12020,
29906,
29918,
336,
7608,
29896,
613,
13,
9651,
364,
29908,
29871,
7670,
2392,
29901,
525,
1646,
29915,
613,
13,
4706,
21251,
13,
4706,
20917,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
21027,
29898,
5030,
1188,
1125,
13,
1678,
5566,
29896,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29896,
29897,
13,
1678,
5566,
29906,
353,
679,
29918,
735,
29883,
29898,
336,
7608,
29906,
29897,
13,
13,
1678,
286,
353,
14974,
2392,
4197,
735,
29883,
29896,
29892,
5566,
29906,
2314,
13,
13,
1678,
2643,
353,
376,
1688,
1243,
1243,
29908,
13,
1678,
1018,
29901,
13,
4706,
12020,
286,
13,
1678,
5174,
14974,
2392,
408,
5566,
29901,
13,
4706,
12183,
29889,
657,
16363,
2141,
11739,
29898,
4906,
29897,
13,
4706,
396,
3650,
262,
3454,
4208,
13,
4706,
20917,
353,
376,
1642,
7122,
29898,
13,
9651,
3402,
29918,
11739,
29898,
1853,
29898,
735,
29883,
511,
5566,
29892,
5566,
17255,
15003,
1627,
1649,
29897,
13,
4706,
1723,
13,
4706,
4974,
2643,
297,
2117,
1188,
29889,
726,
13,
4706,
4974,
20917,
297,
2117,
1188,
29889,
726,
13,
13,
13,
1753,
1065,
29918,
2154,
29898,
978,
29892,
671,
29918,
666,
1656,
29922,
8824,
1125,
13,
1678,
1053,
3367,
29877,
13,
1678,
3367,
29877,
29918,
2084,
353,
10802,
29898,
3626,
29877,
17255,
1445,
1649,
467,
3560,
29889,
3560,
13,
1678,
2471,
29918,
2084,
353,
10802,
22168,
1445,
1649,
467,
3560,
847,
376,
1688,
29918,
4713,
631,
729,
29918,
16713,
29908,
847,
1024,
13,
13,
1678,
8829,
353,
9657,
29898,
359,
29889,
21813,
29897,
13,
1678,
1596,
703,
3560,
349,
29979,
4690,
1164,
10145,
29901,
613,
8829,
29889,
657,
703,
20055,
4690,
1164,
10145,
5783,
13,
1678,
565,
376,
20055,
4690,
1164,
10145,
29908,
297,
8829,
29901,
29871,
396,
282,
23929,
29901,
694,
4612,
13,
4706,
6499,
353,
8829,
3366,
20055,
4690,
1164,
10145,
16862,
5451,
29898,
359,
29889,
2084,
19570,
29897,
13,
1678,
1683,
29901,
13,
4706,
6499,
353,
5159,
13,
1678,
6499,
29889,
7851,
29898,
29900,
29892,
851,
29898,
3626,
29877,
29918,
2084,
876,
13,
1678,
6499,
29889,
7851,
29898,
29900,
29892,
851,
29898,
2154,
29918,
2084,
29889,
3560,
876,
13,
1678,
8829,
3366,
20055,
4690,
1164,
10145,
3108,
353,
2897,
29889,
2084,
19570,
29889,
7122,
29898,
407,
29897,
13,
1678,
1596,
703,
1491,
5014,
349,
29979,
4690,
1164,
10145,
29901,
613,
8829,
29889,
657,
703,
20055,
4690,
1164,
10145,
5783,
13,
13,
1678,
565,
671,
29918,
666,
1656,
29901,
13,
4706,
3454,
353,
518,
2154,
29918,
2084,
29889,
3150,
2141,
949,
3285,
376,
13322,
580,
3108,
13,
13,
4706,
9920,
353,
518,
13,
9651,
10876,
29889,
4258,
9246,
29892,
13,
9651,
11663,
29884,
613,
13,
9651,
11663,
29885,
613,
13,
9651,
376,
5690,
1656,
613,
13,
9651,
396,
694,
20234,
2066,
13,
9651,
376,
489,
24561,
613,
13,
9651,
376,
489,
14343,
979,
5690,
1656,
2052,
29889,
401,
29918,
517,
29918,
3389,
543,
718,
11297,
29876,
4286,
7122,
29898,
9012,
511,
13,
4706,
4514,
13,
1678,
1683,
29901,
13,
4706,
9920,
353,
518,
9675,
29889,
4258,
9246,
29892,
11663,
29884,
613,
851,
29898,
2154,
29918,
2084,
4638,
13,
1678,
1596,
703,
21094,
29901,
613,
9920,
29897,
13,
1678,
8676,
353,
1014,
5014,
29889,
3389,
29898,
13,
4706,
9920,
29892,
8829,
29922,
6272,
29892,
27591,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
380,
20405,
29922,
1491,
5014,
29889,
1254,
3970,
2692,
13,
1678,
1723,
13,
1678,
1596,
703,
5014,
1962,
29901,
1159,
13,
1678,
1596,
29898,
5729,
9446,
29889,
25393,
29889,
13808,
703,
9420,
29899,
29947,
5783,
13,
1678,
736,
8676,
13,
13,
13,
1753,
1423,
29918,
12857,
29918,
735,
13300,
386,
2550,
29898,
5729,
9446,
1125,
13,
1678,
4974,
29918,
4352,
29918,
262,
29918,
11762,
29898,
13,
4706,
518,
13,
9651,
376,
262,
529,
5453,
28341,
13,
9651,
376,
15329,
2392,
613,
13,
9651,
376,
10602,
310,
15685,
3682,
29871,
29896,
613,
13,
9651,
376,
262,
5566,
29896,
29918,
9144,
613,
13,
9651,
376,
1917,
2392,
613,
13,
9651,
376,
10602,
310,
15685,
3682,
29871,
29906,
613,
13,
9651,
376,
262,
5566,
29906,
29918,
9144,
613,
13,
9651,
376,
2558,
2392,
613,
13,
4706,
21251,
8676,
29889,
25393,
29889,
13808,
703,
9420,
29899,
29947,
1159,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
12857,
29918,
735,
13300,
386,
2550,
7295,
13,
1678,
8676,
353,
1065,
29918,
2154,
703,
12857,
29918,
735,
13300,
386,
2550,
29889,
2272,
1159,
13,
1678,
1423,
29918,
12857,
29918,
735,
13300,
386,
2550,
29898,
5729,
9446,
29897,
13,
13,
13,
1753,
1243,
29918,
6341,
29918,
735,
13300,
386,
2550,
7295,
13,
1678,
396,
5399,
393,
1404,
29899,
12119,
429,
13300,
386,
2550,
29879,
9455,
29915,
29873,
20831,
1145,
13,
1678,
8676,
353,
1065,
29918,
2154,
703,
6341,
29918,
735,
13300,
386,
2550,
29889,
2272,
1159,
13,
1678,
4974,
29918,
4352,
29918,
262,
29918,
11762,
29898,
13,
4706,
518,
13,
9651,
396,
450,
9177,
13,
9651,
376,
7944,
22709,
613,
13,
9651,
376,
284,
2040,
505,
263,
2888,
613,
13,
9651,
396,
450,
2643,
13350,
491,
278,
2888,
12422,
29892,
1326,
292,
591,
3282,
29915,
29873,
13,
9651,
396,
5712,
372,
13,
9651,
376,
6341,
2734,
29991,
613,
13,
9651,
396,
450,
14974,
2392,
13,
9651,
376,
15329,
2392,
29901,
613,
13,
4706,
21251,
13,
4706,
8676,
29889,
25393,
29889,
13808,
703,
9420,
29899,
29947,
1159,
13,
1678,
1723,
13,
13,
13,
29937,
910,
9177,
338,
19799,
491,
474,
4691,
29871,
29955,
29889,
29945,
29889,
29900,
373,
3017,
29871,
29941,
29889,
29947,
13,
5215,
18116,
13,
25442,
886,
29889,
4572,
25442,
886,
29898,
13,
1678,
376,
17281,
613,
13,
1678,
2643,
543,
5575,
5931,
29992,
2616,
449,
457,
5931,
10200,
1061,
338,
18164,
613,
13,
1678,
7663,
29922,
8498,
3757,
362,
22709,
29892,
13,
1678,
3883,
543,
5690,
1656,
5575,
29908,
13,
29897,
13,
2202,
29901,
13,
1678,
1053,
5641,
1656,
13,
19499,
16032,
2392,
29901,
29871,
396,
282,
23929,
29901,
694,
4612,
13,
1678,
505,
29918,
666,
1656,
353,
7700,
13,
2870,
29901,
13,
1678,
505,
29918,
666,
1656,
353,
5852,
13,
13,
26180,
29918,
666,
1656,
353,
11451,
1688,
29889,
3502,
29889,
11014,
361,
29898,
1333,
505,
29918,
666,
1656,
29892,
2769,
543,
26180,
5641,
1656,
1159,
13,
13,
13,
29992,
28544,
13,
29992,
26180,
29918,
666,
1656,
13,
1753,
1243,
29918,
666,
1656,
29918,
735,
29883,
29918,
13789,
7295,
13,
1678,
8676,
353,
1065,
29918,
2154,
703,
12857,
29918,
735,
13300,
386,
2550,
29889,
2272,
613,
671,
29918,
666,
1656,
29922,
5574,
29897,
13,
1678,
1423,
29918,
12857,
29918,
735,
13300,
386,
2550,
29898,
5729,
9446,
29897,
13,
13,
13,
29992,
28544,
13,
29992,
26180,
29918,
666,
1656,
13,
1753,
1243,
29918,
666,
1656,
29918,
5215,
287,
29918,
4187,
29918,
348,
3880,
7295,
13,
1678,
8676,
353,
1065,
29918,
2154,
703,
12857,
29918,
735,
13300,
386,
2550,
29918,
5690,
1656,
29889,
2272,
1159,
13,
1678,
1423,
29918,
12857,
29918,
735,
13300,
386,
2550,
29898,
5729,
9446,
29897,
13,
13,
13,
29992,
28544,
13,
29992,
26180,
29918,
666,
1656,
13,
1753,
1243,
29918,
666,
1656,
29918,
6341,
29918,
735,
29883,
29918,
13789,
7295,
13,
1678,
396,
5399,
591,
679,
263,
7575,
9177,
313,
4187,
871,
697,
14366,
565,
278,
1404,
338,
773,
5641,
1656,
13,
1678,
396,
322,
2307,
756,
777,
916,
731,
29918,
6341,
29918,
735,
29883,
7834,
5130,
29889,
13,
1678,
8676,
353,
1065,
29918,
2154,
703,
666,
1656,
29918,
6341,
29918,
735,
29883,
29889,
2272,
613,
671,
29918,
666,
1656,
29922,
5574,
29897,
13,
1678,
4974,
29918,
4352,
29918,
262,
29918,
11762,
29898,
13,
4706,
518,
13,
9651,
396,
450,
9177,
13,
9651,
376,
7944,
22709,
613,
13,
9651,
376,
5690,
1656,
17809,
613,
13,
9651,
376,
11014,
15476,
323,
5378,
613,
13,
9651,
396,
450,
14974,
2392,
13,
9651,
376,
15329,
2392,
613,
13,
9651,
376,
1917,
2392,
613,
13,
9651,
376,
2558,
2392,
613,
13,
4706,
21251,
13,
4706,
8676,
29889,
25393,
29889,
13808,
703,
9420,
29899,
29947,
1159,
13,
1678,
1723,
13,
1678,
396,
8561,
1854,
1749,
916,
9177,
1838,
29915,
29873,
1510,
701,
13,
1678,
4974,
376,
6341,
10876,
29889,
735,
13300,
386,
2550,
29908,
451,
297,
8676,
29889,
25393,
29889,
13808,
703,
9420,
29899,
29947,
1159,
13,
2
] |
jw/custom_ml.py | JoonSeongLee/dss7-coupon | 0 | 179331 | <filename>jw/custom_ml.py
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
import scipy as sp
import pandas as pd
import statsmodels.api as sm
import statsmodels.formula.api as smf
import statsmodels.stats.api as sms
import sklearn as sk
import matplotlib as mpl
import matplotlib.pylab as plt
import matplotlib.font_manager as fm
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sns
sns.set()
sns.set_style("whitegrid")
sns.set_color_codes()
# Model
from sklearn.linear_model import LogisticRegression
from sklearn.linear_model import Perceptron
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn import svm
from sklearn.naive_bayes import GaussianNB
from sklearn.naive_bayes import BernoulliNB
from sklearn.naive_bayes import MultinomialNB
# preprocss with etc
from sklearn.model_selection import train_test_split
from sklearn.metrics import *
from sklearn.preprocessing import label_binarize
from sklearn.multiclass import OneVsRestClassifier
from scipy import interp
def df_to_nparray():
return 0
def cls_conf(X, y, model, test_ratio=0.5):
'''
a, b = cls_conf(X,y,GaussianNB(),0.5)
a, b = cls_conf(X,y,QuadraticDiscriminantAnalysis(store_covariance=True),0.5)
a, b = cls_conf(X,y,LinearDiscriminantAnalysis(n_components=3,
solver="svd", store_covariance=True),0.5)
a, b = cls_conf(X,y,LogisticRegression(), 0.5)
a, b = cls_conf(X,y,SVC(gamma=0.0026, C=10), 0.5)
'''
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=test_ratio,
random_state=0)
model = model.fit(X_train, y_train)
y_pred = model.predict(X_test)
return confusion_matrix(y_test, y_pred), classification_report(y_test, y_pred)
def bin_roc(X,y,model,test_ratio=0.5):
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=test_ratio,
random_state=0)
classifier = model.fit(X_train, y_train)
fpr, tpr, threshold = roc_curve(y_test, classifier.decision_function(X_test))
plt.figure(figsize=(10, 10))
lw = 2
plt.plot(fpr, tpr, label = 'auc area = {}'.format(auc(fpr,tpr)))
plt.plot([0, 1], [0, 1], color='navy', lw=lw, linestyle='--')
plt.xlim([-0.1, 1.0])
plt.ylim([0.0, 1.05])
plt.xlabel('False Positive Rate',fontsize=20)
plt.ylabel('True Positive Rate',fontsize=20)
plt.title('ROC',fontsize=20)
plt.legend(loc='lower right',fontsize=20)
plt.show()
def multi_roc(X, y, model, test_ratio=0.5):
y = label_binarize(y, classes=np.unique(y))
n_classes = y.shape[1]
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=test_ratio,
random_state=0)
ovr = OneVsRestClassifier(model)
y_score = ovr.fit(X_train, y_train).predict_proba(X_test)
fpr = dict()
tpr = dict()
roc_auc = dict()
for i in range(n_classes):
fpr[i], tpr[i], _ = roc_curve(y_test[:, i], y_score[:, i])
roc_auc[i] = auc(fpr[i], tpr[i])
fpr["micro"], tpr["micro"], _ = roc_curve(y_test.ravel(), y_score.ravel())
roc_auc["micro"] = auc(fpr["micro"], tpr["micro"])
plt.figure(figsize=(10, 10))
lw = 2
for i in range(n_classes):
plt.plot(fpr[i], tpr[i], lw=lw,
label='class {} (auc area = {})'.format(i, roc_auc[i]))
plt.plot([0, 1], [0, 1], color='navy', lw=lw, linestyle='--')
plt.xlim([-0.1, 1.0])
plt.ylim([0.0, 1.05])
plt.xlabel('False Positive Rate',fontsize=20)
plt.ylabel('True Positive Rate',fontsize=20)
plt.title('ROC',fontsize=20)
plt.legend(loc='lower right',fontsize=20)
plt.show()
| [
1,
529,
9507,
29958,
29926,
29893,
29914,
6341,
29918,
828,
29889,
2272,
13,
5215,
18116,
13,
25442,
886,
29889,
12857,
4572,
29898,
2467,
2433,
17281,
742,
7663,
29922,
20154,
22709,
29897,
13,
5215,
12655,
408,
7442,
13,
5215,
4560,
2272,
408,
805,
13,
5215,
11701,
408,
10518,
13,
5215,
22663,
9794,
29889,
2754,
408,
1560,
13,
5215,
22663,
9794,
29889,
689,
2497,
29889,
2754,
408,
1560,
29888,
13,
5215,
22663,
9794,
29889,
16202,
29889,
2754,
408,
269,
1516,
13,
5215,
2071,
19668,
408,
2071,
13,
5215,
22889,
408,
286,
572,
13,
5215,
22889,
29889,
2272,
8205,
408,
14770,
13,
5215,
22889,
29889,
5657,
29918,
12847,
408,
285,
29885,
13,
3166,
286,
572,
29918,
10154,
29895,
1169,
29889,
29885,
5317,
29941,
29881,
1053,
319,
9100,
29941,
29928,
13,
5215,
409,
370,
1398,
408,
269,
1983,
13,
29879,
1983,
29889,
842,
580,
13,
29879,
1983,
29889,
842,
29918,
3293,
703,
1332,
277,
387,
2429,
1159,
13,
29879,
1983,
29889,
842,
29918,
2780,
29918,
18137,
580,
13,
13,
29937,
8125,
13,
3166,
2071,
19668,
29889,
10660,
29918,
4299,
1053,
4522,
4695,
4597,
23881,
13,
3166,
2071,
19668,
29889,
10660,
29918,
4299,
1053,
2431,
1547,
1617,
13,
3166,
2071,
19668,
29889,
2218,
29883,
20386,
424,
29918,
15916,
1053,
751,
7887,
2454,
4205,
29883,
20386,
424,
21067,
4848,
13,
3166,
2071,
19668,
29889,
2218,
29883,
20386,
424,
29918,
15916,
1053,
22985,
4205,
29883,
20386,
424,
21067,
4848,
13,
3166,
2071,
19668,
1053,
3731,
29885,
13,
3166,
2071,
19668,
29889,
1056,
573,
29918,
27495,
267,
1053,
22477,
23189,
13,
3166,
2071,
19668,
29889,
1056,
573,
29918,
27495,
267,
1053,
6209,
5059,
492,
23189,
13,
3166,
2071,
19668,
29889,
1056,
573,
29918,
27495,
267,
1053,
9683,
262,
7615,
23189,
13,
13,
29937,
758,
771,
4268,
411,
2992,
13,
3166,
2071,
19668,
29889,
4299,
29918,
21731,
1053,
7945,
29918,
1688,
29918,
5451,
13,
3166,
2071,
19668,
29889,
2527,
10817,
1053,
334,
13,
3166,
2071,
19668,
29889,
1457,
19170,
1053,
3858,
29918,
2109,
279,
675,
13,
3166,
2071,
19668,
29889,
4713,
293,
605,
1053,
3118,
29963,
29879,
15078,
2385,
3709,
13,
3166,
4560,
2272,
1053,
1006,
29886,
13,
13,
13,
1753,
4489,
29918,
517,
29918,
29876,
862,
764,
7295,
13,
1678,
736,
29871,
29900,
13,
13,
1753,
1067,
29879,
29918,
5527,
29898,
29990,
29892,
343,
29892,
1904,
29892,
1243,
29918,
3605,
601,
29922,
29900,
29889,
29945,
1125,
13,
1678,
14550,
13,
1678,
263,
29892,
289,
353,
1067,
29879,
29918,
5527,
29898,
29990,
29892,
29891,
29892,
29954,
17019,
23189,
3285,
29900,
29889,
29945,
29897,
13,
1678,
263,
29892,
289,
353,
1067,
29879,
29918,
5527,
29898,
29990,
29892,
29891,
29892,
2182,
7887,
2454,
4205,
29883,
20386,
424,
21067,
4848,
29898,
8899,
29918,
24542,
279,
8837,
29922,
5574,
511,
29900,
29889,
29945,
29897,
13,
1678,
263,
29892,
289,
353,
1067,
29879,
29918,
5527,
29898,
29990,
29892,
29891,
29892,
12697,
4205,
29883,
20386,
424,
21067,
4848,
29898,
29876,
29918,
14036,
29922,
29941,
29892,
29871,
13,
462,
462,
899,
369,
543,
4501,
29881,
613,
3787,
29918,
24542,
279,
8837,
29922,
5574,
511,
29900,
29889,
29945,
29897,
13,
1678,
263,
29892,
289,
353,
1067,
29879,
29918,
5527,
29898,
29990,
29892,
29891,
29892,
3403,
4695,
4597,
23881,
3285,
29871,
29900,
29889,
29945,
29897,
13,
1678,
263,
29892,
289,
353,
1067,
29879,
29918,
5527,
29898,
29990,
29892,
29891,
29892,
7597,
29907,
29898,
4283,
29922,
29900,
29889,
29900,
29900,
29906,
29953,
29892,
315,
29922,
29896,
29900,
511,
29871,
29900,
29889,
29945,
29897,
13,
1678,
14550,
13,
13,
1678,
1060,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
14968,
29892,
343,
29918,
1688,
353,
7945,
29918,
1688,
29918,
5451,
29898,
29990,
29892,
343,
29892,
1243,
29918,
2311,
29922,
1688,
29918,
3605,
601,
29892,
13,
462,
462,
462,
4706,
4036,
29918,
3859,
29922,
29900,
29897,
13,
1678,
1904,
353,
1904,
29889,
9202,
29898,
29990,
29918,
14968,
29892,
343,
29918,
14968,
29897,
13,
13,
1678,
343,
29918,
11965,
353,
1904,
29889,
27711,
29898,
29990,
29918,
1688,
29897,
13,
13,
1678,
736,
14679,
29918,
5344,
29898,
29891,
29918,
1688,
29892,
343,
29918,
11965,
511,
12965,
29918,
12276,
29898,
29891,
29918,
1688,
29892,
343,
29918,
11965,
29897,
13,
13,
13,
1753,
9016,
29918,
10198,
29898,
29990,
29892,
29891,
29892,
4299,
29892,
1688,
29918,
3605,
601,
29922,
29900,
29889,
29945,
1125,
13,
268,
13,
1678,
1060,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
14968,
29892,
343,
29918,
1688,
353,
7945,
29918,
1688,
29918,
5451,
29898,
29990,
29892,
343,
29892,
1243,
29918,
2311,
29922,
1688,
29918,
3605,
601,
29892,
13,
462,
462,
462,
4706,
4036,
29918,
3859,
29922,
29900,
29897,
13,
1678,
770,
3709,
353,
1904,
29889,
9202,
29898,
29990,
29918,
14968,
29892,
343,
29918,
14968,
29897,
13,
268,
13,
1678,
285,
558,
29892,
260,
558,
29892,
16897,
353,
696,
29883,
29918,
2764,
345,
29898,
29891,
29918,
1688,
29892,
770,
3709,
29889,
7099,
2459,
29918,
2220,
29898,
29990,
29918,
1688,
876,
13,
268,
13,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29896,
29900,
29892,
29871,
29896,
29900,
876,
13,
1678,
301,
29893,
353,
29871,
29906,
13,
1678,
14770,
29889,
5317,
29898,
29888,
558,
29892,
260,
558,
29892,
3858,
353,
525,
14766,
4038,
353,
6571,
4286,
4830,
29898,
14766,
29898,
29888,
558,
29892,
29873,
558,
4961,
13,
1678,
14770,
29889,
5317,
4197,
29900,
29892,
29871,
29896,
1402,
518,
29900,
29892,
29871,
29896,
1402,
2927,
2433,
29876,
5301,
742,
301,
29893,
29922,
29880,
29893,
29892,
6276,
342,
1508,
2433,
489,
1495,
13,
1678,
14770,
29889,
29916,
2576,
4197,
29899,
29900,
29889,
29896,
29892,
29871,
29896,
29889,
29900,
2314,
13,
1678,
14770,
29889,
29891,
2576,
4197,
29900,
29889,
29900,
29892,
29871,
29896,
29889,
29900,
29945,
2314,
13,
1678,
14770,
29889,
29916,
1643,
877,
8824,
10321,
3321,
390,
403,
742,
5657,
2311,
29922,
29906,
29900,
29897,
13,
1678,
14770,
29889,
29891,
1643,
877,
5574,
10321,
3321,
390,
403,
742,
5657,
2311,
29922,
29906,
29900,
29897,
13,
1678,
14770,
29889,
3257,
877,
1672,
29907,
742,
5657,
2311,
29922,
29906,
29900,
29897,
13,
1678,
14770,
29889,
26172,
29898,
2029,
2433,
13609,
1492,
742,
5657,
2311,
29922,
29906,
29900,
29897,
13,
1678,
14770,
29889,
4294,
580,
13,
13,
1753,
2473,
29918,
10198,
29898,
29990,
29892,
343,
29892,
1904,
29892,
1243,
29918,
3605,
601,
29922,
29900,
29889,
29945,
1125,
13,
13,
1678,
343,
353,
3858,
29918,
2109,
279,
675,
29898,
29891,
29892,
4413,
29922,
9302,
29889,
13092,
29898,
29891,
876,
13,
1678,
302,
29918,
13203,
353,
343,
29889,
12181,
29961,
29896,
29962,
13,
13,
1678,
1060,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
14968,
29892,
343,
29918,
1688,
353,
7945,
29918,
1688,
29918,
5451,
29898,
29990,
29892,
343,
29892,
1243,
29918,
2311,
29922,
1688,
29918,
3605,
601,
29892,
13,
462,
462,
462,
4706,
4036,
29918,
3859,
29922,
29900,
29897,
13,
13,
1678,
288,
13416,
353,
3118,
29963,
29879,
15078,
2385,
3709,
29898,
4299,
29897,
13,
1678,
343,
29918,
13628,
353,
288,
13416,
29889,
9202,
29898,
29990,
29918,
14968,
29892,
343,
29918,
14968,
467,
27711,
29918,
771,
2291,
29898,
29990,
29918,
1688,
29897,
13,
13,
1678,
285,
558,
353,
9657,
580,
13,
1678,
260,
558,
353,
9657,
580,
13,
1678,
696,
29883,
29918,
14766,
353,
9657,
580,
13,
1678,
363,
474,
297,
3464,
29898,
29876,
29918,
13203,
1125,
13,
4706,
285,
558,
29961,
29875,
1402,
260,
558,
29961,
29875,
1402,
903,
353,
696,
29883,
29918,
2764,
345,
29898,
29891,
29918,
1688,
7503,
29892,
474,
1402,
343,
29918,
13628,
7503,
29892,
474,
2314,
13,
4706,
696,
29883,
29918,
14766,
29961,
29875,
29962,
353,
20480,
29898,
29888,
558,
29961,
29875,
1402,
260,
558,
29961,
29875,
2314,
13,
13,
1678,
285,
558,
3366,
29885,
2357,
12436,
260,
558,
3366,
29885,
2357,
12436,
903,
353,
696,
29883,
29918,
2764,
345,
29898,
29891,
29918,
1688,
29889,
336,
955,
3285,
343,
29918,
13628,
29889,
336,
955,
3101,
13,
1678,
696,
29883,
29918,
14766,
3366,
29885,
2357,
3108,
353,
20480,
29898,
29888,
558,
3366,
29885,
2357,
12436,
260,
558,
3366,
29885,
2357,
20068,
13,
13,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29896,
29900,
29892,
29871,
29896,
29900,
876,
13,
1678,
301,
29893,
353,
29871,
29906,
13,
1678,
363,
474,
297,
3464,
29898,
29876,
29918,
13203,
1125,
13,
4706,
14770,
29889,
5317,
29898,
29888,
558,
29961,
29875,
1402,
260,
558,
29961,
29875,
1402,
301,
29893,
29922,
29880,
29893,
29892,
13,
462,
3858,
2433,
1990,
6571,
313,
14766,
4038,
353,
426,
1800,
4286,
4830,
29898,
29875,
29892,
696,
29883,
29918,
14766,
29961,
29875,
12622,
13,
1678,
14770,
29889,
5317,
4197,
29900,
29892,
29871,
29896,
1402,
518,
29900,
29892,
29871,
29896,
1402,
2927,
2433,
29876,
5301,
742,
301,
29893,
29922,
29880,
29893,
29892,
6276,
342,
1508,
2433,
489,
1495,
13,
1678,
14770,
29889,
29916,
2576,
4197,
29899,
29900,
29889,
29896,
29892,
29871,
29896,
29889,
29900,
2314,
13,
1678,
14770,
29889,
29891,
2576,
4197,
29900,
29889,
29900,
29892,
29871,
29896,
29889,
29900,
29945,
2314,
13,
1678,
14770,
29889,
29916,
1643,
877,
8824,
10321,
3321,
390,
403,
742,
5657,
2311,
29922,
29906,
29900,
29897,
13,
1678,
14770,
29889,
29891,
1643,
877,
5574,
10321,
3321,
390,
403,
742,
5657,
2311,
29922,
29906,
29900,
29897,
13,
1678,
14770,
29889,
3257,
877,
1672,
29907,
742,
5657,
2311,
29922,
29906,
29900,
29897,
13,
1678,
14770,
29889,
26172,
29898,
2029,
2433,
13609,
1492,
742,
5657,
2311,
29922,
29906,
29900,
29897,
13,
1678,
14770,
29889,
4294,
580,
13,
268,
13,
2
] |
examples/PyGame/reaching_osc.py | Andrew-Luo1/ABR_Control_Prosthetic | 0 | 1609792 | """
Running the threelink arm with the pygame display. The arm will
move the end-effector to the target, which can be moved by
clicking on the background.
"""
import numpy as np
from abr_control.arms import threejoint as arm
# from abr_control.arms import twojoint as arm
from abr_control.interfaces import PyGame
from abr_control.controllers import OSC, Damping, RestingConfig
# initialize our robot config
robot_config = arm.Config(use_cython=True)
# create our arm simulation
arm_sim = arm.ArmSim(robot_config)
# damp the movements of the arm
damping = Damping(robot_config, kv=10)
# keep the arm near a default configuration
resting_config = RestingConfig(
robot_config, kp=50, kv=np.sqrt(50),
rest_angles=[np.pi/4, np.pi/4, None])
# create an operational space controller
ctrlr = OSC(robot_config, kp=20, use_C=True, null_controllers=[damping])
def on_click(self, mouse_x, mouse_y):
self.target[0] = self.mouse_x
self.target[1] = self.mouse_y
# create our interface
interface = PyGame(robot_config, arm_sim, dt=.001, on_click=on_click)
interface.connect()
# create a target
feedback = interface.get_feedback()
target_xyz = robot_config.Tx('EE', feedback['q'])
interface.set_target(target_xyz)
# set up lists for tracking data
ee_path = []
target_path = []
try:
# run ctrl.generate once to load all functions
zeros = np.zeros(robot_config.N_JOINTS)
ctrlr.generate(q=zeros, dq=zeros, target_pos=np.zeros(3))
robot_config.R('EE', q=zeros)
print('\nSimulation starting...\n')
print('\nClick to move the target.\n')
count = 0
while 1:
# get arm feedback
feedback = interface.get_feedback()
hand_xyz = robot_config.Tx('EE', feedback['q'])
# generate an operational space control signal
u = ctrlr.generate(
q=feedback['q'],
dq=feedback['dq'],
target_pos=target_xyz,
target_vel=np.zeros(3))
new_target = interface.get_mousexy()
if new_target is not None:
target_xyz[0:2] = new_target
interface.set_target(target_xyz)
# apply the control signal, step the sim forward
interface.send_forces(
u, update_display=True if count % 50 == 0 else False)
# track data
ee_path.append(np.copy(hand_xyz))
target_path.append(np.copy(target_xyz))
count += 1
finally:
# stop and reset the simulation
interface.disconnect()
print('Simulation terminated...')
| [
1,
9995,
13,
27795,
278,
12455,
295,
682,
5075,
411,
278,
22028,
2479,
29889,
450,
5075,
674,
13,
11631,
278,
1095,
29899,
12352,
3019,
304,
278,
3646,
29892,
607,
508,
367,
6153,
491,
13,
3808,
292,
373,
278,
3239,
29889,
13,
15945,
29908,
13,
5215,
12655,
408,
7442,
13,
13,
3166,
633,
29878,
29918,
6451,
29889,
279,
1516,
1053,
2211,
12090,
408,
5075,
13,
29937,
515,
633,
29878,
29918,
6451,
29889,
279,
1516,
1053,
1023,
12090,
408,
5075,
13,
3166,
633,
29878,
29918,
6451,
29889,
1639,
8726,
1053,
10772,
14199,
13,
3166,
633,
29878,
29918,
6451,
29889,
1285,
11897,
1053,
6570,
29907,
29892,
360,
1160,
292,
29892,
11654,
292,
3991,
13,
13,
13,
29937,
11905,
1749,
19964,
2295,
13,
307,
7451,
29918,
2917,
353,
5075,
29889,
3991,
29898,
1509,
29918,
1270,
386,
265,
29922,
5574,
29897,
13,
29937,
1653,
1749,
5075,
17402,
13,
2817,
29918,
3601,
353,
5075,
29889,
27429,
8942,
29898,
307,
7451,
29918,
2917,
29897,
13,
13,
29937,
270,
1160,
278,
24147,
310,
278,
5075,
13,
29881,
1160,
292,
353,
360,
1160,
292,
29898,
307,
7451,
29918,
2917,
29892,
10908,
29922,
29896,
29900,
29897,
13,
29937,
3013,
278,
5075,
2978,
263,
2322,
5285,
13,
5060,
292,
29918,
2917,
353,
11654,
292,
3991,
29898,
13,
1678,
19964,
29918,
2917,
29892,
413,
29886,
29922,
29945,
29900,
29892,
10908,
29922,
9302,
29889,
3676,
29898,
29945,
29900,
511,
13,
1678,
1791,
29918,
19536,
11759,
9302,
29889,
1631,
29914,
29946,
29892,
7442,
29889,
1631,
29914,
29946,
29892,
6213,
2314,
13,
13,
29937,
1653,
385,
1751,
1288,
2913,
4701,
13,
24220,
29878,
353,
6570,
29907,
29898,
307,
7451,
29918,
2917,
29892,
413,
29886,
29922,
29906,
29900,
29892,
671,
29918,
29907,
29922,
5574,
29892,
1870,
29918,
1285,
11897,
11759,
29881,
1160,
292,
2314,
13,
13,
13,
1753,
373,
29918,
3808,
29898,
1311,
29892,
9495,
29918,
29916,
29892,
9495,
29918,
29891,
1125,
13,
1678,
1583,
29889,
5182,
29961,
29900,
29962,
353,
1583,
29889,
15769,
29918,
29916,
13,
1678,
1583,
29889,
5182,
29961,
29896,
29962,
353,
1583,
29889,
15769,
29918,
29891,
13,
13,
13,
29937,
1653,
1749,
5067,
13,
13248,
353,
10772,
14199,
29898,
307,
7451,
29918,
2917,
29892,
5075,
29918,
3601,
29892,
11636,
21098,
29900,
29900,
29896,
29892,
373,
29918,
3808,
29922,
265,
29918,
3808,
29897,
13,
13248,
29889,
6915,
580,
13,
13,
29937,
1653,
263,
3646,
13,
18798,
1627,
353,
5067,
29889,
657,
29918,
18798,
1627,
580,
13,
5182,
29918,
20230,
353,
19964,
29918,
2917,
29889,
29911,
29916,
877,
17896,
742,
16705,
1839,
29939,
11287,
13,
13248,
29889,
842,
29918,
5182,
29898,
5182,
29918,
20230,
29897,
13,
13,
29937,
731,
701,
8857,
363,
23110,
848,
13,
3905,
29918,
2084,
353,
5159,
13,
5182,
29918,
2084,
353,
5159,
13,
13,
13,
2202,
29901,
13,
1678,
396,
1065,
274,
11742,
29889,
17158,
2748,
304,
2254,
599,
3168,
13,
1678,
24786,
353,
7442,
29889,
3298,
359,
29898,
307,
7451,
29918,
2917,
29889,
29940,
29918,
29967,
6992,
9375,
29897,
13,
1678,
274,
11742,
29878,
29889,
17158,
29898,
29939,
29922,
3298,
359,
29892,
270,
29939,
29922,
3298,
359,
29892,
3646,
29918,
1066,
29922,
9302,
29889,
3298,
359,
29898,
29941,
876,
13,
1678,
19964,
29918,
2917,
29889,
29934,
877,
17896,
742,
3855,
29922,
3298,
359,
29897,
13,
13,
1678,
1596,
28909,
29876,
8942,
2785,
6257,
856,
29905,
29876,
1495,
13,
1678,
1596,
28909,
29876,
4164,
304,
4337,
278,
3646,
7790,
29876,
1495,
13,
13,
1678,
2302,
353,
29871,
29900,
13,
1678,
1550,
29871,
29896,
29901,
13,
4706,
396,
679,
5075,
16705,
13,
4706,
16705,
353,
5067,
29889,
657,
29918,
18798,
1627,
580,
13,
4706,
1361,
29918,
20230,
353,
19964,
29918,
2917,
29889,
29911,
29916,
877,
17896,
742,
16705,
1839,
29939,
11287,
13,
13,
4706,
396,
5706,
385,
1751,
1288,
2913,
2761,
7182,
13,
4706,
318,
353,
274,
11742,
29878,
29889,
17158,
29898,
13,
9651,
3855,
29922,
18798,
1627,
1839,
29939,
7464,
13,
9651,
270,
29939,
29922,
18798,
1627,
1839,
29881,
29939,
7464,
13,
9651,
3646,
29918,
1066,
29922,
5182,
29918,
20230,
29892,
13,
9651,
3646,
29918,
955,
29922,
9302,
29889,
3298,
359,
29898,
29941,
876,
13,
13,
4706,
716,
29918,
5182,
353,
5067,
29889,
657,
29918,
15769,
3594,
580,
13,
4706,
565,
716,
29918,
5182,
338,
451,
6213,
29901,
13,
9651,
3646,
29918,
20230,
29961,
29900,
29901,
29906,
29962,
353,
716,
29918,
5182,
13,
4706,
5067,
29889,
842,
29918,
5182,
29898,
5182,
29918,
20230,
29897,
13,
13,
4706,
396,
3394,
278,
2761,
7182,
29892,
4331,
278,
1027,
6375,
13,
4706,
5067,
29889,
6717,
29918,
1454,
778,
29898,
13,
9651,
318,
29892,
2767,
29918,
4990,
29922,
5574,
565,
2302,
1273,
29871,
29945,
29900,
1275,
29871,
29900,
1683,
7700,
29897,
13,
13,
4706,
396,
5702,
848,
13,
4706,
321,
29872,
29918,
2084,
29889,
4397,
29898,
9302,
29889,
8552,
29898,
3179,
29918,
20230,
876,
13,
4706,
3646,
29918,
2084,
29889,
4397,
29898,
9302,
29889,
8552,
29898,
5182,
29918,
20230,
876,
13,
4706,
2302,
4619,
29871,
29896,
13,
13,
4951,
635,
29901,
13,
1678,
396,
5040,
322,
10092,
278,
17402,
13,
1678,
5067,
29889,
2218,
6915,
580,
13,
13,
1678,
1596,
877,
8942,
2785,
29185,
856,
1495,
13,
2
] |
dspback/main.py | czcnhub/dsp | 1 | 177128 | import uvicorn as uvicorn
from fastapi import FastAPI, Request, Response
from fastapi.staticfiles import StaticFiles
from starlette.middleware.sessions import SessionMiddleware
from dspback.config import get_settings
from dspback.database.models import SessionLocal
from dspback.routers import authentication, repository_authorization, submissions, metadata_class
app = FastAPI()
app.add_middleware(SessionMiddleware, secret_key=get_settings().session_secret_key)
app.mount("/api/schema", StaticFiles(directory="dspback/schemas"), name="schemas")
app.include_router(authentication.router, prefix="/api", tags=["api"])
app.include_router(repository_authorization.router, prefix="/api", tags=["api"])
app.include_router(submissions.router, prefix="/api", tags=["api"])
app.include_router(metadata_class.router, prefix="/api", tags=["api"])
@app.middleware("http")
async def db_session_middleware(request: Request, call_next):
response = Response("Internal server error", status_code=500)
try:
request.state.db = SessionLocal()
response = await call_next(request)
finally:
request.state.db.close()
return response
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=5002)
| [
1,
1053,
318,
26311,
1398,
408,
318,
26311,
1398,
13,
3166,
5172,
2754,
1053,
23786,
8787,
29892,
10729,
29892,
13291,
13,
3166,
5172,
2754,
29889,
7959,
5325,
1053,
624,
2454,
10547,
13,
3166,
5810,
20200,
29889,
17662,
2519,
29889,
29879,
10964,
1053,
16441,
25411,
2519,
13,
13,
3166,
270,
1028,
1627,
29889,
2917,
1053,
679,
29918,
11027,
13,
3166,
270,
1028,
1627,
29889,
9803,
29889,
9794,
1053,
16441,
7717,
13,
3166,
270,
1028,
1627,
29889,
27537,
2153,
1053,
10760,
29892,
9810,
29918,
8921,
2133,
29892,
11834,
6847,
29892,
15562,
29918,
1990,
13,
13,
13,
932,
353,
23786,
8787,
580,
13,
932,
29889,
1202,
29918,
17662,
2519,
29898,
7317,
25411,
2519,
29892,
7035,
29918,
1989,
29922,
657,
29918,
11027,
2141,
7924,
29918,
19024,
29918,
1989,
29897,
13,
13,
932,
29889,
16476,
11974,
2754,
29914,
11010,
613,
624,
2454,
10547,
29898,
12322,
543,
29881,
1028,
1627,
29914,
11993,
4968,
1024,
543,
11993,
1159,
13,
13,
932,
29889,
2856,
29918,
15140,
29898,
23055,
29889,
15140,
29892,
10944,
13802,
2754,
613,
8282,
29922,
3366,
2754,
20068,
13,
932,
29889,
2856,
29918,
15140,
29898,
19033,
29918,
8921,
2133,
29889,
15140,
29892,
10944,
13802,
2754,
613,
8282,
29922,
3366,
2754,
20068,
13,
932,
29889,
2856,
29918,
15140,
29898,
1491,
29885,
6847,
29889,
15140,
29892,
10944,
13802,
2754,
613,
8282,
29922,
3366,
2754,
20068,
13,
932,
29889,
2856,
29918,
15140,
29898,
19635,
29918,
1990,
29889,
15140,
29892,
10944,
13802,
2754,
613,
8282,
29922,
3366,
2754,
20068,
13,
13,
13,
29992,
932,
29889,
17662,
2519,
703,
1124,
1159,
13,
12674,
822,
4833,
29918,
7924,
29918,
17662,
2519,
29898,
3827,
29901,
10729,
29892,
1246,
29918,
4622,
1125,
13,
1678,
2933,
353,
13291,
703,
16491,
1923,
1059,
613,
4660,
29918,
401,
29922,
29945,
29900,
29900,
29897,
13,
1678,
1018,
29901,
13,
4706,
2009,
29889,
3859,
29889,
2585,
353,
16441,
7717,
580,
13,
4706,
2933,
353,
7272,
1246,
29918,
4622,
29898,
3827,
29897,
13,
1678,
7146,
29901,
13,
4706,
2009,
29889,
3859,
29889,
2585,
29889,
5358,
580,
13,
1678,
736,
2933,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
318,
26311,
1398,
29889,
3389,
29898,
932,
29892,
3495,
543,
29900,
29889,
29900,
29889,
29900,
29889,
29900,
613,
2011,
29922,
29945,
29900,
29900,
29906,
29897,
13,
2
] |
module/bio/queue/demux.py | moonwatcher/tubo | 0 | 105200 | <reponame>moonwatcher/tubo<filename>module/bio/queue/demux.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import io
import logging
from ontology import Ontology
from material import Resource
from command import Command
from queue import Job, Task, Scanner
from queue import ResourceTask
from error import *
class DemuxJob(Job):
def __init__(self, queue, node):
Job.__init__(self, queue, node)
self.log = logging.getLogger('Bio')
def load(self):
Job.load(self)
scanner = Scanner(self.env, self.ontology)
if scanner.ignored:
self.node['ignored'].extend(scanner.ignored)
if scanner.results:
count = 0
if self.action == 'demux':
# every lane is demultiplxed by a separate task
# we break the fastq files into tasks by flowcell/lane
breakdown = {}
for location in scanner.results:
if 'flowcell id' in location and 'lane number' in location:
if location['flowcell id'] not in breakdown:
breakdown[location['flowcell id']] = {}
if location['lane number'] not in breakdown[location['flowcell id']]:
breakdown[location['flowcell id']][location['lane number']] = []
breakdown[location['flowcell id']][location['lane number']].append(location)
for flowcell in breakdown.values():
for lane in flowcell.values():
self.push(DemuxTask(self, self.ontology, lane))
count += 1
elif self.action == 'merge':
# merge all files from different lanes but with the same nibble number
breakdown = {}
for location in scanner.results:
if 'flowcell id' in location and 'nibble number' in location:
if location['flowcell id'] not in breakdown:
breakdown[location['flowcell id']] = {}
if location['nibble number'] not in breakdown[location['flowcell id']]:
breakdown[location['flowcell id']][location['nibble number']] = []
breakdown[location['flowcell id']][location['nibble number']].append(location)
for flowcell_id, flowcell in breakdown.items():
for nibble_number in flowcell.keys():
flowcell[nibble_number] = sorted(flowcell[nibble_number], key=lambda x: x['lane number'])
pattern = [':'.join([ str(x['lane number']) for x in nibble ]) for nibble in flowcell.values()]
if len(set(pattern)) > 1:
self.abort('not all lanes have the same number of nibbles in flowcell {}'.format(flowcell_id))
else:
for nibble in flowcell.values():
self.push(MergeTask(self, self.ontology, nibble))
count += 1
elif self.action == 'filter':
for location in scanner.results:
self.push(FilterTask(self, self.ontology, location))
count += 1
self.log.debug('%d %s tasks queued in job %s', count, self.action, self.uuid)
class DemuxTask(Task):
def __init__(self, job, ontology, locations):
Task.__init__(self, job, ontology)
self.log = logging.getLogger('Bio')
self.locations = locations
self.resources = []
self.flowcell = None
self.lane = None
self.template = None
self.node['origins'] = []
def load(self):
Task.load(self)
def fetch_flowcell_resource(resource):
# Locate an ihrf, inrf or imrf resource we can use to get meatadata about the flowcell
flowcell = None
asset = self.env.resolver.resolve(resource.location['flowcell asset uri'], None, self.context)
if asset is not None:
for reference in asset['body']['references']:
if reference['genealogy']['media kind'] == 50 \
and (reference['genealogy']['kind'] in [ 'ihrf', 'imrf', 'inrf' ]):
flowcell = self.env.resolver.resolve(reference['canonical'], None, self.context)
if flowcell is not None:
break
return flowcell
# Since all resources are assumed to come from the same flowcell
# pick a representing resource.
representing = None
if self.valid:
for location in self.locations:
resource = Resource.create(self.env, location, self.context)
if resource is not None:
self.node['origins'].append(location)
self.resources.append(resource)
else:
self.abort('resource location is invalid:\n{}'.format(self.env.to_json(location)))
if self.resources:
representing = self.resources[0]
else:
self.abort('need at least one resource to demultiplex')
if self.valid:
self.flowcell = fetch_flowcell_resource(representing)
if self.flowcell is None:
self.abort('no suitable flowcell resource found to infer pheniqs output layout')
if self.valid:
if 'knowledge uri' in representing.location:
if representing.knowledge:
self.lane = representing.knowledge
if 'pools' not in self.lane['body']:
self.abort('no pools are associated with lane {}'.format(representing.location['home uri']))
else:
self.abort('was unable to resolve {}'.format(representing.location['knowledge uri']))
else:
self.abort('insufficient information to resolve lane from\n{}'.format(self.env.to_json(representing.location)))
if self.valid:
self.template = Ontology.clone(representing.location)
for e in [
'nibble number',
]: del self.template[e]
self.template['media kind'] = 53
def unload(self):
if self.resources:
if self.valid:
for resource in self.resources:
resource.unload()
else:
del self.node['origins']
Task.unload(self)
def last_fragment(self, command):
return len(command.ontology['pheniqs fragment']) - 1
def write_configuration_file(self, command):
def encode_pheniqs_config(ontology):
node = {}
for prototype in ontology.namespace.element.values():
if prototype.key in ontology:
value = ontology[prototype.key]
if value is not None and 'config' in prototype.node:
name = prototype.node['config']
if prototype.type == 'object':
if prototype.plural and value:
node[name] = [ encode_pheniqs_config(e) for e in value ]
else:
node[name] = encode_pheniqs_config(value)
elif not prototype.plural or value:
node[name] = value
return node
node = encode_pheniqs_config(command.ontology)
with io.open(command.ontology['pheniqs configuration path'], 'wb') as w:
w.write(self.env.to_json(node).encode('utf8'))
def reverse_complement(self, nucleotide):
complement = self.env.enumeration['iupac nucleic acid notation'].element
reversed = ''.join([ complement[n].node['reverse'] for n in nucleotide ][::-1])
return reversed
def configure(self, pheniqs):
if self.valid:
for term in [
'pheniqs barcode',
'pheniqs fragment',
'pheniqs input',
'pheniqs library',
'pheniqs output',
'pheniqs sequence'
]:
if term not in pheniqs.ontology:
pheniqs.ontology[term] = []
if not pheniqs.ontology['pheniqs library']:
if 'nibbles' in self.flowcell['body']['flowcell'] and self.flowcell['body']['flowcell']['nibbles']:
# append a new fragment spanning the entire nibble for each non index nibble
# than add a library output contaning just that fragment
for nibble in self.flowcell['body']['flowcell']['nibbles']:
if not nibble['index nibble']:
pheniqs.ontology['pheniqs fragment'].append('{}:0:'.format(nibble['nibble number'] - 1))
pheniqs.ontology['pheniqs library'].append(str(self.last_fragment(pheniqs)))
if not pheniqs.ontology['pheniqs library']:
self.abort('could not find any non index nibbles to write')
# Add all task resources as pheniqs inputs
if self.valid:
for input in self.resources:
pheniqs.ontology['pheniqs input'].append(input.path)
if self.valid:
for pool in self.lane['body']['pools']:
if 'pool barcodes' in pool:
pool['pool barcodes'].sort(key=lambda i: i['barcode index'])
if 'samples' in pool:
for sample in pool['samples']:
if 'library' in sample:
library = sample['library']
if library['barcodes']:
for index,barcode in enumerate(library['barcodes']):
nucleotide = barcode['barcode sequence']
# reverse complement the barcode if needed
if ('pool barcodes' in pool and \
index < len(pool['pool barcodes']) and \
'barcode reverse complement' in pool['pool barcodes'][index] and \
pool['pool barcodes'][index]['barcode reverse complement']):
reversed = self.reverse_complement(nucleotide)
self.log.debug('reverse complementing %s to %s', nucleotide, reversed)
nucleotide = reversed
pheniqs.ontology['pheniqs sequence'].append(nucleotide)
# infer an output product for each nibble
for index in range(len(pheniqs.ontology['pheniqs library'])):
if self.valid:
o = Ontology.clone(self.template)
o.overlay(library.project('ns/service/genealogy'))
o.overlay(sample.project('ns/service/genealogy'))
o['nibble number'] = index + 1
product = self.produce(o)
pheniqs.ontology['pheniqs output'].append(product.path)
else:
self.log.warning('ignoring library %s with missing barcodes', library['home uri'])
else:
self.log.warning('ignoring sample %s with missing library ', sample['home uri'])
def validate(self, pheniqs):
if self.valid:
pattern = { 'barcode':{} }
for pool in self.lane['body']['pools']:
if 'samples' in pool:
for sample in pool['samples']:
if 'library' in sample:
library = sample['library']
if library['barcodes']:
for index,barcode in enumerate(library['barcodes']):
if index not in pattern['barcode']:
pattern['barcode'][index] = []
pattern['barcode'][index].append(
'{}:{}:{}'.format(
barcode['barcode nibble'] - 1,
barcode['barcode cycle offset'] - 1,
barcode['barcode length']
)
)
# verify all barcodes in each collection have an identical pattern
for index,collection in pattern['barcode'].items():
if len(set(collection)) == 1:
pheniqs.ontology['pheniqs fragment'].append(collection[0])
pheniqs.ontology['pheniqs barcode'].append(str(self.last_fragment(pheniqs)))
else:
self.abort('barcodes in set {} are heterogeneous: {}'.format(index, ', '.join(collection)))
if self.valid:
if pheniqs.ontology['pheniqs output']:
for path in pheniqs.ontology['pheniqs output']:
try:
self.env.prepare_to_write_to_path(path, self.ontology['overwrite'])
except (NoOverwriteError, PermissionDeniedError) as e:
self.abort(str(e))
break
else:
self.abort('no libraries to demultiplex')
def pheniqs_demux(self):
pheniqs = Command('pheniqs demux', self.context)
if pheniqs.valid:
try:
self.env.prepare_to_write_to_path(pheniqs.ontology['pheniqs configuration path'], self.ontology['overwrite'])
except (NoOverwriteError, PermissionDeniedError) as e:
self.abort(str(e))
else:
self.configure(pheniqs)
self.validate(pheniqs)
if self.valid:
try:
self.write_configuration_file(pheniqs)
except OSError as error:
self.abort('writing pheniqs configuration file to {} failed'.format(pheniqs.ontology['pheniqs configuration path']))
self.log.error(str(error))
else:
self.log.info('using pheniqs configuration %s', pheniqs.ontology['pheniqs configuration path'])
pheniqs.execute()
else:
self.abort('command {} is invalid'.format(pheniqs.name))
class FilterTask(ResourceTask):
def __init__(self, job, ontology, location):
ResourceTask.__init__(self, job, ontology, location)
self.log = logging.getLogger('Bio')
def pheniqs_filter(self):
product = self.produce(self.resource.origin)
if self.resource.local and product.local:
try:
self.env.prepare_to_write_to_path(product.path, self.ontology['overwrite'])
except (NoOverwriteError, PermissionDeniedError) as e:
self.abort(str(e))
else:
pheniqs = Command('pheniqs filter', self.context)
if pheniqs.valid:
pheniqs.ontology['pheniqs input'].append(self.resource.qualified_path)
pheniqs.ontology['pheniqs output'].append(product.path)
self.log.debug('pheniqs filter {} --> {}'.format(self.resource.qualified_path, product.qualified_path))
pheniqs.execute()
else:
self.abort('command {} is invalid'.format(rsync.name))
else:
self.abort('filter can only be done locally')
class MergeTask(Task):
def __init__(self, job, ontology, locations):
Task.__init__(self, job, ontology)
self.log = logging.getLogger('Bio')
self.locations = locations
self.resources = []
self.node['origins'] = []
def load(self):
Task.load(self)
if self.valid:
for location in self.locations:
resource = Resource.create(self.env, location, self.context)
if resource is not None:
self.node['origins'].append(location)
self.resources.append(resource)
else:
self.abort('resource location is invalid:\n{}'.format(self.env.to_json(location)))
def unload(self):
if self.resources:
if self.valid:
for resource in self.resources:
resource.unload()
else:
del self.node['origins']
Task.unload(self)
def merge_fastq(self):
origin = Ontology.clone(self.resources[0].origin)
origin['media kind'] = 50
product = self.produce(origin)
if product.local:
try:
self.env.prepare_to_write_to_path(product.path, self.ontology['overwrite'])
except (NoOverwriteError, PermissionDeniedError) as e:
self.abort(str(e))
else:
if not self.simulated:
with io.open(product.path, 'wb') as o:
for resource in self.resources:
with io.open(resource.path, 'rb') as i:
o.write(i.read())
else:
self.log.info(
'merge {} --> {}'.format(
' + '.join([resource.path for resource in self.resources]),
product.path
)
)
else:
self.abort('merge can only be done locally')
| [
1,
529,
276,
1112,
420,
29958,
4346,
265,
12344,
261,
29914,
29873,
431,
29877,
29966,
9507,
29958,
5453,
29914,
24840,
29914,
9990,
29914,
2310,
1314,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
5215,
12013,
13,
5215,
12183,
29871,
13,
13,
3166,
4625,
3002,
1053,
18265,
3002,
13,
3166,
5518,
1053,
18981,
13,
3166,
1899,
1053,
10516,
13,
3166,
9521,
1053,
17163,
29892,
9330,
29892,
23412,
13,
3166,
9521,
1053,
18981,
5398,
13,
3166,
1059,
1053,
334,
13,
13,
1990,
4432,
1314,
11947,
29898,
11947,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
9521,
29892,
2943,
1125,
13,
4706,
17163,
17255,
2344,
12035,
1311,
29892,
9521,
29892,
2943,
29897,
13,
4706,
1583,
29889,
1188,
353,
12183,
29889,
657,
16363,
877,
29933,
601,
1495,
13,
13,
1678,
822,
2254,
29898,
1311,
1125,
13,
4706,
17163,
29889,
1359,
29898,
1311,
29897,
13,
4706,
885,
7310,
353,
23412,
29898,
1311,
29889,
6272,
29892,
1583,
29889,
609,
3002,
29897,
13,
4706,
565,
885,
7310,
29889,
647,
4395,
29901,
13,
9651,
1583,
29889,
3177,
1839,
647,
4395,
13359,
21843,
29898,
1557,
7310,
29889,
647,
4395,
29897,
13,
4706,
565,
885,
7310,
29889,
9902,
29901,
13,
9651,
2302,
353,
29871,
29900,
13,
9651,
565,
1583,
29889,
2467,
1275,
525,
2310,
1314,
2396,
13,
18884,
396,
1432,
301,
1662,
338,
1261,
499,
29875,
572,
29916,
287,
491,
263,
5004,
3414,
29871,
13,
18884,
396,
591,
2867,
278,
5172,
29939,
2066,
964,
9595,
491,
4972,
3729,
29914,
25821,
13,
18884,
2867,
3204,
353,
6571,
13,
18884,
363,
4423,
297,
885,
7310,
29889,
9902,
29901,
13,
462,
1678,
565,
525,
1731,
3729,
1178,
29915,
297,
4423,
322,
525,
25821,
1353,
29915,
297,
4423,
29901,
13,
462,
4706,
565,
4423,
1839,
1731,
3729,
1178,
2033,
451,
297,
2867,
3204,
29901,
13,
462,
9651,
2867,
3204,
29961,
5479,
1839,
1731,
3729,
1178,
2033,
29962,
353,
6571,
13,
462,
4706,
565,
4423,
1839,
25821,
1353,
2033,
451,
297,
2867,
3204,
29961,
5479,
1839,
1731,
3729,
1178,
2033,
5387,
13,
462,
9651,
2867,
3204,
29961,
5479,
1839,
1731,
3729,
1178,
2033,
3816,
5479,
1839,
25821,
1353,
2033,
29962,
353,
5159,
13,
462,
4706,
2867,
3204,
29961,
5479,
1839,
1731,
3729,
1178,
2033,
3816,
5479,
1839,
25821,
1353,
2033,
1822,
4397,
29898,
5479,
29897,
13,
13,
18884,
363,
4972,
3729,
297,
2867,
3204,
29889,
5975,
7295,
13,
462,
1678,
363,
301,
1662,
297,
4972,
3729,
29889,
5975,
7295,
13,
462,
4706,
1583,
29889,
5910,
29898,
29928,
331,
1314,
5398,
29898,
1311,
29892,
1583,
29889,
609,
3002,
29892,
301,
1662,
876,
13,
462,
4706,
2302,
4619,
29871,
29896,
13,
13,
9651,
25342,
1583,
29889,
2467,
1275,
525,
14634,
2396,
13,
18884,
396,
10366,
599,
2066,
515,
1422,
10906,
267,
541,
411,
278,
1021,
302,
747,
569,
1353,
13,
18884,
2867,
3204,
353,
6571,
13,
18884,
363,
4423,
297,
885,
7310,
29889,
9902,
29901,
13,
462,
1678,
565,
525,
1731,
3729,
1178,
29915,
297,
4423,
322,
525,
29876,
747,
569,
1353,
29915,
297,
4423,
29901,
13,
462,
4706,
565,
4423,
1839,
1731,
3729,
1178,
2033,
451,
297,
2867,
3204,
29901,
13,
462,
9651,
2867,
3204,
29961,
5479,
1839,
1731,
3729,
1178,
2033,
29962,
353,
6571,
13,
462,
4706,
565,
4423,
1839,
29876,
747,
569,
1353,
2033,
451,
297,
2867,
3204,
29961,
5479,
1839,
1731,
3729,
1178,
2033,
5387,
13,
462,
9651,
2867,
3204,
29961,
5479,
1839,
1731,
3729,
1178,
2033,
3816,
5479,
1839,
29876,
747,
569,
1353,
2033,
29962,
353,
5159,
13,
462,
4706,
2867,
3204,
29961,
5479,
1839,
1731,
3729,
1178,
2033,
3816,
5479,
1839,
29876,
747,
569,
1353,
2033,
1822,
4397,
29898,
5479,
29897,
13,
13,
18884,
363,
4972,
3729,
29918,
333,
29892,
4972,
3729,
297,
2867,
3204,
29889,
7076,
7295,
13,
462,
1678,
363,
302,
747,
569,
29918,
4537,
297,
4972,
3729,
29889,
8149,
7295,
13,
462,
4706,
4972,
3729,
29961,
29876,
747,
569,
29918,
4537,
29962,
353,
12705,
29898,
1731,
3729,
29961,
29876,
747,
569,
29918,
4537,
1402,
1820,
29922,
2892,
921,
29901,
921,
1839,
25821,
1353,
11287,
13,
13,
462,
1678,
4766,
353,
518,
2396,
4286,
7122,
4197,
851,
29898,
29916,
1839,
25821,
1353,
11287,
363,
921,
297,
302,
747,
569,
29871,
2314,
363,
302,
747,
569,
297,
4972,
3729,
29889,
5975,
580,
29962,
13,
462,
1678,
565,
7431,
29898,
842,
29898,
11037,
876,
1405,
29871,
29896,
29901,
13,
462,
4706,
1583,
29889,
370,
441,
877,
1333,
599,
10906,
267,
505,
278,
1021,
1353,
310,
302,
747,
7586,
297,
4972,
3729,
6571,
4286,
4830,
29898,
1731,
3729,
29918,
333,
876,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
363,
302,
747,
569,
297,
4972,
3729,
29889,
5975,
7295,
13,
462,
9651,
1583,
29889,
5910,
29898,
15836,
479,
5398,
29898,
1311,
29892,
1583,
29889,
609,
3002,
29892,
302,
747,
569,
876,
13,
462,
9651,
2302,
4619,
29871,
29896,
13,
13,
9651,
25342,
1583,
29889,
2467,
1275,
525,
4572,
2396,
13,
18884,
363,
4423,
297,
885,
7310,
29889,
9902,
29901,
13,
462,
1678,
1583,
29889,
5910,
29898,
5072,
5398,
29898,
1311,
29892,
1583,
29889,
609,
3002,
29892,
4423,
876,
13,
462,
1678,
2302,
4619,
29871,
29896,
13,
13,
9651,
1583,
29889,
1188,
29889,
8382,
877,
29995,
29881,
1273,
29879,
9595,
712,
6742,
297,
4982,
1273,
29879,
742,
2302,
29892,
1583,
29889,
2467,
29892,
1583,
29889,
25118,
29897,
13,
13,
1990,
4432,
1314,
5398,
29898,
5398,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4982,
29892,
4625,
3002,
29892,
14354,
1125,
13,
4706,
9330,
17255,
2344,
12035,
1311,
29892,
4982,
29892,
4625,
3002,
29897,
13,
4706,
1583,
29889,
1188,
353,
12183,
29889,
657,
16363,
877,
29933,
601,
1495,
13,
4706,
1583,
29889,
2029,
800,
353,
14354,
13,
4706,
1583,
29889,
13237,
353,
5159,
13,
4706,
1583,
29889,
1731,
3729,
353,
6213,
13,
4706,
1583,
29889,
25821,
353,
6213,
13,
4706,
1583,
29889,
6886,
353,
6213,
13,
4706,
1583,
29889,
3177,
1839,
12683,
1144,
2033,
353,
5159,
13,
13,
1678,
822,
2254,
29898,
1311,
1125,
13,
4706,
9330,
29889,
1359,
29898,
1311,
29897,
13,
4706,
822,
6699,
29918,
1731,
3729,
29918,
10314,
29898,
10314,
1125,
13,
9651,
396,
5976,
403,
385,
5351,
29888,
29892,
297,
9600,
470,
527,
9600,
6503,
591,
508,
671,
304,
679,
27654,
7221,
1048,
278,
4972,
3729,
29871,
13,
9651,
4972,
3729,
353,
6213,
13,
9651,
24342,
353,
1583,
29889,
6272,
29889,
9778,
369,
29889,
17863,
29898,
10314,
29889,
5479,
1839,
1731,
3729,
24342,
21333,
7464,
6213,
29892,
1583,
29889,
4703,
29897,
13,
9651,
565,
24342,
338,
451,
6213,
29901,
13,
18884,
363,
3407,
297,
24342,
1839,
2587,
16215,
276,
10662,
2033,
29901,
13,
462,
1678,
565,
3407,
1839,
29887,
1600,
284,
6933,
16215,
9799,
2924,
2033,
1275,
29871,
29945,
29900,
320,
13,
462,
1678,
322,
313,
5679,
1839,
29887,
1600,
284,
6933,
16215,
14380,
2033,
297,
518,
525,
29875,
1092,
29888,
742,
525,
326,
9600,
742,
525,
262,
9600,
29915,
4514,
1125,
13,
462,
4706,
4972,
3729,
353,
1583,
29889,
6272,
29889,
9778,
369,
29889,
17863,
29898,
5679,
1839,
3068,
265,
936,
7464,
6213,
29892,
1583,
29889,
4703,
29897,
13,
462,
4706,
565,
4972,
3729,
338,
451,
6213,
29901,
13,
462,
9651,
2867,
13,
9651,
736,
4972,
3729,
13,
13,
4706,
396,
4001,
599,
7788,
526,
12023,
304,
2041,
515,
278,
1021,
4972,
3729,
13,
4706,
396,
5839,
263,
15783,
6503,
29889,
13,
4706,
15783,
353,
6213,
13,
13,
4706,
565,
1583,
29889,
3084,
29901,
13,
9651,
363,
4423,
297,
1583,
29889,
2029,
800,
29901,
13,
18884,
6503,
353,
18981,
29889,
3258,
29898,
1311,
29889,
6272,
29892,
4423,
29892,
1583,
29889,
4703,
29897,
13,
18884,
565,
6503,
338,
451,
6213,
29901,
13,
462,
1678,
1583,
29889,
3177,
1839,
12683,
1144,
13359,
4397,
29898,
5479,
29897,
13,
462,
1678,
1583,
29889,
13237,
29889,
4397,
29898,
10314,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
1583,
29889,
370,
441,
877,
10314,
4423,
338,
8340,
3583,
29876,
8875,
4286,
4830,
29898,
1311,
29889,
6272,
29889,
517,
29918,
3126,
29898,
5479,
4961,
13,
13,
9651,
565,
1583,
29889,
13237,
29901,
13,
18884,
15783,
353,
1583,
29889,
13237,
29961,
29900,
29962,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
370,
441,
877,
26180,
472,
3203,
697,
6503,
304,
1261,
499,
29875,
10709,
1495,
13,
13,
4706,
565,
1583,
29889,
3084,
29901,
13,
9651,
1583,
29889,
1731,
3729,
353,
6699,
29918,
1731,
3729,
29918,
10314,
29898,
276,
6338,
292,
29897,
13,
9651,
565,
1583,
29889,
1731,
3729,
338,
6213,
29901,
13,
18884,
1583,
29889,
370,
441,
877,
1217,
13907,
4972,
3729,
6503,
1476,
304,
10115,
1374,
11344,
29939,
29879,
1962,
5912,
1495,
13,
13,
4706,
565,
1583,
29889,
3084,
29901,
13,
9651,
565,
525,
28385,
5485,
21333,
29915,
297,
15783,
29889,
5479,
29901,
13,
18884,
565,
15783,
29889,
28385,
5485,
29901,
13,
462,
1678,
1583,
29889,
25821,
353,
15783,
29889,
28385,
5485,
13,
462,
1678,
565,
525,
1129,
3775,
29915,
451,
297,
1583,
29889,
25821,
1839,
2587,
2033,
29901,
13,
462,
4706,
1583,
29889,
370,
441,
877,
1217,
772,
3775,
526,
6942,
411,
301,
1662,
6571,
4286,
4830,
29898,
276,
6338,
292,
29889,
5479,
1839,
5184,
21333,
25901,
13,
18884,
1683,
29901,
13,
462,
1678,
1583,
29889,
370,
441,
877,
11102,
9368,
304,
8814,
6571,
4286,
4830,
29898,
276,
6338,
292,
29889,
5479,
1839,
28385,
5485,
21333,
25901,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
370,
441,
877,
1144,
29884,
4543,
2472,
304,
8814,
301,
1662,
515,
29905,
29876,
8875,
4286,
4830,
29898,
1311,
29889,
6272,
29889,
517,
29918,
3126,
29898,
276,
6338,
292,
29889,
5479,
4961,
13,
13,
4706,
565,
1583,
29889,
3084,
29901,
13,
9651,
1583,
29889,
6886,
353,
18265,
3002,
29889,
16513,
29898,
276,
6338,
292,
29889,
5479,
29897,
13,
9651,
363,
321,
297,
518,
13,
18884,
525,
29876,
747,
569,
1353,
742,
13,
9651,
4514,
29901,
628,
1583,
29889,
6886,
29961,
29872,
29962,
13,
9651,
1583,
29889,
6886,
1839,
9799,
2924,
2033,
353,
29871,
29945,
29941,
13,
13,
1678,
822,
443,
1359,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
13237,
29901,
13,
9651,
565,
1583,
29889,
3084,
29901,
13,
18884,
363,
6503,
297,
1583,
29889,
13237,
29901,
13,
462,
1678,
6503,
29889,
348,
1359,
580,
13,
4706,
1683,
29901,
13,
9651,
628,
1583,
29889,
3177,
1839,
12683,
1144,
2033,
13,
13,
4706,
9330,
29889,
348,
1359,
29898,
1311,
29897,
13,
13,
1678,
822,
1833,
29918,
20777,
29898,
1311,
29892,
1899,
1125,
13,
4706,
736,
7431,
29898,
6519,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
9376,
11287,
448,
29871,
29896,
13,
13,
1678,
822,
2436,
29918,
13305,
29918,
1445,
29898,
1311,
29892,
1899,
1125,
13,
4706,
822,
19750,
29918,
9789,
29875,
29939,
29879,
29918,
2917,
29898,
609,
3002,
1125,
13,
9651,
2943,
353,
6571,
13,
9651,
363,
22267,
297,
4625,
3002,
29889,
22377,
29889,
5029,
29889,
5975,
7295,
13,
18884,
565,
22267,
29889,
1989,
297,
4625,
3002,
29901,
13,
462,
1678,
995,
353,
4625,
3002,
29961,
16309,
29889,
1989,
29962,
13,
462,
1678,
565,
995,
338,
451,
6213,
322,
525,
2917,
29915,
297,
22267,
29889,
3177,
29901,
13,
462,
4706,
1024,
353,
22267,
29889,
3177,
1839,
2917,
2033,
13,
462,
4706,
565,
22267,
29889,
1853,
1275,
525,
3318,
2396,
13,
462,
9651,
565,
22267,
29889,
572,
3631,
322,
995,
29901,
13,
462,
18884,
2943,
29961,
978,
29962,
353,
518,
19750,
29918,
9789,
29875,
29939,
29879,
29918,
2917,
29898,
29872,
29897,
363,
321,
297,
995,
4514,
13,
462,
9651,
1683,
29901,
13,
462,
18884,
2943,
29961,
978,
29962,
353,
19750,
29918,
9789,
29875,
29939,
29879,
29918,
2917,
29898,
1767,
29897,
13,
462,
4706,
25342,
451,
22267,
29889,
572,
3631,
470,
995,
29901,
13,
462,
9651,
2943,
29961,
978,
29962,
353,
995,
13,
9651,
736,
2943,
13,
13,
4706,
2943,
353,
19750,
29918,
9789,
29875,
29939,
29879,
29918,
2917,
29898,
6519,
29889,
609,
3002,
29897,
13,
4706,
411,
12013,
29889,
3150,
29898,
6519,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
5285,
2224,
7464,
525,
29893,
29890,
1495,
408,
281,
29901,
13,
9651,
281,
29889,
3539,
29898,
1311,
29889,
6272,
29889,
517,
29918,
3126,
29898,
3177,
467,
12508,
877,
9420,
29947,
8785,
13,
13,
1678,
822,
11837,
29918,
510,
2037,
29898,
1311,
29892,
22699,
327,
680,
1125,
13,
4706,
19595,
353,
1583,
29889,
6272,
29889,
264,
4680,
362,
1839,
29875,
786,
562,
22699,
293,
22193,
12640,
13359,
5029,
13,
4706,
18764,
287,
353,
525,
4286,
7122,
4197,
19595,
29961,
29876,
1822,
3177,
1839,
24244,
2033,
363,
302,
297,
22699,
327,
680,
29871,
3816,
1057,
29899,
29896,
2314,
13,
4706,
736,
18764,
287,
13,
13,
1678,
822,
10822,
29898,
1311,
29892,
1374,
11344,
29939,
29879,
1125,
13,
4706,
565,
1583,
29889,
3084,
29901,
13,
9651,
363,
1840,
297,
518,
13,
18884,
525,
9789,
29875,
29939,
29879,
2594,
401,
742,
13,
18884,
525,
9789,
29875,
29939,
29879,
9376,
742,
13,
18884,
525,
9789,
29875,
29939,
29879,
1881,
742,
13,
18884,
525,
9789,
29875,
29939,
29879,
3489,
742,
13,
18884,
525,
9789,
29875,
29939,
29879,
1962,
742,
13,
18884,
525,
9789,
29875,
29939,
29879,
5665,
29915,
13,
9651,
4514,
29901,
13,
18884,
565,
1840,
451,
297,
1374,
11344,
29939,
29879,
29889,
609,
3002,
29901,
13,
462,
1678,
1374,
11344,
29939,
29879,
29889,
609,
3002,
29961,
8489,
29962,
353,
5159,
13,
13,
9651,
565,
451,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
3489,
2033,
29901,
13,
18884,
565,
525,
29876,
747,
7586,
29915,
297,
1583,
29889,
1731,
3729,
1839,
2587,
16215,
1731,
3729,
2033,
322,
1583,
29889,
1731,
3729,
1839,
2587,
16215,
1731,
3729,
16215,
29876,
747,
7586,
2033,
29901,
13,
462,
1678,
396,
9773,
263,
716,
9376,
805,
9450,
278,
4152,
302,
747,
569,
363,
1269,
1661,
2380,
302,
747,
569,
13,
462,
1678,
396,
1135,
788,
263,
3489,
1962,
640,
273,
292,
925,
393,
9376,
13,
462,
1678,
363,
302,
747,
569,
297,
1583,
29889,
1731,
3729,
1839,
2587,
16215,
1731,
3729,
16215,
29876,
747,
7586,
2033,
29901,
13,
462,
4706,
565,
451,
302,
747,
569,
1839,
2248,
302,
747,
569,
2033,
29901,
13,
462,
9651,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
9376,
13359,
4397,
877,
29912,
6177,
29900,
29901,
4286,
4830,
29898,
29876,
747,
569,
1839,
29876,
747,
569,
1353,
2033,
448,
29871,
29896,
876,
13,
462,
9651,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
3489,
13359,
4397,
29898,
710,
29898,
1311,
29889,
4230,
29918,
20777,
29898,
9789,
29875,
29939,
29879,
4961,
13,
13,
18884,
565,
451,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
3489,
2033,
29901,
13,
462,
1678,
1583,
29889,
370,
441,
877,
26680,
451,
1284,
738,
1661,
2380,
302,
747,
7586,
304,
2436,
1495,
13,
13,
4706,
396,
3462,
599,
3414,
7788,
408,
1374,
11344,
29939,
29879,
10970,
13,
4706,
565,
1583,
29889,
3084,
29901,
13,
9651,
363,
1881,
297,
1583,
29889,
13237,
29901,
13,
18884,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
1881,
13359,
4397,
29898,
2080,
29889,
2084,
29897,
13,
13,
4706,
565,
1583,
29889,
3084,
29901,
13,
9651,
363,
11565,
297,
1583,
29889,
25821,
1839,
2587,
16215,
1129,
3775,
2033,
29901,
13,
18884,
565,
525,
10109,
2594,
18137,
29915,
297,
11565,
29901,
13,
462,
1678,
11565,
1839,
10109,
2594,
18137,
13359,
6605,
29898,
1989,
29922,
2892,
474,
29901,
474,
1839,
1646,
401,
2380,
11287,
13,
13,
18884,
565,
525,
27736,
29915,
297,
11565,
29901,
13,
462,
1678,
363,
4559,
297,
11565,
1839,
27736,
2033,
29901,
13,
462,
4706,
565,
525,
5258,
29915,
297,
4559,
29901,
13,
462,
9651,
3489,
353,
4559,
1839,
5258,
2033,
13,
462,
9651,
565,
3489,
1839,
1646,
18137,
2033,
29901,
13,
462,
18884,
363,
2380,
29892,
1646,
401,
297,
26985,
29898,
5258,
1839,
1646,
18137,
2033,
1125,
13,
462,
462,
1678,
22699,
327,
680,
353,
2594,
401,
1839,
1646,
401,
5665,
2033,
13,
13,
462,
462,
1678,
396,
11837,
19595,
278,
2594,
401,
565,
4312,
13,
462,
462,
1678,
565,
6702,
10109,
2594,
18137,
29915,
297,
11565,
322,
320,
13,
462,
462,
4706,
2380,
529,
7431,
29898,
10109,
1839,
10109,
2594,
18137,
11287,
322,
320,
13,
462,
462,
4706,
525,
1646,
401,
11837,
19595,
29915,
297,
11565,
1839,
10109,
2594,
18137,
2033,
29961,
2248,
29962,
322,
320,
13,
462,
462,
4706,
11565,
1839,
10109,
2594,
18137,
2033,
29961,
2248,
22322,
1646,
401,
11837,
19595,
2033,
1125,
13,
462,
462,
9651,
18764,
287,
353,
1583,
29889,
24244,
29918,
510,
2037,
29898,
29876,
1682,
280,
327,
680,
29897,
13,
462,
462,
9651,
1583,
29889,
1188,
29889,
8382,
877,
24244,
19595,
292,
1273,
29879,
304,
1273,
29879,
742,
22699,
327,
680,
29892,
18764,
287,
29897,
13,
462,
462,
9651,
22699,
327,
680,
353,
18764,
287,
13,
13,
462,
462,
1678,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
5665,
13359,
4397,
29898,
29876,
1682,
280,
327,
680,
29897,
13,
13,
462,
18884,
396,
10115,
385,
1962,
3234,
363,
1269,
302,
747,
569,
29871,
13,
462,
18884,
363,
2380,
297,
3464,
29898,
2435,
29898,
9789,
29875,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
3489,
2033,
22164,
13,
462,
462,
1678,
565,
1583,
29889,
3084,
29901,
13,
462,
462,
4706,
288,
353,
18265,
3002,
29889,
16513,
29898,
1311,
29889,
6886,
29897,
13,
462,
462,
4706,
288,
29889,
957,
8387,
29898,
5258,
29889,
4836,
877,
1983,
29914,
5509,
29914,
29887,
1600,
284,
6933,
8785,
13,
462,
462,
4706,
288,
29889,
957,
8387,
29898,
11249,
29889,
4836,
877,
1983,
29914,
5509,
29914,
29887,
1600,
284,
6933,
8785,
13,
462,
462,
4706,
288,
1839,
29876,
747,
569,
1353,
2033,
353,
2380,
718,
29871,
29896,
13,
462,
462,
4706,
3234,
353,
1583,
29889,
5498,
346,
29898,
29877,
29897,
13,
462,
462,
4706,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
1962,
13359,
4397,
29898,
4704,
29889,
2084,
29897,
13,
462,
9651,
1683,
29901,
13,
462,
18884,
1583,
29889,
1188,
29889,
27392,
877,
647,
8253,
3489,
1273,
29879,
411,
4567,
2594,
18137,
742,
3489,
1839,
5184,
21333,
11287,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
1583,
29889,
1188,
29889,
27392,
877,
647,
8253,
4559,
1273,
29879,
411,
4567,
3489,
13420,
4559,
1839,
5184,
21333,
11287,
13,
13,
1678,
822,
12725,
29898,
1311,
29892,
1374,
11344,
29939,
29879,
1125,
13,
4706,
565,
1583,
29889,
3084,
29901,
13,
9651,
4766,
353,
426,
525,
1646,
401,
2396,
8875,
500,
13,
9651,
363,
11565,
297,
1583,
29889,
25821,
1839,
2587,
16215,
1129,
3775,
2033,
29901,
13,
18884,
565,
525,
27736,
29915,
297,
11565,
29901,
13,
462,
1678,
363,
4559,
297,
11565,
1839,
27736,
2033,
29901,
13,
462,
4706,
565,
525,
5258,
29915,
297,
4559,
29901,
13,
462,
9651,
3489,
353,
4559,
1839,
5258,
2033,
13,
462,
9651,
565,
3489,
1839,
1646,
18137,
2033,
29901,
13,
462,
18884,
363,
2380,
29892,
1646,
401,
297,
26985,
29898,
5258,
1839,
1646,
18137,
2033,
1125,
13,
462,
462,
1678,
565,
2380,
451,
297,
4766,
1839,
1646,
401,
2033,
29901,
13,
462,
462,
4706,
4766,
1839,
1646,
401,
2033,
29961,
2248,
29962,
353,
5159,
13,
13,
462,
462,
1678,
4766,
1839,
1646,
401,
2033,
29961,
2248,
1822,
4397,
29898,
13,
462,
462,
4706,
22372,
6177,
29912,
6177,
8875,
4286,
4830,
29898,
13,
462,
462,
9651,
2594,
401,
1839,
1646,
401,
302,
747,
569,
2033,
448,
29871,
29896,
29892,
13,
462,
462,
9651,
2594,
401,
1839,
1646,
401,
11412,
9210,
2033,
448,
29871,
29896,
29892,
13,
462,
462,
9651,
2594,
401,
1839,
1646,
401,
3309,
2033,
13,
462,
462,
4706,
1723,
13,
462,
462,
1678,
1723,
13,
13,
9651,
396,
11539,
599,
2594,
18137,
297,
1269,
4333,
505,
385,
13557,
4766,
13,
9651,
363,
2380,
29892,
10855,
297,
4766,
1839,
1646,
401,
13359,
7076,
7295,
13,
18884,
565,
7431,
29898,
842,
29898,
10855,
876,
1275,
29871,
29896,
29901,
13,
462,
1678,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
9376,
13359,
4397,
29898,
10855,
29961,
29900,
2314,
13,
462,
1678,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
2594,
401,
13359,
4397,
29898,
710,
29898,
1311,
29889,
4230,
29918,
20777,
29898,
9789,
29875,
29939,
29879,
4961,
13,
18884,
1683,
29901,
13,
462,
1678,
1583,
29889,
370,
441,
877,
1646,
18137,
297,
731,
6571,
526,
25745,
23724,
29901,
6571,
4286,
4830,
29898,
2248,
29892,
13420,
15300,
7122,
29898,
10855,
4961,
13,
13,
4706,
565,
1583,
29889,
3084,
29901,
13,
9651,
565,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
1962,
2033,
29901,
13,
18884,
363,
2224,
297,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
1962,
2033,
29901,
13,
462,
1678,
1018,
29901,
13,
462,
4706,
1583,
29889,
6272,
29889,
19125,
29918,
517,
29918,
3539,
29918,
517,
29918,
2084,
29898,
2084,
29892,
1583,
29889,
609,
3002,
1839,
957,
3539,
11287,
13,
462,
1678,
5174,
313,
3782,
3563,
3539,
2392,
29892,
20894,
2333,
29315,
1000,
2392,
29897,
408,
321,
29901,
13,
462,
4706,
1583,
29889,
370,
441,
29898,
710,
29898,
29872,
876,
13,
462,
4706,
2867,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
370,
441,
877,
1217,
9562,
304,
1261,
499,
29875,
10709,
1495,
13,
13,
1678,
822,
1374,
11344,
29939,
29879,
29918,
2310,
1314,
29898,
1311,
1125,
13,
4706,
1374,
11344,
29939,
29879,
353,
10516,
877,
9789,
29875,
29939,
29879,
1261,
1314,
742,
1583,
29889,
4703,
29897,
13,
4706,
565,
1374,
11344,
29939,
29879,
29889,
3084,
29901,
13,
9651,
1018,
29901,
13,
18884,
1583,
29889,
6272,
29889,
19125,
29918,
517,
29918,
3539,
29918,
517,
29918,
2084,
29898,
9789,
29875,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
5285,
2224,
7464,
1583,
29889,
609,
3002,
1839,
957,
3539,
11287,
13,
9651,
5174,
313,
3782,
3563,
3539,
2392,
29892,
20894,
2333,
29315,
1000,
2392,
29897,
408,
321,
29901,
13,
18884,
1583,
29889,
370,
441,
29898,
710,
29898,
29872,
876,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
17591,
29898,
9789,
29875,
29939,
29879,
29897,
13,
18884,
1583,
29889,
15480,
29898,
9789,
29875,
29939,
29879,
29897,
13,
18884,
565,
1583,
29889,
3084,
29901,
13,
462,
1678,
1018,
29901,
13,
462,
4706,
1583,
29889,
3539,
29918,
13305,
29918,
1445,
29898,
9789,
29875,
29939,
29879,
29897,
13,
462,
1678,
5174,
438,
29173,
408,
1059,
29901,
13,
462,
4706,
1583,
29889,
370,
441,
877,
16554,
1374,
11344,
29939,
29879,
5285,
934,
304,
6571,
5229,
4286,
4830,
29898,
9789,
29875,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
5285,
2224,
25901,
13,
462,
4706,
1583,
29889,
1188,
29889,
2704,
29898,
710,
29898,
2704,
876,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
1583,
29889,
1188,
29889,
3888,
877,
4746,
1374,
11344,
29939,
29879,
5285,
1273,
29879,
742,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
5285,
2224,
11287,
13,
462,
4706,
1374,
11344,
29939,
29879,
29889,
7978,
580,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
370,
441,
877,
6519,
6571,
338,
8340,
4286,
4830,
29898,
9789,
29875,
29939,
29879,
29889,
978,
876,
13,
13,
1990,
19916,
5398,
29898,
6848,
5398,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4982,
29892,
4625,
3002,
29892,
4423,
1125,
13,
4706,
18981,
5398,
17255,
2344,
12035,
1311,
29892,
4982,
29892,
4625,
3002,
29892,
4423,
29897,
13,
4706,
1583,
29889,
1188,
353,
12183,
29889,
657,
16363,
877,
29933,
601,
1495,
13,
13,
1678,
822,
1374,
11344,
29939,
29879,
29918,
4572,
29898,
1311,
1125,
13,
4706,
3234,
353,
1583,
29889,
5498,
346,
29898,
1311,
29889,
10314,
29889,
12574,
29897,
13,
4706,
565,
1583,
29889,
10314,
29889,
2997,
322,
3234,
29889,
2997,
29901,
13,
9651,
1018,
29901,
13,
18884,
1583,
29889,
6272,
29889,
19125,
29918,
517,
29918,
3539,
29918,
517,
29918,
2084,
29898,
4704,
29889,
2084,
29892,
1583,
29889,
609,
3002,
1839,
957,
3539,
11287,
13,
9651,
5174,
313,
3782,
3563,
3539,
2392,
29892,
20894,
2333,
29315,
1000,
2392,
29897,
408,
321,
29901,
13,
18884,
1583,
29889,
370,
441,
29898,
710,
29898,
29872,
876,
13,
9651,
1683,
29901,
13,
18884,
1374,
11344,
29939,
29879,
353,
10516,
877,
9789,
29875,
29939,
29879,
4175,
742,
1583,
29889,
4703,
29897,
13,
18884,
565,
1374,
11344,
29939,
29879,
29889,
3084,
29901,
13,
462,
1678,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
1881,
13359,
4397,
29898,
1311,
29889,
10314,
29889,
15380,
2164,
29918,
2084,
29897,
13,
462,
1678,
1374,
11344,
29939,
29879,
29889,
609,
3002,
1839,
9789,
29875,
29939,
29879,
1962,
13359,
4397,
29898,
4704,
29889,
2084,
29897,
13,
462,
1678,
1583,
29889,
1188,
29889,
8382,
877,
9789,
29875,
29939,
29879,
4175,
6571,
6660,
6571,
4286,
4830,
29898,
1311,
29889,
10314,
29889,
15380,
2164,
29918,
2084,
29892,
3234,
29889,
15380,
2164,
29918,
2084,
876,
13,
462,
1678,
1374,
11344,
29939,
29879,
29889,
7978,
580,
13,
18884,
1683,
29901,
13,
462,
1678,
1583,
29889,
370,
441,
877,
6519,
6571,
338,
8340,
4286,
4830,
29898,
2288,
2720,
29889,
978,
876,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
370,
441,
877,
4572,
508,
871,
367,
2309,
12430,
1495,
13,
13,
1990,
4702,
479,
5398,
29898,
5398,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4982,
29892,
4625,
3002,
29892,
14354,
1125,
13,
4706,
9330,
17255,
2344,
12035,
1311,
29892,
4982,
29892,
4625,
3002,
29897,
13,
4706,
1583,
29889,
1188,
353,
12183,
29889,
657,
16363,
877,
29933,
601,
1495,
13,
4706,
1583,
29889,
2029,
800,
353,
14354,
13,
4706,
1583,
29889,
13237,
353,
5159,
13,
4706,
1583,
29889,
3177,
1839,
12683,
1144,
2033,
353,
5159,
13,
13,
1678,
822,
2254,
29898,
1311,
1125,
13,
4706,
9330,
29889,
1359,
29898,
1311,
29897,
13,
4706,
565,
1583,
29889,
3084,
29901,
13,
9651,
363,
4423,
297,
1583,
29889,
2029,
800,
29901,
13,
18884,
6503,
353,
18981,
29889,
3258,
29898,
1311,
29889,
6272,
29892,
4423,
29892,
1583,
29889,
4703,
29897,
13,
18884,
565,
6503,
338,
451,
6213,
29901,
13,
462,
1678,
1583,
29889,
3177,
1839,
12683,
1144,
13359,
4397,
29898,
5479,
29897,
13,
462,
1678,
1583,
29889,
13237,
29889,
4397,
29898,
10314,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
1583,
29889,
370,
441,
877,
10314,
4423,
338,
8340,
3583,
29876,
8875,
4286,
4830,
29898,
1311,
29889,
6272,
29889,
517,
29918,
3126,
29898,
5479,
4961,
13,
13,
1678,
822,
443,
1359,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
13237,
29901,
13,
9651,
565,
1583,
29889,
3084,
29901,
13,
18884,
363,
6503,
297,
1583,
29889,
13237,
29901,
13,
462,
1678,
6503,
29889,
348,
1359,
580,
13,
4706,
1683,
29901,
13,
9651,
628,
1583,
29889,
3177,
1839,
12683,
1144,
2033,
13,
13,
4706,
9330,
29889,
348,
1359,
29898,
1311,
29897,
13,
13,
1678,
822,
10366,
29918,
11255,
29939,
29898,
1311,
1125,
13,
4706,
3978,
353,
18265,
3002,
29889,
16513,
29898,
1311,
29889,
13237,
29961,
29900,
1822,
12574,
29897,
13,
4706,
3978,
1839,
9799,
2924,
2033,
353,
29871,
29945,
29900,
13,
4706,
3234,
353,
1583,
29889,
5498,
346,
29898,
12574,
29897,
13,
4706,
565,
3234,
29889,
2997,
29901,
13,
9651,
1018,
29901,
13,
18884,
1583,
29889,
6272,
29889,
19125,
29918,
517,
29918,
3539,
29918,
517,
29918,
2084,
29898,
4704,
29889,
2084,
29892,
1583,
29889,
609,
3002,
1839,
957,
3539,
11287,
13,
9651,
5174,
313,
3782,
3563,
3539,
2392,
29892,
20894,
2333,
29315,
1000,
2392,
29897,
408,
321,
29901,
13,
18884,
1583,
29889,
370,
441,
29898,
710,
29898,
29872,
876,
13,
9651,
1683,
29901,
13,
18884,
565,
451,
1583,
29889,
3601,
7964,
29901,
13,
462,
1678,
411,
12013,
29889,
3150,
29898,
4704,
29889,
2084,
29892,
525,
29893,
29890,
1495,
408,
288,
29901,
13,
462,
4706,
363,
6503,
297,
1583,
29889,
13237,
29901,
13,
462,
9651,
411,
12013,
29889,
3150,
29898,
10314,
29889,
2084,
29892,
525,
6050,
1495,
408,
474,
29901,
13,
462,
18884,
288,
29889,
3539,
29898,
29875,
29889,
949,
3101,
13,
18884,
1683,
29901,
13,
462,
1678,
1583,
29889,
1188,
29889,
3888,
29898,
13,
462,
4706,
525,
14634,
6571,
6660,
6571,
4286,
4830,
29898,
13,
462,
9651,
525,
718,
15300,
7122,
4197,
10314,
29889,
2084,
363,
6503,
297,
1583,
29889,
13237,
11724,
13,
462,
9651,
3234,
29889,
2084,
13,
462,
4706,
1723,
13,
462,
1678,
1723,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
370,
441,
877,
14634,
508,
871,
367,
2309,
12430,
1495,
13,
2
] |
zshoes/api/auth.py | andresgz/zshoes | 0 | 140341 | from django.utils.translation import ugettext_lazy as _
from django.contrib.auth import get_user_model
from rest_framework.authentication import BasicAuthentication
from rest_framework.exceptions import AuthenticationFailed
class AuthenticationBasic(BasicAuthentication):
def authenticate_credentials(self, userid, password):
"""
Authenticate the userid and password against username and password.
"""
User = get_user_model()
user = User()
if userid == 'my_user' and password == '<PASSWORD>':
return (user, None)
else:
raise AuthenticationFailed(
_('Invalid username/password.'))
| [
1,
515,
9557,
29889,
13239,
29889,
3286,
18411,
1053,
318,
657,
726,
29918,
433,
1537,
408,
903,
13,
13,
3166,
9557,
29889,
21570,
29889,
5150,
1053,
679,
29918,
1792,
29918,
4299,
13,
13,
3166,
1791,
29918,
4468,
29889,
23055,
1053,
19219,
16746,
13,
3166,
1791,
29918,
4468,
29889,
11739,
29879,
1053,
27241,
17776,
13,
13,
13,
1990,
27241,
16616,
29898,
16616,
16746,
1125,
13,
1678,
822,
15585,
403,
29918,
11944,
9409,
29898,
1311,
29892,
1404,
333,
29892,
4800,
1125,
13,
4706,
9995,
13,
4706,
13189,
4173,
403,
278,
1404,
333,
322,
4800,
2750,
8952,
322,
4800,
29889,
13,
4706,
9995,
13,
4706,
4911,
353,
679,
29918,
1792,
29918,
4299,
580,
13,
4706,
1404,
353,
4911,
580,
13,
4706,
565,
1404,
333,
1275,
525,
1357,
29918,
1792,
29915,
322,
4800,
1275,
12801,
25711,
17013,
29958,
2396,
13,
9651,
736,
313,
1792,
29892,
6213,
29897,
13,
4706,
1683,
29901,
13,
9651,
12020,
27241,
17776,
29898,
13,
18884,
903,
877,
13919,
8952,
29914,
5630,
6169,
876,
13,
2
] |
dataloader.py | cviaai/TMJ-segment | 6 | 159873 | import numpy as np
np.random.seed(0)
import torch
torch.manual_seed(0)
from torch.utils.data import Dataset, DataLoader, ConcatDataset, RandomSampler
import torchvision
import imageio
import importlib
import random
import glob
import os
import transforms_3d
class patch_DS(Dataset):
"""Implementation of torch.utils.data.Dataset for set of .tiff files, which iterates over the raw and label datasets
patch by patch with a given stride.
"""
def __init__(self, root_dcm, root_mask, phase, transformer_config, patient_ids, patch_shape, stride_shape, patch_builder_cls,
voi_shape, precrop, seed_fn=None):
"""
Args:
root_dcm: path to directory containing raw data.
root_mask: path to directory containing label data.
phase: 'train' for training, 'val' for validation, 'test' for testing; data augmentation is performed
only during the 'train' phase.
transformer_config: dictionary of transformations and parameters for data augmentation.
patient_ids: set of patients' ids for dataset during the phase.
patch_shape: the shape of the patch DxHxW.
stride_shape: the shape of the stride DxHxW.
slice_builder_cls: defines how to sample patches from the image.
voi_shape: shape of each image DxHxW.
precrop: necessity of precroppping.
"""
self.root_dcm = root_dcm
self.root_mask = root_mask
assert phase in ['train', 'val', 'test']
self.phase = phase
self.transformer_config = transformer_config
self.patient_ids = patient_ids
self.patch_shape = patch_shape
self.stride_shape = stride_shape
self.patch_builder_cls = patch_builder_cls
self.voi_shape = voi_shape
self.precrop = precrop
self.seed_fn = seed_fn
self.to_tensor_transform = torchvision.transforms.ToTensor()
self.filenames_dcm = []
self.filenames_mask = []
self.raws = []
self.labels = []
for i in patient_ids:
filenames_img = glob.glob(os.path.join(root_dcm+str(i), '*.tiff'))
filenames_img.sort()
filenames_m = [x.replace('dicom','mask') for x in filenames_img]
self.filenames_dcm.append(filenames_img)
self.filenames_mask.append(filenames_m)
depth = len(filenames_img)
if self.precrop:
z1 = (depth-self.voi_shape[2])//2
z2 = z1+self.voi_shape[2]
else:
z1 = 0
z2 = depth
# read raw scan
raw_img = np.zeros(self.voi_shape, dtype='uint8') # create zero image
for fn in filenames_img[z1:z2]:
img = imageio.imread(fn)
if self.precrop:
img = self._center_crop(img,self.voi_shape[:2])
raw_img[:, :, filenames_img[z1:z2].index(fn)] = img
self.raws.append(raw_img)
# read mask for scan
label_img = np.zeros(self.voi_shape, dtype='uint8') # create zero mask
for fn in filenames_m[z1:z2]:
m = imageio.imread(fn)
if self.precrop:
m = self._center_crop(m,self.voi_shape[:2])
label_img[:, :, filenames_m[z1:z2].index(fn)] = m
self.labels.append(label_img)
self.raws = np.array(self.raws)
self.labels = np.array(self.labels)
min_value, max_value, mean, std = self._calculate_stats(self.raws)
print (f'Input stats: min={min_value}, max={max_value}, mean={mean}, std={std}')
self.transformer = transforms_3d.get_transformer(self.transformer_config, min_value=min_value, max_value=max_value,
mean=mean, std=std, phase=self.phase)
self.raw_transform = self.transformer.raw_transform()
self.label_transform = self.transformer.label_transform()
patch_builder = patch_builder_cls(self.raws, self.labels, patch_shape, stride_shape)
self.raw_patches = patch_builder.raw_patches
self.label_patches= patch_builder.label_patches
self.len = len(self.raw_patches)
def _set_seed(self, seed):
random.seed(seed)
torch.manual_seed(seed)
if self.seed_fn:
self.seed_fn(seed)
@staticmethod
def _calculate_stats(inputs):
return np.min(inputs), np.max(inputs), np.mean(inputs), np.std(inputs)
def __getitem__(self, index):
raw_idx = self.raw_patches[index]
label_idx = self.label_patches[index]
image = self.raws[raw_idx]
image = image.reshape(self.patch_shape)
mask = self.labels[label_idx]
mask = mask.reshape(self.patch_shape)
seed = random.randint(0, 2**32)
self._set_seed(seed)
image = self.raw_transform(image)
image = self.to_tensor_transform(image)
self._set_seed(seed)
mask = self.label_transform(mask)
mask = self.to_tensor_transform(mask)
return image, mask
def _center_crop(self, img, roi_shape):
y_size, x_size = roi_shape
y1 = (img.shape[0]-y_size)//2
x1 = (img.shape[1]-x_size)//2
return img[y1:y1+y_size, x1:x1+x_size]
def __len__(self):
return self.len
class PatchBuilder:
"""Sample patches from the image."""
def __init__(self, raw_dataset, label_dataset, patch_shape, stride_shape):
"""
Args:
raw_dataset: array of raw data.
label_dataset: array of label data.
patch_shape: the shape of the patch DxHxW.
stride_shape: the shape of the stride DxHxW.
"""
self._raw_patches = self._build_patches(raw_dataset, patch_shape, stride_shape)
if label_dataset is None:
self._label_patches = None
else:
self._label_patches = self._build_patches(label_dataset, patch_shape, stride_shape)
@property
def raw_patches(self):
return self._raw_patches
@property
def label_patches(self):
return self._label_patches
@staticmethod
def _build_patches(dataset, patch_shape, stride_shape):
"""Iterate over a given dataset patch-by-patch with a given stride and builds an array of slice positions.
Args:
dataset: array of label data.
patch_shape: the shape of the patch DxHxW.
stride_shape: the shape of the stride DxHxW.
Returns:
list of slices [(slice, slice, slice, slice), ...]
"""
slices = []
assert len(dataset.shape) == 4, 'Supports only 4D (NxDxHxW)'
num_patients, i_z, i_y, i_x = dataset.shape
k_z, k_y, k_x = patch_shape
s_z, s_y, s_x = stride_shape
for p in range(num_patients):
z_steps = PatchBuilder._gen_indices(i_z, k_z, s_z)
for z in z_steps:
y_steps = PatchBuilder._gen_indices(i_y, k_y, s_y)
for y in y_steps:
x_steps = PatchBuilder._gen_indices(i_x, k_x, s_x)
for x in x_steps:
slice_idx = (
slice(z, z + k_z),
slice(y, y + k_y),
slice(x, x + k_x)
)
slice_idx = (slice(p, p+1),) + slice_idx # patient id
slices.append(slice_idx)
return slices
@staticmethod
def _gen_indices(i, k, s):
"""
Args:
i (int): image size.
k (int): patch size.
s (int): stride size.
Returns:
generator of slides start positions
"""
assert i >= k, 'Sample size should be bigger than the patch size'
for j in range(0, i - k + 1, s):
yield j
if (j + k < i)&(i!=s):
yield i - k
def _get_patch_builder_cls(class_name):
m = importlib.import_module('dataloader')
clazz = getattr(m, class_name)
return clazz
def get_train_loaders(config):
"""Return dictionary containing the training and validation loaders (torch.utils.data.DataLoader).
Args:
config: a top level configuration object containing the 'loaders' key.
Returns: dict {'train': <train_loader>, 'val': <val_loader>}: dictionary containing the training and validation loaders.
"""
assert 'loaders' in config, 'Could not find data loaders configuration'
loaders_config = config['loaders']
print ('Creating training and validation set loaders...')
# get train and validation files
objects = loaders_config['objects']
assert isinstance(objects, list)
voi_shape = loaders_config['voi_shape']
dicom_path = loaders_config['dicom_path']
mask_path = loaders_config['mask_path']
train_ids = tuple(loaders_config['train_patient_ids'])
train_patch = tuple(loaders_config['train_patch'])
train_stride = tuple(loaders_config['train_stride'])
val_ids = tuple(loaders_config['val_patient_ids'])
val_patch = tuple(loaders_config['val_patch'])
val_stride = tuple(loaders_config['val_stride'])
transformer_config = loaders_config['transformer']
precrop = loaders_config['precrop']
# get train slice_builder_cls
train_patch_builder_str = loaders_config.get('train_patch_builder', 'PatchBuilder')
print (f'Train s builder class: {train_patch_builder_str}')
train_patch_builder_cls = _get_patch_builder_cls(train_patch_builder_str)
train_datasets = []
for obj in objects:
root_dcm = dicom_path+'_'+obj+ '/'
root_mask = mask_path+'_'+obj+ '/'
try:
print (f'Loading training set from: {root_dcm}...')
train_dataset = patch_DS(root_dcm, root_mask, 'train', transformer_config,
train_ids, train_patch, train_stride,
train_patch_builder_cls, voi_shape,precrop, seed_fn=None)
train_datasets.append(train_dataset)
except Exception:
print (f'Skipping training set: {root_dcm}')
# get val slice_builder_cls
val_patch_builder_str = loaders_config.get('val_patch_builder', 'PatchBuilder')
print (f'Val patch builder class: {val_patch_builder_str}')
val_patch_builder_cls = _get_patch_builder_cls(val_patch_builder_str)
val_datasets = []
for obj in objects:
root_dcm = dicom_path+'_'+obj+ '/'
root_mask = mask_path+'_'+obj+ '/'
try:
print (f'Loading val set from: {root_dcm}...')
val_dataset = patch_DS(root_dcm, root_mask, 'val', transformer_config,
val_ids, val_patch, val_stride,
val_patch_builder_cls, voi_shape, precrop, seed_fn=None)
val_datasets.append(val_dataset)
except Exception:
print(f'Skipping val set: {root_dcm}')
num_workers = loaders_config.get('num_workers', 1)
print (f'Number of workers for train/val dataloader: {num_workers}')
batch_size = loaders_config.get('batch_size', 1)
print (f'Batch size for train/val loader: {batch_size}')
train_dataset_size = loaders_config.get('train_dataset_size', 1)
train_rand_sampler = RandomSampler(ConcatDataset(train_datasets), replacement=True, num_samples=train_dataset_size)
return {'train': DataLoader(ConcatDataset(train_datasets), batch_size=batch_size, shuffle=False, sampler=train_rand_sampler,
num_workers=num_workers),
'val': DataLoader(ConcatDataset(val_datasets), batch_size=batch_size, shuffle=False, num_workers=num_workers)
}
| [
1,
1053,
12655,
408,
7442,
13,
9302,
29889,
8172,
29889,
26776,
29898,
29900,
29897,
13,
5215,
4842,
305,
13,
7345,
305,
29889,
11288,
29918,
26776,
29898,
29900,
29897,
13,
3166,
4842,
305,
29889,
13239,
29889,
1272,
1053,
13373,
24541,
29892,
3630,
10036,
29892,
1281,
4117,
16390,
24541,
29892,
16968,
22966,
20069,
13,
5215,
4842,
305,
4924,
13,
5215,
1967,
601,
13,
5215,
1053,
1982,
13,
5215,
4036,
13,
5215,
13149,
13,
5215,
2897,
13,
13,
5215,
4327,
29879,
29918,
29941,
29881,
29871,
13,
268,
13,
1990,
13261,
29918,
8452,
29898,
16390,
24541,
1125,
13,
1678,
9995,
1888,
14607,
310,
4842,
305,
29889,
13239,
29889,
1272,
29889,
16390,
24541,
363,
731,
310,
869,
29873,
2593,
2066,
29892,
607,
4256,
1078,
975,
278,
10650,
322,
3858,
20035,
13,
1678,
13261,
491,
13261,
411,
263,
2183,
380,
2426,
29889,
13,
1678,
9995,
539,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3876,
29918,
29881,
4912,
29892,
3876,
29918,
13168,
29892,
8576,
29892,
4327,
261,
29918,
2917,
29892,
16500,
29918,
4841,
29892,
13261,
29918,
12181,
29892,
380,
2426,
29918,
12181,
29892,
13261,
29918,
16409,
29918,
25932,
29892,
13,
462,
992,
29875,
29918,
12181,
29892,
8303,
1336,
29892,
16717,
29918,
9144,
29922,
8516,
1125,
13,
4706,
9995,
13,
4706,
826,
3174,
29901,
13,
9651,
3876,
29918,
29881,
4912,
29901,
2224,
304,
3884,
6943,
10650,
848,
29889,
13,
9651,
3876,
29918,
13168,
29901,
2224,
304,
3884,
6943,
3858,
848,
29889,
13,
9651,
8576,
29901,
525,
14968,
29915,
363,
6694,
29892,
525,
791,
29915,
363,
8845,
29892,
525,
1688,
29915,
363,
6724,
29936,
848,
18765,
362,
338,
8560,
13,
9651,
871,
2645,
278,
525,
14968,
29915,
8576,
29889,
13,
9651,
4327,
261,
29918,
2917,
29901,
8600,
310,
29304,
322,
4128,
363,
848,
18765,
362,
29889,
13,
9651,
16500,
29918,
4841,
29901,
731,
310,
22069,
29915,
18999,
363,
8783,
2645,
278,
8576,
29889,
13,
9651,
13261,
29918,
12181,
29901,
278,
8267,
310,
278,
13261,
360,
29916,
29950,
29916,
29956,
29889,
13,
9651,
380,
2426,
29918,
12181,
29901,
278,
8267,
310,
278,
380,
2426,
360,
29916,
29950,
29916,
29956,
29889,
13,
9651,
22780,
29918,
16409,
29918,
25932,
29901,
17645,
920,
304,
4559,
13261,
267,
515,
278,
1967,
29889,
13,
9651,
992,
29875,
29918,
12181,
29901,
8267,
310,
1269,
1967,
360,
29916,
29950,
29916,
29956,
29889,
13,
9651,
8303,
1336,
29901,
24316,
310,
8303,
307,
407,
15702,
29889,
13,
4706,
9995,
1678,
13,
4706,
1583,
29889,
4632,
29918,
29881,
4912,
353,
3876,
29918,
29881,
4912,
13,
4706,
1583,
29889,
4632,
29918,
13168,
353,
3876,
29918,
13168,
13,
4706,
4974,
8576,
297,
6024,
14968,
742,
525,
791,
742,
525,
1688,
2033,
13,
4706,
1583,
29889,
21646,
353,
8576,
13,
4706,
1583,
29889,
9067,
261,
29918,
2917,
353,
4327,
261,
29918,
2917,
13,
4706,
1583,
29889,
5031,
993,
29918,
4841,
353,
16500,
29918,
4841,
13,
4706,
1583,
29889,
5041,
29918,
12181,
353,
13261,
29918,
12181,
13,
4706,
1583,
29889,
303,
2426,
29918,
12181,
353,
380,
2426,
29918,
12181,
13,
4706,
1583,
29889,
5041,
29918,
16409,
29918,
25932,
353,
13261,
29918,
16409,
29918,
25932,
13,
4706,
1583,
29889,
1365,
29875,
29918,
12181,
353,
992,
29875,
29918,
12181,
13,
4706,
1583,
29889,
17990,
1336,
353,
8303,
1336,
13,
4706,
1583,
29889,
26776,
29918,
9144,
353,
16717,
29918,
9144,
13,
13,
4706,
1583,
29889,
517,
29918,
20158,
29918,
9067,
353,
4842,
305,
4924,
29889,
9067,
29879,
29889,
1762,
29911,
6073,
580,
13,
4706,
1583,
29889,
1777,
264,
1280,
29918,
29881,
4912,
353,
5159,
13,
4706,
1583,
29889,
1777,
264,
1280,
29918,
13168,
353,
5159,
13,
4706,
1583,
29889,
1610,
29879,
353,
5159,
13,
4706,
1583,
29889,
21134,
353,
5159,
13,
4706,
363,
474,
297,
16500,
29918,
4841,
29901,
13,
9651,
977,
264,
1280,
29918,
2492,
353,
13149,
29889,
23705,
29898,
359,
29889,
2084,
29889,
7122,
29898,
4632,
29918,
29881,
4912,
29974,
710,
29898,
29875,
511,
525,
10521,
29873,
2593,
8785,
13,
9651,
977,
264,
1280,
29918,
2492,
29889,
6605,
580,
13,
9651,
977,
264,
1280,
29918,
29885,
353,
518,
29916,
29889,
6506,
877,
27774,
290,
3788,
13168,
1495,
363,
921,
297,
977,
264,
1280,
29918,
2492,
29962,
13,
9651,
1583,
29889,
1777,
264,
1280,
29918,
29881,
4912,
29889,
4397,
29898,
1777,
264,
1280,
29918,
2492,
29897,
13,
9651,
1583,
29889,
1777,
264,
1280,
29918,
13168,
29889,
4397,
29898,
1777,
264,
1280,
29918,
29885,
29897,
13,
9651,
10809,
353,
7431,
29898,
1777,
264,
1280,
29918,
2492,
29897,
13,
9651,
565,
1583,
29889,
17990,
1336,
29901,
13,
18884,
503,
29896,
353,
313,
19488,
29899,
1311,
29889,
1365,
29875,
29918,
12181,
29961,
29906,
2314,
458,
29906,
13,
18884,
503,
29906,
353,
503,
29896,
29974,
1311,
29889,
1365,
29875,
29918,
12181,
29961,
29906,
29962,
13,
9651,
1683,
29901,
13,
18884,
503,
29896,
353,
29871,
29900,
13,
18884,
503,
29906,
353,
10809,
13,
9651,
396,
1303,
10650,
12812,
13,
9651,
10650,
29918,
2492,
353,
7442,
29889,
3298,
359,
29898,
1311,
29889,
1365,
29875,
29918,
12181,
29892,
26688,
2433,
13470,
29947,
1495,
396,
1653,
5225,
1967,
259,
13,
9651,
363,
7876,
297,
977,
264,
1280,
29918,
2492,
29961,
29920,
29896,
29901,
29920,
29906,
5387,
13,
18884,
10153,
353,
1967,
601,
29889,
326,
949,
29898,
9144,
29897,
29871,
13,
18884,
565,
1583,
29889,
17990,
1336,
29901,
13,
462,
1678,
10153,
353,
1583,
3032,
5064,
29918,
29883,
1336,
29898,
2492,
29892,
1311,
29889,
1365,
29875,
29918,
12181,
7503,
29906,
2314,
13,
18884,
10650,
29918,
2492,
7503,
29892,
584,
29892,
977,
264,
1280,
29918,
2492,
29961,
29920,
29896,
29901,
29920,
29906,
1822,
2248,
29898,
9144,
4638,
353,
10153,
13,
9651,
1583,
29889,
1610,
29879,
29889,
4397,
29898,
1610,
29918,
2492,
29897,
13,
9651,
396,
1303,
11105,
363,
12812,
13,
9651,
3858,
29918,
2492,
353,
7442,
29889,
3298,
359,
29898,
1311,
29889,
1365,
29875,
29918,
12181,
29892,
26688,
2433,
13470,
29947,
1495,
396,
1653,
5225,
11105,
29871,
13,
9651,
363,
7876,
297,
977,
264,
1280,
29918,
29885,
29961,
29920,
29896,
29901,
29920,
29906,
5387,
13,
18884,
286,
353,
1967,
601,
29889,
326,
949,
29898,
9144,
29897,
29871,
13,
18884,
565,
1583,
29889,
17990,
1336,
29901,
13,
462,
1678,
286,
353,
1583,
3032,
5064,
29918,
29883,
1336,
29898,
29885,
29892,
1311,
29889,
1365,
29875,
29918,
12181,
7503,
29906,
2314,
13,
18884,
3858,
29918,
2492,
7503,
29892,
584,
29892,
977,
264,
1280,
29918,
29885,
29961,
29920,
29896,
29901,
29920,
29906,
1822,
2248,
29898,
9144,
4638,
353,
286,
13,
9651,
1583,
29889,
21134,
29889,
4397,
29898,
1643,
29918,
2492,
29897,
13,
4706,
1583,
29889,
1610,
29879,
353,
7442,
29889,
2378,
29898,
1311,
29889,
1610,
29879,
29897,
13,
4706,
1583,
29889,
21134,
353,
7442,
29889,
2378,
29898,
1311,
29889,
21134,
29897,
13,
308,
13,
4706,
1375,
29918,
1767,
29892,
4236,
29918,
1767,
29892,
2099,
29892,
3659,
353,
1583,
3032,
15807,
403,
29918,
16202,
29898,
1311,
29889,
1610,
29879,
29897,
13,
4706,
1596,
313,
29888,
29915,
4290,
22663,
29901,
1375,
3790,
1195,
29918,
1767,
1118,
4236,
3790,
3317,
29918,
1767,
1118,
2099,
3790,
12676,
1118,
3659,
3790,
4172,
29913,
1495,
13,
4706,
1583,
29889,
9067,
261,
353,
4327,
29879,
29918,
29941,
29881,
29889,
657,
29918,
9067,
261,
29898,
1311,
29889,
9067,
261,
29918,
2917,
29892,
1375,
29918,
1767,
29922,
1195,
29918,
1767,
29892,
4236,
29918,
1767,
29922,
3317,
29918,
1767,
29892,
13,
462,
462,
462,
3986,
2099,
29922,
12676,
29892,
3659,
29922,
4172,
29892,
8576,
29922,
1311,
29889,
21646,
29897,
13,
4706,
1583,
29889,
1610,
29918,
9067,
353,
1583,
29889,
9067,
261,
29889,
1610,
29918,
9067,
580,
13,
4706,
1583,
29889,
1643,
29918,
9067,
353,
1583,
29889,
9067,
261,
29889,
1643,
29918,
9067,
580,
13,
4706,
13261,
29918,
16409,
353,
13261,
29918,
16409,
29918,
25932,
29898,
1311,
29889,
1610,
29879,
29892,
1583,
29889,
21134,
29892,
13261,
29918,
12181,
29892,
380,
2426,
29918,
12181,
29897,
13,
4706,
1583,
29889,
1610,
29918,
5041,
267,
353,
13261,
29918,
16409,
29889,
1610,
29918,
5041,
267,
13,
4706,
1583,
29889,
1643,
29918,
5041,
267,
29922,
13261,
29918,
16409,
29889,
1643,
29918,
5041,
267,
13,
4706,
1583,
29889,
2435,
353,
7431,
29898,
1311,
29889,
1610,
29918,
5041,
267,
29897,
13,
13,
1678,
822,
903,
842,
29918,
26776,
29898,
1311,
29892,
16717,
1125,
13,
4706,
4036,
29889,
26776,
29898,
26776,
29897,
13,
4706,
4842,
305,
29889,
11288,
29918,
26776,
29898,
26776,
29897,
13,
4706,
565,
1583,
29889,
26776,
29918,
9144,
29901,
13,
9651,
1583,
29889,
26776,
29918,
9144,
29898,
26776,
29897,
13,
632,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
903,
15807,
403,
29918,
16202,
29898,
2080,
29879,
1125,
13,
4706,
736,
7442,
29889,
1195,
29898,
2080,
29879,
511,
7442,
29889,
3317,
29898,
2080,
29879,
511,
7442,
29889,
12676,
29898,
2080,
29879,
511,
7442,
29889,
4172,
29898,
2080,
29879,
29897,
13,
632,
13,
1678,
822,
4770,
657,
667,
12035,
1311,
29892,
2380,
1125,
13,
4706,
10650,
29918,
13140,
353,
1583,
29889,
1610,
29918,
5041,
267,
29961,
2248,
29962,
13,
4706,
3858,
29918,
13140,
353,
1583,
29889,
1643,
29918,
5041,
267,
29961,
2248,
29962,
13,
308,
13,
4706,
1967,
353,
1583,
29889,
1610,
29879,
29961,
1610,
29918,
13140,
29962,
13,
4706,
1967,
353,
1967,
29889,
690,
14443,
29898,
1311,
29889,
5041,
29918,
12181,
29897,
13,
4706,
11105,
353,
1583,
29889,
21134,
29961,
1643,
29918,
13140,
29962,
13,
4706,
11105,
353,
11105,
29889,
690,
14443,
29898,
1311,
29889,
5041,
29918,
12181,
29897,
13,
13,
4706,
16717,
353,
4036,
29889,
9502,
524,
29898,
29900,
29892,
29871,
29906,
1068,
29941,
29906,
29897,
13,
4706,
1583,
3032,
842,
29918,
26776,
29898,
26776,
29897,
13,
4706,
1967,
353,
1583,
29889,
1610,
29918,
9067,
29898,
3027,
29897,
13,
4706,
1967,
353,
1583,
29889,
517,
29918,
20158,
29918,
9067,
29898,
3027,
29897,
13,
632,
13,
4706,
1583,
3032,
842,
29918,
26776,
29898,
26776,
29897,
13,
4706,
11105,
353,
1583,
29889,
1643,
29918,
9067,
29898,
13168,
29897,
13,
4706,
11105,
353,
1583,
29889,
517,
29918,
20158,
29918,
9067,
29898,
13168,
29897,
13,
308,
13,
4706,
736,
1967,
29892,
11105,
13,
13,
1678,
822,
903,
5064,
29918,
29883,
1336,
29898,
1311,
29892,
10153,
29892,
14100,
29918,
12181,
1125,
13,
4706,
343,
29918,
2311,
29892,
921,
29918,
2311,
353,
14100,
29918,
12181,
13,
4706,
343,
29896,
353,
313,
2492,
29889,
12181,
29961,
29900,
29962,
29899,
29891,
29918,
2311,
29897,
458,
29906,
13,
4706,
921,
29896,
353,
313,
2492,
29889,
12181,
29961,
29896,
29962,
29899,
29916,
29918,
2311,
29897,
458,
29906,
259,
13,
4706,
736,
10153,
29961,
29891,
29896,
29901,
29891,
29896,
29974,
29891,
29918,
2311,
29892,
921,
29896,
29901,
29916,
29896,
29974,
29916,
29918,
2311,
29962,
13,
13,
1678,
822,
4770,
2435,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
2435,
29871,
13,
13,
13,
1990,
349,
905,
5627,
29901,
13,
1678,
9995,
17708,
13261,
267,
515,
278,
1967,
1213,
15945,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10650,
29918,
24713,
29892,
3858,
29918,
24713,
29892,
13261,
29918,
12181,
29892,
380,
2426,
29918,
12181,
1125,
13,
4706,
9995,
13,
4706,
826,
3174,
29901,
13,
9651,
10650,
29918,
24713,
29901,
1409,
310,
10650,
848,
29889,
13,
9651,
3858,
29918,
24713,
29901,
1409,
310,
3858,
848,
29889,
13,
9651,
13261,
29918,
12181,
29901,
278,
8267,
310,
278,
13261,
360,
29916,
29950,
29916,
29956,
29889,
13,
9651,
380,
2426,
29918,
12181,
29901,
278,
8267,
310,
278,
380,
2426,
360,
29916,
29950,
29916,
29956,
29889,
13,
4706,
9995,
1678,
13,
4706,
1583,
3032,
1610,
29918,
5041,
267,
353,
1583,
3032,
4282,
29918,
5041,
267,
29898,
1610,
29918,
24713,
29892,
13261,
29918,
12181,
29892,
380,
2426,
29918,
12181,
29897,
13,
4706,
565,
3858,
29918,
24713,
338,
6213,
29901,
13,
9651,
1583,
3032,
1643,
29918,
5041,
267,
353,
6213,
13,
4706,
1683,
29901,
13,
9651,
1583,
3032,
1643,
29918,
5041,
267,
353,
1583,
3032,
4282,
29918,
5041,
267,
29898,
1643,
29918,
24713,
29892,
13261,
29918,
12181,
29892,
380,
2426,
29918,
12181,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
10650,
29918,
5041,
267,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
1610,
29918,
5041,
267,
13,
13,
1678,
732,
6799,
13,
1678,
822,
3858,
29918,
5041,
267,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
1643,
29918,
5041,
267,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
903,
4282,
29918,
5041,
267,
29898,
24713,
29892,
13261,
29918,
12181,
29892,
380,
2426,
29918,
12181,
1125,
13,
4706,
9995,
13463,
403,
975,
263,
2183,
8783,
13261,
29899,
1609,
29899,
5041,
411,
263,
2183,
380,
2426,
322,
23315,
385,
1409,
310,
22780,
11909,
29889,
13,
308,
13,
4706,
826,
3174,
29901,
13,
9651,
8783,
29901,
1409,
310,
3858,
848,
29889,
13,
9651,
13261,
29918,
12181,
29901,
278,
8267,
310,
278,
13261,
360,
29916,
29950,
29916,
29956,
29889,
13,
9651,
380,
2426,
29918,
12181,
29901,
278,
8267,
310,
278,
380,
2426,
360,
29916,
29950,
29916,
29956,
29889,
13,
632,
13,
4706,
16969,
29901,
13,
9651,
1051,
310,
269,
29399,
17288,
18337,
29892,
22780,
29892,
22780,
29892,
22780,
511,
2023,
29962,
29871,
13,
4706,
9995,
13,
4706,
269,
29399,
353,
5159,
13,
4706,
4974,
7431,
29898,
24713,
29889,
12181,
29897,
1275,
29871,
29946,
29892,
525,
14039,
29879,
871,
29871,
29946,
29928,
313,
29940,
29916,
29928,
29916,
29950,
29916,
29956,
16029,
13,
4706,
954,
29918,
5031,
10070,
29892,
474,
29918,
29920,
29892,
474,
29918,
29891,
29892,
474,
29918,
29916,
353,
8783,
29889,
12181,
13,
13,
4706,
413,
29918,
29920,
29892,
413,
29918,
29891,
29892,
413,
29918,
29916,
353,
13261,
29918,
12181,
13,
4706,
269,
29918,
29920,
29892,
269,
29918,
29891,
29892,
269,
29918,
29916,
353,
380,
2426,
29918,
12181,
13,
4706,
363,
282,
297,
3464,
29898,
1949,
29918,
5031,
10070,
1125,
13,
9651,
503,
29918,
24530,
353,
349,
905,
5627,
3032,
1885,
29918,
513,
1575,
29898,
29875,
29918,
29920,
29892,
413,
29918,
29920,
29892,
269,
29918,
29920,
29897,
13,
9651,
363,
503,
297,
503,
29918,
24530,
29901,
13,
18884,
343,
29918,
24530,
353,
349,
905,
5627,
3032,
1885,
29918,
513,
1575,
29898,
29875,
29918,
29891,
29892,
413,
29918,
29891,
29892,
269,
29918,
29891,
29897,
13,
18884,
363,
343,
297,
343,
29918,
24530,
29901,
13,
462,
1678,
921,
29918,
24530,
353,
349,
905,
5627,
3032,
1885,
29918,
513,
1575,
29898,
29875,
29918,
29916,
29892,
413,
29918,
29916,
29892,
269,
29918,
29916,
29897,
13,
462,
1678,
363,
921,
297,
921,
29918,
24530,
29901,
13,
462,
4706,
22780,
29918,
13140,
353,
313,
13,
462,
9651,
22780,
29898,
29920,
29892,
503,
718,
413,
29918,
29920,
511,
13,
462,
9651,
22780,
29898,
29891,
29892,
343,
718,
413,
29918,
29891,
511,
13,
462,
9651,
22780,
29898,
29916,
29892,
921,
718,
413,
29918,
29916,
29897,
13,
462,
4706,
1723,
13,
462,
4706,
22780,
29918,
13140,
353,
313,
18337,
29898,
29886,
29892,
282,
29974,
29896,
511,
29897,
718,
22780,
29918,
13140,
396,
16500,
1178,
13,
462,
4706,
269,
29399,
29889,
4397,
29898,
18337,
29918,
13140,
29897,
13,
4706,
736,
269,
29399,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
903,
1885,
29918,
513,
1575,
29898,
29875,
29892,
413,
29892,
269,
1125,
13,
4706,
9995,
13,
4706,
826,
3174,
29901,
13,
9651,
474,
313,
524,
1125,
1967,
2159,
29889,
13,
9651,
413,
313,
524,
1125,
13261,
2159,
29889,
13,
9651,
269,
313,
524,
1125,
380,
2426,
2159,
29889,
13,
4706,
16969,
29901,
13,
9651,
15299,
310,
2243,
2247,
1369,
11909,
13,
4706,
9995,
13,
4706,
4974,
474,
6736,
413,
29892,
525,
17708,
2159,
881,
367,
16600,
1135,
278,
13261,
2159,
29915,
13,
4706,
363,
432,
297,
3464,
29898,
29900,
29892,
474,
448,
413,
718,
29871,
29896,
29892,
269,
1125,
13,
9651,
7709,
432,
13,
4706,
565,
313,
29926,
718,
413,
529,
474,
26927,
29898,
29875,
19216,
29879,
1125,
13,
9651,
7709,
474,
448,
413,
539,
13,
632,
13,
632,
13,
1753,
903,
657,
29918,
5041,
29918,
16409,
29918,
25932,
29898,
1990,
29918,
978,
1125,
13,
1678,
286,
353,
1053,
1982,
29889,
5215,
29918,
5453,
877,
29881,
2075,
29877,
1664,
1495,
13,
1678,
3711,
5617,
353,
679,
5552,
29898,
29885,
29892,
770,
29918,
978,
29897,
13,
1678,
736,
3711,
5617,
13,
13,
13,
1753,
679,
29918,
14968,
29918,
1359,
414,
29898,
2917,
1125,
13,
1678,
9995,
11609,
8600,
6943,
278,
6694,
322,
8845,
2254,
414,
313,
7345,
305,
29889,
13239,
29889,
1272,
29889,
1469,
10036,
467,
13,
268,
13,
1678,
826,
3174,
29901,
13,
4706,
2295,
29901,
263,
2246,
3233,
5285,
1203,
6943,
278,
525,
1359,
414,
29915,
1820,
29889,
13,
268,
13,
1678,
16969,
29901,
9657,
11117,
14968,
2396,
529,
14968,
29918,
12657,
10202,
525,
791,
2396,
529,
791,
29918,
12657,
29958,
6177,
8600,
6943,
278,
6694,
322,
8845,
2254,
414,
29889,
13,
1678,
9995,
13,
1678,
4974,
525,
1359,
414,
29915,
297,
2295,
29892,
525,
23323,
451,
1284,
848,
2254,
414,
5285,
29915,
13,
1678,
2254,
414,
29918,
2917,
353,
2295,
1839,
1359,
414,
2033,
13,
1678,
1596,
6702,
9832,
1218,
6694,
322,
8845,
731,
2254,
414,
856,
1495,
13,
1678,
396,
679,
7945,
322,
8845,
2066,
13,
1678,
3618,
353,
2254,
414,
29918,
2917,
1839,
12650,
2033,
13,
1678,
4974,
338,
8758,
29898,
12650,
29892,
1051,
29897,
13,
1678,
992,
29875,
29918,
12181,
353,
2254,
414,
29918,
2917,
1839,
1365,
29875,
29918,
12181,
2033,
13,
1678,
12124,
290,
29918,
2084,
353,
2254,
414,
29918,
2917,
1839,
27774,
290,
29918,
2084,
2033,
13,
1678,
11105,
29918,
2084,
353,
2254,
414,
29918,
2917,
1839,
13168,
29918,
2084,
2033,
13,
1678,
7945,
29918,
4841,
353,
18761,
29898,
1359,
414,
29918,
2917,
1839,
14968,
29918,
5031,
993,
29918,
4841,
11287,
13,
1678,
7945,
29918,
5041,
353,
18761,
29898,
1359,
414,
29918,
2917,
1839,
14968,
29918,
5041,
11287,
13,
1678,
7945,
29918,
303,
2426,
353,
18761,
29898,
1359,
414,
29918,
2917,
1839,
14968,
29918,
303,
2426,
11287,
13,
1678,
659,
29918,
4841,
353,
18761,
29898,
1359,
414,
29918,
2917,
1839,
791,
29918,
5031,
993,
29918,
4841,
11287,
13,
1678,
659,
29918,
5041,
353,
18761,
29898,
1359,
414,
29918,
2917,
1839,
791,
29918,
5041,
11287,
13,
1678,
659,
29918,
303,
2426,
353,
18761,
29898,
1359,
414,
29918,
2917,
1839,
791,
29918,
303,
2426,
11287,
13,
1678,
4327,
261,
29918,
2917,
353,
2254,
414,
29918,
2917,
1839,
9067,
261,
2033,
13,
1678,
8303,
1336,
353,
2254,
414,
29918,
2917,
1839,
17990,
1336,
2033,
13,
1678,
396,
679,
7945,
22780,
29918,
16409,
29918,
25932,
13,
1678,
7945,
29918,
5041,
29918,
16409,
29918,
710,
353,
2254,
414,
29918,
2917,
29889,
657,
877,
14968,
29918,
5041,
29918,
16409,
742,
525,
29925,
905,
5627,
1495,
13,
1678,
1596,
313,
29888,
29915,
5323,
262,
269,
12856,
770,
29901,
426,
14968,
29918,
5041,
29918,
16409,
29918,
710,
29913,
1495,
13,
1678,
7945,
29918,
5041,
29918,
16409,
29918,
25932,
353,
903,
657,
29918,
5041,
29918,
16409,
29918,
25932,
29898,
14968,
29918,
5041,
29918,
16409,
29918,
710,
29897,
13,
268,
13,
1678,
7945,
29918,
14538,
1691,
353,
5159,
13,
1678,
363,
5446,
297,
3618,
29901,
13,
4706,
3876,
29918,
29881,
4912,
353,
12124,
290,
29918,
2084,
29974,
15972,
18717,
5415,
29974,
8207,
29915,
13,
4706,
3876,
29918,
13168,
353,
11105,
29918,
2084,
29974,
15972,
18717,
5415,
29974,
8207,
29915,
13,
4706,
1018,
29901,
13,
9651,
1596,
313,
29888,
29915,
23456,
6694,
731,
515,
29901,
426,
4632,
29918,
29881,
4912,
29913,
856,
1495,
13,
9651,
7945,
29918,
24713,
353,
13261,
29918,
8452,
29898,
4632,
29918,
29881,
4912,
29892,
3876,
29918,
13168,
29892,
525,
14968,
742,
4327,
261,
29918,
2917,
29892,
29871,
13,
462,
462,
268,
7945,
29918,
4841,
29892,
7945,
29918,
5041,
29892,
7945,
29918,
303,
2426,
29892,
13,
462,
462,
268,
7945,
29918,
5041,
29918,
16409,
29918,
25932,
29892,
992,
29875,
29918,
12181,
29892,
17990,
1336,
29892,
16717,
29918,
9144,
29922,
8516,
29897,
13,
9651,
7945,
29918,
14538,
1691,
29889,
4397,
29898,
14968,
29918,
24713,
29897,
13,
4706,
5174,
8960,
29901,
13,
9651,
1596,
313,
29888,
29915,
29903,
1984,
3262,
6694,
731,
29901,
426,
4632,
29918,
29881,
4912,
29913,
1495,
13,
13,
1678,
396,
679,
659,
22780,
29918,
16409,
29918,
25932,
13,
1678,
659,
29918,
5041,
29918,
16409,
29918,
710,
353,
2254,
414,
29918,
2917,
29889,
657,
877,
791,
29918,
5041,
29918,
16409,
742,
525,
29925,
905,
5627,
1495,
13,
1678,
1596,
313,
29888,
29915,
1440,
13261,
12856,
770,
29901,
426,
791,
29918,
5041,
29918,
16409,
29918,
710,
29913,
1495,
13,
1678,
659,
29918,
5041,
29918,
16409,
29918,
25932,
353,
903,
657,
29918,
5041,
29918,
16409,
29918,
25932,
29898,
791,
29918,
5041,
29918,
16409,
29918,
710,
29897,
13,
13,
1678,
659,
29918,
14538,
1691,
353,
5159,
13,
1678,
363,
5446,
297,
3618,
29901,
13,
4706,
3876,
29918,
29881,
4912,
353,
12124,
290,
29918,
2084,
29974,
15972,
18717,
5415,
29974,
8207,
29915,
13,
4706,
3876,
29918,
13168,
353,
11105,
29918,
2084,
29974,
15972,
18717,
5415,
29974,
8207,
29915,
13,
4706,
1018,
29901,
13,
9651,
1596,
313,
29888,
29915,
23456,
659,
731,
515,
29901,
426,
4632,
29918,
29881,
4912,
29913,
856,
1495,
13,
9651,
659,
29918,
24713,
353,
13261,
29918,
8452,
29898,
4632,
29918,
29881,
4912,
29892,
3876,
29918,
13168,
29892,
525,
791,
742,
4327,
261,
29918,
2917,
29892,
29871,
13,
462,
462,
259,
659,
29918,
4841,
29892,
659,
29918,
5041,
29892,
659,
29918,
303,
2426,
29892,
13,
462,
462,
259,
659,
29918,
5041,
29918,
16409,
29918,
25932,
29892,
992,
29875,
29918,
12181,
29892,
8303,
1336,
29892,
16717,
29918,
9144,
29922,
8516,
29897,
13,
9651,
659,
29918,
14538,
1691,
29889,
4397,
29898,
791,
29918,
24713,
29897,
13,
4706,
5174,
8960,
29901,
13,
9651,
1596,
29898,
29888,
29915,
29903,
1984,
3262,
659,
731,
29901,
426,
4632,
29918,
29881,
4912,
29913,
1495,
13,
13,
1678,
954,
29918,
1287,
414,
353,
2254,
414,
29918,
2917,
29889,
657,
877,
1949,
29918,
1287,
414,
742,
29871,
29896,
29897,
13,
1678,
1596,
313,
29888,
29915,
4557,
310,
17162,
363,
7945,
29914,
791,
1418,
7003,
1664,
29901,
426,
1949,
29918,
1287,
414,
29913,
1495,
13,
1678,
9853,
29918,
2311,
353,
2254,
414,
29918,
2917,
29889,
657,
877,
16175,
29918,
2311,
742,
29871,
29896,
29897,
13,
1678,
1596,
313,
29888,
29915,
23145,
2159,
363,
7945,
29914,
791,
23466,
29901,
426,
16175,
29918,
2311,
29913,
1495,
13,
1678,
7945,
29918,
24713,
29918,
2311,
353,
2254,
414,
29918,
2917,
29889,
657,
877,
14968,
29918,
24713,
29918,
2311,
742,
29871,
29896,
29897,
13,
1678,
7945,
29918,
9502,
29918,
13445,
20069,
353,
16968,
22966,
20069,
29898,
1168,
4117,
16390,
24541,
29898,
14968,
29918,
14538,
1691,
511,
16920,
29922,
5574,
29892,
954,
29918,
27736,
29922,
14968,
29918,
24713,
29918,
2311,
29897,
13,
1678,
736,
11117,
14968,
2396,
3630,
10036,
29898,
1168,
4117,
16390,
24541,
29898,
14968,
29918,
14538,
1691,
511,
9853,
29918,
2311,
29922,
16175,
29918,
2311,
29892,
528,
21897,
29922,
8824,
29892,
3514,
20069,
29922,
14968,
29918,
9502,
29918,
13445,
20069,
29892,
13,
462,
9651,
954,
29918,
1287,
414,
29922,
1949,
29918,
1287,
414,
511,
13,
9651,
525,
791,
2396,
3630,
10036,
29898,
1168,
4117,
16390,
24541,
29898,
791,
29918,
14538,
1691,
511,
9853,
29918,
2311,
29922,
16175,
29918,
2311,
29892,
528,
21897,
29922,
8824,
29892,
954,
29918,
1287,
414,
29922,
1949,
29918,
1287,
414,
29897,
13,
965,
500,
13,
9651,
13,
308,
2
] |
src/code/static_network/globals.py | dvaruas/minority_recommendations | 0 | 43774 | <gh_stars>0
import os
PARAMETERS_PATH = os.path.join(os.path.dirname(__file__), os.pardir, "common", "parameters.ini")
STATIC_DATA_PATH = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir,
"data", "synthetic", "static")
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
2897,
13,
13,
13,
16320,
25797,
4945,
29903,
29918,
10145,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
511,
2897,
29889,
29886,
538,
381,
29892,
376,
9435,
613,
376,
16744,
29889,
2172,
1159,
13,
13,
17816,
2965,
29918,
14573,
29918,
10145,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
511,
2897,
29889,
29886,
538,
381,
29892,
2897,
29889,
29886,
538,
381,
29892,
2897,
29889,
29886,
538,
381,
29892,
13,
1678,
376,
1272,
613,
376,
19274,
386,
7492,
613,
376,
7959,
1159,
13,
2
] |
base/base_trainer.py | yhung119/show-and-tell-image-captioning | 10 | 145888 | import os
import math
import shutil
import torch
from utils import ensure_dir, Early_stopping
class BaseTrainer:
""" Base class for all trainer.
Note:
Modify if you need to change logging style, checkpoint naming, or something else.
"""
def __init__(self, model, loss, vocab, optimizer, epochs,
save_dir, save_freq, eval_freq, resume, verbosity, id, dataset, identifier='', logger=None):
self.model = model
self.loss = loss
self.optimizer = optimizer
self.epochs = epochs
self.min_loss = math.inf
self.vocab = vocab
self.save_dir = save_dir
self.save_freq = save_freq
self.verbosity = verbosity
self.identifier = identifier
self.logger = logger
self.start_epoch = 1
self.dataset = dataset
self.id = id
self.eval_freq = eval_freq
ensure_dir(save_dir)
if resume:
self._resume_checkpoint(resume)
self.early_stop = Early_stopping(patience=3)
def train(self):
for epoch in range(self.start_epoch, self.epochs+1):
result = self._train_epoch(epoch)
# if self.logger:
# log = {'epoch': epoch}
# for key, value in result.items():
# if key == 'metrics':
# for i, metric in enumerate(self.metrics):
# log[metric.__name__] = result['metrics'][i]
# elif key == 'val_metrics':
# for i, metric in enumerate(self.metrics):
# log['val_'+metric.__name__] = result['val_metrics'][i]
# else:
# log[key] = value
# self.logger.add_entry(log)
# if self.verbosity >= 1:
# print(log)
if epoch % self.save_freq == 0:
self._save_checkpoint(epoch, result['loss'])
self.early_stop.update(result["coco_stat"]["Bleu_4"])
if self.early_stop.stop():
break
def _train_epoch(self, epoch):
raise NotImplementedError
def _valid_epoch(self, epoch):
raise NotImplementedError
def _save_checkpoint(self, epoch, loss):
if loss < self.min_loss:
self.min_loss = loss
arch = type(self.model).__name__
state = {
'epoch': epoch,
'logger': self.logger,
'arch': arch,
'state_dict': self.model.state_dict(),
'optimizer': self.optimizer.state_dict(),
'min_loss': self.min_loss,
}
id_filename = str(self.id) + '_/'
id_file_path = self.save_dir + '/' + id_filename + 'checkpoints/'
ensure_dir(id_file_path)
filename = os.path.join(id_file_path,
self.identifier + 'checkpoint_epoch{:02d}_loss_{:.5f}.pth.tar'.format(epoch, loss))
print("Saving checkpoint: {} ...".format(filename))
torch.save(state, filename)
if loss == self.min_loss:
shutil.copyfile(filename, os.path.join(self.save_dir, 'model_best.pth.tar'))
def _resume_checkpoint(self, resume_path):
print("Loading checkpoint: {} ...".format(resume_path))
checkpoint = torch.load(resume_path)
self.start_epoch = checkpoint['epoch'] + 1
self.min_loss = checkpoint['min_loss']
self.model.load_state_dict(checkpoint['state_dict'])
self.optimizer.load_state_dict(checkpoint['optimizer'])
self.logger = checkpoint['logger']
print("Checkpoint '{}' (epoch {}) loaded".format(resume_path, self.start_epoch))
| [
1,
1053,
2897,
13,
5215,
5844,
13,
5215,
528,
4422,
13,
5215,
4842,
305,
13,
3166,
3667,
29879,
1053,
9801,
29918,
3972,
29892,
11095,
29918,
7864,
3262,
13,
13,
13,
1990,
7399,
5323,
4983,
29901,
13,
1678,
9995,
7399,
770,
363,
599,
1020,
4983,
29889,
13,
13,
1678,
3940,
29901,
13,
4706,
3382,
1598,
565,
366,
817,
304,
1735,
12183,
3114,
29892,
1423,
3149,
22006,
29892,
470,
1554,
1683,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1904,
29892,
6410,
29892,
7931,
370,
29892,
5994,
3950,
29892,
21502,
12168,
29892,
13,
462,
4078,
29918,
3972,
29892,
4078,
29918,
29888,
7971,
29892,
19745,
29918,
29888,
7971,
29892,
620,
2017,
29892,
9750,
359,
537,
29892,
1178,
29892,
8783,
29892,
15882,
2433,
742,
17927,
29922,
8516,
1125,
13,
4706,
1583,
29889,
4299,
353,
1904,
13,
4706,
1583,
29889,
6758,
353,
6410,
13,
4706,
1583,
29889,
20640,
3950,
353,
5994,
3950,
13,
4706,
1583,
29889,
1022,
2878,
29879,
353,
21502,
12168,
13,
4706,
1583,
29889,
1195,
29918,
6758,
353,
5844,
29889,
7192,
13,
4706,
1583,
29889,
29894,
542,
370,
353,
7931,
370,
13,
4706,
1583,
29889,
7620,
29918,
3972,
353,
4078,
29918,
3972,
13,
4706,
1583,
29889,
7620,
29918,
29888,
7971,
353,
4078,
29918,
29888,
7971,
13,
4706,
1583,
29889,
18248,
359,
537,
353,
9750,
359,
537,
13,
4706,
1583,
29889,
25378,
353,
15882,
13,
4706,
1583,
29889,
21707,
353,
17927,
13,
4706,
1583,
29889,
2962,
29918,
1022,
2878,
353,
29871,
29896,
13,
4706,
1583,
29889,
24713,
353,
8783,
13,
4706,
1583,
29889,
333,
353,
1178,
13,
4706,
1583,
29889,
14513,
29918,
29888,
7971,
353,
19745,
29918,
29888,
7971,
13,
4706,
9801,
29918,
3972,
29898,
7620,
29918,
3972,
29897,
13,
4706,
565,
620,
2017,
29901,
13,
9651,
1583,
3032,
690,
2017,
29918,
3198,
3149,
29898,
690,
2017,
29897,
13,
4706,
1583,
29889,
799,
368,
29918,
9847,
353,
11095,
29918,
7864,
3262,
29898,
29886,
24701,
29922,
29941,
29897,
13,
13,
13,
13,
1678,
822,
7945,
29898,
1311,
1125,
13,
4706,
363,
21502,
305,
297,
3464,
29898,
1311,
29889,
2962,
29918,
1022,
2878,
29892,
1583,
29889,
1022,
2878,
29879,
29974,
29896,
1125,
13,
9651,
1121,
353,
1583,
3032,
14968,
29918,
1022,
2878,
29898,
1022,
2878,
29897,
13,
9651,
396,
565,
1583,
29889,
21707,
29901,
13,
9651,
396,
268,
1480,
353,
11117,
1022,
2878,
2396,
21502,
305,
29913,
13,
9651,
396,
268,
363,
1820,
29892,
995,
297,
1121,
29889,
7076,
7295,
13,
9651,
396,
308,
565,
1820,
1275,
525,
2527,
10817,
2396,
13,
9651,
396,
632,
363,
474,
29892,
12714,
297,
26985,
29898,
1311,
29889,
2527,
10817,
1125,
13,
9651,
396,
462,
1480,
29961,
16414,
17255,
978,
1649,
29962,
353,
1121,
1839,
2527,
10817,
2033,
29961,
29875,
29962,
13,
9651,
396,
308,
25342,
1820,
1275,
525,
791,
29918,
2527,
10817,
2396,
13,
9651,
396,
632,
363,
474,
29892,
12714,
297,
26985,
29898,
1311,
29889,
2527,
10817,
1125,
13,
9651,
396,
462,
1480,
1839,
791,
29918,
18717,
16414,
17255,
978,
1649,
29962,
353,
1121,
1839,
791,
29918,
2527,
10817,
2033,
29961,
29875,
29962,
13,
9651,
396,
308,
1683,
29901,
13,
9651,
396,
632,
1480,
29961,
1989,
29962,
353,
995,
13,
9651,
396,
268,
1583,
29889,
21707,
29889,
1202,
29918,
8269,
29898,
1188,
29897,
13,
9651,
396,
268,
565,
1583,
29889,
18248,
359,
537,
6736,
29871,
29896,
29901,
13,
9651,
396,
308,
1596,
29898,
1188,
29897,
13,
9651,
565,
21502,
305,
1273,
1583,
29889,
7620,
29918,
29888,
7971,
1275,
29871,
29900,
29901,
13,
18884,
1583,
3032,
7620,
29918,
3198,
3149,
29898,
1022,
2878,
29892,
1121,
1839,
6758,
11287,
13,
632,
13,
9651,
1583,
29889,
799,
368,
29918,
9847,
29889,
5504,
29898,
2914,
3366,
29883,
6235,
29918,
6112,
3108,
3366,
29933,
280,
29884,
29918,
29946,
20068,
13,
9651,
565,
1583,
29889,
799,
368,
29918,
9847,
29889,
9847,
7295,
13,
18884,
2867,
13,
13,
13,
1678,
822,
903,
14968,
29918,
1022,
2878,
29898,
1311,
29892,
21502,
305,
1125,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
1678,
822,
903,
3084,
29918,
1022,
2878,
29898,
1311,
29892,
21502,
305,
1125,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
1678,
822,
903,
7620,
29918,
3198,
3149,
29898,
1311,
29892,
21502,
305,
29892,
6410,
1125,
13,
4706,
565,
6410,
529,
1583,
29889,
1195,
29918,
6758,
29901,
13,
9651,
1583,
29889,
1195,
29918,
6758,
353,
6410,
13,
4706,
3190,
353,
1134,
29898,
1311,
29889,
4299,
467,
1649,
978,
1649,
13,
4706,
2106,
353,
426,
13,
9651,
525,
1022,
2878,
2396,
21502,
305,
29892,
13,
9651,
525,
21707,
2396,
1583,
29889,
21707,
29892,
13,
9651,
525,
1279,
2396,
3190,
29892,
13,
9651,
525,
3859,
29918,
8977,
2396,
1583,
29889,
4299,
29889,
3859,
29918,
8977,
3285,
13,
9651,
525,
20640,
3950,
2396,
1583,
29889,
20640,
3950,
29889,
3859,
29918,
8977,
3285,
13,
9651,
525,
1195,
29918,
6758,
2396,
1583,
29889,
1195,
29918,
6758,
29892,
13,
4706,
500,
13,
4706,
1178,
29918,
9507,
353,
851,
29898,
1311,
29889,
333,
29897,
718,
22868,
22208,
13,
4706,
1178,
29918,
1445,
29918,
2084,
353,
1583,
29889,
7620,
29918,
3972,
718,
8207,
29915,
718,
1178,
29918,
9507,
718,
525,
3198,
9748,
22208,
13,
4706,
9801,
29918,
3972,
29898,
333,
29918,
1445,
29918,
2084,
29897,
13,
4706,
10422,
353,
2897,
29889,
2084,
29889,
7122,
29898,
333,
29918,
1445,
29918,
2084,
29892,
13,
462,
18884,
1583,
29889,
25378,
718,
525,
3198,
3149,
29918,
1022,
2878,
25641,
29900,
29906,
29881,
2403,
6758,
648,
29901,
29889,
29945,
29888,
1836,
29886,
386,
29889,
12637,
4286,
4830,
29898,
1022,
2878,
29892,
6410,
876,
13,
4706,
1596,
703,
29903,
5555,
1423,
3149,
29901,
6571,
2023,
1642,
4830,
29898,
9507,
876,
13,
4706,
4842,
305,
29889,
7620,
29898,
3859,
29892,
10422,
29897,
13,
4706,
565,
6410,
1275,
1583,
29889,
1195,
29918,
6758,
29901,
13,
9651,
528,
4422,
29889,
8552,
1445,
29898,
9507,
29892,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
7620,
29918,
3972,
29892,
525,
4299,
29918,
13318,
29889,
29886,
386,
29889,
12637,
8785,
13,
13,
1678,
822,
903,
690,
2017,
29918,
3198,
3149,
29898,
1311,
29892,
620,
2017,
29918,
2084,
1125,
13,
4706,
1596,
703,
23456,
1423,
3149,
29901,
6571,
2023,
1642,
4830,
29898,
690,
2017,
29918,
2084,
876,
13,
4706,
1423,
3149,
353,
4842,
305,
29889,
1359,
29898,
690,
2017,
29918,
2084,
29897,
13,
4706,
1583,
29889,
2962,
29918,
1022,
2878,
353,
1423,
3149,
1839,
1022,
2878,
2033,
718,
29871,
29896,
13,
4706,
1583,
29889,
1195,
29918,
6758,
353,
1423,
3149,
1839,
1195,
29918,
6758,
2033,
13,
4706,
1583,
29889,
4299,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
3198,
3149,
1839,
3859,
29918,
8977,
11287,
13,
4706,
1583,
29889,
20640,
3950,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
3198,
3149,
1839,
20640,
3950,
11287,
13,
4706,
1583,
29889,
21707,
353,
1423,
3149,
1839,
21707,
2033,
13,
4706,
1596,
703,
5596,
3149,
525,
8875,
29915,
313,
1022,
2878,
426,
1800,
7500,
1642,
4830,
29898,
690,
2017,
29918,
2084,
29892,
1583,
29889,
2962,
29918,
1022,
2878,
876,
13,
2
] |
code/testbed/pde1/FemPde1.py | nicolai-schwartze/Masterthesis | 1 | 3954 | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 13 14:57:32 2020
@author: Nicolai
"""
import sys
import os
importpath = os.path.dirname(os.path.realpath(__file__)) + "/../"
sys.path.append(importpath)
from FemPdeBase import FemPdeBase
import numpy as np
# import from ngsolve
import ngsolve as ngs
from netgen.geom2d import unit_square
import time
import psutil
import gc
class FemPde1(FemPdeBase):
"""
**Implementation of PDE1 of the testbed:**
.. math::
- \Delta u(\mathbf{x}) = -2^{40}y^{10}(1-y)^{10}[90x^8(1-x)^{10}
- 200x^9(1-x)^9 + 90x^{10}(1-x)^8]
-2^{40}x^{10}(1-x)^{10}[90y^8(1-y)^{10}
- 200y^9(1-y)^9 + 90y^{10}(1-y)^8]
\Omega: \mathbf{x} \in [0,1]
u(\mathbf{x})|_{\partial \Omega} = 0
**with the solution:**
.. math::
u(\mathbf{x}) = 2^{40}x^{10}(1-x)^{10}y^{10}(1-y)^{10}
Attributes
----------
max_nodf: int
the maximum number of degrees of freedom that can be created in the
adaptive mesh refinement, standard value is 50000
Methods
-------
solve()
solves the pde by calling ngsolve, provides: static condensation,
adaptive mesh refinement, parallelisation (where possible), sets the
internal variables for evaluating the exact solution and calculating
the distance between exact and approx solution
also sets execution time and memory consumption
Examples
--------
>>> import numpy as np
>>> fempde2 = FemPde2(True)
>>> pos = np.array([0.5, 0.5])
>>> fempde2.exact(pos)
>>> x -> numpy.ndarray with shape (2,)
_mesh -> ngs.comp.Mesh
_ngs_ex -> ngs.fem.CoefficientFunction
-> try to call solve() first
>>> fempde2.solve()
>>> fempde2.exact(pos)
1.0
>>> fempde2.approx(pos)
0.999998924259486
>>> fempde2.normL2()
5.853102150391562e-07
>>> fempde2.exec_time
3.830256175994873
>>> fempde2.mem_consumption
76705792
"""
def __init__(self, show_gui, max_ndof=50000):
super().__init__(show_gui)
# init protected
self._pde_string = "-laplacian(u(x)) = -(2^40*y^10*(1-y)^10*(90*x^8*(1-x)^10 - 200*x^9*(1-x)^9 + 90*x^10*(1-x)^8)) -(2^40*x^10*(1-x)^10*(90*y^8*(1-y)^10 - 200*y^9*(1-y)^9 + 90*y^10*(1-y)^8))"
self._ngs_ex = (2**(4*10))*(ngs.x**10)*((1-ngs.x)**10)*(ngs.y**10)*((1-ngs.y)**10)
# init public
self.max_ndof = max_ndof
def solve(self):
# disable garbage collector
# --------------------------------------------------------------------#
gc.disable()
while(gc.isenabled()):
time.sleep(0.1)
# --------------------------------------------------------------------#
# measure how much memory is used until here
process = psutil.Process()
memstart = process.memory_info().vms
# starts timer
tstart = time.time()
if self.show_gui:
import netgen.gui
# create mesh with initial size 0.1
self._mesh = ngs.Mesh(unit_square.GenerateMesh(maxh=0.1))
#create finite element space
self._fes = ngs.H1(self._mesh, order=2, dirichlet=".*", autoupdate=True)
# test and trail function
u = self._fes.TrialFunction()
v = self._fes.TestFunction()
# create bilinear form and enable static condensation
self._a = ngs.BilinearForm(self._fes, condense=True)
self._a += ngs.grad(u)*ngs.grad(v)*ngs.dx
# creat linear functional and apply RHS
self._f = ngs.LinearForm(self._fes)
self._f += ( \
-(2**40*ngs.y**10*(1-ngs.y)**10*(90*ngs.x**8*(1-ngs.x)**10 - 200*ngs.x**9*(1-ngs.x)**9 + 90*ngs.x**10*(1-ngs.x)**8)) \
-(2**40*ngs.x**10*(1-ngs.x)**10*(90*ngs.y**8*(1-ngs.y)**10 - 200*ngs.y**9*(1-ngs.y)**9 + 90*ngs.y**10*(1-ngs.y)**8)) )*v*ngs.dx
# preconditioner: multigrid - what prerequisits must the problem have?
self._c = ngs.Preconditioner(self._a,"multigrid")
# create grid function that holds the solution and set the boundary to 0
self._gfu = ngs.GridFunction(self._fes, autoupdate=True) # solution
self._g = 0.0
self._gfu.Set(self._g, definedon=self._mesh.Boundaries(".*"))
# draw grid function in gui
if self.show_gui:
ngs.Draw(self._gfu)
# create Hcurl space for flux calculation and estimate error
self._space_flux = ngs.HDiv(self._mesh, order=2, autoupdate=True)
self._gf_flux = ngs.GridFunction(self._space_flux, "flux", autoupdate=True)
# TaskManager starts threads that (standard thread nr is numer of cores)
with ngs.TaskManager():
# this is the adaptive loop
while self._fes.ndof < self.max_ndof:
self._solveStep()
self._estimateError()
self._mesh.Refine()
# since the adaptive loop stopped with a mesh refinement, the gfu must be
# calculated one last time
self._solveStep()
if self.show_gui:
ngs.Draw(self._gfu)
# set measured exectution time
self._exec_time = time.time() - tstart
# set measured used memory
memstop = process.memory_info().vms - memstart
self._mem_consumption = memstop
# enable garbage collector
# --------------------------------------------------------------------#
gc.enable()
gc.collect()
# --------------------------------------------------------------------#
if __name__ == "__main__":
fempde1 = FemPde1(True)
print(fempde1.pde_string)
try:
fempde1.exact(np.array([0.5,0.5]))
except:
print("Î error message above")
try:
fempde1.approx(np.array([0.5,0.5]))
except:
print("Î error message above")
fempde1.solve()
print("-------------------------------------")
print("exact(0.5, 0.5) = {}".format(fempde1.exact(np.array([0.5,0.5]))))
print("approx(0.5, 0.5) = {}".format(fempde1.approx(np.array([0.5,0.5]))))
print("L2 norm to the real solution {}".format(fempde1.normL2()))
print("solving took {} sec".format(fempde1.exec_time))
print("solving uses {} Mb".format(fempde1.mem_consumption/1000000))
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x = y = np.arange(0, 1.01, 0.01)
X, Y = np.meshgrid(x, y)
zs0 = np.array([fempde1.exact(\
np.array([x,y])) for x,y in zip(np.ravel(X), np.ravel(Y))])
Z = zs0.reshape(X.shape)
ax.plot_surface(X, Y, Z, cmap=cm.gnuplot)
fig.tight_layout()
ax.set_xlabel("X0")
ax.set_ylabel("X1")
ax.set_zlabel("f(X0, X1)")
plt.show()
fig.savefig("sol_pde_1.pdf", bbox_inches='tight')
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x = y = np.arange(0, 1.01, 0.01)
X, Y = np.meshgrid(x, y)
zs0 = np.array([fempde1.approx(\
np.array([x,y])) for x,y in zip(np.ravel(X), np.ravel(Y))])
Z = zs0.reshape(X.shape)
ax.plot_surface(X, Y, Z, cmap=cm.gnuplot)
ax.set_xlabel("X0")
ax.set_ylabel("X1")
ax.set_zlabel("f(X0,X1)")
plt.show()
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
20399,
373,
2598,
319,
558,
29871,
29896,
29941,
29871,
29896,
29946,
29901,
29945,
29955,
29901,
29941,
29906,
29871,
29906,
29900,
29906,
29900,
13,
13,
29992,
8921,
29901,
13488,
1794,
13,
15945,
29908,
13,
13,
5215,
10876,
13,
5215,
2897,
13,
5215,
2084,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
6370,
2084,
22168,
1445,
1649,
876,
718,
5591,
6995,
29908,
13,
9675,
29889,
2084,
29889,
4397,
29898,
5215,
2084,
29897,
13,
3166,
19361,
29925,
311,
5160,
1053,
19361,
29925,
311,
5160,
13,
5215,
12655,
408,
7442,
13,
13,
29937,
1053,
515,
8736,
2929,
345,
13,
5215,
8736,
2929,
345,
408,
302,
3174,
13,
3166,
7787,
1885,
29889,
479,
290,
29906,
29881,
1053,
5190,
29918,
17619,
13,
13,
5215,
931,
13,
5215,
6529,
4422,
13,
5215,
330,
29883,
13,
13,
1990,
19361,
29925,
311,
29896,
29898,
29943,
331,
29925,
311,
5160,
1125,
13,
1678,
9995,
13,
1678,
3579,
1888,
14607,
310,
349,
2287,
29896,
310,
278,
1243,
2580,
29901,
1068,
29871,
13,
308,
13,
1678,
6317,
5844,
1057,
29871,
13,
4706,
448,
320,
5268,
318,
1194,
2762,
29912,
29916,
1800,
353,
448,
29906,
998,
29946,
29900,
29913,
29891,
998,
29896,
29900,
2119,
29896,
29899,
29891,
8940,
29896,
29900,
4400,
29929,
29900,
29916,
29985,
29947,
29898,
29896,
29899,
29916,
8940,
29896,
29900,
29913,
29871,
13,
308,
13,
4706,
448,
29871,
29906,
29900,
29900,
29916,
29985,
29929,
29898,
29896,
29899,
29916,
4887,
29929,
718,
29871,
29929,
29900,
29916,
998,
29896,
29900,
2119,
29896,
29899,
29916,
4887,
29947,
29962,
29871,
13,
308,
13,
4706,
448,
29906,
998,
29946,
29900,
29913,
29916,
998,
29896,
29900,
2119,
29896,
29899,
29916,
8940,
29896,
29900,
4400,
29929,
29900,
29891,
29985,
29947,
29898,
29896,
29899,
29891,
8940,
29896,
29900,
29913,
29871,
13,
308,
13,
4706,
448,
29871,
29906,
29900,
29900,
29891,
29985,
29929,
29898,
29896,
29899,
29891,
4887,
29929,
718,
29871,
29929,
29900,
29891,
998,
29896,
29900,
2119,
29896,
29899,
29891,
4887,
29947,
29962,
13,
308,
13,
4706,
320,
5981,
29901,
320,
2762,
29912,
29916,
29913,
320,
262,
518,
29900,
29892,
29896,
29962,
13,
308,
13,
4706,
318,
1194,
2762,
29912,
29916,
1800,
29989,
1665,
3846,
320,
5981,
29913,
353,
29871,
29900,
13,
268,
13,
1678,
3579,
2541,
278,
1650,
29901,
1068,
29871,
13,
308,
13,
1678,
6317,
5844,
1057,
29871,
13,
4706,
318,
1194,
2762,
29912,
29916,
1800,
353,
29871,
29906,
998,
29946,
29900,
29913,
29916,
998,
29896,
29900,
2119,
29896,
29899,
29916,
8940,
29896,
29900,
29913,
29891,
998,
29896,
29900,
2119,
29896,
29899,
29891,
8940,
29896,
29900,
29913,
13,
308,
13,
308,
13,
1678,
6212,
5026,
13,
1678,
448,
1378,
29899,
13,
1678,
4236,
29918,
29876,
397,
29888,
29901,
938,
13,
4706,
278,
7472,
1353,
310,
14496,
310,
16082,
393,
508,
367,
2825,
297,
278,
29871,
13,
4706,
7744,
573,
27716,
2143,
262,
882,
29892,
3918,
995,
338,
29871,
29945,
29900,
29900,
29900,
29900,
13,
308,
13,
1678,
8108,
29879,
13,
1678,
448,
22158,
13,
1678,
4505,
580,
13,
4706,
24307,
278,
282,
311,
491,
5432,
8736,
2929,
345,
29892,
8128,
29901,
2294,
2148,
575,
362,
29892,
29871,
13,
4706,
7744,
573,
27716,
2143,
262,
882,
29892,
8943,
4371,
313,
3062,
1950,
511,
6166,
278,
29871,
13,
4706,
7463,
3651,
363,
6161,
1218,
278,
2684,
1650,
322,
25202,
29871,
13,
4706,
278,
5418,
1546,
2684,
322,
2134,
29916,
1650,
13,
4706,
884,
6166,
8225,
931,
322,
3370,
27430,
13,
308,
13,
1678,
1222,
9422,
13,
1678,
448,
26589,
13,
1678,
8653,
1053,
12655,
408,
7442,
13,
1678,
8653,
285,
3451,
311,
29906,
353,
19361,
29925,
311,
29906,
29898,
5574,
29897,
13,
1678,
8653,
926,
353,
7442,
29889,
2378,
4197,
29900,
29889,
29945,
29892,
29871,
29900,
29889,
29945,
2314,
13,
1678,
8653,
285,
3451,
311,
29906,
29889,
735,
627,
29898,
1066,
29897,
13,
1678,
8653,
921,
1599,
12655,
29889,
299,
2378,
411,
8267,
313,
29906,
29892,
29897,
29871,
13,
4706,
903,
4467,
29882,
1599,
302,
3174,
29889,
2388,
29889,
29924,
12094,
29871,
13,
4706,
903,
865,
29879,
29918,
735,
1599,
302,
3174,
29889,
29888,
331,
29889,
29907,
7297,
4543,
6678,
29871,
13,
4706,
1599,
1018,
304,
1246,
4505,
580,
937,
13,
1678,
8653,
285,
3451,
311,
29906,
29889,
2929,
345,
580,
13,
1678,
8653,
285,
3451,
311,
29906,
29889,
735,
627,
29898,
1066,
29897,
13,
308,
29896,
29889,
29900,
13,
1678,
8653,
285,
3451,
311,
29906,
29889,
14850,
29898,
1066,
29897,
13,
308,
29900,
29889,
29929,
29929,
29929,
29929,
29929,
29947,
29929,
29906,
29946,
29906,
29945,
29929,
29946,
29947,
29953,
13,
1678,
8653,
285,
3451,
311,
29906,
29889,
12324,
29931,
29906,
580,
13,
308,
29945,
29889,
29947,
29945,
29941,
29896,
29900,
29906,
29896,
29945,
29900,
29941,
29929,
29896,
29945,
29953,
29906,
29872,
29899,
29900,
29955,
13,
1678,
8653,
285,
3451,
311,
29906,
29889,
4258,
29918,
2230,
13,
308,
29941,
29889,
29947,
29941,
29900,
29906,
29945,
29953,
29896,
29955,
29945,
29929,
29929,
29946,
29947,
29955,
29941,
13,
1678,
8653,
285,
3451,
311,
29906,
29889,
6954,
29918,
25978,
683,
13,
308,
29955,
29953,
29955,
29900,
29945,
29955,
29929,
29906,
13,
1678,
9995,
13,
268,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1510,
29918,
23569,
29892,
4236,
29918,
299,
974,
29922,
29945,
29900,
29900,
29900,
29900,
1125,
13,
4706,
2428,
2141,
1649,
2344,
12035,
4294,
29918,
23569,
29897,
13,
308,
13,
4706,
396,
2069,
6364,
13,
4706,
1583,
3032,
29886,
311,
29918,
1807,
353,
11663,
6984,
433,
28445,
29898,
29884,
29898,
29916,
876,
353,
19691,
29906,
29985,
29946,
29900,
29930,
29891,
29985,
29896,
29900,
16395,
29896,
29899,
29891,
4887,
29896,
29900,
16395,
29929,
29900,
29930,
29916,
29985,
29947,
16395,
29896,
29899,
29916,
4887,
29896,
29900,
448,
29871,
29906,
29900,
29900,
29930,
29916,
29985,
29929,
16395,
29896,
29899,
29916,
4887,
29929,
718,
29871,
29929,
29900,
29930,
29916,
29985,
29896,
29900,
16395,
29896,
29899,
29916,
4887,
29947,
876,
19691,
29906,
29985,
29946,
29900,
29930,
29916,
29985,
29896,
29900,
16395,
29896,
29899,
29916,
4887,
29896,
29900,
16395,
29929,
29900,
29930,
29891,
29985,
29947,
16395,
29896,
29899,
29891,
4887,
29896,
29900,
448,
29871,
29906,
29900,
29900,
29930,
29891,
29985,
29929,
16395,
29896,
29899,
29891,
4887,
29929,
718,
29871,
29929,
29900,
29930,
29891,
29985,
29896,
29900,
16395,
29896,
29899,
29891,
4887,
29947,
876,
29908,
13,
4706,
1583,
3032,
865,
29879,
29918,
735,
353,
313,
29906,
1068,
29898,
29946,
29930,
29896,
29900,
876,
16395,
865,
29879,
29889,
29916,
1068,
29896,
29900,
11877,
3552,
29896,
29899,
865,
29879,
29889,
29916,
29897,
1068,
29896,
29900,
11877,
29898,
865,
29879,
29889,
29891,
1068,
29896,
29900,
11877,
3552,
29896,
29899,
865,
29879,
29889,
29891,
29897,
1068,
29896,
29900,
29897,
13,
308,
13,
4706,
396,
2069,
970,
13,
4706,
1583,
29889,
3317,
29918,
299,
974,
353,
4236,
29918,
299,
974,
13,
308,
13,
308,
13,
268,
13,
1678,
822,
4505,
29898,
1311,
1125,
29871,
13,
308,
13,
4706,
396,
11262,
25861,
6314,
272,
29871,
13,
4706,
396,
448,
2683,
2683,
2683,
2683,
5634,
29937,
13,
4706,
330,
29883,
29889,
20472,
580,
13,
4706,
1550,
29898,
27354,
29889,
7674,
3606,
580,
1125,
13,
9651,
931,
29889,
17059,
29898,
29900,
29889,
29896,
29897,
13,
4706,
396,
448,
2683,
2683,
2683,
2683,
5634,
29937,
13,
308,
13,
4706,
396,
5645,
920,
1568,
3370,
338,
1304,
2745,
1244,
13,
4706,
1889,
353,
6529,
4422,
29889,
7032,
580,
13,
4706,
2626,
2962,
353,
1889,
29889,
14834,
29918,
3888,
2141,
29894,
1516,
13,
308,
13,
4706,
396,
8665,
12237,
13,
4706,
260,
2962,
353,
931,
29889,
2230,
580,
13,
4706,
565,
1583,
29889,
4294,
29918,
23569,
29901,
13,
9651,
1053,
7787,
1885,
29889,
23569,
13,
308,
13,
4706,
396,
1653,
27716,
411,
2847,
2159,
29871,
29900,
29889,
29896,
13,
4706,
1583,
3032,
4467,
29882,
353,
302,
3174,
29889,
29924,
12094,
29898,
5441,
29918,
17619,
29889,
5631,
403,
29924,
12094,
29898,
3317,
29882,
29922,
29900,
29889,
29896,
876,
13,
308,
13,
4706,
396,
3258,
8093,
1543,
2913,
13,
4706,
1583,
3032,
29888,
267,
353,
302,
3174,
29889,
29950,
29896,
29898,
1311,
3032,
4467,
29882,
29892,
1797,
29922,
29906,
29892,
4516,
436,
1026,
543,
5575,
613,
1120,
1132,
1256,
29922,
5574,
29897,
13,
308,
13,
4706,
396,
1243,
322,
26203,
740,
13,
4706,
318,
353,
1583,
3032,
29888,
267,
29889,
29911,
9315,
6678,
580,
13,
4706,
325,
353,
1583,
3032,
29888,
267,
29889,
3057,
6678,
580,
13,
308,
13,
4706,
396,
1653,
13181,
457,
279,
883,
322,
9025,
2294,
2148,
575,
362,
13,
4706,
1583,
3032,
29874,
353,
302,
3174,
29889,
29933,
309,
457,
279,
2500,
29898,
1311,
3032,
29888,
267,
29892,
378,
1145,
344,
29922,
5574,
29897,
13,
4706,
1583,
3032,
29874,
4619,
302,
3174,
29889,
5105,
29898,
29884,
11877,
865,
29879,
29889,
5105,
29898,
29894,
11877,
865,
29879,
29889,
8235,
13,
268,
13,
4706,
396,
907,
271,
5608,
13303,
322,
3394,
390,
14851,
13,
4706,
1583,
3032,
29888,
353,
302,
3174,
29889,
12697,
2500,
29898,
1311,
3032,
29888,
267,
29897,
13,
4706,
1583,
3032,
29888,
4619,
313,
320,
13,
4706,
19691,
29906,
1068,
29946,
29900,
29930,
865,
29879,
29889,
29891,
1068,
29896,
29900,
16395,
29896,
29899,
865,
29879,
29889,
29891,
29897,
1068,
29896,
29900,
16395,
29929,
29900,
29930,
865,
29879,
29889,
29916,
1068,
29947,
16395,
29896,
29899,
865,
29879,
29889,
29916,
29897,
1068,
29896,
29900,
448,
29871,
29906,
29900,
29900,
29930,
865,
29879,
29889,
29916,
1068,
29929,
16395,
29896,
29899,
865,
29879,
29889,
29916,
29897,
1068,
29929,
718,
29871,
29929,
29900,
29930,
865,
29879,
29889,
29916,
1068,
29896,
29900,
16395,
29896,
29899,
865,
29879,
29889,
29916,
29897,
1068,
29947,
876,
320,
13,
4706,
19691,
29906,
1068,
29946,
29900,
29930,
865,
29879,
29889,
29916,
1068,
29896,
29900,
16395,
29896,
29899,
865,
29879,
29889,
29916,
29897,
1068,
29896,
29900,
16395,
29929,
29900,
29930,
865,
29879,
29889,
29891,
1068,
29947,
16395,
29896,
29899,
865,
29879,
29889,
29891,
29897,
1068,
29896,
29900,
448,
29871,
29906,
29900,
29900,
29930,
865,
29879,
29889,
29891,
1068,
29929,
16395,
29896,
29899,
865,
29879,
29889,
29891,
29897,
1068,
29929,
718,
29871,
29929,
29900,
29930,
865,
29879,
29889,
29891,
1068,
29896,
29900,
16395,
29896,
29899,
865,
29879,
29889,
29891,
29897,
1068,
29947,
876,
1723,
29930,
29894,
29930,
865,
29879,
29889,
8235,
13,
308,
13,
4706,
396,
758,
16122,
261,
29901,
1773,
335,
2429,
448,
825,
544,
406,
7680,
1169,
1818,
278,
1108,
505,
29973,
29871,
13,
4706,
1583,
3032,
29883,
353,
302,
3174,
29889,
6572,
16122,
261,
29898,
1311,
3032,
29874,
1699,
4713,
335,
2429,
1159,
13,
308,
13,
4706,
396,
1653,
6856,
740,
393,
8640,
278,
1650,
322,
731,
278,
10452,
304,
29871,
29900,
13,
4706,
1583,
3032,
29887,
21154,
353,
302,
3174,
29889,
5756,
6678,
29898,
1311,
3032,
29888,
267,
29892,
1120,
1132,
1256,
29922,
5574,
29897,
29871,
396,
1650,
29871,
13,
4706,
1583,
3032,
29887,
353,
29871,
29900,
29889,
29900,
13,
4706,
1583,
3032,
29887,
21154,
29889,
2697,
29898,
1311,
3032,
29887,
29892,
3342,
265,
29922,
1311,
3032,
4467,
29882,
29889,
17109,
4314,
703,
5575,
5783,
13,
308,
13,
4706,
396,
4216,
6856,
740,
297,
1410,
29875,
13,
4706,
565,
1583,
29889,
4294,
29918,
23569,
29901,
13,
9651,
302,
3174,
29889,
8537,
29898,
1311,
3032,
29887,
21154,
29897,
13,
308,
13,
4706,
396,
1653,
379,
18963,
2913,
363,
19389,
13944,
322,
12678,
1059,
13,
4706,
1583,
3032,
3493,
29918,
1579,
1314,
353,
302,
3174,
29889,
29950,
12596,
29898,
1311,
3032,
4467,
29882,
29892,
1797,
29922,
29906,
29892,
1120,
1132,
1256,
29922,
5574,
29897,
13,
4706,
1583,
3032,
29887,
29888,
29918,
1579,
1314,
353,
302,
3174,
29889,
5756,
6678,
29898,
1311,
3032,
3493,
29918,
1579,
1314,
29892,
376,
1579,
1314,
613,
1120,
1132,
1256,
29922,
5574,
29897,
13,
308,
13,
4706,
396,
9330,
3260,
8665,
9717,
393,
313,
15770,
3244,
17114,
338,
4825,
310,
28337,
29897,
13,
4706,
411,
302,
3174,
29889,
5398,
3260,
7295,
13,
9651,
396,
445,
338,
278,
7744,
573,
2425,
13,
9651,
1550,
1583,
3032,
29888,
267,
29889,
299,
974,
529,
1583,
29889,
3317,
29918,
299,
974,
29901,
13,
18884,
1583,
3032,
2929,
345,
14448,
580,
13,
18884,
1583,
3032,
342,
6490,
2392,
580,
13,
18884,
1583,
3032,
4467,
29882,
29889,
5620,
457,
580,
13,
308,
13,
4706,
396,
1951,
278,
7744,
573,
2425,
11084,
411,
263,
27716,
2143,
262,
882,
29892,
278,
330,
21154,
1818,
367,
29871,
13,
4706,
396,
12833,
697,
1833,
931,
13,
4706,
1583,
3032,
2929,
345,
14448,
580,
13,
4706,
565,
1583,
29889,
4294,
29918,
23569,
29901,
13,
9651,
302,
3174,
29889,
8537,
29898,
1311,
3032,
29887,
21154,
29897,
13,
632,
13,
4706,
396,
731,
17005,
429,
522,
918,
931,
13,
4706,
1583,
3032,
4258,
29918,
2230,
353,
931,
29889,
2230,
580,
448,
260,
2962,
13,
308,
13,
4706,
396,
731,
17005,
1304,
3370,
13,
4706,
2626,
9847,
353,
1889,
29889,
14834,
29918,
3888,
2141,
29894,
1516,
448,
2626,
2962,
13,
4706,
1583,
3032,
6954,
29918,
25978,
683,
353,
2626,
9847,
13,
308,
13,
4706,
396,
9025,
25861,
6314,
272,
29871,
13,
4706,
396,
448,
2683,
2683,
2683,
2683,
5634,
29937,
13,
4706,
330,
29883,
29889,
12007,
580,
13,
4706,
330,
29883,
29889,
15914,
580,
13,
4706,
396,
448,
2683,
2683,
2683,
2683,
5634,
29937,
13,
308,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
268,
13,
1678,
285,
3451,
311,
29896,
353,
19361,
29925,
311,
29896,
29898,
5574,
29897,
13,
1678,
1596,
29898,
29888,
3451,
311,
29896,
29889,
29886,
311,
29918,
1807,
29897,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
285,
3451,
311,
29896,
29889,
735,
627,
29898,
9302,
29889,
2378,
4197,
29900,
29889,
29945,
29892,
29900,
29889,
29945,
12622,
13,
1678,
5174,
29901,
13,
4706,
1596,
703,
30126,
1059,
2643,
2038,
1159,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
285,
3451,
311,
29896,
29889,
14850,
29898,
9302,
29889,
2378,
4197,
29900,
29889,
29945,
29892,
29900,
29889,
29945,
12622,
13,
1678,
5174,
29901,
13,
4706,
1596,
703,
30126,
1059,
2643,
2038,
1159,
13,
268,
13,
1678,
285,
3451,
311,
29896,
29889,
2929,
345,
580,
13,
268,
13,
1678,
1596,
703,
2683,
2683,
23648,
1159,
13,
268,
13,
1678,
1596,
703,
735,
627,
29898,
29900,
29889,
29945,
29892,
29871,
29900,
29889,
29945,
29897,
353,
6571,
1642,
4830,
29898,
29888,
3451,
311,
29896,
29889,
735,
627,
29898,
9302,
29889,
2378,
4197,
29900,
29889,
29945,
29892,
29900,
29889,
29945,
12622,
876,
13,
1678,
1596,
703,
14850,
29898,
29900,
29889,
29945,
29892,
29871,
29900,
29889,
29945,
29897,
353,
6571,
1642,
4830,
29898,
29888,
3451,
311,
29896,
29889,
14850,
29898,
9302,
29889,
2378,
4197,
29900,
29889,
29945,
29892,
29900,
29889,
29945,
12622,
876,
13,
1678,
1596,
703,
29931,
29906,
6056,
304,
278,
1855,
1650,
6571,
1642,
4830,
29898,
29888,
3451,
311,
29896,
29889,
12324,
29931,
29906,
22130,
13,
1678,
1596,
703,
2929,
1747,
3614,
6571,
5226,
1642,
4830,
29898,
29888,
3451,
311,
29896,
29889,
4258,
29918,
2230,
876,
13,
1678,
1596,
703,
2929,
1747,
3913,
6571,
341,
29890,
1642,
4830,
29898,
29888,
3451,
311,
29896,
29889,
6954,
29918,
25978,
683,
29914,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
876,
13,
268,
13,
1678,
515,
286,
572,
29918,
10154,
29895,
1169,
29889,
29885,
5317,
29941,
29881,
1053,
319,
9100,
29941,
29928,
13,
1678,
1053,
22889,
29889,
2272,
5317,
408,
14770,
13,
1678,
515,
22889,
1053,
7477,
13,
268,
13,
1678,
2537,
353,
14770,
29889,
4532,
580,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29896,
29896,
29892,
18246,
2433,
29941,
29881,
1495,
13,
1678,
921,
353,
343,
353,
7442,
29889,
279,
927,
29898,
29900,
29892,
29871,
29896,
29889,
29900,
29896,
29892,
29871,
29900,
29889,
29900,
29896,
29897,
13,
1678,
1060,
29892,
612,
353,
7442,
29889,
4467,
29882,
7720,
29898,
29916,
29892,
343,
29897,
13,
268,
13,
1678,
503,
29879,
29900,
353,
7442,
29889,
2378,
4197,
29888,
3451,
311,
29896,
29889,
735,
627,
1194,
13,
1678,
7442,
29889,
2378,
4197,
29916,
29892,
29891,
12622,
363,
921,
29892,
29891,
297,
14319,
29898,
9302,
29889,
336,
955,
29898,
29990,
511,
7442,
29889,
336,
955,
29898,
29979,
876,
2314,
13,
268,
13,
1678,
796,
353,
503,
29879,
29900,
29889,
690,
14443,
29898,
29990,
29889,
12181,
29897,
13,
1678,
4853,
29889,
5317,
29918,
7610,
2161,
29898,
29990,
29892,
612,
29892,
796,
29892,
274,
1958,
29922,
4912,
29889,
18713,
5317,
29897,
13,
268,
13,
1678,
2537,
29889,
29873,
523,
29918,
2680,
580,
13,
268,
13,
1678,
4853,
29889,
842,
29918,
29916,
1643,
703,
29990,
29900,
1159,
13,
1678,
4853,
29889,
842,
29918,
29891,
1643,
703,
29990,
29896,
1159,
13,
1678,
4853,
29889,
842,
29918,
29920,
1643,
703,
29888,
29898,
29990,
29900,
29892,
1060,
29896,
25760,
13,
1678,
14770,
29889,
4294,
580,
13,
1678,
2537,
29889,
7620,
1003,
703,
2929,
29918,
29886,
311,
29918,
29896,
29889,
5140,
613,
289,
1884,
29918,
262,
6609,
2433,
29873,
523,
1495,
13,
268,
13,
268,
13,
1678,
2537,
353,
14770,
29889,
4532,
580,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29896,
29896,
29896,
29892,
18246,
2433,
29941,
29881,
1495,
13,
1678,
921,
353,
343,
353,
7442,
29889,
279,
927,
29898,
29900,
29892,
29871,
29896,
29889,
29900,
29896,
29892,
29871,
29900,
29889,
29900,
29896,
29897,
13,
1678,
1060,
29892,
612,
353,
7442,
29889,
4467,
29882,
7720,
29898,
29916,
29892,
343,
29897,
13,
268,
13,
1678,
503,
29879,
29900,
353,
7442,
29889,
2378,
4197,
29888,
3451,
311,
29896,
29889,
14850,
1194,
13,
1678,
7442,
29889,
2378,
4197,
29916,
29892,
29891,
12622,
363,
921,
29892,
29891,
297,
14319,
29898,
9302,
29889,
336,
955,
29898,
29990,
511,
7442,
29889,
336,
955,
29898,
29979,
876,
2314,
13,
268,
13,
1678,
796,
353,
503,
29879,
29900,
29889,
690,
14443,
29898,
29990,
29889,
12181,
29897,
13,
1678,
4853,
29889,
5317,
29918,
7610,
2161,
29898,
29990,
29892,
612,
29892,
796,
29892,
274,
1958,
29922,
4912,
29889,
18713,
5317,
29897,
13,
268,
13,
1678,
4853,
29889,
842,
29918,
29916,
1643,
703,
29990,
29900,
1159,
13,
1678,
4853,
29889,
842,
29918,
29891,
1643,
703,
29990,
29896,
1159,
13,
1678,
4853,
29889,
842,
29918,
29920,
1643,
703,
29888,
29898,
29990,
29900,
29892,
29990,
29896,
25760,
13,
1678,
14770,
29889,
4294,
580,
13,
268,
2
] |
lightflow_rest/__main__.py | AustralianSynchrotron/lightflow-rest | 0 | 42389 | <reponame>AustralianSynchrotron/lightflow-rest
def main(args):
""" Main entry point for the extension. """
from lightflow_rest.service import app
app.run()
if __name__ == '__main__':
import sys
main(sys.argv[1:])
| [
1,
529,
276,
1112,
420,
29958,
22537,
713,
29216,
305,
307,
509,
265,
29914,
4366,
1731,
29899,
5060,
13,
13,
13,
1753,
1667,
29898,
5085,
1125,
13,
1678,
9995,
4241,
6251,
1298,
363,
278,
6081,
29889,
9995,
13,
1678,
515,
3578,
1731,
29918,
5060,
29889,
5509,
1053,
623,
13,
1678,
623,
29889,
3389,
580,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1053,
10876,
13,
1678,
1667,
29898,
9675,
29889,
19218,
29961,
29896,
29901,
2314,
13,
2
] |
library/azure_rm_sqlvirtualnetworkrule.py | wray/azure_modules | 0 | 109749 | <filename>library/azure_rm_sqlvirtualnetworkrule.py
#!/usr/bin/python
#
# Copyright (c) 2018, <NAME>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: azure_rm_sqlvirtualnetworkrule
version_added: "2.7"
short_description: Manage SQL Virtual Network Rules
description:
- Add/Delete Virtual network Rule.
options:
resource_group:
description:
- The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
required: True
server_name:
description:
- The name of the sql server.
required: True
name:
description:
- The name of the firewall rule.
required: True
subnet_name:
description:
- The name of the subnet
required: True
state:
description:
- Assert the state of the VNet rule. Use 'present' to add a rule and 'absent' to delete it.
default: present
choices:
- absent
- present
extends_documentation_fragment:
- azure
author:
- "<NAME> (@wray)"
'''
EXAMPLES = '''
- name: Create (or update) Virutal Network Rule
azure_rm_sqlvirtualnetworkrule:
resource_group: vnrulecrudtest-17
server_name: vnrulecrudtest-6234
name: vnrulecrudtest-5332
subnet_name: vnrulecrudtest-333
'''
RETURN = '''
id:
description:
- Resource ID.
returned: always
type: str
sample: "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vnrulecrudtest-17/providers/Microsoft.Sql/servers/firewallrulecrudtest-6234
5/firewallRules/firewallrulecrudtest-5332"
'''
import time
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try:
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
from msrest.polling import LROPoller
from azure.mgmt.sql import SqlManagementClient
from msrest.serialization import Model
except ImportError:
# This is handled in azure_rm_common
pass
class Actions:
NoAction, Create, Delete = range(3)
class AzureRMVirtualNetworkRules(AzureRMModuleBase):
"""Configuration class for an Azure RM Firewall Rule resource"""
def __init__(self):
self.module_arg_spec = dict(
resource_group=dict(
type='str',
required=True
),
server_name=dict(
type='str',
required=True
),
name=dict(
type='str',
required=True
),
subnet_name=dict(
type='str',
required=True
),
state=dict(
type='str',
default='present',
choices=['present', 'absent']
)
)
self.resource_group = None
self.server_name = None
self.name = None
self.virtual_network = None
self.subnet_name = None
self.results = dict(changed=False)
self.state = None
self.to_do = Actions.NoAction
super(AzureRMVirtualNetworkRules, self).__init__(derived_arg_spec=self.module_arg_spec,
supports_check_mode=True,
supports_tags=False)
def exec_module(self, **kwargs):
"""Main module execution method"""
for key in list(self.module_arg_spec.keys()):
if hasattr(self, key):
setattr(self, key, kwargs[key])
old_response = self.get_virtualnetworkrule()
response = None
if not old_response:
self.log("Virtual Network Rule instance doesn't exist")
if self.state == 'absent':
self.log("Old Rule didn't exist")
else:
self.to_do = Actions.Create
else:
self.log("Virtual Network Rule instance already exists")
if self.state == 'absent':
self.to_do = Actions.Delete
elif self.state == 'present':
self.log("Virtual Network Rule will remain")
if self.to_do == Actions.Create:
self.log("Need to Create the Virtual Network Rule instance")
if self.check_mode:
self.results['changed'] = True
return self.results
response = self.create_virtualnetworkrule()
if not old_response:
self.results['changed'] = True
else:
self.results['changed'] = old_response.__ne__(response)
self.log("Creation done")
elif self.to_do == Actions.Delete:
self.log("Virtual Network Rule instance to be deleted")
self.results['changed'] = True
if self.check_mode:
return self.results
self.delete_virtualnetworkrule()
# make sure instance is actually deleted, for some Azure resources, instance is hanging around
# for some time after deletion -- this should be really fixed in Azure
while self.get_virtualnetworkrule():
time.sleep(20)
else:
self.log("Virtual Network Rule instance unchanged")
self.results['changed'] = False
response = old_response
if response:
self.results["id"] = response["id"]
return self.results
def create_virtualnetworkrule(self):
'''
Creates or updates Virtual Network Rule with the specified configuration.
:return: deserialized Network Rule instance state dictionary
'''
self.log("Creating the Virtual Network Rule instance {0}".format(self.name))
try:
response = self.sql_client.virtual_network_rules.create_or_update(resource_group_name=self.resource_group,
server_name=self.server_name,
virtual_network_rule_name=self.name,
virtual_network_subnet_id=self.subnet_name)
if isinstance(response, AzureOperationPoller):
response = self.get_poller_result(response)
except CloudError as exc:
self.log('Error attempting to create the Firewall Rule instance.')
self.fail("Error creating the Firewall Rule instance: {0}".format(str(exc)))
return response.as_dict()
def delete_virtualnetworkrule(self):
'''
Deletes specified Firewall Rule instance in the specified subscription and resource group.
:return: True
'''
self.log("Deleting the Firewall Rule instance {0}".format(self.name))
try:
response = self.sql_client.virtual_network_rules.delete(resource_group_name=self.resource_group,
server_name=self.server_name,
virtual_network_rule_name=self.name)
except CloudError as e:
self.log('Error attempting to delete the Firewall Rule instance.')
self.fail("Error deleting the Firewall Rule instance: {0}".format(str(e)))
return True
def get_virtualnetworkrule(self):
'''
Gets the properties of the specified Virtual Network Rule.
:return: deserialized Virtual Network Rule instance state dictionary
'''
self.log("Checking if the Virtual network Rule instance {0} is present".format(self.name))
found = False
try:
response = self.sql_client.virtual_network_rules.get(resource_group_name=self.resource_group,
server_name=self.server_name,
virtual_network_rule_name=self.name)
found = True
self.log("Response : {0}".format(response))
self.log("Virtual Network Rule instance : {0} found".format(response.name))
except CloudError as e:
self.log('Did not find the Virtual Network Rule instance.')
if found is True:
return response.as_dict()
return False
def main():
"""Main execution"""
AzureRMVirtualNetworkRules()
if __name__ == '__main__':
main()
| [
1,
529,
9507,
29958,
5258,
29914,
17688,
29918,
1758,
29918,
2850,
18714,
11618,
7491,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
13,
29937,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29947,
29892,
529,
5813,
29958,
13,
29937,
13,
29937,
15143,
4593,
5236,
19245,
325,
29941,
29889,
29900,
29974,
313,
4149,
315,
4590,
29979,
4214,
470,
2045,
597,
1636,
29889,
18713,
29889,
990,
29914,
506,
11259,
29914,
29887,
572,
29899,
29941,
29889,
29900,
29889,
3945,
29897,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
29892,
8542,
29892,
1596,
29918,
2220,
13,
1649,
2527,
562,
605,
1649,
353,
1134,
13,
13,
13,
2190,
5425,
29933,
1307,
29918,
2303,
29911,
3035,
8254,
353,
11117,
19635,
29918,
3259,
2396,
525,
29896,
29889,
29896,
742,
13,
462,
1678,
525,
4882,
2396,
6024,
25347,
7464,
13,
462,
1678,
525,
23765,
29918,
1609,
2396,
525,
23834,
10827,
13,
13,
13,
28665,
5005,
3919,
8098,
353,
14550,
13,
5634,
13,
5453,
29901,
15699,
29918,
1758,
29918,
2850,
18714,
11618,
7491,
13,
3259,
29918,
23959,
29901,
376,
29906,
29889,
29955,
29908,
13,
12759,
29918,
8216,
29901,
2315,
482,
3758,
19181,
8527,
390,
2540,
13,
8216,
29901,
13,
1678,
448,
3462,
29914,
12498,
19181,
3564,
27308,
29889,
13,
13,
6768,
29901,
13,
1678,
6503,
29918,
2972,
29901,
13,
4706,
6139,
29901,
13,
9651,
448,
450,
1024,
310,
278,
6503,
2318,
393,
3743,
278,
6503,
29889,
887,
508,
4017,
445,
995,
515,
278,
12634,
18981,
15629,
3450,
470,
278,
25792,
29889,
13,
4706,
3734,
29901,
5852,
13,
1678,
1923,
29918,
978,
29901,
13,
4706,
6139,
29901,
13,
9651,
448,
450,
1024,
310,
278,
4576,
1923,
29889,
13,
4706,
3734,
29901,
5852,
13,
1678,
1024,
29901,
13,
4706,
6139,
29901,
13,
9651,
448,
450,
1024,
310,
278,
25570,
5751,
29889,
13,
4706,
3734,
29901,
5852,
13,
1678,
1014,
1212,
29918,
978,
29901,
13,
4706,
6139,
29901,
13,
9651,
448,
450,
1024,
310,
278,
1014,
1212,
13,
4706,
3734,
29901,
5852,
13,
1678,
2106,
29901,
13,
418,
6139,
29901,
13,
4706,
448,
16499,
278,
2106,
310,
278,
478,
6779,
5751,
29889,
4803,
525,
6338,
29915,
304,
788,
263,
5751,
322,
525,
6897,
296,
29915,
304,
5217,
372,
29889,
13,
418,
2322,
29901,
2198,
13,
418,
19995,
29901,
13,
4706,
448,
29207,
13,
4706,
448,
2198,
13,
13,
1062,
1975,
29918,
12663,
29918,
20777,
29901,
13,
1678,
448,
15699,
13,
13,
8921,
29901,
13,
1678,
448,
9872,
5813,
29958,
20164,
29893,
764,
5513,
13,
13,
12008,
13,
13,
5746,
19297,
17101,
353,
14550,
13,
29871,
448,
1024,
29901,
6204,
313,
272,
2767,
29897,
6749,
329,
284,
8527,
27308,
13,
1678,
15699,
29918,
1758,
29918,
2850,
18714,
11618,
7491,
29901,
13,
418,
6503,
29918,
2972,
29901,
325,
29876,
7491,
7283,
566,
1688,
29899,
29896,
29955,
13,
418,
1923,
29918,
978,
29901,
325,
29876,
7491,
7283,
566,
1688,
29899,
29953,
29906,
29941,
29946,
13,
418,
1024,
29901,
325,
29876,
7491,
7283,
566,
1688,
29899,
29945,
29941,
29941,
29906,
13,
418,
1014,
1212,
29918,
978,
29901,
325,
29876,
7491,
7283,
566,
1688,
29899,
29941,
29941,
29941,
13,
12008,
13,
13,
1525,
29911,
24015,
353,
14550,
13,
333,
29901,
13,
1678,
6139,
29901,
13,
4706,
448,
18981,
3553,
29889,
13,
1678,
4133,
29901,
2337,
13,
1678,
1134,
29901,
851,
13,
1678,
4559,
29901,
5591,
1491,
7588,
1980,
29914,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29899,
29896,
29896,
29896,
29896,
29899,
29906,
29906,
29906,
29906,
29899,
29941,
29941,
29941,
29941,
29899,
29946,
29946,
29946,
29946,
29946,
29946,
29946,
29946,
29946,
29946,
29946,
29946,
29914,
10314,
24020,
29914,
18564,
7491,
7283,
566,
1688,
29899,
29896,
29955,
29914,
771,
29454,
29914,
11277,
29889,
10520,
29914,
643,
874,
29914,
8696,
11358,
7491,
7283,
566,
1688,
29899,
29953,
29906,
29941,
29946,
13,
795,
29945,
29914,
8696,
11358,
29934,
2540,
29914,
8696,
11358,
7491,
7283,
566,
1688,
29899,
29945,
29941,
29941,
29906,
29908,
13,
12008,
13,
13,
5215,
931,
13,
3166,
385,
1687,
29889,
5453,
29918,
13239,
29889,
17688,
29918,
1758,
29918,
9435,
1053,
12634,
29934,
29924,
7355,
5160,
13,
13,
2202,
29901,
13,
1678,
515,
10887,
5060,
17688,
29889,
17688,
29918,
11739,
29879,
1053,
14293,
2392,
13,
1678,
515,
10887,
5060,
17688,
29889,
17688,
29918,
16453,
1053,
12634,
10925,
7713,
1358,
13,
1678,
515,
10887,
5060,
29889,
3733,
1847,
1053,
365,
1672,
7713,
1358,
13,
1678,
515,
15699,
29889,
29885,
29887,
4378,
29889,
2850,
1053,
13093,
27107,
4032,
13,
1678,
515,
10887,
5060,
29889,
15550,
2133,
1053,
8125,
13,
19499,
16032,
2392,
29901,
13,
1678,
396,
910,
338,
16459,
297,
15699,
29918,
1758,
29918,
9435,
13,
1678,
1209,
13,
13,
13,
1990,
319,
1953,
29901,
13,
1678,
1939,
4276,
29892,
6204,
29892,
21267,
353,
3464,
29898,
29941,
29897,
13,
13,
13,
1990,
12634,
29934,
29924,
21287,
13724,
29934,
2540,
29898,
28413,
29934,
29924,
7355,
5160,
1125,
13,
1678,
9995,
8614,
770,
363,
385,
12634,
390,
29924,
6438,
11358,
27308,
6503,
15945,
29908,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
5453,
29918,
1191,
29918,
6550,
353,
9657,
29898,
13,
9651,
6503,
29918,
2972,
29922,
8977,
29898,
13,
18884,
1134,
2433,
710,
742,
13,
18884,
3734,
29922,
5574,
13,
9651,
10353,
13,
9651,
1923,
29918,
978,
29922,
8977,
29898,
13,
18884,
1134,
2433,
710,
742,
13,
18884,
3734,
29922,
5574,
13,
9651,
10353,
13,
9651,
1024,
29922,
8977,
29898,
13,
18884,
1134,
2433,
710,
742,
13,
18884,
3734,
29922,
5574,
13,
9651,
10353,
13,
9651,
1014,
1212,
29918,
978,
29922,
8977,
29898,
13,
18884,
1134,
2433,
710,
742,
13,
18884,
3734,
29922,
5574,
13,
9651,
10353,
13,
9651,
2106,
29922,
8977,
29898,
13,
18884,
1134,
2433,
710,
742,
13,
18884,
2322,
2433,
6338,
742,
13,
18884,
19995,
29922,
1839,
6338,
742,
525,
6897,
296,
2033,
13,
9651,
1723,
13,
4706,
1723,
13,
13,
4706,
1583,
29889,
10314,
29918,
2972,
353,
6213,
13,
4706,
1583,
29889,
2974,
29918,
978,
353,
6213,
13,
4706,
1583,
29889,
978,
353,
6213,
13,
4706,
1583,
29889,
18714,
29918,
11618,
353,
6213,
13,
4706,
1583,
29889,
1491,
1212,
29918,
978,
353,
6213,
13,
13,
4706,
1583,
29889,
9902,
353,
9657,
29898,
15033,
29922,
8824,
29897,
13,
4706,
1583,
29889,
3859,
353,
6213,
13,
4706,
1583,
29889,
517,
29918,
1867,
353,
319,
1953,
29889,
3782,
4276,
13,
13,
4706,
2428,
29898,
28413,
29934,
29924,
21287,
13724,
29934,
2540,
29892,
1583,
467,
1649,
2344,
12035,
672,
2347,
29918,
1191,
29918,
6550,
29922,
1311,
29889,
5453,
29918,
1191,
29918,
6550,
29892,
13,
462,
462,
462,
259,
11286,
29918,
3198,
29918,
8513,
29922,
5574,
29892,
13,
462,
462,
462,
259,
11286,
29918,
11338,
29922,
8824,
29897,
13,
13,
1678,
822,
2279,
29918,
5453,
29898,
1311,
29892,
3579,
19290,
1125,
13,
4706,
9995,
6330,
3883,
8225,
1158,
15945,
29908,
13,
13,
4706,
363,
1820,
297,
1051,
29898,
1311,
29889,
5453,
29918,
1191,
29918,
6550,
29889,
8149,
580,
1125,
13,
9651,
565,
756,
5552,
29898,
1311,
29892,
1820,
1125,
13,
18884,
731,
5552,
29898,
1311,
29892,
1820,
29892,
9049,
5085,
29961,
1989,
2314,
13,
13,
4706,
2030,
29918,
5327,
353,
1583,
29889,
657,
29918,
18714,
11618,
7491,
580,
13,
4706,
2933,
353,
6213,
13,
13,
4706,
565,
451,
2030,
29918,
5327,
29901,
13,
9651,
1583,
29889,
1188,
703,
21287,
8527,
27308,
2777,
1838,
29915,
29873,
1863,
1159,
13,
9651,
565,
1583,
29889,
3859,
1275,
525,
6897,
296,
2396,
13,
18884,
1583,
29889,
1188,
703,
21648,
27308,
3282,
29915,
29873,
1863,
1159,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
517,
29918,
1867,
353,
319,
1953,
29889,
4391,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
1188,
703,
21287,
8527,
27308,
2777,
2307,
4864,
1159,
13,
9651,
565,
1583,
29889,
3859,
1275,
525,
6897,
296,
2396,
13,
18884,
1583,
29889,
517,
29918,
1867,
353,
319,
1953,
29889,
12498,
13,
9651,
25342,
1583,
29889,
3859,
1275,
525,
6338,
2396,
13,
18884,
1583,
29889,
1188,
703,
21287,
8527,
27308,
674,
3933,
1159,
13,
13,
4706,
565,
1583,
29889,
517,
29918,
1867,
1275,
319,
1953,
29889,
4391,
29901,
13,
9651,
1583,
29889,
1188,
703,
8139,
287,
304,
6204,
278,
19181,
8527,
27308,
2777,
1159,
13,
13,
9651,
565,
1583,
29889,
3198,
29918,
8513,
29901,
13,
18884,
1583,
29889,
9902,
1839,
15033,
2033,
353,
5852,
13,
18884,
736,
1583,
29889,
9902,
13,
13,
9651,
2933,
353,
1583,
29889,
3258,
29918,
18714,
11618,
7491,
580,
13,
13,
9651,
565,
451,
2030,
29918,
5327,
29901,
13,
18884,
1583,
29889,
9902,
1839,
15033,
2033,
353,
5852,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
9902,
1839,
15033,
2033,
353,
2030,
29918,
5327,
17255,
484,
12035,
5327,
29897,
13,
9651,
1583,
29889,
1188,
703,
9832,
362,
2309,
1159,
13,
4706,
25342,
1583,
29889,
517,
29918,
1867,
1275,
319,
1953,
29889,
12498,
29901,
13,
9651,
1583,
29889,
1188,
703,
21287,
8527,
27308,
2777,
304,
367,
11132,
1159,
13,
9651,
1583,
29889,
9902,
1839,
15033,
2033,
353,
5852,
13,
13,
9651,
565,
1583,
29889,
3198,
29918,
8513,
29901,
13,
18884,
736,
1583,
29889,
9902,
13,
13,
9651,
1583,
29889,
8143,
29918,
18714,
11618,
7491,
580,
13,
9651,
396,
1207,
1854,
2777,
338,
2869,
11132,
29892,
363,
777,
12634,
7788,
29892,
2777,
338,
298,
9776,
2820,
13,
9651,
396,
363,
777,
931,
1156,
7374,
291,
1192,
445,
881,
367,
2289,
4343,
297,
12634,
13,
9651,
1550,
1583,
29889,
657,
29918,
18714,
11618,
7491,
7295,
13,
18884,
931,
29889,
17059,
29898,
29906,
29900,
29897,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
1188,
703,
21287,
8527,
27308,
2777,
443,
15033,
1159,
13,
9651,
1583,
29889,
9902,
1839,
15033,
2033,
353,
7700,
13,
9651,
2933,
353,
2030,
29918,
5327,
13,
13,
4706,
565,
2933,
29901,
13,
9651,
1583,
29889,
9902,
3366,
333,
3108,
353,
2933,
3366,
333,
3108,
13,
13,
4706,
736,
1583,
29889,
9902,
13,
13,
1678,
822,
1653,
29918,
18714,
11618,
7491,
29898,
1311,
1125,
13,
4706,
14550,
13,
4706,
6760,
1078,
470,
11217,
19181,
8527,
27308,
411,
278,
6790,
5285,
29889,
13,
13,
4706,
584,
2457,
29901,
16964,
616,
1891,
8527,
27308,
2777,
2106,
8600,
13,
4706,
14550,
13,
4706,
1583,
29889,
1188,
703,
9832,
1218,
278,
19181,
8527,
27308,
2777,
426,
29900,
29913,
1642,
4830,
29898,
1311,
29889,
978,
876,
13,
13,
4706,
1018,
29901,
13,
9651,
2933,
353,
1583,
29889,
2850,
29918,
4645,
29889,
18714,
29918,
11618,
29918,
19238,
29889,
3258,
29918,
272,
29918,
5504,
29898,
10314,
29918,
2972,
29918,
978,
29922,
1311,
29889,
10314,
29918,
2972,
29892,
13,
462,
462,
462,
462,
795,
1923,
29918,
978,
29922,
1311,
29889,
2974,
29918,
978,
29892,
13,
462,
462,
462,
462,
795,
6901,
29918,
11618,
29918,
7491,
29918,
978,
29922,
1311,
29889,
978,
29892,
13,
462,
462,
462,
462,
795,
6901,
29918,
11618,
29918,
1491,
1212,
29918,
333,
29922,
1311,
29889,
1491,
1212,
29918,
978,
29897,
13,
13,
9651,
565,
338,
8758,
29898,
5327,
29892,
12634,
10925,
7713,
1358,
1125,
13,
18884,
2933,
353,
1583,
29889,
657,
29918,
3733,
1358,
29918,
2914,
29898,
5327,
29897,
13,
13,
4706,
5174,
14293,
2392,
408,
5566,
29901,
13,
9651,
1583,
29889,
1188,
877,
2392,
15661,
304,
1653,
278,
6438,
11358,
27308,
2777,
29889,
1495,
13,
9651,
1583,
29889,
14057,
703,
2392,
4969,
278,
6438,
11358,
27308,
2777,
29901,
426,
29900,
29913,
1642,
4830,
29898,
710,
29898,
735,
29883,
4961,
13,
4706,
736,
2933,
29889,
294,
29918,
8977,
580,
13,
13,
1678,
822,
5217,
29918,
18714,
11618,
7491,
29898,
1311,
1125,
13,
4706,
14550,
13,
4706,
897,
1026,
267,
6790,
6438,
11358,
27308,
2777,
297,
278,
6790,
25691,
322,
6503,
2318,
29889,
13,
13,
4706,
584,
2457,
29901,
5852,
13,
4706,
14550,
13,
4706,
1583,
29889,
1188,
703,
2772,
1026,
292,
278,
6438,
11358,
27308,
2777,
426,
29900,
29913,
1642,
4830,
29898,
1311,
29889,
978,
876,
13,
4706,
1018,
29901,
13,
9651,
2933,
353,
1583,
29889,
2850,
29918,
4645,
29889,
18714,
29918,
11618,
29918,
19238,
29889,
8143,
29898,
10314,
29918,
2972,
29918,
978,
29922,
1311,
29889,
10314,
29918,
2972,
29892,
13,
462,
462,
462,
632,
1923,
29918,
978,
29922,
1311,
29889,
2974,
29918,
978,
29892,
13,
462,
462,
462,
632,
6901,
29918,
11618,
29918,
7491,
29918,
978,
29922,
1311,
29889,
978,
29897,
13,
4706,
5174,
14293,
2392,
408,
321,
29901,
13,
9651,
1583,
29889,
1188,
877,
2392,
15661,
304,
5217,
278,
6438,
11358,
27308,
2777,
29889,
1495,
13,
9651,
1583,
29889,
14057,
703,
2392,
21228,
278,
6438,
11358,
27308,
2777,
29901,
426,
29900,
29913,
1642,
4830,
29898,
710,
29898,
29872,
4961,
13,
13,
4706,
736,
5852,
13,
13,
1678,
822,
679,
29918,
18714,
11618,
7491,
29898,
1311,
1125,
13,
4706,
14550,
13,
4706,
402,
1691,
278,
4426,
310,
278,
6790,
19181,
8527,
27308,
29889,
13,
13,
4706,
584,
2457,
29901,
16964,
616,
1891,
19181,
8527,
27308,
2777,
2106,
8600,
13,
4706,
14550,
13,
4706,
1583,
29889,
1188,
703,
5596,
292,
565,
278,
19181,
3564,
27308,
2777,
426,
29900,
29913,
338,
2198,
1642,
4830,
29898,
1311,
29889,
978,
876,
13,
4706,
1476,
353,
7700,
13,
4706,
1018,
29901,
13,
9651,
2933,
353,
1583,
29889,
2850,
29918,
4645,
29889,
18714,
29918,
11618,
29918,
19238,
29889,
657,
29898,
10314,
29918,
2972,
29918,
978,
29922,
1311,
29889,
10314,
29918,
2972,
29892,
13,
462,
462,
462,
462,
1923,
29918,
978,
29922,
1311,
29889,
2974,
29918,
978,
29892,
13,
462,
462,
462,
462,
6901,
29918,
11618,
29918,
7491,
29918,
978,
29922,
1311,
29889,
978,
29897,
13,
9651,
1476,
353,
5852,
13,
9651,
1583,
29889,
1188,
703,
5103,
584,
426,
29900,
29913,
1642,
4830,
29898,
5327,
876,
13,
9651,
1583,
29889,
1188,
703,
21287,
8527,
27308,
2777,
584,
426,
29900,
29913,
1476,
1642,
4830,
29898,
5327,
29889,
978,
876,
13,
4706,
5174,
14293,
2392,
408,
321,
29901,
13,
9651,
1583,
29889,
1188,
877,
9260,
451,
1284,
278,
19181,
8527,
27308,
2777,
29889,
1495,
13,
4706,
565,
1476,
338,
5852,
29901,
13,
9651,
736,
2933,
29889,
294,
29918,
8977,
580,
13,
13,
4706,
736,
7700,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
9995,
6330,
8225,
15945,
29908,
13,
1678,
12634,
29934,
29924,
21287,
13724,
29934,
2540,
580,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
13,
2
] |
neighborapp/models.py | Maureen-1998DEV/watch_Hood | 0 | 25766 |
from django.db import models
from django.contrib.auth.models import User
from cloudinary.models import CloudinaryField
# Create your models here.
class Neighborhood(models.Model):
name = models.CharField(max_length = 50)
location = models.ForeignKey('Location',on_delete = models.CASCADE,null = True)
admin = models.ForeignKey(User,on_delete = models.CASCADE)
occupants = models.IntegerField(null=True)
def __str__(self):
return self.name
def create_neighborhood(self):
self.save()
def delete_neighborhood(self):
self.delete()
@classmethod
def find_neighborhood(cls,neigborhood_id):
neighborhood = cls.objects.get(id = neigborhood_id)
return neighborhood
def update_neighborhood(self):
self.save()
def update_occupants(self):
self.occupants += 1
self.save()
class UserProfile(models.Model):
user = models.ForeignKey(User,on_delete = models.CASCADE,related_name = 'profile')
first_name = models.CharField(max_length = 50,null=True)
last_name = models.CharField(max_length = 50,null=True)
bio = models.TextField(null=True)
neighborhood = models.ForeignKey(Neighborhood,on_delete = models.CASCADE,null=True)
email = models.EmailField(max_length = 60,null=True)
profile_pic = CloudinaryField('profile/')
pub_date = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.user.username
class Business(models.Model):
name = models.CharField(max_length = 60)
user = models.ForeignKey(User,on_delete = models.CASCADE,related_name = 'business_user')
description = models.CharField(max_length = 150,null=True)
neighborhood = models.ForeignKey(Neighborhood,on_delete = models.CASCADE,related_name = 'business_neighbourhood')
category = models.ForeignKey('Category',on_delete = models.CASCADE,null=True)
email = models.EmailField(max_length = 60)
def __str__(self):
return self.name
def create_business(self):
self.save()
def delete_business(self):
self.delete()
@classmethod
def find_business(cls,business_id):
business = Business.objects.get(id = business_id)
return business
def update_business(self):
self.save()
class Post(models.Model):
title = models.CharField(max_length = 50)
content = models.TextField()
user = models.ForeignKey(User,on_delete = models.CASCADE)
neighborhood = models.ForeignKey(Neighborhood,on_delete = models.CASCADE)
type = models.CharField(max_length = 50,null=True)
pub_date = models.DateTimeField(auto_now_add=True,null=True)
def __str__(self):
return self.title
class Comment(models.Model):
comment = models.CharField(max_length = 300)
posted_on = models.DateTimeField(auto_now=True)
user = models.ForeignKey(User, on_delete=models.CASCADE)
def save_comment(self):
self.save()
def delete_comment(self):
self.delete()
class Location(models.Model):
name = models.CharField(max_length = 40)
def __str__(self):
return self.name
class Category(models.Model):
name = models.CharField(max_length = 40)
def __str__(self):
return self.name | [
1,
29871,
13,
3166,
9557,
29889,
2585,
1053,
4733,
13,
3166,
9557,
29889,
21570,
29889,
5150,
29889,
9794,
1053,
4911,
13,
3166,
9570,
3821,
29889,
9794,
1053,
14293,
3821,
3073,
13,
29937,
6204,
596,
4733,
1244,
29889,
13,
1990,
2448,
1141,
4089,
6614,
29898,
9794,
29889,
3195,
1125,
13,
1678,
1024,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29945,
29900,
29897,
13,
1678,
4423,
353,
4733,
29889,
27755,
2558,
877,
6508,
742,
265,
29918,
8143,
353,
4733,
29889,
29907,
3289,
5454,
2287,
29892,
4304,
353,
5852,
29897,
13,
1678,
4113,
353,
4733,
29889,
27755,
2558,
29898,
2659,
29892,
265,
29918,
8143,
353,
4733,
29889,
29907,
3289,
5454,
2287,
29897,
13,
1678,
6919,
1934,
353,
4733,
29889,
7798,
3073,
29898,
4304,
29922,
5574,
29897,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
978,
13,
13,
1678,
822,
1653,
29918,
484,
1141,
4089,
6614,
29898,
1311,
1125,
13,
4706,
1583,
29889,
7620,
580,
13,
13,
1678,
822,
5217,
29918,
484,
1141,
4089,
6614,
29898,
1311,
1125,
13,
4706,
1583,
29889,
8143,
580,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1284,
29918,
484,
1141,
4089,
6614,
29898,
25932,
29892,
484,
335,
4089,
6614,
29918,
333,
1125,
13,
4706,
18403,
353,
1067,
29879,
29889,
12650,
29889,
657,
29898,
333,
353,
452,
335,
4089,
6614,
29918,
333,
29897,
13,
4706,
736,
18403,
13,
13,
1678,
822,
2767,
29918,
484,
1141,
4089,
6614,
29898,
1311,
1125,
13,
4706,
1583,
29889,
7620,
580,
13,
13,
1678,
822,
2767,
29918,
16770,
1934,
29898,
1311,
1125,
13,
4706,
1583,
29889,
16770,
1934,
4619,
29871,
29896,
13,
4706,
1583,
29889,
7620,
580,
13,
13,
13,
1990,
4911,
13909,
29898,
9794,
29889,
3195,
1125,
13,
1678,
1404,
353,
4733,
29889,
27755,
2558,
29898,
2659,
29892,
265,
29918,
8143,
353,
4733,
29889,
29907,
3289,
5454,
2287,
29892,
12817,
29918,
978,
353,
525,
10185,
1495,
13,
1678,
937,
29918,
978,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29945,
29900,
29892,
4304,
29922,
5574,
29897,
13,
1678,
1833,
29918,
978,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29945,
29900,
29892,
4304,
29922,
5574,
29897,
13,
1678,
17799,
353,
4733,
29889,
15778,
29898,
4304,
29922,
5574,
29897,
13,
1678,
18403,
353,
4733,
29889,
27755,
2558,
29898,
8139,
1141,
4089,
6614,
29892,
265,
29918,
8143,
353,
4733,
29889,
29907,
3289,
5454,
2287,
29892,
4304,
29922,
5574,
29897,
13,
1678,
4876,
353,
4733,
29889,
9823,
3073,
29898,
3317,
29918,
2848,
353,
29871,
29953,
29900,
29892,
4304,
29922,
5574,
29897,
13,
1678,
8722,
29918,
16447,
353,
14293,
3821,
3073,
877,
10185,
29914,
1495,
13,
1678,
2529,
29918,
1256,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29918,
1202,
29922,
5574,
29897,
13,
268,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
1792,
29889,
6786,
13,
13,
1990,
15197,
29898,
9794,
29889,
3195,
1125,
13,
1678,
1024,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29953,
29900,
29897,
13,
1678,
1404,
353,
4733,
29889,
27755,
2558,
29898,
2659,
29892,
265,
29918,
8143,
353,
4733,
29889,
29907,
3289,
5454,
2287,
29892,
12817,
29918,
978,
353,
525,
8262,
3335,
29918,
1792,
1495,
13,
1678,
6139,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29896,
29945,
29900,
29892,
4304,
29922,
5574,
29897,
13,
1678,
18403,
353,
4733,
29889,
27755,
2558,
29898,
8139,
1141,
4089,
6614,
29892,
265,
29918,
8143,
353,
4733,
29889,
29907,
3289,
5454,
2287,
29892,
12817,
29918,
978,
353,
525,
8262,
3335,
29918,
484,
1141,
6526,
6614,
1495,
13,
1678,
7663,
353,
4733,
29889,
27755,
2558,
877,
10900,
742,
265,
29918,
8143,
353,
4733,
29889,
29907,
3289,
5454,
2287,
29892,
4304,
29922,
5574,
29897,
13,
1678,
4876,
353,
4733,
29889,
9823,
3073,
29898,
3317,
29918,
2848,
353,
29871,
29953,
29900,
29897,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
978,
13,
13,
1678,
822,
1653,
29918,
8262,
3335,
29898,
1311,
1125,
13,
4706,
1583,
29889,
7620,
580,
13,
13,
1678,
822,
5217,
29918,
8262,
3335,
29898,
1311,
1125,
13,
4706,
1583,
29889,
8143,
580,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1284,
29918,
8262,
3335,
29898,
25932,
29892,
8262,
3335,
29918,
333,
1125,
13,
4706,
5381,
353,
15197,
29889,
12650,
29889,
657,
29898,
333,
353,
5381,
29918,
333,
29897,
13,
4706,
736,
5381,
13,
13,
1678,
822,
2767,
29918,
8262,
3335,
29898,
1311,
1125,
13,
4706,
1583,
29889,
7620,
580,
13,
13,
1990,
4918,
29898,
9794,
29889,
3195,
1125,
13,
1678,
3611,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29945,
29900,
29897,
13,
1678,
2793,
353,
4733,
29889,
15778,
580,
13,
1678,
1404,
353,
4733,
29889,
27755,
2558,
29898,
2659,
29892,
265,
29918,
8143,
353,
4733,
29889,
29907,
3289,
5454,
2287,
29897,
13,
1678,
18403,
353,
4733,
29889,
27755,
2558,
29898,
8139,
1141,
4089,
6614,
29892,
265,
29918,
8143,
353,
4733,
29889,
29907,
3289,
5454,
2287,
29897,
13,
1678,
1134,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29945,
29900,
29892,
4304,
29922,
5574,
29897,
13,
1678,
2529,
29918,
1256,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29918,
1202,
29922,
5574,
29892,
4304,
29922,
5574,
29897,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
3257,
13,
13,
1990,
461,
29898,
9794,
29889,
3195,
1125,
13,
1678,
3440,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29941,
29900,
29900,
29897,
13,
1678,
8059,
29918,
265,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29922,
5574,
29897,
13,
1678,
1404,
353,
4733,
29889,
27755,
2558,
29898,
2659,
29892,
373,
29918,
8143,
29922,
9794,
29889,
29907,
3289,
5454,
2287,
29897,
13,
13,
1678,
822,
4078,
29918,
9342,
29898,
1311,
1125,
13,
4706,
1583,
29889,
7620,
580,
13,
13,
1678,
822,
5217,
29918,
9342,
29898,
1311,
1125,
13,
4706,
1583,
29889,
8143,
580,
13,
13,
1990,
17015,
29898,
9794,
29889,
3195,
1125,
13,
1678,
1024,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29946,
29900,
29897,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
978,
13,
13,
1990,
17943,
29898,
9794,
29889,
3195,
1125,
13,
1678,
1024,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29946,
29900,
29897,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
978,
2
] |
assignment-section-05/classification_model/__init__.py | RostekA/deploying-machine-learning-models | 1 | 154920 | import logging
from classification_model.config.core import PACKAGE_ROOT, config
# It is strongly advised that you do not add any handlers other than
# NullHandler to your library’s loggers. This is because the configuration
# of handlers is the prerogative of the application developer who uses your
# library. The application developer knows their target audience and what
# handlers are most appropriate for their application: if you add handlers
# ‘under the hood’, you might well interfere with their ability to carry out
# unit tests and deliver logs which suit their requirements.
# https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
logging.getLogger(config.app_config.package_name).addHandler(logging.NullHandler())
with open(PACKAGE_ROOT / "VERSION") as version_file:
__version__ = version_file.read().strip()
| [
1,
1053,
12183,
13,
13,
3166,
12965,
29918,
4299,
29889,
2917,
29889,
3221,
1053,
349,
11375,
10461,
29918,
21289,
29892,
2295,
13,
13,
29937,
739,
338,
13818,
594,
11292,
393,
366,
437,
451,
788,
738,
25795,
916,
1135,
13,
29937,
19014,
4598,
304,
596,
3489,
30010,
29879,
1480,
5743,
29889,
910,
338,
1363,
278,
5285,
13,
29937,
310,
25795,
338,
278,
544,
261,
468,
1230,
310,
278,
2280,
13897,
1058,
3913,
596,
13,
29937,
3489,
29889,
450,
2280,
13897,
9906,
1009,
3646,
20026,
322,
825,
13,
29937,
25795,
526,
1556,
8210,
363,
1009,
2280,
29901,
565,
366,
788,
25795,
13,
29937,
5129,
5062,
278,
298,
2092,
30010,
29892,
366,
1795,
1532,
1006,
29888,
406,
411,
1009,
11509,
304,
8677,
714,
13,
29937,
5190,
6987,
322,
12021,
10748,
607,
14726,
1009,
11780,
29889,
13,
29937,
2045,
597,
2640,
29889,
4691,
29889,
990,
29914,
29941,
29914,
3525,
517,
29914,
21027,
29889,
1420,
29937,
2917,
3864,
29899,
21027,
29899,
1454,
29899,
29874,
29899,
5258,
13,
21027,
29889,
657,
16363,
29898,
2917,
29889,
932,
29918,
2917,
29889,
5113,
29918,
978,
467,
1202,
4598,
29898,
21027,
29889,
7327,
4598,
3101,
13,
13,
13,
2541,
1722,
29898,
29925,
11375,
10461,
29918,
21289,
847,
376,
16358,
1159,
408,
1873,
29918,
1445,
29901,
13,
1678,
4770,
3259,
1649,
353,
1873,
29918,
1445,
29889,
949,
2141,
17010,
580,
13,
2
] |
yt_dlp/extractor/zingmp3.py | mrBliss/yt-dlp | 80 | 72605 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
)
class ZingMp3BaseIE(InfoExtractor):
_VALID_URL_TMPL = r'https?://(?:mp3\.zing|zingmp3)\.vn/(?:%s)/[^/]+/(?P<id>\w+)\.html'
_GEO_COUNTRIES = ['VN']
def _extract_item(self, item, fatal):
item_id = item['id']
title = item.get('name') or item['title']
formats = []
for k, v in (item.get('source') or {}).items():
if not v:
continue
if k in ('mp4', 'hls'):
for res, video_url in v.items():
if not video_url:
continue
if k == 'hls':
formats.extend(self._extract_m3u8_formats(
video_url, item_id, 'mp4',
'm3u8_native', m3u8_id=k, fatal=False))
elif k == 'mp4':
formats.append({
'format_id': 'mp4-' + res,
'url': video_url,
'height': int_or_none(self._search_regex(
r'^(\d+)p', res, 'resolution', default=None)),
})
else:
formats.append({
'ext': 'mp3',
'format_id': k,
'tbr': int_or_none(k),
'url': self._proto_relative_url(v),
'vcodec': 'none',
})
if not formats:
if not fatal:
return
msg = item['msg']
if msg == 'Sorry, this content is not available in your country.':
self.raise_geo_restricted(countries=self._GEO_COUNTRIES, metadata_available=True)
self.raise_no_formats(msg, expected=True)
self._sort_formats(formats)
subtitles = None
lyric = item.get('lyric')
if lyric:
subtitles = {
'origin': [{
'url': lyric,
}],
}
album = item.get('album') or {}
return {
'id': item_id,
'title': title,
'formats': formats,
'thumbnail': item.get('thumbnail'),
'subtitles': subtitles,
'duration': int_or_none(item.get('duration')),
'track': title,
'artist': item.get('artists_names'),
'album': album.get('name') or album.get('title'),
'album_artist': album.get('artists_names'),
}
def _real_extract(self, url):
page_id = self._match_id(url)
webpage = self._download_webpage(
url.replace('://zingmp3.vn/', '://mp3.zing.vn/'),
page_id, query={'play_song': 1})
data_path = self._search_regex(
r'data-xml="([^"]+)', webpage, 'data path')
return self._process_data(self._download_json(
'https://mp3.zing.vn/xhr' + data_path, page_id)['data'])
class ZingMp3IE(ZingMp3BaseIE):
_VALID_URL = ZingMp3BaseIE._VALID_URL_TMPL % 'bai-hat|video-clip'
_TESTS = [{
'url': 'http://mp3.zing.vn/bai-hat/Xa-Mai-Xa-Bao-Thy/ZWZB9WAB.html',
'md5': 'ead7ae13693b3205cbc89536a077daed',
'info_dict': {
'id': 'ZWZB9WAB',
'title': 'Xa Mãi Xa',
'ext': 'mp3',
'thumbnail': r're:^https?://.+\.jpg',
'subtitles': {
'origin': [{
'ext': 'lrc',
}]
},
'duration': 255,
'track': 'Xa Mãi Xa',
'artist': 'Bảo Thy',
'album': 'Special Album',
'album_artist': 'Bảo Thy',
},
}, {
'url': 'https://mp3.zing.vn/video-clip/Suong-Hoa-Dua-Loi-K-ICM-RYO/ZO8ZF7C7.html',
'md5': 'e9c972b693aa88301ef981c8151c4343',
'info_dict': {
'id': 'ZO8ZF7C7',
'title': 'Sương Hoa Đưa Lối',
'ext': 'mp4',
'thumbnail': r're:^https?://.+\.jpg',
'duration': 207,
'track': 'Sương Hoa Đưa Lối',
'artist': 'K-ICM, RYO',
},
}, {
'url': 'https://zingmp3.vn/bai-hat/Xa-Mai-Xa-Bao-Thy/ZWZB9WAB.html',
'only_matching': True,
}]
IE_NAME = 'zingmp3'
IE_DESC = 'mp3.zing.vn'
def _process_data(self, data):
return self._extract_item(data, True)
class ZingMp3AlbumIE(ZingMp3BaseIE):
_VALID_URL = ZingMp3BaseIE._VALID_URL_TMPL % 'album|playlist'
_TESTS = [{
'url': 'http://mp3.zing.vn/album/Lau-Dai-Tinh-Ai-Bang-Kieu-Minh-Tuyet/ZWZBWDAF.html',
'info_dict': {
'_type': 'playlist',
'id': 'ZWZBWDAF',
'title': 'Lâu Đài Tình Ái',
},
'playlist_count': 10,
}, {
'url': 'http://mp3.zing.vn/playlist/Duong-Hong-Loan-apollobee/IWCAACCB.html',
'only_matching': True,
}, {
'url': 'https://zingmp3.vn/album/Lau-Dai-Tinh-Ai-Bang-Kieu-Minh-Tuyet/ZWZBWDAF.html',
'only_matching': True,
}]
IE_NAME = 'zingmp3:album'
def _process_data(self, data):
def entries():
for item in (data.get('items') or []):
entry = self._extract_item(item, False)
if entry:
yield entry
info = data.get('info') or {}
return self.playlist_result(
entries(), info.get('id'), info.get('name') or info.get('title'))
| [
1,
396,
14137,
29901,
23616,
29899,
29947,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
3166,
869,
9435,
1053,
22140,
5647,
28891,
13,
3166,
6317,
13239,
1053,
313,
13,
1678,
938,
29918,
272,
29918,
9290,
29892,
13,
29897,
13,
13,
13,
1990,
796,
292,
29924,
29886,
29941,
5160,
8673,
29898,
3401,
5647,
28891,
1125,
13,
1678,
903,
26707,
29918,
4219,
29918,
29911,
3580,
29931,
353,
364,
29915,
991,
29973,
597,
10780,
29901,
1526,
29941,
23301,
19583,
29989,
19583,
1526,
29941,
2144,
29889,
18564,
29914,
10780,
16664,
29879,
6802,
22896,
29914,
10062,
29914,
10780,
29925,
29966,
333,
14247,
29893,
29974,
2144,
29889,
1420,
29915,
13,
1678,
903,
1692,
29949,
29918,
18736,
3960,
2890,
353,
6024,
29963,
29940,
2033,
13,
13,
1678,
822,
903,
21111,
29918,
667,
29898,
1311,
29892,
2944,
29892,
18409,
1125,
13,
4706,
2944,
29918,
333,
353,
2944,
1839,
333,
2033,
13,
4706,
3611,
353,
2944,
29889,
657,
877,
978,
1495,
470,
2944,
1839,
3257,
2033,
13,
13,
4706,
21971,
353,
5159,
13,
4706,
363,
413,
29892,
325,
297,
313,
667,
29889,
657,
877,
4993,
1495,
470,
6571,
467,
7076,
7295,
13,
9651,
565,
451,
325,
29901,
13,
18884,
6773,
13,
9651,
565,
413,
297,
6702,
1526,
29946,
742,
525,
29882,
3137,
29374,
13,
18884,
363,
620,
29892,
4863,
29918,
2271,
297,
325,
29889,
7076,
7295,
13,
462,
1678,
565,
451,
4863,
29918,
2271,
29901,
13,
462,
4706,
6773,
13,
462,
1678,
565,
413,
1275,
525,
29882,
3137,
2396,
13,
462,
4706,
21971,
29889,
21843,
29898,
1311,
3032,
21111,
29918,
29885,
29941,
29884,
29947,
29918,
689,
1446,
29898,
13,
462,
9651,
4863,
29918,
2271,
29892,
2944,
29918,
333,
29892,
525,
1526,
29946,
742,
13,
462,
9651,
525,
29885,
29941,
29884,
29947,
29918,
11487,
742,
286,
29941,
29884,
29947,
29918,
333,
29922,
29895,
29892,
18409,
29922,
8824,
876,
13,
462,
1678,
25342,
413,
1275,
525,
1526,
29946,
2396,
13,
462,
4706,
21971,
29889,
4397,
3319,
13,
462,
9651,
525,
4830,
29918,
333,
2396,
525,
1526,
29946,
29899,
29915,
718,
620,
29892,
13,
462,
9651,
525,
2271,
2396,
4863,
29918,
2271,
29892,
13,
462,
9651,
525,
3545,
2396,
938,
29918,
272,
29918,
9290,
29898,
1311,
3032,
4478,
29918,
13087,
29898,
13,
462,
18884,
364,
29915,
29985,
1194,
29881,
28135,
29886,
742,
620,
29892,
525,
9778,
918,
742,
2322,
29922,
8516,
8243,
13,
462,
4706,
5615,
13,
9651,
1683,
29901,
13,
18884,
21971,
29889,
4397,
3319,
13,
462,
1678,
525,
1062,
2396,
525,
1526,
29941,
742,
13,
462,
1678,
525,
4830,
29918,
333,
2396,
413,
29892,
13,
462,
1678,
525,
29873,
1182,
2396,
938,
29918,
272,
29918,
9290,
29898,
29895,
511,
13,
462,
1678,
525,
2271,
2396,
1583,
3032,
17529,
29918,
22925,
29918,
2271,
29898,
29894,
511,
13,
462,
1678,
525,
29894,
401,
29883,
2396,
525,
9290,
742,
13,
18884,
5615,
13,
4706,
565,
451,
21971,
29901,
13,
9651,
565,
451,
18409,
29901,
13,
18884,
736,
13,
9651,
10191,
353,
2944,
1839,
7645,
2033,
13,
9651,
565,
10191,
1275,
525,
29903,
3818,
29892,
445,
2793,
338,
451,
3625,
297,
596,
4234,
29889,
2396,
13,
18884,
1583,
29889,
22692,
29918,
24756,
29918,
5060,
4146,
287,
29898,
2798,
2722,
29922,
1311,
3032,
1692,
29949,
29918,
18736,
3960,
2890,
29892,
15562,
29918,
16515,
29922,
5574,
29897,
13,
9651,
1583,
29889,
22692,
29918,
1217,
29918,
689,
1446,
29898,
7645,
29892,
3806,
29922,
5574,
29897,
13,
4706,
1583,
3032,
6605,
29918,
689,
1446,
29898,
689,
1446,
29897,
13,
13,
4706,
12059,
277,
793,
353,
6213,
13,
4706,
21261,
2200,
353,
2944,
29889,
657,
877,
368,
2200,
1495,
13,
4706,
565,
21261,
2200,
29901,
13,
9651,
12059,
277,
793,
353,
426,
13,
18884,
525,
12574,
2396,
15974,
13,
462,
1678,
525,
2271,
2396,
21261,
2200,
29892,
13,
18884,
500,
1402,
13,
9651,
500,
13,
13,
4706,
3769,
353,
2944,
29889,
657,
877,
10336,
1495,
470,
6571,
13,
13,
4706,
736,
426,
13,
9651,
525,
333,
2396,
2944,
29918,
333,
29892,
13,
9651,
525,
3257,
2396,
3611,
29892,
13,
9651,
525,
689,
1446,
2396,
21971,
29892,
13,
9651,
525,
386,
21145,
2396,
2944,
29889,
657,
877,
386,
21145,
5477,
13,
9651,
525,
1491,
23545,
793,
2396,
12059,
277,
793,
29892,
13,
9651,
525,
19708,
2396,
938,
29918,
272,
29918,
9290,
29898,
667,
29889,
657,
877,
19708,
1495,
511,
13,
9651,
525,
11294,
2396,
3611,
29892,
13,
9651,
525,
442,
391,
2396,
2944,
29889,
657,
877,
442,
2879,
29918,
7039,
5477,
13,
9651,
525,
10336,
2396,
3769,
29889,
657,
877,
978,
1495,
470,
3769,
29889,
657,
877,
3257,
5477,
13,
9651,
525,
10336,
29918,
442,
391,
2396,
3769,
29889,
657,
877,
442,
2879,
29918,
7039,
5477,
13,
4706,
500,
13,
13,
1678,
822,
903,
6370,
29918,
21111,
29898,
1311,
29892,
3142,
1125,
13,
4706,
1813,
29918,
333,
353,
1583,
3032,
4352,
29918,
333,
29898,
2271,
29897,
13,
4706,
24499,
353,
1583,
3032,
10382,
29918,
2676,
3488,
29898,
13,
9651,
3142,
29889,
6506,
877,
597,
19583,
1526,
29941,
29889,
18564,
29914,
742,
525,
597,
1526,
29941,
29889,
19583,
29889,
18564,
29914,
5477,
13,
9651,
1813,
29918,
333,
29892,
2346,
3790,
29915,
1456,
29918,
21453,
2396,
29871,
29896,
1800,
13,
4706,
848,
29918,
2084,
353,
1583,
3032,
4478,
29918,
13087,
29898,
13,
9651,
364,
29915,
1272,
29899,
3134,
543,
4197,
29985,
3108,
28135,
742,
24499,
29892,
525,
1272,
2224,
1495,
13,
4706,
736,
1583,
3032,
5014,
29918,
1272,
29898,
1311,
3032,
10382,
29918,
3126,
29898,
13,
9651,
525,
991,
597,
1526,
29941,
29889,
19583,
29889,
18564,
29914,
29916,
1092,
29915,
718,
848,
29918,
2084,
29892,
1813,
29918,
333,
29897,
1839,
1272,
11287,
13,
13,
13,
1990,
796,
292,
29924,
29886,
29941,
8673,
29898,
29999,
292,
29924,
29886,
29941,
5160,
8673,
1125,
13,
1678,
903,
26707,
29918,
4219,
353,
796,
292,
29924,
29886,
29941,
5160,
8673,
3032,
26707,
29918,
4219,
29918,
29911,
3580,
29931,
1273,
525,
29890,
1794,
29899,
2455,
29989,
9641,
29899,
24049,
29915,
13,
1678,
903,
18267,
29903,
353,
15974,
13,
4706,
525,
2271,
2396,
525,
1124,
597,
1526,
29941,
29889,
19583,
29889,
18564,
29914,
29890,
1794,
29899,
2455,
29914,
29990,
29874,
29899,
29924,
1794,
29899,
29990,
29874,
29899,
29933,
6241,
29899,
1349,
29891,
29914,
29999,
29956,
29999,
29933,
29929,
29956,
2882,
29889,
1420,
742,
13,
4706,
525,
3487,
29945,
2396,
525,
1479,
29955,
3660,
29896,
29941,
29953,
29929,
29941,
29890,
29941,
29906,
29900,
29945,
10702,
29883,
29947,
29929,
29945,
29941,
29953,
29874,
29900,
29955,
29955,
1388,
287,
742,
13,
4706,
525,
3888,
29918,
8977,
2396,
426,
13,
9651,
525,
333,
2396,
525,
29999,
29956,
29999,
29933,
29929,
29956,
2882,
742,
13,
9651,
525,
3257,
2396,
525,
29990,
29874,
341,
30033,
29875,
1060,
29874,
742,
13,
9651,
525,
1062,
2396,
525,
1526,
29941,
742,
13,
9651,
525,
386,
21145,
2396,
364,
29915,
276,
29901,
29985,
991,
29973,
597,
29889,
3124,
29889,
6173,
742,
13,
9651,
525,
1491,
23545,
793,
2396,
426,
13,
18884,
525,
12574,
2396,
15974,
13,
462,
1678,
525,
1062,
2396,
525,
29880,
2214,
742,
13,
18884,
500,
29962,
13,
9651,
2981,
13,
9651,
525,
19708,
2396,
29871,
29906,
29945,
29945,
29892,
13,
9651,
525,
11294,
2396,
525,
29990,
29874,
341,
30033,
29875,
1060,
29874,
742,
13,
9651,
525,
442,
391,
2396,
525,
29933,
30643,
29877,
498,
29891,
742,
13,
9651,
525,
10336,
2396,
525,
24780,
10217,
742,
13,
9651,
525,
10336,
29918,
442,
391,
2396,
525,
29933,
30643,
29877,
498,
29891,
742,
13,
4706,
2981,
13,
1678,
2981,
426,
13,
4706,
525,
2271,
2396,
525,
991,
597,
1526,
29941,
29889,
19583,
29889,
18564,
29914,
9641,
29899,
24049,
29914,
5091,
549,
29899,
29950,
19807,
29899,
29928,
3357,
29899,
3410,
29875,
29899,
29968,
29899,
2965,
29924,
29899,
13207,
29949,
29914,
29999,
29949,
29947,
29999,
29943,
29955,
29907,
29955,
29889,
1420,
742,
13,
4706,
525,
3487,
29945,
2396,
525,
29872,
29929,
29883,
29929,
29955,
29906,
29890,
29953,
29929,
29941,
7340,
29947,
29947,
29941,
29900,
29896,
1389,
29929,
29947,
29896,
29883,
29947,
29896,
29945,
29896,
29883,
29946,
29941,
29946,
29941,
742,
13,
4706,
525,
3888,
29918,
8977,
2396,
426,
13,
9651,
525,
333,
2396,
525,
29999,
29949,
29947,
29999,
29943,
29955,
29907,
29955,
742,
13,
9651,
525,
3257,
2396,
525,
29903,
30416,
30556,
865,
8335,
29874,
29871,
30250,
30416,
29874,
365,
30984,
29875,
742,
13,
9651,
525,
1062,
2396,
525,
1526,
29946,
742,
13,
9651,
525,
386,
21145,
2396,
364,
29915,
276,
29901,
29985,
991,
29973,
597,
29889,
3124,
29889,
6173,
742,
13,
9651,
525,
19708,
2396,
29871,
29906,
29900,
29955,
29892,
13,
9651,
525,
11294,
2396,
525,
29903,
30416,
30556,
865,
8335,
29874,
29871,
30250,
30416,
29874,
365,
30984,
29875,
742,
13,
9651,
525,
442,
391,
2396,
525,
29968,
29899,
2965,
29924,
29892,
390,
29979,
29949,
742,
13,
4706,
2981,
13,
1678,
2981,
426,
13,
4706,
525,
2271,
2396,
525,
991,
597,
19583,
1526,
29941,
29889,
18564,
29914,
29890,
1794,
29899,
2455,
29914,
29990,
29874,
29899,
29924,
1794,
29899,
29990,
29874,
29899,
29933,
6241,
29899,
1349,
29891,
29914,
29999,
29956,
29999,
29933,
29929,
29956,
2882,
29889,
1420,
742,
13,
4706,
525,
6194,
29918,
4352,
292,
2396,
5852,
29892,
13,
1678,
500,
29962,
13,
1678,
7159,
29918,
5813,
353,
525,
19583,
1526,
29941,
29915,
13,
1678,
7159,
29918,
2287,
7187,
353,
525,
1526,
29941,
29889,
19583,
29889,
18564,
29915,
13,
13,
1678,
822,
903,
5014,
29918,
1272,
29898,
1311,
29892,
848,
1125,
13,
4706,
736,
1583,
3032,
21111,
29918,
667,
29898,
1272,
29892,
5852,
29897,
13,
13,
13,
1990,
796,
292,
29924,
29886,
29941,
2499,
2404,
8673,
29898,
29999,
292,
29924,
29886,
29941,
5160,
8673,
1125,
13,
1678,
903,
26707,
29918,
4219,
353,
796,
292,
29924,
29886,
29941,
5160,
8673,
3032,
26707,
29918,
4219,
29918,
29911,
3580,
29931,
1273,
525,
10336,
29989,
1456,
1761,
29915,
13,
1678,
903,
18267,
29903,
353,
15974,
13,
4706,
525,
2271,
2396,
525,
1124,
597,
1526,
29941,
29889,
19583,
29889,
18564,
29914,
10336,
29914,
29931,
585,
29899,
29928,
1794,
29899,
29911,
262,
29882,
29899,
29909,
29875,
29899,
29933,
574,
29899,
29968,
9532,
29899,
8140,
29882,
29899,
29911,
8631,
300,
29914,
29999,
29956,
29999,
29933,
24668,
5098,
29889,
1420,
742,
13,
4706,
525,
3888,
29918,
8977,
2396,
426,
13,
9651,
22868,
1853,
2396,
525,
1456,
1761,
742,
13,
9651,
525,
333,
2396,
525,
29999,
29956,
29999,
29933,
24668,
5098,
742,
13,
9651,
525,
3257,
2396,
525,
29931,
30057,
29884,
29871,
30250,
30001,
29875,
323,
30097,
29876,
29882,
7260,
29875,
742,
13,
4706,
2981,
13,
4706,
525,
1456,
1761,
29918,
2798,
2396,
29871,
29896,
29900,
29892,
13,
1678,
2981,
426,
13,
4706,
525,
2271,
2396,
525,
1124,
597,
1526,
29941,
29889,
19583,
29889,
18564,
29914,
1456,
1761,
29914,
29928,
29884,
549,
29899,
29950,
549,
29899,
3410,
273,
29899,
481,
324,
417,
915,
29872,
29914,
29902,
29956,
5454,
2477,
21685,
29889,
1420,
742,
13,
4706,
525,
6194,
29918,
4352,
292,
2396,
5852,
29892,
13,
1678,
2981,
426,
13,
4706,
525,
2271,
2396,
525,
991,
597,
19583,
1526,
29941,
29889,
18564,
29914,
10336,
29914,
29931,
585,
29899,
29928,
1794,
29899,
29911,
262,
29882,
29899,
29909,
29875,
29899,
29933,
574,
29899,
29968,
9532,
29899,
8140,
29882,
29899,
29911,
8631,
300,
29914,
29999,
29956,
29999,
29933,
24668,
5098,
29889,
1420,
742,
13,
4706,
525,
6194,
29918,
4352,
292,
2396,
5852,
29892,
13,
1678,
500,
29962,
13,
1678,
7159,
29918,
5813,
353,
525,
19583,
1526,
29941,
29901,
10336,
29915,
13,
13,
1678,
822,
903,
5014,
29918,
1272,
29898,
1311,
29892,
848,
1125,
13,
4706,
822,
9976,
7295,
13,
9651,
363,
2944,
297,
313,
1272,
29889,
657,
877,
7076,
1495,
470,
5159,
1125,
13,
18884,
6251,
353,
1583,
3032,
21111,
29918,
667,
29898,
667,
29892,
7700,
29897,
13,
18884,
565,
6251,
29901,
13,
462,
1678,
7709,
6251,
13,
4706,
5235,
353,
848,
29889,
657,
877,
3888,
1495,
470,
6571,
13,
4706,
736,
1583,
29889,
1456,
1761,
29918,
2914,
29898,
13,
9651,
9976,
3285,
5235,
29889,
657,
877,
333,
5477,
5235,
29889,
657,
877,
978,
1495,
470,
5235,
29889,
657,
877,
3257,
8785,
13,
2
] |
backend-example.py | MOSAIC-LoPoW/oss7-thingsboard-backend-example | 5 | 84318 | <gh_stars>1-10
#!/usr/bin/env python
from __future__ import print_function
import argparse
import socket
import subprocess
from datetime import datetime
import jsonpickle
import serial
import time
import paho.mqtt.client as mqtt
import signal
import struct
from d7a.alp.command import Command
from d7a.alp.operations.responses import ReturnFileData
from d7a.system_files.system_file_ids import SystemFileIds
from d7a.system_files.system_files import SystemFiles
from modem.modem import Modem
import time
from pprint import pprint
from tb_api_client import swagger_client
from tb_api_client.swagger_client import ApiClient, Configuration
from tb_api_client.swagger_client.rest import ApiException
class BackendExample:
def __init__(self):
argparser = argparse.ArgumentParser()
argparser.add_argument("-v", "--verbose", help="verbose", default=False, action="store_true")
argparser.add_argument("-b", "--broker", help="mqtt broker hostname", default="localhost")
argparser.add_argument("-u", "--url", help="URL of the thingsboard server", default="http://localhost:8080")
argparser.add_argument("-t", "--token", help="token to access the thingsboard API", required=True)
self.mq = None
self.connected_to_mqtt = False
self.config = argparser.parse_args()
self.connect_to_mqtt()
api_client_config = Configuration()
api_client_config.host = self.config.url
api_client_config.api_key['X-Authorization'] = self.config.token
api_client_config.api_key_prefix['X-Authorization'] = 'Bearer'
api_client = ApiClient(api_client_config)
self.device_controller_api = swagger_client.DeviceControllerApi(api_client=api_client)
self.device_api_controller_api =swagger_client.DeviceApiControllerApi(api_client=api_client)
def connect_to_mqtt(self):
self.connected_to_mqtt = False
self.mq = mqtt.Client("", True, None, mqtt.MQTTv31)
self.mq.on_connect = self.on_mqtt_connect
self.mq.on_message = self.on_mqtt_message
self.mq.connect(self.config.broker, 1883, 60)
self.mq.loop_start()
while not self.connected_to_mqtt: pass # busy wait until connected
print("Connected to MQTT broker on {}".format(
self.config.broker,
))
def on_mqtt_connect(self, client, config, flags, rc):
self.mq.subscribe("/tb")
self.connected_to_mqtt = True
def on_mqtt_message(self, client, config, msg):
# msg contains already parsed command in ALP in JSON
print("ALP Command received from TB: {}".format(msg.payload))
try:
obj = jsonpickle.json.loads(msg.payload)
except:
print("Payload not valid JSON, skipping") # TODO issue with TB rule filter, to be fixed
return
gateway = obj["deviceId"]
cmd = jsonpickle.decode(jsonpickle.json.dumps(obj["alp"]))
node_id = gateway # overwritten below with remote node ID when received over D7 interface
# get remote node id (when this is received over D7 interface)
if cmd.interface_status != None and cmd.interface_status.operand.interface_id == 0xd7:
node_id = '{:x}'.format(cmd.interface_status.operand.interface_status.addressee.id)
# look for returned file data which we can parse, in this example file 64
my_sensor_value = 0
for action in cmd.actions:
if type(action.operation) is ReturnFileData and action.operand.offset.id == 64:
my_sensor_value = struct.unpack("L", bytearray(action.operand.data))[0] # parse binary payload (adapt to your needs)
print("node {} sensor value {}".format(node_id, my_sensor_value))
# save the parsed sensor data as an attribute to the device, using the TB API
try:
# first get the deviceId mapped to the device name
response = self.device_controller_api.get_tenant_device_using_get(device_name=str(node_id))
device_id = response.id.id
# next, get the access token of the device
response = self.device_controller_api.get_device_credentials_by_device_id_using_get(device_id=device_id)
device_access_token = response.credentials_id
# finally, store the sensor attribute on the node in TB
response = self.device_api_controller_api.post_telemetry_using_post(
device_token=device_access_token,
json={ "my_sensor": my_sensor_value }
)
print("Updated my_sensor attribute for node {}".format(node_id))
except ApiException as e:
print("Exception when calling API: %s\n" % e)
def __del__(self):
try:
self.mq.loop_stop()
self.mq.disconnect()
except:
pass
def run(self):
print("Started")
keep_running = True
while keep_running:
try:
signal.pause()
except KeyboardInterrupt:
print("received KeyboardInterrupt... stopping processing")
keep_running = False
if __name__ == "__main__":
BackendExample().run()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
5215,
1852,
5510,
13,
5215,
9909,
13,
5215,
1014,
5014,
13,
13,
3166,
12865,
1053,
12865,
13,
5215,
4390,
23945,
280,
13,
5215,
7797,
13,
5215,
931,
13,
13,
5215,
282,
29745,
29889,
28466,
698,
29889,
4645,
408,
286,
29939,
698,
13,
5215,
7182,
13,
13,
5215,
2281,
13,
13,
3166,
270,
29955,
29874,
29889,
284,
29886,
29889,
6519,
1053,
10516,
13,
3166,
270,
29955,
29874,
29889,
284,
29886,
29889,
3372,
800,
29889,
26679,
267,
1053,
7106,
2283,
1469,
13,
3166,
270,
29955,
29874,
29889,
5205,
29918,
5325,
29889,
5205,
29918,
1445,
29918,
4841,
1053,
2184,
2283,
21943,
13,
3166,
270,
29955,
29874,
29889,
5205,
29918,
5325,
29889,
5205,
29918,
5325,
1053,
2184,
10547,
13,
3166,
4464,
29885,
29889,
8513,
29885,
1053,
21864,
29885,
13,
13,
5215,
931,
13,
3166,
282,
2158,
1053,
282,
2158,
13,
13,
3166,
260,
29890,
29918,
2754,
29918,
4645,
1053,
2381,
9921,
29918,
4645,
13,
3166,
260,
29890,
29918,
2754,
29918,
4645,
29889,
2774,
9921,
29918,
4645,
1053,
29749,
4032,
29892,
20999,
13,
3166,
260,
29890,
29918,
2754,
29918,
4645,
29889,
2774,
9921,
29918,
4645,
29889,
5060,
1053,
29749,
2451,
13,
13,
13,
1990,
7437,
355,
14023,
29901,
13,
29871,
822,
4770,
2344,
12035,
1311,
1125,
13,
1678,
1852,
16680,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
1678,
1852,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29894,
613,
376,
489,
369,
15828,
613,
1371,
543,
369,
15828,
613,
2322,
29922,
8824,
29892,
3158,
543,
8899,
29918,
3009,
1159,
13,
1678,
1852,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29890,
613,
376,
489,
6729,
3946,
613,
1371,
543,
28466,
698,
2545,
3946,
3495,
978,
613,
2322,
543,
7640,
1159,
13,
1678,
1852,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29884,
613,
376,
489,
2271,
613,
1371,
543,
4219,
310,
278,
2712,
3377,
1923,
613,
2322,
543,
1124,
597,
7640,
29901,
29947,
29900,
29947,
29900,
1159,
13,
1678,
1852,
16680,
29889,
1202,
29918,
23516,
703,
29899,
29873,
613,
376,
489,
6979,
613,
1371,
543,
6979,
304,
2130,
278,
2712,
3377,
3450,
613,
3734,
29922,
5574,
29897,
13,
1678,
1583,
29889,
28466,
353,
6213,
13,
1678,
1583,
29889,
18045,
29918,
517,
29918,
28466,
698,
353,
7700,
13,
13,
1678,
1583,
29889,
2917,
353,
1852,
16680,
29889,
5510,
29918,
5085,
580,
13,
1678,
1583,
29889,
6915,
29918,
517,
29918,
28466,
698,
580,
13,
13,
1678,
7882,
29918,
4645,
29918,
2917,
353,
20999,
580,
13,
1678,
7882,
29918,
4645,
29918,
2917,
29889,
3069,
353,
1583,
29889,
2917,
29889,
2271,
13,
1678,
7882,
29918,
4645,
29918,
2917,
29889,
2754,
29918,
1989,
1839,
29990,
29899,
25471,
2033,
353,
1583,
29889,
2917,
29889,
6979,
13,
1678,
7882,
29918,
4645,
29918,
2917,
29889,
2754,
29918,
1989,
29918,
13506,
1839,
29990,
29899,
25471,
2033,
353,
525,
29933,
799,
261,
29915,
13,
1678,
7882,
29918,
4645,
353,
29749,
4032,
29898,
2754,
29918,
4645,
29918,
2917,
29897,
13,
13,
1678,
1583,
29889,
10141,
29918,
8299,
29918,
2754,
353,
2381,
9921,
29918,
4645,
29889,
11501,
2956,
11713,
29898,
2754,
29918,
4645,
29922,
2754,
29918,
4645,
29897,
13,
1678,
1583,
29889,
10141,
29918,
2754,
29918,
8299,
29918,
2754,
353,
2774,
9921,
29918,
4645,
29889,
11501,
11713,
2956,
11713,
29898,
2754,
29918,
4645,
29922,
2754,
29918,
4645,
29897,
13,
13,
29871,
822,
4511,
29918,
517,
29918,
28466,
698,
29898,
1311,
1125,
13,
1678,
1583,
29889,
18045,
29918,
517,
29918,
28466,
698,
353,
7700,
13,
13,
1678,
1583,
29889,
28466,
353,
286,
29939,
698,
29889,
4032,
703,
613,
5852,
29892,
6213,
29892,
286,
29939,
698,
29889,
25566,
19988,
29894,
29941,
29896,
29897,
13,
1678,
1583,
29889,
28466,
29889,
265,
29918,
6915,
353,
1583,
29889,
265,
29918,
28466,
698,
29918,
6915,
13,
1678,
1583,
29889,
28466,
29889,
265,
29918,
4906,
353,
1583,
29889,
265,
29918,
28466,
698,
29918,
4906,
13,
1678,
1583,
29889,
28466,
29889,
6915,
29898,
1311,
29889,
2917,
29889,
6729,
3946,
29892,
29871,
29896,
29947,
29947,
29941,
29892,
29871,
29953,
29900,
29897,
13,
1678,
1583,
29889,
28466,
29889,
7888,
29918,
2962,
580,
13,
1678,
1550,
451,
1583,
29889,
18045,
29918,
517,
29918,
28466,
698,
29901,
1209,
29871,
396,
19587,
4480,
2745,
6631,
13,
1678,
1596,
703,
20971,
2954,
304,
341,
29984,
19988,
2545,
3946,
373,
6571,
1642,
4830,
29898,
13,
418,
1583,
29889,
2917,
29889,
6729,
3946,
29892,
13,
268,
876,
13,
13,
29871,
822,
373,
29918,
28466,
698,
29918,
6915,
29898,
1311,
29892,
3132,
29892,
2295,
29892,
13449,
29892,
364,
29883,
1125,
13,
1678,
1583,
29889,
28466,
29889,
19496,
11974,
22625,
1159,
13,
1678,
1583,
29889,
18045,
29918,
517,
29918,
28466,
698,
353,
5852,
13,
13,
29871,
822,
373,
29918,
28466,
698,
29918,
4906,
29898,
1311,
29892,
3132,
29892,
2295,
29892,
10191,
1125,
13,
1678,
396,
10191,
3743,
2307,
21213,
1899,
297,
319,
13208,
297,
4663,
13,
1678,
1596,
703,
1964,
29925,
10516,
4520,
515,
323,
29933,
29901,
6571,
1642,
4830,
29898,
7645,
29889,
23813,
876,
13,
1678,
1018,
29901,
13,
418,
5446,
353,
4390,
23945,
280,
29889,
3126,
29889,
18132,
29898,
7645,
29889,
23813,
29897,
13,
1678,
5174,
29901,
13,
418,
1596,
703,
15467,
1359,
451,
2854,
4663,
29892,
14993,
3262,
1159,
396,
14402,
2228,
411,
323,
29933,
5751,
4175,
29892,
304,
367,
4343,
13,
418,
736,
13,
13,
1678,
28646,
353,
5446,
3366,
10141,
1204,
3108,
13,
1678,
9920,
353,
4390,
23945,
280,
29889,
13808,
29898,
3126,
23945,
280,
29889,
3126,
29889,
29881,
17204,
29898,
5415,
3366,
284,
29886,
3108,
876,
13,
1678,
2943,
29918,
333,
353,
28646,
29871,
396,
975,
17625,
2400,
411,
7592,
2943,
3553,
746,
4520,
975,
360,
29955,
5067,
13,
1678,
396,
679,
7592,
2943,
1178,
313,
8256,
445,
338,
4520,
975,
360,
29955,
5067,
29897,
13,
1678,
565,
9920,
29889,
13248,
29918,
4882,
2804,
6213,
322,
9920,
29889,
13248,
29918,
4882,
29889,
3372,
392,
29889,
13248,
29918,
333,
1275,
29871,
29900,
29916,
29881,
29955,
29901,
13,
418,
2943,
29918,
333,
353,
22372,
29901,
29916,
29913,
4286,
4830,
29898,
9006,
29889,
13248,
29918,
4882,
29889,
3372,
392,
29889,
13248,
29918,
4882,
29889,
1202,
690,
4149,
29889,
333,
29897,
13,
13,
1678,
396,
1106,
363,
4133,
934,
848,
607,
591,
508,
6088,
29892,
297,
445,
1342,
934,
29871,
29953,
29946,
13,
1678,
590,
29918,
29879,
6073,
29918,
1767,
353,
29871,
29900,
13,
1678,
363,
3158,
297,
9920,
29889,
7387,
29901,
13,
418,
565,
1134,
29898,
2467,
29889,
16453,
29897,
338,
7106,
2283,
1469,
322,
3158,
29889,
3372,
392,
29889,
10289,
29889,
333,
1275,
29871,
29953,
29946,
29901,
13,
4706,
590,
29918,
29879,
6073,
29918,
1767,
353,
2281,
29889,
348,
4058,
703,
29931,
613,
7023,
2378,
29898,
2467,
29889,
3372,
392,
29889,
1272,
876,
29961,
29900,
29962,
396,
6088,
7581,
20092,
313,
1114,
415,
304,
596,
4225,
29897,
13,
4706,
1596,
703,
3177,
6571,
23530,
995,
6571,
1642,
4830,
29898,
3177,
29918,
333,
29892,
590,
29918,
29879,
6073,
29918,
1767,
876,
13,
13,
1678,
396,
4078,
278,
21213,
23530,
848,
408,
385,
5352,
304,
278,
4742,
29892,
773,
278,
323,
29933,
3450,
13,
1678,
1018,
29901,
13,
418,
396,
937,
679,
278,
4742,
1204,
20545,
304,
278,
4742,
1024,
13,
418,
2933,
353,
1583,
29889,
10141,
29918,
8299,
29918,
2754,
29889,
657,
29918,
841,
424,
29918,
10141,
29918,
4746,
29918,
657,
29898,
10141,
29918,
978,
29922,
710,
29898,
3177,
29918,
333,
876,
13,
418,
4742,
29918,
333,
353,
2933,
29889,
333,
29889,
333,
13,
13,
418,
396,
2446,
29892,
679,
278,
2130,
5993,
310,
278,
4742,
13,
418,
2933,
353,
1583,
29889,
10141,
29918,
8299,
29918,
2754,
29889,
657,
29918,
10141,
29918,
11944,
9409,
29918,
1609,
29918,
10141,
29918,
333,
29918,
4746,
29918,
657,
29898,
10141,
29918,
333,
29922,
10141,
29918,
333,
29897,
13,
418,
4742,
29918,
5943,
29918,
6979,
353,
2933,
29889,
11944,
9409,
29918,
333,
13,
13,
418,
396,
7146,
29892,
3787,
278,
23530,
5352,
373,
278,
2943,
297,
323,
29933,
13,
418,
2933,
353,
1583,
29889,
10141,
29918,
2754,
29918,
8299,
29918,
2754,
29889,
2490,
29918,
371,
2409,
27184,
29918,
4746,
29918,
2490,
29898,
13,
4706,
4742,
29918,
6979,
29922,
10141,
29918,
5943,
29918,
6979,
29892,
13,
4706,
4390,
3790,
376,
1357,
29918,
29879,
6073,
1115,
590,
29918,
29879,
6073,
29918,
1767,
500,
13,
418,
1723,
13,
13,
418,
1596,
703,
29248,
590,
29918,
29879,
6073,
5352,
363,
2943,
6571,
1642,
4830,
29898,
3177,
29918,
333,
876,
13,
1678,
5174,
29749,
2451,
408,
321,
29901,
13,
418,
1596,
703,
2451,
746,
5432,
3450,
29901,
1273,
29879,
29905,
29876,
29908,
1273,
321,
29897,
13,
13,
13,
29871,
822,
4770,
6144,
12035,
1311,
1125,
13,
1678,
1018,
29901,
13,
418,
1583,
29889,
28466,
29889,
7888,
29918,
9847,
580,
13,
418,
1583,
29889,
28466,
29889,
2218,
6915,
580,
13,
1678,
5174,
29901,
13,
418,
1209,
13,
13,
29871,
822,
1065,
29898,
1311,
1125,
13,
1678,
1596,
703,
4763,
287,
1159,
13,
1678,
3013,
29918,
21094,
353,
5852,
13,
1678,
1550,
3013,
29918,
21094,
29901,
13,
418,
1018,
29901,
13,
4706,
7182,
29889,
29886,
1071,
580,
13,
418,
5174,
7670,
3377,
4074,
6685,
29901,
13,
4706,
1596,
703,
13556,
2347,
7670,
3377,
4074,
6685,
856,
25480,
9068,
1159,
13,
4706,
3013,
29918,
21094,
353,
7700,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
29871,
7437,
355,
14023,
2141,
3389,
580,
13,
2
] |
lwc/views.py | codingforentrepreneurs/launch-with-code | 64 | 42341 | <reponame>codingforentrepreneurs/launch-with-code
from django.shortcuts import render
def testhome(request):
context = {}
template = "donotuse.html"
return render(request, template, context)
# def home2(request):
# context = {}
# template = "home2.html"
# return render(request, template, context) | [
1,
529,
276,
1112,
420,
29958,
29883,
3689,
1454,
14056,
558,
1600,
1295,
29914,
15343,
29899,
2541,
29899,
401,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
13,
13,
13,
1753,
1243,
5184,
29898,
3827,
1125,
13,
12,
4703,
353,
6571,
13,
12,
6886,
353,
376,
9176,
327,
1509,
29889,
1420,
29908,
13,
12,
2457,
4050,
29898,
3827,
29892,
4472,
29892,
3030,
29897,
13,
13,
13,
29937,
822,
3271,
29906,
29898,
3827,
1125,
13,
29937,
29871,
12,
4703,
353,
6571,
13,
29937,
29871,
12,
6886,
353,
376,
5184,
29906,
29889,
1420,
29908,
13,
29937,
29871,
12,
2457,
4050,
29898,
3827,
29892,
4472,
29892,
3030,
29897,
2
] |
cassiopeia/datastores/riotapi/match.py | artemigkh/cassiopeia | 1 | 8266 | from time import time
from typing import Type, TypeVar, MutableMapping, Any, Iterable, Generator, Union
import arrow
import datetime
import math
from datapipelines import DataSource, PipelineContext, Query, NotFoundError, validate_query
from .common import RiotAPIService, APINotFoundError
from ...data import Platform, Season, Queue, SEASON_IDS, QUEUE_IDS
from ...dto.match import MatchDto, MatchListDto, TimelineDto
from ..uniquekeys import convert_region_to_platform
T = TypeVar("T")
def _get_current_time(query: MutableMapping[str, Any], context: PipelineContext = None) -> int:
return int(time()) * 1000
class MatchAPI(RiotAPIService):
@DataSource.dispatch
def get(self, type: Type[T], query: MutableMapping[str, Any], context: PipelineContext = None) -> T:
pass
@DataSource.dispatch
def get_many(self, type: Type[T], query: MutableMapping[str, Any], context: PipelineContext = None) -> Iterable[T]:
pass
_validate_get_match_query = Query. \
has("id").as_(int).also. \
has("platform").as_(Platform)
@get.register(MatchDto)
@validate_query(_validate_get_match_query, convert_region_to_platform)
def get_match(self, query: MutableMapping[str, Any], context: PipelineContext = None) -> MatchDto:
url = "https://{platform}.api.riotgames.com/lol/match/v4/matches/{id}".format(platform=query["platform"].value.lower(), id=query["id"])
try:
app_limiter, method_limiter = self._get_rate_limiter(query["platform"], "matches/id")
data = self._get(url, {}, app_limiter=app_limiter, method_limiter=method_limiter)
except APINotFoundError as error:
raise NotFoundError(str(error)) from error
data["gameId"] = query["id"]
data["region"] = query["platform"].region.value
for p in data["participantIdentities"]:
aid = p.get("player", {}).get("currentAccountId", None)
if aid == 0:
p["player"]["bot"] = True
return MatchDto(data)
_validate_get_many_match_query = Query. \
has("ids").as_(Iterable).also. \
has("platform").as_(Platform)
@get_many.register(MatchDto)
@validate_query(_validate_get_many_match_query, convert_region_to_platform)
def get_many_match(self, query: MutableMapping[str, Any], context: PipelineContext = None) -> Generator[MatchDto, None, None]:
def generator():
for id in query["ids"]:
url = "https://{platform}.api.riotgames.com/lol/match/v4/matches/{id}".format(platform=query["platform"].value.lower(), id=id)
try:
app_limiter, method_limiter = self._get_rate_limiter(query["platform"], "matches/id")
data = self._get(url, {}, app_limiter=app_limiter, method_limiter=method_limiter)
except APINotFoundError as error:
raise NotFoundError(str(error)) from error
for participant in data["participants"]:
participant.setdefault("runes", [])
for p in data["participantIdentities"]:
aid = p.get("player", {}).get("currentAccountId", None)
if aid == 0:
p["player"]["bot"] = True
data["gameId"] = id
data["region"] = query["platform"].region.value
yield MatchDto(data)
return generator()
_validate_get_match_list_query = Query. \
has("accountId").as_(str).also. \
has("platform").as_(Platform).also. \
has("beginTime").as_(int).also. \
can_have("endTime").as_(int).also. \
has("beginIndex").as_(int).also. \
has("maxNumberOfMatches").as_(float).also. \
can_have("seasons").as_(Iterable).also. \
can_have("champion.ids").as_(Iterable).also. \
can_have("queues").as_(Iterable)
@get.register(MatchListDto)
@validate_query(_validate_get_match_list_query, convert_region_to_platform)
def get_match_list(self, query: MutableMapping[str, Any], context: PipelineContext = None) -> MatchListDto:
params = {}
riot_index_interval = 100
riot_date_interval = datetime.timedelta(days=7)
begin_time = query["beginTime"] # type: arrow.Arrow
end_time = query.get("endTime", arrow.now()) # type: arrow.Arrow
if isinstance(begin_time, int):
begin_time = arrow.get(begin_time / 1000)
if isinstance(end_time, int):
end_time = arrow.get(end_time / 1000)
def determine_calling_method(begin_time, end_time) -> str:
"""Returns either "by_date" or "by_index"."""
matches_per_date_interval = 10 # This is an assumption
seconds_per_day = (60 * 60 * 24)
riot_date_interval_in_days = riot_date_interval.total_seconds() / seconds_per_day # in units of days
npulls_by_date = (end_time - begin_time).total_seconds() / seconds_per_day / riot_date_interval_in_days
npulls_by_index = (arrow.now() - begin_time).total_seconds() / seconds_per_day / riot_date_interval_in_days * matches_per_date_interval / riot_index_interval
if math.ceil(npulls_by_date) < math.ceil(npulls_by_index):
by = "by_date"
else:
by = "by_index"
return by
calling_method = determine_calling_method(begin_time, end_time)
if calling_method == "by_date":
params["beginTime"] = begin_time.timestamp * 1000
if "endTime" in query:
params["endTime"] = min((begin_time + riot_date_interval).timestamp * 1000, query["endTime"])
else:
params["endTime"] = (begin_time + riot_date_interval).timestamp * 1000
else:
params["beginIndex"] = query["beginIndex"]
params["endIndex"] = query["beginIndex"] + min(riot_index_interval, query["maxNumberOfMatches"])
params["endIndex"] = int(params["endIndex"])
if "seasons" in query:
seasons = {Season(season) for season in query["seasons"]}
params["season"] = {SEASON_IDS[season] for season in seasons}
else:
seasons = set()
if "champion.ids" in query:
champions = query["champion.ids"]
params["champion"] = champions
else:
champions = set()
if "queues" in query:
queues = {Queue(queue) for queue in query["queues"]}
params["queue"] = {QUEUE_IDS[queue] for queue in queues}
else:
queues = set()
url = "https://{platform}.api.riotgames.com/lol/match/v4/matchlists/by-account/{accountId}".format(platform=query["platform"].value.lower(), accountId=query["accountId"])
try:
app_limiter, method_limiter = self._get_rate_limiter(query["platform"], "matchlists/by-account/accountId")
data = self._get(url, params, app_limiter=app_limiter, method_limiter=method_limiter)
except APINotFoundError:
data = {"matches": []}
data["accountId"] = query["accountId"]
data["region"] = query["platform"].region.value
data["season"] = seasons
data["champion"] = champions
data["queue"] = queues
if calling_method == "by_index":
data["beginIndex"] = params["beginIndex"]
data["endIndex"] = params["endIndex"]
data["maxNumberOfMatches"] = query["maxNumberOfMatches"]
else:
data["beginTime"] = params["beginTime"]
data["endTime"] = params["endTime"]
for match in data["matches"]:
match["accountId"] = query["accountId"]
match["region"] = Platform(match["platformId"]).region.value
return MatchListDto(data)
_validate_get_many_match_list_query = Query. \
has("accountIds").as_(Iterable).also. \
has("platform").as_(Platform).also. \
can_have("beginTime").as_(int).also. \
can_have("endTime").as_(int).also. \
can_have("beginIndex").as_(int).also. \
can_have("endIndex").as_(int).also. \
can_have("seasons").as_(Iterable).also. \
can_have("champion.ids").as_(Iterable).also. \
can_have("queues").as_(Iterable)
@get_many.register(MatchListDto)
@validate_query(_validate_get_many_match_list_query, convert_region_to_platform)
def get_many_match_list(self, query: MutableMapping[str, Any], context: PipelineContext = None) -> Generator[MatchListDto, None, None]:
params = {}
if "beginIndex" in query:
params["beginIndex"] = query["beginIndex"]
if "endIndex" in query:
params["endIndex"] = query["endIndex"]
if "seasons" in query:
seasons = {Season(season) for season in query["seasons"]}
params["season"] = {SEASON_IDS[season] for season in seasons}
else:
seasons = set()
if "champion.ids" in query:
params["champion"] = {query["champion.ids"]}
if "queues" in query:
queues = {Queue(queue) for queue in query["queues"]}
params["queue"] = {QUEUE_IDS[queue] for queue in queues}
else:
queues = set()
def generator():
for id in query["accountIds"]:
url = "https://{platform}.api.riotgames.com/lol/match/v4/matchlists/by-account/{accountId}".format(platform=query["platform"].value.lower(), accountId=id)
try:
app_limiter, method_limiter = self._get_rate_limiter(query["platform"], "matchlists/by-account/accountId")
data = self._get(url, params, app_limiter=app_limiter, method_limiter=method_limiter)
except APINotFoundError as error:
raise NotFoundError(str(error)) from error
data["accountId"] = id
data["region"] = query["platform"].region.value
if "beginIndex" in query:
data["beginIndex"] = query["beginIndex"]
if "endIndex" in query:
data["endIndex"] = query["endIndex"]
if "seasons" in query:
data["seasons"] = seasons
if "champion.ids" in query:
data["champion"] = params["champion"]
if "queues" in query:
params["queue"] = queues
yield MatchListDto(data)
return generator()
_validate_get_timeline_query = Query. \
has("id").as_(int).also. \
has("platform").as_(Platform)
@get.register(TimelineDto)
@validate_query(_validate_get_timeline_query, convert_region_to_platform)
def get_match_timeline(self, query: MutableMapping[str, Any], context: PipelineContext = None) -> TimelineDto:
url = "https://{platform}.api.riotgames.com/lol/match/v4/timelines/by-match/{id}".format(platform=query["platform"].value.lower(), id=query["id"])
try:
app_limiter, method_limiter = self._get_rate_limiter(query["platform"], "timelines/by-match/id")
data = self._get(url, {}, app_limiter=app_limiter, method_limiter=method_limiter)
except APINotFoundError as error:
raise NotFoundError(str(error)) from error
data["matchId"] = query["id"]
data["region"] = query["platform"].region.value
return TimelineDto(data)
_validate_get_many_timeline_query = Query. \
has("ids").as_(Iterable).also. \
has("platform").as_(Platform)
@get_many.register(TimelineDto)
@validate_query(_validate_get_many_timeline_query, convert_region_to_platform)
def get_many_match_timeline(self, query: MutableMapping[str, Any], context: PipelineContext = None) -> Generator[TimelineDto, None, None]:
def generator():
for id in query["ids"]:
url = "https://{platform}.api.riotgames.com/lol/match/v4/timelines/by-match/{id}".format(platform=query["platform"].value.lower(), id=id)
try:
app_limiter, method_limiter = self._get_rate_limiter(query["platform"], "timelines/by-match/id")
data = self._get(url, {}, app_limiter=app_limiter, method_limiter=method_limiter)
except APINotFoundError as error:
raise NotFoundError(str(error)) from error
data["matchId"] = id
data["region"] = query["platform"].region.value
yield TimelineDto(data)
return generator()
| [
1,
515,
931,
1053,
931,
13,
3166,
19229,
1053,
5167,
29892,
5167,
9037,
29892,
341,
9246,
15845,
29892,
3139,
29892,
20504,
519,
29892,
3251,
1061,
29892,
7761,
13,
5215,
16578,
13,
5215,
12865,
13,
5215,
5844,
13,
13,
3166,
1418,
481,
666,
24210,
1053,
3630,
4435,
29892,
349,
23828,
2677,
29892,
13641,
29892,
2216,
9692,
2392,
29892,
12725,
29918,
1972,
13,
13,
3166,
869,
9435,
1053,
21710,
327,
8787,
3170,
29892,
12279,
1177,
327,
9692,
2392,
13,
3166,
2023,
1272,
1053,
28096,
29892,
24791,
29892,
5462,
434,
29892,
3725,
29909,
3094,
29918,
1367,
29903,
29892,
660,
4462,
4462,
29918,
1367,
29903,
13,
3166,
2023,
29881,
517,
29889,
4352,
1053,
14514,
29928,
517,
29892,
14514,
1293,
29928,
517,
29892,
7870,
5570,
29928,
517,
13,
3166,
6317,
13092,
8149,
1053,
3588,
29918,
12803,
29918,
517,
29918,
12120,
13,
13,
29911,
353,
5167,
9037,
703,
29911,
1159,
13,
13,
13,
1753,
903,
657,
29918,
3784,
29918,
2230,
29898,
1972,
29901,
341,
9246,
15845,
29961,
710,
29892,
3139,
1402,
3030,
29901,
349,
23828,
2677,
353,
6213,
29897,
1599,
938,
29901,
13,
1678,
736,
938,
29898,
2230,
3101,
334,
29871,
29896,
29900,
29900,
29900,
13,
13,
13,
1990,
14514,
8787,
29898,
29934,
24414,
8787,
3170,
1125,
13,
1678,
732,
15559,
29889,
13369,
13,
1678,
822,
679,
29898,
1311,
29892,
1134,
29901,
5167,
29961,
29911,
1402,
2346,
29901,
341,
9246,
15845,
29961,
710,
29892,
3139,
1402,
3030,
29901,
349,
23828,
2677,
353,
6213,
29897,
1599,
323,
29901,
13,
4706,
1209,
13,
13,
1678,
732,
15559,
29889,
13369,
13,
1678,
822,
679,
29918,
13011,
29898,
1311,
29892,
1134,
29901,
5167,
29961,
29911,
1402,
2346,
29901,
341,
9246,
15845,
29961,
710,
29892,
3139,
1402,
3030,
29901,
349,
23828,
2677,
353,
6213,
29897,
1599,
20504,
519,
29961,
29911,
5387,
13,
4706,
1209,
13,
13,
1678,
903,
15480,
29918,
657,
29918,
4352,
29918,
1972,
353,
13641,
29889,
320,
13,
4706,
756,
703,
333,
2564,
294,
23538,
524,
467,
15189,
29889,
320,
13,
4706,
756,
703,
12120,
2564,
294,
23538,
21889,
29897,
13,
13,
1678,
732,
657,
29889,
9573,
29898,
9652,
29928,
517,
29897,
13,
1678,
732,
15480,
29918,
1972,
7373,
15480,
29918,
657,
29918,
4352,
29918,
1972,
29892,
3588,
29918,
12803,
29918,
517,
29918,
12120,
29897,
13,
1678,
822,
679,
29918,
4352,
29898,
1311,
29892,
2346,
29901,
341,
9246,
15845,
29961,
710,
29892,
3139,
1402,
3030,
29901,
349,
23828,
2677,
353,
6213,
29897,
1599,
14514,
29928,
517,
29901,
13,
4706,
3142,
353,
376,
991,
597,
29912,
12120,
1836,
2754,
29889,
374,
327,
29887,
1280,
29889,
510,
29914,
29880,
324,
29914,
4352,
29914,
29894,
29946,
29914,
20317,
19248,
333,
29913,
1642,
4830,
29898,
12120,
29922,
1972,
3366,
12120,
16862,
1767,
29889,
13609,
3285,
1178,
29922,
1972,
3366,
333,
20068,
13,
4706,
1018,
29901,
13,
9651,
623,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
353,
1583,
3032,
657,
29918,
10492,
29918,
2576,
1524,
29898,
1972,
3366,
12120,
12436,
376,
20317,
29914,
333,
1159,
13,
9651,
848,
353,
1583,
3032,
657,
29898,
2271,
29892,
24335,
623,
29918,
2576,
1524,
29922,
932,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
29922,
5696,
29918,
2576,
1524,
29897,
13,
4706,
5174,
12279,
1177,
327,
9692,
2392,
408,
1059,
29901,
13,
9651,
12020,
2216,
9692,
2392,
29898,
710,
29898,
2704,
876,
515,
1059,
13,
13,
4706,
848,
3366,
11802,
1204,
3108,
353,
2346,
3366,
333,
3108,
13,
4706,
848,
3366,
12803,
3108,
353,
2346,
3366,
12120,
16862,
12803,
29889,
1767,
13,
4706,
363,
282,
297,
848,
3366,
1595,
12654,
424,
7648,
1907,
3108,
29901,
13,
9651,
16226,
353,
282,
29889,
657,
703,
9106,
613,
6571,
467,
657,
703,
3784,
10601,
1204,
613,
6213,
29897,
13,
9651,
565,
16226,
1275,
29871,
29900,
29901,
13,
18884,
282,
3366,
9106,
3108,
3366,
7451,
3108,
353,
5852,
13,
4706,
736,
14514,
29928,
517,
29898,
1272,
29897,
13,
13,
1678,
903,
15480,
29918,
657,
29918,
13011,
29918,
4352,
29918,
1972,
353,
13641,
29889,
320,
13,
4706,
756,
703,
4841,
2564,
294,
23538,
13463,
519,
467,
15189,
29889,
320,
13,
4706,
756,
703,
12120,
2564,
294,
23538,
21889,
29897,
13,
13,
1678,
732,
657,
29918,
13011,
29889,
9573,
29898,
9652,
29928,
517,
29897,
13,
1678,
732,
15480,
29918,
1972,
7373,
15480,
29918,
657,
29918,
13011,
29918,
4352,
29918,
1972,
29892,
3588,
29918,
12803,
29918,
517,
29918,
12120,
29897,
13,
1678,
822,
679,
29918,
13011,
29918,
4352,
29898,
1311,
29892,
2346,
29901,
341,
9246,
15845,
29961,
710,
29892,
3139,
1402,
3030,
29901,
349,
23828,
2677,
353,
6213,
29897,
1599,
3251,
1061,
29961,
9652,
29928,
517,
29892,
6213,
29892,
6213,
5387,
13,
4706,
822,
15299,
7295,
13,
9651,
363,
1178,
297,
2346,
3366,
4841,
3108,
29901,
13,
18884,
3142,
353,
376,
991,
597,
29912,
12120,
1836,
2754,
29889,
374,
327,
29887,
1280,
29889,
510,
29914,
29880,
324,
29914,
4352,
29914,
29894,
29946,
29914,
20317,
19248,
333,
29913,
1642,
4830,
29898,
12120,
29922,
1972,
3366,
12120,
16862,
1767,
29889,
13609,
3285,
1178,
29922,
333,
29897,
13,
18884,
1018,
29901,
13,
462,
1678,
623,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
353,
1583,
3032,
657,
29918,
10492,
29918,
2576,
1524,
29898,
1972,
3366,
12120,
12436,
376,
20317,
29914,
333,
1159,
13,
462,
1678,
848,
353,
1583,
3032,
657,
29898,
2271,
29892,
24335,
623,
29918,
2576,
1524,
29922,
932,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
29922,
5696,
29918,
2576,
1524,
29897,
13,
18884,
5174,
12279,
1177,
327,
9692,
2392,
408,
1059,
29901,
13,
462,
1678,
12020,
2216,
9692,
2392,
29898,
710,
29898,
2704,
876,
515,
1059,
13,
462,
13,
18884,
363,
5221,
424,
297,
848,
3366,
1595,
12654,
1934,
3108,
29901,
13,
462,
1678,
5221,
424,
29889,
842,
4381,
703,
3389,
267,
613,
518,
2314,
13,
18884,
363,
282,
297,
848,
3366,
1595,
12654,
424,
7648,
1907,
3108,
29901,
13,
462,
1678,
16226,
353,
282,
29889,
657,
703,
9106,
613,
6571,
467,
657,
703,
3784,
10601,
1204,
613,
6213,
29897,
13,
462,
1678,
565,
16226,
1275,
29871,
29900,
29901,
13,
462,
4706,
282,
3366,
9106,
3108,
3366,
7451,
3108,
353,
5852,
13,
13,
18884,
848,
3366,
11802,
1204,
3108,
353,
1178,
13,
18884,
848,
3366,
12803,
3108,
353,
2346,
3366,
12120,
16862,
12803,
29889,
1767,
13,
18884,
7709,
14514,
29928,
517,
29898,
1272,
29897,
13,
13,
4706,
736,
15299,
580,
13,
13,
1678,
903,
15480,
29918,
657,
29918,
4352,
29918,
1761,
29918,
1972,
353,
13641,
29889,
320,
13,
4706,
756,
703,
10149,
1204,
2564,
294,
23538,
710,
467,
15189,
29889,
320,
13,
4706,
756,
703,
12120,
2564,
294,
23538,
21889,
467,
15189,
29889,
320,
13,
4706,
756,
703,
463,
2481,
2564,
294,
23538,
524,
467,
15189,
29889,
320,
13,
4706,
508,
29918,
17532,
703,
355,
2481,
2564,
294,
23538,
524,
467,
15189,
29889,
320,
13,
4706,
756,
703,
463,
3220,
2564,
294,
23538,
524,
467,
15189,
29889,
320,
13,
4706,
756,
703,
3317,
4557,
2776,
9652,
267,
2564,
294,
23538,
7411,
467,
15189,
29889,
320,
13,
4706,
508,
29918,
17532,
703,
344,
7040,
2564,
294,
23538,
13463,
519,
467,
15189,
29889,
320,
13,
4706,
508,
29918,
17532,
703,
305,
3103,
29889,
4841,
2564,
294,
23538,
13463,
519,
467,
15189,
29889,
320,
13,
4706,
508,
29918,
17532,
703,
802,
1041,
2564,
294,
23538,
13463,
519,
29897,
13,
13,
1678,
732,
657,
29889,
9573,
29898,
9652,
1293,
29928,
517,
29897,
13,
1678,
732,
15480,
29918,
1972,
7373,
15480,
29918,
657,
29918,
4352,
29918,
1761,
29918,
1972,
29892,
3588,
29918,
12803,
29918,
517,
29918,
12120,
29897,
13,
1678,
822,
679,
29918,
4352,
29918,
1761,
29898,
1311,
29892,
2346,
29901,
341,
9246,
15845,
29961,
710,
29892,
3139,
1402,
3030,
29901,
349,
23828,
2677,
353,
6213,
29897,
1599,
14514,
1293,
29928,
517,
29901,
13,
4706,
8636,
353,
6571,
13,
13,
4706,
10107,
327,
29918,
2248,
29918,
19207,
353,
29871,
29896,
29900,
29900,
13,
4706,
10107,
327,
29918,
1256,
29918,
19207,
353,
12865,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29955,
29897,
13,
13,
4706,
3380,
29918,
2230,
353,
2346,
3366,
463,
2481,
3108,
29871,
396,
1134,
29901,
16578,
29889,
1433,
798,
13,
4706,
1095,
29918,
2230,
353,
2346,
29889,
657,
703,
355,
2481,
613,
16578,
29889,
3707,
3101,
29871,
396,
1134,
29901,
16578,
29889,
1433,
798,
13,
4706,
565,
338,
8758,
29898,
463,
29918,
2230,
29892,
938,
1125,
13,
9651,
3380,
29918,
2230,
353,
16578,
29889,
657,
29898,
463,
29918,
2230,
847,
29871,
29896,
29900,
29900,
29900,
29897,
13,
4706,
565,
338,
8758,
29898,
355,
29918,
2230,
29892,
938,
1125,
13,
9651,
1095,
29918,
2230,
353,
16578,
29889,
657,
29898,
355,
29918,
2230,
847,
29871,
29896,
29900,
29900,
29900,
29897,
13,
13,
4706,
822,
8161,
29918,
4804,
292,
29918,
5696,
29898,
463,
29918,
2230,
29892,
1095,
29918,
2230,
29897,
1599,
851,
29901,
13,
9651,
9995,
11609,
29879,
2845,
376,
1609,
29918,
1256,
29908,
470,
376,
1609,
29918,
2248,
29908,
1213,
15945,
13,
9651,
7087,
29918,
546,
29918,
1256,
29918,
19207,
353,
29871,
29896,
29900,
29871,
396,
910,
338,
385,
11833,
13,
9651,
6923,
29918,
546,
29918,
3250,
353,
313,
29953,
29900,
334,
29871,
29953,
29900,
334,
29871,
29906,
29946,
29897,
13,
9651,
10107,
327,
29918,
1256,
29918,
19207,
29918,
262,
29918,
16700,
353,
10107,
327,
29918,
1256,
29918,
19207,
29889,
7827,
29918,
23128,
580,
847,
6923,
29918,
546,
29918,
3250,
29871,
396,
297,
10340,
310,
3841,
13,
9651,
7442,
913,
29879,
29918,
1609,
29918,
1256,
353,
313,
355,
29918,
2230,
448,
3380,
29918,
2230,
467,
7827,
29918,
23128,
580,
847,
6923,
29918,
546,
29918,
3250,
847,
10107,
327,
29918,
1256,
29918,
19207,
29918,
262,
29918,
16700,
13,
9651,
7442,
913,
29879,
29918,
1609,
29918,
2248,
353,
313,
2936,
29889,
3707,
580,
448,
3380,
29918,
2230,
467,
7827,
29918,
23128,
580,
847,
6923,
29918,
546,
29918,
3250,
847,
10107,
327,
29918,
1256,
29918,
19207,
29918,
262,
29918,
16700,
334,
7087,
29918,
546,
29918,
1256,
29918,
19207,
847,
10107,
327,
29918,
2248,
29918,
19207,
13,
9651,
565,
5844,
29889,
27696,
29898,
9302,
913,
29879,
29918,
1609,
29918,
1256,
29897,
529,
5844,
29889,
27696,
29898,
9302,
913,
29879,
29918,
1609,
29918,
2248,
1125,
13,
18884,
491,
353,
376,
1609,
29918,
1256,
29908,
13,
9651,
1683,
29901,
13,
18884,
491,
353,
376,
1609,
29918,
2248,
29908,
13,
9651,
736,
491,
13,
13,
4706,
5432,
29918,
5696,
353,
8161,
29918,
4804,
292,
29918,
5696,
29898,
463,
29918,
2230,
29892,
1095,
29918,
2230,
29897,
13,
13,
4706,
565,
5432,
29918,
5696,
1275,
376,
1609,
29918,
1256,
1115,
13,
9651,
8636,
3366,
463,
2481,
3108,
353,
3380,
29918,
2230,
29889,
16394,
334,
29871,
29896,
29900,
29900,
29900,
13,
9651,
565,
376,
355,
2481,
29908,
297,
2346,
29901,
13,
18884,
8636,
3366,
355,
2481,
3108,
353,
1375,
3552,
463,
29918,
2230,
718,
10107,
327,
29918,
1256,
29918,
19207,
467,
16394,
334,
29871,
29896,
29900,
29900,
29900,
29892,
2346,
3366,
355,
2481,
20068,
13,
9651,
1683,
29901,
13,
18884,
8636,
3366,
355,
2481,
3108,
353,
313,
463,
29918,
2230,
718,
10107,
327,
29918,
1256,
29918,
19207,
467,
16394,
334,
29871,
29896,
29900,
29900,
29900,
13,
4706,
1683,
29901,
13,
9651,
8636,
3366,
463,
3220,
3108,
353,
2346,
3366,
463,
3220,
3108,
13,
9651,
8636,
3366,
355,
3220,
3108,
353,
2346,
3366,
463,
3220,
3108,
718,
1375,
29898,
374,
327,
29918,
2248,
29918,
19207,
29892,
2346,
3366,
3317,
4557,
2776,
9652,
267,
20068,
13,
9651,
8636,
3366,
355,
3220,
3108,
353,
938,
29898,
7529,
3366,
355,
3220,
20068,
13,
13,
4706,
565,
376,
344,
7040,
29908,
297,
2346,
29901,
13,
9651,
20084,
353,
426,
2008,
1658,
29898,
25682,
29897,
363,
4259,
297,
2346,
3366,
344,
7040,
3108,
29913,
13,
9651,
8636,
3366,
25682,
3108,
353,
426,
1660,
29909,
3094,
29918,
1367,
29903,
29961,
25682,
29962,
363,
4259,
297,
20084,
29913,
13,
4706,
1683,
29901,
13,
9651,
20084,
353,
731,
580,
13,
13,
4706,
565,
376,
305,
3103,
29889,
4841,
29908,
297,
2346,
29901,
13,
9651,
29314,
353,
2346,
3366,
305,
3103,
29889,
4841,
3108,
13,
9651,
8636,
3366,
305,
3103,
3108,
353,
29314,
13,
4706,
1683,
29901,
13,
9651,
29314,
353,
731,
580,
13,
13,
4706,
565,
376,
802,
1041,
29908,
297,
2346,
29901,
13,
9651,
712,
1041,
353,
426,
10620,
29898,
9990,
29897,
363,
9521,
297,
2346,
3366,
802,
1041,
3108,
29913,
13,
9651,
8636,
3366,
9990,
3108,
353,
426,
11144,
4462,
29918,
1367,
29903,
29961,
9990,
29962,
363,
9521,
297,
712,
1041,
29913,
13,
4706,
1683,
29901,
13,
9651,
712,
1041,
353,
731,
580,
13,
13,
4706,
3142,
353,
376,
991,
597,
29912,
12120,
1836,
2754,
29889,
374,
327,
29887,
1280,
29889,
510,
29914,
29880,
324,
29914,
4352,
29914,
29894,
29946,
29914,
4352,
21513,
29914,
1609,
29899,
10149,
19248,
10149,
1204,
29913,
1642,
4830,
29898,
12120,
29922,
1972,
3366,
12120,
16862,
1767,
29889,
13609,
3285,
3633,
1204,
29922,
1972,
3366,
10149,
1204,
20068,
13,
4706,
1018,
29901,
13,
9651,
623,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
353,
1583,
3032,
657,
29918,
10492,
29918,
2576,
1524,
29898,
1972,
3366,
12120,
12436,
376,
4352,
21513,
29914,
1609,
29899,
10149,
29914,
10149,
1204,
1159,
13,
9651,
848,
353,
1583,
3032,
657,
29898,
2271,
29892,
8636,
29892,
623,
29918,
2576,
1524,
29922,
932,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
29922,
5696,
29918,
2576,
1524,
29897,
13,
4706,
5174,
12279,
1177,
327,
9692,
2392,
29901,
13,
9651,
848,
353,
8853,
20317,
1115,
5159,
29913,
13,
13,
4706,
848,
3366,
10149,
1204,
3108,
353,
2346,
3366,
10149,
1204,
3108,
13,
4706,
848,
3366,
12803,
3108,
353,
2346,
3366,
12120,
16862,
12803,
29889,
1767,
13,
4706,
848,
3366,
25682,
3108,
353,
20084,
13,
4706,
848,
3366,
305,
3103,
3108,
353,
29314,
13,
4706,
848,
3366,
9990,
3108,
353,
712,
1041,
13,
4706,
565,
5432,
29918,
5696,
1275,
376,
1609,
29918,
2248,
1115,
13,
9651,
848,
3366,
463,
3220,
3108,
353,
8636,
3366,
463,
3220,
3108,
13,
9651,
848,
3366,
355,
3220,
3108,
353,
8636,
3366,
355,
3220,
3108,
13,
9651,
848,
3366,
3317,
4557,
2776,
9652,
267,
3108,
353,
2346,
3366,
3317,
4557,
2776,
9652,
267,
3108,
13,
4706,
1683,
29901,
13,
9651,
848,
3366,
463,
2481,
3108,
353,
8636,
3366,
463,
2481,
3108,
13,
9651,
848,
3366,
355,
2481,
3108,
353,
8636,
3366,
355,
2481,
3108,
13,
4706,
363,
1993,
297,
848,
3366,
20317,
3108,
29901,
13,
9651,
1993,
3366,
10149,
1204,
3108,
353,
2346,
3366,
10149,
1204,
3108,
13,
9651,
1993,
3366,
12803,
3108,
353,
28096,
29898,
4352,
3366,
12120,
1204,
3108,
467,
12803,
29889,
1767,
13,
4706,
736,
14514,
1293,
29928,
517,
29898,
1272,
29897,
13,
13,
1678,
903,
15480,
29918,
657,
29918,
13011,
29918,
4352,
29918,
1761,
29918,
1972,
353,
13641,
29889,
320,
13,
4706,
756,
703,
10149,
21943,
2564,
294,
23538,
13463,
519,
467,
15189,
29889,
320,
13,
4706,
756,
703,
12120,
2564,
294,
23538,
21889,
467,
15189,
29889,
320,
13,
4706,
508,
29918,
17532,
703,
463,
2481,
2564,
294,
23538,
524,
467,
15189,
29889,
320,
13,
4706,
508,
29918,
17532,
703,
355,
2481,
2564,
294,
23538,
524,
467,
15189,
29889,
320,
13,
4706,
508,
29918,
17532,
703,
463,
3220,
2564,
294,
23538,
524,
467,
15189,
29889,
320,
13,
4706,
508,
29918,
17532,
703,
355,
3220,
2564,
294,
23538,
524,
467,
15189,
29889,
320,
13,
4706,
508,
29918,
17532,
703,
344,
7040,
2564,
294,
23538,
13463,
519,
467,
15189,
29889,
320,
13,
4706,
508,
29918,
17532,
703,
305,
3103,
29889,
4841,
2564,
294,
23538,
13463,
519,
467,
15189,
29889,
320,
13,
4706,
508,
29918,
17532,
703,
802,
1041,
2564,
294,
23538,
13463,
519,
29897,
13,
13,
1678,
732,
657,
29918,
13011,
29889,
9573,
29898,
9652,
1293,
29928,
517,
29897,
13,
1678,
732,
15480,
29918,
1972,
7373,
15480,
29918,
657,
29918,
13011,
29918,
4352,
29918,
1761,
29918,
1972,
29892,
3588,
29918,
12803,
29918,
517,
29918,
12120,
29897,
13,
1678,
822,
679,
29918,
13011,
29918,
4352,
29918,
1761,
29898,
1311,
29892,
2346,
29901,
341,
9246,
15845,
29961,
710,
29892,
3139,
1402,
3030,
29901,
349,
23828,
2677,
353,
6213,
29897,
1599,
3251,
1061,
29961,
9652,
1293,
29928,
517,
29892,
6213,
29892,
6213,
5387,
13,
4706,
8636,
353,
6571,
13,
13,
4706,
565,
376,
463,
3220,
29908,
297,
2346,
29901,
13,
9651,
8636,
3366,
463,
3220,
3108,
353,
2346,
3366,
463,
3220,
3108,
13,
13,
4706,
565,
376,
355,
3220,
29908,
297,
2346,
29901,
13,
9651,
8636,
3366,
355,
3220,
3108,
353,
2346,
3366,
355,
3220,
3108,
13,
13,
4706,
565,
376,
344,
7040,
29908,
297,
2346,
29901,
13,
9651,
20084,
353,
426,
2008,
1658,
29898,
25682,
29897,
363,
4259,
297,
2346,
3366,
344,
7040,
3108,
29913,
13,
9651,
8636,
3366,
25682,
3108,
353,
426,
1660,
29909,
3094,
29918,
1367,
29903,
29961,
25682,
29962,
363,
4259,
297,
20084,
29913,
13,
4706,
1683,
29901,
13,
9651,
20084,
353,
731,
580,
13,
13,
4706,
565,
376,
305,
3103,
29889,
4841,
29908,
297,
2346,
29901,
13,
9651,
8636,
3366,
305,
3103,
3108,
353,
426,
1972,
3366,
305,
3103,
29889,
4841,
3108,
29913,
13,
13,
4706,
565,
376,
802,
1041,
29908,
297,
2346,
29901,
13,
9651,
712,
1041,
353,
426,
10620,
29898,
9990,
29897,
363,
9521,
297,
2346,
3366,
802,
1041,
3108,
29913,
13,
9651,
8636,
3366,
9990,
3108,
353,
426,
11144,
4462,
29918,
1367,
29903,
29961,
9990,
29962,
363,
9521,
297,
712,
1041,
29913,
13,
4706,
1683,
29901,
13,
9651,
712,
1041,
353,
731,
580,
13,
13,
4706,
822,
15299,
7295,
13,
9651,
363,
1178,
297,
2346,
3366,
10149,
21943,
3108,
29901,
13,
18884,
3142,
353,
376,
991,
597,
29912,
12120,
1836,
2754,
29889,
374,
327,
29887,
1280,
29889,
510,
29914,
29880,
324,
29914,
4352,
29914,
29894,
29946,
29914,
4352,
21513,
29914,
1609,
29899,
10149,
19248,
10149,
1204,
29913,
1642,
4830,
29898,
12120,
29922,
1972,
3366,
12120,
16862,
1767,
29889,
13609,
3285,
3633,
1204,
29922,
333,
29897,
13,
18884,
1018,
29901,
13,
462,
1678,
623,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
353,
1583,
3032,
657,
29918,
10492,
29918,
2576,
1524,
29898,
1972,
3366,
12120,
12436,
376,
4352,
21513,
29914,
1609,
29899,
10149,
29914,
10149,
1204,
1159,
13,
462,
1678,
848,
353,
1583,
3032,
657,
29898,
2271,
29892,
8636,
29892,
623,
29918,
2576,
1524,
29922,
932,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
29922,
5696,
29918,
2576,
1524,
29897,
13,
18884,
5174,
12279,
1177,
327,
9692,
2392,
408,
1059,
29901,
13,
462,
1678,
12020,
2216,
9692,
2392,
29898,
710,
29898,
2704,
876,
515,
1059,
13,
13,
18884,
848,
3366,
10149,
1204,
3108,
353,
1178,
13,
18884,
848,
3366,
12803,
3108,
353,
2346,
3366,
12120,
16862,
12803,
29889,
1767,
13,
18884,
565,
376,
463,
3220,
29908,
297,
2346,
29901,
13,
462,
1678,
848,
3366,
463,
3220,
3108,
353,
2346,
3366,
463,
3220,
3108,
13,
18884,
565,
376,
355,
3220,
29908,
297,
2346,
29901,
13,
462,
1678,
848,
3366,
355,
3220,
3108,
353,
2346,
3366,
355,
3220,
3108,
13,
18884,
565,
376,
344,
7040,
29908,
297,
2346,
29901,
13,
462,
1678,
848,
3366,
344,
7040,
3108,
353,
20084,
13,
18884,
565,
376,
305,
3103,
29889,
4841,
29908,
297,
2346,
29901,
13,
462,
1678,
848,
3366,
305,
3103,
3108,
353,
8636,
3366,
305,
3103,
3108,
13,
18884,
565,
376,
802,
1041,
29908,
297,
2346,
29901,
13,
462,
1678,
8636,
3366,
9990,
3108,
353,
712,
1041,
13,
18884,
7709,
14514,
1293,
29928,
517,
29898,
1272,
29897,
13,
13,
4706,
736,
15299,
580,
13,
13,
1678,
903,
15480,
29918,
657,
29918,
9346,
5570,
29918,
1972,
353,
13641,
29889,
320,
13,
4706,
756,
703,
333,
2564,
294,
23538,
524,
467,
15189,
29889,
320,
13,
4706,
756,
703,
12120,
2564,
294,
23538,
21889,
29897,
13,
13,
1678,
732,
657,
29889,
9573,
29898,
13711,
5570,
29928,
517,
29897,
13,
1678,
732,
15480,
29918,
1972,
7373,
15480,
29918,
657,
29918,
9346,
5570,
29918,
1972,
29892,
3588,
29918,
12803,
29918,
517,
29918,
12120,
29897,
13,
1678,
822,
679,
29918,
4352,
29918,
9346,
5570,
29898,
1311,
29892,
2346,
29901,
341,
9246,
15845,
29961,
710,
29892,
3139,
1402,
3030,
29901,
349,
23828,
2677,
353,
6213,
29897,
1599,
7870,
5570,
29928,
517,
29901,
13,
4706,
3142,
353,
376,
991,
597,
29912,
12120,
1836,
2754,
29889,
374,
327,
29887,
1280,
29889,
510,
29914,
29880,
324,
29914,
4352,
29914,
29894,
29946,
29914,
9346,
24210,
29914,
1609,
29899,
4352,
19248,
333,
29913,
1642,
4830,
29898,
12120,
29922,
1972,
3366,
12120,
16862,
1767,
29889,
13609,
3285,
1178,
29922,
1972,
3366,
333,
20068,
13,
4706,
1018,
29901,
13,
9651,
623,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
353,
1583,
3032,
657,
29918,
10492,
29918,
2576,
1524,
29898,
1972,
3366,
12120,
12436,
376,
9346,
24210,
29914,
1609,
29899,
4352,
29914,
333,
1159,
13,
9651,
848,
353,
1583,
3032,
657,
29898,
2271,
29892,
24335,
623,
29918,
2576,
1524,
29922,
932,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
29922,
5696,
29918,
2576,
1524,
29897,
13,
4706,
5174,
12279,
1177,
327,
9692,
2392,
408,
1059,
29901,
13,
9651,
12020,
2216,
9692,
2392,
29898,
710,
29898,
2704,
876,
515,
1059,
13,
13,
4706,
848,
3366,
4352,
1204,
3108,
353,
2346,
3366,
333,
3108,
13,
4706,
848,
3366,
12803,
3108,
353,
2346,
3366,
12120,
16862,
12803,
29889,
1767,
13,
4706,
736,
7870,
5570,
29928,
517,
29898,
1272,
29897,
13,
13,
1678,
903,
15480,
29918,
657,
29918,
13011,
29918,
9346,
5570,
29918,
1972,
353,
13641,
29889,
320,
13,
4706,
756,
703,
4841,
2564,
294,
23538,
13463,
519,
467,
15189,
29889,
320,
13,
4706,
756,
703,
12120,
2564,
294,
23538,
21889,
29897,
13,
13,
1678,
732,
657,
29918,
13011,
29889,
9573,
29898,
13711,
5570,
29928,
517,
29897,
13,
1678,
732,
15480,
29918,
1972,
7373,
15480,
29918,
657,
29918,
13011,
29918,
9346,
5570,
29918,
1972,
29892,
3588,
29918,
12803,
29918,
517,
29918,
12120,
29897,
13,
1678,
822,
679,
29918,
13011,
29918,
4352,
29918,
9346,
5570,
29898,
1311,
29892,
2346,
29901,
341,
9246,
15845,
29961,
710,
29892,
3139,
1402,
3030,
29901,
349,
23828,
2677,
353,
6213,
29897,
1599,
3251,
1061,
29961,
13711,
5570,
29928,
517,
29892,
6213,
29892,
6213,
5387,
13,
4706,
822,
15299,
7295,
13,
9651,
363,
1178,
297,
2346,
3366,
4841,
3108,
29901,
13,
18884,
3142,
353,
376,
991,
597,
29912,
12120,
1836,
2754,
29889,
374,
327,
29887,
1280,
29889,
510,
29914,
29880,
324,
29914,
4352,
29914,
29894,
29946,
29914,
9346,
24210,
29914,
1609,
29899,
4352,
19248,
333,
29913,
1642,
4830,
29898,
12120,
29922,
1972,
3366,
12120,
16862,
1767,
29889,
13609,
3285,
1178,
29922,
333,
29897,
13,
18884,
1018,
29901,
13,
462,
1678,
623,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
353,
1583,
3032,
657,
29918,
10492,
29918,
2576,
1524,
29898,
1972,
3366,
12120,
12436,
376,
9346,
24210,
29914,
1609,
29899,
4352,
29914,
333,
1159,
13,
462,
1678,
848,
353,
1583,
3032,
657,
29898,
2271,
29892,
24335,
623,
29918,
2576,
1524,
29922,
932,
29918,
2576,
1524,
29892,
1158,
29918,
2576,
1524,
29922,
5696,
29918,
2576,
1524,
29897,
13,
18884,
5174,
12279,
1177,
327,
9692,
2392,
408,
1059,
29901,
13,
462,
1678,
12020,
2216,
9692,
2392,
29898,
710,
29898,
2704,
876,
515,
1059,
13,
13,
18884,
848,
3366,
4352,
1204,
3108,
353,
1178,
13,
18884,
848,
3366,
12803,
3108,
353,
2346,
3366,
12120,
16862,
12803,
29889,
1767,
13,
18884,
7709,
7870,
5570,
29928,
517,
29898,
1272,
29897,
13,
13,
4706,
736,
15299,
580,
13,
2
] |
queue_services/events-listener/tests/integration/test_worker_queue.py | karthik-aot/sbc-auth | 11 | 109679 | <reponame>karthik-aot/sbc-auth
# Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Test Suite to ensure the worker routines are working as expected."""
import pytest
from auth_api.models import Org as OrgModel
from entity_queue_common.service_utils import subscribe_to_queue
from tests.integration import factory_org_model
from .utils import helper_add_event_to_queue
@pytest.mark.asyncio
async def test_events_listener_queue(app, session, stan_server, event_loop, client_id, events_stan, future):
"""Assert that events can be retrieved and decoded from the Queue."""
# Call back for the subscription
from events_listener.worker import cb_subscription_handler
# vars
org_id = '1'
status = 'lock'
events_subject = 'test_subject'
events_queue = 'test_queue'
events_durable_name = 'test_durable'
# Create a Credit Card Payment
# register the handler to test it
await subscribe_to_queue(events_stan,
events_subject,
events_queue,
events_durable_name,
cb_subscription_handler)
# add an event to queue
await helper_add_event_to_queue(events_stan, events_subject, org_id=org_id,
action=status)
assert True
@pytest.mark.asyncio
async def test_update_internal_payment(app, session, stan_server, event_loop, client_id, events_stan, future):
"""Assert that the update internal payment records works."""
# Call back for the subscription
from events_listener.worker import cb_subscription_handler
events_subject = 'test_subject'
events_queue = 'test_queue'
events_durable_name = 'test_durable'
org = factory_org_model()
id = org.id
# register the handler to test it
await subscribe_to_queue(events_stan,
events_subject,
events_queue,
events_durable_name,
cb_subscription_handler)
# add an event to queue
await helper_add_event_to_queue(events_stan, events_subject, org_id=org.id,
action='lock')
# Get the internal account and invoice and assert that the identifier is new identifier
new_org = OrgModel.find_by_org_id(id)
assert new_org.status_code == 'NSF_SUSPENDED'
| [
1,
529,
276,
1112,
420,
29958,
5689,
386,
638,
29899,
29874,
327,
29914,
29879,
12328,
29899,
5150,
13,
29937,
14187,
1266,
29871,
30211,
29871,
29906,
29900,
29896,
29929,
17325,
310,
4908,
15411,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
15945,
29908,
3057,
2166,
568,
304,
9801,
278,
15645,
6745,
1475,
526,
1985,
408,
3806,
1213,
15945,
13,
13,
5215,
11451,
1688,
13,
3166,
4817,
29918,
2754,
29889,
9794,
1053,
1394,
29887,
408,
1394,
29887,
3195,
13,
3166,
7855,
29918,
9990,
29918,
9435,
29889,
5509,
29918,
13239,
1053,
1014,
13086,
29918,
517,
29918,
9990,
13,
13,
3166,
6987,
29889,
27925,
1053,
12529,
29918,
990,
29918,
4299,
13,
13,
3166,
869,
13239,
1053,
16876,
29918,
1202,
29918,
3696,
29918,
517,
29918,
9990,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
294,
948,
3934,
13,
12674,
822,
1243,
29918,
13604,
29918,
25894,
29918,
9990,
29898,
932,
29892,
4867,
29892,
11075,
29918,
2974,
29892,
1741,
29918,
7888,
29892,
3132,
29918,
333,
29892,
4959,
29918,
14411,
29892,
5434,
1125,
13,
1678,
9995,
14697,
393,
4959,
508,
367,
27387,
322,
1602,
6797,
515,
278,
5462,
434,
1213,
15945,
13,
1678,
396,
8251,
1250,
363,
278,
25691,
13,
1678,
515,
4959,
29918,
25894,
29889,
24602,
1053,
26324,
29918,
1491,
22371,
29918,
13789,
13,
13,
1678,
396,
24987,
13,
1678,
1638,
29918,
333,
353,
525,
29896,
29915,
13,
1678,
4660,
353,
525,
908,
29915,
13,
13,
1678,
4959,
29918,
16009,
353,
525,
1688,
29918,
16009,
29915,
13,
1678,
4959,
29918,
9990,
353,
525,
1688,
29918,
9990,
29915,
13,
1678,
4959,
29918,
29881,
21115,
29918,
978,
353,
525,
1688,
29918,
29881,
21115,
29915,
13,
13,
1678,
396,
6204,
263,
24596,
277,
9160,
14617,
358,
13,
13,
1678,
396,
6036,
278,
7834,
304,
1243,
372,
13,
1678,
7272,
1014,
13086,
29918,
517,
29918,
9990,
29898,
13604,
29918,
14411,
29892,
13,
462,
632,
4959,
29918,
16009,
29892,
13,
462,
632,
4959,
29918,
9990,
29892,
13,
462,
632,
4959,
29918,
29881,
21115,
29918,
978,
29892,
13,
462,
632,
26324,
29918,
1491,
22371,
29918,
13789,
29897,
13,
13,
1678,
396,
788,
385,
1741,
304,
9521,
13,
1678,
7272,
16876,
29918,
1202,
29918,
3696,
29918,
517,
29918,
9990,
29898,
13604,
29918,
14411,
29892,
4959,
29918,
16009,
29892,
1638,
29918,
333,
29922,
990,
29918,
333,
29892,
13,
462,
462,
1678,
3158,
29922,
4882,
29897,
13,
13,
1678,
4974,
5852,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
294,
948,
3934,
13,
12674,
822,
1243,
29918,
5504,
29918,
7564,
29918,
27825,
29898,
932,
29892,
4867,
29892,
11075,
29918,
2974,
29892,
1741,
29918,
7888,
29892,
3132,
29918,
333,
29892,
4959,
29918,
14411,
29892,
5434,
1125,
13,
1678,
9995,
14697,
393,
278,
2767,
7463,
19179,
6475,
1736,
1213,
15945,
13,
1678,
396,
8251,
1250,
363,
278,
25691,
13,
1678,
515,
4959,
29918,
25894,
29889,
24602,
1053,
26324,
29918,
1491,
22371,
29918,
13789,
13,
13,
1678,
4959,
29918,
16009,
353,
525,
1688,
29918,
16009,
29915,
13,
1678,
4959,
29918,
9990,
353,
525,
1688,
29918,
9990,
29915,
13,
1678,
4959,
29918,
29881,
21115,
29918,
978,
353,
525,
1688,
29918,
29881,
21115,
29915,
13,
13,
1678,
1638,
353,
12529,
29918,
990,
29918,
4299,
580,
13,
1678,
1178,
353,
1638,
29889,
333,
13,
1678,
396,
6036,
278,
7834,
304,
1243,
372,
13,
1678,
7272,
1014,
13086,
29918,
517,
29918,
9990,
29898,
13604,
29918,
14411,
29892,
13,
462,
632,
4959,
29918,
16009,
29892,
13,
462,
632,
4959,
29918,
9990,
29892,
13,
462,
632,
4959,
29918,
29881,
21115,
29918,
978,
29892,
13,
462,
632,
26324,
29918,
1491,
22371,
29918,
13789,
29897,
13,
13,
1678,
396,
788,
385,
1741,
304,
9521,
13,
1678,
7272,
16876,
29918,
1202,
29918,
3696,
29918,
517,
29918,
9990,
29898,
13604,
29918,
14411,
29892,
4959,
29918,
16009,
29892,
1638,
29918,
333,
29922,
990,
29889,
333,
29892,
13,
462,
462,
1678,
3158,
2433,
908,
1495,
13,
13,
1678,
396,
3617,
278,
7463,
3633,
322,
297,
14917,
322,
4974,
393,
278,
15882,
338,
716,
15882,
13,
1678,
716,
29918,
990,
353,
1394,
29887,
3195,
29889,
2886,
29918,
1609,
29918,
990,
29918,
333,
29898,
333,
29897,
13,
1678,
4974,
716,
29918,
990,
29889,
4882,
29918,
401,
1275,
525,
3059,
29943,
29918,
29903,
3308,
29925,
1430,
2287,
29928,
29915,
13,
2
] |
PIVX-Discord-master/bot.py | Sieres/PIVX-Discord-Master | 1 | 198646 | <filename>PIVX-Discord-master/bot.py
import discord
from discord.ext import commands
from utils import output, parsing, checks, mysql_module
import os, traceback
config = parsing.parse_json('config.json')
Mysql = mysql_module.Mysql()
bot = commands.Bot(command_prefix="!", description=config["description"])
#command_prefix=commands.when_mentioned
try:
os.remove("log.txt")
except FileNotFoundError:
pass
startup_extensions = os.listdir("./cogs")
if "__pycache__" in startup_extensions:
startup_extensions.remove("__pycache__")
startup_extensions = [ext.replace('.py', '') for ext in startup_extensions]
loaded_extensions = []
@bot.event
async def on_ready():
output.info("Loading {} extension(s)...".format(len(startup_extensions)))
for extension in startup_extensions:
try:
bot.load_extension("cogs.{}".format(extension.replace(".py", "")))
loaded_extensions.append(extension)
except Exception as e:
exc = '{}: {}'.format(type(e).__name__, e)
output.error('Failed to load extension {}\n\t->{}'.format(extension, exc))
output.success('Successfully loaded the following extension(s); {}'.format(loaded_extensions))
async def send_cmd_help(ctx):
if ctx.invoked_subcommand:
pages = bot.formatter.format_help_for(ctx, ctx.invoked_subcommand)
for page in pages:
em = discord.Embed(title="Missing args :x:",
description=page.strip("```").replace('<', '[').replace('>', ']'),
color=discord.Color.red())
await bot.send_message(ctx.message.channel, embed=em)
else:
pages = bot.formatter.format_help_for(ctx, ctx.command)
for page in pages:
em = discord.Embed(title="Missing args :x:",
description=page.strip("```").replace('<', '[').replace('>', ']'),
color=discord.Color.red())
await bot.send_message(ctx.message.channel, embed=em)
@bot.command(pass_context=True)
@commands.check(checks.is_owner)
async def shutdown(ctx):
"""Shut down the bot"""
author = str(ctx.message.author)
try:
await bot.say("Shutting down...")
await bot.logout()
bot.loop.stop()
output.info('{} has shut down the bot...'.format(author))
except Exception as e:
exc = '{}: {}'.format(type(e).__name__, e)
output.error('{} has attempted to shut down the bot, but the following '
'exception occurred;\n\t->{}'.format(author, exc))
@bot.command(pass_context=True)
@commands.check(checks.is_owner)
async def load(ctx, module: str):
"""Load a cog located in /cogs"""
author = str(ctx.message.author)
module = module.strip()
try:
bot.load_extension("cogs.{}".format(module))
output.info('{} loaded module: {}'.format(author, module))
loaded_extensions.append(module)
await bot.say("Successfully loaded {}.py".format(module))
except Exception as e:
exc = '{}: {}'.format(type(e).__name__, e)
output.error('{} attempted to load module \'{}\' but the following '
'exception occured;\n\t->{}'.format(author, module, exc))
await bot.say('Failed to load extension {}\n\t->{}'.format(module, exc))
@bot.command(pass_context=True)
@commands.check(checks.is_owner)
async def unload(ctx, module: str):
"""Unload any loaded cog"""
author = str(ctx.message.author)
module = module.strip()
try:
bot.unload_extension("cogs.{}".format(module))
output.info('{} unloaded module: {}'.format(author, module))
startup_extensions.remove(module)
await bot.say("Successfully unloaded {}.py".format(module))
except Exception as e:
exc = '{}: {}'.format(type(e).__name__, e)
await bot.say('Failed to load extension {}\n\t->{}'.format(module, exc))
@bot.command()
@commands.check(checks.is_owner)
async def loaded():
"""List loaded cogs"""
string = ""
for cog in loaded_extensions:
string += str(cog) + "\n"
await bot.say('Currently loaded extensions:\n```{}```'.format(string))
@bot.command(pass_context=True)
@commands.check(checks.is_owner)
async def restart(ctx):
"""Restart the bot"""
author = str(ctx.message.author)
try:
await bot.say("Restarting...")
await bot.logout()
bot.loop.stop()
output.info('{} has restarted the bot...'.format(author))
os.system('sh restart.sh')
except Exception as e:
exc = '{}: {}'.format(type(e).__name__, e)
output.error('{} has attempted to restart the bot, but the following '
'exception occurred;\n\t->{}'.format(author, exc))
@bot.event
async def on_server_join(server):
output.info("Added to {0}".format(server.name))
Mysql.add_server(server)
for channel in server.channels:
Mysql.add_channel(channel)
await bot.say(server.default_channel,
"Hey {0}, {1} seems nice. To set me up run {2}configure otherwise I will work in all channels".format(
server.owner.mention, server.name, config["prefix"]))
@bot.event
async def on_server_leave(server):
Mysql.remove_server(server)
output.info("Removed from {0}".format(server.name))
@bot.event
async def on_channel_create(channel):
Mysql.add_channel(channel)
channelString = str(channel)
if channelString.startswith("Direct Message"):
output.info(channelString)
else:
output.info("Channel {0} added to {1}".format(channel.name, channel.server.name))
@bot.event
async def on_channel_delete(channel):
Mysql.remove_channel(channel)
output.info("Channel {0} deleted from {1}".format(channel.name, channel.server.name))
@bot.event
async def on_command_error(error, ctx):
channel = ctx.message.channel
if isinstance(error, commands.MissingRequiredArgument):
await send_cmd_help(ctx)
elif isinstance(error, commands.BadArgument):
await send_cmd_help(ctx)
elif isinstance(error, commands.CommandInvokeError):
output.error("Exception in command '{}', {}".format(ctx.command.qualified_name, error.original))
oneliner = "Error in command '{}' - {}: {}\nIf this issue persists, Please report it in the support server.".format(
ctx.command.qualified_name, type(error.original).__name__, str(error.original))
await ctx.bot.send_message(channel, oneliner)
bot.run(config["discord"]["token"])
bot.loop.close()
| [
1,
529,
9507,
29958,
2227,
29963,
29990,
29899,
4205,
16090,
29899,
6207,
29914,
7451,
29889,
2272,
13,
5215,
2313,
536,
13,
3166,
2313,
536,
29889,
1062,
1053,
8260,
13,
3166,
3667,
29879,
1053,
1962,
29892,
13755,
29892,
12747,
29892,
5749,
29918,
5453,
13,
5215,
2897,
29892,
9637,
1627,
13,
13,
2917,
353,
13755,
29889,
5510,
29918,
3126,
877,
2917,
29889,
3126,
1495,
13,
13,
29924,
952,
1519,
353,
5749,
29918,
5453,
29889,
29924,
952,
1519,
580,
13,
13,
7451,
353,
8260,
29889,
29933,
327,
29898,
6519,
29918,
13506,
543,
29991,
613,
6139,
29922,
2917,
3366,
8216,
20068,
13,
29937,
6519,
29918,
13506,
29922,
26381,
29889,
8256,
29918,
358,
28487,
13,
2202,
29901,
13,
1678,
2897,
29889,
5992,
703,
1188,
29889,
3945,
1159,
13,
19499,
3497,
17413,
2392,
29901,
13,
1678,
1209,
13,
13,
2962,
786,
29918,
24299,
353,
2897,
29889,
1761,
3972,
703,
6904,
29883,
12099,
1159,
13,
361,
376,
1649,
2272,
8173,
1649,
29908,
297,
20234,
29918,
24299,
29901,
13,
1678,
20234,
29918,
24299,
29889,
5992,
703,
1649,
2272,
8173,
1649,
1159,
13,
2962,
786,
29918,
24299,
353,
518,
1062,
29889,
6506,
12839,
2272,
742,
27255,
363,
1294,
297,
20234,
29918,
24299,
29962,
13,
15638,
29918,
24299,
353,
5159,
13,
13,
13,
29992,
7451,
29889,
3696,
13,
12674,
822,
373,
29918,
2040,
7295,
13,
1678,
1962,
29889,
3888,
703,
23456,
6571,
6081,
29898,
29879,
467,
636,
1642,
4830,
29898,
2435,
29898,
2962,
786,
29918,
24299,
4961,
13,
13,
1678,
363,
6081,
297,
20234,
29918,
24299,
29901,
13,
4706,
1018,
29901,
13,
9651,
9225,
29889,
1359,
29918,
17588,
703,
29883,
12099,
29889,
8875,
1642,
4830,
29898,
17588,
29889,
6506,
17350,
2272,
613,
5124,
4961,
13,
9651,
7500,
29918,
24299,
29889,
4397,
29898,
17588,
29897,
13,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
5566,
353,
22372,
6177,
6571,
4286,
4830,
29898,
1853,
29898,
29872,
467,
1649,
978,
1649,
29892,
321,
29897,
13,
9651,
1962,
29889,
2704,
877,
17776,
304,
2254,
6081,
426,
1012,
29876,
29905,
29873,
976,
8875,
4286,
4830,
29898,
17588,
29892,
5566,
876,
13,
1678,
1962,
29889,
8698,
877,
14191,
3730,
7500,
278,
1494,
6081,
29898,
29879,
416,
6571,
4286,
4830,
29898,
15638,
29918,
24299,
876,
13,
13,
13,
12674,
822,
3638,
29918,
9006,
29918,
8477,
29898,
13073,
1125,
13,
1678,
565,
12893,
29889,
11569,
12504,
29918,
1491,
6519,
29901,
13,
4706,
6515,
353,
9225,
29889,
689,
2620,
29889,
4830,
29918,
8477,
29918,
1454,
29898,
13073,
29892,
12893,
29889,
11569,
12504,
29918,
1491,
6519,
29897,
13,
4706,
363,
1813,
297,
6515,
29901,
13,
9651,
953,
353,
2313,
536,
29889,
6026,
2580,
29898,
3257,
543,
18552,
292,
6389,
584,
29916,
29901,
613,
13,
462,
1669,
6139,
29922,
3488,
29889,
17010,
703,
28956,
2564,
6506,
877,
29966,
742,
525,
1839,
467,
6506,
877,
29958,
742,
525,
29962,
5477,
13,
462,
1669,
2927,
29922,
2218,
16090,
29889,
3306,
29889,
1127,
3101,
13,
9651,
7272,
9225,
29889,
6717,
29918,
4906,
29898,
13073,
29889,
4906,
29889,
12719,
29892,
8297,
29922,
331,
29897,
13,
1678,
1683,
29901,
13,
4706,
6515,
353,
9225,
29889,
689,
2620,
29889,
4830,
29918,
8477,
29918,
1454,
29898,
13073,
29892,
12893,
29889,
6519,
29897,
13,
4706,
363,
1813,
297,
6515,
29901,
13,
9651,
953,
353,
2313,
536,
29889,
6026,
2580,
29898,
3257,
543,
18552,
292,
6389,
584,
29916,
29901,
613,
13,
462,
1669,
6139,
29922,
3488,
29889,
17010,
703,
28956,
2564,
6506,
877,
29966,
742,
525,
1839,
467,
6506,
877,
29958,
742,
525,
29962,
5477,
13,
462,
1669,
2927,
29922,
2218,
16090,
29889,
3306,
29889,
1127,
3101,
13,
9651,
7272,
9225,
29889,
6717,
29918,
4906,
29898,
13073,
29889,
4906,
29889,
12719,
29892,
8297,
29922,
331,
29897,
13,
13,
13,
29992,
7451,
29889,
6519,
29898,
3364,
29918,
4703,
29922,
5574,
29897,
13,
29992,
26381,
29889,
3198,
29898,
3198,
29879,
29889,
275,
29918,
20348,
29897,
13,
12674,
822,
12522,
3204,
29898,
13073,
1125,
13,
1678,
9995,
2713,
329,
1623,
278,
9225,
15945,
29908,
13,
1678,
4148,
353,
851,
29898,
13073,
29889,
4906,
29889,
8921,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
7272,
9225,
29889,
20834,
703,
2713,
329,
1259,
1623,
856,
1159,
13,
4706,
7272,
9225,
29889,
1188,
449,
580,
13,
4706,
9225,
29889,
7888,
29889,
9847,
580,
13,
4706,
1962,
29889,
3888,
877,
8875,
756,
12522,
1623,
278,
9225,
856,
4286,
4830,
29898,
8921,
876,
13,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
5566,
353,
22372,
6177,
6571,
4286,
4830,
29898,
1853,
29898,
29872,
467,
1649,
978,
1649,
29892,
321,
29897,
13,
4706,
1962,
29889,
2704,
877,
8875,
756,
16388,
304,
12522,
1623,
278,
9225,
29892,
541,
278,
1494,
525,
13,
462,
268,
525,
11739,
10761,
10436,
29876,
29905,
29873,
976,
8875,
4286,
4830,
29898,
8921,
29892,
5566,
876,
13,
13,
13,
29992,
7451,
29889,
6519,
29898,
3364,
29918,
4703,
29922,
5574,
29897,
13,
29992,
26381,
29889,
3198,
29898,
3198,
29879,
29889,
275,
29918,
20348,
29897,
13,
12674,
822,
2254,
29898,
13073,
29892,
3883,
29901,
851,
1125,
13,
1678,
9995,
5896,
263,
274,
468,
5982,
297,
847,
29883,
12099,
15945,
29908,
13,
1678,
4148,
353,
851,
29898,
13073,
29889,
4906,
29889,
8921,
29897,
13,
1678,
3883,
353,
3883,
29889,
17010,
580,
13,
13,
1678,
1018,
29901,
13,
4706,
9225,
29889,
1359,
29918,
17588,
703,
29883,
12099,
29889,
8875,
1642,
4830,
29898,
5453,
876,
13,
4706,
1962,
29889,
3888,
877,
8875,
7500,
3883,
29901,
6571,
4286,
4830,
29898,
8921,
29892,
3883,
876,
13,
4706,
7500,
29918,
24299,
29889,
4397,
29898,
5453,
29897,
13,
4706,
7272,
9225,
29889,
20834,
703,
14191,
3730,
7500,
426,
1836,
2272,
1642,
4830,
29898,
5453,
876,
13,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
5566,
353,
22372,
6177,
6571,
4286,
4830,
29898,
1853,
29898,
29872,
467,
1649,
978,
1649,
29892,
321,
29897,
13,
4706,
1962,
29889,
2704,
877,
8875,
16388,
304,
2254,
3883,
320,
29915,
29912,
1012,
29915,
541,
278,
1494,
525,
13,
462,
268,
525,
11739,
2179,
2955,
10436,
29876,
29905,
29873,
976,
8875,
4286,
4830,
29898,
8921,
29892,
3883,
29892,
5566,
876,
13,
4706,
7272,
9225,
29889,
20834,
877,
17776,
304,
2254,
6081,
426,
1012,
29876,
29905,
29873,
976,
8875,
4286,
4830,
29898,
5453,
29892,
5566,
876,
13,
13,
13,
29992,
7451,
29889,
6519,
29898,
3364,
29918,
4703,
29922,
5574,
29897,
13,
29992,
26381,
29889,
3198,
29898,
3198,
29879,
29889,
275,
29918,
20348,
29897,
13,
12674,
822,
443,
1359,
29898,
13073,
29892,
3883,
29901,
851,
1125,
13,
1678,
9995,
2525,
1359,
738,
7500,
274,
468,
15945,
29908,
13,
1678,
4148,
353,
851,
29898,
13073,
29889,
4906,
29889,
8921,
29897,
13,
1678,
3883,
353,
3883,
29889,
17010,
580,
13,
13,
1678,
1018,
29901,
13,
4706,
9225,
29889,
348,
1359,
29918,
17588,
703,
29883,
12099,
29889,
8875,
1642,
4830,
29898,
5453,
876,
13,
4706,
1962,
29889,
3888,
877,
8875,
443,
15638,
3883,
29901,
6571,
4286,
4830,
29898,
8921,
29892,
3883,
876,
13,
4706,
20234,
29918,
24299,
29889,
5992,
29898,
5453,
29897,
13,
4706,
7272,
9225,
29889,
20834,
703,
14191,
3730,
443,
15638,
426,
1836,
2272,
1642,
4830,
29898,
5453,
876,
13,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
5566,
353,
22372,
6177,
6571,
4286,
4830,
29898,
1853,
29898,
29872,
467,
1649,
978,
1649,
29892,
321,
29897,
13,
4706,
7272,
9225,
29889,
20834,
877,
17776,
304,
2254,
6081,
426,
1012,
29876,
29905,
29873,
976,
8875,
4286,
4830,
29898,
5453,
29892,
5566,
876,
13,
13,
13,
29992,
7451,
29889,
6519,
580,
13,
29992,
26381,
29889,
3198,
29898,
3198,
29879,
29889,
275,
29918,
20348,
29897,
13,
12674,
822,
7500,
7295,
13,
1678,
9995,
1293,
7500,
274,
12099,
15945,
29908,
13,
1678,
1347,
353,
5124,
13,
1678,
363,
274,
468,
297,
7500,
29918,
24299,
29901,
13,
4706,
1347,
4619,
851,
29898,
29883,
468,
29897,
718,
6634,
29876,
29908,
13,
13,
1678,
7272,
9225,
29889,
20834,
877,
7583,
368,
7500,
17752,
3583,
29876,
28956,
8875,
28956,
4286,
4830,
29898,
1807,
876,
13,
13,
13,
29992,
7451,
29889,
6519,
29898,
3364,
29918,
4703,
29922,
5574,
29897,
13,
29992,
26381,
29889,
3198,
29898,
3198,
29879,
29889,
275,
29918,
20348,
29897,
13,
12674,
822,
10715,
29898,
13073,
1125,
13,
1678,
9995,
15078,
442,
278,
9225,
15945,
29908,
13,
1678,
4148,
353,
851,
29898,
13073,
29889,
4906,
29889,
8921,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
7272,
9225,
29889,
20834,
703,
15078,
442,
292,
856,
1159,
13,
4706,
7272,
9225,
29889,
1188,
449,
580,
13,
4706,
9225,
29889,
7888,
29889,
9847,
580,
13,
4706,
1962,
29889,
3888,
877,
8875,
756,
10715,
287,
278,
9225,
856,
4286,
4830,
29898,
8921,
876,
13,
4706,
2897,
29889,
5205,
877,
845,
10715,
29889,
845,
1495,
13,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
5566,
353,
22372,
6177,
6571,
4286,
4830,
29898,
1853,
29898,
29872,
467,
1649,
978,
1649,
29892,
321,
29897,
13,
4706,
1962,
29889,
2704,
877,
8875,
756,
16388,
304,
10715,
278,
9225,
29892,
541,
278,
1494,
525,
13,
462,
268,
525,
11739,
10761,
10436,
29876,
29905,
29873,
976,
8875,
4286,
4830,
29898,
8921,
29892,
5566,
876,
13,
13,
13,
29992,
7451,
29889,
3696,
13,
12674,
822,
373,
29918,
2974,
29918,
7122,
29898,
2974,
1125,
13,
1678,
1962,
29889,
3888,
703,
2528,
287,
304,
426,
29900,
29913,
1642,
4830,
29898,
2974,
29889,
978,
876,
13,
1678,
28924,
1519,
29889,
1202,
29918,
2974,
29898,
2974,
29897,
13,
1678,
363,
8242,
297,
1923,
29889,
305,
12629,
29901,
13,
4706,
28924,
1519,
29889,
1202,
29918,
12719,
29898,
12719,
29897,
13,
1678,
7272,
9225,
29889,
20834,
29898,
2974,
29889,
4381,
29918,
12719,
29892,
13,
462,
29871,
376,
29950,
1032,
426,
29900,
1118,
426,
29896,
29913,
2444,
7575,
29889,
1763,
731,
592,
701,
1065,
426,
29906,
29913,
17591,
6467,
306,
674,
664,
297,
599,
18196,
1642,
4830,
29898,
13,
462,
418,
1923,
29889,
20348,
29889,
358,
291,
29892,
1923,
29889,
978,
29892,
2295,
3366,
13506,
3108,
876,
13,
13,
13,
29992,
7451,
29889,
3696,
13,
12674,
822,
373,
29918,
2974,
29918,
280,
1351,
29898,
2974,
1125,
13,
1678,
28924,
1519,
29889,
5992,
29918,
2974,
29898,
2974,
29897,
13,
1678,
1962,
29889,
3888,
703,
7301,
8238,
515,
426,
29900,
29913,
1642,
4830,
29898,
2974,
29889,
978,
876,
13,
13,
13,
29992,
7451,
29889,
3696,
13,
12674,
822,
373,
29918,
12719,
29918,
3258,
29898,
12719,
1125,
13,
1678,
28924,
1519,
29889,
1202,
29918,
12719,
29898,
12719,
29897,
13,
1678,
8242,
1231,
353,
851,
29898,
12719,
29897,
13,
1678,
565,
8242,
1231,
29889,
27382,
2541,
703,
17392,
7777,
29908,
1125,
13,
4706,
1962,
29889,
3888,
29898,
12719,
1231,
29897,
13,
1678,
1683,
29901,
13,
4706,
1962,
29889,
3888,
703,
13599,
426,
29900,
29913,
2715,
304,
426,
29896,
29913,
1642,
4830,
29898,
12719,
29889,
978,
29892,
8242,
29889,
2974,
29889,
978,
876,
13,
268,
13,
13,
13,
29992,
7451,
29889,
3696,
13,
12674,
822,
373,
29918,
12719,
29918,
8143,
29898,
12719,
1125,
13,
1678,
28924,
1519,
29889,
5992,
29918,
12719,
29898,
12719,
29897,
13,
1678,
1962,
29889,
3888,
703,
13599,
426,
29900,
29913,
11132,
515,
426,
29896,
29913,
1642,
4830,
29898,
12719,
29889,
978,
29892,
8242,
29889,
2974,
29889,
978,
876,
13,
13,
13,
29992,
7451,
29889,
3696,
13,
12674,
822,
373,
29918,
6519,
29918,
2704,
29898,
2704,
29892,
12893,
1125,
13,
1678,
8242,
353,
12893,
29889,
4906,
29889,
12719,
13,
1678,
565,
338,
8758,
29898,
2704,
29892,
8260,
29889,
18552,
292,
19347,
15730,
1125,
13,
4706,
7272,
3638,
29918,
9006,
29918,
8477,
29898,
13073,
29897,
13,
1678,
25342,
338,
8758,
29898,
2704,
29892,
8260,
29889,
22050,
15730,
1125,
13,
4706,
7272,
3638,
29918,
9006,
29918,
8477,
29898,
13073,
29897,
13,
1678,
25342,
338,
8758,
29898,
2704,
29892,
8260,
29889,
6255,
20731,
2392,
1125,
13,
4706,
1962,
29889,
2704,
703,
2451,
297,
1899,
525,
8875,
742,
6571,
1642,
4830,
29898,
13073,
29889,
6519,
29889,
15380,
2164,
29918,
978,
29892,
1059,
29889,
13492,
876,
13,
4706,
373,
295,
4983,
353,
376,
2392,
297,
1899,
525,
8875,
29915,
448,
426,
6177,
426,
1012,
29876,
3644,
445,
2228,
3736,
2879,
29892,
3529,
3461,
372,
297,
278,
2304,
1923,
1213,
29889,
4830,
29898,
13,
9651,
12893,
29889,
6519,
29889,
15380,
2164,
29918,
978,
29892,
1134,
29898,
2704,
29889,
13492,
467,
1649,
978,
1649,
29892,
851,
29898,
2704,
29889,
13492,
876,
13,
4706,
7272,
12893,
29889,
7451,
29889,
6717,
29918,
4906,
29898,
12719,
29892,
373,
295,
4983,
29897,
13,
13,
13,
7451,
29889,
3389,
29898,
2917,
3366,
2218,
16090,
3108,
3366,
6979,
20068,
13,
7451,
29889,
7888,
29889,
5358,
580,
13,
2
] |
cwf2neo/tests/__init__.py | sintax1/cwf2neo | 1 | 27170 | <gh_stars>1-10
import sys # NOQA
import os
current_path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, current_path + '/../')
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
10876,
396,
11698,
29984,
29909,
13,
5215,
2897,
13,
13,
3784,
29918,
2084,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
22168,
1445,
1649,
876,
13,
9675,
29889,
2084,
29889,
7851,
29898,
29900,
29892,
1857,
29918,
2084,
718,
8207,
6995,
1495,
13,
2
] |
common/web_client.py | newsettle/ns4_chatbot | 51 | 26504 | # -*- coding=utf-8 -*-
import urllib2
import json
import logger
import traceback
def send(apiUrl,data,method=None):
logger.debug("调用内部系统[%s],data[%r]",apiUrl,data)
try:
data_json = json.dumps(data)
headers = {'Content-Type': 'application/json'} # 设置数据为json格式,很重要
request = urllib2.Request(url=apiUrl, headers=headers, data=data_json)
if method is not None:
request.get_method = method
response = urllib2.urlopen(request)
result = {'code':response.getcode(),'content':response.read()}
logger.debug("调用[%s]返回结果:%r",apiUrl,result)
return result
except Exception as e:
#traceback.print_stack()
logger.exception(e,"调用内部系统[%s],data[%r],发生错误[%r]", apiUrl, data,e)
return None
if __name__ == "__main__":
logger.init_4_debug()
| [
1,
396,
448,
29930,
29899,
14137,
29922,
9420,
29899,
29947,
448,
29930,
29899,
13,
5215,
3142,
1982,
29906,
13,
5215,
4390,
13,
5215,
17927,
13,
5215,
9637,
1627,
13,
13,
1753,
3638,
29898,
2754,
5983,
29892,
1272,
29892,
5696,
29922,
8516,
1125,
13,
1678,
17927,
29889,
8382,
703,
31268,
30406,
30728,
30636,
31185,
31675,
29961,
29995,
29879,
1402,
1272,
29961,
29995,
29878,
29962,
613,
2754,
5983,
29892,
1272,
29897,
13,
1678,
1018,
29901,
13,
4706,
848,
29918,
3126,
353,
4390,
29889,
29881,
17204,
29898,
1272,
29897,
13,
4706,
9066,
353,
11117,
3916,
29899,
1542,
2396,
525,
6214,
29914,
3126,
10827,
396,
29871,
30872,
30669,
30354,
30763,
30573,
3126,
31168,
30607,
30214,
232,
193,
139,
30908,
30698,
13,
4706,
2009,
353,
3142,
1982,
29906,
29889,
3089,
29898,
2271,
29922,
2754,
5983,
29892,
9066,
29922,
13662,
29892,
848,
29922,
1272,
29918,
3126,
29897,
13,
4706,
565,
1158,
338,
451,
6213,
29901,
13,
9651,
2009,
29889,
657,
29918,
5696,
353,
1158,
13,
13,
4706,
2933,
353,
3142,
1982,
29906,
29889,
332,
417,
2238,
29898,
3827,
29897,
13,
4706,
1121,
353,
11117,
401,
2396,
5327,
29889,
657,
401,
3285,
29915,
3051,
2396,
5327,
29889,
949,
28296,
13,
4706,
17927,
29889,
8382,
703,
31268,
30406,
29961,
29995,
29879,
29962,
31086,
30742,
31320,
30801,
16664,
29878,
613,
2754,
5983,
29892,
2914,
29897,
13,
4706,
736,
1121,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
396,
15003,
1627,
29889,
2158,
29918,
1429,
580,
13,
4706,
17927,
29889,
11739,
29898,
29872,
1699,
31268,
30406,
30728,
30636,
31185,
31675,
29961,
29995,
29879,
1402,
1272,
29961,
29995,
29878,
1402,
30910,
30486,
31745,
235,
178,
178,
29961,
29995,
29878,
29962,
613,
7882,
5983,
29892,
848,
29892,
29872,
29897,
13,
4706,
736,
6213,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
17927,
29889,
2344,
29918,
29946,
29918,
8382,
580,
13,
2
] |
tests/test_write.py | Aquaveo/gsshapyorm | 0 | 116438 | <reponame>Aquaveo/gsshapyorm
"""
********************************************************************************
* Name: Write Tests
* Author: <NAME>
* Created On: May 16, 2013
* Copyright: (c) Brigham Young University 2013
* License: BSD 2-Clause
********************************************************************************
"""
import uuid
import os
from unittest import TestCase, main
from gsshapyorm.orm.file_io import MapTableFile, ProjectFileEventManager, PrecipFile, ChannelInputFile, \
StormPipeNetworkFile, HmetFile, NwsrfsFile, OrographicGageFile, GridPipeFile, GridStreamFile, TimeSeriesFile, \
OutputLocationFile, RasterMapFile, ProjectionFile, ReplaceParamFile, ReplaceValFile, LinkNodeDatasetFile, IndexMap
from gsshapyorm.orm import ProjectFile
from gsshapyorm.lib import db_tools as dbt
class TestWriteMethods(TestCase):
def setUp(self):
# Find db directory path
here = os.path.abspath(os.path.dirname(__file__))
self.dbName = '%s.db' % uuid.uuid4()
self.db_path = os.path.join(here, 'db', 'standard.db')
# Create Test DB
sqlalchemy_url = dbt.init_sqlite_db(self.db_path)
# Define workspace
self.readDirectory = os.path.join(here, 'standard')
self.writeDirectory = os.path.join(here, 'out')
self.original = 'standard'
self.name = 'standard'
self.dir_list = ('run_2014_to_2017', 'run_2014_to_2017_2',
'run_2015_to_2017', 'run_2015_to_2017_1',
'run_2016_to_2017')
for subdir in self.dir_list:
try:
os.mkdir(os.path.join(self.readDirectory, subdir))
except OSError:
pass
# Create DB Sessions
session_maker = dbt.get_sessionmaker(sqlalchemy_url)
readSession = session_maker()
# Instantiate GSSHAPY ProjectFile object
prjR = ProjectFile()
# Invoke read project method
prjR.readProject(directory=self.readDirectory,
projectFileName='standard.prj',
session=readSession)
readSession.close()
# create write session
self.writeSession = session_maker()
def tearDown(self):
self.writeSession.close()
self._delete_extra_dirs()
# Remove temp database
dbt.del_sqlite_db(self.db_path)
# Clear out directory
fileList = os.listdir(self.writeDirectory)
for afile in fileList:
if afile != ".gitignore":
path = os.path.join(self.writeDirectory, afile)
try:
os.remove(path)
except OSError:
pass
def test_project_file_write(self):
"""
Test ProjectFile write method
"""
# Query and invoke write method
self._query_n_write(ProjectFile)
# Test
self._compare_files(self.original, self.name, 'prj')
def test_channel_input_write(self):
"""
Test ChannelInputFile write method
"""
# Query and invoke write method
self._query_n_write(ChannelInputFile)
# Test
self._compare_files(self.original, self.name, 'cif')
def test_map_table_file_write(self):
"""
Test MapTableFile write method
"""
# Query and invoke write method
self._query_n_write(MapTableFile)
# Test
self._compare_files(self.original, self.name, 'cmt')
def test_precip_file_write(self):
"""
Test PrecipFile write method
"""
# Query and invoke write method
self._query_n_write(PrecipFile)
# Test
self._compare_files(self.original, self.name, 'gag')
def test_grid_pipe_file_write(self):
"""
Test GridPipeFile write method
"""
# Query and invoke write method
self._query_n_write(GridPipeFile)
# Test
self._compare_files(self.original, self.name, 'gpi')
def test_grid_stream_file_write(self):
"""
Test GridStreamFile write method
"""
# Query and invoke write method
self._query_n_write(GridStreamFile)
# Test
self._compare_files(self.original, self.name, 'gst')
def test_hmet_file_write(self):
"""
Test HmetFile write method
"""
# Query and invoke write method
self._query_n_write_filename(HmetFile, 'hmet_wes.hmt')
# Test
self._compare_files('hmet_wes', 'hmet_wes', 'hmt')
def test_output_location_file_write(self):
"""
Test OutputLocationFile write method
"""
# Query and invoke write method
self._query_n_write_multiple(OutputLocationFile, 'ihl')
# Test
self._compare_files(self.original, self.name, 'ihl')
def test_link_node_dataset_file_write(self):
"""
Test LinkNodeDatasetFile write method
"""
# Query and invoke write method
self._query_n_write_multiple(LinkNodeDatasetFile, 'cdp')
# Test
self._compare_files(self.original, self.name, 'cdp')
def test_raster_map_file_write(self):
"""
Test RasterMapFile write method
"""
# Query and invoke write method
self._query_n_write_multiple(RasterMapFile, 'msk')
# Test
self._compare_files(self.original, self.name, 'msk')
def test_projection_file_write(self):
"""
Test ProjectionFile write method
"""
# Query and invoke write method
self._query_n_write(ProjectionFile)
# Test
self._compare_files('standard_prj', 'standard_prj', 'pro')
def test_replace_param_file_write(self):
"""
Test ReplaceParamFile write method
"""
# Query and invoke write method
self._query_n_write_filename(ReplaceParamFile, 'replace_param.txt')
# Test
self._compare_files('replace_param', 'replace_param', 'txt')
def test_replace_val_file_write(self):
"""
Test ReplaceValFile write method
"""
# Query and invoke write method
self._query_n_write_filename(ReplaceValFile, 'replace_val.txt')
# Test
self._compare_files('replace_val', 'replace_val', 'txt')
def test_nwsrfs_file_write(self):
"""
Test NwsrfsFile write method
"""
# Query and invoke write method
self._query_n_write_filename(NwsrfsFile, 'nwsrfs_elev.txt')
# Test
self._compare_files('nwsrfs_elev', 'nwsrfs_elev', 'txt')
def test_oro_gage_file_write(self):
"""
Test OrographicGageFile write method
"""
# Query and invoke write method
self._query_n_write_filename(OrographicGageFile, 'oro_gages.txt')
# Test
self._compare_files('oro_gages', 'oro_gages', 'txt')
def test_evt_yml_file_write(self):
"""
Test ProjectFileEventManager write method
"""
# Query and invoke write method
self._query_n_write_filename(ProjectFileEventManager, 'testyml.yml')
# Test
self._compare_files('testyml', 'testyml', 'yml')
def test_evt_yml_file_add_write(self):
"""
Test ProjectFileEventManager add_event write method
"""
# Retrieve ProjectFileEventManager from database
prjEvtMng = self.writeSession.query(ProjectFileEventManager).one()
a = prjEvtMng.add_event(name="event3", subfolder="run_2015_to_2017",
session=self.writeSession)
assert a.name == "event3"
assert a.subfolder == "run_2015_to_2017_2"
a1 = prjEvtMng.add_event(name="event3", subfolder="run_2015_to_2017",
session=self.writeSession)
assert a1.name == "event3"
assert a1.subfolder == "run_2015_to_2017_3"
b = prjEvtMng.generate_event(session=self.writeSession)
assert b.name == "event_1"
assert b.subfolder == "event_1"
b1 = prjEvtMng.generate_event(session=self.writeSession)
assert b1.name == "event_2"
assert b1.subfolder == "event_2"
c = prjEvtMng.add_event(name="event2", subfolder="run_2014_to_2017",
session=self.writeSession)
assert c.name == "event2"
assert c.subfolder == "run_2014_to_2017_3"
c1 = prjEvtMng.add_event(name="event2", subfolder="run_2014_to_2017",
session=self.writeSession)
assert c1.name == "event2"
assert c1.subfolder == "run_2014_to_2017_4"
# Query and invoke write method
self._query_n_write_filename(ProjectFileEventManager, 'testyml2.yml')
# Test
self._compare_files('testyml2', 'testyml2', 'yml')
def test_storm_pipe_network_file_write(self):
"""
Test StormPipeNetworkFile write method
"""
# Query and invoke write method
self._query_n_write(StormPipeNetworkFile)
# Test
self._compare_files(self.original, self.name, 'spn')
def test_time_series_file_write(self):
"""
Test TimeSeriesFile write method
"""
# Query and invoke write method
self._query_n_write_multiple(TimeSeriesFile, 'ohl')
# Test
self._compare_files(self.original, self.name, 'ohl')
def test_index_map_write(self):
"""
Test IndexMap write method
"""
# Retrieve file from database
idx = self.writeSession.query(IndexMap).\
filter(IndexMap.filename == 'Soil.idx').\
one()
# Invoke write method
idx.write(session=self.writeSession,
directory=self.writeDirectory,
name='soil_new_name')
# Test
self._compare_files('Soil', 'soil_new_name', 'idx')
def test_project_file_write_all(self):
"""
Test ProjectFile write all method
"""
# Retrieve ProjectFile from database
projectFile = self.writeSession.query(ProjectFile).one()
# Invoke write all method
projectFile.writeProject(session=self.writeSession,
directory=self.writeDirectory,
name='standard')
# Compare all files
self._compare_directories(self.readDirectory, self.writeDirectory)
def test_project_file_write_input(self):
"""
Test ProjecFile write input method
"""
# Retrieve ProjectFile from database
projectFile = self.writeSession.query(ProjectFile).one()
# Invoke write input method
projectFile.writeInput(session=self.writeSession,
directory=self.writeDirectory,
name='standard')
# Compare all files
self._compare_directories(self.readDirectory, self.writeDirectory)
def test_project_file_write_output(self):
"""
Test ProjectFile write output method
"""
# Retrieve ProjectFile from database
projectFile = self.writeSession.query(ProjectFile).one()
# Invoke write output method
projectFile.writeOutput(session=self.writeSession,
directory=self.writeDirectory,
name='standard')
# Compare all files
self._compare_directories(self.readDirectory, self.writeDirectory)
def _query_n_write(self, fileIO):
"""
Query database and write file method
"""
# Retrieve file from database
instance = self.writeSession.query(fileIO).one()
# Invoke write method
instance.write(session=self.writeSession,
directory=self.writeDirectory,
name=self.name)
def _query_n_write_filename(self, fileIO, filename):
"""
Query database and write file method
"""
# Retrieve file from database
instance = self.writeSession.query(fileIO).one()
# Invoke write method
instance.write(session=self.writeSession,
directory=self.writeDirectory,
name=filename)
def _query_n_write_multiple(self, fileIO, ext):
"""
Query database and write file method for fileIO object that could have multiple extensions
"""
# Retrieve file from database
instance = self.writeSession.query(fileIO).\
filter(fileIO.fileExtension == ext).\
one()
# Invoke write method
instance.write(session=self.writeSession,
directory=self.writeDirectory,
name=self.name)
def _compare_files(self, original, new, ext):
"""
Compare the contents of two files
"""
if ext == 'cmt':
original = '{0}_compare'.format(original)
filenameO = '%s.%s' % (original, ext)
filePathO = os.path.join(self.readDirectory, filenameO)
filenameN = '%s.%s' % (new, ext)
filePathN = os.path.join(self.writeDirectory, filenameN)
with open(filePathO) as fileO:
contentsO = fileO.read()
linesO = contentsO.strip().split()
with open(filePathN) as fileN:
contentsN = fileN.read()
linesN = contentsN.strip().split()
self.assertEqual(linesO, linesN)
def _compare_directories(self, dir1, dir2):
"""
Compare the contents of the files of two directories
"""
self._delete_extra_dirs()
fileList2 = os.listdir(dir2)
for afile in fileList2:
if not os.path.basename(afile).startswith("."):
name = afile.split('.')[0]
ext = afile.split('.')[1]
# Compare files with same name
self._compare_files(name, name, ext)
def _list_compare(self, listone, listtwo):
for one, two in zip(listone, listtwo):
self.assertEqual(one, two)
def _delete_extra_dirs(self):
for subdir in self.dir_list:
try:
os.rmdir(os.path.join(self.readDirectory, subdir))
except OSError:
pass
if __name__ == '__main__':
main()
| [
1,
529,
276,
1112,
420,
29958,
29909,
339,
1351,
29877,
29914,
3174,
845,
27580,
555,
13,
15945,
29908,
13,
7775,
7775,
7775,
7775,
7775,
13,
29930,
4408,
29901,
14350,
4321,
29879,
13,
29930,
13361,
29901,
529,
5813,
29958,
13,
29930,
6760,
630,
1551,
29901,
2610,
29871,
29896,
29953,
29892,
29871,
29906,
29900,
29896,
29941,
13,
29930,
14187,
1266,
29901,
313,
29883,
29897,
1771,
1141,
314,
10443,
3014,
29871,
29906,
29900,
29896,
29941,
13,
29930,
19245,
29901,
350,
7230,
29871,
29906,
29899,
20216,
1509,
13,
7775,
7775,
7775,
7775,
7775,
13,
15945,
29908,
13,
5215,
318,
5416,
13,
5215,
2897,
13,
13,
3166,
443,
27958,
1053,
4321,
8259,
29892,
1667,
13,
13,
3166,
330,
15269,
27580,
555,
29889,
555,
29889,
1445,
29918,
601,
1053,
7315,
3562,
2283,
29892,
8010,
2283,
2624,
3260,
29892,
349,
4361,
29886,
2283,
29892,
17368,
4290,
2283,
29892,
320,
13,
1678,
24444,
12197,
412,
13724,
2283,
29892,
379,
2527,
2283,
29892,
405,
5652,
29878,
5847,
2283,
29892,
438,
307,
4262,
293,
29954,
482,
2283,
29892,
11657,
12197,
412,
2283,
29892,
11657,
3835,
2283,
29892,
5974,
19204,
2283,
29892,
320,
13,
1678,
10604,
6508,
2283,
29892,
390,
1901,
3388,
2283,
29892,
1019,
6929,
2283,
29892,
22108,
4736,
2283,
29892,
22108,
1440,
2283,
29892,
6645,
4247,
16390,
24541,
2283,
29892,
11374,
3388,
13,
3166,
330,
15269,
27580,
555,
29889,
555,
1053,
8010,
2283,
13,
3166,
330,
15269,
27580,
555,
29889,
1982,
1053,
4833,
29918,
8504,
408,
270,
3116,
13,
13,
13,
1990,
4321,
6113,
26112,
29898,
3057,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
396,
10987,
4833,
3884,
2224,
13,
4706,
1244,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
876,
13,
13,
4706,
1583,
29889,
2585,
1170,
353,
14210,
29879,
29889,
2585,
29915,
1273,
318,
5416,
29889,
25118,
29946,
580,
13,
4706,
1583,
29889,
2585,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4150,
29892,
525,
2585,
742,
525,
15770,
29889,
2585,
1495,
13,
13,
4706,
396,
6204,
4321,
6535,
13,
4706,
4576,
284,
305,
6764,
29918,
2271,
353,
270,
3116,
29889,
2344,
29918,
22793,
29918,
2585,
29898,
1311,
29889,
2585,
29918,
2084,
29897,
13,
13,
4706,
396,
22402,
664,
3493,
13,
4706,
1583,
29889,
949,
9882,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4150,
29892,
525,
15770,
1495,
13,
4706,
1583,
29889,
3539,
9882,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4150,
29892,
525,
449,
1495,
13,
4706,
1583,
29889,
13492,
353,
525,
15770,
29915,
13,
4706,
1583,
29889,
978,
353,
525,
15770,
29915,
13,
13,
4706,
1583,
29889,
3972,
29918,
1761,
353,
6702,
3389,
29918,
29906,
29900,
29896,
29946,
29918,
517,
29918,
29906,
29900,
29896,
29955,
742,
525,
3389,
29918,
29906,
29900,
29896,
29946,
29918,
517,
29918,
29906,
29900,
29896,
29955,
29918,
29906,
742,
13,
462,
308,
525,
3389,
29918,
29906,
29900,
29896,
29945,
29918,
517,
29918,
29906,
29900,
29896,
29955,
742,
525,
3389,
29918,
29906,
29900,
29896,
29945,
29918,
517,
29918,
29906,
29900,
29896,
29955,
29918,
29896,
742,
13,
462,
308,
525,
3389,
29918,
29906,
29900,
29896,
29953,
29918,
517,
29918,
29906,
29900,
29896,
29955,
1495,
13,
4706,
363,
1014,
3972,
297,
1583,
29889,
3972,
29918,
1761,
29901,
13,
9651,
1018,
29901,
13,
18884,
2897,
29889,
11256,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
949,
9882,
29892,
1014,
3972,
876,
13,
9651,
5174,
438,
29173,
29901,
13,
18884,
1209,
13,
13,
4706,
396,
6204,
6535,
317,
10964,
13,
4706,
4867,
29918,
28107,
353,
270,
3116,
29889,
657,
29918,
7924,
28107,
29898,
2850,
284,
305,
6764,
29918,
2271,
29897,
13,
4706,
1303,
7317,
353,
4867,
29918,
28107,
580,
13,
13,
4706,
396,
2799,
3656,
403,
402,
1799,
29950,
3301,
29979,
8010,
2283,
1203,
13,
4706,
544,
29926,
29934,
353,
8010,
2283,
580,
13,
13,
4706,
396,
512,
5744,
1303,
2060,
1158,
13,
4706,
544,
29926,
29934,
29889,
949,
7653,
29898,
12322,
29922,
1311,
29889,
949,
9882,
29892,
13,
462,
308,
2060,
17020,
2433,
15770,
29889,
558,
29926,
742,
13,
462,
308,
4867,
29922,
949,
7317,
29897,
13,
13,
4706,
1303,
7317,
29889,
5358,
580,
13,
13,
4706,
396,
1653,
2436,
4867,
13,
4706,
1583,
29889,
3539,
7317,
353,
4867,
29918,
28107,
580,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
1583,
29889,
3539,
7317,
29889,
5358,
580,
13,
4706,
1583,
3032,
8143,
29918,
17833,
29918,
3972,
29879,
580,
13,
13,
4706,
396,
15154,
5694,
2566,
13,
4706,
270,
3116,
29889,
6144,
29918,
22793,
29918,
2585,
29898,
1311,
29889,
2585,
29918,
2084,
29897,
13,
13,
4706,
396,
17732,
714,
3884,
13,
4706,
934,
1293,
353,
2897,
29889,
1761,
3972,
29898,
1311,
29889,
3539,
9882,
29897,
13,
13,
4706,
363,
263,
1445,
297,
934,
1293,
29901,
13,
9651,
565,
263,
1445,
2804,
11393,
5559,
17281,
1115,
13,
18884,
2224,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
3539,
9882,
29892,
263,
1445,
29897,
13,
18884,
1018,
29901,
13,
462,
1678,
2897,
29889,
5992,
29898,
2084,
29897,
13,
18884,
5174,
438,
29173,
29901,
13,
462,
1678,
1209,
13,
13,
1678,
822,
1243,
29918,
4836,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
8010,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29898,
7653,
2283,
29897,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
29898,
1311,
29889,
13492,
29892,
1583,
29889,
978,
29892,
525,
558,
29926,
1495,
13,
13,
1678,
822,
1243,
29918,
12719,
29918,
2080,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
17368,
4290,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29898,
13599,
4290,
2283,
29897,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
29898,
1311,
29889,
13492,
29892,
1583,
29889,
978,
29892,
525,
29883,
361,
1495,
13,
13,
1678,
822,
1243,
29918,
1958,
29918,
2371,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
7315,
3562,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29898,
3388,
3562,
2283,
29897,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
29898,
1311,
29889,
13492,
29892,
1583,
29889,
978,
29892,
525,
29883,
4378,
1495,
13,
13,
1678,
822,
1243,
29918,
1457,
7334,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
349,
4361,
29886,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29898,
29925,
4361,
29886,
2283,
29897,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
29898,
1311,
29889,
13492,
29892,
1583,
29889,
978,
29892,
525,
29887,
351,
1495,
13,
13,
1678,
822,
1243,
29918,
7720,
29918,
17760,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
11657,
12197,
412,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29898,
5756,
12197,
412,
2283,
29897,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
29898,
1311,
29889,
13492,
29892,
1583,
29889,
978,
29892,
525,
29887,
1631,
1495,
13,
13,
1678,
822,
1243,
29918,
7720,
29918,
5461,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
11657,
3835,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29898,
5756,
3835,
2283,
29897,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
29898,
1311,
29889,
13492,
29892,
1583,
29889,
978,
29892,
525,
29887,
303,
1495,
13,
13,
1678,
822,
1243,
29918,
29882,
2527,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
379,
2527,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29918,
9507,
29898,
29950,
2527,
2283,
29892,
525,
29882,
2527,
29918,
29893,
267,
29889,
29882,
4378,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
877,
29882,
2527,
29918,
29893,
267,
742,
525,
29882,
2527,
29918,
29893,
267,
742,
525,
29882,
4378,
1495,
13,
13,
1678,
822,
1243,
29918,
4905,
29918,
5479,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
10604,
6508,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29918,
20787,
29898,
6466,
6508,
2283,
29892,
525,
29875,
4415,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
29898,
1311,
29889,
13492,
29892,
1583,
29889,
978,
29892,
525,
29875,
4415,
1495,
13,
13,
1678,
822,
1243,
29918,
2324,
29918,
3177,
29918,
24713,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
6645,
4247,
16390,
24541,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29918,
20787,
29898,
6595,
4247,
16390,
24541,
2283,
29892,
525,
2252,
29886,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
29898,
1311,
29889,
13492,
29892,
1583,
29889,
978,
29892,
525,
2252,
29886,
1495,
13,
13,
1678,
822,
1243,
29918,
29878,
1901,
29918,
1958,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
390,
1901,
3388,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29918,
20787,
29898,
29934,
1901,
3388,
2283,
29892,
525,
29885,
808,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
29898,
1311,
29889,
13492,
29892,
1583,
29889,
978,
29892,
525,
29885,
808,
1495,
13,
13,
1678,
822,
1243,
29918,
771,
6929,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
1019,
6929,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29898,
1184,
6929,
2283,
29897,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
877,
15770,
29918,
558,
29926,
742,
525,
15770,
29918,
558,
29926,
742,
525,
771,
1495,
13,
13,
1678,
822,
1243,
29918,
6506,
29918,
3207,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
22108,
4736,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29918,
9507,
29898,
20083,
4736,
2283,
29892,
525,
6506,
29918,
3207,
29889,
3945,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
877,
6506,
29918,
3207,
742,
525,
6506,
29918,
3207,
742,
525,
3945,
1495,
13,
13,
1678,
822,
1243,
29918,
6506,
29918,
791,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
22108,
1440,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29918,
9507,
29898,
20083,
1440,
2283,
29892,
525,
6506,
29918,
791,
29889,
3945,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
877,
6506,
29918,
791,
742,
525,
6506,
29918,
791,
742,
525,
3945,
1495,
13,
13,
1678,
822,
1243,
29918,
29876,
5652,
29878,
5847,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
405,
5652,
29878,
5847,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29918,
9507,
29898,
29940,
5652,
29878,
5847,
2283,
29892,
525,
29876,
5652,
29878,
5847,
29918,
29872,
2608,
29889,
3945,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
877,
29876,
5652,
29878,
5847,
29918,
29872,
2608,
742,
525,
29876,
5652,
29878,
5847,
29918,
29872,
2608,
742,
525,
3945,
1495,
13,
13,
1678,
822,
1243,
29918,
5801,
29918,
29887,
482,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
438,
307,
4262,
293,
29954,
482,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29918,
9507,
29898,
29949,
307,
4262,
293,
29954,
482,
2283,
29892,
525,
5801,
29918,
29887,
1179,
29889,
3945,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
877,
5801,
29918,
29887,
1179,
742,
525,
5801,
29918,
29887,
1179,
742,
525,
3945,
1495,
13,
13,
1678,
822,
1243,
29918,
5750,
29873,
29918,
21053,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
8010,
2283,
2624,
3260,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29918,
9507,
29898,
7653,
2283,
2624,
3260,
29892,
525,
1688,
21053,
29889,
21053,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
877,
1688,
21053,
742,
525,
1688,
21053,
742,
525,
21053,
1495,
13,
13,
1678,
822,
1243,
29918,
5750,
29873,
29918,
21053,
29918,
1445,
29918,
1202,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
8010,
2283,
2624,
3260,
788,
29918,
3696,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
4649,
29878,
2418,
8010,
2283,
2624,
3260,
515,
2566,
13,
4706,
544,
29926,
29923,
21908,
29924,
865,
353,
1583,
29889,
3539,
7317,
29889,
1972,
29898,
7653,
2283,
2624,
3260,
467,
650,
580,
13,
13,
4706,
263,
353,
544,
29926,
29923,
21908,
29924,
865,
29889,
1202,
29918,
3696,
29898,
978,
543,
3696,
29941,
613,
1014,
12083,
543,
3389,
29918,
29906,
29900,
29896,
29945,
29918,
517,
29918,
29906,
29900,
29896,
29955,
613,
13,
462,
18884,
4867,
29922,
1311,
29889,
3539,
7317,
29897,
13,
4706,
4974,
263,
29889,
978,
1275,
376,
3696,
29941,
29908,
13,
4706,
4974,
263,
29889,
1491,
12083,
1275,
376,
3389,
29918,
29906,
29900,
29896,
29945,
29918,
517,
29918,
29906,
29900,
29896,
29955,
29918,
29906,
29908,
13,
13,
4706,
263,
29896,
353,
544,
29926,
29923,
21908,
29924,
865,
29889,
1202,
29918,
3696,
29898,
978,
543,
3696,
29941,
613,
1014,
12083,
543,
3389,
29918,
29906,
29900,
29896,
29945,
29918,
517,
29918,
29906,
29900,
29896,
29955,
613,
13,
462,
462,
4867,
29922,
1311,
29889,
3539,
7317,
29897,
13,
4706,
4974,
263,
29896,
29889,
978,
1275,
376,
3696,
29941,
29908,
13,
4706,
4974,
263,
29896,
29889,
1491,
12083,
1275,
376,
3389,
29918,
29906,
29900,
29896,
29945,
29918,
517,
29918,
29906,
29900,
29896,
29955,
29918,
29941,
29908,
13,
13,
4706,
289,
353,
544,
29926,
29923,
21908,
29924,
865,
29889,
17158,
29918,
3696,
29898,
7924,
29922,
1311,
29889,
3539,
7317,
29897,
13,
4706,
4974,
289,
29889,
978,
1275,
376,
3696,
29918,
29896,
29908,
13,
4706,
4974,
289,
29889,
1491,
12083,
1275,
376,
3696,
29918,
29896,
29908,
13,
13,
4706,
289,
29896,
353,
544,
29926,
29923,
21908,
29924,
865,
29889,
17158,
29918,
3696,
29898,
7924,
29922,
1311,
29889,
3539,
7317,
29897,
13,
4706,
4974,
289,
29896,
29889,
978,
1275,
376,
3696,
29918,
29906,
29908,
13,
4706,
4974,
289,
29896,
29889,
1491,
12083,
1275,
376,
3696,
29918,
29906,
29908,
13,
13,
4706,
274,
353,
544,
29926,
29923,
21908,
29924,
865,
29889,
1202,
29918,
3696,
29898,
978,
543,
3696,
29906,
613,
1014,
12083,
543,
3389,
29918,
29906,
29900,
29896,
29946,
29918,
517,
29918,
29906,
29900,
29896,
29955,
613,
13,
462,
18884,
4867,
29922,
1311,
29889,
3539,
7317,
29897,
13,
4706,
4974,
274,
29889,
978,
1275,
376,
3696,
29906,
29908,
13,
4706,
4974,
274,
29889,
1491,
12083,
1275,
376,
3389,
29918,
29906,
29900,
29896,
29946,
29918,
517,
29918,
29906,
29900,
29896,
29955,
29918,
29941,
29908,
13,
13,
4706,
274,
29896,
353,
544,
29926,
29923,
21908,
29924,
865,
29889,
1202,
29918,
3696,
29898,
978,
543,
3696,
29906,
613,
1014,
12083,
543,
3389,
29918,
29906,
29900,
29896,
29946,
29918,
517,
29918,
29906,
29900,
29896,
29955,
613,
13,
462,
462,
4867,
29922,
1311,
29889,
3539,
7317,
29897,
13,
4706,
4974,
274,
29896,
29889,
978,
1275,
376,
3696,
29906,
29908,
13,
4706,
4974,
274,
29896,
29889,
1491,
12083,
1275,
376,
3389,
29918,
29906,
29900,
29896,
29946,
29918,
517,
29918,
29906,
29900,
29896,
29955,
29918,
29946,
29908,
13,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29918,
9507,
29898,
7653,
2283,
2624,
3260,
29892,
525,
1688,
21053,
29906,
29889,
21053,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
877,
1688,
21053,
29906,
742,
525,
1688,
21053,
29906,
742,
525,
21053,
1495,
13,
13,
1678,
822,
1243,
29918,
303,
555,
29918,
17760,
29918,
11618,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
24444,
12197,
412,
13724,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29898,
855,
555,
12197,
412,
13724,
2283,
29897,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
29898,
1311,
29889,
13492,
29892,
1583,
29889,
978,
29892,
525,
1028,
29876,
1495,
13,
13,
1678,
822,
1243,
29918,
2230,
29918,
13757,
29918,
1445,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
5974,
19204,
2283,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
13641,
322,
15928,
2436,
1158,
13,
4706,
1583,
3032,
1972,
29918,
29876,
29918,
3539,
29918,
20787,
29898,
2481,
19204,
2283,
29892,
525,
10330,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
29898,
1311,
29889,
13492,
29892,
1583,
29889,
978,
29892,
525,
10330,
1495,
13,
13,
1678,
822,
1243,
29918,
2248,
29918,
1958,
29918,
3539,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
11374,
3388,
2436,
1158,
13,
4706,
9995,
13,
4706,
396,
4649,
29878,
2418,
934,
515,
2566,
13,
4706,
22645,
353,
1583,
29889,
3539,
7317,
29889,
1972,
29898,
3220,
3388,
467,
29905,
13,
9651,
4175,
29898,
3220,
3388,
29889,
9507,
1275,
525,
6295,
309,
29889,
13140,
2824,
29905,
13,
9651,
697,
580,
13,
13,
4706,
396,
512,
5744,
2436,
1158,
13,
4706,
22645,
29889,
3539,
29898,
7924,
29922,
1311,
29889,
3539,
7317,
29892,
13,
462,
29871,
3884,
29922,
1311,
29889,
3539,
9882,
29892,
13,
462,
29871,
1024,
2433,
578,
309,
29918,
1482,
29918,
978,
1495,
13,
13,
4706,
396,
4321,
13,
4706,
1583,
3032,
18307,
29918,
5325,
877,
6295,
309,
742,
525,
578,
309,
29918,
1482,
29918,
978,
742,
525,
13140,
1495,
13,
13,
1678,
822,
1243,
29918,
4836,
29918,
1445,
29918,
3539,
29918,
497,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
8010,
2283,
2436,
599,
1158,
13,
4706,
9995,
13,
4706,
396,
4649,
29878,
2418,
8010,
2283,
515,
2566,
13,
4706,
2060,
2283,
353,
1583,
29889,
3539,
7317,
29889,
1972,
29898,
7653,
2283,
467,
650,
580,
13,
13,
4706,
396,
512,
5744,
2436,
599,
1158,
13,
4706,
2060,
2283,
29889,
3539,
7653,
29898,
7924,
29922,
1311,
29889,
3539,
7317,
29892,
13,
462,
462,
3884,
29922,
1311,
29889,
3539,
9882,
29892,
13,
462,
462,
1024,
2433,
15770,
1495,
13,
13,
4706,
396,
3831,
598,
599,
2066,
13,
4706,
1583,
3032,
18307,
29918,
11851,
3842,
29898,
1311,
29889,
949,
9882,
29892,
1583,
29889,
3539,
9882,
29897,
13,
13,
1678,
822,
1243,
29918,
4836,
29918,
1445,
29918,
3539,
29918,
2080,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
1019,
29926,
687,
2283,
2436,
1881,
1158,
13,
4706,
9995,
13,
4706,
396,
4649,
29878,
2418,
8010,
2283,
515,
2566,
13,
4706,
2060,
2283,
353,
1583,
29889,
3539,
7317,
29889,
1972,
29898,
7653,
2283,
467,
650,
580,
13,
13,
4706,
396,
512,
5744,
2436,
1881,
1158,
13,
4706,
2060,
2283,
29889,
3539,
4290,
29898,
7924,
29922,
1311,
29889,
3539,
7317,
29892,
13,
462,
1669,
3884,
29922,
1311,
29889,
3539,
9882,
29892,
13,
462,
1669,
1024,
2433,
15770,
1495,
13,
13,
4706,
396,
3831,
598,
599,
2066,
13,
4706,
1583,
3032,
18307,
29918,
11851,
3842,
29898,
1311,
29889,
949,
9882,
29892,
1583,
29889,
3539,
9882,
29897,
13,
13,
1678,
822,
1243,
29918,
4836,
29918,
1445,
29918,
3539,
29918,
4905,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
8010,
2283,
2436,
1962,
1158,
13,
4706,
9995,
13,
4706,
396,
4649,
29878,
2418,
8010,
2283,
515,
2566,
13,
4706,
2060,
2283,
353,
1583,
29889,
3539,
7317,
29889,
1972,
29898,
7653,
2283,
467,
650,
580,
13,
13,
4706,
396,
512,
5744,
2436,
1962,
1158,
13,
4706,
2060,
2283,
29889,
3539,
6466,
29898,
7924,
29922,
1311,
29889,
3539,
7317,
29892,
13,
462,
18884,
3884,
29922,
1311,
29889,
3539,
9882,
29892,
13,
462,
18884,
1024,
2433,
15770,
1495,
13,
13,
4706,
396,
3831,
598,
599,
2066,
13,
4706,
1583,
3032,
18307,
29918,
11851,
3842,
29898,
1311,
29889,
949,
9882,
29892,
1583,
29889,
3539,
9882,
29897,
13,
13,
1678,
822,
903,
1972,
29918,
29876,
29918,
3539,
29898,
1311,
29892,
934,
5971,
1125,
13,
4706,
9995,
13,
4706,
13641,
2566,
322,
2436,
934,
1158,
13,
4706,
9995,
13,
4706,
396,
4649,
29878,
2418,
934,
515,
2566,
13,
4706,
2777,
353,
1583,
29889,
3539,
7317,
29889,
1972,
29898,
1445,
5971,
467,
650,
580,
13,
13,
4706,
396,
512,
5744,
2436,
1158,
13,
4706,
2777,
29889,
3539,
29898,
7924,
29922,
1311,
29889,
3539,
7317,
29892,
13,
462,
539,
3884,
29922,
1311,
29889,
3539,
9882,
29892,
13,
462,
539,
1024,
29922,
1311,
29889,
978,
29897,
13,
13,
1678,
822,
903,
1972,
29918,
29876,
29918,
3539,
29918,
9507,
29898,
1311,
29892,
934,
5971,
29892,
10422,
1125,
13,
4706,
9995,
13,
4706,
13641,
2566,
322,
2436,
934,
1158,
13,
4706,
9995,
13,
4706,
396,
4649,
29878,
2418,
934,
515,
2566,
13,
4706,
2777,
353,
1583,
29889,
3539,
7317,
29889,
1972,
29898,
1445,
5971,
467,
650,
580,
13,
13,
4706,
396,
512,
5744,
2436,
1158,
13,
4706,
2777,
29889,
3539,
29898,
7924,
29922,
1311,
29889,
3539,
7317,
29892,
13,
462,
539,
3884,
29922,
1311,
29889,
3539,
9882,
29892,
13,
462,
539,
1024,
29922,
9507,
29897,
13,
13,
1678,
822,
903,
1972,
29918,
29876,
29918,
3539,
29918,
20787,
29898,
1311,
29892,
934,
5971,
29892,
1294,
1125,
13,
4706,
9995,
13,
4706,
13641,
2566,
322,
2436,
934,
1158,
363,
934,
5971,
1203,
393,
1033,
505,
2999,
17752,
13,
4706,
9995,
13,
4706,
396,
4649,
29878,
2418,
934,
515,
2566,
13,
4706,
2777,
353,
1583,
29889,
3539,
7317,
29889,
1972,
29898,
1445,
5971,
467,
29905,
13,
9651,
4175,
29898,
1445,
5971,
29889,
1445,
17657,
1275,
1294,
467,
29905,
13,
9651,
697,
580,
13,
13,
4706,
396,
512,
5744,
2436,
1158,
13,
4706,
2777,
29889,
3539,
29898,
7924,
29922,
1311,
29889,
3539,
7317,
29892,
13,
462,
539,
3884,
29922,
1311,
29889,
3539,
9882,
29892,
13,
462,
539,
1024,
29922,
1311,
29889,
978,
29897,
13,
13,
1678,
822,
903,
18307,
29918,
5325,
29898,
1311,
29892,
2441,
29892,
716,
29892,
1294,
1125,
13,
4706,
9995,
13,
4706,
3831,
598,
278,
8118,
310,
1023,
2066,
13,
4706,
9995,
13,
4706,
565,
1294,
1275,
525,
29883,
4378,
2396,
13,
9651,
2441,
353,
22372,
29900,
2403,
18307,
4286,
4830,
29898,
13492,
29897,
13,
13,
4706,
10422,
29949,
353,
14210,
29879,
29889,
29995,
29879,
29915,
1273,
313,
13492,
29892,
1294,
29897,
13,
4706,
934,
2605,
29949,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
949,
9882,
29892,
10422,
29949,
29897,
13,
4706,
10422,
29940,
353,
14210,
29879,
29889,
29995,
29879,
29915,
1273,
313,
1482,
29892,
1294,
29897,
13,
4706,
934,
2605,
29940,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
3539,
9882,
29892,
10422,
29940,
29897,
13,
13,
4706,
411,
1722,
29898,
1445,
2605,
29949,
29897,
408,
934,
29949,
29901,
13,
9651,
8118,
29949,
353,
934,
29949,
29889,
949,
580,
13,
9651,
3454,
29949,
353,
8118,
29949,
29889,
17010,
2141,
5451,
580,
13,
13,
4706,
411,
1722,
29898,
1445,
2605,
29940,
29897,
408,
934,
29940,
29901,
13,
9651,
8118,
29940,
353,
934,
29940,
29889,
949,
580,
13,
9651,
3454,
29940,
353,
8118,
29940,
29889,
17010,
2141,
5451,
580,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
9012,
29949,
29892,
3454,
29940,
29897,
13,
13,
1678,
822,
903,
18307,
29918,
11851,
3842,
29898,
1311,
29892,
4516,
29896,
29892,
4516,
29906,
1125,
13,
4706,
9995,
13,
4706,
3831,
598,
278,
8118,
310,
278,
2066,
310,
1023,
17525,
13,
4706,
9995,
13,
4706,
1583,
3032,
8143,
29918,
17833,
29918,
3972,
29879,
580,
13,
13,
4706,
934,
1293,
29906,
353,
2897,
29889,
1761,
3972,
29898,
3972,
29906,
29897,
13,
13,
4706,
363,
263,
1445,
297,
934,
1293,
29906,
29901,
13,
9651,
565,
451,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
29874,
1445,
467,
27382,
2541,
703,
1213,
1125,
13,
18884,
1024,
353,
263,
1445,
29889,
5451,
12839,
29861,
29900,
29962,
13,
18884,
1294,
353,
263,
1445,
29889,
5451,
12839,
29861,
29896,
29962,
13,
13,
18884,
396,
3831,
598,
2066,
411,
1021,
1024,
13,
18884,
1583,
3032,
18307,
29918,
5325,
29898,
978,
29892,
1024,
29892,
1294,
29897,
13,
13,
1678,
822,
903,
1761,
29918,
18307,
29898,
1311,
29892,
1051,
650,
29892,
1051,
10184,
1125,
13,
4706,
363,
697,
29892,
1023,
297,
14319,
29898,
1761,
650,
29892,
1051,
10184,
1125,
13,
9651,
1583,
29889,
9294,
9843,
29898,
650,
29892,
1023,
29897,
13,
13,
1678,
822,
903,
8143,
29918,
17833,
29918,
3972,
29879,
29898,
1311,
1125,
13,
4706,
363,
1014,
3972,
297,
1583,
29889,
3972,
29918,
1761,
29901,
13,
9651,
1018,
29901,
13,
18884,
2897,
29889,
1758,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
949,
9882,
29892,
1014,
3972,
876,
13,
9651,
5174,
438,
29173,
29901,
13,
18884,
1209,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
2
] |
image_extractor.py | IstoVisio/script_image_extractor | 0 | 21160 | import os
import sys
import syglass as sy
from syglass import pyglass
import numpy as np
import tifffile
import subprocess
def extract(projectPath):
project = sy.get_project(projectPath)
head, tail = os.path.split(projectPath)
# Get a dictionary showing the number of blocks in each level
#codebreak()
resolution_map = project.get_resolution_map()
# Calculate the index of the highest resolution level
max_resolution_level = len(resolution_map) - 1
# Determine the number of blocks in this level
block_count = resolution_map[max_resolution_level]
# get size of project
total_size = project.get_size(max_resolution_level)
xsize = total_size[1]
ysize = total_size[2]
zslices = total_size[0]
dimensions = np.asarray([1,xsize, ysize])
offset = np.asarray([0,0,0])
os.chdir(os.path.dirname(projectPath))
for slice in range(zslices):
s = str(slice).zfill(5)
offset[0] = slice
block = project.get_custom_block(0, max_resolution_level, offset, dimensions)
data = block.data
print(s + ".tiff")
tifffile.imwrite(tail + "_" + s + ".tiff", data)
subprocess.run(['explorer', head])
def main():
print("Image Extractor, by <NAME>")
print("Attempts to extract the original data volume from a syGlass project")
print("and write it to a series of TIFF files")
print("---------------------------------------")
print("Usage: Highlight a project and use the Script Launcher in syGlass.")
print("---------------------------------------")
print(sys.argv)
for syGlassProjectPath in sys.argv:
print("Extracting project from: " + syGlassProjectPath)
extract(syGlassProjectPath)
if __name__== "__main__":
main() | [
1,
1053,
2897,
13,
5215,
10876,
13,
5215,
269,
4790,
605,
408,
9878,
13,
3166,
269,
4790,
605,
1053,
19484,
605,
13,
5215,
12655,
408,
7442,
13,
5215,
260,
361,
600,
488,
13,
5215,
1014,
5014,
13,
13,
1753,
6597,
29898,
4836,
2605,
1125,
29871,
13,
12,
4836,
353,
9878,
29889,
657,
29918,
4836,
29898,
4836,
2605,
29897,
13,
12,
2813,
29892,
12464,
353,
2897,
29889,
2084,
29889,
5451,
29898,
4836,
2605,
29897,
13,
12,
29937,
3617,
263,
8600,
6445,
278,
1353,
310,
10930,
297,
1269,
3233,
13,
12,
29937,
401,
8690,
580,
13,
12,
9778,
918,
29918,
1958,
353,
2060,
29889,
657,
29918,
9778,
918,
29918,
1958,
580,
13,
13,
12,
29937,
20535,
403,
278,
2380,
310,
278,
9939,
10104,
3233,
13,
12,
3317,
29918,
9778,
918,
29918,
5563,
353,
7431,
29898,
9778,
918,
29918,
1958,
29897,
448,
29871,
29896,
13,
13,
12,
29937,
5953,
837,
457,
278,
1353,
310,
10930,
297,
445,
3233,
13,
12,
1271,
29918,
2798,
353,
10104,
29918,
1958,
29961,
3317,
29918,
9778,
918,
29918,
5563,
29962,
13,
12,
13,
12,
29937,
679,
2159,
310,
2060,
4706,
13,
12,
7827,
29918,
2311,
353,
2060,
29889,
657,
29918,
2311,
29898,
3317,
29918,
9778,
918,
29918,
5563,
29897,
13,
12,
13,
12,
29916,
2311,
353,
3001,
29918,
2311,
29961,
29896,
29962,
13,
12,
952,
675,
353,
3001,
29918,
2311,
29961,
29906,
29962,
13,
12,
13,
12,
22381,
29399,
353,
3001,
29918,
2311,
29961,
29900,
29962,
13,
12,
13,
12,
6229,
5580,
353,
7442,
29889,
294,
2378,
4197,
29896,
29892,
29916,
2311,
29892,
343,
2311,
2314,
13,
12,
10289,
353,
7442,
29889,
294,
2378,
4197,
29900,
29892,
29900,
29892,
29900,
2314,
13,
12,
359,
29889,
305,
3972,
29898,
359,
29889,
2084,
29889,
25721,
29898,
4836,
2605,
876,
13,
12,
1454,
22780,
297,
3464,
29898,
22381,
29399,
1125,
13,
12,
12,
29879,
353,
851,
29898,
18337,
467,
29920,
5589,
29898,
29945,
29897,
13,
12,
12,
10289,
29961,
29900,
29962,
353,
22780,
13,
12,
12,
1271,
353,
2060,
29889,
657,
29918,
6341,
29918,
1271,
29898,
29900,
29892,
4236,
29918,
9778,
918,
29918,
5563,
29892,
9210,
29892,
13391,
29897,
13,
12,
12,
1272,
353,
2908,
29889,
1272,
13,
12,
12,
2158,
29898,
29879,
718,
11393,
29873,
2593,
1159,
13,
12,
12,
29873,
361,
600,
488,
29889,
326,
3539,
29898,
18237,
718,
11119,
29908,
718,
269,
718,
11393,
29873,
2593,
613,
848,
29897,
13,
12,
1491,
5014,
29889,
3389,
18959,
735,
14716,
742,
2343,
2314,
13,
13,
1753,
1667,
7295,
13,
12,
2158,
703,
2940,
7338,
28891,
29892,
491,
529,
5813,
29958,
1159,
13,
12,
2158,
703,
4165,
3456,
29879,
304,
6597,
278,
2441,
848,
7977,
515,
263,
9878,
29954,
605,
2060,
1159,
13,
12,
2158,
703,
392,
2436,
372,
304,
263,
3652,
310,
323,
29902,
4198,
2066,
1159,
13,
12,
2158,
703,
2683,
2683,
26589,
1159,
13,
12,
2158,
703,
27573,
29901,
5057,
4366,
263,
2060,
322,
671,
278,
14415,
997,
3322,
261,
297,
9878,
29954,
605,
23157,
13,
12,
2158,
703,
2683,
2683,
26589,
1159,
13,
13,
12,
2158,
29898,
9675,
29889,
19218,
29897,
13,
12,
1454,
9878,
29954,
605,
7653,
2605,
297,
10876,
29889,
19218,
29901,
13,
12,
12,
2158,
703,
5647,
1461,
292,
2060,
515,
29901,
376,
718,
9878,
29954,
605,
7653,
2605,
29897,
13,
12,
12,
21111,
29898,
29879,
29891,
29954,
605,
7653,
2605,
29897,
13,
13,
361,
4770,
978,
1649,
1360,
376,
1649,
3396,
1649,
1115,
13,
12,
3396,
580,
2
] |
src/TMscore_test.py | h3nnn4n/TMscore.py | 2 | 190954 | <filename>src/TMscore_test.py
import pytest
from TMscore import TMscore
def test_init():
tmscore = TMscore("./TMscore")
assert tmscore is not None
def test_init_no_args():
tmscore = TMscore()
assert tmscore is not None
def test_init_wrong_path():
with pytest.raises(FileNotFoundError):
TMscore('this path is bananas')
def test_call():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
data = tmscore.get_all()
assert data['gdt_ha'] == (0.2772, (0.1304, 0.1957, 0.2609, 0.5217))
assert data['gdt_ts'] == (0.4402, (0.1957, 0.2609, 0.5217, 0.7826))
assert data['maxsub'] == 0.3286
assert data['tm_score'] == 0.2875
assert data['rmsd'] == 6.709
def test_get_rmsd():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_rmsd() == 6.709
def test_get_tm_score():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_tm_score() == 0.2875
def test_get_gdt_ts():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_gdt_ts() == 0.4402
def test_get_gdt_ts_info():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_gdt_ts_info() == (0.4402, (0.1957, 0.2609, 0.5217, 0.7826))
def test_get_gdt_ha():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_gdt_ha() == 0.2772
def test_get_gdt_ha_info():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_gdt_ha_info() == (0.2772, (0.1304, 0.1957, 0.2609, 0.5217))
def test_get_maxsub():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_maxsub() == 0.3286
| [
1,
529,
9507,
29958,
4351,
29914,
23081,
13628,
29918,
1688,
29889,
2272,
13,
5215,
11451,
1688,
13,
3166,
323,
29924,
13628,
1053,
323,
29924,
13628,
13,
13,
13,
1753,
1243,
29918,
2344,
7295,
13,
1678,
260,
1516,
3221,
353,
323,
29924,
13628,
703,
6904,
23081,
13628,
1159,
13,
1678,
4974,
260,
1516,
3221,
338,
451,
6213,
13,
13,
13,
1753,
1243,
29918,
2344,
29918,
1217,
29918,
5085,
7295,
13,
1678,
260,
1516,
3221,
353,
323,
29924,
13628,
580,
13,
1678,
4974,
260,
1516,
3221,
338,
451,
6213,
13,
13,
13,
1753,
1243,
29918,
2344,
29918,
15866,
549,
29918,
2084,
7295,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
2283,
17413,
2392,
1125,
13,
4706,
323,
29924,
13628,
877,
1366,
2224,
338,
9892,
16397,
1495,
13,
13,
13,
1753,
1243,
29918,
4804,
7295,
13,
1678,
260,
1516,
3221,
353,
323,
29924,
13628,
703,
6904,
23081,
13628,
1159,
13,
1678,
260,
1516,
3221,
703,
6995,
14676,
1144,
29914,
29896,
7283,
29876,
29889,
29886,
2585,
613,
376,
6995,
14676,
1144,
29914,
13318,
29889,
29886,
2585,
1159,
13,
1678,
848,
353,
260,
1516,
3221,
29889,
657,
29918,
497,
580,
13,
13,
1678,
4974,
848,
1839,
29887,
6008,
29918,
2350,
2033,
1275,
313,
29900,
29889,
29906,
29955,
29955,
29906,
29892,
313,
29900,
29889,
29896,
29941,
29900,
29946,
29892,
29871,
29900,
29889,
29896,
29929,
29945,
29955,
29892,
29871,
29900,
29889,
29906,
29953,
29900,
29929,
29892,
29871,
29900,
29889,
29945,
29906,
29896,
29955,
876,
13,
1678,
4974,
848,
1839,
29887,
6008,
29918,
1372,
2033,
1275,
313,
29900,
29889,
29946,
29946,
29900,
29906,
29892,
313,
29900,
29889,
29896,
29929,
29945,
29955,
29892,
29871,
29900,
29889,
29906,
29953,
29900,
29929,
29892,
29871,
29900,
29889,
29945,
29906,
29896,
29955,
29892,
29871,
29900,
29889,
29955,
29947,
29906,
29953,
876,
13,
1678,
4974,
848,
1839,
3317,
1491,
2033,
1275,
29871,
29900,
29889,
29941,
29906,
29947,
29953,
13,
1678,
4974,
848,
1839,
18276,
29918,
13628,
2033,
1275,
29871,
29900,
29889,
29906,
29947,
29955,
29945,
13,
1678,
4974,
848,
1839,
29878,
1516,
29881,
2033,
1275,
29871,
29953,
29889,
29955,
29900,
29929,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
29878,
1516,
29881,
7295,
13,
1678,
260,
1516,
3221,
353,
323,
29924,
13628,
703,
6904,
23081,
13628,
1159,
13,
1678,
260,
1516,
3221,
703,
6995,
14676,
1144,
29914,
29896,
7283,
29876,
29889,
29886,
2585,
613,
376,
6995,
14676,
1144,
29914,
13318,
29889,
29886,
2585,
1159,
13,
13,
1678,
4974,
260,
1516,
3221,
29889,
657,
29918,
29878,
1516,
29881,
580,
1275,
29871,
29953,
29889,
29955,
29900,
29929,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
18276,
29918,
13628,
7295,
13,
1678,
260,
1516,
3221,
353,
323,
29924,
13628,
703,
6904,
23081,
13628,
1159,
13,
1678,
260,
1516,
3221,
703,
6995,
14676,
1144,
29914,
29896,
7283,
29876,
29889,
29886,
2585,
613,
376,
6995,
14676,
1144,
29914,
13318,
29889,
29886,
2585,
1159,
13,
13,
1678,
4974,
260,
1516,
3221,
29889,
657,
29918,
18276,
29918,
13628,
580,
1275,
29871,
29900,
29889,
29906,
29947,
29955,
29945,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
29887,
6008,
29918,
1372,
7295,
13,
1678,
260,
1516,
3221,
353,
323,
29924,
13628,
703,
6904,
23081,
13628,
1159,
13,
1678,
260,
1516,
3221,
703,
6995,
14676,
1144,
29914,
29896,
7283,
29876,
29889,
29886,
2585,
613,
376,
6995,
14676,
1144,
29914,
13318,
29889,
29886,
2585,
1159,
13,
13,
1678,
4974,
260,
1516,
3221,
29889,
657,
29918,
29887,
6008,
29918,
1372,
580,
1275,
29871,
29900,
29889,
29946,
29946,
29900,
29906,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
29887,
6008,
29918,
1372,
29918,
3888,
7295,
13,
1678,
260,
1516,
3221,
353,
323,
29924,
13628,
703,
6904,
23081,
13628,
1159,
13,
1678,
260,
1516,
3221,
703,
6995,
14676,
1144,
29914,
29896,
7283,
29876,
29889,
29886,
2585,
613,
376,
6995,
14676,
1144,
29914,
13318,
29889,
29886,
2585,
1159,
13,
13,
1678,
4974,
260,
1516,
3221,
29889,
657,
29918,
29887,
6008,
29918,
1372,
29918,
3888,
580,
1275,
313,
29900,
29889,
29946,
29946,
29900,
29906,
29892,
313,
29900,
29889,
29896,
29929,
29945,
29955,
29892,
29871,
29900,
29889,
29906,
29953,
29900,
29929,
29892,
29871,
29900,
29889,
29945,
29906,
29896,
29955,
29892,
29871,
29900,
29889,
29955,
29947,
29906,
29953,
876,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
29887,
6008,
29918,
2350,
7295,
13,
1678,
260,
1516,
3221,
353,
323,
29924,
13628,
703,
6904,
23081,
13628,
1159,
13,
1678,
260,
1516,
3221,
703,
6995,
14676,
1144,
29914,
29896,
7283,
29876,
29889,
29886,
2585,
613,
376,
6995,
14676,
1144,
29914,
13318,
29889,
29886,
2585,
1159,
13,
13,
1678,
4974,
260,
1516,
3221,
29889,
657,
29918,
29887,
6008,
29918,
2350,
580,
1275,
29871,
29900,
29889,
29906,
29955,
29955,
29906,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
29887,
6008,
29918,
2350,
29918,
3888,
7295,
13,
1678,
260,
1516,
3221,
353,
323,
29924,
13628,
703,
6904,
23081,
13628,
1159,
13,
1678,
260,
1516,
3221,
703,
6995,
14676,
1144,
29914,
29896,
7283,
29876,
29889,
29886,
2585,
613,
376,
6995,
14676,
1144,
29914,
13318,
29889,
29886,
2585,
1159,
13,
13,
1678,
4974,
260,
1516,
3221,
29889,
657,
29918,
29887,
6008,
29918,
2350,
29918,
3888,
580,
1275,
313,
29900,
29889,
29906,
29955,
29955,
29906,
29892,
313,
29900,
29889,
29896,
29941,
29900,
29946,
29892,
29871,
29900,
29889,
29896,
29929,
29945,
29955,
29892,
29871,
29900,
29889,
29906,
29953,
29900,
29929,
29892,
29871,
29900,
29889,
29945,
29906,
29896,
29955,
876,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
3317,
1491,
7295,
13,
1678,
260,
1516,
3221,
353,
323,
29924,
13628,
703,
6904,
23081,
13628,
1159,
13,
1678,
260,
1516,
3221,
703,
6995,
14676,
1144,
29914,
29896,
7283,
29876,
29889,
29886,
2585,
613,
376,
6995,
14676,
1144,
29914,
13318,
29889,
29886,
2585,
1159,
13,
13,
1678,
4974,
260,
1516,
3221,
29889,
657,
29918,
3317,
1491,
580,
1275,
29871,
29900,
29889,
29941,
29906,
29947,
29953,
13,
2
] |
src/apytizer/utils/__init__.py | seanssullivan/apytizer | 1 | 1614662 | <filename>src/apytizer/utils/__init__.py
# -*- coding: utf-8 -*-
# pylint: skip-file
from .generate_key import generate_key
from .merge import merge
| [
1,
529,
9507,
29958,
4351,
29914,
481,
3637,
3950,
29914,
13239,
29914,
1649,
2344,
26914,
2272,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
29937,
282,
2904,
524,
29901,
14383,
29899,
1445,
13,
13,
3166,
869,
17158,
29918,
1989,
1053,
5706,
29918,
1989,
13,
3166,
869,
14634,
1053,
10366,
13,
2
] |
lists_carousels/urls.py | snoop2head/exercise_curation_django | 3 | 122663 | <gh_stars>1-10
from django.urls import path
from . import views
# making separate urls.py for rooms
app_name = "lists_carousels"
# receiving "localhost/rooms/110230" to use it as primary key for database
urlpatterns = []
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
9557,
29889,
26045,
1053,
2224,
13,
3166,
869,
1053,
8386,
13,
13,
29937,
3907,
5004,
23942,
29889,
2272,
363,
19600,
13,
932,
29918,
978,
353,
376,
21513,
29918,
4287,
681,
1379,
29908,
13,
13,
29937,
13442,
376,
7640,
29914,
18901,
29914,
29896,
29896,
29900,
29906,
29941,
29900,
29908,
304,
671,
372,
408,
7601,
1820,
363,
2566,
13,
2271,
11037,
29879,
353,
5159,
13,
2
] |
forms/TranslationForm.py | greshniksv/PBDatabaseGenerator | 0 | 198923 | <reponame>greshniksv/PBDatabaseGenerator
from .TranslationFormUi import Ui_TranslationForm
from PyQt5 import QtWidgets
from PyQt5.QtGui import QStandardItemModel, QStandardItem
from PyQt5.QtWidgets import QFileDialog
from PyQt5.QtWidgets import QMessageBox
from pydantic import ValidationError
from models.TranslationModel import TranslationModel
from .MetadataForm import MetadataWidget
from .TranslationFormUi import Ui_TranslationForm
class TranslationForm(QtWidgets.QMainWindow, Ui_TranslationForm):
def __init__(self, parent):
# Это здесь нужно для доступа к переменным, методам
# и т.д. в файле design.py
super().__init__()
self.parent_form = parent
self.setupUi(self)
self.translation_model = None
self.model = QStandardItemModel()
self.tvMetadata.setModel(self.model)
self.model.setHorizontalHeaderLabels(["Name", "Value", "Type", "Row Type"])
self.tvMetadata.setColumnWidth(0, 200)
self.tvMetadata.setColumnWidth(1, 290)
self.tvMetadata.setColumnWidth(2, 290)
self.tvMetadata.setColumnWidth(3, 100) # this column should be read-only
self.btnAddMetodata.clicked.connect(self.add_metadata)
self.btnRemoveMetodata.clicked.connect(self.remove_metadata)
self.btnSave.clicked.connect(self.save)
self.btnBrowseFile.clicked.connect(self.open_file_names_dialog)
self.setFixedSize(self.width(), self.height()-20)
def apply_model(self):
model = self.translation_model
self.txbLangId.setText(model.language)
self.txbDraftBy.setText(model.draft_by)
self.txbSlug.setText(model.slug)
self.txbPermalink.setText(model.permalink)
self.txbCreatedBy.setText(model.created_by)
self.txbAllowedChildren.setText(model.allowed_children)
self.txbTitle.setText(model.title)
self.txbIsPublished.setText(model.is_published)
self.txbFile.setText(model.file)
# Clear
while self.model.rowCount() > 0:
self.model.removeRow(0)
for item in model.metadata:
self.model.appendRow(
[
QStandardItem(item['name']),
QStandardItem(item['value']),
QStandardItem(item['type']),
QStandardItem('MetaData')
])
for item in model.content_data:
self.model.appendRow(
[
QStandardItem(item['name']),
QStandardItem(item['value']),
QStandardItem(item['type']),
QStandardItem('ContentData')
])
def open_file_names_dialog(self):
options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog
files, _ = QFileDialog.getOpenFileNames(self, "QFileDialog.getOpenFileNames()", "",
"All Files (*);;", options=options)
if len(files) > 0:
self.txbFile.setText(files[0])
def save(self):
try:
metadata = []
content_data = []
row_count = self.model.rowCount()
for row in range(row_count):
name = self.model.data(self.model.index(row, 0))
value = self.model.data(self.model.index(row, 1))
value_type = self.model.data(self.model.index(row, 2))
row_type = self.model.data(self.model.index(row, 3))
if row_type == "ContentData":
content_data.append({'name': name, 'value': value, 'type': value_type})
if row_type == "MetaData":
metadata.append({'name': name, 'value': value, 'type': value_type})
self.translation_model = TranslationModel(
language=self.txbLangId.text(),
draft_by=self.txbDraftBy.text(),
slug=self.txbSlug.text(),
permalink=self.txbPermalink.text(),
created_by=self.txbCreatedBy.text(),
allowed_children=self.txbAllowedChildren.text(),
title=self.txbTitle.text(),
is_published=self.txbIsPublished.text(),
file=self.txbFile.text(),
metadata=metadata,
content_data=content_data
)
self.parent_form.set_translation(self.translation_model)
except ValidationError as e:
error_acquire = True
QMessageBox.about(self, 'Error message', '{}'.format(e))
except BaseException as err:
error_acquire = True
QMessageBox.about(self, 'Error message', 'An exception occurred: {}'.format(err))
self.close()
def remove_metadata(self):
indexes = self.tvMetadata.selectedIndexes()
for index in indexes:
self.model.removeRow(index.row())
def add_metadata(self):
try:
dialog = MetadataWidget()
result = dialog.exec_()
if result == 1:
data = dialog.return_data()
self.model.appendRow(
[
QStandardItem(data['name']),
QStandardItem(data['value']),
QStandardItem(data['type']),
QStandardItem(data['row_type'])
])
except BaseException as err:
QMessageBox.about(self, 'PyQt5 message', 'An exception occurred: {}'.format(err))
| [
1,
529,
276,
1112,
420,
29958,
7201,
3123,
638,
4501,
29914,
29925,
29933,
9112,
21575,
13,
3166,
869,
4300,
18411,
2500,
29965,
29875,
1053,
501,
29875,
29918,
4300,
18411,
2500,
13,
3166,
10772,
17303,
29945,
1053,
14705,
8801,
29879,
13,
3166,
10772,
17303,
29945,
29889,
17303,
28707,
1053,
660,
15449,
2001,
3195,
29892,
660,
15449,
2001,
13,
3166,
10772,
17303,
29945,
29889,
17303,
8801,
29879,
1053,
660,
2283,
7647,
13,
3166,
10772,
17303,
29945,
29889,
17303,
8801,
29879,
1053,
660,
3728,
3313,
13,
3166,
282,
2941,
7716,
1053,
15758,
362,
2392,
13,
13,
3166,
4733,
29889,
4300,
18411,
3195,
1053,
4103,
18411,
3195,
13,
3166,
869,
18417,
2500,
1053,
4737,
7221,
8801,
13,
3166,
869,
4300,
18411,
2500,
29965,
29875,
1053,
501,
29875,
29918,
4300,
18411,
2500,
13,
13,
13,
1990,
4103,
18411,
2500,
29898,
17303,
8801,
29879,
29889,
29984,
6330,
5907,
29892,
501,
29875,
29918,
4300,
18411,
2500,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3847,
1125,
13,
4706,
396,
20782,
754,
1216,
1210,
26367,
9907,
3807,
1447,
12308,
1186,
2942,
2387,
4470,
29892,
20148,
840,
29959,
13,
4706,
396,
606,
1937,
29889,
29957,
29889,
490,
6725,
29977,
753,
2874,
29889,
2272,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
3560,
29918,
689,
353,
3847,
13,
4706,
1583,
29889,
14669,
29965,
29875,
29898,
1311,
29897,
13,
4706,
1583,
29889,
3286,
18411,
29918,
4299,
353,
6213,
13,
4706,
1583,
29889,
4299,
353,
660,
15449,
2001,
3195,
580,
13,
4706,
1583,
29889,
12427,
18417,
29889,
842,
3195,
29898,
1311,
29889,
4299,
29897,
13,
4706,
1583,
29889,
4299,
29889,
842,
24932,
7850,
4775,
29879,
29898,
3366,
1170,
613,
376,
1917,
613,
376,
1542,
613,
376,
4301,
5167,
20068,
13,
4706,
1583,
29889,
12427,
18417,
29889,
842,
4409,
6110,
29898,
29900,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
12427,
18417,
29889,
842,
4409,
6110,
29898,
29896,
29892,
29871,
29906,
29929,
29900,
29897,
13,
4706,
1583,
29889,
12427,
18417,
29889,
842,
4409,
6110,
29898,
29906,
29892,
29871,
29906,
29929,
29900,
29897,
13,
4706,
1583,
29889,
12427,
18417,
29889,
842,
4409,
6110,
29898,
29941,
29892,
29871,
29896,
29900,
29900,
29897,
29871,
396,
445,
1897,
881,
367,
1303,
29899,
6194,
13,
4706,
1583,
29889,
7290,
2528,
10095,
397,
532,
29889,
3808,
287,
29889,
6915,
29898,
1311,
29889,
1202,
29918,
19635,
29897,
13,
4706,
1583,
29889,
7290,
15941,
10095,
397,
532,
29889,
3808,
287,
29889,
6915,
29898,
1311,
29889,
5992,
29918,
19635,
29897,
13,
4706,
1583,
29889,
7290,
11371,
29889,
3808,
287,
29889,
6915,
29898,
1311,
29889,
7620,
29897,
13,
4706,
1583,
29889,
7290,
29933,
798,
344,
2283,
29889,
3808,
287,
29889,
6915,
29898,
1311,
29889,
3150,
29918,
1445,
29918,
7039,
29918,
15901,
29897,
13,
4706,
1583,
29889,
842,
26262,
3505,
29898,
1311,
29889,
2103,
3285,
1583,
29889,
3545,
580,
29899,
29906,
29900,
29897,
13,
13,
1678,
822,
3394,
29918,
4299,
29898,
1311,
1125,
13,
4706,
1904,
353,
1583,
29889,
3286,
18411,
29918,
4299,
13,
4706,
1583,
29889,
7508,
29890,
29931,
574,
1204,
29889,
12038,
29898,
4299,
29889,
11675,
29897,
13,
4706,
1583,
29889,
7508,
29890,
29928,
4154,
2059,
29889,
12038,
29898,
4299,
29889,
29881,
4154,
29918,
1609,
29897,
13,
4706,
1583,
29889,
7508,
29890,
16973,
688,
29889,
12038,
29898,
4299,
29889,
29517,
29897,
13,
4706,
1583,
29889,
7508,
29890,
15737,
284,
682,
29889,
12038,
29898,
4299,
29889,
546,
5156,
682,
29897,
13,
4706,
1583,
29889,
7508,
29890,
20399,
2059,
29889,
12038,
29898,
4299,
29889,
11600,
29918,
1609,
29897,
13,
4706,
1583,
29889,
7508,
29890,
15930,
287,
19334,
29889,
12038,
29898,
4299,
29889,
24622,
29918,
11991,
29897,
13,
4706,
1583,
29889,
7508,
29890,
7030,
29889,
12038,
29898,
4299,
29889,
3257,
29897,
13,
4706,
1583,
29889,
7508,
29890,
3624,
21076,
3726,
29889,
12038,
29898,
4299,
29889,
275,
29918,
5467,
3726,
29897,
13,
4706,
1583,
29889,
7508,
29890,
2283,
29889,
12038,
29898,
4299,
29889,
1445,
29897,
13,
13,
4706,
396,
17732,
13,
4706,
1550,
1583,
29889,
4299,
29889,
798,
3981,
580,
1405,
29871,
29900,
29901,
13,
9651,
1583,
29889,
4299,
29889,
5992,
4301,
29898,
29900,
29897,
13,
13,
4706,
363,
2944,
297,
1904,
29889,
19635,
29901,
13,
9651,
1583,
29889,
4299,
29889,
4397,
4301,
29898,
13,
18884,
518,
13,
462,
1678,
660,
15449,
2001,
29898,
667,
1839,
978,
2033,
511,
13,
462,
1678,
660,
15449,
2001,
29898,
667,
1839,
1767,
2033,
511,
13,
462,
1678,
660,
15449,
2001,
29898,
667,
1839,
1853,
2033,
511,
13,
462,
1678,
660,
15449,
2001,
877,
19346,
1469,
1495,
13,
462,
2314,
13,
13,
4706,
363,
2944,
297,
1904,
29889,
3051,
29918,
1272,
29901,
13,
9651,
1583,
29889,
4299,
29889,
4397,
4301,
29898,
13,
18884,
518,
13,
462,
1678,
660,
15449,
2001,
29898,
667,
1839,
978,
2033,
511,
13,
462,
1678,
660,
15449,
2001,
29898,
667,
1839,
1767,
2033,
511,
13,
462,
1678,
660,
15449,
2001,
29898,
667,
1839,
1853,
2033,
511,
13,
462,
1678,
660,
15449,
2001,
877,
3916,
1469,
1495,
13,
462,
2314,
13,
13,
1678,
822,
1722,
29918,
1445,
29918,
7039,
29918,
15901,
29898,
1311,
1125,
13,
4706,
3987,
353,
660,
2283,
7647,
29889,
5856,
580,
13,
4706,
3987,
891,
29922,
660,
2283,
7647,
29889,
29928,
609,
11403,
11024,
7647,
13,
4706,
2066,
29892,
903,
353,
660,
2283,
7647,
29889,
657,
6585,
2283,
8659,
29898,
1311,
29892,
376,
29984,
2283,
7647,
29889,
657,
6585,
2283,
8659,
580,
613,
12633,
13,
462,
462,
18884,
376,
3596,
12745,
3070,
416,
29936,
613,
3987,
29922,
6768,
29897,
13,
4706,
565,
7431,
29898,
5325,
29897,
1405,
29871,
29900,
29901,
13,
9651,
1583,
29889,
7508,
29890,
2283,
29889,
12038,
29898,
5325,
29961,
29900,
2314,
13,
13,
1678,
822,
4078,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
15562,
353,
5159,
13,
9651,
2793,
29918,
1272,
353,
5159,
13,
9651,
1948,
29918,
2798,
353,
1583,
29889,
4299,
29889,
798,
3981,
580,
13,
9651,
363,
1948,
297,
3464,
29898,
798,
29918,
2798,
1125,
13,
18884,
1024,
353,
1583,
29889,
4299,
29889,
1272,
29898,
1311,
29889,
4299,
29889,
2248,
29898,
798,
29892,
29871,
29900,
876,
13,
18884,
995,
353,
1583,
29889,
4299,
29889,
1272,
29898,
1311,
29889,
4299,
29889,
2248,
29898,
798,
29892,
29871,
29896,
876,
13,
18884,
995,
29918,
1853,
353,
1583,
29889,
4299,
29889,
1272,
29898,
1311,
29889,
4299,
29889,
2248,
29898,
798,
29892,
29871,
29906,
876,
13,
18884,
1948,
29918,
1853,
353,
1583,
29889,
4299,
29889,
1272,
29898,
1311,
29889,
4299,
29889,
2248,
29898,
798,
29892,
29871,
29941,
876,
13,
18884,
565,
1948,
29918,
1853,
1275,
376,
3916,
1469,
1115,
13,
462,
1678,
2793,
29918,
1272,
29889,
4397,
3319,
29915,
978,
2396,
1024,
29892,
525,
1767,
2396,
995,
29892,
525,
1853,
2396,
995,
29918,
1853,
1800,
13,
18884,
565,
1948,
29918,
1853,
1275,
376,
19346,
1469,
1115,
13,
462,
1678,
15562,
29889,
4397,
3319,
29915,
978,
2396,
1024,
29892,
525,
1767,
2396,
995,
29892,
525,
1853,
2396,
995,
29918,
1853,
1800,
13,
13,
9651,
1583,
29889,
3286,
18411,
29918,
4299,
353,
4103,
18411,
3195,
29898,
13,
18884,
4086,
29922,
1311,
29889,
7508,
29890,
29931,
574,
1204,
29889,
726,
3285,
13,
18884,
18195,
29918,
1609,
29922,
1311,
29889,
7508,
29890,
29928,
4154,
2059,
29889,
726,
3285,
13,
18884,
2243,
688,
29922,
1311,
29889,
7508,
29890,
16973,
688,
29889,
726,
3285,
13,
18884,
3635,
284,
682,
29922,
1311,
29889,
7508,
29890,
15737,
284,
682,
29889,
726,
3285,
13,
18884,
2825,
29918,
1609,
29922,
1311,
29889,
7508,
29890,
20399,
2059,
29889,
726,
3285,
13,
18884,
6068,
29918,
11991,
29922,
1311,
29889,
7508,
29890,
15930,
287,
19334,
29889,
726,
3285,
13,
18884,
3611,
29922,
1311,
29889,
7508,
29890,
7030,
29889,
726,
3285,
13,
18884,
338,
29918,
5467,
3726,
29922,
1311,
29889,
7508,
29890,
3624,
21076,
3726,
29889,
726,
3285,
13,
18884,
934,
29922,
1311,
29889,
7508,
29890,
2283,
29889,
726,
3285,
13,
18884,
15562,
29922,
19635,
29892,
13,
18884,
2793,
29918,
1272,
29922,
3051,
29918,
1272,
13,
9651,
1723,
13,
9651,
1583,
29889,
3560,
29918,
689,
29889,
842,
29918,
3286,
18411,
29898,
1311,
29889,
3286,
18411,
29918,
4299,
29897,
13,
13,
4706,
5174,
15758,
362,
2392,
408,
321,
29901,
13,
9651,
1059,
29918,
562,
1548,
353,
5852,
13,
9651,
660,
3728,
3313,
29889,
12717,
29898,
1311,
29892,
525,
2392,
2643,
742,
525,
8875,
4286,
4830,
29898,
29872,
876,
13,
13,
4706,
5174,
7399,
2451,
408,
4589,
29901,
13,
9651,
1059,
29918,
562,
1548,
353,
5852,
13,
9651,
660,
3728,
3313,
29889,
12717,
29898,
1311,
29892,
525,
2392,
2643,
742,
525,
2744,
3682,
10761,
29901,
6571,
4286,
4830,
29898,
3127,
876,
13,
13,
4706,
1583,
29889,
5358,
580,
13,
13,
1678,
822,
3349,
29918,
19635,
29898,
1311,
1125,
13,
4706,
18111,
353,
1583,
29889,
12427,
18417,
29889,
8391,
3220,
267,
580,
13,
4706,
363,
2380,
297,
18111,
29901,
13,
9651,
1583,
29889,
4299,
29889,
5992,
4301,
29898,
2248,
29889,
798,
3101,
13,
13,
1678,
822,
788,
29918,
19635,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
7928,
353,
4737,
7221,
8801,
580,
13,
9651,
1121,
353,
7928,
29889,
4258,
29918,
580,
13,
9651,
565,
1121,
1275,
29871,
29896,
29901,
13,
18884,
848,
353,
7928,
29889,
2457,
29918,
1272,
580,
13,
18884,
1583,
29889,
4299,
29889,
4397,
4301,
29898,
13,
462,
1678,
518,
13,
462,
4706,
660,
15449,
2001,
29898,
1272,
1839,
978,
2033,
511,
13,
462,
4706,
660,
15449,
2001,
29898,
1272,
1839,
1767,
2033,
511,
13,
462,
4706,
660,
15449,
2001,
29898,
1272,
1839,
1853,
2033,
511,
13,
462,
4706,
660,
15449,
2001,
29898,
1272,
1839,
798,
29918,
1853,
11287,
13,
462,
268,
2314,
13,
4706,
5174,
7399,
2451,
408,
4589,
29901,
13,
9651,
660,
3728,
3313,
29889,
12717,
29898,
1311,
29892,
525,
19737,
17303,
29945,
2643,
742,
525,
2744,
3682,
10761,
29901,
6571,
4286,
4830,
29898,
3127,
876,
13,
2
] |
src/client/pydaos/raw/conversion.py | gczsjdy/daos | 1 | 8558 | #!/usr/bin/python
"""
(C) Copyright 2018 Intel Corporation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE
The Government's rights to use, modify, reproduce, release, perform, display,
or disclose this software are subject to the terms of the Apache License as
provided in Contract No. B609815.
Any reproduction of computer software, computer software documentation, or
portions thereof marked with this legend must also reproduce the markings.
"""
import ctypes
import uuid
def c_uuid_to_str(uuid):
""" utility function to convert a C uuid into a standard string format """
uuid_str = '{:02X}{:02X}{:02X}{:02X}-{:02X}{:02X}-{:02X}{:02X}-{:02X}'\
'{:02X}-{:02X}{:02X}{:02X}{:02X}{:02X}{:02X}'.format(
uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5],
uuid[6], uuid[7], uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15])
return uuid_str
def c_uuid(p_uuid, c_uuid):
""" utility function to create a UUID in C format from a python UUID """
hexstr = p_uuid.hex
for i in range(0, 31, 2):
c_uuid[int(i/2)] = int(hexstr[i:i+2], 16)
def str_to_c_uuid(uuidstr):
""" utility function to convert string format uuid to a C uuid """
uuidstr2 = '{' + uuidstr + '}'
puuid = uuid.UUID(uuidstr2)
cuuid = (ctypes.c_ubyte * 16)()
c_uuid(puuid, cuuid)
return cuuid
| [
1,
18787,
4855,
29914,
2109,
29914,
4691,
13,
15945,
29908,
13,
29871,
313,
29907,
29897,
14187,
1266,
29871,
29906,
29900,
29896,
29947,
18555,
15025,
29889,
13,
13,
29871,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29871,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29871,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
13,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
13,
29871,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29871,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29871,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29871,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29871,
27028,
1090,
278,
19245,
29889,
13,
13,
29871,
21947,
5348,
29940,
13780,
365,
2965,
1430,
1660,
390,
22530,
29903,
29899,
4590,
1430,
7791,
4574,
4741,
7791,
7818,
12982,
1525,
13,
29871,
450,
10354,
29915,
29879,
10462,
304,
671,
29892,
6623,
29892,
18532,
29892,
6507,
29892,
2189,
29892,
2479,
29892,
13,
29871,
470,
2313,
2226,
445,
7047,
526,
4967,
304,
278,
4958,
310,
278,
13380,
19245,
408,
13,
29871,
4944,
297,
2866,
1461,
1939,
29889,
350,
29953,
29900,
29929,
29947,
29896,
29945,
29889,
13,
29871,
3139,
9483,
428,
310,
6601,
7047,
29892,
6601,
7047,
5106,
29892,
470,
13,
29871,
2011,
1080,
727,
974,
10902,
411,
445,
15983,
1818,
884,
18532,
278,
2791,
886,
29889,
13,
15945,
29908,
13,
5215,
274,
8768,
13,
5215,
318,
5416,
13,
13,
1753,
274,
29918,
25118,
29918,
517,
29918,
710,
29898,
25118,
1125,
13,
1678,
9995,
19725,
740,
304,
3588,
263,
315,
318,
5416,
964,
263,
3918,
1347,
3402,
9995,
13,
1678,
318,
5416,
29918,
710,
353,
22372,
29901,
29900,
29906,
29990,
1157,
29901,
29900,
29906,
29990,
1157,
29901,
29900,
29906,
29990,
1157,
29901,
29900,
29906,
29990,
7402,
25641,
29900,
29906,
29990,
1157,
29901,
29900,
29906,
29990,
7402,
25641,
29900,
29906,
29990,
1157,
29901,
29900,
29906,
29990,
7402,
25641,
29900,
29906,
29990,
10162,
29905,
13,
1669,
22372,
29901,
29900,
29906,
29990,
7402,
25641,
29900,
29906,
29990,
1157,
29901,
29900,
29906,
29990,
1157,
29901,
29900,
29906,
29990,
1157,
29901,
29900,
29906,
29990,
1157,
29901,
29900,
29906,
29990,
1157,
29901,
29900,
29906,
29990,
29913,
4286,
4830,
29898,
13,
462,
259,
318,
5416,
29961,
29900,
1402,
318,
5416,
29961,
29896,
1402,
318,
5416,
29961,
29906,
1402,
318,
5416,
29961,
29941,
1402,
318,
5416,
29961,
29946,
1402,
318,
5416,
29961,
29945,
1402,
13,
462,
259,
318,
5416,
29961,
29953,
1402,
318,
5416,
29961,
29955,
1402,
318,
5416,
29961,
29947,
1402,
318,
5416,
29961,
29929,
1402,
318,
5416,
29961,
29896,
29900,
1402,
318,
5416,
29961,
29896,
29896,
1402,
13,
462,
259,
318,
5416,
29961,
29896,
29906,
1402,
318,
5416,
29961,
29896,
29941,
1402,
318,
5416,
29961,
29896,
29946,
1402,
318,
5416,
29961,
29896,
29945,
2314,
13,
1678,
736,
318,
5416,
29918,
710,
13,
13,
1753,
274,
29918,
25118,
29898,
29886,
29918,
25118,
29892,
274,
29918,
25118,
1125,
13,
1678,
9995,
19725,
740,
304,
1653,
263,
501,
11150,
297,
315,
3402,
515,
263,
3017,
501,
11150,
9995,
13,
1678,
15090,
710,
353,
282,
29918,
25118,
29889,
20970,
13,
1678,
363,
474,
297,
3464,
29898,
29900,
29892,
29871,
29941,
29896,
29892,
29871,
29906,
1125,
13,
4706,
274,
29918,
25118,
29961,
524,
29898,
29875,
29914,
29906,
4638,
353,
938,
29898,
20970,
710,
29961,
29875,
29901,
29875,
29974,
29906,
1402,
29871,
29896,
29953,
29897,
13,
13,
1753,
851,
29918,
517,
29918,
29883,
29918,
25118,
29898,
25118,
710,
1125,
13,
1678,
9995,
19725,
740,
304,
3588,
1347,
3402,
318,
5416,
304,
263,
315,
318,
5416,
9995,
13,
1678,
318,
5416,
710,
29906,
353,
525,
10998,
718,
318,
5416,
710,
718,
525,
10162,
13,
1678,
2653,
5416,
353,
318,
5416,
29889,
29965,
11150,
29898,
25118,
710,
29906,
29897,
13,
1678,
2723,
5416,
353,
313,
312,
7384,
29889,
29883,
29918,
4471,
371,
334,
29871,
29896,
29953,
29897,
580,
13,
1678,
274,
29918,
25118,
29898,
3746,
5416,
29892,
2723,
5416,
29897,
13,
1678,
736,
2723,
5416,
13,
2
] |
utils/pvacapi/controllers/database.py | mrichters/pVACtools | 96 | 24591 | import os
import re
import csv
import sys
import json
import yaml
import time
import socket
import connexion
import postgresql as psql
from flask import current_app
from urllib.parse import urlencode
from hashlib import md5
from bokeh.embed import server_document
from .processes import fetch_process, is_running, process_info
from .utils import column_filter
float_pattern = re.compile(r'^\d*\.\d+$')
int_pattern = re.compile(r'^-?\d+$')
NA_pattern = re.compile(r'^NA$')
queryfilters = re.compile(r'(.+)(<=?|>=?|!=|==)(.+)')
def init_column_mapping(row, schema):
"""Generate initial estimates of column data types"""
defs = {column_filter(col): 'text' for col in row}
# Apply predefined table schema
defs.update({k: v for (k, v) in schema.items() if k in defs})
for (col, val) in row.items():
col = column_filter(col)
if col not in schema:
if int_pattern.match(val):
try:
int(val)
print("Assigning int to", col, "based on", val)
defs[col] = 'integer'
except ValueError:
print("ERROR: Int mismatch:", val)
elif float_pattern.match(val):
try:
float(val)
print("Assigning float to", col, "based on", val)
defs[col] = 'decimal'
except ValueError:
print("ERROR: Float mismatch:", val)
mapping = {}
for (col, val) in defs.items():
if 'int' in val:
mapping[col] = int
elif val == 'decimal':
mapping[col] = float
else:
mapping[col] = str
return (mapping, defs)
def column_mapping(row, mapping, schema):
"""Apply filtering to the current row.
Detect if column data types need to be changed"""
output = {}
changes = {}
for (col, val) in row.items():
col = column_filter(col)
if val == None or NA_pattern.match(str(val)):
output[col] = None
continue
if col not in schema and mapping[col] == str:
if int_pattern.match(val):
try:
int(val)
print("Assigning int to", col, "based on", val)
mapping[col] = int
changes[col] = int
except ValueError:
print("ERROR: Int mismatch:", val)
elif float_pattern.match(val):
try:
float(val)
print("Assigning float to", col, "based on", val)
mapping[col] = float
changes[col] = float
except ValueError:
print("ERROR: Float mismatch:", val)
try:
output[col] = mapping[col](val)
except ValueError:
output[col] = None
return (mapping, output, changes)
def old_file_read(db, CREATE_TABLE, tablekey, column_names, reader, mapping):
with db.xact():
db.execute(CREATE_TABLE)
# table marked for insertion during original attempt, so don't need to here
# prepare the insertion query
insert = db.prepare("INSERT INTO %s (%s) VALUES (%s)" % (
tablekey,
','.join(column_names),
','.join('$%d' % i for (_, i) in zip(
column_names, range(1, sys.maxsize)
))
))
update = "ALTER TABLE %s " % tablekey
for row in reader:
# process each row
# We format the data in the row and update column data types, if
# necessary
(mapping, formatted, changes) = column_mapping(row, mapping, current_app.config['schema'])
if len(changes):
#Generate a query to alter the table schema, if any changes are required
alter_cols = []
for (k, v) in changes.items():
# if there were any changes to the data type, update the table
# since we only ever update a text column to int/decimal, then
# it's okay to nullify the data
typ = ''
if v == int:
typ = 'bigint' if k in {'start', 'stop'} else 'integer'
elif v == float:
typ = 'decimal'
alter_cols.append(
"ALTER COLUMN %s SET DATA TYPE %s USING %s::%s" % (
k, typ, k, typ
)
)
# Re-generate the insert statement since the data types changed
print("Alter:", update + ','.join(alter_cols))
db.execute(update + ','.join(alter_cols))
insert = db.prepare("INSERT INTO %s (%s) VALUES (%s)" % (
tablekey,
','.join(column_names),
','.join('$%d' % i for (_, i) in zip(
column_names, range(1, sys.maxsize)
))
))
# insert the row
insert(*[formatted[column] for column in column_names])
def table_transaction(file_permissions, db, CREATE_TABLE, tablekey, all_tablecolumns, raw_reader, column_names, mapping):
with db.xact():
db.execute(CREATE_TABLE)
db.prepare("LOCK TABLE %s IN ACCESS EXCLUSIVE MODE" % (tablekey))
copy_query = "COPY %s (%s) FROM '%s' WITH FREEZE NULL 'NA' DELIMITER E'\t' CSV HEADER" % (tablekey, all_tablecolumns, raw_reader.name)
#copy_query may result in psql.exceptions.InsufficientPrivilegeError when run; workaround attempted below
if file_permissions:
#mark the table for deletion when the server shuts down
#don't need to mark table for deletion during second attempt
if 'db-clean' not in current_app.config:
current_app.config['db-clean'] = [tablekey]
else:
current_app.config['db-clean'].append(tablekey)
#attempt file copy
db.execute(copy_query)
else:
import subprocess
filedest = "/tmp/"+os.path.basename(raw_reader.name)
subprocess.run(["mktemp", filedest], stdout=subprocess.DEVNULL)
subprocess.run(["cp", raw_reader.name, filedest])
subprocess.run(["chmod", "666", filedest])
copy_query = "COPY %s (%s) FROM '%s' WITH FREEZE NULL 'NA' DELIMITER E'\t' CSV HEADER" % (tablekey, all_tablecolumns, filedest)
try:
db.execute(copy_query)
print("...Success")
finally:
subprocess.run(["rm", filedest])
col_val_query = "SELECT "
for col_name in column_names:
col_val_query += "(select %s from %s where %s is not null limit 1), "%(col_name, tablekey, col_name)
col_val_query = col_val_query[:-2]
col_values = db.prepare(col_val_query)
values = col_values()[0]
update = "ALTER TABLE %s " % tablekey
row = dict(zip(col_values.column_names, values))
(mapping, formatted, changes) = column_mapping(row, mapping, current_app.config['schema'])
if len(changes):
#Generate a query to alter the table schema, if any changes are required
alter_cols = []
for (k, v) in changes.items():
# if there were any changes to the data type, update the table
# since we only ever update a text column to int/decimal, then
# it's okay to nullify the data
typ = ''
if v == int:
typ = 'bigint' if k in {'start', 'stop'} else 'integer'
elif v == float:
typ = 'decimal'
alter_cols.append(
"ALTER COLUMN %s SET DATA TYPE %s USING %s::%s" % (
k, typ, k, typ
)
)
print("Alter:", update + ','.join(alter_cols))
db.execute(update + ','.join(alter_cols))
def create_table(parentID, fileID, data, tablekey, db):
# Open a reader to cache the file in the database
if parentID != -1:
process = fetch_process(parentID, data, current_app.config['storage']['children'])
if not process[0]:
return (
{
"code": 400,
"message": "The requested process (%d) does not exist" % parentID,
"fields": "parentID"
}, 400
)
if is_running(process):
return (
{
"code": 400,
"message": "The requested process (%d) is still running" % parentID,
"fields": "parentID"
}, 400
)
if str(fileID) not in process[0]['files']:
return (
{
"code": 400,
"message": "The requested fileID (%s) does not exist for this process (%d)" % (fileID, parentID),
"fields": "fileID"
}, 400
)
raw_reader = open(process[0]['files'][fileID]['fullname'])
else:
if str(fileID) not in data['visualize']:
return (
{
"code": 400,
"message": "The requested fileID (%s) does not exist in the visualize" % fileID,
"fields": "fileID"
}, 400
)
raw_reader = open(data['visualize'][str(fileID)]['fullname'])
if not raw_reader.name.endswith('.tsv'):
ext = os.path.splitext(raw_reader.name)[1].lower()
if len(ext) and ext[0] == '.':
ext = ext[1:]
return serve_as(raw_reader, ext)
reader = csv.DictReader(raw_reader, delimiter='\t')
tmp_reader = open(raw_reader.name)
tmp = csv.DictReader(tmp_reader, delimiter='\t')
try:
init = next(tmp)
except StopIteration:
return []
tmp_reader.close()
# Get an initial estimate of column datatypes from the first row
(mapping, column_names) = init_column_mapping(init, current_app.config['schema'])
tablecolumns = "\n".join( # use the estimated types to create the table
"%s %s," % (colname, column_names[colname])
for colname in column_names
)[:-1]
CREATE_TABLE = "CREATE TABLE %s (\
rowid SERIAL PRIMARY KEY NOT NULL,\
%s\
)" % (tablekey, tablecolumns)
all_tablecolumns = ', '.join(column_filter(col) for col in reader.fieldnames)
try:
table_transaction(True, db, CREATE_TABLE, tablekey, all_tablecolumns, raw_reader, column_names, mapping)
except psql.exceptions.UniqueError: #If another transaction already created specified table, pass
pass
except psql.exceptions.InsufficientPrivilegeError as e:
#can occur when postgres user unable to open file due to permissions; specifically for travis-ci tests
#check if resulting from postgres user permissions
if e.args[0].startswith("must be superuser"):
print("WARNING: Postgres user is not a super user; visualization time may be slow")
old_file_read(db, CREATE_TABLE, tablekey, column_names, reader, mapping) #use inefficient file-read-to-db method
else:
#attempt to resolve by copying file to /tmp/, changing its permissions, and accessing it there
try:
print("InsufficientPrivilegeError raised in accessing file.\nAttempting workaround...")
table_transaction(False, db, CREATE_TABLE, tablekey, all_tablecolumns, raw_reader, column_names, mapping)
except psql.exceptions.InsufficientPrivilegeError:
print("Postgres could not access file. Check to make sure that both the "
"file and your current postgres user has the appropriate permissions.")
raise
raw_reader.close()
def filterfile(parentID, fileID, count, page, filters, sort, direction):
"""Gets the file ID belonging to the parent.\
For result files, the parentID is the process ID that spawned them.\
For visualize files, the parentID is -1"""
data = current_app.config['storage']['loader']()
# first, generate the key
tablekey = "data_%s_%s" % (
(parentID if parentID >= 0 else 'visualize'),
fileID
)
# check if the table exists:
db = psql.open("localhost/pvacseq")
fileID = str(fileID)
with db.xact():
query = db.prepare("SELECT 1 FROM information_schema.tables WHERE table_name = $1")
response = query(tablekey)
if not len(response): # table does not exist
table_errors = create_table(parentID, fileID, data, tablekey, db)
if table_errors != None:
return table_errors
#with db.synchronizer:
# test_query = db.prepare("SELECT 1 FROM information_schema.tables WHERE table_name = $1")
# test_response = query(tablekey)
with db.xact():
typequery = db.prepare(
"SELECT column_name, data_type FROM information_schema.columns WHERE table_name = $1"
)
column_defs = typequery(tablekey)
column_maps = {}
for (col, typ) in column_defs:
if 'int' in typ:
column_maps[col] = int
elif typ == 'numeric'or typ == 'decimal':
column_maps[col] = float
else:
column_maps[col] = str
formatted_filters = []
for i in range(len(filters)):
f = filters[i].strip()
if not len(f):
continue
result = queryfilters.match(f)
if not result:
return ({
"code": 400,
"message": "Encountered an invalid filter (%s)" % f,
"fields": "filters"
}, 400)
colname = column_filter(result.group(1))
if colname not in column_maps:
return ({
"code": 400,
"message": "Unknown column name %s" % result.group(1),
"fields": "filters"
}, 400)
op = result.group(2)
typ = column_maps[colname]
val = None
try:
val = column_maps[colname](
result.group(3)
)
except ValueError:
return ({
"code": 400,
"message": "Value %s cannot be formatted to match the type of column %s (%s)" % (
result.group(3),
result.group(1),
typ
)
}, 400)
if typ == str and (op in {'==', '!='}):
formatted_filters.append(
json.dumps(colname) + (' not ' if '!' in op else ' ') + "LIKE '%s'" % (
json.dumps(val)[1:-1]
)
)
else: # type is numerical
op = op.replace('==', '=')
formatted_filters.append(
'%s %s %s' % (
json.dumps(colname),
op,
json.dumps(val)
)
)
raw_query = "SELECT %s FROM %s" % (
','.join([k[0] for k in column_defs]),
tablekey
)
if len(formatted_filters):
raw_query += " WHERE " + " AND ".join(formatted_filters)
if sort:
if column_filter(sort) not in column_maps:
return ({
'code': 400,
'message': 'Invalid column name %s' % sort,
'fields': 'sort'
}, 400)
raw_query += " ORDER BY %s" % (column_filter(sort))
if direction:
raw_query += " " + direction
if count:
raw_query += " LIMIT %d" % count
if page:
raw_query += " OFFSET %d" % (page * count)
print("Query:", raw_query)
import decimal
with db.xact('SERIALIZABLE', 'READ ONLY DEFERRABLE'):
query = db.prepare(raw_query)
decimalizer = lambda x: (float(x) if type(x) == decimal.Decimal else x)
result = [
{
colname: decimalizer(value) for (colname, value) in zip(
[k[0] for k in column_defs],
[val for val in row]
)
} for row in query.rows()
]
db.close()
return result
def fileschema(parentID, fileID):
data = current_app.config['storage']['loader']()
tablekey = "data_%s_%s" % (
(parentID if parentID >= 0 else 'visualize'),
fileID
)
# check if the table exists:
db = psql.open("localhost/pvacseq")
with db.xact():
query = db.prepare("SELECT 1 FROM information_schema.tables WHERE table_name = $1")
if not len(query(tablekey)): # table does not exist
return ({
'code': 400,
'message': "The requested file has not been loaded into the Postgres database",
'fields': "fileID"
}, 400)
typequery = db.prepare("SELECT column_name, data_type FROM information_schema.columns WHERE table_name = $1")
result = {
key: val for (key, val) in typequery(tablekey)
}
db.close()
return result
def serve_as(reader, filetype):
if filetype == 'json':
return {
'filetype':'json',
'content':json.load(reader)
}
elif filetype == 'yaml' or filetype == 'yml':
return {
'filetype':'yaml',
'content':yaml.load(reader.read())
}
elif filetype == 'log':
return {
'filetype':'log',
'content':[line.rstrip() for line in reader.readlines()]
}
else:
return {
'filetype':'raw',
'content':reader.read()
}
def visualize(parentID, fileID):
vis = visualize_script(parentID, fileID)
return '<html><head></head><body>%s</body></html'%(vis if type(vis)!=tuple else vis[0])
def visualize_script(parentID, fileID):
"""Return an HTML document containing the requested table visualization"""
from .files import results_getcols
data = current_app.config['storage']['loader']()
#first call filterfile to load the table if it's not loaded already
result = filterfile(parentID, fileID, 1, 0, '', 'rowid', 'ASC')
if type(result) != list:
return (
{
'code':400,
'message':json.dumps(result),
'fields':'unknown',
},
400
)
if len(result) == 0 or type(result) == dict:
return (
'Results file contains no data - cannot visualize'
)
cols = results_getcols(parentID, fileID)
if type(cols) != dict:
return (
{
'code':400,
'message':json.dumps(cols),
'fields':'unknown'
},
400
)
proc_data = process_info(parentID)
if type(proc_data)==dict and 'parameters' in proc_data and 'sample_name' in proc_data['parameters']:
sample = proc_data['parameters']['sample_name']
elif parentID == -1:
sample = data['visualize'][str(fileID)]['display_name'].rsplit(".", 1)[0]
else:
sample = 'Unknown Sample'
if current_app.PROXY_IP_ADDRESS is not None:
IP = current_app.PROXY_IP_ADDRESS
else:
IP = current_app.IP_ADDRESS
return (
server_document(
url="http://" + IP + ":5006/visualizations",
arguments={
'target-process': parentID,
'target-file': fileID,
'cols': json.dumps(cols),
'samplename': sample
}
)
)
| [
1,
1053,
2897,
13,
5215,
337,
13,
5215,
11799,
13,
5215,
10876,
13,
5215,
4390,
13,
5215,
343,
8807,
13,
5215,
931,
13,
5215,
9909,
13,
5215,
1826,
29916,
291,
13,
5215,
27035,
408,
282,
2850,
13,
13,
3166,
29784,
1053,
1857,
29918,
932,
13,
3166,
3142,
1982,
29889,
5510,
1053,
3142,
12508,
13,
3166,
6608,
1982,
1053,
22821,
29945,
13,
3166,
1045,
446,
29882,
29889,
17987,
1053,
1923,
29918,
3225,
13,
3166,
869,
5014,
267,
1053,
6699,
29918,
5014,
29892,
338,
29918,
21094,
29892,
1889,
29918,
3888,
13,
3166,
869,
13239,
1053,
1897,
29918,
4572,
13,
13,
7411,
29918,
11037,
353,
337,
29889,
12198,
29898,
29878,
29915,
3823,
29881,
17710,
7790,
29881,
24035,
1495,
13,
524,
29918,
11037,
353,
337,
29889,
12198,
29898,
29878,
29915,
21583,
29973,
29905,
29881,
24035,
1495,
13,
3521,
29918,
11037,
353,
337,
29889,
12198,
29898,
29878,
29915,
29985,
3521,
29938,
1495,
13,
1972,
26705,
353,
337,
29889,
12198,
29898,
29878,
29915,
11891,
29974,
5033,
14065,
29973,
29989,
18572,
29973,
29989,
19216,
29989,
1360,
5033,
29889,
28135,
1495,
13,
13,
1753,
2069,
29918,
4914,
29918,
20698,
29898,
798,
29892,
10938,
1125,
13,
1678,
9995,
5631,
403,
2847,
21875,
310,
1897,
848,
4072,
15945,
29908,
13,
1678,
822,
29879,
353,
426,
4914,
29918,
4572,
29898,
1054,
1125,
525,
726,
29915,
363,
784,
297,
1948,
29913,
13,
1678,
396,
2401,
368,
758,
12119,
1591,
10938,
13,
1678,
822,
29879,
29889,
5504,
3319,
29895,
29901,
325,
363,
313,
29895,
29892,
325,
29897,
297,
10938,
29889,
7076,
580,
565,
413,
297,
822,
29879,
1800,
13,
1678,
363,
313,
1054,
29892,
659,
29897,
297,
1948,
29889,
7076,
7295,
13,
4706,
784,
353,
1897,
29918,
4572,
29898,
1054,
29897,
13,
4706,
565,
784,
451,
297,
10938,
29901,
13,
9651,
565,
938,
29918,
11037,
29889,
4352,
29898,
791,
1125,
13,
18884,
1018,
29901,
13,
462,
1678,
938,
29898,
791,
29897,
13,
462,
1678,
1596,
703,
7900,
647,
292,
938,
304,
613,
784,
29892,
376,
6707,
373,
613,
659,
29897,
13,
462,
1678,
822,
29879,
29961,
1054,
29962,
353,
525,
16031,
29915,
13,
18884,
5174,
7865,
2392,
29901,
13,
462,
1678,
1596,
703,
11432,
29901,
3159,
29635,
29901,
613,
659,
29897,
13,
9651,
25342,
5785,
29918,
11037,
29889,
4352,
29898,
791,
1125,
13,
18884,
1018,
29901,
13,
462,
1678,
5785,
29898,
791,
29897,
13,
462,
1678,
1596,
703,
7900,
647,
292,
5785,
304,
613,
784,
29892,
376,
6707,
373,
613,
659,
29897,
13,
462,
1678,
822,
29879,
29961,
1054,
29962,
353,
525,
7099,
3039,
29915,
13,
18884,
5174,
7865,
2392,
29901,
13,
462,
1678,
1596,
703,
11432,
29901,
27842,
29635,
29901,
613,
659,
29897,
13,
1678,
10417,
353,
6571,
13,
1678,
363,
313,
1054,
29892,
659,
29897,
297,
822,
29879,
29889,
7076,
7295,
13,
4706,
565,
525,
524,
29915,
297,
659,
29901,
13,
9651,
10417,
29961,
1054,
29962,
353,
938,
13,
4706,
25342,
659,
1275,
525,
7099,
3039,
2396,
13,
9651,
10417,
29961,
1054,
29962,
353,
5785,
13,
4706,
1683,
29901,
13,
9651,
10417,
29961,
1054,
29962,
353,
851,
13,
1678,
736,
313,
20698,
29892,
822,
29879,
29897,
13,
13,
13,
1753,
1897,
29918,
20698,
29898,
798,
29892,
10417,
29892,
10938,
1125,
13,
1678,
9995,
2052,
368,
21166,
304,
278,
1857,
1948,
29889,
13,
1678,
5953,
522,
565,
1897,
848,
4072,
817,
304,
367,
3939,
15945,
29908,
13,
1678,
1962,
353,
6571,
13,
1678,
3620,
353,
6571,
13,
1678,
363,
313,
1054,
29892,
659,
29897,
297,
1948,
29889,
7076,
7295,
13,
4706,
784,
353,
1897,
29918,
4572,
29898,
1054,
29897,
13,
4706,
565,
659,
1275,
6213,
470,
8598,
29918,
11037,
29889,
4352,
29898,
710,
29898,
791,
22164,
13,
9651,
1962,
29961,
1054,
29962,
353,
6213,
13,
9651,
6773,
13,
4706,
565,
784,
451,
297,
10938,
322,
10417,
29961,
1054,
29962,
1275,
851,
29901,
13,
9651,
565,
938,
29918,
11037,
29889,
4352,
29898,
791,
1125,
13,
18884,
1018,
29901,
13,
462,
1678,
938,
29898,
791,
29897,
13,
462,
1678,
1596,
703,
7900,
647,
292,
938,
304,
613,
784,
29892,
376,
6707,
373,
613,
659,
29897,
13,
462,
1678,
10417,
29961,
1054,
29962,
353,
938,
13,
462,
1678,
3620,
29961,
1054,
29962,
353,
938,
13,
18884,
5174,
7865,
2392,
29901,
13,
462,
1678,
1596,
703,
11432,
29901,
3159,
29635,
29901,
613,
659,
29897,
13,
9651,
25342,
5785,
29918,
11037,
29889,
4352,
29898,
791,
1125,
13,
18884,
1018,
29901,
13,
462,
1678,
5785,
29898,
791,
29897,
13,
462,
1678,
1596,
703,
7900,
647,
292,
5785,
304,
613,
784,
29892,
376,
6707,
373,
613,
659,
29897,
13,
462,
1678,
10417,
29961,
1054,
29962,
353,
5785,
13,
462,
1678,
3620,
29961,
1054,
29962,
353,
5785,
13,
18884,
5174,
7865,
2392,
29901,
13,
462,
1678,
1596,
703,
11432,
29901,
27842,
29635,
29901,
613,
659,
29897,
13,
4706,
1018,
29901,
13,
9651,
1962,
29961,
1054,
29962,
353,
10417,
29961,
1054,
850,
791,
29897,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
1962,
29961,
1054,
29962,
353,
6213,
13,
1678,
736,
313,
20698,
29892,
1962,
29892,
3620,
29897,
13,
13,
1753,
2030,
29918,
1445,
29918,
949,
29898,
2585,
29892,
14602,
29918,
21009,
29892,
1591,
1989,
29892,
1897,
29918,
7039,
29892,
9591,
29892,
10417,
1125,
13,
1678,
411,
4833,
29889,
29916,
627,
7295,
13,
4706,
4833,
29889,
7978,
29898,
27045,
29918,
21009,
29897,
13,
4706,
396,
1591,
10902,
363,
4635,
291,
2645,
2441,
4218,
29892,
577,
1016,
29915,
29873,
817,
304,
1244,
13,
4706,
396,
19012,
278,
4635,
291,
2346,
13,
4706,
4635,
353,
4833,
29889,
19125,
703,
19460,
11646,
1273,
29879,
313,
29995,
29879,
29897,
15673,
313,
29995,
29879,
5513,
1273,
313,
13,
9651,
1591,
1989,
29892,
13,
9651,
13420,
4286,
7122,
29898,
4914,
29918,
7039,
511,
13,
9651,
13420,
4286,
7122,
877,
29938,
29995,
29881,
29915,
1273,
474,
363,
313,
3383,
474,
29897,
297,
14319,
29898,
13,
18884,
1897,
29918,
7039,
29892,
3464,
29898,
29896,
29892,
10876,
29889,
3317,
2311,
29897,
13,
632,
876,
13,
308,
876,
13,
4706,
2767,
353,
376,
1964,
4945,
10911,
1273,
29879,
376,
1273,
1591,
1989,
13,
4706,
363,
1948,
297,
9591,
29901,
13,
9651,
396,
1889,
1269,
1948,
13,
9651,
396,
1334,
3402,
278,
848,
297,
278,
1948,
322,
2767,
1897,
848,
4072,
29892,
565,
13,
9651,
396,
5181,
13,
9651,
313,
20698,
29892,
20917,
29892,
3620,
29897,
353,
1897,
29918,
20698,
29898,
798,
29892,
10417,
29892,
1857,
29918,
932,
29889,
2917,
1839,
11010,
11287,
13,
9651,
565,
7431,
29898,
25990,
1125,
13,
18884,
396,
5631,
403,
263,
2346,
304,
10551,
278,
1591,
10938,
29892,
565,
738,
3620,
526,
3734,
13,
18884,
10551,
29918,
22724,
353,
5159,
13,
18884,
363,
313,
29895,
29892,
325,
29897,
297,
3620,
29889,
7076,
7295,
13,
462,
1678,
396,
565,
727,
892,
738,
3620,
304,
278,
848,
1134,
29892,
2767,
278,
1591,
13,
462,
1678,
396,
1951,
591,
871,
3926,
2767,
263,
1426,
1897,
304,
938,
29914,
7099,
3039,
29892,
769,
13,
462,
1678,
396,
372,
29915,
29879,
20759,
304,
1870,
1598,
278,
848,
13,
462,
1678,
2393,
353,
6629,
13,
462,
1678,
565,
325,
1275,
938,
29901,
13,
462,
4706,
2393,
353,
525,
3752,
524,
29915,
565,
413,
297,
11117,
2962,
742,
525,
9847,
10827,
1683,
525,
16031,
29915,
13,
462,
1678,
25342,
325,
1275,
5785,
29901,
13,
462,
4706,
2393,
353,
525,
7099,
3039,
29915,
13,
462,
1678,
10551,
29918,
22724,
29889,
4397,
29898,
13,
462,
4706,
376,
1964,
4945,
23958,
29127,
1273,
29879,
11368,
360,
8254,
323,
6959,
1273,
29879,
3148,
4214,
1273,
29879,
1057,
29995,
29879,
29908,
1273,
313,
13,
462,
9651,
413,
29892,
2393,
29892,
413,
29892,
2393,
13,
462,
4706,
1723,
13,
462,
1678,
1723,
13,
18884,
396,
830,
29899,
17158,
278,
4635,
3229,
1951,
278,
848,
4072,
3939,
13,
18884,
1596,
703,
2499,
357,
29901,
613,
2767,
718,
13420,
4286,
7122,
29898,
13794,
29918,
22724,
876,
13,
18884,
4833,
29889,
7978,
29898,
5504,
718,
13420,
4286,
7122,
29898,
13794,
29918,
22724,
876,
13,
18884,
4635,
353,
4833,
29889,
19125,
703,
19460,
11646,
1273,
29879,
313,
29995,
29879,
29897,
15673,
313,
29995,
29879,
5513,
1273,
313,
13,
462,
1678,
1591,
1989,
29892,
13,
462,
1678,
13420,
4286,
7122,
29898,
4914,
29918,
7039,
511,
13,
462,
1678,
13420,
4286,
7122,
877,
29938,
29995,
29881,
29915,
1273,
474,
363,
313,
3383,
474,
29897,
297,
14319,
29898,
13,
462,
4706,
1897,
29918,
7039,
29892,
3464,
29898,
29896,
29892,
10876,
29889,
3317,
2311,
29897,
13,
462,
268,
876,
13,
462,
876,
13,
9651,
396,
4635,
278,
1948,
13,
9651,
4635,
10456,
29961,
689,
19667,
29961,
4914,
29962,
363,
1897,
297,
1897,
29918,
7039,
2314,
13,
13,
1753,
1591,
29918,
20736,
29898,
1445,
29918,
17858,
6847,
29892,
4833,
29892,
14602,
29918,
21009,
29892,
1591,
1989,
29892,
599,
29918,
2371,
13099,
29892,
10650,
29918,
16950,
29892,
1897,
29918,
7039,
29892,
10417,
1125,
13,
1678,
411,
4833,
29889,
29916,
627,
7295,
13,
4706,
4833,
29889,
7978,
29898,
27045,
29918,
21009,
29897,
13,
4706,
4833,
29889,
19125,
703,
21339,
10911,
1273,
29879,
2672,
319,
26925,
8528,
6154,
3308,
18474,
16999,
2287,
29908,
1273,
313,
2371,
1989,
876,
13,
4706,
3509,
29918,
1972,
353,
376,
3217,
20055,
1273,
29879,
313,
29995,
29879,
29897,
3895,
14210,
29879,
29915,
22659,
383,
21661,
10721,
4265,
525,
3521,
29915,
5012,
5265,
26349,
1001,
382,
12764,
29873,
29915,
16874,
17714,
3035,
1001,
29908,
1273,
313,
2371,
1989,
29892,
599,
29918,
2371,
13099,
29892,
10650,
29918,
16950,
29889,
978,
29897,
13,
4706,
396,
8552,
29918,
1972,
1122,
1121,
297,
282,
2850,
29889,
11739,
29879,
29889,
797,
2146,
4543,
29925,
1150,
488,
479,
2392,
746,
1065,
29936,
14725,
16388,
2400,
13,
4706,
565,
934,
29918,
17858,
6847,
29901,
13,
9651,
396,
3502,
278,
1591,
363,
7374,
291,
746,
278,
1923,
528,
8842,
1623,
13,
9651,
396,
9176,
29915,
29873,
817,
304,
2791,
1591,
363,
7374,
291,
2645,
1473,
4218,
13,
9651,
565,
525,
2585,
29899,
14941,
29915,
451,
297,
1857,
29918,
932,
29889,
2917,
29901,
13,
18884,
1857,
29918,
932,
29889,
2917,
1839,
2585,
29899,
14941,
2033,
353,
518,
2371,
1989,
29962,
13,
9651,
1683,
29901,
13,
18884,
1857,
29918,
932,
29889,
2917,
1839,
2585,
29899,
14941,
13359,
4397,
29898,
2371,
1989,
29897,
13,
9651,
396,
1131,
3456,
934,
3509,
13,
9651,
4833,
29889,
7978,
29898,
8552,
29918,
1972,
29897,
13,
4706,
1683,
29901,
13,
9651,
1053,
1014,
5014,
13,
9651,
934,
7854,
353,
5591,
7050,
12975,
29974,
359,
29889,
2084,
29889,
6500,
3871,
29898,
1610,
29918,
16950,
29889,
978,
29897,
13,
9651,
1014,
5014,
29889,
3389,
29898,
3366,
29885,
1193,
3451,
613,
934,
7854,
1402,
27591,
29922,
1491,
5014,
29889,
2287,
29963,
10074,
29897,
13,
9651,
1014,
5014,
29889,
3389,
29898,
3366,
6814,
613,
10650,
29918,
16950,
29889,
978,
29892,
934,
7854,
2314,
13,
9651,
1014,
5014,
29889,
3389,
29898,
3366,
305,
1545,
613,
376,
29953,
29953,
29953,
613,
934,
7854,
2314,
13,
9651,
3509,
29918,
1972,
353,
376,
3217,
20055,
1273,
29879,
313,
29995,
29879,
29897,
3895,
14210,
29879,
29915,
22659,
383,
21661,
10721,
4265,
525,
3521,
29915,
5012,
5265,
26349,
1001,
382,
12764,
29873,
29915,
16874,
17714,
3035,
1001,
29908,
1273,
313,
2371,
1989,
29892,
599,
29918,
2371,
13099,
29892,
934,
7854,
29897,
13,
9651,
1018,
29901,
13,
18884,
4833,
29889,
7978,
29898,
8552,
29918,
1972,
29897,
13,
18884,
1596,
703,
856,
14191,
1159,
13,
9651,
7146,
29901,
13,
18884,
1014,
5014,
29889,
3389,
29898,
3366,
1758,
613,
934,
7854,
2314,
13,
4706,
784,
29918,
791,
29918,
1972,
353,
376,
6404,
376,
13,
4706,
363,
784,
29918,
978,
297,
1897,
29918,
7039,
29901,
13,
9651,
784,
29918,
791,
29918,
1972,
4619,
18227,
2622,
1273,
29879,
515,
1273,
29879,
988,
1273,
29879,
338,
451,
1870,
4046,
29871,
29896,
511,
11860,
29898,
1054,
29918,
978,
29892,
1591,
1989,
29892,
784,
29918,
978,
29897,
13,
4706,
784,
29918,
791,
29918,
1972,
353,
784,
29918,
791,
29918,
1972,
7503,
29899,
29906,
29962,
13,
4706,
784,
29918,
5975,
353,
4833,
29889,
19125,
29898,
1054,
29918,
791,
29918,
1972,
29897,
13,
4706,
1819,
353,
784,
29918,
5975,
580,
29961,
29900,
29962,
13,
4706,
2767,
353,
376,
1964,
4945,
10911,
1273,
29879,
376,
1273,
1591,
1989,
13,
4706,
1948,
353,
9657,
29898,
7554,
29898,
1054,
29918,
5975,
29889,
4914,
29918,
7039,
29892,
1819,
876,
13,
4706,
313,
20698,
29892,
20917,
29892,
3620,
29897,
353,
1897,
29918,
20698,
29898,
798,
29892,
10417,
29892,
1857,
29918,
932,
29889,
2917,
1839,
11010,
11287,
13,
4706,
565,
7431,
29898,
25990,
1125,
13,
4706,
396,
5631,
403,
263,
2346,
304,
10551,
278,
1591,
10938,
29892,
565,
738,
3620,
526,
3734,
13,
9651,
10551,
29918,
22724,
353,
5159,
13,
9651,
363,
313,
29895,
29892,
325,
29897,
297,
3620,
29889,
7076,
7295,
13,
18884,
396,
565,
727,
892,
738,
3620,
304,
278,
848,
1134,
29892,
2767,
278,
1591,
13,
18884,
396,
1951,
591,
871,
3926,
2767,
263,
1426,
1897,
304,
938,
29914,
7099,
3039,
29892,
769,
13,
18884,
396,
372,
29915,
29879,
20759,
304,
1870,
1598,
278,
848,
13,
18884,
2393,
353,
6629,
13,
18884,
565,
325,
1275,
938,
29901,
13,
462,
1678,
2393,
353,
525,
3752,
524,
29915,
565,
413,
297,
11117,
2962,
742,
525,
9847,
10827,
1683,
525,
16031,
29915,
13,
18884,
25342,
325,
1275,
5785,
29901,
13,
462,
1678,
2393,
353,
525,
7099,
3039,
29915,
13,
18884,
10551,
29918,
22724,
29889,
4397,
29898,
13,
462,
1678,
376,
1964,
4945,
23958,
29127,
1273,
29879,
11368,
360,
8254,
323,
6959,
1273,
29879,
3148,
4214,
1273,
29879,
1057,
29995,
29879,
29908,
1273,
313,
13,
462,
4706,
413,
29892,
2393,
29892,
413,
29892,
2393,
13,
462,
1678,
1723,
13,
18884,
1723,
13,
9651,
1596,
703,
2499,
357,
29901,
613,
2767,
718,
13420,
4286,
7122,
29898,
13794,
29918,
22724,
876,
13,
9651,
4833,
29889,
7978,
29898,
5504,
718,
13420,
4286,
7122,
29898,
13794,
29918,
22724,
876,
13,
13,
1753,
1653,
29918,
2371,
29898,
3560,
1367,
29892,
934,
1367,
29892,
848,
29892,
1591,
1989,
29892,
4833,
1125,
13,
1678,
396,
4673,
263,
9591,
304,
7090,
278,
934,
297,
278,
2566,
13,
1678,
565,
3847,
1367,
2804,
448,
29896,
29901,
13,
4706,
1889,
353,
6699,
29918,
5014,
29898,
3560,
1367,
29892,
848,
29892,
1857,
29918,
932,
29889,
2917,
1839,
12925,
16215,
11991,
11287,
13,
4706,
565,
451,
1889,
29961,
29900,
5387,
13,
9651,
736,
313,
13,
18884,
426,
13,
462,
1678,
376,
401,
1115,
29871,
29946,
29900,
29900,
29892,
13,
462,
1678,
376,
4906,
1115,
376,
1576,
13877,
1889,
313,
29995,
29881,
29897,
947,
451,
1863,
29908,
1273,
3847,
1367,
29892,
13,
462,
1678,
376,
9621,
1115,
376,
3560,
1367,
29908,
13,
18884,
2981,
29871,
29946,
29900,
29900,
13,
9651,
1723,
13,
4706,
565,
338,
29918,
21094,
29898,
5014,
1125,
13,
9651,
736,
313,
13,
18884,
426,
13,
462,
1678,
376,
401,
1115,
29871,
29946,
29900,
29900,
29892,
13,
462,
1678,
376,
4906,
1115,
376,
1576,
13877,
1889,
313,
29995,
29881,
29897,
338,
1603,
2734,
29908,
1273,
3847,
1367,
29892,
13,
462,
1678,
376,
9621,
1115,
376,
3560,
1367,
29908,
13,
18884,
2981,
29871,
29946,
29900,
29900,
13,
9651,
1723,
13,
4706,
565,
851,
29898,
1445,
1367,
29897,
451,
297,
1889,
29961,
29900,
22322,
5325,
2033,
29901,
13,
9651,
736,
313,
13,
18884,
426,
13,
462,
1678,
376,
401,
1115,
29871,
29946,
29900,
29900,
29892,
13,
462,
1678,
376,
4906,
1115,
376,
1576,
13877,
934,
1367,
313,
29995,
29879,
29897,
947,
451,
1863,
363,
445,
1889,
313,
29995,
29881,
5513,
1273,
313,
1445,
1367,
29892,
3847,
1367,
511,
13,
462,
1678,
376,
9621,
1115,
376,
1445,
1367,
29908,
13,
18884,
2981,
29871,
29946,
29900,
29900,
13,
9651,
1723,
13,
4706,
10650,
29918,
16950,
353,
1722,
29898,
5014,
29961,
29900,
22322,
5325,
2033,
29961,
1445,
1367,
22322,
8159,
978,
11287,
13,
1678,
1683,
29901,
13,
4706,
565,
851,
29898,
1445,
1367,
29897,
451,
297,
848,
1839,
20119,
675,
2033,
29901,
13,
9651,
736,
313,
13,
18884,
426,
13,
462,
1678,
376,
401,
1115,
29871,
29946,
29900,
29900,
29892,
13,
462,
1678,
376,
4906,
1115,
376,
1576,
13877,
934,
1367,
313,
29995,
29879,
29897,
947,
451,
1863,
297,
278,
7604,
675,
29908,
1273,
934,
1367,
29892,
13,
462,
1678,
376,
9621,
1115,
376,
1445,
1367,
29908,
13,
18884,
2981,
29871,
29946,
29900,
29900,
13,
9651,
1723,
13,
4706,
10650,
29918,
16950,
353,
1722,
29898,
1272,
1839,
20119,
675,
2033,
29961,
710,
29898,
1445,
1367,
4638,
1839,
8159,
978,
11287,
13,
1678,
565,
451,
10650,
29918,
16950,
29889,
978,
29889,
1975,
2541,
12839,
1372,
29894,
29374,
13,
4706,
1294,
353,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
1610,
29918,
16950,
29889,
978,
9601,
29896,
1822,
13609,
580,
13,
4706,
565,
7431,
29898,
1062,
29897,
322,
1294,
29961,
29900,
29962,
1275,
15300,
2396,
13,
9651,
1294,
353,
1294,
29961,
29896,
17531,
13,
4706,
736,
9080,
29918,
294,
29898,
1610,
29918,
16950,
29892,
1294,
29897,
13,
1678,
9591,
353,
11799,
29889,
21533,
6982,
29898,
1610,
29918,
16950,
29892,
28552,
2433,
29905,
29873,
1495,
13,
13,
1678,
13128,
29918,
16950,
353,
1722,
29898,
1610,
29918,
16950,
29889,
978,
29897,
13,
1678,
13128,
353,
11799,
29889,
21533,
6982,
29898,
7050,
29918,
16950,
29892,
28552,
2433,
29905,
29873,
1495,
13,
1678,
1018,
29901,
13,
4706,
2069,
353,
2446,
29898,
7050,
29897,
13,
1678,
5174,
22303,
13463,
362,
29901,
13,
4706,
736,
5159,
13,
1678,
13128,
29918,
16950,
29889,
5358,
580,
13,
13,
1678,
396,
3617,
385,
2847,
12678,
310,
1897,
1418,
271,
7384,
515,
278,
937,
1948,
13,
1678,
313,
20698,
29892,
1897,
29918,
7039,
29897,
353,
2069,
29918,
4914,
29918,
20698,
29898,
2344,
29892,
1857,
29918,
932,
29889,
2917,
1839,
11010,
11287,
13,
1678,
1591,
13099,
353,
6634,
29876,
1642,
7122,
29898,
29871,
396,
671,
278,
15899,
4072,
304,
1653,
278,
1591,
13,
4706,
11860,
29879,
1273,
29879,
1699,
1273,
313,
1054,
978,
29892,
1897,
29918,
7039,
29961,
1054,
978,
2314,
13,
4706,
363,
784,
978,
297,
1897,
29918,
7039,
13,
1678,
1723,
7503,
29899,
29896,
29962,
13,
1678,
14602,
29918,
21009,
353,
376,
27045,
10911,
1273,
29879,
3441,
13,
4706,
1948,
333,
26996,
25758,
29778,
14636,
6058,
4265,
2053,
13,
4706,
1273,
29879,
29905,
13,
1678,
1723,
29908,
1273,
313,
2371,
1989,
29892,
1591,
13099,
29897,
13,
1678,
599,
29918,
2371,
13099,
353,
13420,
15300,
7122,
29898,
4914,
29918,
4572,
29898,
1054,
29897,
363,
784,
297,
9591,
29889,
2671,
7039,
29897,
13,
1678,
1018,
29901,
13,
4706,
1591,
29918,
20736,
29898,
5574,
29892,
4833,
29892,
14602,
29918,
21009,
29892,
1591,
1989,
29892,
599,
29918,
2371,
13099,
29892,
10650,
29918,
16950,
29892,
1897,
29918,
7039,
29892,
10417,
29897,
13,
1678,
5174,
282,
2850,
29889,
11739,
29879,
29889,
8110,
802,
2392,
29901,
396,
3644,
1790,
10804,
2307,
2825,
6790,
1591,
29892,
1209,
13,
4706,
1209,
13,
1678,
5174,
282,
2850,
29889,
11739,
29879,
29889,
797,
2146,
4543,
29925,
1150,
488,
479,
2392,
408,
321,
29901,
13,
4706,
396,
3068,
6403,
746,
1400,
7201,
1404,
9368,
304,
1722,
934,
2861,
304,
11239,
29936,
10816,
363,
1020,
1730,
29899,
455,
6987,
13,
4706,
396,
3198,
565,
9819,
515,
1400,
7201,
1404,
11239,
13,
4706,
565,
321,
29889,
5085,
29961,
29900,
1822,
27382,
2541,
703,
21969,
367,
2428,
1792,
29908,
1125,
13,
9651,
1596,
703,
29956,
25614,
29901,
4918,
7201,
1404,
338,
451,
263,
2428,
1404,
29936,
7604,
2133,
931,
1122,
367,
5232,
1159,
13,
9651,
2030,
29918,
1445,
29918,
949,
29898,
2585,
29892,
14602,
29918,
21009,
29892,
1591,
1989,
29892,
1897,
29918,
7039,
29892,
9591,
29892,
10417,
29897,
396,
1509,
297,
8462,
934,
29899,
949,
29899,
517,
29899,
2585,
1158,
13,
4706,
1683,
29901,
13,
9651,
396,
1131,
3456,
304,
8814,
491,
17596,
934,
304,
847,
7050,
19637,
6480,
967,
11239,
29892,
322,
17378,
372,
727,
13,
9651,
1018,
29901,
13,
18884,
1596,
703,
797,
2146,
4543,
29925,
1150,
488,
479,
2392,
10425,
297,
17378,
934,
7790,
29876,
4165,
3456,
292,
14725,
856,
1159,
13,
18884,
1591,
29918,
20736,
29898,
8824,
29892,
4833,
29892,
14602,
29918,
21009,
29892,
1591,
1989,
29892,
599,
29918,
2371,
13099,
29892,
10650,
29918,
16950,
29892,
1897,
29918,
7039,
29892,
10417,
29897,
13,
9651,
5174,
282,
2850,
29889,
11739,
29879,
29889,
797,
2146,
4543,
29925,
1150,
488,
479,
2392,
29901,
13,
18884,
1596,
703,
6747,
7201,
1033,
451,
2130,
934,
29889,
29871,
5399,
304,
1207,
1854,
393,
1716,
278,
376,
13,
462,
1678,
376,
1445,
322,
596,
1857,
1400,
7201,
1404,
756,
278,
8210,
11239,
23157,
13,
18884,
12020,
13,
1678,
10650,
29918,
16950,
29889,
5358,
580,
13,
13,
1753,
4175,
1445,
29898,
3560,
1367,
29892,
934,
1367,
29892,
2302,
29892,
1813,
29892,
18094,
29892,
2656,
29892,
5305,
1125,
13,
1678,
9995,
29954,
1691,
278,
934,
3553,
23329,
304,
278,
3847,
7790,
13,
1678,
1152,
1121,
2066,
29892,
278,
3847,
1367,
338,
278,
1889,
3553,
393,
29178,
287,
963,
7790,
13,
1678,
1152,
7604,
675,
2066,
29892,
278,
3847,
1367,
338,
448,
29896,
15945,
29908,
13,
1678,
848,
353,
1857,
29918,
932,
29889,
2917,
1839,
12925,
16215,
12657,
2033,
580,
13,
13,
1678,
396,
937,
29892,
5706,
278,
1820,
13,
1678,
1591,
1989,
353,
376,
1272,
29918,
29995,
29879,
29918,
29995,
29879,
29908,
1273,
313,
13,
4706,
313,
3560,
1367,
565,
3847,
1367,
6736,
29871,
29900,
1683,
525,
20119,
675,
5477,
13,
4706,
934,
1367,
13,
1678,
1723,
13,
13,
1678,
396,
1423,
565,
278,
1591,
4864,
29901,
13,
1678,
4833,
353,
282,
2850,
29889,
3150,
703,
7640,
29914,
29886,
29894,
562,
11762,
1159,
13,
1678,
934,
1367,
353,
851,
29898,
1445,
1367,
29897,
13,
1678,
411,
4833,
29889,
29916,
627,
7295,
13,
4706,
2346,
353,
4833,
29889,
19125,
703,
6404,
29871,
29896,
3895,
2472,
29918,
11010,
29889,
24051,
5754,
1591,
29918,
978,
353,
395,
29896,
1159,
13,
4706,
2933,
353,
2346,
29898,
2371,
1989,
29897,
13,
1678,
565,
451,
7431,
29898,
5327,
1125,
29871,
396,
1591,
947,
451,
1863,
13,
4706,
1591,
29918,
12523,
353,
1653,
29918,
2371,
29898,
3560,
1367,
29892,
934,
1367,
29892,
848,
29892,
1591,
1989,
29892,
4833,
29897,
13,
4706,
565,
1591,
29918,
12523,
2804,
6213,
29901,
13,
9651,
736,
1591,
29918,
12523,
13,
1678,
396,
2541,
4833,
29889,
29879,
9524,
3950,
29901,
13,
1678,
396,
1678,
1243,
29918,
1972,
353,
4833,
29889,
19125,
703,
6404,
29871,
29896,
3895,
2472,
29918,
11010,
29889,
24051,
5754,
1591,
29918,
978,
353,
395,
29896,
1159,
13,
1678,
396,
1678,
1243,
29918,
5327,
353,
2346,
29898,
2371,
1989,
29897,
13,
1678,
411,
4833,
29889,
29916,
627,
7295,
13,
4706,
1134,
1972,
353,
4833,
29889,
19125,
29898,
13,
9651,
376,
6404,
1897,
29918,
978,
29892,
848,
29918,
1853,
3895,
2472,
29918,
11010,
29889,
13099,
5754,
1591,
29918,
978,
353,
395,
29896,
29908,
13,
4706,
1723,
13,
4706,
1897,
29918,
1753,
29879,
353,
1134,
1972,
29898,
2371,
1989,
29897,
13,
4706,
1897,
29918,
10339,
353,
6571,
13,
4706,
363,
313,
1054,
29892,
2393,
29897,
297,
1897,
29918,
1753,
29879,
29901,
13,
9651,
565,
525,
524,
29915,
297,
2393,
29901,
13,
18884,
1897,
29918,
10339,
29961,
1054,
29962,
353,
938,
13,
9651,
25342,
2393,
1275,
525,
21574,
29915,
272,
2393,
1275,
525,
7099,
3039,
2396,
13,
18884,
1897,
29918,
10339,
29961,
1054,
29962,
353,
5785,
13,
9651,
1683,
29901,
13,
18884,
1897,
29918,
10339,
29961,
1054,
29962,
353,
851,
13,
1678,
20917,
29918,
26705,
353,
5159,
13,
1678,
363,
474,
297,
3464,
29898,
2435,
29898,
26705,
22164,
13,
4706,
285,
353,
18094,
29961,
29875,
1822,
17010,
580,
13,
4706,
565,
451,
7431,
29898,
29888,
1125,
13,
9651,
6773,
13,
4706,
1121,
353,
2346,
26705,
29889,
4352,
29898,
29888,
29897,
13,
4706,
565,
451,
1121,
29901,
13,
9651,
736,
21313,
13,
18884,
376,
401,
1115,
29871,
29946,
29900,
29900,
29892,
13,
18884,
376,
4906,
1115,
376,
8566,
5336,
287,
385,
8340,
4175,
313,
29995,
29879,
5513,
1273,
285,
29892,
13,
18884,
376,
9621,
1115,
376,
26705,
29908,
13,
9651,
2981,
29871,
29946,
29900,
29900,
29897,
13,
4706,
784,
978,
353,
1897,
29918,
4572,
29898,
2914,
29889,
2972,
29898,
29896,
876,
13,
4706,
565,
784,
978,
451,
297,
1897,
29918,
10339,
29901,
13,
9651,
736,
21313,
13,
18884,
376,
401,
1115,
29871,
29946,
29900,
29900,
29892,
13,
18884,
376,
4906,
1115,
376,
14148,
1897,
1024,
1273,
29879,
29908,
1273,
1121,
29889,
2972,
29898,
29896,
511,
13,
18884,
376,
9621,
1115,
376,
26705,
29908,
13,
9651,
2981,
29871,
29946,
29900,
29900,
29897,
13,
4706,
1015,
353,
1121,
29889,
2972,
29898,
29906,
29897,
13,
4706,
2393,
353,
1897,
29918,
10339,
29961,
1054,
978,
29962,
13,
4706,
659,
353,
6213,
13,
4706,
1018,
29901,
13,
9651,
659,
353,
1897,
29918,
10339,
29961,
1054,
978,
850,
13,
18884,
1121,
29889,
2972,
29898,
29941,
29897,
13,
9651,
1723,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
736,
21313,
13,
18884,
376,
401,
1115,
29871,
29946,
29900,
29900,
29892,
13,
18884,
376,
4906,
1115,
376,
1917,
1273,
29879,
2609,
367,
20917,
304,
1993,
278,
1134,
310,
1897,
1273,
29879,
313,
29995,
29879,
5513,
1273,
313,
13,
462,
1678,
1121,
29889,
2972,
29898,
29941,
511,
13,
462,
1678,
1121,
29889,
2972,
29898,
29896,
511,
13,
462,
1678,
2393,
13,
18884,
1723,
13,
9651,
2981,
29871,
29946,
29900,
29900,
29897,
13,
4706,
565,
2393,
1275,
851,
322,
313,
459,
297,
11117,
1360,
742,
525,
29991,
2433,
29913,
1125,
13,
9651,
20917,
29918,
26705,
29889,
4397,
29898,
13,
18884,
4390,
29889,
29881,
17204,
29898,
1054,
978,
29897,
718,
6702,
451,
525,
565,
525,
20714,
297,
1015,
1683,
525,
25710,
718,
376,
5265,
6059,
14210,
29879,
11838,
1273,
313,
13,
462,
1678,
4390,
29889,
29881,
17204,
29898,
791,
9601,
29896,
13018,
29896,
29962,
13,
18884,
1723,
13,
9651,
1723,
13,
4706,
1683,
29901,
29871,
396,
1134,
338,
16259,
13,
9651,
1015,
353,
1015,
29889,
6506,
877,
1360,
742,
525,
29922,
1495,
13,
9651,
20917,
29918,
26705,
29889,
4397,
29898,
13,
18884,
14210,
29879,
1273,
29879,
1273,
29879,
29915,
1273,
313,
13,
462,
1678,
4390,
29889,
29881,
17204,
29898,
1054,
978,
511,
13,
462,
1678,
1015,
29892,
13,
462,
1678,
4390,
29889,
29881,
17204,
29898,
791,
29897,
13,
18884,
1723,
13,
9651,
1723,
13,
1678,
10650,
29918,
1972,
353,
376,
6404,
1273,
29879,
3895,
1273,
29879,
29908,
1273,
313,
13,
4706,
13420,
4286,
7122,
4197,
29895,
29961,
29900,
29962,
363,
413,
297,
1897,
29918,
1753,
29879,
11724,
13,
4706,
1591,
1989,
13,
1678,
1723,
13,
1678,
565,
7431,
29898,
689,
19667,
29918,
26705,
1125,
13,
4706,
10650,
29918,
1972,
4619,
376,
5754,
376,
718,
376,
5300,
11393,
7122,
29898,
689,
19667,
29918,
26705,
29897,
13,
1678,
565,
2656,
29901,
13,
4706,
565,
1897,
29918,
4572,
29898,
6605,
29897,
451,
297,
1897,
29918,
10339,
29901,
13,
9651,
736,
21313,
13,
18884,
525,
401,
2396,
29871,
29946,
29900,
29900,
29892,
13,
18884,
525,
4906,
2396,
525,
13919,
1897,
1024,
1273,
29879,
29915,
1273,
2656,
29892,
13,
18884,
525,
9621,
2396,
525,
6605,
29915,
13,
9651,
2981,
29871,
29946,
29900,
29900,
29897,
13,
4706,
10650,
29918,
1972,
4619,
376,
15606,
6770,
1273,
29879,
29908,
1273,
313,
4914,
29918,
4572,
29898,
6605,
876,
13,
4706,
565,
5305,
29901,
13,
9651,
10650,
29918,
1972,
4619,
376,
376,
718,
5305,
13,
1678,
565,
2302,
29901,
13,
4706,
10650,
29918,
1972,
4619,
376,
27848,
1273,
29881,
29908,
1273,
2302,
13,
1678,
565,
1813,
29901,
13,
4706,
10650,
29918,
1972,
4619,
376,
438,
4198,
10490,
1273,
29881,
29908,
1273,
313,
3488,
334,
2302,
29897,
13,
1678,
1596,
703,
3010,
29901,
613,
10650,
29918,
1972,
29897,
13,
1678,
1053,
13677,
13,
1678,
411,
4833,
29889,
29916,
627,
877,
6304,
25758,
26664,
6181,
742,
525,
16310,
6732,
16786,
5012,
29943,
21662,
6181,
29374,
13,
4706,
2346,
353,
4833,
29889,
19125,
29898,
1610,
29918,
1972,
29897,
13,
4706,
13677,
3950,
353,
14013,
921,
29901,
313,
7411,
29898,
29916,
29897,
565,
1134,
29898,
29916,
29897,
1275,
13677,
29889,
23307,
1683,
921,
29897,
13,
4706,
1121,
353,
518,
13,
9651,
426,
13,
18884,
784,
978,
29901,
13677,
3950,
29898,
1767,
29897,
363,
313,
1054,
978,
29892,
995,
29897,
297,
14319,
29898,
13,
462,
1678,
518,
29895,
29961,
29900,
29962,
363,
413,
297,
1897,
29918,
1753,
29879,
1402,
13,
462,
1678,
518,
791,
363,
659,
297,
1948,
29962,
13,
18884,
1723,
13,
9651,
500,
363,
1948,
297,
2346,
29889,
5727,
580,
13,
4706,
4514,
13,
1678,
4833,
29889,
5358,
580,
13,
1678,
736,
1121,
13,
13,
13,
1753,
977,
1968,
2603,
29898,
3560,
1367,
29892,
934,
1367,
1125,
13,
1678,
848,
353,
1857,
29918,
932,
29889,
2917,
1839,
12925,
16215,
12657,
2033,
580,
13,
1678,
1591,
1989,
353,
376,
1272,
29918,
29995,
29879,
29918,
29995,
29879,
29908,
1273,
313,
13,
4706,
313,
3560,
1367,
565,
3847,
1367,
6736,
29871,
29900,
1683,
525,
20119,
675,
5477,
13,
4706,
934,
1367,
13,
1678,
1723,
13,
13,
1678,
396,
1423,
565,
278,
1591,
4864,
29901,
13,
1678,
4833,
353,
282,
2850,
29889,
3150,
703,
7640,
29914,
29886,
29894,
562,
11762,
1159,
13,
1678,
411,
4833,
29889,
29916,
627,
7295,
13,
4706,
2346,
353,
4833,
29889,
19125,
703,
6404,
29871,
29896,
3895,
2472,
29918,
11010,
29889,
24051,
5754,
1591,
29918,
978,
353,
395,
29896,
1159,
13,
4706,
565,
451,
7431,
29898,
1972,
29898,
2371,
1989,
22164,
29871,
396,
1591,
947,
451,
1863,
13,
9651,
736,
21313,
13,
18884,
525,
401,
2396,
29871,
29946,
29900,
29900,
29892,
13,
18884,
525,
4906,
2396,
376,
1576,
13877,
934,
756,
451,
1063,
7500,
964,
278,
4918,
7201,
2566,
613,
13,
18884,
525,
9621,
2396,
376,
1445,
1367,
29908,
13,
9651,
2981,
29871,
29946,
29900,
29900,
29897,
13,
4706,
1134,
1972,
353,
4833,
29889,
19125,
703,
6404,
1897,
29918,
978,
29892,
848,
29918,
1853,
3895,
2472,
29918,
11010,
29889,
13099,
5754,
1591,
29918,
978,
353,
395,
29896,
1159,
13,
4706,
1121,
353,
426,
13,
9651,
1820,
29901,
659,
363,
313,
1989,
29892,
659,
29897,
297,
1134,
1972,
29898,
2371,
1989,
29897,
13,
4706,
500,
13,
1678,
4833,
29889,
5358,
580,
13,
1678,
736,
1121,
13,
13,
1753,
9080,
29918,
294,
29898,
16950,
29892,
934,
1853,
1125,
13,
1678,
565,
934,
1853,
1275,
525,
3126,
2396,
13,
4706,
736,
426,
13,
9651,
525,
1445,
1853,
22099,
3126,
742,
13,
9651,
525,
3051,
2396,
3126,
29889,
1359,
29898,
16950,
29897,
13,
4706,
500,
13,
1678,
25342,
934,
1853,
1275,
525,
25162,
29915,
470,
934,
1853,
1275,
525,
21053,
2396,
13,
4706,
736,
426,
13,
9651,
525,
1445,
1853,
22099,
25162,
742,
13,
9651,
525,
3051,
2396,
25162,
29889,
1359,
29898,
16950,
29889,
949,
3101,
13,
4706,
500,
13,
1678,
25342,
934,
1853,
1275,
525,
1188,
2396,
13,
4706,
736,
426,
13,
9651,
525,
1445,
1853,
22099,
1188,
742,
13,
9651,
525,
3051,
2396,
29961,
1220,
29889,
29878,
17010,
580,
363,
1196,
297,
9591,
29889,
949,
9012,
580,
29962,
13,
4706,
500,
13,
1678,
1683,
29901,
13,
4706,
736,
426,
13,
9651,
525,
1445,
1853,
22099,
1610,
742,
13,
9651,
525,
3051,
2396,
16950,
29889,
949,
580,
13,
4706,
500,
13,
13,
1753,
7604,
675,
29898,
3560,
1367,
29892,
934,
1367,
1125,
13,
1678,
1998,
353,
7604,
675,
29918,
2154,
29898,
3560,
1367,
29892,
934,
1367,
29897,
13,
1678,
736,
12801,
1420,
5299,
2813,
2565,
2813,
5299,
2587,
29958,
29995,
29879,
829,
2587,
2565,
1420,
29915,
29995,
29898,
1730,
565,
1134,
29898,
1730,
29897,
19216,
23583,
1683,
1998,
29961,
29900,
2314,
13,
13,
1753,
7604,
675,
29918,
2154,
29898,
3560,
1367,
29892,
934,
1367,
1125,
13,
1678,
9995,
11609,
385,
4544,
1842,
6943,
278,
13877,
1591,
7604,
2133,
15945,
29908,
13,
1678,
515,
869,
5325,
1053,
2582,
29918,
657,
22724,
13,
1678,
848,
353,
1857,
29918,
932,
29889,
2917,
1839,
12925,
16215,
12657,
2033,
580,
13,
1678,
396,
4102,
1246,
4175,
1445,
304,
2254,
278,
1591,
565,
372,
29915,
29879,
451,
7500,
2307,
13,
1678,
1121,
353,
4175,
1445,
29898,
3560,
1367,
29892,
934,
1367,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
15516,
525,
798,
333,
742,
525,
28599,
1495,
13,
1678,
565,
1134,
29898,
2914,
29897,
2804,
1051,
29901,
13,
4706,
736,
313,
13,
9651,
426,
13,
18884,
525,
401,
2396,
29946,
29900,
29900,
29892,
13,
18884,
525,
4906,
2396,
3126,
29889,
29881,
17204,
29898,
2914,
511,
13,
18884,
525,
9621,
22099,
26690,
742,
13,
9651,
2981,
13,
632,
29946,
29900,
29900,
13,
4706,
1723,
13,
1678,
565,
7431,
29898,
2914,
29897,
1275,
29871,
29900,
470,
1134,
29898,
2914,
29897,
1275,
9657,
29901,
13,
4706,
736,
313,
13,
9651,
525,
12191,
934,
3743,
694,
848,
448,
2609,
7604,
675,
29915,
13,
4706,
1723,
13,
1678,
28730,
353,
2582,
29918,
657,
22724,
29898,
3560,
1367,
29892,
934,
1367,
29897,
13,
1678,
565,
1134,
29898,
22724,
29897,
2804,
9657,
29901,
13,
4706,
736,
313,
13,
9651,
426,
13,
18884,
525,
401,
2396,
29946,
29900,
29900,
29892,
13,
18884,
525,
4906,
2396,
3126,
29889,
29881,
17204,
29898,
22724,
511,
13,
18884,
525,
9621,
22099,
26690,
29915,
13,
9651,
2981,
13,
632,
29946,
29900,
29900,
13,
4706,
1723,
13,
13,
1678,
9580,
29918,
1272,
353,
1889,
29918,
3888,
29898,
3560,
1367,
29897,
13,
13,
1678,
565,
1134,
29898,
15439,
29918,
1272,
29897,
1360,
8977,
322,
525,
16744,
29915,
297,
9580,
29918,
1272,
322,
525,
11249,
29918,
978,
29915,
297,
9580,
29918,
1272,
1839,
16744,
2033,
29901,
13,
4706,
4559,
353,
9580,
29918,
1272,
1839,
16744,
16215,
11249,
29918,
978,
2033,
13,
1678,
25342,
3847,
1367,
1275,
448,
29896,
29901,
13,
4706,
4559,
353,
848,
1839,
20119,
675,
2033,
29961,
710,
29898,
1445,
1367,
4638,
1839,
4990,
29918,
978,
13359,
2288,
2830,
17350,
613,
29871,
29896,
9601,
29900,
29962,
13,
1678,
1683,
29901,
13,
4706,
4559,
353,
525,
14148,
21029,
29915,
13,
13,
1678,
565,
1857,
29918,
932,
29889,
8618,
18454,
29918,
5690,
29918,
17744,
26785,
338,
451,
6213,
29901,
13,
4706,
5641,
353,
1857,
29918,
932,
29889,
8618,
18454,
29918,
5690,
29918,
17744,
26785,
13,
1678,
1683,
29901,
13,
4706,
5641,
353,
1857,
29918,
932,
29889,
5690,
29918,
17744,
26785,
13,
13,
1678,
736,
313,
13,
4706,
1923,
29918,
3225,
29898,
13,
9651,
3142,
543,
1124,
597,
29908,
718,
5641,
718,
29242,
29945,
29900,
29900,
29953,
29914,
20119,
17063,
613,
13,
9651,
6273,
3790,
13,
18884,
525,
5182,
29899,
5014,
2396,
3847,
1367,
29892,
13,
18884,
525,
5182,
29899,
1445,
2396,
934,
1367,
29892,
13,
18884,
525,
22724,
2396,
4390,
29889,
29881,
17204,
29898,
22724,
511,
13,
18884,
525,
13445,
572,
3871,
2396,
4559,
13,
9651,
500,
13,
4706,
1723,
13,
1678,
1723,
13,
2
] |
Loan-Approval-Analysis/code.py | pavanmakineni/ga-learner-dsb-repo | 0 | 133787 | <reponame>pavanmakineni/ga-learner-dsb-repo
# --------------
# Import packages
import numpy as np
import pandas as pd
from scipy.stats import mode
# code starts here
bank=pd.read_csv(path,sep=',',header='infer')
#print(bank)
categorical_var = bank.select_dtypes(include = 'object')
#print(categorical_var)
numerical_var = bank.select_dtypes(include = 'number')
print(numerical_var)
# code ends here
# --------------
# code starts here
import pandas as pd
print(bank.columns)
banks = bank.drop(columns = 'Loan_ID')
print(banks.columns)
print(banks.isnull().sum())
bank_mode1 = banks.mode()
print(bank_mode1)
bank_mode = banks.mode().iloc[0]
print(bank_mode)
banks.fillna(bank_mode, inplace=True)
print(banks.isnull().sum())
#code ends here
# --------------
# Code starts here
import pandas as pd
avg_loan_amount = pd.pivot_table(banks,index=['Gender','Married','Self_Employed'],values='LoanAmount',aggfunc='mean')
print(avg_loan_amount)
print(type(avg_loan_amount))
# code ends here
# --------------
# code starts here
import pandas as pd
loan_status = 614
loan_approved_se = banks[(banks['Self_Employed'] == 'Yes') & (banks['Loan_Status'] == 'Y')]
#print(loan_approved_se)
print(type(loan_approved_se))
loan_approved_nse = banks[(banks['Self_Employed'] == 'No') & (banks['Loan_Status'] == 'Y')]
#print(loan_approved_nse)
print(type(loan_approved_nse))
print(loan_approved_se.count())
print(loan_approved_se.count().iloc[0])
percentage_se = (loan_approved_se.count().iloc[0]/loan_status) * 100
print(percentage_se)
percentage_nse = (loan_approved_nse.count().iloc[0]/loan_status) * 100
print(percentage_nse)
# code ends here
# --------------
# code starts here
import pandas as pd
print(banks.columns)
def convert_to_year(months):
return int(months)/12
loan_term = banks['Loan_Amount_Term'].apply(lambda x:convert_to_year(x))
#print(loan_term)
print(type(loan_term))
print(banks.columns)
big_loan_term1 = loan_term[loan_term >= 25].count()
print(big_loan_term1)
print(type(big_loan_term1))
big_loan_term = len(loan_term[loan_term >= 25])
print(big_loan_term)
print(type(big_loan_term))
# code ends here
# --------------
# code starts here
import pandas as pd
loan_groupby = banks.groupby('Loan_Status')
print(loan_groupby)
loan_groupby = loan_groupby['ApplicantIncome','Credit_History']
print(loan_groupby)
mean_values = loan_groupby.apply(np.mean)
print(mean_values)
# code ends here
| [
1,
529,
276,
1112,
420,
29958,
29886,
29080,
29885,
557,
7026,
29875,
29914,
3249,
29899,
1945,
1089,
29899,
6289,
29890,
29899,
20095,
13,
29937,
448,
9072,
29899,
13,
29937,
16032,
9741,
13,
5215,
12655,
408,
7442,
13,
5215,
11701,
408,
10518,
13,
3166,
4560,
2272,
29889,
16202,
1053,
4464,
29871,
13,
29871,
13,
13,
13,
13,
29937,
775,
8665,
1244,
13,
9157,
29922,
15926,
29889,
949,
29918,
7638,
29898,
2084,
29892,
19570,
29922,
742,
742,
6672,
2433,
262,
571,
1495,
13,
29937,
2158,
29898,
9157,
29897,
13,
13,
29883,
20440,
936,
29918,
1707,
353,
9124,
29889,
2622,
29918,
29881,
8768,
29898,
2856,
353,
525,
3318,
1495,
13,
29937,
2158,
29898,
29883,
20440,
936,
29918,
1707,
29897,
13,
13,
8058,
936,
29918,
1707,
353,
9124,
29889,
2622,
29918,
29881,
8768,
29898,
2856,
353,
525,
4537,
1495,
13,
2158,
29898,
8058,
936,
29918,
1707,
29897,
13,
13,
13,
13,
29937,
775,
10614,
1244,
13,
13,
13,
29937,
448,
9072,
29899,
13,
29937,
775,
8665,
1244,
13,
5215,
11701,
408,
10518,
29871,
13,
13,
13,
2158,
29898,
9157,
29889,
13099,
29897,
13,
29890,
1331,
353,
9124,
29889,
8865,
29898,
13099,
353,
525,
3410,
273,
29918,
1367,
1495,
13,
2158,
29898,
29890,
1331,
29889,
13099,
29897,
13,
13,
2158,
29898,
29890,
1331,
29889,
275,
4304,
2141,
2083,
3101,
13,
13,
13,
9157,
29918,
8513,
29896,
353,
24388,
29889,
8513,
580,
13,
2158,
29898,
9157,
29918,
8513,
29896,
29897,
13,
13,
9157,
29918,
8513,
353,
24388,
29889,
8513,
2141,
309,
542,
29961,
29900,
29962,
13,
2158,
29898,
9157,
29918,
8513,
29897,
13,
13,
29890,
1331,
29889,
5589,
1056,
29898,
9157,
29918,
8513,
29892,
297,
6689,
29922,
5574,
29897,
13,
13,
13,
2158,
29898,
29890,
1331,
29889,
275,
4304,
2141,
2083,
3101,
13,
29937,
401,
10614,
1244,
13,
13,
13,
29937,
448,
9072,
29899,
13,
29937,
5920,
8665,
1244,
13,
5215,
11701,
408,
10518,
29871,
13,
13,
13,
13,
13,
485,
29887,
29918,
417,
273,
29918,
14506,
353,
10518,
29889,
29886,
11002,
29918,
2371,
29898,
29890,
1331,
29892,
2248,
29922,
1839,
29954,
1581,
3788,
7083,
1255,
3788,
24313,
29918,
10495,
2376,
287,
7464,
5975,
2433,
3410,
273,
18087,
742,
16170,
9891,
2433,
12676,
1495,
13,
2158,
29898,
485,
29887,
29918,
417,
273,
29918,
14506,
29897,
13,
2158,
29898,
1853,
29898,
485,
29887,
29918,
417,
273,
29918,
14506,
876,
13,
13,
29937,
775,
10614,
1244,
13,
13,
13,
13,
29937,
448,
9072,
29899,
13,
29937,
775,
8665,
1244,
13,
5215,
11701,
408,
10518,
29871,
13,
13,
417,
273,
29918,
4882,
353,
29871,
29953,
29896,
29946,
13,
13,
13,
417,
273,
29918,
9961,
1490,
29918,
344,
353,
24388,
15625,
29890,
1331,
1839,
24313,
29918,
10495,
2376,
287,
2033,
1275,
525,
8241,
1495,
669,
313,
29890,
1331,
1839,
3410,
273,
29918,
5709,
2033,
1275,
525,
29979,
1495,
29962,
13,
29937,
2158,
29898,
417,
273,
29918,
9961,
1490,
29918,
344,
29897,
13,
2158,
29898,
1853,
29898,
417,
273,
29918,
9961,
1490,
29918,
344,
876,
13,
13,
417,
273,
29918,
9961,
1490,
29918,
29876,
344,
353,
24388,
15625,
29890,
1331,
1839,
24313,
29918,
10495,
2376,
287,
2033,
1275,
525,
3782,
1495,
669,
313,
29890,
1331,
1839,
3410,
273,
29918,
5709,
2033,
1275,
525,
29979,
1495,
29962,
13,
29937,
2158,
29898,
417,
273,
29918,
9961,
1490,
29918,
29876,
344,
29897,
13,
2158,
29898,
1853,
29898,
417,
273,
29918,
9961,
1490,
29918,
29876,
344,
876,
13,
2158,
29898,
417,
273,
29918,
9961,
1490,
29918,
344,
29889,
2798,
3101,
13,
2158,
29898,
417,
273,
29918,
9961,
1490,
29918,
344,
29889,
2798,
2141,
309,
542,
29961,
29900,
2314,
13,
13,
25376,
482,
29918,
344,
353,
313,
417,
273,
29918,
9961,
1490,
29918,
344,
29889,
2798,
2141,
309,
542,
29961,
29900,
16261,
417,
273,
29918,
4882,
29897,
334,
29871,
29896,
29900,
29900,
13,
2158,
29898,
25376,
482,
29918,
344,
29897,
13,
13,
25376,
482,
29918,
29876,
344,
353,
313,
417,
273,
29918,
9961,
1490,
29918,
29876,
344,
29889,
2798,
2141,
309,
542,
29961,
29900,
16261,
417,
273,
29918,
4882,
29897,
334,
29871,
29896,
29900,
29900,
13,
2158,
29898,
25376,
482,
29918,
29876,
344,
29897,
13,
29937,
775,
10614,
1244,
13,
13,
13,
29937,
448,
9072,
29899,
13,
29937,
775,
8665,
1244,
13,
5215,
11701,
408,
10518,
29871,
13,
13,
2158,
29898,
29890,
1331,
29889,
13099,
29897,
13,
13,
1753,
3588,
29918,
517,
29918,
6360,
29898,
10874,
29879,
1125,
13,
1678,
736,
938,
29898,
10874,
29879,
6802,
29896,
29906,
13,
13,
417,
273,
29918,
8489,
353,
24388,
1839,
3410,
273,
29918,
18087,
29918,
14343,
13359,
7302,
29898,
2892,
921,
29901,
13441,
29918,
517,
29918,
6360,
29898,
29916,
876,
13,
29937,
2158,
29898,
417,
273,
29918,
8489,
29897,
13,
2158,
29898,
1853,
29898,
417,
273,
29918,
8489,
876,
13,
2158,
29898,
29890,
1331,
29889,
13099,
29897,
13,
13,
3752,
29918,
417,
273,
29918,
8489,
29896,
353,
24806,
29918,
8489,
29961,
417,
273,
29918,
8489,
6736,
29871,
29906,
29945,
1822,
2798,
580,
13,
2158,
29898,
3752,
29918,
417,
273,
29918,
8489,
29896,
29897,
13,
2158,
29898,
1853,
29898,
3752,
29918,
417,
273,
29918,
8489,
29896,
876,
13,
13,
3752,
29918,
417,
273,
29918,
8489,
353,
7431,
29898,
417,
273,
29918,
8489,
29961,
417,
273,
29918,
8489,
6736,
29871,
29906,
29945,
2314,
13,
2158,
29898,
3752,
29918,
417,
273,
29918,
8489,
29897,
13,
2158,
29898,
1853,
29898,
3752,
29918,
417,
273,
29918,
8489,
876,
13,
29937,
775,
10614,
1244,
13,
13,
13,
29937,
448,
9072,
29899,
13,
29937,
775,
8665,
1244,
13,
5215,
11701,
408,
10518,
29871,
13,
13,
417,
273,
29918,
27789,
353,
24388,
29889,
27789,
877,
3410,
273,
29918,
5709,
1495,
13,
2158,
29898,
417,
273,
29918,
27789,
29897,
13,
13,
417,
273,
29918,
27789,
353,
24806,
29918,
27789,
1839,
2052,
506,
424,
797,
2763,
3788,
15507,
277,
29918,
20570,
2033,
13,
2158,
29898,
417,
273,
29918,
27789,
29897,
13,
13,
12676,
29918,
5975,
353,
24806,
29918,
27789,
29889,
7302,
29898,
9302,
29889,
12676,
29897,
13,
2158,
29898,
12676,
29918,
5975,
29897,
13,
29937,
775,
10614,
1244,
13,
13,
13,
2
] |
Documentation_generator/ivml_documentation_from_file.py | jegentile/IVML | 8 | 51504 | __author__ = 'jgentile'
class IVMLDocumentationFromFile:
def __init__(self,file_name):
self.__file_name = file_name
self.__file = open(file_name)
print ' Document generator looking at ',file_name
self.__ivml_object_documentation = '\0'
self.__type = ''
self.__ivml_non_required_attributes = {}
self.__ivml_required_attributes = {}
self.__svg_attributes = {}
self.__events = {}
self.__name = ""
self.__description = ""
def change_from_camel_case(self,string):
str = string
for i in range(65,91):
str = str.replace(chr(i),'-'+chr(i+32))
return str
def parse(self):
on_line = 0
for line in self.__file:
#check to see if the first line annotates an IVML object
if on_line ==0:
stripped_line = line.replace(' ','').replace('\t','').rstrip()
array = stripped_line.split(':')
#if the first line in the JavaScript file is not annotated for the documentaion, return
if not array[0] == '//@defining' or not len(array) ==3:
print " WARNING: First line of",self.__file_name," file does not have proper annotation. Skipping."
return
print array
if array[1] == 'ivml.chart':
self.__type = 'chart'
if array[1] == 'ivml.visualElement':
self.__type = 'visual_element'
if array[1] == 'ivml.group':
self.__type = 'group'
print 'Name: ', array[2]," --- type:",self.__type
self.__name = self.change_from_camel_case( array[2])
if on_line > 0 and self.__type:
if '//@' in line:
struct = 0
offset = 1
if '//@i' in line:
struct = self.__ivml_non_required_attributes
if '//@ir' in line:
struct = self.__ivml_required_attributes
offset = 2
if '//@s' in line:
struct = self.__svg_attributes
if '//@e' in line:
struct = self.__events
if '//@description' in line:
self.__description = line.split('//@description')[1].rstrip()
if not struct == 0:
attribute = line.strip().replace(' ','').replace('\t','').split(':')[0]
struct[self.change_from_camel_case(attribute)] = line.split('//@')[len(line.split('//@'))-1][offset:].strip().rstrip().replace('#','\#').replace('_','\_')
on_line+=1
'''
print 'ivml',self.__ivml_attributes
print 'svg',self.__svg_attributes
print 'events',self.__events
'''
def get_type(self):
if self.__type:
return self.__type
def get_ivml_required_attributes(self):
return self.__ivml_required_attributes
def get_ivml_non_required_attributes(self):
return self.__ivml_non_required_attributes
def get_svg_attributes(self):
return self.__svg_attributes
def get_event_attributes(self):
return self.__events
def get_name(self):
return self.__name
def get_description(self):
return self.__description
| [
1,
4770,
8921,
1649,
353,
525,
29926,
5362,
488,
29915,
13,
13,
13,
1990,
6599,
1988,
6268,
362,
4591,
2283,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1445,
29918,
978,
1125,
13,
4706,
1583,
17255,
1445,
29918,
978,
353,
934,
29918,
978,
13,
4706,
1583,
17255,
1445,
353,
1722,
29898,
1445,
29918,
978,
29897,
13,
4706,
1596,
525,
1678,
10854,
15299,
3063,
472,
13420,
1445,
29918,
978,
13,
4706,
1583,
17255,
440,
828,
29918,
3318,
29918,
12663,
353,
11297,
29900,
29915,
13,
4706,
1583,
17255,
1853,
353,
6629,
13,
4706,
1583,
17255,
440,
828,
29918,
5464,
29918,
12403,
29918,
15697,
353,
6571,
13,
4706,
1583,
17255,
440,
828,
29918,
12403,
29918,
15697,
353,
6571,
13,
4706,
1583,
17255,
15120,
29918,
15697,
353,
6571,
13,
4706,
1583,
17255,
13604,
353,
6571,
13,
4706,
1583,
17255,
978,
353,
5124,
13,
4706,
1583,
17255,
8216,
353,
5124,
13,
13,
1678,
822,
1735,
29918,
3166,
29918,
11108,
295,
29918,
4878,
29898,
1311,
29892,
1807,
1125,
13,
4706,
851,
353,
1347,
13,
4706,
363,
474,
297,
3464,
29898,
29953,
29945,
29892,
29929,
29896,
1125,
13,
9651,
851,
353,
851,
29889,
6506,
29898,
22495,
29898,
29875,
511,
28560,
18717,
22495,
29898,
29875,
29974,
29941,
29906,
876,
13,
4706,
736,
851,
13,
13,
1678,
822,
6088,
29898,
1311,
1125,
13,
13,
4706,
373,
29918,
1220,
353,
29871,
29900,
13,
4706,
363,
1196,
297,
1583,
17255,
1445,
29901,
13,
9651,
396,
3198,
304,
1074,
565,
278,
937,
1196,
9732,
1078,
385,
6599,
1988,
1203,
13,
9651,
565,
373,
29918,
1220,
1275,
29900,
29901,
13,
18884,
10076,
2986,
29918,
1220,
353,
1196,
29889,
6506,
877,
525,
5501,
2824,
6506,
28909,
29873,
3788,
2824,
29878,
17010,
580,
13,
18884,
1409,
353,
10076,
2986,
29918,
1220,
29889,
5451,
877,
29901,
1495,
13,
13,
18884,
396,
361,
278,
937,
1196,
297,
278,
8286,
934,
338,
451,
9732,
630,
363,
278,
1842,
29874,
291,
29892,
736,
13,
18884,
565,
451,
1409,
29961,
29900,
29962,
1275,
525,
458,
29992,
1753,
2827,
29915,
470,
451,
7431,
29898,
2378,
29897,
1275,
29941,
29901,
13,
462,
1678,
1596,
376,
418,
399,
25614,
29901,
3824,
1196,
310,
613,
1311,
17255,
1445,
29918,
978,
1699,
934,
947,
451,
505,
1571,
17195,
29889,
28551,
3262,
1213,
13,
462,
1678,
736,
13,
18884,
1596,
1409,
13,
18884,
565,
1409,
29961,
29896,
29962,
1275,
525,
440,
828,
29889,
15425,
2396,
13,
462,
1678,
1583,
17255,
1853,
353,
525,
15425,
29915,
13,
18884,
565,
1409,
29961,
29896,
29962,
1275,
525,
440,
828,
29889,
20119,
2642,
2396,
13,
462,
1678,
1583,
17255,
1853,
353,
525,
20119,
29918,
5029,
29915,
13,
18884,
565,
1409,
29961,
29896,
29962,
1275,
525,
440,
828,
29889,
2972,
2396,
13,
462,
1678,
1583,
17255,
1853,
353,
525,
2972,
29915,
13,
13,
18884,
1596,
525,
1170,
29901,
13420,
1409,
29961,
29906,
1402,
29908,
11474,
1134,
29901,
613,
1311,
17255,
1853,
13,
18884,
1583,
17255,
978,
353,
1583,
29889,
3167,
29918,
3166,
29918,
11108,
295,
29918,
4878,
29898,
1409,
29961,
29906,
2314,
13,
13,
9651,
565,
373,
29918,
1220,
1405,
29871,
29900,
322,
1583,
17255,
1853,
29901,
13,
18884,
565,
525,
458,
29992,
29915,
297,
1196,
29901,
13,
462,
1678,
2281,
353,
29871,
29900,
13,
462,
1678,
9210,
353,
29871,
29896,
13,
462,
1678,
565,
525,
458,
29992,
29875,
29915,
297,
1196,
29901,
13,
462,
4706,
2281,
353,
1583,
17255,
440,
828,
29918,
5464,
29918,
12403,
29918,
15697,
13,
462,
1678,
565,
525,
458,
29992,
381,
29915,
297,
1196,
29901,
13,
462,
4706,
2281,
353,
1583,
17255,
440,
828,
29918,
12403,
29918,
15697,
13,
462,
4706,
9210,
353,
29871,
29906,
13,
462,
1678,
565,
525,
458,
29992,
29879,
29915,
297,
1196,
29901,
13,
462,
4706,
2281,
353,
1583,
17255,
15120,
29918,
15697,
13,
462,
1678,
565,
525,
458,
29992,
29872,
29915,
297,
1196,
29901,
13,
462,
4706,
2281,
353,
1583,
17255,
13604,
13,
462,
1678,
565,
525,
458,
29992,
8216,
29915,
297,
1196,
29901,
13,
462,
4706,
1583,
17255,
8216,
353,
1196,
29889,
5451,
877,
458,
29992,
8216,
29861,
29896,
1822,
29878,
17010,
580,
13,
462,
1678,
565,
451,
2281,
1275,
29871,
29900,
29901,
13,
462,
4706,
5352,
353,
1196,
29889,
17010,
2141,
6506,
877,
525,
5501,
2824,
6506,
28909,
29873,
3788,
2824,
5451,
877,
29901,
29861,
29900,
29962,
13,
462,
4706,
2281,
29961,
1311,
29889,
3167,
29918,
3166,
29918,
11108,
295,
29918,
4878,
29898,
12715,
4638,
353,
1196,
29889,
5451,
877,
458,
29992,
29861,
2435,
29898,
1220,
29889,
5451,
877,
458,
29992,
8785,
29899,
29896,
3816,
10289,
29901,
1822,
17010,
2141,
29878,
17010,
2141,
6506,
14237,
3788,
29905,
29937,
2824,
6506,
877,
29918,
3788,
20122,
1495,
13,
9651,
373,
29918,
1220,
23661,
29896,
13,
13,
1678,
14550,
13,
4706,
1596,
525,
440,
828,
742,
1311,
17255,
440,
828,
29918,
15697,
13,
4706,
1596,
525,
15120,
742,
1311,
17255,
15120,
29918,
15697,
13,
4706,
1596,
525,
13604,
742,
1311,
17255,
13604,
13,
1678,
14550,
13,
13,
1678,
822,
679,
29918,
1853,
29898,
1311,
1125,
13,
4706,
565,
1583,
17255,
1853,
29901,
13,
9651,
736,
1583,
17255,
1853,
13,
13,
1678,
822,
679,
29918,
440,
828,
29918,
12403,
29918,
15697,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
440,
828,
29918,
12403,
29918,
15697,
13,
13,
1678,
822,
679,
29918,
440,
828,
29918,
5464,
29918,
12403,
29918,
15697,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
440,
828,
29918,
5464,
29918,
12403,
29918,
15697,
13,
13,
1678,
822,
679,
29918,
15120,
29918,
15697,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
15120,
29918,
15697,
13,
13,
1678,
822,
679,
29918,
3696,
29918,
15697,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
13604,
13,
13,
1678,
822,
679,
29918,
978,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
978,
13,
13,
1678,
822,
679,
29918,
8216,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
8216,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
2
] |
bot_python/pwm_test.py | WillWagnerIV/gis_bot | 1 | 179294 | <reponame>WillWagnerIV/gis_bot
import time
from adafruit_servokit import ServoKit
# Set channels to the number of servo channels on your kit.
# 8 for FeatherWing, 16 for Shield/HAT/Bonnet.
kit = ServoKit(channels=8)
kit.servo[0].angle = 180
kit.continuous_servo[1].throttle = 1
time.sleep(1)
kit.continuous_servo[1].throttle = -1
time.sleep(1)
kit.servo[0].angle = 0
kit.continuous_servo[1].throttle = 0 | [
1,
529,
276,
1112,
420,
29958,
12984,
29956,
18303,
5667,
29914,
29887,
275,
29918,
7451,
13,
5215,
931,
13,
3166,
594,
2142,
9216,
29918,
2140,
554,
277,
1053,
1816,
1365,
13117,
13,
13,
29937,
3789,
18196,
304,
278,
1353,
310,
724,
1365,
18196,
373,
596,
413,
277,
29889,
13,
29937,
29871,
29947,
363,
5169,
1624,
29956,
292,
29892,
29871,
29896,
29953,
363,
1383,
969,
29914,
29950,
1299,
29914,
29933,
265,
1212,
29889,
13,
7354,
353,
1816,
1365,
13117,
29898,
305,
12629,
29922,
29947,
29897,
13,
13,
7354,
29889,
643,
1365,
29961,
29900,
1822,
2521,
353,
29871,
29896,
29947,
29900,
13,
7354,
29889,
20621,
681,
29918,
643,
1365,
29961,
29896,
1822,
386,
26970,
280,
353,
29871,
29896,
13,
2230,
29889,
17059,
29898,
29896,
29897,
13,
7354,
29889,
20621,
681,
29918,
643,
1365,
29961,
29896,
1822,
386,
26970,
280,
353,
448,
29896,
13,
2230,
29889,
17059,
29898,
29896,
29897,
13,
7354,
29889,
643,
1365,
29961,
29900,
1822,
2521,
353,
29871,
29900,
13,
7354,
29889,
20621,
681,
29918,
643,
1365,
29961,
29896,
1822,
386,
26970,
280,
353,
29871,
29900,
2
] |
Level/__init__.py | PyRectangle/GreyRectangle | 3 | 18786 | from Level.Render import Render
from Level.Data import Data
from Constants import *
import os
class Level:
def __init__(self, folder, main):
self.main = main
self.name = folder
self.folder = LEVEL_PATH + "/" + folder
self.dataFiles = []
files = os.listdir(self.folder)
for file in files:
if file[0:4] == "data":
self.dataFiles.append(file)
self.render = Render(self, main)
self.data = Data(self)
def rename(self, name):
self.name = name
folder = LEVEL_PATH + "/" + name
os.rename(self.folder, folder)
self.folder = folder
self.main.levelSelection.levelGuiHandler.updateText()
def openSection(self, number):
self.close()
self.data = Data(self, number)
def save(self):
self.data.save()
for region in self.data.regions:
if region.loaded:
region.save()
region.save()
def close(self):
self.data.close()
del self.data
| [
1,
515,
21597,
29889,
10716,
1053,
26000,
13,
3166,
21597,
29889,
1469,
1053,
3630,
13,
3166,
5798,
1934,
1053,
334,
13,
5215,
2897,
13,
13,
13,
1990,
21597,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4138,
29892,
1667,
1125,
13,
4706,
1583,
29889,
3396,
353,
1667,
13,
4706,
1583,
29889,
978,
353,
4138,
13,
4706,
1583,
29889,
12083,
353,
11060,
29963,
6670,
29918,
10145,
718,
5591,
29908,
718,
4138,
13,
4706,
1583,
29889,
1272,
10547,
353,
5159,
13,
4706,
2066,
353,
2897,
29889,
1761,
3972,
29898,
1311,
29889,
12083,
29897,
13,
4706,
363,
934,
297,
2066,
29901,
13,
9651,
565,
934,
29961,
29900,
29901,
29946,
29962,
1275,
376,
1272,
1115,
13,
18884,
1583,
29889,
1272,
10547,
29889,
4397,
29898,
1445,
29897,
13,
4706,
1583,
29889,
9482,
353,
26000,
29898,
1311,
29892,
1667,
29897,
13,
4706,
1583,
29889,
1272,
353,
3630,
29898,
1311,
29897,
13,
268,
13,
1678,
822,
19508,
29898,
1311,
29892,
1024,
1125,
13,
4706,
1583,
29889,
978,
353,
1024,
13,
4706,
4138,
353,
11060,
29963,
6670,
29918,
10145,
718,
5591,
29908,
718,
1024,
13,
4706,
2897,
29889,
1267,
420,
29898,
1311,
29889,
12083,
29892,
4138,
29897,
13,
4706,
1583,
29889,
12083,
353,
4138,
13,
4706,
1583,
29889,
3396,
29889,
5563,
15097,
29889,
5563,
28707,
4598,
29889,
5504,
1626,
580,
13,
13,
1678,
822,
1722,
13438,
29898,
1311,
29892,
1353,
1125,
13,
4706,
1583,
29889,
5358,
580,
13,
4706,
1583,
29889,
1272,
353,
3630,
29898,
1311,
29892,
1353,
29897,
13,
268,
13,
1678,
822,
4078,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1272,
29889,
7620,
580,
13,
4706,
363,
5120,
297,
1583,
29889,
1272,
29889,
1727,
1080,
29901,
13,
9651,
565,
5120,
29889,
15638,
29901,
13,
18884,
5120,
29889,
7620,
580,
13,
9651,
5120,
29889,
7620,
580,
13,
13,
1678,
822,
3802,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1272,
29889,
5358,
580,
13,
4706,
628,
1583,
29889,
1272,
13,
2
] |
example/declarative/custom_form.py | wilsaj/flask-admin-old | 2 | 106274 | import sys
from flask import Flask, redirect
from flask.ext import admin
from flask.ext.admin.datastore.sqlalchemy import SQLAlchemyDatastore
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Boolean, Column, Integer, Text, String, Float, Time
from sqlalchemy.orm import synonym
from werkzeug import check_password_hash, generate_password_hash
from wtforms import Form, validators
from wtforms.fields import BooleanField, TextField, PasswordField
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(Integer, primary_key=True)
username = Column(String(80), unique=True)
_password_hash = Column('password', String(80), nullable=False)
is_active = Column(Boolean, default=True)
def __init__(self, username="", password="", is_active=True):
self.username = username
self.password = password
self.is_active = is_active
def check_password(self, password):
return check_password_hash(self.pw_hash, password)
@property
def password(self):
return self._password_hash
@password.setter
def password(self, password):
self._password_hash = generate_password_hash(password)
password = synonym('_password_hash', descriptor=password)
def __repr__(self):
return self.username
__mapper_args__ = {
'order_by': username
}
class UserForm(Form):
"""
Form for creating or editting User object (via the admin). Define
any handling of fields here. This form class also has precedence
when rendering forms to a webpage, so the model-generated fields
will come after it.
"""
username = TextField(u'User name',
[validators.required(), validators.length(max=80)])
password = PasswordField('<PASSWORD>',
[validators.optional(),
validators.equal_to('confirm_password')])
confirm_password = PasswordField()
is_active = BooleanField(default=True)
def create_app(database_uri='sqlite://'):
app = Flask(__name__)
app.config['SECRET_KEY'] = 'not secure'
engine = create_engine(database_uri, convert_unicode=True)
db_session = scoped_session(sessionmaker(
autocommit=False, autoflush=False,
bind=engine))
datastore = SQLAlchemyDatastore(
(User,), db_session, model_forms={'User': UserForm})
admin_blueprint = admin.create_admin_blueprint(
datastore)
app.register_blueprint(admin_blueprint, url_prefix='/admin')
Base.metadata.create_all(bind=engine)
@app.route('/')
def go_to_admin():
return redirect('/admin')
return app
if __name__ == '__main__':
app = create_app('sqlite:///simple.db')
app.run(debug=True)
| [
1,
1053,
10876,
13,
13,
3166,
29784,
1053,
2379,
1278,
29892,
29871,
6684,
13,
3166,
29784,
29889,
1062,
1053,
4113,
13,
3166,
29784,
29889,
1062,
29889,
6406,
29889,
4130,
579,
487,
29889,
2850,
284,
305,
6764,
1053,
3758,
2499,
305,
6764,
16390,
579,
487,
13,
3166,
4576,
284,
305,
6764,
1053,
1653,
29918,
10599,
13,
3166,
4576,
284,
305,
6764,
29889,
555,
1053,
16505,
287,
29918,
7924,
29892,
4867,
28107,
13,
3166,
4576,
284,
305,
6764,
29889,
1062,
29889,
311,
16544,
1230,
1053,
7669,
1230,
29918,
3188,
13,
3166,
4576,
284,
305,
6764,
1053,
11185,
29892,
12481,
29892,
8102,
29892,
3992,
29892,
1714,
29892,
27842,
29892,
5974,
13,
3166,
4576,
284,
305,
6764,
29889,
555,
1053,
5222,
4735,
13,
3166,
23085,
13289,
1053,
1423,
29918,
5630,
29918,
8568,
29892,
5706,
29918,
5630,
29918,
8568,
13,
3166,
281,
29873,
9514,
1053,
3812,
29892,
2854,
4097,
13,
3166,
281,
29873,
9514,
29889,
9621,
1053,
11185,
3073,
29892,
3992,
3073,
29892,
25280,
3073,
13,
13,
13,
5160,
353,
7669,
1230,
29918,
3188,
580,
13,
13,
13,
1990,
4911,
29898,
5160,
1125,
13,
1678,
4770,
3891,
2435,
420,
1649,
353,
525,
1792,
29915,
13,
13,
1678,
1178,
353,
12481,
29898,
7798,
29892,
7601,
29918,
1989,
29922,
5574,
29897,
13,
1678,
8952,
353,
12481,
29898,
1231,
29898,
29947,
29900,
511,
5412,
29922,
5574,
29897,
13,
1678,
903,
5630,
29918,
8568,
353,
12481,
877,
5630,
742,
1714,
29898,
29947,
29900,
511,
1870,
519,
29922,
8824,
29897,
13,
1678,
338,
29918,
4925,
353,
12481,
29898,
18146,
29892,
2322,
29922,
5574,
29897,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
8952,
543,
613,
4800,
543,
613,
338,
29918,
4925,
29922,
5574,
1125,
13,
4706,
1583,
29889,
6786,
353,
8952,
13,
4706,
1583,
29889,
5630,
353,
4800,
13,
4706,
1583,
29889,
275,
29918,
4925,
353,
338,
29918,
4925,
13,
13,
1678,
822,
1423,
29918,
5630,
29898,
1311,
29892,
4800,
1125,
13,
4706,
736,
1423,
29918,
5630,
29918,
8568,
29898,
1311,
29889,
29886,
29893,
29918,
8568,
29892,
4800,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
4800,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
5630,
29918,
8568,
13,
13,
1678,
732,
5630,
29889,
842,
357,
13,
1678,
822,
4800,
29898,
1311,
29892,
4800,
1125,
13,
4706,
1583,
3032,
5630,
29918,
8568,
353,
5706,
29918,
5630,
29918,
8568,
29898,
5630,
29897,
13,
13,
1678,
4800,
353,
5222,
4735,
877,
29918,
5630,
29918,
8568,
742,
553,
11709,
29922,
5630,
29897,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
6786,
13,
13,
1678,
4770,
655,
2496,
29918,
5085,
1649,
353,
426,
13,
4706,
525,
2098,
29918,
1609,
2396,
8952,
13,
4706,
500,
13,
13,
13,
1990,
4911,
2500,
29898,
2500,
1125,
13,
1678,
9995,
13,
1678,
3812,
363,
4969,
470,
1226,
5367,
4911,
1203,
313,
6071,
278,
4113,
467,
22402,
13,
1678,
738,
11415,
310,
4235,
1244,
29889,
910,
883,
770,
884,
756,
9399,
663,
13,
1678,
746,
15061,
7190,
304,
263,
24499,
29892,
577,
278,
1904,
29899,
13525,
4235,
13,
1678,
674,
2041,
1156,
372,
29889,
13,
1678,
9995,
13,
1678,
8952,
353,
3992,
3073,
29898,
29884,
29915,
2659,
1024,
742,
13,
462,
308,
518,
3084,
4097,
29889,
12403,
3285,
2854,
4097,
29889,
2848,
29898,
3317,
29922,
29947,
29900,
29897,
2314,
13,
1678,
4800,
353,
25280,
3073,
877,
29966,
25711,
17013,
29958,
742,
13,
462,
632,
518,
3084,
4097,
29889,
25253,
3285,
13,
462,
795,
2854,
4097,
29889,
11745,
29918,
517,
877,
26897,
29918,
5630,
1495,
2314,
13,
1678,
9659,
29918,
5630,
353,
25280,
3073,
580,
13,
1678,
338,
29918,
4925,
353,
11185,
3073,
29898,
4381,
29922,
5574,
29897,
13,
13,
13,
1753,
1653,
29918,
932,
29898,
9803,
29918,
5338,
2433,
22793,
597,
29374,
13,
1678,
623,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
1678,
623,
29889,
2917,
1839,
1660,
22245,
29911,
29918,
10818,
2033,
353,
525,
1333,
11592,
29915,
13,
1678,
6012,
353,
1653,
29918,
10599,
29898,
9803,
29918,
5338,
29892,
3588,
29918,
2523,
356,
29922,
5574,
29897,
13,
1678,
4833,
29918,
7924,
353,
16505,
287,
29918,
7924,
29898,
7924,
28107,
29898,
13,
4706,
4469,
15060,
29922,
8824,
29892,
1120,
974,
29880,
1878,
29922,
8824,
29892,
13,
4706,
7868,
29922,
10599,
876,
13,
1678,
1418,
579,
487,
353,
3758,
2499,
305,
6764,
16390,
579,
487,
29898,
13,
4706,
313,
2659,
29892,
511,
4833,
29918,
7924,
29892,
1904,
29918,
9514,
3790,
29915,
2659,
2396,
4911,
2500,
1800,
13,
1678,
4113,
29918,
9539,
2158,
353,
4113,
29889,
3258,
29918,
6406,
29918,
9539,
2158,
29898,
13,
4706,
1418,
579,
487,
29897,
13,
1678,
623,
29889,
9573,
29918,
9539,
2158,
29898,
6406,
29918,
9539,
2158,
29892,
3142,
29918,
13506,
2433,
29914,
6406,
1495,
13,
1678,
7399,
29889,
19635,
29889,
3258,
29918,
497,
29898,
5355,
29922,
10599,
29897,
13,
13,
1678,
732,
932,
29889,
13134,
11219,
1495,
13,
1678,
822,
748,
29918,
517,
29918,
6406,
7295,
13,
4706,
736,
6684,
11219,
6406,
1495,
13,
13,
1678,
736,
623,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
623,
353,
1653,
29918,
932,
877,
22793,
597,
29914,
12857,
29889,
2585,
1495,
13,
1678,
623,
29889,
3389,
29898,
8382,
29922,
5574,
29897,
13,
2
] |
src/ml_analysis.py | UBC-MDS/DMC_Portuguese | 0 | 144125 | <gh_stars>0
# author: <NAME>
# date: 2020-01-24
'''This script does ML analysis by training multiple models, doing hyperparameter
tuning and reporting the results in a csv file.
Usage:
ml_analysis.py --train_csv=<train_csv> --test_csv=<test_csv> --output_csv=<output_csv> --output_png=<output_png>
ml_analysis.py --test_csv=<test_csv> --output_csv=<output_csv>
ml_analysis.py --train_csv=<train_csv> --output_csv=<output_csv>
ml_analysis.py --train_csv=<train_csv> --test_csv=<test_csv>
ml_analysis.py --train_csv=<train_csv>
ml_analysis.py --test_csv=<test_csv>
ml_analysis.py --output_csv=<output_csv>
ml_analysis.py
Options:
--train_csv=<train_csv> csv path for training [Default: ./data/clean/bank_train.csv].
--test_csv=<test_csv> csv path for testing [Default: ./data/clean/bank_test.csv].
--output_csv=<output_csv> csv path for outputting the result of training and hyperparameter tuning.
[Default: ./reports/training_report.csv]
--output_png=<output_png> png path for outputting the result of figure containing all trainings
[Default: ./reports/training_report.png]
'''
import pandas as pd
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix, f1_score
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import train_test_split
from tqdm import tqdm
import lightgbm as lgb
from docopt import docopt
from itertools import accumulate
import os
import altair as alt
import selenium
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
os.environ["PYTHONWARNINGS"] = "ignore::UserWarning"
np.random.RandomState(42)
np.random.seed(2020)
def check_filepath(save_dir):
"""
Checks if all subfolders of save_dir exist or not. If not, creates
Parameters
----------
save_dir: str containing the path where the files hould be saved
Returns:
None
Usage
-----
check_filepath('./unknown_dir')
"""
for subdir in accumulate(save_dir.split('/'), lambda x, y: os.path.join(x, y)):
if not os.path.exists(subdir):
os.mkdir(subdir)
print(f"Directory {subdir} Created ")
def train_lgb(X_train, y_train, X_test, y_test, epochs = 1000, early_stopping = 100):
"""
Function that handles the training process of Lightgbm.
Parameters
----------
X_train: 2D numpy.ndarray containing predictors for training
y_train: 1D numpy.ndarray containing response for training
X_test: 2D numpy.ndarray containing predictors for testing
y_test: 1D numpy.ndarray containing response for testing
epochs: positive integer specifying number of weak learners in the model
Default: 1000
early_stopping: represents number of epochs that is required to pass without
model improvement to stop the training earlier. Default: 100
Returns
-------
tuple: (model, parameters, Train F1 score, Test F1 score, Test accuracy, confusion_matrix)
Examples
--------
>>>train_lgb(X_train, y_train, X_test, y_test)
(<lightgbm.basic.Booster at 0x7fd9f06b3470>,
{'learning_rate': 0.01, 'lambda_l2': 0.5},
0.6242424242424243,
0.3972602739726027,
0.9027624309392265)
"""
# Defining custom f1 score for LightGBM model
def lgb_f1_score(y_hat, data):
y_true = data.get_label()
y_hat = np.round(y_hat) # scikits f1 doesn't like probabilities
return 'f1', f1_score(y_true, y_hat), True
# Defining validation set
X_train, X_valid, y_train, y_valid = train_test_split(X_train, y_train, test_size=0.2)
# Creating dataset objects for LightGBM
lgb_train = lgb.Dataset(X_train, label=y_train)
lgb_valid = lgb.Dataset(X_valid, label=y_valid)
# For all possible parameters see https://lightgbm.readthedocs.io/en/latest/Parameters.html
params = {
"learning_rate" : 0.1,
"lambda_l1": 0.5,
"max_depth": 64,
"num_leaves": 32,
"bagging_fraction" : 0.9,
"bagging_freq": 3,
"bagging_seed": 42,
"seed": 42
}
# Training model
model = lgb.train(params,
lgb_train,
valid_sets=[lgb_train, lgb_valid],
feval = lgb_f1_score,
num_boost_round=epochs,
early_stopping_rounds=early_stopping,
verbose_eval=False)
# Getting train F1 score
lgb_train_preds = np.round(model.predict(X_train))
train_f1 = f1_score(y_train, lgb_train_preds)
# Getting test F1 score
lgb_test_preds = np.round(model.predict(X_test))
test_f1 = f1_score(y_test, lgb_test_preds)
# Getting test accuracy
test_acc = sum(lgb_test_preds == y_test)/len(y_test)
# Getting confusion matrix
cm = confusion_matrix(y_test, lgb_test_preds)
# Returning whatever is important
return model, params, train_f1, test_f1, test_acc, [train_f1], [test_f1], cm
def hyperparameter_tuning_and_report(classifier, parameters, X, y, X_test=None, y_test=None, scoring='f1'):
"""
Tunes hyperparameters of given model from the list of parameters.
Uses GridSearchCV to find best hyperparameter. Optionally can
calculate F1 score and accuracy of test set. Scoring function
can be changed that GridSearchCV is using. Default scoring function
is F1.
Parameters
----------
X: 2D numpy.ndarray containing predictors for training
y: 1D numpy.ndarray containing response for training
X_test: 2D numpy.ndarray containing predictors for testing. If None, test
scores will not be computed. Default: None
y_test: 1D numpy.ndarray containing response for testing. If None, test
scores will not be computed. Default: None
scoring: Scoring function used in GridSearchCV. Default is 'f1'. For all
possibilities, please check documentation of GridSearchCV.
Returns
-------
tuple: (best model, best parameters, Train F1 score, Test F1 score, Test accuracy, Mean Train scores, Mean Test scores, confusion_matrices)
Examples
--------
>>>hyperparameter_tuning_and_report(LogisticRegression(),
{'penalty': ['l1', 'l2'], 'C': [0.1, 1, 10]},
X_train, y_train, X_test, y_test)
(LogisticRegression(C=10, class_weight=None, dual=False, fit_intercept=True,
intercept_scaling=1, l1_ratio=None, max_iter=100,
multi_class='auto', n_jobs=None, penalty='l2',
random_state=None, solver='lbfgs', tol=0.0001, verbose=0,
warm_start=False),
{'C': 10, 'penalty': 'l2'},
0.43209194041441296,
0.3776223776223776,
0.901657458563536,
array([ nan, 0.37217253, nan, 0.44838868, nan,
0.45292401]),
array([ nan, 0.34413357, nan, 0.42585911, nan,
0.43209194]))
"""
# Find the best model
try:
grid_search = GridSearchCV(classifier, parameters, n_jobs=-1, scoring=scoring, return_train_score=True)
grid_search.fit(X, y)
except ValueError:
pass
test_f1 = None
test_accuracy = None
y_train_pred = grid_search.predict(X)
train_report = classification_report(y, y_train_pred, output_dict=True)
# Test best model on test set and produce classification report
if X_test is not None and y_test is not None:
y_test_pred = grid_search.predict(X_test)
report = classification_report(y_test, y_test_pred, output_dict=True)
test_f1 = report['1.0']['f1-score'],
test_accuracy = report['accuracy'],
cm = confusion_matrix(y_test, y_test_pred)
# Return whatever is important
return (grid_search.best_estimator_,
grid_search.best_params_,
train_report['1.0']['f1-score'],
test_f1,
test_accuracy,
grid_search.cv_results_['mean_train_score'],
grid_search.cv_results_['mean_test_score'],
cm)
def save_confusion_matrix(model_names, cms, save_path):
"""
Creates and saves confusion matrix figures containing all models
mentioned in the input arrays.
Parameters
----------
model_names: array containing names of the models tested
csm: confusion matrices the models trained
save_path: str showing the filepath, where the figure should be saved
Returns
-------
None
"""
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(16, 10))
(ax1, ax2), (ax3, ax4) = axes
cols = ListedColormap([[1, 1, 1], [1, 1, 1], [1, 1, 1], [1, 1, 1]])
im1 = ax1.matshow(cms[0], cmap=cols)
im2 = ax2.matshow(cms[1], cmap=cols)
im3 = ax3.matshow(cms[2], cmap=cols)
im4 = ax4.matshow(cms[3], cmap=cols)
ax = (ax1, ax2, ax3, ax4)
for i, model_name in enumerate(model_names):
for y in range(cms[i].shape[0]):
for x in range(cms[i].shape[1]):
ax[i].text(x, y, f'{cms[i][y, x]}',
horizontalalignment='center',
verticalalignment='center',
fontdict = {'size': 16, 'weight': 'bold'}
)
ax[i].set_xticklabels(['', 'Predicted 0', 'Predicted 1'])
ax[i].set_yticklabels(['', 'Actual 0', 'Actual 1'])
ax[i].title.set_text(f'Confusion matrix of {model_name}')
# for y in range(a.shape[0]):
# for x in range(a.shape[1]):
# ax2.text(x, y, '%.4f' % a[y, x],
# horizontalalignment='center',
# verticalalignment='center',
# )
#
# for y in range(a.shape[0]):
# for x in range(a.shape[1]):
# ax3.text(x, y, '%.4f' % a[y, x],
# horizontalalignment='center',
# verticalalignment='center',
# )
# for y in range(a.shape[0]):
# for x in range(a.shape[1]):
# ax4.text(x, y, '%.4f' % a[y, x],
# horizontalalignment='center',
# verticalalignment='center',
# )
# model_name = 'aa'
#
# ax1.title.set_text(f'confusion matrix of {model_name}')
# ax2.title.set_text(f'confusion matrix of {model_name}')
# ax3.title.set_text(f'confusion matrix of {model_name}')
# ax4.title.set_text(f'confusion matrix of {model_name}')
check_filepath(save_path.rsplit('/', 1)[0])
fig.savefig(save_path)
def generate_csv_and_figure_reports(arr, csv_filepath, figure_filepath):
"""
Generates csv report from the results obtained from hyperparameter tuning.
Given the array of results of hyperparameter_tuning_and_report for different
models, generates csv file and saves in the given path.
Parameters
----------
arr: 1D array containing a tuple returned from hyperparameter_tuning_and_report or
train_lgb() function.
csv_filepath: str containing path where the report should be saved.
figure_filepath: str containing path where the figure report should be saved. Should have extension .png
Returns
-------
None
Notes:
Please be sure that arr is array of tuples.
"""
names = []
best_params = []
train_f1s = []
test_f1s = []
test_accuracies = []
train_score_results = []
test_score_results = []
score_res_names = []
cms = []
# Gathering names of the models and other information
for model in tqdm(arr):
names.append(model[0].__class__.__name__)
best_params.append(model[1])
train_f1s.append(model[2])
test_f1s.append(model[3])
test_accuracies.append(model[4])
cms.append(model[7].astype(int))
if model[0].__class__.__name__ != 'Booster':
train_score_results.extend(model[5])
test_score_results.extend(model[6])
score_res_names.extend([model[0].__class__.__name__]*len(model[5]))
# Creating dataframe from the results
csv_report = pd.DataFrame({'Model name': names,
'Best parameters': best_params,
'Train F1': train_f1s,
'Test F1': test_f1s,
'Test accuracies': test_accuracies,
'Confusion matrix': cms})
# Creating dataframe from the results for figure generation
figure_report = pd.DataFrame({'models': score_res_names,
'train_scores': train_score_results,
'test_scores': test_score_results})
# Check for existance of a filepath
check_filepath(csv_filepath.rsplit('/', 1)[0])
check_filepath(figure_filepath.rsplit('/', 1)[0])
# Saving the report
csv_report.to_csv(csv_filepath)
# Saving figure
alt.Chart(figure_report).mark_circle(size=100).encode(
x = alt.X('test_scores',
axis = alt.Axis(title='Cross-Val Test F1 score'),
scale = alt.Scale(domain = (0., 1.))),
y = alt.Y('train_scores',
axis = alt.Axis(title='Cross-Val Train F1 score'),
scale = alt.Scale(domain=(0., 1.))),
color = 'models').properties(
title = 'Train and Test scores of all methods tested').\
configure_axis(
labelFontSize=15,
titleFontSize=15
).\
configure_legend(labelFontSize = 15,
titleFontSize=15).\
configure_title(fontSize=20).\
save(figure_filepath)
# Saving confusion matrix
save_confusion_matrix(names, cms, './reports/confusion_matrix.png')
def read_data_and_split(train_csv_path = '../data/clean/bank_train.csv',
test_csv_path = '../data/clean/bank_test.csv'):
"""
Reads the data from the given paths and returns predictors and response
variables separately for train and test sets
Parameters
----------
train_csv_path: str containing the path of train csv. Default: '../data/clean/bank_train.csv'
test_csv_path: str containing the path of test csv. Default: '../data/clean/bank_test.csv'
Returns
-------
tuple: (X_train, y_train, X_test, y_test)
"""
try:
train_ds = pd.read_csv(train_csv_path)
test_ds = pd.read_csv(test_csv_path)
except (FileNotFoundError) as e:
print('Please check train and test filepaths')
raise(e)
try:
X_train, y_train = train_ds.drop('y_yes', axis=1), train_ds['y_yes']
X_test, y_test = test_ds.drop('y_yes', axis=1), test_ds['y_yes']
except KeyError:
print('Corrupted csv files. Please check the columns')
raise KeyError
return X_train, y_train, X_test, y_test
def main(train_csv, test_csv, output_csv, output_png):
try:
X_train, y_train, X_test, y_test = read_data_and_split(train_csv, test_csv)
except:
return
# Define models that should be passed to hyperparameter tuning
models = [LogisticRegression(class_weight = 'balanced', random_state=42),
SVC(class_weight = 'balanced', random_state=42),
RandomForestClassifier(class_weight = 'balanced', random_state=42)
]
# Define parameters that should be tested for each of the models.
# Note: Be sure that indices of models and its parameters correspond.
# Note2: Each model should have some valid dictionalry associated with it.
parameters = [
[{'solver': ['saga', 'liblinear'], 'penalty': ['l1', 'l2'], 'C': [0.01, 0.1, 1, 10]},
{'solver': ['lbfgs', 'newton-cg', 'sag'], 'penalty': ['l2'], 'C': [0.01, 0.1, 1, 10]}],
[{'C': [0.01, 0.1, 1, 10], 'kernel': ['rbf']},
{'C': [0.01, 0.1, 1, 10], 'kernel': ['poly'], 'degree': [2, 3, 4]}],
{'n_estimators': [25, 50, 75], 'max_depth': [None, 16, 32], 'criterion': ['gini', 'entropy']}
]
if len(models) != len(parameters):
print('Check models and corresponding parameters. Each model should have a dictionary of parameters to test.')
return
# Performing hyperparameter tuning and getting reports of each of the models
# defined above
all_results = []
for model_id, model in enumerate(tqdm(models)):
model_params = parameters[model_id]
res = hyperparameter_tuning_and_report(model, model_params, X_train, y_train, X_test, y_test)
all_results.append(res)
# Training LightGBM model and appending results to other results
lgb_model_res = train_lgb(X_train, y_train, X_test, y_test)
all_results.append(lgb_model_res)
# Generating and saving model results
generate_csv_and_figure_reports(all_results, output_csv, output_png)
if __name__ == '__main__':
opt = docopt(__doc__)
main(opt["--train_csv"], opt["--test_csv"], opt["--output_csv"], opt["--output_png"])
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
4148,
29901,
529,
5813,
29958,
13,
29937,
2635,
29901,
29871,
29906,
29900,
29906,
29900,
29899,
29900,
29896,
29899,
29906,
29946,
13,
13,
12008,
4013,
2471,
947,
23158,
7418,
491,
6694,
2999,
4733,
29892,
2599,
11266,
15501,
13,
29873,
27964,
322,
23415,
278,
2582,
297,
263,
11799,
934,
29889,
13,
13,
27573,
29901,
29871,
13,
1678,
286,
29880,
29918,
15916,
29889,
2272,
1192,
14968,
29918,
7638,
29922,
29966,
14968,
29918,
7638,
29958,
1192,
1688,
29918,
7638,
29922,
29966,
1688,
29918,
7638,
29958,
1192,
4905,
29918,
7638,
29922,
29966,
4905,
29918,
7638,
29958,
1192,
4905,
29918,
2732,
29922,
29966,
4905,
29918,
2732,
29958,
13,
1678,
286,
29880,
29918,
15916,
29889,
2272,
1192,
1688,
29918,
7638,
29922,
29966,
1688,
29918,
7638,
29958,
1192,
4905,
29918,
7638,
29922,
29966,
4905,
29918,
7638,
29958,
13,
1678,
286,
29880,
29918,
15916,
29889,
2272,
1192,
14968,
29918,
7638,
29922,
29966,
14968,
29918,
7638,
29958,
1192,
4905,
29918,
7638,
29922,
29966,
4905,
29918,
7638,
29958,
13,
1678,
286,
29880,
29918,
15916,
29889,
2272,
1192,
14968,
29918,
7638,
29922,
29966,
14968,
29918,
7638,
29958,
1192,
1688,
29918,
7638,
29922,
29966,
1688,
29918,
7638,
29958,
13,
1678,
286,
29880,
29918,
15916,
29889,
2272,
1192,
14968,
29918,
7638,
29922,
29966,
14968,
29918,
7638,
29958,
13,
1678,
286,
29880,
29918,
15916,
29889,
2272,
1192,
1688,
29918,
7638,
29922,
29966,
1688,
29918,
7638,
29958,
13,
1678,
286,
29880,
29918,
15916,
29889,
2272,
1192,
4905,
29918,
7638,
29922,
29966,
4905,
29918,
7638,
29958,
13,
1678,
286,
29880,
29918,
15916,
29889,
2272,
13,
13,
5856,
29901,
13,
489,
14968,
29918,
7638,
29922,
29966,
14968,
29918,
7638,
29958,
308,
11799,
2224,
363,
6694,
518,
4592,
29901,
11431,
1272,
29914,
14941,
29914,
9157,
29918,
14968,
29889,
7638,
1822,
13,
489,
1688,
29918,
7638,
29922,
29966,
1688,
29918,
7638,
29958,
965,
11799,
2224,
363,
6724,
518,
4592,
29901,
11431,
1272,
29914,
14941,
29914,
9157,
29918,
1688,
29889,
7638,
1822,
13,
489,
4905,
29918,
7638,
29922,
29966,
4905,
29918,
7638,
29958,
539,
11799,
2224,
363,
1962,
1259,
278,
1121,
310,
6694,
322,
11266,
15501,
18515,
292,
29889,
13,
462,
18884,
518,
4592,
29901,
11431,
276,
4011,
29914,
26495,
29918,
12276,
29889,
7638,
29962,
13,
489,
4905,
29918,
2732,
29922,
29966,
4905,
29918,
2732,
29958,
539,
282,
865,
2224,
363,
1962,
1259,
278,
1121,
310,
4377,
6943,
599,
7945,
886,
13,
462,
18884,
518,
4592,
29901,
11431,
276,
4011,
29914,
26495,
29918,
12276,
29889,
2732,
29962,
13,
12008,
13,
13,
5215,
11701,
408,
10518,
13,
5215,
12655,
408,
7442,
13,
3166,
2071,
19668,
29889,
10660,
29918,
4299,
1053,
4522,
4695,
4597,
23881,
13,
3166,
2071,
19668,
29889,
4501,
29885,
1053,
317,
8257,
13,
3166,
2071,
19668,
29889,
24031,
1053,
16968,
2831,
342,
2385,
3709,
13,
3166,
2071,
19668,
29889,
2527,
10817,
1053,
12965,
29918,
12276,
13,
3166,
2071,
19668,
29889,
2527,
10817,
1053,
14679,
29918,
5344,
29892,
285,
29896,
29918,
13628,
13,
3166,
2071,
19668,
29889,
4299,
29918,
21731,
1053,
11657,
7974,
15633,
13,
3166,
2071,
19668,
29889,
4299,
29918,
21731,
1053,
7945,
29918,
1688,
29918,
5451,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
5215,
3578,
29887,
5838,
408,
301,
26300,
13,
3166,
437,
1111,
415,
1053,
437,
1111,
415,
13,
3166,
4256,
8504,
1053,
18414,
5987,
13,
5215,
2897,
13,
5215,
21352,
381,
408,
5272,
13,
5215,
18866,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
3166,
22889,
29889,
27703,
1053,
2391,
287,
1625,
555,
481,
13,
13,
359,
29889,
21813,
3366,
20055,
4690,
1164,
29956,
25614,
29903,
3108,
353,
376,
17281,
1057,
2659,
22709,
29908,
13,
9302,
29889,
8172,
29889,
17875,
2792,
29898,
29946,
29906,
29897,
13,
9302,
29889,
8172,
29889,
26776,
29898,
29906,
29900,
29906,
29900,
29897,
13,
13,
1753,
1423,
29918,
1445,
2084,
29898,
7620,
29918,
3972,
1125,
13,
1678,
9995,
13,
1678,
5399,
29879,
565,
599,
1014,
8771,
414,
310,
4078,
29918,
3972,
1863,
470,
451,
29889,
960,
451,
29892,
10017,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
4078,
29918,
3972,
29901,
851,
6943,
278,
2224,
988,
278,
2066,
298,
483,
367,
7160,
13,
13,
1678,
16969,
29901,
13,
1678,
6213,
13,
13,
1678,
10783,
482,
13,
1678,
448,
807,
13,
1678,
1423,
29918,
1445,
2084,
877,
6904,
26690,
29918,
3972,
1495,
13,
1678,
9995,
13,
1678,
363,
1014,
3972,
297,
18414,
5987,
29898,
7620,
29918,
3972,
29889,
5451,
11219,
5477,
14013,
921,
29892,
343,
29901,
2897,
29889,
2084,
29889,
7122,
29898,
29916,
29892,
343,
22164,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
1491,
3972,
1125,
13,
9651,
2897,
29889,
11256,
3972,
29898,
1491,
3972,
29897,
13,
9651,
1596,
29898,
29888,
29908,
9882,
426,
1491,
3972,
29913,
6760,
630,
16521,
13,
13,
13,
1753,
7945,
29918,
19920,
29890,
29898,
29990,
29918,
14968,
29892,
343,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
1688,
29892,
21502,
12168,
353,
29871,
29896,
29900,
29900,
29900,
29892,
4688,
29918,
7864,
3262,
353,
29871,
29896,
29900,
29900,
1125,
13,
1678,
9995,
13,
1678,
6680,
393,
17766,
278,
6694,
1889,
310,
12790,
29887,
5838,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
1060,
29918,
14968,
29901,
29871,
29906,
29928,
12655,
29889,
299,
2378,
6943,
8500,
943,
363,
6694,
13,
1678,
343,
29918,
14968,
29901,
29871,
29896,
29928,
12655,
29889,
299,
2378,
6943,
2933,
363,
6694,
13,
1678,
1060,
29918,
1688,
29901,
29871,
29906,
29928,
12655,
29889,
299,
2378,
6943,
8500,
943,
363,
6724,
13,
1678,
343,
29918,
1688,
29901,
29871,
29896,
29928,
12655,
29889,
299,
2378,
6943,
2933,
363,
6724,
13,
1678,
21502,
12168,
29901,
6374,
6043,
22146,
1353,
310,
8062,
5110,
414,
297,
278,
1904,
13,
9651,
13109,
29901,
29871,
29896,
29900,
29900,
29900,
13,
1678,
4688,
29918,
7864,
3262,
29901,
11524,
1353,
310,
21502,
12168,
393,
338,
3734,
304,
1209,
1728,
13,
18884,
1904,
20414,
304,
5040,
278,
6694,
8859,
29889,
13109,
29901,
29871,
29896,
29900,
29900,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
18761,
29901,
313,
4299,
29892,
4128,
29892,
28186,
383,
29896,
8158,
29892,
4321,
383,
29896,
8158,
29892,
4321,
13600,
29892,
14679,
29918,
5344,
29897,
13,
308,
13,
1678,
1222,
9422,
13,
1678,
448,
26589,
13,
1678,
8653,
14968,
29918,
19920,
29890,
29898,
29990,
29918,
14968,
29892,
343,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
1688,
29897,
29871,
13,
1678,
313,
29966,
4366,
29887,
5838,
29889,
16121,
29889,
8431,
15664,
472,
29871,
29900,
29916,
29955,
11512,
29929,
29888,
29900,
29953,
29890,
29941,
29946,
29955,
29900,
10202,
13,
268,
11117,
21891,
29918,
10492,
2396,
29871,
29900,
29889,
29900,
29896,
29892,
525,
2892,
29918,
29880,
29906,
2396,
29871,
29900,
29889,
29945,
1118,
13,
418,
29900,
29889,
29953,
29906,
29946,
29906,
29946,
29906,
29946,
29906,
29946,
29906,
29946,
29906,
29946,
29906,
29946,
29941,
29892,
13,
418,
29900,
29889,
29941,
29929,
29955,
29906,
29953,
29900,
29906,
29955,
29941,
29929,
29955,
29906,
29953,
29900,
29906,
29955,
29892,
13,
418,
29900,
29889,
29929,
29900,
29906,
29955,
29953,
29906,
29946,
29941,
29900,
29929,
29941,
29929,
29906,
29906,
29953,
29945,
29897,
13,
1678,
9995,
13,
1678,
396,
5282,
2827,
2888,
285,
29896,
8158,
363,
12790,
7210,
29924,
1904,
13,
1678,
822,
301,
26300,
29918,
29888,
29896,
29918,
13628,
29898,
29891,
29918,
2455,
29892,
848,
1125,
13,
4706,
343,
29918,
3009,
353,
848,
29889,
657,
29918,
1643,
580,
13,
4706,
343,
29918,
2455,
353,
7442,
29889,
14486,
29898,
29891,
29918,
2455,
29897,
396,
4560,
29895,
1169,
285,
29896,
1838,
29915,
29873,
763,
2070,
11614,
13,
4706,
736,
525,
29888,
29896,
742,
285,
29896,
29918,
13628,
29898,
29891,
29918,
3009,
29892,
343,
29918,
2455,
511,
5852,
13,
13,
1678,
396,
5282,
2827,
8845,
731,
13,
1678,
1060,
29918,
14968,
29892,
1060,
29918,
3084,
29892,
343,
29918,
14968,
29892,
343,
29918,
3084,
353,
7945,
29918,
1688,
29918,
5451,
29898,
29990,
29918,
14968,
29892,
343,
29918,
14968,
29892,
1243,
29918,
2311,
29922,
29900,
29889,
29906,
29897,
13,
13,
1678,
396,
26221,
8783,
3618,
363,
12790,
7210,
29924,
13,
1678,
301,
26300,
29918,
14968,
353,
301,
26300,
29889,
16390,
24541,
29898,
29990,
29918,
14968,
29892,
3858,
29922,
29891,
29918,
14968,
29897,
13,
1678,
301,
26300,
29918,
3084,
353,
301,
26300,
29889,
16390,
24541,
29898,
29990,
29918,
3084,
29892,
3858,
29922,
29891,
29918,
3084,
29897,
13,
13,
1678,
396,
1152,
599,
1950,
4128,
1074,
2045,
597,
4366,
29887,
5838,
29889,
949,
386,
287,
12332,
29889,
601,
29914,
264,
29914,
12333,
29914,
11507,
29889,
1420,
13,
1678,
8636,
353,
426,
13,
4706,
376,
21891,
29918,
10492,
29908,
584,
29871,
29900,
29889,
29896,
29892,
13,
4706,
376,
2892,
29918,
29880,
29896,
1115,
29871,
29900,
29889,
29945,
29892,
13,
4706,
376,
3317,
29918,
19488,
1115,
29871,
29953,
29946,
29892,
13,
4706,
376,
1949,
29918,
280,
5989,
1115,
29871,
29941,
29906,
29892,
13,
4706,
376,
23156,
3460,
29918,
29888,
13857,
29908,
584,
29871,
29900,
29889,
29929,
29892,
13,
4706,
376,
23156,
3460,
29918,
29888,
7971,
1115,
29871,
29941,
29892,
13,
4706,
376,
23156,
3460,
29918,
26776,
1115,
29871,
29946,
29906,
29892,
13,
4706,
376,
26776,
1115,
29871,
29946,
29906,
13,
1678,
500,
13,
13,
1678,
396,
26101,
1904,
13,
1678,
1904,
353,
301,
26300,
29889,
14968,
29898,
7529,
29892,
13,
462,
539,
301,
26300,
29918,
14968,
29892,
13,
462,
539,
2854,
29918,
7224,
11759,
19920,
29890,
29918,
14968,
29892,
301,
26300,
29918,
3084,
1402,
13,
462,
539,
1238,
791,
353,
301,
26300,
29918,
29888,
29896,
29918,
13628,
29892,
13,
462,
539,
954,
29918,
17079,
29918,
14486,
29922,
1022,
2878,
29879,
29892,
13,
462,
539,
4688,
29918,
7864,
3262,
29918,
29878,
3885,
29922,
799,
368,
29918,
7864,
3262,
29892,
13,
462,
539,
26952,
29918,
14513,
29922,
8824,
29897,
13,
13,
1678,
396,
24162,
7945,
383,
29896,
8158,
13,
1678,
301,
26300,
29918,
14968,
29918,
11965,
29879,
353,
7442,
29889,
14486,
29898,
4299,
29889,
27711,
29898,
29990,
29918,
14968,
876,
13,
1678,
7945,
29918,
29888,
29896,
353,
285,
29896,
29918,
13628,
29898,
29891,
29918,
14968,
29892,
301,
26300,
29918,
14968,
29918,
11965,
29879,
29897,
13,
13,
1678,
396,
24162,
1243,
383,
29896,
8158,
13,
1678,
301,
26300,
29918,
1688,
29918,
11965,
29879,
353,
7442,
29889,
14486,
29898,
4299,
29889,
27711,
29898,
29990,
29918,
1688,
876,
13,
1678,
1243,
29918,
29888,
29896,
353,
285,
29896,
29918,
13628,
29898,
29891,
29918,
1688,
29892,
301,
26300,
29918,
1688,
29918,
11965,
29879,
29897,
13,
268,
13,
1678,
396,
24162,
1243,
13600,
13,
1678,
1243,
29918,
5753,
353,
2533,
29898,
19920,
29890,
29918,
1688,
29918,
11965,
29879,
1275,
343,
29918,
1688,
6802,
2435,
29898,
29891,
29918,
1688,
29897,
13,
13,
1678,
396,
24162,
14679,
4636,
13,
1678,
7477,
353,
14679,
29918,
5344,
29898,
29891,
29918,
1688,
29892,
301,
26300,
29918,
1688,
29918,
11965,
29879,
29897,
13,
13,
1678,
396,
7106,
292,
6514,
338,
4100,
13,
1678,
736,
1904,
29892,
8636,
29892,
7945,
29918,
29888,
29896,
29892,
1243,
29918,
29888,
29896,
29892,
1243,
29918,
5753,
29892,
518,
14968,
29918,
29888,
29896,
1402,
518,
1688,
29918,
29888,
29896,
1402,
7477,
13,
13,
13,
1753,
11266,
15501,
29918,
29873,
27964,
29918,
392,
29918,
12276,
29898,
1990,
3709,
29892,
4128,
29892,
1060,
29892,
343,
29892,
1060,
29918,
1688,
29922,
8516,
29892,
343,
29918,
1688,
29922,
8516,
29892,
26654,
2433,
29888,
29896,
29374,
13,
1678,
9995,
13,
1678,
323,
7844,
11266,
16744,
310,
2183,
1904,
515,
278,
1051,
310,
4128,
29889,
13,
268,
13,
1678,
10783,
267,
11657,
7974,
15633,
304,
1284,
1900,
11266,
15501,
29889,
10831,
635,
508,
13,
1678,
8147,
383,
29896,
8158,
322,
13600,
310,
1243,
731,
29889,
2522,
8253,
740,
13,
1678,
508,
367,
3939,
393,
11657,
7974,
15633,
338,
773,
29889,
13109,
26654,
740,
13,
1678,
338,
383,
29896,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
1060,
29901,
29871,
29906,
29928,
12655,
29889,
299,
2378,
6943,
8500,
943,
363,
6694,
13,
1678,
343,
29901,
29871,
29896,
29928,
12655,
29889,
299,
2378,
6943,
2933,
363,
6694,
13,
1678,
1060,
29918,
1688,
29901,
29871,
29906,
29928,
12655,
29889,
299,
2378,
6943,
8500,
943,
363,
6724,
29889,
960,
6213,
29892,
1243,
13,
9651,
19435,
674,
451,
367,
15712,
29889,
13109,
29901,
6213,
13,
1678,
343,
29918,
1688,
29901,
29871,
29896,
29928,
12655,
29889,
299,
2378,
6943,
2933,
363,
6724,
29889,
960,
6213,
29892,
1243,
13,
9651,
19435,
674,
451,
367,
15712,
29889,
13109,
29901,
6213,
13,
1678,
26654,
29901,
2522,
8253,
740,
1304,
297,
11657,
7974,
15633,
29889,
13109,
338,
525,
29888,
29896,
4286,
1152,
599,
13,
9651,
24496,
29892,
3113,
1423,
5106,
310,
11657,
7974,
15633,
29889,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
18761,
29901,
313,
13318,
1904,
29892,
1900,
4128,
29892,
28186,
383,
29896,
8158,
29892,
4321,
383,
29896,
8158,
29892,
4321,
13600,
29892,
16316,
28186,
19435,
29892,
16316,
4321,
19435,
29892,
14679,
29918,
2922,
11669,
29897,
13,
308,
13,
1678,
1222,
9422,
13,
1678,
448,
26589,
13,
1678,
8653,
24947,
15501,
29918,
29873,
27964,
29918,
392,
29918,
12276,
29898,
3403,
4695,
4597,
23881,
3285,
13,
462,
462,
4706,
11117,
2238,
18745,
2396,
6024,
29880,
29896,
742,
525,
29880,
29906,
7464,
525,
29907,
2396,
518,
29900,
29889,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29900,
29962,
1118,
13,
462,
462,
4706,
1060,
29918,
14968,
29892,
343,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
1688,
29897,
13,
1678,
313,
3403,
4695,
4597,
23881,
29898,
29907,
29922,
29896,
29900,
29892,
770,
29918,
7915,
29922,
8516,
29892,
14581,
29922,
8824,
29892,
6216,
29918,
1639,
1547,
29922,
5574,
29892,
13,
462,
1678,
23404,
29918,
19529,
292,
29922,
29896,
29892,
301,
29896,
29918,
3605,
601,
29922,
8516,
29892,
4236,
29918,
1524,
29922,
29896,
29900,
29900,
29892,
13,
462,
1678,
2473,
29918,
1990,
2433,
6921,
742,
302,
29918,
9057,
29879,
29922,
8516,
29892,
27368,
2433,
29880,
29906,
742,
13,
462,
1678,
4036,
29918,
3859,
29922,
8516,
29892,
899,
369,
2433,
29880,
1635,
3174,
742,
304,
29880,
29922,
29900,
29889,
29900,
29900,
29900,
29896,
29892,
26952,
29922,
29900,
29892,
13,
462,
1678,
14294,
29918,
2962,
29922,
8824,
511,
13,
268,
11117,
29907,
2396,
29871,
29896,
29900,
29892,
525,
2238,
18745,
2396,
525,
29880,
29906,
16675,
13,
418,
29900,
29889,
29946,
29941,
29906,
29900,
29929,
29896,
29929,
29946,
29900,
29946,
29896,
29946,
29946,
29896,
29906,
29929,
29953,
29892,
13,
418,
29900,
29889,
29941,
29955,
29955,
29953,
29906,
29906,
29941,
29955,
29955,
29953,
29906,
29906,
29941,
29955,
29955,
29953,
29892,
13,
418,
29900,
29889,
29929,
29900,
29896,
29953,
29945,
29955,
29946,
29945,
29947,
29945,
29953,
29941,
29945,
29941,
29953,
29892,
13,
268,
1409,
4197,
539,
23432,
29892,
29871,
29900,
29889,
29941,
29955,
29906,
29896,
29955,
29906,
29945,
29941,
29892,
4706,
23432,
29892,
29871,
29900,
29889,
29946,
29946,
29947,
29941,
29947,
29947,
29953,
29947,
29892,
4706,
23432,
29892,
13,
632,
29900,
29889,
29946,
29945,
29906,
29929,
29906,
29946,
29900,
29896,
11724,
13,
268,
1409,
4197,
539,
23432,
29892,
29871,
29900,
29889,
29941,
29946,
29946,
29896,
29941,
29941,
29945,
29955,
29892,
4706,
23432,
29892,
29871,
29900,
29889,
29946,
29906,
29945,
29947,
29945,
29929,
29896,
29896,
29892,
4706,
23432,
29892,
13,
632,
29900,
29889,
29946,
29941,
29906,
29900,
29929,
29896,
29929,
29946,
12622,
13,
1678,
9995,
13,
1678,
396,
10987,
278,
1900,
1904,
13,
1678,
1018,
29901,
13,
4706,
6856,
29918,
4478,
353,
11657,
7974,
15633,
29898,
1990,
3709,
29892,
4128,
29892,
302,
29918,
9057,
29879,
10457,
29896,
29892,
26654,
29922,
1557,
8253,
29892,
736,
29918,
14968,
29918,
13628,
29922,
5574,
29897,
13,
4706,
6856,
29918,
4478,
29889,
9202,
29898,
29990,
29892,
343,
29897,
13,
1678,
5174,
7865,
2392,
29901,
13,
4706,
1209,
13,
268,
13,
1678,
1243,
29918,
29888,
29896,
353,
6213,
13,
1678,
1243,
29918,
562,
2764,
4135,
353,
6213,
13,
13,
1678,
343,
29918,
14968,
29918,
11965,
353,
6856,
29918,
4478,
29889,
27711,
29898,
29990,
29897,
13,
1678,
7945,
29918,
12276,
353,
12965,
29918,
12276,
29898,
29891,
29892,
343,
29918,
14968,
29918,
11965,
29892,
1962,
29918,
8977,
29922,
5574,
29897,
13,
13,
1678,
396,
4321,
1900,
1904,
373,
1243,
731,
322,
7738,
12965,
3461,
13,
1678,
565,
1060,
29918,
1688,
338,
451,
6213,
322,
343,
29918,
1688,
338,
451,
6213,
29901,
13,
4706,
343,
29918,
1688,
29918,
11965,
353,
6856,
29918,
4478,
29889,
27711,
29898,
29990,
29918,
1688,
29897,
13,
4706,
3461,
353,
12965,
29918,
12276,
29898,
29891,
29918,
1688,
29892,
343,
29918,
1688,
29918,
11965,
29892,
1962,
29918,
8977,
29922,
5574,
29897,
13,
4706,
1243,
29918,
29888,
29896,
353,
1678,
3461,
1839,
29896,
29889,
29900,
16215,
29888,
29896,
29899,
13628,
7464,
29871,
13,
4706,
1243,
29918,
562,
2764,
4135,
353,
1678,
3461,
1839,
562,
2764,
4135,
7464,
29871,
13,
4706,
7477,
353,
14679,
29918,
5344,
29898,
29891,
29918,
1688,
29892,
343,
29918,
1688,
29918,
11965,
29897,
13,
13,
1678,
396,
7106,
6514,
338,
4100,
13,
1678,
736,
313,
7720,
29918,
4478,
29889,
13318,
29918,
342,
326,
1061,
3383,
29871,
13,
9651,
6856,
29918,
4478,
29889,
13318,
29918,
7529,
3383,
29871,
13,
9651,
7945,
29918,
12276,
1839,
29896,
29889,
29900,
16215,
29888,
29896,
29899,
13628,
7464,
29871,
13,
9651,
1243,
29918,
29888,
29896,
29892,
13,
9651,
1243,
29918,
562,
2764,
4135,
29892,
13,
9651,
6856,
29918,
4478,
29889,
11023,
29918,
9902,
29918,
1839,
12676,
29918,
14968,
29918,
13628,
7464,
29871,
13,
9651,
6856,
29918,
4478,
29889,
11023,
29918,
9902,
29918,
1839,
12676,
29918,
1688,
29918,
13628,
7464,
13,
9651,
7477,
29897,
13,
13,
1753,
4078,
29918,
5527,
3958,
29918,
5344,
29898,
4299,
29918,
7039,
29892,
274,
1516,
29892,
4078,
29918,
2084,
1125,
13,
1678,
9995,
13,
1678,
6760,
1078,
322,
27401,
14679,
4636,
13994,
6943,
599,
4733,
13,
1678,
5276,
297,
278,
1881,
7049,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
1904,
29918,
7039,
29901,
1409,
6943,
2983,
310,
278,
4733,
9528,
13,
1678,
274,
3844,
29901,
14679,
13516,
278,
4733,
16370,
13,
1678,
4078,
29918,
2084,
29901,
851,
6445,
278,
934,
2084,
29892,
988,
278,
4377,
881,
367,
7160,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
6213,
13,
1678,
9995,
13,
1678,
2537,
29892,
27815,
353,
14770,
29889,
1491,
26762,
29898,
29876,
5727,
29922,
29906,
29892,
302,
22724,
29922,
29906,
29892,
2537,
2311,
7607,
29896,
29953,
29892,
29871,
29896,
29900,
876,
13,
13,
1678,
313,
1165,
29896,
29892,
4853,
29906,
511,
313,
1165,
29941,
29892,
4853,
29946,
29897,
353,
27815,
13,
13,
1678,
28730,
353,
2391,
287,
1625,
555,
481,
4197,
29961,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
1402,
518,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
1402,
518,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
1402,
518,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
24960,
13,
13,
1678,
527,
29896,
353,
4853,
29896,
29889,
2922,
4294,
29898,
29883,
1516,
29961,
29900,
1402,
274,
1958,
29922,
22724,
29897,
13,
1678,
527,
29906,
353,
4853,
29906,
29889,
2922,
4294,
29898,
29883,
1516,
29961,
29896,
1402,
274,
1958,
29922,
22724,
29897,
13,
1678,
527,
29941,
353,
4853,
29941,
29889,
2922,
4294,
29898,
29883,
1516,
29961,
29906,
1402,
274,
1958,
29922,
22724,
29897,
13,
1678,
527,
29946,
353,
4853,
29946,
29889,
2922,
4294,
29898,
29883,
1516,
29961,
29941,
1402,
274,
1958,
29922,
22724,
29897,
13,
13,
1678,
4853,
353,
313,
1165,
29896,
29892,
4853,
29906,
29892,
4853,
29941,
29892,
4853,
29946,
29897,
13,
13,
1678,
363,
474,
29892,
1904,
29918,
978,
297,
26985,
29898,
4299,
29918,
7039,
1125,
13,
13,
4706,
363,
343,
297,
3464,
29898,
29883,
1516,
29961,
29875,
1822,
12181,
29961,
29900,
29962,
1125,
13,
9651,
363,
921,
297,
3464,
29898,
29883,
1516,
29961,
29875,
1822,
12181,
29961,
29896,
29962,
1125,
13,
18884,
4853,
29961,
29875,
1822,
726,
29898,
29916,
29892,
343,
29892,
285,
29915,
29912,
29883,
1516,
29961,
29875,
3816,
29891,
29892,
921,
12258,
742,
13,
462,
308,
14698,
2520,
358,
2433,
5064,
742,
13,
462,
308,
11408,
2520,
358,
2433,
5064,
742,
13,
462,
308,
4079,
8977,
353,
11117,
2311,
2396,
29871,
29896,
29953,
29892,
525,
7915,
2396,
525,
8934,
10827,
13,
462,
308,
1723,
13,
18884,
4853,
29961,
29875,
1822,
842,
29918,
486,
860,
21134,
18959,
742,
525,
23084,
18186,
29871,
29900,
742,
525,
23084,
18186,
29871,
29896,
11287,
13,
18884,
4853,
29961,
29875,
1822,
842,
29918,
3637,
860,
21134,
18959,
742,
525,
2865,
950,
29871,
29900,
742,
525,
2865,
950,
29871,
29896,
11287,
13,
13,
4706,
4853,
29961,
29875,
1822,
3257,
29889,
842,
29918,
726,
29898,
29888,
29915,
16376,
3958,
4636,
310,
426,
4299,
29918,
978,
29913,
1495,
13,
1678,
396,
363,
343,
297,
3464,
29898,
29874,
29889,
12181,
29961,
29900,
29962,
1125,
13,
1678,
396,
268,
363,
921,
297,
3464,
29898,
29874,
29889,
12181,
29961,
29896,
29962,
1125,
13,
1678,
396,
308,
4853,
29906,
29889,
726,
29898,
29916,
29892,
343,
29892,
14210,
29889,
29946,
29888,
29915,
1273,
263,
29961,
29891,
29892,
921,
1402,
13,
1678,
396,
462,
29871,
14698,
2520,
358,
2433,
5064,
742,
13,
1678,
396,
462,
29871,
11408,
2520,
358,
2433,
5064,
742,
13,
1678,
396,
462,
29871,
1723,
13,
1678,
396,
3986,
13,
1678,
396,
363,
343,
297,
3464,
29898,
29874,
29889,
12181,
29961,
29900,
29962,
1125,
13,
1678,
396,
268,
363,
921,
297,
3464,
29898,
29874,
29889,
12181,
29961,
29896,
29962,
1125,
13,
1678,
396,
308,
4853,
29941,
29889,
726,
29898,
29916,
29892,
343,
29892,
14210,
29889,
29946,
29888,
29915,
1273,
263,
29961,
29891,
29892,
921,
1402,
13,
1678,
396,
462,
29871,
14698,
2520,
358,
2433,
5064,
742,
13,
1678,
396,
462,
29871,
11408,
2520,
358,
2433,
5064,
742,
13,
1678,
396,
462,
29871,
1723,
13,
13,
1678,
396,
363,
343,
297,
3464,
29898,
29874,
29889,
12181,
29961,
29900,
29962,
1125,
13,
1678,
396,
268,
363,
921,
297,
3464,
29898,
29874,
29889,
12181,
29961,
29896,
29962,
1125,
13,
1678,
396,
308,
4853,
29946,
29889,
726,
29898,
29916,
29892,
343,
29892,
14210,
29889,
29946,
29888,
29915,
1273,
263,
29961,
29891,
29892,
921,
1402,
13,
1678,
396,
462,
29871,
14698,
2520,
358,
2433,
5064,
742,
13,
1678,
396,
462,
29871,
11408,
2520,
358,
2433,
5064,
742,
13,
1678,
396,
462,
29871,
1723,
13,
13,
1678,
396,
1904,
29918,
978,
353,
525,
7340,
29915,
13,
1678,
396,
3986,
13,
1678,
396,
4853,
29896,
29889,
3257,
29889,
842,
29918,
726,
29898,
29888,
29915,
5527,
3958,
4636,
310,
426,
4299,
29918,
978,
29913,
1495,
13,
1678,
396,
4853,
29906,
29889,
3257,
29889,
842,
29918,
726,
29898,
29888,
29915,
5527,
3958,
4636,
310,
426,
4299,
29918,
978,
29913,
1495,
13,
1678,
396,
4853,
29941,
29889,
3257,
29889,
842,
29918,
726,
29898,
29888,
29915,
5527,
3958,
4636,
310,
426,
4299,
29918,
978,
29913,
1495,
13,
1678,
396,
4853,
29946,
29889,
3257,
29889,
842,
29918,
726,
29898,
29888,
29915,
5527,
3958,
4636,
310,
426,
4299,
29918,
978,
29913,
1495,
308,
13,
13,
1678,
1423,
29918,
1445,
2084,
29898,
7620,
29918,
2084,
29889,
2288,
2830,
11219,
742,
29871,
29896,
9601,
29900,
2314,
13,
13,
1678,
2537,
29889,
7620,
1003,
29898,
7620,
29918,
2084,
29897,
13,
13,
1753,
5706,
29918,
7638,
29918,
392,
29918,
4532,
29918,
276,
4011,
29898,
2749,
29892,
11799,
29918,
1445,
2084,
29892,
4377,
29918,
1445,
2084,
1125,
13,
1678,
9995,
13,
1678,
3251,
1078,
11799,
3461,
515,
278,
2582,
7625,
515,
11266,
15501,
18515,
292,
29889,
13,
13,
1678,
11221,
278,
1409,
310,
2582,
310,
11266,
15501,
29918,
29873,
27964,
29918,
392,
29918,
12276,
363,
1422,
13,
1678,
4733,
29892,
16785,
11799,
934,
322,
27401,
297,
278,
2183,
2224,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
3948,
29901,
29871,
29896,
29928,
1409,
6943,
263,
18761,
4133,
515,
11266,
15501,
29918,
29873,
27964,
29918,
392,
29918,
12276,
470,
13,
4706,
7945,
29918,
19920,
29890,
580,
740,
29889,
13,
1678,
11799,
29918,
1445,
2084,
29901,
851,
6943,
2224,
988,
278,
3461,
881,
367,
7160,
29889,
13,
1678,
4377,
29918,
1445,
2084,
29901,
851,
6943,
2224,
988,
278,
4377,
3461,
881,
367,
7160,
29889,
10575,
505,
6081,
869,
2732,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
6213,
13,
13,
1678,
8695,
29901,
13,
1678,
3529,
367,
1854,
393,
3948,
338,
1409,
310,
5291,
2701,
29889,
13,
1678,
9995,
13,
1678,
2983,
353,
5159,
13,
1678,
1900,
29918,
7529,
353,
5159,
13,
1678,
7945,
29918,
29888,
29896,
29879,
353,
5159,
13,
1678,
1243,
29918,
29888,
29896,
29879,
353,
5159,
13,
1678,
1243,
29918,
5753,
2002,
2478,
353,
5159,
13,
13,
1678,
7945,
29918,
13628,
29918,
9902,
353,
5159,
13,
1678,
1243,
29918,
13628,
29918,
9902,
353,
5159,
13,
1678,
8158,
29918,
690,
29918,
7039,
353,
5159,
13,
13,
1678,
274,
1516,
353,
5159,
13,
13,
1678,
396,
402,
1624,
292,
2983,
310,
278,
4733,
322,
916,
2472,
13,
1678,
363,
1904,
297,
260,
29939,
18933,
29898,
2749,
1125,
13,
4706,
2983,
29889,
4397,
29898,
4299,
29961,
29900,
1822,
1649,
1990,
1649,
17255,
978,
1649,
29897,
13,
4706,
1900,
29918,
7529,
29889,
4397,
29898,
4299,
29961,
29896,
2314,
13,
4706,
7945,
29918,
29888,
29896,
29879,
29889,
4397,
29898,
4299,
29961,
29906,
2314,
13,
4706,
1243,
29918,
29888,
29896,
29879,
29889,
4397,
29898,
4299,
29961,
29941,
2314,
13,
4706,
1243,
29918,
5753,
2002,
2478,
29889,
4397,
29898,
4299,
29961,
29946,
2314,
13,
4706,
274,
1516,
29889,
4397,
29898,
4299,
29961,
29955,
1822,
579,
668,
29898,
524,
876,
13,
268,
13,
4706,
565,
1904,
29961,
29900,
1822,
1649,
1990,
1649,
17255,
978,
1649,
2804,
525,
8431,
15664,
2396,
13,
9651,
7945,
29918,
13628,
29918,
9902,
29889,
21843,
29898,
4299,
29961,
29945,
2314,
13,
9651,
1243,
29918,
13628,
29918,
9902,
29889,
21843,
29898,
4299,
29961,
29953,
2314,
13,
9651,
8158,
29918,
690,
29918,
7039,
29889,
21843,
4197,
4299,
29961,
29900,
1822,
1649,
1990,
1649,
17255,
978,
1649,
14178,
2435,
29898,
4299,
29961,
29945,
12622,
13,
13,
1678,
396,
26221,
12205,
515,
278,
2582,
13,
1678,
11799,
29918,
12276,
353,
10518,
29889,
17271,
3319,
29915,
3195,
1024,
2396,
2983,
29892,
13,
462,
1669,
525,
25353,
4128,
2396,
1900,
29918,
7529,
29892,
13,
462,
795,
525,
5323,
262,
383,
29896,
2396,
7945,
29918,
29888,
29896,
29879,
29892,
13,
462,
795,
525,
3057,
383,
29896,
2396,
1243,
29918,
29888,
29896,
29879,
29892,
13,
462,
795,
525,
3057,
1035,
2002,
2478,
2396,
1243,
29918,
5753,
2002,
2478,
29892,
13,
462,
795,
525,
16376,
3958,
4636,
2396,
274,
1516,
1800,
13,
268,
13,
1678,
396,
26221,
12205,
515,
278,
2582,
363,
4377,
12623,
13,
1678,
4377,
29918,
12276,
353,
10518,
29889,
17271,
3319,
29915,
9794,
2396,
8158,
29918,
690,
29918,
7039,
29892,
13,
462,
462,
525,
14968,
29918,
1557,
2361,
2396,
7945,
29918,
13628,
29918,
9902,
29892,
13,
462,
462,
525,
1688,
29918,
1557,
2361,
2396,
1243,
29918,
13628,
29918,
9902,
1800,
13,
13,
1678,
396,
5399,
363,
1863,
749,
310,
263,
934,
2084,
13,
1678,
1423,
29918,
1445,
2084,
29898,
7638,
29918,
1445,
2084,
29889,
2288,
2830,
11219,
742,
29871,
29896,
9601,
29900,
2314,
13,
1678,
1423,
29918,
1445,
2084,
29898,
4532,
29918,
1445,
2084,
29889,
2288,
2830,
11219,
742,
29871,
29896,
9601,
29900,
2314,
13,
13,
1678,
396,
317,
5555,
278,
3461,
13,
1678,
11799,
29918,
12276,
29889,
517,
29918,
7638,
29898,
7638,
29918,
1445,
2084,
29897,
13,
13,
1678,
396,
317,
5555,
4377,
13,
1678,
5272,
29889,
14732,
29898,
4532,
29918,
12276,
467,
3502,
29918,
16622,
29898,
2311,
29922,
29896,
29900,
29900,
467,
12508,
29898,
13,
4706,
921,
353,
5272,
29889,
29990,
877,
1688,
29918,
1557,
2361,
742,
13,
9651,
9685,
353,
5272,
29889,
16070,
29898,
3257,
2433,
29907,
2124,
29899,
1440,
4321,
383,
29896,
8158,
5477,
13,
9651,
6287,
353,
5272,
29889,
17185,
29898,
7247,
353,
313,
29900,
1696,
29871,
29896,
29889,
876,
511,
13,
4706,
343,
353,
5272,
29889,
29979,
877,
14968,
29918,
1557,
2361,
742,
13,
9651,
9685,
353,
5272,
29889,
16070,
29898,
3257,
2433,
29907,
2124,
29899,
1440,
28186,
383,
29896,
8158,
5477,
13,
9651,
6287,
353,
5272,
29889,
17185,
29898,
7247,
7607,
29900,
1696,
29871,
29896,
29889,
876,
511,
13,
4706,
2927,
353,
525,
9794,
2824,
11330,
29898,
13,
4706,
3611,
353,
525,
5323,
262,
322,
4321,
19435,
310,
599,
3519,
9528,
2824,
29905,
13,
1678,
10822,
29918,
8990,
29898,
13,
4706,
3858,
9824,
3505,
29922,
29896,
29945,
29892,
13,
4706,
3611,
9824,
3505,
29922,
29896,
29945,
13,
1678,
13742,
29905,
13,
1678,
10822,
29918,
26172,
29898,
1643,
9824,
3505,
353,
29871,
29896,
29945,
29892,
13,
462,
268,
3611,
9824,
3505,
29922,
29896,
29945,
467,
29905,
13,
1678,
10822,
29918,
3257,
29898,
5657,
3505,
29922,
29906,
29900,
467,
29905,
13,
1678,
4078,
29898,
4532,
29918,
1445,
2084,
29897,
13,
1678,
396,
317,
5555,
14679,
4636,
13,
1678,
4078,
29918,
5527,
3958,
29918,
5344,
29898,
7039,
29892,
274,
1516,
29892,
19283,
276,
4011,
29914,
5527,
3958,
29918,
5344,
29889,
2732,
1495,
13,
13,
13,
1753,
1303,
29918,
1272,
29918,
392,
29918,
5451,
29898,
14968,
29918,
7638,
29918,
2084,
353,
525,
6995,
1272,
29914,
14941,
29914,
9157,
29918,
14968,
29889,
7638,
742,
13,
462,
4706,
1243,
29918,
7638,
29918,
2084,
353,
525,
6995,
1272,
29914,
14941,
29914,
9157,
29918,
1688,
29889,
7638,
29374,
13,
1678,
9995,
13,
1678,
7523,
29879,
278,
848,
515,
278,
2183,
10898,
322,
3639,
8500,
943,
322,
2933,
13,
1678,
3651,
16949,
363,
7945,
322,
1243,
6166,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
7945,
29918,
7638,
29918,
2084,
29901,
851,
6943,
278,
2224,
310,
7945,
11799,
29889,
13109,
29901,
525,
6995,
1272,
29914,
14941,
29914,
9157,
29918,
14968,
29889,
7638,
29915,
13,
1678,
1243,
29918,
7638,
29918,
2084,
29901,
851,
6943,
278,
2224,
310,
1243,
11799,
29889,
13109,
29901,
525,
6995,
1272,
29914,
14941,
29914,
9157,
29918,
1688,
29889,
7638,
29915,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
18761,
29901,
313,
29990,
29918,
14968,
29892,
343,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
1688,
29897,
13,
1678,
9995,
13,
1678,
1018,
29901,
13,
4706,
7945,
29918,
6289,
353,
10518,
29889,
949,
29918,
7638,
29898,
14968,
29918,
7638,
29918,
2084,
29897,
13,
4706,
1243,
29918,
6289,
353,
10518,
29889,
949,
29918,
7638,
29898,
1688,
29918,
7638,
29918,
2084,
29897,
13,
1678,
5174,
313,
2283,
17413,
2392,
29897,
408,
321,
29901,
13,
4706,
1596,
877,
12148,
1423,
7945,
322,
1243,
934,
24772,
1495,
13,
4706,
12020,
29898,
29872,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
1060,
29918,
14968,
29892,
343,
29918,
14968,
353,
7945,
29918,
6289,
29889,
8865,
877,
29891,
29918,
3582,
742,
9685,
29922,
29896,
511,
7945,
29918,
6289,
1839,
29891,
29918,
3582,
2033,
13,
4706,
1060,
29918,
1688,
29892,
343,
29918,
1688,
353,
1243,
29918,
6289,
29889,
8865,
877,
29891,
29918,
3582,
742,
9685,
29922,
29896,
511,
1243,
29918,
6289,
1839,
29891,
29918,
3582,
2033,
13,
1678,
5174,
7670,
2392,
29901,
13,
4706,
1596,
877,
12521,
14214,
11799,
2066,
29889,
3529,
1423,
278,
4341,
1495,
13,
4706,
12020,
7670,
2392,
13,
13,
1678,
736,
1060,
29918,
14968,
29892,
343,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
1688,
13,
13,
1753,
1667,
29898,
14968,
29918,
7638,
29892,
1243,
29918,
7638,
29892,
1962,
29918,
7638,
29892,
1962,
29918,
2732,
1125,
13,
1678,
1018,
29901,
13,
4706,
1060,
29918,
14968,
29892,
343,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
1688,
353,
1303,
29918,
1272,
29918,
392,
29918,
5451,
29898,
14968,
29918,
7638,
29892,
1243,
29918,
7638,
29897,
13,
1678,
5174,
29901,
13,
4706,
736,
13,
13,
1678,
396,
22402,
4733,
393,
881,
367,
4502,
304,
11266,
15501,
18515,
292,
13,
1678,
4733,
353,
518,
3403,
4695,
4597,
23881,
29898,
1990,
29918,
7915,
353,
525,
5521,
8362,
742,
4036,
29918,
3859,
29922,
29946,
29906,
511,
13,
632,
317,
8257,
29898,
1990,
29918,
7915,
353,
525,
5521,
8362,
742,
4036,
29918,
3859,
29922,
29946,
29906,
511,
13,
632,
16968,
2831,
342,
2385,
3709,
29898,
1990,
29918,
7915,
353,
525,
5521,
8362,
742,
4036,
29918,
3859,
29922,
29946,
29906,
29897,
13,
632,
4514,
13,
795,
13,
13,
1678,
396,
22402,
4128,
393,
881,
367,
9528,
363,
1269,
310,
278,
4733,
29889,
29871,
13,
1678,
396,
3940,
29901,
1522,
1854,
393,
16285,
310,
4733,
322,
967,
4128,
3928,
29889,
13,
1678,
396,
3940,
29906,
29901,
7806,
1904,
881,
505,
777,
2854,
9657,
1848,
719,
6942,
411,
372,
29889,
13,
1678,
4128,
353,
518,
13,
9651,
518,
10998,
2929,
369,
2396,
6024,
29879,
7781,
742,
525,
1982,
10660,
7464,
525,
2238,
18745,
2396,
6024,
29880,
29896,
742,
525,
29880,
29906,
7464,
525,
29907,
2396,
518,
29900,
29889,
29900,
29896,
29892,
29871,
29900,
29889,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29900,
29962,
1118,
13,
632,
11117,
2929,
369,
2396,
6024,
29880,
1635,
3174,
742,
525,
1482,
880,
29899,
29883,
29887,
742,
525,
29879,
351,
7464,
525,
2238,
18745,
2396,
6024,
29880,
29906,
7464,
525,
29907,
2396,
518,
29900,
29889,
29900,
29896,
29892,
29871,
29900,
29889,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29900,
12258,
1402,
13,
9651,
518,
10998,
29907,
2396,
518,
29900,
29889,
29900,
29896,
29892,
29871,
29900,
29889,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29900,
1402,
525,
17460,
2396,
6024,
29878,
1635,
2033,
1118,
13,
632,
11117,
29907,
2396,
518,
29900,
29889,
29900,
29896,
29892,
29871,
29900,
29889,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29900,
1402,
525,
17460,
2396,
6024,
22678,
7464,
525,
12163,
929,
2396,
518,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
12258,
1402,
13,
9651,
11117,
29876,
29918,
342,
326,
4097,
2396,
518,
29906,
29945,
29892,
29871,
29945,
29900,
29892,
29871,
29955,
29945,
1402,
525,
3317,
29918,
19488,
2396,
518,
8516,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29906,
1402,
525,
29883,
5385,
291,
2396,
6024,
29887,
2172,
742,
525,
296,
14441,
2033,
29913,
13,
1678,
4514,
13,
13,
1678,
565,
7431,
29898,
9794,
29897,
2804,
7431,
29898,
16744,
1125,
13,
4706,
1596,
877,
5596,
4733,
322,
6590,
4128,
29889,
7806,
1904,
881,
505,
263,
8600,
310,
4128,
304,
1243,
29889,
1495,
13,
4706,
736,
13,
13,
1678,
396,
27313,
292,
11266,
15501,
18515,
292,
322,
2805,
13676,
310,
1269,
310,
278,
4733,
13,
1678,
396,
3342,
2038,
13,
1678,
599,
29918,
9902,
353,
5159,
13,
1678,
363,
1904,
29918,
333,
29892,
1904,
297,
26985,
29898,
29873,
29939,
18933,
29898,
9794,
22164,
13,
4706,
1904,
29918,
7529,
353,
4128,
29961,
4299,
29918,
333,
29962,
13,
4706,
620,
353,
11266,
15501,
29918,
29873,
27964,
29918,
392,
29918,
12276,
29898,
4299,
29892,
1904,
29918,
7529,
29892,
1060,
29918,
14968,
29892,
343,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
1688,
29897,
13,
4706,
599,
29918,
9902,
29889,
4397,
29898,
690,
29897,
13,
13,
1678,
396,
26101,
12790,
7210,
29924,
1904,
322,
623,
2548,
2582,
304,
916,
2582,
13,
1678,
301,
26300,
29918,
4299,
29918,
690,
353,
7945,
29918,
19920,
29890,
29898,
29990,
29918,
14968,
29892,
343,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
1688,
29897,
13,
1678,
599,
29918,
9902,
29889,
4397,
29898,
19920,
29890,
29918,
4299,
29918,
690,
29897,
13,
13,
1678,
396,
3251,
1218,
322,
14238,
1904,
2582,
13,
1678,
5706,
29918,
7638,
29918,
392,
29918,
4532,
29918,
276,
4011,
29898,
497,
29918,
9902,
29892,
1962,
29918,
7638,
29892,
1962,
29918,
2732,
29897,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
3523,
353,
437,
1111,
415,
22168,
1514,
1649,
29897,
13,
1678,
1667,
29898,
3670,
3366,
489,
14968,
29918,
7638,
12436,
3523,
3366,
489,
1688,
29918,
7638,
12436,
3523,
3366,
489,
4905,
29918,
7638,
12436,
3523,
3366,
489,
4905,
29918,
2732,
20068,
13,
2
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.